/*! For license information please see 883.351e03bc8b137e3ddbd8.js.LICENSE.txt */
(globalThis.webpackChunk_rio_rio_ui=globalThis.webpackChunk_rio_rio_ui||[]).push([[883],{32055(e,t,i){"use strict";i.d(t,{j:()=>mr});var s=i(15567),r=i(51718),n=i(410),o=i(78953),a=new s.C("ClientDevice_Browser");var l,c,h,d,u,p,g,m,f,y,v,C,b,S,w,x,E,M,A,T,D,I,R,P,k,L,N,_,O,F,G,B,V,H,U,z,W,j,K,$,Y,q,X,Z,Q,J,ee,te,ie,se,re,ne,oe,ae,le,ce,he,de,ue,pe,ge,me,fe,ye,ve,Ce,be,Se,we,xe,Ee,Me,Ae,Te,De,Ie,Re,Pe,ke,Le,Ne,_e,Oe,Fe,Ge,Be,Ve,He,Ue,ze,We,je,Ke,$e,Ye,qe,Xe,Ze,Qe,Je,et,tt,it,st,rt,nt,ot,at,lt,ct,ht,dt,ut,pt,gt,mt,ft,yt,vt,Ct,bt,St,wt,xt,Et,Mt,At,Tt,Dt,It,Rt,Pt=function(){function e(){}return e.clientInfo=function(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return a.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return a.warn("No navigator object available to get browser client info"),{};var t,i=e.platform,s=e.product,r=e.vendor,n=e.userAgent,o=e.language,l=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var i=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};var s=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(s)return{type:s[1],version:s[2]};var r=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var n=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var o=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);return o?{type:o[1],version:o[2]}:{type:"",version:""}}(n),c=(t=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()))&&t[1]||"";return{platform:i,make:s||r,model:l.type,version:l.version,appVersion:[l.type,l.version].join("/"),language:o,timezone:c}}()},e.dimension=function(){return"undefined"==typeof window?(a.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}(),kt=i(56059),Lt=i(81504),Nt=i(71481),_t={clockOffset:0,getDateWithClockOffset:function(){return _t.clockOffset?new Date((new Date).getTime()+_t.clockOffset):new Date},getClockOffset:function(){return _t.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=_t.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),i=t[1],s=t[2],r=t[3],n=t[4],o=t[5],a=t[6];return new Date(Date.UTC(Number(i),Number(s)-1,Number(r),Number(n),Number(o),Number(a)))},isClockSkewed:function(e){return Math.abs(e.getTime()-_t.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){_t.clockOffset=e}},Ot=function(){return Ot=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ot.apply(this,arguments)},Ft=new s.C("Signer"),Gt="AWS4-HMAC-SHA256",Bt=function(e,t){var i=new kt.Sha256(e);return i.update(t),i.digestSync()},Vt=function(e){var t=e||"",i=new kt.Sha256;return i.update(t),(0,Lt.n)(i.digestSync())},Ht=function(e){return Object.keys(e).map(function(e){return e.toLowerCase()}).sort().join(";")},Ut=function(e){var t,i,s=(0,Nt.parse)(e.url);return[e.method||"/",encodeURIComponent(s.pathname).replace(/%2F/gi,"/"),(i=s.query,i&&0!==i.length?i.split("&").map(function(e){var t=e.split("=");if(1===t.length)return e;var i=t[1].replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});return t[0]+"="+i}).sort(function(e,t){var i=e.split("=")[0],s=t.split("=")[0];return i===s?e<t?-1:1:i<s?-1:1}).join("&"):""),(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map(function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}}).sort(function(e,t){return e.key<t.key?-1:1}).map(function(e){return e.key+":"+e.value}).join("\n")+"\n":""),Ht(e.headers),Vt(e.data)].join("\n")},zt=function(e){var t=((0,Nt.parse)(e.url).host.match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}},Wt=function(e,t,i){return[e,t,i,"aws4_request"].join("/")},jt=function(e,t,i,s){return[e,i,s,Vt(t)].join("\n")},Kt=function(e,t,i){Ft.debug(i);var s=Bt("AWS4"+e,t),r=Bt(s,i.region),n=Bt(r,i.service);return Bt(n,"aws4_request")},$t=function(e,t){return(0,Lt.n)(Bt(e,t))},Yt=function(){function e(){}return e.sign=function(e,t,i){if(void 0===i&&(i=null),e.headers=e.headers||{},e.body&&!e.data)throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');var s=_t.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),r=s.substr(0,8),n=(0,Nt.parse)(e.url);e.headers.host=n.host,e.headers["x-amz-date"]=s,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var o=Ut(e);Ft.debug(o);var a=i||zt(e),l=Wt(r,a.region,a.service),c=jt(Gt,o,s,l),h=Kt(t.secret_key,r,a),d=$t(h,c),u=function(e,t,i,s,r){return[e+" Credential="+t+"/"+i,"SignedHeaders="+s,"Signature="+r].join(", ")}(Gt,t.access_key,l,Ht(e.headers),d);return e.headers.Authorization=u,e},e.signUrl=function(e,t,i,s){var r="object"==typeof e?e.url:e,n="object"==typeof e?e.method:"GET",o="object"==typeof e?e.body:void 0,a=_t.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),l=a.substr(0,8),c=(0,Nt.parse)(r,!0,!0),h=(c.search,function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i}(c,["search"])),d={host:h.host},u=i||zt({url:(0,Nt.format)(h)}),p=u.region,g=u.service,m=Wt(l,p,g),f=t.session_token&&"iotdevicegateway"!==g,y=Ot(Ot(Ot({"X-Amz-Algorithm":Gt,"X-Amz-Credential":[t.access_key,m].join("/"),"X-Amz-Date":a.substr(0,16)},f?{"X-Amz-Security-Token":""+t.session_token}:{}),s?{"X-Amz-Expires":""+s}:{}),{"X-Amz-SignedHeaders":Object.keys(d).join(",")}),v=Ut({method:n,url:(0,Nt.format)(Ot(Ot({},h),{query:Ot(Ot({},h.query),y)})),headers:d,data:o}),C=jt(Gt,v,a,m),b=Kt(t.secret_key,l,{region:p,service:g}),S=$t(b,C),w=Ot({"X-Amz-Signature":S},t.session_token&&{"X-Amz-Security-Token":t.session_token});return(0,Nt.format)({protocol:h.protocol,slashes:!0,hostname:h.hostname,port:h.port,pathname:h.pathname,query:Ot(Ot(Ot({},h.query),y),w)})},e}(),qt=i(51678),Xt=i(41547),Zt=i(11351),Qt=i(65959);!function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(l||(l={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(c||(c={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(h||(h={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(d||(d={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(u||(u={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(p||(p={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(g||(g={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(m||(m={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(f||(f={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(y||(y={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(v||(v={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(C||(C={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(b||(b={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(S||(S={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(w||(w={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(x||(x={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(E||(E={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(M||(M={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(A||(A={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(T||(T={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(D||(D={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(I||(I={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(R||(R={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(P||(P={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(k||(k={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(L||(L={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(N||(N={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(_||(_={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(O||(O={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(F||(F={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(G||(G={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(B||(B={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(V||(V={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(H||(H={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(U||(U={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(z||(z={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(W||(W={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(j||(j={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(K||(K={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}($||($={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Y||(Y={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(q||(q={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(X||(X={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Z||(Z={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Q||(Q={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(J||(J={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ee||(ee={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(te||(te={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ie||(ie={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(se||(se={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(re||(re={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ne||(ne={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(oe||(oe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ae||(ae={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(le||(le={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ce||(ce={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(he||(he={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(de||(de={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ue||(ue={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(pe||(pe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ge||(ge={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(me||(me={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(fe||(fe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ye||(ye={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ve||(ve={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ce||(Ce={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(be||(be={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Se||(Se={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(we||(we={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(xe||(xe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ee||(Ee={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Me||(Me={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ae||(Ae={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Te||(Te={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(De||(De={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ie||(Ie={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Re||(Re={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Pe||(Pe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ke||(ke={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Le||(Le={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ne||(Ne={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(_e||(_e={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Oe||(Oe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Fe||(Fe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ge||(Ge={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Be||(Be={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ve||(Ve={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(He||(He={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ue||(Ue={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ze||(ze={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(We||(We={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(je||(je={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ke||(Ke={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}($e||($e={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ye||(Ye={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(qe||(qe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Xe||(Xe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ze||(Ze={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Qe||(Qe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Je||(Je={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(et||(et={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(tt||(tt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(it||(it={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(st||(st={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(rt||(rt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(nt||(nt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ot||(ot={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(at||(at={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(lt||(lt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ct||(ct={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ht||(ht={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(dt||(dt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ut||(ut={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(pt||(pt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(gt||(gt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(mt||(mt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ft||(ft={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(yt||(yt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(vt||(vt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ct||(Ct={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(bt||(bt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(St||(St={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(wt||(wt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(xt||(xt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Et||(Et={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Mt||(Mt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(At||(At={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Tt||(Tt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Dt||(Dt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(It||(It={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Rt||(Rt={}));var Jt=i(59027),ei=i(11538),ti=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h,d,u,p,g,m;return(0,Qt.__generator)(this,function(f){switch(f.label){case 0:return s=[(0,Qt.__assign)({},e)],m={},[4,Ei(e.body,t)];case 1:switch(i=Qt.__assign.apply(void 0,s.concat([(m.body=f.sent(),m)])),n="UnknownError",n=Mi(e,i.body)){case"BadRequestException":case"com.amazonaws.pinpoint#BadRequestException":return[3,2];case"ForbiddenException":case"com.amazonaws.pinpoint#ForbiddenException":return[3,4];case"InternalServerErrorException":case"com.amazonaws.pinpoint#InternalServerErrorException":return[3,6];case"MethodNotAllowedException":case"com.amazonaws.pinpoint#MethodNotAllowedException":return[3,8];case"NotFoundException":case"com.amazonaws.pinpoint#NotFoundException":return[3,10];case"PayloadTooLargeException":case"com.amazonaws.pinpoint#PayloadTooLargeException":return[3,12];case"TooManyRequestsException":case"com.amazonaws.pinpoint#TooManyRequestsException":return[3,14]}return[3,16];case 2:return o=[{}],[4,si(i,t)];case 3:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,o.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 4:return a=[{}],[4,ri(i,t)];case 5:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,a.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 6:return l=[{}],[4,ni(i,t)];case 7:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,l.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 8:return c=[{}],[4,oi(i,t)];case 9:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,c.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 10:return h=[{}],[4,ai(i,t)];case 11:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,h.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 12:return d=[{}],[4,li(i,t)];case 13:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,d.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 14:return u=[{}],[4,ci(i,t)];case 15:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,u.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 16:p=i.body,n=p.code||p.Code||n,r=(0,Qt.__assign)((0,Qt.__assign)({},p),{name:""+n,message:p.message||p.Message||n,$fault:"client",$metadata:xi(e)}),f.label=17;case 17:return g=r.message||r.Message||n,r.message=g,delete r.Message,[2,Promise.reject(Object.assign(new Error(g),r))]}})})},ii=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h,d,u,p,g,m;return(0,Qt.__generator)(this,function(f){switch(f.label){case 0:return s=[(0,Qt.__assign)({},e)],m={},[4,Ei(e.body,t)];case 1:switch(i=Qt.__assign.apply(void 0,s.concat([(m.body=f.sent(),m)])),n="UnknownError",n=Mi(e,i.body)){case"BadRequestException":case"com.amazonaws.pinpoint#BadRequestException":return[3,2];case"ForbiddenException":case"com.amazonaws.pinpoint#ForbiddenException":return[3,4];case"InternalServerErrorException":case"com.amazonaws.pinpoint#InternalServerErrorException":return[3,6];case"MethodNotAllowedException":case"com.amazonaws.pinpoint#MethodNotAllowedException":return[3,8];case"NotFoundException":case"com.amazonaws.pinpoint#NotFoundException":return[3,10];case"PayloadTooLargeException":case"com.amazonaws.pinpoint#PayloadTooLargeException":return[3,12];case"TooManyRequestsException":case"com.amazonaws.pinpoint#TooManyRequestsException":return[3,14]}return[3,16];case 2:return o=[{}],[4,si(i,t)];case 3:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,o.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 4:return a=[{}],[4,ri(i,t)];case 5:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,a.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 6:return l=[{}],[4,ni(i,t)];case 7:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,l.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 8:return c=[{}],[4,oi(i,t)];case 9:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,c.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 10:return h=[{}],[4,ai(i,t)];case 11:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,h.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 12:return d=[{}],[4,li(i,t)];case 13:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,d.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 14:return u=[{}],[4,ci(i,t)];case 15:return r=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,u.concat([f.sent()])),{name:n,$metadata:xi(e)}]),[3,17];case 16:p=i.body,n=p.code||p.Code||n,r=(0,Qt.__assign)((0,Qt.__assign)({},p),{name:""+n,message:p.message||p.Message||n,$fault:"client",$metadata:xi(e)}),f.label=17;case 17:return g=r.message||r.Message||n,r.message=g,delete r.Message,[2,Promise.reject(Object.assign(new Error(g),r))]}})})},si=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"BadRequestException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ri=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"ForbiddenException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ni=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"InternalServerErrorException",$fault:"server",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},oi=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"MethodNotAllowedException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ai=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"NotFoundException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},li=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"PayloadTooLargeException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ci=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(s){return t={name:"TooManyRequestsException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},hi=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.AppVersion&&null!==e.AppVersion&&{AppVersion:e.AppVersion}),void 0!==e.Locale&&null!==e.Locale&&{Locale:e.Locale}),void 0!==e.Make&&null!==e.Make&&{Make:e.Make}),void 0!==e.Model&&null!==e.Model&&{Model:e.Model}),void 0!==e.ModelVersion&&null!==e.ModelVersion&&{ModelVersion:e.ModelVersion}),void 0!==e.Platform&&null!==e.Platform&&{Platform:e.Platform}),void 0!==e.PlatformVersion&&null!==e.PlatformVersion&&{PlatformVersion:e.PlatformVersion}),void 0!==e.Timezone&&null!==e.Timezone&&{Timezone:e.Timezone})},di=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.City&&null!==e.City&&{City:e.City}),void 0!==e.Country&&null!==e.Country&&{Country:e.Country}),void 0!==e.Latitude&&null!==e.Latitude&&{Latitude:e.Latitude}),void 0!==e.Longitude&&null!==e.Longitude&&{Longitude:e.Longitude}),void 0!==e.PostalCode&&null!==e.PostalCode&&{PostalCode:e.PostalCode}),void 0!==e.Region&&null!==e.Region&&{Region:e.Region})},ui=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.UserAttributes&&null!==e.UserAttributes&&{UserAttributes:yi(e.UserAttributes,t)}),void 0!==e.UserId&&null!==e.UserId&&{UserId:e.UserId})},pi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,s=(0,Qt.__read)(t,2),r=s[0],n=s[1];return null===n?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[r]=n,i))},{})},gi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,s=(0,Qt.__read)(t,2),r=s[0],n=s[1];return null===n?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[r]=n,i))},{})},mi=function(e,t){return Object.entries(e).reduce(function(e,i){var s,r=(0,Qt.__read)(i,2),n=r[0],o=r[1];return null===o?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((s={})[n]=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.AppPackageName&&null!==e.AppPackageName&&{AppPackageName:e.AppPackageName}),void 0!==e.AppTitle&&null!==e.AppTitle&&{AppTitle:e.AppTitle}),void 0!==e.AppVersionCode&&null!==e.AppVersionCode&&{AppVersionCode:e.AppVersionCode}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:gi(e.Attributes)}),void 0!==e.ClientSdkVersion&&null!==e.ClientSdkVersion&&{ClientSdkVersion:e.ClientSdkVersion}),void 0!==e.EventType&&null!==e.EventType&&{EventType:e.EventType}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:pi(e.Metrics,t)}),void 0!==e.SdkName&&null!==e.SdkName&&{SdkName:e.SdkName}),void 0!==e.Session&&null!==e.Session&&{Session:Ci(e.Session,t)}),void 0!==e.Timestamp&&null!==e.Timestamp&&{Timestamp:e.Timestamp})}(o,t),s))},{})},fi=function(e,t){return Object.entries(e).reduce(function(e,i){var s,r=(0,Qt.__read)(i,2),n=r[0],o=r[1];return null===o?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((s={})[n]=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Endpoint&&null!==e.Endpoint&&{Endpoint:vi(e.Endpoint,t)}),void 0!==e.Events&&null!==e.Events&&{Events:mi(e.Events,t)})}(o,t),s))},{})},yi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,s=(0,Qt.__read)(t,2),r=s[0],n=s[1];return null===n?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[r]=function(e){return e.filter(function(e){return null!=e}).map(function(e){return null===e?null:e})}(n),i))},{})},vi=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Address&&null!==e.Address&&{Address:e.Address}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:yi(e.Attributes,t)}),void 0!==e.ChannelType&&null!==e.ChannelType&&{ChannelType:e.ChannelType}),void 0!==e.Demographic&&null!==e.Demographic&&{Demographic:hi(e.Demographic)}),void 0!==e.EffectiveDate&&null!==e.EffectiveDate&&{EffectiveDate:e.EffectiveDate}),void 0!==e.EndpointStatus&&null!==e.EndpointStatus&&{EndpointStatus:e.EndpointStatus}),void 0!==e.Location&&null!==e.Location&&{Location:di(e.Location)}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:pi(e.Metrics,t)}),void 0!==e.OptOut&&null!==e.OptOut&&{OptOut:e.OptOut}),void 0!==e.RequestId&&null!==e.RequestId&&{RequestId:e.RequestId}),void 0!==e.User&&null!==e.User&&{User:ui(e.User,t)})},Ci=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Duration&&null!==e.Duration&&{Duration:e.Duration}),void 0!==e.Id&&null!==e.Id&&{Id:e.Id}),void 0!==e.StartTimestamp&&null!==e.StartTimestamp&&{StartTimestamp:e.StartTimestamp}),void 0!==e.StopTimestamp&&null!==e.StopTimestamp&&{StopTimestamp:e.StopTimestamp})},bi=function(e,t){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,StatusCode:void 0!==e.StatusCode&&null!==e.StatusCode?e.StatusCode:void 0}},Si=function(e,t){return Object.entries(e).reduce(function(e,t){var i,s=(0,Qt.__read)(t,2),r=s[0],n=s[1];return null===n?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[r]=function(e){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,StatusCode:void 0!==e.StatusCode&&null!==e.StatusCode?e.StatusCode:void 0}}(n),i))},{})},wi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,s=(0,Qt.__read)(t,2),r=s[0],n=s[1];return null===n?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[r]=function(e){return{EndpointItemResponse:void 0!==e.EndpointItemResponse&&null!==e.EndpointItemResponse?bi(e.EndpointItemResponse):void 0,EventsItemResponse:void 0!==e.EventsItemResponse&&null!==e.EventsItemResponse?Si(e.EventsItemResponse):void 0}}(n),i))},{})},xi=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Ei=function(e,t){return function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then(function(e){return t.utf8Encoder(e)})}(e,t).then(function(e){return e.length?JSON.parse(e):{}})},Mi=function(e,t){var i,s=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(i=e.headers,Object.keys(i).find(function(e){return e.toLowerCase()==="x-amzn-errortype".toLowerCase()}));return void 0!==r?s(e.headers[r]):void 0!==t.code?s(t.code):void 0!==t.__type?s(t.__type):""},Ai=i(74052),Ti=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,Qt.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,Ai.TM)(t,this.serialize,this.deserialize));var s=e.concat(this.middlewareStack),r={logger:t.logger,clientName:"PinpointClient",commandName:"PutEventsCommand",inputFilterSensitiveLog:ve.filterSensitiveLog,outputFilterSensitiveLog:Ce.filterSensitiveLog},n=t.requestHandler;return s.resolve(function(e){return n.handle(e.request,i||{})},r)},t.prototype.serialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h;return(0,Qt.__generator)(this,function(d){switch(d.label){case 0:if(i={"content-type":"application/json"},s="/v1/apps/{ApplicationId}/events",void 0===e.ApplicationId)throw new Error("No value provided for input HTTP label: ApplicationId.");if((r=e.ApplicationId).length<=0)throw new Error("Empty value provided for input HTTP label: ApplicationId.");return s=s.replace("{ApplicationId}",(0,ei.$6)(r)),void 0!==e.EventsRequest&&(n=function(e,t){return(0,Qt.__assign)({},void 0!==e.BatchItem&&null!==e.BatchItem&&{BatchItem:fi(e.BatchItem,t)})}(e.EventsRequest,t)),void 0===n&&(n={}),n=JSON.stringify(n),[4,t.endpoint()];case 1:return o=d.sent(),a=o.hostname,l=o.protocol,c=void 0===l?"https":l,h=o.port,[2,new Jt.Kd({protocol:c,hostname:a,port:h,method:"POST",headers:i,path:s,body:n})]}})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,Qt.__generator)(this,function(r){switch(r.label){case 0:return 202!==e.statusCode&&e.statusCode>=300?[2,ti(e,t)]:(i={$metadata:xi(e),EventsResponse:void 0},[4,Ei(e.body,t)]);case 1:return s=r.sent(),i.EventsResponse=function(e,t){return{Results:void 0!==e.Results&&null!==e.Results?wi(e.Results,t):void 0}}(s,t),[2,Promise.resolve(i)]}})})}(e,t)},t}(ei.uB),Di=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,Qt.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,Ai.TM)(t,this.serialize,this.deserialize));var s=e.concat(this.middlewareStack),r={logger:t.logger,clientName:"PinpointClient",commandName:"UpdateEndpointCommand",inputFilterSensitiveLog:tt.filterSensitiveLog,outputFilterSensitiveLog:it.filterSensitiveLog},n=t.requestHandler;return s.resolve(function(e){return n.handle(e.request,i||{})},r)},t.prototype.serialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h;return(0,Qt.__generator)(this,function(d){switch(d.label){case 0:if(i={"content-type":"application/json"},s="/v1/apps/{ApplicationId}/endpoints/{EndpointId}",void 0===e.ApplicationId)throw new Error("No value provided for input HTTP label: ApplicationId.");if((r=e.ApplicationId).length<=0)throw new Error("Empty value provided for input HTTP label: ApplicationId.");if(s=s.replace("{ApplicationId}",(0,ei.$6)(r)),void 0===e.EndpointId)throw new Error("No value provided for input HTTP label: EndpointId.");if((r=e.EndpointId).length<=0)throw new Error("Empty value provided for input HTTP label: EndpointId.");return s=s.replace("{EndpointId}",(0,ei.$6)(r)),void 0!==e.EndpointRequest&&(n=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Address&&null!==e.Address&&{Address:e.Address}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:yi(e.Attributes,t)}),void 0!==e.ChannelType&&null!==e.ChannelType&&{ChannelType:e.ChannelType}),void 0!==e.Demographic&&null!==e.Demographic&&{Demographic:hi(e.Demographic)}),void 0!==e.EffectiveDate&&null!==e.EffectiveDate&&{EffectiveDate:e.EffectiveDate}),void 0!==e.EndpointStatus&&null!==e.EndpointStatus&&{EndpointStatus:e.EndpointStatus}),void 0!==e.Location&&null!==e.Location&&{Location:di(e.Location)}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:pi(e.Metrics,t)}),void 0!==e.OptOut&&null!==e.OptOut&&{OptOut:e.OptOut}),void 0!==e.RequestId&&null!==e.RequestId&&{RequestId:e.RequestId}),void 0!==e.User&&null!==e.User&&{User:ui(e.User,t)})}(e.EndpointRequest,t)),void 0===n&&(n={}),n=JSON.stringify(n),[4,t.endpoint()];case 1:return o=d.sent(),a=o.hostname,l=o.protocol,c=void 0===l?"https":l,h=o.port,[2,new Jt.Kd({protocol:c,hostname:a,port:h,method:"PUT",headers:i,path:s,body:n})]}})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,Qt.__generator)(this,function(r){switch(r.label){case 0:return 202!==e.statusCode&&e.statusCode>=300?[2,ii(e,t)]:(i={$metadata:xi(e),MessageBody:void 0},[4,Ei(e.body,t)]);case 1:return s=r.sent(),i.MessageBody=function(e){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,RequestID:void 0!==e.RequestID&&null!==e.RequestID?e.RequestID:void 0}}(s),[2,Promise.resolve(i)]}})})}(e,t)},t}(ei.uB),Ii=i(54218),Ri=i(22292),Pi=i(10078),ki=i(16307),Li=i(68380),Ni=i(93972),_i=i(39448),Oi=i(31643),Fi="pinpoint.{region}.amazonaws.com",Gi=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Bi=new Set(["cn-north-1","cn-northwest-1"]),Vi=new Set(["us-iso-east-1"]),Hi=new Set(["us-isob-east-1"]),Ui=new Set(["us-gov-east-1","us-gov-west-1"]),zi={apiVersion:"2016-12-01",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var i=void 0;switch(e){case"ap-northeast-1":i={hostname:"pinpoint.ap-northeast-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-northeast-2":i={hostname:"pinpoint.ap-northeast-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-south-1":i={hostname:"pinpoint.ap-south-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-southeast-1":i={hostname:"pinpoint.ap-southeast-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-southeast-2":i={hostname:"pinpoint.ap-southeast-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ca-central-1":i={hostname:"pinpoint.ca-central-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-central-1":i={hostname:"pinpoint.eu-central-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-west-1":i={hostname:"pinpoint.eu-west-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-west-2":i={hostname:"pinpoint.eu-west-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"fips-us-east-1":i={hostname:"pinpoint-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-gov-west-1":i={hostname:"pinpoint-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":i={hostname:"pinpoint-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"us-east-1":i={hostname:"pinpoint.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"us-gov-west-1":i={hostname:"pinpoint.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-west-2":i={hostname:"pinpoint.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;default:Gi.has(e)&&(i={hostname:Fi.replace("{region}",e),partition:"aws",signingService:"mobiletargeting"}),Bi.has(e)&&(i={hostname:"pinpoint.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Vi.has(e)&&(i={hostname:"pinpoint.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Hi.has(e)&&(i={hostname:"pinpoint.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Ui.has(e)&&(i={hostname:"pinpoint.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov",signingService:"mobiletargeting"}),void 0===i&&(i={hostname:Fi.replace("{region}",e),partition:"aws",signingService:"mobiletargeting"})}return Promise.resolve((0,Qt.__assign)({signingService:"mobiletargeting"},i))},serviceId:"Pinpoint",urlParser:i(2049).D},Wi=(0,Qt.__assign)((0,Qt.__assign)({},zi),{runtime:"browser",base64Decoder:Li.E,base64Encoder:Li.n,bodyLengthChecker:Ni.n,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:(0,_i.m)({serviceId:zi.serviceId,clientVersion:"3.6.1"}),maxAttempts:ki.Gz,region:(0,Pi.B)("Region is missing"),requestHandler:new Ri.N,sha256:Ii.Sha256,streamCollector:Ri.k,utf8Decoder:Oi.fromUtf8,utf8Encoder:Oi.toUtf8}),ji=i(85775),Ki=i(23788),$i=i(14188),Yi=i(64996),qi=i(88428),Xi=i(44625),Zi=function(e){function t(t){var i=this,s=(0,Qt.__assign)((0,Qt.__assign)({},Wi),t),r=(0,ji.TD)(s),n=(0,ji.vJ)(r),o=(0,qi.k9)(n),a=(0,ki.$z)(o),l=(0,$i.OV)(a),c=(0,Xi.Dc)(l);return(i=e.call(this,c)||this).config=c,i.middlewareStack.use((0,qi.DF)(i.config)),i.middlewareStack.use((0,ki.ey)(i.config)),i.middlewareStack.use((0,Ki.vK)(i.config)),i.middlewareStack.use((0,$i.TC)(i.config)),i.middlewareStack.use((0,Yi.Y7)(i.config)),i.middlewareStack.use((0,Xi.sM)(i.config)),i}return(0,Qt.__extends)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(ei.Kj),Qi={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(i(75315).i1)).getStorage()};function Ji(e){var t=0;t=e.length;for(var i=e.length;i>=0;i-=1){var s=e.charCodeAt(i);s>127&&s<=2047?t+=1:s>2047&&s<=65535&&(t+=2),s>=56320&&s<=57343&&(i-=1)}return t}function es(){return(new Date).getTime()}function ts(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var is,ss={},rs=(function(){function e(){}e.clear=function(){ss={}},e.getItem=function(e){return ss[e]||null},e.setItem=function(e,t){ss[e]=t},e.removeItem=function(e){delete ss[e]}}(),new s.C("StorageCache")),ns=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){ts(this.config.capacityInBytes)||(rs.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=Qi.capacityInBytes),ts(this.config.itemMaxSize)||(rs.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=Qi.itemMaxSize),ts(this.config.defaultTTL)||(rs.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=Qi.defaultTTL),ts(this.config.defaultPriority)||(rs.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=Qi.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(rs.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=Qi.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(rs.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=Qi.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(rs.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=Qi.warningThreshold),this.config.capacityInBytes>5242880&&(rs.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=Qi.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,i){var s={key:e,data:t,timestamp:es(),visitedTime:es(),priority:i.priority,expires:i.expires,type:typeof t,byteSize:0};return s.byteSize=Ji(JSON.stringify(s)),s.byteSize=Ji(JSON.stringify(s)),s},e.prototype.configure=function(e){return e?(e.keyPrefix&&rs.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}(),os=(is=function(e,t){return is=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},is(e,t)},function(e,t){function i(){this.constructor=e}is(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),as=new s.C("Cache"),ls=new(function(e){function t(t){var i=this,s=t?Object.assign({},Qi,t):Qi;return(i=e.call(this,s)||this).config.storage=s.storage,i.getItem=i.getItem.bind(i),i.setItem=i.setItem.bind(i),i.removeItem=i.removeItem.bind(i),i}return os(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=es(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),i=JSON.parse(t);return es()>=i.expires},t.prototype._removeItem=function(e,t){var i=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(i),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(e){this._decreaseCurSizeInBytes(t.byteSize),as.error("Failed to set item "+e)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,i=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>i?t:i},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],i=0;i<this.config.storage.length;i+=1)t.push(this.config.storage.key(i));for(i=0;i<t.length;i+=1){var s=t[i];0===s.indexOf(this.config.keyPrefix)&&s!==this.cacheCurSizeKey&&(this._isExpired(s)?this._removeItem(s):e.push(s))}return e},t.prototype._popOutItems=function(e,t){for(var i=[],s=t,r=0;r<e.length;r+=1){var n=this.config.storage.getItem(e[r]);if(null!=n){var o=JSON.parse(n);i.push(o)}}for(i.sort(function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1}),r=0;r<i.length;r+=1)if(this._removeItem(i[r].key,i[r].byteSize),(s-=i[r].byteSize)<=0)return},t.prototype.setItem=function(e,t,i){as.log("Set item: key is "+e+", value is "+t+" with options: "+i);var s=this.config.keyPrefix+e;if(s!==this.config.keyPrefix&&s!==this.cacheCurSizeKey)if(void 0!==t){var r={priority:i&&void 0!==i.priority?i.priority:this.config.defaultPriority,expires:i&&void 0!==i.expires?i.expires:this.config.defaultTTL+es()};if(r.priority<1||r.priority>5)as.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var n=this.fillCacheItem(s,t,r);if(n.byteSize>this.config.itemMaxSize)as.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var o=this.config.storage.getItem(s);if(o&&this._removeItem(s,JSON.parse(o).byteSize),this._isCacheFull(n.byteSize)){var a=this._findValidKeys();if(this._isCacheFull(n.byteSize)){var l=this._sizeToPop(n.byteSize);this._popOutItems(a,l)}}this._setItem(s,n)}catch(e){as.warn("setItem failed! "+e)}}}else as.warn("The value of item should not be undefined!");else as.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){as.log("Get item: key is "+e+" with options "+t);var i=null,s=this.config.keyPrefix+e;if(s===this.config.keyPrefix||s===this.cacheCurSizeKey)return as.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(i=this.config.storage.getItem(s))){if(!this._isExpired(s)){var r=JSON.parse(i);return(r=this._refreshItem(r,s)).data}this._removeItem(s,JSON.parse(i).byteSize),i=null}if(t&&void 0!==t.callback){var n=t.callback();return null!==n&&this.setItem(e,n,t),n}return null}catch(e){return as.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){as.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var i=this.config.storage.getItem(t);i&&this._removeItem(t,JSON.parse(i).byteSize)}catch(e){as.warn("removeItem failed! "+e)}},t.prototype.clear=function(){as.log("Clear Cache");for(var e=[],t=0;t<this.config.storage.length;t+=1){var i=this.config.storage.key(t);0===i.indexOf(this.config.keyPrefix)&&e.push(i)}try{for(t=0;t<e.length;t+=1)this.config.storage.removeItem(e[t])}catch(e){as.warn("clear failed! "+e)}},t.prototype.getAllKeys=function(){for(var e=[],t=0;t<this.config.storage.length;t+=1){var i=this.config.storage.key(t);0===i.indexOf(this.config.keyPrefix)&&i!==this.cacheCurSizeKey&&e.push(i.substring(this.config.keyPrefix.length))}return e},t.prototype.getCacheCurSize=function(){var e=this.config.storage.getItem(this.cacheCurSizeKey);return e||(this.config.storage.setItem(this.cacheCurSizeKey,"0"),e="0"),Number(e)},t.prototype.createInstance=function(e){return e.keyPrefix&&e.keyPrefix!==Qi.keyPrefix||(as.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=es.toString()),new t(e)},t}(ns));const cs=ls;o.HA.register(ls);var hs=i(16699),ds=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},us=new s.C("EventsBuffer"),ps=[429,500],gs=[202];const ms=function(){function e(e,t){this._pause=!1,this._flush=!1,us.debug("Instantiating buffer with config:",t),this._buffer=[],this._client=e,this._config=t,this._sendBatch=this._sendBatch.bind(this),this._startLoop()}return e.prototype.push=function(e){var t;if(this._buffer.length>=this._config.bufferSize)return us.debug("Exceeded analytics events buffer size"),e.handlers.reject(new Error("Exceeded the size of analytics events buffer"));var i=((t={})[e.params.event.eventId]=e,t);this._buffer.push(i)},e.prototype.pause=function(){this._pause=!0},e.prototype.resume=function(){this._pause=!1},e.prototype.updateClient=function(e){this._client=e},e.prototype.flush=function(){this._flush=!0},e.prototype._startLoop=function(){this._interval&&clearInterval(this._interval);var e=this._config.flushInterval;this._interval=setInterval(this._sendBatch,e)},e.prototype._sendBatch=function(){var e=this._buffer.length;if(this._flush&&!e&&clearInterval(this._interval),!this._pause&&e){var t=this._config.flushSize,i=Math.min(t,e),s=this._buffer.splice(0,i);this._putEvents(s)}},e.prototype._putEvents=function(e){return t=this,i=void 0,r=function(){var t,i,s,r,n;return function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}(this,function(o){switch(o.label){case 0:t=this._bufferToMap(e),i=this._generateBatchEventParams(t),o.label=1;case 1:return o.trys.push([1,3,,4]),s=new Ti(i),[4,this._client.send(s)];case 2:return r=o.sent(),this._processPutEventsSuccessResponse(r,t),[3,4];case 3:return n=o.sent(),[2,this._handlePutEventsFailure(n,t)];case 4:return[2]}})},new((s=void 0)||(s=Promise))(function(e,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s(function(e){e(i)})).then(o,a)}l((r=r.apply(t,i||[])).next())});var t,i,s,r},e.prototype._generateBatchEventParams=function(e){var t={ApplicationId:"",EventsRequest:{BatchItem:{}}};return Object.values(e).forEach(function(e){var i=e.params,s=i.event,r=i.timestamp,n=i.config,o=s.name,a=s.attributes,l=s.metrics,c=s.eventId,h=s.session,d=n.appId,u=n.endpointId,p=t.EventsRequest.BatchItem;t.ApplicationId=t.ApplicationId||d,p[u]||(p[u]={Endpoint:{},Events:{}}),p[u].Events[c]={EventType:o,Timestamp:new Date(r).toISOString(),Attributes:a,Metrics:l,Session:h}}),t},e.prototype._handlePutEventsFailure=function(e,t){us.debug("_putEvents Failed: ",e);var i=e.$metadata&&e.$metadata.httpStatusCode;if(ps.includes(i)){var s=Object.values(t);this._retry(s)}},e.prototype._processPutEventsSuccessResponse=function(e,t){var i=e.EventsResponse.Results,s=[];Object.entries(i).forEach(function(e){var i=ds(e,2),r=i[0],n=i[1].EventsItemResponse;Object.entries(n).forEach(function(e){var i,n,o=ds(e,2),a=o[0],l=o[1],c=l.StatusCode,h=l.Message,d=t[a],u={EventsResponse:{Results:(i={},i[r]={EventsItemResponse:(n={},n[a]={StatusCode:c,Message:h},n)},i)}};if(gs.includes(c))d.handlers.resolve(u);else{if(!ps.includes(c)){var p=d.params.event.name;return us.error("event "+a+" : "+p+" failed with error: "+h),d.handlers.reject(u)}s.push(d)}})}),s.length&&this._retry(s)},e.prototype._retry=function(e){var t,i=[];e.forEach(function(e){var t,s=e.params,r=s.event,n=r.eventId,o=r.name;if(s.resendLimit-- >0)return us.debug("resending event "+n+" : "+o+" with "+s.resendLimit+" retry attempts remaining"),void i.push((t={},t[n]=e,t));us.debug("no retry attempts remaining for event "+n+" : "+o)}),(t=this._buffer).unshift.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ds(arguments[t]));return e}(i))},e.prototype._bufferToMap=function(e){return e.reduce(function(e,t){var i=ds(Object.entries(t),1),s=ds(i[0],2),r=s[0],n=s[1];return e[r]=n,e},{})},e}();var fs=function(){return fs=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},fs.apply(this,arguments)},ys=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},vs=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},Cs=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i},bs="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ss=function(e,t){r.YZ.dispatch("analytics",{event:e,data:t},"Analytics",bs)},ws=new s.C("AWSPinpointProvider"),xs=[429,500],Es=[202],Ms="_update_endpoint",As="_session.stop",Ts="undefined"!=typeof navigator&&navigator&&"function"==typeof navigator.sendBeacon,Ds=function(){function e(e){this._endpointGenerating=!0,this._endpointUpdateInProgress=!1,this._buffer=null,this._endpointBuffer=[],this._config=e||{},this._config.bufferSize=this._config.bufferSize||1e3,this._config.flushSize=this._config.flushSize||100,this._config.flushInterval=this._config.flushInterval||5e3,this._config.resendLimit=this._config.resendLimit||5,this._clientInfo=Pt.clientInfo()}return e.prototype.getCategory=function(){return e.category},e.prototype.getProviderName=function(){return e.providerName},e.prototype.configure=function(e){var t=this;ws.debug("configure Analytics",e);var i=e||{};if(this._config=Object.assign({},this._config,i),this._endpointGenerating=!!e.autoSessionRecord,this._config.appId&&!this._config.disabled)if(this._config.endpointId)Ss("pinpointProvider_configured",null);else{var s=this.getProviderName()+"_"+this._config.appId;this._getEndpointId(s).then(function(e){ws.debug("setting endpoint id from the cache",e),t._config.endpointId=e,Ss("pinpointProvider_configured",null)}).catch(function(e){ws.debug("Failed to generate endpointId",e)})}else this._flushBuffer();return this._config},e.prototype.record=function(e,t){return ys(this,void 0,void 0,function(){var i,s;return vs(this,function(r){switch(r.label){case 0:return ws.debug("_public record",e),[4,this._getCredentials()];case 1:return(i=r.sent())&&this._config.appId&&this._config.region?(this._initClients(i),s=(new Date).getTime(),this._generateSession(e),e.event.eventId=(0,hs.v1)(),Object.assign(e,{timestamp:s,config:this._config}),e.event.immediate?[2,this._send(e,t)]:(this._putToBuffer(e,t),[2])):(ws.debug("cannot send events without credentials, applicationId or region"),[2,t.reject(new Error("No credentials, applicationId or region"))])}})})},e.prototype._sendEndpointUpdate=function(e){return ys(this,void 0,void 0,function(){var t;return vs(this,function(i){switch(i.label){case 0:return this._endpointUpdateInProgress?(this._endpointBuffer.push(e),[2]):(this._endpointUpdateInProgress=!0,[4,this._updateEndpoint(e)]);case 1:return i.sent(),t=this._endpointBuffer.shift(),this._endpointUpdateInProgress=!1,t&&this._sendEndpointUpdate(t),[2]}})})},e.prototype._putToBuffer=function(e,t){e.event.name!==Ms?this._buffer&&this._buffer.push({params:e,handlers:t}):this._sendEndpointUpdate({params:e,handlers:t})},e.prototype._generateSession=function(e){this._sessionId=this._sessionId||(0,hs.v1)();var t=e.event;switch(t.name){case"_session.start":this._sessionStartTimestamp=(new Date).getTime(),this._sessionId=(0,hs.v1)(),t.session={Id:this._sessionId,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString()};break;case As:var i=(new Date).getTime();this._sessionStartTimestamp=this._sessionStartTimestamp||(new Date).getTime(),this._sessionId=this._sessionId||(0,hs.v1)(),t.session={Id:this._sessionId,Duration:i-this._sessionStartTimestamp,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString(),StopTimestamp:new Date(i).toISOString()},this._sessionId=void 0,this._sessionStartTimestamp=void 0;break;default:this._sessionStartTimestamp=this._sessionStartTimestamp||(new Date).getTime(),this._sessionId=this._sessionId||(0,hs.v1)(),t.session={Id:this._sessionId,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString()}}},e.prototype._send=function(e,t){return ys(this,void 0,void 0,function(){return vs(this,function(i){switch(e.event.name){case Ms:return[2,this._updateEndpoint({params:e,handlers:t})];case As:return[2,this._pinpointSendStopSession(e,t)];default:return[2,this._pinpointPutEvents(e,t)]}return[2]})})},e.prototype._generateBatchItemContext=function(e){var t,i=e.event,s=e.timestamp,r=e.config,n=i.name,o=i.attributes,a=i.metrics,l=i.eventId,c=i.session,h=r.appId,d=r.endpointId,u={ApplicationId:h,EventsRequest:{BatchItem:{}}},p={Endpoint:{}};return p.Events=((t={})[l]={EventType:n,Timestamp:new Date(s).toISOString(),Attributes:o,Metrics:a,Session:c},t),u.EventsRequest.BatchItem[d]=p,u},e.prototype._pinpointPutEvents=function(e,t){return ys(this,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h,d,u;return vs(this,function(p){switch(p.label){case 0:i=e.event.eventId,s=e.config.endpointId,r=this._generateBatchItemContext(e),n=new Ti(r),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.pinpointClient.send(n)];case 2:return o=p.sent(),a=s,l=i,c=o.EventsResponse.Results[a].EventsItemResponse[l],h=c.StatusCode,d=c.Message,Es.includes(h)?(ws.debug("record event success. ",o),[2,t.resolve(o)]):xs.includes(h)?(this._retry(e,t),[3,4]):(ws.error("Event "+i+" is not accepted, the error is "+d),[2,t.reject(o)]);case 3:return u=p.sent(),this._eventError(u),[2,t.reject(u)];case 4:return[2]}})})},e.prototype._pinpointSendStopSession=function(e,t){if(Ts){var i=this._generateBatchItemContext(e),s=this._config.region,r=i.ApplicationId,n=i.EventsRequest,o={secret_key:this._config.credentials.secretAccessKey,access_key:this._config.credentials.accessKeyId,session_token:this._config.credentials.sessionToken},a="https://pinpoint."+s+".amazonaws.com/v1/apps/"+r+"/events/legacy",l=JSON.stringify(n),c={url:a,body:l,method:"POST"},h={region:s,service:"mobiletargeting"},d=Yt.signUrl(c,o,h,null);return navigator.sendBeacon(d,l)?t.resolve("sendBeacon success"):t.reject("sendBeacon failure")}this._pinpointPutEvents(e,t)},e.prototype._retry=function(e,t){var i=e.config.resendLimit;e.resendLimit="number"==typeof e.resendLimit?e.resendLimit:i,e.resendLimit-- >0?(ws.debug("resending event "+e.eventName+" with "+e.resendLimit+" retry times left"),this._pinpointPutEvents(e,t)):ws.debug("retry times used up for event "+e.eventName)},e.prototype._updateEndpoint=function(e){return ys(this,void 0,void 0,function(){var t,i,s,r,n,o,a,l,c,h,d,u;return vs(this,function(p){switch(p.label){case 0:t=e.params,i=e.handlers,s=t.config,r=t.event,n=s.appId,o=s.endpointId,a=this._endpointRequest(s,qt.JS.transferKeyToLowerCase(r,[],["attributes","userAttributes","Attributes","UserAttributes"])),l={ApplicationId:n,EndpointId:o,EndpointRequest:a},p.label=1;case 1:return p.trys.push([1,3,,4]),c=new Di(l),[4,this.pinpointClient.send(c)];case 2:return h=p.sent(),ws.debug("updateEndpoint success",h),this._endpointGenerating=!1,this._resumeBuffer(),i.resolve(h),[2];case 3:return d=p.sent(),u={err:d,update_params:l,endpointObject:e},[2,this._handleEndpointUpdateFailure(u)];case 4:return[2]}})})},e.prototype._handleEndpointUpdateFailure=function(e){return ys(this,void 0,void 0,function(){var t,i,s;return vs(this,function(r){return t=e.err,i=e.endpointObject,s=t.$metadata&&t.$metadata.httpStatusCode,ws.debug("updateEndpoint error",t),403===s?[2,this._handleEndpointUpdateForbidden(e)]:xs.includes(s)?[2,this._retryEndpointUpdate(i,!0)]:(ws.error("updateEndpoint failed",t),i.handlers.reject(t),[2])})})},e.prototype._handleEndpointUpdateForbidden=function(e){var t=e.err,i=e.endpointObject,s=t.code,r=t.retryable;if("ExpiredTokenException"!==s&&!r)return i.handlers.reject(t);this._retryEndpointUpdate(i)},e.prototype._retryEndpointUpdate=function(e,t){void 0===t&&(t=!1),ws.debug("_retryEndpointUpdate",e);var i=e.params,s=i.config.resendLimit;if(i.resendLimit="number"==typeof i.resendLimit?i.resendLimit:s,i.resendLimit-- >0)return ws.debug("resending endpoint update "+i.event.eventId+" with "+i.resendLimit+" retry attempts remaining"),void(this._endpointBuffer.length?this._endpointBuffer.unshift(e):this._updateEndpoint(e));ws.warn("resending endpoint update "+i.event.eventId+" failed after "+i.config.resendLimit+" attempts"),this._endpointGenerating&&ws.error("Initial endpoint update failed. ")},e.prototype._initClients=function(e){return ys(this,void 0,void 0,function(){var t,i;return vs(this,function(s){return ws.debug("init clients"),this.pinpointClient&&this._config.credentials&&this._config.credentials.sessionToken===e.sessionToken&&this._config.credentials.identityId===e.identityId?(ws.debug("no change for aws credentials, directly return from init"),[2]):(t=this._config.credentials?this._config.credentials.identityId:null,this._config.credentials=e,i=this._config.region,ws.debug("init clients with credentials",e),this.pinpointClient=new Zi({region:i,credentials:e,customUserAgent:(0,Xt.fE)()}),this.pinpointClient.middlewareStack.addRelativeTo(function(e){return function(t){return delete t.request.headers["amz-sdk-invocation-id"],delete t.request.headers["amz-sdk-request"],e(t)}},{step:"finalizeRequest",relation:"after",toMiddleware:"retryMiddleware"}),this._bufferExists()&&t===e.identityId?this._updateBufferClient():this._initBuffer(),this._customizePinpointClientReq(),[2])})})},e.prototype._bufferExists=function(){return this._buffer&&this._buffer instanceof ms},e.prototype._initBuffer=function(){this._bufferExists()&&this._flushBuffer(),this._buffer=new ms(this.pinpointClient,this._config),this._endpointGenerating&&this._buffer.pause()},e.prototype._updateBufferClient=function(){this._bufferExists()&&this._buffer.updateClient(this.pinpointClient)},e.prototype._flushBuffer=function(){this._bufferExists()&&(this._buffer.flush(),this._buffer=null)},e.prototype._resumeBuffer=function(){this._bufferExists()&&this._buffer.resume()},e.prototype._customizePinpointClientReq=function(){},e.prototype._getEndpointId=function(e){return ys(this,void 0,void 0,function(){var t,i;return vs(this,function(s){switch(s.label){case 0:return[4,cs.getItem(e)];case 1:return t=s.sent(),ws.debug("endpointId from cache",t,"type",typeof t),t||(t=(0,hs.v1)(),i=(new Date).getTime()+31536e8,cs.setItem(e,t,{expires:i,priority:1})),[2,t]}})})},e.prototype._endpointRequest=function(e,t){var i=e.credentials,s=this._clientInfo||{},r=e.clientContext||{},n=e.endpoint||{},o={appVersion:s.appVersion,make:s.make,model:s.model,modelVersion:s.version,platform:s.platform},a=(r.clientId,r.appTitle,r.appVersionName,r.appVersionCode,r.appPackageName,Cs(r,["clientId","appTitle","appVersionName","appVersionCode","appPackageName"])),l=t.address?"android"===s.platform?"GCM":"APNS":void 0,c=fs(fs(fs({channelType:l,requestId:(0,hs.v1)(),effectiveDate:(new Date).toISOString()},n),t),{attributes:fs(fs({},n.attributes),t.attributes),demographic:fs(fs(fs(fs({},o),a),n.demographic),t.demographic),location:fs(fs({},n.location),t.location),metrics:fs(fs({},n.metrics),t.metrics),user:{userId:t.userId||n.userId||i.identityId,userAttributes:fs(fs({},n.userAttributes),t.userAttributes)}}),h=(c.userId,c.userAttributes,c.name,c.session,c.eventId,c.immediate,Cs(c,["userId","userAttributes","name","session","eventId","immediate"]));return qt.JS.transferKeyToUpperCase(h,[],["metrics","userAttributes","attributes"])},e.prototype._eventError=function(e){ws.error("record event failed.",e),ws.warn('Please ensure you have updated your Pinpoint IAM Policy with the Action: "mobiletargeting:PutEvents" in order to record events')},e.prototype._getCredentials=function(){return ys(this,void 0,void 0,function(){var e,t;return vs(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Zt.Ji.get()];case 1:return(e=i.sent())?(ws.debug("set credentials for analytics",e),[2,Zt.Ji.shear(e)]):[2,null];case 2:return t=i.sent(),ws.debug("ensure credentials error",t),[2,null];case 3:return[2]}})})},e.category="Analytics",e.providerName="AWSPinpoint",e}(),Is=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},Rs=[],Ps=function(){function e(e,t){this.context=e,this.methodName=t,this._originalMethod=e[t].bind(e)}return e.add=function(e,t,i){ks(e,t).set(i)},e.remove=function(e,t){ks(e,t).remove()},e.prototype.set=function(e){var t=this;this.context[this.methodName]=function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return e(t._originalMethod.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Is(arguments[t]));return e}(i)))}},e.prototype.remove=function(){this.context[this.methodName]=this._originalMethod},e}();function ks(e,t){var i=Rs.filter(function(i){return i.context===e&&i.methodName===t})[0];return i||(i=new Ps(e,t),Rs.push(i)),i}var Ls=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},Ns=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},_s=new s.C("PageViewTracker"),Os="aws-amplify-analytics-prevUrl",Fs={enable:!1,provider:"AWSPinpoint",getUrl:function(){return qt.JS.browserOrNode().isBrowser?window.location.origin+window.location.pathname:""}},Gs=function(){function e(e,t){_s.debug("initialize pageview tracker with opts",t),this._config=Object.assign({},Fs,t),this._tracker=e,this._hasEnabled=!1,this._trackFunc=this._trackFunc.bind(this),"SPA"===this._config.type?this._pageViewTrackSPA():this._pageViewTrackDefault()}return e.prototype.configure=function(e){return Object.assign(this._config,e),"SPA"===this._config.type&&this._pageViewTrackSPA(),this._config},e.prototype._isSameUrl=function(){return sessionStorage.getItem(Os)===this._config.getUrl()&&(_s.debug("the url is same"),!0)},e.prototype._pageViewTrackDefault=function(){return Ls(this,void 0,void 0,function(){var e,t,i,s;return Ns(this,function(r){switch(r.label){case 0:return qt.JS.browserOrNode().isBrowser&&window.addEventListener&&window.sessionStorage?(e=this._config.getUrl(),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]):(_s.debug("not in the supported web enviroment"),[2]);case 1:return i=r.sent(),[3,3];case 2:i=this._config.attributes,r.label=3;case 3:return t=i,s=Object.assign({url:e},t),this._config.enable&&!this._isSameUrl()&&(this._tracker({name:this._config.eventName||"pageView",attributes:s},this._config.provider).catch(function(e){_s.debug("Failed to record the page view event",e)}),sessionStorage.setItem(Os,e)),[2]}})})},e.prototype._trackFunc=function(){return Ls(this,void 0,void 0,function(){var e,t,i,s;return Ns(this,function(r){switch(r.label){case 0:return qt.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState&&window.sessionStorage?(e=this._config.getUrl(),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]):(_s.debug("not in the supported web enviroment"),[2]);case 1:return i=r.sent(),[3,3];case 2:i=this._config.attributes,r.label=3;case 3:return t=i,s=Object.assign({url:e},t),this._isSameUrl()||(this._tracker({name:this._config.eventName||"pageView",attributes:s},this._config.provider).catch(function(e){_s.debug("Failed to record the page view event",e)}),sessionStorage.setItem(Os,e)),[2]}})})},e.prototype._pageViewTrackSPA=function(){qt.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState?this._config.enable&&!this._hasEnabled?(Ps.add(history,"pushState",this._trackFunc),Ps.add(history,"replaceState",this._trackFunc),window.addEventListener("popstate",this._trackFunc),this._trackFunc(),this._hasEnabled=!0):(Ps.remove(history,"pushState"),Ps.remove(history,"replaceState"),window.removeEventListener("popstate",this._trackFunc),this._hasEnabled=!1):_s.debug("not in the supported web enviroment")},e}();const Bs=Gs;var Vs=qt.JS.browserOrNode().isBrowser&&window.Element?window.Element.prototype:null,Hs=Vs?Vs.matches||Vs.matchesSelector||Vs.webkitMatchesSelector||Vs.mozMatchesSelector||Vs.msMatchesSelector||Vs.oMatchesSelector:null;function Us(e,t){if(e&&1===e.nodeType&&t){if("string"==typeof t||1===t.nodeType)return e===t||zs(e,t);if("length"in t)for(var i=0,s=void 0;s=t[i];i++)if(e===s||zs(e,s))return!0}return!1}function zs(e,t){if("string"!=typeof t)return!1;if(Hs)return Hs.call(e,t);for(var i=e.parentNode.querySelectorAll(t),s=0,r=void 0;r=i[s];s++)if(r===e)return!0;return!1}var Ws=new s.C("EventTracker"),js={enable:!1,events:["click"],selectorPrefix:"data-amplify-analytics-",provider:"AWSPinpoint"};const Ks=function(){function e(e,t){qt.JS.browserOrNode().isBrowser&&window.addEventListener?(this._config=Object.assign({},js,t),this._tracker=e,this._delegates={},this._trackFunc=this._trackFunc.bind(this),Ws.debug("initialize pageview tracker with opts",this._config),this.configure(this._config)):Ws.debug("not in the supported web environment")}return e.prototype.configure=function(e){var t=this;if(Object.assign(this._config,e),this._config.enable){if(this._config.enable&&0===Object.keys(this._delegates).length){var i="["+this._config.selectorPrefix+"on]";this._config.events.forEach(function(e){t._delegates[e]=function(e,t,i,s,r){void 0===r&&(r={});var n=function(e){var t;if(r.composed&&"function"==typeof e.composedPath)for(var n=e.composedPath(),o=0,a=void 0;a=n[o];o++)1===a.nodeType&&Us(a,i)&&(t=a);else t=function(e,t,i){if(void 0===i&&(i=!1),e&&1===e.nodeType&&t)for(var s,r=(i?[e]:[]).concat(function(e){for(var t=[],i=e;i&&i.parentNode&&1===i.parentNode.nodeType;)i=i.parentNode,t.push(i);return t}(e)),n=0;s=r[n];n++)if(Us(s,t))return s}(e.target,i,!0);t&&s.call(t,e,t)};return e.addEventListener(t,n,r.useCapture),{destroy:function(){e.removeEventListener(t,n,r.useCapture)}}}(document,e,i,t._trackFunc,{composed:!0,useCapture:!0})})}}else Object.keys(this._delegates).forEach(function(e){"function"==typeof t._delegates[e].destroy&&t._delegates[e].destroy()}),this._delegates={};return this._config},e.prototype._trackFunc=function(e,t){return i=this,s=void 0,n=function(){var i,s,r,n,o,a,l;return function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}(this,function(c){switch(c.label){case 0:return i={},s=t.getAttribute(this._config.selectorPrefix+"on").split(/\s*,\s*/),r=t.getAttribute(this._config.selectorPrefix+"name"),(n=t.getAttribute(this._config.selectorPrefix+"attrs"))&&n.split(/\s*,\s*/).forEach(function(e){var t=e.trim().split(/\s*:\s*/);i[t[0]]=t[1]}),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()];case 1:return a=c.sent(),[3,3];case 2:a=this._config.attributes,c.label=3;case 3:return o=a,l=Object.assign({type:e.type,target:e.target.localName+" with id "+e.target.id},o,i),Ws.debug("events needed to be recorded",s),Ws.debug("attributes needed to be attached",i),s.indexOf(e.type)<0?(Ws.debug("event "+e.type+" is not selected to be recorded"),[2]):(this._tracker({name:r||"event",attributes:l},this._config.provider).catch(function(t){Ws.debug("Failed to record the "+e.type+" event', "+t)}),[2])}})},new((r=void 0)||(r=Promise))(function(e,t){function o(e){try{l(n.next(e))}catch(e){t(e)}}function a(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof r?i:new r(function(e){e(i)})).then(o,a)}l((n=n.apply(i,s||[])).next())});var i,s,r,n},e}();var $s=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},Ys=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},qs=new s.C("SessionTracker"),Xs={enable:!1,provider:"AWSPinpoint"},Zs=!1;const Qs=function(){function e(e,t){this._config=Object.assign({},Xs,t),this._tracker=e,this._hasEnabled=!1,this._trackFunc=this._trackFunc.bind(this),this._trackBeforeUnload=this._trackBeforeUnload.bind(this),this.configure(this._config)}return e.prototype._envCheck=function(){if(!qt.JS.browserOrNode().isBrowser)return!1;if(!document||!document.addEventListener)return qs.debug("not in the supported web environment"),!1;if(void 0!==document.hidden)this._hidden="hidden",this._visibilityChange="visibilitychange";else if(void 0!==document.msHidden)this._hidden="msHidden",this._visibilityChange="msvisibilitychange";else{if(void 0===document.webkitHidden)return qs.debug("not in the supported web environment"),!1;this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange"}return!0},e.prototype._trackFunc=function(){return $s(this,void 0,void 0,function(){var e,t,i;return Ys(this,function(s){switch(s.label){case 0:return"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()];case 1:return t=s.sent(),[3,3];case 2:t=this._config.attributes,s.label=3;case 3:return e=t,i=Object.assign({},e),document.visibilityState===this._hidden?this._tracker({name:"_session.stop",attributes:i},this._config.provider).catch(function(e){qs.debug("record session stop event failed.",e)}):this._tracker({name:"_session.start",attributes:i},this._config.provider).catch(function(e){qs.debug("record session start event failed.",e)}),[2]}})})},e.prototype._trackBeforeUnload=function(e){var t=this;("function"==typeof this._config.attributes?Promise.resolve(this._config.attributes()):Promise.resolve(this._config.attributes)).then(function(e){var i=Object.assign({},e);t._tracker({name:"_session.stop",attributes:i,immediate:!0},t._config.provider).catch(function(e){qs.debug("record session stop event failed.",e)})})},e.prototype._sendInitialEvent=function(){return $s(this,void 0,void 0,function(){var e,t,i;return Ys(this,function(s){switch(s.label){case 0:return Zs?(qs.debug("the start session has been sent when the page is loaded"),[2]):(Zs=!0,"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]);case 1:return t=s.sent(),[3,3];case 2:t=this._config.attributes,s.label=3;case 3:return e=t,i=Object.assign({},e),this._tracker({name:"_session.start",attributes:i},this._config.provider).catch(function(e){qs.debug("record session start event failed.",e)}),[2]}})})},e.prototype.configure=function(e){return this._envCheck()?(Object.assign(this._config,e),this._config.enable&&!this._hasEnabled?(this._sendInitialEvent(),document.addEventListener(this._visibilityChange,this._trackFunc,!1),window.addEventListener("beforeunload",this._trackBeforeUnload,!1),this._hasEnabled=!0):!this._config.enable&&this._hasEnabled&&(document.removeEventListener(this._visibilityChange,this._trackFunc,!1),window.removeEventListener("beforeunload",this._trackBeforeUnload,!1),this._hasEnabled=!1),this._config):this._config},e}();var Js=function(){return Js=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Js.apply(this,arguments)},er=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},tr=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},ir=new s.C("AnalyticsClass"),sr="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",rr={pageView:Bs,event:Ks,session:Qs},nr=null,or=function(){function e(){this._config={},this._pluggables=[],this._disabled=!1,this._trackers={},nr=this,this.record=this.record.bind(this),r.YZ.listen("auth",hr),r.YZ.listen("storage",hr),r.YZ.listen("analytics",hr)}return e.prototype.getModuleName=function(){return"Analytics"},e.prototype.configure=function(e){var t=this;if(!e)return this._config;ir.debug("configure Analytics",e);var i=n.iX.parseMobilehubConfig(e);return this._config=Object.assign({},this._config,i.Analytics,e),this._config.disabled&&(this._disabled=!0),void 0===this._config.autoSessionRecord&&(this._config.autoSessionRecord=!0),this._pluggables.forEach(function(e){var i="AWSPinpoint"!==e.getProviderName()||t._config.AWSPinpoint?t._config[e.getProviderName()]:t._config;e.configure(Js({disabled:t._config.disabled,autoSessionRecord:t._config.autoSessionRecord},i))}),0===this._pluggables.length&&this.addPluggable(new Ds),r.YZ.dispatch("analytics",{event:"configured",data:null,message:"The Analytics category has been configured successfully"},"Analytics",sr),ir.debug("current configuration",this._config),this._config},e.prototype.addPluggable=function(e){if(e&&"Analytics"===e.getCategory()){this._pluggables.push(e);var t="AWSPinpoint"!==e.getProviderName()||this._config.AWSPinpoint?this._config[e.getProviderName()]:this._config,i=Js({disabled:this._config.disabled},t);return e.configure(i),i}},e.prototype.getPluggable=function(e){for(var t=0;t<this._pluggables.length;t+=1){var i=this._pluggables[t];if(i.getProviderName()===e)return i}return ir.debug("No plugin found with providerName",e),null},e.prototype.removePluggable=function(e){for(var t=0;t<this._pluggables.length&&this._pluggables[t].getProviderName()!==e;)t+=1;return t===this._pluggables.length?void ir.debug("No plugin found with providerName",e):void this._pluggables.splice(t,t+1)},e.prototype.disable=function(){this._disabled=!0},e.prototype.enable=function(){this._disabled=!1},e.prototype.startSession=function(e){return er(this,void 0,void 0,function(){var t;return tr(this,function(i){return t={event:{name:"_session.start"},provider:e},[2,this._sendEvent(t)]})})},e.prototype.stopSession=function(e){return er(this,void 0,void 0,function(){var t;return tr(this,function(i){return t={event:{name:"_session.stop"},provider:e},[2,this._sendEvent(t)]})})},e.prototype.record=function(e,t,i){return er(this,void 0,void 0,function(){var s;return tr(this,function(r){return null,s="string"==typeof e?{event:{name:e,attributes:t,metrics:i},provider:"AWSPinpoint"}:{event:e,provider:t},[2,this._sendEvent(s)]})})},e.prototype.updateEndpoint=function(e,t){return er(this,void 0,void 0,function(){var i;return tr(this,function(s){return i=Js(Js({},e),{name:"_update_endpoint"}),[2,this.record(i,t)]})})},e.prototype._sendEvent=function(e){var t=this;if(this._disabled)return ir.debug("Analytics has been disabled"),Promise.resolve();var i=e.provider?e.provider:"AWSPinpoint";return new Promise(function(s,r){t._pluggables.forEach(function(t){t.getProviderName()===i&&t.record(e,{resolve:s,reject:r})})})},e.prototype.autoTrack=function(e,t){if(rr[e]){"session"===e&&(this._config.autoSessionRecord=t.enable);var i=this._trackers[e];i?i.configure(t):this._trackers[e]=new rr[e](this.record,t)}else ir.debug("invalid tracker type")},e}(),ar=!1,lr=!1,cr=!1,hr=function(e){var t=e.channel,i=e.payload;switch(ir.debug("on hub capsule "+t,i),t){case"auth":ur(i);break;case"storage":dr(i);break;case"analytics":pr(i)}},dr=function(e){var t=e.data,i=t.attrs,s=t.metrics;i&&cr&&nr.record({name:"Storage",attributes:i,metrics:s}).catch(function(e){ir.debug("Failed to send the storage event automatically",e)})},ur=function(e){var t=e.event;if(t){var i=function(e){return er(void 0,void 0,void 0,function(){var t;return tr(this,function(i){switch(i.label){case 0:if(!lr||!cr)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,nr.record({name:"_userauth."+e})];case 2:return[2,i.sent()];case 3:return t=i.sent(),ir.debug("Failed to send the "+e+" event automatically",t),[3,4];case 4:return[2]}})})};switch(t){case"signIn":return i("sign_in");case"signUp":return i("sign_up");case"signOut":return i("sign_out");case"signIn_failure":return i("auth_fail");case"configured":(lr=!0)&&cr&&gr()}}},pr=function(e){var t=e.event;t&&"pinpointProvider_configured"===t&&(cr=!0,lr&&cr&&gr())},gr=function(){var e=nr.configure();!ar&&e.autoSessionRecord&&(nr.updateEndpoint({immediate:!0}).catch(function(e){ir.debug("Failed to update the endpoint",e)}),ar=!0),nr.autoTrack("session",{enable:e.autoSessionRecord})},mr=new or;o.HA.register(mr)},27021(e,t,i){"use strict";var s,r,n;function o(e){return e&&!!["provider"].find(function(t){return e.hasOwnProperty(t)})}function a(e){return void 0!==e.redirectSignIn}i.d(t,{N:()=>Xe}),function(e){e.Cognito="COGNITO",e.Google="Google",e.Facebook="Facebook",e.Amazon="LoginWithAmazon",e.Apple="SignInWithApple"}(s||(s={})),function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError"}(r||(r={})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(n||(n={}));var l,c=i(15567),h=i(51718),d=i(11351),u=i(410),p=i(12599),g=i(51678),m=(0,g.gy)().isBrowser,f=function(){function e(e){void 0===e&&(e={}),this.cookies=new p.A,this.store=m?window.localStorage:Object.create(null),this.cookies=e.req?new p.A(e.req.headers.cookie):new p.A,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map(function(t,i){return e.key(i)}).forEach(function(t){return e.removeItem(t)})},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":m?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),y=i(75315),v=i(78953),C=function(){function e(e){var t=e||{},i=t.ValidationData,s=t.Username,r=t.Password,n=t.AuthParameters,o=t.ClientMetadata;this.validationData=i||{},this.authParameters=n||{},this.clientMetadata=o||{},this.username=s,this.password=r}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),b=i(51999),S=i(60095),w=i.n(S),x=(i(74842),i(9331)),E=i.n(x),M=i(31939),A=i.n(M);if("undefined"!=typeof window&&window.crypto&&(l=window.crypto),!l&&"undefined"!=typeof window&&window.msCrypto&&(l=window.msCrypto),!l&&"undefined"!=typeof globalThis&&globalThis.crypto&&(l=globalThis.crypto),!l)try{l=i(55595)}catch(e){}function T(){if(l){if("function"==typeof l.getRandomValues)try{return l.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof l.randomBytes)try{return l.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}var D=function(){function e(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length}var t=e.prototype;return t.random=function(t){for(var i=[],s=0;s<t;s+=4)i.push(T());return new e(i,t)},t.toString=function(){return function(e){for(var t=e.words,i=e.sigBytes,s=[],r=0;r<i;r++){var n=t[r>>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).toString(16))}return s.join("")}(this)},e}();const I=R;function R(e,t){null!=e&&this.fromString(e,t)}function P(){return new R(null)}var k,L="undefined"!=typeof navigator;L&&"Microsoft Internet Explorer"==navigator.appName?(R.prototype.am=function(e,t,i,s,r,n){for(var o=32767&t,a=t>>15;--n>=0;){var l=32767&this[e],c=this[e++]>>15,h=a*l+c*o;r=((l=o*l+((32767&h)<<15)+i[s]+(1073741823&r))>>>30)+(h>>>15)+a*c+(r>>>30),i[s++]=1073741823&l}return r},k=30):L&&"Netscape"!=navigator.appName?(R.prototype.am=function(e,t,i,s,r,n){for(;--n>=0;){var o=t*this[e++]+i[s]+r;r=Math.floor(o/67108864),i[s++]=67108863&o}return r},k=26):(R.prototype.am=function(e,t,i,s,r,n){for(var o=16383&t,a=t>>14;--n>=0;){var l=16383&this[e],c=this[e++]>>14,h=a*l+c*o;r=((l=o*l+((16383&h)<<14)+i[s]+r)>>28)+(h>>14)+a*c,i[s++]=268435455&l}return r},k=28),R.prototype.DB=k,R.prototype.DM=(1<<k)-1,R.prototype.DV=1<<k,R.prototype.FV=Math.pow(2,52),R.prototype.F1=52-k,R.prototype.F2=2*k-52;var N,_,O=new Array;for(N="0".charCodeAt(0),_=0;_<=9;++_)O[N++]=_;for(N="a".charCodeAt(0),_=10;_<36;++_)O[N++]=_;for(N="A".charCodeAt(0),_=10;_<36;++_)O[N++]=_;function F(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function G(e,t){var i=O[e.charCodeAt(t)];return null==i?-1:i}function B(e){var t=P();return t.fromInt(e),t}function V(e){var t,i=1;return 0!=(t=e>>>16)&&(e=t,i+=16),0!=(t=e>>8)&&(e=t,i+=8),0!=(t=e>>4)&&(e=t,i+=4),0!=(t=e>>2)&&(e=t,i+=2),0!=(t=e>>1)&&(e=t,i+=1),i}function H(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function U(e){return b.hp.from((new D).random(e).toString(),"hex")}H.prototype.convert=function(e){var t=P();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(R.ZERO)>0&&this.m.subTo(t,t),t},H.prototype.revert=function(e){var t=P();return e.copyTo(t),this.reduce(t),t},H.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var i=32767&e[t],s=i*this.mpl+((i*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=t+this.m.t]+=this.m.am(0,s,e,t,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},H.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},H.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},R.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},R.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},R.prototype.fromString=function(e,t){var i;if(16==t)i=4;else if(8==t)i=3;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");i=2}this.t=0,this.s=0;for(var s=e.length,r=!1,n=0;--s>=0;){var o=G(e,s);o<0?"-"==e.charAt(s)&&(r=!0):(r=!1,0==n?this[this.t++]=o:n+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-n)-1)<<n,this[this.t++]=o>>this.DB-n):this[this.t-1]|=o<<n,(n+=i)>=this.DB&&(n-=this.DB))}this.clamp(),r&&R.ZERO.subTo(this,this)},R.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},R.prototype.dlShiftTo=function(e,t){var i;for(i=this.t-1;i>=0;--i)t[i+e]=this[i];for(i=e-1;i>=0;--i)t[i]=0;t.t=this.t+e,t.s=this.s},R.prototype.drShiftTo=function(e,t){for(var i=e;i<this.t;++i)t[i-e]=this[i];t.t=Math.max(this.t-e,0),t.s=this.s},R.prototype.lShiftTo=function(e,t){var i,s=e%this.DB,r=this.DB-s,n=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<s&this.DM;for(i=this.t-1;i>=0;--i)t[i+o+1]=this[i]>>r|a,a=(this[i]&n)<<s;for(i=o-1;i>=0;--i)t[i]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},R.prototype.rShiftTo=function(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)t.t=0;else{var s=e%this.DB,r=this.DB-s,n=(1<<s)-1;t[0]=this[i]>>s;for(var o=i+1;o<this.t;++o)t[o-i-1]|=(this[o]&n)<<r,t[o-i]=this[o]>>s;s>0&&(t[this.t-i-1]|=(this.s&n)<<r),t.t=this.t-i,t.clamp()}},R.prototype.subTo=function(e,t){for(var i=0,s=0,r=Math.min(e.t,this.t);i<r;)s+=this[i]-e[i],t[i++]=s&this.DM,s>>=this.DB;if(e.t<this.t){for(s-=e.s;i<this.t;)s+=this[i],t[i++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;i<e.t;)s-=e[i],t[i++]=s&this.DM,s>>=this.DB;s-=e.s}t.s=s<0?-1:0,s<-1?t[i++]=this.DV+s:s>0&&(t[i++]=s),t.t=i,t.clamp()},R.prototype.multiplyTo=function(e,t){var i=this.abs(),s=e.abs(),r=i.t;for(t.t=r+s.t;--r>=0;)t[r]=0;for(r=0;r<s.t;++r)t[r+i.t]=i.am(0,s[r],t,r,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&R.ZERO.subTo(t,t)},R.prototype.squareTo=function(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e[i]=0;for(i=0;i<t.t-1;++i){var s=t.am(i,t[i],e,2*i,0,1);(e[i+t.t]+=t.am(i+1,2*t[i],e,2*i+1,s,t.t-i-1))>=t.DV&&(e[i+t.t]-=t.DV,e[i+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(i,t[i],e,2*i,0,1)),e.s=0,e.clamp()},R.prototype.divRemTo=function(e,t,i){var s=e.abs();if(!(s.t<=0)){var r=this.abs();if(r.t<s.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=P());var n=P(),o=this.s,a=e.s,l=this.DB-V(s[s.t-1]);l>0?(s.lShiftTo(l,n),r.lShiftTo(l,i)):(s.copyTo(n),r.copyTo(i));var c=n.t,h=n[c-1];if(0!=h){var d=h*(1<<this.F1)+(c>1?n[c-2]>>this.F2:0),u=this.FV/d,p=(1<<this.F1)/d,g=1<<this.F2,m=i.t,f=m-c,y=null==t?P():t;for(n.dlShiftTo(f,y),i.compareTo(y)>=0&&(i[i.t++]=1,i.subTo(y,i)),R.ONE.dlShiftTo(c,y),y.subTo(n,n);n.t<c;)n[n.t++]=0;for(;--f>=0;){var v=i[--m]==h?this.DM:Math.floor(i[m]*u+(i[m-1]+g)*p);if((i[m]+=n.am(0,v,i,f,0,c))<v)for(n.dlShiftTo(f,y),i.subTo(y,i);i[m]<--v;)i.subTo(y,i)}null!=t&&(i.drShiftTo(c,t),o!=a&&R.ZERO.subTo(t,t)),i.t=c,i.clamp(),l>0&&i.rShiftTo(l,i),o<0&&R.ZERO.subTo(i,i)}}},R.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},R.prototype.addTo=function(e,t){for(var i=0,s=0,r=Math.min(e.t,this.t);i<r;)s+=this[i]+e[i],t[i++]=s&this.DM,s>>=this.DB;if(e.t<this.t){for(s+=e.s;i<this.t;)s+=this[i],t[i++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;i<e.t;)s+=e[i],t[i++]=s&this.DM,s>>=this.DB;s+=e.s}t.s=s<0?-1:0,s>0?t[i++]=s:s<-1&&(t[i++]=this.DV+s),t.t=i,t.clamp()},R.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var i,s=(1<<t)-1,r=!1,n="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0)for(a<this.DB&&(i=this[o]>>a)>0&&(r=!0,n=F(i));o>=0;)a<t?(i=(this[o]&(1<<a)-1)<<t-a,i|=this[--o]>>(a+=this.DB-t)):(i=this[o]>>(a-=t)&s,a<=0&&(a+=this.DB,--o)),i>0&&(r=!0),r&&(n+=F(i));return r?n:"0"},R.prototype.negate=function(){var e=P();return R.ZERO.subTo(this,e),e},R.prototype.abs=function(){return this.s<0?this.negate():this},R.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var i=this.t;if(0!=(t=i-e.t))return this.s<0?-t:t;for(;--i>=0;)if(0!=(t=this[i]-e[i]))return t;return 0},R.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+V(this[this.t-1]^this.s&this.DM)},R.prototype.mod=function(e){var t=P();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(R.ZERO)>0&&e.subTo(t,t),t},R.prototype.equals=function(e){return 0==this.compareTo(e)},R.prototype.add=function(e){var t=P();return this.addTo(e,t),t},R.prototype.subtract=function(e){var t=P();return this.subTo(e,t),t},R.prototype.multiply=function(e){var t=P();return this.multiplyTo(e,t),t},R.prototype.divide=function(e){var t=P();return this.divRemTo(e,t,null),t},R.prototype.modPow=function(e,t,i){var s,r=e.bitLength(),n=B(1),o=new H(t);if(r<=0)return n;s=r<18?1:r<48?3:r<144?4:r<768?5:6;var a=new Array,l=3,c=s-1,h=(1<<s)-1;if(a[1]=o.convert(this),s>1){var d=P();for(o.sqrTo(a[1],d);l<=h;)a[l]=P(),o.mulTo(d,a[l-2],a[l]),l+=2}var u,p,g=e.t-1,m=!0,f=P();for(r=V(e[g])-1;g>=0;){for(r>=c?u=e[g]>>r-c&h:(u=(e[g]&(1<<r+1)-1)<<c-r,g>0&&(u|=e[g-1]>>this.DB+r-c)),l=s;!(1&u);)u>>=1,--l;if((r-=l)<0&&(r+=this.DB,--g),m)a[u].copyTo(n),m=!1;else{for(;l>1;)o.sqrTo(n,f),o.sqrTo(f,n),l-=2;l>0?o.sqrTo(n,f):(p=n,n=f,f=p),o.mulTo(f,a[u],n)}for(;g>=0&&!(e[g]&1<<r);)o.sqrTo(n,f),p=n,n=f,f=p,--r<0&&(r=this.DB-1,--g)}var y=o.revert(n);return i(null,y),y},R.ZERO=B(0),R.ONE=B(1);var z=/^[89a-f]/i,W=function(){function e(e){this.N=new I("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",16),this.g=new I("2",16),this.k=new I(this.hexHash(""+this.padHex(this.N)+this.padHex(this.g)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue(function(){}),this.infoBits=b.hp.from("Caldera Derived Key","utf8"),this.poolName=e}var t=e.prototype;return t.getSmallAValue=function(){return this.smallAValue},t.getLargeAValue=function(e){var t=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,function(i,s){i&&e(i,null),t.largeAValue=s,e(null,t.largeAValue)})},t.generateRandomSmallA=function(){var e=U(128).toString("hex");return new I(e,16)},t.generateRandomString=function(){return U(40).toString("base64")},t.getRandomPassword=function(){return this.randomPassword},t.getSaltDevices=function(){return this.SaltToHashDevices},t.getVerifierDevices=function(){return this.verifierDevices},t.generateHashDevice=function(e,t,i){var s=this;this.randomPassword=this.generateRandomString();var r=""+e+t+":"+this.randomPassword,n=this.hash(r),o=U(16).toString("hex");this.SaltToHashDevices=this.padHex(new I(o,16)),this.g.modPow(new I(this.hexHash(this.SaltToHashDevices+n),16),this.N,function(e,t){e&&i(e,null),s.verifierDevices=s.padHex(t),i(null,null)})},t.calculateA=function(e,t){var i=this;this.g.modPow(e,this.N,function(e,s){e&&t(e,null),s.mod(i.N).equals(I.ZERO)&&t(new Error("Illegal paramater. A mod N cannot be 0."),null),t(null,s)})},t.calculateU=function(e,t){return this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(t)),new I(this.UHexHash,16)},t.hash=function(e){var t=e instanceof b.hp?w().lib.WordArray.create(e):e,i=E()(t).toString();return new Array(64-i.length).join("0")+i},t.hexHash=function(e){return this.hash(b.hp.from(e,"hex"))},t.computehkdf=function(e,t){var i=w().lib.WordArray.create(b.hp.concat([this.infoBits,b.hp.from(String.fromCharCode(1),"utf8")])),s=e instanceof b.hp?w().lib.WordArray.create(e):e,r=t instanceof b.hp?w().lib.WordArray.create(t):t,n=A()(s,r),o=A()(i,n);return b.hp.from(o.toString(),"hex").slice(0,16)},t.getPasswordAuthenticationKey=function(e,t,i,s,r){var n=this;if(i.mod(this.N).equals(I.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,i),this.UValue.equals(I.ZERO))throw new Error("U cannot be zero.");var o=""+this.poolName+e+":"+t,a=this.hash(o),l=new I(this.hexHash(this.padHex(s)+a),16);this.calculateS(l,i,function(e,t){e&&r(e,null);var i=n.computehkdf(b.hp.from(n.padHex(t),"hex"),b.hp.from(n.padHex(n.UValue),"hex"));r(null,i)})},t.calculateS=function(e,t,i){var s=this;this.g.modPow(e,this.N,function(r,n){r&&i(r,null),t.subtract(s.k.multiply(n)).modPow(s.smallAValue.add(s.UValue.multiply(e)),s.N,function(e,t){e&&i(e,null),i(null,t.mod(s.N))})})},t.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return"userAttributes."},t.padHex=function(e){if(!(e instanceof I))throw new Error("Not a BigInteger");var t=e.compareTo(I.ZERO)<0,i=e.abs().toString(16);if(i=i.length%2!=0?"0"+i:i,i=z.test(i)?"00"+i:i,t){var s=i.split("").map(function(e){var t=15&~parseInt(e,16);return"0123456789ABCDEF".charAt(t)}).join("");(i=new I(s,16).add(I.ONE).toString(16)).toUpperCase().startsWith("FF8")&&(i=i.substring(2))}return i},e}(),j=function(){function e(e){this.jwtToken=e||"",this.payload=this.decodePayload()}var t=e.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(b.hp.from(e,"base64").toString("utf8"))}catch(e){return{}}},e}();function K(e,t){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},K(e,t)}var $=function(e){var t,i;function s(t){var i=(void 0===t?{}:t).AccessToken;return e.call(this,i||"")||this}return i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,K(t,i),s}(j);function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var q=function(e){var t,i;function s(t){var i=(void 0===t?{}:t).IdToken;return e.call(this,i||"")||this}return i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,Y(t,i),s}(j),X=function(){function e(e){var t=(void 0===e?{}:e).RefreshToken;this.token=t||""}return e.prototype.getToken=function(){return this.token},e}(),Z=i(81716),Q=i.n(Z),J=function(){function e(e){var t=void 0===e?{}:e,i=t.IdToken,s=t.RefreshToken,r=t.AccessToken,n=t.ClockDrift;if(null==r||null==i)throw new Error("Id token and Access Token must be present.");this.idToken=i,this.refreshToken=s,this.accessToken=r,this.clockDrift=void 0===n?this.calculateClockDrift():n}var t=e.prototype;return t.getIdToken=function(){return this.idToken},t.getRefreshToken=function(){return this.refreshToken},t.getAccessToken=function(){return this.accessToken},t.getClockDrift=function(){return this.clockDrift},t.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},t.isValid=function(){var e=Math.floor(new Date/1e3)-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},e}(),ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],te=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ie=function(){function e(){}return e.prototype.getNowString=function(){var e=new Date,t=te[e.getUTCDay()],i=ee[e.getUTCMonth()],s=e.getUTCDate(),r=e.getUTCHours();r<10&&(r="0"+r);var n=e.getUTCMinutes();n<10&&(n="0"+n);var o=e.getUTCSeconds();return o<10&&(o="0"+o),t+" "+i+" "+s+" "+r+":"+n+":"+o+" UTC "+e.getUTCFullYear()},e}(),se=function(){function e(e){var t=void 0===e?{}:e,i=t.Name,s=t.Value;this.Name=i||"",this.Value=s||""}var t=e.prototype;return t.getValue=function(){return this.Value},t.setValue=function(e){return this.Value=e,this},t.getName=function(){return this.Name},t.setName=function(e){return this.Name=e,this},t.toString=function(){return JSON.stringify(this)},t.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}(),re={},ne=function(){function e(){}return e.setItem=function(e,t){return re[e]=t,re[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(re,e)?re[e]:void 0},e.removeItem=function(e){return delete re[e]},e.clear=function(){return re={}},e}(),oe=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(e){this.storageWindow=ne}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),ae="undefined"!=typeof navigator?navigator.userAgent:"nodejs",le=function(){function e(e){if(null==e||null==e.Username||null==e.Pool)throw new Error("Username and Pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||(new oe).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=e.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,t){var i=this,s=e.getAuthParameters();s.USERNAME=this.username;var r=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),n={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:s,ClientMetadata:r};this.getUserContextData()&&(n.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",n,function(e,s){if(e)return t.onFailure(e);var r=s.ChallengeName,n=s.ChallengeParameters;return"CUSTOM_CHALLENGE"===r?(i.Session=s.Session,t.customChallenge(n)):(i.signInUserSession=i.getCognitoUserSession(s.AuthenticationResult),i.cacheTokens(),t.onSuccess(i.signInUserSession))})},t.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType||"CUSTOM_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,t){var i,s,r=this,n=new W(this.pool.getUserPoolName()),o=new ie,a={};null!=this.deviceKey&&(a.DEVICE_KEY=this.deviceKey),a.USERNAME=this.username,n.getLargeAValue(function(l,c){l&&t.onFailure(l),a.SRP_A=c.toString(16),"CUSTOM_AUTH"===r.authenticationFlowType&&(a.CHALLENGE_NAME="SRP_A");var h=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),d={AuthFlow:r.authenticationFlowType,ClientId:r.pool.getClientId(),AuthParameters:a,ClientMetadata:h};r.getUserContextData(r.username)&&(d.UserContextData=r.getUserContextData(r.username)),r.client.request("InitiateAuth",d,function(a,l){if(a)return t.onFailure(a);var c=l.ChallengeParameters;r.username=c.USER_ID_FOR_SRP,r.userDataKey=r.keyPrefix+"."+r.username+".userData",i=new I(c.SRP_B,16),s=new I(c.SALT,16),r.getCachedDeviceKeyAndPassword(),n.getPasswordAuthenticationKey(r.username,e.getPassword(),i,s,function(e,i){e&&t.onFailure(e);var s=o.getNowString(),a=w().lib.WordArray.create(b.hp.concat([b.hp.from(r.pool.getUserPoolName(),"utf8"),b.hp.from(r.username,"utf8"),b.hp.from(c.SECRET_BLOCK,"base64"),b.hp.from(s,"utf8")])),d=w().lib.WordArray.create(i),u=Q().stringify(A()(a,d)),p={};p.USERNAME=r.username,p.PASSWORD_CLAIM_SECRET_BLOCK=c.SECRET_BLOCK,p.TIMESTAMP=s,p.PASSWORD_CLAIM_SIGNATURE=u,null!=r.deviceKey&&(p.DEVICE_KEY=r.deviceKey);var g={ChallengeName:"PASSWORD_VERIFIER",ClientId:r.pool.getClientId(),ChallengeResponses:p,Session:l.Session,ClientMetadata:h};r.getUserContextData()&&(g.UserContextData=r.getUserContextData()),function e(t,i){return r.client.request("RespondToAuthChallenge",t,function(s,n){return s&&"ResourceNotFoundException"===s.code&&-1!==s.message.toLowerCase().indexOf("device")?(p.DEVICE_KEY=null,r.deviceKey=null,r.randomPassword=null,r.deviceGroupKey=null,r.clearCachedDeviceKeyAndPassword(),e(t,i)):i(s,n)})}(g,function(e,i){return e?t.onFailure(e):r.authenticateUserInternal(i,n,t)})})})})},t.authenticateUserPlainUsernamePassword=function(e,t){var i=this,s={};if(s.USERNAME=this.username,s.PASSWORD=e.getPassword(),s.PASSWORD){var r=new W(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(s.DEVICE_KEY=this.deviceKey);var n=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),o={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:s,ClientMetadata:n};this.getUserContextData(this.username)&&(o.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",o,function(e,s){return e?t.onFailure(e):i.authenticateUserInternal(s,r,t)})}else t.onFailure(new Error("PASSWORD parameter is required"))},t.authenticateUserInternal=function(e,t,i){var s=this,r=e.ChallengeName,n=e.ChallengeParameters;if("SMS_MFA"===r)return this.Session=e.Session,i.mfaRequired(r,n);if("SELECT_MFA_TYPE"===r)return this.Session=e.Session,i.selectMFAType(r,n);if("MFA_SETUP"===r)return this.Session=e.Session,i.mfaSetup(r,n);if("SOFTWARE_TOKEN_MFA"===r)return this.Session=e.Session,i.totpRequired(r,n);if("CUSTOM_CHALLENGE"===r)return this.Session=e.Session,i.customChallenge(n);if("NEW_PASSWORD_REQUIRED"===r){this.Session=e.Session;var o=null,a=null,l=[],c=t.getNewPasswordRequiredChallengeUserAttributePrefix();if(n&&(o=JSON.parse(e.ChallengeParameters.userAttributes),a=JSON.parse(e.ChallengeParameters.requiredAttributes)),a)for(var h=0;h<a.length;h++)l[h]=a[h].substr(c.length);return i.newPasswordRequired(o,l)}if("DEVICE_SRP_AUTH"===r)return this.Session=e.Session,void this.getDeviceResponse(i);this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=r,this.cacheTokens();var d=e.AuthenticationResult.NewDeviceMetadata;if(null==d)return i.onSuccess(this.signInUserSession);t.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(r){if(r)return i.onFailure(r);var n={Salt:b.hp.from(t.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:b.hp.from(t.getVerifierDevices(),"hex").toString("base64")};s.verifierDevices=n.PasswordVerifier,s.deviceGroupKey=d.DeviceGroupKey,s.randomPassword=t.getRandomPassword(),s.client.request("ConfirmDevice",{DeviceKey:d.DeviceKey,AccessToken:s.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:n,DeviceName:ae},function(t,r){return t?i.onFailure(t):(s.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,s.cacheDeviceKeyAndPassword(),!0===r.UserConfirmationNecessary?i.onSuccess(s.signInUserSession,r.UserConfirmationNecessary):i.onSuccess(s.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,t,i,s){var r=this;if(!e)return i.onFailure(new Error("New password is required."));var n=new W(this.pool.getUserPoolName()),o=n.getNewPasswordRequiredChallengeUserAttributePrefix(),a={};t&&Object.keys(t).forEach(function(e){a[o+e]=t[e]}),a.NEW_PASSWORD=e,a.USERNAME=this.username;var l={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:a,Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",l,function(e,t){return e?i.onFailure(e):r.authenticateUserInternal(t,n,i)})},t.getDeviceResponse=function(e,t){var i=this,s=new W(this.deviceGroupKey),r=new ie,n={};n.USERNAME=this.username,n.DEVICE_KEY=this.deviceKey,s.getLargeAValue(function(o,a){o&&e.onFailure(o),n.SRP_A=a.toString(16);var l={ChallengeName:"DEVICE_SRP_AUTH",ClientId:i.pool.getClientId(),ChallengeResponses:n,ClientMetadata:t,Session:i.Session};i.getUserContextData()&&(l.UserContextData=i.getUserContextData()),i.client.request("RespondToAuthChallenge",l,function(t,n){if(t)return e.onFailure(t);var o=n.ChallengeParameters,a=new I(o.SRP_B,16),l=new I(o.SALT,16);s.getPasswordAuthenticationKey(i.deviceKey,i.randomPassword,a,l,function(t,s){if(t)return e.onFailure(t);var a=r.getNowString(),l=w().lib.WordArray.create(b.hp.concat([b.hp.from(i.deviceGroupKey,"utf8"),b.hp.from(i.deviceKey,"utf8"),b.hp.from(o.SECRET_BLOCK,"base64"),b.hp.from(a,"utf8")])),c=w().lib.WordArray.create(s),h=Q().stringify(A()(l,c)),d={};d.USERNAME=i.username,d.PASSWORD_CLAIM_SECRET_BLOCK=o.SECRET_BLOCK,d.TIMESTAMP=a,d.PASSWORD_CLAIM_SIGNATURE=h,d.DEVICE_KEY=i.deviceKey;var u={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:i.pool.getClientId(),ChallengeResponses:d,Session:n.Session};i.getUserContextData()&&(u.UserContextData=i.getUserContextData()),i.client.request("RespondToAuthChallenge",u,function(t,s){return t?e.onFailure(t):(i.signInUserSession=i.getCognitoUserSession(s.AuthenticationResult),i.cacheTokens(),e.onSuccess(i.signInUserSession))})})})})},t.confirmRegistration=function(e,t,i,s){var r={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:t,ClientMetadata:s};this.getUserContextData()&&(r.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",r,function(e){return e?i(e,null):i(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,t,i){var s=this,r={};r.USERNAME=this.username,r.ANSWER=e;var n=new W(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var o={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:r,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:i};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",o,function(e,i){return e?t.onFailure(e):s.authenticateUserInternal(i,n,t)})},t.sendMFACode=function(e,t,i,s){var r=this,n={};n.USERNAME=this.username,n.SMS_MFA_CODE=e;var o=i||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===o&&(n.SOFTWARE_TOKEN_MFA_CODE=e),null!=this.deviceKey&&(n.DEVICE_KEY=this.deviceKey);var a={ChallengeName:o,ChallengeResponses:n,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",a,function(e,i){if(e)return t.onFailure(e);if("DEVICE_SRP_AUTH"!==i.ChallengeName){if(r.signInUserSession=r.getCognitoUserSession(i.AuthenticationResult),r.cacheTokens(),null==i.AuthenticationResult.NewDeviceMetadata)return t.onSuccess(r.signInUserSession);var s=new W(r.pool.getUserPoolName());s.generateHashDevice(i.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,i.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(e){if(e)return t.onFailure(e);var n={Salt:b.hp.from(s.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:b.hp.from(s.getVerifierDevices(),"hex").toString("base64")};r.verifierDevices=n.PasswordVerifier,r.deviceGroupKey=i.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,r.randomPassword=s.getRandomPassword(),r.client.request("ConfirmDevice",{DeviceKey:i.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:r.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:n,DeviceName:ae},function(e,s){return e?t.onFailure(e):(r.deviceKey=i.AuthenticationResult.NewDeviceMetadata.DeviceKey,r.cacheDeviceKeyAndPassword(),!0===s.UserConfirmationNecessary?t.onSuccess(r.signInUserSession,s.UserConfirmationNecessary):t.onSuccess(r.signInUserSession))})})}else r.getDeviceResponse(t)})},t.changePassword=function(e,t,i,s){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(e){return e?i(e,null):i(null,"SUCCESS")})},t.enableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var t=[];t.push({DeliveryMedium:"SMS",AttributeName:"phone_number"}),this.client.request("SetUserSettings",{MFAOptions:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?i(e,null):i(null,"SUCCESS")})},t.disableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("SetUserSettings",{MFAOptions:[],AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},t.deleteUser=function(e,t){var i=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:t},function(t){return t?e(t,null):(i.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,t,i){var s=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:i},function(e){return e?t(e,null):s.getUserData(function(){return t(null,"SUCCESS")},{bypassCache:!0})})},t.getUserAttributes=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,i){if(t)return e(t,null);for(var s=[],r=0;r<i.UserAttributes.length;r++){var n={Name:i.UserAttributes[r].Name,Value:i.UserAttributes[r].Value},o=new se(n);s.push(o)}return e(null,s)})},t.getMFAOptions=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,i){return t?e(t,null):e(null,i.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var t=this;return void 0===e&&(e={}),new Promise(function(i){var s=t.signInUserSession.getRefreshToken();s&&s.getToken()?t.refreshSession(s,i,e.clientMetadata):i()})},t.getUserData=function(e,t){var i=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var s=this.getUserDataFromCache();if(s)if(this.isFetchUserDataAndTokenRequired(t))this.fetchUserData().then(function(e){return i.refreshSessionIfPossible(t).then(function(){return e})}).then(function(t){return e(null,t)}).catch(e);else try{return void e(null,JSON.parse(s))}catch(t){return this.clearCachedUserData(),void e(t,null)}else this.fetchUserData().then(function(t){e(null,t)}).catch(e)},t.getUserDataFromCache=function(){return this.storage.getItem(this.userDataKey)},t.isFetchUserDataAndTokenRequired=function(e){var t=(e||{}).bypassCache;return void 0!==t&&t},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(t){return e.cacheUserData(t),t})},t.deleteAttributes=function(e,t){var i=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?t(e,null):i.getUserData(function(){return t(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,t){var i={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.client.request("ResendConfirmationCode",i,function(t,i){return t?e(t,null):e(null,i)})},t.getSession=function(e,t){if(void 0===t&&(t={}),null==this.username)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(null!=this.signInUserSession&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var i="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,s=i+".idToken",r=i+".accessToken",n=i+".refreshToken",o=i+".clockDrift";if(this.storage.getItem(s)){var a=new q({IdToken:this.storage.getItem(s)}),l=new $({AccessToken:this.storage.getItem(r)}),c=new X({RefreshToken:this.storage.getItem(n)}),h=parseInt(this.storage.getItem(o),0)||0,d=new J({IdToken:a,AccessToken:l,RefreshToken:c,ClockDrift:h});if(d.isValid())return this.signInUserSession=d,e(null,this.signInUserSession);if(!c.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(c,e,t.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,t,i){var s=this,r=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(t):t,n={};n.REFRESH_TOKEN=e.getToken();var o="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=o+".LastAuthUser";if(this.storage.getItem(a)){this.username=this.storage.getItem(a);var l=o+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(l),n.DEVICE_KEY=this.deviceKey}var c={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:n,ClientMetadata:i};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",c,function(t,i){if(t)return"NotAuthorizedException"===t.code&&s.clearCachedUser(),r(t,null);if(i){var n=i.AuthenticationResult;return Object.prototype.hasOwnProperty.call(n,"RefreshToken")||(n.RefreshToken=e.getToken()),s.signInUserSession=s.getCognitoUserSession(n),s.cacheTokens(),r(null,s.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",i=e+"."+this.username+".accessToken",s=e+"."+this.username+".refreshToken",r=e+"."+this.username+".clockDrift",n=e+".LastAuthUser";this.storage.setItem(t,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(i,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(r,""+this.signInUserSession.getClockDrift()),this.storage.setItem(n,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",i=e+".randomPasswordKey",s=e+".deviceGroupKey";this.storage.setItem(t,this.deviceKey),this.storage.setItem(i,this.randomPassword),this.storage.setItem(s,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",i=e+".randomPasswordKey",s=e+".deviceGroupKey";this.storage.getItem(t)&&(this.deviceKey=this.storage.getItem(t),this.randomPassword=this.storage.getItem(i),this.deviceGroupKey=this.storage.getItem(s))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",i=e+".randomPasswordKey",s=e+".deviceGroupKey";this.storage.removeItem(t),this.storage.removeItem(i),this.storage.removeItem(s)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",i=e+"."+this.username+".accessToken",s=e+"."+this.username+".refreshToken",r=e+".LastAuthUser",n=e+"."+this.username+".clockDrift";this.storage.removeItem(t),this.storage.removeItem(i),this.storage.removeItem(s),this.storage.removeItem(r),this.storage.removeItem(n)},t.getCognitoUserSession=function(e){var t=new q(e),i=new $(e),s=new X(e);return new J({IdToken:t,AccessToken:i,RefreshToken:s})},t.forgotPassword=function(e,t){var i={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",i,function(t,i){return t?e.onFailure(t):"function"==typeof e.inputVerificationCode?e.inputVerificationCode(i):e.onSuccess(i)})},t.confirmPassword=function(e,t,i,s){var r={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:t,ClientMetadata:s};this.getUserContextData()&&(r.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",r,function(e){return e?i.onFailure(e):i.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:i},function(e,i){return e?t.onFailure(e):"function"==typeof t.inputVerificationCode?t.inputVerificationCode(i):t.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?i.onFailure(e):i.onSuccess("SUCCESS")})},t.getDevice=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(t,i){return t?e.onFailure(t):e.onSuccess(i)})},t.forgetSpecificDevice=function(e,t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var t=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(i){return t.deviceKey=null,t.deviceGroupKey=null,t.randomPassword=null,t.clearCachedDeviceKeyAndPassword(),e.onSuccess(i)}})},t.setDeviceStatusRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},t.listDevices=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i.onFailure(new Error("User is not authenticated"));var s={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};t&&(s.PaginationToken=t),this.client.request("ListDevices",s,function(e,t){return e?i.onFailure(e):i.onSuccess(t)})},t.globalSignOut=function(e){var t=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(i){return i?e.onFailure(i):(t.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var t=this;e&&"function"==typeof e?this.getSession(function(i,s){if(i)return e(i);t.revokeTokens(function(i){t.cleanClientData(),e(i)})}):this.cleanClientData()},t.revokeTokens=function(e){if(void 0===e&&(e=function(){}),"function"!=typeof e)throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession)return e(new Error("User is not authenticated"));if(!this.signInUserSession.getAccessToken())return e(new Error("No Access token available"));var t=this.signInUserSession.getRefreshToken().getToken(),i=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(i)&&t)return this.revokeToken({token:t,callback:e});e()},t.isSessionRevocable=function(e){if(e&&"function"==typeof e.decodePayload)try{return!!e.decodePayload().origin_jti}catch(e){}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var t=e.token,i=e.callback;this.client.requestWithRetry("RevokeToken",{Token:t,ClientId:this.pool.getClientId()},function(e){if(e)return i(e);i()})},t.sendMFASelectionAnswer=function(e,t){var i=this,s={};s.USERNAME=this.username,s.ANSWER=e;var r={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:s,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(r.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",r,function(s,r){return s?t.onFailure(s):(i.Session=r.Session,"SMS_MFA"===e?t.mfaRequired(r.ChallengeName,r.ChallengeParameters):"SOFTWARE_TOKEN_MFA"===e?t.totpRequired(r.ChallengeName,r.ChallengeParameters):void 0)})},t.getUserContextData=function(){return this.pool.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var t=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,i){return t?e.onFailure(t):e.associateSecretCode(i.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(i,s){return i?e.onFailure(i):(t.Session=s.Session,e.associateSecretCode(s.SecretCode))})},t.verifySoftwareToken=function(e,t,i){var s=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:t},function(e,t){return e?i.onFailure(e):i.onSuccess(t)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:t},function(e,t){if(e)return i.onFailure(e);s.Session=t.Session;var r={};r.USERNAME=s.username;var n={ChallengeName:"MFA_SETUP",ClientId:s.pool.getClientId(),ChallengeResponses:r,Session:s.Session};s.getUserContextData()&&(n.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",n,function(e,t){return e?i.onFailure(e):(s.signInUserSession=s.getCognitoUserSession(t.AuthenticationResult),s.cacheTokens(),i.onSuccess(s.signInUserSession))})})},e}(),ce=(i(40061),"aws-amplify/5.0.4"),he={userAgent:ce+" js",product:"",navigator:null,isReactNative:!1};function de(){}"undefined"!=typeof navigator&&navigator.product&&(he.product=navigator.product||"",he.navigator=navigator||null,"ReactNative"===navigator.product?(he.userAgent=ce+" react-native",he.isReactNative=!0):(he.userAgent=ce+" js",he.isReactNative=!1)),de.prototype.userAgent=he.userAgent;const ue=de;function pe(e){var t="function"==typeof Map?new Map:void 0;return pe=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,s)}function s(){return ge(e,arguments,fe(this).constructor)}return s.prototype=Object.create(e.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),me(s,e)},pe(e)}function ge(e,t,i){return ge=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,i){var s=[null];s.push.apply(s,t);var r=new(Function.bind.apply(e,s));return i&&me(r,i.prototype),r},ge.apply(null,arguments)}function me(e,t){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},me(e,t)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fe(e)}var ye=function(e){function t(t,i,s,r){var n;return(n=e.call(this,t)||this).code=i,n.name=s,n.statusCode=r,n}return s=e,(i=t).prototype=Object.create(s.prototype),i.prototype.constructor=i,me(i,s),t;var i,s}(pe(Error)),ve=function(){function e(e,t,i){this.endpoint=t||"https://cognito-idp."+e+".amazonaws.com/";var s=(i||{}).credentials;this.fetchOptions=s?{credentials:s}:{}}var t=e.prototype;return t.promisifyRequest=function(e,t){var i=this;return new Promise(function(s,r){i.request(e,t,function(e,t){e?r(new ye(e.message,e.code,e.name,e.statusCode)):s(t)})})},t.requestWithRetry=function(e,t,i){var s,r,n=this;(s=[t],r=5e3,void 0===r&&(r=3e5),Ce(function(t){return new Promise(function(i,s){n.request(e,t,function(e,t){e?s(e):i(t)})})},s,function(e){return function(t){var i=100*Math.pow(2,t)+100*Math.random();return!(i>e)&&i}}(r))).then(function(e){return i(null,e)}).catch(function(e){return i(e)})},t.request=function(e,t,i){var s,r={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":ue.prototype.userAgent,"Cache-Control":"no-store"},n=Object.assign({},this.fetchOptions,{headers:r,method:"POST",mode:"cors",body:JSON.stringify(t)});fetch(this.endpoint,n).then(function(e){return s=e,e},function(e){if(e instanceof TypeError)throw new Error("Network error");throw e}).then(function(e){return e.json().catch(function(){return{}})}).then(function(e){if(s.ok)return i(null,e);var t=(e.__type||e.code).split("#").pop(),r=new Error(e.message||e.Message||null);return r.name=t,r.code=t,i(r)}).catch(function(e){if(s&&s.headers&&s.headers.get("x-amzn-errortype"))try{var t=s.headers.get("x-amzn-errortype").split(":")[0],r=new Error(s.status?s.status.toString():null);return r.code=t,r.name=t,r.statusCode=s.status,i(r)}catch(t){return i(e)}else e instanceof Error&&"Network error"===e.message&&(e.code="NetworkError");return i(e)})},e}();function Ce(e,t,i,s){if(void 0===s&&(s=1),"function"!=typeof e)throw Error("functionToRetry must be a function");return e.name,JSON.stringify(t),e.apply(void 0,t).catch(function(r){if(e.name,(n=r)&&n.nonRetryable)throw e.name,r;var n,o=i(s,t,r);if(e.name,!1!==o)return new Promise(function(e){return setTimeout(e,o)}).then(function(){return Ce(e,t,i,s+1)});throw r})}var be=function(){function e(e,t){var i=e||{},s=i.UserPoolId,r=i.ClientId,n=i.endpoint,o=i.fetchOptions,a=i.AdvancedSecurityDataCollectionFlag;if(!s||!r)throw new Error("Both UserPoolId and ClientId are required.");if(s.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(s))throw new Error("Invalid UserPoolId format.");var l=s.split("_")[0];this.userPoolId=s,this.clientId=r,this.client=new ve(l,n,o),this.advancedSecurityDataCollectionFlag=!1!==a,this.storage=e.Storage||(new oe).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,i,s,r,n){var o=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:i,ValidationData:s,ClientMetadata:n};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,function(t,i){if(t)return r(t,null);var s={Username:e,Pool:o,Storage:o.storage},n={user:new le(s),userConfirmed:i.UserConfirmed,userSub:i.UserSub,codeDeliveryDetails:i.CodeDeliveryDetails};return r(null,n)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var i={Username:t,Pool:this,Storage:this.storage};return new le(i)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var i=t.getData(e,this.userPoolId,this.clientId);if(i)return{EncodedData:i}}return{}}},e}(),Se=i(97351),we=function(){function e(e){if(!e.domain)throw new Error("The domain of cookieStorage can not be undefined.");if(this.domain=e.domain,e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var i={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(i.sameSite=this.sameSite),Se.set(e,t,i),Se.get(e)},t.getItem=function(e){return Se.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),Se.remove(e,t)},t.clear=function(){for(var e=Se.get(),t=Object.keys(e).length,i=0;i<t;++i)this.removeItem(Object.keys(e)[i]);return{}},e}(),xe=i(71481),Ee=function(e){var t=window.open(e,"_self");return t?Promise.resolve(t):Promise.reject()},Me=function(){return Me=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Me.apply(this,arguments)},Ae=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},Te=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},De=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},Ie="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Re=function(e,t,i){h.YZ.dispatch("auth",{event:e,data:t,message:i},"Auth",Ie)},Pe=new c.C("OAuth"),ke=function(){function e(e){var t=e.config,i=e.cognitoClientId,s=e.scopes,r=void 0===s?[]:s;if(this._urlOpener=t.urlOpener||Ee,this._config=t,this._cognitoClientId=i,!this.isValidScopes(r))throw Error("scopes must be a String Array");this._scopes=r}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every(function(e){return"string"==typeof e})},e.prototype.oauthSignIn=function(e,t,i,r,n,o){void 0===e&&(e="code"),void 0===n&&(n=s.Cognito);var a=this._generateState(32),l=o?a+"-"+o.split("").map(function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")}).join(""):a;!function(e){window.sessionStorage.setItem("oauth_state",e)}(l);var c,h=this._generateRandom(128);c=h,window.sessionStorage.setItem("ouath_pkce_key",c);var d=this._generateChallenge(h),u=this._scopes.join(" "),p="https://"+t+"/oauth2/authorize?"+Object.entries(Me(Me({redirect_uri:i,response_type:e,client_id:r,identity_provider:n,scope:u,state:l},"code"===e?{code_challenge:d}:{}),"code"===e?{code_challenge_method:"S256"}:{})).map(function(e){var t=De(e,2),i=t[0],s=t[1];return encodeURIComponent(i)+"="+encodeURIComponent(s)}).join("&");Pe.debug("Redirecting to "+p),this._urlOpener(p,i)},e.prototype._handleCodeFlow=function(e){return Ae(this,void 0,void 0,function(){var t,i,s,r,n,o,l,c,h,d,u,p,g,m;return Te(this,function(f){switch(f.label){case 0:return t=((0,xe.parse)(e).query||"").split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i,s=De(t,2),r=s[0],n=s[1];return Me(Me({},e),((i={})[r]=n,i))},{code:void 0}).code,i=(0,xe.parse)(e).pathname||"/",s=(0,xe.parse)(this._config.redirectSignIn).pathname||"/",t&&i===s?(r="https://"+this._config.domain+"/oauth2/token",Re("codeFlow",{},"Retrieving tokens from "+r),n=a(this._config)?this._cognitoClientId:this._config.clientID,o=a(this._config)?this._config.redirectSignIn:this._config.redirectUri,y=window.sessionStorage.getItem("ouath_pkce_key"),window.sessionStorage.removeItem("ouath_pkce_key"),c=Me({grant_type:"authorization_code",code:t,client_id:n,redirect_uri:o},(l=y)?{code_verifier:l}:{}),Pe.debug("Calling token endpoint: "+r+" with",c),h=Object.entries(c).map(function(e){var t=De(e,2),i=t[0],s=t[1];return encodeURIComponent(i)+"="+encodeURIComponent(s)}).join("&"),[4,fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:h})]):[2];case 1:return[4,f.sent().json()];case 2:if(d=f.sent(),u=d.access_token,p=d.refresh_token,g=d.id_token,m=d.error)throw new Error(m);return[2,{accessToken:u,refreshToken:p,idToken:g}]}var y})})},e.prototype._handleImplicitFlow=function(e){return Ae(this,void 0,void 0,function(){var t,i,s;return Te(this,function(r){return t=((0,xe.parse)(e).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i,s=De(t,2),r=s[0],n=s[1];return Me(Me({},e),((i={})[r]=n,i))},{id_token:void 0,access_token:void 0}),i=t.id_token,s=t.access_token,Re("implicitFlow",{},"Got tokens from "+e),Pe.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:s,idToken:i,refreshToken:null}]})})},e.prototype.handleAuthResponse=function(e){return Ae(this,void 0,void 0,function(){var t,i,s,r,n,o,a;return Te(this,function(l){switch(l.label){case 0:if(l.trys.push([0,5,,6]),t=e?Me(Me({},((0,xe.parse)(e).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i=De(t,2),s=i[0],r=i[1];return e[s]=r,e},{})),((0,xe.parse)(e).query||"").split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i=De(t,2),s=i[0],r=i[1];return e[s]=r,e},{})):{},i=t.error,s=t.error_description,i)throw new Error(s);return r=this._validateState(t),Pe.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(n=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,Me.apply(void 0,[Me.apply(void 0,n.concat([l.sent()])),{state:r}])];case 2:return o=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,Me.apply(void 0,[Me.apply(void 0,o.concat([l.sent()])),{state:r}])];case 4:return[3,6];case 5:throw a=l.sent(),Pe.error("Error handling auth response.",a),a;case 6:return[2]}})})},e.prototype._validateState=function(e){if(e){var t,i=(t=window.sessionStorage.getItem("oauth_state"),window.sessionStorage.removeItem("oauth_state"),t),s=e.state;if(i&&i!==s)throw new Error("Invalid state in OAuth flow");return s}},e.prototype.signOut=function(){return Ae(this,void 0,void 0,function(){var e,t,i;return Te(this,function(s){return e="https://"+this._config.domain+"/logout?",t=a(this._config)?this._cognitoClientId:this._config.oauth.clientID,i=a(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(i)}).map(function(e){var t=De(e,2);return t[0]+"="+t[1]}).join("&"),Re("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),Pe.debug("Signing out from "+e),[2,this._urlOpener(e,i)]})})},e.prototype._generateState=function(e){for(var t="",i=e;i>0;--i)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.round(61*Math.random())];return t},e.prototype._generateChallenge=function(e){return this._base64URL(E()(e))},e.prototype._base64URL=function(e){return e.toString(Q()).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!=typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var i=0;i<e;i+=1)t[i]=66*Math.random()|0;return this._bufferToString(t)},e.prototype._bufferToString=function(e){for(var t=[],i=0;i<e.byteLength;i+=1){var s=e[i]%62;t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[s])}return t.join("")},e}();const Le=ke;var Ne;!function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",e.AUTOSIGNIN_ERROR="Please use your credentials to sign in"}(Ne||(Ne={}));var _e,Oe=(_e=function(e,t){return _e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},_e(e,t)},function(e,t){function i(){this.constructor=e}_e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Fe=new c.C("AuthError"),Ge=function(e){function t(i){var s=this,r=Ve[i],n=r.message,o=r.log;return(s=e.call(this,n)||this).constructor=t,Object.setPrototypeOf(s,t.prototype),s.name="AuthError",s.log=o||n,Fe.error(s.log),s}return Oe(t,e),t}(Error),Be=function(e){function t(i){var s=e.call(this,i)||this;return s.constructor=t,Object.setPrototypeOf(s,t.prototype),s.name="NoUserPoolError",s}return Oe(t,e),t}(Ge),Ve={noConfig:{message:Ne.DEFAULT_MSG,log:"\n            Error: Amplify has not been configured correctly.\n            This error is typically caused by one of the following scenarios:\n\n            1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n                See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n            \n            2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n        "},missingAuthConfig:{message:Ne.DEFAULT_MSG,log:"\n            Error: Amplify has not been configured correctly. \n            The configuration object is missing required auth properties.\n            This error is typically caused by one of the following scenarios:\n\n            1. Did you run `amplify push` after adding auth via `amplify add auth`?\n                See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n            2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\n        "},emptyUsername:{message:Ne.EMPTY_USERNAME},invalidUsername:{message:Ne.INVALID_USERNAME},emptyPassword:{message:Ne.EMPTY_PASSWORD},emptyCode:{message:Ne.EMPTY_CODE},signUpError:{message:Ne.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:Ne.NO_MFA},invalidMFA:{message:Ne.INVALID_MFA},emptyChallengeResponse:{message:Ne.EMPTY_CHALLENGE},noUserSession:{message:Ne.NO_USER_SESSION},deviceConfig:{message:Ne.DEVICE_CONFIG},networkError:{message:Ne.NETWORK_ERROR},autoSignInError:{message:Ne.AUTOSIGNIN_ERROR},default:{message:Ne.DEFAULT_MSG}},He=function(){return He=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},He.apply(this,arguments)},Ue=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},ze=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},We=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},je=new c.C("AuthClass"),Ke="aws.cognito.signin.user.admin",$e="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ye=function(e,t,i){h.YZ.dispatch("auth",{event:e,data:t,message:i},"Auth",$e)},qe=function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.autoSignInInitiated=!1,this.Credentials=d.Ji,this.wrapRefreshSessionCallback=function(e){return function(t,i){return i?Ye("tokenRefresh",void 0,"New token retrieved"):Ye("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,i)}},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),h.YZ.listen("auth",function(e){switch(e.payload.event){case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true")}})}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};je.debug("configure Auth");var i=Object.assign({},this._config,u.iX.parseMobilehubConfig(e).Auth,e);this._config=i;var s=this._config,n=s.userPoolId,o=s.userPoolWebClientId,l=s.cookieStorage,c=s.oauth,h=s.region,d=s.identityPoolId,p=s.mandatorySignIn,m=s.refreshHandlers,v=s.identityPoolRegion,C=s.clientMetadata,b=s.endpoint;if(this._config.storage){if(!this._isValidAuthStorage(this._config.storage))throw je.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}else this._storage=l?new we(l):e.ssr?new f:(new y.i1).getStorage();if(this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),n){var S={UserPoolId:n,ClientId:o,endpoint:b};S.Storage=this._storage,this.userPool=new be(S,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:p,region:v||h,userPoolId:n,identityPoolId:d,refreshHandlers:m,storage:this._storage});var w=c?a(this._config.oauth)?c:c.awsCognito:void 0;if(w){var x=Object.assign({cognitoClientId:o,UserPoolId:n,domain:w.domain,scopes:w.scope,redirectSignIn:w.redirectSignIn,redirectSignOut:w.redirectSignOut,responseType:w.responseType,Storage:this._storage,urlOpener:w.urlOpener,clientMetadata:C},w.options);this._oAuthHandler=new Le({scopes:x.scopes,config:x,cognitoClientId:x.cognitoClientId});var E={};!function(){if((0,g.gy)().isBrowser&&window.location)!function(e){var i=e.url;E[i]||(E[i]=!0,t._handleAuthResponse(i))}({url:window.location.href});else if(!(0,g.gy)().isNode)throw new Error("Not supported")}()}return Ye("configured",null,"The Auth category has been configured successfully"),this.autoSignInInitiated||"function"!=typeof this._storage.getItem||(this.isTrueStorageValue("amplify-polling-started")&&(Ye("autoSignIn_failure",null,r.AutoSignInError),this._storage.removeItem("amplify-auto-sign-in")),this._storage.removeItem("amplify-polling-started")),this._config},e.prototype.signUp=function(e){for(var t,i,s,n=this,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];if(!this.userPool)return this.rejectNoUserPool();var l,c=null,h=null,d=[],u=null,p={enabled:!1},g={},m={};if(e&&"string"==typeof e){c=e,h=o?o[0]:null;var f=o?o[1]:null,y=o?o[2]:null;f&&d.push(new se({Name:"email",Value:f})),y&&d.push(new se({Name:"phone_number",Value:y}))}else{if(!e||"object"!=typeof e)return this.rejectAuthError(r.SignUpError);c=e.username,h=e.password,e&&e.clientMetadata?l=e.clientMetadata:this._config.clientMetadata&&(l=this._config.clientMetadata);var v=e.attributes;v&&Object.keys(v).map(function(e){d.push(new se({Name:e,Value:v[e]}))});var C=e.validationData;C&&(u=[],Object.keys(C).map(function(e){u.push(new se({Name:e,Value:C[e]}))})),(p=null!==(t=e.autoSignIn)&&void 0!==t?t:{enabled:!1}).enabled&&(this._storage.setItem("amplify-auto-sign-in","true"),g=null!==(i=p.validationData)&&void 0!==i?i:{},m=null!==(s=p.clientMetaData)&&void 0!==s?s:{})}return c?h?(je.debug("signUp attrs:",d),je.debug("signUp validation data:",u),new Promise(function(e,t){n.userPool.signUp(c,h,d,u,function(i,s){i?(Ye("signUp_failure",i,c+" failed to signup"),t(i)):(Ye("signUp",s,c+" has signed up successfully"),p.enabled&&n.handleAutoSignIn(c,h,g,m,s),e(s))},l)})):this.rejectAuthError(r.EmptyPassword):this.rejectAuthError(r.EmptyUsername)},e.prototype.handleAutoSignIn=function(e,t,i,s,r){this.autoSignInInitiated=!0;var n=new C({Username:e,Password:t,ValidationData:i,ClientMetadata:s});r.userConfirmed?this.signInAfterUserConfirmed(n):"link"===this._config.signUpVerificationMethod?this.handleLinkAutoSignIn(n):this.handleCodeAutoSignIn(n)},e.prototype.handleCodeAutoSignIn=function(e){var t=this,i=function(s){"confirmSignUp"===s.payload.event&&t.signInAfterUserConfirmed(e,i)};h.YZ.listen("auth",i)},e.prototype.handleLinkAutoSignIn=function(e){var t=this;this._storage.setItem("amplify-polling-started","true");var i=Date.now(),s=setInterval(function(){Date.now()-i>18e4?(clearInterval(s),Ye("autoSignIn_failure",null,"Please confirm your account and use your credentials to sign in."),t._storage.removeItem("amplify-auto-sign-in")):t.signInAfterUserConfirmed(e,null,s)},5e3)},e.prototype.signInAfterUserConfirmed=function(e,t,i){return Ue(this,void 0,void 0,function(){var s,r,n=this;return ze(this,function(o){switch(o.label){case 0:s=this.createCognitoUser(e.getUsername()),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,s.authenticateUser(e,this.authCallbacks(s,function(s){Ye("autoSignIn",s,e.getUsername()+" has signed in successfully"),t&&h.YZ.remove("auth",t),i&&(clearInterval(i),n._storage.removeItem("amplify-polling-started")),n._storage.removeItem("amplify-auto-sign-in")},function(e){je.error(e),n._storage.removeItem("amplify-auto-sign-in")}))];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),je.error(r),[3,4];case 4:return[2]}})})},e.prototype.confirmSignUp=function(e,t,i){var s=this;if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(r.EmptyUsername);if(!t)return this.rejectAuthError(r.EmptyCode);var n,o=this.createCognitoUser(e),a=!i||"boolean"!=typeof i.forceAliasCreation||i.forceAliasCreation;return i&&i.clientMetadata?n=i.clientMetadata:this._config.clientMetadata&&(n=this._config.clientMetadata),new Promise(function(i,l){o.confirmRegistration(t,a,function(t,n){t?l(t):(Ye("confirmSignUp",n,e+" has been confirmed successfully"),s.isTrueStorageValue("amplify-auto-sign-in")&&!s.autoSignInInitiated&&(Ye("autoSignIn_failure",null,r.AutoSignInError),s._storage.removeItem("amplify-auto-sign-in")),i(n))},n)})},e.prototype.isTrueStorageValue=function(e){var t=this._storage.getItem(e);return!!t&&"true"===t},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(r.EmptyUsername);var i=this.createCognitoUser(e);return new Promise(function(e,s){i.resendConfirmationCode(function(t,i){t?s(t):e(i)},t)})},e.prototype.signIn=function(e,t,i){if(void 0===i&&(i=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var s=null,n=null,o={};if("string"==typeof e)s=e,n=t;else{if(!e.username)return this.rejectAuthError(r.InvalidUsername);void 0!==t&&je.warn("The password should be defined under the first parameter object!"),s=e.username,n=e.password,o=e.validationData}if(!s)return this.rejectAuthError(r.EmptyUsername);var a=new C({Username:s,Password:n,ValidationData:o,ClientMetadata:i});return n?this.signInWithPassword(a):this.signInWithoutPassword(a)},e.prototype.authCallbacks=function(e,t,i){var s=this,r=this;return{onSuccess:function(n){return Ue(s,void 0,void 0,function(){var s,o,a,l;return ze(this,function(c){switch(c.label){case 0:je.debug(n),delete e.challengeName,delete e.challengeParam,c.label=1;case 1:return c.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return c.sent(),[4,this.Credentials.set(n,"session")];case 3:return s=c.sent(),je.debug("succeed to get cognito credentials",s),[3,9];case 4:return o=c.sent(),je.debug("cannot get cognito credentials",o),[3,9];case 5:return c.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return a=c.sent(),r.user=a,Ye("signIn",a,"A user "+e.getUsername()+" has been signed in"),t(a),[3,8];case 7:return l=c.sent(),je.error("Failed to get the signed in user",l),i(l),[3,8];case 8:return[7];case 9:return[2]}})})},onFailure:function(t){je.debug("signIn failure",t),Ye("signIn_failure",t,e.getUsername()+" failed to signin"),i(t)},customChallenge:function(i){je.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=i,t(e)},mfaRequired:function(i,s){je.debug("signIn MFA required"),e.challengeName=i,e.challengeParam=s,t(e)},mfaSetup:function(i,s){je.debug("signIn mfa setup",i),e.challengeName=i,e.challengeParam=s,t(e)},newPasswordRequired:function(i,s){je.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:i,requiredAttributes:s},t(e)},totpRequired:function(i,s){je.debug("signIn totpRequired"),e.challengeName=i,e.challengeParam=s,t(e)},selectMFAType:function(i,s){je.debug("signIn selectMFAType",i),e.challengeName=i,e.challengeParam=s,t(e)}}},e.prototype.signInWithPassword=function(e){var t=this;if(this.pendingSignIn)throw new Error("Pending sign-in attempt already in progress");var i=this.createCognitoUser(e.getUsername());return this.pendingSignIn=new Promise(function(s,r){i.authenticateUser(e,t.authCallbacks(i,function(e){t.pendingSignIn=null,s(e)},function(e){t.pendingSignIn=null,r(e)}))}),this.pendingSignIn},e.prototype.signInWithoutPassword=function(e){var t=this,i=this.createCognitoUser(e.getUsername());return i.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise(function(s,r){i.initiateAuth(e,t.authCallbacks(i,s,r))})},e.prototype.getMFAOptions=function(e){return new Promise(function(t,i){e.getMFAOptions(function(e,s){if(e)return je.debug("get MFA Options failed",e),void i(e);je.debug("get MFA options success",s),t(s)})})},e.prototype.getPreferredMFA=function(e,t){var i=this,s=this;return new Promise(function(r,n){var o=i._config.clientMetadata,a=!!t&&t.bypassCache;e.getUserData(function(t,o){return Ue(i,void 0,void 0,function(){var i,a;return ze(this,function(l){switch(l.label){case 0:if(!t)return[3,5];if(je.debug("getting preferred mfa failed",t),!this.isSessionInvalid(t))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return l.sent(),[3,4];case 3:return i=l.sent(),n(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return n(t),[2];case 5:return(a=s._getMfaTypeFromUserData(o))?(r(a),[2]):(n("invalid MFA Type"),[2])}})})},{bypassCache:a,clientMetadata:o})})},e.prototype._getMfaTypeFromUserData=function(e){var t=null,i=e.PreferredMfaSetting;if(i)t=i;else{var s=e.UserMFASettingList;s?0===s.length?t="NOMFA":je.debug("invalid case for getPreferredMFA",e):t=e.MFAOptions?"SMS_MFA":"NOMFA"}return t},e.prototype._getUserData=function(e,t){var i=this;return new Promise(function(s,r){e.getUserData(function(t,n){return Ue(i,void 0,void 0,function(){var i;return ze(this,function(o){switch(o.label){case 0:if(!t)return[3,5];if(je.debug("getting user data failed",t),!this.isSessionInvalid(t))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),r(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return r(t),[2];case 5:s(n),o.label=6;case 6:return[2]}})})},t)})},e.prototype.setPreferredMFA=function(e,t){return Ue(this,void 0,void 0,function(){var i,s,n,o,a,l,c=this;return ze(this,function(h){switch(h.label){case 0:return i=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:i})];case 1:switch(s=h.sent(),n=null,o=null,t){case"TOTP":case"SOFTWARE_TOKEN_MFA":return[3,2];case"SMS":case"SMS_MFA":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return n={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return a=s.UserMFASettingList,[4,this._getMfaTypeFromUserData(s)];case 5:if("NOMFA"===(l=h.sent()))return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===l)n={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==l)return[2,this.rejectAuthError(r.InvalidMFA)];o={PreferredMfa:!1,Enabled:!1}}return a&&0!==a.length&&a.forEach(function(e){"SMS_MFA"===e?n={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(o={PreferredMfa:!1,Enabled:!1})}),[3,7];case 6:return je.debug("no validmfa method provided"),[2,this.rejectAuthError(r.NoMFA)];case 7:return[2,new Promise(function(t,s){e.setUserMfaPreference(n,o,function(r,n){if(r)return je.debug("Set user mfa preference error",r),s(r);je.debug("Set user mfa success",n),je.debug("Caching the latest user data into local"),e.getUserData(function(i,r){return Ue(c,void 0,void 0,function(){var r;return ze(this,function(o){switch(o.label){case 0:if(!i)return[3,5];if(je.debug("getting user data failed",i),!this.isSessionInvalid(i))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),s(new Error("Session is invalid due to: "+i.message+" and failed to clean up invalid session: "+r.message)),[2];case 4:return[2,s(i)];case 5:return[2,t(n)]}})})},{bypassCache:!0,clientMetadata:i})})})]}})})},e.prototype.disableSMS=function(e){return new Promise(function(t,i){e.disableMFA(function(e,s){if(e)return je.debug("disable mfa failed",e),void i(e);je.debug("disable mfa succeed",s),t(s)})})},e.prototype.enableSMS=function(e){return new Promise(function(t,i){e.enableMFA(function(e,s){if(e)return je.debug("enable mfa failed",e),void i(e);je.debug("enable mfa succeed",s),t(s)})})},e.prototype.setupTOTP=function(e){return new Promise(function(t,i){e.associateSoftwareToken({onFailure:function(e){je.debug("associateSoftwareToken failed",e),i(e)},associateSecretCode:function(e){je.debug("associateSoftwareToken sucess",e),t(e)}})})},e.prototype.verifyTotpToken=function(e,t){return je.debug("verification totp token",e,t),new Promise(function(i,s){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){je.debug("verifyTotpToken failed",e),s(e)},onSuccess:function(t){Ye("signIn",e,"A user "+e.getUsername()+" has been signed in"),je.debug("verifyTotpToken success",t),i(t)}})})},e.prototype.confirmSignIn=function(e,t,i,s){var n=this;if(void 0===s&&(s=this._config.clientMetadata),!t)return this.rejectAuthError(r.EmptyCode);var o=this;return new Promise(function(r,a){e.sendMFACode(t,{onSuccess:function(t){return Ue(n,void 0,void 0,function(){var i,s;return ze(this,function(n){switch(n.label){case 0:je.debug(t),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return n.sent(),[4,this.Credentials.set(t,"session")];case 3:return i=n.sent(),je.debug("succeed to get cognito credentials",i),[3,6];case 4:return s=n.sent(),je.debug("cannot get cognito credentials",s),[3,6];case 5:return o.user=e,Ye("signIn",e,"A user "+e.getUsername()+" has been signed in"),r(e),[7];case 6:return[2]}})})},onFailure:function(e){je.debug("confirm signIn failure",e),a(e)}},i,s)})},e.prototype.completeNewPassword=function(e,t,i,s){var n=this;if(void 0===i&&(i={}),void 0===s&&(s=this._config.clientMetadata),!t)return this.rejectAuthError(r.EmptyPassword);var o=this;return new Promise(function(r,a){e.completeNewPasswordChallenge(t,i,{onSuccess:function(t){return Ue(n,void 0,void 0,function(){var i,s;return ze(this,function(n){switch(n.label){case 0:je.debug(t),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return n.sent(),[4,this.Credentials.set(t,"session")];case 3:return i=n.sent(),je.debug("succeed to get cognito credentials",i),[3,6];case 4:return s=n.sent(),je.debug("cannot get cognito credentials",s),[3,6];case 5:return o.user=e,Ye("signIn",e,"A user "+e.getUsername()+" has been signed in"),r(e),[7];case 6:return[2]}})})},onFailure:function(e){je.debug("completeNewPassword failure",e),Ye("completeNewPassword_failure",e,n.user+" failed to complete the new password flow"),a(e)},mfaRequired:function(t,i){je.debug("signIn MFA required"),e.challengeName=t,e.challengeParam=i,r(e)},mfaSetup:function(t,i){je.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=i,r(e)},totpRequired:function(t,i){je.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=i,r(e)}},s)})},e.prototype.sendCustomChallengeAnswer=function(e,t,i){var s=this;return void 0===i&&(i=this._config.clientMetadata),this.userPool?t?new Promise(function(r,n){e.sendCustomChallengeAnswer(t,s.authCallbacks(e,r,n),i)}):this.rejectAuthError(r.EmptyChallengeResponse):this.rejectNoUserPool()},e.prototype.deleteUserAttributes=function(e,t){var i=this;return new Promise(function(s,r){i.userSession(e).then(function(i){e.deleteAttributes(t,function(e,t){return e?r(e):s(t)})})})},e.prototype.deleteUser=function(){return Ue(this,void 0,void 0,function(){var e,t,i=this;return ze(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this._storageSync];case 1:return s.sent(),[3,3];case 2:throw e=s.sent(),je.debug("Failed to sync cache info into memory",e),new Error(e);case 3:return t=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(e,s){return Ue(i,void 0,void 0,function(){var i,r=this;return ze(this,function(n){if(this.userPool){if(!(i=this.userPool.getCurrentUser()))return je.debug("Failed to get user from user pool"),[2,s(new Error("No current user."))];i.getSession(function(n,o){return Ue(r,void 0,void 0,function(){var r,o=this;return ze(this,function(a){switch(a.label){case 0:if(!n)return[3,5];if(je.debug("Failed to get the user session",n),!this.isSessionInvalid(n))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(i)];case 2:return a.sent(),[3,4];case 3:return r=a.sent(),s(new Error("Session is invalid due to: "+n.message+" and failed to clean up invalid session: "+r.message)),[2];case 4:return[2,s(n)];case 5:i.deleteUser(function(r,n){if(r)s(r);else{Ye("userDeleted",n,"The authenticated user has been deleted."),i.signOut(),o.user=null;try{o.cleanCachedItems()}catch(e){je.debug("failed to clear cached items")}t?o.oAuthSignOutRedirect(e,s):(Ye("signOut",o.user,"A user has been signed out"),e(n))}}),a.label=6;case 6:return[2]}})})})}else je.debug("no Congito User pool"),s(new Error("Cognito User pool does not exist"));return[2]})})})]}})})},e.prototype.updateUserAttributes=function(e,t,i){void 0===i&&(i=this._config.clientMetadata);var s=[],r=this;return new Promise(function(n,o){r.userSession(e).then(function(r){for(var a in t)if("sub"!==a&&a.indexOf("_verified")<0){var l={Name:a,Value:t[a]};s.push(l)}e.updateAttributes(s,function(e,t){return e?o(e):n(t)},i)})})},e.prototype.userAttributes=function(e){var t=this;return new Promise(function(i,s){t.userSession(e).then(function(t){e.getUserAttributes(function(e,t){e?s(e):i(t)})})})},e.prototype.verifiedContact=function(e){var t=this;return this.userAttributes(e).then(function(e){var i=t.attributesToObject(e),s={},r={};return i.email&&(i.email_verified?r.email=i.email:s.email=i.email),i.phone_number&&(i.phone_number_verified?r.phone_number=i.phone_number:s.phone_number=i.phone_number),{verified:r,unverified:s}})},e.prototype.isErrorWithMessage=function(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"message")},e.prototype.isTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Access Token has been revoked"===e.message},e.prototype.isRefreshTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has been revoked"===e.message},e.prototype.isUserDisabledError=function(e){return this.isErrorWithMessage(e)&&"User is disabled."===e.message},e.prototype.isUserDoesNotExistError=function(e){return this.isErrorWithMessage(e)&&"User does not exist."===e.message},e.prototype.isRefreshTokenExpiredError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has expired"===e.message},e.prototype.isSignedInHostedUI=function(){return this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI")},e.prototype.isSessionInvalid=function(e){return this.isUserDisabledError(e)||this.isUserDoesNotExistError(e)||this.isTokenRevokedError(e)||this.isRefreshTokenRevokedError(e)||this.isRefreshTokenExpiredError(e)},e.prototype.cleanUpInvalidSession=function(e){return Ue(this,void 0,void 0,function(){var t=this;return ze(this,function(i){switch(i.label){case 0:e.signOut(),this.user=null,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.cleanCachedItems()];case 2:return i.sent(),[3,4];case 3:return i.sent(),je.debug("failed to clear cached items"),[3,4];case 4:return this.isSignedInHostedUI()?[2,new Promise(function(e,i){t.oAuthSignOutRedirect(e,i)})]:(Ye("signOut",this.user,"A user has been signed out"),[2])}})})},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise(function(i,s){t._storageSync.then(function(){return Ue(t,void 0,void 0,function(){var t,r,n=this;return ze(this,function(o){switch(o.label){case 0:return this.isOAuthInProgress()?(je.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise(function(e){var t=setTimeout(function(){je.debug("OAuth signIn in progress timeout"),h.YZ.remove("auth",i),e()},1e4);function i(s){var r=s.payload.event;"cognitoHostedUI"!==r&&"cognitoHostedUI_failure"!==r||(je.debug("OAuth signIn resolved: "+r),clearTimeout(t),h.YZ.remove("auth",i),e())}h.YZ.listen("auth",i)})]):[3,2];case 1:o.sent(),o.label=2;case 2:return(t=this.userPool.getCurrentUser())?(r=this._config.clientMetadata,t.getSession(function(r,o){return Ue(n,void 0,void 0,function(){var n,a,l,c,h=this;return ze(this,function(d){switch(d.label){case 0:if(!r)return[3,5];if(je.debug("Failed to get the user session",r),!this.isSessionInvalid(r))return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return d.sent(),[3,4];case 3:return n=d.sent(),s(new Error("Session is invalid due to: "+r.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return s(r),[2];case 5:return(a=!!e&&e.bypassCache)?[4,this.Credentials.clear()]:[3,7];case 6:d.sent(),d.label=7;case 7:return l=this._config.clientMetadata,(void 0===(c=o.getAccessToken().decodePayload().scope)?"":c).split(" ").includes(Ke)?(t.getUserData(function(e,r){return Ue(h,void 0,void 0,function(){var n,o,a,l,c,h,d;return ze(this,function(u){switch(u.label){case 0:if(!e)return[3,7];if(je.debug("getting user data failed",e),!this.isSessionInvalid(e))return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return u.sent(),[3,4];case 3:return n=u.sent(),s(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return s(e),[3,6];case 5:i(t),u.label=6;case 6:return[2];case 7:for(o=r.PreferredMfaSetting||"NOMFA",a=[],l=0;l<r.UserAttributes.length;l++)c={Name:r.UserAttributes[l].Name,Value:r.UserAttributes[l].Value},h=new se(c),a.push(h);return d=this.attributesToObject(a),Object.assign(t,{attributes:d,preferredMFA:o}),[2,i(t)]}})})},{bypassCache:a,clientMetadata:l}),[2]):(je.debug("Unable to get the user data because the "+Ke+" is not in the scopes of the access token"),[2,i(t)])}})})},{clientMetadata:r}),[2]):(je.debug("Failed to get user from user pool"),s("No current user"),[2])}})})}).catch(function(e){return je.debug("Failed to sync cache info into memory",e),s(e)})}):this.rejectNoUserPool()},e.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},e.prototype.currentAuthenticatedUser=function(e){return Ue(this,void 0,void 0,function(){var t,i,s,r,n;return ze(this,function(o){switch(o.label){case 0:je.debug("getting current authenticated user"),t=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this._storageSync];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),je.debug("Failed to sync cache info into memory",i),i;case 4:try{(s=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")))&&(t=He(He({},s.user),{token:s.token}))}catch(e){je.debug("cannot load federated user from auth storage")}return t?(this.user=t,je.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:je.debug("get current authenticated userpool user"),r=null,o.label=6;case 6:return o.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return r=o.sent(),[3,9];case 8:return"No userPool"===(n=o.sent())&&je.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),je.debug("The user is not authenticated by the error",n),[2,Promise.reject("The user is not authenticated")];case 9:return this.user=r,[2,this.user]}})})},e.prototype.currentSession=function(){var e=this;return je.debug("Getting current session"),this.userPool?new Promise(function(t,i){e.currentUserPoolUser().then(function(s){e.userSession(s).then(function(e){t(e)}).catch(function(e){je.debug("Failed to get the current session",e),i(e)})}).catch(function(e){je.debug("Failed to get the current user",e),i(e)})}):Promise.reject(new Error("No User Pool in the configuration."))},e.prototype.userSession=function(e){var t=this;if(!e)return je.debug("the user is null"),this.rejectAuthError(r.NoUserSession);var i=this._config.clientMetadata;return new Promise(function(s,r){je.debug("Getting the session from this user:",e),e.getSession(function(i,n){return Ue(t,void 0,void 0,function(){var t;return ze(this,function(o){switch(o.label){case 0:if(!i)return[3,5];if(je.debug("Failed to get the session from user",e),!this.isSessionInvalid(i))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return o.sent(),[3,4];case 3:return t=o.sent(),r(new Error("Session is invalid due to: "+i.message+" and failed to clean up invalid session: "+t.message)),[2];case 4:return r(i),[2];case 5:return je.debug("Succeed to get the user session",n),s(n),[2]}})})},{clientMetadata:i})})},e.prototype.currentUserCredentials=function(){return Ue(this,void 0,void 0,function(){var e,t,i=this;return ze(this,function(s){switch(s.label){case 0:je.debug("Getting current user credentials"),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._storageSync];case 2:return s.sent(),[3,4];case 3:throw e=s.sent(),je.debug("Failed to sync cache info into memory",e),e;case 4:t=null;try{t=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(e){je.debug("failed to get or parse item aws-amplify-federatedInfo",e)}return t?[2,this.Credentials.refreshFederatedToken(t)]:[2,this.currentSession().then(function(e){return je.debug("getting session success",e),i.Credentials.set(e,"session")}).catch(function(){return je.debug("getting guest credentials"),i.Credentials.set(null,"guest")})]}})})},e.prototype.currentCredentials=function(){return je.debug("getting current credentials"),this.Credentials.get()},e.prototype.verifyUserAttribute=function(e,t,i){return void 0===i&&(i=this._config.clientMetadata),new Promise(function(s,r){e.getAttributeVerificationCode(t,{onSuccess:function(e){return s(e)},onFailure:function(e){return r(e)}},i)})},e.prototype.verifyUserAttributeSubmit=function(e,t,i){return i?new Promise(function(s,r){e.verifyAttribute(t,i,{onSuccess:function(e){s(e)},onFailure:function(e){r(e)}})}):this.rejectAuthError(r.EmptyCode)},e.prototype.verifyCurrentUserAttribute=function(e){var t=this;return t.currentUserPoolUser().then(function(i){return t.verifyUserAttribute(i,e)})},e.prototype.verifyCurrentUserAttributeSubmit=function(e,t){var i=this;return i.currentUserPoolUser().then(function(s){return i.verifyUserAttributeSubmit(s,e,t)})},e.prototype.cognitoIdentitySignOut=function(e,t){return Ue(this,void 0,void 0,function(){var i,s,r=this;return ze(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this._storageSync];case 1:return n.sent(),[3,3];case 2:throw i=n.sent(),je.debug("Failed to sync cache info into memory",i),i;case 3:return s=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(i,n){if(e&&e.global){je.debug("user global sign out",t);var o=r._config.clientMetadata;t.getSession(function(e,o){return Ue(r,void 0,void 0,function(){var r,o=this;return ze(this,function(a){switch(a.label){case 0:if(!e)return[3,5];if(je.debug("failed to get the user session",e),!this.isSessionInvalid(e))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return a.sent(),[3,4];case 3:return r=a.sent(),n(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+r.message)),[2];case 4:return[2,n(e)];case 5:return t.globalSignOut({onSuccess:function(e){if(je.debug("global sign out success"),!s)return i();o.oAuthSignOutRedirect(i,n)},onFailure:function(e){return je.debug("global sign out failed",e),n(e)}}),[2]}})})},{clientMetadata:o})}else je.debug("user sign out",t),t.signOut(function(){if(!s)return i();r.oAuthSignOutRedirect(i,n)})})]}})})},e.prototype.oAuthSignOutRedirect=function(e,t){(0,g.gy)().isBrowser?this.oAuthSignOutRedirectOrReject(t):this.oAuthSignOutAndResolve(e)},e.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},e.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout(function(){return e(Error("Signout timeout fail"))},3e3)},e.prototype.signOut=function(e){return Ue(this,void 0,void 0,function(){var t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return i.sent(),[3,3];case 2:return i.sent(),je.debug("failed to clear cached items"),[3,3];case 3:return this.userPool?(t=this.userPool.getCurrentUser())?[4,this.cognitoIdentitySignOut(e,t)]:[3,5]:[3,7];case 4:return i.sent(),[3,6];case 5:je.debug("no current Cognito user"),i.label=6;case 6:return[3,8];case 7:je.debug("no Cognito User pool"),i.label=8;case 8:return Ye("signOut",this.user,"A user has been signed out"),this.user=null,[2]}})})},e.prototype.cleanCachedItems=function(){return Ue(this,void 0,void 0,function(){return ze(this,function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}})})},e.prototype.changePassword=function(e,t,i,s){var r=this;return void 0===s&&(s=this._config.clientMetadata),new Promise(function(n,o){r.userSession(e).then(function(r){e.changePassword(t,i,function(e,t){return e?(je.debug("change password failure",e),o(e)):n(t)},s)})})},e.prototype.forgotPassword=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(r.EmptyUsername);var i=this.createCognitoUser(e);return new Promise(function(s,r){i.forgotPassword({onSuccess:function(){s()},onFailure:function(t){je.debug("forgot password failure",t),Ye("forgotPassword_failure",t,e+" forgotPassword failed"),r(t)},inputVerificationCode:function(t){Ye("forgotPassword",i,e+" has initiated forgot password flow"),s(t)}},t)})},e.prototype.forgotPasswordSubmit=function(e,t,i,s){if(void 0===s&&(s=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(r.EmptyUsername);if(!t)return this.rejectAuthError(r.EmptyCode);if(!i)return this.rejectAuthError(r.EmptyPassword);var n=this.createCognitoUser(e);return new Promise(function(r,o){n.confirmPassword(t,i,{onSuccess:function(t){Ye("forgotPasswordSubmit",n,e+" forgotPasswordSubmit successful"),r(t)},onFailure:function(t){Ye("forgotPasswordSubmit_failure",t,e+" forgotPasswordSubmit failed"),o(t)}},s)})},e.prototype.currentUserInfo=function(){return Ue(this,void 0,void 0,function(){var e,t,i,s,r,n,o;return ze(this,function(a){switch(a.label){case 0:return(e=this.Credentials.getCredSource())&&"aws"!==e&&"userPool"!==e?[3,9]:[4,this.currentUserPoolUser().catch(function(e){return je.error(e)})];case 1:if(!(o=a.sent()))return[2,null];a.label=2;case 2:return a.trys.push([2,8,,9]),[4,this.userAttributes(o)];case 3:t=a.sent(),i=this.attributesToObject(t),s=null,a.label=4;case 4:return a.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return s=a.sent(),[3,7];case 6:return r=a.sent(),je.debug("Failed to retrieve credentials while getting current user info",r),[3,7];case 7:return[2,{id:s?s.identityId:void 0,username:o.getUsername(),attributes:i}];case 8:return n=a.sent(),je.error("currentUserInfo error",n),[2,{}];case 9:return"federated"===e?[2,(o=this.user)||{}]:[2]}})})},e.prototype.federatedSignIn=function(e,t,i){return Ue(this,void 0,void 0,function(){var r,n,l,c,h,d,u,p,g,m,f;return ze(this,function(y){switch(y.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if(void 0===e&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return o(e)||(v=e)&&["customProvider"].find(function(e){return v.hasOwnProperty(e)})||function(e){return e&&!!["customState"].find(function(t){return e.hasOwnProperty(t)})}(e)||void 0===e?(r=e||{provider:s.Cognito},h=o(r)?r.provider:r.customProvider,o(r),n=r.customState,this._config.userPoolId&&(l=a(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,c=a(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,c,l,h,n)),[3,4]):[3,1];case 1:h=e;try{(d=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user))&&je.warn("There is already a signed in user: "+d+" in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.")}catch(e){}return u=t.token,p=t.identity_id,g=t.expires_at,[4,this.Credentials.set({provider:h,token:u,identity_id:p,user:i,expires_at:g},"federation")];case 2:return m=y.sent(),[4,this.currentAuthenticatedUser()];case 3:return f=y.sent(),Ye("signIn",f,"A user "+f.username+" has been signed in"),je.debug("federated sign in credentials",m),[2,m];case 4:return[2]}var v})})},e.prototype._handleAuthResponse=function(e){return Ue(this,void 0,void 0,function(){var t,i,s,r,n,o,a,l,c,h,d,u,p,m;return ze(this,function(f){switch(f.label){case 0:if(this.oAuthFlowInProgress)return je.debug("Skipping URL "+e+" current flow in progress"),[2];f.label=1;case 1:if(f.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if(Ye("parsingCallbackUrl",{url:e},"The callback url is being parsed"),t=e||((0,g.gy)().isBrowser?window.location.href:""),i=!!((0,xe.parse)(t).query||"").split("&").map(function(e){return e.split("=")}).find(function(e){var t=We(e,1)[0];return"code"===t||"error"===t}),s=!!((0,xe.parse)(t).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).find(function(e){var t=We(e,1)[0];return"access_token"===t||"error"===t}),!i&&!s)return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),f.label=2;case 2:return f.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(t)];case 3:return r=f.sent(),n=r.accessToken,o=r.idToken,a=r.refreshToken,l=r.state,c=new J({IdToken:new q({IdToken:o}),RefreshToken:new X({RefreshToken:a}),AccessToken:new $({AccessToken:n})}),h=void 0,this._config.identityPoolId?[4,this.Credentials.set(c,"session")]:[3,5];case 4:h=f.sent(),je.debug("AWS credentials",h),f.label=5;case 5:return d=/-/.test(l),(u=this.createCognitoUser(c.getIdToken().decodePayload()["cognito:username"])).setSignInUserSession(c),window&&void 0!==window.history&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),Ye("signIn",u,"A user "+u.getUsername()+" has been signed in"),Ye("cognitoHostedUI",u,"A user "+u.getUsername()+" has been signed in via Cognito Hosted UI"),d&&(p=l.split("-").splice(1).join("-"),Ye("customOAuthState",p.match(/.{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""),"State for user "+u.getUsername())),[2,h];case 6:return m=f.sent(),je.debug("Error in cognito hosted auth response",m),window&&void 0!==window.history&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),Ye("signIn_failure",m,"The OAuth response flow failed"),Ye("cognitoHostedUI_failure",m,"A failure occurred when returning to the Cognito Hosted UI"),Ye("customState_failure",m,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}})})},e.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e.prototype.attributesToObject=function(e){var t=this,i={};return e&&e.map(function(e){"email_verified"===e.Name||"phone_number_verified"===e.Name?i[e.Name]=t.isTruthyString(e.Value)||!0===e.Value:i[e.Name]=e.Value}),i},e.prototype.isTruthyString=function(e){return"function"==typeof e.toLowerCase&&"true"===e.toLowerCase()},e.prototype.createCognitoUser=function(e){var t={Username:e,Pool:this.userPool};t.Storage=this._storage;var i=this._config.authenticationFlowType,s=new le(t);return i&&s.setAuthenticationFlowType(i),s},e.prototype._isValidAuthStorage=function(e){return!!e&&"function"==typeof e.getItem&&"function"==typeof e.setItem&&"function"==typeof e.removeItem&&"function"==typeof e.clear},e.prototype.noUserPoolErrorHandler=function(e){return!e||e.userPoolId&&e.identityPoolId?r.NoConfig:r.MissingAuthConfig},e.prototype.rejectAuthError=function(e){return Promise.reject(new Ge(e))},e.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new Be(e))},e.prototype.rememberDevice=function(){return Ue(this,void 0,void 0,function(){var e,t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=i.sent(),[3,3];case 2:return t=i.sent(),je.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,i){e.setDeviceStatusRemembered({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?i(new Ge(r.DeviceConfig)):"NetworkError"===e.code?i(new Ge(r.NetworkError)):i(e)}})})]}})})},e.prototype.forgetDevice=function(){return Ue(this,void 0,void 0,function(){var e,t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=i.sent(),[3,3];case 2:return t=i.sent(),je.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,i){e.forgetDevice({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?i(new Ge(r.DeviceConfig)):"NetworkError"===e.code?i(new Ge(r.NetworkError)):i(e)}})})]}})})},e.prototype.fetchDevices=function(){return Ue(this,void 0,void 0,function(){var e,t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=i.sent(),[3,3];case 2:throw t=i.sent(),je.debug("The user is not authenticated by the error",t),new Error("The user is not authenticated");case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,i){var s={onSuccess:function(e){var i=e.Devices.map(function(e){var t=e.DeviceAttributes.find(function(e){return"device_name"===e.Name})||{};return{id:e.DeviceKey,name:t.Value}});t(i)},onFailure:function(e){"InvalidParameterException"===e.code?i(new Ge(r.DeviceConfig)):"NetworkError"===e.code?i(new Ge(r.NetworkError)):i(e)}};e.listDevices(60,null,s)})]}})})},e}(),Xe=new qe(null);v.HA.register(Xe)},78953(e,t,i){"use strict";i.d(t,{HA:()=>n});var s=i(15567),r=new s.C("Amplify"),n=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=s.C,this.ServiceWorker=null}return e.prototype.register=function(e){r.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):r.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),r.debug("amplify config",this._config),Object.entries(this._modules).forEach(function(e){var i=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}(e,2),s=(i[0],i[1]);Object.keys(s).forEach(function(e){t._modules[e]&&(s[e]=t._modules[e])})}),this._components.map(function(e){e.configure(t._config)}),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map(function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)})},e}())},11351(e,t,i){"use strict";i.d(t,{Ji:()=>Ut});var s,r,n,o,a,l,c,h,d,u,p,g,m,f,y,v,C,b,S,w,x,E,M,A,T,D,I,R,P,k,L,N,_,O,F,G,B,V,H,U,z,W,j,K,$,Y,q,X,Z,Q,J,ee,te,ie,se,re,ne,oe,ae=i(15567),le=i(75315),ce=i(51678),he=(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),de=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},ue=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},pe=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},ge=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(pe(arguments[t]));return e},me=new ae.C("Util"),fe=function(e){function t(t){var i=e.call(this,t)||this;return i.nonRetryable=!0,i}return he(t,e),t}(Error),ye=3e5,ve=new ae.C("CognitoCredentials"),Ce=new Promise(function(e,t){return(0,ce.gy)().isBrowser?window.gapi&&window.gapi.auth2&&window.gapi.auth2?(ve.debug("google api already loaded"),e()):void setTimeout(function(){return e()},2e3):(ve.debug("not in the browser, directly resolved"),e())}),be=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return e=this,t=void 0,s=function(){return function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(ve.debug("need to wait for the Google SDK loaded"),[4,Ce]);case 1:e.sent(),this.initialized=!0,ve.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}})},new((i=void 0)||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())});var e,t,i,s},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return(0,ce.gy)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise(function(t,i){e.getAuthInstance().then(function(e){e||(ve.debug("google Auth undefined"),i(new fe("google Auth undefined")));var s=e.currentUser.get();s.isSignedIn()?(ve.debug("refreshing the google access token"),s.reloadAuthResponse().then(function(e){var i=e.id_token,s=e.expires_at;t({token:i,expires_at:s})}).catch(function(e){e&&"network_error"===e.error?i("Network error reloading google auth response"):i(new fe("Failed to reload google auth response"))})):i(new fe("User is not signed in with Google"))}).catch(function(e){ve.debug("Failed to refresh google token",e),i(new fe("Failed to refresh google token"))})}):(ve.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),Se=new ae.C("CognitoCredentials"),we=new Promise(function(e,t){return(0,ce.gy)().isBrowser?window.FB?(Se.debug("FB SDK already loaded"),e()):void setTimeout(function(){return e()},2e3):(Se.debug("not in the browser, directly resolved"),e())}),xe=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return e=this,t=void 0,s=function(){return function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Se.debug("need to wait for the Facebook SDK loaded"),[4,we]);case 1:e.sent(),this.initialized=!0,Se.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}})},new((i=void 0)||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())});var e,t,i,s},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if((0,ce.gy)().isBrowser&&(e=window.FB),!e){var t="no fb sdk available";return Se.debug(t),Promise.reject(new fe(t))}return new Promise(function(t,i){e.getLoginStatus(function(e){if(e&&e.authResponse){var s=e.authResponse,r=s.accessToken,n=1e3*s.expiresIn+(new Date).getTime();r||(o="the jwtToken is undefined",Se.debug(o),i(new fe(o))),t({token:r,expires_at:n})}else{var o="no response from facebook when refreshing the jwt token";Se.debug(o),i(new fe(o))}},{scope:"public_profile,email"})})},e}(),Ee=new be,Me=new xe,Ae=i(78953),Te=i(65927),De=i(65959);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(r||(r={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(n||(n={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(o||(o={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(a||(a={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(l||(l={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(c||(c={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(h||(h={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(d||(d={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(u||(u={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(p||(p={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(g||(g={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(m||(m={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(f||(f={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(y||(y={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(v||(v={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(C||(C={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(b||(b={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(S||(S={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(w||(w={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(x||(x={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(E||(E={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(M||(M={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(A||(A={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(T||(T={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(D||(D={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(I||(I={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(R||(R={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(P||(P={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(k||(k={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(L||(L={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(N||(N={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(_||(_={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(O||(O={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(F||(F={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(G||(G={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(B||(B={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(V||(V={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(H||(H={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(U||(U={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(z||(z={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(W||(W={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(j||(j={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(K||(K={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}($||($={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(Y||(Y={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(q||(q={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(X||(X={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(Z||(Z={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(Q||(Q={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(J||(J={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(ee||(ee={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(te||(te={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(ie||(ie={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(se||(se={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(re||(re={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(ne||(ne={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(oe||(oe={}));var Ie=i(59027),Re=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h,d,u,p,g,m,f;return(0,De.__generator)(this,function(y){switch(y.label){case 0:return s=[(0,De.__assign)({},e)],f={},[4,et(e.body,t)];case 1:switch(i=De.__assign.apply(void 0,s.concat([(f.body=y.sent(),f)])),n="UnknownError",n=tt(e,i.body)){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return o=[{}],[4,ke(i,t)];case 3:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,o.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 4:return a=[{}],[4,Le(i,t)];case 5:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,a.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 6:return l=[{}],[4,Ne(i,t)];case 7:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,l.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 8:return c=[{}],[4,_e(i,t)];case 9:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,c.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 10:return h=[{}],[4,Fe(i,t)];case 11:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,h.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 12:return d=[{}],[4,Ge(i,t)];case 13:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,d.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 14:return u=[{}],[4,Be(i,t)];case 15:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,u.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 16:return p=[{}],[4,Ve(i,t)];case 17:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,p.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 18:g=i.body,n=g.code||g.Code||n,r=(0,De.__assign)((0,De.__assign)({},g),{name:""+n,message:g.message||g.Message||n,$fault:"client",$metadata:Qe(e)}),y.label=19;case 19:return m=r.message||r.Message||n,r.message=m,delete r.Message,[2,Promise.reject(Object.assign(new Error(m),r))]}})})},Pe=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s,r,n,o,a,l,c,h,d,u,p,g,m,f;return(0,De.__generator)(this,function(y){switch(y.label){case 0:return s=[(0,De.__assign)({},e)],f={},[4,et(e.body,t)];case 1:switch(i=De.__assign.apply(void 0,s.concat([(f.body=y.sent(),f)])),n="UnknownError",n=tt(e,i.body)){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return o=[{}],[4,ke(i,t)];case 3:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,o.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 4:return a=[{}],[4,Le(i,t)];case 5:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,a.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 6:return l=[{}],[4,_e(i,t)];case 7:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,l.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 8:return c=[{}],[4,Oe(i,t)];case 9:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,c.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 10:return h=[{}],[4,Fe(i,t)];case 11:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,h.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 12:return d=[{}],[4,Ge(i,t)];case 13:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,d.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 14:return u=[{}],[4,Be(i,t)];case 15:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,u.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 16:return p=[{}],[4,Ve(i,t)];case 17:return r=De.__assign.apply(void 0,[De.__assign.apply(void 0,p.concat([y.sent()])),{name:n,$metadata:Qe(e)}]),[3,19];case 18:g=i.body,n=g.code||g.Code||n,r=(0,De.__assign)((0,De.__assign)({},g),{name:""+n,message:g.message||g.Message||n,$fault:"client",$metadata:Qe(e)}),y.label=19;case 19:return m=r.message||r.Message||n,r.message=m,delete r.Message,[2,Promise.reject(Object.assign(new Error(m),r))]}})})},ke=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=ze(i,t),[2,(0,De.__assign)({name:"ExternalServiceException",$fault:"client",$metadata:Qe(e)},s)]})})},Le=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=We(i,t),[2,(0,De.__assign)({name:"InternalErrorException",$fault:"server",$metadata:Qe(e)},s)]})})},Ne=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=je(i,t),[2,(0,De.__assign)({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Qe(e)},s)]})})},_e=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=Ke(i,t),[2,(0,De.__assign)({name:"InvalidParameterException",$fault:"client",$metadata:Qe(e)},s)]})})},Oe=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=$e(i,t),[2,(0,De.__assign)({name:"LimitExceededException",$fault:"client",$metadata:Qe(e)},s)]})})},Fe=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=Ye(i,t),[2,(0,De.__assign)({name:"NotAuthorizedException",$fault:"client",$metadata:Qe(e)},s)]})})},Ge=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=qe(i,t),[2,(0,De.__assign)({name:"ResourceConflictException",$fault:"client",$metadata:Qe(e)},s)]})})},Be=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=Xe(i,t),[2,(0,De.__assign)({name:"ResourceNotFoundException",$fault:"client",$metadata:Qe(e)},s)]})})},Ve=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i=e.body,s=Ze(i,t),[2,(0,De.__assign)({name:"TooManyRequestsException",$fault:"client",$metadata:Qe(e)},s)]})})},He=function(e,t){return Object.entries(e).reduce(function(e,t){var i,s=(0,De.__read)(t,2),r=s[0],n=s[1];return null===n?e:(0,De.__assign)((0,De.__assign)({},e),((i={})[r]=n,i))},{})},Ue=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},ze=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},We=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},je=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ke=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},$e=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ye=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},qe=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Xe=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ze=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Qe=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Je=function(e,t,i,s,r){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var n,o,a,l,c,h;return(0,De.__generator)(this,function(d){switch(d.label){case 0:return[4,e.endpoint()];case 1:return n=d.sent(),o=n.hostname,a=n.protocol,l=void 0===a?"https":a,c=n.port,h={protocol:l,hostname:o,port:c,method:"POST",path:i,headers:t},void 0!==s&&(h.hostname=s),void 0!==r&&(h.body=r),[2,new Ie.Kd(h)]}})})},et=function(e,t){return function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then(function(e){return t.utf8Encoder(e)})}(e,t).then(function(e){return e.length?JSON.parse(e):{}})},tt=function(e,t){var i,s=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(i=e.headers,Object.keys(i).find(function(e){return e.toLowerCase()==="x-amzn-errortype".toLowerCase()}));return void 0!==r?s(e.headers[r]):void 0!==t.code?s(t.code):void 0!==t.__type?s(t.__type):""},it=i(74052),st=i(11538),rt=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,De.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,it.TM)(t,this.serialize,this.deserialize));var s=e.concat(this.middlewareStack),r={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:E.filterSensitiveLog,outputFilterSensitiveLog:A.filterSensitiveLog},n=t.requestHandler;return s.resolve(function(e){return n.handle(e.request,i||{})},r)},t.prototype.serialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},s=JSON.stringify(function(e,t){return(0,De.__assign)((0,De.__assign)((0,De.__assign)({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:He(e.Logins,t)})}(e,t)),[2,Je(t,i,"/",void 0,s)]})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s,r;return(0,De.__generator)(this,function(n){switch(n.label){case 0:return e.statusCode>=300?[2,Re(e,t)]:[4,et(e.body,t)];case 1:return i=n.sent(),s=function(e){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?Ue(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}}(i),r=(0,De.__assign)({$metadata:Qe(e)},s),[2,Promise.resolve(r)]}})})}(e,t)},t}(st.uB),nt=function(e){function t(t,i){void 0===i&&(i=!0);var s=e.call(this,t)||this;return s.tryNextLink=i,s}return(0,Te.__extends)(t,e),t}(Error);function ot(e){return Promise.all(Object.keys(e).reduce(function(t,i){var s=e[i];return"string"==typeof s?t.push([i,s]):t.push(s().then(function(e){return[i,e]})),t},[])).then(function(e){return e.reduce(function(e,t){var i=(0,Te.__read)(t,2),s=i[0],r=i[1];return e[s]=r,e},{})})}function at(e){var t=this;return function(){return(0,Te.__awaiter)(t,void 0,void 0,function(){var t,i,s,r,n,o,a,l,c,h,d,u,p;return(0,Te.__generator)(this,function(g){switch(g.label){case 0:return h=(c=e.client).send,d=rt.bind,p={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,ot(e.logins)]:[3,2];case 1:return u=g.sent(),[3,3];case 2:u=void 0,g.label=3;case 3:return[4,h.apply(c,[new(d.apply(rt,[void 0,(p.Logins=u,p)]))])];case 4:return t=g.sent().Credentials,i=void 0===t?function(){throw new nt("Response from Amazon Cognito contained no credentials")}():t,s=i.AccessKeyId,r=void 0===s?function(){throw new nt("Response from Amazon Cognito contained no access key ID")}():s,n=i.Expiration,o=i.SecretKey,a=void 0===o?function(){throw new nt("Response from Amazon Cognito contained no secret key")}():o,l=i.SessionToken,[2,{identityId:e.identityId,accessKeyId:r,secretAccessKey:a,sessionToken:l,expiration:n}]}})})}}var lt=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,De.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,it.TM)(t,this.serialize,this.deserialize));var s=e.concat(this.middlewareStack),r={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:D.filterSensitiveLog,outputFilterSensitiveLog:I.filterSensitiveLog},n=t.requestHandler;return s.resolve(function(e){return n.handle(e.request,i||{})},r)},t.prototype.serialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s;return(0,De.__generator)(this,function(r){return i={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},s=JSON.stringify(function(e,t){return(0,De.__assign)((0,De.__assign)((0,De.__assign)({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:He(e.Logins,t)})}(e,t)),[2,Je(t,i,"/",void 0,s)]})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,s,r;return(0,De.__generator)(this,function(n){switch(n.label){case 0:return e.statusCode>=300?[2,Pe(e,t)]:[4,et(e.body,t)];case 1:return i=n.sent(),s=function(e){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}}(i),r=(0,De.__assign)({$metadata:Qe(e)},s),[2,Promise.resolve(r)]}})})}(e,t)},t}(st.uB),ct="IdentityIds",ht=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",function(t){var i=t.get(e);return new Promise(function(e){i.onerror=function(){return e(null)},i.onsuccess=function(){return e(i.result?i.result.value:null)}})}).catch(function(){return null})},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",function(t){var i=t.delete(e);return new Promise(function(e,t){i.onerror=function(){return t(i.error)},i.onsuccess=function(){return e()}})})},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",function(i){var s=i.put({id:e,value:t});return new Promise(function(e,t){s.onerror=function(){return t(s.error)},s.onsuccess=function(){return e()}})})},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise(function(t,i){e.onsuccess=function(){t(e.result)},e.onerror=function(){i(e.error)},e.onblocked=function(){i(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){i(new Error("Failed to create object store"))},t.createObjectStore(ct,{keyPath:"id"})}})},e.prototype.withObjectStore=function(e,t){return this.getDb().then(function(i){var s=i.transaction(ct,e);return s.oncomplete=function(){return i.close()},new Promise(function(e,i){s.onerror=function(){return i(s.error)},e(t(s.objectStore(ct)))}).catch(function(e){throw i.close(),e})})},e}(),dt=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());var ut=i(54218),pt=i(22292),gt=i(10078),mt=i(16307),ft=i(68380),yt=i(93972),vt=i(39448),Ct=i(31643),bt="cognito-identity.{region}.amazonaws.com",St=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),wt=new Set(["cn-north-1","cn-northwest-1"]),xt=new Set(["us-iso-east-1"]),Et=new Set(["us-isob-east-1"]),Mt=new Set(["us-gov-east-1","us-gov-west-1"]),At={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var i=void 0;switch(e){case"ap-northeast-1":i={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":i={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":i={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":i={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":i={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":i={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":i={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":i={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":i={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":i={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":i={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":i={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":i={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":i={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":i={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":i={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":i={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":i={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":i={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":i={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":i={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":i={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:St.has(e)&&(i={hostname:bt.replace("{region}",e),partition:"aws"}),wt.has(e)&&(i={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),xt.has(e)&&(i={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Et.has(e)&&(i={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Mt.has(e)&&(i={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===i&&(i={hostname:bt.replace("{region}",e),partition:"aws"})}return Promise.resolve((0,De.__assign)({signingService:"cognito-identity"},i))},serviceId:"Cognito Identity",urlParser:i(2049).D},Tt=(0,De.__assign)((0,De.__assign)({},At),{runtime:"browser",base64Decoder:ft.E,base64Encoder:ft.n,bodyLengthChecker:yt.n,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:(0,vt.m)({serviceId:At.serviceId,clientVersion:"3.6.1"}),maxAttempts:mt.Gz,region:(0,gt.B)("Region is missing"),requestHandler:new pt.N,sha256:ut.Sha256,streamCollector:pt.k,utf8Decoder:Ct.fromUtf8,utf8Encoder:Ct.toUtf8}),Dt=i(85775),It=i(23788),Rt=i(14188),Pt=i(64996),kt=i(88428),Lt=i(44625),Nt=function(e){function t(t){var i=this,s=(0,De.__assign)((0,De.__assign)({},Tt),t),r=(0,Dt.TD)(s),n=(0,Dt.vJ)(r),o=(0,kt.k9)(n),a=(0,mt.$z)(o),l=(0,Rt.OV)(a),c=(0,Lt.Dc)(l);return(i=e.call(this,c)||this).config=c,i.middlewareStack.use((0,mt.ey)(i.config)),i.middlewareStack.use((0,It.vK)(i.config)),i.middlewareStack.use((0,Rt.TC)(i.config)),i.middlewareStack.use((0,Pt.Y7)(i.config)),i.middlewareStack.use((0,Lt.sM)(i.config)),i}return(0,De.__extends)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(st.Kj),_t=i(41547),Ot=function(){return Ot=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ot.apply(this,arguments)};function Ft(e){var t=new Nt({region:e.region,customUserAgent:(0,_t.fE)()});return t.middlewareStack.add(function(e,t){return function(t){return e(function(e){return Ot(Ot({},e),{request:Ot(Ot({},e.request),{headers:Ot(Ot({},e.request.headers),{"cache-control":"no-store"})})})}(t))}},{step:"build",name:"cacheControlMiddleWare"}),t}var Gt=function(){return Gt=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Gt.apply(this,arguments)},Bt=function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},Vt=function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},Ht=new ae.C("Credentials"),Ut=new(function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=Ee.refreshGoogleToken,this._refreshHandlers.facebook=Me.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Gt(Gt({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new le.i1).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Ht.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return Ht.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Ht.debug("getting old cred promise"):(Ht.debug("getting new cred promise"),this._gettingCredPromise=(0,ce.VN)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Bt(this,void 0,void 0,function(){var e,t,i,s,r,n,o;return Vt(this,function(a){switch(a.label){case 0:if(Ht.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Ht.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Ht.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(i=void 0===t?Ae.HA.Auth:t)||"function"!=typeof i.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Ht.debug("ttl has passed but token is not yet expired"),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,i.currentUserPoolUser()];case 2:return s=a.sent(),[4,i.currentSession()];case 3:return r=a.sent(),n=r.refreshToken,[4,new Promise(function(e,t){s.refreshSession(n,function(i,s){return i?t(i):e(s)})})];case 4:return a.sent(),[3,6];case 5:return o=a.sent(),Ht.debug("Error attempting to refreshing the session",o),[3,6];case 6:return[2,i.currentUserCredentials()]}})})},e.prototype.refreshFederatedToken=function(e){Ht.debug("Getting federated credentials");var t=e.provider,i=e.user,s=e.token,r=e.identity_id,n=e.expires_at;n=1970===new Date(n).getFullYear()?1e3*n:n;var o=this;return Ht.debug("checking if federated jwt token expired"),n>(new Date).getTime()?(Ht.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:s,user:i,identity_id:r,expires_at:n})):o._refreshHandlers[t]&&"function"==typeof o._refreshHandlers[t]?(Ht.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:o._refreshHandlers[t],provider:t,user:i})):(Ht.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t,i,s,r,n=this,o=e.refreshHandler,a=e.provider,l=e.user;return(t=o,i=[],s=1e4,void 0===s&&(s=ye),function(e,t,i,s){return de(this,void 0,void 0,function(){var r=this;return ue(this,function(n){if("function"!=typeof e)throw Error("functionToRetry must be a function");return[2,new Promise(function(n,o){return de(r,void 0,void 0,function(){var r,a,l,c,h,d,u;return ue(this,function(p){switch(p.label){case 0:r=0,a=!1,c=function(){},s&&s.then(function(){a=!0,clearTimeout(l),c()}),d=function(){var s,d,u,p;return ue(this,function(g){switch(g.label){case 0:r++,me.debug(e.name+" attempt #"+r+" with this vars: "+JSON.stringify(t)),g.label=1;case 1:return g.trys.push([1,3,,7]),s={},d=n,[4,e.apply(void 0,ge(t))];case 2:return[2,(s.value=d.apply(void 0,[g.sent()]),s)];case 3:return u=g.sent(),h=u,me.debug("error on "+e.name,u),(m=u)&&m.nonRetryable?(me.debug(e.name+" non retryable error",u),[2,{value:o(u)}]):(p=i(r,t,u),me.debug(e.name+" retrying in "+p+" ms"),!1===p||a?[2,{value:o(u)}]:[3,4]);case 4:return[4,new Promise(function(e){c=e,l=setTimeout(c,p)})];case 5:g.sent(),g.label=6;case 6:return[3,7];case 7:return[2]}var m})},p.label=1;case 1:return a?[3,3]:[5,d()];case 2:return"object"==typeof(u=p.sent())?[2,u.value]:[3,1];case 3:return o(h),[2]}})})})]})})}(t,i,function(e){return void 0===e&&(e=ye),function(t){var i=100*Math.pow(2,t)+100*Math.random();return!(i>e)&&i}}(s),r)).then(function(e){return Ht.debug("refresh federated token sucessfully",e),n._setCredentialsFromFederation({provider:a,token:e.token,user:l,identity_id:e.identity_id,expires_at:e.expires_at})}).catch(function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||n.clear(),Ht.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)})},e.prototype._isExpired=function(e){if(!e)return Ht.debug("no credentials for expiration check"),!0;Ht.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return Bt(this,void 0,void 0,function(){var e,t,i,s,r,n,o,a,l=this;return Vt(this,function(c){switch(c.label){case 0:return Ht.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,i=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?i?(r=this,[4,this._getGuestIdentityId()]):(Ht.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Ht.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return s=r._identityId=c.sent(),n=Ft({region:i}),o=void 0,s?o=at({identityId:s,client:n})():(a=function(){return Bt(l,void 0,void 0,function(){var e;return Vt(this,function(i){switch(i.label){case 0:return[4,n.send(new lt({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,[2,at({client:n,identityId:e})()]}})})},o=a().catch(function(e){return Bt(l,void 0,void 0,function(){return Vt(this,function(t){throw e})})})),[2,this._loadCredentials(o,"guest",!1,null).then(function(e){return e}).catch(function(e){return Bt(l,void 0,void 0,function(){var i,r=this;return Vt(this,function(a){switch(a.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+s+"' not found."?[3,2]:(Ht.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return a.sent(),i=function(){return Bt(r,void 0,void 0,function(){var e;return Vt(this,function(i){switch(i.label){case 0:return[4,n.send(new lt({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,[2,at({client:n,identityId:e})()]}})})},o=i().catch(function(e){return Bt(r,void 0,void 0,function(){return Vt(this,function(t){throw e})})}),[2,this._loadCredentials(o,"guest",!1,null)];case 2:return[2,e]}})})})]}})})},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,i=e.token,s=e.identity_id,r={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!r)return Promise.reject("You must specify a federated provider");var n={};n[r]=i;var o=this._config,a=o.identityPoolId,l=o.region;if(!a)return Ht.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!l)return Ht.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=Ft({region:l}),h=void 0;return h=s?at({identityId:s,logins:n,client:c})():function(e){var t=this,i=e.accountId,s=e.cache,r=void 0===s?"object"==typeof self&&self.indexedDB?new ht:"object"==typeof window&&window.localStorage?window.localStorage:dt:s,n=e.client,o=e.customRoleArn,a=e.identityPoolId,l=e.logins,c=e.userIdentifier,h=void 0===c?l&&0!==Object.keys(l).length?void 0:"ANONYMOUS":c,d=h?"aws:cognito-identity-credentials:"+a+":"+h:void 0,u=function(){return(0,Te.__awaiter)(t,void 0,void 0,function(){var e,t,s,c,h,p,g,m,f;return(0,Te.__generator)(this,function(y){switch(y.label){case 0:return(t=d)?[4,r.getItem(d)]:[3,2];case 1:t=y.sent(),y.label=2;case 2:return(e=t)?[3,7]:(p=(h=n).send,g=lt.bind,f={AccountId:i,IdentityPoolId:a},l?[4,ot(l)]:[3,4]);case 3:return m=y.sent(),[3,5];case 4:m=void 0,y.label=5;case 5:return[4,p.apply(h,[new(g.apply(lt,[void 0,(f.Logins=m,f)]))])];case 6:s=y.sent().IdentityId,c=void 0===s?function(){throw new nt("Response from Amazon Cognito contained no identity ID")}():s,e=c,d&&Promise.resolve(r.setItem(d,e)).catch(function(){}),y.label=7;case 7:return[2,(u=at({client:n,customRoleArn:o,logins:l,identityId:e}))()]}})})};return function(){return u().catch(function(e){return(0,Te.__awaiter)(t,void 0,void 0,function(){return(0,Te.__generator)(this,function(t){throw d&&Promise.resolve(r.removeItem(d)).catch(function(){}),e})})})}}({logins:n,identityPoolId:a,client:c})(),this._loadCredentials(h,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Ht.debug("set credentials from session");var i=e.getIdToken().getJwtToken(),s=this._config,r=s.region,n=s.userPoolId,o=s.identityPoolId;if(!o)return Ht.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!r)return Ht.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var a={};a["cognito-idp."+r+".amazonaws.com/"+n]=i;var l=Ft({region:r}),c=Bt(t,void 0,void 0,function(){var e,t,i,s,r,n,c,h,d,u;return Vt(this,function(p){switch(p.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=p.sent())?[3,3]:[4,l.send(new lt({IdentityPoolId:o,Logins:a}))];case 2:i=p.sent().IdentityId,t=i,p.label=3;case 3:return[4,l.send(new rt({IdentityId:e||t,Logins:a}))];case 4:return s=p.sent(),r=s.Credentials,n=r.AccessKeyId,c=r.Expiration,h=r.SecretKey,d=r.SessionToken,u=s.IdentityId,this._identityId=u,e?(Ht.debug("The guest identity "+e+" has been successfully linked to the logins"),e===u&&Ht.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:p.sent(),p.label=6;case 6:return[2,{accessKeyId:n,secretAccessKey:h,sessionToken:d,expiration:c,identityId:u}]}})}).catch(function(e){return Bt(t,void 0,void 0,function(){return Vt(this,function(t){throw e})})});return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,i,s){var r=this,n=this;return new Promise(function(o,a){e.then(function(e){return Bt(r,void 0,void 0,function(){var r,a,l,c,h;return Vt(this,function(d){switch(d.label){case 0:if(Ht.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),n._credentials=e,n._credentials.authenticated=i,n._credentials_source=t,n._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){r=Object.assign({id:this._credentials.identityId},s.user),a=s.provider,l=s.token,c=s.expires_at,h=s.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:a,token:l,user:r,expires_at:c,identity_id:h}))}catch(e){Ht.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:d.sent(),d.label=2;case 2:return o(n._credentials),[2]}})})}).catch(function(t){if(t)return Ht.debug("Failed to load credentials",e),Ht.debug("Error loading credentials",t),void a(t)})})},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Ht.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Bt(this,void 0,void 0,function(){return Vt(this,function(e){return this._credentials=null,this._credentials_source=null,Ht.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]})})},e.prototype._getGuestIdentityId=function(){return Bt(this,void 0,void 0,function(){var e,t;return Vt(this,function(i){switch(i.label){case 0:e=this._config.identityPoolId,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._storageSync];case 2:return i.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=i.sent(),Ht.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}})})},e.prototype._setGuestIdentityId=function(e){return Bt(this,void 0,void 0,function(){var t,i;return Vt(this,function(s){switch(s.label){case 0:t=this._config.identityPoolId,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._storageSync];case 2:return s.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return i=s.sent(),Ht.debug("Failed to cache guest identityId",i),[3,4];case 4:return[2]}})})},e.prototype._removeGuestIdentityId=function(){return Bt(this,void 0,void 0,function(){var e;return Vt(this,function(t){return e=this._config.identityPoolId,Ht.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]})})},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}())(null);Ae.HA.register(Ut)},51718(e,t,i){"use strict";i.d(t,{YZ:()=>c});var s=i(15567),r=function(){return r=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},n=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},o=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},a=new s.C("Hub"),l="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",c=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var i=this.patterns.find(function(t){return t.pattern.source===e.source});if(!i)return void a.warn("No listeners for "+e);this.patterns=o(this.patterns.filter(function(e){return e!==i}))}else{var s=this.listeners[e];if(!s)return void a.warn("No listeners for "+e);this.listeners[e]=o(s.filter(function(e){return e.callback!==t}))}},e.prototype.dispatch=function(e,t,i,s){void 0===i&&(i=""),this.protectedChannels.indexOf(e)>-1&&(s===l||a.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var n={channel:e,payload:r({},t),source:i,patternInfo:[]};try{this._toListeners(n)}catch(e){a.error(e)}},e.prototype.listen=function(e,t,i){var s,r=this;if(void 0===i&&(i="noname"),function(e){return void 0!==e.onHubCapsule}(t))a.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),s=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");s=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:s});else{var n=this.listeners[e];n||(n=[],this.listeners[e]=n),n.push({name:i,callback:s})}return function(){r.remove(e,s)}},e.prototype._toListeners=function(e){var t=e.channel,i=e.payload,s=this.listeners[t];if(s&&s.forEach(function(s){a.debug("Dispatching to "+t+" with ",i);try{s.callback(e)}catch(e){a.error(e)}}),this.patterns.length>0){if(!i.message)return void a.warn("Cannot perform pattern matching without a message key");var o=i.message;this.patterns.forEach(function(t){var i=o.match(t.pattern);if(i){var s=n(i).slice(1),l=r(r({},e),{patternInfo:s});try{t.callback(l)}catch(e){a.error(e)}}})}},e}())("__default__")},51678(e,t,i){"use strict";i.d(t,{JS:()=>y,VN:()=>d,gy:()=>p});var s=i(85409),r=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],n=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,i){if(!e||!e.sort)return!1;var s=i&&"desc"===i?-1:1;return e.sort(function(e,i){var r=e[t],n=i[t];return void 0===n?void 0===r?0:1*s:void 0===r||r<n?-1*s:r>n?1*s:0}),!0},a=function(e,t){var i=Object.assign({},e);return t&&("string"==typeof t?delete i[t]:t.forEach(function(e){delete i[e]})),i},l=function(e,t){void 0===t&&(t="application/octet-stream");var i=e.toLowerCase(),s=r.filter(function(e){return i.endsWith("."+e.ext)});return s.length>0?s[0].type:t},c=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||"application/json"===t||"application/xml"===t||"application/sh"===t},h=function(){for(var e="",t=32;t>0;t-=1)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return e},d=function(e){if(e.isResolved)return e;var t=!0,i=!1,s=!1,r=e.then(function(e){return s=!0,t=!1,e},function(e){throw i=!0,t=!1,e});return r.isFullfilled=function(){return s},r.isPending=function(){return t},r.isRejected=function(){return i},r},u=function(){if("undefined"==typeof self)return!1;var e=self;return void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},p=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:void 0!==s&&null!=s.versions&&null!=s.versions.node}},g=function(e,t,i){if(void 0===t&&(t=[]),void 0===i&&(i=[]),!f(e))return e;var s={};for(var r in e)e.hasOwnProperty(r)&&(s[t.includes(r)?r:r[0].toLowerCase()+r.slice(1)]=i.includes(r)?e[r]:g(e[r],t,i));return s},m=function(e,t,i){if(void 0===t&&(t=[]),void 0===i&&(i=[]),!f(e))return e;var s={};for(var r in e)e.hasOwnProperty(r)&&(s[t.includes(r)?r:r[0].toUpperCase()+r.slice(1)]=i.includes(r)?e[r]:m(e[r],t,i));return s},f=function(e){return!(!(e instanceof Object)||e instanceof Array||e instanceof Function||e instanceof Number||e instanceof String||e instanceof Boolean)},y=function(){function e(){}return e.isEmpty=n,e.sortByField=o,e.objectLessAttributes=a,e.filenameToContentType=l,e.isTextFile=c,e.generateRandomString=h,e.makeQuerablePromise=d,e.isWebWorker=u,e.browserOrNode=p,e.transferKeyToLowerCase=g,e.transferKeyToUpperCase=m,e.isStrictObject=f,e}()},15567(e,t,i){"use strict";i.d(t,{C:()=>a});var s,r=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,r,n=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o},n=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(s||(s={}));var a=function(){function e(e,t){void 0===t&&(t=s.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var i,r,n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var l=this.level;if(e.LOG_LEVEL&&(l=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(l=window.LOG_LEVEL),o[t]>=o[l]){var c=console.log.bind(console);t===s.ERROR&&console.error&&(c=console.error.bind(console)),t===s.WARN&&console.warn&&(c=console.warn.bind(console));var h="["+t+"] "+this._ts()+" "+this.name,d="";if(1===n.length&&"string"==typeof n[0])c(d=h+" - "+n[0]);else if(1===n.length)d=h+" "+n[0],c(h,n[0]);else if("string"==typeof n[0]){var u=n.slice(1);1===u.length&&(u=u[0]),d=h+" - "+n[0]+" "+u,c(h+" - "+n[0],u)}else d=h+" "+n,c(h,n);try{for(var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],s=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._pluggables),g=p.next();!g.done;g=p.next()){var m=g.value,f={message:d,timestamp:Date.now()};m.pushLogs([f])}}catch(e){i={error:e}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,n([s.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,n([s.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,n([s.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,n([s.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,n([s.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,n([s.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&"Logging"===e.getCategoryName()&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}()},410(e,t,i){"use strict";i.d(t,{iX:()=>a});var s=i(15567),r=function(){return r=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},n=new s.C("Parser"),o=function(e){var t,i={};if(e.aws_mobile_analytics_app_id){var s={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};i.Analytics=s}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(i.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in,signUpVerificationMethod:e.aws_cognito_sign_up_verification_method||"code"}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(i.Logging=r(r({},e.Logging),{region:e.aws_project_region})),e.geo&&(i.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(i.Geo={AmazonLocationService:e.geo.amazon_location_service})),i.Analytics=Object.assign({},i.Analytics,e.Analytics),i.Auth=Object.assign({},i.Auth,e.Auth),i.Storage=Object.assign({},t),i.Logging=Object.assign({},i.Logging,e.Logging),n.debug("parse config",e,"to amplifyconfig",i),i},a=function(){function e(){}return e.parseMobilehubConfig=o,e}()},41547(e,t,i){"use strict";i.d(t,{fE:()=>n});var s="aws-amplify/4.7.14",r={userAgent:s+" js",product:"",navigator:null,isReactNative:!1};"undefined"!=typeof navigator&&navigator.product&&(r.product=navigator.product||"",r.navigator=navigator||null,"ReactNative"===navigator.product?(r.userAgent=s+" react-native",r.isReactNative=!0):(r.userAgent=s+" js",r.isReactNative=!1));var n=function(e){return""+r.userAgent+(e||"")}},75315(e,t,i){"use strict";i.d(t,{i1:()=>n});var s={},r=function(){function e(){}return e.setItem=function(e,t){return s[e]=t,s[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(s,e)?s[e]:void 0},e.removeItem=function(e){return delete s[e]},e.clear=function(){return s={}},e}(),n=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=r}}return e.prototype.getStorage=function(){return this.storageWindow},e}()},56692(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36637(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},21516(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19840(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},15784(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var i=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,s=t.getRandomValues,r=t.subtle;return i.map(function(e){return r[e]}).concat(s).every(function(e){return"function"==typeof e})}return!1}},10098(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(65927);s.__exportStar(i(56692),t),s.__exportStar(i(36637),t),s.__exportStar(i(21516),t),s.__exportStar(i(19840),t),s.__exportStar(i(15784),t)},90843(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},87098(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var s=i(25515),r=i(22038),n=i(18558),o=i(91014),a=i(10098),l=i(1632),c=function(){function e(e){(0,o.supportsWebCrypto)((0,l.locateWindow)())?this.hash=new r.Sha256(e):(0,a.isMsWindow)((0,l.locateWindow)())?this.hash=new s.Sha256(e):this.hash=new n.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},25515(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var s=i(27755),r=i(90843),n=i(31643),o=i(1632),a=function(){function e(e){e?(this.operation=function(e){return new Promise(function(t,i){var s=(0,o.locateWindow)().msCrypto.subtle.importKey("raw",l(e),r.SHA_256_HMAC_ALGO,!1,["sign"]);s.oncomplete=function(){s.result&&t(s.result),i(new Error("ImportKey completed without importing key."))},s.onerror=function(){i(new Error("ImportKey failed to import key."))}})}(e).then(function(e){return(0,o.locateWindow)().msCrypto.subtle.sign(r.SHA_256_HMAC_ALGO,e)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,o.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;(0,s.isEmptyData)(e)||(this.operation=this.operation.then(function(i){return i.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},i.process(l(e)),i}),this.operation.catch(function(){}))},e.prototype.digest=function(){return this.operation.then(function(e){return new Promise(function(t,i){e.onerror=function(){i(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),i(new Error("Error encountered finalizing hash"))},e.finish()})})},e}();function l(e){return"string"==typeof e?(0,n.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},54218(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,(0,i(65927).__exportStar)(i(87098),t);var s=i(25515);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return s.Sha256}});var r=i(22038);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return r.Sha256}})},27755(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},22038(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var s=i(47062),r=i(90843),n=i(1632),o=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise(function(t,i){(0,n.locateWindow)().crypto.subtle.importKey("raw",(0,s.convertToBuffer)(e),r.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,i)}),this.key.catch(function(){}))}return e.prototype.update=function(e){if(!(0,s.isEmptyData)(e)){var t=(0,s.convertToBuffer)(e),i=new Uint8Array(this.toHash.byteLength+t.byteLength);i.set(this.toHash,0),i.set(t,this.toHash.byteLength),this.toHash=i}},e.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return(0,n.locateWindow)().crypto.subtle.sign(r.SHA_256_HMAC_ALGO,t,e.toHash).then(function(e){return new Uint8Array(e)})}):(0,s.isEmptyData)(this.toHash)?Promise.resolve(r.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,n.locateWindow)().crypto.subtle.digest(r.SHA_256_HASH,e.toHash)}).then(function(e){return Promise.resolve(new Uint8Array(e))})},e}();t.Sha256=o},50930(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(17214),r=function(){function e(){this.state=Int32Array.from(s.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,i=e.byteLength;if(this.bytesHashed+=i,8*this.bytesHashed>s.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=e[t++],i--,this.bufferLength===s.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(t.setUint8(this.bufferLength++,128),i%s.BLOCK_SIZE>=s.BLOCK_SIZE-8){for(var r=this.bufferLength;r<s.BLOCK_SIZE;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<s.BLOCK_SIZE-8;r++)t.setUint8(r,0);t.setUint32(s.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(s.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var n=new Uint8Array(s.DIGEST_LENGTH);for(r=0;r<8;r++)n[4*r]=this.state[r]>>>24&255,n[4*r+1]=this.state[r]>>>16&255,n[4*r+2]=this.state[r]>>>8&255,n[4*r+3]=this.state[r]>>>0&255;return n},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=0;d<s.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var u=this.temp[d-2],p=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,g=((u=this.temp[d-15])>>>7|u<<25)^(u>>>18|u<<14)^u>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(g+this.temp[d-16]|0)}var m=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&l^~a&c)|0)+(h+(s.KEY[d]+this.temp[d]|0)|0)|0,f=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&n^r&n)|0;h=c,c=l,l=a,a=o+m|0,o=n,n=r,r=i,i=m+f|0}t[0]+=i,t[1]+=r,t[2]+=n,t[3]+=o,t[4]+=a,t[5]+=l,t[6]+=c,t[7]+=h},e}();t.RawSha256=r},17214(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},56059(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(65927).__exportStar(i(15119),t)},15119(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(65927),r=i(17214),n=i(50930),o=i(94518),a=function(){function e(e){if(this.hash=new n.RawSha256,e){this.outer=new n.RawSha256;var t=function(e){var t=l(e);if(t.byteLength>r.BLOCK_SIZE){var i=new n.RawSha256;i.update(t),t=i.digest()}var s=new Uint8Array(r.BLOCK_SIZE);return s.set(t),s}(e),i=new Uint8Array(r.BLOCK_SIZE);i.set(t);for(var s=0;s<r.BLOCK_SIZE;s++)t[s]^=54,i[s]^=92;for(this.hash.update(t),this.outer.update(i),s=0;s<t.byteLength;s++)t[s]=0}}return e.prototype.update=function(e){if(!(t=e,("string"==typeof t?0===t.length:0===t.byteLength)||this.error))try{this.hash.update(l(e))}catch(e){this.error=e}var t},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){return[2,this.digestSync()]})})},e}();function l(e){return"string"==typeof e?o.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},615(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var s=i(44335),r=function(){function e(){this.state=Int32Array.from(s.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,i=e.byteLength;if(this.bytesHashed+=i,8*this.bytesHashed>s.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=e[t++],i--,this.bufferLength===s.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(t.setUint8(this.bufferLength++,128),i%s.BLOCK_SIZE>=s.BLOCK_SIZE-8){for(var r=this.bufferLength;r<s.BLOCK_SIZE;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<s.BLOCK_SIZE-8;r++)t.setUint8(r,0);t.setUint32(s.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(s.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var n=new Uint8Array(s.DIGEST_LENGTH);for(r=0;r<8;r++)n[4*r]=this.state[r]>>>24&255,n[4*r+1]=this.state[r]>>>16&255,n[4*r+2]=this.state[r]>>>8&255,n[4*r+3]=this.state[r]>>>0&255;return n},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=0;d<s.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var u=this.temp[d-2],p=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,g=((u=this.temp[d-15])>>>7|u<<25)^(u>>>18|u<<14)^u>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(g+this.temp[d-16]|0)}var m=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&l^~a&c)|0)+(h+(s.KEY[d]+this.temp[d]|0)|0)|0,f=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&n^r&n)|0;h=c,c=l,l=a,a=o+m|0,o=n,n=r,r=i,i=m+f|0}t[0]+=i,t[1]+=r,t[2]+=n,t[3]+=o,t[4]+=a,t[5]+=l,t[6]+=c,t[7]+=h},e}();t.RawSha256=r},44335(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},18558(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,i(65927).__exportStar)(i(21048),t)},21048(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var s=i(65927),r=i(44335),n=i(615),o=i(47062),a=function(){function e(e){if(this.hash=new n.RawSha256,e){this.outer=new n.RawSha256;var t=function(e){var t=(0,o.convertToBuffer)(e);if(t.byteLength>r.BLOCK_SIZE){var i=new n.RawSha256;i.update(t),t=i.digest()}var s=new Uint8Array(r.BLOCK_SIZE);return s.set(t),s}(e),i=new Uint8Array(r.BLOCK_SIZE);i.set(t);for(var s=0;s<r.BLOCK_SIZE;s++)t[s]^=54,i[s]^=92;for(this.hash.update(t),this.outer.update(i),s=0;s<t.byteLength;s++)t[s]=0}}return e.prototype.update=function(e){if(!(0,o.isEmptyData)(e)&&!this.error)try{this.hash.update((0,o.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){return(0,s.__generator)(this,function(e){return[2,this.digestSync()]})})},e}();t.Sha256=a},91014(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(65927).__exportStar(i(9301),t)},9301(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var s=i(65927),r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function n(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function o(e){return e&&r.every(function(t){return"function"==typeof e[t]})}t.supportsWebCrypto=function(e){return!(!n(e)||"object"!=typeof e.crypto.subtle)&&o(e.crypto.subtle)},t.supportsSecureRandom=n,t.supportsSubtleCrypto=o,t.supportsZeroByteGCM=function(e){return s.__awaiter(this,void 0,void 0,function(){var t;return s.__generator(this,function(i){switch(i.label){case 0:if(!o(e))return[2,!1];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=i.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===i.sent().byteLength];case 4:return i.sent(),[2,!1];case 5:return[2]}})})}},29046(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var s=i(91486),r="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:s.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?r(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},47062(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var s=i(29046);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return s.convertToBuffer}});var r=i(69783);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=i(41739);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var o=i(77780);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return o.uint32ArrayFrom}})},69783(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},41739(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},77780(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},85775(e,t,i){"use strict";i.d(t,{vJ:()=>r,TD:()=>a});var s=i(65927),r=function(e){var t;return(0,s.__assign)((0,s.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?n(e):function(){return o(e)},isCustomEndpoint:!!e.endpoint})},n=function(e){var t=e.endpoint,i=e.urlParser;if("string"==typeof t){var s=Promise.resolve(i(t));return function(){return s}}if("object"==typeof t){var r=Promise.resolve(t);return function(){return r}}return t},o=function(e){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var t,i,r,n,o;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return t=e.tls,i=void 0===t||t,[4,e.region()];case 1:if(r=s.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(r)];case 2:if(!(n=(null!==(o=s.sent())&&void 0!==o?o:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((i?"https:":"http:")+"//"+n)]}})})},a=function(e){if(!e.region)throw new Error("Region is missing");return(0,s.__assign)((0,s.__assign)({},e),{region:l(e.region)})},l=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},22292(e,t,i){"use strict";i.d(t,{N:()=>o,k:()=>l});var s=i(65927),r=i(59027),n=i(2726),o=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var i=(void 0===t?{}:t).abortSignal,o=this.requestTimeout;if(null==i?void 0:i.aborted){var a=new Error("Request aborted");return a.name="AbortError",Promise.reject(a)}var l=e.path;if(e.query){var c=function(e){var t,i,r=[];try{for(var o=(0,s.__values)(Object.keys(e).sort()),a=o.next();!a.done;a=o.next()){var l=a.value,c=e[l];if(l=(0,n.o)(l),Array.isArray(c))for(var h=0,d=c.length;h<d;h++)r.push(l+"="+(0,n.o)(c[h]));else{var u=l;(c||"string"==typeof c)&&(u+="="+(0,n.o)(c)),r.push(u)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query);c&&(l+="?"+c)}var h=e.port,d=e.method,u=e.protocol+"//"+e.hostname+(h?":"+h:"")+l,p={body:"GET"===d||"HEAD"===d?void 0:e.body,headers:new Headers(e.headers),method:d};"undefined"!=typeof AbortController&&(p.signal=i);var g,m=new Request(u,p),f=[fetch(m).then(function(e){var t,i,n=e.headers,o={};try{for(var a=(0,s.__values)(n.entries()),l=a.next();!l.done;l=a.next()){var c=l.value;o[c[0]]=c[1]}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new r.cS({headers:o,statusCode:e.status,body:e.body})}:e.blob().then(function(t){return{response:new r.cS({headers:o,statusCode:e.status,body:t})}})}),(g=o,void 0===g&&(g=0),new Promise(function(e,t){g&&setTimeout(function(){var e=new Error("Request did not complete within "+g+" ms");e.name="TimeoutError",t(e)},g)}))];return i&&f.push(new Promise(function(e,t){i.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}})),Promise.race(f)},e}(),a=i(68380),l=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,i;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return[4,c(e)];case 1:return t=s.sent(),i=(0,a.E)(t),[2,new Uint8Array(i)]}})})}(e):function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,i,r,n,o,a,l;return(0,s.__generator)(this,function(s){switch(s.label){case 0:t=new Uint8Array(0),i=e.getReader(),r=!1,s.label=1;case 1:return r?[3,3]:[4,i.read()];case 2:return n=s.sent(),o=n.done,(a=n.value)&&(l=t,(t=new Uint8Array(l.length+a.length)).set(l),t.set(a,l.length)),r=o,[3,1];case 3:return[2,t]}})})}(e)};function c(e){return new Promise(function(t,i){var s=new FileReader;s.onloadend=function(){var e;if(2!==s.readyState)return i(new Error("Reader aborted too early"));var r=null!==(e=s.result)&&void 0!==e?e:"",n=r.indexOf(","),o=n>-1?n+1:r.length;t(r.substring(o))},s.onabort=function(){return i(new Error("Read aborted"))},s.onerror=function(){return i(s.error)},s.readAsDataURL(e)})}},10078(e,t,i){"use strict";i.d(t,{B:()=>s});var s=function(e){return function(){return Promise.reject(e)}}},23788(e,t,i){"use strict";i.d(t,{vK:()=>a});var s=i(65927),r=i(59027),n="content-length",o={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},a=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(i){return function(o){return(0,s.__awaiter)(t,void 0,void 0,function(){var t,a,l,c,h;return(0,s.__generator)(this,function(d){return t=o.request,r.Kd.isInstance(t)&&(a=t.body,l=t.headers,a&&-1===Object.keys(l).map(function(e){return e.toLowerCase()}).indexOf(n)&&void 0!==(c=e(a))&&(t.headers=(0,s.__assign)((0,s.__assign)({},t.headers),((h={})[n]=String(c),h)))),[2,i((0,s.__assign)((0,s.__assign)({},o),{request:t}))]})})}}}(e.bodyLengthChecker),o)}}}},14188(e,t,i){"use strict";i.d(t,{OV:()=>n,TC:()=>a});var s=i(65927),r=i(59027);function n(e){return e}var o={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},a=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(i){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var n,o;return(0,s.__generator)(this,function(s){return r.Kd.isInstance(i.request)?(n=i.request,(void 0===(o=(e.requestHandler.metadata||{}).handlerProtocol)?"":o).indexOf("h2")>=0&&!n.headers[":authority"]?(delete n.headers.host,n.headers[":authority"]=""):n.headers.host||(n.headers.host=n.hostname),[2,t(i)]):[2,t(i)]})})}}}(e),o)}}}},64996(e,t,i){"use strict";i.d(t,{Y7:()=>n});var s=i(65927),r={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},n=function(e){return{applyToStack:function(e){e.add(function(e,t){return function(i){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var r,n,o,a,l,c,h,d,u;return(0,s.__generator)(this,function(p){switch(p.label){case 0:return r=t.clientName,n=t.commandName,o=t.inputFilterSensitiveLog,a=t.logger,l=t.outputFilterSensitiveLog,[4,e(i)];case 1:return c=p.sent(),a?("function"==typeof a.info&&(h=c.output,d=h.$metadata,u=(0,s.__rest)(h,["$metadata"]),a.info({clientName:r,commandName:n,input:o(i.input),output:l(u),metadata:d})),[2,c]):[2,c]}})})}},r)}}}},16307(e,t,i){"use strict";i.d(t,{Gz:()=>m,ey:()=>n,$z:()=>y});var s=i(65927),r={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},n=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,i){return function(r){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var n;return(0,s.__generator)(this,function(o){return(null===(n=null==e?void 0:e.retryStrategy)||void 0===n?void 0:n.mode)&&(i.userAgent=(0,s.__spread)(i.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]})})}}}(e),r)}}},o=i(59027),a=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],l=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],c=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],h=[500,502,503,504],d=function(e){var t,i;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||l.includes(e.name)||1==(null===(i=e.$retryable)||void 0===i?void 0:i.throttling)},u=i(16699),p=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},g=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return a.includes(e.name)}(e)||d(e)||function(e){var t;return c.includes(e.name)||h.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},m=3,f=function(){function e(e,t){var i,s,r,n,o,a,l;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(i=null==t?void 0:t.retryDecider)&&void 0!==i?i:g,this.delayDecider=null!==(s=null==t?void 0:t.delayDecider)&&void 0!==s?s:p,this.retryQuota=null!==(r=null==t?void 0:t.retryQuota)&&void 0!==r?r:(n=500,o=500,a=function(e){return"TimeoutError"===e.name?10:5},l=function(e){return a(e)<=o},Object.freeze({hasRetryTokens:l,retrieveRetryTokens:function(e){if(!l(e))throw new Error("No retry token available");var t=a(e);return o-=t,t},releaseRetryTokens:function(e){o+=null!=e?e:1,o=Math.min(o,n)}}))}return e.prototype.shouldRetry=function(e,t,i){return t<i&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e;return(0,s.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=m,[3,3];case 3:return[2,e]}})})},e.prototype.retry=function(e,t){return(0,s.__awaiter)(this,void 0,void 0,function(){var i,r,n,a,l,c,h,p;return(0,s.__generator)(this,function(g){switch(g.label){case 0:return r=0,n=0,[4,this.getMaxAttempts()];case 1:a=g.sent(),l=t.request,o.Kd.isInstance(l)&&(l.headers["amz-sdk-invocation-id"]=(0,u.v4)()),c=function(){var c,u,p,g,m;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,5]),o.Kd.isInstance(l)&&(l.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+a),[4,e(t)];case 1:return c=s.sent(),u=c.response,p=c.output,h.retryQuota.releaseRetryTokens(i),p.$metadata.attempts=r+1,p.$metadata.totalRetryDelay=n,[2,{value:{response:u,output:p}}];case 2:return g=s.sent(),r++,h.shouldRetry(g,r,a)?(i=h.retryQuota.retrieveRetryTokens(g),m=h.delayDecider(d(g)?500:100,r),n+=m,[4,new Promise(function(e){return setTimeout(e,m)})]):[3,4];case 3:return s.sent(),[2,"continue"];case 4:throw g.$metadata||(g.$metadata={}),g.$metadata.attempts=r,g.$metadata.totalRetryDelay=n,g;case 5:return[2]}})},h=this,g.label=2;case 2:return[5,c()];case 3:return"object"==typeof(p=g.sent())?[2,p.value]:[3,2];case 4:return[2]}})})},e}(),y=function(e){var t=v(e.maxAttempts);return(0,s.__assign)((0,s.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new f(t)})},v=function(e){if(void 0===e&&(e=m),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},74052(e,t,i){"use strict";i.d(t,{TM:()=>o});var s=i(65927),r={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},n={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function o(e,t,i){return{applyToStack:function(o){o.add(function(e,t){return function(i,r){return function(r){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var n,o;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return[4,i(r)];case 1:return n=s.sent().response,[4,t(n,e)];case 2:return o=s.sent(),[2,{response:n,output:o}]}})})}}}(e,i),r),o.add(function(e,t){return function(i,r){return function(r){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var n;return(0,s.__generator)(this,function(o){switch(o.label){case 0:return[4,t(r.input,e)];case 1:return n=o.sent(),[2,i((0,s.__assign)((0,s.__assign)({},r),{request:n}))]}})})}}}(e,t),n)}}}},88428(e,t,i){"use strict";i.d(t,{DF:()=>V,k9:()=>_});var s=i(65927),r=i(81504),n="X-Amz-Date",o="X-Amz-Signature",a="X-Amz-Security-Token",l="authorization",c=n.toLowerCase(),h=[l,c,"date"],d=o.toLowerCase(),u="x-amz-content-sha256",p=a.toLowerCase(),g={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},m=/^proxy-/,f=/^sec-/,y="AWS4-HMAC-SHA256",v="AWS4-HMAC-SHA256-PAYLOAD",C="aws4_request",b={},S=[];function w(e,t,i){return e+"/"+t+"/"+i+"/"+C}function x(e,t,i){var s=new e(t);return s.update(i),s.digest()}function E(e,t,i){var r,n,o=e.headers,a={};try{for(var l=(0,s.__values)(Object.keys(o).sort()),c=l.next();!c.done;c=l.next()){var h=c.value,d=h.toLowerCase();(d in g||(null==t?void 0:t.has(d))||m.test(d)||f.test(d))&&(!i||i&&!i.has(d))||(a[d]=o[h].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return a}var M=i(2726);function A(e,t){var i=e.headers,n=e.body;return(0,s.__awaiter)(this,void 0,void 0,function(){var e,o,a,l,c,h,d;return(0,s.__generator)(this,function(p){switch(p.label){case 0:try{for(e=(0,s.__values)(Object.keys(i)),o=e.next();!o.done;o=e.next())if((a=o.value).toLowerCase()===u)return[2,i[a]]}catch(e){h={error:e}}finally{try{o&&!o.done&&(d=e.return)&&d.call(e)}finally{if(h)throw h.error}}return null!=n?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof n||ArrayBuffer.isView(n)||(g=n,"function"==typeof ArrayBuffer&&g instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(g))?((l=new t).update(n),c=r.n,[4,l.digest()]):[3,3];case 2:return[2,c.apply(void 0,[p.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var g})})}function T(e){var t=e.headers,i=e.query,r=(0,s.__rest)(e,["headers","query"]);return(0,s.__assign)((0,s.__assign)({},r),{headers:(0,s.__assign)({},t),query:i?D(i):void 0})}function D(e){return Object.keys(e).reduce(function(t,i){var r,n=e[i];return(0,s.__assign)((0,s.__assign)({},t),((r={})[i]=Array.isArray(n)?(0,s.__spread)(n):n,r))},{})}function I(e){var t,i;e="function"==typeof e.clone?e.clone():T(e);try{for(var r=(0,s.__values)(Object.keys(e.headers)),n=r.next();!n.done;n=r.next()){var o=n.value;h.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(e){t={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return e}var R=function(){function e(e){var t=e.applyChecksum,i=e.credentials,s=e.region,r=e.service,n=e.sha256,o=e.uriEscapePath,a=void 0===o||o;this.service=r,this.sha256=n,this.uriEscapePath=a,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=L(s),this.credentialProvider=N(i)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),(0,s.__awaiter)(this,void 0,void 0,function(){var i,r,l,c,h,d,u,p,g,m,f,v,C,b,S,x,M,D,R,L,N,_,O,F;return(0,s.__generator)(this,function(G){switch(G.label){case 0:return i=t.signingDate,r=void 0===i?new Date:i,l=t.expiresIn,c=void 0===l?3600:l,h=t.unsignableHeaders,d=t.unhoistableHeaders,u=t.signableHeaders,p=t.signingRegion,g=t.signingService,[4,this.credentialProvider()];case 1:return m=G.sent(),null==p?[3,2]:(v=p,[3,4]);case 2:return[4,this.regionProvider()];case 3:v=G.sent(),G.label=4;case 4:return f=v,C=P(r),b=C.longDate,S=C.shortDate,c>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(x=w(S,f,null!=g?g:this.service),M=function(e,t){var i,r,n;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():T(e),a=o.headers,l=o.query,c=void 0===l?{}:l;try{for(var h=(0,s.__values)(Object.keys(a)),d=h.next();!d.done;d=h.next()){var u=d.value,p=u.toLowerCase();"x-amz-"!==p.substr(0,6)||(null===(n=t.unhoistableHeaders)||void 0===n?void 0:n.has(p))||(c[u]=a[u],delete a[u])}}catch(e){i={error:e}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}return(0,s.__assign)((0,s.__assign)({},e),{headers:a,query:c})}(I(e),{unhoistableHeaders:d}),m.sessionToken&&(M.query[a]=m.sessionToken),M.query["X-Amz-Algorithm"]=y,M.query["X-Amz-Credential"]=m.accessKeyId+"/"+x,M.query[n]=b,M.query["X-Amz-Expires"]=c.toString(10),D=E(M,h,u),M.query["X-Amz-SignedHeaders"]=k(D),R=M.query,L=o,N=this.getSignature,_=[b,x,this.getSigningKey(m,f,S,g)],O=this.createCanonicalRequest,F=[M,D],[4,A(e,this.sha256)]);case 5:return[4,N.apply(this,_.concat([O.apply(this,F.concat([G.sent()]))]))];case 6:return R[L]=G.sent(),[2,M]}})})},e.prototype.sign=function(e,t){return(0,s.__awaiter)(this,void 0,void 0,function(){return(0,s.__generator)(this,function(i){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]})})},e.prototype.signEvent=function(e,t){var i=e.headers,n=e.payload,o=t.signingDate,a=void 0===o?new Date:o,l=t.priorSignature,c=t.signingRegion,h=t.signingService;return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t,o,d,u,p,g,m,f,y,C;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return null==c?[3,1]:(t=c,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=s.sent(),s.label=3;case 3:return e=t,o=P(a),d=o.shortDate,u=o.longDate,p=w(d,e,null!=h?h:this.service),[4,A({headers:{},body:n},this.sha256)];case 4:return g=s.sent(),(m=new this.sha256).update(i),y=r.n,[4,m.digest()];case 5:return f=y.apply(void 0,[s.sent()]),C=[v,u,p,l,f,g].join("\n"),[2,this.signString(C,{signingDate:a,signingRegion:e,signingService:h})]}})})},e.prototype.signString=function(e,t){var i=void 0===t?{}:t,n=i.signingDate,o=void 0===n?new Date:n,a=i.signingRegion,l=i.signingService;return(0,s.__awaiter)(this,void 0,void 0,function(){var t,i,n,c,h,d,u,p;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return[4,this.credentialProvider()];case 1:return t=s.sent(),null==a?[3,2]:(n=a,[3,4]);case 2:return[4,this.regionProvider()];case 3:n=s.sent(),s.label=4;case 4:return i=n,c=P(o).shortDate,u=(d=this.sha256).bind,[4,this.getSigningKey(t,i,c,l)];case 5:return(h=new(u.apply(d,[void 0,s.sent()]))).update(e),p=r.n,[4,h.digest()];case 6:return[2,p.apply(void 0,[s.sent()])]}})})},e.prototype.signRequest=function(e,t){var i=void 0===t?{}:t,r=i.signingDate,n=void 0===r?new Date:r,o=i.signableHeaders,a=i.unsignableHeaders,h=i.signingRegion,d=i.signingService;return(0,s.__awaiter)(this,void 0,void 0,function(){var t,i,r,g,m,f,v,C,b,S,x;return(0,s.__generator)(this,function(M){switch(M.label){case 0:return[4,this.credentialProvider()];case 1:return t=M.sent(),null==h?[3,2]:(r=h,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=M.sent(),M.label=4;case 4:return i=r,g=I(e),m=P(n),f=m.longDate,v=m.shortDate,C=w(v,i,null!=d?d:this.service),g.headers[c]=f,t.sessionToken&&(g.headers[p]=t.sessionToken),[4,A(g,this.sha256)];case 5:return b=M.sent(),!function(e,t){var i,r;e=e.toLowerCase();try{for(var n=(0,s.__values)(Object.keys(t)),o=n.next();!o.done;o=n.next())if(e===o.value.toLowerCase())return!0}catch(e){i={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return!1}(u,g.headers)&&this.applyChecksum&&(g.headers[u]=b),S=E(g,a,o),[4,this.getSignature(f,C,this.getSigningKey(t,i,v,d),this.createCanonicalRequest(g,S,b))];case 6:return x=M.sent(),g.headers[l]=y+" Credential="+t.accessKeyId+"/"+C+", SignedHeaders="+k(S)+", Signature="+x,[2,g]}})})},e.prototype.createCanonicalRequest=function(e,t,i){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,i,r=e.query,n=void 0===r?{}:r,o=[],a={},l=function(e){if(e.toLowerCase()===d)return"continue";o.push(e);var t=n[e];"string"==typeof t?a[e]=(0,M.o)(e)+"="+(0,M.o)(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce(function(t,i){return t.concat([(0,M.o)(e)+"="+(0,M.o)(i)])},[]).join("&"))};try{for(var c=(0,s.__values)(Object.keys(n).sort()),h=c.next();!h.done;h=c.next())l(h.value)}catch(e){t={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(t)throw t.error}}return o.map(function(e){return a[e]}).filter(function(e){return e}).join("&")}(e)+"\n"+r.map(function(e){return e+":"+t[e]}).join("\n")+"\n\n"+r.join(";")+"\n"+i},e.prototype.createStringToSign=function(e,t,i){return(0,s.__awaiter)(this,void 0,void 0,function(){var n,o;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return(n=new this.sha256).update(i),[4,n.digest()];case 1:return o=s.sent(),[2,y+"\n"+e+"\n"+t+"\n"+(0,r.n)(o)]}})})},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,i,n){return(0,s.__awaiter)(this,void 0,void 0,function(){var o,a,l,c,h;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return[4,this.createStringToSign(e,t,n)];case 1:return o=s.sent(),c=(l=this.sha256).bind,[4,i];case 2:return(a=new(c.apply(l,[void 0,s.sent()]))).update(o),h=r.n,[4,a.digest()];case 3:return[2,h.apply(void 0,[s.sent()])]}})})},e.prototype.getSigningKey=function(e,t,i,n){return function(e,t,i,n,o){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var a,l,c,h,d,u,p,g,m;return(0,s.__generator)(this,function(f){switch(f.label){case 0:return[4,x(e,t.secretAccessKey,t.accessKeyId)];case 1:if(a=f.sent(),(l=i+":"+n+":"+o+":"+(0,r.n)(a)+":"+t.sessionToken)in b)return[2,b[l]];for(S.push(l);S.length>50;)delete b[S.shift()];c="AWS4"+t.secretAccessKey,f.label=2;case 2:f.trys.push([2,7,8,9]),h=(0,s.__values)([i,n,o,C]),d=h.next(),f.label=3;case 3:return d.done?[3,6]:(u=d.value,[4,x(e,c,u)]);case 4:c=f.sent(),f.label=5;case 5:return d=h.next(),[3,3];case 6:return[3,9];case 7:return p=f.sent(),g={error:p},[3,9];case 8:try{d&&!d.done&&(m=h.return)&&m.call(h)}finally{if(g)throw g.error}return[7];case 9:return[2,b[l]=c]}})})}(this.sha256,e,i,t,n||this.service)},e}(),P=function(e){var t,i=(t=e,function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e}(t).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");return{longDate:i,shortDate:i.substr(0,8)}},k=function(e){return Object.keys(e).sort().join(";")},L=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},N=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function _(e){var t,i=this,r=O(e.credentials||e.credentialDefaultProvider(e)),n=e.signingEscapePath,o=void 0===n||n,a=e.systemClockOffset,l=void 0===a?e.systemClockOffset||0:a,c=e.sha256;return t=e.signer?O(e.signer):function(){return O(e.region)().then(function(t){return(0,s.__awaiter)(i,void 0,void 0,function(){return(0,s.__generator)(this,function(i){switch(i.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[i.sent()||{},t]]}})})}).then(function(t){var i=(0,s.__read)(t,2),n=i[0],a=i[1],l=n.signingRegion,h=n.signingService;return e.signingRegion=e.signingRegion||l||a,e.signingName=e.signingName||h||e.serviceId,new R({credentials:r,region:e.signingRegion,service:e.signingName,sha256:c,uriEscapePath:o})})},(0,s.__assign)((0,s.__assign)({},e),{systemClockOffset:l,signingEscapePath:o,credentials:r,signer:t})}function O(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var F=i(59027);function G(e){return function(t,i){return function(r){return(0,s.__awaiter)(this,void 0,void 0,function(){var n,o,a,l,c,h,d,u,p;return(0,s.__generator)(this,function(g){switch(g.label){case 0:return F.Kd.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return o=g.sent(),[3,3];case 2:o=e.signer,g.label=3;case 3:return n=o,l=t,c=[(0,s.__assign)({},r)],p={},[4,n.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:i.signing_region,signingService:i.signing_service})];case 4:return[4,l.apply(void 0,[s.__assign.apply(void 0,c.concat([(p.request=g.sent(),p)]))])];case 5:return a=g.sent(),h=a.response.headers,(d=h&&(h.date||h.Date))&&(m=u=Date.parse(d),f=e.systemClockOffset,Math.abs(function(e){return new Date(Date.now()+e)}(f).getTime()-m)>=3e5&&(e.systemClockOffset=u-Date.now())),[2,a]}var m,f})})}}}var B={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},V=function(e){return{applyToStack:function(t){t.addRelativeTo(G(e),B)}}}},44625(e,t,i){"use strict";i.d(t,{sM:()=>h,Dc:()=>r});var s=i(65927);function r(e){return(0,s.__assign)((0,s.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var n=i(59027),o="user-agent",a=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,l=function(e){var t=(0,s.__read)(e,2),i=t[0],r=t[1],n=i.indexOf("/"),o=i.substring(0,n),l=i.substring(n+1);return"api"===o&&(l=l.toLowerCase()),[o,l,r].filter(function(e){return e&&e.length>0}).map(function(e){return null==e?void 0:e.replace(a,"_")}).join("/")},c={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},h=function(e){return{applyToStack:function(t){var i;t.add((i=e,function(e,t){return function(r){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var a,c,h,d,u,p,g,m;return(0,s.__generator)(this,function(f){switch(f.label){case 0:return a=r.request,n.Kd.isInstance(a)?(c=a.headers,h=(null===(g=null==t?void 0:t.userAgent)||void 0===g?void 0:g.map(l))||[],[4,i.defaultUserAgentProvider()]):[2,e(r)];case 1:return d=f.sent().map(l),u=(null===(m=null==i?void 0:i.customUserAgent)||void 0===m?void 0:m.map(l))||[],c["x-amz-user-agent"]=(0,s.__spread)(d,h,u).join(" "),p=(0,s.__spread)(d.filter(function(e){return e.startsWith("aws-sdk-")}),u).join(" "),"browser"!==i.runtime&&p&&(c[o]=c[o]?c[o]+" "+p:p),[2,e((0,s.__assign)((0,s.__assign)({},r),{request:a}))]}})})}}),c)}}}},59027(e,t,i){"use strict";i.d(t,{Kd:()=>n,cS:()=>s});var s=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),r=i(65927),n=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,i=new e((0,r.__assign)((0,r.__assign)({},this),{headers:(0,r.__assign)({},this.headers)}));return i.query&&(i.query=(t=i.query,Object.keys(t).reduce(function(e,i){var s,n=t[i];return(0,r.__assign)((0,r.__assign)({},e),((s={})[i]=Array.isArray(n)?(0,r.__spread)(n):n,s))},{}))),i},e}()},11538(e,t,i){"use strict";i.d(t,{Kj:()=>a,uB:()=>l,$6:()=>c});var s=i(65927),r=function(){var e=[],t=[],i=new Set,a=function(i){return e.forEach(function(e){i.add(e.middleware,(0,s.__assign)({},e))}),t.forEach(function(e){i.addRelativeTo(e.middleware,(0,s.__assign)({},e))}),i},l=function(e){var t=[];return e.before.forEach(function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,(0,s.__spread)(l(e)))}),t.push(e),e.after.reverse().forEach(function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,(0,s.__spread)(l(e)))}),t},c={add:function(t,r){void 0===r&&(r={});var n=r.name,o=r.override,a=(0,s.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(n){if(i.has(n)){if(!o)throw new Error("Duplicate middleware name '"+n+"'");var l=e.findIndex(function(e){return e.name===n}),c=e[l];if(c.step!==a.step||c.priority!==a.priority)throw new Error('"'+n+'" middleware with '+c.priority+" priority in "+c.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(l,1)}i.add(n)}e.push(a)},addRelativeTo:function(e,r){var n=r.name,o=r.override,a=(0,s.__assign)({middleware:e},r);if(n){if(i.has(n)){if(!o)throw new Error("Duplicate middleware name '"+n+"'");var l=t.findIndex(function(e){return e.name===n}),c=t[l];if(c.toMiddleware!==a.toMiddleware||c.relation!==a.relation)throw new Error('"'+n+'" middleware '+c.relation+' "'+c.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(l,1)}i.add(n)}t.push(a)},clone:function(){return a(r())},use:function(e){e.applyToStack(c)},remove:function(s){return"string"==typeof s?function(s){var r=!1,n=function(e){return!e.name||e.name!==s||(r=!0,i.delete(s),!1)};return e=e.filter(n),t=t.filter(n),r}(s):function(s){var r=!1,n=function(e){return e.middleware!==s||(r=!0,e.name&&i.delete(e.name),!1)};return e=e.filter(n),t=t.filter(n),r}(s)},removeByTag:function(s){var r=!1,n=function(e){var t=e.tags,n=e.name;return!t||!t.includes(s)||(n&&i.delete(n),r=!0,!1)};return e=e.filter(n),t=t.filter(n),r},concat:function(e){var t=a(r());return t.use(e),t},applyToStack:a,resolve:function(i,r){var a,c;try{for(var h=(0,s.__values)(function(){var i,r=[],a=[],c={};return e.forEach(function(e){var t=(0,s.__assign)((0,s.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),r.push(t)}),t.forEach(function(e){var t=(0,s.__assign)((0,s.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),a.push(t)}),a.forEach(function(e){if(e.toMiddleware){var t=c[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}}),(i=r,i.sort(function(e,t){return n[t.step]-n[e.step]||o[t.priority||"normal"]-o[e.priority||"normal"]})).map(l).reduce(function(e,t){return e.push.apply(e,(0,s.__spread)(t)),e},[]).map(function(e){return e.middleware})}().reverse()),d=h.next();!d.done;d=h.next())i=(0,d.value)(i,r)}catch(e){a={error:e}}finally{try{d&&!d.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error}}return i}};return c},n={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},o={high:3,normal:2,low:1},a=function(){function e(e){this.middlewareStack=r(),this.config=e}return e.prototype.send=function(e,t,i){var s="function"!=typeof t?t:void 0,r="function"==typeof t?t:i,n=e.resolveMiddleware(this.middlewareStack,this.config,s);if(!r)return n(e).then(function(e){return e.output});n(e).then(function(e){return r(null,e.output)},function(e){return r(e)}).catch(function(){})},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),l=function(){this.middlewareStack=r()};function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}var h=function(){var e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,(0,s.__spread)([null],arguments)));return Object.setPrototypeOf(t,e.prototype),t};h.prototype=Object.create(String.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(h,String),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(0,s.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(h)},2049(e,t,i){"use strict";i.d(t,{D:()=>r});var s=i(65927),r=function(e){var t,i=new URL(e),r=i.hostname,n=i.pathname,o=i.port,a=i.protocol,l=i.search;return l&&(t=function(e){var t,i,r={};if(e=e.replace(/^\?/,""))try{for(var n=(0,s.__values)(e.split("&")),o=n.next();!o.done;o=n.next()){var a=o.value,l=(0,s.__read)(a.split("="),2),c=l[0],h=l[1],d=void 0===h?null:h;c=decodeURIComponent(c),d&&(d=decodeURIComponent(d)),c in r?Array.isArray(r[c])?r[c].push(d):r[c]=[r[c],d]:r[c]=d}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}return r}(l)),{hostname:r,port:o?parseInt(o):void 0,protocol:a,path:n,query:t}}},68380(e,t,i){"use strict";i.d(t,{E:()=>h,n:()=>d});for(var s={},r=new Array(64),n=0,o="A".charCodeAt(0),a="Z".charCodeAt(0);n+o<=a;n++){var l=String.fromCharCode(n+o);s[l]=n,r[n]=l}for(n=0,o="a".charCodeAt(0),a="z".charCodeAt(0);n+o<=a;n++){l=String.fromCharCode(n+o);var c=n+26;s[l]=c,r[c]=l}for(n=0;n<10;n++)s[n.toString(10)]=n+52,l=n.toString(10),c=n+52,s[l]=c,r[c]=l;function h(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var i=new ArrayBuffer(t),r=new DataView(i),n=0;n<e.length;n+=4){for(var o=0,a=0,l=n,c=n+3;l<=c;l++)"="!==e[l]?(o|=s[e[l]]<<6*(c-l),a+=6):o>>=6;var h=n/4*3;o>>=a%8;for(var d=Math.floor(a/8),u=0;u<d;u++){var p=8*(d-u-1);r.setUint8(h+u,(o&255<<p)>>p)}}return new Uint8Array(i)}function d(e){for(var t="",i=0;i<e.length;i+=3){for(var s=0,n=0,o=i,a=Math.min(i+3,e.length);o<a;o++)s|=e[o]<<8*(a-o-1),n+=8;var l=Math.ceil(n/6);s<<=6*l-n;for(var c=1;c<=l;c++){var h=6*(l-c);t+=r[(s&63<<h)>>h]}t+="==".slice(0,4-l)}return t}s["+"]=62,r[62]="+",s["/"]=63,r[63]="/"},93972(e,t,i){"use strict";function s(e){if("string"==typeof e){for(var t=e.length,i=t-1;i>=0;i--){var s=e.charCodeAt(i);s>127&&s<=2047?t++:s>2047&&s<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}i.d(t,{n:()=>s})},93065(e,t,i){"use strict";i.d(t,{n:()=>s.n});var s=i(67520)},81504(e,t,i){"use strict";i.d(t,{n:()=>a});for(var s={},r={},n=0;n<256;n++){var o=n.toString(16).toLowerCase();1===o.length&&(o="0"+o),s[n]=o,r[o]=n}function a(e){for(var t="",i=0;i<e.byteLength;i++)t+=s[e[i]];return t}},1632(e,t,i){"use strict";i.r(t),i.d(t,{locateWindow:()=>r});const s={};function r(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:s}},2726(e,t,i){"use strict";i.d(t,{o:()=>s});var s=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,r)},r=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}},39448(e,t,i){"use strict";i.d(t,{m:()=>o});var s=i(65927),r=i(36621),n=i.n(r),o=function(e){var t=e.serviceId,i=e.clientVersion;return function(){return(0,s.__awaiter)(void 0,void 0,void 0,function(){var e,r,o,a,l,c,h,d,u;return(0,s.__generator)(this,function(s){return e=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?n().parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",i],["os/"+((null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.name)||"other"),null===(l=null==e?void 0:e.os)||void 0===l?void 0:l.version],["lang/js"],["md/browser",(null!==(h=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.name)&&void 0!==h?h:"unknown")+"_"+(null!==(u=null===(d=null==e?void 0:e.browser)||void 0===d?void 0:d.version)&&void 0!==u?u:"unknown")]],t&&r.push(["api/"+t,i]),[2,r]})})}}},94518(e,t,i){"use strict";i.r(t),i.d(t,{fromUtf8:()=>s,toUtf8:()=>r});var s=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],i=0,s=e.length;i<s;i++){var r=e.charCodeAt(i);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(i+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))){var n=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i));t.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)}(e)},r=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",i=0,s=e.length;i<s;i++){var r=e[i];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){var n=e[++i];t+=String.fromCharCode((31&r)<<6|63&n)}else if(240<=r&&r<365){var o="%"+[r,e[++i],e[++i],e[++i]].map(function(e){return e.toString(16)}).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++i])<<6|63&e[++i])}return t}(e)}},91486(e,t,i){"use strict";i.r(t),i.d(t,{fromUtf8:()=>s,toUtf8:()=>r});const s=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let i=0,s=e.length;i<s;i++){const s=e.charCodeAt(i);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192,63&s|128);else if(i+1<e.length&&55296==(64512&s)&&56320==(64512&e.charCodeAt(i+1))){const r=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i));t.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else t.push(s>>12|224,s>>6&63|128,63&s|128)}return Uint8Array.from(t)})(e),r=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let i=0,s=e.length;i<s;i++){const s=e[i];if(s<128)t+=String.fromCharCode(s);else if(192<=s&&s<224){const r=e[++i];t+=String.fromCharCode((31&s)<<6|63&r)}else if(240<=s&&s<365){const r="%"+[s,e[++i],e[++i],e[++i]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(r)}else t+=String.fromCharCode((15&s)<<12|(63&e[++i])<<6|63&e[++i])}return t})(e)},31643(e,t,i){"use strict";i.r(t),i.d(t,{fromUtf8:()=>s,toUtf8:()=>r});var s=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],i=0,s=e.length;i<s;i++){var r=e.charCodeAt(i);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(i+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))){var n=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i));t.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)}(e)},r=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",i=0,s=e.length;i<s;i++){var r=e[i];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){var n=e[++i];t+=String.fromCharCode((31&r)<<6|63&n)}else if(240<=r&&r<365){var o="%"+[r,e[++i],e[++i],e[++i]].map(function(e){return e.toString(16)}).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++i])<<6|63&e[++i])}return t}(e)}},70381(e,t,i){e.exports={graphlib:i(55166),layout:i(79623),debug:i(10698),util:{time:i(82469).time,notime:i(82469).notime},version:i(69741)}},85933(e,t,i){"use strict";let s=i(72046),r=i(82469).uniqueId;e.exports={run:function(e){("greedy"===e.graph().acyclicer?s(e,function(e){return t=>e.edge(t).weight}(e)):function(e){let t=[],i={},s={};return e.nodes().forEach(function r(n){Object.hasOwn(s,n)||(s[n]=!0,i[n]=!0,e.outEdges(n).forEach(e=>{Object.hasOwn(i,e.w)?t.push(e):r(e.w)}),delete i[n])}),t}(e)).forEach(t=>{let i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,r("rev"))})},undo:function(e){e.edges().forEach(t=>{let i=e.edge(t);if(i.reversed){e.removeEdge(t);let s=i.forwardName;delete i.reversed,delete i.forwardName,e.setEdge(t.w,t.v,i,s)}})}}},8328(e,t,i){let s=i(82469);function r(e,t,i,r,n,o){let a={width:0,height:0,rank:o,borderType:t},l=n[t][o-1],c=s.addDummyNode(e,"border",a,i);n[t][o]=c,e.setParent(c,r),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){e.children().forEach(function t(i){let s=e.children(i),n=e.node(i);if(s.length&&s.forEach(t),Object.hasOwn(n,"minRank")){n.borderLeft=[],n.borderRight=[];for(let t=n.minRank,s=n.maxRank+1;t<s;++t)r(e,"borderLeft","_bl",i,n,t),r(e,"borderRight","_br",i,n,t)}})}},29481(e){"use strict";function t(e){e.nodes().forEach(t=>i(e.node(t))),e.edges().forEach(t=>i(e.edge(t)))}function i(e){let t=e.width;e.width=e.height,e.height=t}function s(e){e.y=-e.y}function r(e){let t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){let i=e.graph().rankdir.toLowerCase();"lr"!==i&&"rl"!==i||t(e)},undo:function(e){let i=e.graph().rankdir.toLowerCase();"bt"!==i&&"rl"!==i||function(e){e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let i=e.edge(t);i.points.forEach(s),Object.hasOwn(i,"y")&&s(i)})}(e),"lr"!==i&&"rl"!==i||(function(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>{let i=e.edge(t);i.points.forEach(r),Object.hasOwn(i,"x")&&r(i)})}(e),t(e))}}},78976(e){function t(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,i=e._prev;if(i!==e)return t(i),i}enqueue(e){let i=this._sentinel;e._prev&&e._next&&t(e),e._next=i._next,i._next._prev=e,i._next=e,e._prev=i}toString(){let e=[],t=this._sentinel,s=t._prev;for(;s!==t;)e.push(JSON.stringify(s,i)),s=s._prev;return"["+e.join(", ")+"]"}}},10698(e,t,i){let s=i(82469),r=i(55166).Graph;e.exports={debugOrdering:function(e){let t=s.buildLayerMatrix(e),i=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{i.setNode(t,{label:t}),i.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>i.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let s="layer"+t;i.setNode(s,{rank:"same"}),e.reduce((e,t)=>(i.setEdge(e,t,{style:"invis"}),t))}),i}}},72046(e,t,i){let s=i(55166).Graph,r=i(78976);e.exports=function(e,t){if(e.nodeCount()<=1)return[];let i=function(e,t){let i=new s,n=0,o=0;e.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let s=i.edge(e.v,e.w)||0,r=t(e),a=s+r;i.setEdge(e.v,e.w,a),o=Math.max(o,i.node(e.v).out+=r),n=Math.max(n,i.node(e.w).in+=r)});let l=function(e){const t=[];for(let i=0;i<e;i++)t.push(i);return t}(o+n+3).map(()=>new r),c=n+1;return i.nodes().forEach(e=>{a(l,c,i.node(e))}),{graph:i,buckets:l,zeroIdx:c}}(e,t||n);return function(e,t,i){let s,r=[],n=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;s=a.dequeue();)o(e,t,i,s);for(;s=n.dequeue();)o(e,t,i,s);if(e.nodeCount())for(let n=t.length-2;n>0;--n)if(s=t[n].dequeue(),s){r=r.concat(o(e,t,i,s,!0));break}}return r}(i.graph,i.buckets,i.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};let n=()=>1;function o(e,t,i,s,r){let n=r?[]:void 0;return e.inEdges(s.v).forEach(s=>{let o=e.edge(s),l=e.node(s.v);r&&n.push({v:s.v,w:s.w}),l.out-=o,a(t,i,l)}),e.outEdges(s.v).forEach(s=>{let r=e.edge(s),n=s.w,o=e.node(n);o.in-=r,a(t,i,o)}),e.removeNode(s.v),n}function a(e,t,i){i.out?i.in?e[i.out-i.in+t].enqueue(i):e[e.length-1].enqueue(i):e[0].enqueue(i)}},79623(e,t,i){"use strict";let s=i(85933),r=i(77798),n=i(83816),o=i(82469).normalizeRanks,a=i(77999),l=i(82469).removeEmptyRanks,c=i(32254),h=i(8328),d=i(29481),u=i(5354),p=i(7489),g=i(82469),m=i(55166).Graph;e.exports=function(e,t){let i=t&&t.debugTiming?g.time:g.notime;i("layout",()=>{let A=i("  buildLayoutGraph",()=>function(e){let t=new m({multigraph:!0,compound:!0}),i=M(e.graph());return t.setGraph(Object.assign({},y,E(i,f),g.pick(i,v))),e.nodes().forEach(i=>{const s=E(M(e.node(i)),C);Object.keys(b).forEach(e=>{void 0===s[e]&&(s[e]=b[e])}),t.setNode(i,s),t.setParent(i,e.parent(i))}),e.edges().forEach(i=>{let s=M(e.edge(i));t.setEdge(i,Object.assign({},w,E(s,S),g.pick(s,x)))}),t}(e));i("  runLayout",()=>function(e,t,i){t("    makeSpaceForEdgeLabels",()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(i=>{let s=e.edge(i);s.minlen*=2,"c"!==s.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?s.width+=s.labeloffset:s.height+=s.labeloffset)})}(e)),t("    removeSelfEdges",()=>function(e){e.edges().forEach(t=>{if(t.v===t.w){var i=e.node(t.v);i.selfEdges||(i.selfEdges=[]),i.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)),t("    acyclic",()=>s.run(e)),t("    nestingGraph.run",()=>c.run(e)),t("    rank",()=>n(g.asNonCompoundGraph(e))),t("    injectEdgeLabelProxies",()=>function(e){e.edges().forEach(t=>{let i=e.edge(t);if(i.width&&i.height){let i=e.node(t.v),s={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};g.addDummyNode(e,"edge-proxy",s,"_ep")}})}(e)),t("    removeEmptyRanks",()=>l(e)),t("    nestingGraph.cleanup",()=>c.cleanup(e)),t("    normalizeRanks",()=>o(e)),t("    assignRankMinMax",()=>function(e){let t=0;e.nodes().forEach(i=>{let s=e.node(i);s.borderTop&&(s.minRank=e.node(s.borderTop).rank,s.maxRank=e.node(s.borderBottom).rank,t=Math.max(t,s.maxRank))}),e.graph().maxRank=t}(e)),t("    removeEdgeLabelProxies",()=>function(e){e.nodes().forEach(t=>{let i=e.node(t);"edge-proxy"===i.dummy&&(e.edge(i.e).labelRank=i.rank,e.removeNode(t))})}(e)),t("    normalize.run",()=>r.run(e)),t("    parentDummyChains",()=>a(e)),t("    addBorderSegments",()=>h(e)),t("    order",()=>u(e,i)),t("    insertSelfEdges",()=>function(e){g.buildLayerMatrix(e).forEach(t=>{var i=0;t.forEach((t,s)=>{var r=e.node(t);r.order=s+i,(r.selfEdges||[]).forEach(t=>{g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:r.rank,order:s+ ++i,e:t.e,label:t.label},"_se")}),delete r.selfEdges})})}(e)),t("    adjustCoordinateSystem",()=>d.adjust(e)),t("    position",()=>p(e)),t("    positionSelfEdges",()=>function(e){e.nodes().forEach(t=>{var i=e.node(t);if("selfedge"===i.dummy){var s=e.node(i.e.v),r=s.x+s.width/2,n=s.y,o=i.x-r,a=s.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:r+2*o/3,y:n-a},{x:r+5*o/6,y:n-a},{x:r+o,y:n},{x:r+5*o/6,y:n+a},{x:r+2*o/3,y:n+a}],i.label.x=i.x,i.label.y=i.y}})}(e)),t("    removeBorderNodes",()=>function(e){e.nodes().forEach(t=>{if(e.children(t).length){let i=e.node(t),s=e.node(i.borderTop),r=e.node(i.borderBottom),n=e.node(i.borderLeft[i.borderLeft.length-1]),o=e.node(i.borderRight[i.borderRight.length-1]);i.width=Math.abs(o.x-n.x),i.height=Math.abs(r.y-s.y),i.x=n.x+i.width/2,i.y=s.y+i.height/2}}),e.nodes().forEach(t=>{"border"===e.node(t).dummy&&e.removeNode(t)})}(e)),t("    normalize.undo",()=>r.undo(e)),t("    fixupEdgeLabelCoords",()=>function(e){e.edges().forEach(t=>{let i=e.edge(t);if(Object.hasOwn(i,"x"))switch("l"!==i.labelpos&&"r"!==i.labelpos||(i.width-=i.labeloffset),i.labelpos){case"l":i.x-=i.width/2+i.labeloffset;break;case"r":i.x+=i.width/2+i.labeloffset}})}(e)),t("    undoCoordinateSystem",()=>d.undo(e)),t("    translateGraph",()=>function(e){let t=Number.POSITIVE_INFINITY,i=0,s=Number.POSITIVE_INFINITY,r=0,n=e.graph(),o=n.marginx||0,a=n.marginy||0;function l(e){let n=e.x,o=e.y,a=e.width,l=e.height;t=Math.min(t,n-a/2),i=Math.max(i,n+a/2),s=Math.min(s,o-l/2),r=Math.max(r,o+l/2)}e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let i=e.edge(t);Object.hasOwn(i,"x")&&l(i)}),t-=o,s-=a,e.nodes().forEach(i=>{let r=e.node(i);r.x-=t,r.y-=s}),e.edges().forEach(i=>{let r=e.edge(i);r.points.forEach(e=>{e.x-=t,e.y-=s}),Object.hasOwn(r,"x")&&(r.x-=t),Object.hasOwn(r,"y")&&(r.y-=s)}),n.width=i-t+o,n.height=r-s+a}(e)),t("    assignNodeIntersects",()=>function(e){e.edges().forEach(t=>{let i,s,r=e.edge(t),n=e.node(t.v),o=e.node(t.w);r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=o,s=n),r.points.unshift(g.intersectRect(n,i)),r.points.push(g.intersectRect(o,s))})}(e)),t("    reversePoints",()=>function(e){e.edges().forEach(t=>{let i=e.edge(t);i.reversed&&i.points.reverse()})}(e)),t("    acyclic.undo",()=>s.undo(e))}(A,i,t)),i("  updateInputGraph",()=>function(e,t){e.nodes().forEach(i=>{let s=e.node(i),r=t.node(i);s&&(s.x=r.x,s.y=r.y,s.rank=r.rank,t.children(i).length&&(s.width=r.width,s.height=r.height))}),e.edges().forEach(i=>{let s=e.edge(i),r=t.edge(i);s.points=r.points,Object.hasOwn(r,"x")&&(s.x=r.x,s.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,A))})};let f=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},v=["acyclicer","ranker","rankdir","align"],C=["width","height","rank"],b={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},x=["labelpos"];function E(e,t){return g.mapValues(g.pick(e,t),Number)}function M(e){var t={};return e&&Object.entries(e).forEach(([e,i])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=i}),t}},32254(e,t,i){let s=i(82469);function r(e,t,i,n,o,a,l){let c=e.children(l);if(!c.length)return void(l!==t&&e.setEdge(t,l,{weight:0,minlen:i}));let h=s.addBorderNode(e,"_bt"),d=s.addBorderNode(e,"_bb"),u=e.node(l);e.setParent(h,l),u.borderTop=h,e.setParent(d,l),u.borderBottom=d,c.forEach(s=>{r(e,t,i,n,o,a,s);let c=e.node(s),u=c.borderTop?c.borderTop:s,p=c.borderBottom?c.borderBottom:s,g=c.borderTop?n:2*n,m=u!==p?1:o-a[l]+1;e.setEdge(h,u,{weight:g,minlen:m,nestingEdge:!0}),e.setEdge(p,d,{weight:g,minlen:m,nestingEdge:!0})}),e.parent(l)||e.setEdge(t,h,{weight:0,minlen:o+a[l]})}e.exports={run:function(e){let t=s.addDummyNode(e,"root",{},"_root"),i=function(e){var t={};function i(s,r){var n=e.children(s);n&&n.length&&n.forEach(e=>i(e,r+1)),t[s]=r}return e.children().forEach(e=>i(e,1)),t}(e),n=Object.values(i),o=s.applyWithChunking(Math.max,n)-1,a=2*o+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let l=function(e){return e.edges().reduce((t,i)=>t+e.edge(i).weight,0)}(e)+1;e.children().forEach(s=>r(e,t,a,l,o,i,s)),e.graph().nodeRankFactor=a},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}},77798(e,t,i){"use strict";let s=i(82469);e.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>function(e,t){let i,r,n,o=t.v,a=e.node(o).rank,l=t.w,c=e.node(l).rank,h=t.name,d=e.edge(t),u=d.labelRank;if(c!==a+1){for(e.removeEdge(t),n=0,++a;a<c;++n,++a)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:a},i=s.addDummyNode(e,"edge",r,"_d"),a===u&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(o,i,{weight:d.weight},h),0===n&&e.graph().dummyChains.push(i),o=i;e.setEdge(o,l,{weight:d.weight},h)}}(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let i,s=e.node(t),r=s.edgeLabel;for(e.setEdge(s.edgeObj,r);s.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:s.x,y:s.y}),"edge-label"===s.dummy&&(r.x=s.x,r.y=s.y,r.width=s.width,r.height=s.height),t=i,s=e.node(t)})}}},6281(e){e.exports=function(e,t,i){let s,r={};i.forEach(i=>{let n,o,a=e.parent(i);for(;a;){if(n=e.parent(a),n?(o=r[n],r[n]=a):(o=s,s=a),o&&o!==a)return void t.setEdge(o,a);a=n}})}},21213(e){e.exports=function(e,t=[]){return t.map(t=>{let i=e.inEdges(t);if(i.length){let s=i.reduce((t,i)=>{let s=e.edge(i),r=e.node(i.v);return{sum:t.sum+s.weight*r.order,weight:t.weight+s.weight}},{sum:0,weight:0});return{v:t,barycenter:s.sum/s.weight,weight:s.weight}}return{v:t}})}},96703(e,t,i){let s=i(55166).Graph,r=i(82469);e.exports=function(e,t,i){let n=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),o=new s({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(t=>e.node(t));return e.nodes().forEach(s=>{let r=e.node(s),a=e.parent(s);(r.rank===t||r.minRank<=t&&t<=r.maxRank)&&(o.setNode(s),o.setParent(s,a||n),e[i](s).forEach(t=>{let i=t.v===s?t.w:t.v,r=o.edge(i,s),n=void 0!==r?r.weight:0;o.setEdge(i,s,{weight:e.edge(t).weight+n})}),Object.hasOwn(r,"minRank")&&o.setNode(s,{borderLeft:r.borderLeft[t],borderRight:r.borderRight[t]}))}),o}},28304(e,t,i){"use strict";let s=i(82469).zipObject;function r(e,t,i){let r=s(i,i.map((e,t)=>t)),n=t.flatMap(t=>e.outEdges(t).map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),o=1;for(;o<i.length;)o<<=1;let a=2*o-1;o-=1;let l=new Array(a).fill(0),c=0;return n.forEach(e=>{let t=e.pos+o;l[t]+=e.weight;let i=0;for(;t>0;)t%2&&(i+=l[t+1]),t=t-1>>1,l[t]+=e.weight;c+=e.weight*i}),c}e.exports=function(e,t){let i=0;for(let s=1;s<t.length;++s)i+=r(e,t[s-1],t[s]);return i}},5354(e,t,i){"use strict";let s=i(15612),r=i(28304),n=i(93315),o=i(96703),a=i(6281),l=i(55166).Graph,c=i(82469);function h(e,t,i){return t.map(function(t){return o(e,t,i)})}function d(e,t){let i=new l;e.forEach(function(e){let s=e.graph().root,r=n(e,s,i,t);r.vs.forEach((t,i)=>e.node(t).order=i),a(e,i,r.vs)})}function u(e,t){Object.values(t).forEach(t=>t.forEach((t,i)=>e.node(t).order=i))}e.exports=function e(t,i){if(i&&"function"==typeof i.customOrder)return void i.customOrder(t,e);let n=c.maxRank(t),o=h(t,c.range(1,n+1),"inEdges"),a=h(t,c.range(n-1,-1,-1),"outEdges"),l=s(t);if(u(t,l),i&&i.disableOptimalOrderHeuristic)return;let p,g=Number.POSITIVE_INFINITY;for(let e=0,i=0;i<4;++e,++i){d(e%2?o:a,e%4>=2),l=c.buildLayerMatrix(t);let s=r(t,l);s<g&&(i=0,p=Object.assign({},l),g=s)}u(t,p)}},15612(e,t,i){"use strict";let s=i(82469);e.exports=function(e){let t={},i=e.nodes().filter(t=>!e.children(t).length),r=i.map(t=>e.node(t).rank),n=s.applyWithChunking(Math.max,r),o=s.range(n+1).map(()=>[]);return i.sort((t,i)=>e.node(t).rank-e.node(i).rank).forEach(function i(s){if(t[s])return;t[s]=!0;let r=e.node(s);o[r.rank].push(s),e.successors(s).forEach(i)}),o}},7216(e,t,i){"use strict";let s=i(82469);e.exports=function(e,t){let i={};return e.forEach((e,t)=>{let s=i[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(s.barycenter=e.barycenter,s.weight=e.weight)}),t.edges().forEach(e=>{let t=i[e.v],s=i[e.w];void 0!==t&&void 0!==s&&(s.indegree++,t.out.push(i[e.w]))}),function(e){let t=[];function i(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let i=0,s=0;e.weight&&(i+=e.barycenter*e.weight,s+=e.weight),t.weight&&(i+=t.barycenter*t.weight,s+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=i/s,e.weight=s,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function r(t){return i=>{i.in.push(t),0===--i.indegree&&e.push(i)}}for(;e.length;){let s=e.pop();t.push(s),s.in.reverse().forEach(i(s)),s.out.forEach(r(s))}return t.filter(e=>!e.merged).map(e=>s.pick(e,["vs","i","barycenter","weight"]))}(Object.values(i).filter(e=>!e.indegree))}},93315(e,t,i){let s=i(21213),r=i(7216),n=i(31112);e.exports=function e(t,i,o,a){let l=t.children(i),c=t.node(i),h=c?c.borderLeft:void 0,d=c?c.borderRight:void 0,u={};h&&(l=l.filter(e=>e!==h&&e!==d));let p=s(t,l);p.forEach(i=>{if(t.children(i.v).length){let n=e(t,i.v,o,a);u[i.v]=n,Object.hasOwn(n,"barycenter")&&(r=n,void 0!==(s=i).barycenter?(s.barycenter=(s.barycenter*s.weight+r.barycenter*r.weight)/(s.weight+r.weight),s.weight+=r.weight):(s.barycenter=r.barycenter,s.weight=r.weight))}var s,r});let g=r(p,o);!function(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}(g,u);let m=n(g,a);if(h&&(m.vs=[h,m.vs,d].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),i=t.node(t.predecessors(d)[0]);Object.hasOwn(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+e.order+i.order)/(m.weight+2),m.weight+=2}return m}},31112(e,t,i){let s=i(82469);function r(e,t,i){let s;for(;t.length&&(s=t[t.length-1]).i<=i;)t.pop(),e.push(s.vs),i++;return i}e.exports=function(e,t){let i=s.partition(e,e=>Object.hasOwn(e,"barycenter")),n=i.lhs,o=i.rhs.sort((e,t)=>t.i-e.i),a=[],l=0,c=0,h=0;var d;n.sort((d=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:d?t.i-e.i:e.i-t.i)),h=r(a,o,h),n.forEach(e=>{h+=e.vs.length,a.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=r(a,o,h)});let u={vs:a.flat(!0)};return c&&(u.barycenter=l/c,u.weight=c),u}},77999(e){e.exports=function(e){let t=function(e){let t={},i=0;return e.children().forEach(function s(r){let n=i;e.children(r).forEach(s),t[r]={low:n,lim:i++}}),t}(e);e.graph().dummyChains.forEach(i=>{let s=e.node(i),r=s.edgeObj,n=function(e,t,i,s){let r,n,o=[],a=[],l=Math.min(t[i].low,t[s].low),c=Math.max(t[i].lim,t[s].lim);r=i;do{r=e.parent(r),o.push(r)}while(r&&(t[r].low>l||c>t[r].lim));for(n=r,r=s;(r=e.parent(r))!==n;)a.push(r);return{path:o.concat(a.reverse()),lca:n}}(e,t,r.v,r.w),o=n.path,a=n.lca,l=0,c=o[l],h=!0;for(;i!==r.w;){if(s=e.node(i),h){for(;(c=o[l])!==a&&e.node(c).maxRank<s.rank;)l++;c===a&&(h=!1)}if(!h){for(;l<o.length-1&&e.node(c=o[l+1]).minRank<=s.rank;)l++;c=o[l]}e.setParent(i,c),i=e.successors(i)[0]}})}},95101(e,t,i){"use strict";let s=i(55166).Graph,r=i(82469);function n(e,t){let i={};return t.length&&t.reduce(function(t,s){let r=0,n=0,o=t.length,l=s[s.length-1];return s.forEach((t,c)=>{let h=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),d=h?e.node(h).order:o;(h||t===l)&&(s.slice(n,c+1).forEach(t=>{e.predecessors(t).forEach(s=>{let n=e.node(s),o=n.order;!(o<r||d<o)||n.dummy&&e.node(t).dummy||a(i,s,t)})}),n=c+1,r=d)}),s}),i}function o(e,t){let i={};function s(t,s,n,o,l){let c;r.range(s,n).forEach(s=>{c=t[s],e.node(c).dummy&&e.predecessors(c).forEach(t=>{let s=e.node(t);s.dummy&&(s.order<o||s.order>l)&&a(i,t,c)})})}return t.length&&t.reduce(function(t,i){let r,n=-1,o=0;return i.forEach((a,l)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(r=e.node(t[0]).order,s(i,o,l,n,r),o=l,n=r)}s(i,o,i.length,r,t.length)}),i}),i}function a(e,t,i){if(t>i){let e=t;t=i,i=e}let s=e[t];s||(e[t]=s={}),s[i]=!0}function l(e,t,i){if(t>i){let e=t;t=i,i=e}return!!e[t]&&Object.hasOwn(e[t],i)}function c(e,t,i,s){let r={},n={},o={};return t.forEach(e=>{e.forEach((e,t)=>{r[e]=e,n[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=s(e);if(a.length){a=a.sort((e,t)=>o[e]-o[t]);let s=(a.length-1)/2;for(let c=Math.floor(s),h=Math.ceil(s);c<=h;++c){let s=a[c];n[e]===e&&t<o[s]&&!l(i,e,s)&&(n[s]=e,n[e]=r[e]=r[s],t=o[s])}}})}),{root:r,align:n}}function h(e,t,i,r,n){let o={},a=function(e,t,i,r){let n=new s,o=e.graph(),a=function(e,t,i){return(s,r,n)=>{let o,a=s.node(r),l=s.node(n),c=0;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=-a.width/2;break;case"r":o=a.width/2}if(o&&(c+=i?o:-o),o=0,c+=(a.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":o=l.width/2;break;case"r":o=-l.width/2}return o&&(c+=i?o:-o),o=0,c}}(o.nodesep,o.edgesep,r);return t.forEach(t=>{let s;t.forEach(t=>{let r=i[t];if(n.setNode(r),s){var o=i[s],l=n.edge(o,r);n.setEdge(o,r,Math.max(a(e,t,s),l||0))}s=t})}),n}(e,t,i,n),l=n?"borderLeft":"borderRight";function c(e,t){let i=a.nodes(),s=i.pop(),r={};for(;s;)r[s]?e(s):(r[s]=!0,i.push(s),i=i.concat(t(s))),s=i.pop()}return c(function(e){o[e]=a.inEdges(e).reduce((e,t)=>Math.max(e,o[t.v]+a.edge(t)),0)},a.predecessors.bind(a)),c(function(t){let i=a.outEdges(t).reduce((e,t)=>Math.min(e,o[t.w]-a.edge(t)),Number.POSITIVE_INFINITY),s=e.node(t);i!==Number.POSITIVE_INFINITY&&s.borderType!==l&&(o[t]=Math.max(o[t],i))},a.successors.bind(a)),Object.keys(r).forEach(e=>o[e]=o[i[e]]),o}function d(e,t){return Object.values(t).reduce((t,i)=>{let s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([t,i])=>{let n=function(e,t){return e.node(t).width}(e,t)/2;s=Math.max(i+n,s),r=Math.min(i-n,r)});const n=s-r;return n<t[0]&&(t=[n,i]),t},[Number.POSITIVE_INFINITY,null])[1]}function u(e,t){let i=Object.values(t),s=r.applyWithChunking(Math.min,i),n=r.applyWithChunking(Math.max,i);["u","d"].forEach(i=>{["l","r"].forEach(o=>{let a=i+o,l=e[a];if(l===t)return;let c=Object.values(l),h=s-r.applyWithChunking(Math.min,c);"l"!==o&&(h=n-r.applyWithChunking(Math.max,c)),h&&(e[a]=r.mapValues(l,e=>e+h))})})}function p(e,t){return r.mapValues(e.ul,(i,s)=>{if(t)return e[t.toLowerCase()][s];{let t=Object.values(e).map(e=>e[s]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}e.exports={positionX:function(e){let t,i=r.buildLayerMatrix(e),s=Object.assign(n(e,i),o(e,i)),a={};["u","d"].forEach(n=>{t="u"===n?i:Object.values(i).reverse(),["l","r"].forEach(i=>{"r"===i&&(t=t.map(e=>Object.values(e).reverse()));let o=("u"===n?e.predecessors:e.successors).bind(e),l=c(0,t,s,o),d=h(e,t,l.root,l.align,"r"===i);"r"===i&&(d=r.mapValues(d,e=>-e)),a[n+i]=d})});let l=d(e,a);return u(a,l),p(a,e.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:u,findSmallestWidthAlignment:d,balance:p}},7489(e,t,i){"use strict";let s=i(82469),r=i(95101).positionX;e.exports=function(e){(function(e){let t=s.buildLayerMatrix(e),i=e.graph().ranksep,r=0;t.forEach(t=>{const s=t.reduce((t,i)=>{const s=e.node(i).height;return t>s?t:s},0);t.forEach(t=>e.node(t).y=r+s/2),r+=s+i})})(e=s.asNonCompoundGraph(e)),Object.entries(r(e)).forEach(([t,i])=>e.node(t).x=i)}},66884(e,t,i){"use strict";var s=i(55166).Graph,r=i(74354).slack;function n(e,t){return e.nodes().forEach(function i(s){t.nodeEdges(s).forEach(n=>{var o=n.v,a=s===o?n.w:o;e.hasNode(a)||r(t,n)||(e.setNode(a,{}),e.setEdge(s,a,{}),i(a))})}),e.nodeCount()}function o(e,t){return t.edges().reduce((i,s)=>{let n=Number.POSITIVE_INFINITY;return e.hasNode(s.v)!==e.hasNode(s.w)&&(n=r(t,s)),n<i[0]?[n,s]:i},[Number.POSITIVE_INFINITY,null])[1]}function a(e,t,i){e.nodes().forEach(e=>t.node(e).rank+=i)}e.exports=function(e){var t,i,l=new s({directed:!1}),c=e.nodes()[0],h=e.nodeCount();for(l.setNode(c,{});n(l,e)<h;)t=o(l,e),i=l.hasNode(t.v)?r(e,t):-r(e,t),a(l,e,i);return l}},83816(e,t,i){"use strict";var s=i(74354).longestPath,r=i(66884),n=i(48641);e.exports=function(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case"network-simplex":default:!function(e){n(e)}(e);break;case"tight-tree":!function(e){s(e),r(e)}(e);break;case"longest-path":o(e);case"none":}};var o=s},48641(e,t,i){"use strict";var s=i(66884),r=i(74354).slack,n=i(74354).longestPath,o=i(55166).alg.preorder,a=i(55166).alg.postorder,l=i(82469).simplify;function c(e){e=l(e),n(e);var t,i=s(e);for(u(i),h(i,e);t=g(i);)f(i,e,t,m(i,e,t))}function h(e,t){var i=a(e,e.nodes());(i=i.slice(0,i.length-1)).forEach(i=>function(e,t,i){var s=e.node(i).parent;e.edge(i,s).cutvalue=d(e,t,i)}(e,t,i))}function d(e,t,i){var s=e.node(i).parent,r=!0,n=t.edge(i,s),o=0;return n||(r=!1,n=t.edge(s,i)),o=n.weight,t.nodeEdges(i).forEach(n=>{var a,l,c=n.v===i,h=c?n.w:n.v;if(h!==s){var d=c===r,u=t.edge(n).weight;if(o+=d?u:-u,a=i,l=h,e.hasEdge(a,l)){var p=e.edge(i,h).cutvalue;o+=d?-p:p}}}),o}function u(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,i,s,r){var n=i,o=e.node(s);return t[s]=!0,e.neighbors(s).forEach(r=>{Object.hasOwn(t,r)||(i=p(e,t,i,r,s))}),o.low=n,o.lim=i++,r?o.parent=r:delete o.parent,i}function g(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function m(e,t,i){var s=i.v,n=i.w;t.hasEdge(s,n)||(s=i.w,n=i.v);var o=e.node(s),a=e.node(n),l=o,c=!1;o.lim>a.lim&&(l=a,c=!0);var h=t.edges().filter(t=>c===y(0,e.node(t.v),l)&&c!==y(0,e.node(t.w),l));return h.reduce((e,i)=>r(t,i)<r(t,e)?i:e)}function f(e,t,i,s){var r=i.v,n=i.w;e.removeEdge(r,n),e.setEdge(s.v,s.w,{}),u(e),h(e,t),function(e,t){var i=e.nodes().find(e=>!t.node(e).parent),s=o(e,i);(s=s.slice(1)).forEach(i=>{var s=e.node(i).parent,r=t.edge(i,s),n=!1;r||(r=t.edge(s,i),n=!0),t.node(i).rank=t.node(s).rank+(n?r.minlen:-r.minlen)})}(e,t)}function y(e,t,i){return i.low<=t.lim&&t.lim<=i.lim}e.exports=c,c.initLowLimValues=u,c.initCutValues=h,c.calcCutValue=d,c.leaveEdge=g,c.enterEdge=m,c.exchangeEdges=f},74354(e,t,i){"use strict";const{applyWithChunking:s}=i(82469);e.exports={longestPath:function(e){var t={};e.sources().forEach(function i(r){var n=e.node(r);if(Object.hasOwn(t,r))return n.rank;t[r]=!0;let o=e.outEdges(r).map(t=>null==t?Number.POSITIVE_INFINITY:i(t.w)-e.edge(t).minlen);var a=s(Math.min,o);return a===Number.POSITIVE_INFINITY&&(a=0),n.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},82469(e,t,i){"use strict";let s=i(55166).Graph;function r(e,t,i,s){for(var r=s;e.hasNode(r);)r=l(s);return i.dummy=t,e.setNode(r,i),r}e.exports={addBorderNode:function(e,t,i,s){let n={width:0,height:0};return arguments.length>=4&&(n.rank=i,n.order=s),r(e,"border",n,t)},addDummyNode:r,applyWithChunking:n,asNonCompoundGraph:function(e){let t=new s({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(i=>{e.children(i).length||t.setNode(i,e.node(i))}),e.edges().forEach(i=>{t.setEdge(i,e.edge(i))}),t},buildLayerMatrix:function(e){let t=c(o(e)+1).map(()=>[]);return e.nodes().forEach(i=>{let s=e.node(i),r=s.rank;void 0!==r&&(t[r][s.order]=i)}),t},intersectRect:function(e,t){let i,s,r=e.x,n=e.y,o=t.x-r,a=t.y-n,l=e.width/2,c=e.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*l>Math.abs(o)*c?(a<0&&(c=-c),i=c*o/a,s=c):(o<0&&(l=-l),i=l,s=l*a/o),{x:r+i,y:n+s}},mapValues:function(e,t){let i=t;return"string"==typeof t&&(i=e=>e[t]),Object.entries(e).reduce((e,[t,s])=>(e[t]=i(s,t),e),{})},maxRank:o,normalizeRanks:function(e){let t=e.nodes().map(t=>{let i=e.node(t).rank;return void 0===i?Number.MAX_VALUE:i}),i=n(Math.min,t);e.nodes().forEach(t=>{let s=e.node(t);Object.hasOwn(s,"rank")&&(s.rank-=i)})},notime:function(e,t){return t()},partition:function(e,t){let i={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?i.lhs.push(e):i.rhs.push(e)}),i},pick:function(e,t){const i={};for(const s of t)void 0!==e[s]&&(i[s]=e[s]);return i},predecessorWeights:function(e){let t=e.nodes().map(t=>{let i={};return e.inEdges(t).forEach(t=>{i[t.v]=(i[t.v]||0)+e.edge(t).weight}),i});return h(e.nodes(),t)},range:c,removeEmptyRanks:function(e){let t=e.nodes().map(t=>e.node(t).rank),i=n(Math.min,t),s=[];e.nodes().forEach(t=>{let r=e.node(t).rank-i;s[r]||(s[r]=[]),s[r].push(t)});let r=0,o=e.graph().nodeRankFactor;Array.from(s).forEach((t,i)=>{void 0===t&&i%o!==0?--r:void 0!==t&&r&&t.forEach(t=>e.node(t).rank+=r)})},simplify:function(e){let t=(new s).setGraph(e.graph());return e.nodes().forEach(i=>t.setNode(i,e.node(i))),e.edges().forEach(i=>{let s=t.edge(i.v,i.w)||{weight:0,minlen:1},r=e.edge(i);t.setEdge(i.v,i.w,{weight:s.weight+r.weight,minlen:Math.max(s.minlen,r.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let i={};return e.outEdges(t).forEach(t=>{i[t.w]=(i[t.w]||0)+e.edge(t).weight}),i});return h(e.nodes(),t)},time:function(e,t){let i=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-i)+"ms")}},uniqueId:l,zipObject:h};function n(e,t){if(t.length>65535){const i=function(e,t=65535){const i=[];for(let s=0;s<e.length;s+=t){const r=e.slice(s,s+t);i.push(r)}return i}(t);return e.apply(null,i.map(t=>e.apply(null,t)))}return e.apply(null,t)}function o(e){const t=e.nodes().map(t=>{let i=e.node(t).rank;return void 0===i?Number.MIN_VALUE:i});return n(Math.max,t)}let a=0;function l(e){return e+""+ ++a}function c(e,t,i=1){null==t&&(t=e,e=0);let s=e=>e<t;i<0&&(s=e=>t<e);const r=[];for(let t=e;s(t);t+=i)r.push(t);return r}function h(e,t){return e.reduce((e,i,s)=>(e[i]=t[s],e),{})}},69741(e){e.exports="1.1.5"},55166(e,t,i){var s=i(72482);e.exports={Graph:s.Graph,json:i(73082),alg:i(42703),version:s.version}},55783(e){e.exports=function(e){var t,i={},s=[];function r(s){Object.hasOwn(i,s)||(i[s]=!0,t.push(s),e.successors(s).forEach(r),e.predecessors(s).forEach(r))}return e.nodes().forEach(function(e){t=[],r(e),t.length&&s.push(t)}),s}},10400(e){function t(e,t,i,r){for(var n=[[e,!1]];n.length>0;){var o=n.pop();o[1]?r.push(o[0]):Object.hasOwn(i,o[0])||(i[o[0]]=!0,n.push([o[0],!0]),s(t(o[0]),e=>n.push([e,!1])))}}function i(e,t,i,r){for(var n=[e];n.length>0;){var o=n.pop();Object.hasOwn(i,o)||(i[o]=!0,r.push(o),s(t(o),e=>n.push(e)))}}function s(e,t){for(var i=e.length;i--;)t(e[i],i,e);return e}e.exports=function(e,s,r){Array.isArray(s)||(s=[s]);var n=e.isDirected()?t=>e.successors(t):t=>e.neighbors(t),o="post"===r?t:i,a=[],l={};return s.forEach(t=>{if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);o(t,n,l,a)}),a}},32843(e,t,i){var s=i(59349);e.exports=function(e,t,i){return e.nodes().reduce(function(r,n){return r[n]=s(e,n,t,i),r},{})}},59349(e,t,i){var s=i(52821);e.exports=function(e,t,i,n){return function(e,t,i,r){var n,o,a={},l=new s,c=function(e){var t=e.v!==n?e.v:e.w,s=a[t],r=i(e),c=o.distance+r;if(r<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+r);c<s.distance&&(s.distance=c,s.predecessor=n,l.decrease(t,c))};for(e.nodes().forEach(function(e){var i=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:i},l.add(e,i)});l.size()>0&&(n=l.removeMin(),(o=a[n]).distance!==Number.POSITIVE_INFINITY);)r(n).forEach(c);return a}(e,String(t),i||r,n||function(t){return e.outEdges(t)})};var r=()=>1},57706(e,t,i){var s=i(52495);e.exports=function(e){return s(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},85298(e){e.exports=function(e,i,s){return function(e,t,i){var s={},r=e.nodes();return r.forEach(function(e){s[e]={},s[e][e]={distance:0},r.forEach(function(t){e!==t&&(s[e][t]={distance:Number.POSITIVE_INFINITY})}),i(e).forEach(function(i){var r=i.v===e?i.w:i.v,n=t(i);s[e][r]={distance:n,predecessor:e}})}),r.forEach(function(e){var t=s[e];r.forEach(function(i){var n=s[i];r.forEach(function(i){var s=n[e],r=t[i],o=n[i],a=s.distance+r.distance;a<o.distance&&(o.distance=a,o.predecessor=r.predecessor)})})}),s}(e,i||t,s||function(t){return e.outEdges(t)})};var t=()=>1},42703(e,t,i){e.exports={components:i(55783),dijkstra:i(59349),dijkstraAll:i(32843),findCycles:i(57706),floydWarshall:i(85298),isAcyclic:i(20574),postorder:i(26385),preorder:i(57484),prim:i(8523),tarjan:i(52495),topsort:i(81412)}},20574(e,t,i){var s=i(81412);e.exports=function(e){try{s(e)}catch(e){if(e instanceof s.CycleException)return!1;throw e}return!0}},26385(e,t,i){var s=i(10400);e.exports=function(e,t){return s(e,t,"post")}},57484(e,t,i){var s=i(10400);e.exports=function(e,t){return s(e,t,"pre")}},8523(e,t,i){var s=i(76234),r=i(52821);e.exports=function(e,t){var i,n=new s,o={},a=new r;function l(e){var s=e.v===i?e.w:e.v,r=a.priority(s);if(void 0!==r){var n=t(e);n<r&&(o[s]=i,a.decrease(s,n))}}if(0===e.nodeCount())return n;e.nodes().forEach(function(e){a.add(e,Number.POSITIVE_INFINITY),n.setNode(e)}),a.decrease(e.nodes()[0],0);for(var c=!1;a.size()>0;){if(i=a.removeMin(),Object.hasOwn(o,i))n.setEdge(i,o[i]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(i).forEach(l)}return n}},52495(e){e.exports=function(e){var t=0,i=[],s={},r=[];function n(o){var a=s[o]={onStack:!0,lowlink:t,index:t++};if(i.push(o),e.successors(o).forEach(function(e){Object.hasOwn(s,e)?s[e].onStack&&(a.lowlink=Math.min(a.lowlink,s[e].index)):(n(e),a.lowlink=Math.min(a.lowlink,s[e].lowlink))}),a.lowlink===a.index){var l,c=[];do{l=i.pop(),s[l].onStack=!1,c.push(l)}while(o!==l);r.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(s,e)||n(e)}),r}},81412(e){function t(e){var t={},s={},r=[];if(e.sinks().forEach(function n(o){if(Object.hasOwn(s,o))throw new i;Object.hasOwn(t,o)||(s[o]=!0,t[o]=!0,e.predecessors(o).forEach(n),delete s[o],r.push(o))}),Object.keys(t).length!==e.nodeCount())throw new i;return r}class i extends Error{constructor(){super(...arguments)}}e.exports=t,t.CycleException=i},52821(e){e.exports=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(e,t){var i=this._keyIndices;if(e=String(e),!Object.hasOwn(i,e)){var s=this._arr,r=s.length;return i[e]=r,s.push({key:e,priority:t}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var i=this._keyIndices[e];if(t>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[i].priority+" New: "+t);this._arr[i].priority=t,this._decrease(i)}_heapify(e){var t=this._arr,i=2*e,s=i+1,r=e;i<t.length&&(r=t[i].priority<t[r].priority?i:r,s<t.length&&(r=t[s].priority<t[r].priority?s:r),r!==e&&(this._swap(e,r),this._heapify(r)))}_decrease(e){for(var t,i=this._arr,s=i[e].priority;0!==e&&!(i[t=e>>1].priority<s);)this._swap(e,t),e=t}_swap(e,t){var i=this._arr,s=this._keyIndices,r=i[e],n=i[t];i[e]=n,i[t]=r,s[n.key]=e,s[r.key]=t}}},76234(e){"use strict";var t="\0";function i(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function r(e,t,i,s){var r=""+t,n=""+i;if(!e&&r>n){var o=r;r=n,n=o}return r+""+n+""+(void 0===s?"\0":s)}function n(e,t){return r(e,t.v,t.w,t.name)}e.exports=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var i=arguments,s=this;return e.forEach(function(e){i.length>1?s.setNode(e,t):s.setNode(e)}),this}setNode(e,i){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=i),this):(this._nodes[e]=arguments.length>1?i:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=t,this._children[e]={},this._children[t][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var i=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(i),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(i),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===i)i=t;else{for(var s=i+="";void 0!==s;s=this.parent(s))if(s===e)throw new Error("Setting "+i+" as parent of "+e+" would create a cycle");this.setNode(i)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=i,this._children[i][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var i=this._parent[e];if(i!==t)return i}}children(e=t){if(this._isCompound){var i=this._children[e];if(i)return Object.keys(i)}else{if(e===t)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const s=new Set(t);for(var i of this.successors(e))s.add(i);return Array.from(s.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var i=this;Object.entries(this._nodes).forEach(function([i,s]){e(i)&&t.setNode(i,s)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,i.edge(e))});var s={};function r(e){var n=i.parent(e);return void 0===n||t.hasNode(n)?(s[e]=n,n):n in s?s[n]:r(n)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var i=this,s=arguments;return e.reduce(function(e,r){return s.length>1?i.setEdge(e,r,t):i.setEdge(e,r),r}),this}setEdge(){var e,t,s,n,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,s=a.name,2===arguments.length&&(n=arguments[1],o=!0)):(e=a,t=arguments[1],s=arguments[3],arguments.length>2&&(n=arguments[2],o=!0)),e=""+e,t=""+t,void 0!==s&&(s=""+s);var l=r(this._isDirected,e,t,s);if(Object.hasOwn(this._edgeLabels,l))return o&&(this._edgeLabels[l]=n),this;if(void 0!==s&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=o?n:this._defaultEdgeLabelFn(e,t,s);var c=function(e,t,i,s){var r=""+t,n=""+i;if(!e&&r>n){var o=r;r=n,n=o}var a={v:r,w:n};return s&&(a.name=s),a}(this._isDirected,e,t,s);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[l]=c,i(this._preds[t],e),i(this._sucs[e],t),this._in[t][l]=c,this._out[e][l]=c,this._edgeCount++,this}edge(e,t,i){var s=1===arguments.length?n(this._isDirected,arguments[0]):r(this._isDirected,e,t,i);return this._edgeLabels[s]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,i){var s=1===arguments.length?n(this._isDirected,arguments[0]):r(this._isDirected,e,t,i);return Object.hasOwn(this._edgeLabels,s)}removeEdge(e,t,i){var o=1===arguments.length?n(this._isDirected,arguments[0]):r(this._isDirected,e,t,i),a=this._edgeObjs[o];return a&&(e=a.v,t=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){var i=this._in[e];if(i){var s=Object.values(i);return t?s.filter(e=>e.v===t):s}}outEdges(e,t){var i=this._out[e];if(i){var s=Object.values(i);return t?s.filter(e=>e.w===t):s}}nodeEdges(e,t){var i=this.inEdges(e,t);if(i)return i.concat(this.outEdges(e,t))}}},72482(e,t,i){e.exports={Graph:i(76234),version:i(51350)}},73082(e,t,i){var s=i(76234);function r(e){return e.nodes().map(function(t){var i=e.node(t),s=e.parent(t),r={v:t};return void 0!==i&&(r.value=i),void 0!==s&&(r.parent=s),r})}function n(e){return e.edges().map(function(t){var i=e.edge(t),s={v:t.v,w:t.w};return void 0!==t.name&&(s.name=t.name),void 0!==i&&(s.value=i),s})}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:r(e),edges:n(e)};return void 0!==e.graph()&&(t.value=structuredClone(e.graph())),t},read:function(e){var t=new s(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},51350(e){e.exports="2.2.4"},85997(e,t,i){"use strict";i.d(t,{A:()=>o});var s=i(5866),r=i.n(s);const n={normalDateWithWeekday:"ddd, MMM D",normalDate:"D MMMM",shortDate:"MMM D",monthAndDate:"MMMM D",dayOfMonth:"D",year:"YYYY",month:"MMMM",monthShort:"MMM",monthAndYear:"MMMM YYYY",weekday:"dddd",weekdayShort:"ddd",minutes:"mm",hours12h:"hh",hours24h:"HH",seconds:"ss",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDate:"ll",fullDateWithWeekday:"dddd, LL",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDate:"L",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"};class o{constructor({locale:e,formats:t,instance:i}={}){this.lib="moment",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.moment.localeData(this.getCurrentLocaleCode()).longDateFormat("LT")),this.getFormatHelperText=e=>{var t,i;return null!==(i=null===(t=e.match(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g))||void 0===t?void 0:t.map(e=>{const t=e[0];return"L"===t||";"===t?this.moment.localeData(this.getCurrentLocaleCode()).longDateFormat(e):e}).join("").replace(/a/gi,"(a|p)m").toLocaleLowerCase())&&void 0!==i?i:e},this.getCurrentLocaleCode=()=>this.locale||this.moment.locale(),this.parseISO=e=>this.moment(e,!0),this.toISO=e=>e.toISOString(),this.parse=(e,t)=>""===e?null:this.locale?this.moment(e,t,this.locale,!0):this.moment(e,t,!0),this.date=e=>{if(null===e)return null;const t=this.moment(e);return this.locale&&t.locale(this.locale),t},this.toJsDate=e=>e.toDate(),this.isValid=e=>this.moment(e).isValid(),this.isNull=e=>null===e,this.getDiff=(e,t,i)=>this.moment(t).isValid()?e.diff(t,i):0,this.isAfter=(e,t)=>e.isAfter(t),this.isBefore=(e,t)=>e.isBefore(t),this.isAfterDay=(e,t)=>e.isAfter(t,"day"),this.isBeforeDay=(e,t)=>e.isBefore(t,"day"),this.isBeforeMonth=(e,t)=>e.isBefore(t,"month"),this.isAfterMonth=(e,t)=>e.isAfter(t,"month"),this.isBeforeYear=(e,t)=>e.isBefore(t,"year"),this.isAfterYear=(e,t)=>e.isAfter(t,"year"),this.startOfDay=e=>e.clone().startOf("day"),this.endOfDay=e=>e.clone().endOf("day"),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>{const i=e.clone();return this.locale&&i.locale(this.locale),i.format(t)},this.formatNumber=e=>e,this.getHours=e=>e.get("hours"),this.addSeconds=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"seconds"):e.clone().add(t,"seconds"),this.addMinutes=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"minutes"):e.clone().add(t,"minutes"),this.addHours=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"hours"):e.clone().add(t,"hours"),this.addDays=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"days"):e.clone().add(t,"days"),this.addWeeks=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"weeks"):e.clone().add(t,"weeks"),this.addMonths=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"months"):e.clone().add(t,"months"),this.addYears=(e,t)=>t<0?e.clone().subtract(Math.abs(t),"years"):e.clone().add(t,"years"),this.setHours=(e,t)=>e.clone().hours(t),this.getMinutes=e=>e.get("minutes"),this.setMinutes=(e,t)=>e.clone().minutes(t),this.getSeconds=e=>e.get("seconds"),this.setSeconds=(e,t)=>e.clone().seconds(t),this.getMonth=e=>e.get("month"),this.getDaysInMonth=e=>e.daysInMonth(),this.isSameDay=(e,t)=>e.isSame(t,"day"),this.isSameMonth=(e,t)=>e.isSame(t,"month"),this.isSameYear=(e,t)=>e.isSame(t,"year"),this.isSameHour=(e,t)=>e.isSame(t,"hour"),this.setMonth=(e,t)=>e.clone().month(t),this.getMeridiemText=e=>this.is12HourCycleInCurrentLocale()?this.moment.localeData(this.getCurrentLocaleCode()).meridiem("am"===e?0:13,0,!1):"am"===e?"AM":"PM",this.startOfYear=e=>e.clone().startOf("year"),this.endOfYear=e=>e.clone().endOf("year"),this.startOfMonth=e=>e.clone().startOf("month"),this.endOfMonth=e=>e.clone().endOf("month"),this.startOfWeek=e=>e.clone().startOf("week"),this.endOfWeek=e=>e.clone().endOf("week"),this.getNextMonth=e=>e.clone().add(1,"month"),this.getPreviousMonth=e=>e.clone().subtract(1,"month"),this.getMonthArray=e=>{const t=[e.clone().startOf("year")];for(;t.length<12;){const e=t[t.length-1];t.push(this.getNextMonth(e))}return t},this.getYear=e=>e.get("year"),this.setYear=(e,t)=>e.clone().set("year",t),this.getDate=e=>e.get("date"),this.setDate=(e,t)=>e.clone().set("date",t),this.mergeDateAndTime=(e,t)=>e.hour(t.hour()).minute(t.minute()).second(t.second()),this.getWeekdays=()=>this.moment.weekdaysShort(!0),this.isEqual=(e,t)=>null===e&&null===t||this.moment(e).isSame(t),this.getWeekArray=e=>{const t=e.clone().startOf("month").startOf("week"),i=e.clone().endOf("month").endOf("week");let s=0,r=t;const n=[];for(;r.isBefore(i);){const e=Math.floor(s/7);n[e]=n[e]||[],n[e].push(r),r=r.clone().add(1,"day"),s+=1}return n},this.getYearRange=(e,t)=>{const i=this.moment(e).startOf("year"),s=this.moment(t).endOf("year"),r=[];let n=i;for(;n.isBefore(s);)r.push(n),n=n.clone().add(1,"year");return r},this.isWithinRange=(e,[t,i])=>e.isBetween(t,i,null,"[]"),this.moment=i||r(),this.locale=e,this.formats=Object.assign({},n,t)}}},41487(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>f});var s=i(8900),r=i(46903),n=i(75612),o=i(16253),a=i(95093),l=i(3746),c=i(39574),h=function(e,t,i){for(var s=0,r=0;s=r,r=(0,a.se)(),38===s&&12===r&&(t[i]=1),!(0,a.Sh)(r);)(0,a.K2)();return(0,a.di)(e,a.G1)},d=new WeakMap,u=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,i=e.parent,s=e.column===i.column&&e.line===i.line;"rule"!==i.type;)if(!(i=i.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||d.get(i))&&!s){d.set(e,!0);for(var r=[],o=function(e,t){return(0,a.VF)(function(e,t){var i=-1,s=44;do{switch((0,a.Sh)(s)){case 0:38===s&&12===(0,a.se)()&&(t[i]=1),e[i]+=h(a.G1-1,t,i);break;case 2:e[i]+=(0,a.Tb)(s);break;case 4:if(44===s){e[++i]=58===(0,a.se)()?"&\f":"",t[i]=e[i].length;break}default:e[i]+=(0,n.HT)(s)}}while(s=(0,a.K2)());return e}((0,a.c4)(e),t))}(t,r),l=i.props,c=0,u=0;c<o.length;c++)for(var p=0;p<l.length;p++,u++)e.props[u]=r[c]?o[c].replace(/&\f/g,l[p]):l[p]+" "+o[c]}}},p=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function g(e,t){switch((0,n.tW)(e,t)){case 5103:return r.j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r.j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return r.j+e+r.vd+e+r.MS+e+e;case 6828:case 4268:return r.j+e+r.MS+e+e;case 6165:return r.j+e+r.MS+"flex-"+e+e;case 5187:return r.j+e+(0,n.HC)(e,/(\w+).+(:[^]+)/,r.j+"box-$1$2"+r.MS+"flex-$1$2")+e;case 5443:return r.j+e+r.MS+"flex-item-"+(0,n.HC)(e,/flex-|-self/,"")+e;case 4675:return r.j+e+r.MS+"flex-line-pack"+(0,n.HC)(e,/align-content|flex-|-self/,"")+e;case 5548:return r.j+e+r.MS+(0,n.HC)(e,"shrink","negative")+e;case 5292:return r.j+e+r.MS+(0,n.HC)(e,"basis","preferred-size")+e;case 6060:return r.j+"box-"+(0,n.HC)(e,"-grow","")+r.j+e+r.MS+(0,n.HC)(e,"grow","positive")+e;case 4554:return r.j+(0,n.HC)(e,/([^-])(transform)/g,"$1"+r.j+"$2")+e;case 6187:return(0,n.HC)((0,n.HC)((0,n.HC)(e,/(zoom-|grab)/,r.j+"$1"),/(image-set)/,r.j+"$1"),e,"")+e;case 5495:case 3959:return(0,n.HC)(e,/(image-set\([^]*)/,r.j+"$1$`$1");case 4968:return(0,n.HC)((0,n.HC)(e,/(.+:)(flex-)?(.*)/,r.j+"box-pack:$3"+r.MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r.j+e+e;case 4095:case 3583:case 4068:case 2532:return(0,n.HC)(e,/(.+)-inline(.+)/,r.j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if((0,n.b2)(e)-1-t>6)switch((0,n.wN)(e,t+1)){case 109:if(45!==(0,n.wN)(e,t+4))break;case 102:return(0,n.HC)(e,/(.+:)(.+)-([^]+)/,"$1"+r.j+"$2-$3$1"+r.vd+(108==(0,n.wN)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,n.K5)(e,"stretch")?g((0,n.HC)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,n.wN)(e,t+1))break;case 6444:switch((0,n.wN)(e,(0,n.b2)(e)-3-(~(0,n.K5)(e,"!important")&&10))){case 107:return(0,n.HC)(e,":",":"+r.j)+e;case 101:return(0,n.HC)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+r.j+(45===(0,n.wN)(e,14)?"inline-":"")+"box$3$1"+r.j+"$2$3$1"+r.MS+"$2box$3")+e}break;case 5936:switch((0,n.wN)(e,t+11)){case 114:return r.j+e+r.MS+(0,n.HC)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return r.j+e+r.MS+(0,n.HC)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return r.j+e+r.MS+(0,n.HC)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return r.j+e+r.MS+e+e}return e}var m=[function(e,t,i,s){if(e.length>-1&&!e.return)switch(e.type){case r.LU:e.return=g(e.value,e.length);break;case r.Sv:return(0,l.l)([(0,a.C)(e,{value:(0,n.HC)(e.value,"@","@"+r.j)})],s);case r.XZ:if(e.length)return(0,n.kg)(e.props,function(t){switch((0,n.YW)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,l.l)([(0,a.C)(e,{props:[(0,n.HC)(t,/:(read-\w+)/,":"+r.vd+"$1")]})],s);case"::placeholder":return(0,l.l)([(0,a.C)(e,{props:[(0,n.HC)(t,/:(plac\w+)/,":"+r.j+"input-$1")]}),(0,a.C)(e,{props:[(0,n.HC)(t,/:(plac\w+)/,":"+r.vd+"$1")]}),(0,a.C)(e,{props:[(0,n.HC)(t,/:(plac\w+)/,r.MS+"input-$1")]})],s)}return""})}}],f=function(e){var t=e.key;if("css"===t){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,n,a=e.stylisPlugins||m,h={},d=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),i=1;i<t.length;i++)h[t[i]]=!0;d.push(e)});var g,f=[u,p],y=[l.A,(0,c.MY)(function(e){g.insert(e)})],v=(0,c.r1)(f.concat(a,y));n=function(e,t,i,s){var r;g=i,r=e?e+"{"+t.styles+"}":t.styles,(0,l.l)((0,o.wE)(r),v),s&&(C.inserted[t.name]=!0)};var C={key:t,sheet:new s.StyleSheet({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:h,registered:{},insert:n};return C.sheet.hydrate(d),C}},22066(e,t,i){"use strict";i.r(t),i.d(t,{CacheProvider:()=>R,ClassNames:()=>z,Global:()=>G,ThemeContext:()=>I,createElement:()=>F,css:()=>O,jsx:()=>F,keyframes:()=>V,withEmotionCache:()=>P});var s=i(20415),r=i(22155),n=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,i=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(i,t),this.tags.push(i)}var s=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(s);try{var n=105===e.charCodeAt(1)&&64===e.charCodeAt(0);r.insertRule(e,n?0:r.cssRules.length)}catch(e){}}else s.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),o=i(27903),a="/*|*/",l=a+"}";function c(e){e&&h.current.insert(e+"}")}var h={current:null},d=function(e,t,i,s,r,n,o,d,u,p){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return h.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===d)return t+a;break;case 3:switch(d){case 102:case 112:return h.current.insert(i[0]+t),"";default:return t+(0===p?a:"")}case-2:t.split(l).forEach(c)}};function u(e,t,i){var s="";return i.split(" ").forEach(function(i){void 0!==e[i]?t.push(e[i]):s+=i+" "}),s}var p=function(e,t,i){var s=e.key+"-"+t.name;if(!1===i&&void 0===e.registered[s]&&(e.registered[s]=t.styles),void 0===e.inserted[t.name]){var r=t;do{e.insert("."+s,r,e.sheet,!0),r=r.next}while(void 0!==r)}};const g=function(e){for(var t,i=0,s=0,r=e.length;r>=4;++s,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(s)|(255&e.charCodeAt(++s))<<8|(255&e.charCodeAt(++s))<<16|(255&e.charCodeAt(++s))<<24))+(59797*(t>>>16)<<16),i=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&i)+(59797*(i>>>16)<<16);switch(r){case 3:i^=(255&e.charCodeAt(s+2))<<16;case 2:i^=(255&e.charCodeAt(s+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(s)))+(59797*(i>>>16)<<16)}return(((i=1540483477*(65535&(i^=i>>>13))+(59797*(i>>>16)<<16))^i>>>15)>>>0).toString(36)};var m,f=i(55355),y=/[A-Z]|^ms/g,v=/_EMO_([^_]+?)_([^]*?)_EMO_/g,C=function(e){return 45===e.charCodeAt(1)},b=function(e){return null!=e&&"boolean"!=typeof e},S=(m={},function(e){return void 0===m[e]&&(m[e]=C(t=e)?t:t.replace(y,"-$&").toLowerCase()),m[e];var t}),w=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(v,function(e,t,i){return E={name:t,styles:i,next:E},t})}return 1===f.A[e]||C(e)||"number"!=typeof t||0===t?t:t+"px"};function x(e,t,i,s){if(null==i)return"";if(void 0!==i.__emotion_styles)return i;switch(typeof i){case"boolean":return"";case"object":if(1===i.anim)return E={name:i.name,styles:i.styles,next:E},i.name;if(void 0!==i.styles){var r=i.next;if(void 0!==r)for(;void 0!==r;)E={name:r.name,styles:r.styles,next:E},r=r.next;return i.styles+";"}return function(e,t,i){var s="";if(Array.isArray(i))for(var r=0;r<i.length;r++)s+=x(e,t,i[r],!1);else for(var n in i){var o=i[n];if("object"!=typeof o)null!=t&&void 0!==t[o]?s+=n+"{"+t[o]+"}":b(o)&&(s+=S(n)+":"+w(n,o)+";");else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var a=x(e,t,o,!1);switch(n){case"animation":case"animationName":s+=S(n)+":"+a+";";break;default:s+=n+"{"+a+"}"}}else for(var l=0;l<o.length;l++)b(o[l])&&(s+=S(n)+":"+w(n,o[l])+";")}return s}(e,t,i);case"function":if(void 0!==e){var n=E,o=i(e);return E=n,x(e,t,o,s)}}if(null==t)return i;var a=t[i];return void 0===a||s?i:a}var E,M=/label:\s*([^\s;\n{]+)\s*;/g,A=function(e,t,i){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var s=!0,r="";E=void 0;var n=e[0];null==n||void 0===n.raw?(s=!1,r+=x(i,t,n,!1)):r+=n[0];for(var o=1;o<e.length;o++)r+=x(i,t,e[o],46===r.charCodeAt(r.length-1)),s&&(r+=n[o]);M.lastIndex=0;for(var a,l="";null!==(a=M.exec(r));)l+="-"+a[1];return{name:g(r)+l,styles:r,next:E}},T=Object.prototype.hasOwnProperty,D=(0,r.createContext)("undefined"!=typeof HTMLElement?function(e){void 0===e&&(e={});var t,i=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var s,r=new o.A(t),a={};s=e.container||document.head;var l,c=document.querySelectorAll("style[data-emotion-"+i+"]");Array.prototype.forEach.call(c,function(e){e.getAttribute("data-emotion-"+i).split(" ").forEach(function(e){a[e]=!0}),e.parentNode!==s&&s.appendChild(e)}),r.use(e.stylisPlugins)(d),l=function(e,t,i,s){var n=t.name;h.current=i,r(e,t.styles),s&&(u.inserted[n]=!0)};var u={key:i,sheet:new n({key:i,container:s,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:a,registered:{},insert:l};return u}():null),I=(0,r.createContext)({}),R=D.Provider,P=function(e){var t=function(t,i){return(0,r.createElement)(D.Consumer,null,function(s){return e(t,s,i)})};return(0,r.forwardRef)(t)},k="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",L=function(){return null},N=function(e,t,i,s){var n=null===i?t.css:t.css(i);"string"==typeof n&&void 0!==e.registered[n]&&(n=e.registered[n]);var o=t[k],a=[n],l="";"string"==typeof t.className?l=u(e.registered,a,t.className):null!=t.className&&(l=t.className+" ");var c=A(a);p(e,c,"string"==typeof o),l+=e.key+"-"+c.name;var h={};for(var d in t)T.call(t,d)&&"css"!==d&&d!==k&&(h[d]=t[d]);h.ref=s,h.className=l;var g=(0,r.createElement)(o,h),m=(0,r.createElement)(L,null);return(0,r.createElement)(r.Fragment,null,m,g)},_=P(function(e,t,i){return"function"==typeof e.css?(0,r.createElement)(I.Consumer,null,function(s){return N(t,e,s,i)}):N(t,e,null,i)});const O=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A(t)};var F=function(e,t){var i=arguments;if(null==t||!T.call(t,"css"))return r.createElement.apply(void 0,i);var s=i.length,n=new Array(s);n[0]=_,n[1]=function(e,t){var i={};for(var s in t)T.call(t,s)&&(i[s]=t[s]);return i[k]=e,i}(e,t);for(var o=2;o<s;o++)n[o]=i[o];return r.createElement.apply(null,n)},G=P(function(e,t){var i=e.styles;if("function"==typeof i)return(0,r.createElement)(I.Consumer,null,function(e){var s=A([i(e)]);return(0,r.createElement)(B,{serialized:s,cache:t})});var s=A([i]);return(0,r.createElement)(B,{serialized:s,cache:t})}),B=function(e){function t(t,i,s){return e.call(this,t,i,s)||this}(0,s.A)(t,e);var i=t.prototype;return i.componentDidMount=function(){this.sheet=new n({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-emotion-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},i.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},i.insertStyles=function(){if(void 0!==this.props.serialized.next&&p(this.props.cache,this.props.serialized.next,!0),this.sheet.tags.length){var e=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling;this.sheet.before=e,this.sheet.flush()}this.props.cache.insert("",this.props.serialized,this.sheet,!1)},i.componentWillUnmount=function(){this.sheet.flush()},i.render=function(){return null},t}(r.Component),V=function(){var e=O.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},H=function e(t){for(var i=t.length,s=0,r="";s<i;s++){var n=t[s];if(null!=n){var o=void 0;switch(typeof n){case"boolean":break;case"object":if(Array.isArray(n))o=e(n);else for(var a in o="",n)n[a]&&a&&(o&&(o+=" "),o+=a);break;default:o=n}o&&(r&&(r+=" "),r+=o)}}return r},U=function(){return null},z=P(function(e,t){return(0,r.createElement)(I.Consumer,null,function(i){var s=function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];var r=A(i,t.registered);return p(t,r,!1),t.key+"-"+r.name},n={css:s,cx:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return function(e,t,i){var s=[],r=u(e,s,i);return s.length<2?i:r+t(s)}(t.registered,s,H(i))},theme:i},o=e.children(n),a=(0,r.createElement)(U,null);return(0,r.createElement)(r.Fragment,null,a,o)})})},99302(e,t,i){"use strict";i.d(t,{A:()=>n});var s=i(78371),r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,n=(0,s.A)(function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})},78371(e,t,i){"use strict";function s(e){var t=Object.create(null);return function(i){return void 0===t[i]&&(t[i]=e(i)),t[i]}}i.d(t,{A:()=>s})},95803(e,t,i){"use strict";i.d(t,{C:()=>g,E:()=>A,T:()=>y,_:()=>m,a:()=>b,b:()=>S,c:()=>E,h:()=>w,i:()=>u,u:()=>v,w:()=>f});var s=i(22155),r=i(41487),n=i(69932),o=function(e){var t=new WeakMap;return function(i){if(t.has(i))return t.get(i);var s=e(i);return t.set(i,s),s}},a=i(4674),l=i.n(a),c=i(60966),h=i(22855),d=i(82504),u=!1,p=s.createContext("undefined"!=typeof HTMLElement?(0,r.default)({key:"css"}):null),g=p.Provider,m=function(){return(0,s.useContext)(p)},f=function(e){return(0,s.forwardRef)(function(t,i){var r=(0,s.useContext)(p);return e(t,r,i)})},y=s.createContext({}),v=function(){return s.useContext(y)},C=o(function(e){return o(function(t){return function(e,t){return"function"==typeof t?t(e):(0,n.A)({},e,t)}(e,t)})}),b=function(e){var t=s.useContext(y);return e.theme!==t&&(t=C(t)(e.theme)),s.createElement(y.Provider,{value:t},e.children)};function S(e){var t,i,r=e.displayName||e.name||"Component",o=s.forwardRef(function(t,i){var r=s.useContext(y);return s.createElement(e,(0,n.A)({theme:r,ref:i},t))});return o.displayName="WithTheme("+r+")",t=o,i=e,l()(t,i)}var w={}.hasOwnProperty,x="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",E=function(e,t){var i={};for(var s in t)w.call(t,s)&&(i[s]=t[s]);return i[x]=e,i},M=function(e){var t=e.cache,i=e.serialized,s=e.isStringTag;return(0,c.SF)(t,i,s),(0,d.s)(function(){return(0,c.sk)(t,i,s)}),null},A=f(function(e,t,i){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var n=e[x],o=[r],a="";"string"==typeof e.className?a=(0,c.Rk)(t.registered,o,e.className):null!=e.className&&(a=e.className+" ");var l=(0,h.serializeStyles)(o,void 0,s.useContext(y));a+=t.key+"-"+l.name;var d={};for(var p in e)w.call(e,p)&&"css"!==p&&p!==x&&!u&&(d[p]=e[p]);return d.className=a,i&&(d.ref=i),s.createElement(s.Fragment,null,s.createElement(M,{cache:t,serialized:l,isStringTag:"string"==typeof n}),s.createElement(n,d))})},95349(e,t,i){"use strict";i.r(t),i.d(t,{CacheProvider:()=>n.C,ClassNames:()=>f,Global:()=>d,ThemeContext:()=>n.T,ThemeProvider:()=>n.a,__unsafe_useEmotionCache:()=>n._,createElement:()=>h,css:()=>u,jsx:()=>h,keyframes:()=>p,useTheme:()=>n.u,withEmotionCache:()=>n.w,withTheme:()=>n.b});var s,r,n=i(95803),o=i(22155),a=i(60966),l=i(82504),c=i(22855),h=(i(41487),i(4674),function(e,t){var i=arguments;if(null==t||!n.h.call(t,"css"))return o.createElement.apply(void 0,i);var s=i.length,r=new Array(s);r[0]=n.E,r[1]=(0,n.c)(e,t);for(var a=2;a<s;a++)r[a]=i[a];return o.createElement.apply(null,r)});s=h||(h={}),r||(r=s.JSX||(s.JSX={}));var d=(0,n.w)(function(e,t){var i=e.styles,s=(0,c.serializeStyles)([i],void 0,o.useContext(n.T)),r=o.useRef();return(0,l.i)(function(){var e=t.key+"-global",i=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),n=!1,o=document.querySelector('style[data-emotion="'+e+" "+s.name+'"]');return t.sheet.tags.length&&(i.before=t.sheet.tags[0]),null!==o&&(n=!0,o.setAttribute("data-emotion",e),i.hydrate([o])),r.current=[i,n],function(){i.flush()}},[t]),(0,l.i)(function(){var e=r.current,i=e[0];if(e[1])e[1]=!1;else{if(void 0!==s.next&&(0,a.sk)(t,s.next,!0),i.tags.length){var n=i.tags[i.tags.length-1].nextElementSibling;i.before=n,i.flush()}t.insert("",s,i,!1)}},[t,s.name]),null});function u(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return(0,c.serializeStyles)(t)}function p(){var e=u.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var g=function e(t){for(var i=t.length,s=0,r="";s<i;s++){var n=t[s];if(null!=n){var o=void 0;switch(typeof n){case"boolean":break;case"object":if(Array.isArray(n))o=e(n);else for(var a in o="",n)n[a]&&a&&(o&&(o+=" "),o+=a);break;default:o=n}o&&(r&&(r+=" "),r+=o)}}return r},m=function(e){var t=e.cache,i=e.serializedArr;return(0,l.s)(function(){for(var e=0;e<i.length;e++)(0,a.sk)(t,i[e],!1)}),null},f=(0,n.w)(function(e,t){var i=!1,s=[],r=function(){if(i&&n.i)throw new Error("css can only be used during render");for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var l=(0,c.serializeStyles)(r,t.registered);return s.push(l),(0,a.SF)(t,l,!1),t.key+"-"+l.name},l={css:r,cx:function(){if(i&&n.i)throw new Error("cx can only be used during render");for(var e=arguments.length,s=new Array(e),o=0;o<e;o++)s[o]=arguments[o];return function(e,t,i){var s=[],r=(0,a.Rk)(e,s,i);return s.length<2?i:r+t(s)}(t.registered,r,g(s))},theme:o.useContext(n.T)},h=e.children(l);return i=!0,o.createElement(o.Fragment,null,o.createElement(m,{cache:t,serializedArr:s}),h)})},22855(e,t,i){"use strict";i.r(t),i.d(t,{serializeStyles:()=>g});var s={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},r=i(78371),n=/[A-Z]|^ms/g,o=/_EMO_([^_]+?)_([^]*?)_EMO_/g,a=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},c=(0,r.A)(function(e){return a(e)?e:e.replace(n,"-$&").toLowerCase()}),h=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(o,function(e,t,i){return u={name:t,styles:i,next:u},t})}return 1===s[e]||a(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,i){if(null==i)return"";var s=i;if(void 0!==s.__emotion_styles)return s;switch(typeof i){case"boolean":return"";case"object":var r=i;if(1===r.anim)return u={name:r.name,styles:r.styles,next:u},r.name;var n=i;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)u={name:o.name,styles:o.styles,next:u},o=o.next;return n.styles+";"}return function(e,t,i){var s="";if(Array.isArray(i))for(var r=0;r<i.length;r++)s+=d(e,t,i[r])+";";else for(var n in i){var o=i[n];if("object"!=typeof o){var a=o;null!=t&&void 0!==t[a]?s+=n+"{"+t[a]+"}":l(a)&&(s+=c(n)+":"+h(n,a)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var u=d(e,t,o);switch(n){case"animation":case"animationName":s+=c(n)+":"+u+";";break;default:s+=n+"{"+u+"}"}}else for(var p=0;p<o.length;p++)l(o[p])&&(s+=c(n)+":"+h(n,o[p])+";")}return s}(e,t,i);case"function":if(void 0!==e){var a=u,p=i(e);return u=a,d(e,t,p)}}var g=i;if(null==t)return g;var m=t[g];return void 0!==m?m:g}var u,p=/label:\s*([^\s;{]+)\s*(;|$)/g;function g(e,t,i){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var s=!0,r="";u=void 0;var n=e[0];null==n||void 0===n.raw?(s=!1,r+=d(i,t,n)):r+=n[0];for(var o=1;o<e.length;o++)r+=d(i,t,e[o]),s&&(r+=n[o]);p.lastIndex=0;for(var a,l="";null!==(a=p.exec(r));)l+="-"+a[1];var c=function(e){for(var t,i=0,s=0,r=e.length;r>=4;++s,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(s)|(255&e.charCodeAt(++s))<<8|(255&e.charCodeAt(++s))<<16|(255&e.charCodeAt(++s))<<24))+(59797*(t>>>16)<<16),i=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&i)+(59797*(i>>>16)<<16);switch(r){case 3:i^=(255&e.charCodeAt(s+2))<<16;case 2:i^=(255&e.charCodeAt(s+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(s)))+(59797*(i>>>16)<<16)}return(((i=1540483477*(65535&(i^=i>>>13))+(59797*(i>>>16)<<16))^i>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:u}}},8900(e,t,i){"use strict";i.r(t),i.d(t,{StyleSheet:()=>s});var s=function(){function e(e){var t=this;this._insertTag=function(e){var i;i=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,i),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{i.insertRule(e,i.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}()},41786(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>g});var s=i(69932),r=i(95803),n=i(22855),o=i(82504),a=i(60966),l=i(22155),c=i(99302).A,h=function(e){return"theme"!==e},d=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?c:h},u=function(e,t,i){var s;if(t){var r=t.shouldForwardProp;s=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof s&&i&&(s=e.__emotion_forwardProp),s},p=function(e){var t=e.cache,i=e.serialized,s=e.isStringTag;return(0,a.SF)(t,i,s),(0,o.s)(function(){return(0,a.sk)(t,i,s)}),null},g=function e(t,i){var o,c,h=t.__emotion_real===t,g=h&&t.__emotion_base||t;void 0!==i&&(o=i.label,c=i.target);var m=u(t,i,h),f=m||d(g),y=!f("as");return function(){var v=arguments,C=h&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&C.push("label:"+o+";"),null==v[0]||void 0===v[0].raw)C.push.apply(C,v);else{var b=v[0];C.push(b[0]);for(var S=v.length,w=1;w<S;w++)C.push(v[w],b[w])}var x=(0,r.w)(function(e,t,i){var s=y&&e.as||g,o="",h=[],u=e;if(null==e.theme){for(var v in u={},e)u[v]=e[v];u.theme=l.useContext(r.T)}"string"==typeof e.className?o=(0,a.Rk)(t.registered,h,e.className):null!=e.className&&(o=e.className+" ");var b=(0,n.serializeStyles)(C.concat(h),t.registered,u);o+=t.key+"-"+b.name,void 0!==c&&(o+=" "+c);var S=y&&void 0===m?d(s):f,w={};for(var x in e)y&&"as"===x||S(x)&&(w[x]=e[x]);return w.className=o,i&&(w.ref=i),l.createElement(l.Fragment,null,l.createElement(p,{cache:t,serialized:b,isStringTag:"string"==typeof s}),l.createElement(s,w))});return x.displayName=void 0!==o?o:"Styled("+("string"==typeof g?g:g.displayName||g.name||"Component")+")",x.defaultProps=t.defaultProps,x.__emotion_real=x,x.__emotion_base=g,x.__emotion_styles=C,x.__emotion_forwardProp=m,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(t,r){return e(t,(0,s.A)({},i,r,{shouldForwardProp:u(x,r,!0)})).apply(void 0,C)},x}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){g[e]=g(e)})},27903(e,t,i){"use strict";i.d(t,{A:()=>s});const s=function(e){function t(e,s,l,c,u){for(var p,g,m,f,b,w=0,x=0,E=0,M=0,A=0,k=0,N=m=p=0,O=0,F=0,G=0,B=0,V=l.length,H=V-1,U="",z="",W="",j="";O<V;){if(g=l.charCodeAt(O),O===H&&0!==x+M+E+w&&(0!==x&&(g=47===x?10:47),M=E=w=0,V++,H++),0===x+M+E+w){if(O===H&&(0<F&&(U=U.replace(d,"")),0<U.trim().length)){switch(g){case 32:case 9:case 59:case 13:case 10:break;default:U+=l.charAt(O)}g=59}switch(g){case 123:for(p=(U=U.trim()).charCodeAt(0),m=1,B=++O;O<V;){switch(g=l.charCodeAt(O)){case 123:m++;break;case 125:m--;break;case 47:switch(g=l.charCodeAt(O+1)){case 42:case 47:e:{for(N=O+1;N<H;++N)switch(l.charCodeAt(N)){case 47:if(42===g&&42===l.charCodeAt(N-1)&&O+2!==N){O=N+1;break e}break;case 10:if(47===g){O=N+1;break e}}O=N}}break;case 91:g++;case 40:g++;case 34:case 39:for(;O++<H&&l.charCodeAt(O)!==g;);}if(0===m)break;O++}if(m=l.substring(B,O),0===p&&(p=(U=U.replace(h,"").trim()).charCodeAt(0)),64===p){switch(0<F&&(U=U.replace(d,"")),g=U.charCodeAt(1)){case 100:case 109:case 115:case 45:F=s;break;default:F=P}if(B=(m=t(s,F,m,g,u+1)).length,0<L&&(b=a(3,m,F=i(P,U,G),s,D,T,B,g,u,c),U=F.join(""),void 0!==b&&0===(B=(m=b.trim()).length)&&(g=0,m="")),0<B)switch(g){case 115:U=U.replace(S,o);case 100:case 109:case 45:m=U+"{"+m+"}";break;case 107:m=(U=U.replace(y,"$1 $2"))+"{"+m+"}",m=1===R||2===R&&n("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=U+m,112===c&&(z+=m,m="")}else m=""}else m=t(s,i(s,U,G),m,c,u+1);W+=m,m=G=F=N=p=0,U="",g=l.charCodeAt(++O);break;case 125:case 59:if(1<(B=(U=(0<F?U.replace(d,""):U).trim()).length))switch(0===N&&(p=U.charCodeAt(0),45===p||96<p&&123>p)&&(B=(U=U.replace(" ",":")).length),0<L&&void 0!==(b=a(1,U,s,e,D,T,z.length,c,u,c))&&0===(B=(U=b.trim()).length)&&(U="\0\0"),p=U.charCodeAt(0),g=U.charCodeAt(1),p){case 0:break;case 64:if(105===g||99===g){j+=U+l.charAt(O);break}default:58!==U.charCodeAt(B-1)&&(z+=r(U,p,g,U.charCodeAt(2)))}G=F=N=p=0,U="",g=l.charCodeAt(++O)}}switch(g){case 13:case 10:47===x?x=0:0===1+p&&107!==c&&0<U.length&&(F=1,U+="\0"),0<L*_&&a(0,U,s,e,D,T,z.length,c,u,c),T=1,D++;break;case 59:case 125:if(0===x+M+E+w){T++;break}default:switch(T++,f=l.charAt(O),g){case 9:case 32:if(0===M+w+x)switch(A){case 44:case 58:case 9:case 32:f="";break;default:32!==g&&(f=" ")}break;case 0:f="\\0";break;case 12:f="\\f";break;case 11:f="\\v";break;case 38:0===M+x+w&&(F=G=1,f="\f"+f);break;case 108:if(0===M+x+w+I&&0<N)switch(O-N){case 2:112===A&&58===l.charCodeAt(O-3)&&(I=A);case 8:111===k&&(I=k)}break;case 58:0===M+x+w&&(N=O);break;case 44:0===x+E+M+w&&(F=1,f+="\r");break;case 34:case 39:0===x&&(M=M===g?0:0===M?g:M);break;case 91:0===M+x+E&&w++;break;case 93:0===M+x+E&&w--;break;case 41:0===M+x+w&&E--;break;case 40:0===M+x+w&&(0===p&&(2*A+3*k==533||(p=1)),E++);break;case 64:0===x+E+M+w+N+m&&(m=1);break;case 42:case 47:if(!(0<M+w+E))switch(x){case 0:switch(2*g+3*l.charCodeAt(O+1)){case 235:x=47;break;case 220:B=O,x=42}break;case 42:47===g&&42===A&&B+2!==O&&(33===l.charCodeAt(B+2)&&(z+=l.substring(B,O+1)),f="",x=0)}}0===x&&(U+=f)}k=A,A=g,O++}if(0<(B=z.length)){if(F=s,0<L&&void 0!==(b=a(2,z,F,e,D,T,B,c,u,c))&&0===(z=b).length)return j+z+W;if(z=F.join(",")+"{"+z+"}",0!==R*I){switch(2!==R||n(z,2)||(I=0),I){case 111:z=z.replace(C,":-moz-$1")+z;break;case 112:z=z.replace(v,"::-webkit-input-$1")+z.replace(v,"::-moz-$1")+z.replace(v,":-ms-input-$1")+z}I=0}}return j+z+W}function i(e,t,i){var r=t.trim().split(m);t=r;var n=r.length,o=e.length;switch(o){case 0:case 1:var a=0;for(e=0===o?"":e[0]+" ";a<n;++a)t[a]=s(e,t[a],i).trim();break;default:var l=a=0;for(t=[];a<n;++a)for(var c=0;c<o;++c)t[l++]=s(e[c]+" ",r[a],i).trim()}return t}function s(e,t,i){var s=t.charCodeAt(0);switch(33>s&&(s=(t=t.trim()).charCodeAt(0)),s){case 38:return t.replace(f,"$1"+e.trim());case 58:return e.trim()+t.replace(f,"$1"+e.trim());default:if(0<1*i&&0<t.indexOf("\f"))return t.replace(f,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,i,s){var o=e+";",a=2*t+3*i+4*s;if(944===a){e=o.indexOf(":",9)+1;var l=o.substring(e,o.length-1).trim();return l=o.substring(0,e).trim()+l+";",1===R||2===R&&n(l,1)?"-webkit-"+l+l:l}if(0===R||2===R&&!n(o,1))return o;switch(a){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(A,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(l=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+l+o;case 1005:return p.test(o)?o.replace(u,":-webkit-")+o.replace(u,":-moz-")+o:o;case 1e3:switch(t=(l=o.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(t)){case 226:l=o.replace(b,"tb");break;case 232:l=o.replace(b,"tb-rl");break;case 220:l=o.replace(b,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+l+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,a=(l=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:o=o.replace(l,"-webkit-"+l)+";"+o;break;case 207:case 102:o=o.replace(l,"-webkit-"+(102<a?"inline-":"")+"box")+";"+o.replace(l,"-webkit-"+l)+";"+o.replace(l,"-ms-"+l+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return l=o.replace("-items",""),"-webkit-"+o+"-webkit-box-"+l+"-ms-flex-"+l+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(x,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(x,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===M.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,i,s).replace(":fill-available",":stretch"):o.replace(l,"-webkit-"+l)+o.replace(l,"-moz-"+l.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===i+s&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(g,"$1-webkit-$2")+o}return o}function n(e,t){var i=e.indexOf(1===t?":":"{"),s=e.substring(0,3!==t?i:10);return i=e.substring(i+1,e.length-1),N(2!==t?s:s.replace(E,"$1"),i,t)}function o(e,t){var i=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return i!==t+";"?i.replace(w," or ($1)").substring(4):"("+t+")"}function a(e,t,i,s,r,n,o,a,l,h){for(var d,u=0,p=t;u<L;++u)switch(d=k[u].call(c,e,p,i,s,r,n,o,a,l,h)){case void 0:case!1:case!0:case null:break;default:p=d}if(p!==t)return p}function l(e){return void 0!==(e=e.prefix)&&(N=null,e?"function"!=typeof e?R=1:(R=2,N=e):R=0),l}function c(e,i){var s=e;if(33>s.charCodeAt(0)&&(s=s.trim()),s=[s],0<L){var r=a(-1,i,s,s,D,T,0,0,0,0);void 0!==r&&"string"==typeof r&&(i=r)}var n=t(P,s,i,0,0);return 0<L&&void 0!==(r=a(-2,n,s,s,D,T,n.length,0,0,0))&&(n=r),I=0,T=D=1,n}var h=/^\0+/g,d=/[\0\r\f]/g,u=/: */g,p=/zoo|gra/,g=/([,: ])(transform)/g,m=/,\r+?/g,f=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,C=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,S=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,x=/-self|flex-/g,E=/[^]*?(:[rp][el]a[\w-]+)[^]*/,M=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,T=1,D=1,I=0,R=1,P=[],k=[],L=0,N=null,_=0;return c.use=function e(t){switch(t){case void 0:case null:L=k.length=0;break;default:if("function"==typeof t)k[L++]=t;else if("object"==typeof t)for(var i=0,s=t.length;i<s;++i)e(t[i]);else _=0|!!t}return e},c.set=l,void 0!==e&&l(e),c}},55355(e,t,i){"use strict";i.d(t,{A:()=>s});const s={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},82504(e,t,i){"use strict";var s;i.d(t,{i:()=>a,s:()=>o});var r=i(22155),n=!!(s||(s=i.t(r,2))).useInsertionEffect&&(s||(s=i.t(r,2))).useInsertionEffect,o=n||function(e){return e()},a=n||r.useLayoutEffect},60966(e,t,i){"use strict";function s(e,t,i){var s="";return i.split(" ").forEach(function(i){void 0!==e[i]?t.push(e[i]+";"):i&&(s+=i+" ")}),s}i.d(t,{Rk:()=>s,SF:()=>r,sk:()=>n});var r=function(e,t,i){var s=e.key+"-"+t.name;!1===i&&void 0===e.registered[s]&&(e.registered[s]=t.styles)},n=function(e,t,i){r(e,t,i);var s=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var n=t;do{e.insert(t===n?"."+s:"",n,e.sheet,!0),n=n.next}while(void 0!==n)}}},72168(e,t){!function(){var i={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},s=Array.prototype.map,r=Array.isArray,n=Object.prototype.toString;function o(e){return!!(""===e||e&&e.charCodeAt&&e.substr)}function a(e){return r?r(e):"[object Array]"===n.call(e)}function l(e){return e&&"[object Object]"===n.call(e)}function c(e,t){var i;for(i in e=e||{},t=t||{})t.hasOwnProperty(i)&&null==e[i]&&(e[i]=t[i]);return e}function h(e,t,i){var r,n,o=[];if(!e)return o;if(s&&e.map===s)return e.map(t,i);for(r=0,n=e.length;r<n;r++)o[r]=t.call(i,e[r],r,e);return o}function d(e,t){return e=Math.round(Math.abs(e)),isNaN(e)?t:e}function u(e){var t=i.settings.currency.format;return"function"==typeof e&&(e=e()),o(e)&&e.match("%v")?{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}:e&&e.pos&&e.pos.match("%v")?e:o(t)?i.settings.currency.format={pos:t,neg:t.replace("%v","-%v"),zero:t}:t}var p=i.unformat=i.parse=function(e,t){if(a(e))return h(e,function(e){return p(e,t)});if("number"==typeof(e=e||0))return e;t=t||i.settings.number.decimal;var s=new RegExp("[^0-9-"+t+"]",["g"]),r=parseFloat((""+e).replace(/\((.*)\)/,"-$1").replace(s,"").replace(t,"."));return isNaN(r)?0:r},g=i.toFixed=function(e,t){t=d(t,i.settings.number.precision);var s=Math.pow(10,t);return(Math.round(i.unformat(e)*s)/s).toFixed(t)},m=i.formatNumber=i.format=function(e,t,s,r){if(a(e))return h(e,function(e){return m(e,t,s,r)});e=p(e);var n=c(l(t)?t:{precision:t,thousand:s,decimal:r},i.settings.number),o=d(n.precision),u=e<0?"-":"",f=parseInt(g(Math.abs(e||0),o),10)+"",y=f.length>3?f.length%3:0;return u+(y?f.substr(0,y)+n.thousand:"")+f.substr(y).replace(/(\d{3})(?=\d)/g,"$1"+n.thousand)+(o?n.decimal+g(Math.abs(e),o).split(".")[1]:"")},f=i.formatMoney=function(e,t,s,r,n,o){if(a(e))return h(e,function(e){return f(e,t,s,r,n,o)});e=p(e);var g=c(l(t)?t:{symbol:t,precision:s,thousand:r,decimal:n,format:o},i.settings.currency),y=u(g.format);return(e>0?y.pos:e<0?y.neg:y.zero).replace("%s",g.symbol).replace("%v",m(Math.abs(e),d(g.precision),g.thousand,g.decimal))};i.formatColumn=function(e,t,s,r,n,g){if(!e)return[];var f=c(l(t)?t:{symbol:t,precision:s,thousand:r,decimal:n,format:g},i.settings.currency),y=u(f.format),v=y.pos.indexOf("%s")<y.pos.indexOf("%v"),C=0,b=h(e,function(e,t){if(a(e))return i.formatColumn(e,f);var s=((e=p(e))>0?y.pos:e<0?y.neg:y.zero).replace("%s",f.symbol).replace("%v",m(Math.abs(e),d(f.precision),f.thousand,f.decimal));return s.length>C&&(C=s.length),s});return h(b,function(e,t){return o(e)&&e.length<C?v?e.replace(f.symbol,f.symbol+new Array(C-e.length+1).join(" ")):new Array(C-e.length+1).join(" ")+e:e})},e.exports&&(t=e.exports=i),t.accounting=i}()},21371(e){"use strict";var t,i=Object.defineProperty,s=Object.defineProperties,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=Reflect.get,u=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),p=Math.pow,g=(e,t,s)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,m=(e,t)=>{for(var i in t||(t={}))c.call(t,i)&&g(e,i,t[i]);if(a)for(var i of a(t))h.call(t,i)&&g(e,i,t[i]);return e},f=(e,t)=>s(e,n(t)),y=(e,t)=>{var i={};for(var s in e)c.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&a)for(var s of a(e))t.indexOf(s)<0&&h.call(e,s)&&(i[s]=e[s]);return i},v=(e,t)=>{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},C=(e,t,s,n)=>{for(var o,a=n>1?void 0:n?r(t,s):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(n?o(t,s,a):o(a))||a);return n&&a&&i(t,s,a),a},b=(e,t,i)=>d(l(e),i,t),S=(e,t,i)=>new Promise((s,r)=>{var n=e=>{try{a(i.next(e))}catch(e){r(e)}},o=e=>{try{a(i.throw(e))}catch(e){r(e)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);a((i=i.apply(e,t)).next())}),w=function(e,t){this[0]=e,this[1]=t},x=e=>{var t,i=e[u("asyncIterator")],s=!1,r={};return null==i?(i=e[u("iterator")](),t=e=>r[e]=t=>i[e](t)):(i=i.call(e),t=e=>r[e]=t=>{if(s){if(s=!1,"throw"===e)throw t;return t}return s=!0,{done:!1,value:new w(new Promise(s=>{var r=i[e](t);if(!(r instanceof Object))throw TypeError("Object expected");s(r)}),1)}}),r[u("iterator")]=()=>r,t("next"),"throw"in i?t("throw"):r.throw=e=>{throw e},"return"in i&&t("return"),r},E={};v(E,{AgChart:()=>Am,AgCharts:()=>Mm,AgErrorBarSupportedSeriesTypes:()=>M,AgTooltipPositionType:()=>A,Marker:()=>fd,VERSION:()=>Im,_ModuleSupport:()=>zm,_Scale:()=>Vm,_Scene:()=>Rm,_Theme:()=>Gm,_Util:()=>Hm,__FORCE_MODULE_DETECTION:()=>T,time:()=>D}),e.exports=(t=E,((e,t,s,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))c.call(e,s)||void 0===s||i(e,s,{get:()=>t[s],enumerable:!(n=r(t,s))||n.enumerable});return e})(i({},"__esModule",{value:!0}),t));var M=["bar","line","scatter"],A=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(A||{}),T=0,D={};v(D,{day:()=>ee,friday:()=>le,hour:()=>Q,millisecond:()=>F,minute:()=>q,monday:()=>re,month:()=>de,saturday:()=>ce,second:()=>K,sunday:()=>se,thursday:()=>ae,tuesday:()=>ne,utcDay:()=>ye,utcHour:()=>fe,utcMinute:()=>me,utcMonth:()=>ve,utcYear:()=>Ce,wednesday:()=>oe,year:()=>pe});var I=new Map;function R(e,t){I.has(t)||(I.set(t,!0),e())}function P(e){return e}function*k(...e){for(const t of e)yield*x(t)}function L(e,t=0,i){const{leading:s=!0,trailing:r=!0}=null!=i?i:{};let n,o,a=!1;function l(){r&&o?(n=setTimeout(l,t),e(...o)):a=!1,o=null}return Object.assign(function(...i){a?o=i:(a=!0,n=setTimeout(l,t),s?e(...i):o=i)},{cancel(){clearTimeout(n),a=!1,o=null}})}R.clear=()=>I.clear();var N={log(...e){console.log(...e)},warn(e,...t){console.warn(`AG Charts - ${e}`,...t)},error(e,...t){"object"==typeof e?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)},table(...e){console.table(...e)},warnOnce(e,...t){R(()=>N.warn(e,...t),`Logger.warn: ${e}`)},errorOnce(e,...t){R(()=>N.error(e,...t),`Logger.error: ${e}`)}},_=class{constructor(e,t,i){this._encode=e,this._decode=t,this._rangeCallback=i}floor(e){const t=new Date(e),i=this._encode(t);return this._decode(i)}ceil(e){const t=new Date(Number(e)-1),i=this._encode(t);return this._decode(i+1)}range(e,t,i){var s;const r=null==(s=this._rangeCallback)?void 0:s.call(this,e,t),n=this._encode(i?this.floor(e):this.ceil(e)),o=this._encode(i?this.ceil(t):this.floor(t));if(o<n)return[];const a=[];for(let e=n;e<=o;e++){const t=this._decode(e);a.push(t)}return null==r||r(),a}},O=class extends _{getOffset(e,t){const i="number"==typeof e||e instanceof Date?this._encode(new Date(e)):0;return Math.floor(i)%t}every(e,t){let i,s=0;const r=e;r!==(e=Math.max(1,Math.round(e)))&&N.warnOnce(`interval step of [${r}] rounded to [${e}].`);const{snapTo:n="start"}=null!=t?t:{};if("string"==typeof n){const t=s;i=(i,r)=>{const o="start"===n?i:r;return s=this.getOffset(o,e),()=>s=t}}else"number"==typeof n?s=this.getOffset(new Date(n),e):n instanceof Date&&(s=this.getOffset(n,e));return new _(t=>{const i=this._encode(t);return Math.floor((i-s)/e)},t=>this._decode(t*e+s),i)}},F=new O(function(e){return e.getTime()},function(e){return new Date(e)}),G=F,B=(new Date(0).getFullYear(),1e3),V=6e4,H=36e5,U=864e5,z=6048e5,W=31536e6,j=(new Date).getTimezoneOffset()*V,K=new O(function(e){return Math.floor((e.getTime()-j)/B)},function(e){return new Date(j+e*B)}),$=K,Y=(new Date).getTimezoneOffset()*V,q=new O(function(e){return Math.floor((e.getTime()-Y)/V)},function(e){return new Date(Y+e*V)}),X=q,Z=(new Date).getTimezoneOffset()*V,Q=new O(function(e){return Math.floor((e.getTime()-Z)/H)},function(e){return new Date(Z+e*H)}),J=Q,ee=new O(function(e){const t=e.getTimezoneOffset()*V;return Math.floor((e.getTime()-t)/U)},function(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}),te=ee;function ie(e){const t=(7+e-4)%7;return new O(function(e){const i=e.getTimezoneOffset()*V;return Math.floor((e.getTime()-i)/z-t/7)},function(e){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*e+t),i})}var se=ie(0),re=ie(1),ne=ie(2),oe=ie(3),ae=ie(4),le=ie(5),ce=ie(6),he=se,de=new O(function(e){return 12*e.getFullYear()+e.getMonth()},function(e){const t=Math.floor(e/12);return new Date(t,e-12*t,1)}),ue=de,pe=new O(function(e){return e.getFullYear()},function(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}),ge=pe,me=new O(function(e){return Math.floor(e.getTime()/V)},function(e){return new Date(e*V)}),fe=new O(function(e){return Math.floor(e.getTime()/H)},function(e){return new Date(e*H)}),ye=new O(function(e){return Math.floor(e.getTime()/U)},function(e){const t=new Date(0);return t.setUTCDate(t.getUTCDate()+e),t.setUTCHours(0,0,0,0),t}),ve=new O(function(e){return 12*e.getUTCFullYear()+e.getUTCMonth()},function(e){const t=Math.floor(e/12),i=e-12*t;return new Date(Date.UTC(t,i,1))}),Ce=new O(function(e){return e.getUTCFullYear()},function(e){const t=new Date;return t.setUTCFullYear(e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t}),be={isEnterprise:!1},Se=class{constructor(){this.destroyFns=[]}destroy(){for(const e of this.destroyFns)e()}},we=new class{constructor(){this.modules=[],this.dependencies=new Set,this.dependents=new Set}register(...e){for(const t of e){this.registerDependencies(t);const e=this.modules.find(e=>t.type===e.type&&t.optionsKey===e.optionsKey&&t.identifier===e.identifier);if(e){if("enterprise"===t.packageType&&"community"===e.packageType){const i=this.modules.indexOf(e);this.modules.splice(i,1,t)}}else this.modules.push(t)}}hasEnterpriseModules(){return this.modules.some(e=>"enterprise"===e.packageType)}*byType(...e){for(const t of this.modules)e.includes(t.type)&&this.dependencies.has(t.optionsKey)&&(yield t);for(const t of this.modules)!e.includes(t.type)||this.dependencies.has(t.optionsKey)||this.dependents.has(t.optionsKey)||(yield t);for(const t of this.modules)e.includes(t.type)&&this.dependents.has(t.optionsKey)&&(yield t)}registerDependencies(e){if(null!=e.dependencies&&0!==e.dependencies.length){if(this.dependencies.has(e.optionsKey))throw new Error(`Module [${e.optionsKey}] can not both be depended upon by any module and have dependencies of [${e.dependencies}].`);for(const t of e.dependencies){if(this.dependents.has(t))throw new Error(`Module [${t}] can not both be depended upon by any module and have dependencies of [${e.optionsKey}].`);this.dependencies.add(t)}this.dependents.add(e.optionsKey)}}},xe=new class{constructor(){this.axesMap=new Map,this.hidden=new Set,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.instanceConstructor),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate),t.hidden&&this.hidden.add(e)}create(e,t){const i=this.axesMap.get(e);if(i)return new i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}publicKeys(){return[...this.keys()].filter(e=>!this.hidden.has(e))}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},Ee=Symbol("BREAK"),Me="__decorator_config";function Ae(e,t){null==Object.getOwnPropertyDescriptor(e,Me)&&Object.defineProperty(e,Me,{value:{}});const i=e[Me],s=t.toString();if(void 0!==i[s])return i[s];const r=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:r};const n=Object.getOwnPropertyDescriptor(e,t),o=null==n?void 0:n.set,a=null==n?void 0:n.get;return Object.defineProperty(e,t,{set:function(e){const{setters:n,observers:l}=i[s];let c;n.some(e=>e.length>2)&&(c=a?a.call(this):r.get(this));for(const i of n)if((e=i(this,t,e,c))===Ee)return;o?o.call(this,e):r.set(this,e);for(const t of l)t(this,e,c)},get:function(){let e=a?a.call(this):r.get(this);for(const r of i[s].getters)if(e=r(this,t,e),e===Ee)return;return e},enumerable:!0,configurable:!1}),i[s]}function Te(e,t,i){return(s,r)=>{const n=Ae(s,r);n.setters.push(e),t&&n.getters.unshift(t),i&&Object.assign(n,i)}}function De(e){return void 0!==e&&Me in e}function Ie(e){const t=new Set;for(;De(e);)t.add(null==e?void 0:e[Me]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(e=>Object.keys(e))}function Re(e){return Ie(e).reduce((t,i)=>{var s;return t[i]=null!=(s=e[i])?s:null,t},{})}function Pe(e){return null!=e}function ke(e){return Array.isArray(e)}function Le(e){return"boolean"==typeof e}function Ne(e){return e instanceof Date}function _e(e){return Ne(e)&&!isNaN(Number(e))}function Oe(e){return e instanceof RegExp}function Fe(e){return"function"==typeof e}function Ge(e){return"object"==typeof e&&null!==e&&!ke(e)}function Be(e){return ke(e)||Ve(e)}function Ve(e){return"object"==typeof e&&null!==e&&e.constructor===Object}function He(e){return"string"==typeof e}function Ue(e){return"number"==typeof e}function ze(e){return Ue(e)&&Number.isFinite(e)}function We(e){return"undefined"!=typeof window&&e instanceof HTMLElement}function je(e,t){return He(t)&&Object.keys(e).includes(t)}function Ke(e,t){return Object.values(e).includes(t)}function $e(e){return"symbol"==typeof e}function Ye(...e){return qe(...e.reverse())}function qe(...e){const t={};for(const i of e){if(!Ge(i))continue;const e=De(i)?Ie(i):Object.keys(i);for(const s of e)Ve(t[s])&&Ve(i[s])?t[s]=qe(t[s],i[s]):null!=t[s]||(t[s]=i[s])}return t}function Xe(e,...t){return t&&ke(e)?e.map(e=>qe(e,...t)):e}function Ze(e,t){return Object.entries(e).reduce((i,[s,r])=>(i[s]=t(r,s,e),i),{})}function Qe(e,t){const i=m({},e);for(const e of t)delete i[e];return i}function Je(e,t){return(ke(t)?t:t.split(".")).reduce((e,t)=>e[t],e)}var et=new Set(["__proto__","constructor","prototype"]);function tt(e,t,i){const s=ke(t)?t.slice():t.split("."),r=s.pop();s.some(e=>et.has(e))||(s.reduce((e,t)=>e[t],e)[r]=i)}function it(e,t,i){if(void 0===i)return t;for(const s of e){const e=i[s];void 0!==e&&(t[s]=e)}return t}var st=class extends Map{get(e){var t;return null!=(t=super.get(e))?t:"unknown"}isCartesian(e){return"cartesian"===this.get(e)}isPolar(e){return"polar"===this.get(e)}isHierarchy(e){return"hierarchy"===this.get(e)}isTopology(e){return"topology"===this.get(e)}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}},rt=class extends Map{set(e,t){return super.set(e,qe(t,this.get(e)))}},nt=new st,ot=new st,at=new rt,lt=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology"],optionsInnerKey:"image"},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"],optionsInnerKey:"miniChart"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bullet"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"}];function ct(e){var t;return null==(t=lt.find(t=>"series"===t.type&&t.identifier===e))?void 0:t.chartTypes}function ht(e){if(!function(e){return"enterprise"===e.packageType}(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=lt.find(t=>t.type===e.type&&t.optionsKey===e.optionsKey&&t.identifier===e.identifier&&e.chartTypes.every(e=>t.chartTypes.includes(e)));return t&&(null!=t.useCount||(t.useCount=0),t.useCount++),null!=t}function dt(e){var t,i,s;return null!=(s=null==(i=null==(t=e.series)?void 0:t[0])?void 0:i.type)?s:"line"}function ut(e){const t=dt(e);return null==t||("cartesian"===t?(N.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):nt.isCartesian(t)||"cartesian"===(null==(i=ct(t))?void 0:i.find(e=>"cartesian"===e)));var i}function pt(e){const t=dt(e);return null!=t&&("polar"===t?(N.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):nt.isPolar(t)||"polar"===(null==(i=ct(t))?void 0:i.find(e=>"polar"===e)));var i}function gt(e){const t=dt(e);return null!=t&&("hierarchy"===t?(N.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):nt.isHierarchy(t)||"hierarchy"===(null==(i=ct(t))?void 0:i.find(e=>"hierarchy"===e)));var i}function mt(e){const t=dt(e);return null!=t&&("topology"===t?(N.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):nt.isTopology(t)||"topology"===(null==(i=ct(t))?void 0:i.find(e=>"topology"===e)));var i}function ft(e){return null!=e&&xe.has(e)}var yt=class{set(e){const{className:t=this.constructor.name}=this.constructor;if("object"!=typeof e)return N.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const t of Ie(this))if(i.has(t)){const s=e[t],r=this;Ct(r[t])?r[t]=r[t]instanceof vt?r[t].reset(s):r[t].set(s):r[t]=s,i.delete(t)}for(const e of i)N.warn(`unable to set [${e}] in ${t} - property is unknown`);return this}isValid(){return Ie(this).every(e=>{const{optional:t}=function(e,t){const i=t.toString();for(;De(e);){const t=e[Me];if(Object.hasOwn(t,i))return t[i];e=Object.getPrototypeOf(e)}}(this,e),i=t||void 0!==this[e];return i||N.warnOnce(`[${e}] is required.`),i})}toJson(){return Ie(this).reduce((e,t)=>{const i=this[t];return e[t]=Ct(i)?i.toJson():i,e},{})}},vt=class e extends Array{constructor(e,...t){super(t.length),Object.defineProperty(this,"itemFactory",{value:e,enumerable:!1,configurable:!1}),this.set(t)}set(e){if(ke(e)){this.length=e.length;for(let t=0;t<e.length;t++)this[t]=(new this.itemFactory).set(e[t])}return this}reset(t){return new e(this.itemFactory,...t)}toJson(){return this.map(e=>{var t,i;return null!=(i=null==(t=null==e?void 0:e.toJson)?void 0:t.call(e))?i:e})}};function Ct(e){return e instanceof yt||e instanceof vt}var bt="class-instance";function St(e,t,i){if(ke(t)){if(!ke(e)||e.length!==t.length||t.some((t,i)=>null!=St(e[i],t)))return t}else{if(Ve(t)){if(!Ve(e))return t;const s={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of r)if(e[n]!==t[n]&&!(null==i?void 0:i.includes(n)))if(typeof e[n]==typeof t[n]){const i=St(e[n],t[n]);null!==i&&(s[n]=i)}else s[n]=t[n];return Object.keys(s).length?s:null}if(e!==t)return t}return null}function wt(e,t){return ke(e)?e.map(e=>wt(e,t)):Ve(e)?Ze(e,(e,i)=>{var s;return(null==(s=null==t?void 0:t.shallow)?void 0:s.includes(i))?xt(e):wt(e,t)}):xt(e)}function xt(e){return ke(e)?[...e]:Ve(e)?m({},e):Ne(e)?new Date(e):Oe(e)?new RegExp(e.source,e.flags):e}function Et(e,t,i,...s){var r;if(ke(e))t(e,...s),e.forEach((e,r)=>{Et(e,t,i,...At(s,r))});else if(Ve(e)){t(e,...s);for(const n of Object.keys(e)){if(null==(r=null==i?void 0:i.skip)?void 0:r.includes(n))continue;const o=e[n];(ke(o)||Ve(o))&&Et(o,t,i,...At(s,n))}}}function Mt(e,t,i={}){const{path:s,constructedArrays:r,matcherPath:n=(null==s?void 0:s.replace(/(\[[0-9+]+])/i,"[]")),skip:o=[]}=i;if(null==e)throw new Error(`AG Charts - target is uninitialised: ${null!=s?s:"<root>"}`);if(null==t)return e;if(Ct(e))return e.set(t);const a=e,l=Tt(e);for(const c in t){if(et.has(c))continue;const h=`${n?n+".":""}${c}`;if(o.includes(h))continue;const d=t[c],u=`${s?s+".":""}${c}`,p=a.constructor,g=a[c];let y;try{const t=Tt(g),s=Tt(d);if(l===bt&&!(c in e)){N.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - property is unknown`);continue}if(null!=t&&null!=s&&s!==t&&(t!==bt||"object"!==s)){N.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - can't apply type of [${s}], allowed types are: [${t}]`);continue}if(Ct(g))a[c].set(d);else if("array"===s)if(null!=y||(y=null==r?void 0:r.get(g)),null==y)a[c]=d;else{const e=d;a[c]=e.map(e=>Mt(new y,e,f(m({},i),{path:u,matcherPath:h+"[]"})))}else s===bt?a[c]=d:"object"===s?null!=g?Mt(g,d,f(m({},i),{path:u,matcherPath:h})):null==y?(a[c]={},Mt(a[c],d,f(m({},i),{path:u,matcherPath:h}))):a[c]=Mt(new y,d,f(m({},i),{path:u,matcherPath:h})):a[c]=d}catch(e){N.warn(`unable to set [${u}] in [${null==p?void 0:p.name}]; nested error is: ${e.message}`)}}return e}function At(e,t){return e.map(e=>null==e?void 0:e[t])}function Tt(e){return null==e?null:We(e)||Ne(e)?"primitive":ke(e)?"array":Ge(e)?Ve(e)?"object":bt:Fe(e)?"function":"primitive"}var Dt=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],instanceConstructor:i,defaultAxes:s,themeTemplate:r,enterpriseThemeTemplate:n,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,swapDefaultAxesCondition:d,hidden:u}){this.setThemeTemplate(e,r,n),this.seriesMap.set(e,{instanceConstructor:i,defaultAxes:s,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,swapDefaultAxesCondition:d}),nt.set(e,t),u||ot.set(e,t)}create(e,t){var i;const s=null==(i=this.seriesMap.get(e))?void 0:i.instanceConstructor;if(s)return new s(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){var t;const i=null==(t=this.seriesMap.get(e))?void 0:t.defaultAxes;return i?{axes:wt(i)}:null}setThemeTemplate(e,t,i={}){const s=this.themeTemplates.get(e);this.themeTemplates.set(e,{community:qe(t,null==s?void 0:s.community),enterprise:qe(i,t,null==s?void 0:s.community)})}getThemeTemplate(e){const t=this.themeTemplates.get(e);return be.isEnterprise?null==t?void 0:t.enterprise:null==t?void 0:t.community}getPaletteFactory(e){var t;return null==(t=this.seriesMap.get(e))?void 0:t.paletteFactory}isSolo(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.solo)&&i}isGroupable(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.groupable)&&i}isStackable(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.stackable)&&i}isStackedByDefault(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.stackedByDefault)&&i}isDefaultAxisSwapNeeded(e){var t,i,s;let r;for(const n of null!=(t=e.series)?t:[]){const{type:e="line"}=n,t=null==(s=null==(i=this.seriesMap.get(e))?void 0:i.swapDefaultAxesCondition)?void 0:s.call(i,n);if(null!=t){if(null!=r&&r!=t)throw new Error("AG Charts - The provided series have incompatible directions");r=t}}return r}},It=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,instanceConstructor:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,instanceConstructor:i}),this.themeTemplates.set(t,s)}create(e,t){var i;const s=null==(i=this.legendMap.get(e))?void 0:i.instanceConstructor;if(s)return new s(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},Rt=(e=>(e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=17]="LARGE",e))(Rt||{}),Pt=(e=>(e.NORMAL="normal",e.BOLD="bold",e.BOLDER="bolder",e.LIGHTER="lighter",e))(Pt||{}),kt=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(kt||{}),Lt=(e=>(e.CATEGORY="category",e.ORDINAL_TIME="ordinal-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(Lt||{}),Nt=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Nt||{}),_t=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(_t||{}),Ot={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Ft={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Gt=Symbol("is-dark-theme"),Bt=Symbol("extends-axes-defaults"),Vt=Symbol("extends-axes-line-defaults"),Ht=Symbol("extends-axes-tick-defaults"),Ut=Symbol("extends-axes-grid-line-defaults"),zt=Symbol("extends-series-defaults"),Wt=Symbol("extends-cartesian-marker-defaults"),jt=Symbol("default-font"),Kt=Symbol("default-label-colour"),$t=Symbol("default-inverted-label-colour"),Yt=Symbol("default-inside-series-label-colour"),qt=Symbol("default-muted-label-colour"),Xt=Symbol("default-axis-grid-colour"),Zt=Symbol("default-axis-line-colour"),Qt=Symbol("default-cross-lines-colour"),Jt=Symbol("default-background-colour"),ei=Symbol("default-shadow-colour"),ti=Symbol("default-colours"),ii=Symbol("default-waterfall-series-positive-colors"),si=Symbol("default-waterfall-series-negative-colors"),ri=Symbol("default-waterfall-series-total-colors"),ni=Symbol("default-waterfall-series-connector-line-stroke"),oi=Symbol("default-polar-series-stroke"),ai=Symbol("default-diverging-series-colour-range"),li=Symbol("default-hierarchy-fills"),ci=Symbol("default-hierarchy-strokes"),hi=Symbol("default-annotation-stroke"),di=Symbol("default-annotation-background-fill"),ui=Symbol("default-annotation-handle-fill"),pi="white",gi={fills:Object.values(Ot),strokes:Object.values(Ft)},mi={get cartesian(){return{seriesTypes:nt.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:nt.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:nt.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:nt.topologyTypes,commonOptions:[]}}},fi=Object.values(mi).reduce((e,{commonOptions:t})=>e.concat(t),[]),yi=class e{getPalette(){return gi}static getAxisDefaults(e){return qe(e,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:"normal",fontSize:13,fontFamily:jt,color:Kt},label:{fontSize:12,fontFamily:jt,padding:5,color:Kt,avoidCollisions:!0},line:{enabled:!0,width:1,color:Zt},tick:{enabled:!1,width:1,color:Zt},gridLine:{enabled:!0,style:[{stroke:Xt,lineDash:[]}]},crossLines:{enabled:!1,fill:Qt,stroke:Qt,fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:12,fontFamily:jt,padding:5,color:Kt}}})}static getSeriesDefaults(){return{visible:!0,showInLegend:!0,highlightStyle:{item:{fill:"#ffffff54",stroke:"#0006",strokeWidth:2},series:{dimOpacity:1}},nodeClickRange:"exact",tooltip:{enabled:!0}}}static getCartesianSeriesMarkerDefaults(){return{enabled:!0,shape:"circle",size:7,strokeWidth:1}}static getChartDefaults(){return{background:{visible:!0,fill:Jt},padding:{top:20,right:20,bottom:20,left:20},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:"normal",fontSize:17,fontFamily:jt,color:Kt,wrapping:"hyphenate"},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontSize:13,fontFamily:jt,color:qt,wrapping:"hyphenate"},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:13,fontFamily:jt,color:"rgb(140, 140, 140)",wrapping:"hyphenate"},legend:{position:"bottom",spacing:30,listeners:{},item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},toggleSeriesVisible:!0,label:{color:Kt,fontSize:12,fontFamily:jt}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:Kt},inactiveStyle:{fill:qt},highlightStyle:{fill:Kt},label:{color:Kt}}},tooltip:{enabled:!0,darkTheme:Gt,range:"nearest",delay:0},overlays:{loading:{darkTheme:Gt},noData:{darkTheme:Gt},noVisibleSeries:{darkTheme:Gt}},listeners:{}}}constructor(e={}){const{overrides:t,palette:i}=wt(e),s=this.createChartConfigPerChartType(this.getDefaults());t&&this.mergeOverrides(s,t),this.config=Object.freeze(this.templateTheme(s)),this.palette=qe(i,this.getPalette())}mergeOverrides(e,t){for(const{seriesTypes:i,commonOptions:s}of Object.values(mi)){const r=m({},t.common);for(const e of fi)s.includes(e)||delete r[e];if(r)for(const t of i){const i=t;e[i]=qe(r,e[i])}}nt.seriesTypes.forEach(i=>{const s=i;t[s]&&(e[s]=qe(t[s],e[s]))})}createChartConfigPerChartType(e){for(const[t,{seriesTypes:i}]of Object.entries(mi)){const s=at.get(t);for(const t of i)e[t]||(e[t]=wt(s))}return e}getDefaults(){const t=(t,i)=>{var s;const r={},n=m(m(m({axes:{}},It.getThemeTemplates()),e.getChartDefaults()),at.get(t));for(const o of i){r[o]=qe(Dt.getThemeTemplate(o),null!=(s=r[o])?s:wt(n));const{axes:i}=r[o];for(const s of xe.keys())i[s]=qe(i[s],xe.getThemeTemplate(s),"cartesian"===t&&e.cartesianAxisDefault[s])}return r};return qe(t("cartesian",nt.cartesianTypes),t("polar",nt.polarTypes),t("hierarchy",nt.hierarchyTypes),t("topology",nt.topologyTypes))}templateTheme(e){const t=wt(e),{extensions:i,properties:s}=this.getTemplateParameters();return Et(t,e=>{if(e.__extends__){const t=e.__extends__,s=i.get(t);if(null==s)throw new Error(`AG Charts - no template variable provided for: ${t}`);Object.keys(s).forEach(t=>{t in e?Ge(e[t])&&(e[t]=qe(e[t],s[t])):e[t]=s[t]}),delete e.__extends__}if(ke(e))for(let t=0;t<e.length;t++){const i=e[t];s.has(i)&&(e[t]=s.get(i))}else for(const[t,i]of Object.entries(e))s.has(i)&&(e[t]=s.get(i))}),wt(t)}static getDefaultColors(){return{fills:Ot,strokes:Ft}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ot.BLUE,stroke:Ft.BLUE,label:{color:Kt}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ot.ORANGE,stroke:Ft.ORANGE,label:{color:Kt}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ot.GRAY,stroke:Ft.GRAY,label:{color:Kt}}}getTemplateParameters(){const t=new Map;t.set(Bt,e.getAxisDefaults()),t.set(Vt,e.getAxisDefaults().line),t.set(Ht,e.getAxisDefaults().tick),t.set(Ut,e.getAxisDefaults().gridLine),t.set(zt,e.getSeriesDefaults()),t.set(Wt,e.getCartesianSeriesMarkerDefaults());const i=new Map;return i.set(Gt,!1),i.set(jt,"Verdana, sans-serif"),i.set(Kt,"rgb(70, 70, 70)"),i.set($t,"white"),i.set(qt,"rgb(140, 140, 140)"),i.set(Xt,"rgb(224,234,241)"),i.set(Zt,"rgb(195, 195, 195)"),i.set(Qt,"rgb(70, 70, 70)"),i.set(Yt,pi),i.set(Jt,pi),i.set(ei,"rgba(0, 0, 0, 0.5)"),i.set(ai,[Ot.ORANGE,Ot.YELLOW,Ot.GREEN]),i.set(li,["#ffffff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"]),i.set(ci,["#ffffff","#c5cbd1","#a4b1bd","#8498a9","#648096"]),i.set(oi,pi),i.set(ti,e.getDefaultColors()),i.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),i.set(si,e.getWaterfallSeriesDefaultNegativeColors()),i.set(ri,e.getWaterfallSeriesDefaultTotalColors()),i.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),i.set(hi,Ft.BLUE),i.set(di,Ot.BLUE),i.set(ui,pi),{extensions:t,properties:i}}};yi.cartesianAxisDefault={number:yi.getAxisDefaults({line:{enabled:!1}}),log:yi.getAxisDefaults({base:10,line:{enabled:!1}}),category:yi.getAxisDefaults({groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:!1}}),time:yi.getAxisDefaults({gridLine:{enabled:!1}}),"grouped-category":yi.getAxisDefaults()};var vi=yi,Ci="#192232",bi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Si={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},wi={fills:Object.values(bi),strokes:Object.values(Si)},xi=class e extends vi{static getDefaultColors(){return{fills:bi,strokes:Si}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:bi.BLUE,stroke:Si.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:bi.ORANGE,stroke:Si.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:bi.GRAY,stroke:Si.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(Gt,!0),t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(oi,Ci),t.properties.set(Kt,"white"),t.properties.set(qt,"#7D91A0"),t.properties.set(Xt,"#545A6E"),t.properties.set(Qt,"white"),t.properties.set(ai,[bi.ORANGE,bi.YELLOW,bi.GREEN]),t.properties.set(li,["#192834","#253746","#324859","#3f596c","#4d6a80"]),t.properties.set(ci,["#192834","#3b5164","#496275","#577287","#668399"]),t.properties.set(Jt,Ci),t.properties.set(Yt,Ci),t.properties.set(hi,Si.BLUE),t.properties.set(di,bi.BLUE),t.properties.set(ui,Ci),t}getPalette(){return wi}constructor(e){super(e)}},Ei={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Mi={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},Ai={fills:Object.values(Ei),strokes:Object.values(Mi)},Ti=class e extends xi{static getDefaultColors(){return{fills:Ei,strokes:Mi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ei.BLUE,stroke:Mi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ei.RED,stroke:Mi.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ei.GRAY,stroke:Mi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Ei.ORANGE,Ei.YELLOW,Ei.GREEN]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Mi.BLUE),t.properties.set(di,Ei.BLUE),t}getPalette(){return Ai}},Di={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ii={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Ri={fills:Object.values(Di),strokes:Object.values(Ii)},Pi=class e extends vi{static getDefaultColors(){return{fills:Di,strokes:Ii}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Di.BLUE,stroke:Ii.BLUE,label:{color:Kt}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Di.RED,stroke:Ii.RED,label:{color:Kt}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Di.GRAY,stroke:Ii.GRAY,label:{color:Kt}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Di.ORANGE,Di.YELLOW,Di.GREEN]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Ii.BLUE),t.properties.set(di,Di.BLUE),t}getPalette(){return Ri}},ki={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Li={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff"},Ni={fills:Object.values(ki),strokes:Object.values(Li)},_i=class e extends xi{static getDefaultColors(){return{fills:ki,strokes:Li}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:ki.BLUE,stroke:Li.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:ki.RED,stroke:Li.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#eeeeee",label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[ki.BLUE,ki.RED]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Li.BLUE),t.properties.set(di,ki.BLUE),t}getPalette(){return Ni}},Oi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Fi={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb"},Gi={fills:Object.values(Oi),strokes:Object.values(Fi)},Bi=class e extends vi{static getDefaultColors(){return{fills:Oi,strokes:Fi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Oi.BLUE,stroke:Fi.BLUE,label:{color:Kt}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Oi.RED,stroke:Fi.RED,label:{color:Kt}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#888888",label:{color:Kt}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Oi.BLUE,Oi.RED]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Fi.BLUE),t.properties.set(di,Oi.BLUE),t}getPalette(){return Gi}},Vi={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Hi={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},Ui={fills:Object.values(Vi),strokes:Object.values(Hi)},zi=class e extends xi{static getDefaultColors(){return{fills:f(m({},Vi),{RED:Vi.ORANGE}),strokes:f(m({},Hi),{RED:Hi.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Vi.BLUE,stroke:Hi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Vi.ORANGE,stroke:Hi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Vi.GRAY,stroke:Hi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Vi.ORANGE,Vi.YELLOW,Vi.GREEN]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Hi.BLUE),t.properties.set(di,Vi.BLUE),t}getPalette(){return Ui}},Wi={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},ji={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},Ki={fills:Object.values(Wi),strokes:Object.values(ji)},$i=class e extends vi{static getDefaultColors(){return{fills:f(m({},Wi),{RED:Wi.ORANGE}),strokes:f(m({},ji),{RED:ji.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Wi.BLUE,stroke:ji.BLUE,label:{color:Kt}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Wi.ORANGE,stroke:ji.ORANGE,label:{color:Kt}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Wi.GRAY,stroke:ji.GRAY,label:{color:Kt}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Wi.ORANGE,Wi.YELLOW,Wi.GREEN]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,ji.BLUE),t.properties.set(di,Wi.BLUE),t}getPalette(){return Ki}},Yi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},qi={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#c18aff",YELLOW:"#fff653",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Xi={fills:Object.values(Yi),strokes:Object.values(qi)},Zi=class e extends xi{static getDefaultColors(){return{fills:Yi,strokes:qi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Yi.BLUE,stroke:qi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Yi.ORANGE,stroke:qi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Yi.GRAY,stroke:qi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Yi.ORANGE,Yi.YELLOW,Yi.GREEN]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,qi.BLUE),t.properties.set(di,Yi.BLUE),t}getPalette(){return Xi}},Qi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ji={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},es={fills:Object.values(Qi),strokes:Object.values(Ji)},ts=class e extends vi{static getDefaultColors(){return{fills:Qi,strokes:Ji}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Qi.BLUE,stroke:Ji.BLUE,label:{color:Kt}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Qi.ORANGE,stroke:Ji.ORANGE,label:{color:Kt}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Qi.GRAY,stroke:Ji.GRAY,label:{color:Kt}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(si,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Qi.ORANGE,Qi.YELLOW,Qi.GREEN]),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Ji.BLUE),t.properties.set(di,Qi.BLUE),t}getPalette(){return es}},is=()=>new vi,ss=()=>new xi,rs={undefined:is,null:is,"ag-default":is,"ag-sheets":()=>new $i,"ag-polychroma":()=>new Bi,"ag-vivid":()=>new ts,"ag-material":()=>new Pi},ns=m(m({},{undefined:ss,null:ss,"ag-default-dark":ss,"ag-sheets-dark":()=>new zi,"ag-polychroma-dark":()=>new _i,"ag-vivid-dark":()=>new Zi,"ag-material-dark":()=>new Ti}),rs);function os(e){let t=function(e){return void 0===e||"string"==typeof e||e instanceof vi?e:"object"==typeof e?function(e){if(null===e)return;let t=!0;const{baseTheme:i,palette:s,overrides:r}=e;if(void 0!==i&&"string"!=typeof i&&"object"!=typeof i&&(N.warn(`invalid theme.baseTheme type ${typeof i}, expected (string | object).`),t=!1),void 0!==r&&"object"!=typeof r&&(N.warn(`invalid theme.overrides type ${typeof r}, expected object.`),t=!1),"object"==typeof s){if(null!==s){const{fills:e,strokes:i}=s;void 0===e||Array.isArray(e)||(N.warn("theme.overrides.fills must be undefined or an array"),t=!1),void 0===i||Array.isArray(i)||(N.warn("theme.overrides.strokes must be undefined or an array"),t=!1)}}else void 0!==s&&(N.warn(`invalid theme.palette type ${typeof s}, expected object.`),t=!1);return t?e:void 0}(e):void N.warn(`invalid theme value type ${typeof e}, expected object or string.`)}(e);if(t instanceof vi)return t;if(null==t||"string"==typeof t){const e=ns[t];return e?e():(N.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),is())}const i=[];let s;for(;"object"==typeof t;)i.push(t.overrides),null!=s||(s=t.palette),t=t.baseTheme;const r={baseTheme:t,overrides:qe(...i),palette:s};return new((r.baseTheme?os(r.baseTheme):is()).constructor)(r)}function as(e){if(0===e.length)return;let t=1/0,i=-1/0;for(let s of e)s instanceof Date&&(s=s.getTime()),"number"==typeof s&&(s<t&&(t=s),s>i&&(i=s));const s=[t,i];return s.every(isFinite)?s:void 0}function ls(e,t,i){return cs(e,t,i).extent}function cs(e,t,i){var s;let r=!1;return e.length>2&&(e=null!=(s=as(e))?s:[NaN,NaN]),isNaN(t)||(r||(r=t>e[0]),e=[t,e[1]]),isNaN(i)||(r||(r=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:r}}function hs(e,t){if(null==e||null==t||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!hs(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function ds(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function us(e){return Array.from(new Set(e))}function ps(e,t){return e.reduce((e,i)=>{const s=t(i);return null!=e[s]||(e[s]=[]),e[s].push(i),e},{})}function gs(e,t,i=0){if(0===e.length)return[];const s=[];for(let r=0;r<t;r++)s.push(e.at((r+i)%e.length));return s}function ms(e,t){return t.reduce(([t,i],s)=>e(s)?[[...t,s],i]:[t,[...i,s]],[[],[]])}function*fs(e,t){for(const i of e)yield t(i)}function ys(e,t){return!t.some(t=>!function(e,t){return function(e,t){return e.includes(t)}(e,t)}(e,t))}var vs={},Cs=new WeakMap;function bs(e){var t;return e?null==(t=vs.document)?void 0:t[e]:vs.document}function Ss(e){var t;return e?null==(t=vs.window)?void 0:t[e]:vs.window}function ws(e,t,i){const s=bs().createElement(e);return"object"==typeof t&&(i=t,t=void 0),t&&s.classList.add(t),i&&Object.assign(s.style,i),s}function xs(e,t){const{body:i}=bs(),s=ws("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function Es(e,t){var i,s;const r=bs();if(t&&(null==(i=Cs.get(r))?void 0:i.has(t)))return;const n=ws("style");n.innerHTML=e,r.head.insertBefore(n,r.head.querySelector("style")),t&&!Cs.has(r)?Cs.set(r,new Set([t])):t&&(null==(s=Cs.get(r))||s.add(t))}function Ms(e){vs.document=e}function As(e){vs.window=e}"undefined"!=typeof window?vs.window=window:"undefined"!=typeof globalThis&&(vs.window=globalThis.window),"undefined"!=typeof document?vs.document=document:"undefined"!=typeof globalThis&&(vs.document=globalThis.document);var Ts=Date.now(),Ds={create:(...e)=>Object.assign((...t)=>{Ds.check(...e)&&("function"==typeof t[0]&&(t=ds(t[0]())),(()=>{const e=Date.now()-Ts;if(e>2e3){const t=(Math.floor(e/100)/10).toFixed(1);N.log(`**** ${t}s since last log message ****`)}Ts=Date.now()})(),N.log(...t))},{check:()=>Ds.check(...e)}),check:(...e)=>(0===e.length&&e.push(!0),ds(Ss("agChartsDebug")).some(t=>e.includes(t)))},Is=new Set(["map-shape-background","map-line-background"]),Rs=class{constructor(e,t){var i,s;const r={shallow:["data"]},n=wt(e,r),o=this.optionsType(n);this.sanityCheckAndCleanup(n),this.userOptions=n,this.activeTheme=os(n.theme),this.defaultAxes=this.getDefaultAxes(n),this.specialOverrides=this.specialOverridesDefaults(m({},t));const a=this.getSeriesThemeConfig(o),{axes:l={},annotations:c={},series:h}=a,d=y(a,["axes","annotations","series"]);this.processedOptions=wt(qe(this.userOptions,d,this.defaultAxes),r),this.processAxesOptions(this.processedOptions,l),this.processSeriesOptions(this.processedOptions),this.processMiniChartSeriesOptions(this.processedOptions),this.processAnnotationsOptions(this.processedOptions,c),(ut(this.processedOptions)||function(e){const t=dt(e);return pt(e)&&"pie"!==t&&"donut"!==t}(this.processedOptions))&&null==(null==(i=this.processedOptions.legend)?void 0:i.enabled)&&(null!=(s=this.processedOptions).legend||(s.legend={}),this.processedOptions.legend.enabled=this.processedOptions.series.length>1),this.enableConfiguredOptions(this.processedOptions),be.isEnterprise||function(e){var t,i,s,r;const n=[],o=nt.get(dt(e));for(const{type:a,chartTypes:l,optionsKey:c,optionsInnerKey:h,identifier:d}of lt)if("unknown"===o||l.includes(o))if("root"===a||"legend"===a){const t=e[c];if(null==t)continue;h?t[h]&&(n.push(`${c}.${h}`),delete t[h]):(n.push(c),delete e[c])}else if("axis"===a){if(!("axes"in e)||!(null==(t=e.axes)?void 0:t.some(e=>e.type===d)))continue;n.push(`axis[type=${d}]`),e.axes=e.axes.filter(e=>e.type!==d)}else if("axis-option"===a){if(!("axes"in e)||!(null==(i=e.axes)?void 0:i.some(e=>e[c])))continue;n.push(`axis.${c}`),e.axes.forEach(e=>{e[c]&&delete e[c]})}else if("series"===a){if(!(null==(s=e.series)?void 0:s.some(e=>e.type===d)))continue;n.push(`series[type=${d}]`),e.series=e.series.filter(e=>e.type!==d)}else if("series-option"===a){if(!(null==(r=e.series)?void 0:r.some(e=>e[c])))continue;n.push(`series.${c}`),e.series.forEach(e=>{e[c]&&delete e[c]})}if(n.length){let t="ag-charts-enterprise",i="https://charts.ag-grid.com/javascript/installation/";"integrated"===e.mode&&(t="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",i="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),N.warnOnce([`unable to use these enterprise features as '${t}' has not been loaded:`,"",...n,"",`See: ${i}`].join("\n"))}}(this.processedOptions)}getOptions(){var e;return null!=(e=this.processedOptions)?e:{}}diffOptions(e){return St(e,this.processedOptions)}getSeriesThemeConfig(e){var t,i;return wt(null!=(i=null==(t=this.activeTheme)?void 0:t.config[e])?i:{})}getDefaultAxes(e){const t=this.optionsType(e),i=Dt.cloneDefaultAxes(t);return Dt.isDefaultAxisSwapNeeded(e)&&this.swapAxesPosition(i),i}optionsType(e){var t,i,s;return null!=(s=null==(i=null==(t=e.series)?void 0:t[0])?void 0:i.type)?s:"line"}sanityCheckAndCleanup(e){var t;this.deprecationWarnings(e),this.axesTypeIntegrity(e),this.seriesTypeIntegrity(e),this.soloSeriesIntegrity(e),this.removeDisabledOptions(e),this.removeLeftoverSymbols(e),(null==(t=e.series)?void 0:t.some(e=>"bullet"===e.type))&&null!=e.sync&&!1!==e.sync.enabled&&(N.warnOnce("bullet series cannot be synced, disabling synchronization."),delete e.sync)}swapAxesPosition(e){var t;if(ut(e)){const[i,s]=null!=(t=e.axes)?t:[];e.axes=[f(m({},i),{position:s.position}),f(m({},s),{position:i.position})]}}processAxesOptions(e,t){"axes"in e&&(e.axes=e.axes.map(e=>{var i,s,r;const n=qe(null==(i=t[e.type])?void 0:i[e.position],t[e.type]),{crossLines:o}=n,a=y(n,["crossLines"]);e.crossLines&&(e.crossLines=Xe(e.crossLines,o));const l=null==(s=a.gridLine)?void 0:s.style;(null==(r=e.gridLine)?void 0:r.style)&&(null==l?void 0:l.length)&&(e.gridLine.style=e.gridLine.style.map((e,t)=>null!=e.stroke||null!=e.lineDash?qe(e,l.at(t%l.length)):e));const c=qe(e,a),{top:h,right:d,bottom:u,left:p}=c;return y(c,["top","right","bottom","left"])}))}processSeriesOptions(e){const t=this.getDefaultSeriesType(e),i=this.getTooltipPositionDefaults(e),s=Boolean(Ge(e.theme)&&e.theme.palette),r={colourIndex:0,userPalette:s},n=e.series.map(e=>{var n;null!=e.type||(e.type=t);const o=null!=(n=this.getSeriesThemeConfig(e.type).series)?n:{},{innerLabels:a}=o,l=y(o,["innerLabels"]),c=Is.has(e.type)?{colourIndex:0,userPalette:s}:r,h=this.getSeriesPalette(e.type,c),d=qe(this.getSeriesGroupingOptions(e),e,i,l,h);return d.innerLabels&&(d.innerLabels=Xe(d.innerLabels,a)),this.activeTheme.templateTheme(d)});e.series=this.setSeriesGroupingOptions(n)}processMiniChartSeriesOptions(e){var t,i;let s=null==(i=null==(t=e.navigator)?void 0:t.miniChart)?void 0:i.series;if(null==s)return;const r={colourIndex:0,userPalette:Boolean(Ge(e.theme)&&e.theme.palette)};s=s.map(e=>{var t;null!=e.type||(e.type="line");const i=null!=(t=this.getSeriesThemeConfig(e.type).series)?t:{},{innerLabels:s}=i,n=y(i,["innerLabels"]),o=qe(this.getSeriesGroupingOptions(e),e,n,this.getSeriesPalette(e.type,r));return this.activeTheme.templateTheme(o)}),e.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}processAnnotationsOptions(e,t){ut(e)}getSeriesPalette(e,t){const i=Dt.getPaletteFactory(e),{colourIndex:s,userPalette:r}=t,{fills:n=[],strokes:o=[]}=this.activeTheme.palette;return null==i?void 0:i({userPalette:r,colorsCount:Math.max(n.length,o.length),themeTemplateParameters:this.activeTheme.getTemplateParameters(),takeColors:e=>(t.colourIndex+=e,{fills:gs(n,e,s),strokes:gs(o,e,s)})})}getSeriesGroupingOptions(e){const t=Dt.isGroupable(e.type),i=Dt.isStackable(e.type),s=Dt.isStackedByDefault(e.type);e.grouped&&!t&&N.warnOnce(`unsupported grouping of series type "${e.type}".`),!e.stacked&&!e.stackGroup||i||N.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:n}=e;return null!=n||(n=(s||null!=e.stackGroup)&&!(t&&r)),null!=r||(r=!0),{stacked:i&&n,grouped:t&&r&&!(i&&n)}}setSeriesGroupingOptions(e){const t=this.getSeriesGrouping(e);Ds.create(!0,"opts")("setSeriesGroupingOptions() - series grouping: ",t);const i={},s=t.reduce((e,t)=>{var i;return"default"===t.groupType||(null!=e[i=t.seriesType]||(e[i]=0),e[t.seriesType]+="stack"===t.groupType?1:t.series.length),e},{});return t.flatMap(e=>{var t;switch(null!=i[t=e.seriesType]||(i[t]=0),e.groupType){case"stack":const t=i[e.seriesType]++;return e.series.map((i,r)=>Object.assign(i,{seriesGrouping:{groupIndex:t,groupCount:s[e.seriesType],stackIndex:r,stackCount:e.series.length}}));case"group":return e.series.map(t=>Object.assign(t,{seriesGrouping:{groupIndex:i[e.seriesType]++,groupCount:s[e.seriesType],stackIndex:0,stackCount:0}}))}return e.series}).map(e=>{var t=e,{stacked:i,grouped:s}=t;return y(t,["stacked","grouped"])})}getSeriesGroupId(e){var t;return[e.type,e.xKey,e.stacked?null!=(t=e.stackGroup)?t:"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const t=new Map;return e.reduce((e,i)=>{const s=i.type;if(i.stacked||i.grouped){const r=this.getSeriesGroupId(i);if(!t.has(r)){const n={groupType:i.stacked?"stack":"group",seriesType:s,series:[]};t.set(r,n),e.push(n)}t.get(r).series.push(i)}else e.push({groupType:"default",seriesType:s,series:[i]});return e},[])}getDefaultSeriesType(e){if(ut(e))return"line";if(pt(e))return"pie";if(gt(e))return"treemap";if(mt(e))return"map-shape";throw new Error("Invalid chart options type detected.")}getTooltipPositionDefaults(e){var t;const i=null==(t=e.tooltip)?void 0:t.position;if(!Ve(i))return;const{type:s,xOffset:r,yOffset:n}=i,o={};return He(s)&&Ke(A,s)&&(o.type=s),ze(r)&&(o.xOffset=r),ze(n)&&(o.yOffset=n),{tooltip:{position:o}}}deprecationWarnings(e){Object.entries({yKeys:"yKey",yNames:"yName"}).forEach(([t,i])=>{var s;(null==(s=e.series)?void 0:s.some(e=>null!=e[t]))&&N.warnOnce(`Property [series.${t}] is deprecated, please use [series.${i}] and multiple series instead.`)})}axesTypeIntegrity(e){var t;if("axes"in e){const i=null!=(t=e.axes)?t:[];for(const{type:t}of i)if(!ft(t)){delete e.axes;const i=Array.from(xe.publicKeys()).join(", ");N.warnOnce(`unknown axis type: ${t}; expected one of: ${i}`)}}}seriesTypeIntegrity(e){var t;const i=null!=(t=e.series)?t:[];e.series=i.filter(({type:e})=>{if(null==e||null!=(t=e)&&nt.has(t)||function(e){return lt.some(t=>"series"===t.type&&t.identifier===e)}(e))return!0;var t;N.warnOnce(`unknown series type: ${e}; expected one of: ${ot.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(e){const t=e.series;if(t&&t.length>1&&t.some(e=>Dt.isSolo(e.type))){const i=this.optionsType(e);if(Dt.isSolo(i))N.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),e.series=t.slice(0,1);else{const{solo:i,nonSolo:s}=ps(t,e=>Dt.isSolo(e.type)?"solo":"nonSolo"),r=us(i.map(e=>e.type)).join(", ");N.warn(`Unable to mix these series types with the lead series type: ${r}`),e.series=s}}}enableConfiguredOptions(e){Et(this.userOptions,(e,t)=>{t&&"enabled"in t&&!t._enabledFromTheme&&null==e.enabled&&(t.enabled=!0)},{skip:["data","theme"]},e),Et(e,e=>{null!=e._enabledFromTheme&&delete e._enabledFromTheme},{skip:["data","theme"]})}removeDisabledOptions(e){Et(e,e=>{"enabled"in e&&!1===e.enabled&&Object.keys(e).forEach(t=>{"enabled"!==t&&delete e[t]})},{skip:["data","theme"]})}removeLeftoverSymbols(e){Et(e,e=>{if(e&&Ge(e))for(const[t,i]of Object.entries(e))$e(i)&&delete e[t]},{skip:["data"]})}specialOverridesDefaults(e){if(null!=e.window?As(e.window):"undefined"!=typeof window?e.window=window:"undefined"!=typeof globalThis&&(e.window=globalThis.window),null!=e.document?Ms(e.document):"undefined"!=typeof document?e.document=document:"undefined"!=typeof globalThis&&(e.document=globalThis.document),null==e.window)throw new Error("AG Charts - unable to resolve global window");if(null==e.document)throw new Error("AG Charts - unable to resolve global document");return e}};function Ps(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");N.warnOnce(i)}}function ks(e,t){const i=Ps(),s=null==t?void 0:t.default;return Te((t,r,n)=>(n!==s&&i(r.toString(),e),n))}function Ls(e,t){const i=Ps();return Te((s,r,n)=>(n!==s[e]&&(i(r.toString(),`Use [${e}] instead.`),tt(s,e,t?t(n):n)),Ee),(t,s)=>(i(s.toString(),`Use [${e}] instead.`),Je(t,e)))}var Ns={};v(Ns,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Dr,fromToMotion:()=>Ir,staticFromToMotion:()=>Rr});var _s=new Map;function Os(){_s.clear()}function Fs(e){var t;const i=e.constructor,s=Object.hasOwn(i,"className")?i.className:i.name;if(!s)throw new Error(`The ${i} is missing the 'className' property.`);const r=(null!=(t=_s.get(s))?t:0)+1;return _s.set(s,r),`${s}-${r}`}var Gs="$interpolate",Bs=e=>null!=e[Gs];function Vs(e,t,i){return Math.min(i,Math.max(e,t))}function Hs(e,t){const[i,s]=Us(t);return Vs(i,e,s)}function Us(e){return e.length?[Math.min(...e),Math.max(...e)]:[]}function zs(e){const[t,i]=Us(e);return i-t}function Ws(e,t,i=1e-10){return Math.abs(e-t)<i}function js(e){return-1===Math.sign(e)||Object.is(e,-0)}function Ks(e,t=2){const i=p(10,t);return Math.round(e*i)/i}function $s(e,t=2){const i=Math.floor(Math.log(Math.abs(e))/Math.LN10);return i>=0||!isFinite(i)?e.toFixed(t):e.toFixed(Math.abs(i)-1+t)}function Ys(e,t){return Math.floor(e%t+(e<0?t:0))}function qs(e,t=10){const[,i=""]=(Math.abs(e)%1).toLocaleString("en-GB",{minimumFractionDigits:0,maximumFractionDigits:t}).split(".");return i.length}function Xs(e,t,i,s=1/0){const r={nearest:void 0,distanceSquared:s};for(const s of i){const i=s.distanceSquared(e,t);if(0===i)return{nearest:s,distanceSquared:0};i<r.distanceSquared&&(r.nearest=s,r.distanceSquared=i)}return r}function Zs(e,t,i,s=1/0){const{x:r,y:n}=i.transformPoint(e,t),o={nearest:void 0,distanceSquared:s};for(const e of i.children){const{nearest:t,distanceSquared:i}=e.nearestSquared(r,n,o.distanceSquared);if(0===i)return{nearest:t,distanceSquared:i};i<o.distanceSquared&&(o.nearest=t,o.distanceSquared=i)}return o}var Qs=class e{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}clone(){const{x:t,y:i,width:s,height:r}=this;return new e(t,i,s,r)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,t){return e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const i=e-Vs(this.x,e,this.x+this.width),s=t-Vs(this.y,t,this.y+this.height);return i*i+s*s}static nearestBox(e,t,i){return Xs(e,t,i)}clip(e){if(void 0===e)return this;const t=Math.max(this.x,e.x),i=Math.max(this.y,e.y),s=Math.min(this.x+this.width,e.x+e.width),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.y=i,this.width=Math.max(0,s-t),this.height=Math.max(0,r-i),this}shrink(e,t){const i=(e,t)=>{switch(e){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=2*t;break;case"horizontal":this.x+=t,this.width-=2*t;break;case void 0:this.x+=t,this.width-=2*t,this.y+=t,this.height-=2*t}};return"number"==typeof e?i(t,e):"object"==typeof e&&Object.entries(e).forEach(([e,t])=>i(e,t)),this}grow(e,t){if("number"==typeof e)this.shrink(-e,t);else{const t=m({},e);for(const e in t)t[e]*=-1;this.shrink(t)}return this}combine(e){const{x:t,y:i,width:s,height:r}=this;this.x=Math.min(t,e.x),this.y=Math.min(i,e.y),this.width=Math.max(t+s,e.x+e.width)-this.x,this.height=Math.max(i+r,e.y+e.height)-this.y}static merge(t){let i=1/0,s=1/0,r=-1/0,n=-1/0;for(const e of t)e.x<i&&(i=e.x),e.y<s&&(s=e.y),e.x+e.width>r&&(r=e.x+e.width),e.y+e.height>n&&(n=e.y+e.height);return new e(i,s,r-i,n-s)}[Gs](t,i){return new e(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};Qs.zero=new Qs(0,0,0,0),Qs.NaN=new Qs(NaN,NaN,NaN,NaN);var Js=Qs,er=(e=>(e[e.NONE=0]="NONE",e[e.TRIVIAL=1]="TRIVIAL",e[e.MINOR=2]="MINOR",e[e.MAJOR=3]="MAJOR",e))(er||{}),tr=function(){try{return new Function("return true"),!0}catch(e){return!1}}();function ir(e){const{changeCb:t,convertor:i}=null!=e?e:{};return function(s,r){const n=`__${r}`;s[r]||(tr&&null==t&&null==i?function(e,t,i,s){const{redraw:r=1,type:n="normal",checkDirtyOnAssignment:o=!1}=null!=s?s:{},a=new Function("value",`\n        const oldValue = this.${i};\n        if (value !== oldValue) {\n            this.${i} = value;\n            ${"normal"===n?`this.markDirty(this, ${r});`:""}\n            ${"transform"===n?`this.markDirtyTransform(${r});`:""}\n            ${"path"===n?`if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, ${r}); }`:""}\n            ${"font"===n?`if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, ${r}); }`:""}\n        }\n        ${o?"if (value != null && value._dirty > 0) { this.markDirty(value, value._dirty); }":""}\n`),l=new Function(`return this.${i};`);Object.defineProperty(e,t,{set:a,get:l,enumerable:!0,configurable:!0})}(s,r,n,e):function(e,t,i,s){const{redraw:r=1,type:n="normal",changeCb:o,convertor:a,checkDirtyOnAssignment:l=!1}=null!=s?s:{};Object.defineProperty(e,t,{set:function(e){const t=this[i];(e=a?a(e):e)!==t&&(this[i]=e,"normal"===n&&this.markDirty(this,r),"transform"===n&&this.markDirtyTransform(r),"path"!==n||this._dirtyPath||(this._dirtyPath=!0,this.markDirty(this,r)),"font"!==n||this._dirtyFont||(this._dirtyFont=!0,this.markDirty(this,r)),null==o||o(this)),l&&null!=e&&e._dirty>0&&this.markDirty(e,e._dirty)},get:function(){return this[i]},enumerable:!0,configurable:!0})}(s,r,n,e))}}var sr=class{constructor(){this._dirty=3}markDirty(e,t=1){this._dirty<t&&(this._dirty=t)}markClean(e){this._dirty=0}isDirty(){return this._dirty>0}},rr=class e{get e(){return[...this.elements]}constructor(e=[1,0,0,1,0,0]){this.elements=e}setElements(e){const t=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this}get identity(){const e=this.elements;return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}AxB(e,t,i){const s=e[0]*t[0]+e[2]*t[1],r=e[1]*t[0]+e[3]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],a=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];(i=null!=i?i:e)[0]=s,i[1]=r,i[2]=n,i[3]=o,i[4]=a,i[5]=l}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(t){const i=new Array(6);return this.AxB(this.elements,t.elements,i),new e(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],r=t[2],n=t[3];const o=t[4],a=t[5],l=1/(i*n-s*r);return i*=l,s*=l,r*=l,n*=l,new e([n,-s,-r,i,r*a-n*o,s*o-i*a])}inverseTo(e){const t=this.elements;let i=t[0],s=t[1],r=t[2],n=t[3];const o=t[4],a=t[5],l=1/(i*n-s*r);return i*=l,s*=l,r*=l,n*=l,e.setElements([n,-s,-r,i,r*a-n*o,s*o-i*a]),this}invertSelf(){const e=this.elements;let t=e[0],i=e[1],s=e[2],r=e[3];const n=e[4],o=e[5],a=1/(t*r-i*s);return t*=a,i*=a,s*=a,r*=a,e[0]=r,e[1]=-i,e[2]=-s,e[3]=t,e[4]=s*o-r*n,e[5]=i*n-t*o,this}transformPoint(e,t){const i=this.elements;return{x:e*i[0]+t*i[2]+i[4],y:e*i[1]+t*i[3]+i[5]}}transformBBox(e,t){const i=this.elements,s=i[0],r=i[1],n=i[2],o=i[3],a=.5*e.width,l=.5*e.height,c=e.x+a,h=e.y+l,d=Math.abs(a*s)+Math.abs(l*n),u=Math.abs(a*r)+Math.abs(l*o);return t||(t=new Js(0,0,0,0)),t.x=c*s+h*n+i[4]-d,t.y=c*r+h*o+i[5]-u,t.width=d+d,t.height=u+u,t}toContext(e){if(this.identity)return;const t=this.elements;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}static flyweight(t){return e.instance.setElements(t.elements)}static updateTransformMatrix(e,t,i,s,r,n,o){const[a,l]=[0,0],c=t,h=i;let d,u;1===c&&1===h?(d=0,u=0):(d=null==(null==o?void 0:o.scalingCenterX)?a:null==o?void 0:o.scalingCenterX,u=null==(null==o?void 0:o.scalingCenterY)?l:null==o?void 0:o.scalingCenterY);const p=s,g=Math.cos(p),m=Math.sin(p);let f,y;0===p?(f=0,y=0):(f=null==(null==o?void 0:o.rotationCenterX)?a:null==o?void 0:o.rotationCenterX,y=null==(null==o?void 0:o.rotationCenterY)?l:null==o?void 0:o.rotationCenterY);const v=r,C=n,b=d*(1-c)-f,S=u*(1-h)-y;return e.setElements([g*c,m*c,-m*h,g*h,g*b-m*S+f+v,m*b+g*S+y+C]),e}static fromContext(t){const i=t.getTransform();return new e([i.a,i.b,i.c,i.d,i.e,i.f])}};rr.instance=new rr;var nr=rr,or=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(or||{}),ar=class e extends sr{constructor({isVirtual:t,tag:i,zIndex:s}={}){super(),this.serialNumber=e._nextSerialNumber++,this.id=Fs(this),this.isContainerNode=!1,this._virtualChildren=[],this._children=[],this.childSet={},this.matrix=new nr,this.dirtyTransform=!1,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0,this.translationX=0,this.translationY=0,this._childNodeCounts={groups:0,nonGroups:0},this.visible=!0,this.dirtyZIndex=!1,this.zIndex=0,this.zIndexSubOrder=void 0,this.pointerEvents=0,this.isVirtual=null!=t&&t,this.tag=null!=i?i:NaN,this.zIndex=null!=s?s:0}get datum(){var e,t;return null!=(t=this._datum)?t:null==(e=this._parent)?void 0:e.datum}get previousDatum(){return this._previousDatum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum),this._datum=e}_setLayerManager(e){this._layerManager=e,this._debug=null==e?void 0:e.debug;for(const t of this._children)t._setLayerManager(e);for(const t of this._virtualChildren)t._setLayerManager(e)}get layerManager(){return this._layerManager}*ancestors(){let e=this;for(;e=e.parent;)yield e}*traverseUp(){yield this,yield*x(this.ancestors())}get parent(){return this._parent}get children(){return this._virtualChildren.length?this._children.concat(this._virtualChildren.flatMap(e=>e.children)):this._children}get virtualChildren(){return this._virtualChildren}hasVirtualChildren(){return this._virtualChildren.length>0}setProperties(e,t){const i=null!=t?t:Object.keys(e);for(const t of i)this[t]=e[t];return this}append(e){Array.isArray(e)||(e=[e]);for(const t of e){if(t.parent)throw new Error(`${t} already belongs to another parent: ${t.parent}.`);if(t.layerManager)throw new Error(`${t} already belongs to a scene: ${t.layerManager}.`);if(this.childSet[t.id])throw new Error(`Duplicate ${t.constructor.name} node: ${t}`);t.isVirtual?this._virtualChildren.push(t):this._children.push(t),this.childSet[t.id]=!0,t._parent=this,t._setLayerManager(this.layerManager)}this.dirtyZIndex=!0,this.markDirty(this,3)}appendChild(e){return this.append(e),e}removeChild(e){const t=()=>{throw new Error("The node to be removed is not a child of this node.")};if(e.parent!==this&&t(),e.isVirtual){const i=this._virtualChildren.indexOf(e);i<0&&t(),this._virtualChildren.splice(i,1)}else{const i=this._children.indexOf(e);i<0&&t(),this._children.splice(i,1)}return delete this.childSet[e.id],e._parent=void 0,e._setLayerManager(),this.dirtyZIndex=!0,this.markDirty(e,3),e}calculateCumulativeMatrix(){this.computeTransformMatrix();const e=nr.flyweight(this.matrix);for(const t of this.ancestors())t.computeTransformMatrix(),e.preMultiplySelf(t.matrix);return e}transformPoint(e,t){return this.calculateCumulativeMatrix().invertSelf().transformPoint(e,t)}inverseTransformPoint(e,t){return this.calculateCumulativeMatrix().transformPoint(e,t)}transformBBox(e){return this.calculateCumulativeMatrix().invertSelf().transformBBox(e)}inverseTransformBBox(e){return this.calculateCumulativeMatrix().transformBBox(e)}markDirtyTransform(){this.dirtyTransform=!0,this.markDirty(this,3)}containsPoint(e,t){return!1}pickNode(e,t){var i;if(!this.visible||1===this.pointerEvents||!this.containsPoint(e,t))return;const{children:s}=this;if(s.length>1e3)for(let r=s.length-1;r>=0;r--){const n=s[r],o=(null==(i=n.computeTransformedBBox())?void 0:i.containsPoint(e,t))?n.pickNode(e,t):void 0;if(o)return o}else if(s.length)for(let i=s.length-1;i>=0;i--){const r=s[i].pickNode(e,t);if(r)return r}else if(!this.isContainerNode)return this}getCachedBBox(){var e;return null!=(e=this.cachedBBox)?e:Js.zero}computeBBox(){}computeTransformedBBox(){const e=this.computeBBox();if(!e)return;this.computeTransformMatrix();const t=nr.flyweight(this.matrix);for(const e of this.ancestors())e.computeTransformMatrix(),t.preMultiplySelf(e.matrix);return t.transformBBox(e,e),e}computeTransformMatrix(){if(!this.dirtyTransform)return;const{matrix:e,scalingX:t,scalingY:i,rotation:s,translationX:r,translationY:n,scalingCenterX:o,scalingCenterY:a,rotationCenterX:l,rotationCenterY:c}=this;nr.updateTransformMatrix(e,t,i,s,r,n,{scalingCenterX:o,scalingCenterY:a,rotationCenterX:l,rotationCenterY:c}),this.dirtyTransform=!1}preRender(){this._childNodeCounts.groups=0,this._childNodeCounts.nonGroups=1;for(const e of this.children){const t=e.preRender();this._childNodeCounts.groups+=t.groups,this._childNodeCounts.nonGroups+=t.nonGroups}return this._childNodeCounts}render(e){const{stats:t}=e;this._dirty=0,this.cachedBBox=this.computeBBox(),t&&t.nodesRendered++}markDirty(e,t=1,i=t){this._dirty>t||this._dirty===t&&t===i||(this._dirty=t,this.parent?this.parent.markDirty(this,i):this.layerManager&&this.layerManager.markDirty())}get dirty(){return this._dirty}markClean(e){const{force:t=!1,recursive:i=!0}=null!=e?e:{};if(0!==this._dirty||t){if(this._dirty=0,!1!==i)for(const e of this._virtualChildren)e.markClean({force:t});if(!0===i)for(const e of this._children)e.markClean({force:t})}}onVisibleChange(){}get nodeCount(){let e=1,t=this._dirty>=0||this.dirtyTransform?1:0,i=this.visible?1:0;const s=s=>{const{count:r,visibleCount:n,dirtyCount:o}=s.nodeCount;e+=r,i+=n,t+=o};for(const e of this._children)s(e);for(const e of this._virtualChildren)s(e);return{count:e,visibleCount:i,dirtyCount:t}}onZIndexChange(){this.parent&&(this.parent.dirtyZIndex=!0)}};ar._nextSerialNumber=0,C([ir({type:"transform"})],ar.prototype,"scalingX",2),C([ir({type:"transform"})],ar.prototype,"scalingY",2),C([ir({type:"transform"})],ar.prototype,"scalingCenterX",2),C([ir({type:"transform"})],ar.prototype,"scalingCenterY",2),C([ir({type:"transform"})],ar.prototype,"rotationCenterX",2),C([ir({type:"transform"})],ar.prototype,"rotationCenterY",2),C([ir({type:"transform"})],ar.prototype,"rotation",2),C([ir({type:"transform"})],ar.prototype,"translationX",2),C([ir({type:"transform"})],ar.prototype,"translationY",2),C([ir({redraw:3,changeCb:e=>e.onVisibleChange()})],ar.prototype,"visible",2),C([ir({redraw:1,changeCb:e=>e.onZIndexChange()})],ar.prototype,"zIndex",2),C([ir({redraw:1,changeCb:e=>e.onZIndexChange()})],ar.prototype,"zIndexSubOrder",2);var lr=ar,cr=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*p((i+.055)/1.055,2.4)},hr=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*p(i,1/2.4)-.055):12.92*e},dr=class e{constructor(e,t,i,s=1){this.r=Vs(0,e||0,1),this.g=Vs(0,t||0,1),this.b=Vs(0,i||0,1),this.a=Vs(0,s||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!e.parseHex(t):t.indexOf("rgb")>=0?!!e.stringToRgba(t):!!e.nameToHex[t.toLowerCase()]}static fromString(t){if(t.indexOf("#")>=0)return e.fromHexString(t);const i=e.nameToHex[t.toLowerCase()];if(i)return e.fromHexString(i);if(t.indexOf("rgb")>=0)return e.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static tryParseFromString(t){try{return e.fromString(t)}catch(i){return N.warnOnce(`invalid color string: '${t}'.`),e.fromArray([0,0,0])}}static parseHex(e){let t;switch((e=e.replace(/ /g,"").slice(1)).length){case 6:case 8:t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(`${e[i]}${e[i+1]}`,16));break;case 3:case 4:t=e.split("").map(e=>parseInt(e,16)).map(e=>e+16*e)}if((null==t?void 0:t.length)>=3&&t.every(e=>e>=0))return 3===t.length&&t.push(255),t}static fromHexString(t){const i=e.parseHex(t);if(i){const[t,s,r,n]=i;return new e(t/255,s/255,r/255,n/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(e){let[t,i]=[NaN,NaN];for(let s=0;s<e.length;s++){const r=e[s];if(t||"("!==r){if(")"===r){i=s;break}}else t=s}const s=t&&i&&e.substring(t+1,i);if(!s)return;const r=s.split(","),n=[];for(let e=0;e<r.length;e++){const t=r[e];let i=parseFloat(t);if(isNaN(i))return;t.indexOf("%")>=0?(i=Vs(0,i,100),i/=100):3===e?i=Vs(0,i,1):(i=Vs(0,i,255),i/=255),n.push(i)}return n}static fromRgbaString(t){const i=e.stringToRgba(t);if(i){if(3===i.length)return new e(i[0],i[1],i[2]);if(4===i.length)return new e(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(4===t.length)return new e(t[0],t[1],t[2],t[3]);if(3===t.length)return new e(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,r=1){const n=e.HSBtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static fromHSL(t,i,s,r=1){const n=e.HSLtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static fromOKLCH(t,i,s,r=1){const n=e.OKLCHtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static padHex(e){return 1===e.length?"0"+e:e}toHexString(){let t="#"+e.padHex(Math.round(255*this.r).toString(16))+e.padHex(Math.round(255*this.g).toString(16))+e.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(t+=e.padHex(Math.round(255*this.a).toString(16))),t}toRgbaString(e=3){const t=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,e);return 1!==this.a?(t.push(Math.round(this.a*i)/i),`rgba(${t.join(", ")})`):`rgb(${t.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return e.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,t,i){const s=cr(e),r=cr(t),n=cr(i),o=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*n),l=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*n),c=.2104542553*o+.793617785*a-.0040720468*l,h=1.9779984951*o-2.428592205*a+.4505937099*l,d=.0259040371*o+.7827717662*a-.808675766*l,u=180*Math.atan2(d,h)/Math.PI;return[c,Math.hypot(h,d),u>=0?u:u+360]}static OKLCHtoRGB(e,t,i){const s=e,r=t*Math.cos(i*Math.PI/180),n=t*Math.sin(i*Math.PI/180),o=p(s+.3963377774*r+.2158037573*n,3),a=p(s-.1055613458*r-.0638541728*n,3),l=p(s-.0894841775*r-1.291485548*n,3),c=-1.2684380046*o+2.6097574011*a-.3413193965*l,h=-.0041960863*o-.7034186147*a+1.707614701*l;return[hr(4.0767416621*o-3.3077115913*a+.2309699292*l),hr(c),hr(h)]}static RGBtoHSL(e,t,i){const s=Math.min(e,t,i),r=Math.max(e,t,i),n=(r+s)/2;let o,a;if(r===s)o=NaN,a=0;else{const l=r-s;a=n>.5?l/(2-r-s):l/(r+s),o=r===e?(t-i)/l+(t<i?6:0):r===t?(i-e)/l+2:(e-t)/l+4,o*=60}return[o,a,n]}static HSLtoRGB(e,t,i){if(0===t)return[i,i,i];const s=i<.5?i*(1+t):i+t-i*t,r=2*i-s;function n(e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+6*(s-r)*e:e<.5?s:e<2/3?r+(s-r)*(2/3-e)*6:r}return[n(e/360+1/3),n(e/360),n(e/360-1/3)]}static RGBtoHSB(e,t,i){const s=Math.min(e,t,i),r=Math.max(e,t,i);let n=NaN;if(s!==r){const o=r-s,a=(r-e)/o,l=(r-t)/o,c=(r-i)/o;n=e===r?c-l:t===r?2+a-c:4+l-a,n/=6,n<0&&(n+=1)}return[360*n,0===r?0:(r-s)/r,r]}static HSBtoRGB(e,t,i){isNaN(e)&&(e=0),e=(e%360+360)%360/360;let s=0,r=0,n=0;if(0===t)s=r=n=i;else{const o=6*(e-Math.floor(e)),a=o-Math.floor(o),l=i*(1-t),c=i*(1-t*a),h=i*(1-t*(1-a));switch(0|o){case 0:s=i,r=h,n=l;break;case 1:s=c,r=i,n=l;break;case 2:s=l,r=i,n=h;break;case 3:s=l,r=c,n=i;break;case 4:s=h,r=l,n=i;break;case 5:s=i,r=l,n=c}}return[s,r,n]}derive(t,i,s,r){const n=e.RGBtoHSB(this.r,this.g,this.b);let o=n[2];0==o&&s>1&&(o=.05);const a=((n[0]+t)%360+360)%360,l=Vs(0,n[1]*i,1);o=Vs(0,o*s,1);const c=Vs(0,this.a*r,1),h=e.HSBtoRGB(a,l,o);return h.push(c),e.fromArray(h)}brighter(){return this.derive(0,1,1/.7,1)}darker(){return this.derive(0,1,.7,1)}static interpolate(t,i){const s=e.tryParseFromString(t),r=e.tryParseFromString(i);return t=>{const i=(e,i)=>e*(1-t)+i*t;return new e(i(s.r,r.r),i(s.g,r.g),i(s.b,r.b),i(s.a,r.a)).toString()}}};dr.didDebug=!1,dr.nameToHex=Object.freeze({aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",transparent:"#00000000",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"});var ur=dr;function pr(e,t){return i=>Number(e)*(1-i)+Number(t)*i}var gr={};v(gr,{easeIn:()=>fr,easeInOut:()=>vr,easeInOutQuad:()=>Sr,easeInQuad:()=>Cr,easeOut:()=>yr,easeOutQuad:()=>br,inverseEaseOut:()=>wr,linear:()=>mr});var mr=e=>e,fr=e=>1-Math.cos(e*Math.PI/2),yr=e=>Math.sin(e*Math.PI/2),vr=e=>-(Math.cos(e*Math.PI)-1)/2,Cr=e=>e*e,br=e=>1-p(1-e,2),Sr=e=>e<.5?2*e*e:1-p(-2*e+2,2)/2,wr=e=>2*Math.asin(e)/Math.PI,xr=["initial","remove","update","add","trailing","end","none"],Er={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},Mr=(e=>(e.Loop="loop",e.Reverse="reverse",e))(Mr||{});function Ar(e){return e.every(e=>e instanceof lr)?{nodes:e,selections:[]}:{nodes:[],selections:e}}var Tr=class{constructor(e){var t,i,s,r,n,o,a;this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=null==(t=e.autoplay)||t,this.ease=null!=(i=e.ease)?i:mr,this.phase=e.phase;const l=null!=(s=e.duration)?s:Er[this.phase].animationDuration;this.duration=l*e.defaultDuration,this.delay=(null!=(r=e.delay)?r:0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,!0===e.skip&&(null==(n=this.onUpdate)||n.call(this,e.to,!1,this),null==(o=this.onStop)||o.call(this,this),null==(a=this.onComplete)||a.call(this,this),this.isComplete=!0),!1!==e.collapsable&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return e.from===e.to?0:"object"==typeof e.from&&St(e.from,e.to)?t:0}play(e=!1){var t,i;this.isPlaying||this.isComplete||(this.isPlaying=!0,null==(t=this.onPlay)||t.call(this,this),this.autoplay&&(this.autoplay=!1,e&&(null==(i=this.onUpdate)||i.call(this,this.from,!0,this))))}pause(){this.isPlaying=!1}stop(){var e;this.isPlaying=!1,this.isComplete||(this.isComplete=!0,null==(e=this.onStop)||e.call(this,this))}update(e){var t,i;if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const s=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const r=this.interpolate(this.isReverse?1-this.delta:this.delta);null==(t=this.onUpdate)||t.call(this,r,!1,this);const n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,null==(i=this.onComplete)||i.call(this,this),e-(n-s)):0}get delta(){return this.ease(Vs(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if("object"!=typeof t||Bs(t))return this.interpolateValue(e,t);const i=[];for(const s in t){const r=this.interpolateValue(e[s],t[s]);null!=r&&i.push([s,r])}return e=>{const t={};for(const[s,r]of i)t[s]=r(e);return t}}interpolateValue(e,t){if(void 0!==e&&void 0!==t){if(Bs(e))return i=>e[Gs](t,i);try{switch(typeof e){case"number":return pr(e,t);case"string":return function(e,t){if("string"==typeof e)try{e=ur.fromString(e)}catch(t){e=ur.fromArray([0,0,0])}if("string"==typeof t)try{t=ur.fromString(t)}catch(e){t=ur.fromArray([0,0,0])}const i=pr(e.r,t.r),s=pr(e.g,t.g),r=pr(e.b,t.b),n=pr(e.a,t.a);return e=>ur.fromArray([i(e),s(e),r(e),n(e)]).toRgbaString()}(e,t);case"boolean":if(e===t)return()=>e}}catch(e){}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Dr={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Ir(e,t,i,s,r,n,o){const{fromFn:a,toFn:l,intermediateFn:c}=r,{nodes:h,selections:d}=Ar(s),u=(s,r)=>{var h;let d,u=0,p=0;for(const g of r){const f=s[u]===g,v={last:p>=r.length-1,lastLive:u>=s.length-1,prev:r[p-1],prevFromProps:d,prevLive:s[u-1],next:r[p+1],nextLive:s[u+(f?1:0)]},C=`${e}_${t}_${g.id}`;i.stopByAnimationId(C);let b="unknown";f?n&&o&&(b=Pr(g,g.datum,n,o)):b="removed";const S=a(g,g.datum,b,v),{phase:w,start:x,finish:E,delay:M,duration:A}=S,T=y(S,["phase","start","finish","delay","duration"]),D=l(g,g.datum,b,v),{phase:I,start:R,finish:P,delay:k,duration:L}=D,N=y(D,["phase","start","finish","delay","duration"]),_=null==E&&null==P;i.animate({id:C,groupId:e,phase:null!=(h=null!=w?w:I)?h:"update",duration:null!=A?A:L,delay:null!=M?M:k,from:T,to:N,ease:yr,collapsable:_,onPlay:()=>{g.setProperties(m(m({},x),R))},onUpdate(e){g.setProperties(e),c&&g.setProperties(c(g,g.datum,b,v))},onStop:()=>{g.setProperties(m(m(m(m(m(m({},x),R),T),N),E),P))}}),f&&u++,p++,d=T}};let p=0;for(const s of d){const r=s.nodes();u(r.filter(e=>!s.isGarbage(e)),r),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:yr,onStop(){s.cleanup()}}),p++}u(h,h)}function Rr(e,t,i,s,r,n,o){const{nodes:a,selections:l}=Ar(s),{start:c,finish:h,phase:d}=o,u=null==h;i.animate({id:`${e}_${t}`,groupId:e,phase:null!=d?d:"update",from:r,to:n,ease:yr,collapsable:u,onPlay:()=>{if(c){for(const e of a)e.setProperties(c);for(const e of l)for(const t of e.nodes())t.setProperties(c)}},onUpdate(e){for(const t of a)t.setProperties(e);for(const t of l)for(const i of t.nodes())i.setProperties(e)},onStop:()=>{for(const e of a)e.setProperties(m(m({},n),h));for(const e of l)for(const t of e.nodes())t.setProperties(m(m({},n),h))}})}function Pr(e,t,i,s){const r=i(e,t);return s.added.has(r)?"added":s.removed.has(r)?"removed":"updated"}var kr=2*Math.PI;function Lr(e){return e%=kr,(e+=kr)%kr}function Nr(e){return e%=kr,(e+=kr)!==kr&&(e%=kr),e}function _r(e){return(e%=kr)<-Math.PI?e+=kr:e>=Math.PI&&(e-=kr),e}function Or(e,t,i){const s=Lr(e),r=Lr(t),n=Nr(i);return r<=n?r<=s&&s<=n:r<=s||s<=n}function Fr(e){return e/180*Math.PI}function Gr(e){return e/Math.PI*180}function Br(e,t){return e=Lr(e),(t=Lr(t))-e+(e>t?2*Math.PI:0)}function Vr(e,t,i,s){return{x:e+i*Math.cos(s),y:t+i*Math.sin(s)}}var Hr=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(e){this[i]!==e&&(this[i]=e,this.invalid=!0)},enumerable:!0,configurable:!1})},Ur=class e{constructor(){this.type="band",this.invalid=!0,this.interval=void 0,this.index=new Map,this.ordinalRange=[],this._domain=[],this.range=[0,1],this._bandwidth=1,this._step=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0,this.round=!1}static is(t){return t instanceof e}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&N.warnOnce("Expected update to not invalidate scale"))}set domain(e){this.invalid=!0;const t=[];this.index=new Map;const i=this.index;e.forEach(e=>{void 0===this.getIndex(e)&&i.set(e,t.push(e)-1)}),this._domain=t}get domain(){return this._domain}ticks(){this.refresh();let{interval:e=1}=this;"number"!=typeof e&&(e=Number(e));const t=Math.abs(Math.round(e));return this._domain.filter((e,i)=>i%t===0)}convert(e){this.refresh();const t=this.getIndex(e);if(void 0===t)return NaN;const i=this.ordinalRange[t];return void 0===i?NaN:i}invert(e){this.refresh();const t=this.ordinalRange.findIndex(t=>t===e);return this.domain[t]}invertNearest(e){var t;this.refresh();let i=-1,s=1/0;const r=this.ordinalRange.findIndex((t,r)=>{if(t===e)return!0;const n=Math.abs(e-t);return n<s&&(s=n,i=r),!1});return null!=(t=this.domain[r])?t:this.domain[i]}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=Vs(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this._paddingInner=Vs(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this._paddingOuter=Vs(0,e,1)}get paddingOuter(){return this._paddingOuter}update(){const e=this._domain.length;if(0===e)return;const t=this.round,i=this._paddingInner,s=this._paddingOuter,[r,n]=this.range,o=n-r,a=o/Math.max(1,e+2*s-i),l=t?Math.floor(a):a,c=r+(o-l*(e-i))/2,h=t?Math.round(c):c,d=l*(1-i),u=t?Math.round(d):d,p=a*(1-i),g=[];for(let t=0;t<e;t++)g.push(h+l*t);this._bandwidth=u,this._rawBandwidth=p,this._step=l,this.ordinalRange=g}getIndex(e){if(!(e instanceof Date))return this.index.get(e);const t=e.valueOf();let i=0;for(const e of this.index.keys()){if(e instanceof Date&&e.valueOf()===t)return i;i++}}};C([Hr],Ur.prototype,"interval",2),C([Hr],Ur.prototype,"range",2),C([Hr],Ur.prototype,"round",2);var zr=Ur;function Wr(e,t=[void 0]){return Te((i,s,r)=>t.includes(r)?Fe(e)?e(r):e:r)}function jr(e,t={}){const{optional:i=!1,property:s}=t;return Te((r,n,o)=>{var a;const l=f(m({},t),{target:r,property:n});if(i&&void 0===o||e(o,l))return Ct(r[n])&&!Ct(o)?(r[n].set(o),r[n]):o;const c=null!=s?s:String(n).replace(/^_*/,""),h=null!=(a=r.constructor.className)?a:r.constructor.name.replace(/Properties$/,"");let d=Un(o);if(null!=d&&d.length>50){const e=d.length-50;d=d.slice(0,50)+`... (+${e} characters)`}return N.warn(`Property [${c}] of [${h}] cannot be set to [${d}]${e.message?`; expecting ${Vn(e,l)}`:""}, ignoring.`),Ee},void 0,{optional:i})}var Kr,$r=(...e)=>{const t=[];return Bn((i,s)=>(t.length=0,e.every(e=>{const r=e(i,s);return r||t.push(Vn(e,s)),r})),()=>t.filter(Boolean).join(" AND "))},Yr=(...e)=>Bn((t,i)=>e.some(e=>e(t,i)),t=>e.map(function(e){return t=>Vn(t,e)}(t)).filter(Boolean).join(" OR ")),qr=Hn(Bn((e,t)=>Ct(e)||Ge(e)&&Ct(t.target[t.property]),"a properties object")),Xr=Hn(Bn(e=>Ge(e),"an object")),Zr=Bn(Le,"a boolean"),Qr=Bn(Fe,"a function"),Jr=Bn(He,"a string"),en=(Kr=Bn(ze,"a number"),Object.assign(Kr,{restrict({min:e,max:t}={}){const i=["a number"],s=Ue(e),r=Ue(t);return s&&r?i.push(`between ${e} and ${t} inclusive`):s?i.push(`greater than or equal to ${e}`):r&&i.push(`less than or equal to ${t}`),Bn(i=>ze(i)&&(!s||i>=e)&&(!r||i<=t),i.join(" "))}})),tn=Bn(e=>Ue(e)&&isNaN(e),"NaN"),sn=en.restrict({min:0}),rn=en.restrict({min:0,max:1}),nn=en.restrict({min:-360,max:360}),on=Yr(en,tn),an=function(e){return Object.assign(e,{restrict({length:e,minLength:t}={}){let i="an array";return Ue(t)&&t>0?i="a non-empty array":Ue(e)&&(i=`an array of length ${e}`),Bn(i=>ke(i)&&(!Ue(e)||i.length===e)&&(!Ue(t)||i.length>=t),i)}})}(Bn(ke,"an array")),ln=(e,t)=>Bn((t,i)=>ke(t)&&t.every(t=>e(t,i)),e=>{var i;const s=null!=(i=Vn(an,e))?i:"";return t?`${s} of ${t}`:s}),cn=e=>ze(e)||_e(e),hn=e=>Bn((t,i)=>!cn(t)||!cn(i.target[e])||t<i.target[e],`to be less than ${e}`),dn=e=>Bn((t,i)=>!cn(t)||!cn(i.target[e])||t>i.target[e],`to be greater than ${e}`),un=Bn(_e,"Date object"),pn=Yr(un,sn),gn="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",mn=Bn(e=>He(e)&&ur.validColorString(e),`color String. ${gn}`),fn=Bn(ln(mn),`color strings. ${gn}`),yn=ln(Zr,"boolean values"),vn=ln(en,"numbers"),Cn=ln(Jr,"strings"),bn=Bn(ln(un),"Date objects"),Sn=Bn(ln(qr),"objects"),wn=On(["butt","round","square"],"a line cap"),xn=On(["round","bevel","miter"],"a line join"),En=Bn(ln(sn),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),Mn=On(["top","right","bottom","left"],"a position"),An=On(["normal","italic","oblique"],"a font style"),Tn=Yr(On(["normal","bold","bolder","lighter"],"a font weight"),en.restrict({min:1,max:1e3})),Dn=On(["never","always","hyphenate","on-space"],"a text wrap strategy"),In=On(["left","center","right"],"a text align"),Rn=On(["top","middle","bottom"],"a vertical align"),Pn=On(["ellipsis","hide"],"an overflow strategy"),kn=On(["horizontal","vertical"],"a direction"),Ln=On(["inside","outside"],"a placement"),Nn=Yr(On(["exact","nearest"],"interaction range"),en),_n=On(["top","bottom","left","right"]);function On(e,t="a"){return Bn(t=>e.includes(t),`${t} keyword such as ${function(e){const t=e.map(e=>`'${e}'`);if(1===t.length)return t[0];const i=t.pop();return`${t.join(", ")} or ${i}`}(e)}`)}var Fn=Yr($r(en.restrict({min:1}),hn("maxSpacing")),tn),Gn=Yr($r(en.restrict({min:1}),dn("minSpacing")),tn);function Bn(e,t){return e.message=t,e}function Vn(e,t){return Fe(e.message)?e.message(t):e.message}function Hn(e){return Object.assign(e,{restrict:t=>Bn(e=>e instanceof t,i=>{var s;return null!=(s=Vn(e,i))?s:`an instance of ${t.name}`})})}function Un(e){if("number"==typeof e){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}return JSON.stringify(e)}var zn=Bn(e=>ze(e)&&e>0||e instanceof _,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Wn=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6,this.color=void 0,this.interval=void 0,this.values=void 0}};C([jr(Zr)],Wn.prototype,"enabled",2),C([jr(sn)],Wn.prototype,"width",2),C([jr(sn)],Wn.prototype,"size",2),C([jr(mn,{optional:!0})],Wn.prototype,"color",2),C([jr(zn,{optional:!0})],Wn.prototype,"interval",2),C([jr(an,{optional:!0})],Wn.prototype,"values",2);var jn=(e=>(e.X="x",e.Y="y",e))(jn||{}),Kn={constructedArrays:new WeakMap};function $n(e,t){var i;null==(i=Kn.constructedArrays)||i.set(e,t)}var Yn=class e{constructor(t,i){this.invalid=!0,this.nice=!1,this.interval=void 0,this.tickCount=e.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.niceDomain=[],this.defaultClampMode="raw",this.domain=t,this.range=i}static is(t){return t instanceof e}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{range:t}=this,i=this.getDomain(),s=Math.abs(t[1]-t[0]),r=Math.abs(i[1]-i[0])/e+1,n=Math.floor(s),o=Math.min(r,n);return s/Math.max(1,o)}getDomain(){return this.nice&&(this.refresh(),this.niceDomain.length)?this.niceDomain:this.domain}convert(e,t){var i;const s=null!=(i=null==t?void 0:t.clampMode)?i:this.defaultClampMode;if(!this.domain||this.domain.length<2)return NaN;this.refresh();const r=this.getDomain().map(e=>this.transform(e)),[n,o]=r,{range:a}=this,[l,c]=a;if(e=this.transform(e),"clamped"===s){const[t,i]=Us(r.map(Number));if(Number(e)<t)return l;if(Number(e)>i)return c}return n===o?(l+c)/2:e===n?l:e===o?c:l+(Number(e)-Number(n))/(Number(o)-Number(n))*(c-l)}invert(e){this.refresh();const t=this.getDomain().map(e=>this.transform(e)),[i,s]=t,{range:r}=this,[n,o]=r,a=n>o;let l;return e<(a?o:n)?a?s:i:e>(a?n:o)?a?i:s:(l=n===o?this.toDomain((Number(i)+Number(s))/2):this.toDomain(Number(i)+(e-n)/(o-n)*(Number(s)-Number(i))),this.transformInvert(l))}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&N.warnOnce("Expected update to not invalidate scale"))}getPixelRange(){const[e,t]=this.range;return Math.abs(t-e)}};Yn.defaultTickCount=5,Yn.defaultMaxTickCount=6,C([Hr],Yn.prototype,"domain",2),C([Hr],Yn.prototype,"range",2),C([Hr],Yn.prototype,"nice",2),C([Hr],Yn.prototype,"interval",2),C([Hr],Yn.prototype,"tickCount",2),C([Hr],Yn.prototype,"minTickCount",2),C([Hr],Yn.prototype,"maxTickCount",2);var qn=Yn,Xn={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function Zn(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+6e4*i;return Math.floor(s/864e5)}function Qn(e,t){const i=(t-new Date(e.getFullYear(),0,1).getDay()+7)%7,s=new Date(e.getFullYear(),0,i+1);return s<=e?Math.floor(Zn(e,s)/7)+1:0}function Jn(e,t=e.getFullYear()){const i=new Date(t,0,1).getDay(),s=new Date(t,0,(4-i+7)%7-3+1);return s<=e?Math.floor(Zn(e,s)/7)+1:Jn(e,t-1)}var eo={a:e=>Xn.shortDays[e.getDay()],A:e=>Xn.days[e.getDay()],b:e=>Xn.shortMonths[e.getMonth()],B:e=>Xn.months[e.getMonth()],c:"%x, %X",d:(e,t)=>io(e.getDate(),2,null!=t?t:"0"),e:"%_d",f:(e,t)=>io(1e3*e.getMilliseconds(),6,null!=t?t:"0"),H:(e,t)=>io(e.getHours(),2,null!=t?t:"0"),I:(e,t)=>{const i=e.getHours()%12;return 0===i?"12":io(i,2,null!=t?t:"0")},j:(e,t)=>io(Zn(e)+1,3,null!=t?t:"0"),m:(e,t)=>io(e.getMonth()+1,2,null!=t?t:"0"),M:(e,t)=>io(e.getMinutes(),2,null!=t?t:"0"),L:(e,t)=>io(e.getMilliseconds(),3,null!=t?t:"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>io(e.getSeconds(),2,null!=t?t:"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>io(Qn(e,0),2,null!=t?t:"0"),V:(e,t)=>io(Jn(e),2,null!=t?t:"0"),w:(e,t)=>io(e.getDay(),2,null!=t?t:"0"),W:(e,t)=>io(Qn(e,1),2,null!=t?t:"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>io(e.getFullYear()%100,2,null!=t?t:"0"),Y:(e,t)=>io(e.getFullYear(),4,null!=t?t:"0"),Z:e=>function(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${io(Math.floor(i/60),2,"0")}${io(Math.floor(i%60),2,"0")}`}(e),"%":()=>"%"},to={_:" ",0:"0","-":""};function io(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function so(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(0!==i){const s=i>0?e.substring(0,i):e;t.push(s)}if(i<0)break;const s=e[i+1],r=to[s];null!=r&&i++;const n=e[i+1],o=eo[n];if("function"==typeof o)t.push([o,r]);else if("string"==typeof o){const e=so(o);t.push([e,r])}else t.push(`${null!=r?r:""}${n}`);e=e.substring(i+2)}return e=>{const i="number"==typeof e?new Date(e):e;return t.map(e=>"string"==typeof e?e:e[0](i,e[1])).join("")}}function ro(e){return e instanceof Date?e.getTime():e}function no(e,t){const i=oo(e,t);return e=>so(i)(e)}function oo(e=[],t=e){let i=8;const s=e=>{e<i&&(i=e)};for(const t of e)s(ao(t));const r=ro(t[0]),n=ro(t.at(-1)),o=new Date(r).getFullYear(),a=new Date(n).getFullYear();return function(e,t,i){const s=ro(i[0]),r=ro(i.at(-1)),n=Math.abs(r-s),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",V,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",V,216e5,3,"%p"]," ",["day",U,6048e5,4,"%a"],["month",0===n?0:z,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",t||8===e?0:W,1/0,8,"%Y"]].filter(t=>{if("string"==typeof t)return!0;const[i,s,r,o]=t;return o>=e&&s<=n&&n<r}).reduce((e,t)=>("string"==typeof t?e.result.push(t):e.used.has(t[0])||(e.result.push(t),e.used.add(t[0])),e),{result:[],used:new Set}).result,a=o.findIndex(e=>"string"!=typeof e),l=o.length-[...o].reverse().findIndex(e=>"string"!=typeof e);return o.slice(a,l).map(e=>"string"==typeof e?e:e[4]).join("").replaceAll(/\s+/g," ").trim()}(i,a-o>0,e)}function ao(e){return $.floor(e)<e?0:X.floor(e)<e?1:J.floor(e)<e?2:te.floor(e)<e?3:ue.floor(e)<e?he.floor(e)<e?4:5:ge.floor(e)<e?6:8}var lo=(e,t=[])=>Object.assign(t,{fractionDigits:e});function co(e,t,i,s,r){if(i<2)return po(e,t,t-e);const n=uo(e,t,i,s,r);return isNaN(n)?lo(0):po(e=Math.ceil(e/n)*n,t=Math.floor(t/n)*n,n)}var ho=[1,2,5,10];function uo(e,t,i,s=0,r=1/0){const n=Math.abs(t-e),o=n/i,a=Math.floor(Math.log10(o)),l=Math.pow(10,a),c=ho.map(e=>{const t=e*l,o=Math.ceil(n/t);return{multiplier:e,isWithinBounds:o>=s&&o<=r,diffCount:Math.abs(o-i)}}).sort((e,t)=>e.isWithinBounds!==t.isWithinBounds?e.isWithinBounds?-1:1:e.diffCount-t.diffCount)[0].multiplier;return!c||isNaN(c)?NaN:c*l}function po(e,t,i){const s=Math.min(e,t),r=Math.max(e,t),n=qs(i),o=Math.pow(10,n),a=Math.ceil((r-s)/i),l=lo(n);for(let e=0;e<=a;e++){const t=s+i*e;l.push(Math.round(t*o)/o)}return l}function go({start:e,stop:t,interval:i,count:s,availableRange:r}){return null!=s||(s=(t-e)/("number"==typeof i?i:1)),s>=r&&(N.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}var mo=class e extends qn{constructor(){super([],[0,1]),this.type="time"}toDomain(e){return new Date(e)}static getTickInterval({start:t,stop:i,count:s,minCount:r,maxCount:n,target:o}){let a,l;const c=null!=s?s:qn.defaultTickCount,h=null!=o?o:Math.abs(i-t)/Math.max(c,1),d=e.getIntervalIndex(h);if(0===d)l=Math.max(uo(t,i,c,r,n),1),a=G;else if(d===e.tickIntervals.length)l=void 0===o?uo(t/W,i/W,c,r,n):1,a=ge;else{const t=h-e.tickIntervals[d-1][2]<e.tickIntervals[d][2]-h?d-1:d;[a,l]=e.tickIntervals[t]}return a.every(l)}static getIntervalIndex(t){let i=0;for(;i<e.tickIntervals.length&&t>e.tickIntervals[i][2];)i++;return i}invert(e){return new Date(super.invert(e))}ticks(){if(!this.domain||this.domain.length<2)return[];this.refresh();const[t,i]=this.getDomain().map(ro),s=Math.min(t,i),r=Math.max(t,i),{interval:n,nice:o,tickCount:a,minTickCount:l,maxTickCount:c}=this;if(void 0!==n){const t=this.getPixelRange(),i=e.getTicksForInterval({start:s,stop:r,interval:n,availableRange:t});return null!=i?i:e.getDefaultTicks({start:s,stop:r,tickCount:a,minTickCount:l,maxTickCount:c})}if(o){if(2===a)return this.niceDomain;if(1===a)return this.niceDomain.slice(0,1)}return e.getDefaultTicks({start:s,stop:r,tickCount:a,minTickCount:l,maxTickCount:c})}static getDefaultTicks({start:t,stop:i,tickCount:s,minTickCount:r,maxTickCount:n}){const o=e.getTickInterval({start:t,stop:i,count:s,minCount:r,maxCount:n});return o?o.range(new Date(t),new Date(i)):[]}static getTicksForInterval({start:t,stop:i,interval:s,availableRange:r}){if(!s)return[];if(s instanceof _){const e=s.range(new Date(t),new Date(i));if(go({start:t,stop:i,interval:s,count:e.length,availableRange:r}))return;return e}const n=Math.abs(s);if(go({start:t,stop:i,interval:n,availableRange:r}))return;const o=[...e.tickIntervals];o.reverse();const a=o.find(e=>n%e[2]===0);if(a)return a[0].every(n/(a[2]/a[1])).range(new Date(t),new Date(i));let l=new Date(t);const c=new Date(i),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+n);return h}tickFormat({ticks:e,domain:t,specifier:i}){return null==i?no(e,t):so(i)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}updateNiceDomain(){let[e,t]=this.domain;for(let i=0;i<4;i++){this.updateNiceDomainIteration(e,t);const[i,s]=this.niceDomain;if(ro(e)===ro(i)&&ro(t)===ro(s))break;e=i,t=s}}updateNiceDomainIteration(t,i){const s=Math.min(ro(t),ro(i)),r=Math.max(ro(t),ro(i)),n=t>i,{interval:o}=this;let a;if(o instanceof _)a=o;else{const t="number"==typeof o?(r-s)/Math.max(o,1):this.tickCount;a=e.getTickInterval({start:s,stop:r,count:t,minCount:this.minTickCount,maxCount:this.maxTickCount})}if(a){const e=a.range(new Date(s),new Date(r),!0),t=n?[...e].reverse():e,i=t[0],o=t.at(-1);this.niceDomain=[i,o]}}};mo.tickIntervals=[[$,1,B],[$,5,5e3],[$,15,15e3],[$,30,3e4],[X,1,V],[X,5,3e5],[X,15,9e5],[X,30,18e5],[J,1,H],[J,3,108e5],[J,6,216e5],[J,12,432e5],[te,1,U],[te,2,1728e5],[he,1,z],[he,2,12096e5],[he,3,18144e5],[ue,1,2592e6],[ue,2,5184e6],[ue,3,7776e6],[ue,4,10368e6],[ue,6,15552e6],[ge,1,W]];var fo=mo,yo=class e extends zr{constructor(){super(...arguments),this.type="ordinal-time",this.tickCount=qn.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.interval=void 0,this.index=new Map,this._domain=[]}static is(t){return t instanceof e}toDomain(e){return new Date(e)}set domain(e){if(this.invalid=!0,0===e.length)return void(this._domain=[]);const t=this.updateIndex(e);this._domain=t}get domain(){return this._domain}updateIndex(e){this.index=new Map;const{index:t}=this,i=[],s=[],r=e[0]>e.at(-1),n=r?0:1;e.forEach((o,a)=>{const l=e[a+1],c=r?o:this.toDomain(ro(o)+1),h=r?this.toDomain(ro(l)+1):l,d=r?[h,c]:[c,h];i.push(o),void 0!==l&&void 0===t.get(d)&&(s.push(Math.abs(ro(h)-ro(c))),t.set(d,a+n))}),s.sort((e,t)=>e-t);const o=s.length,a=Math.floor(o/2);this.medianInterval=o>2&&o%2==0?(s[a-1]+s[a+1])/2:s[a];const l=Math.max(0,fo.getIntervalIndex(this.medianInterval)-1),[c,h]=fo.tickIntervals[l],d=c.every(h),u=r?e.length-1:0,p=e[u],g=[d.floor(e[u]),p];return t.set(g,u),i}ticks(){if(!this.domain)return[];this.refresh();const[e,t]=[ro(this.domain[0]),ro(this.domain.at(-1))],i=Math.min(e,t),s=Math.max(e,t),r=e>t;let n;void 0!==this.interval&&(n=this.getTicksForInterval({start:i,stop:s,interval:this.interval}));const o=this.domain.length,{maxTickCount:a,tickCount:l}=this;let c,{minTickCount:h}=this;isFinite(a)&&o<=a&&(h=Math.max(1,o),c=this.medianInterval),null!=n||(n=this.getDefaultTicks({start:i,stop:s,tickCount:l,minTickCount:h,maxTickCount:a,isReversed:r,interval:c}));const d=new Set;return n.filter(e=>{const t=this.convert(e);return!isNaN(t)&&!d.has(t)&&(d.add(t),!0)})}getDefaultTicks({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:r,isReversed:n,interval:o}){const a=fo.getTickInterval({start:e,stop:t,count:i,minCount:s,maxCount:r,target:o});if(!a)return[];const l=Math.ceil(this.domain.length/r),c=[];for(const[e,t]of this.index.entries()){if(t%l>0)continue;const i=n?a.ceil(e[0]):a.floor(e[1]);c.splice(t,0,i)}return c}getTicksForInterval({start:e,stop:t,interval:i}){var s;const[r,n]=this.range,o=Math.abs(n-r);return null!=(s=fo.getTicksForInterval({start:e,stop:t,interval:i,availableRange:o}))?s:[]}convert(e){if("number"==typeof e&&(e=new Date(e)),!(e instanceof Date))return NaN;let t;this.refresh();for(const[i,s]of this.index.entries())if(e>=i[0]&&e<=i[1]){t=s;break}if(void 0===t)return NaN;const i=this.ordinalRange[t];return void 0===i?NaN:i}tickFormat({ticks:e,domain:t,specifier:i}){return null==i?no(e,t):so(i)}invert(e){return new Date(super.invert(e))}invertNearest(e){return new Date(super.invertNearest(e))}};C([Hr],yo.prototype,"tickCount",2),C([Hr],yo.prototype,"minTickCount",2),C([Hr],yo.prototype,"maxTickCount",2),C([Hr],yo.prototype,"interval",2);var vo=yo;function Co(e,t){return"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):null==e&&null==t?0:null==e?-1:null==t?1:String(e).localeCompare(String(t))}function bo(e){return"function"==typeof e?e():e}function So(e,t,i){for(const s in e){const r=i(bo(e[s]),bo(t[s]));if(0!==r)return r}return 0}var wo=class e extends lr{constructor(e){var t;super({isVirtual:null==e?void 0:e.isVirtual}),this.opts=e,this.opacity=1,this.lastBBox=void 0;const{zIndex:i,zIndexSubOrder:s}=null!=e?e:{};this.isContainerNode=!0,void 0!==i&&(this.zIndex=i),void 0!==s&&(this.zIndexSubOrder=s),this.name=null==(t=this.opts)?void 0:t.name}static is(t){return t instanceof e}onZIndexChange(){var e;super.onZIndexChange(),this.layer&&(null==(e=this._layerManager)||e.moveLayer(this.layer,this.zIndex,this.zIndexSubOrder))}isLayer(){return null!=this.layer}_setLayerManager(e){if(this._layerManager&&this.layer&&(this._layerManager.removeLayer(this.layer),this.layer=void 0),this.layer)throw new Error("AG Charts - unable to deregister scene rendering layer!");super._setLayerManager(e)}initialiseLayer(){var e;this.layer||this._layerManager&&!0===(null==(e=this.opts)?void 0:e.layer)&&(this.layer=this._layerManager.addLayer({name:this.name,zIndex:this.zIndex,zIndexSubOrder:this.zIndexSubOrder,getComputedOpacity:()=>this.getComputedOpacity(),getVisibility:()=>this.getVisibility()}))}getComputedOpacity(){let t=1;for(const i of this.traverseUp())i instanceof e&&(t*=i.opacity);return t}getVisibility(){for(const e of this.traverseUp())if(!e.visible)return!1;return!0}onVisibleChange(){this.layer&&(this.layer.enabled=this.visible)}markDirty(e,t=1){if(this.isVirtual)return void super.markDirty(e,t);let i=t;(t<2||null!=this.layer)&&(i=1),super.markDirty(e,t,i)}containsPoint(e,t){return!0}computeBBox(){return this.computeTransformMatrix(),e.computeBBox(this.children)}computeTransformedBBox(){return this.computeBBox()}preRender(){var e,t;const i=super.preRender();return i.groups+=1,i.nonGroups-=1,!0!==(null==(e=this.opts)?void 0:e.layer)||null!=this.layer||(i.nonGroups>0&&this.initialiseLayer(),(null==(t=this.opts)?void 0:t.nonEmptyChildDerivedZIndex)&&i.nonGroups>0&&this.deriveZIndexFromChildren()),i}deriveZIndexFromChildren(){var e;const t=this.children.filter(e=>e._childNodeCounts.nonGroups>0);this.sortChildren(t);const i=t.at(-1);this.zIndex=null!=(e=null==i?void 0:i.zIndex)?e:-1/0,this.zIndexSubOrder=null==i?void 0:i.zIndexSubOrder}render(e){var t,i;const{opts:{name:s}={},_debug:r}=this,{dirty:n,dirtyZIndex:o,layer:a,children:l,clipRect:c,dirtyTransform:h}=this;let{ctx:d,forceRender:u,clipBBox:p}=e;const{resized:g,stats:y}=e,v=d.getTransform(),C=n>=2||o||g;let b=C,S=!1;for(const e of l)if(b||(b=null==e.layerManager&&e.dirty>=1),S||(S=null!=e.layerManager&&e.dirty>=1),b)break;if(s&&(null==r||r({name:s,group:this,isDirty:C,isChildDirty:b,dirtyTransform:h,renderCtx:e,forceRender:u})),h)u="dirtyTransform";else if(a){const e=this.computeBBox();void 0!==this.lastBBox&&this.lastBBox.equals(e)||(u="dirtyTransform",this.lastBBox=e)}if(!(C||b||S||u))return s&&y&&(null==r||r({name:s,result:"skipping",renderCtx:e,counts:this.nodeCount,group:this})),a&&y&&(y.layersSkipped++,y.nodesSkipped+=this.nodeCount.count),void this.markClean({recursive:!1});const w=this.visible;if(a){if(d=a.context,d.save(),d.setTransform(a.pixelRatio,0,0,a.pixelRatio,0,0),"dirtyTransform"!==u&&(u=b||o),u&&a.clear(),p){const{width:t,height:i,x:n,y:o}=p;null==r||r(()=>({name:s,clipBBox:p,ctxTransform:d.getTransform(),renderCtx:e,group:this})),d.beginPath(),d.rect(n,o,t,i),d.clip()}d.setTransform(v)}else d.globalAlpha*=this.opacity;if(this.computeTransformMatrix(),this.matrix.toContext(d),c){const{x:t,y:i,width:n,height:o}=c;d.save(),null==r||r(()=>({name:s,clipRect:c,ctxTransform:d.getTransform(),renderCtx:e,group:this})),d.beginPath(),d.rect(t,i,n,o),d.clip(),p=this.matrix.transformBBox(c)}const x=this.hasVirtualChildren();o?(this.sortChildren(l),"dirtyTransform"!==u&&(u=!0)):x&&this.sortChildren(l);const E=u!==e.forceRender||p!==e.clipBBox||d!==e.ctx?f(m({},e),{ctx:d,forceRender:u,clipBBox:p}):e;let M=0;for(const e of l)e.visible&&w?u||0!==e.dirty?(d.save(),e.render(E),d.restore()):y&&(M+=e.nodeCount.count):(e.markClean(),y&&(M+=e.nodeCount.count));if(y&&(y.nodesSkipped+=M),super.render(e),c&&d.restore(),x)for(const e of this.virtualChildren)e.markClean({recursive:"virtual"});a&&(y&&y.layersRendered++,d.restore(),u&&a.snapshot(),null==(i=(t=a.context).verifyDepthZero)||i.call(t)),s&&y&&(null==r||r({name:s,result:"rendered",skipped:M,renderCtx:e,counts:this.nodeCount,group:this}))}sortChildren(e){this.dirtyZIndex=!1,e.sort((e,t)=>{var i,s;return So([e.zIndex,...null!=(i=e.zIndexSubOrder)?i:[void 0,void 0],e.serialNumber],[t.zIndex,...null!=(s=t.zIndexSubOrder)?s:[void 0,void 0],t.serialNumber],Co)})}static computeBBox(e){let t=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of e){if(!n.visible)continue;const e=n.computeTransformedBBox();if(!e)continue;const{x:o,y:a,width:l,height:c}=e;o<t&&(t=o),a<s&&(s=a),o+l>i&&(i=o+l),a+c>r&&(r=a+c)}return new Js(t,s,i-t,r-s)}setClipRectInGroupCoordinateSpace(e){this.clipRect=e?this.transformBBox(e):void 0}};wo.className="Group",C([ir({redraw:3,convertor:e=>Vs(0,e,1)})],wo.prototype,"opacity",2);var xo=wo,Eo=class{constructor(e=[]){this.stops=e}},Mo=class extends Eo{constructor(e,t=0){super(e),this.angle=t}createGradient(e,t){const{stops:i,angle:s}=this,r=Lr(Fr(s+90)),n=Math.cos(r),o=Math.sin(r),a=t.width,l=t.height,c=t.x+.5*a,h=t.y+.5*l;if(a>0&&l>0){const t=Math.sqrt(l*l+a*a)/2,s=Math.atan2(l,a);let d;d=r<Math.PI/2?r:r<Math.PI?Math.PI-r:r<1.5*Math.PI?r-Math.PI:2*Math.PI-r;const u=t*Math.abs(Math.cos(d-s)),p=e.createLinearGradient(c+n*u,h+o*u,c-n*u,h-o*u);for(const e of i)p.addColorStop(e.offset,e.color);return p}return"black"}},Ao=/^linear-gradient\((.*?)deg,\s*(.*?)\s*\)$/i,To=class e extends lr{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=e.defaultStyles.fill,this.stroke=e.defaultStyles.stroke,this.strokeWidth=e.defaultStyles.strokeWidth,this.lineDash=e.defaultStyles.lineDash,this.lineDashOffset=e.defaultStyles.lineDashOffset,this.lineCap=e.defaultStyles.lineCap,this.lineJoin=e.defaultStyles.lineJoin,this.opacity=e.defaultStyles.opacity,this.fillShadow=e.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}onFillChange(){const{fill:e}=this;let t;if((null==e?void 0:e.startsWith("linear-gradient"))&&(t=Ao.exec(e))){const e=parseFloat(t[1]),i=[],s=t[2],r=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let n;for(;n=r.exec(s);)i.push(n[0]);this.gradient=new Mo(i.map((e,t)=>({color:e,offset:t/(i.length-1)})),e)}else this.gradient=void 0}align(e,t){var i,s,r;const n=null!=(r=null==(s=null==(i=this.layerManager)?void 0:i.canvas)?void 0:s.pixelRatio)?r:1,o=Math.round(e*n)/n;return null==t?o:0===t?0:t<1?Math.ceil(t*n)/n:Math.round((t+e)*n)/n-o}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){if(this.fill){const{globalAlpha:i}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=i}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFill(e){var t,i;e.fillStyle=null!=(i=null==(t=this.gradient)?void 0:t.createGradient(e,this.computeBBox()))?i:this.fill}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){var t,i;const s=null!=(i=null==(t=this.layerManager)?void 0:t.canvas.pixelRatio)?i:1,r=this.fillShadow;(null==r?void 0:r.enabled)&&(e.shadowColor=r.color,e.shadowOffsetX=r.xOffset*s,e.shadowOffsetY=r.yOffset*s,e.shadowBlur=r.blur*s)}renderStroke(e,t){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=e;e.strokeStyle=this.stroke,e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.executeStroke(e,t),e.globalAlpha=i}}executeStroke(e,t){t?e.stroke(t):e.stroke()}containsPoint(e,t){return this.isPointInPath(e,t)}};To.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},C([ir({redraw:2})],To.prototype,"fillOpacity",2),C([ir({redraw:2})],To.prototype,"strokeOpacity",2),C([ir({redraw:2,changeCb:e=>e.onFillChange()})],To.prototype,"fill",2),C([ir({redraw:2})],To.prototype,"stroke",2),C([ir({redraw:2})],To.prototype,"strokeWidth",2),C([ir({redraw:2})],To.prototype,"lineDash",2),C([ir({redraw:2})],To.prototype,"lineDashOffset",2),C([ir({redraw:2})],To.prototype,"lineCap",2),C([ir({redraw:2})],To.prototype,"lineJoin",2),C([ir({redraw:2,convertor:e=>Vs(0,e,1)})],To.prototype,"opacity",2),C([ir({redraw:2,checkDirtyOnAssignment:!0})],To.prototype,"fillShadow",2);var Do=To,Io=class extends Do{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new Js(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){var t;const{ctx:i,forceRender:s,stats:r}=e;if(0===this.dirty&&!s)return void(r&&(r.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:n,y1:o,x2:a,y2:l}=this;n=this.align(n),o=this.align(o),a=this.align(a),l=this.align(l);const{fill:c,opacity:h,isRange:d}=this;if(d&&c){const{fillOpacity:e}=this;i.fillStyle=c,i.globalAlpha=h*e,i.beginPath(),i.moveTo(n,o),i.lineTo(a,o),i.lineTo(a,l),i.lineTo(n,l),i.closePath(),i.fill()}const{stroke:u,strokeWidth:p,startLine:g,endLine:m}=this;if((g||m)&&u&&p){const{strokeOpacity:e,lineDash:t,lineDashOffset:s,lineCap:r,lineJoin:c}=this;i.strokeStyle=u,i.globalAlpha=h*e,i.lineWidth=p,t&&i.setLineDash(t),s&&(i.lineDashOffset=s),r&&(i.lineCap=r),c&&(i.lineJoin=c),i.beginPath(),g&&(i.moveTo(n,o),i.lineTo(a,o)),m&&(i.moveTo(a,l),i.lineTo(n,l)),i.stroke()}null==(t=this.fillShadow)||t.markClean(),super.render(e)}};Io.className="Range",Io.defaultStyles=f(m({},Do.defaultStyles),{strokeWidth:1}),C([ir({redraw:2})],Io.prototype,"x1",2),C([ir({redraw:2})],Io.prototype,"y1",2),C([ir({redraw:2})],Io.prototype,"x2",2),C([ir({redraw:2})],Io.prototype,"y2",2),C([ir({redraw:2})],Io.prototype,"startLine",2),C([ir({redraw:2})],Io.prototype,"endLine",2),C([ir({redraw:2})],Io.prototype,"isRange",2);var Ro=new WeakMap,Po=new WeakMap;function ko(e,t){var i,s,r;const n=JSON.stringify(e,null,0);return Ro.has(t)||Ro.set(t,new Map),(null==(i=Ro.get(t))?void 0:i.has(n))||null==(s=Ro.get(t))||s.set(n,t(e)),null==(r=Ro.get(t))?void 0:r.get(n)}function Lo(e){return(t,...i)=>{var s,r,n;const o=JSON.stringify(t,null,0);return Po.has(e)||Po.set(e,new Map),(null==(s=Po.get(e))?void 0:s.has(o))||null==(r=Po.get(e))||r.set(o,e(t,...i)),null==(n=Po.get(e))?void 0:n.get(o)}}function No(e){const{redraw:t=3,changeCb:i}=null!=e?e:{};return ir({redraw:t,type:"font",changeCb:i})}var _o=class e extends Do{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this._dirtyFont=!0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=e.defaultStyles.textAlign,this.textBaseline=e.defaultStyles.textBaseline}onTextChange(){var e,t;this.lines=null!=(t=null==(e=this.text)?void 0:e.split("\n").map(e=>e.trim()))?t:[]}get font(){return(null==this._font||this._dirtyFont)&&(this._dirtyFont=!1,this._font=Go(this)),this._font}computeBBox(){const{x:t,y:i,lines:s,lineHeight:r,textBaseline:n,textAlign:o}=this,{top:a,left:l,width:c,height:h}=e.getTextSizeMultiline(s,Go(this),n,o,r);return new Js(t-l,i-a,c,h)}getLineHeight(t){var i,s;if(this.lineHeight)return this.lineHeight;const r=e.measureText(t,this.font,this.textBaseline,this.textAlign);return(null!=(i=r.fontBoundingBoxAscent)?i:r.emHeightAscent)+(null!=(s=r.fontBoundingBoxDescent)?s:r.emHeightDescent)}isPointInPath(e,t){const i=this.transformPoint(e,t),s=this.computeBBox();return!!s&&s.containsPoint(i.x,i.y)}render(e){const{ctx:t,forceRender:i,stats:s}=e;if(0===this.dirty&&!i)return void(s&&(s.nodesSkipped+=this.nodeCount.count));if(!this.lines.length||!this.layerManager)return void(s&&(s.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(t);const{fill:r,stroke:n,strokeWidth:o}=this;t.font=this.font,t.textAlign=this.textAlign,t.textBaseline=this.textBaseline;const a=this.layerManager.canvas.pixelRatio||1,{globalAlpha:l}=t;if(r){t.fillStyle=r,t.globalAlpha=l*this.opacity*this.fillOpacity;const{fillShadow:e}=this;(null==e?void 0:e.enabled)&&(t.shadowColor=e.color,t.shadowOffsetX=e.xOffset*a,t.shadowOffsetY=e.yOffset*a,t.shadowBlur=e.blur*a),this.renderLines((e,i,s)=>t.fillText(e,i,s))}if(n&&o){t.strokeStyle=n,t.lineWidth=o,t.globalAlpha=l*this.opacity*this.strokeOpacity;const{lineDash:e,lineDashOffset:i,lineCap:s,lineJoin:r}=this;e&&t.setLineDash(e),i&&(t.lineDashOffset=i),s&&(t.lineCap=s),r&&(t.lineJoin=r),this.renderLines((e,i,s)=>t.strokeText(e,i,s))}super.render(e)}renderLines(t){const{lines:i,x:s,y:r}=this,n=i.map(e=>this.getLineHeight(e)),o=n.reduce((e,t)=>e+t,0);let a=(n[0]-o)*e.getVerticalModifier(this.textBaseline);for(let e=0;e<i.length;e++)t(i[e],s,r+a),a+=n[e]}static wrapLines(t,i,s,r,n,o){const a="hide"!==o,l=new Fo(r),c=t.split(/\r?\n/g);if(0===c.length)return{lines:void 0,truncated:!1};if("never"===n){const{text:t,truncated:s}=e.truncateLine(c[0],i,l,a?"auto":"never");return{lines:null!=t?[t]:void 0,truncated:s}}const h=[];let d=0,u=!1;for(const t of c){const o=e.wrapLine(t,i,s,l,r,n,d,a);if(null==o)return{lines:void 0,truncated:!1};if(h.push(...o.result),d=o.cumulativeHeight,o.truncated){u=!0;break}}return{lines:h,truncated:u}}static wrap(t,i,s,r,n,o="ellipsis"){var a;const{lines:l,truncated:c}=e.wrapLines(t,i,s,r,n,o);return{text:null!=(a=null==l?void 0:l.join("\n").trim())?a:"",truncated:c}}static wrapLine(t,i,s,r,n,o,a,l){if(!(t=t.trim()))return{result:[],truncated:!1,cumulativeHeight:a};const c=r.size(t);if(c.width<=i)return{result:[t],truncated:!1,cumulativeHeight:a+c.height};if(c.height>s||r.width("W")>i)return l?{result:[],truncated:!0,cumulativeHeight:a}:void 0;const h=t.split(/\s+/g),d=e.wrapLineSequentially(h,i,s,r,n,o,a,l);if(null==d)return;a=d.cumulativeHeight;let{lines:u}=d;if(!d.wordsBrokenOrTruncated&&!d.linesTruncated){const t=d.lines.length,s=e.wrapLineBalanced(h,i,r,t);s.length===u.length&&(u=s)}return{result:u.map(e=>e.join(" ")),truncated:d.linesTruncated,cumulativeHeight:a}}static breakWord(t,i,s,r,n){const o=i=>e.punctuationMarks.includes(t[i]),a=r?n.width("-"):0,l=[];let c=0,h=0;for(let e=0;e<t.length;e++){const r=t[e],o=n.width(r);c+o+a>(0===h?i:s)&&(l.push(e),c=0,h++),c+=o}const d=[];let u=0;for(const e of l){let i=t.substring(u,e);r&&i.length>0&&!o(e-1)&&!o(e)&&(i+="-"),d.push(i),u=e}return d.push(t.substring(u)),d}static truncateLine(e,t,i,s){e=e.trimEnd();const r=i.width(e);if(r>t&&"never"===s)return{text:void 0,truncated:!1};if(r<=t&&"force"!==s)return{text:e,truncated:!1};const n=i.width("…");let o=e,a=r;for(;o.length>0&&a+n>t;)o=o.slice(0,-1).trimEnd(),a=i.width(o);return a+n<=t?{text:`${o}…`,truncated:!0}:{text:void 0,truncated:!1}}static wrapLineSequentially(t,i,s,r,n,o,a,l){const{fontSize:c=0,lineHeight:h=c*e.defaultLineHeightRatio}=n,d="always"===o||"hyphenate"===o,u="hyphenate"===o,p=r.width(" ");let g=!1,m=!1;const f=[];let y=[],v=0;const C=()=>({lines:f,linesTruncated:m,wordsBrokenOrTruncated:g,cumulativeHeight:a}),b=()=>{if(!l)return;const t=y.join(" "),{text:s}=e.truncateLine(t,i,r,"force");return null!=s?(y.splice(0,y.length,s),m=!0,C()):void 0},S=()=>{const e=a+h;return!(e>=s||(y=[],v=0,a=e,f.push(y),0))};if(!S())return b();for(let s=0;s<t.length;s++){const n=t[s],o=r.width(n),a=0===y.length?0:p,c=v+a+o;if(c<=i)y.push(n),v=c;else if(o<=i){if(!S())return b();y.push(n),v=o}else{if(g=!0,!d){if(l){if(!S())return b();const{text:o}=e.truncateLine(n,i,r,"force");if(null==o)return;y.push(o),s<t.length-1&&(m=!0);break}return}{const t=i-v-a,s=e.breakWord(n,t,i,u,r);for(let e=0;e<s.length;e++){const t=s[e];if(t&&y.push(t),e===s.length-1)v=r.width(t);else if(!S())return b()}}}}return C()}static wrapLineBalanced(e,t,i,s){const r=e.reduce((e,t)=>e+i.width(t),0),n=i.width(" "),o=(r+n*(e.length-s-2))/s,a=[];let l=[],c=i.width(e[0]),h=!0;for(const s of e){const e=i.width(s);if(h){l=[],l.push(s),c=e,h=!1,a.push(l);continue}const r=c+n+e;r<=o?(l.push(s),c=r):r<=t?(l.push(s),h=!0):(l=[s],c=e,a.push(l))}return a}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}static getVerticalModifier(e){switch(e){case"top":case"hanging":return 0;case"bottom":case"alphabetic":case"ideographic":return 1;case"middle":return.5}}static get textContext(){if(!this._textContext){const e=ws("canvas");e.width=0,e.height=0,this._textContext=e.getContext("2d")}return this._textContext}static measureText(e,t,i,s){return this._measureText({text:e,font:t,textBaseline:i,textAlign:s})}static getTextSize(e,t){return this._getTextSize({text:e,font:t})}static getTextSizeMultiline(t,i,s=e.defaultStyles.textBaseline,r=e.defaultStyles.textAlign,n){var o,a;let l=0,c=0,h=0,d=0,u=0;for(const[e,n]of t.entries()){const p=this._measureText({text:n,font:i,textBaseline:s,textAlign:r});c=Math.max(c,p.actualBoundingBoxLeft),h=Math.max(h,p.width),0==e?(l+=p.actualBoundingBoxAscent,d+=p.actualBoundingBoxAscent):u+=null!=(o=p.fontBoundingBoxAscent)?o:p.emHeightAscent,e==t.length-1?d+=p.actualBoundingBoxDescent:u+=null!=(a=p.fontBoundingBoxDescent)?a:p.emHeightDescent}return null!=n&&(u=(t.length-1)*n),d+=u,l+=u*e.getVerticalModifier(s),{top:l,left:c,width:h,height:d}}};_o.className="Text",_o.defaultLineHeightRatio=1.15,_o.defaultStyles=Object.assign({},Do.defaultStyles,{textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"}),_o.ellipsis="…",_o.punctuationMarks=[".",",","-",":",";","!","?","'",'"',"(",")"],_o._measureText=Lo(({text:e,font:t,textBaseline:i,textAlign:s})=>{const r=_o.textContext;return r.font!==t&&(r.font=t),r.textBaseline!==i&&(r.textBaseline=i),r.textAlign!==s&&(r.textAlign=s),r.measureText(e)}),_o._getTextSize=Lo(({text:e,font:t})=>{const i=_o.textContext;i.font!==t&&(i.font=t);const s=i.measureText(e);return{width:s.width,height:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent}}),C([ir({redraw:3})],_o.prototype,"x",2),C([ir({redraw:3})],_o.prototype,"y",2),C([ir({redraw:3,changeCb:e=>e.onTextChange()})],_o.prototype,"text",2),C([No()],_o.prototype,"fontStyle",2),C([No()],_o.prototype,"fontWeight",2),C([No()],_o.prototype,"fontSize",2),C([No()],_o.prototype,"fontFamily",2),C([ir({redraw:3})],_o.prototype,"textAlign",2),C([ir({redraw:3})],_o.prototype,"textBaseline",2),C([ir({redraw:3})],_o.prototype,"lineHeight",2);var Oo=_o,Fo=class{constructor(e){this.font=He(e)?e:Go(e)}size(e){return e.includes("\n")?Oo.getTextSizeMultiline(e.split("\n").map(e=>e.trim()),this.font):Oo.getTextSize(e,this.font)}width(e){const{width:t}=this.size(e);return t}};function Go(e){const{fontFamily:t,fontSize:i,fontStyle:s,fontWeight:r}=e;return[null!=s?s:"",null!=r?r:"",i+"px",t].join(" ").trim()}var Bo=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}getFont(){return Go(this)}};function Vo(e){const{parallelFlipRotation:t=0,regularFlipRotation:i=0}=e,s=e.rotation?Lr(Fr(e.rotation)):0,r=!s&&t>=0&&t<=Math.PI?-1:1,n=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return e.parallel?o=r*Math.PI/2:-1===n&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:r,regularFlipFlag:n}}function Ho(e,t,i,s,r){const n=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI;if(e){if(!t&&!i)return"center";if(s*(n||o?-1:1)==-1)return"end"}else if(s*r===-1)return"end";return"start"}function Uo(e,t,i,s,r){const{width:n,height:o}=t,a=new Js(i,s,0,0);r.transformBBox(a,t);const{x:l,y:c}=t;return t.width=n,t.height=o,{point:{x:l,y:c},label:{text:e,width:n,height:o}}}C([jr(Zr)],Bo.prototype,"enabled",2),C([jr(mn,{optional:!0})],Bo.prototype,"color",2),C([jr(An,{optional:!0})],Bo.prototype,"fontStyle",2),C([jr(Tn,{optional:!0})],Bo.prototype,"fontWeight",2),C([jr(sn)],Bo.prototype,"fontSize",2),C([jr(Jr)],Bo.prototype,"fontFamily",2),C([jr(Qr,{optional:!0})],Bo.prototype,"formatter",2);var zo=(e=>(e[e.SERIES_BACKGROUND_ZINDEX=0]="SERIES_BACKGROUND_ZINDEX",e[e.AXIS_GRID_ZINDEX=1]="AXIS_GRID_ZINDEX",e[e.AXIS_ZINDEX=2]="AXIS_ZINDEX",e[e.SERIES_CROSSLINE_RANGE_ZINDEX=3]="SERIES_CROSSLINE_RANGE_ZINDEX",e[e.SERIES_LAYER_ZINDEX=4]="SERIES_LAYER_ZINDEX",e[e.SERIES_HIGHLIGHT_ZINDEX=5]="SERIES_HIGHLIGHT_ZINDEX",e[e.AXIS_FOREGROUND_ZINDEX=6]="AXIS_FOREGROUND_ZINDEX",e[e.SERIES_CROSSHAIR_ZINDEX=7]="SERIES_CROSSHAIR_ZINDEX",e[e.SERIES_LABEL_ZINDEX=8]="SERIES_LABEL_ZINDEX",e[e.SERIES_CROSSLINE_LINE_ZINDEX=9]="SERIES_CROSSLINE_LINE_ZINDEX",e[e.SERIES_ANNOTATION_ZINDEX=10]="SERIES_ANNOTATION_ZINDEX",e[e.LEGEND_ZINDEX=11]="LEGEND_ZINDEX",e[e.NAVIGATOR_ZINDEX=12]="NAVIGATOR_ZINDEX",e))(zo||{});function Wo(e){return null!=e&&Object.hasOwn(e,"toString")&&He(e.toString())}function jo(e){return null!=e&&Object.hasOwn(e,"valueOf")&&ze(e.valueOf())}function Ko(e){return ze(e)||_e(e)||jo(e)}function $o(e,t){return null!=e&&(!t||Ko(e))}function Yo(e){return Wo(e)&&Object.hasOwn(e,"id")?e.id:e}var qo=e=>"value"===e?Bn((e,t)=>"line"===t.target.type,e=>"range"===e.target.type?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):Bn((e,t)=>"range"===t.target.type,e=>"line"===e.target.type?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),Xo=(e,t,i,s)=>{const r="line"===e&&void 0!==t,n="range"===e&&void 0!==i;if(!r&&!n)return!0;const[o,a]=null!=i?i:[t,void 0],l=qn.is(s)||vo.is(s),c=$o(o,l)&&!isNaN(s.convert(o)),h=$o(a,l)&&!isNaN(s.convert(a));if(r&&c||n&&c&&h)return!0;const d=["Expecting crossLine"];return n?(c||d.push(`range start ${Un(o)}`),h||d.push(`${c?"":"and "}range end ${Un(a)}`)):d.push(`value ${Un(o)}`),d.push("to match the axis scale domain."),N.warnOnce(d.join(" ")),!1},Zo={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},topLeft:{xTranslationDirection:1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:-1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:1},bottomRight:{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:1,yTranslationDirection:0},insideRight:{xTranslationDirection:-1,yTranslationDirection:0},insideTop:{xTranslationDirection:0,yTranslationDirection:1},insideBottom:{xTranslationDirection:0,yTranslationDirection:-1},insideTopLeft:{xTranslationDirection:1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomRight:{xTranslationDirection:-1,yTranslationDirection:-1}},Qo={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},topLeft:{xTranslationDirection:-1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},bottomRight:{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:0,yTranslationDirection:1},insideRight:{xTranslationDirection:0,yTranslationDirection:-1},insideTop:{xTranslationDirection:-1,yTranslationDirection:0},insideBottom:{xTranslationDirection:1,yTranslationDirection:0},insideTopLeft:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:-1},insideBottomRight:{xTranslationDirection:1,yTranslationDirection:-1}};function Jo({yDirection:e,padding:t=0,position:i="top",bbox:s}){const r=e?Zo:Qo,{xTranslationDirection:n,yTranslationDirection:o}=r[i];return{xTranslation:n*(t+(e?s.width:s.height)/2),yTranslation:o*(t+(e?s.height:s.width)/2)}}var ea=({yDirection:e,xEnd:t,yStart:i,yEnd:s})=>e?{x:t/2,y:i}:{x:t,y:isNaN(s)?i:(i+s)/2},ta=({yDirection:e,xStart:t,xEnd:i,yStart:s,yEnd:r})=>e?{x:t,y:isNaN(r)?s:(s+r)/2}:{x:i/2,y:s},ia=({yDirection:e,xEnd:t,yStart:i,yEnd:s})=>e?{x:t,y:isNaN(s)?i:(i+s)/2}:{x:t/2,y:isNaN(s)?i:s},sa=({yDirection:e,xStart:t,xEnd:i,yStart:s,yEnd:r})=>e?{x:i/2,y:isNaN(r)?s:r}:{x:t,y:isNaN(r)?s:(s+r)/2},ra=({yDirection:e,xStart:t,xEnd:i,yStart:s})=>e?{x:t/2,y:s}:{x:i,y:s},na=({yDirection:e,xStart:t,yStart:i,yEnd:s})=>e?{x:t,y:isNaN(s)?i:s}:{x:t,y:i},oa=({yDirection:e,xEnd:t,yStart:i,yEnd:s})=>e?{x:t,y:i}:{x:t,y:isNaN(s)?i:s},aa=({yDirection:e,xStart:t,xEnd:i,yStart:s,yEnd:r})=>e?{x:i,y:isNaN(r)?s:r}:{x:t,y:isNaN(r)?s:r},la={top:{c:ea},bottom:{c:sa},left:{c:ta},right:{c:ia},topLeft:{c:ra},topRight:{c:oa},bottomLeft:{c:na},bottomRight:{c:aa},inside:{c:({xEnd:e,yStart:t,yEnd:i})=>({x:e/2,y:isNaN(i)?t:(t+i)/2})},insideLeft:{c:ta},insideRight:{c:ia},insideTop:{c:ea},insideBottom:{c:sa},insideTopLeft:{c:ra},insideBottomLeft:{c:na},insideTopRight:{c:oa},insideBottomRight:{c:aa}},ca=On(["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","inside","insideLeft","insideRight","insideTop","insideBottom","insideTopLeft","insideBottomLeft","insideTopRight","insideBottomRight"],"crossLine label position"),ha=class{constructor(){this.enabled=void 0,this.text=void 0,this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)",this.position=void 0,this.rotation=void 0,this.parallel=void 0}};C([jr(Zr,{optional:!0})],ha.prototype,"enabled",2),C([jr(Jr,{optional:!0})],ha.prototype,"text",2),C([jr(An,{optional:!0})],ha.prototype,"fontStyle",2),C([jr(Tn,{optional:!0})],ha.prototype,"fontWeight",2),C([jr(sn)],ha.prototype,"fontSize",2),C([jr(Jr)],ha.prototype,"fontFamily",2),C([jr(en)],ha.prototype,"padding",2),C([jr(mn,{optional:!0})],ha.prototype,"color",2),C([jr(ca,{optional:!0})],ha.prototype,"position",2),C([jr(nn,{optional:!0})],ha.prototype,"rotation",2),C([jr(Zr,{optional:!0})],ha.prototype,"parallel",2);var da=class e{constructor(){this.id=Fs(this),this.enabled=void 0,this.type=void 0,this.range=void 0,this.value=void 0,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=void 0,this.strokeOpacity=void 0,this.lineDash=void 0,this.label=new ha,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.group=new xo({name:`${this.id}`,layer:!0,zIndex:e.LINE_LAYER_ZINDEX}),this.labelGroup=new xo({name:`${this.id}`,layer:!0,zIndex:e.LABEL_LAYER_ZINDEX}),this.crossLineRange=new Io,this.crossLineLabel=new Oo,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1;const{group:t,labelGroup:i,crossLineRange:s,crossLineLabel:r}=this;t.append(s),i.append(r),s.pointerEvents=1}update(e){const{enabled:t,data:i,type:s,value:r,range:n,scale:o}=this;if(!(s&&o&&t&&e&&Xo(s,r,n,o)&&0!==i.length))return this.group.visible=!1,void(this.labelGroup.visible=!1);this.group.visible=e,this.labelGroup.visible=e,this.group.zIndex=this.getZIndex(this.isRange),this.updateNodes()}calculateLayout(e,t){if(!e)return;if(!this.createNodeData(t))return;const{sideFlag:i,gridLength:s,data:r}=this,n=[],o=i*s,a=r[0],l=r[1],c=new Js(Math.min(0,o),Math.min(a,l),Math.abs(0-o),Math.abs(a-l));n.push(c);const h=this.computeLabelBBox();return h&&n.push(h),Js.merge(n)}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}createNodeData(e){var t,i,s;const{scale:r,gridLength:n,sideFlag:o,direction:a,label:{position:l="top"},clippedRange:c,strokeWidth:h=0}=this;if(this.data=[],!r)return!1;const d=null!=(t=r.bandwidth)?t:0,u=null!=(i=r.step)?i:0,p=(e?-1:1)*(r instanceof zr?(u-d)/2:0),[g,m]=[0,o*n];let[f,y]=this.getRange();const v=void 0===y&&vo.is(r)?d/2+p:0;let[C,b]=[Number(r.convert(f,{clampMode:"clamped"}))-p+v,r.convert(y,{clampMode:"clamped"})+d+p];C=Hs(C,c),b=Hs(b,c),[f,y]=[Number(r.convert(f))+v,r.convert(y)+d];const S=(f===C||y===b||C!==b)&&Math.abs(b-C)>0;if(S&&C>b&&([C,b]=[b,C],[f,y]=[y,f]),f-p>=C&&(f-=p),y+p<=b&&(y+=p),this.isRange=S,this.startLine=h>0&&f>=C&&f<=C+p,this.endLine=h>0&&y>=b-d-p&&y<=b,!S&&!this.startLine&&!this.endLine)return!1;if(this.data=[C,b],this.label.enabled){const e="y"===a,{c:t=ea}=null!=(s=la[l])?s:{},{x:i,y:r}=t({yDirection:e,xStart:g,xEnd:m,yStart:C,yEnd:b});this.labelPoint={x:i,y:r}}return!0}updateRangeNode(){var e;const{crossLineRange:t,sideFlag:i,gridLength:s,data:r,startLine:n,endLine:o,isRange:a,fill:l,fillOpacity:c,stroke:h,strokeWidth:d,lineDash:u}=this;t.x1=0,t.x2=i*s,t.y1=r[0],t.y2=r[1],t.startLine=n,t.endLine=o,t.isRange=a,t.fill=l,t.fillOpacity=null!=c?c:1,t.stroke=h,t.strokeWidth=null!=d?d:1,t.strokeOpacity=null!=(e=this.strokeOpacity)?e:1,t.lineDash=u}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}positionLabel(){const{crossLineLabel:e,labelPoint:{x:t,y:i}={},label:{parallel:s,rotation:r,position:n="top",padding:o=0},direction:a,parallelFlipRotation:l,regularFlipRotation:c}=this;if(void 0===t||void 0===i)return;const{defaultRotation:h,configuredRotation:d}=Vo({rotation:r,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});e.rotation=h+d,e.textBaseline="middle",e.textAlign="center";const u=e.computeTransformedBBox();if(!u)return;const p="y"===a,{xTranslation:g,yTranslation:m}=Jo({yDirection:p,padding:o,position:n,bbox:u});e.translationX=t+g,e.translationY=i+m}getZIndex(t=!1){return t?e.RANGE_LAYER_ZINDEX:e.LINE_LAYER_ZINDEX}getRange(){var e;const{value:t,range:i,scale:s}=this,r=qn.is(s)||vo.is(s),n=null!=(e=null==i?void 0:i[0])?e:t;let o=null==i?void 0:i[1];return r||void 0!==o||(o=n),r&&n===o&&(o=void 0),[n,o]}computeLabelBBox(){const{label:e}=this;if(!e.enabled)return;const t=new Oo;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text;const{labelPoint:{x:i,y:s}={},label:{parallel:r,rotation:n,position:o="top",padding:a=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(void 0===i||void 0===s)return;const{configuredRotation:d}=Vo({rotation:n,parallel:r,regularFlipRotation:h,parallelFlipRotation:c});t.rotation=d,t.textBaseline="middle",t.textAlign="center";const u=t.computeTransformedBBox();if(!u)return;const p="y"===l,{xTranslation:g,yTranslation:m}=Jo({yDirection:p,padding:a,position:o,bbox:u});return t.translationX=i+g,t.translationY=s+m,t.computeTransformedBBox()}calculatePadding(e){var t,i,s,r,n,o,a,l;const{isRange:c,startLine:h,endLine:d,direction:u,label:{padding:p=0,position:g="top"}}=this;if(!c&&!h&&!d)return;const m=this.computeLabelBBox();if(null==(null==m?void 0:m.x)||null==(null==m?void 0:m.y))return;const f=function({yDirection:e,bbox:t,padding:i=0,position:s="top"}){const r={};return s.startsWith("inside")||("top"!==s||e?"bottom"!==s||e?"left"===s&&e?r.left=i+t.width:"right"===s&&e&&(r.right=i+t.width):r.bottom=i+t.height:r.top=i+t.height),r}({yDirection:"y"===u,padding:p,position:g,bbox:m});e.left=Math.max(null!=(t=e.left)?t:0,null!=(i=f.left)?i:0),e.right=Math.max(null!=(s=e.right)?s:0,null!=(r=f.right)?r:0),e.top=Math.max(null!=(n=e.top)?n:0,null!=(o=f.top)?o:0),e.bottom=Math.max(null!=(a=e.bottom)?a:0,null!=(l=f.bottom)?l:0)}};da.LINE_LAYER_ZINDEX=9,da.RANGE_LAYER_ZINDEX=3,da.LABEL_LAYER_ZINDEX=8,da.className="CrossLine",C([jr(Zr,{optional:!0})],da.prototype,"enabled",2),C([jr(On(["range","line"],"a crossLine type"),{optional:!0})],da.prototype,"type",2),C([jr($r(qo("range"),an.restrict({length:2})),{optional:!0})],da.prototype,"range",2),C([jr(qo("value"),{optional:!0})],da.prototype,"value",2),C([jr(mn,{optional:!0})],da.prototype,"fill",2),C([jr(rn,{optional:!0})],da.prototype,"fillOpacity",2),C([jr(mn,{optional:!0})],da.prototype,"stroke",2),C([jr(en,{optional:!0})],da.prototype,"strokeWidth",2),C([jr(rn,{optional:!0})],da.prototype,"strokeOpacity",2),C([jr(En,{optional:!0})],da.prototype,"lineDash",2);var ua=da,pa=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){var t;const i=He(e)?e:e.optionsKey;null==(t=this.moduleMap.get(i))||t.moduleInstance.destroy(),this.moduleMap.delete(i)}getModule(e){var t;return null==(t=this.moduleMap.get(He(e)?e:e.optionsKey))?void 0:t.moduleInstance}isEnabled(e){return this.moduleMap.has(He(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){var e;for(const t of this.moduleMap.keys())null==(e=this.moduleMap.get(t))||e.moduleInstance.destroy();this.moduleMap.clear()}},ga={};function ma(e,t){const{nodes:i,selections:s}=Ar(e);for(const e of s){for(const i of e.nodes()){const e=t(i,i.datum);i.setProperties(e)}e.cleanup()}for(const e of i){const i=t(e,e.datum);e.setProperties(i)}}v(ga,{resetMotion:()=>ma});var fa=class{constructor(e,t,i){this.states=t,this.preTransitionCb=i,this.debug=Ds.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,"color: green")}transition(e,t){var i,s;const r=this.states[this.state],n=null==r?void 0:r[e];if(!n)return void this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.state}`,"color: grey");let o=this.state;return"string"==typeof n?o=n:"object"==typeof n&&(o=n.target),this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${o}`,"color: green"),null==(i=this.preTransitionCb)||i.call(this,this.state,o),this.state=o,"function"==typeof n?n(t):"object"==typeof n&&(null==(s=n.action)||s.call(n,t)),this.state}},ya=e=>`(${e})`,va=e=>`${ya(e)}?`,Ca=e=>va(`?:${e}`),ba=new RegExp(["^",Ca(`${va(".")}${ya("[<>=^]")}`),va("[+\\-( ]"),va("[$€£¥₣₹#]"),va("0"),va("\\d+"),va(","),Ca(`\\.${ya("\\d+")}`),va("~"),va("[%a-z]"),"$"].join(""),"i"),Sa=new RegExp(["^",ya(".*?"),`#\\{${ya(".+?")}\\}`,ya(".*?"),"$"].join(""));function wa(e){let t,i;const s=Sa.exec(e);s&&([,t,e,i]=s);const r=ba.exec(e);if(!r)throw new Error(`The number formatter is invalid: ${e}`);const[,n,o,a,l,c,h,d,u,p,g]=r;return{fill:n,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:d,precision:parseInt(u),trim:Boolean(p),type:g,prefix:t,suffix:i}}function xa(e){const t="string"==typeof e?wa(e):e,{fill:i,align:s,sign:r="-",symbol:n,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=t;let{trim:p}=t;const g=void 0===u||isNaN(u);let m,f;if(c)if(c in Aa&&c in Ma)m=g?Ma[c]:Aa[c];else if(c in Aa)m=Aa[c];else{if(!(c in Ma))throw new Error(`The number formatter type is invalid: ${c}`);m=Ma[c]}else m=Aa.g,p=!0;return f=null==u||g?c?6:12:u,e=>{let t=m(e,f);return p&&(t=t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(t=function(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),r=e.substring(i);for(let e=s.length-3;e>0;e-=3)s.splice(e,0,t);return`${s.join("")}${r}`}(t,l)),t=function(e,t,i=""){if("("===i)return e>=0?t:`(${t})`;return`${e>=0?"+"===i?"+":"":"−"}${t}`}(e,t,r),n&&"#"!==n&&(t=`${n}${t}`),"#"===n&&"x"===c&&(t=`0x${t}`),"s"===c&&(t=`${t}${function(e){return Ra[Ta(e)]}(e)}`),"%"!==c&&"p"!==c||(t=`${t}%`),null==a||isNaN(a)||(t=function(e,t,i=" ",s=">"){let r=e;if(">"!==s&&s){if("<"===s)r=r.padEnd(t,i);else if("^"===s){const e=Math.max(0,t-r.length),s=Math.ceil(e/2),n=Math.floor(e/2);r=r.padStart(s+r.length,i),r=r.padEnd(n+r.length,i)}}else r=r.padStart(t,i);return r}(t,a,null!=i?i:o,s)),t=`${h}${t}${d}`,t}}var Ea=e=>Math.floor(Math.abs(e)),Ma={b:e=>Ea(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Ea(e).toString(8),x:e=>Ea(e).toString(16),X:e=>Ma.x(e).toUpperCase(),n:e=>Ma.d(e),"%":e=>`${Ea(100*e).toFixed(0)}`},Aa={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Aa.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Aa.f(e,t).toUpperCase(),g:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>Aa.g(e,t).toUpperCase(),n:(e,t)=>Aa.g(e,t),p:(e,t)=>Aa.r(100*e,t),r:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i))-(t-1);if(s<=0)return i.toFixed(-s);const r=Math.pow(10,s);return(Math.round(i/r)*r).toFixed()},s:(e,t)=>{const i=Ta(e);return Aa.r(e/Math.pow(10,i),t)},"%":(e,t)=>Aa.f(100*e,t)};function Ta(e){return Vs(Da,e?3*Math.floor(Math.log10(Math.abs(e))/3):0,Ia)}var Da=-24,Ia=24,Ra={[Da]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[Ia]:"Y"};function Pa(e,t){const i=wa(null!=t?t:",f"),{precision:s}=i;(null==s||isNaN(s))&&("f"===i.type||"%"===i.type?i.precision=Math.max(...e.map(e=>{if("number"!=typeof e||0===e)return 0;const t=Math.floor(Math.log10(Math.abs(e))),s=i.type?6:12,r=e.toExponential(s-1).replace(/\.?0+e/,"e"),n=r.indexOf(".");if(n<0)return t>=0?0:-t;const o=r.indexOf("e")-n;return Math.max(0,o-t-1)})):i.type&&!(i.type in Aa)||(i.precision=Math.max(...e.map(e=>{if("number"!=typeof e)return 0;const t=e.toExponential((i.type?6:12)-1).replace(/\.?0+e/,"e");return t.substring(0,t.indexOf("e")).replace(".","").length}))));const r=xa(i);return e=>r(Number(e))}var ka=class e extends qn{constructor(){super([1,10],[0,1]),this.type="log",this.base=10,this.baseLog=P,this.basePow=P,this.log=e=>Math.min(...this.domain)>=0?this.baseLog(e):-this.baseLog(-e),this.pow=e=>Math.min(...this.domain)>=0?this.basePow(e):-this.basePow(-e),this.defaultClampMode="clamped"}toDomain(e){return e}transform(e){return Math.min(...this.domain)>=0?Math.log(e):-Math.log(-e)}transformInvert(e){return Math.min(...this.domain)>=0?Math.exp(e):-Math.exp(-e)}refresh(){this.base<=0&&(this.base=0,N.warnOnce("expecting a finite Number greater than to 0")),super.refresh()}update(){!this.domain||this.domain.length<2||(this.baseLog=e.getBaseLogMethod(this.base),this.basePow=e.getBasePowerMethod(this.base),this.nice&&this.updateNiceDomain())}updateNiceDomain(){const[e,t]=this.domain,i=e>t?Math.ceil:Math.floor,s=e>t?Math.floor:Math.ceil,r=this.pow(i(this.log(e))),n=this.pow(s(this.log(t)));this.niceDomain=[r,n]}ticks(){var e;const t=null!=(e=this.tickCount)?e:10;if(!this.domain||this.domain.length<2||t<1)return[];this.refresh();const i=this.base,[s,r]=this.getDomain(),n=Math.min(s,r),o=Math.max(s,r);let a=this.log(n),l=this.log(o);if(this.interval){const e=Math.abs(this.interval),t=Math.abs(l-a);let i=po(a,l,Math.min(t,e));i=lo(i.fractionDigits,i.map(e=>this.pow(e)).filter(e=>e>=n&&e<=o));const s=this.getPixelRange();if(!go({start:n,stop:o,interval:e,count:i.length,availableRange:s}))return i}if(i%1!=0||l-a>=t){let e=co(a,l,Math.min(l-a,t));return e=lo(e.fractionDigits,e.map(e=>this.pow(e))),e}const c=[],h=n>0;a=Math.floor(a)-1,l=Math.round(l)+1;const d=zs(this.range)/t;let u=1/0;for(let e=a;e<=l;e++){const t=this.convert(this.pow(e+1));for(let s=1;s<i;s++){const r=h?s:i-s+1,a=this.pow(e)*r,l=this.convert(a),p=Math.abs(u-l),g=Math.abs(l-t);a>=n&&a<=o&&(1===s||p>=d&&g>=d||0===c.length)&&(c.push(a),u=l)}}return c}tickFormat({count:e,ticks:t,specifier:i}){return e!==1/0&&null==t&&this.ticks(),null!=i||(i=10===this.base?".0e":","),He(i)?xa(i):i}static getBaseLogMethod(e){switch(e){case 10:return Math.log10;case Math.E:return Math.log;case 2:return Math.log2;default:const t=Math.log(e);return e=>Math.log(e)/t}}static getBasePowerMethod(e){switch(e){case 10:return e=>e>=0?p(10,e):1/p(10,-e);case Math.E:return Math.exp;default:return t=>p(e,t)}}};C([Hr],ka.prototype,"base",2);var La=ka,Na=class e{constructor(e,t,i=!0){this.parentNode=e,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Ds.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(lr,t)?()=>new t:t}static select(t,i,s=!0){return new e(t,i,s)}static selectAll(e,t){const i=[],s=e=>{t(e)&&i.push(e),e.children.forEach(s)};return s(e),i}static selectByClass(t,i,...s){return e.selectAll(t,e=>e instanceof i||s.some(t=>e instanceof t))}static selectByTag(t,i){return e.selectAll(t,e=>e.tag===i)}createNode(e,t,i){const s=this.nodeFactory(e);return s.datum=e,null==t||t(s),null==i?this._nodes.push(s):this._nodes.splice(i,0,s),this.parentNode.appendChild(s),s}update(e,t,i){if(this.garbageBin.size>0&&this.debug(`Selection - update() called with pending garbage: ${e}`),i){const s=new Map(e.map((e,t)=>[i(e),[e,t]]));for(const[e,t]of this._nodesMap.entries())if(s.has(t)){const[i]=s.get(t);e.datum=i,this.garbageBin.delete(e),s.delete(t)}else this.garbageBin.add(e);for(const[e,[i,r]]of s.entries())this._nodesMap.set(this.createNode(i,t,r),e)}else{const i=Math.max(e.length,this.data.length);for(let s=0;s<i;s++)s>=e.length?this.garbageBin.add(this._nodes[s]):s>=this._nodes.length?this.createNode(e[s],t):(this._nodes[s].datum=e[s],this.garbageBin.delete(this._nodes[s]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(e=>!this.garbageBin.has(e)||(this._nodesMap.delete(e),this.garbageBin.delete(e),this.parentNode.removeChild(e),!1))),this}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}hasGarbage(){return this.garbageBin.size>0}each(e){for(const t of this._nodes.entries())e(t[1],t[1].datum,t[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const t=this._nodes[e],i=this._nodes[e].datum;yield{node:t,datum:i,index:e}}}select(t){return e.selectAll(this.parentNode,t)}selectByClass(t){return e.selectByClass(this.parentNode,t)}selectByTag(t){return e.selectByTag(this.parentNode,t)}nodes(){return this._nodes}};function _a(e,t,i,s){const r=e-i,n=t-s;return r*r+n*n}function Oa(e,t,i,s,r,n,o){if(i===r&&s===n)return Math.min(o,_a(e,t,i,s));const a=r-i,l=n-s,c=Math.max(0,Math.min(1,((e-i)*a+(t-s)*l)/(a*a+l*l))),h=i+c*a,d=s+c*l;return Math.min(o,_a(e,t,h,d))}function Fa(e,t,i,s,r,n,o,a,l){if(a&&([o,n]=[n,o]),!Or(Math.atan2(t-s,e-i),n,o)){const o=i+Math.cos(n)*r,a=s+Math.sin(n)*r,c=i+Math.cos(n)*r,h=s+Math.sin(n)*r;return Math.min(l,_a(e,t,o,a),_a(e,t,c,h))}const c=r-Math.sqrt(_a(e,t,i,s));return Math.min(l,c*c)}var Ga=class extends Do{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}computeBBox(){return new Js(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){if(this.x1===this.x2||this.y1===this.y2){const{x:i,y:s}=this.transformPoint(e,t);return this.computeBBox().grow(this.strokeWidth/2).containsPoint(i,s)}return!1}distanceSquared(e,t){const{x1:i,y1:s,x2:r,y2:n}=this;return Oa(e,t,i,s,r,n,1/0)}render(e){var t;const{ctx:i,forceRender:s,stats:r,devicePixelRatio:n}=e;if(0===this.dirty&&!s)return void(r&&(r.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:o,y1:a,x2:l,y2:c}=this;if(o===l){const{strokeWidth:e}=this,t=Math.round(o*n)/n+Math.trunc(e*n)%2/(2*n);o=t,l=t}else if(a===c){const{strokeWidth:e}=this,t=Math.round(a*n)/n+Math.trunc(e*n)%2/(2*n);a=t,c=t}i.beginPath(),i.moveTo(o,a),i.lineTo(l,c),this.fillStroke(i),null==(t=this.fillShadow)||t.markClean(),super.render(e)}};function Ba(e,t,i,s,r,n){if(0===e.size)return!1;let o=e.x,a=e.y;null!=t&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+r&&(l=i+r);let c=a;a<s?c=s:a>s+n&&(c=s+n);const h=o-l,d=a-c;return Math.sqrt(h*h+d*d)<=.5*e.size}function Va(e,t,i,s,r){const n=e.x+e.width>t&&e.x<t+s,o=e.y+e.height>i&&e.y<i+r;return n&&o}function Ha(e,t,i,s,r){return t+s<e.x+e.width&&t>e.x&&i>e.y&&i+r<e.y+e.height}function Ua(e){return null!=e&&"object"==typeof e.point&&"object"==typeof e.label}Ga.className="Line",Ga.defaultStyles=Object.assign({},Do.defaultStyles,{fill:void 0,strokeWidth:1}),C([ir({redraw:3})],Ga.prototype,"x1",2),C([ir({redraw:3})],Ga.prototype,"y1",2),C([ir({redraw:3})],Ga.prototype,"x2",2),C([ir({redraw:3})],Ga.prototype,"y2",2);var za={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function Wa(e,t){return e.length===t.length&&e.every((e,i)=>{const s=t[i];return Array.isArray(e)&&Array.isArray(s)?Wa(e,s):e===s})}function ja(e,t){return e.length===t.length&&e.every((e,i)=>Number(e)===Number(t[i]))}function Ka(e){const t=ke(e)?e:e.split(".");if(1===t.length){const[e]=t;return Te((t,i,s)=>t[e]=s,t=>t[e])}return Te((e,i,s)=>tt(e,t,s),e=>Je(e,t))}function $a(e){return Te((t,i,s)=>t[e]=s)}function Ya(e,t){return Te((i,s,r)=>i[e][null!=t?t:s]=r)}function qa(e){const{newValue:t,oldValue:i,changeValue:s}=e;return Te((e,r,n,o)=>(n!==o&&(void 0!==o&&(null==i||i.call(e,o)),void 0!==n&&(null==t||t.call(e,n)),null==s||s.call(e,n,o)),n))}function Xa(e){return t=e,(e,i)=>{Ae(e,i).observers.push(t)};var t}function Za(e,t,i){void 0===i||""===i?null==e||e.removeAttribute(t):null==e||e.setAttribute(t,i.toString())}function Qa(e,t,i,s,r){let{top:n,right:o,bottom:a,left:l,width:c,height:h}=r;return null!=l?null!=c?o=i-l+c:null!=o&&(c=i-l-o):null!=o&&null!=c&&(l=i-o-c),null!=n?null!=h?a=s-n-h:null!=a&&(h=s-a-n):null!=a&&null!=h&&(n=s-a-h),null==c?null==h?(c=e,h=t):c=Math.ceil(e*h/t):null==h&&(h=Math.ceil(t*c/e)),null==l&&(l=null==o?Math.floor((i-c)/2):i-o-c),null==n&&(n=null==a?Math.floor((s-h)/2):s-h-a),{x:l,y:n,width:c,height:h}}var Ja="ag-chart-tooltip",el="ag-chart-dark-tooltip",tl={html:"",ariaLabel:""};function il(e){const t=(e,t,i)=>0===t||"."!==i[t-1]?". ":" ";return e.replace(/<br\s*\/?>/g,t).replace(/<\/p\s+>/g,t).replace(/<\/li\s*\/>/g,t).replace(/<[^>]+>/g,"")}function sl(e,t){var i,s,r;if("string"==typeof e)return{html:e,ariaLabel:e};const{content:n=(null!=(i=null==t?void 0:t.content)?i:""),title:o=(null==t?void 0:t.title),color:a=(null!=(s=null==t?void 0:t.color)?s:"white"),backgroundColor:l=(null!=(r=null==t?void 0:t.backgroundColor)?r:"#888")}=e;return{html:`${o?`<div class="${Ja}-title"\n        style="color: ${a}; background-color: ${l}">${o}</div>`:""}${n?`<div class="${Ja}-content">${n}</div>`:""}`,ariaLabel:il(`${o?`${o}: `:""}${n}`)}}var rl=class extends yt{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};C([jr(On(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"))],rl.prototype,"type",2),C([jr(en)],rl.prototype,"xOffset",2),C([jr(en)],rl.prototype,"yOffset",2);var nl=class extends yt{constructor(){super(),this.enabled=!0,this.delay=0,this.range="nearest",this.wrapping="hyphenate",this.position=new rl,this.darkTheme=!1,this.enableInteraction=!1,this.lastVisibilityChange=Date.now(),this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this.element=ws("div",Ja),Za(this.element,"aria-hidden",!0),this.root=bs("body"),this.root.appendChild(this.element)}destroy(){this.element.remove()}isVisible(){return!this.element.classList.contains(Ja+"-hidden")}show(e,t,i,s=!1){var r,n,o,a,l,c,h,d,u;const{element:p}=this;if(null!=i)p.innerHTML=i.html;else if(!p.innerHTML)return void this.toggle(!1);const g=null!=(n=null==(r=t.position)?void 0:r.type)?n:this.position.type,m=null!=(a=null==(o=t.position)?void 0:o.xOffset)?a:0,f=null!=(c=null==(l=t.position)?void 0:l.yOffset)?c:0,y=this.getTooltipBounds({positionType:g,meta:t,yOffset:f,xOffset:m,canvasRect:e}),v=this.getWindowSize(),C=Qa(p.clientWidth,p.clientHeight,e.width,e.height,y);C.x+=e.x,C.y+=e.y;const b=Vs(0,C.x,v.width-p.clientWidth-1),S=Vs(0,C.y,v.height-p.clientHeight),w=b!==C.x||S!==C.y,x=!("node"!==g&&"pointer"!==g||w||m||f),E=null!=(d=null!=(h=t.showArrow)?h:this.showArrow)?d:x;this.updateShowArrow(E),p.style.transform=`translate(${Math.round(b)}px, ${Math.round(S)}px)`,this.enableInteraction=null!=(u=t.enableInteraction)&&u,this.delay>0&&!s?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}getWindowSize(){const{innerWidth:e,innerHeight:t}=Ss();return{width:e,height:t}}toggle(e){const{classList:t}=this.element,i=(e,i)=>t.toggle(`${Ja}-${e}`,i),s=this.isVisible();let r=1/0;if(e||clearTimeout(this.showTimeout),s!==e){const e=Date.now();r=e-this.lastVisibilityChange,this.lastVisibilityChange=e}r>5&&i("no-animation",!s&&e&&r>100),i("no-interaction",!this.enableInteraction),i("hidden",!e),i("arrow",this._showArrow),t.toggle(el,this.darkTheme);for(const e of this.wrapTypes)t.toggle(`${Ja}-wrap-${e}`,e===this.wrapping)}pointerLeftOntoTooltip(e){var t;if(!this.enableInteraction)return!1;const i=null==(t=e.sourceEvent.relatedTarget)?void 0:t.classList,s=Boolean(["","-title","-content"].filter(e=>null==i?void 0:i.contains(`${Ja}${e}`)));return void 0!==i&&s}updateShowArrow(e){this._showArrow=e}getTooltipBounds({positionType:e,meta:t,yOffset:i,xOffset:s,canvasRect:r}){const{clientWidth:n,clientHeight:o}=this.element,a={width:n,height:o};switch(e){case"node":case"pointer":return a.top=t.offsetY+i-o-8,a.left=t.offsetX+s-n/2,a;case"top":return a.top=i,a.left=r.width/2-n/2+s,a;case"right":return a.top=r.height/2-o/2+i,a.left=r.width-n/2+s,a;case"left":return a.top=r.height/2-o/2+i,a.left=s,a;case"bottom":return a.top=r.height-o+i,a.left=r.width/2-n/2+s,a;case"top-left":return a.top=i,a.left=s,a;case"top-right":return a.top=i,a.left=r.width-n+s,a;case"bottom-right":return a.top=r.height-o+i,a.left=r.width-n+s,a;case"bottom-left":return a.top=r.height-o+i,a.left=s,a}}};C([jr(Zr)],nl.prototype,"enabled",2),C([jr(Zr,{optional:!0})],nl.prototype,"showArrow",2),C([Xa((e,t,i)=>{t&&e.element.classList.add(t),i&&e.element.classList.remove(i)}),jr(Jr,{optional:!0})],nl.prototype,"class",2),C([jr(sn)],nl.prototype,"delay",2),C([jr(Nn)],nl.prototype,"range",2),C([jr(Dn)],nl.prototype,"wrapping",2),C([jr(qr)],nl.prototype,"position",2),C([jr(Zr)],nl.prototype,"darkTheme",2);var ol=class extends yt{constructor(){super(...arguments),this.id=Fs(this),this.node=new Oo({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncated=!1}getOrAddRegion(e,t){return"root"===t?e.regionManager.getRegion("root"):e.regionManager.addRegionFromProperties({name:t,bboxproviders:[this.node],canInteraction:()=>this.enabled&&this.node.visible})}registerInteraction(e,t){const i=this.getOrAddRegion(e,t);return function(...e){return()=>{for(const t of e)t()}}(i.addListener("hover",t=>this.handleMouseMove(e,t)),i.addListener("leave",t=>this.handleMouseLeave(e,t)))}computeTextWrap(e,t){var i,s;const{text:r,wrapping:n}=this,o=Math.min(null!=(i=this.maxWidth)?i:1/0,e),a=null!=(s=this.maxHeight)?s:t;if(!isFinite(o)&&!isFinite(a))return void(this.node.text=r);const{text:l,truncated:c}=Oo.wrap(null!=r?r:"",o,a,this,n);this.node.text=l,this.truncated=c}updateTooltip(e,t){if(void 0!==t&&this.enabled&&this.node.visible&&this.truncated){const{offsetX:i,offsetY:s}=t;return e.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:t,showArrow:!1},sl({content:this.text})),!0}return!1}handleMouseMove(e,t){this.updateTooltip(e,t)&&t.consume()}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};ol.SMALL_PADDING=10,ol.LARGE_PADDING=20,C([jr(Zr)],ol.prototype,"enabled",2),C([jr(Jr,{optional:!0}),Ya("node")],ol.prototype,"text",2),C([jr(In,{optional:!0}),Ya("node")],ol.prototype,"textAlign",2),C([jr(An,{optional:!0}),Ya("node")],ol.prototype,"fontStyle",2),C([jr(Tn,{optional:!0}),Ya("node")],ol.prototype,"fontWeight",2),C([jr(sn),Ya("node")],ol.prototype,"fontSize",2),C([jr(Jr),Ya("node")],ol.prototype,"fontFamily",2),C([jr(mn,{optional:!0}),Ya("node","fill")],ol.prototype,"color",2),C([jr(sn,{optional:!0})],ol.prototype,"spacing",2),C([jr(sn,{optional:!0})],ol.prototype,"lineHeight",2),C([jr(sn,{optional:!0})],ol.prototype,"maxWidth",2),C([jr(sn,{optional:!0})],ol.prototype,"maxHeight",2),C([jr(Dn)],ol.prototype,"wrapping",2);var al=["stroke","lineDash"],ll=ln(e=>Ge(e)&&Object.keys(e).every(e=>al.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),cl=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};C([jr(Zr)],cl.prototype,"enabled",2),C([jr(sn)],cl.prototype,"width",2),C([jr(ll)],cl.prototype,"style",2);var hl=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.autoWrap=!1,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.padding=5,this.minSpacing=NaN,this.color="rgba(87, 87, 87, 1)",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}};C([jr(Zr)],hl.prototype,"enabled",2),C([jr(Zr,{optional:!0})],hl.prototype,"autoWrap",2),C([jr(sn,{optional:!0})],hl.prototype,"maxWidth",2),C([jr(sn,{optional:!0})],hl.prototype,"maxHeight",2),C([jr(An,{optional:!0})],hl.prototype,"fontStyle",2),C([jr(Tn,{optional:!0})],hl.prototype,"fontWeight",2),C([jr(en.restrict({min:1}))],hl.prototype,"fontSize",2),C([jr(Jr)],hl.prototype,"fontFamily",2),C([jr(sn)],hl.prototype,"padding",2),C([jr(on),Wr(NaN)],hl.prototype,"minSpacing",2),C([jr(mn,{optional:!0})],hl.prototype,"color",2),C([jr(nn,{optional:!0})],hl.prototype,"rotation",2),C([jr(Zr)],hl.prototype,"avoidCollisions",2),C([jr(Zr)],hl.prototype,"mirrored",2),C([jr(Zr)],hl.prototype,"parallel",2),C([jr(Qr,{optional:!0})],hl.prototype,"formatter",2),C([jr(Jr,{optional:!0})],hl.prototype,"format",2);var dl=class{constructor(){this.enabled=!0,this.width=1,this.color=void 0}};C([jr(Zr)],dl.prototype,"enabled",2),C([jr(sn)],dl.prototype,"width",2),C([jr(mn,{optional:!0})],dl.prototype,"color",2);var ul=class extends yt{constructor(){super(...arguments),this.enabled=!1,this.spacing=ol.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};function pl(e){const[t,i]=Us(e.range),s=Math.floor(t),r=Math.ceil(i);return{min:s,max:r,visible:s!==r}}C([jr(Zr)],ul.prototype,"enabled",2),C([jr(Jr,{optional:!0})],ul.prototype,"text",2),C([jr(sn,{optional:!0})],ul.prototype,"spacing",2),C([jr(An,{optional:!0})],ul.prototype,"fontStyle",2),C([jr(Tn,{optional:!0})],ul.prototype,"fontWeight",2),C([jr(sn)],ul.prototype,"fontSize",2),C([jr(Jr)],ul.prototype,"fontFamily",2),C([jr(mn,{optional:!0})],ul.prototype,"color",2),C([jr(Dn)],ul.prototype,"wrapping",2),C([jr(Qr,{optional:!0})],ul.prototype,"formatter",2);var gl=2*Math.PI,ml=gl/2;function fl(e){const t=(t,i)=>{const[s=e.min,r=e.max]=Us(null!=i?i:[]);return t<s||t>r},i={fromFn(e,i,s){let r=e.y1+e.translationY,n=e.opacity;return("added"===s||t(e.datum.translationY,e.datum.range))&&(r=i.translationY,n=0),{y:0,translationY:r,opacity:n,phase:Dr[s]}},toFn(e,t,i){const s=t.translationY;let r=1;return"removed"===i&&(r=0),{y:0,translationY:s,opacity:r,finish:{y:s,translationY:0}}},intermediateFn:(e,i,s)=>({visible:!t(e.y)})},s={fromFn(e,i,s){var r;const n=null!=(r=e.previousDatum)?r:i,o=n.x,a=n.y,l=n.rotationCenterX;let c=Math.round(e.translationY),h=n.rotation,d=e.opacity;return"removed"===s||t(n.y,n.range)?h=i.rotation:("added"===s||t(e.datum.y,e.datum.range))&&(c=Math.round(n.translationY),d=0,h=i.rotation),{x:o,y:a,rotationCenterX:l,translationY:c,rotation:h,opacity:d,phase:Dr[s]}},toFn(e,t,i){var s,r;const n=t.x,o=t.y,a=t.rotationCenterX,l=Math.round(t.translationY);let c=0,h=1;var d,u;return"added"===i?(h=1,c=t.rotation):"removed"===i?(h=0,c=t.rotation):(d=null!=(r=null==(s=e.previousDatum)?void 0:s.rotation)?r:t.rotation,u=t.rotation,c=Math.abs(u-d)<ml?u:d>u?u+gl:u-gl),{x:n,y:o,rotationCenterX:a,translationY:l,rotation:c,opacity:h,finish:{rotation:t.rotation}}}};return{tick:i,line:{fromFn(e,t){var i;return f(m({},null!=(i=e.previousDatum)?i:t),{phase:Dr.updated})},toFn:(e,t)=>m({},t)},label:s,group:{fromFn(e,t){const{rotation:i,translationX:s,translationY:r}=e;return{rotation:i,translationX:s,translationY:r,phase:Dr.updated}},toFn(e,t){const{rotation:i,translationX:s,translationY:r}=t;return{rotation:i,translationX:s,translationY:r}}}}}function yl(){return(e,t)=>({rotation:t.rotation,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,translationX:t.translationX,translationY:t.translationY})}function vl(e){const{visible:t,min:i,max:s}=e;return(e,r)=>{const n=r.translationY;return{y:n,translationY:0,opacity:1,visible:t&&n>=i&&n<=s}}}function Cl(){return(e,t)=>({x:t.x,y:t.y,translationY:t.translationY,rotation:t.rotation,rotationCenterX:t.rotationCenterX})}function bl(){return(e,t)=>m({},t)}var Sl=class e{constructor(t,i,s){let r;this.moduleCtx=t,this.scale=i,this.id=Fs(this),this.nice=!0,this.reverse=!1,this.keys=[],this.dataDomain={domain:[],clipped:!1},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new xo({name:`${this.id}-axis`,zIndex:2}),this.lineNode=this.axisGroup.appendChild(new Ga),this.tickLineGroup=this.axisGroup.appendChild(new xo({name:`${this.id}-Axis-tick-lines`,zIndex:2})),this.tickLabelGroup=this.axisGroup.appendChild(new xo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.crossLineGroup=new xo({name:`${this.id}-CrossLines`}),this.gridGroup=new xo({name:`${this.id}-Axis-grid`}),this.gridLineGroup=this.gridGroup.appendChild(new xo({name:`${this.id}-gridLines`,zIndex:1})),this.tickLineGroupSelection=Na.select(this.tickLineGroup,Ga,!1),this.tickLabelGroupSelection=Na.select(this.tickLabelGroup,Oo,!1),this.gridLineGroupSelection=Na.select(this.gridLineGroup,Ga,!1),this.line=new dl,this.tick=this.createTick(),this.gridLine=new cl,this.label=this.createLabel(),this.defaultTickMinSpacing=e.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,padding:this.label.padding,format:this.label.format}},this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new ul,this._titleCaption=new ol,this.gridLength=0,this.fractionDigits=0,this.gridPadding=0,this.seriesAreaPadding=0,this.tickGenerationResult=void 0,this.maxThickness=1/0,this.moduleMap=new pa,this.refreshScale(),this.destroyFns.push(this._titleCaption.registerInteraction(this.moduleCtx,"root")),this._titleCaption.node.rotation=-Math.PI/2,this.axisGroup.appendChild(this._titleCaption.node),this.destroyFns.push(t.regionManager.getRegion("series").addListener("hover",e=>this.checkAxisHover(e))),this.animationManager=t.animationManager,this.animationState=new fa("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:e=>this.animateReadyUpdate(e),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this._crossLines=[],this.assignCrossLineArrayConstructor(this._crossLines),this.destroyFns.push(t.layoutService.addListener("layout-complete",e=>{null!=r&&null!=St(e.chart,r)&&this.animationState.transition("resize"),r=m({},e.chart)})),!1!==(null==s?void 0:s.respondsToZoom)&&this.destroyFns.push(t.updateService.addListener("update-complete",e=>{this.minRect=e.minRect}))}get type(){var e;return null!=(e=this.constructor.type)?e:""}set crossLines(e){var t,i;null==(t=this._crossLines)||t.forEach(e=>this.detachCrossLine(e)),e&&this.assignCrossLineArrayConstructor(e),this._crossLines=e,null==(i=this._crossLines)||i.forEach(e=>{this.attachCrossLine(e),this.initCrossLine(e)})}get crossLines(){return this._crossLines}resetAnimation(e){"initial"===e&&this.animationState.transition("reset")}attachCrossLine(e){this.crossLineGroup.appendChild(e.group),this.crossLineGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineGroup.removeChild(e.group),this.crossLineGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}refreshScale(){var e;this.range=this.scale.range.slice(),null==(e=this.crossLines)||e.forEach(this.initCrossLine,this)}updateRange(){var e;const{range:t,visibleRange:i,scale:s}=this,r=(t[1]-t[0])/(i[1]-i[0]),n=r*i[0],o=t[0]-n;s.range=[o,o+r],null==(e=this.crossLines)||e.forEach(e=>{e.clippedRange=[t[0],t[1]]})}setCrossLinesVisible(e){this.crossLineGroup.visible=e}attachAxis(e,t){t.appendChild(this.gridGroup),e.appendChild(this.axisGroup),e.appendChild(this.crossLineGroup)}detachAxis(e,t){t.removeChild(this.gridGroup),e.removeChild(this.axisGroup),e.removeChild(this.crossLineGroup)}inRange(e,t=0,i=0){const[s,r]=Us(this.range);return e+t>=s-i&&e<=r+i}onLabelFormatChange(e,t,i){const{scale:s,fractionDigits:r}=this,n=!(s instanceof La)&&r>0?e=>"number"==typeof e?e.toFixed(r):String(e):e=>String(e);if(i&&s&&s.tickFormat)try{this.labelFormatter=s.tickFormat({ticks:e,specifier:i})}catch(e){this.labelFormatter=n,N.warnOnce(`the axis label format string ${i} is invalid. No formatting will be applied`)}else this.labelFormatter=n}setTickInterval(e){var t;this.scale.interval=null!=(t=this.tick.interval)?t:e}setTickCount(e,t,i){const{scale:s}=this,r=qn.is(s)||vo.is(s);if(e&&r)return"number"==typeof e?(s.tickCount=e,s.minTickCount=null!=t?t:0,void(s.maxTickCount=null!=i?i:1/0)):void(s instanceof fo&&this.setTickInterval(e))}onGridLengthChange(e,t){var i;(t&&!e||!t&&e)&&this.onGridVisibilityChange(),null==(i=this.crossLines)||i.forEach(this.initCrossLine,this)}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new hl}checkAxisHover(e){this.interactionEnabled&&this.computeBBox().containsPoint(e.offsetX,e.offsetY)&&this.moduleCtx.chartEventManager.axisHover(this.id,this.direction)}update(e=0,t=!0){if(!this.tickGenerationResult)return;const{rotation:i,parallelFlipRotation:s,regularFlipRotation:r}=this.calculateRotations(),n=this.label.getSideFlag();this.updatePosition();const o=this.getAxisLineCoordinates(),{tickData:a,combinedRotation:l,textBaseline:c,textAlign:h,primaryTickCount:d}=this.tickGenerationResult,u=this.tickLabelGroupSelection.nodes().map(e=>e.datum.tickId);if(this.updateSelections(o,a.ticks,{combinedRotation:l,textAlign:h,textBaseline:c,range:this.scale.range}),!t||this.animationManager.isSkipped())this.resetSelectionNodes();else{const e=this.calculateUpdateDiff(u,a);this.animationState.transition("update",e)}return this.updateAxisLine(),this.updateLabels(),this.updateVisibility(),this.updateGridLines(n),this.updateTickLines(),this.updateTitle({anyTickVisible:a.ticks.length>0}),this.updateCrossLines({rotation:i,parallelFlipRotation:s,regularFlipRotation:r}),this.updateLayoutState(),d}getAxisLineCoordinates(){const[e,t]=Us(this.range);return{x:0,y1:e,y2:t}}getTickLineCoordinates(e){const t=this.label.getSideFlag()*this.getTickSize(),i=Math.min(0,t);return{x1:i,x2:i+Math.abs(t),y:e.translationY}}getTickLabelProps(e,t){const{label:i}=this,{combinedRotation:s,textBaseline:r,textAlign:n,range:o}=t,a=e.tickLabel,l=i.getSideFlag()*(this.getTickSize()+i.padding+this.seriesAreaPadding),c=""!==a&&null!=a;return{tickId:e.tickId,translationY:e.translationY,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,rotation:s,rotationCenterX:l,text:a,textAlign:n,textBaseline:r,visible:c,x:l,y:0,range:o}}getTickSize(){return this.tick.enabled?this.tick.size:this.createTick().size}setTitleProps(e,t){var i;const{title:s}=this;if(s.enabled){if(e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.enabled=s.enabled,e.wrapping=s.wrapping,s.enabled){const r=e.node,n=(null!=(i=s.spacing)?i:0)+t.spacing,o=this.label.getSideFlag(),a=Lr(this.rotation),l=-1===o&&a>Math.PI&&a<2*Math.PI?-1:1,c=l*o*Math.PI/2,h=1===l?"bottom":"top",{range:d}=this,u=Math.floor(l*o*(d[0]+d[1])/2),p=-1===o?Math.floor(l*-n):Math.floor(-n),{callbackCache:g}=this.moduleCtx,{formatter:m=e=>e.defaultValue}=s,f=g.call(m,this.getTitleFormatterParams());r.setProperties({rotation:c,text:f,textBaseline:h,visible:!0,x:u,y:p})}}else e.enabled=!1}calculateLayout(e){var t,i;const{rotation:s,parallelFlipRotation:r,regularFlipRotation:n}=this.calculateRotations(),o=this.label.getSideFlag(),a=o*(this.getTickSize()+this.label.padding+this.seriesAreaPadding);this.updateScale(),this.tickGenerationResult=this.generateTicks({primaryTickCount:e,parallelFlipRotation:r,regularFlipRotation:n,labelX:a,sideFlag:o}),this.updateLayoutState();const l=this.tickGenerationResult,{tickData:c,combinedRotation:h,textBaseline:d,textAlign:u}=l,p=y(l,["tickData","combinedRotation","textBaseline","textAlign"]),g=[],{x:v,y1:C,y2:b}=this.getAxisLineCoordinates(),S=new Js(v+Math.min(o*this.seriesAreaPadding,0),C,this.seriesAreaPadding,b-C);if(g.push(S),this.tick.enabled&&c.ticks.forEach(e=>{const{x1:t,x2:i,y:s}=this.getTickLineCoordinates(e),r=new Js(t,s,i-t,0);g.push(r)}),this.label.enabled){const e=new Oo;c.ticks.forEach(t=>{const i=this.getTickLabelProps(t,{combinedRotation:h,textAlign:u,textBaseline:d,range:this.scale.range});if(!i.visible)return;e.setProperties(f(m({},i),{translationY:Math.round(t.translationY)}));const s=e.computeTransformedBBox();s&&g.push(s)})}if(null==(t=this.title)?void 0:t.enabled){const e=new ol,t=Js.merge(g).width;this.setTitleProps(e,{spacing:t});const i=e.node.computeTransformedBBox();i&&g.push(i)}const w=(e=>{const t=new nr,{rotation:i,translationX:s,translationY:r,rotationCenterX:n,rotationCenterY:o}=this.getAxisTransform();return nr.updateTransformMatrix(t,1,1,i,s,r,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:n,rotationCenterY:o}),t.transformBBox(e)})(Js.merge(g)),x=this.isAnySeriesActive();return null==(i=this.crossLines)||i.forEach(e=>{var t;e.sideFlag=-o,e.direction=s===-Math.PI/2?"x":"y",e instanceof ua&&(e.label.parallel=null!=(t=e.label.parallel)?t:this.label.parallel),e.parallelFlipRotation=r,e.regularFlipRotation=n,e.calculateLayout(x,this.reverse)}),{primaryTickCount:e=p.primaryTickCount,bbox:w}}updateLayoutState(){this.layout.label={fractionDigits:this.fractionDigits,padding:this.label.padding,format:this.label.format}}setDomain(e){this.dataDomain=this.normaliseDataDomain(e),this.reverse&&this.dataDomain.domain.reverse(),this.scale.domain=this.dataDomain.domain}updateScale(){this.updateRange(),this.calculateDomain(),this.setTickInterval(this.tick.interval);const{scale:e,nice:t}=this;qn.is(e)&&(e.nice=t,e.update())}calculateRotations(){const e=Fr(this.rotation);return{rotation:e,parallelFlipRotation:Lr(e),regularFlipRotation:Lr(e-Math.PI/2)}}generateTicks({primaryTickCount:e,parallelFlipRotation:t,regularFlipRotation:i,labelX:s,sideFlag:r}){var n;const{scale:o,tick:a,label:{parallel:l,rotation:c,fontFamily:h,fontSize:d,fontStyle:u,fontWeight:p}}=this,g=void 0!==e,{defaultRotation:y,configuredRotation:v,parallelFlipFlag:C,regularFlipFlag:b}=Vo({rotation:c,parallel:l,regularFlipRotation:i,parallelFlipRotation:t}),S=v+y,w=new nr,{maxTickCount:x}=this.estimateTickCount({minSpacing:a.minSpacing,maxSpacing:null!=(n=a.maxSpacing)?n:NaN}),E=!qn.is(o)&&!vo.is(o)||isNaN(x)?10:x;let M=Ho(l,v,0,r,b);const A=function(e,t,i,s){return e&&!t?i*s===-1?"hanging":"bottom":"middle"}(l,v,r,C),T={fontFamily:h,fontSize:d,fontStyle:u,fontWeight:p,textBaseline:A,textAlign:M};let D={rawTicks:[],ticks:[],labelCount:0},I=0,R=0,P=!0,k=!1;for(;P&&I<=E&&!k;){R=0,M=Ho(l,v,0,r,b);const t=this.getTickStrategies({secondaryAxis:g,index:I});for(const i of t){({tickData:D,index:I,autoRotation:R,terminate:k}=i({index:I,tickData:D,textProps:T,labelOverlap:P,terminate:k,primaryTickCount:e}));const t=0!==v||0!==R,n=S+R;M=Ho(l,v,R,r,b),P=!!this.label.avoidCollisions&&this.checkLabelOverlap(n,t,w,D.ticks,s,f(m({},T),{textAlign:M}))}}const L=y+v+R;return!g&&D.rawTicks.length>0&&(e=D.rawTicks.length),{tickData:D,primaryTickCount:e,combinedRotation:L,textBaseline:A,textAlign:M}}getTickStrategies({index:e,secondaryAxis:t}){const{scale:i,label:s,tick:r}=this,n=qn.is(i)||vo.is(i),o=s.enabled&&s.avoidCollisions,a=!n&&0!==e&&o,l=!0===s.autoRotate&&void 0===s.rotation,c=[];let h;if(h=this.tick.values?3:t?1:a?2:0,c.push(({index:e,tickData:t,primaryTickCount:i,terminate:s})=>this.createTickData(h,e,t,s,i)),!n&&!isNaN(r.minSpacing)){const e=({index:e,tickData:t,primaryTickCount:i,terminate:s})=>this.createTickData(2,e,t,s,i);c.push(e)}if(!o)return c;if(s.autoWrap){const e=({index:e,tickData:t,textProps:i})=>this.wrapLabels(t,e,i);c.push(e)}else if(l){const e=({index:e,tickData:t,labelOverlap:i,terminate:s})=>({index:e,tickData:t,autoRotation:this.getAutoRotation(i),terminate:s});c.push(e)}return c}createTickData(e,t,i,s,r){var n;const{scale:o,tick:a}=this,{maxTickCount:l,minTickCount:c,defaultTickCount:h}=this.estimateTickCount({minSpacing:a.minSpacing,maxSpacing:null!=(n=a.maxSpacing)?n:NaN}),d=qn.is(o)||vo.is(o),u=!d||isNaN(l)?10:l;let p=d?Math.max(h-t,c):l;const g=void 0===a.interval&&void 0===a.values&&p>c&&(d||2===e);let m=!0;for(;m&&t<=u;){const s=i.rawTicks;p=d?Math.max(h-t,c):l;const{rawTicks:n,ticks:o,labelCount:a}=this.getTicks({tickGenerationType:e,previousTicks:s,tickCount:p,minTickCount:c,maxTickCount:l,primaryTickCount:r});i.rawTicks=n,i.ticks=o,i.labelCount=a,m=!!g&&ja(n,s),t++}const f=void 0!==a.interval||void 0!==a.values;return s||(s=f),{tickData:i,index:t,autoRotation:0,terminate:s}}checkLabelOverlap(e,t,i,s,r,n){nr.updateTransformMatrix(i,1,1,e,0,0);const o=this.createLabelData(s,r,n,i),a=function(e,t){return isNaN(e)?t?0:10:e}(this.label.minSpacing,t);return function(e,t){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{point:{x:n,y:o},label:{text:a}}=r;let{label:{width:l,height:c}}=r;if(l+=null!=t?t:0,c+=null!=t?t:0,i.some(e=>Va(e,n,o,l,c)))return!0;i.push({index:s,text:a,x:n,y:o,width:l,height:c,datum:r})}return!1}(o,a)}createLabelData(e,t,i,s){const r=[],n=new Fo(i);for(const{tickLabel:i,translationY:o}of e){if(""===i||null==i)continue;const{width:e,height:a}=n.size(i),l=Uo(i,new Js(t,o,e,a),t,o,s);r.push(l)}return r}getAutoRotation(e){var t;return e?Lr(Fr(null!=(t=this.label.autoRotateAngle)?t:0)):0}getTicks({tickGenerationType:e,previousTicks:t,tickCount:i,minTickCount:s,maxTickCount:r,primaryTickCount:n}){var o;const{range:a,scale:l,visibleRange:c}=this;let h;switch(e){case 3:if(qn.is(l)){const[e,t]=Us(l.getDomain().map(Number));h=this.tick.values.filter(i=>i>=e&&i<=t).sort((e,t)=>e-t)}else h=this.tick.values;break;case 1:h=qn.is(l)?this.updateSecondaryAxisTicks(n):this.createTicks(i,s,r);break;case 2:h=this.filterTicks(t,i);break;default:h=this.createTicks(i,s,r)}this.fractionDigits=h.fractionDigits>=0?h.fractionDigits:0;const d=(null!=(o=l.bandwidth)?o:0)/2,u=[];let p=0;const g=new Map,m=Math.max(0,Math.floor(c[0]*h.length)),f=Math.min(h.length,Math.ceil(c[1]*h.length)),y=h.slice(m,f);this.onLabelFormatChange(y,h,this.label.format);for(let e=0;e<y.length;e++){const t=y[e],i=l.convert(t)+d;if(a.length>0&&!this.inRange(i,0,.001))continue;const s=this.formatTick(t,m+e);let r=s;if(g.has(r)){const e=g.get(r);g.set(r,e+1),r=`${r}_${e}`}else g.set(r,1);u.push({tick:t,tickId:r,tickLabel:s,translationY:Math.floor(i)}),""!==s&&null!=s&&p++}return{rawTicks:h,ticks:u,labelCount:p}}filterTicks(e,t){var i;const s=isNaN(this.tick.minSpacing)&&isNaN(null!=(i=this.tick.maxSpacing)?i:NaN)?2:Math.ceil(e.length/t);return e.filter((e,t)=>t%s===0)}createTicks(e,t,i){var s,r,n;return this.setTickCount(e,t,i),null!=(n=null==(r=(s=this.scale).ticks)?void 0:r.call(s))?n:[]}estimateTickCount({minSpacing:e,maxSpacing:t}){const{minRect:i,label:{avoidCollisions:s}}=this;if(!s)return{minTickCount:qn.defaultMaxTickCount,maxTickCount:qn.defaultMaxTickCount,defaultTickCount:qn.defaultMaxTickCount};const r=this.calculateRangeWithBleed(),n=Math.max(this.defaultTickMinSpacing,r/qn.defaultMaxTickCount);let o=!isNaN(t);isNaN(e)&&(e=n),isNaN(t)&&(t=r),e>t&&(e===n?e=t:t=e);let a=1;i&&(a="x"===this.direction?i.width:i.height),o&&(o=a<n);const l=Vs(1,Math.floor(r/e),o?Math.min(Math.floor(r/a),100):100),c=Math.min(l,Math.ceil(r/t));return{minTickCount:c,maxTickCount:l,defaultTickCount:Vs(c,qn.defaultTickCount,l)}}updateVisibility(){this.moduleCtx.animationManager.isSkipped()&&this.resetSelectionNodes(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled}updateCrossLines({rotation:e,parallelFlipRotation:t,regularFlipRotation:i}){var s;const r=this.label.getSideFlag(),n=this.isAnySeriesActive();null==(s=this.crossLines)||s.forEach(s=>{var o;s.sideFlag=-r,s.direction=e===-Math.PI/2?"x":"y",s instanceof ua&&(s.label.parallel=null!=(o=s.label.parallel)?o:this.label.parallel),s.parallelFlipRotation=t,s.regularFlipRotation=i,s.update(n)})}updateTickLines(){const{tick:e,label:t}=this,i=t.getSideFlag();this.tickLineGroupSelection.each(t=>{t.strokeWidth=e.width,t.stroke=e.color,t.x1=i*this.getTickSize(),t.x2=0})}calculateAvailableRange(){return zs(this.range)}calculateRangeWithBleed(){const e=1/zs(this.visibleRange);return Ks(this.calculateAvailableRange()*e,2)}calculateDomain(){const e=this.boundSeries.filter(e=>this.includeInvisibleDomains||e.isEnabled()).flatMap(e=>e.getDomain(this.direction));this.setDomain(e)}getAxisTransform(){return{rotation:Fr(this.rotation),rotationCenterX:0,rotationCenterY:0,translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineGroup:e,axisGroup:t,gridGroup:i,translation:s,gridLineGroupSelection:r,gridPadding:n,gridLength:o}=this,{rotation:a}=this.calculateRotations(),l=this.label.getSideFlag(),c=Math.floor(s.x),h=Math.floor(s.y);e.setProperties({rotation:a,translationX:c,translationY:h}),i.setProperties({rotation:a,translationX:c,translationY:h}),t.datum=this.getAxisTransform(),r.each(e=>{e.x1=n,e.x2=-l*o+n})}updateSecondaryAxisTicks(e){throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.")}updateSelections(e,t,i){this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?t:[],e=>e.append(new Ga),e=>e.tickId),this.tickLineGroupSelection.update(t,e=>e.appendChild(new Ga),e=>e.tickId),this.tickLabelGroupSelection.update(t.map(e=>this.getTickLabelProps(e,i)),e=>e.appendChild(new Oo),e=>e.tickId)}updateAxisLine(){const{line:e}=this,t=e.enabled?e.width:0;this.lineNode.setProperties({stroke:e.color,strokeWidth:t})}updateGridLines(e){const{gridLine:{style:t,width:i},gridPadding:s,gridLength:r}=this;0!==r&&0!==t.length&&this.gridLineGroupSelection.each((n,o,a)=>{const{stroke:l,lineDash:c}=t[a%t.length];n.setProperties({x1:s,x2:-e*r+s,fill:void 0,stroke:l,strokeWidth:i,lineDash:c})})}updateLabels(){const{label:e}=this;e.enabled&&this.tickLabelGroupSelection.each((e,t)=>{e.setProperties(t,["fill","fontFamily","fontSize","fontStyle","fontWeight","text","textAlign","textBaseline"])})}wrapLabels(e,t,i){const{parallel:s,maxWidth:r,maxHeight:n}=this.label;let o=this.maxThickness,a=Math.round(this.calculateAvailableRange()/e.labelCount);return s&&([o,a]=[a,o]),e.ticks.forEach(e=>{const{text:t}=Oo.wrap(e.tickLabel,null!=r?r:o,null!=n?n:a,i,"hyphenate");e.tickLabel=t}),{tickData:e,index:t,autoRotation:0,terminate:!0}}updateTitle(e){const{rotation:t,title:i,_titleCaption:s,lineNode:r,tickLineGroup:n,tickLabelGroup:o}=this;if(!i)return void(s.enabled=!1);let a=0;if(i.enabled&&e.anyTickVisible){const e=xo.computeBBox([n,o,r]);a+=(0===t?e.width:e.height)+(this.tickLabelGroup.visible?0:this.seriesAreaPadding)}this.setTitleProps(s,{spacing:a})}formatTick(e,t){return this.datumFormatter(t)(e)}formatDatum(e){return String(e)}datumFormatter(e=0){const{label:t,labelFormatter:i,fractionDigits:s,moduleCtx:{callbackCache:r}}=this;return t.formatter?n=>{var o;return null!=(o=r.call(t.formatter,{value:s>0?n:String(n),index:e,fractionDigits:s,formatter:i}))?o:n}:i?e=>{var t;return null!=(t=r.call(i,e))?t:String(e)}:e=>String(e)}computeBBox(){return this.axisGroup.computeBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,t,i,s){this.tickLineGroup.setClipRectInGroupCoordinateSpace(new Js(e,t,i,s))}clipGrid(e,t,i,s){this.gridGroup.setClipRectInGroupCoordinateSpace(new Js(e,t,i,s))}calculatePadding(e,t){const i=.01*Math.abs(this.reverse?t:e);return[i,i]}getTitleFormatterParams(){var e;const t=this.boundSeries.reduce((e,t)=>{const i=t.getKeys(this.direction),s=t.getNames(this.direction);for(let t=0;t<i.length;t++)e.push({key:i[t],name:s[t]});return e},[]);return{direction:this.direction,boundSeries:t,defaultValue:null==(e=this.title)?void 0:e.text}}normaliseDataDomain(e){return{domain:[...e],clipped:!1}}getLayoutState(){return m({rect:this.computeBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale},this.layout)}getModuleMap(){return this.moduleMap}createModuleContext(){return null!=this.axisContext||(this.axisContext=this.createAxisContext()),f(m({},this.moduleCtx),{parent:this.axisContext})}createAxisContext(){return{axisId:this.id,direction:this.direction,continuous:qn.is(this.scale),keys:()=>this.boundSeries.flatMap(e=>e.getKeys(this.direction)),seriesKeyProperties:()=>this.boundSeries.reduce((e,t)=>(t.getKeyProperties(this.direction).forEach(t=>{e.indexOf(t)<0&&e.push(t)}),e),[]),scaleValueFormatter:e=>{var t,i;return e?null==(i=(t=this.scale).tickFormat)?void 0:i.call(t,{specifier:e}):this.formatDatum},scaleBandwidth:()=>{var e;return null!=(e=this.scale.bandwidth)?e:0},scaleConvert:e=>this.scale.convert(e),scaleInvert:e=>{var t,i;return null==(i=(t=this.scale).invert)?void 0:i.call(t,e)}}}animateReadyUpdate(e){const{animationManager:t}=this.moduleCtx,i=fl(pl(this));Ir(this.id,"axis-group",t,[this.axisGroup],i.group),Ir(this.id,"line",t,[this.lineNode],i.line),Ir(this.id,"line-paths",t,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(e,t)=>t.tickId,e),Ir(this.id,"tick-labels",t,[this.tickLabelGroupSelection],i.label,(e,t)=>t.tickId,e)}resetSelectionNodes(){const{gridLineGroupSelection:e,tickLineGroupSelection:t,tickLabelGroupSelection:i,lineNode:s}=this,r=pl(this);ma([this.axisGroup],(e,t)=>({rotation:t.rotation,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,translationX:t.translationX,translationY:t.translationY})),ma([e,t],vl(r)),ma([i],(e,t)=>({x:t.x,y:t.y,translationY:t.translationY,rotation:t.rotation,rotationCenterX:t.rotationCenterX})),ma([s],bl())}calculateUpdateDiff(e,t){const i=new Set,s=new Set,r={},n=Math.max(e.length,t.ticks.length);for(let o=0;o<n;o++){const n=t.ticks[o],a=e[o],l=null==n?void 0:n.tickId;r[null!=l?l:a]=n,a!==l&&(s.has(l)?s.delete(l):l&&i.add(l),i.has(a)?i.delete(a):a&&s.add(a))}return{changed:i.size>0||s.size>0,added:i,removed:s}}isReversed(){return this.reverse}};Sl.defaultTickMinSpacing=50,C([jr(Zr)],Sl.prototype,"nice",2),C([jr(Zr)],Sl.prototype,"reverse",2),C([jr(Cn)],Sl.prototype,"keys",2),C([jr(qr,{optional:!0})],Sl.prototype,"title",2),C([Xa((e,t,i)=>e.onGridLengthChange(t,i))],Sl.prototype,"gridLength",2);var wl=Sl,xl=class extends hl{constructor(){super(...arguments),this.autoRotateAngle=335}};C([jr(Zr,{optional:!0})],xl.prototype,"autoRotate",2),C([jr(nn)],xl.prototype,"autoRotateAngle",2);var El=class e extends wl{constructor(){super(...arguments),this.thickness=0,this.position="left"}static is(t){return t instanceof e}get direction(){return["top","bottom"].includes(this.position)?"x":"y"}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}update(e,t){return this.updateDirection(),super.update(e,t)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}createAxisContext(){return f(m({},super.createAxisContext()),{position:this.position})}assignCrossLineArrayConstructor(e){$n(e,ua)}createLabel(){return new xl}};C([jr(sn)],El.prototype,"thickness",2),C([jr(Mn)],El.prototype,"position",2);var Ml=El,Al=class extends Wn{constructor(){super(...arguments),this.minSpacing=NaN}};C([jr(Fn),Wr(NaN)],Al.prototype,"minSpacing",2);var Tl=class extends Ml{constructor(e,t=new zr){super(e,t),this._paddingOverrideEnabled=!1,this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}set paddingInner(e){this._paddingOverrideEnabled=!0,this.scale.paddingInner=e}get paddingInner(){return this._paddingOverrideEnabled=!0,this.scale.paddingInner}set paddingOuter(e){this.scale.paddingOuter=e}get paddingOuter(){return this.scale.paddingOuter}createTick(){return new Al}normaliseDataDomain(e){const t=[],i=new Set;for(const s of e){const e=s instanceof Date?s.getTime():s;i.has(e)||(i.add(e),t.push(s))}return{domain:t,clipped:!1}}calculateDomain(){if(!this._paddingOverrideEnabled){const e=this.boundSeries.map(e=>{var t;return null==(t=e.getBandScalePadding)?void 0:t.call(e)}).filter(e=>null!=e);e.length>0&&(this.scale.paddingInner=Math.min(...e.map(e=>e.inner)),this.scale.paddingOuter=Math.max(...e.map(e=>e.outer)))}return super.calculateDomain()}};Tl.className="CategoryAxis",Tl.type="category",C([jr(rn)],Tl.prototype,"groupPaddingInner",2);var Dl=class{constructor(e="",t,i=0){this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.screenX=0,this.screenY=0,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.label=e,this.parent=t,this.depth=t?t.depth+1:0,this.number=i}getLeftSibling(){return this.number>0&&this.parent?this.parent.children[this.number-1]:void 0}getLeftmostSibling(){return this.number>0&&this.parent?this.parent.children[0]:void 0}nextLeft(){return this.children?this.children[0]:this.thread}nextRight(){return this.children?this.children[this.children.length-1]:this.thread}getSiblings(){return this.parent?this.parent.children.filter((e,t)=>t!==this.number):[]}};function Il(e,t,i){const s=i/(t.number-e.number);t.change-=s,t.shift+=i,e.change+=s,t.prelim+=i,t.mod+=i}function Rl(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function Pl(e,t){const i=e.children;if(i.length){let s=i[0];i.forEach(e=>{Pl(e,t),s=function(e,t,i){const s=e.getLeftSibling();if(s){let r=e,n=e,o=s,a=n.getLeftmostSibling(),l=n.mod,c=r.mod,h=o.mod,d=a.mod;for(;o.nextRight()&&n.nextLeft();){o=o.nextRight(),n=n.nextLeft(),a=a.nextLeft(),r=r.nextRight(),r.ancestor=e;const s=o.prelim+h-(n.prelim+l)+i;s>0&&(Il(Rl(o,e,t),e,s),l+=s,c+=s),h+=o.mod,l+=n.mod,d+=a.mod,c+=r.mod}o.nextRight()&&!r.nextRight()?(r.thread=o.nextRight(),r.mod+=h-c):(n.nextLeft()&&!a.nextLeft()&&(a.thread=n.nextLeft(),a.mod+=l-d),t=e)}return t}(e,s,t)}),function(e){const t=e.children;if(t){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const r=t[s];r.prelim+=e,r.mod+=e,i+=r.change,e+=r.shift+i}}}(e);const r=(i[0].prelim+i.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+t,e.mod=e.prelim-r):e.prelim=r}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+t:0}}var kl=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){const{x:i,y:s}=t(e);i>this.right&&(this.right=i),i<this.left&&(this.left=i),s>this.bottom&&(this.bottom=s),s<this.top&&(this.top=s)}};function Ll(e,t,i){e.x=e.prelim+t,e.y=e.depth,i.update(e),e.children.forEach(s=>Ll(s,t+e.mod,i))}function Nl(e){const t=e.children;let i=0;t.forEach(e=>{Nl(e),e.children.length?i+=e.leafCount:i++}),e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[e.children.length-1].subtreeRight,e.x=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.x,e.subtreeRight=e.x)}function _l(e){const t=new Ol;return Pl(e,1),Ll(e,-e.prelim,t),Nl(e),t}var Ol=class{constructor(){this.dimensions=new kl,this.leafCount=0,this.nodes=[],this.leafNodes=[],this.nonLeafNodes=[],this.depth=0}update(e){this.dimensions.update(e,e=>({x:e.x,y:e.y})),e.children.length?this.nonLeafNodes.push(e):(this.leafCount++,this.leafNodes.push(e)),e.depth>this.depth&&(this.depth=e.depth),this.nodes.push(e)}resize(e,t,i=0,s=0,r=!1){const n=this.leafCount-1,o=this.depth,a=this.dimensions;let l=1,c=1;if(e>0&&n){const t=(a.right-a.left)/n;l=e/n/t,r&&(l=-l)}if(t>0&&o){const e=(a.bottom-a.top)/o;c=t/o/e}const h=new kl;this.nodes.forEach(e=>{e.screenX=e.x*l,e.screenY=e.y*c,h.update(e,e=>({x:e.screenX,y:e.screenY}))});const d=-h.left,u=-h.top;this.nodes.forEach(e=>{e.screenX+=d+i,e.screenY+=u+s})}},Fl=class extends hl{constructor(){super(...arguments),this.grid=!1}};C([jr(Zr)],Fl.prototype,"grid",2);var Gl=class extends Ml{constructor(e){super(e,new zr),this.tickScale=new zr,this.line=new dl,this.label=new Fl,this.labelColor="rgba(87, 87, 87, 1)",this.includeInvisibleDomains=!0;const{tickLineGroup:t,tickLabelGroup:i,gridLineGroup:s,tickScale:r,scale:n}=this;n.paddingOuter=.1,n.paddingInner=2*n.paddingOuter,this.refreshScale(),r.paddingInner=1,r.paddingOuter=0,this.gridLineSelection=Na.select(s,Ga),this.axisLineSelection=Na.select(t,Ga),this.separatorSelection=Na.select(t,Ga),this.labelSelection=Na.select(i,Oo)}updateRange(){const{range:e,visibleRange:t,scale:i}=this,s=(e[1]-e[0])/(t[1]-t[0]),r=s*t[0],n=e[0]-r;this.tickScale.range=i.range=[n,n+s],this.resizeTickTree()}resizeTickTree(){var e;const t=this.scale,i=t.domain.length?[t.convert(t.domain[0]),t.convert(t.domain[t.domain.length-1])]:t.range,s=this.tickTreeLayout,r=this.lineHeight;s&&s.resize(Math.abs(i[1]-i[0]),s.depth*r,(Math.min(i[0],i[1])||0)+(null!=(e=t.bandwidth)?e:0)/2,-s.depth*r,i[1]-i[0]<0)}get lineHeight(){return 1.5*this.label.fontSize}onGridVisibilityChange(){this.gridLineSelection.clear(),this.labelSelection.clear()}createTick(){return new Al}calculateDomain(){var e;const{direction:t}=this;let i=null;const s=this.boundSeries.filter(e=>e.visible).flatMap(e=>{if("y"===t||i)return e.getDomain(t);if(null===i){const s=e.getDomain(t);return i=Ue(s[0]),s}return[]});this.setDomain(null!=(e=as(s))?e:us(s));const{domain:r}=this.dataDomain;this.tickTreeLayout=_l(function(e,t=!0){const i=new Dl;let s=0;return t&&e.forEach(e=>s=Math.max(s,e.labels.length)),e.forEach(e=>{if(t)for(;e.labels.length<s;)e.labels.unshift("");!function(e,t){const i=t.labels.slice().reverse(),s=i.length-1;i.forEach((t,i)=>{const r=e.children,n=r.find(e=>e.label===t),o=i!==s;if(n&&o)e=n;else{const i=new Dl(t,e);i.number=r.length,r.push(i),o&&(e=i)}})}(i,e)}),i}(r)),this.tickScale.domain=r.concat(""),this.resizeTickTree()}update(){this.computedLayout&&(this.updatePosition(),this.updateTitleCaption(),this.updateCategoryLabels(),this.updateSeparators(),this.updateAxisLines(),this.updateCategoryGridLines(),this.resetSelectionNodes())}updateTitleCaption(){const{_titleCaption:e}=this;e.node.visible=!1}updateCategoryLabels(){if(!this.computedLayout)return;const{tickLabelLayout:e}=this.computedLayout;this.labelSelection.update(e).each((e,t)=>{e.setProperties(t)})}updateSeparators(){if(!this.computedLayout)return;const{separatorLayout:e}=this.computedLayout,{range:t}=this;this.separatorSelection.update(e).each((e,i)=>{e.x1=i.x1,e.x2=i.x2,e.y1=i.y,e.y2=i.y,e.visible=i.y>=t[0]-1e-7&&i.y<=t[1]+1e-7,e.stroke=this.tick.color,e.fill=void 0,e.strokeWidth=1})}updateAxisLines(){if(!this.computedLayout)return;const{axisLineLayout:e}=this.computedLayout;this.axisLineSelection.update(e).each((e,t)=>{e.setProperties(f(m({},t),{stroke:this.line.color,strokeWidth:this.line.width})),e.x1=t.x,e.x2=t.x,e.y1=t.y1,e.y2=t.y2,e.strokeWidth=this.line.width,e.stroke=this.line.color})}updateCategoryGridLines(){const{gridLength:e,gridLine:t,label:i,range:s,tickScale:r}=this,n=r.ticks(),o=i.getSideFlag(),a=this.gridLineSelection.update(e?n:[]);if(e){const{width:i,style:n}=t,l=n.length;a.each((t,a,c)=>{const h=Math.round(r.convert(a));t.x1=0,t.x2=-o*e,t.y1=h,t.y2=h,t.visible=h>=s[0]&&h<=s[1];const{stroke:d,lineDash:u}=n[c%l];t.stroke=d,t.strokeWidth=i,t.lineDash=u,t.fill=void 0})}}computeLayout(){this.updateDirection(),this.calculateDomain(),this.updateRange();const{scale:e,label:t,label:{parallel:i},moduleCtx:{callbackCache:s},range:r,title:n,title:{formatter:o=e=>e.defaultValue}={}}=this,a=e.range[0],l=e.range[1],c=Math.abs(l-a)/e.domain.length||0,h=Math.ceil(t.fontSize/c),d=Fr(this.rotation),u=Math.abs(Math.cos(d))<1e-8,p=t.getSideFlag(),g=this.lineHeight,y=this.tickTreeLayout,v=e.ticks(),C=y?y.nodes:[],b=!!y&&y.depth>1,{defaultRotation:S,configuredRotation:w,parallelFlipFlag:x}=Vo({rotation:t.rotation,parallel:i,regularFlipRotation:Lr(d-Math.PI/2),parallelFlipRotation:Lr(d)}),E=[],M=new Map;let A=0;const T=new Oo,D=(e,i)=>{var a;if(T.setProperties({fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textAlign:"center",textBaseline:-1===x?"bottom":"hanging",translationX:e.screenY-.25*t.fontSize,translationY:e.screenX}),0===i){if(!((null==n?void 0:n.enabled)&&v.length>0))return!1;const i=s.call(o,this.getTitleFormatterParams());T.setProperties({fill:n.color,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,text:i,textBaseline:"hanging",translationX:e.screenY-.25*t.fontSize,translationY:e.screenX})}else{if(i%h!==0)return!1;if(!(e.screenX>=r[0]&&e.screenX<=r[1]))return!1;t.formatter?T.text=null!=(a=s.call(t.formatter,{value:String(e.label),index:i}))?a:String(e.label):T.text=String(e.label)}return!0};C.forEach((e,t)=>{if(!D(e,t))return;const i=T.computeTransformedBBox();i&&(M.set(t,i),!e.children.length&&i.width>A&&(A=i.width))});const I=p*t.padding,R=this.label.grid,P=[];C.forEach((e,t)=>{let i=D(e,t);const s=t;T.x=I,T.rotationCenterX=I;const r=!e.children.length;if(r)T.rotation=w,T.textAlign="end",T.textBaseline="middle";else{T.translationX-=A-g+this.label.padding;const t=e.leafCount*c,r=M.get(s);r&&r.width>t?(i=!1,M.delete(s)):T.rotation=u?S:-Math.PI/2}if(e.parent&&b){const t=r?e.screenX-c/2:e.screenX-e.leafCount*c/2;if(r)(e.number!==e.children.length-1||R)&&P.push({y:t,x1:0,x2:-A-2*this.label.padding});else{const i=-A-2*this.label.padding+e.screenY;P.push({y:t,x1:i+g,x2:i})}}let n;if(i){const e=T.computeTransformedBBox();e&&M.set(t,e),n=f(m({},{fill:(o=T).fill,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,rotation:o.rotation,rotationCenterX:o.rotationCenterX,rotationCenterY:o.rotationCenterY,text:o.text,textAlign:o.textAlign,textBaseline:o.textBaseline,translationX:o.translationX,translationY:o.translationY,visible:o.visible,x:o.x,y:o.y}),{visible:i})}else M.delete(t),n={visible:i};var o;E.push(n)});let k=0;P.forEach(e=>k=Math.min(k,e.x2)),P.push({y:Math.max(a,l),x1:0,x2:k});const L=[],N=[];P.forEach(e=>{if(e.y>=r[0]-1e-7&&e.y<=r[1]+1e-7){const{x1:t,x2:i,y:s}=e,r=new Js(Math.min(t,i),s,Math.abs(t-i),0);N.push(r),L.push({x1:t,x2:i,y:s})}});const _=[],O=[],F=y?y.depth+1:1;for(let e=0;e<F;e++){const t=v.length>0&&(0===e||R&&b),i=e>0?-A-2*this.label.padding-(e-1)*g:0,s=new Js(i,Math.min(...r),0,Math.abs(r[1]-r[0]));O.push(s),_.push({x:i,y1:r[0],y2:r[1],visible:t})}return{bbox:(e=>{const t=new nr,{rotation:i,translationX:s,translationY:r,rotationCenterX:n,rotationCenterY:o}=this.getAxisTransform();return nr.updateTransformMatrix(t,1,1,i,s,r,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:n,rotationCenterY:o}),t.transformBBox(e)})(Js.merge([...M.values(),...N,...O])),tickLabelLayout:E,separatorLayout:L,axisLineLayout:_}}calculateLayout(){const{axisLineLayout:e,separatorLayout:t,tickLabelLayout:i,bbox:s}=this.computeLayout();return this.computedLayout={axisLineLayout:e,separatorLayout:t,tickLabelLayout:i},{bbox:s,primaryTickCount:void 0}}};Gl.className="GroupedCategoryAxis",Gl.type="grouped-category",C([jr(mn,{optional:!0})],Gl.prototype,"labelColor",2);var Bl=class e{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:i,height:s,pixelRatio:r,position:n,insertAsFirstChild:o}=t;this.insertAsFirstChild=null!=o&&o,this.pixelRatio=function(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent.match(/\(iPhone; CPU iPhone OS (\d+_\d+_\d+) like Mac OS X\)/);if(null==e)return!1;const[t,i]=e[1].split("_").map(Number);return t<16||16===t&&i<6}()?1:null!=r?r:Ss("devicePixelRatio"),this.element=ws("canvas"),this.element.width=Math.round((null!=i?i:this.width)*this.pixelRatio),this.element.height=Math.round((null!=s?s:this.height)*this.pixelRatio),n&&(this.element.style.position=n),this.context=this.element.getContext("2d"),this.onEnabledChange(),this.resize(null!=i?i:0,null!=s?s:0),e.debugContext(this.context)}static is(t){return t instanceof e}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t){if(!(e>0&&t>0))return;const{element:i,context:s,pixelRatio:r}=this;i.width=Math.round(e*r),i.height=Math.round(t*r),s.setTransform(r,0,0,r,0,0),i.style.width=e+"px",i.style.height=t+"px",this.width=e,this.height=t}snapshot(){}clear(){this.context.save(),this.context.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.context.clearRect(0,0,this.width,this.height),this.context.restore()}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onContainerChange(e,t){var i,s,r,n;e!==t&&(null==(i=this.element.parentNode)||i.removeChild(this.element),this.insertAsFirstChild&&(null==(s=this.container)?void 0:s.firstChild)?null==(r=this.container)||r.insertBefore(this.element,this.container.firstChild):null==(n=this.container)||n.appendChild(this.element))}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"block":"none")}static debugContext(e){if(Ds.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(0===s)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(0!==s)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}};C([Xa(e=>e.onEnabledChange())],Bl.prototype,"enabled",2),C([Xa((e,t,i)=>e.onContainerChange(t,i))],Bl.prototype,"container",2);var Vl=Bl,Hl=class e{constructor(e,t){this.canvas=e,this.markDirty=t,this.debug=Ds.create(!0,"scene"),this.layersMap=new Map,this.nextZIndex=0,this.nextLayerId=0}static sortLayers(e,t){var i,s;return So([e.zIndex,...null!=(i=e.zIndexSubOrder)?i:[void 0,void 0],e.id],[t.zIndex,...null!=(s=t.zIndexSubOrder)?s:[void 0,void 0],t.id],Co)}get size(){return this.layersMap.size}forEach(t){Array.from(this.layersMap.values()).sort(e.sortLayers).forEach(t)}resize(e,t){this.canvas.resize(e,t),this.layersMap.forEach(({canvas:i})=>i.resize(e,t))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{zIndex:r=this.nextZIndex++,name:n,zIndexSubOrder:o,getComputedOpacity:a,getVisibility:l}=e,c=new Vl({width:t,height:i,pixelRatio:s,position:"absolute"}),h={id:this.nextLayerId++,name:n,canvas:c,zIndex:r,zIndexSubOrder:o,getComputedOpacity:a,getVisibility:l};return r>=this.nextZIndex&&(this.nextZIndex=r+1),this.layersMap.set(c,h),this.debug("Scene.addLayer() - layers",this.layersMap),h.canvas}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.markDirty(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}moveLayer(e,t,i){const s=this.layersMap.get(e);s&&(s.zIndex=t,s.zIndexSubOrder=i,this.markDirty(),this.debug("Scene.moveLayer() -  layers",this.layersMap))}clear(){this.layersMap.clear()}};function Ul(e,t,i,s,r={}){if(!Ds.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:n=0,layersSkipped:o=0,nodesRendered:a=0,nodesSkipped:l=0}=null!=s?s:{},c=performance.now(),h=t,{start:d}=h,u=y(h,["start"]),p=Object.entries(u).map(([e,t])=>Kl(e,t)).filter(e=>null!=e).join(" + "),g=Object.entries(r).map(([e,t])=>`${e}: ${t}`).join(" ; "),m=Ds.check("scene:stats:verbose"),f=[`${Kl("⏱️",d,c)} (${p})`,`${g}`,`Layers: ${m?jl(n,o):e.size}`,m?`Nodes: ${jl(a,l)}`:null].filter(He),v=new Map(f.map(e=>[e,Oo.getTextSize(e,i.font)])),C=Math.max(...Array.from(v.values(),e=>e.width)),b=function(e,t){let i=0;for(const s of e)i+=t(s);return i}(v.values(),e=>e.height);i.save(),i.fillStyle="white",i.fillRect(0,0,C,b),i.fillStyle="black";let S=0;for(const[e,t]of v.entries())S+=t.height,i.fillText(e,2,S);i.restore()}function zl(e){var t,i;return Ds.check(!0,"scene")?m(m({node:e,name:null!=(t=e instanceof xo?e.name:null)?t:e.id,dirty:er[e.dirty]},(null==(i=e.parent)?void 0:i.isVirtual)?{virtualParentDirty:er[e.parent.dirty],virtualParent:e.parent}:{}),e.children.map(e=>zl(e)).reduce((e,t)=>{let{name:i}=t;const{node:{visible:s,opacity:r,zIndex:n,zIndexSubOrder:o},node:a,virtualParent:l}=t;(!s||r<=0)&&(i=`(${i})`),a instanceof xo&&a.isLayer()&&(i=`*${i}*`);const c=[`${null!=i?i:"<unknown>"}`,`z: ${n}`,o&&`zo: ${o.map(e=>"function"==typeof e?`${e()} (fn)`:e).join(" / ")}`,l&&"(virtual parent)"].filter(e=>!!e).join(" ");let h=c,d=1;for(;null!=e[h]&&d<100;)h=`${c} (${d++})`;return e[h]=t,e},{})):{}}function Wl(e){var t;if(0===e.dirty)return{dirtyTree:{},paths:[]};const i=e.children.map(e=>Wl(e)).filter(e=>e.paths.length>0),s=xo.is(e)&&null!=(t=e.name)?t:e.id,r=i.length?i.flatMap(e=>e.paths).map(e=>`${s}.${e}`):[s];return{dirtyTree:m({name:s,node:e,dirty:er[e.dirty]},i.map(e=>e.dirtyTree).filter(e=>null!=e.dirty).reduce((e,t)=>{var i;return e[null!=(i=t.name)?i:"<unknown>"]=t,e},{})),paths:r}}function jl(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function Kl(e,t,i){const s=null!=i?i-t:t;return`${e}: ${Math.round(100*s)/100}ms`}var $l=class{constructor({width:e,height:t,pixelRatio:i,canvasPosition:s}){this.debug=Ds.create(!0,"scene"),this.id=Fs(this),this.root=null,this.isDirty=!1,this.canvas=new Vl({width:e,height:t,pixelRatio:i,position:s,insertAsFirstChild:"absolute"===s}),this.layersManager=new Hl(this.canvas,()=>{this.isDirty=!0})}get width(){var e,t;return null!=(t=null==(e=this.pendingSize)?void 0:e[0])?t:this.canvas.width}get height(){var e,t;return null!=(t=null==(e=this.pendingSize)?void 0:e[1])?t:this.canvas.height}setContainer(e){return this.canvas.container=e,this}setRoot(e){var t;return this.root===e||(this.isDirty=!0,null==(t=this.root)||t._setLayerManager(),this.root=e,e&&(e.visible=!0,e._setLayerManager(this.layersManager))),this}attachNode(e){var t;return null==(t=this.root)||t.appendChild(e),()=>this.removeChild(e)}appendChild(e){var t;return null==(t=this.root)||t.appendChild(e),this}removeChild(e){var t;return null==(t=this.root)||t.removeChild(e),this}download(e,t){var i;xs(this.canvas.toDataURL(t),null!=(i=null==e?void 0:e.trim())?i:"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t){return e=Math.round(e),t=Math.round(t),e>0&&t>0&&(e!==this.width||t!==this.height)&&(this.pendingSize=[e,t],this.isDirty=!0,!0)}render(e){return S(this,null,function*(){var t,i;const{debugSplitTimes:s={start:performance.now()},extraDebugStats:r}=null!=e?e:{},{canvas:n,canvas:{context:o}={},root:a,pendingSize:l}=this;if(!o)return;const c=performance.now();if(l&&(this.layersManager.resize(...l),this.pendingSize=void 0),a&&!a.visible)return void(this.isDirty=!1);if(a&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{redrawType:er[a.dirty],tree:zl(a)}),void Ul(this.layersManager,s,o,void 0,r);const h={ctx:o,devicePixelRatio:null!=(t=this.canvas.pixelRatio)?t:1,forceRender:!0,resized:Boolean(l),debugNodes:{}};Ds.check("scene:stats:verbose")&&(h.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0});let d=!1;if((!a||a.dirty>=1)&&(d=!0,n.clear()),a&&Ds.check("scene:dirtyTree")){const{dirtyTree:e,paths:t}=Wl(a);Ds.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:e,paths:t})}if(a&&d&&(this.debug("Scene.render() - before",{redrawType:er[a.dirty],canvasCleared:d,tree:zl(a)}),a.visible&&(a.preRender(),o.save(),a.render(h),o.restore())),s["✍️"]=performance.now()-c,this.layersManager.size&&d){const e=performance.now();o.save(),o.resetTransform(),this.layersManager.forEach(e=>{e.canvas.enabled&&e.getVisibility()&&(o.globalAlpha=e.getComputedOpacity(),e.canvas.drawImage(o))}),o.restore(),s["⛙"]=performance.now()-e}null==(i=o.verifyDepthZero)||i.call(o),this.isDirty=!1,Ul(this.layersManager,s,o,h.stats,r),function(e,t){e.save();for(const[i,s]of Object.entries(t)){const t=s.computeTransformedBBox();t?(e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(t.x,t.y,t.width,t.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,t.x,t.y,t.width),e.fillText(i,t.x,t.y,t.width)):N.log(`Scene.render() - no bbox for debugged node [${i}].`)}e.restore()}(o,h.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{redrawType:er[a.dirty],tree:zl(a),canvasCleared:d})})}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.canvas.container=void 0,this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};function Yl(e){return new Promise(t=>{setTimeout(()=>t(void 0),e)})}$l.className="Scene";var ql=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(e=>N.errorOnce(e))})}acquireImmediately(e){return S(this,null,function*(){return!!this.available&&(yield this.acquire(e),!0)})}waitForClearAcquireQueue(){return S(this,null,function*(){return this.acquire(()=>S(this,null,function*(){}))})}dispatchNext(){return S(this,null,function*(){var e,t;this.available=!1;let[i,s]=null!=(e=this.acquireQueue.shift())?e:[];for(;i;){try{yield i(),null==s||s()}catch(e){N.error("mutex callback error",e),null==s||s()}[i,s]=null!=(t=this.acquireQueue.shift())?t:[]}this.available=!0})}},Xl=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if("function"!=typeof t)throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){var i;null==(i=this.eventListeners.get(e))||i.delete(t),0===this.eventListeners.size&&this.eventListeners.delete(e)}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){var t;null==(t=this.eventListeners.get(e.type))||t.forEach(t=>t(e))}},Zl=class extends yt{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}clear(){this.top=this.right=this.bottom=this.left=0}};function Ql(e,t){let i,s,r=0,n=!1;const o=()=>n,a=()=>{n=!1,null==s||s(),s=void 0,i=void 0,r>0&&e(l)},l=()=>{const e=r;r=0,n=!0;const i=t({count:e});i?i.then(a,a):a()};return{schedule(t){0!==r||o()||e(l,t),r++},await(){return S(this,null,function*(){if(o())for(null==i&&(i=new Promise(e=>{s=e}));o();)yield i})}}}C([jr(sn)],Zl.prototype,"top",2),C([jr(sn)],Zl.prototype,"right",2),C([jr(sn)],Zl.prototype,"bottom",2),C([jr(sn)],Zl.prototype,"left",2);var Jl=class{constructor(){var e;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,t])=>this.observe(e,t)),this.queuedObserveRequests=[]},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:t,contentRect:i}of e){const{width:e,height:s}=i;this.checkSize(this.elements.get(t),t,e,s)}}),this.documentReady="complete"===bs("readyState"),this.documentReady||null==(e=Ss())||e.addEventListener("load",this.onLoad))}destroy(){var e,t;null==(e=Ss())||e.removeEventListener("load",this.onLoad),null==(t=this.resizeObserver)||t.disconnect(),this.resizeObserver=null}checkSize(e,t,i,s){var r,n;e&&(i===(null==(r=e.size)?void 0:r.width)&&s===(null==(n=e.size)?void 0:n.height)||(e.size={width:i,height:s},e.cb(e.size,t)))}observe(e,t){var i;this.documentReady?(this.elements.has(e)?this.removeFromQueue(e):null==(i=this.resizeObserver)||i.observe(e),this.elements.set(e,{cb:t})):this.queuedObserveRequests.push([e,t])}unobserve(e){var t;null==(t=this.resizeObserver)||t.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},ec=class{constructor(){this.cache=new WeakMap}call(e,...t){let i,s=this.cache.get(e);const r=()=>{try{const r=e(...t);return s&&null!=i&&s.set(i,r),r}catch(e){return void N.warnOnce("User callback errored, ignoring",e)}};try{i=JSON.stringify(t)}catch(e){return r()}return null==s&&(s=new Map,this.cache.set(e,s)),s.has(i)?s.get(i):r()}invalidateCache(){this.cache=new WeakMap}},tc=class{constructor(e){this.annotationRoot=e}attachNode(e){return this.annotationRoot.append(e),()=>{var t;return null==(t=this.annotationRoot)||t.removeChild(e),this}}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){var t;return null==(t=this.styles)?void 0:t[e]}},ic=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(t=>t.symbol===e);if(s>=0){i.splice(s,1),0===i.length&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(e){N.errorOnce(e)}}dispatchWrapHandlers(e,t,...i){for(const s of this.getListenersByType(e))try{t(s.handler,...i)}catch(e){N.errorOnce(e)}}getListenersByType(e){var t;return null!=(t=this.registeredListeners.get(e))?t:[]}destroy(){this.registeredListeners.clear()}},sc=class extends ic{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=Ds.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){"function"==typeof e&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return L(e=>this.fetch(e),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return L((e,t)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:t})},e,{leading:!0,trailing:!0})}fetch(e){return S(this,null,function*(){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;let s;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{s=yield this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(e){this.debug(`DataService - request failed | ${i}`),N.errorOnce(`DataService - request failed | [${e}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.findIndex(e=>e===i);-1===r||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(r+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error"))})}};C([qa({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],sc.prototype,"dispatchThrottle",2),C([qa({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],sc.prototype,"requestThrottle",2);var rc=class{constructor(e){this.maxAnimationTime=e,this.debug=Ds.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(xr.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){var e;return null!=(e=this.phases.get(xr[this.currentPhase]))?e:[]}checkOverlappingId(e){null!=e&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){var t;if(!e.isComplete)return xr.indexOf(e.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",e.id),void e.stop()):(this.controllers.set(e.id,e),void(null==(t=this.phases.get(e.phase))||t.push(e)))}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=null==t?void 0:t.indexOf(e);null!=i&&i>=0&&(null==t||t.splice(i,1))}progress(e){if(!this.isReady)return;let t=0===e?.01:e;const i=()=>{const e=xr[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:e,phaseMeta:Er[e]}};let{phase:s,phaseControllers:r,phaseMeta:n}=i();const o=()=>null==xr[this.currentPhase],a=()=>{for(({phase:s,phaseControllers:r,phaseMeta:n}=i());!o()&&0===r.length;)this.currentPhase++,({phase:s,phaseControllers:r,phaseMeta:n}=i()),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},r)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${null==r?void 0:r.length} of ${l}`);do{const e=t,i=n.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let s=0;for(const n of r)i?n.stop():t=Math.min(n.update(e),t),n.isComplete&&(s++,this.removeAnimation(n));this.animationTimeConsumed+=e-t,this.debug(`AnimationBatch - updated ${r.length} controllers; ${s} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(N.warnOnce("Animation batch exceeded max animation time, skipping.",new Map(this.controllers.entries())),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&!0!==Er[t.phase].skipIfNoEarlierAnimations){e=!1;break}if(!e)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(e=!0){if(!1===this.skipAnimations&&!0===e){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}pause(){for(const e of this.controllers.values())e.pause()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(e){N.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(e){if(null!=e&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},nc=class{constructor(){this.listeners=new ic,this.destroyFns=[]}addListener(e,t){return this.listeners.addListener(e,t)}removeListener(e){this.listeners.removeListener(e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e())}};function oc(e){const t=f(m({},e),{consumed:!1,consume(){var i,s;t.consumed=!0,e.sourceEvent instanceof Event?null==(i=e.sourceEvent)||i.preventDefault():null==(s=e.sourceEvent)||s.consume()}});return t}function ac(e,t,i){e.dispatchWrapHandlers(t,(e,t)=>{t.consumed||e(t)},i)}var lc=["click","dblclick","contextmenu","hover","drag-start","drag","drag-end","leave","enter","page-left","wheel"],cc=["blur","focus"],hc=["keydown","keyup"],dc=["pagehide","mousemove","mouseup"],uc=["click","dblclick","contextmenu","mousedown","mouseout","mouseenter","touchstart","touchmove","touchend","touchcancel","wheel","blur","focus","keydown","keyup"],pc=(e=>(e[e.Default=16]="Default",e[e.ZoomDrag=8]="ZoomDrag",e[e.Annotations=4]="Annotations",e[e.ContextMenu=2]="ContextMenu",e[e.Animation=1]="Animation",e[e.All=31]="All",e))(pc||{}),gc=class e extends nc{constructor(e,t){super(),this.keyboardOptions=e,this.debug=Ds.create(!0,"interaction"),this.eventHandler=e=>this.processEvent(e),this.mouseDown=!1,this.touchDown=!1,this.clickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.dblclickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"},{offsetX:NaN,offsetY:NaN,type:"mouseup"},{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.stateQueue=17,this.rootElement=bs("body"),this.element=t;for(const e of uc)e.startsWith("touch")?t.addEventListener(e,this.eventHandler,{passive:!0}):"wheel"===e?t.addEventListener(e,this.eventHandler,{passive:!1}):t.addEventListener(e,this.eventHandler);for(const e of dc)Ss().addEventListener(e,this.eventHandler);Es("\n.ag-chart-wrapper {\n    touch-action: none;\n}\n","interactionManager")}destroy(){super.destroy();for(const e of dc)Ss().removeEventListener(e,this.eventHandler);for(const e of uc)this.element.removeEventListener(e,this.eventHandler)}addListener(e,t,i=16){return super.addListener(e,e=>{this.getState()&i&&t(e)})}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}getState(){return this.stateQueue&-this.stateQueue}processEvent(e){const t=this.decideInteractionEventTypes(e);t.length>0&&this.dispatchEvent(e,t).catch(e=>N.errorOnce(e))}dispatchEvent(e,t){return S(this,null,function*(){if(ys(lc,t))this.dispatchPointerEvent(e,t);else if(ys(cc,t))for(const i of t)ac(this.listeners,i,oc({type:i,sourceEvent:e}));else if(ys(hc,t))for(const i of t)ac(this.listeners,i,oc({type:i,sourceEvent:e}))})}dispatchPointerEvent(e,t){const i=this.calculateCoordinates(e);if(null!=i)for(const s of t)ac(this.listeners,s,this.buildPointerEvent(m({type:s,event:e},i)))}recordDown(e){e instanceof MouseEvent&&(it(["offsetX","offsetY"],this.clickHistory[0],e),it(["offsetX","offsetY"],this.dblclickHistory[2],this.dblclickHistory[0]),it(["offsetX","offsetY"],this.dblclickHistory[0],e)),this.dragStartElement=e.target}recordUp(e){e instanceof MouseEvent&&it(["offsetX","offsetY"],this.dblclickHistory[1],e),this.dragStartElement=void 0}decideInteractionEventTypes(e){const t="drag-start";switch(e.type){case"blur":case"focus":case"keydown":case"keyup":return this.keyboardOptions.enabled?[e.type]:[];case"click":case"dblclick":case"contextmenu":case"wheel":return[e.type];case"mousedown":return this.isEventOverElement(e)?(this.mouseDown=!0,this.recordDown(e),[t]):[];case"touchstart":return this.isEventOverElement(e)?(this.touchDown=!0,this.recordDown(e),[t]):[];case"touchmove":case"mousemove":return this.mouseDown||this.touchDown||this.isEventOverElement(e)?this.mouseDown||this.touchDown?["drag"]:["hover"]:[];case"mouseup":return this.mouseDown||this.isEventOverElement(e)?(this.mouseDown=!1,this.recordUp(e),["drag-end"]):[];case"touchend":return this.touchDown||this.isEventOverElement(e)?(this.touchDown=!1,this.recordUp(e),["drag-end"]):[];case"mouseout":case"touchcancel":return["leave"];case"mouseenter":const i=e instanceof MouseEvent&&!(1&~e.buttons);return this.mouseDown!==i?(this.mouseDown=i,[i?t:"drag-end"]):["enter"];case"pagehide":return["page-left"]}return[]}isEventOverElement(e){var t,i,s;return e.target===this.element||(null==(t=e.target)?void 0:t.parentElement)===this.element||(null==(s=null==(i=e.target)?void 0:i.parentElement)?void 0:s.parentElement)===this.element}calculateCoordinates(t){var i;if(t instanceof MouseEvent)return this.getMouseEventCoords(t);if("undefined"!=typeof TouchEvent&&t instanceof TouchEvent){const s=null!=(i=t.touches[0])?i:t.changedTouches[0],{clientX:r,clientY:n,pageX:o,pageY:a}=s;return f(m({},e.NULL_COORDS),{clientX:r,clientY:n,pageX:o,pageY:a})}if(t instanceof PageTransitionEvent){if(t.persisted)return;return e.NULL_COORDS}}getMouseEventCoords(e){const{clientX:t,clientY:i,pageX:s,pageY:r}=e;let{offsetX:n,offsetY:o}=e;const a=e=>{let t=0,i=0;for(;e;)t+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{x:t,y:i}};if(null!=this.dragStartElement&&e.target!==this.dragStartElement){const t=a(this.dragStartElement),i=a(e.target);n-=t.x-i.x,o-=t.y-i.y}return{clientX:t,clientY:i,pageX:s,pageY:r,offsetX:n,offsetY:o}}isWheelEvent(e){return"wheel"===e.type}buildPointerEvent(e){const{type:t,event:i,clientX:s,clientY:r}=e;let{offsetX:n,offsetY:o,pageX:a,pageY:l}=e;if(!ze(n)||!ze(o)){const e=this.element.getBoundingClientRect();n=s-e.left,o=r-e.top}if(!ze(a)||!ze(l)){const e=this.rootElement.getBoundingClientRect();a=s-e.left,l=r-e.top}let[c,h]=[NaN,NaN];if(this.isWheelEvent(i)){const e=0===i.deltaMode?.01:1;c=i.deltaX*e,h=i.deltaY*e}let d=[];"click"===i.type?d=this.clickHistory:"dblclick"===i.type&&(d=this.dblclickHistory);const u=oc({type:t,offsetX:n,offsetY:o,pageX:a,pageY:l,deltaX:c,deltaY:h,pointerHistory:d,sourceEvent:i});return this.debug("InteractionManager - builtEvent: ",u),u}};gc.NULL_COORDS={clientX:-1/0,clientY:-1/0,pageX:-1/0,pageY:-1/0,offsetX:-1/0,offsetY:-1/0};var mc=gc;function fc(e){return null==e||!isNaN(e)&&e>=0&&e<=2}var yc=class extends nc{constructor(e,t){super(),this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new rc(1.5*this.defaultDuration),this.debug=Ds.create(!0,"animation"),this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!1,this.requestId=null,this.skipAnimations=!1}animate(e){var t,i=y(e,[]);const s=this.batch;try{s.checkOverlappingId(i.id)}catch(e){return void this.failsafeOnError(e)}const r=null!=(t=i.id)?t:Math.random().toString(),n=this.isSkipped()||"none"===i.phase;n&&this.debug("AnimationManager - skipping animation");const{delay:o,duration:a}=i;if(!fc(o))throw new Error(`Animation delay of ${o} is unsupported (${r})`);if(!fc(a))throw new Error(`Animation duration of ${a} is unsupported (${r})`);const l=new Tr(f(m({},i),{id:r,skip:n,autoplay:!!this.isPlaying&&i.autoplay,phase:i.phase,defaultDuration:this.defaultDuration}));if(!this.forceTimeJump(l,this.defaultDuration))return this.batch.addAnimation(l),l}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}pause(){if(this.isPlaying){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.pause()");try{this.batch.pause()}catch(e){this.failsafeOnError(e)}}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:(new Error).stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=requestAnimationFrame(e)}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let e;const t=i=>S(this,null,function*(){const s=()=>S(this,null,function*(){const t=i-(null!=e?e:i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:t}),this.interactionManager.pushState(1);try{this.batch.progress(t)}catch(e){this.failsafeOnError(e)}this.listeners.dispatch("animation-frame",{type:"animation-frame",deltaMs:t})});this.isSkippingFrames()?yield this.chartUpdateMutex.acquireImmediately(s):yield this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.listeners.dispatch("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))});this.listeners.dispatch("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){N.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.stop(),this.batch.destroy(),this.batch=new rc(1.5*this.defaultDuration),!0===e&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(1),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}},vc=class e{constructor(t){this.canvas=t,this.debug=Ds.create(!0,"aria"),this.canvas.appendChild(this.liveElem=e.createAnnouncer())}static createAnnouncer(){const e=bs().createElement("div");return e.classList.add("ag-charts-aria-announcer"),Za(e,"role","status"),Za(e,"aria-live","assertive"),e}destroy(){this.canvas.removeChild(this.liveElem)}announceValue(e){this.debug(`AriaAnnouncementService - announceValue: ${e}`),this.liveElem.textContent=e}},Cc=class extends nc{legendItemClick(e,t,i,s){const r={type:"legend-item-click",series:e,itemId:t,enabled:i,legendItemName:s};this.listeners.dispatch("legend-item-click",r)}legendItemDoubleClick(e,t,i,s,r){const n={type:"legend-item-double-click",series:e,itemId:t,enabled:i,legendItemName:r,numVisibleItems:s};this.listeners.dispatch("legend-item-double-click",n)}axisHover(e,t){const i={type:"axis-hover",axisId:e,direction:t};this.listeners.dispatch("axis-hover",i)}},bc=class{constructor(){this.defaultActions=[],this.disabledActions=new Set}copyDefaultActions(){return[...this.defaultActions]}registerDefaultAction(e){e.id&&this.defaultActions.find(({id:t})=>t===e.id)||this.defaultActions.push(e)}enableAction(e){this.disabledActions.delete(e)}disableAction(e){this.disabledActions.add(e)}isDisabled(e){return this.disabledActions.has(e)}},Sc=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),void 0!==t&&super.set(e,t),this}stateId(){var e;return null!=(e=Array.from(this.keys()).pop())?e:this.defaultState}stateValue(){var e;return null!=(e=Array.from(this.values()).pop())?e:this.defaultValue}},wc=class{constructor(e){this.element=e,this.stateTracker=new Sc("default")}updateCursor(e,t){this.stateTracker.set(e,t),this.element.style.cursor=this.stateTracker.stateValue()}getCursor(){return this.element.style.cursor}};function xc(e,t){return Math.sqrt(function(e,t){const i=e.screenX-t.screenX,s=e.screenY-t.screenY;return i*i+s*s}(e,t))}var Ec=class extends nc{constructor(e){super(),this.touchstart=e=>this.onTouchStart(e),this.touchmove=e=>this.onTouchMove(e),this.touchend=e=>this.onTouchEnd(e),this.touchcancel=e=>this.onTouchCancel(e),this.pinch={finger1:{identifier:NaN,screenX:NaN,screenY:NaN},finger2:{identifier:NaN,screenX:NaN,screenY:NaN},origin:{x:NaN,y:NaN},distance:NaN,status:0},this.element=e,e.addEventListener("touchstart",this.touchstart,{passive:!0}),e.addEventListener("touchmove",this.touchmove,{passive:!0}),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel)}destroy(){const{element:e}=this;e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel)}findPinchTouches(e){const{touches:t}=e,{finger1:i,finger2:s}=this.pinch;if(0!==this.pinch.status&&2===t.length){if(t[0].identifier===i.identifier&&t[1].identifier===s.identifier)return[t[0],t[1]];if(t[0].identifier===s.identifier&&t[1].identifier===i.identifier)return[t[1],t[0]]}}copyTouchData(e){const t=["identifier","screenX","screenY"];it(t,this.pinch.finger1,e.touches[0]),it(t,this.pinch.finger2,e.touches[1]),this.pinch.distance=xc(this.pinch.finger1,this.pinch.finger2)}dispatchPinchEvent(e,t){const{finger1:i,finger2:s,origin:r}=this.pinch,n={type:e,finger1:i,finger2:s,deltaDistance:t,origin:r};this.listeners.dispatch(e,n)}onTouchStart(e){this.stopPinchTracking();const{pinch:t}=this;2===e.touches.length&&(t.status=1,this.copyTouchData(e),t.origin.x=(e.touches[0].clientX+e.touches[1].clientX)/2,t.origin.y=(e.touches[0].clientY+e.touches[1].clientY)/2)}onTouchMove(e){const t=this.findPinchTouches(e);if(void 0!==t){const[i,s]=t,{pinch:r}=this,n=xc(i,s),o=n-r.distance;1===r.status?Math.abs(o)>1&&(r.status=2,this.copyTouchData(e),this.dispatchPinchEvent("pinch-start",0)):2===r.status?(r.distance=n,this.copyTouchData(e),this.dispatchPinchEvent("pinch-move",o)):N.error(`unexpected pinch.status: ${r.status}`)}}onTouchEnd(e){this.stopPinchTracking()}onTouchCancel(e){this.stopPinchTracking()}stopPinchTracking(){const{pinch:e}=this;2===e.status&&this.dispatchPinchEvent("pinch-end",0),this.pinch.status=0}},Mc=class extends nc{constructor(){super(...arguments),this.highlightStates=new Sc,this.pickedStates=new Sc}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i})}getActiveHighlight(){return this.activeHighlight}updatePicked(e,t){this.pickedStates.set(e,t),this.activePicked=this.pickedStates.stateValue()}getActivePicked(){return this.activePicked}isEqual(e,t){return e===t||(null==e?void 0:e.series)===(null==t?void 0:t.series)&&(null==e?void 0:e.itemId)===(null==t?void 0:t.itemId)&&(null==e?void 0:e.datum)===(null==t?void 0:t.datum)}},Ac=class extends nc{constructor(e){super(),this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.isClicking=!1,this.destroyFns.push(e.addListener("drag-start",e=>this.onClickStart(e),31),e.addListener("click",e=>this.onClickStop(e),31),e.addListener("drag-end",e=>this.onClickStop(e),31),e.addListener("wheel",e=>this.mouseBlur(e)),e.addListener("hover",e=>this.mouseBlur(e)),e.addListener("drag",e=>this.mouseBlur(e)),e.addListener("blur",e=>this.onBlur(e),31),e.addListener("focus",e=>this.onFocus(e),31),e.addListener("keydown",e=>this.onKeyDown(e),31))}destroy(){super.destroy()}onClickStart(e){this.isClicking=!0,this.mouseBlur(e)}onClickStop(e){this.isClicking=!1,this.mouseBlur(e)}mouseBlur(e){this.hasBrowserFocus&&(this.isMouseBlurred||(this.dispatch("blur",0,e),this.isMouseBlurred=!0))}onBlur(e){this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.dispatch("blur",0,e)}onFocus(e){this.hasBrowserFocus=!0,this.isClicking?this.isMouseBlurred=!0:(this.dispatch("browserfocus",1,e),this.dispatch("tab",0,e))}onKeyDown(e){if(this.hasBrowserFocus&&!this.isClicking)switch(this.isMouseBlurred=!1,e.sourceEvent.code){case"Tab":return e.sourceEvent.shiftKey?this.dispatch("tab",-1,e):this.dispatch("tab",1,e);case"ArrowDown":return this.dispatch("nav-vert",1,e);case"ArrowUp":return this.dispatch("nav-vert",-1,e);case"ArrowLeft":return this.dispatch("nav-hori",-1,e);case"ArrowRight":return this.dispatch("nav-hori",1,e);case"Space":case"Enter":return this.dispatch("submit",0,e)}}dispatch(e,t,i){const s=oc({type:e,delta:t,sourceEvent:i});ac(this.listeners,e,s)}},Tc={};v(Tc,{block:()=>Dc,css:()=>Pc,elements:()=>Ic,modifiers:()=>Rc});var Dc="ag-charts-focus",Ic={wrapper:`${Dc}__wrapper`,indicator:`${Dc}__indicator`},Rc={hidden:`${Dc}--hidden`},Pc=`\n.${Dc}.${Ic.wrapper} {\n    position: relative;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    overflow: hidden;\n    top: 0;\n    left: 0;\n}\n\n.${Dc}.${Ic.indicator} {\n    position: absolute;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    border: var(--ag-charts-focus-border);\n    box-shadow: var(--ag-charts-focus-border-shadow);\n}\n\n.${Rc.hidden} {\n    visibility: hidden;\n}\n`,kc=["series","legend"],Lc=class extends ic{},Nc=class{constructor(e,t,i,s){this.interactionManager=e,this.keyNavManager=t,this.canvasElement=i,this.currentTabIndex=0,this.isDragging=!1,this.leftCanvas=!1,this.regions=new Map,this.destroyFns=[],this.destroyFns.push(...lc.map(t=>e.addListener(t,this.processPointerEvent.bind(this),31)),this.keyNavManager.addListener("blur",this.onNav.bind(this)),this.keyNavManager.addListener("browserfocus",this.onFocus.bind(this)),this.keyNavManager.addListener("tab",this.onTab.bind(this)),this.keyNavManager.addListener("nav-vert",this.onNav.bind(this)),this.keyNavManager.addListener("nav-hori",this.onNav.bind(this)),this.keyNavManager.addListener("submit",this.onNav.bind(this))),Es(Pc,Dc),this.focusWrapper=bs().createElement("div"),this.focusIndicator=bs().createElement("div"),this.focusWrapper.appendChild(this.focusIndicator),s.appendChild(this.focusWrapper);const{block:r,elements:n,modifiers:o}=Tc;this.focusWrapper.classList.add(r,n.wrapper),this.focusIndicator.classList.add(r,n.indicator,o.hidden)}destroy(){this.destroyFns.forEach(e=>e()),this.currentRegion=void 0;for(const e of this.regions.values())e.listeners.destroy();this.focusWrapper.remove(),this.regions.clear()}addRegionFromProperties(e){const t={properties:e,listeners:new Lc};return this.regions.set(e.name,t),this.makeObserver(t)}addRegion(e,t,...i){return this.addRegionFromProperties({name:e,bboxproviders:[t,...i],canInteraction:()=>!0})}getRegion(e){return this.makeObserver(this.regions.get(e))}find(e,t){const i=[];for(const[s,r]of this.regions.entries())for(const s of r.properties.bboxproviders){const n=s.getCachedBBox();n.containsPoint(e,t)&&i.push([r,n.width*n.height])}return i.sort((e,t)=>e[1]-t[1]).map(e=>e[0])}makeObserver(e){const{interactionManager:t}=this;return new class{addListener(i,s,r=16){var n;return null!=(n=null==e?void 0:e.listeners.addListener(i,e=>{e.consumed||t.getState()&r&&s(e)}))?n:()=>{}}}}checkPointerHistory(e,t){for(const i of t.pointerHistory){const t=this.pickRegion(i.offsetX,i.offsetY);if(e.properties.name!==(null==t?void 0:t.properties.name))return!1}return!0}dispatch(e,t){null==e||e.listeners.dispatch(t.type,t)}handleDragging(e){const{currentRegion:t}=this;switch(e.type){case"drag-start":this.isDragging=!0,this.leftCanvas=!1;break;case"leave":return this.leftCanvas=!0,this.isDragging;case"enter":return this.leftCanvas=!1,this.isDragging;case"drag":if(this.isDragging)return this.dispatch(t,e),!0;break;case"drag-end":if(this.isDragging)return this.isDragging=!1,this.dispatch(t,e),this.leftCanvas&&this.dispatch(t,f(m({},e),{type:"leave"})),!0}return!1}processPointerEvent(e){if(this.handleDragging(e))return;const{currentRegion:t}=this,i=this.pickRegion(e.offsetX,e.offsetY);void 0!==t&&(null==i?void 0:i.properties.name)!==t.properties.name&&this.dispatch(t,f(m({},e),{type:"leave"})),void 0!==i&&i.properties.name!==(null==t?void 0:t.properties.name)&&this.dispatch(i,f(m({},e),{type:"enter"})),void 0!==i&&this.checkPointerHistory(i,e)&&this.dispatch(i,e),this.currentRegion=i}pickRegion(e,t){const i=this.find(e,t);return i.length>0?i[0]:void 0}getTabRegion(e){if(void 0!==e&&e>=0&&e<kc.length)return this.regions.get(kc[e])}dispatchTabStart(e){const{delta:t,sourceEvent:i}=e,s=oc({type:"tab-start",delta:t,sourceEvent:i}),r=this.getTabRegion(this.currentTabIndex);return this.dispatch(r,s),!!s.consumed}getNextInteractableTabIndex(e,t){const i=t<0?-1:1;let s=e;for(;0!==t;){const e=this.getTabRegion(s+i);if(void 0===e)return;e.properties.canInteraction()&&(t-=i),s+=i}return s}validateCurrentTabIndex(){var e;const t=this.getTabRegion(this.currentTabIndex);void 0===t||t.properties.canInteraction()||(this.currentTabIndex=null!=(e=this.getNextInteractableTabIndex(-1,1))?e:0)}onFocus(e){const{delta:t,sourceEvent:i}=e,s=t>0?this.getNextInteractableTabIndex(-1,1):this.getNextInteractableTabIndex(kc.length,-1);this.currentTabIndex=null!=s?s:0;const r=this.getTabRegion(this.currentTabIndex);r&&this.dispatch(r,oc({type:"tab",delta:t,sourceEvent:i}))}onTab(e){if(this.dispatchTabStart(e))return;this.validateCurrentTabIndex();const t=this.getNextInteractableTabIndex(this.currentTabIndex,e.delta),i=this.getTabRegion(t),s=this.getTabRegion(this.currentTabIndex);if(void 0!==t&&(this.currentTabIndex=t),void 0!==s&&(null==i?void 0:i.properties.name)!==s.properties.name){const{delta:t,sourceEvent:i}=e,r=oc({type:"blur",delta:t,sourceEvent:i});this.dispatch(s,r)}void 0!==i&&i.properties.canInteraction()?this.dispatch(i,e):this.updateFocusIndicatorRect(void 0)}onNav(e){const t=this.getTabRegion(this.currentTabIndex);this.dispatch(t,e)}updateFocusWrapperRect(){this.focusWrapper.style.width=this.canvasElement.style.width,this.focusWrapper.style.height=this.canvasElement.style.height}updateFocusIndicatorRect(e){null!=e?(this.updateFocusWrapperRect(),this.focusIndicator.classList.remove(Rc.hidden),this.focusIndicator.style.width=`${e.width}px`,this.focusIndicator.style.height=`${e.height}px`,this.focusIndicator.style.left=`${e.x}px`,this.focusIndicator.style.top=`${e.y}px`):this.focusIndicator.classList.add(Rc.hidden)}},_c=class extends nc{constructor(e){super(),this.element=e}static isGroup(e,t){return t.group===e}pressButton(e,t){this.listeners.dispatch("button-pressed",{type:"button-pressed",group:e,value:t})}toggleGroup(e,t){this.listeners.dispatch("group-toggled",{type:"group-toggled",group:e,visible:t})}toggleButton(e,t,i){this.listeners.dispatch("button-toggled",{type:"button-toggled",group:e,value:t,enabled:i})}proxyGroupOptions(e,t){this.listeners.dispatch("proxy-group-options",{type:"proxy-group-options",group:e,options:t})}},Oc=`\n.${Ja} {\n    transition: transform 0.1s ease;\n    max-width: 100%;\n    position: fixed;\n    left: 0px;\n    top: 0px;\n    z-index: 99999;\n    font: 12px Verdana, sans-serif;\n    color: rgb(70, 70, 70);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);\n}\n\n.${Ja}-wrap-always {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: none;\n}\n\n.${Ja}-wrap-hyphenate {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: auto;\n}\n\n.${Ja}-wrap-on-space {\n    overflow-wrap: normal;\n    word-break: normal;\n}\n\n.${Ja}-wrap-never {\n    white-space: pre;\n    text-overflow: ellipsis;\n}\n\n.${Ja}-no-interaction {\n    pointer-events: none;\n    user-select: none;\n}\n\n.${Ja}-no-animation {\n    transition: none !important;\n}\n\n.${Ja}-hidden {\n    visibility: hidden;\n}\n\n.${Ja}-title {\n    overflow: hidden;\n    position: relative;\n    padding: 8px 14px;\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px;\n    color: white;\n    background-color: #888888;\n    z-index: 1;\n    text-overflow: inherit;\n}\n\n.${Ja}-title:only-child {\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n}\n\n.${Ja}-content {\n    overflow: hidden;\n    padding: 6px 14px;\n    line-height: 1.7em;\n    background: white;\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    overflow: hidden;\n    text-overflow: inherit;\n}\n\n.${Ja}-arrow::before {\n    content: "";\n\n    position: absolute;\n    top: 100%;\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid #d9d9d9;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.${Ja}-arrow::after {\n    content: "";\n\n    position: absolute;\n    top: calc(100% - 1px);\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid white;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.ag-chart-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n`,Fc=class{constructor(e,t){if(this.canvasElement=e,this.tooltip=t,this.stateTracker=new Sc,this.appliedState=null,"undefined"!=typeof IntersectionObserver){const e=new IntersectionObserver(e=>{for(const t of e)t.target===this.canvasElement&&0===t.intersectionRatio&&this.tooltip.toggle(!1)},{root:this.tooltip.root});e.observe(this.canvasElement),this.observer=e}Es(Oc,"tooltip")}updateTooltip(e,t,i){var s;this.tooltip.enabled&&(null!=i||(i=null==(s=this.stateTracker.get(e))?void 0:s.content),this.stateTracker.set(e,{content:i,meta:t}),this.applyStates())}removeTooltip(e){this.tooltip.enabled&&(this.stateTracker.delete(e),this.applyStates())}getTooltipMeta(e){var t;return null==(t=this.stateTracker.get(e))?void 0:t.meta}destroy(){var e;null==(e=this.observer)||e.unobserve(this.canvasElement)}applyStates(){var e;const t=this.stateTracker.stateId(),i=t?this.stateTracker.get(t):null;if(null==(null==i?void 0:i.meta)||null==(null==i?void 0:i.content))return this.appliedState=null,void this.tooltip.toggle(!1);const s=this.canvasElement.getBoundingClientRect();if((null==(e=this.appliedState)?void 0:e.content)===(null==i?void 0:i.content)){const e=this.tooltip.isVisible();this.tooltip.show(s,null==i?void 0:i.meta,null,e)}else this.tooltip.show(s,null==i?void 0:i.meta,null==i?void 0:i.content);this.appliedState=i}static makeTooltipMeta(e,t){var i,s,r,n,o,a,l;const{offsetX:c,offsetY:h}=e,{tooltip:d}=t.series.properties,u={offsetX:c,offsetY:h,enableInteraction:null!=(s=null==(i=d.interaction)?void 0:i.enabled)&&s,lastPointerEvent:{type:e.type,offsetX:c,offsetY:h},showArrow:d.showArrow,position:{type:d.position.type,xOffset:d.position.xOffset,yOffset:d.position.yOffset}},p=null!=(l=null!=(n=null==(r=t.yBar)?void 0:r.upperPoint)?n:t.midPoint)?l:null==(a=(o=t.series).datumMidPoint)?void 0:a.call(o,t);if("node"===d.position.type&&p){const{x:e,y:i}=p,s=t.series.contentGroup.inverseTransformPoint(e,i);return f(m({},u),{offsetX:Math.round(s.x),offsetY:Math.round(s.y)})}return u}},Gc=class extends ic{constructor(){super(...arguments),this.layoutComplete="layout-complete"}addListener(e,t){if(this.isLayoutStage(e)||this.isLayoutComplete(e))return super.addListener(e,t);throw new Error(`AG Charts - unsupported listener type: ${e}`)}dispatchPerformLayout(e,t){return this.isLayoutStage(e)?this.getListenersByType(e).reduce((e,t)=>{try{return t.handler(e)}catch(t){return N.errorOnce(t),e}},t):t}dispatchLayoutComplete(e){this.dispatch(this.layoutComplete,e)}isLayoutStage(e){return e!==this.layoutComplete}isLayoutComplete(e){return e===this.layoutComplete}},Bc=class{constructor(){this.groups={}}registerSeries({id:e,seriesGrouping:t,visible:i,type:s}){var r;t&&(null!=(r=this.groups)[s]||(r[s]={}),this.groups[s][e]={grouping:t,visible:i})}deregisterSeries({id:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&0===Object.keys(this.groups[t]).length&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){var s;if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const r=new Set,n=new Set;for(const i of Object.values(null!=(s=this.groups[e])?s:{}))i.visible&&(r.add(i.grouping.groupIndex),i.grouping.groupIndex===t.groupIndex&&n.add(i.grouping.stackIndex));const o=Array.from(r);return o.sort((e,t)=>e-t),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(t.groupIndex)}}},Vc=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=4]="SERIES_UPDATE",e[e.TOOLTIP_RECALCULATION=5]="TOOLTIP_RECALCULATION",e[e.SCENE_RENDER=6]="SCENE_RENDER",e[e.NONE=7]="NONE",e))(Vc||{}),Hc=class extends ic{constructor(e){super(),this.updateCallback=e}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.dispatch("update-complete",{type:"update-complete",minRect:null==e?void 0:e.minRect,minVisibleRect:null==e?void 0:e.minVisibleRect})}},Uc=class{constructor(e,t){const{scene:i,syncManager:s,element:r,updateCallback:n,updateMutex:o}=t;this.chartService=e,this.scene=i,this.syncManager=s,this.zoomManager=e.zoomManager,this.annotationManager=new tc(e.annotationRoot),this.ariaAnnouncementService=new vc(i.canvas.element),this.chartEventManager=new Cc,this.contextMenuRegistry=new bc,this.cursorManager=new wc(r),this.highlightManager=new Mc,this.interactionManager=new mc(e.keyboard,r),this.keyNavManager=new Ac(this.interactionManager),this.regionManager=new Nc(this.interactionManager,this.keyNavManager,this.scene.canvas.element,r),this.toolbarManager=new _c(r),this.gestureDetector=new Ec(r),this.layoutService=new Gc,this.updateService=new Hc(n),this.seriesStateManager=new Bc,this.callbackCache=new ec,this.animationManager=new yc(this.interactionManager,o),this.animationManager.skip(),this.animationManager.play(),this.dataService=new sc(this.animationManager),this.tooltipManager=new Fc(this.scene.canvas.element,e.tooltip)}destroy(){this.tooltipManager.destroy(),this.regionManager.destroy(),this.keyNavManager.destroy(),this.interactionManager.destroy(),this.animationManager.stop(),this.animationManager.destroy(),this.ariaAnnouncementService.destroy(),this.chartEventManager.destroy(),this.highlightManager.destroy(),this.callbackCache.invalidateCache(),this.animationManager.reset(),this.syncManager.destroy()}},zc=class extends yt{constructor(){super(...arguments),this.range="tooltip"}};C([jr(On(["tooltip","node"],"a range"))],zc.prototype,"range",2);var Wc=class e{constructor(){this.domain=new Set}static is(t){return t instanceof e}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},jc=class e{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e}static extendDomain(e,t=[1/0,-1/0]){for(const i of e)"number"==typeof i&&(t[0]>i&&(t[0]=i),t[1]<i&&(t[1]=i));return t}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}};function Kc(e){return e.map(e=>Ge(e)?JSON.stringify(e):e).join("-")}function $c(e){const t=1e4;return Number.isInteger(e)?e:Math.abs(e)>t?Math.trunc(e):Math.round(e*t)/t}function Yc(e,t){var i;const s=function(e){if(null==e)return[];let[t,i]=e.map(Number);return 0===t&&0===i?[0,1]:t===1/0&&i===-1/0?[]:(t===1/0?t=0:i===-1/0&&(i=0),ze(t)&&ze(i)?[t,i]:[])}(e);if(0===s.length)return s;let[r,n]=s;if(r===n){const[e,s]=null!=(i=null==t?void 0:t.calculatePadding(r,n))?i:[1,1];r-=e,n+=s}return[r,n]}function qc(e,t){var i;return null!=(i=null==t?void 0:t.get(e.id))?i:0}var Xc=Symbol("invalid"),Zc=class{constructor(e,t="standalone"){this.opts=e,this.mode=t,this.debug=Ds.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let i=!0;for(const t of e.props){if("key"===t.type&&!i)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===t.type&&i&&(i=!1)}const s=({matchGroupIds:e=[]})=>{for(const t of e)if(this.values.every(e=>e.groupId!==t))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${t}).`)};for(const t of e.props)switch(t.type){case"key":this.keys.push(f(m({},t),{index:this.keys.length,missing:new Map}));break;case"value":if(null==t.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(t)}`);this.values.push(f(m({},t),{index:this.values.length,missing:new Map}));break;case"aggregate":s(t),this.aggregates.push(f(m({},t),{index:this.aggregates.length}));break;case"group-value-processor":s(t),this.groupProcessors.push(f(m({},t),{index:this.groupProcessors.length}));break;case"property-value-processor":this.propertyProcessors.push(f(m({},t),{index:this.propertyProcessors.length}));break;case"reducer":this.reducers.push(f(m({},t),{index:this.reducers.length}));break;case"processor":this.processors.push(f(m({},t),{index:this.processors.length}))}}resolveProcessedDataDefById(e,t){var i;const s=null==(i=this.scopeCache.get(e.id))?void 0:i.get(t);if(!s)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:s.index,def:s}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveProcessedDataDefsByIds(e,t){return t.map(t=>[t,this.resolveProcessedDataDefById(e,t)])}resolveProcessedDataDefsValues(e,{keys:t,values:i}){const s={};for(const[r,{index:n,def:o}]of e){const e="key"===o.type?t:i;s[r]=e[n]}return s}getDomain(e,t,i="value",s){var r;const n=this.getDomainsByType(i,s);return null!=(r=null==n?void 0:n[this.resolveProcessedDataIndexById(e,t)])?r:[]}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e,t){var i;const{opts:{groupByKeys:s,groupByFn:r},aggregates:n,groupProcessors:o,reducers:a,processors:l,propertyProcessors:c}=this,h=performance.now();if(s&&0===this.keys.length)return;let d=this.extractData(e,t);if(s?d=this.groupData(d):r&&(d=this.groupData(d,r(d))),o.length>0&&this.postProcessGroups(d),n.length>0&&this.aggregateData(d),c.length>0&&this.postProcessProperties(d),a.length>0&&this.reduceData(d),l.length>0&&this.postProcessData(d),e.length>0)for(const t of k(this.keys,this.values))for(const[i,s]of t.missing)if(s>=e.length){const e=null==i?"":` for ${i}`;N.warnOnce(`the key '${t.property}' was not found in any data element${e}.`)}const u=performance.now();d.time=u-h,this.debug.check()&&function(e){var t,i;const s=(e,t)=>{t.length>0&&(N.log(`DataModel.processData() - ${e}`),N.table(t))};N.log("DataModel.processData() - processedData",e),s("Key Domains",e.domain.keys),s("Group Domains",null!=(t=e.domain.groups)?t:[]),s("Value Domains",e.domain.values),s("Aggregate Domains",null!=(i=e.domain.aggValues)?i:[]),"grouped"===e.type?s("Values",e.data.reduce((e,t)=>{var i,s;const r=null!=(i=t.keys)?i:[],n=null!=(s=t.aggValues)?s:[],o=t.keys.map(()=>{}),a=null==n?void 0:n.map(()=>{});return e.push(...t.values.map((e,t)=>[...0===t?r:o,...null!=e?e:[],...0==t?n:a])),e},[])):s("Values",e.data.reduce((e,t)=>{var i;const s=null!=(i=t.aggValues)?i:[];return e.push([...t.keys,...t.values,...s]),e},[]))}(d),this.scopeCache.clear();for(const e of k(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,s]of e.idsMap)for(const r of s)if(this.scopeCache.has(t)){if(null==(i=this.scopeCache.get(t))?void 0:i.has(r))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(r,e)}else this.scopeCache.set(t,new Map([[r,e]]));return d}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=null==e||0===e.length,s="string"==typeof t?t:t.id,r=this.values.findIndex(t=>(null==t.scopes||i&&!t.scopes.length||t.scopes.some(t=>null==e?void 0:e.includes(t)))&&(t.property===s||t.id===s||(t=>{if(t.idsMap)for(const[i,r]of t.idsMap)if((null==e?void 0:e.includes(i))&&r.has(s))return!0;return!1})(t)));if(-1===r)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return r}extractData(e,t){var i,s,r;const{dataDomain:n,processValue:o,scopes:a,allScopesHaveSameDefs:l}=this.initDataDomainProcessor(),c=new Map(null==t?void 0:t.map(e=>[e.id,e])),{keys:h,values:d}=this,u=new Array(e.length);let p=0,g=0;for(const[t,n]of e.entries()){const e={},f=a.size>0?new Set(a):void 0,y=new Array(h.length);let v,C=0;for(const e of h){if(v=o(e,n,v),v===Xc)break;y&&(y[C++]=v)}if(v===Xc)continue;const b=d.length>0?new Array(d.length):void 0;let S;for(const[h,u]of d.entries()){for(const r of null!=(i=u.scopes)?i:a){const i=c.get(r);if(S=o(u,null!=(s=null==i?void 0:i.data[t])?s:n,S,r),S!==Xc&&b){if(null!=i&&!1!==u.includeProperty){const t=u.includeProperty&&null!=u.id?u.id:u.property;null!=e[r]||(e[r]={}),e[r][t]=S}b[h]=S}}if(S===Xc){if(l)break;for(const e of null!=(r=u.scopes)?r:a)null==f||f.delete(e);if(0===(null==f?void 0:f.size))break}}if(S===Xc&&l)continue;if(0===(null==f?void 0:f.size))continue;const w={datum:m(m({},n),e),keys:y,values:b};!l&&f&&f.size<a.size&&(g++,w.validScopes=new Set(f)),u[p++]=w}u.length=p;const f=e=>{const t=n.get(e),i=t.getDomain();return jc.is(t)&&i[0]>i[1]?[]:i};return{type:"ungrouped",input:{count:e.length},data:u,domain:{keys:h.map(f),values:d.map(f)},defs:{allScopesHaveSameDefs:l,keys:h,values:d},partialValidDataCount:g,time:0}}groupData(e,t){var i;const s=new Map;for(const r of e.data){const{keys:e,values:n,datum:o,validScopes:a}=r,l=null!=(i=null==t?void 0:t(r))?i:e,c=Kc(l);if(s.has(c)){const e=s.get(c);if(e.values.push(n),e.datum.push(o),null!=a&&null!=e.validScopes)for(const t of e.validScopes)a.has(t)||e.validScopes.delete(t)}else s.set(c,{keys:l,values:[n],datum:[o],validScopes:a})}const r=new Array(s.size),n=new Array(s.size);let o=0;for(const{keys:e,values:t,datum:i,validScopes:a}of s.values())0!==(null==a?void 0:a.size)&&(n[o]=e,r[o++]={keys:e,values:t,datum:i,validScopes:a});return f(m({},e),{type:"grouped",data:r,domain:f(m({},e.domain),{groups:n})})}aggregateData(e){var t,i,s,r,n,o;const a="ungrouped"===e.type;e.domain.aggValues=[];for(const[l,c]of this.aggregates.entries()){const h=this.valueGroupIdxLookup(c),d=[1/0,-1/0];for(const u of e.data){if(null!=u.aggValues||(u.aggValues=new Array(this.aggregates.length)),u.validScopes)continue;const e=a?[u.values]:u.values;let p=null!=(i=null==(t=c.groupAggregateFunction)?void 0:t.call(c))?i:[1/0,-1/0];for(const t of e){const e=h.map(e=>t[e]),i=c.aggregateFunction(e,u.keys);i&&(p=null!=(r=null==(s=c.groupAggregateFunction)?void 0:s.call(c,i,p))?r:jc.extendDomain(i,p))}const g=(null!=(o=null==(n=c.finalFunction)?void 0:n.call(c,p))?o:p).map(e=>$c(e));u.aggValues[l]=g,jc.extendDomain(g,d)}e.domain.aggValues.push(d)}}postProcessGroups(e){var t,i;const{groupProcessors:s}=this,r=new Set,n=new Map,o=new Map,a=new Map;for(const e of s){const t=this.valueGroupIdxLookup(e);o.set(e,t),a.set(e,e.adjust());for(const e of t){const t="category"===this.values[e].valueType;r.add(e),n.set(e,t?new Wc:new jc)}}const l=e=>{var t;for(const i of r)null==(t=n.get(i))||t.extend(e[i])};for(const r of e.data){for(const n of s){if(r.validScopes)continue;const s=null!=(t=o.get(n))?t:[],l=null==(i=a.get(n))?void 0:i();if(l)if("grouped"===e.type)for(const e of r.values)e&&l(e,s);else r.values&&l(r.values,s)}if("grouped"===e.type)for(const e of r.values)l(e);else l(r.values)}for(const[t,i]of n)e.domain.values[t]=i.getDomain()}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)t()(e,this.valueIdxLookup(s,i))}reduceData(e){var t;null!=e.reduced||(e.reduced={});for(const i of this.reducers){const s=i.reducer();let r=i.initialValue;for(const n of e.data)n.validScopes&&!(null==(t=i.scopes)?void 0:t.some(e=>{var t;return null==(t=n.validScopes)?void 0:t.has(e)}))||(r=s(r,n));e.reduced[i.property]=r}}postProcessData(e){null!=e.reduced||(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e)}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const e of t)if(e.scopes)for(const t of e.scopes)i.add(t);const s=new Map,r=new Map;let n=!0;const o=()=>{var r;for(const o of k(e,t))"category"===o.valueType?s.set(o,new Wc):(s.set(o,new jc),n&&(n=(null!=(r=o.scopes)?r:[]).length===i.size))};o();const a=this.buildAccessors(k(e,t));return{dataDomain:s,processValue:(e,t,i,n)=>{var l,c,h,d,u;let p,g;if(a.has(e.property)){try{g=a.get(e.property)(t)}catch(e){}p=null!=g}else p=e.property in t,g=p?t[e.property]:e.missingValue;if(null!=e.forceValue&&(g=p&&js(g)?-1*e.forceValue:e.forceValue,p=!0),!p&&!("missingValue"in e)){const t=null!=(l=e.missing.get(n))?l:0;e.missing.set(n,t+1)}if(s.has(e)||o(),p&&null!=(h=null==(c=e.validation)?void 0:c.call(e,g,t))&&!h){if(!("invalidValue"in e))return"integrated"!==this.mode&&N.warnOnce(`invalid value of type [${typeof g}] ignored:`,`[${g}]`),Xc;g=e.invalidValue}return e.processor&&(r.has(e)||r.set(e,e.processor()),g=null==(d=r.get(e))?void 0:d(g,i===Xc?void 0:i)),null==(u=s.get(e))||u.extend(g),g},initDataDomain:o,scopes:i,allScopesHaveSameDefs:n}}buildAccessors(e){const t=new Map;if("integrated"===this.mode)return t;for(const i of e){if(!i.property.includes(".")&&!i.property.includes("["))continue;let e;e=i.property.startsWith("[")?`return datum${i.property};`:`return datum.${i.property};`,t.set(i.property,new Function("datum",e))}return t}},Qc=class e{constructor(e){this.mode=e,this.debug=Ds.create(!0,"data-model"),this.requested=[],this.status="setup"}request(e,t,i){return S(this,null,function*(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,r)=>{this.requested.push({id:e,opts:i,data:t,resolve:s,reject:r})})})}execute(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const e=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",e);const t=this.mergeRequested(e);this.debug("DataController.execute() - merged",t),this.debug.check()&&(Ss().processedData=[]);const i=this.requested.map(({id:e})=>e),s=this.hasMultipleDataSources(e);for(const{opts:r,data:n,resolves:o,rejects:a,ids:l}of t)try{const t=new Zc(r,this.mode),c=t.processData(n,e);this.debug.check()&&Ss("processedData").push(c),0===(null==c?void 0:c.partialValidDataCount)?o.forEach((e,r)=>e({dataModel:t,processedData:this.processScopedData(l[r],c,i,s)})):c?this.splitResult(t,c,l,o):a.forEach(e=>e(new Error("AG Charts - no processed data generated")))}catch(e){a.forEach(t=>t(e))}}hasMultipleDataSources(e){if(e.length){const[{data:t},...i]=e;return i.some(e=>t!==e.data)}return!1}processScopedData(e,t,i,s){const r=t=>{if(Array.isArray(t))return t.map(r);const n=s?m(m({},t),t[e]):t;for(const e of i)delete n[e];return n},n=t=>{var i;return Array.isArray(t)?t.map(n):null!=(i=null==t?void 0:t[e])?i:t};return f(m({},t),{data:t.data.map(e=>{var t;return f(m({},e),{datum:r(e.datum),values:s?null==(t=e.values)?void 0:t.map(n):e.values})})})}validateRequests(e){const t=[];for(const[i,s]of e.entries())i>0&&s.data.length!==e[0].data.length&&!1===s.opts.groupByData?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):t.push(s);return t}mergeRequested(t){const i=[];for(const s of t){const t=i.find(e.groupMatch(s));t?t.push(s):i.push([s])}return i.map(e.mergeRequests)}splitResult(e,t,i,s){for(let r=0;r<i.length;r++){const n=i[r];(0,s[r])({dataModel:e,processedData:f(m({},t),{data:t.data.filter(({validScopes:e})=>{var t;return null==(t=null==e?void 0:e.has(n))||t})})})}}static groupMatch({data:e,opts:t}){function i(e){return e.filter(e=>"key"===e.type).map(e=>e.property).join(";")}return([s])=>(!1===t.groupByData||s.data===e)&&s.opts.groupByKeys===t.groupByKeys&&s.opts.groupByFn===t.groupByFn&&i(s.opts.props)===i(t.props)}static mergeRequests(t){return t.reduce((t,i)=>{var s,r,{id:n,data:o,resolve:a,reject:l,opts:c}=i,h=c,{props:d}=h,u=y(h,["props"]);t.ids.push(n),t.rejects.push(l),t.resolves.push(a),null!=t.data||(t.data=o),null!=t.opts||(t.opts=f(m({},u),{props:[]}));for(const i of d){const o=f(m({},i),{scopes:[n]});e.createIdsMap(n,o);const a=t.opts.props.find(t=>t.type===o.type&&e.deepEqual(t,o));a?(null!=a.scopes||(a.scopes=[]),a.scopes.push(...null!=(s=o.scopes)?s:[]),"key"!==a.type&&"value"!==a.type||!(null==(r=o.idsMap)?void 0:r.size)||e.mergeIdsMap(o.idsMap,a.idsMap)):t.opts.props.push(o)}return t},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,t){for(const[i,s]of e)if(t.has(i))for(const e of s)t.get(i).add(e);else t.set(i,new Set(s))}static createIdsMap(e,t){null!=t.id&&(null!=t.idsMap||(t.idsMap=new Map),t.idsMap.has(e)?t.idsMap.get(e).add(t.id):t.idsMap.set(e,new Set([t.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;let s,r;if(Array.isArray(t)){if(r=t.length,r!==i.length)return!1;for(s=r-1;s>=0;s--)if(!e.deepEqual(t[s],i[s]))return!1;return!0}const n=Object.keys(t);if(r=n.length,r!==Object.keys(i).length)return!1;for(s=r-1;s>=0;s--){const r=n[s];if(!(e.skipKeys.has(r)||Object.hasOwn(i,r)&&e.deepEqual(t[r],i[r])))return!1}return!0}return!1}};Qc.skipKeys=new Set(["id","idsMap","type","scopes"]);var Jc=Qc,eh=class e extends nc{constructor(e){super(),this.chart=e}subscribe(t=e.DEFAULT_GROUP){let i=this.get(t);return i||(i=new Set,e.chartsGroups.set(t,i)),i.add(this.chart),this}unsubscribe(t=e.DEFAULT_GROUP){var i;return null==(i=this.get(t))||i.delete(this.chart),this}getChart(){return this.chart}getGroup(t=e.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i):[]}getGroupSiblings(t=e.DEFAULT_GROUP){return this.getGroup(t).filter(e=>e!==this.chart)}get(t){return e.chartsGroups.get(t)}};eh.chartsGroups=new Map,eh.DEFAULT_GROUP=Symbol("sync-group-default");var th=eh,ih=class extends nc{constructor(){super(...arguments),this.axisZoomManagers=new Map,this.state=new Sc(void 0,"initial"),this.rejectCallbacks=new Map}updateAxes(e){var t;const i=new Map(e.map(e=>[e.id,this.axisZoomManagers.get(e.id)]));this.axisZoomManagers.clear();for(const s of e)this.axisZoomManagers.set(s.id,null!=(t=i.get(s.id))?t:new sh(s));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}updateZoom(e,t,i=!0,s){var r;if(s&&this.rejectCallbacks.set(e,s),0===this.axisZoomManagers.size){const n=this.state.stateId();return void("initial"===n||n===e||i?(this.state.set(e,t),n!==e&&(null==(r=this.rejectCallbacks.get(n))||r(e))):null==s||s(n))}this.state.set(e,t),this.axisZoomManagers.forEach(i=>{i.updateZoom(e,null==t?void 0:t[i.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){var s;null==(s=this.axisZoomManagers.get(t))||s.updateZoom(e,i),this.applyChanges(e)}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?null!=e||(e=i.getZoom()):"y"===i.getDirection()&&(null!=t||(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){var t,i;return null!=(i=null==(t=this.axisZoomManagers.get(e))?void 0:t.getZoom())?i:{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}applyChanges(e){if(!Array.from(this.axisZoomManagers.values(),e=>e.applyChanges()).some(Boolean))return;const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]=i.getZoom();this.listeners.dispatch("zoom-change",f(m({type:"zoom-change"},this.getZoom()),{axes:t,callerId:e}))}},sh=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new Sc({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return wt(this.state.stateValue())}applyChanges(){const e=this.currentZoom;return this.currentZoom=this.state.stateValue(),e.min!==this.currentZoom.min||e.max!==this.currentZoom.max}},rh=class extends yt{constructor(){super(...arguments),this.enabled=!1}};function nh(e,t){const{bbox:i,showFocusBox:s}=t;if(s&&e.updateFocusIndicatorRect(t.bbox),void 0!==i){const{x:e,y:t}=i.computeCenter();return{type:"keyboard",offsetX:e,offsetY:t}}}C([jr(Zr)],rh.prototype,"enabled",2),C([jr(en)],rh.prototype,"tabIndex",2);var oh=["top","right","bottom","left"],ah=["category","grouped-category","ordinal-time","number","log","time"],lh=class{constructor(){this.result=[],this.valid=[],this.invalid=[]}push(e,t){const{result:i,valid:s,invalid:r}=this;var n;(function(e){return ah.includes(e.type)})(t)&&("string"==typeof(n=t.position)&&oh.includes(n)?s.push(e):r.push(e)),i.push(e)}guessInvalidPositions(){const e=this.valid.filter(e=>ah.includes(e.type)).map(e=>e.position).filter(e=>void 0!==e),t=["top","right","bottom","left"];for(const i of this.invalid){let s=t.pop();for(;e.includes(s)&&void 0!==s;)s=t.pop();if(void 0===s)break;i.position=s}return this.result}},ch=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo","stacked","grouped","stackGroup"],hh=class extends pa{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&Ct(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())"legend"===e.type&&(yield{legendType:e.identifier,legend:t})}},dh="ag-chart-overlay",uh="ag-chart-dark-overlay",ph=class extends yt{constructor(e,t){super(),this.className=e,this.defaultText=t,this.darkTheme=!1}getText(){var e;return null!=(e=this.text)?e:this.defaultText}getElement(e,t){null!=this.element||(this.element=ws("div",dh,{position:"absolute"})),this.element.classList.toggle(uh,this.darkTheme),this.focusBox=t;const i=this.element;if(i.style.left=`${t.x}px`,i.style.top=`${t.y}px`,i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,this.renderer){const e=this.renderer();e instanceof HTMLElement?i.replaceChildren(e):i.innerHTML=e}else{const t=ws("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",font:"12px Verdana, sans-serif"});t.innerText=this.getText(),i.replaceChildren(t),null==e||e.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){i.style.opacity="1"}})}return this.element}removeElement(e){if(this.element){if(e){const{element:t}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(e){t.style.opacity=String(e)},onStop(){t.remove()}})}else this.element.remove();this.element=void 0,this.focusBox=void 0}}};C([jr(Jr,{optional:!0})],ph.prototype,"text",2),C([jr(Qr,{optional:!0})],ph.prototype,"renderer",2),C([jr(Zr)],ph.prototype,"darkTheme",2);var gh=class extends yt{constructor(){super(...arguments),this.loading=new ph("ag-chart-loading-overlay","Loading data..."),this.noData=new ph("ag-chart-no-data-overlay","No data to display"),this.noVisibleSeries=new ph("ag-chart-no-visible-series","No visible series")}getFocusInfo(){for(const e of[this.loading,this.noData,this.noVisibleSeries])if(void 0!==e.focusBox)return{text:e.getText(),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement()}};C([jr(qr)],gh.prototype,"loading",2),C([jr(qr)],gh.prototype,"noData",2),C([jr(qr)],gh.prototype,"noVisibleSeries",2);var mh=`\n.${dh} {\n    color: #181d1f;\n}\n\n.${dh}.${uh} {\n    color: #ffffff;\n}\n\n.${dh}--loading {\n    color: rgb(140, 140, 140); /* DEFAULT_MUTED_LABEL_COLOUR */\n}\n\n.${dh}__loading-background {\n    background: white; /* DEFAULT_BACKGROUND_FILL */\n}\n\n.${dh}.${uh} .${dh}__loading-background {\n    background: #192232; /* DEFAULT_DARK_BACKGROUND_FILL */\n}\n`;function fh(e,t=[0,0]){for(const i of e)"number"==typeof i&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function yh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>fh(e)}}function vh(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:e=>fh(e),groupAggregateFunction:(e,t=[0,0])=>{var i,s;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(s=null==e?void 0:e[1])?s:0,t}}}function Ch(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>jc.extendDomain(e)}}function bh(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,t=[0,0])=>{var i,s;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(s=null==e?void 0:e[1])?s:0,t}}}function Sh(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:e=>fh(e),groupAggregateFunction:(e,t=[0,0,-1])=>{var i,s;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(s=null==e?void 0:e[1])?s:0,t[2]++,t},finalFunction:(e=[0,0,0])=>{const t=e[0]+e[1];return t>=0?[0,t/e[2]]:[t/e[2],0]}}}function wh(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(e,i=[])=>{const s=i[1]-i[0];return t.aggregateFunction(e).map(e=>e/s)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function xh(e){return()=>{let t=0;return i=>ze(i)?(t+=e?Math.max(0,i):i,t):i}}function Eh(){return()=>{let e=0;return t=>{if(!ze(t))return t;const i=e;return e+=t,i}}}var Mh={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s=i.keys[0],r=Math.abs(s-e);return e=s,!isNaN(r)&&r>0&&r<t?r:t}}},Ah={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>null==e?void 0:e.slice().sort((e,t)=>{for(let i=0;i<e.length;i++){const s=e[i]-t[i];if(0!==s)return s}return 0})};function Th({normaliseTo:e,mode:t}){const i=(t,i)=>{const s=t*e/i;return s>=0?Math.min(e,s):Math.max(-e,s)};return()=>()=>(e,s)=>{const r=[0,0];for(const i of s){const s=e[i],n=s<0?0:1;"sum"===t?r[n]+=s:r[n]=0===n?Math.min(r[n],s):Math.max(r[n],s)}const n=Math.max(Math.abs(r[0]),r[1]);for(const t of s)e[t]=i(e[t],n)}}function Dh(e,t,i="sum"){return{type:"group-value-processor",matchGroupIds:e,adjust:ko({normaliseTo:t,mode:i},Th)}}function Ih({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const r=e[1]-e[0],n=(i,s,n)=>{const o=e[0]+(i-s)/n*r;return 0===n?t:o>=e[1]?e[1]:o<e[0]?e[0]:o};return()=>(t,r)=>{let[o,a]=t.domain.values[r];null!=i&&(o=i),null!=s&&(a=s);const l=a-o;t.domain.values[r]=[e[0],e[1]];for(const e of t.data){let i=e.values;"ungrouped"===t.type&&(i=[i]);for(const e of i)e[r]=n(e[r],o,l)}}}function Rh(e,t,i,s,r){return{type:"property-value-processor",property:e,adjust:ko({normaliseTo:t,rangeMin:s,rangeMax:r,zeroDomain:i},Ih)}}function Ph(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:s}=t.defs,{input:r,data:n}=t;let o=!0,a=!0;const l=[];for(let t=0;t<s.length;t++)(null==e?void 0:e.includes(s[t].id))&&l.push([t,s[t]]);const c=(e,i,s)=>{var l;if("category"===i.valueType){const i=t.domain[s][e];return void(o&&(o=i.length===r.count))}let c=null==(l=n[0])?void 0:l[s][e];for(let t=1;(o||a)&&t<n.length;t++){const i=n[t][s][e];a&&(a=c<=i),o&&(o=c!==i),c=i}};for(let e=0;(o||a)&&e<i.length;e++)c(e,i[e],"keys");for(let e=0;(o||a)&&e<l.length;e++){const[t,i]=l[e];c(t,i,"values")}return{uniqueKeys:o,orderedKeys:a}}}}function kh({mode:e,separateNegative:t}){return()=>()=>(i,s)=>{const r=[0,0];for(const n of s){const s=i[n],o=js(s)&&t?0:1;ze(s)&&("normal"===e&&(r[o]+=s),i[n]=r[o],"trailing"===e&&(r[o]+=s))}}}function Lh({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(r,n)=>{let o=0;for(const a of n){const n=r[a],l=s&&"current"===t?0:i[a];i[a]=n;const c="current"===t?n:l;ze(n)&&ze(l)?("normal"===e&&(o+=c),r[a]=o,"trailing"===e&&(o+=c)):r[a]=o}s=!1}}}function Nh(e,t,i,s=!1){let r;return r=t.startsWith("window")?ko({mode:t.endsWith("-trailing")?"trailing":"normal",sum:i},Lh):ko({mode:t,separateNegative:s},kh),{type:"group-value-processor",matchGroupIds:[e],adjust:r}}function _h(e,t=!0){return{type:"processor",property:"diff",calculate:i=>{const s=new Map,r=new Map,n=new Map,o=new Map,a=Math.max(e.data.length,i.data.length);for(let l=0;l<a;l++){const a=e.data[l],c=i.data[l],h=a?Oh(a.keys):"",d=c?Oh(c.keys):"";c&&a&&h===d?hs(a.values,c.values)||n.set(d,c):(o.has(d)?(!t&&hs(o.get(d).values,c.values)||(n.set(d,c),s.set(d,c)),o.delete(d)):c&&r.set(d,c),r.has(h)?(!t&&hs(r.get(h).values,a.values)||(n.set(h,a),s.set(h,a)),r.delete(h)):a&&(n.delete(h),o.set(h,a)))}return{changed:r.size>0||n.size>0||o.size>0,added:r,updated:n,removed:o,moved:s}}}}function Oh(e,...t){let i;return i=ke(e)?e.map(e=>Yo(e)).join("___"):Yo(e),("string"==typeof i||"number"==typeof i||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var Fh=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_BY_MAIN_AXIS_FIRST=1]="NEAREST_BY_MAIN_AXIS_FIRST",e[e.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST=2]="NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST",e[e.NEAREST_NODE=3]="NEAREST_NODE",e))(Fh||{});function Gh(e){return null!=e&&Ko(e)}function Bh(e){return null!=e}function Vh(e){switch(e){case"number":case"log":case"ordinal-time":case"time":case"color":return Gh;default:return Bh}}function Hh(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Uh(e,t,i={}){return m({property:e,type:"key",valueType:Hh(t),validation:Vh(t)},i)}function zh(e,t,i={}){return m({property:e,type:"value",valueType:Hh(t),validation:Vh(t)},i)}function Wh(e,t={}){const i=t,{min:s=-1/0,max:r=1/0}=i,n=y(i,["min","max"]);return m({type:"value",property:e,valueType:"range",validation:Gh,processor:()=>e=>ze(e)?Vs(s,e,r):e},n)}function jh(e,t,i={}){const s=i,{onlyPositive:r}=s,n=y(s,["onlyPositive"]);return f(m({},zh(e,t,n)),{processor:xh(r)})}function Kh(e,t,i={}){return f(m({},zh(e,t,i)),{processor:Eh()})}function $h(e,t,i="current",s,r){return[zh(e,r,s),Nh(s.groupId,t,i,s.separateNegative),...null!=s.rangeId?[Ch(s.rangeId,s.groupId)]:[]]}var Yh=class{constructor(e,t,{datum:i},s){this.type=e,this.event=t,this.datum=i,this.seriesId=s.id}},qh=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},Xh=class extends Xl{constructor(e){super(),this.destroyFns=[],this.seriesGrouping=void 0,this.NodeEvent=Yh,this.internalId=Fs(this),this.rootGroup=new xo({name:"seriesRoot",isVirtual:!0}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new pa,this._declarationOrder=-1,this.seriesListeners=new ic;const{moduleCtx:t,pickModes:i=[1],directionKeys:s={},directionNames:r={},contentGroupVirtual:n=!0,canHaveAxes:o=!1}=e;this.ctx=t,this.directionKeys=s,this.directionNames=r,this.canHaveAxes=o,this.contentGroup=this.rootGroup.appendChild(new xo({name:`${this.internalId}-content`,isVirtual:n,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.highlightGroup=new xo({name:`${this.internalId}-highlight`,isVirtual:n,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("highlight")}),this.highlightNode=this.highlightGroup.appendChild(new xo({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new xo({name:"highlightLabel",zIndex:10})),this.pickModes=i,this.labelGroup=this.rootGroup.appendChild(new xo({name:`${this.internalId}-series-labels`,zIndex:8})),this.annotationGroup=new xo({name:`${this.id}-annotation`,isVirtual:n,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("annotation")})}get id(){var e,t;return null!=(t=null==(e=this.properties)?void 0:e.id)?t:this.internalId}get type(){var e;return null!=(e=this.constructor.type)?e:""}get data(){var e;return null!=(e=this._data)?e:this._chartData}set visible(e){this.properties.visible=e,this.visibleChanged()}get visible(){return this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){var e,t;return null!=(t=null==(e=this.properties.tooltip)?void 0:e.enabled)&&t}onDataChange(){this.nodeDataRefresh=!0}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:r}=this;e&&this.ctx.seriesStateManager.deregisterSeries({id:i,type:s}),t&&this.ctx.seriesStateManager.registerSeries({id:i,type:s,visible:r,seriesGrouping:t}),this.fireEvent(new qh(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}getGroupZIndexSubOrder(e,t=0){let i=0;switch(e){case"data":case"paths":break;case"labels":i+=2e4;break;case"marker":i+=1e4;break;case"highlight":t+=15e3;break;case"annotation":i+=15e3}return[()=>this._declarationOrder+i,t]}addListener(e,t){return this.seriesListeners.addListener(e,t)}dispatch(e,t){this.seriesListeners.dispatch(e,t)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns=[],this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(e,t){const i=this.resolveKeyDirection(e),s=null==t?void 0:t[i],r=[];if(!s)return r;const n=(...e)=>{for(const t of e)Array.isArray(t)?n(...t):"object"==typeof t?n(...Object.values(t)):r.push(t)};return n(...s.map(e=>this.properties[e])),r}getKeys(e){return this.getDirectionValues(e,this.directionKeys)}getKeyProperties(e){var t;return null!=(t=this.directionKeys[this.resolveKeyDirection(e)])?t:[]}getNames(e){return this.getDirectionValues(e,this.directionNames)}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(t=>t.getDomain(e));return t.concat(i.flat())}markNodeDataDirty(){this.nodeDataRefresh=!0}visibleChanged(){this.ctx.seriesStateManager.registerSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:t=!0}=this.properties.highlightStyle.series;if(!t||1===e)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return e}}getStrokeWidth(e){const{strokeWidth:t,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===t)return e;switch(this.isItemIdHighlighted()){case 1:return t;case 0:case 2:return e}}isItemIdHighlighted(){var e,t;const i=null==(t=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight())?void 0:t.series;return null==i?0:i!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNode(e,t){const{pickModes:i,visible:s,rootGroup:r}=this;if(s&&r.visible)for(const s of i){if(t&&!t.includes(s))continue;let i;switch(s){case 0:i=this.pickNodeExactShape(e);break;case 1:case 2:i=this.pickNodeMainAxisFirst(e,2===s);break;case 3:i=this.pickNodeClosestDatum(e)}if(i)return{pickMode:s,match:i.datum,distance:i.distance}}}pickNodeExactShape(e){const t=this.contentGroup.pickNode(e.x,e.y);if(t&&!0!==t.datum.missing)return{datum:t.datum,distance:0}}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=Xs(e.x,e.y,t);if(void 0!==i.nearest&&!0!==i.nearest.datum.missing)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}fireNodeClickEvent(e,t){this.fireEvent(new this.NodeEvent("nodeClick",e,t,this))}fireNodeDoubleClickEvent(e,t){this.fireEvent(new this.NodeEvent("nodeDoubleClick",e,t,this))}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}toggleSeriesItem(e,t){this.visible=t,this.nodeDataRefresh=!0,this.dispatch("visibility-changed",{itemId:e,enabled:t})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return f(m({},this.ctx),{series:this})}getLabelText(e,t,i=String){var s;return e.formatter&&null!=(s=this.ctx.callbackCache.call(e.formatter,m({seriesId:this.id},t)))?s:i(t.value)}getMarkerStyle(e,t,i=e.getStyle()){var s,r;const n=qe({size:null!=(r=null==(s=t.datum.point)?void 0:s.size)?r:0},i);return e.formatter?qe(this.ctx.callbackCache.call(e.formatter,f(m(m({seriesId:this.id},n),t),{datum:t.datum.datum})),n):n}updateMarkerStyle(e,t,i,s=t.getStyle(),{applyTranslation:r=!0}={}){const{point:n}=i.datum,o=this.getMarkerStyle(t,i,s),a=this.visible&&o.size>0&&n&&!isNaN(n.x)&&!isNaN(n.y);r?e.setProperties(f(m({visible:a},o),{translationX:null==n?void 0:n.x,translationY:null==n?void 0:n.y})):e.setProperties(m({visible:a},o)),"function"!=typeof t.shape||e.dirtyPath||(e.path.clear(!0),e.updatePath(),e.checkPathDirty())}getMinRects(e,t){}get nodeDataDependencies(){var e;return null!=(e=this._nodeDataDependencies)?e:{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=null!=e?e:{width:NaN,height:NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,r=null!=St(this.nodeDataDependencies,s);return r&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),r}pickFocus(e){}};Xh.highlightedZIndex=1e12,C([qa({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Xh.prototype,"seriesGrouping",2);var Zh=class{constructor(e,t,i){this.seriesRoot=e,this.highlightRoot=t,this.annotationRoot=i,this.groups={},this.series={},this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){var t,i,s;const{internalId:r,type:n,rootGroup:o,highlightGroup:a,annotationGroup:l,seriesGrouping:c}=e,{groupIndex:h=r}=null!=c?c:{};if(null!=this.series[r])throw new Error(`AG Charts - series already has an allocated layer: ${this.series[r]}`);0===Object.keys(this.series).length&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal"),null!=(t=this.groups)[n]||(t[n]={});const d=this.lookupIdx(h);let u=this.groups[n][d];return u||(u=null!=(s=(i=this.groups[n])[d])?s:i[d]={seriesIds:[],group:this.seriesRoot.appendChild(new xo({name:`${n}-content`,layer:!0,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("data")})),highlight:this.highlightRoot.appendChild(new xo({name:`${n}-highlight`,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("highlight")})),annotation:this.annotationRoot.appendChild(new xo({name:`${n}-annotation`,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("annotation")}))}),this.series[r]={layerState:u,seriesConfig:e},u.seriesIds.push(r),u.group.appendChild(o),u.highlight.appendChild(a),u.annotation.appendChild(l),u.group}changeGroup(e){var t,i;const{internalId:s,seriesGrouping:r,type:n,rootGroup:o,highlightGroup:a,annotationGroup:l,oldGrouping:c}=e,{groupIndex:h=s}=null!=r?r:{};(null==(i=null==(t=this.groups[n])?void 0:t[h])?void 0:i.seriesIds.includes(s))||(null!=this.series[s]&&this.releaseGroup({internalId:s,seriesGrouping:c,type:n,rootGroup:o,highlightGroup:a,annotationGroup:l}),this.requestGroup(e))}releaseGroup(e){var t,i,s,r,n;const{internalId:o,seriesGrouping:a,rootGroup:l,highlightGroup:c,annotationGroup:h,type:d}=e,{groupIndex:u=o}=null!=a?a:{};if(null==this.series[o])throw new Error(`AG Charts - series doesn't have an allocated layer: ${o}`);const p=this.lookupIdx(u),g=null!=(s=null==(t=this.groups[d])?void 0:t[p])?s:null==(i=this.series[o])?void 0:i.layerState;if(g&&(g.seriesIds=g.seriesIds.filter(e=>e!==o),g.group.removeChild(l),g.highlight.removeChild(c),g.annotation.removeChild(h)),0===(null==g?void 0:g.seriesIds.length))this.seriesRoot.removeChild(g.group),this.highlightRoot.removeChild(g.highlight),this.annotationRoot.removeChild(g.annotation),delete this.groups[d][p],delete this.groups[d][o];else if((null==g?void 0:g.seriesIds.length)>0){const e=null==(n=this.series[null==(r=null==g?void 0:g.seriesIds)?void 0:r[0]])?void 0:n.seriesConfig;g.group.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("data"),g.highlight.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("highlight"),g.annotation.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("annotation")}delete this.series[o]}lookupIdx(e){return"normal"===this.mode?e:"string"!=typeof e||(e=Number(e.split("-").slice(-1)[0]))?Math.floor(30*Vs(0,e/this.expectedSeriesCount,1)):0}destroy(){for(const e of Object.values(this.groups))for(const t of Object.values(e))this.seriesRoot.removeChild(t.group),this.highlightRoot.removeChild(t.highlight),this.annotationRoot.removeChild(t.annotation);this.groups={},this.series={}}},Qh=class{constructor(e,t){this.chartLike=e,this.layoutService=t,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("start-layout",e=>this.positionPadding(e.shrinkRect)),this.layoutService.addListener("start-layout",e=>this.positionCaptions(e.shrinkRect)))}destroy(){this.destroyFns.forEach(e=>e())}positionPadding(e){const{padding:t}=this.chartLike;return e.shrink(t.left,"left"),e.shrink(t.top,"top"),e.shrink(t.right,"right"),e.shrink(t.bottom,"bottom"),{shrinkRect:e}}positionCaptions(e){var t,i;const{title:s,subtitle:r,footnote:n}=this.chartLike,o=e.clone(),a=t=>{var i;const s=e.height/10,r=null!=(i=t.lineHeight)?i:t.fontSize*Oo.defaultLineHeightRatio,n=e.width,o=Math.max(r,s);t.computeTextWrap(n,o)},l=e=>"left"===e?o.x:"right"===e?o.x+o.width:("center"!==e&&N.error(`invalid textAlign value: ${e}`),o.x+o.width/2),c=(e,t)=>{const i=o.y;e.node.x=l(e.textAlign),e.node.y=i,e.node.textBaseline="top",a(e);const s=e.node.computeBBox(),r=Math.ceil(s.y-i+s.height+t);o.shrink(r,"top")};if(s.node.visible=s.enabled,r.node.visible=r.enabled,n.node.visible=n.enabled,s.enabled){const{spacing:e=(r.enabled?ol.SMALL_PADDING:ol.LARGE_PADDING)}=s;c(s,e)}return r.enabled&&c(r,null!=(t=r.spacing)?t:0),n.enabled&&((e,t)=>{const i=o.y+o.height;e.node.x=l(e.textAlign),e.node.y=i,e.node.textBaseline="bottom",a(e);const s=e.node.computeBBox(),r=Math.ceil(i-s.y+t);o.shrink(r,"bottom")})(n,null!=(i=n.spacing)?i:0),{shrinkRect:o}}},Jh=class{constructor(e,t,i,s){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=s,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){(this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow().catch(e=>N.errorOnce(e))}onZoomChange(){this.dirtyZoom=!0}updateWindow(){return S(this,null,function*(){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let t,i=!0;if(e){const s=this.zoomManager.getAxisZoom(e.id);t=this.getAxisWindow(e,s),i=this.shouldRefresh(e,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:null==t?void 0:t.min,windowEnd:null==t?void 0:t.max})})}getValidAxis(){return this.chart.axes.find(e=>"time"===e.type)}shouldRefresh(e,t){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(e.id);return!(i&&t.min===i.min&&t.max===i.max||(this.lastAxisZooms.set(e.id,t),0))}getAxisWindow(e,t){var i,s;const r=null==(s=(i=e.scale).getDomain)?void 0:s.call(i);if(!t||!r||0===r.length||isNaN(Number(r[0])))return;const n=Number(r[1])-Number(r[0]);return{min:new Date(Number(r[0])+n*t.min),max:new Date(Number(r[0])+n*t.max)}}},ed=class{constructor(e,t,i,s,r){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutService=s,this.animationManager=r,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("layout-complete",e=>this.onLayoutComplete(e)))}destroy(){this.destroyFns.forEach(e=>e())}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(e=>e.hasData),s=this.chartLike.series.some(e=>e.visible);this.toggleOverlay(this.overlays.loading,e,t),this.toggleOverlay(this.overlays.noData,e,!t&&!i),this.toggleOverlay(this.overlays.noVisibleSeries,e,i&&!s)}toggleOverlay(e,t,i){if(i){const i=e.getElement(this.animationManager,t);this.chartLike.element.append(i)}else e.removeElement(this.animationManager)}},td=Ds.create(!0,"opts"),id=class extends yt{constructor(){super(...arguments),this.padding=new Zl(0)}};C([jr(Zr,{optional:!0})],id.prototype,"clip",2),C([jr(qr)],id.prototype,"padding",2);var sd=class e extends Xl{constructor(e,t){var i,s;super(),this.id=Fs(this),this.seriesRoot=new xo({name:`${this.id}-series-root`}),this.highlightRoot=new xo({name:`${this.id}-highlight-root`,layer:!0,zIndex:5,nonEmptyChildDerivedZIndex:!0}),this.annotationRoot=new xo({name:`${this.id}-annotation-root`,layer:!0,zIndex:10}),this.debug=Ds.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this.padding=new Zl(20),this.seriesArea=new id,this.title=new ol,this.subtitle=new ol,this.footnote=new ol,this.keyboard=new rh,this.mode="standalone",this.destroyed=!1,this._skipSync=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new hh,this.zoomManager=new ih,this.processors=[],this.processedOptions={},this.userOptions={},this.queuedUserOptions=[],this._pendingFactoryUpdatesCount=0,this._performUpdateNoRenderCount=0,this._performUpdateSkipAnimations=!1,this.performUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new ql,this.updateRequestors={},this.performUpdateTrigger=Ql((e,t=0)=>setTimeout(e,t),e=>S(this,[e],function*({count:e}){this.destroyed||this.updateMutex.acquire(()=>S(this,null,function*(){try{yield this.performUpdate(e)}catch(e){N.error("update error",e)}})).catch(e=>N.errorOnce(e))})),this._performUpdateSplits={},this.axes=[],this.series=[],this.focus={hasFocus:!1,series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.pointerScheduler=Ql((e,t)=>requestAnimationFrame(e),()=>{this.lastInteractionEvent&&(this.performUpdateType<=4?this.pointerScheduler.schedule():(this.handlePointer(this.lastInteractionEvent,!1),this.lastInteractionEvent=void 0))}),this.onSeriesNodeClick=e=>{const t=f(m({},e),{type:"seriesNodeClick"});Object.defineProperty(t,"series",{enumerable:!1,get:()=>e.series}),this.fireEvent(t)},this.onSeriesNodeDoubleClick=e=>{const t=f(m({},e),{type:"seriesNodeDoubleClick"});this.fireEvent(t)},this.seriesGroupingChanged=e=>{if(!(e instanceof qh))return;const{series:t,seriesGrouping:i,oldGrouping:s}=e;null!=t.rootGroup.parent&&this.seriesLayerManager.changeGroup({internalId:t.internalId,type:t.type,rootGroup:t.rootGroup,highlightGroup:t.highlightGroup,annotationGroup:t.annotationGroup,getGroupZIndexSubOrder:e=>t.getGroupZIndexSubOrder(e),seriesGrouping:i,oldGrouping:s})},this.dataProcessListeners=new Set,this.chartOptions=e;let r=null==t?void 0:t.scene;const n=null!=(i=null==t?void 0:t.element)?i:ws("div","ag-chart-wrapper",{position:"relative",userSelect:"none"}),o=null==t?void 0:t.container;this.element=n;const a=new xo({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.highlightRoot),a.append(this.annotationRoot),this.axisGridGroup=new xo({name:"Axes-Grids",layer:!0,zIndex:1}),a.appendChild(this.axisGridGroup),this.axisGroup=new xo({name:"Axes",layer:!0,zIndex:2}),a.appendChild(this.axisGroup),this.sizeMonitor=new Jl,this.sizeMonitor.observe(this.element,e=>this.rawResize(e));const{overrideDevicePixelRatio:l}=e.specialOverrides;null!=r||(r=new $l({pixelRatio:l,canvasPosition:"absolute"})),r.setRoot(a).setContainer(n),this.autoSize=!0,this.tooltip=new nl,this.seriesLayerManager=new Zh(this.seriesRoot,this.highlightRoot,this.annotationRoot);const c=this.ctx=new Uc(this,{scene:r,syncManager:new th(this),element:n,updateCallback:(e=0,t)=>this.update(e,t),updateMutex:this.updateMutex});this.overlays=new gh,null!=(s=this.overlays.loading).renderer||(s.renderer=()=>function(e,t){const{animationDuration:i}=Er.add,s=ws("div",`${dh}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${i*t}ms linear 50ms both`}),r=ws("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),n=ws("p",{marginTop:"1em"});n.innerText=e;const o=ws("div",`${dh}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),a=ws("style");return a.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),s.replaceChildren(a,r,n,o),Es(mh,"chartOverlays"),s}(this.overlays.loading.getText(),c.animationManager.defaultDuration)),this.processors=[new Qh(this,c.layoutService),new Jh(this,c.dataService,c.updateService,c.zoomManager),new ed(this,this.overlays,c.dataService,c.layoutService,c.animationManager)],this.highlight=new zc,this.container=o;const{All:h}=pc,d=this.getModuleContext(),u=c.regionManager.addRegion("series",this.seriesRoot,this.axisGroup);c.regionManager.addRegion("root",a),this._destroyFns.push(c.dataService.addListener("data-load",e=>{this.data=e.data}),c.scene.attachNode(this.title.node),c.scene.attachNode(this.subtitle.node),c.scene.attachNode(this.footnote.node),this.title.registerInteraction(d,"title"),this.subtitle.registerInteraction(d,"subtitle"),this.footnote.registerInteraction(d,"footnote"),c.interactionManager.addListener("click",e=>this.onClick(e)),c.interactionManager.addListener("dblclick",e=>this.onDoubleClick(e)),u.addListener("hover",e=>this.onMouseMove(e)),u.addListener("leave",e=>this.onLeave(e)),u.addListener("blur",()=>this.onBlur()),u.addListener("tab",e=>this.onTab(e)),u.addListener("nav-vert",e=>this.onNavVert(e)),u.addListener("nav-hori",e=>this.onNavHori(e)),u.addListener("submit",e=>this.onSubmit(e)),c.keyNavManager.addListener("browserfocus",e=>this.onBrowserFocus(e)),c.interactionManager.addListener("page-left",()=>this.destroy()),c.interactionManager.addListener("contextmenu",e=>this.onContextMenu(e),h),c.animationManager.addListener("animation-start",()=>this.onAnimationStart()),c.animationManager.addListener("animation-frame",()=>{this.update(6)}),c.highlightManager.addListener("highlight-change",e=>this.changeHighlightDatum(e)),c.zoomManager.addListener("zoom-pan-start",()=>this.resetPointer()),c.zoomManager.addListener("zoom-change",()=>{this.resetPointer(),this.series.map(e=>{var t;return null==(t=e.animationState)?void 0:t.transition("updateData")});const e="initial"!==this.chartAnimationPhase;this.update(3,{forceNodeDataRefresh:!0,skipAnimations:e})}))}static getInstance(t){return e.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}onAutoSizeChange(e){const{style:t}=this.element;if(e){if(t.display="block",t.width="100%",t.height="100%",!this._lastAutoSize)return;this.resize(void 0,void 0,"autoSize option")}else t.display="inline-block",t.width="auto",t.height="auto"}download(e,t){this.ctx.scene.download(e,t)}getOptions(){var e;return null!=(e=this.queuedUserOptions.at(-1))?e:this.userOptions}getModuleContext(){return this.ctx}getAriaLabel(){var e;const t=[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ");return`chart, ${null!=(e=this.series.length)?e:0} series, ${t}`}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}destroy(e){if(this.destroyed)return;const t=null==e?void 0:e.keepTransferableResources;let i;return this.performUpdateType=7,this._destroyFns.forEach(e=>e()),this.processors.forEach(e=>e.destroy()),this.tooltip.destroy(),this.overlays.destroy(),this.sizeMonitor.unobserve(this.element),this.modulesManager.destroy(),t?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene,element:this.element}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(e=>e.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.zoomManager.destroy(),this.destroyed=!0,Object.freeze(this),i}resetPointer(e=!1){e||this.ctx.tooltipManager.removeTooltip(this.id),this.ctx.highlightManager.updateHighlight(this.id),this.lastInteractionEvent=void 0}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(()=>S(this,null,function*(){this.destroyed||(yield e(this),this.destroyed||this._pendingFactoryUpdatesCount--)})).catch(e=>N.errorOnce(e)))}update(e=0,t){var i,s;const{forceNodeDataRefresh:r=!1,skipAnimations:n,seriesToUpdate:o=this.series,newAnimationBatch:a}=null!=t?t:{};r&&this.series.forEach(e=>e.markNodeDataDirty());for(const e of o)this.seriesToUpdate.add(e);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this._skipSync=null!=(i=null==t?void 0:t.skipSync)&&i,this.debug.check()){let t=null!=(s=(new Error).stack)?s:"<unknown>";t=t.replace(/\([^)]*/g,""),this.updateRequestors[t]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.performUpdateTrigger.schedule(null==t?void 0:t.backOffMs))}performUpdate(e){return S(this,null,function*(){const{performUpdateType:t,extraDebugStats:i,_performUpdateSplits:s,ctx:r}=this,n=[...this.seriesToUpdate];this.performUpdateType=7,this.seriesToUpdate.clear(),0===this.updateShortcutCount&&t<6&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",Vc[t]);let o=performance.now();null!=s.start||(s.start=o);const a=e=>{null!=s[e]||(s[e]=0),s[e]+=performance.now()-o,o=performance.now()};let l=!1;switch(t){case 0:this.updateDOM();case 1:yield this.updateData(),a("⬇️");case 2:yield this.processData(),this.resetPointer(!0),a("🏭");case 3:if(this.checkUpdateShortcut(3))break;if(!this.checkFirstAutoSize(n)){l=!0;break}yield this.processLayout(),a("⌖");case 4:if(this.checkUpdateShortcut(4))break;const{seriesRect:e}=this;yield Promise.all(n.map(t=>t.update({seriesRect:e}))),a("🤔");case 5:if(this.checkUpdateShortcut(5))break;const o=r.tooltipManager.getTooltipMeta(this.id);t<=4&&null!=(null==o?void 0:o.lastPointerEvent)&&this.handlePointer(o.lastPointerEvent,!0),a("↖");case 6:if(this.checkUpdateShortcut(6))break;r.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,yield r.scene.render({debugSplitTimes:s,extraDebugStats:i}),this.ctx.regionManager.updateFocusWrapperRect(),this.extraDebugStats={};for(const e in s)delete s[e];case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}l||r.updateService.dispatchUpdateComplete(this.getMinRects());const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(c-s.start))/100,count:e,performUpdateType:Vc[t]})})}updateThemeClassName(){const{element:e,processedOptions:{theme:t}}=this,i="ag-charts-theme-",s=[`${i}default`,`${i}default-dark`];let r=s[0],n=!1;"string"==typeof t?(r=t.replace("ag-",i),n=t.includes("-dark")):"string"==typeof(null==t?void 0:t.baseTheme)&&(r=t.baseTheme.replace("ag-",i),n=t.baseTheme.includes("-dark")),s.includes(r)||(r=n?s[1]:s[0]),e.classList.forEach(t=>{t.startsWith(i)&&t!==r&&e.classList.remove(t)}),e.classList.add(r)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:t}=this.keyboard;this.element.tabIndex=e?null!=t?t:0:-1,Za(this.ctx.scene.canvas.element,"role","figure"),Za(this.ctx.scene.canvas.element,"aria-label",this.getAriaLabel())}checkUpdateShortcut(e){return this.updateShortcutCount>3?(N.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e&&(this.updateShortcutCount++,!0)}checkFirstAutoSize(e){if(this.autoSize&&!this._lastAutoSize){const t=this._performUpdateNoRenderCount++,i=40*p(t+1,2);if(t<8)return this.update(3,{seriesToUpdate:e,backOffMs:i}),this.debug("Chart.checkFirstAutoSize() - backing off until first size update",i),!1;this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}return this._performUpdateNoRenderCount=0,!0}onAxisChange(e,t=[]){for(const i of t)e.includes(i)||(i.detachAxis(this.axisGroup,this.axisGridGroup),i.destroy());for(const i of e)(null==t?void 0:t.includes(i))||i.attachAxis(this.axisGroup,this.axisGridGroup)}onSeriesChange(e,t){var i,s;const r=null!=(i=null==t?void 0:t.filter(t=>!e.includes(t)))?i:[];this.destroySeries(r),null==(s=this.seriesLayerManager)||s.setSeriesCount(e.length);for(const i of e){if(null==t?void 0:t.includes(i))continue;null==i.rootGroup.parent&&this.seriesLayerManager.requestGroup(i);const e=this;i.chart={get mode(){return e.mode},get isMiniChart(){return!1},get seriesRect(){return e.seriesRect},placeLabels:()=>e.placeLabels()},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}}destroySeries(e){null==e||e.forEach(e=>{e.removeEventListener("nodeClick",this.onSeriesNodeClick),e.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),e.removeEventListener("groupingChanged",this.seriesGroupingChanged),e.destroy(),this.seriesLayerManager.releaseGroup(e),e.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}updateAllSeriesListeners(){this.series.forEach(e=>{e.removeEventListener("nodeClick",this.onSeriesNodeClick),e.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.addSeriesListeners(e)})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e=ps(this.axes,e=>e.direction);this.series.forEach(t=>{t.directions.forEach(i=>{const s=e[i];if(!s)return void N.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const r=t.getKeys(i),n=s.find(e=>!e.keys.length||r.some(t=>e.keys.includes(t)));n?t.axes[i]=n:N.warnOnce(`no matching axis for direction [${i}] and keys [${r}]; check series and axes configuration.`)})})}rawResize({width:e,height:t}){var i;if(!this.autoSize)return;if(e=Math.floor(e),t=Math.floor(t),0===e&&0===t)return;const[s=0,r=0]=null!=(i=this._lastAutoSize)?i:[];s===e&&r===t||(this._lastAutoSize=[e,t],this.resize(void 0,void 0,"SizeMonitor"))}resize(e,t,i){var s,r,n,o;const{scene:a,animationManager:l}=this.ctx;if(null!=e||(e=null!=(r=this.width)?r:this.autoSize?null==(s=this._lastAutoSize)?void 0:s[0]:a.canvas.width),null!=t||(t=null!=(o=this.height)?o:this.autoSize?null==(n=this._lastAutoSize)?void 0:n[1]:a.canvas.height),this.debug(`Chart.resize() from ${i}`,{width:e,height:t,stack:(new Error).stack}),e&&t&&ze(e)&&ze(t)&&a.resize(e,t)){this.resetPointer(),l.reset();let e=!0;this.autoSize&&this._firstAutoSize&&(e=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:e})}}updateData(){return S(this,null,function*(){this.series.forEach(e=>e.setChartData(this.data));const e=this.modulesManager.mapModules(e=>{var t;return null==(t=e.updateData)?void 0:t.call(e,{data:this.data})});yield Promise.all(e)})}processData(){return S(this,null,function*(){if(this.series.some(e=>e.canHaveAxes)){this.assignAxesToSeries();const e=this.modulesManager.getModule("sync");(null==e?void 0:e.enabled)?e.syncAxes(this._skipSync):this.assignSeriesToAxes()}const e=new Jc(this.mode),t=this.series.map(t=>t.processData(e)),i=this.modulesManager.mapModules(t=>{var i;return null==(i=t.processData)?void 0:i.call(t,{dataController:e})});e.execute(),yield Promise.all([...t,...i]);for(const{legendType:e,legend:t}of this.modulesManager.legends())t.data=this.getLegendData(e,"integrated"!==this.mode);this.dataProcessListeners.forEach(e=>e()),this.dataProcessListeners.clear()})}placeLabels(){const e=[],t=[];for(const i of this.series){if(!i.visible)continue;const s=i.getLabelData();Ua(null==s?void 0:s[0])&&(t.push(s),e.push(i))}const{seriesRect:i}=this,{top:s,right:r,bottom:n,left:o}=this.seriesArea.padding,a=i&&t.length>0?function(e,t,i=5){var s,r;const n=[];e=e.map(e=>e.slice().sort((e,t)=>t.point.size-e.point.size));for(let o=0;o<e.length;o++){const a=n[o]=[],l=e[o];if((null==l?void 0:l.length)&&l[0].label)for(let o=0,c=l.length;o<c;o++){const c=l[o],{point:h,label:d,marker:u}=c,{text:p,width:g,height:m}=d,f=.5*h.size;let y=0,v=0;if(f>0&&null!=c.placement){const e=za[c.placement];y=(.5*g+f+i)*e.x,v=(.5*m+f+i)*e.y}const C=h.x-.5*g+y-((null!=(s=null==u?void 0:u.center.x)?s:.5)-.5)*h.size,b=h.y-.5*m+v-((null!=(r=null==u?void 0:u.center.y)?r:.5)-.5)*h.size;t&&!Ha(t,C,b,g,m)||e.some(e=>e.some(e=>{var t;return Ba(e.point,null==(t=e.marker)?void 0:t.center,C,b,g,m)}))||n.some(e=>e.some(e=>Va(e,C,b,g,m)))||a.push({index:o,text:p,x:C,y:b,width:g,height:m,datum:c})}}return n}(t,{x:-o,y:-s,width:i.width+o+r,height:i.height+s+n}):[];return new Map(a.map((t,i)=>[e[i],t]))}getLegendData(e,t){var i,s;const r=this.series.filter(e=>e.properties.showInLegend).flatMap(t=>t.getLegendData(e));if(t&&r.every(e=>"category"===e.legendType)){const e={},t=new Map(this.series.map(e=>[e.id,e.type]));for(const{seriesId:n,marker:o,label:a}of r){if(null==o.fill)continue;const r=t.get(n),l=null!=(i=e[r])?i:e[r]={};null!=l[s=a.text]||(l[s]=o.fill),l[a.text]!==o.fill&&N.warnOnce(`legend item '${a.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}return r}processLayout(){return S(this,null,function*(){var e;const t=this.animationRect;yield this.performLayout(),t&&!(null==(e=this.animationRect)?void 0:e.equals(t))&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)})}performLayout(){return S(this,null,function*(){const{width:e,height:t}=this.ctx.scene;let i={shrinkRect:new Js(0,0,e,t)};i=this.ctx.layoutService.dispatchPerformLayout("start-layout",i),i=this.ctx.layoutService.dispatchPerformLayout("before-series",i);const s=this.modulesManager.mapModules(e=>S(this,null,function*(){null!=e.performLayout&&(i=yield e.performLayout(i))}));return yield Promise.all(s),i.shrinkRect})}pickSeriesNode(e,t,i){var s,r;const n=performance.now(),o=t?[0]:void 0,a=[...this.series].reverse();let l;for(const t of a){if(!t.visible||!t.rootGroup.visible)continue;const{match:r,distance:n}=null!=(s=t.pickNode(e,o))?s:{};if(r&&null!=n&&((!l||l.distance>n)&&n<=(null!=i?i:1/0)&&(l={series:t,distance:n,datum:r}),0===n))break}return this.extraDebugStats.pickSeriesNode=Math.round((null!=(r=this.extraDebugStats.pickSeriesNode)?r:0)+(performance.now()-n)),l}onMouseMove(e){this.lastInteractionEvent=e,this.pointerScheduler.schedule(),this.extraDebugStats.mouseX=e.offsetX,this.extraDebugStats.mouseY=e.offsetY,this.update(6)}onLeave(e){this.tooltip.pointerLeftOntoTooltip(e)||(this.resetPointer(),this.update(6),this.ctx.cursorManager.updateCursor("chart"))}onBrowserFocus(e){e.delta>0?(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=0,this.focus.seriesIndex=0):(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=1/0,this.focus.seriesIndex=1/0)}onAnimationStart(){this.focus.hasFocus&&this.onBlur()}onBlur(){this.ctx.regionManager.updateFocusIndicatorRect(void 0),this.resetPointer(),this.focus.hasFocus=!1}onTab(e){this.handleFocus(),e.consume(),this.focus.hasFocus=!0}onNavVert(e){this.focus.seriesIndex+=e.delta,this.handleFocus(),e.consume()}onNavHori(e){this.focus.datumIndex+=e.delta,this.handleFocus(e.delta),e.consume()}onSubmit(e){const{series:t,datum:i}=this.focus,s=e.sourceEvent.sourceEvent;void 0!==t&&void 0!==i?t.fireNodeClickEvent(s,i):this.fireEvent({type:"click",event:s})}onContextMenu(e){this.ctx.tooltipManager.removeTooltip(this.id);const{Default:t,ContextMenu:i}=pc;this.ctx.interactionManager.getState()&(t|i)&&this.checkSeriesNodeRange(e,()=>{this.ctx.highlightManager.updateHighlight(this.id)})}handleFocus(e){this.focus.hasFocus=!0;const t=this.overlays.getFocusInfo();null==t?this.handleSeriesFocus(null!=e?e:0):(this.ctx.regionManager.updateFocusIndicatorRect(t.rect),this.ctx.ariaAnnouncementService.announceValue(t.text))}handleSeriesFocus(e){const{series:t,seriesRect:i,focus:s}=this,r=t.filter(e=>e.visible);if(0===r.length)return;s.seriesIndex=Vs(0,s.seriesIndex,r.length-1),s.series=r[s.seriesIndex];const n=s.series.pickFocus({datumIndex:s.datumIndex,datumIndexDelta:e,seriesRect:i});if(void 0===n)return;const{datum:o,datumIndex:a}=n;s.datumIndex=a,s.datum=o;const l=nh(this.ctx.regionManager,n);if(void 0!==l){this.lastInteractionEvent=l;const e=s.series.getTooltipHtml(o),t=Fc.makeTooltipMeta(this.lastInteractionEvent,o);this.ctx.highlightManager.updateHighlight(this.id,o),this.ctx.tooltipManager.updateTooltip(this.id,t,e),this.ctx.ariaAnnouncementService.announceValue(e.ariaLabel)}}static isHoverEvent(e){return void 0!==e&&"hover"===e.type}handlePointer(t,i){if(16!==this.ctx.interactionManager.getState()||!e.isHoverEvent(t))return;const{lastPick:s,hoverRect:r}=this,{offsetX:n,offsetY:o}=t,a=(e=!1)=>{s&&this.resetPointer(e)};(i?!this.ctx.animationManager.isActive():null==r?void 0:r.containsPoint(n,o))?(this.handlePointerTooltip(t,a),this.handlePointerNode(t)):a()}handlePointerTooltip(e,t){const{lastPick:i,tooltip:s}=this,{range:r}=s,{offsetX:n,offsetY:o}=e;let a;ze(r)&&(a=r);const l=this.pickSeriesNode({x:n,y:o},"exact"===r,a);if(!l)return this.ctx.tooltipManager.removeTooltip(this.id),void("tooltip"===this.highlight.range&&t(!0));const c="node"===this.highlight.range||!i||i!==l.datum;let h;c&&(h=l.series.getTooltipHtml(l.datum),"tooltip"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,l.datum));const d=null!=a,u=this.tooltip.enabled&&l.series.tooltipEnabled,p="exact"===r&&0===l.distance,g=u&&("nearest"===r||d||p)&&(!c||void 0!==h),m=Fc.makeTooltipMeta(e,l.datum);g&&this.ctx.tooltipManager.updateTooltip(this.id,m,h)}handlePointerNode(e){this.checkSeriesNodeRange(e,(e,t)=>{(e.hasEventListener("nodeClick")||e.hasEventListener("nodeDoubleClick"))&&this.ctx.cursorManager.updateCursor("chart","pointer"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,t)})||(this.ctx.cursorManager.updateCursor("chart"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id))}onClick(e){this.checkSeriesNodeClick(e)?this.update(4):this.fireEvent({type:"click",event:e.sourceEvent})}onDoubleClick(e){this.checkSeriesNodeDoubleClick(e)?this.update(4):this.fireEvent({type:"doubleClick",event:e.sourceEvent})}checkSeriesNodeClick(e){return this.checkSeriesNodeRange(e,(t,i)=>t.fireNodeClickEvent(e.sourceEvent,i))}checkSeriesNodeDoubleClick(e){return this.checkSeriesNodeRange(e,(t,i)=>t.fireNodeDoubleClickEvent(e.sourceEvent,i))}checkSeriesNodeRange(e,t){var i;const s=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!1),r=null==s?void 0:s.datum,n=null==r?void 0:r.series.properties.nodeClickRange;let o;ze(n)&&(o=n);let a=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!0);if(a?this.ctx.highlightManager.updatePicked(this.id,a.datum):this.ctx.highlightManager.updatePicked(this.id),r&&"nearest"===n)return t(r.series,r),!0;if("exact"!==n&&(a=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!1,o)),!a)return!1;const l=null!=o,c="exact"===n&&0===a.distance;return!(!l&&!c||void 0!==e.pointerHistory&&!(null==(i=e.pointerHistory)?void 0:i.every(e=>{const t={x:e.offsetX,y:e.offsetY},i=this.pickSeriesNode(t,!1,o);return(null==i?void 0:i.datum)===(null==a?void 0:a.datum)})))&&(t(a.series,a.datum),!0)}changeHighlightDatum(e){var t,i;const s=new Set,{series:r,datum:n}=null!=(t=e.currentHighlight)?t:{},{series:o,datum:a}=null!=(i=e.previousHighlight)?i:{};o&&s.add(o),r&&s.add(r),(null==o?void 0:o.properties.cursor)&&a&&this.ctx.cursorManager.updateCursor(o.id),(null==r?void 0:r.properties.cursor)&&n&&this.ctx.cursorManager.updateCursor(r.id,r.properties.cursor),this.lastPick=e.currentHighlight,null==r||null==o?this.update(4):this.update(4,{seriesToUpdate:s})}waitForUpdate(e=1e4,t=!1){return S(this,null,function*(){const i=performance.now();for(this._pendingFactoryUpdatesCount>0&&(yield this.updateMutex.waitForClearAcquireQueue());7!==this.performUpdateType;){if(performance.now()-i>e){const i=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(t)throw new Error(i);N.warnOnce(i)}yield Yl(50)}yield this.updateMutex.waitForClearAcquireQueue()})}waitForDataProcess(e){return new Promise(t=>{this.dataProcessListeners.add(t),Ue(e)&&setTimeout(()=>{this.dataProcessListeners.has(t)&&(this.dataProcessListeners.delete(t),t())},e)})}getMinRects(){const{width:e,height:t}=this.ctx.scene,i=this.series.map(i=>i.getMinRects(e,t)).filter(Pe);if(0===i.length)return;let s=0,r=0,n=0,o=0;for(const{minRect:e,minVisibleRect:t}of i)s=Math.max(s,e.width),r=Math.max(r,e.height),n=Math.max(n,t.width),o=Math.max(o,t.height);const a=new Js(0,0,s,r);let l=a.clone();return n>0&&o>0&&(l=new Js(0,0,n,o)),{minRect:a,minVisibleRect:l}}filterMiniChartSeries(e){return null==e?void 0:e.filter(e=>!1!==e.showInMiniChart)}applyOptions(e){var t,i,s,r,n;const o=this.processedOptions,a=e.diffOptions(o),l=e.userOptions;if(null==a)return;td("AgChartV2.updateDelta() - applying delta",a);const c=qe(a,o),h=this.applyModules(c);a.listeners&&this.registerListeners(this,a.listeners),Mt(this,a,{skip:["type","data","series","listeners","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","axes","topology"]});let d=!1,u="no-op";(null==(t=a.series)?void 0:t.length)&&(u=this.applySeries(this,a.series,null==o?void 0:o.series),d=!0),"replaced"===u&&this.resetAnimations(),this.applyAxes(this,c,o,u)&&(d=!0),a.data&&(this.data=a.data),(null==(i=a.legend)?void 0:i.listeners)&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,a.legend.listeners),a.listeners&&this.updateAllSeriesListeners(),this.chartOptions=e,this.processedOptions=c,this.userOptions=qe(l,this.userOptions);const p=this.modulesManager.getModule("navigator"),g=this.modulesManager.getModule("zoom");(null==p?void 0:p.enabled)||(null==g?void 0:g.enabled)||this.ctx.zoomManager.updateZoom("chart");const m=null==p?void 0:p.miniChart,f=null!=(n=null==(r=null==(s=c.navigator)?void 0:s.miniChart)?void 0:r.series)?n:c.series;!0===(null==m?void 0:m.enabled)&&null!=f?this.applyMiniChartOptions(m,f,c,o):!1===(null==m?void 0:m.enabled)&&(m.series=[],m.axes=[]),Es("\n/* Reset */\n\n[class^='ag-charts'],\n[class^='ag-charts']:focus,\n[class^='ag-charts']:after,\n[class^='ag-charts']:before {\n    box-sizing: border-box;\n    outline: none;\n}\n\nbutton[class^='ag-charts'] {\n    background: none;\n    border: 0;\n}\n\n\n\n/* Icons */\n\n[class^='ag-charts-icon'] {\n    display: block;\n    /* speak: none; */\n    mask-size: contain;\n    mask-repeat: no-repeat;\n    background-color: currentColor;\n}\n\n.ag-charts-icon-zoom-in {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+);\n}\n\n.ag-charts-icon-zoom-out {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-reset {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXJvdGF0ZS1jY3ciPjxwYXRoIGQ9Ik0zIDEyYTkgOSAwIDEgMCA5LTkgOS43NSA5Ljc1IDAgMCAwLTYuNzQgMi43NEwzIDgiLz48cGF0aCBkPSJNMyAzdjVoNSIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-left {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGVmdCI+PHBhdGggZD0ibTE1IDE4LTYtNiA2LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-right {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQiPjxwYXRoIGQ9Im05IDE4IDYtNi02LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-start {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tZmlyc3QiPjxwYXRoIGQ9Im0xNyAxOC02LTYgNi02Ii8+PHBhdGggZD0iTTcgNnYxMiIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-end {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGFzdCI+PHBhdGggZD0ibTcgMTggNi02LTYtNiIvPjxwYXRoIGQ9Ik0xNyA2djEyIi8+PC9zdmc+);\n}\n\n\n\n/* AG Charts Theme Default */\n\n.ag-charts-theme-default,\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-active-color: var(--ag-active-color, #2196f3);\n    --ag-charts-background-color: var(--ag-background-color, #fff);\n    --ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);\n    --ag-charts-border-color: var(--ag-border-color, #dddddd);\n\n    /* Sizing */\n    --ag-charts-font-size: var(--ag-font-size, 14px);\n    --ag-charts-size: var(--ag-grid-size, 8px);\n\n    /* Borders */\n    --ag-charts-border: var(--ag-borders, solid 1px);\n    --ag-charts-border-critical: var(--ag-borders-critical, solid 1px);\n\n    /* Toolbar */\n    --ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));\n    --ag-charts-toolbar-background-color: var(\n        --ag-header-background-color,\n        color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%)\n    );\n    --ag-charts-toolbar-size: var(--ag-header-height, 48px);\n    --ag-charts-toolbar-padding: calc(var(--ag-charts-size) * 2);\n    --ag-charts-toolbar-border: var(--ag-charts-border, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-border-critical: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);\n    --ag-charts-toolbar-disabled-foreground-color: var(\n        --ag-disabled-foreground-color,\n        color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%)\n    );\n    --ag-charts-toolbar-disabled-background-color: var(\n        --ag-input-disabled-background-color,\n        color-mix(in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6%)\n    );\n    --ag-charts-toolbar-gap: var(--ag-charts-size);\n\n    /* Buttons */\n    --ag-charts-button-padding: var(--ag-charts-size);\n    --ag-charts-button-radius: var(--ag-border-radius, 4px);\n\n    /* Focus Indicator */\n    --ag-charts-focus-border: solid 2px var(--ag-input-focus-border-color, var(--ag-charts-active-color));\n    --ag-charts-focus-border-shadow: var(--ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-focus-border) 47%));\n\n    /* Icons */\n    --ag-charts-icon-font-family: 'agChartsDefault';\n    --ag-charts-icon-font-weight: normal;\n    --ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);\n}\n\n\n\n/* AG Charts Theme Default Dark */\n\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));\n    --ag-charts-foreground-color: var(--ag-foreground-color, #fff);\n    --ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, 0.16));\n    --ag-charts-hover-color: var(\n        --ag-row-hover-color,\n        color-mix(in srgb, transparent, var(--ag-charts-active-color) 20%)\n    );\n\n    /* Toolbar */\n    --ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));\n}\n\n\n","chart"),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),d||(d=this.shouldForceNodeDataRefresh(a,u));const y=d||h?0:3;this.maybeResetAnimations(u),td("AgChartV2.applyChartOptions() - update type",Vc[y],{seriesStatus:u,forceNodeDataRefresh:d}),this.update(y,{forceNodeDataRefresh:d,newAnimationBatch:!0})}maybeResetAnimations(e){if("standalone"===this.mode)switch(e){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(e,t){const i=!!e.data||"data-change"===t||"replaced"===t,s=It.getKeys(),r=Object.values(s).some(t=>null!=e[t]),n=null!=e.title&&null!=e.subtitle;return i||r||n}applyMiniChartOptions(e,t,i,s){var r,n,o,a,l;const c=null!=(o=null==(n=null==(r=null==s?void 0:s.navigator)?void 0:r.miniChart)?void 0:n.series)?o:null==s?void 0:s.series,h=this.applySeries(e,this.filterMiniChartSeries(t),this.filterMiniChartSeries(c));this.applyAxes(e,i,s,h,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const d=e.axes,u=d.find(e=>"x"===e.direction);for(const e of d)e.gridLine.enabled=!1,e.label.enabled=e===u,e.tick.enabled=!1,e.interactionEnabled=!1;if(null!=u){const e=null==(a=i.navigator)?void 0:a.miniChart,t=null==e?void 0:e.label,s=null==(l=null==e?void 0:e.label)?void 0:l.interval;u.line.enabled=!1,u.label.set(Qe(t,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),u.tick.set(Qe(s,["enabled","width","size","color","interval","step"]));const r=null==s?void 0:s.step;null!=r&&(u.tick.interval=r)}}applyModules(e){var t;const{type:i}=this.constructor;let s=!1;for(const r of we.byType("root","legend")){const n=null!=e[r.optionsKey]&&r.chartTypes.includes(i);n!==this.modulesManager.isEnabled(r)&&(n?(this.modulesManager.addModule(r,e=>new e.instanceConstructor(this.getModuleContext())),"legend"===r.type&&(null==(t=this.modulesManager.getModule(r))||t.attachLegend(this.ctx.scene)),this[r.optionsKey]=this.modulesManager.getModule(r)):(this.modulesManager.removeModule(r),delete this[r.optionsKey]),s=!0)}return s}applySeries(e,t,i){var s;if(!t)return"no-change";const r=function(e,t,i){var s,r,n,o;const a=(e,t)=>{const i=[e];for(const e of ch)e in t&&null!=t[e]&&i.push(`${e}=${t[e]}`);return i.join(";")},l=new Map;let c=0;for(const t of e){const e=a(t.type,t.properties);l.has(e)||l.set(e,[]),null==(s=l.get(e))||s.push([t,c++])}const h=new Map;for(const e of t){const t=a(e.type,e);h.has(t)||h.set(t,[]),null==(r=h.get(t))||r.push(e)}if(![...l.keys()].some(e=>h.has(e)))return{status:"no-overlap",oldKeys:l.keys(),newKeys:h.keys()};const d=[];let u=-1;for(const[e,t]of h.entries())for(const s of t){u++;const t=l.get(e);if(null==t||t.length<1){d.push({opts:s,idx:u,status:"add"}),l.delete(e);continue}const[r,a]=t.shift(),c=St(null!=(n=null==i?void 0:i[a])?n:{},null!=s?s:{}),{groupIndex:h,stackIndex:p}=null!=(o=null==c?void 0:c.seriesGrouping)?o:{};null!=h||null!=p?d.push({opts:s,series:r,diff:c,idx:a,status:"series-grouping"}):c?d.push({opts:s,series:r,diff:c,idx:a,status:"update"}):d.push({opts:s,series:r,idx:a,status:"no-op"}),0===t.length&&l.delete(e)}for(const e of l.values())for(const[t,i]of e)d.push({series:t,idx:i,status:"remove"});return{status:"overlap",changes:d}}(e.series,t,i);if("no-overlap"===r.status)return td(`AgChartV2.applySeries() - creating new series instances, status: ${r.status}`,r),e.series=t.map(e=>this.createSeries(e)),"replaced";td("AgChartV2.applySeries() - matchResult",r);const n=[];let o=!1,a=!1,l=!1;for(const e of r.changes)switch(a||(a="series-grouping"===e.status),o||(o=null!=(null==(s=e.diff)?void 0:s.data)),l||(l="no-op"!==e.status),e.status){case"add":const t=this.createSeries(e.opts);n.push(t),td("AgChartV2.applySeries() - created new series",t);break;case"remove":td(`AgChartV2.applySeries() - removing series at previous idx ${e.idx}`,e.series);break;case"no-op":n.push(e.series),td(`AgChartV2.applySeries() - no change to series at previous idx ${e.idx}`,e.series);break;default:const{series:i,diff:s,idx:r}=e;td(`AgChartV2.applySeries() - applying series diff previous idx ${r}`,s,i),this.applySeriesValues(i,s),i.markNodeDataDirty(),n.push(i)}for(let e=0;e<n.length;e++)n[e]._declarationOrder=e;return td("AgChartV2.applySeries() - final series instances",n),e.series=n,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(e,t,i,s,r=[]){if(!("axes"in t)||!t.axes)return!1;r=["axes[].type",...r];const{axes:n}=t;return"replaced"!==s&&e.axes.length===n.length&&e.axes.every((e,t)=>e.type===n[t].type)&&ut(i)?(e.axes.forEach((e,t)=>{var s,o;const a=St(null!=(o=null==(s=i.axes)?void 0:s[t])?o:{},n[t]);td(`AgChartV2.applyAxes() - applying axis diff idx ${t}`,a);const l=`axes[${t}]`;Mt(e,a,f(m({},Kn),{path:l,skip:r}))}),!0):(td(`AgChartV2.applyAxes() - creating new axes instances; seriesStatus: ${s}`),e.axes=this.createAxis(n,r),!0)}createSeries(e){const t=Dt.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(t,e),this.applySeriesValues(t,e),t}applySeriesOptionModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();for(const r of we.byType("series-option"))r.optionsKey in t&&r.seriesTypes.includes(e.type)&&s.addModule(r,e=>new e.instanceConstructor(i))}applySeriesValues(e,t){const i=e.getModuleMap(),s=t,{type:r,data:n,listeners:o,seriesGrouping:a,showInMiniChart:l}=s,c=y(s,["type","data","listeners","seriesGrouping","showInMiniChart"]);for(const e of lt)if("series-option"===e.type&&e.optionsKey in c){const t=i.getModule(e.optionsKey),s=c[e.optionsKey];delete c[e.optionsKey],t.properties.set(s)}e.properties.set(c),"data"in t&&e.setOptionsData(n),o&&this.registerListeners(e,o),"seriesGrouping"in t&&(e.seriesGrouping=null==a?void 0:m(m({},e.seriesGrouping),a))}createAxis(e,t){const i=new lh,s=this.getModuleContext();for(let r=0;r<e.length;r++){const n=e[r],o=xe.create(n.type,s);this.applyAxisModules(o,n),Mt(o,n,f(m({},Kn),{path:`axes[${r}]`,skip:t})),i.push(o,n)}return i.guessInvalidPositions()}applyAxisModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();for(const r of we.byType("axis-option")){const n=null!=t[r.optionsKey];n!==s.isEnabled(r)&&(n?(s.addModule(r,e=>new e.instanceConstructor(i)),e[r.optionsKey]=s.getModule(r)):(s.removeModule(r),delete e[r.optionsKey]))}}registerListeners(e,t){e.clearEventListeners();for(const[i,s]of Object.entries(t))Fe(s)&&e.addEventListener(i,s)}};sd.chartsInstances=new WeakMap,C([qa({newValue(e){this.destroyed||(e.setAttribute("data-ag-charts",""),e.appendChild(this.element),sd.chartsInstances.set(e,this))},oldValue(e){e.removeAttribute("data-ag-charts"),e.removeChild(this.element),sd.chartsInstances.delete(e)}})],sd.prototype,"container",2),C([qa({newValue(e){this.resize(e,void 0,"width option")}})],sd.prototype,"width",2),C([qa({newValue(e){this.resize(void 0,e,"height option")}})],sd.prototype,"height",2),C([qa({newValue(e){this.onAutoSizeChange(e)}}),jr(Zr)],sd.prototype,"autoSize",2),C([jr(qr)],sd.prototype,"padding",2),C([jr(qr)],sd.prototype,"seriesArea",2),C([jr(qr)],sd.prototype,"title",2),C([jr(qr)],sd.prototype,"subtitle",2),C([jr(qr)],sd.prototype,"footnote",2),C([jr(qr)],sd.prototype,"keyboard",2),C([jr(On(["standalone","integrated"],"a chart mode"))],sd.prototype,"mode",2),C([qa({changeValue(e,t){this.onAxisChange(e,t)}})],sd.prototype,"axes",2),C([qa({changeValue(e,t){this.onSeriesChange(e,t)}})],sd.prototype,"series",2);var rd=sd;function nd(e,t,i,s,r,n,o,a){const l=(i-e)*(a-n)-(s-t)*(o-r);if(0===l)return 0;const c=((o-r)*(t-n)-(e-r)*(a-n))/l,h=((i-e)*(t-n)-(s-t)*(e-r))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function od(e,t,i,s,r,n,o,a,l,c,h,d){let u=0;const p=c-d,g=h-l,m=l*(d-c)-c*(h-l),f=ad(e,i,r,o),y=ad(t,s,n,a),v=function(e,t,i,s){if(0===e)return function(e,t,i){if(0===e)return function(e,t){const i=-t/e;return 0!==e&&i>=0&&i<=1?[i]:[]}(t,i);const s=t*t-4*e*i,r=[];if(0===s){const i=-t/(2*e);i>=0&&i<=1&&r.push(i)}else if(s>0){const i=Math.sqrt(s),n=(-t-i)/(2*e),o=(-t+i)/(2*e);n>=0&&n<=1&&r.push(n),o>=0&&o<=1&&r.push(o)}return r}(t,i,s);const r=t/e,n=i/e,o=(3*n-r*r)/9,a=(9*r*n-s/e*27-2*r*r*r)/54,l=o*o*o+a*a,c=1/3,h=[];if(l>=0){const e=Math.sqrt(l),t=Math.sign(a+e)*Math.pow(Math.abs(a+e),c),i=Math.sign(a-e)*Math.pow(Math.abs(a-e),c),s=Math.abs(Math.sqrt(3)*(t-i)/2),n=-c*r+(t+i);if(n>=0&&n<=1&&h.push(n),0===s){const e=-c*r-(t+i)/2;e>=0&&e<=1&&h.push(e)}}else{const e=Math.acos(a/Math.sqrt(-o*o*o)),t=c*r,i=2*Math.sqrt(-o),s=i*Math.cos(c*e)-t,n=i*Math.cos(c*(e+2*Math.PI))-t,l=i*Math.cos(c*(e+4*Math.PI))-t;s>=0&&s<=1&&h.push(s),n>=0&&n<=1&&h.push(n),l>=0&&l<=1&&h.push(l)}return h}(p*f[0]+g*y[0],p*f[1]+g*y[1],p*f[2]+g*y[2],p*f[3]+g*y[3]+m);for(const e of v){const t=e*e,i=e*t,s=f[0]*i+f[1]*t+f[2]*e+f[3],r=y[0]*i+y[1]*t+y[2]*e+y[3];let n;n=l===h?(r-c)/(d-c):(s-l)/(h-l),n>=0&&n<=1&&u++}return u}function ad(e,t,i,s){return[3*t-e-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function ld(e,t,i,s,r,n,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;n&&([r,s]=[s,r]);const h=(c-a)/(l-o),d=a-h*o,u=Math.pow(h,2)+1,p=2*(h*(d-t)-e),g=Math.pow(e,2)+Math.pow(d-t,2)-Math.pow(i,2),m=Math.pow(p,2)-4*u*g;if(m<0)return 0;const f=(-p+Math.sqrt(m))/2/u,y=(-p-Math.sqrt(m))/2/u;let v=0;return[f,y].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const n=i-e,a=h*i+d-t;Or(Math.atan2(a,n),s,r)&&v++}),v}var cd=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,r){r=Math.min(r,i/2,s/2),this.moveTo(e,t+r),this.arc(e+r,t+r,r,Math.PI,1.5*Math.PI),this.lineTo(e+r,t),this.lineTo(e+i-r,t),this.arc(e+i-r,t+r,r,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+r),this.lineTo(e+i,t+s-r),this.arc(e+i-r,t+s-r,r,0,Math.PI/2),this.lineTo(e+i-r,t+s),this.lineTo(e+r,t+s),this.arc(e+ +r,t+s-r,r,Math.PI/2,Math.PI),this.lineTo(e,t+s-r),this.closePath()}arc(e,t,i,s,r,n){this.openedPath=!0,this.path2d.arc(e,t,i,s,r,n),this.commands.push(2),this.params.push(e,t,i,s,r,n?1:0)}cubicCurveTo(e,t,i,s,r,n){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,r,n),this.commands.push(3),this.params.push(e,t,i,s,r,n)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,s=this.params,r=i.length,n=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,d=0;for(let u=0,p=0;u<r;u++)switch(i[u]){case 0:d+=nd(a,l,c,h,n,o,e,t),c=s[p++],a=c,h=s[p++],l=h;break;case 1:d+=nd(c,h,s[p++],s[p++],n,o,e,t),c=s[p-2],h=s[p-1];break;case 3:d+=od(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],n,o,e,t),c=s[p-2],h=s[p-1];break;case 2:const i=s[p++],r=s[p++],u=s[p++],g=s[p++],m=s[p++];d+=ld(i,r,u,g,m,Boolean(s[p++]),n,o,e,t),isNaN(a)||(d+=nd(c,h,i+Math.cos(g)*u,r+Math.sin(g)*u,n,o,e,t)),c=i+Math.cos(m)*u,h=r+Math.sin(m)*u;break;case 4:d+=nd(a,l,c,h,n,o,e,t)}return d%2==1}distanceSquared(e,t){let i=1/0;const s=this.commands,r=this.params,n=s.length;let o=NaN,a=NaN,l=0,c=0;for(let h=0,d=0;h<n;h++)switch(s[h]){case 0:l=o=r[d++],c=a=r[d++];break;case 1:i=Oa(e,t,l,c,r[d++],r[d++],i);break;case 3:N.error("Command.Curve distanceSquare not implemented");break;case 2:{const s=r[d++],n=r[d++],o=r[d++],a=r[d++],h=r[d++],u=s+Math.cos(a)*o,p=n+Math.sin(a)*o,g=Boolean(r[d++]);i=Oa(e,t,l,c,u,p,i),i=Fa(e,t,s,n,o,a,h,g,i),l=s+Math.cos(h)*o,c=n+Math.sin(h)*o;break}case 4:i=Oa(e,t,l,c,o,a,i)}return i}getPoints(){const{commands:e,params:t}=this,i=[];let s=0;for(let r=0;r<e.length;r++)switch(e[r]){case 0:case 1:i.push({x:t[s++],y:t[s++]});break;case 3:s+=4,i.push({x:t[s++],y:t[s++]});break;case 2:i.push({x:t[s++],y:t[s++]}),s+=4}return i}};function hd(e){const{redraw:t=3,changeCb:i,convertor:s}=null!=e?e:{};return ir({redraw:t,type:"path",convertor:s,changeCb:i})}var dd=class extends Do{constructor(){super(...arguments),this.path=new cd,this._clipX=NaN,this._clipY=NaN,this._dirtyPath=!0}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty(this,3))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){var e,t,i,s;this._dirtyPath||(this.dirtyPath=this.path.isDirty()||null!=(t=null==(e=this.fillShadow)?void 0:e.isDirty())&&t||null!=(s=null==(i=this._clipPath)?void 0:i.isDirty())&&s)}isPointInPath(e,t){const i=this.transformPoint(e,t);return this.path.closedPath&&this.path.isPointInPath(i.x,i.y)}distanceSquared(e,t){const i=this.transformPoint(e,t);return this.path.distanceSquared(i.x,i.y)}isDirtyPath(){return!1}updatePath(){}render(e){var t,i,s,r;const{ctx:n,forceRender:o,stats:a}=e;if(0!==this.dirty||o){if(this.computeTransformMatrix(),this.matrix.toContext(n),(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),isNaN(this._clipX)||isNaN(this._clipY)||null==this.clipMode)this.drawPath(n);else{n.save();const e=this.strokeWidth/2;if(null!=this._clipPath||(this._clipPath=new cd),this._clipPath.clear(),this._clipPath.rect(-e,-e,this._clipX+e,this._clipY+e+e),"normal"===this.clipMode&&n.clip(null==(t=this._clipPath)?void 0:t.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(n),"punch-out"===this.clipMode){n.clip(null==(i=this._clipPath)?void 0:i.getPath2D());const{x:e=-1e4,y:t=-1e4,width:r=2e4,height:o=2e4}=null!=(s=this.computeBBox())?s:{};n.clearRect(e,t,r,o)}n.restore()}null==(r=this.fillShadow)||r.markClean(),super.render(e)}else a&&(a.nodesSkipped+=this.nodeCount.count)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}};dd.className="Path",C([hd()],dd.prototype,"clipMode",2),C([hd()],dd.prototype,"clipX",1),C([hd()],dd.prototype,"clipY",1);var ud=class{constructor(e,t,i){this.root=new md(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(t,i)=>e.distanceSquared(t,i)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},pd=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},gd=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=null!=i?i:Js.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(void 0===this.subdivisions?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:r}=this,n=this.maxdepth-1,o=i/2,a=s/2,l=new Js(e,t,o,a),c=new Js(e+o,t,o,a),h=new Js(e,t+a,o,a),d=new Js(e+o,t+a,o,a);return new pd(this.child(r,n,l),this.child(r,n,c),this.child(r,n,h),this.child(r,n,d))}},md=class e extends gd{addCondition(e){const{x:t,y:i}=e.hitTester.midPoint;return this.boundary.containsPoint(t,i)}findCondition(e,t,i){const{best:s}=i;return 0!==s.distanceSquared&&this.boundary.distanceSquared(e,t)<s.distanceSquared}findAction(e,t,i){const s=Xs(e,t,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(t,i,s){return new e(t,i,s)}},fd=class extends dd{constructor(){super(...arguments),this.x=0,this.y=0,this.size=12}computeBBox(){const{x:e,y:t,size:i}=this,{center:s}=this.constructor;return new Js(e-i*s.x,t-i*s.y,i,i)}applyPath(e,t){const{path:i}=this;let{x:s,y:r}=this;null!=this.repeat&&(s=0,r=0),i.clear();for(const{x:n,y:o,t:a}of t)s+=n*e,r+=o*e,"move"===a?i.moveTo(s,r):i.lineTo(s,r);i.closePath()}executeFill(e,t){if(!t)return;if(null==this.repeat)return super.executeFill(e,t);e.save();let i=this.translationX,s=this.translationY;for(const r of this.repeat)e.translate(r.x-i,r.y-s),e.fill(t),i=r.x,s=r.y;e.restore()}executeStroke(e,t){if(!t)return;if(null==this.repeat)return super.executeStroke(e,t);e.save();let i=this.translationX,s=this.translationY;for(const r of this.repeat)e.translate(r.x-i,r.y-s),e.stroke(t),i=r.x,s=r.y;e.restore()}};fd.center={x:.5,y:.5},C([hd()],fd.prototype,"x",2),C([hd()],fd.prototype,"y",2),C([hd({convertor:Math.abs})],fd.prototype,"size",2),C([hd()],fd.prototype,"repeat",2);var yd=class extends fd{updatePath(){const{x:e,y:t,path:i,size:s}=this,r=s/2;i.clear(),i.arc(e,t,r,0,2*Math.PI),i.closePath()}};yd.className="Circle";var vd=class e extends fd{updatePath(){const t=this.size/4.2;super.applyPath(t,e.moves)}};vd.className="Cross",vd.moves=[{x:-1,y:0,t:"move"},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:-1,y:1},{x:-1,y:-1}];var Cd=vd,bd=class e extends fd{updatePath(){const t=this.size/2;super.applyPath(t,e.moves)}};bd.className="Diamond",bd.moves=[{x:0,y:-1,t:"move"},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}];var Sd=bd,wd=class extends fd{rad(e){return e/180*Math.PI}updatePath(){const{x:e,path:t,size:i,rad:s}=this,r=i/4,n=this.y+r/2;t.clear(),t.arc(e-r,n-r,r,s(130),s(330)),t.arc(e+r,n-r,r,s(220),s(50)),t.lineTo(e,n+r),t.closePath()}};wd.className="Heart";var xd=class extends fd{updatePath(){const{path:e,x:t,y:i}=this,s=this.size,r=.5;e.clear(),e.moveTo(t+-.34375*s,i+-.65625*s),e.cubicCurveTo(t+-.34375*s,i+-.848509*s,t+-.192259*s,i+-1*s,t+0*s,i+-1*s),e.cubicCurveTo(t+(.692259-r)*s,i+-1*s,t+.34375*s,i+-.848509*s,t+.34375*s,i+-.65625*s),e.cubicCurveTo(t+.34375*s,i+-.506176*s,t+.284625*s,i+(.600181-1)*s,t+(.716461-r)*s,i+(.695393-1)*s),e.cubicCurveTo(t+.199009*s,i+-.280231*s,t+(.681271-r)*s,i+-.256896*s,t+(.663785-r)*s,i+(.766105-1)*s),e.cubicCurveTo(t+(.611893-r)*s,i+(.834367-1)*s,t+(.562228-r)*s,i+(.899699-1)*s,t+(.528896-r)*s,i+(.980648-1)*s),e.cubicCurveTo(t+(.524075-r)*s,i+(.992358-1)*s,t+(.512663-r)*s,i+0*s,t+0*s,i+0*s),e.cubicCurveTo(t+(.487337-r)*s,i+0*s,t+(.475925-r)*s,i+(.992358-1)*s,t+(.471104-r)*s,i+(.980648-1)*s),e.cubicCurveTo(t+(.487337-r)*s,i+0*s,t+(.475925-r)*s,i+(.992358-1)*s,t+(.471104-r)*s,i+(.980648-1)*s),e.cubicCurveTo(t+(.437772-r)*s,i+(.899699-1)*s,t+(.388107-r)*s,i+(.834367-1)*s,t+(.336215-r)*s,i+(.766105-1)*s),e.cubicCurveTo(t+(.318729-r)*s,i+-.256896*s,t+-.199009*s,i+-.280231*s,t+(.283539-r)*s,i+(.695393-1)*s),e.cubicCurveTo(t+-.284625*s,i+(.600181-1)*s,t+-.34375*s,i+-.506176*s,t+-.34375*s,i+-.65625*s),e.closePath()}};xd.className="MapPin",xd.center={x:.5,y:1};var Ed=class e extends fd{updatePath(){const t=this.size/3;super.applyPath(t,e.moves)}};Ed.className="Plus",Ed.moves=[{x:-.5,y:-.5,t:"move"},{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:-1},{x:-1,y:0},{x:0,y:-1}];var Md=Ed,Ad=class extends fd{updatePath(){const{path:e,x:t,y:i}=this,s=this.size/2;e.clear(),e.moveTo(this.align(t-s),this.align(i-s)),e.lineTo(this.align(t+s),this.align(i-s)),e.lineTo(this.align(t+s),this.align(i+s)),e.lineTo(this.align(t-s),this.align(i+s)),e.closePath()}};Ad.className="Square";var Td=class extends fd{updatePath(){const{x:e,y:t,path:i,size:s}=this,r=s/2,n=Math.PI/2;i.clear();for(let o=0;o<10;o++){const a=o%2==0?s:r,l=o*Math.PI/5-n,c=e+Math.cos(l)*a,h=t+Math.sin(l)*a;i.lineTo(c,h)}i.closePath()}};Td.className="Star";var Dd=class e extends fd{updatePath(){const t=1.1*this.size;super.applyPath(t,e.moves)}};Dd.className="Triangle",Dd.moves=[{x:0,y:-.48,t:"move"},{x:.5,y:.87},{x:-1,y:0}];var Id=Dd,Rd={circle:yd,cross:Cd,diamond:Sd,heart:wd,pin:xd,plus:Md,square:Ad,star:Td,triangle:Id},Pd=Object.keys(Rd);function kd(e){return"string"==typeof e&&Pd.includes(e)}function Ld(e=Ad){return kd(e)?Rd[e]:"function"==typeof e?e:Ad}var Nd=class extends Xh{constructor(){super(...arguments),this.showFocusBox=!0}getScaleInformation({xScale:e,yScale:t}){return{isContinuousX:qn.is(e),isContinuousY:qn.is(t),xScaleType:null==e?void 0:e.type,yScaleType:null==t?void 0:t.type}}getModulePropertyDefinitions(){var e,t;const i=null==(e=this.axes.x)?void 0:e.scale,s=null==(t=this.axes.y)?void 0:t.scale;return this.moduleMap.mapModules(e=>e.getPropertyDefinitions(this.getScaleInformation({xScale:i,yScale:s}))).flat()}requestDataModel(e,t,i){return S(this,null,function*(){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:r}=yield e.request(this.id,null!=t?t:[],i);return this.dataModel=s,this.processedData=r,this.dispatch("data-processed",{dataModel:s,processedData:r}),{dataModel:s,processedData:r}})}isProcessedDataAnimatable(){var e,t;const i=null==(t=null==(e=this.processedData)?void 0:e.reduced)?void 0:t.animationValidation;if(!i)return!0;const{orderedKeys:s,uniqueKeys:r}=i;return s&&r}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){return this.doPickFocus(e,this)}doPickFocus(e,t){const i=this.getNodeData();if(void 0===i||0===i.length)return;const{datumIndexDelta:s,seriesRect:r}=e,n=this.computeFocusDatumIndex(e,i,t.seriesItemEnabled);if(void 0===n)return;const{showFocusBox:o}=this,a=i[n],l=this.computeFocusBounds({datumIndex:n,datumIndexDelta:s,seriesRect:r});return void 0!==l?{bbox:l,showFocusBox:o,datum:a,datumIndex:n}:void 0}computeFocusDatumIndex(e,t,i){i&&t.length!==i.length&&N.error(`invalid state: nodeData.length (${t.length} !== seriesItemEnabled.length (${null==i?void 0:i.length})`);const s=e=>{const s=t[e];return(void 0===s.missing||!1===s.missing)&&(void 0===i||i[e])},r=e=>{for(;e>=0&&!s(e);)e--;return-1===e?void 0:e},n=e=>{for(;e<t.length&&!s(e);)e++;return e===t.length?void 0:e};let o;const a=Vs(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?o=r(a):e.datumIndexDelta>0?o=n(a):(null!=o||(o=n(a)),null!=o||(o=r(a))),void 0===o?0===e.datumIndexDelta?void 0:e.datumIndex-e.datumIndexDelta:o}},_d=class extends yt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};C([jr(mn,{optional:!0})],_d.prototype,"fill",2),C([jr(rn,{optional:!0})],_d.prototype,"fillOpacity",2),C([jr(mn,{optional:!0})],_d.prototype,"stroke",2),C([jr(sn,{optional:!0})],_d.prototype,"strokeWidth",2),C([jr(rn,{optional:!0})],_d.prototype,"strokeOpacity",2),C([jr(En,{optional:!0})],_d.prototype,"lineDash",2),C([jr(sn,{optional:!0})],_d.prototype,"lineDashOffset",2);var Od=class extends yt{};C([jr(sn,{optional:!0})],Od.prototype,"strokeWidth",2),C([jr(rn,{optional:!0})],Od.prototype,"dimOpacity",2),C([jr(Zr,{optional:!0})],Od.prototype,"enabled",2);var Fd=class extends yt{constructor(){super(...arguments),this.color="black"}};C([jr(mn,{optional:!0})],Fd.prototype,"color",2);var Gd=class extends yt{constructor(){super(...arguments),this.item=new _d,this.series=new Od,this.text=new Fd}};C([jr(qr)],Gd.prototype,"item",2),C([jr(qr)],Gd.prototype,"series",2),C([jr(qr)],Gd.prototype,"text",2);var Bd=class extends yt{constructor(){super(...arguments),this.visible=!0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlightStyle=new Gd}};C([jr(Jr,{optional:!0})],Bd.prototype,"id",2),C([jr(Zr)],Bd.prototype,"visible",2),C([jr(Zr)],Bd.prototype,"showInLegend",2),C([jr(Jr)],Bd.prototype,"cursor",2),C([jr(Nn)],Bd.prototype,"nodeClickRange",2),C([jr(qr)],Bd.prototype,"highlightStyle",2);var Vd={x:["xKey"],y:["yKey"]},Hd={x:["xName"],y:["yName"]},Ud=class extends Yh{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},zd=class extends Bd{};C([jr(Jr,{optional:!0})],zd.prototype,"legendItemName",2);var Wd=class extends Nd{constructor(e){var t=e,{pathsPerSeries:i=1,hasMarkers:s=!1,hasHighlightedLabels:r=!1,pathsZIndexSubOrderOffset:n=[],datumSelectionGarbageCollection:o=!0,markerSelectionGarbageCollection:a=!0,animationAlwaysUpdateSelections:l=!1,animationResetFns:c,directionKeys:h,directionNames:d}=t,u=y(t,["pathsPerSeries","hasMarkers","hasHighlightedLabels","pathsZIndexSubOrderOffset","datumSelectionGarbageCollection","markerSelectionGarbageCollection","animationAlwaysUpdateSelections","animationResetFns","directionKeys","directionNames"]);if(super(m({directionKeys:h,directionNames:d,canHaveAxes:!0},u)),this.NodeEvent=Ud,this.dataNodeGroup=this.contentGroup.appendChild(new xo({name:`${this.id}-series-dataNodes`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.markerGroup=this.contentGroup.appendChild(new xo({name:`${this.id}-series-markers`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("marker")})),this.labelGroup=this.contentGroup.appendChild(new xo({name:`${this.id}-series-labels`,zIndex:8,zIndexSubOrder:this.getGroupZIndexSubOrder("labels")})),this.labelSelection=Na.select(this.labelGroup,Oo),this.highlightSelection=Na.select(this.highlightNode,()=>this.opts.hasMarkers?this.markerFactory():this.nodeFactory()),this.highlightLabelSelection=Na.select(this.highlightLabel,Oo),this.annotationSelections=new Set,this.minRectsCache={dirtyNodeData:!0},this.debug=Ds.create(),!h||!d)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:i,hasMarkers:s,hasHighlightedLabels:r,pathsZIndexSubOrderOffset:n,directionKeys:h,directionNames:d,animationResetFns:c,animationAlwaysUpdateSelections:l,datumSelectionGarbageCollection:o,markerSelectionGarbageCollection:a},this.paths=[];for(let e=0;e<i;e++)this.paths[e]=new dd,this.paths[e].zIndex=4,this.paths[e].zIndexSubOrder=this.getGroupZIndexSubOrder("paths",e),this.contentGroup.appendChild(this.paths[e]);this.datumSelection=Na.select(this.dataNodeGroup,()=>this.nodeFactory(),o),this.markerSelection=Na.select(this.markerGroup,()=>this.markerFactory(),a),this.animationState=new fa("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:e=>this.resetAllAnimation(e),reset:"empty"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){var e;return null==(e=this.contextNodeData)?void 0:e.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e?this.animationState.transition("skip"):"disabled"===e&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update(e){return S(this,arguments,function*({seriesRect:e}){var t,i;const{visible:s,_contextNodeData:r}=this,n=(null==(i=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight())?void 0:i.series)===this,o=this.checkResize(e),a=yield this.updateHighlightSelection(n);yield this.updateSelections(s),yield this.updateNodes(a,n,s);const l=this.getAnimationData(e,r);l&&(o&&this.animationState.transition("resize",l),this.animationState.transition("update",l))})}updateSelections(e){return S(this,null,function*(){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if((e||!i)&&(this.nodeDataRefresh||this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=yield this.createNodeData();const e=this.isProcessedDataAnimatable();this._contextNodeData&&(null!=(t=this._contextNodeData).animationValid||(t.animationValid=e)),this.minRectsCache.dirtyNodeData=!0;const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.dispatch("data-update",{dataModel:i,processedData:s})}yield this.updateSeriesSelections()}})}updateSeriesSelections(e){return S(this,null,function*(){const{datumSelection:t,labelSelection:i,markerSelection:s,paths:r}=this,n=this._contextNodeData;if(!n)return;const{nodeData:o,labelData:a,itemId:l}=n;yield this.updatePaths({seriesHighlighted:e,itemId:l,contextData:n,paths:r}),this.datumSelection=yield this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelSelection=yield this.updateLabelSelection({labelData:a,labelSelection:i}),this.opts.hasMarkers&&(this.markerSelection=yield this.updateMarkerSelection({nodeData:o,markerSelection:s}))})}markerFactory(){return new(Ld())}getGroupZIndexSubOrder(e,t=0){var i;const s=super.getGroupZIndexSubOrder(e,t);if("paths"===e){const[e]=s,r=null!=(i=this.opts.pathsZIndexSubOrderOffset[t])?i:0;s[0]=Fe(e)?()=>Number(e())+r:Number(e)+r}return s}updateNodes(e,t,i){return S(this,null,function*(){var s;const{highlightSelection:r,highlightLabelSelection:n,opts:{hasMarkers:o,hasHighlightedLabels:a}}=this,l=!this.ctx.animationManager.isSkipped(),c=this.visible&&null!=this._contextNodeData&&i;this.rootGroup.visible=l||c,this.contentGroup.visible=l||c,this.highlightGroup.visible=(l||c)&&t;const h=this.getOpacity();o?(yield this.updateMarkerNodes({markerSelection:r,isHighlight:!0}),this.animationState.transition("highlightMarkers",r)):(yield this.updateDatumNodes({datumSelection:r,isHighlight:!0}),this.animationState.transition("highlight",r)),a&&(yield this.updateLabelNodes({labelSelection:n}));const{dataNodeGroup:d,markerGroup:u,datumSelection:p,labelSelection:g,markerSelection:m,paths:f,labelGroup:y}=this,{itemId:v}=null!=(s=this.contextNodeData)?s:{};d.opacity=h,d.visible=l||c,y.visible=c,o&&(u.opacity=h,u.zIndex=d.zIndex>=4?d.zIndex:d.zIndex+1,u.visible=c),y&&(y.opacity=h),yield this.updatePathNodes({seriesHighlighted:t,itemId:v,paths:f,opacity:h,visible:c,animationEnabled:l}),d.visible&&(yield this.updateDatumNodes({datumSelection:p,highlightedItems:e,isHighlight:!1}),yield this.updateLabelNodes({labelSelection:g}),o&&(yield this.updateMarkerNodes({markerSelection:m,isHighlight:!1})))})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum&&e.itemId===t.itemId);return 0===i.length?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){return S(this,null,function*(){var t;const{highlightSelection:i,highlightLabelSelection:s,_contextNodeData:r}=this;if(!r)return;const n=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight(),o=e&&(null==n?void 0:n.datum)?n:void 0;let a,l;if(null!=o){const e=this.isLabelEnabled(),{labelData:t,nodeData:i}=r;l=this.getHighlightData(i,o),a=e?this.getHighlightLabelData(t,o):void 0}return this.highlightSelection=yield this.updateHighlightSelectionItem({items:l,highlightSelection:i}),this.highlightLabelSelection=yield this.updateHighlightSelectionLabel({items:a,highlightLabelSelection:s}),l})}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)!0!==e.datum.missing&&(yield e)}getQuadTree(){if(void 0===this.quadtree){const{width:e,height:t}=this.ctx.scene.canvas,i=new Js(0,0,e,t);this.quadtree=new ud(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodeExactShape(e){var t;const i=super.pickNodeExactShape(e);if(i)return i;const{x:s,y:r}=e,{opts:{hasMarkers:n}}=this;let o;const{dataNodeGroup:a,markerGroup:l}=this;if(o=a.pickNode(s,r),!o&&n&&(o=null==l?void 0:l.pickNode(s,r)),o&&!0!==o.datum.missing)return{datum:o.datum,distance:0};for(const i of this.moduleMap.modules()){const{datum:s}=null!=(t=i.pickNodeExact(e))?t:{};if(null!=s&&!0!==(null==s?void 0:s.missing))return{datum:s,distance:0}}}pickNodeClosestDatum(e){var t,i;const{x:s,y:r}=e,{axes:n,rootGroup:o,_contextNodeData:a}=this;if(!a)return;const l=n.x,c=n.y,h=o.transformPoint(s,r);let d,u=1/0;for(const e of a.nodeData){const{point:{x:t=NaN,y:i=NaN}={}}=e;if(isNaN(t)||isNaN(i))continue;if(!(null==l?void 0:l.inRange(t))||!(null==c?void 0:c.inRange(i)))continue;const s=Math.max(p(h.x-t,2)+p(h.y-i,2),0);s<u&&(u=s,d=e)}for(const t of this.moduleMap.modules()){const i=t.pickNodeNearest(e);if(void 0!==i&&i.distanceSquared<u){u=i.distanceSquared,d=i.datum;break}}return d?{datum:d,distance:Math.max(Math.sqrt(u)-(null!=(i=null==(t=d.point)?void 0:t.size)?i:0),0)}:void 0}pickNodeMainAxisFirst(e,t){var i,s,r,n;const{x:o,y:a}=e,{axes:l,rootGroup:c,_contextNodeData:h}=this;if(!h)return;const d=l.x,u=l.y,g=[d,u].filter(e=>e instanceof Tl).map(e=>e.direction);if(t&&0===g.length)return;const[m="x"]=g,f=c.transformPoint(o,a),y="x"===m?[f.x,f.y]:[f.y,f.x],v=[1/0,1/0];let C;for(const e of h.nodeData){const{x:t=NaN,y:r=NaN}=null!=(s=null!=(i=e.point)?i:e.midPoint)?s:{};if(isNaN(t)||isNaN(r)||!0===e.missing)continue;if(!(null==d?void 0:d.inRange(t))||!(null==u?void 0:u.inRange(r)))continue;const n="x"===m?[t,r]:[r,t];let o=!0;for(let e=0;e<n.length;e++){const t=Math.abs(n[e]-y[e]);if(t>v[e]){o=!1;break}t<v[e]&&(v[e]=t,v.fill(1/0,e+1,v.length))}o&&(C=e)}if(C){let t=Math.max(p(v[0],2)+p(v[1],2)-(null!=(n=null==(r=C.point)?void 0:r.size)?n:0),0);for(const i of this.moduleMap.modules()){const s=i.pickNodeMainAxisFirst(e);if(void 0!==s&&s.distanceSquared<t){C=s.datum,t=s.distanceSquared;break}}return{datum:C,distance:Math.sqrt(t)}}}onLegendItemClick(e){const{legendItemName:t}=this.properties,{enabled:i,itemId:s,series:r}=e,n=null!=t&&t===e.legendItemName;(r.id===this.id||n)&&this.toggleSeriesItem(s,i)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:r}=e,{legendItemName:n}=this.properties,o=null!=n&&n===e.legendItemName;s.id===this.id||o||t&&1===r?this.toggleSeriesItem(i,!0):this.toggleSeriesItem(i,!1)}isPathOrSelectionDirty(){return!1}getLabelData(){return[]}shouldFlipXY(){return!1}getMinRects(e,t){const{dirtyNodeData:i,sizeCache:s,minRect:r,minVisibleRect:n}=this.minRectsCache,o=JSON.stringify({width:e,height:t});if(o===s&&!i&&r&&n)return{minRect:r,minVisibleRect:n};const a=this.computeMinRects(e,t);return this.minRectsCache={dirtyNodeData:!1,sizeCache:o,minRect:null==a?void 0:a.minRect,minVisibleRect:null==a?void 0:a.minVisibleRect},a}computeMinRects(e,t){var i,s;const r=this._contextNodeData;if(!(null==r?void 0:r.nodeData.length))return;const{nodeData:n}=r,o=Array(n.length),a=Array(n.length);for(const[e,{midPoint:t}]of n.entries())o[e]=null!=(i=null==t?void 0:t.x)?i:0,a[e]=null!=(s=null==t?void 0:t.y)?s:0;let l,c,h,d;o.sort((e,t)=>e-t),a.sort((e,t)=>e-t);let u=0,p=0;for(let i=1;i<n.length;i++)o[i]>=0&&(null!=l||(l=i)),o[i]>e&&(null!=c||(c=i)),a[i]>=0&&(null!=h||(h=i)),a[i]>t&&(null!=d||(d=i)),u=Math.max(u,o[i]-o[i-1]),p=Math.max(p,a[i]-a[i-1]);null!=c||(c=n.length),null!=d||(d=n.length);const g=null!=l&&null!=c?o.slice(l,c):[],m=null!=h&&null!=d?a.slice(h,d):[];let f=0,y=0;for(let e=1;e<Math.max(g.length,m.length);e++){const t=g[e],i=g[e-1],s=m[e],r=m[e-1];null!=t&&null!=i&&(f=Math.max(f,t-i)),null!=s&&null!=r&&(y=Math.max(y,s-r))}return{minRect:new Js(0,0,u,p),minVisibleRect:new Js(0,0,f,y)}}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:s}=e,r=null!=i?i:[];if(t){const e=s;return this.updateMarkerSelection({nodeData:r,markerSelection:e})}return this.updateDatumSelection({nodeData:r,datumSelection:s})}updateHighlightSelectionLabel(e){var t;return this.updateLabelSelection({labelData:null!=(t=e.items)?t:[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return S(this,null,function*(){return e.datumSelection})}updateDatumNodes(e){return S(this,null,function*(){})}updateMarkerSelection(e){return S(this,null,function*(){return e.markerSelection})}updateMarkerNodes(e){return S(this,null,function*(){})}updatePaths(e){return S(this,null,function*(){e.paths.forEach(e=>e.visible=!1)})}updatePathNodes(e){return S(this,null,function*(){const{paths:t,opacity:i,visible:s}=e;for(const e of t)e.opacity=i,e.visible=s})}resetAllAnimation(e){var t,i,s;const{path:r,datum:n,label:o,marker:a}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),r&&e.paths.forEach(e=>{ma([e],r)}),n&&ma([e.datumSelection],n),o&&ma([e.labelSelection],o),a&&this.opts.hasMarkers&&ma([e.markerSelection],a),!1===(null==(s=e.contextData)?void 0:s.animationValid)&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){var t,i;const{datum:s}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};s&&ma([e],s)}animateReadyHighlightMarkers(e){var t,i;const{marker:s}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};s&&ma([e],s)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animationTransitionClear(){const e=this.getAnimationData();e&&this.animationState.transition("clear",e)}getAnimationData(e,t){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}}calculateScaling(){const e={};for(const t of Object.values(jn)){const i=this.axes[t];if(i)if(i.scale instanceof La){const{range:s,domain:r}=i.scale;e[t]={type:"log",convert:e=>i.scale.convert(e),domain:[r[0],r[1]],range:[s[0],s[1]]}}else if(i.scale instanceof qn){const{range:s}=i.scale,r=i.scale.getDomain();e[t]={type:"continuous",domain:[r[0],r[1]],range:[s[0],s[1]]}}else if(i.scale){const{domain:s}=i.scale;e[t]={type:"category",domain:s,range:s.map(e=>i.scale.convert(e))}}}return e}},jd=["top","right","bottom","left"],Kd=class e extends rd{constructor(e,t){super(e,t),this.paired=!0,this.firstSeriesTranslation=!0,this._lastCrossLineIds=void 0,this._lastAxisWidths={top:0,bottom:0,left:0,right:0},this._lastClipSeries=!1,this._lastVisibility={crossLines:!0,series:!0}}onAxisChange(e,t){super.onAxisChange(e,t),this.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.firstSeriesTranslation=!0}performLayout(){return S(this,null,function*(){const t=yield b(e.prototype,this,"performLayout").call(this),{firstSeriesTranslation:i,seriesRoot:s,annotationRoot:r,highlightRoot:n}=this,{animationRect:o,seriesRect:a,visibility:l,clipSeries:c}=this.updateAxes(t);this.seriesRoot.visible=l.series,this.seriesRect=a,this.animationRect=o;const{x:h,y:d}=a;if(i){for(const e of[s,r,n])e.translationX=Math.floor(h),e.translationY=Math.floor(d);this.firstSeriesTranslation=!1}else{const{translationX:e,translationY:t}=s;Rr(this.id,"seriesRect",this.ctx.animationManager,[s,n,r],{translationX:e,translationY:t},{translationX:Math.floor(h),translationY:Math.floor(d)},{phase:"update"})}const u=a.clone().grow(this.seriesArea.padding);this.hoverRect=u;const p=this.seriesArea.clip||c?u:void 0;s.setClipRectInGroupCoordinateSpace(p),n.setClipRectInGroupCoordinateSpace(p),r.setClipRectInGroupCoordinateSpace(p),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:c,series:{rect:a,paddedRect:u,visible:l.series,shouldFlipXY:this.shouldFlipXY()},axes:this.axes.map(e=>m({id:e.id},e.getLayoutState()))});const g=this.modulesManager.mapModules(e=>{var t;return null==(t=e.performCartesianLayout)?void 0:t.call(e,{seriesRect:a})});return yield Promise.all(g),t})}updateAxes(e){var t;const i=this.axes.flatMap(e=>{var t;return null!=(t=e.crossLines)?t:[]}).map(e=>e.id);let s,r,n;null!=this._lastCrossLineIds&&this._lastCrossLineIds.length===i.length&&this._lastCrossLineIds.every((e,t)=>i[t]===e)?(s=m({},this._lastAxisWidths),r=this._lastClipSeries,n=m({},this._lastVisibility)):(s={top:0,bottom:0,left:0,right:0},r=!1,n={crossLines:!0,series:!0},this._lastCrossLineIds=i);const o=new Set(this.axes.map(e=>e.position));for(const e of Object.keys(s))o.has(e)||delete s[e];const a=(e,t,i)=>!Object.keys(e).some(e=>null==s[e])&&n.crossLines===i.crossLines&&n.series===i.series&&Object.entries(s).every(([t,i])=>{const s=e[t];return null==i&&null==s||i===s})&&r===t,l=e=>Ze(e,e=>e&&Math.abs(e)===1/0?0:null!=e?Math.ceil(e):e);let c={},h={},d=!1,u=null==(t=this.seriesRect)?void 0:t.clone(),p=0,g={};do{Object.assign(s,c),r=d,Object.assign(n,h);const t=this.updateAxesPass(s,e.clone(),u);if(c=l(t.axisWidths),h=t.visibility,d=t.clipSeries,u=t.seriesRect,g=t.primaryTickCounts,p++>10){N.warn("unable to find stable axis layout.");break}}while(!a(c,d,h));return this.axes.forEach(e=>{e.update(g[e.direction])}),this.axes.forEach(t=>{if(t.setCrossLinesVisible(n.crossLines),u)switch(t.clipGrid(u.x,u.y,u.width+5,u.height+5),t.position){case"left":case"right":t.clipTickLines(e.x,u.y,e.width+5,u.height+5);break;case"top":case"bottom":t.clipTickLines(u.x,e.y,u.width+5,e.height+5)}}),this._lastAxisWidths=s,this._lastVisibility=n,{seriesRect:u,animationRect:e,visibility:n,clipSeries:r}}updateAxesPass(e,t,i){const s={},r={},n={series:!0,crossLines:!0};let o=!1;const a={},l=this.applySeriesPadding(t),c=i?this.buildCrossLinePadding(e):{},h=this.buildAxisBound(l,e,c,n),d=this.buildSeriesRect(h,e);return this.axes.forEach(t=>{var i,n;const{position:c="left"}=t,{clipSeries:u,axisThickness:p,axisOffset:g}=this.calculateAxisDimensions({axis:t,seriesRect:d,paddedBounds:l,axisWidths:e,newAxisWidths:r,primaryTickCounts:a,clipSeries:o,addInterAxisPadding:(null!=(i=s[c])?i:0)>0});s[c]=(null!=(n=s[c])?n:0)+1,o=o||u,this.positionAxis({axis:t,axisBound:h,axisOffset:g,axisThickness:p,axisWidths:e,primaryTickCounts:a,seriesRect:d})}),{clipSeries:o,seriesRect:d,axisWidths:r,visibility:n,primaryTickCounts:a}}buildCrossLinePadding(e){var t;const i={};this.axes.forEach(e=>{e.crossLines&&e.crossLines.forEach(e=>{var t;null==(t=e.calculatePadding)||t.call(e,i)})});for(const[s,r=0]of Object.entries(i))i[s]=Math.max(r-(null!=(t=e[s])?t:0),0);return i}applySeriesPadding(e){const t=e.clone(),i=this.axes.slice().reverse();return jd.forEach(e=>{const s=this.seriesArea.padding[e],r=i.find(t=>t.position===e);r?r.seriesAreaPadding=s:t.shrink(s,e)}),t}buildAxisBound(e,t,i,s){var r,n,o,a;const l=e.clone(),{top:c=0,right:h=0,bottom:d=0,left:u=0}=i,p=u+h,g=c+d,m=(null!=(r=t.left)?r:0)+(null!=(n=t.right)?n:0)+p,f=(null!=(o=t.top)?o:0)+(null!=(a=t.bottom)?a:0)+g;return l.width<=m||l.height<=f?(s.crossLines=!1,s.series=!1,l):(l.x+=u,l.y+=c,l.width-=p,l.height-=g,l)}buildSeriesRect(e,t){const i=e.clone(),{top:s,bottom:r,left:n,right:o}=t;return i.x+=null!=n?n:0,i.y+=null!=s?s:0,i.width-=(null!=n?n:0)+(null!=o?o:0),i.height-=(null!=s?s:0)+(null!=r?r:0),i.width=Math.max(0,i.width),i.height=Math.max(0,i.height),i}clampToOutsideSeriesRect(e,t,i,s){const{x:r,y:n,width:o,height:a}=e,l=[r,n,r+o,n+a][("x"===i?0:1)+(1===s?0:2)];return(1===s?Math.min:Math.max)(t,l)}calculateAxisDimensions(e){var t,i,s;const{axis:r,seriesRect:n,paddedBounds:o,axisWidths:a,newAxisWidths:l,primaryTickCounts:c,addInterAxisPadding:h}=e;let{clipSeries:d}=e;const{position:u="left",direction:p}=r,g=r instanceof Tl||r instanceof Gl,m="left"===u||"right"===u,f=null!=(t=l[u])?t:0,{min:y,max:v}=this.ctx.zoomManager.getAxisZoom(r.id);m?(g?(r.range=[0,n.height],r.visibleRange=[1-v,1-y]):(r.range=[n.height,0],r.visibleRange=[y,v]),r.gridLength=n.width):(r.range=[0,n.width],r.visibleRange=[y,v],r.gridLength=n.height);let C=r.nice?c[p]:void 0;const b="y"===p;r.thickness?r.maxThickness=r.thickness:r.maxThickness=.3*(b?o.width:o.height);const S=r.calculateLayout(C);let w;if(C=S.primaryTickCount,null!=c[p]||(c[p]=C),d||(d=r.dataDomain.clipped||r.visibleRange[0]>0||r.visibleRange[1]<1),null!=r.thickness&&r.thickness>0)w=r.thickness;else{const{bbox:e}=S;w=b?e.width:e.height}return h&&(w+=15),w=Math.ceil(w),l[u]=(null!=(i=l[u])?i:0)+w,r.gridPadding=(null!=(s=a[u])?s:0)-l[u],{clipSeries:d,axisThickness:w,axisOffset:f,primaryTickCount:C}}positionAxis(e){var t,i,s,r;const{axis:n,axisBound:o,axisWidths:a,seriesRect:l,axisOffset:c,axisThickness:h}=e,{position:d}=n;switch(d){case"top":n.translation.x=o.x+(null!=(t=a.left)?t:0),n.translation.y=this.clampToOutsideSeriesRect(l,o.y+1+c+h,"y",1);break;case"bottom":n.translation.x=o.x+(null!=(i=a.left)?i:0),n.translation.y=this.clampToOutsideSeriesRect(l,o.y+o.height+1-h-c,"y",-1);break;case"left":n.translation.y=o.y+(null!=(s=a.top)?s:0),n.translation.x=this.clampToOutsideSeriesRect(l,o.x+c+h,"x",1);break;case"right":n.translation.y=o.y+(null!=(r=a.top)?r:0),n.translation.x=this.clampToOutsideSeriesRect(l,o.x+o.width-h-c,"x",-1)}n.updatePosition({rotation:Fr(n.rotation),sideFlag:n.label.getSideFlag()})}shouldFlipXY(){return!this.series.some(e=>!(e instanceof Wd&&e.shouldFlipXY()))}};Kd.className="CartesianChart",Kd.type="cartesian";var $d=Kd,Yd=class e{static isInstance(t){var i;return t instanceof e||"AgChartInstanceProxy"===(null==(i=t.constructor)?void 0:i.name)&&null!=t.chart||null!=t.chart&&this.validateImplementation(t)}static validateImplementation(e){var t;const i=Object.keys(null!=(t=Object.getPrototypeOf(e))?t:{});return["getOptions","destroy"].every(e=>i.includes(e))}constructor(e){this.chart=e}getOptions(){return wt(this.chart.getOptions())}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.chart.destroy()}};Yd.chartInstances=new WeakMap,C([qa({oldValue(e){Yd.chartInstances.delete(e)},newValue(e){Yd.chartInstances.set(e,this)}})],Yd.prototype,"chart",2);var qd=Yd,Xd=class extends qn{constructor(){super([0,1],[0,1]),this.type="number"}toDomain(e){return e}ticks(){var e;const t=null!=(e=this.tickCount)?e:qn.defaultTickCount;if(!this.domain||this.domain.length<2||t<1||this.domain.some(e=>!isFinite(e)))return[];this.refresh();const[i,s]=this.getDomain(),{interval:r}=this;if(r){const e=Math.abs(r);if(!go({start:i,stop:s,interval:e,availableRange:this.getPixelRange()}))return po(i,s,e)}return co(i,s,t,this.minTickCount,this.maxTickCount)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}getTickStep(e,t){var i,s;const r=null!=(i=this.tickCount)?i:qn.defaultTickCount;return null!=(s=this.interval)?s:uo(e,t,r,this.minTickCount,this.maxTickCount)}updateNiceDomain(){var e;const t=null!=(e=this.tickCount)?e:qn.defaultTickCount;if(t<1)return void(this.niceDomain=[...this.domain]);let[i,s]=this.domain;if(1===t)[i,s]=function(e,t){const i=Math.abs(t-e),s=Math.floor(Math.log10(i)),r=Math.pow(10,s),n=e>t?Math.ceil:Math.floor,o=t<e?Math.floor:Math.ceil;return ho.map(s=>{const a=s*r,l=n(e/a)*a,c=o(t/a)*a;return{error:1-i/Math.abs(c-l),domain:[l,c]}}).sort((e,t)=>e.error-t.error)[0].domain}(i,s);else{const e=i>s?Math.ceil:Math.floor,t=s<i?Math.floor:Math.ceil,r=4;for(let n=0;n<r;n++){const r=i,n=s,o=this.getTickStep(i,s),[a,l]=this.domain;if(o>=1)i=e(a/o)*o,s=t(l/o)*o;else{const r=1/o;i=e(a*r)/r,s=t(l*r)/r}if(i===r&&s===n)break}}this.niceDomain=[i,s]}tickFormat({ticks:e,specifier:t}){return Pa(null!=e?e:this.ticks(),t)}};var Zd=class extends Wn{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};C([jr(Fn),Wr(NaN)],Zd.prototype,"minSpacing",2),C([jr(Gn),Wr(NaN)],Zd.prototype,"maxSpacing",2);var Qd=class extends Ml{constructor(e,t=new Xd){super(e,t),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=cs(e,t,i);return{domain:s,clipped:r}}createTick(){return new Zd}updateSecondaryAxisTicks(e){if(null==this.dataDomain)throw new Error("AG Charts - dataDomain not calculated, cannot perform tick calculation.");if(0===this.dataDomain.domain.length)return[];const[t,i]=function(e,t,i){let[s,r]=Us(e);s=function(e,t,i){const s=Math.abs(t-e)/(i-1),r=Math.floor(Math.log10(s)),n=Math.pow(10,r);return Math.floor(e/n)*n}(Math.floor(s),r,t);const n=function(e,t,i){return function(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/i*10;return s>0&&s<=1?i/10:s>1&&s<=2?2*i/10:s>1&&s<=5?5*i/10:s>5&&s<=10?10*i/10:s>10&&s<=20?20*i/10:s>20&&s<=40?40*i/10:s>40&&s<=50?50*i/10:s>50&&s<=100?100*i/10:s}((t-e)/(i-1))}(s,r,t);r=s+(t-1)*n;const o=i?[r,s]:[s,r],a=function(e,t,i){const s=Math.floor(Math.log10(t)),r=t>0&&t<1?Math.abs(s):0,n=Math.pow(10,r),o=lo(r);for(let s=0;s<i;s++){const i=e+t*s;o[s]=Math.round(i*n)/n}return o}(s,n,t);return[o,a]}(this.dataDomain.domain,null!=e?e:0,this.reverse);return this.scale.nice=!1,this.scale.domain=t,this.scale.update(),i}formatDatum(e){return"number"==typeof e?e.toFixed(2):String(e)}};Qd.className="NumberAxis",Qd.type="number",C([jr($r(on,hn("max"))),Wr(NaN)],Qd.prototype,"min",2),C([jr($r(on,dn("min"))),Wr(NaN)],Qd.prototype,"max",2);var Jd=Bn(e=>Ue(e)&&0!==e,"a non-zero number"),eu=class extends Qd{constructor(e){super(e,new La),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=cs(e,t,i),n=s[0]>s[1],o=s[0]<0&&s[1]>0,a=0===s[0]&&0===s[1];return(n||o||a)&&(o?N.warn("the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."):a&&N.warn("the data domain has 0 extent, no data is rendered.")),0===s[0]&&(s[0]=1),0===s[1]&&(s[1]=-1),{domain:s,clipped:r}}set base(e){this.scale.base=e}get base(){return this.scale.base}};eu.className="LogAxis",eu.type="log",C([jr($r(on,Jd,hn("max"))),Wr(NaN)],eu.prototype,"min",2),C([jr($r(on,Jd,dn("min"))),Wr(NaN)],eu.prototype,"max",2);var tu=class extends Wn{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};C([jr(Fn),Wr(NaN)],tu.prototype,"minSpacing",2),C([jr(Gn),Wr(NaN)],tu.prototype,"maxSpacing",2);var iu=class extends Ml{constructor(e){super(e,new fo),this.min=void 0,this.max=void 0,this.refreshScale()}normaliseDataDomain(e){var t;let{min:i,max:s}=this,r=!1;return"number"==typeof i&&(i=new Date(i)),"number"==typeof s&&(s=new Date(s)),e.length>2&&(e=(null!=(t=as(e))?t:[0,1e3]).map(e=>new Date(e))),i instanceof Date&&(r||(r=i>e[0]),e=[i,e[1]]),s instanceof Date&&(r||(r=s<e[1]),e=[e[0],s]),e[0]>e[1]&&(e=[]),{domain:e,clipped:r}}createTick(){return new tu}onLabelFormatChange(e,t,i){i?super.onLabelFormatChange(e,t,i):this.labelFormatter=this.scale.tickFormat({ticks:e,domain:t})}calculatePadding(){return[0,0]}formatDatum(e){var t;const i=this.scale.tickFormat({specifier:"%m/%d/%y, %H:%M:%S"});return null!=(t=this.moduleCtx.callbackCache.call(i,e))?t:String(e)}};iu.className="TimeAxis",iu.type="time",C([jr($r(pn,hn("max")),{optional:!0})],iu.prototype,"min",2),C([jr($r(pn,dn("min")),{optional:!0})],iu.prototype,"max",2);var su=1e-6,ru=(e,t,i,s,r)=>{let n=!1,o=!1,a=s-Math.sqrt(Math.max(p(r,2)-p(i,2),0)),l=0,c=0,h=i-Math.sqrt(Math.max(p(r,2)-p(s,2),0));return a>e?(n=!0,a=e,l=i-Math.sqrt(Math.max(p(r,2)-p(s-e,2)))):a<su&&(a=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(p(r,2)-p(i-t,2))),h=t):h<su&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:n,trailingClipped:o}},nu=(e,{x0:t,y0:i,x1:s,y1:r,cx:n,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==r){const l=Math.atan2(i-o,t-n),c=Math.atan2(r-o,s-n);e.arc(n,o,a,l,c)}else e.lineTo(t,i)},ou=(e,t,i,s,r,n,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=n;const d=Math.max(a+h,l+c),u=Math.max(a+l,h+c);if(d<=0&&u<=0)return void(null==o?e.rect(t,i,s,r):e.rect(o.x,o.y,o.width,o.height));if(null==o&&a===l&&a===c&&a===h)return void e.roundRect(t,i,s,r,a);if(s<0&&(t+=s,s=Math.abs(s)),r<0&&(i+=r,r=Math.abs(r)),s<=0||r<=0)return;if(null==o)o=new Js(t,i,s,r);else{const e=Math.max(t,o.x),n=Math.min(t+s,o.x+o.width),a=Math.max(i,o.y),l=Math.min(i+r,o.y+o.height);o=new Js(e,a,n-e,l-a)}const p=Math.max(d/r,u/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g,m,f,y,v=!0,C=!0,b=!0,S=!0;if(v){const e=ru(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);e.leadingClipped&&(S=!1),e.trailingClipped&&(C=!1),g={x0:Math.max(o.x+e.leading1,o.x),y0:Math.max(o.y+e.leading0,o.y),x1:Math.max(o.x+e.trailing1,o.x),y1:Math.max(o.y+e.trailing0,o.y),cx:t+a,cy:i+a}}if(C){const e=ru(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);e.leadingClipped&&(v=!1),e.trailingClipped&&(b=!1),m={x0:Math.min(o.x+o.width-e.leading0,o.x+o.width),y0:Math.max(o.y+e.leading1,o.y),x1:Math.min(o.x+o.width-e.trailing0,o.x+o.width),y1:Math.max(o.y+e.trailing1,o.y),cx:t+s-l,cy:i+l}}if(b){const e=ru(o.height,o.width,Math.max(o.x+o.width-(t+s-c),0),Math.max(o.y+o.height-(i+r-c),0),c);e.leadingClipped&&(C=!1),e.trailingClipped&&(S=!1),f={x0:Math.min(o.x+o.width-e.leading1,o.x+o.width),y0:Math.min(o.y+o.height-e.leading0,o.y+o.height),x1:Math.min(o.x+o.width-e.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-e.trailing0,o.y+o.height),cx:t+s-c,cy:i+r-c}}if(S){const e=ru(o.width,o.height,Math.max(o.y+o.height-(i+r-h),0),Math.max(t+h-o.x,0),h);e.leadingClipped&&(b=!1),e.trailingClipped&&(v=!1),y={x0:Math.max(o.x+e.leading0,o.x),y0:Math.min(o.y+o.height-e.leading1,o.y+o.height),x1:Math.max(o.x+e.trailing0,o.x),y1:Math.min(o.y+o.height-e.trailing1,o.y+o.height),cx:t+h,cy:i+r-h}}let w=!1;v&&null!=g&&(nu(e,g,a,!w),w||(w=!0)),C&&null!=m&&(nu(e,m,l,!w),w||(w=!0)),b&&null!=f&&(nu(e,f,c,!w),w||(w=!0)),S&&null!=y&&(nu(e,y,h,!w),w||(w=!0)),e.closePath()},au=class extends dd{constructor(){super(...arguments),this.borderPath=new cd,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=Do.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Do.defaultStyles.strokeWidth,this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared,this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){var e,t,i;const{path:s,borderPath:r,crisp:n,topLeftCornerRadius:o,topRightCornerRadius:a,bottomRightCornerRadius:l,bottomLeftCornerRadius:c}=this;let{x:h,y:d,width:u,height:p,strokeWidth:g,clipBBox:m}=this;const f=1/(null!=(t=null==(e=this.layerManager)?void 0:e.canvas.pixelRatio)?t:1);let y=1;if(s.clear(!0),r.clear(!0),n&&(u<=f&&(y*=u/f),p<=f&&(y*=p/f),u=this.align(h,u),p=this.align(d,p),h=this.align(h),d=this.align(d),m=null!=m?new Js(this.align(m.x),this.align(m.y),this.align(m.x,m.width),this.align(m.y,m.height)):void 0),g)if(u<f){const e=h+f/2;r.moveTo(e,d),r.lineTo(e,d+p),g=f,this.borderClipPath=void 0}else if(p<f){const e=d+f/2;r.moveTo(h,e),r.lineTo(h+u,e),g=f,this.borderClipPath=void 0}else if(g<u&&g<p){const e=g/2;h+=e,d+=e,u-=g,p-=g;const t=null==m?void 0:m.clone().shrink(e),i={topLeft:o>0?o-g:0,topRight:a>0?a-g:0,bottomRight:l>0?l-g:0,bottomLeft:c>0?c-g:0};this.borderClipPath=void 0,u>0&&p>0&&(null==t||(null==t?void 0:t.width)>0&&(null==t?void 0:t.height)>0)&&(ou(s,h,d,u,p,i,t),ou(r,h,d,u,p,i,t))}else this.borderClipPath=null!=(i=this.borderClipPath)?i:new cd,this.borderClipPath.clear(!0),this.borderClipPath.rect(h,d,u,p),r.rect(h,d,u,p);else{const e={topLeft:o,topRight:a,bottomRight:l,bottomLeft:c};this.borderClipPath=void 0,ou(s,h,d,u,p,e,m)}[o,a,l,c].every(e=>0===e)?(this.hittester=(e,t)=>{const i=this.transformPoint(e,t);return this.getCachedBBox().containsPoint(i.x,i.y)},this.distanceSquared=(e,t)=>this.getCachedBBox().distanceSquared(e,t)):(this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared),this.effectiveStrokeWidth=g,this.lastUpdatePathStrokeWidth=g,this.microPixelEffectOpacity=y}computeBBox(){var e;const{x:t,y:i,width:s,height:r,clipBBox:n}=this;return null!=(e=null==n?void 0:n.clone())?e:new Js(t,i,s,r)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAlpha(e){const{fillOpacity:t,microPixelEffectOpacity:i,opacity:s}=this;e.globalAlpha*=s*t*i}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{strokeOpacity:r,lineDash:n,lineDashOffset:o,lineCap:a,lineJoin:l,borderPath:c,borderClipPath:h,opacity:d,microPixelEffectOpacity:u}=this;h&&e.clip(h.getPath2D()),e.strokeStyle=t,e.globalAlpha*=d*r*u,e.lineWidth=i,n&&e.setLineDash(n),o&&(e.lineDashOffset=o),a&&(e.lineCap=a),l&&(e.lineJoin=l),e.stroke(c.getPath2D()),e.globalAlpha=s}}};au.className="Rect",C([hd()],au.prototype,"x",2),C([hd()],au.prototype,"y",2),C([hd()],au.prototype,"width",2),C([hd()],au.prototype,"height",2),C([hd()],au.prototype,"topLeftCornerRadius",2),C([hd()],au.prototype,"topRightCornerRadius",2),C([hd()],au.prototype,"bottomRightCornerRadius",2),C([hd()],au.prototype,"bottomLeftCornerRadius",2),C([hd()],au.prototype,"clipBBox",2),C([hd()],au.prototype,"crisp",2);var lu=class extends Se{constructor(e){super(),this.node=new xo({name:"background",zIndex:0}),this.rectNode=new au,this.visible=!0,this.fill="white",this.node.appendChild(this.rectNode),this.destroyFns.push(e.scene.attachNode(this.node),e.layoutService.addListener("layout-complete",e=>this.onLayoutComplete(e)))}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};C([jr(Zr),Ya("node","visible")],lu.prototype,"visible",2),C([jr(mn,{optional:!0}),Ya("rectNode","fill")],lu.prototype,"fill",2),C([jr(qr,{optional:!0})],lu.prototype,"image",2);var cu={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:lu};function hu({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:r=0,itemPaddingX:n=0,forceResult:o=!1}){const a="horizontal"===e,l={max:a?s:i,fn:a?e=>e.width:e=>e.height,padding:a?n:r},c={max:a?i:s,fn:a?e=>e.height:e=>e.width,padding:a?r:n};let h=0;const d=[];for(;h<t.length;){const e=du(t.slice(h),h,l,c,o);if(!e)return;h+=e.processedBBoxCount,d.push(e.pageIndices)}return function(e,t,i,s,r){let n=0,o=0;return{pages:e.map(e=>{"horizontal"===t&&(e=function(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((e,i)=>{e.forEach((e,s)=>{t[s][i]=e})}),t}(e));let a=0;const l=e.map(e=>{const t=e.map(e=>(a=Math.max(e,a),i[e]));let n=0,o=0;return t.forEach(e=>{n+=e.height+s,o=Math.max(o,e.width+r)}),{indices:e,bboxes:t,columnHeight:Math.ceil(n),columnWidth:Math.ceil(o)}});let c=0,h=0;return l.forEach(e=>{c+=e.columnWidth,h=Math.max(h,e.columnHeight)}),n=Math.max(c,n),o=Math.max(h,o),{columns:l,startIndex:e[0][0],endIndex:a,pageWidth:c,pageHeight:h}}),maxPageWidth:n,maxPageHeight:o}}(d,e,t,r,n)}function du(e,t,i,s,r){let n=function(e,t){const i=e.length;let s=0;for(let r=0;r<i;r++)if(s+=t.fn(e[r])+t.padding,s>t.max)return i/r<2?Math.ceil(i/2):r;return i}(e,i);if(n<1){if(!r)return;n=1}let o=n;for(;o>=1;){const n=uu(e,t,o,i,s,r);if(null==n&&o<=1)return;if(null!=n){if("number"!=typeof n)return{processedBBoxCount:n.length*n[0].length,pageIndices:n};if(n<=1)return;o=n<o&&n>1?n:o,o--}else o--}}function uu(e,t,i,s,r,n){var o;const a=[];let l=0,c=0,h=[];const d=[];for(let u=0;u<e.length;u++){const p=(u+i)%i;0===p&&(l+=c,c=0,h.length>0&&a.push(h),h=[]);const g=s.fn(e[u])+s.padding;d[p]=Math.max(null!=(o=d[p])?o:0,g),c=Math.max(c,r.fn(e[u])+r.padding);const m=l+c,f=!n||a.length>0;if(m>r.max&&f){h=[];break}if(d.reduce((e,t)=>e+t,0)>s.max&&!n)return d.length<i?d.length:void 0;h.push(u+t)}return h.length>0&&a.push(h),a.length>0?a:void 0}var pu=class extends xo{constructor(){super({name:"markerLabelGroup"}),this.label=new Oo,this.line=new Ga,this._marker=new Ad,this._markerSize=15,this._spacing=8;const{marker:e,label:t,line:i}=this;t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1,this.append([i,e,t]),this.update()}set marker(e){this._marker!==e&&(this.removeChild(this._marker),this._marker=e,this.appendChild(e),this.update())}get marker(){return this._marker}set markerSize(e){this._markerSize!==e&&(this._markerSize=e,this.update())}get markerSize(){return this._markerSize}set spacing(e){this._spacing!==e&&(this._spacing=e,this.update())}get spacing(){return this._spacing}setSeriesStrokeOffset(e){const t=this.marker.size/2+e;this.line.x1=-t,this.line.x2=t,this.line.y1=0,this.line.y2=0,this.line.markDirtyTransform(),this.update()}update(){const{markerSize:e}=this,t=this.marker.constructor.center;this.marker.size=e,this.marker.x=(t.x-.5)*e,this.marker.y=(t.y-.5)*e;const i=this.line.visible?this.line.x2:-1/0,s=e/2;this.label.x=Math.max(i,s)+this.spacing}render(e){this.marker.opacity=this.opacity,this.label.opacity=this.opacity,this.line.opacity=this.opacity,super.render(e)}};pu.className="MarkerLabel",C([Ya("label")],pu.prototype,"text",2),C([Ya("label")],pu.prototype,"fontStyle",2),C([Ya("label")],pu.prototype,"fontWeight",2),C([Ya("label")],pu.prototype,"fontSize",2),C([Ya("label")],pu.prototype,"fontFamily",2),C([Ya("label","fill")],pu.prototype,"color",2),C([Ya("marker","fill")],pu.prototype,"markerFill",2),C([Ya("marker","stroke")],pu.prototype,"markerStroke",2),C([Ya("marker","strokeWidth")],pu.prototype,"markerStrokeWidth",2),C([Ya("marker","fillOpacity")],pu.prototype,"markerFillOpacity",2),C([Ya("marker","strokeOpacity")],pu.prototype,"markerStrokeOpacity",2),C([Ya("marker","visible")],pu.prototype,"markerVisible",2),C([Ya("line","stroke")],pu.prototype,"lineStroke",2),C([Ya("line","strokeWidth")],pu.prototype,"lineStrokeWidth",2),C([Ya("line","strokeOpacity")],pu.prototype,"lineStrokeOpacity",2),C([Ya("line","lineDash")],pu.prototype,"lineLineDash",2),C([Ya("line","visible")],pu.prototype,"lineVisible",2);var gu=class extends yt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};C([jr(mn)],gu.prototype,"color",2),C([jr(An,{optional:!0})],gu.prototype,"fontStyle",2),C([jr(Tn,{optional:!0})],gu.prototype,"fontWeight",2),C([jr(sn)],gu.prototype,"fontSize",2),C([jr(Jr)],gu.prototype,"fontFamily",2);var mu=class extends yt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};C([jr(sn)],mu.prototype,"size",2),C([jr(mn,{optional:!0})],mu.prototype,"fill",2),C([jr(rn,{optional:!0})],mu.prototype,"fillOpacity",2),C([jr(mn,{optional:!0})],mu.prototype,"stroke",2),C([jr(sn)],mu.prototype,"strokeWidth",2),C([jr(rn)],mu.prototype,"strokeOpacity",2);var fu=class extends yt{constructor(e){super(),this.parent=e,this.shape=Id,this.size=15,this.padding=8}};C([qa({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],fu.prototype,"shape",2),C([jr(sn)],fu.prototype,"size",2),C([jr(sn)],fu.prototype,"padding",2);var yu=class extends yt{constructor(e,t,i,s){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.regionManager=i,this.cursorManager=s,this.id=Fs(this),this.marker=new fu(this),this.activeStyle=new mu,this.inactiveStyle=new mu,this.highlightStyle=new mu,this.label=new gu,this.group=new xo({name:"pagination"}),this.labelNode=new Oo,this.destroyFns=[],this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this._nextButton=new Id,this._previousButton=new Id,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]);const r=this.regionManager.addRegion("pagination",this.group);this.destroyFns.push(r.addListener("click",e=>this.onPaginationClick(e)),r.addListener("hover",e=>this.onPaginationMouseMove(e))),this.update(),this.updateMarkers()}destroy(){this.destroyFns.forEach(e=>e())}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){this._orientation=e,"horizontal"===e?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}set nextButton(e){this._nextButton!==e&&(this.group.removeChild(this._nextButton),this._nextButton=e,this.group.appendChild(e))}get nextButton(){return this._nextButton}set previousButton(e){this._previousButton!==e&&(this.group.removeChild(this._previousButton),this._previousButton=e,this.group.appendChild(e))}get previousButton(){return this._previousButton}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.computeBBox();this.nextButton.translationX=e.x+e.width+this.marker.size/2+this.marker.padding}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:r,inactiveStyle:n,highlightStyle:o,highlightActive:a}=this,l=(e,t)=>t?n:e===a?o:r;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){var i;const{size:s}=this.marker;e.size=s,e.fill=t.fill,e.fillOpacity=null!=(i=t.fillOpacity)?i:1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=0===t,s=e===t-1,r=0===e;this.nextButtonDisabled=s||i,this.previousButtonDisabled=r||i}nextButtonContainsPoint(e,t){return!this.nextButtonDisabled&&this.nextButton.containsPoint(e,t)}previousButtonContainsPoint(e,t){return!this.previousButtonDisabled&&this.previousButton.containsPoint(e,t)}clickNext(){this.incrementPage(),this.onPaginationChanged()}clickPrevious(){this.decrementPage(),this.onPaginationChanged()}setPage(e){e=Vs(0,e,this.totalPages-1),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}onPaginationClick(e){const{offsetX:t,offsetY:i}=e;this.nextButtonContainsPoint(t,i)?(this.clickNext(),e.consume()):this.previousButtonContainsPoint(t,i)&&(this.clickPrevious(),e.consume())}onPaginationMouseMove(e){const{offsetX:t,offsetY:i}=e;this.nextButtonContainsPoint(t,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="next"):this.previousButtonContainsPoint(t,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="previous"):(this.cursorManager.updateCursor(this.id),this.highlightActive=void 0),this.updateMarkers(),this.chartUpdateCallback(6)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){const e=Ld(this.marker.shape||Id);this.previousButton=new e,this.nextButton=new e,this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(e){e.append(this.group)}computeBBox(){return this.group.computeBBox()}};yu.className="Pagination",C([jr(qr)],yu.prototype,"marker",2),C([jr(qr)],yu.prototype,"activeStyle",2),C([jr(qr)],yu.prototype,"inactiveStyle",2),C([jr(qr)],yu.prototype,"highlightStyle",2),C([jr(qr)],yu.prototype,"label",2);var vu=class extends yt{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.formatter=void 0}};C([jr(sn,{optional:!0})],vu.prototype,"maxLength",2),C([jr(mn)],vu.prototype,"color",2),C([jr(An,{optional:!0})],vu.prototype,"fontStyle",2),C([jr(Tn,{optional:!0})],vu.prototype,"fontWeight",2),C([jr(sn)],vu.prototype,"fontSize",2),C([jr(Jr)],vu.prototype,"fontFamily",2),C([jr(Qr,{optional:!0})],vu.prototype,"formatter",2);var Cu=class extends yt{constructor(){super(...arguments),this.size=15,this.padding=8,this.enabled=!0}};C([Xa(e=>{var t;return null==(t=e.parent)?void 0:t.onMarkerShapeChange()})],Cu.prototype,"shape",2),C([jr(sn)],Cu.prototype,"size",2),C([jr(sn)],Cu.prototype,"padding",2),C([jr(sn,{optional:!0})],Cu.prototype,"strokeWidth",2),C([jr(Zr)],Cu.prototype,"enabled",2);var bu=class extends yt{};C([jr(sn,{optional:!0})],bu.prototype,"strokeWidth",2),C([jr(sn,{optional:!0})],bu.prototype,"length",2);var Su=class extends yt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.toggleSeriesVisible=!0,this.showSeriesStroke=!1,this.marker=new Cu,this.label=new vu,this.line=new bu}};C([jr(sn,{optional:!0})],Su.prototype,"maxWidth",2),C([jr(sn)],Su.prototype,"paddingX",2),C([jr(sn)],Su.prototype,"paddingY",2),C([jr(Zr)],Su.prototype,"toggleSeriesVisible",2),C([jr(Zr)],Su.prototype,"showSeriesStroke",2),C([jr(qr)],Su.prototype,"marker",2),C([jr(qr)],Su.prototype,"label",2),C([jr(qr)],Su.prototype,"line",2);var wu=class extends yt{};C([jr(Qr,{optional:!0})],wu.prototype,"legendItemClick",2),C([jr(Qr,{optional:!0})],wu.prototype,"legendItemDoubleClick",2);var xu=class extends yt{constructor(e){super(),this.ctx=e,this.id=Fs(this),this.group=new xo({name:"legend",layer:!0,zIndex:11}),this.itemSelection=Na.select(this.group,pu),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.item=new Su,this.listeners=new wu,this.enabled=!0,this.position="bottom",this.spacing=20,this.characterWidths=new Map,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.focus={mode:"item",index:0},this.item.marker.parent=this,this.pagination=new yu(t=>e.updateService.update(t),e=>this.updatePageNumber(e),e.regionManager,e.cursorManager),this.pagination.attachPagination(this.group),this.item.marker.parent=this;const t=e.regionManager.addRegionFromProperties({name:"legend",bboxproviders:[this.group],canInteraction:()=>this.enabled&&this.group.visible});this.destroyFns.push(t.addListener("click",e=>this.checkLegendClick(e),17),t.addListener("dblclick",e=>this.checkLegendDoubleClick(e),17),t.addListener("hover",e=>this.handleLegendMouseMove(e)),t.addListener("leave",e=>this.handleLegendMouseExit(e),17),t.addListener("enter",e=>this.handleLegendMouseEnter(e),17),t.addListener("blur",e=>this.onBlur(e)),t.addListener("tab",e=>this.onTab(e)),t.addListener("tab-start",e=>this.onTabStart(e)),t.addListener("nav-vert",e=>this.onNav(e)),t.addListener("nav-hori",e=>this.onNav(e)),t.addListener("submit",e=>this.onSubmit(e)),e.layoutService.addListener("start-layout",e=>this.positionLegend(e.shrinkRect)),()=>this.detachLegend())}set data(e){this._data=e,this.updateGroupVisibility()}get data(){return this._data}destroy(){this.destroyFns.forEach(e=>e()),this.pagination.destroy()}onMarkerShapeChange(){this.itemSelection.clear(),this.group.markDirty(this.group,2)}getOrientation(){if(void 0!==this.orientation)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}getCharacterWidths(e){const{characterWidths:t}=this;if(t.has(e))return t.get(e);const i={"...":Oo.getTextSize("...",e).width};return t.set(e,i),i}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}detachLegend(){var e;null==(e=this.group.parent)||e.removeChild(this.group)}getItemLabel(e){const{ctx:{callbackCache:t}}=this,{formatter:i}=this.item.label;return i?t.call(i,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId}):e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:r,maxWidth:n,marker:{size:o,padding:a,shape:l},label:{maxLength:c=1/0,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p},line:g,showSeriesStroke:m}=this.item,f=[...this.data];this.reverseOrder&&f.reverse(),this.itemSelection.update(f);const y=[],v=Go(r),C=null!=n?n:.8*e,b=o+a+i;if(this.itemSelection.each((e,t)=>{var i,s,r;const n=Ld(null!=l?l:t.marker.shape),f=null!=(i=t.marker.enabled)?i:this.item.marker.enabled;e.marker&&e.marker instanceof n||(e.marker=new n),e.markerSize=o,e.spacing=a,e.fontStyle=h,e.fontWeight=d,e.fontSize=u,e.fontFamily=p;const S=null!=(s=t.itemId)?s:t.id,w=this.getItemLabel(t),x=(null!=w?w:"<unknown>").replace(/\r?\n/g," ");e.text=this.truncate(x,c,C,b,v,S),m&&void 0!==t.line?(e.lineVisible=!0,e.markerVisible=f,e.setSeriesStrokeOffset(null!=(r=g.length)?r:5)):(e.lineVisible=!1,e.markerVisible=!0),y.push(e.computeBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return!1;const S=this.size,w=this.oldSize;S[0]=e,S[1]=t,S[0]===w[0]&&S[1]===w[1]||(w[0]=S[0],w[1]=S[1]);const{pages:x,maxPageHeight:E,maxPageWidth:M}=this.updatePagination(y,e,t);this.pages=x,this.maxPageSize=[M-i,E-s];const A=this.pagination.currentPage,T=this.pages[A];this.pages.length<1||!T?this.visible=!1:(this.visible=!0,this.updatePositions(A),this.update())}truncate(e,t,i,s,r,n){const o=e.split("");let a=!1;if(e.length>t&&(e=`${e.substring(0,t)}`,a=!0),Math.floor(s+Oo.getTextSize(e,r).width)>i){let t="";const n=this.getCharacterWidths(r);let l=s+n["..."];for(const e of o){if(n[e]||(n[e]=Oo.getTextSize(e,r).width),l+=n[e],l>i)break;t+=e}e=t,a=!0}return a?(e+="...",this.truncatedItems.add(n)):this.truncatedItems.delete(n),e}updatePagination(e,t,i){const s=this.getOrientation(),r=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:n,maxPageHeight:o,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=n.findIndex(e=>e.endIndex>=r);this.pagination.currentPage=Vs(0,h,n.length-1);const{paddingX:d,paddingY:u}=this.item,p=a-d,g=o-u;let m=0,f=-l.y-this.item.marker.size/2;return c?f+=g+8:(m+=-l.x+p+8,f+=(g-l.height)/2),this.pagination.translationX=m,this.pagination.translationY=f,this.pagination.update(),this.pagination.updateMarkers(),{maxPageHeight:o,maxPageWidth:a,pages:n}}calculatePagination(e,t,i){var s,r,n;const{paddingX:o,paddingY:a}=this.item,l=this.getOrientation(),c=["left","right"].includes(this.position);let h=this.pagination.computeBBox(),d=new Js(0,0,0,0),u=[],p=0,g=0,m=0;const f=e=>e.width===h.width&&e.height===h.height,y=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(m++>10){N.warn("unable to find stable legend layout.");break}h=d;const f=t-(c?0:h.width),v=hu({orientation:l,bboxes:e,maxHeight:i-(c?h.height:0),maxWidth:f,itemPaddingY:a,itemPaddingX:o,forceResult:y});u=null!=(s=null==v?void 0:v.pages)?s:[],p=null!=(r=null==v?void 0:v.maxPageWidth)?r:0,g=null!=(n=null==v?void 0:v.maxPageHeight)?n:0;const C=u.length;if(this.pagination.visible=C>1,this.pagination.totalPages=C,this.pagination.update(),d=this.pagination.computeBBox(),!this.pagination.visible)break}while(!f(d));return{maxPageWidth:p,maxPageHeight:g,pages:u,paginationBBox:h,paginationVertical:c}}getPageItemCount(e){let t=0;for(const i of this.pages[e].columns)t+=i.indices.length;return t}getNodeIndexFromFocusIndex(){const{index:e}=this.focus,t=this.pages[this.pagination.currentPage];let i=0;for(const s of t.columns){if(e<i+s.indices.length)return s.indices[e-i];i+=s.indices.length}return-1}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:r,startIndex:n,endIndex:o}=s[e];let a=0,l=0;const c=r.length,h=r[0].indices.length,d="horizontal"===this.getOrientation(),u=r[0].bboxes[0].height+t,p=[];i.each((e,t,i)=>{var s,g;if(i<n||i>o)return void(e.visible=!1);const m=i-n;let f=0,y=0;d?(f=m%c,y=Math.floor(m/c)):(f=Math.floor(m/h),y=m%h),e.visible=!0;const v=r[f];v&&(l=u*y,a=null!=(s=p[y])?s:0,p[y]=(null!=(g=p[y])?g:0)+v.columnWidth,e.translationX=Math.floor(a),e.translationY=Math.floor(l))})}updatePageNumber(e){const{pages:t}=this,{startIndex:i,endIndex:s}=t[e];0===i?this.paginationTrackingIndex=0:e===t.length-1?this.paginationTrackingIndex=s:this.paginationTrackingIndex=Math.floor((i+s)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.ctx.updateService.update(6)}update(){const{label:{color:e},marker:t,line:i,showSeriesStroke:s}=this.item;this.itemSelection.each((r,n)=>{var o,a;const l=n.marker;r.markerFill=l.fill,r.markerStroke=l.stroke,r.markerStrokeWidth=null!=(o=t.strokeWidth)?o:Math.min(2,l.strokeWidth),r.markerFillOpacity=l.fillOpacity,r.markerStrokeOpacity=l.strokeOpacity,r.opacity=n.enabled?1:.5,r.color=e;const{line:c}=n;s&&void 0!==c&&(r.lineStroke=c.stroke,r.lineStrokeOpacity=c.strokeOpacity,r.lineStrokeWidth=null!=(a=i.strokeWidth)?a:Math.min(2,c.strokeWidth),r.lineLineDash=c.lineDash)})}getDatumForPoint(e,t){const i=[],s={dist:1/0,datum:void 0};for(const r of this.group.children){if(!r.visible)continue;if(!(r instanceof pu))continue;const n=r.computeBBox();if(n.grow(this.item.paddingX/2,"horizontal"),n.grow(this.item.paddingY/2,"vertical"),n.containsPoint(e,t))return r.datum;const o=e-n.x-this.item.paddingX/2,a=t-n.y-this.item.paddingY/2,l=p(o,2)+p(a,2);o>=0&&a>=0&&l<s.dist&&(s.dist=l,s.datum=r.datum),i.push(n)}if(Js.merge(i).containsPoint(e,t))return s.datum}computePagedBBox(){const e=this.group.computeBBox();if(this.pages.length<=1)return e;const[t,i]=this.maxPageSize;return e.height=Math.max(i,e.height),e.width=Math.max(t,e.width),e}checkLegendClick(e){const t=this.getDatumForPoint(e.offsetX,e.offsetY);this.doClick(t)&&e.consume()}doClick(e){const{listeners:{legendItemClick:t},ctx:{chartService:i,highlightManager:s},item:{toggleSeriesVisible:r},preventHidingAll:n}=this;if(!e)return!1;const{id:o,itemId:a,enabled:l}=e,c=i.series.find(e=>e.id===o);if(!c)return!1;let h=l;if(r){h=!l,n&&!h&&i.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length<2&&(h=!0);const t=h?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`${t}`),this.ctx.chartEventManager.legendItemClick(c,a,h,e.legendItemName)}return h?s.updateHighlight(this.id,{series:c,itemId:a,datum:void 0}):s.updateHighlight(this.id),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==t||t({type:"click",enabled:h,itemId:a,seriesId:c.id}),!0}checkLegendDoubleClick(e){var t;const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},item:{toggleSeriesVisible:r}}=this;if("integrated"===s.mode)return;const n=this.getDatumForPoint(e.offsetX,e.offsetY);if(!n)return;const{id:o,itemId:a,seriesId:l}=n,c=s.series.find(e=>e.id===o);if(c){if(e.consume(),r){const e=s.series.flatMap(e=>e.getLegendData("category")),i=e.filter(e=>e.enabled).length,r=e.find(e=>e.itemId===a&&e.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(c,a,null!=(t=null==r?void 0:r.enabled)&&t,i,null==r?void 0:r.legendItemName)}this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==i||i({type:"dblclick",enabled:!0,itemId:a,seriesId:c.id})}}handleLegendMouseMove(e){if(!this.enabled)return;const{offsetX:t,offsetY:i}=e;e.consume();const s=this.getDatumForPoint(t,i);this.doHover(e,s)}doHover(e,t){var i;const{item:{toggleSeriesVisible:s},listeners:r}=this;if(void 0===e||void 0===t)return this.ctx.cursorManager.updateCursor(this.id),void this.ctx.highlightManager.updateHighlight(this.id);const n=t?this.ctx.chartService.series.find(e=>e.id===(null==t?void 0:t.id)):void 0;if(t&&this.truncatedItems.has(null!=(i=t.itemId)?i:t.id)){const{offsetX:i,offsetY:s}=e;this.ctx.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:e,showArrow:!1},sl({content:this.getItemLabel(t)}))}else this.ctx.tooltipManager.removeTooltip(this.id);(s||null!=r.legendItemClick||null!=r.legendItemDoubleClick)&&this.ctx.cursorManager.updateCursor(this.id,"pointer"),(null==t?void 0:t.enabled)&&n?this.ctx.highlightManager.updateHighlight(this.id,{series:n,itemId:null==t?void 0:t.itemId,datum:void 0}):this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseExit(e){this.doMouseExit()}doMouseExit(){this.ctx.cursorManager.updateCursor(this.id),this.ctx.tooltipManager.removeTooltip(this.id),16===this.ctx.interactionManager.getState()&&this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseEnter(e){const{enabled:t,item:{toggleSeriesVisible:i},listeners:{legendItemClick:s,legendItemDoubleClick:r}}=this,n=this.getDatumForPoint(e.offsetX,e.offsetY);t&&void 0!==n&&(i||null!=s||null!=r)&&this.ctx.cursorManager.updateCursor(this.id,"pointer")}onBlur(e){this.doMouseExit(),this.focus.mode="item",this.ctx.regionManager.updateFocusIndicatorRect(void 0)}onTab(e){this.updateFocus(),e.consume()}onTabStart(e){if(!this.pagination.visible||!this.pagination.enabled)return;const t=t=>{this.focus.mode=t,this.updateFocus(),e.consume()};"item"===this.focus.mode&&1===e.delta?(this.focus.index=0===this.pagination.currentPage?1:0,t("page")):"page"===this.focus.mode&&-1===e.delta&&(this.focus.index=0,t("item"))}onNav(e){if("item"===this.focus.mode){const t=this.focus.index+e.delta,i=this.getPageItemCount(this.pagination.currentPage);this.focus.index=Vs(-1,t,i),this.updateFocus(),e.consume()}else"page"===this.focus.mode&&(e.delta<0&&(this.focus.index=0),e.delta>0&&(this.focus.index=1),this.updateFocus(),e.consume())}onSubmit(e){"item"===this.focus.mode?this.doClick(this.getFocusedItem().datum):"page"===this.focus.mode&&(0===this.focus.index&&this.pagination.clickPrevious(),1===this.focus.index&&this.pagination.clickNext(),this.ctx.ariaAnnouncementService.announceValue(`Legend page ${this.pagination.currentPage+1} of ${this.pages.length}`))}maybeChangeFocusPage(){const e=this.pagination.currentPage,t=this.getPageItemCount(e);if(-1===this.focus.index)this.pagination.setPage(e-1);else{if(this.focus.index!==t)return;this.pagination.setPage(e+1)}const{currentPage:i}=this.pagination;e===i?this.focus.index=Vs(0,this.focus.index,t-1):-1===this.focus.index?this.focus.index=this.getPageItemCount(i)-1:this.focus.index=0}getFocusedItem(){if("item"!==this.focus.mode)return N.error("getFocusedItem() should be called only when focus.mode is 'item'"),{nodeIndex:-1,node:void 0,datum:void 0};this.maybeChangeFocusPage();const e=this.getNodeIndexFromFocusIndex();if(e<0)return N.error(`Cannot access negative nodeIndex ${e}`),{nodeIndex:-1,node:void 0,datum:void 0};const t=this.itemSelection.nodes()[e];let i;return e<this.data.length?i=this.data[e]:N.error(`Cannot access datum[${e}]`),{nodeIndex:e,node:t,datum:i}}updateFocus(){const{focus:e,pagination:t}=this;if("item"===e.mode){const{nodeIndex:e,node:t,datum:i}=this.getFocusedItem();if(void 0===i)return;const s=null==t?void 0:t.computeTransformedBBox();this.doHover(nh(this.ctx.regionManager,{bbox:s,showFocusBox:!0}),i);const r=i&&this.getItemLabel(i);if(r){const t=i.enabled?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`Legend item ${e+1} of ${this.data.length}, ${r}, ${t}`)}}else if("page"===e.mode){const i=0===e.index?t.previousButton:t.nextButton;this.ctx.regionManager.updateFocusIndicatorRect(i.computeTransformedBBox());const s=["Previous legend page","Next legend page"][e.index];this.ctx.ariaAnnouncementService.announceValue(`${s}, button`)}}positionLegend(e){const t=e.clone();if(!this.enabled||!this.data.length)return{shrinkRect:t};const[i,s]=this.calculateLegendDimensions(e);this.group.translationX=0,this.group.translationY=0,this.calcLayout(i,s);const r=this.computePagedBBox(),n=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return e.height-r.height;default:return e.width-r.width}};if(this.visible){let i,s;switch(this.position){case"top":case"bottom":i=(e.width-r.width)/2,s=n(),t.shrink(r.height,this.position);break;default:i=n(),s=(e.height-r.height)/2,t.shrink(r.width,this.position)}this.group.translationX=Math.floor(-r.x+e.x+i),this.group.translationY=Math.floor(-r.y+e.y+s)}if(this.visible&&this.enabled&&this.data.length){const e=this.spacing;t.shrink(e,this.position);const i=r.clone();i.x+=this.group.translationX,i.y+=this.group.translationY}return{shrinkRect:t}}calculateLegendDimensions(e){const{width:t,height:i}=e,s=t/i;let r,n;switch(this.position){case"top":case"bottom":const e=s<1?Math.min(.5,1/s*.2):.2;r=this.maxWidth?Math.min(this.maxWidth,t):t,n=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*e);break;default:const o=s>1?Math.min(.5,.25*s):.25;r=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*o),n=this.maxHeight?Math.min(this.maxHeight,i):i}return[r,n]}};xu.className="Legend",C([jr(qr)],xu.prototype,"pagination",2),C([jr(qr)],xu.prototype,"item",2),C([jr(qr)],xu.prototype,"listeners",2),C([Xa(e=>e.updateGroupVisibility()),jr(Zr)],xu.prototype,"enabled",2),C([jr(Mn)],xu.prototype,"position",2),C([jr(sn,{optional:!0})],xu.prototype,"maxWidth",2),C([jr(sn,{optional:!0})],xu.prototype,"maxHeight",2),C([jr(Zr,{optional:!0})],xu.prototype,"reverseOrder",2),C([jr(On(["horizontal","vertical"],"an orientation"),{optional:!0})],xu.prototype,"orientation",2),C([jr(Zr,{optional:!0})],xu.prototype,"preventHidingAll",2),C([jr(sn)],xu.prototype,"spacing",2);var Eu={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:xu,packageType:"community"},Mu=class extends dd{constructor(){super(...arguments),this.zIndex=3,this._fill="#f2f2f2",this._stroke="#999999",this._strokeWidth=1,this._lineCap="square",this._centerX=0,this._centerY=0,this._width=8,this._gripLineGap=2,this._gripLineLength=8,this._height=16}set centerX(e){this._centerX!==e&&(this._centerX=e,this.dirtyPath=!0)}get centerX(){return this._centerX}set centerY(e){this._centerY!==e&&(this._centerY=e,this.dirtyPath=!0)}get centerY(){return this._centerY}set width(e){this._width!==e&&(this._width=e,this.dirtyPath=!0)}get width(){return this._width}set gripLineGap(e){this._gripLineGap!==e&&(this._gripLineGap=e,this.dirtyPath=!0)}get gripLineGap(){return this._gripLineGap}set gripLineLength(e){this._gripLineLength!==e&&(this._gripLineLength=e,this.dirtyPath=!0)}get gripLineLength(){return this._gripLineLength}set height(e){this._height!==e&&(this._height=e,this.dirtyPath=!0)}get height(){return this._height}layout(e,t){this.centerX=e,this.centerY=t}static align(e,t,i,s,r,n,o,a){const l=e.strokeWidth/2,c=e.align(i+r*o)+l,h=c+e.align(i+r*o,r*(a-o))-2*l,d=e.align(s+n/2)+l;e.layout(c,d),t.layout(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this;return new Js(e-i/2,t-s/2,i,s)}isPointInPath(e,t){const i=this.transformPoint(e,t);return this.computeBBox().containsPoint(i.x,i.y)}updatePath(){var e,t,i;const{centerX:s,centerY:r,path:n,strokeWidth:o,gripLineGap:a,gripLineLength:l}=this,c=null!=(i=null==(t=null==(e=this.layerManager)?void 0:e.canvas)?void 0:t.pixelRatio)?i:1;n.clear();const h=Math.floor(this.width/2*c)/c,d=Math.floor(this.height/2*c)/c;n.moveTo(s-h,r-d),n.lineTo(s+h,r-d),n.lineTo(s+h,r+d),n.lineTo(s-h,r+d),n.closePath();const u=Math.floor((a+o)/2*c)/c,p=Math.floor(l/2*c)/c;n.moveTo(s-u,r-p),n.lineTo(s-u,r+p),n.moveTo(s+u,r-p),n.lineTo(s+u,r+p)}};Mu.className="RangeHandle",C([jr(mn)],Mu.prototype,"_fill",2),C([jr(mn)],Mu.prototype,"_stroke",2),C([jr(sn)],Mu.prototype,"_strokeWidth",2),C([jr(wn)],Mu.prototype,"_lineCap",2),C([jr(sn)],Mu.prototype,"_width",2),C([jr(sn)],Mu.prototype,"_gripLineGap",2),C([jr(sn)],Mu.prototype,"_gripLineLength",2),C([jr(sn)],Mu.prototype,"_height",2);var Au=class extends dd{constructor(){super(...arguments),this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1}layout(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this.dirtyPath=!0}update(e,t){this.min=isNaN(e)?this.min:e,this.max=isNaN(t)?this.max:t,this.dirtyPath=!0}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new Js(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:r,max:n}=this,o=e+i*r;return new Js(o,t,e+i*n-o,s)}updatePath(){const{path:e,x:t,y:i,width:s,height:r,min:n,max:o,strokeWidth:a}=this,l=a/2;e.clear();const c=this.align(t)+l,h=this.align(i)+l,d=c+this.align(t,s)-2*l,u=h+this.align(i,r)-2*l;e.moveTo(c,h),e.lineTo(d,h),e.lineTo(d,u),e.lineTo(c,u),e.closePath();const p=this.align(t+s*n)+l,g=p+this.align(t+s*n,s*(o-n))-2*l;e.moveTo(p,h),e.lineTo(p,u),e.lineTo(g,u),e.lineTo(g,h),e.closePath()}};Au.className="RangeMask";var Tu=class extends xo{constructor(e){super({name:"rangeSelectorGroup",layer:!0,zIndex:12}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.isContainerNode=!0,this.background=new xo({name:"navigator-background"}),this.background.zIndex=1,this.appendChild(this.background),this.append(e)}layout(e,t,i,s,r,n){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=r,this.rOffset=n,this.background.translationX=e,this.background.translationY=t}updateBackground(e,t){null!=e&&this.background.removeChild(e),null!=t&&this.background.appendChild(t)}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:r,rOffset:n}=this;return new Js(e-r,t,i+(r+n),s)}},Du=class extends Se{constructor(e){super(),this.ctx=e,this.miniChart=void 0,this.enabled=!1,this.mask=new Au,this.minHandle=new Mu,this.maxHandle=new Mu,this.height=30,this.margin=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Tu([this.mask,this.minHandle,this.maxHandle]),this._min=0,this._max=1,this.minRange=.001;const t=e.regionManager.addRegion("navigator",this.rangeSelector);this.destroyFns.push(e.scene.attachNode(this.rangeSelector),t.addListener("hover",e=>this.onHover(e),25),t.addListener("drag-start",e=>this.onDragStart(e),25),t.addListener("drag",e=>this.onDrag(e),25),t.addListener("drag-end",()=>this.onDragEnd(),25),t.addListener("leave",e=>this.onLeave(e),25),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.updateGroupVisibility()}updateBackground(e,t){var i;null==(i=this.rangeSelector)||i.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;null!=this.rangeSelector&&e!==this.rangeSelector.visible&&(this.rangeSelector.visible=e,e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}performLayout(e){return S(this,arguments,function*({shrinkRect:e}){if(this.enabled){const t=this.height+this.margin;e.shrink(t,"bottom"),this.y=e.y+e.height+this.margin}else this.y=0;return{shrinkRect:e}})}performCartesianLayout(e){return S(this,null,function*(){const{x:t,width:i}=e.seriesRect;if(this.enabled){const{y:e,height:s}=this;this.layoutNodes(t,e,i,s)}this.x=t,this.width=i})}onHover(e){if(!this.enabled)return;const{mask:t,minHandle:i,maxHandle:s}=this,{offsetX:r,offsetY:n}=e;i.containsPoint(r,n)||s.containsPoint(r,n)?this.ctx.cursorManager.updateCursor("navigator","ew-resize"):t.computeVisibleRangeBBox().containsPoint(r,n)?this.ctx.cursorManager.updateCursor("navigator","grab"):this.ctx.cursorManager.updateCursor("navigator")}onDragStart(e){if(!this.enabled)return;const{mask:t,minHandle:i,maxHandle:s,x:r,width:n,_min:o}=this,{offsetX:a,offsetY:l}=e;i.zIndex<s.zIndex?s.containsPoint(a,l)?this.dragging="max":i.containsPoint(a,l)&&(this.dragging="min"):i.containsPoint(a,l)?this.dragging="min":s.containsPoint(a,l)&&(this.dragging="max"),null==this.dragging&&t.computeVisibleRangeBBox().containsPoint(a,l)&&(this.dragging="pan",this.panStart=(a-r)/n-o),null!=this.dragging&&this.ctx.zoomManager.fireZoomPanStartEvent("navigator")}onDrag(e){if(!this.enabled||null==this.dragging)return;const{dragging:t,minRange:i,panStart:s,x:r,width:n}=this;let{_min:o,_max:a}=this;const{offsetX:l}=e,c=(l-r)/n;if("min"===t)o=Vs(0,c,a-i);else if("max"===t)a=Vs(o+i,c,1);else if("pan"===t&&null!=s){const e=a-o;o=Vs(0,c-s,1-e),a=o+e}this._min=o,this._max=a,this.updateZoom()}onDragEnd(){this.dragging=void 0}onLeave(e){this.ctx.cursorManager.updateCursor("navigator")}onZoomChange(e){const{x:t}=e;t&&(this._min=t.min,this._max=t.max,this.updateNodes(t.min,t.max))}layoutNodes(e,t,i,s){const{rangeSelector:r,mask:n,minHandle:o,maxHandle:a,_min:l,_max:c}=this;r.layout(e,t,i,s,o.width/2,a.width/2),n.layout(e,t,i,s),Mu.align(o,a,e,t,i,s,l,c),l+(c-l)/2<.5?(o.zIndex=3,a.zIndex=4):(o.zIndex=4,a.zIndex=3)}updateNodes(e,t){this.mask.update(e,t)}updateZoom(){if(!this.enabled)return;const{_min:e,_max:t}=this,i=this.ctx.zoomManager.getZoom();return null!=e&&null!=t?this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t},y:null==i?void 0:i.y},!1,e=>{null==this.min&&null==this.max||N.warnOnce(`Could not apply [navigator.min] or [navigator.max] as [${e}] has modified the initial zoom state.`)}):void 0}};C([jr(qr,{optional:!0})],Du.prototype,"miniChart",2),C([jr(Zr),Xa(e=>e.updateGroupVisibility())],Du.prototype,"enabled",2),C([jr(sn)],Du.prototype,"height",2),C([jr(sn)],Du.prototype,"margin",2),C([qa({newValue(e){this._min=e,this.updateZoom()}}),jr($r(rn,hn("max")),{optional:!0})],Du.prototype,"min",2),C([qa({newValue(e){this._max=e,this.updateZoom()}}),jr($r(rn,dn("min")),{optional:!0})],Du.prototype,"max",2);var Iu={type:"root",optionsKey:"navigator",packageType:"community",chartTypes:["cartesian"],instanceConstructor:Du,themeTemplate:{navigator:{enabled:!1,height:30,mask:{fill:"#999999",stroke:"#999999",strokeWidth:1,fillOpacity:.2},minHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8},maxHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8}}}},Ru=({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}},Pu=e=>{const{fill:t,stroke:i}=Ru(e);return{marker:{fill:t,stroke:i}}};function ku(e,t,i,s,r){const{addPhaseFn:n,updatePhaseFn:o,removePhaseFn:a}=r,l=(s,r,n)=>{i.animate({id:`${e}_${t}_${r.id}_${s}`,groupId:e,from:0,to:1,ease:yr,collapsable:!1,onUpdate(e,t){t&&"removed"!==s||(r.path.clear(!0),n(e,r),r.checkPathDirty())},onStop(){"added"===s&&(r.path.clear(!0),n(1,r),r.checkPathDirty())},phase:Dr[s]})};for(const e of s)i.isSkipped()||(l("removed",e,a),l("updated",e,o)),l("added",e,n)}var Lu=null;function Nu(e){if(null!=e)return""===e?"":(null!=Lu||(Lu=ws("div")),Lu.textContent=String(e),Lu.innerHTML)}function _u({id:e},t,i,...s){Rr(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Ou({id:e},t,i,...s){Rr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Fu(e){return{opacity:1}}var Gu=class extends yt{constructor(){super(...arguments),this._dirty=3}markDirty(e,t=1){this._dirty<t&&(this._dirty=t)}markClean(e){this._dirty=0}isDirty(){return this._dirty>0}},Bu=class extends Gu{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};C([jr(Zr),ir({redraw:3})],Bu.prototype,"enabled",2),C([jr(mn),ir({redraw:3})],Bu.prototype,"color",2),C([jr(en),ir({redraw:3})],Bu.prototype,"xOffset",2),C([jr(en),ir({redraw:3})],Bu.prototype,"yOffset",2),C([jr(sn),ir({redraw:3})],Bu.prototype,"blur",2);var Vu=Bn(e=>kd(e)||"function"==typeof fd&&Object.create(e.prototype)instanceof fd,"a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Hu=class extends Gu{constructor(){super(...arguments),this.enabled=!0,this.shape=yd,this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1}getStyle(){const{size:e,fill:t,fillOpacity:i,stroke:s,strokeWidth:r,strokeOpacity:n}=this;return{size:e,fill:t,fillOpacity:i,stroke:s,strokeWidth:r,strokeOpacity:n}}getDiameter(){return this.size+this.strokeWidth}};C([jr(Zr),ir({redraw:3})],Hu.prototype,"enabled",2),C([jr(Vu),ir({redraw:3})],Hu.prototype,"shape",2),C([jr(sn),ir({redraw:3})],Hu.prototype,"size",2),C([jr(mn,{optional:!0}),ir({redraw:3})],Hu.prototype,"fill",2),C([jr(rn),ir({redraw:3})],Hu.prototype,"fillOpacity",2),C([jr(mn,{optional:!0}),ir({redraw:3})],Hu.prototype,"stroke",2),C([jr(sn),ir({redraw:3})],Hu.prototype,"strokeWidth",2),C([jr(rn),ir({redraw:3})],Hu.prototype,"strokeOpacity",2),C([jr(Qr,{optional:!0}),ir({redraw:3})],Hu.prototype,"formatter",2);var Uu=class extends yt{constructor(){super(...arguments),this.enabled=!1}};C([jr(Zr)],Uu.prototype,"enabled",2);var zu=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.interaction=new Uu,this.position=new rl}toTooltipHtml(e,t){return this.renderer?sl(this.renderer(t),e):sl(e)}};C([jr(Zr)],zu.prototype,"enabled",2),C([jr(Zr,{optional:!0})],zu.prototype,"showArrow",2),C([jr(Qr,{optional:!0})],zu.prototype,"renderer",2),C([jr(qr)],zu.prototype,"interaction",2),C([jr(qr)],zu.prototype,"position",2);var Wu=class extends zd{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.shadow=new Bu,this.marker=new Hu,this.label=new Bo,this.tooltip=new zu,this.connectMissingData=!1}};function ju({id:e},t,i,...s){Rr(e,"markers",t,s,{opacity:0},{opacity:1},{phase:i?Dr[i]:"trailing"}),s.forEach(e=>e.cleanup())}function Ku({id:e},t,...i){Rr(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(e=>e.cleanup())}function $u({id:e,nodeDataDependencies:t},i,...s){const r=t.seriesRectWidth;Ir(e,"markers",i,s,{fromFn:(e,t)=>{var i,s;const n=null!=(s=null==(i=t.midPoint)?void 0:i.x)?s:r;let o=Vs(0,wr(n/r),1);return isNaN(o)&&(o=0),{scalingX:0,scalingY:0,delay:o,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Yu(e){return{opacity:1,scalingX:1,scalingY:1}}function qu(e,t){var i,s,r,n;return{translationX:null!=(s=null==(i=t.point)?void 0:i.x)?s:NaN,translationY:null!=(n=null==(r=t.point)?void 0:r.y)?n:NaN}}function Xu(e,t){const i=(t,i)=>{const s=e[i][t];return Array.isArray(s)?s[0]:s},s=t=>{const{xValue:s}=t;return e.moved[s]?{point:i(s,"moved"),status:"updated"}:e.removed[s]?{point:i(s,"removed"),status:"removed"}:e.added[s]?{point:i(s,"added"),status:"added"}:{status:"unknown"}};return{fromFn:(e,i)=>{var r,n,o,a,l,c;const{status:h,point:d}=s(i);if("unknown"===h)return{opacity:0};const u={translationX:null!=(n=null==(r=null==d?void 0:d.from)?void 0:r.x)?n:e.translationX,translationY:null!=(a=null==(o=null==d?void 0:d.from)?void 0:o.y)?a:e.translationY,opacity:e.opacity,phase:Dr[h]};return"added"===t?f(m({},u),{opacity:0,translationX:null==(l=null==d?void 0:d.to)?void 0:l.x,translationY:null==(c=null==d?void 0:d.to)?void 0:c.y,phase:Dr.added}):("added"===h&&(u.opacity=0),u)},toFn:(e,i)=>{var r,n;const{status:o,point:a}=s(i);if("unknown"===o)return{opacity:0};const l={translationX:i.point.x,translationY:i.point.y,opacity:1,phase:Dr[o]};return"removed"===o||"removed"===t?f(m({},l),{translationX:null==(r=null==a?void 0:a.to)?void 0:r.x,translationY:null==(n=null==a?void 0:a.to)?void 0:n.y,opacity:0,phase:Dr.removed}):l}}}function Zu(e,{datumIndex:t}){const i=e.getNodeData();if(void 0===i)return;const s=i[t];if(void 0===s||void 0===s.point)return;const r=e.getFormattedMarkerStyle(s).size,n=r/2,{x:o,y:a}=e.contentGroup.inverseTransformPoint(s.point.x-n,s.point.y-n);return new Js(o,a,r,r)}function Qu(e){return e.reduce(({min:e,max:t},i)=>((null==e||e.point.x>i.point.x)&&(e=i),(null==t||t.point.x<i.point.x)&&(t=i),{min:e,max:t}),{})}function Ju(e,t,i){const s=(t.y-e.y)/(t.x-e.x);return{x:i,y:(i-e.x)*s+e.y}}function ep(e,t,i,s){let r=-1,n=0;const o=[];for(;n<e.length;)e[n].change!==t?e[n].change!==i?(o.length>0&&(s(o,r,n),o.length=0),r=n,n++):n++:(o.push(e[n]),n++);o.length>0&&s(o,r,n)}function tp(e,t){ep(e,"out","in",(i,s,r)=>{var n,o;-1===s&&e[r]?i.forEach(t=>t.to=e[r].from):r===e.length&&e[s]?i.forEach(t=>t.to=e[s].from):"intersect"===t&&(null==(n=e[s])?void 0:n.from)&&(null==(o=e[r])?void 0:o.from)?i.forEach(t=>t.to=Ju(e[s].from,e[r].from,t.from.x)):i.forEach(e=>e.to=e.from)}),ep(e,"in","out",(i,s,r)=>{var n,o;-1===s&&e[r]?i.forEach(t=>t.from=e[r].to):r===e.length&&e[s]?i.forEach(t=>t.from=e[s].to):"intersect"===t&&(null==(n=e[s])?void 0:n.to)&&(null==(o=e[r])?void 0:o.to)?i.forEach(t=>t.from=Ju(e[s].to,e[r].to,t.to.x)):i.forEach(e=>e.from=e.to)})}function ip(e,t,i){const s=isNaN(e.x)?t.x:e.x,r=isNaN(e.y)?t.y:e.y,n=t.x-e.x,o=t.y-e.y;return{x:s+(isNaN(n)?0:n*i),y:r+(isNaN(o)?0:o*i)}}function sp(e,t,i){const{path:s}=i;let r;for(const i of e){const{from:e,to:n}=i,o=t[i.change];if(null==o||null==e||null==n)continue;const{x:a,y:l}=ip(e,n,o);if(!1===i.moveTo)s.lineTo(a,l);else if(!0!==i.moveTo&&r){if(r){const e="in"===i.moveTo?o:1-o,{x:t,y:n}=ip(r,{x:a,y:l},e);s.lineTo(t,n),s.moveTo(a,l)}}else s.moveTo(a,l);r={x:a,y:l}}}function rp({id:e,visible:t,nodeDataDependencies:i},s,...r){const{seriesRectWidth:n,seriesRectHeight:o}=i;Rr(e,"path_properties",s,r,{clipX:0},{clipX:n},{phase:"initial",start:{clipMode:"normal",clipY:o,visible:t},finish:{clipMode:void 0,visible:t}})}function np({id:e},t,i,s="add",...r){Rr(e,t,i,r,{opacity:0},{opacity:1},{phase:s})}function op({id:e},t,i,...s){Rr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function ap(e){return t=>({opacity:e.getOpacity(),clipScalingX:1,clipMode:void 0})}function lp({nodeDataDependencies:e},t){const i=e=>isFinite(e)?e:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}function cp(e){return"continuous"===e.type||"log"===e.type}function hp(e){return"category"===e.type}function dp(e,t){return e.domain.length===t.domain.length&&e.range.length===t.range.length&&e.domain.every((e,i)=>e===t.domain[i])&&e.range.every((e,i)=>e===t.range[i])}function up(e,t){return void 0===e||void 0===t?void 0!==e||void 0!==t:cp(e)&&cp(t)?e.type===t.type&&dp(e,t):!(!hp(e)||!hp(t))&&dp(e,t)}function pp(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),"continuous"===t.type&&"number"==typeof e)return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if("log"===t.type&&"number"==typeof e)return t.convert(e);const i=t.domain.findIndex(t=>t===e);return i>=0?t.range[i]:NaN}function gp(e,t){const i=Number(e),s=Number(t);return isNaN(i)||isNaN(s)?e===t:Math.abs(s-i)<.25}function mp(e=!1,t=!1){return e===t?Boolean(e):e?"in":"out"}function fp(e,t,i={}){var s,r,n,o;const{backfillSplitMode:a="intersect"}=i,l=t=>{var i,s;return{x:pp(null!=(i=t.xValue)?i:NaN,e.scales.x),y:pp(null!=(s=t.yValue)?s:NaN,e.scales.y)}},c=e=>{var i,s;return{x:pp(null!=(i=e.xValue)?i:NaN,t.scales.x),y:pp(null!=(s=e.yValue)?s:NaN,t.scales.y)}},h=[],d={added:{},moved:{},removed:{}},u=(e,t,i,s="move")=>{e&&(isNaN(e.point.x)||isNaN(e.point.y))&&(e=t);const r={from:null==e?void 0:e.point,to:null==t?void 0:t.point,moveTo:mp(null==e?void 0:e.point.moveTo,null==t?void 0:t.point.moveTo),change:s};"move"===s?(d.moved[i]=r,y++,v++):"in"===s?(d.added[i]=r,v++):"out"===s&&(d.removed[i]=r,y++),h.push(r)},{min:p,max:g}=Qu(t.nodeData),{min:m,max:f}=Qu(e.nodeData);let y=0,v=0;for(;y<t.nodeData.length||v<e.nodeData.length;){const i=t.nodeData[y],a=e.nodeData[v],h=i?l(i):void 0,d=a?c(a):void 0,C=void 0;if(h&&gp(h.x,null==a?void 0:a.point.x))u(i,a,a.xValue,"move");else if(h&&h.x<(null!=(s=null==m?void 0:m.point.x)?s:-1/0))u(i,C,i.xValue,"out");else if(h&&h.x>(null!=(r=null==f?void 0:f.point.x)?r:1/0))u(i,C,i.xValue,"out");else if(d&&d.x<(null!=(n=null==p?void 0:p.point.x)?n:-1/0))u(C,a,a.xValue,"in");else if(d&&d.x>(null!=(o=null==g?void 0:g.point.x)?o:1/0))u(C,a,a.xValue,"in");else if(h&&h.x<(null==a?void 0:a.point.x))u(i,C,i.xValue,"out");else if(d&&d.x<(null==i?void 0:i.point.x))u(C,a,a.xValue,"in");else if(i)u(i,C,i.xValue,"out");else{if(!a)throw new Error("Unable to process points");u(C,a,a.xValue,"in")}}return tp(h,a),{result:h,resultMap:d}}function yp(e,t,i,s={}){var r,n,o;const{backfillSplitMode:a="intersect",multiDatum:l=!1}=s,c=[],h={added:{},moved:{},removed:{}},d={added:{},moved:{},removed:{}},u={in:"added",move:"moved",out:"removed"};let p,g;const f=(e,t)=>{var i;const s=u[t.change];l?(null!=(i=d[s])[e]||(i[e]=[]),d[s][e].push(t)):h[s][e]=t,p=t,g=Yo(e)};let y=0,v=0,C=!1;for(;y<t.nodeData.length||v<e.nodeData.length;){const s=t.nodeData[y],a=e.nodeData[v],h=Yo(null==s?void 0:s.xValue),d=Yo(null==a?void 0:a.xValue);let u;if(h===d)u={change:"move",moveTo:mp(null!=(r=s.point.moveTo)&&r,a.point.moveTo),from:s.point,to:a.point},f(null==s?void 0:s.xValue,u),y++,v++;else if(null==i?void 0:i.removed.has(String(h)))u={change:"out",moveTo:null!=(n=s.point.moveTo)&&n,from:s.point},f(null==s?void 0:s.xValue,u),y++;else if(null==i?void 0:i.added.has(String(d)))u={change:"in",moveTo:null!=(o=a.point.moveTo)&&o,to:a.point},f(null==a?void 0:a.xValue,u),v++;else if(l&&p&&g===h)u=m({},p),f(null==s?void 0:s.xValue,u),y++;else{if(!l||!p||g!==d){C=!0;break}u=m({},p),f(null==a?void 0:a.xValue,u),v++}c.push(u)}let b=-1/0;return C||(C=c.some(e=>{const{change:t,to:{x:i=-1/0}={}}=e;if("out"===t)return;const s=i<b;return b=i,s})),C?{result:void 0,resultMap:void 0}:(tp(c,a),{result:c,resultMap:l?d:h})}function vp(e,t,i){var s,r,n,o;let a="updated";const l=e=>e.visible;if(!l(t)&&l(e))a="added";else if(l(t)&&!l(e))a="removed";else for(let e=0;e<i.length&&"move"===i[e].change&&(null==(s=i[e].from)?void 0:s.x)===(null==(r=i[e].to)?void 0:r.x)&&(null==(n=i[e].from)?void 0:n.y)===(null==(o=i[e].to)?void 0:o.y);e++)if(e===i.length-1)return"no-op";return a}function Cp(e,t,i,s,r){const n=vp(e,t,i),o=function(e,t){const i="none"===t?"updated":e,s={fromFn:t=>{let s;return s="removed"===e?{finish:{visible:!1}}:"added"===e?{start:{visible:!0}}:{},m({phase:Dr[i]},s)},toFn:e=>({phase:Dr[i]})};return"fade"===t?{fromFn:t=>{const i="added"===e?0:t.opacity;return m({opacity:i},s.fromFn(t))},toFn:t=>m({opacity:"removed"===e?0:1},s.toFn(t))}:s}(n,s);return{status:n,path:{addPhaseFn:(e,t)=>{r(i,{move:1,in:e},t)},updatePhaseFn:(e,t)=>{r(i,{move:e},t)},removePhaseFn:(e,t)=>{r(i,{move:0,out:e},t)}},pathProperties:o}}function bp(e,t,i){var s,r,n;const o="category"===(null==(s=e.scales.x)?void 0:s.type);if(o!==("category"===(null==(r=t.scales.x)?void 0:r.type)))return;const{result:a,resultMap:l}=o?yp(e,t,i):fp(e,t);let c="updated";if(t.visible&&!e.visible?c="removed":!t.visible&&e.visible&&(c="added"),void 0===a||void 0===l)return;const h=null==(n=null==i?void 0:i.changed)||n||function(e,t){return!up(e.scales.x,t.scales.x)||!up(e.scales.y,t.scales.y)}(e,t)||"updated"!==c,d=Cp(e,t,a,"fade",sp),u=Xu(l,c);return f(m({},d),{marker:u,hasMotion:h})}C([jr(Jr)],Wu.prototype,"xKey",2),C([jr(Jr,{optional:!0})],Wu.prototype,"xName",2),C([jr(Jr)],Wu.prototype,"yKey",2),C([jr(Jr,{optional:!0})],Wu.prototype,"yName",2),C([jr(sn,{optional:!0})],Wu.prototype,"normalizedTo",2),C([jr(mn)],Wu.prototype,"fill",2),C([jr(rn)],Wu.prototype,"fillOpacity",2),C([jr(mn)],Wu.prototype,"stroke",2),C([jr(sn)],Wu.prototype,"strokeWidth",2),C([jr(rn)],Wu.prototype,"strokeOpacity",2),C([jr(En)],Wu.prototype,"lineDash",2),C([jr(sn)],Wu.prototype,"lineDashOffset",2),C([jr(qr)],Wu.prototype,"shadow",2),C([jr(qr)],Wu.prototype,"marker",2),C([jr(qr)],Wu.prototype,"label",2),C([jr(qr)],Wu.prototype,"tooltip",2),C([jr(Zr)],Wu.prototype,"connectMissingData",2);var Sp=(e=>(e[e.Fill=0]="Fill",e[e.Stroke=1]="Stroke",e[e.Marker=2]="Marker",e[e.Label=3]="Label",e))(Sp||{});function wp(e){const{points:t,phantomPoints:i}=e.fillData;return{top:t,bottom:i}}function xp(e,t,i){return{scales:t.scales,nodeData:i[e],visible:t.visible}}function Ep(e,t,i){var s,r;const n="category"===(null==(s=e.scales.x)?void 0:s.type);if(n!==("category"===(null==(r=t.scales.x)?void 0:r.type)))return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const{resultMap:a}=n?yp(e,t,i,{backfillSplitMode:"static",multiDatum:!0}):fp(e,t,{backfillSplitMode:"static"}),{top:l,bottom:c}=n?function(e,t,i){const s=wp(t),r=wp(e),n={multiDatum:!0};return{top:yp(xp("top",e,r),xp("top",t,s),i,n),bottom:yp(xp("bottom",e,r),xp("bottom",t,s),i,n)}}(e,t,i):function(e,t){const i=wp(t),s=wp(e);return{top:fp(xp("top",e,s),xp("top",t,i)),bottom:fp(xp("bottom",e,s),xp("bottom",t,i))}}(e,t);if(void 0===a||void 0===l.result||void 0===c.result)return;const h=Cp(e,t,[...l.result,...c.result.reverse()],!!t.stackVisible&&e.stackVisible?"none":"fade",sp),d=Xu(a,o);return{status:h.status,fill:h,marker:d}}var Mp=class extends Wd{constructor(e){super({moduleCtx:e,directionKeys:Vd,directionNames:Hd,pathsPerSeries:2,pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[1,0],animationResetFns:{path:ap({getOpacity:()=>this.getOpacity()}),label:Fu,marker:(e,t)=>m(m({},{opacity:1,scalingX:1,scalingY:1}),qu(0,t))}}),this.properties=new Wu}processData(e){return S(this,null,function*(){var t,i;if(null==this.data||!this.properties.isValid())return;const{data:s,visible:r,seriesGrouping:{groupIndex:n=this.id,stackCount:o=1}={}}=this,{xKey:a,yKey:l,connectMissingData:c,normalizedTo:h}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=null==(t=this.axes.x)?void 0:t.scale,p=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:g,xScaleType:y,yScaleType:v}=this.getScaleInformation({xScale:u,yScale:p}),C=[`area-stack-${n}-yValues`,`area-stack-${n}-yValues-trailing`,`area-stack-${n}-yValues-prev`,`area-stack-${n}-yValues-trailing-prev`,`area-stack-${n}-yValues-marker`],b=[];Pe(h)&&(b.push(Dh([C[0],C[1],C[4]],h,"range")),b.push(Dh([C[2],C[3]],h,"range"))),!g&&d&&this.processedData&&b.push(_h(this.processedData)),d&&b.push(Ph());const S={invalidValue:null};c&&o>1&&(S.invalidValue=0),r||(S.forceValue=0),yield this.requestDataModel(e,s,{props:[Uh(a,y,{id:"xValue"}),zh(l,v,m({id:"yValueRaw"},S)),...$h(l,"window","current",f(m({id:"yValueEnd"},S),{groupId:C[0]}),v),...$h(l,"window-trailing","current",f(m({id:"yValueStart"},S),{groupId:C[1]}),v),...$h(l,"window","last",f(m({id:"yValuePreviousEnd"},S),{groupId:C[2]}),v),...$h(l,"window-trailing","last",f(m({id:"yValuePreviousStart"},S),{groupId:C[3]}),v),...$h(l,"normal","current",f(m({id:"yValueCumulative"},S),{groupId:C[4]}),v),...b],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")})}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i||0===t.data.length)return[];const r=s.x,n=s.y,o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t),l=i.getDomain(this,"yValueEnd","value",t);return"x"===e?"key"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?a:Yc(as(a),r):Yc(n instanceof eu||n instanceof iu?l:[l[0]>0?0:l[0],l[1]<0?0:l[1]],n)}createNodeData(){return S(this,null,function*(){var e;const{axes:t,data:i,processedData:{data:s}={},dataModel:r}=this,n=t.x,o=t.y;if(!(n&&o&&i&&r&&this.properties.isValid()))return;const{yKey:a,xKey:l,marker:c,label:h,fill:d,stroke:u,connectMissingData:p}=this.properties,{scale:g}=n,{scale:y}=o,{isContinuousY:v}=this.getScaleInformation({xScale:g,yScale:y}),C=(null!=(e=g.bandwidth)?e:0)/2,b=r.resolveProcessedDataDefsByIds(this,["yValueStart","yValueEnd","yValueRaw","yValuePreviousStart","yValuePreviousEnd","yValueCumulative"]),S=e=>f(m({},e),{point:f(m({},e.point),{moveTo:!0})}),w=(e,t,i)=>{const s=g.convert(e)+C,r=y.convert(t);return[{point:{x:s,y:y.convert(i)},yValue:i,xValue:e},{point:{x:s,y:r},yValue:t,xValue:e}]},x=(e,t,i)=>{let s;return(Pe(this.properties.normalizedTo)?v&&Ko(i):!isNaN(i))&&(s=t),{x:g.convert(e)+C,y:y.convert(s),size:c.size}},E=a,M=[],A=[],{visibleSameStackCount:T}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),D={itemId:E,fillData:{itemId:E,points:[],phantomPoints:[]},strokeData:{itemId:E,points:[]},labelData:M,nodeData:A,scales:this.calculateScaling(),visible:this.visible,stackVisible:T>0},I=D.fillData.points,R=D.fillData.phantomPoints,P=D.strokeData.points;let k,L=-1,N=-1/0;return null==s||s.forEach(e=>{const{keys:t,keys:[i],datum:s,values:n}=e;n.forEach((e,n)=>{var o,g,m;L++;const f=s[n],y=r.resolveProcessedDataDefsValues(b,{keys:t,values:e}),{yValueRaw:v,yValueCumulative:C}=y;let{yValueStart:T,yValueEnd:D,yValuePreviousStart:_,yValuePreviousEnd:O}=y;const F=null!=v,G=x(i,+C,v);if(F&&c&&A.push({index:L,series:this,itemId:E,datum:f,midPoint:{x:G.x,y:G.y},cumulativeValue:D,yValue:v,xValue:i,yKey:a,xKey:l,point:G,fill:null!=(o=c.fill)?o:d,stroke:null!=(g=c.stroke)?g:u,strokeWidth:null!=(m=c.strokeWidth)?m:this.getStrokeWidth(this.properties.strokeWidth)}),F&&h){const e=this.getLabelText(h,{value:v,datum:f,xKey:l,yKey:a,xName:this.properties.xName,yName:this.properties.yName},e=>ze(e)?e.toFixed(2):String(e));M.push({index:L,series:this,itemId:a,datum:f,x:G.x,y:G.y,label:e?{text:e,fontStyle:h.fontStyle,fontWeight:h.fontWeight,fontSize:h.fontSize,fontFamily:h.fontFamily,textAlign:"center",textBaseline:"bottom",fill:h.color}:void 0})}const B=null!=k&&null!=i,V=null!=N&&F;V||(T=null!=T?T:0,D=null!=T?T:0,_=null!=_?_:0,O=null!=_?_:0);const[H,U]=w(k,_,O),[z,W]=w(i,T,D);!B||p&&!V||(I.push(H,z),R.push(U,W)),V&&L>0&&P.push(S(H),z),k=i,N=v})}),P.length>0&&(P[0]=S(P[0])),D})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:e}=this.properties.marker;return new(Ld(e))}updatePathNodes(e){return S(this,null,function*(){const{opacity:t,visible:i,animationEnabled:s}=e,[r,n]=e.paths,o=this.getStrokeWidth(this.properties.strokeWidth);n.setProperties({tag:1,fill:void 0,lineJoin:n.lineCap="round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:o,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i}),r.setProperties({tag:0,stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,opacity:t,visible:i||s,strokeWidth:o}),lp(this,n),lp(this,r)})}updatePaths(e){return S(this,null,function*(){this.updateAreaPaths(e.paths,e.contextData)})}updateAreaPaths(e,t){this.updateFillPath(e,t),this.updateStrokePath(e,t)}updateFillPath(e,t){const{fillData:i}=t,[s]=e,{path:r}=s;let n;r.clear(!0);for(const{point:e}of k(i.points,function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]}(i.phantomPoints)))e.moveTo?r.moveTo(e.x,e.y):(null==n?void 0:n.y)!==e.y&&(n&&r.lineTo(n.x,n.y),r.lineTo(e.x,e.y)),n=e;n&&r.lineTo(n.x,n.y),r.closePath(),s.checkPathDirty()}updateStrokePath(e,t){const{strokeData:i}=t,[,s]=e,{path:r}=s;r.clear(!0);for(const{point:e}of i.points)e.moveTo?r.moveTo(e.x,e.y):r.lineTo(e.x,e.y);s.checkPathDirty()}updateMarkerSelection(e){return S(this,null,function*(){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])})}updateMarkerNodes(e){return S(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,marker:n,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:d}=this.properties,u=qe(i&&d.item,n.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h});t.each((e,t)=>{this.updateMarkerStyle(e,n,{datum:t,highlighted:i,xKey:s,yKey:r},u)}),i||this.properties.marker.markClean()})}updateLabelSelection(e){return S(this,null,function*(){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.tag=3})})}updateLabelNodes(e){return S(this,null,function*(){const{labelSelection:t}=e,{enabled:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o,color:a}=this.properties.label;t.each((e,t)=>{const{x:l,y:c,label:h}=t;h&&i&&this.visible?(e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textAlign=h.textAlign,e.textBaseline=h.textBaseline,e.text=h.text,e.x=l,e.y=c-10,e.fill=a,e.visible=!0):e.visible=!1})})}getTooltipHtml(e){const{id:t,axes:i,dataModel:s}=this,{xKey:r,xName:n,yName:o,tooltip:a,marker:l}=this.properties,{yKey:c,xValue:h,yValue:d,datum:u,itemId:p}=e,g=i.x,m=i.y;if(!this.properties.isValid()||!(g&&m&&ze(d))||!s)return tl;const f=g.formatDatum(h),y=m.formatDatum(d),v=Nu(o),C=Nu(f+": "+y),b=qe({fill:this.properties.fill},l.getStyle(),{stroke:this.properties.stroke,strokeWidth:this.properties.strokeWidth}),{fill:S}=this.getMarkerStyle(l,{datum:e,xKey:r,yKey:c,highlighted:!1},b);return a.toTooltipHtml({title:v,content:C,backgroundColor:S},{datum:u,itemId:p,xKey:r,xName:n,yKey:c,yName:o,color:S,title:v,seriesId:t})}getLegendData(e){var t,i,s,r;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||"category"!==e)return[];const{yKey:n,yName:o,fill:a,stroke:l,fillOpacity:c,strokeOpacity:h,strokeWidth:d,lineDash:u,marker:p,visible:g}=this.properties,m=!p.enabled||void 0===p.fill;return[{legendType:e,id:this.id,itemId:n,seriesId:this.id,enabled:g,label:{text:null!=o?o:n},marker:{shape:p.shape,fill:m?a:p.fill,fillOpacity:m?c:p.fillOpacity,stroke:null!=(i=p.stroke)?i:l,strokeOpacity:null!=(s=p.strokeOpacity)?s:h,strokeWidth:null!=(r=p.strokeWidth)?r:0,enabled:p.enabled||d<=0},line:{stroke:l,strokeOpacity:h,strokeWidth:d,lineDash:u}}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:r}=e,{animationManager:n}=this.ctx;this.updateAreaPaths(r,s),rp(this,n,...r),ma([t],qu),$u(this,n,t),_u(this,"labels",n,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){var t,i;const{animationManager:s}=this.ctx,{markerSelection:r,labelSelection:n,contextData:o,paths:a,previousContextData:l}=e,[c,h]=a;if(null==c&&null==h)return;super.resetAllAnimation(e);const d=()=>{this.updateAreaPaths(a,o),this.updateStrokePath(a,o)};if(null==o||null==l)return d(),ju(this,s,"added",r),np(this,"fill_path_properties",s,"add",c),np(this,"stroke",s,"trailing",h),void _u(this,"labels",s,n);const u=Ep(o,l,null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(ju(this,s,void 0,r),Ir(this.id,"fill_path_properties",s,[c],u.fill.pathProperties),ku(this.id,"fill_path_update",s,[c],u.fill.path),this.updateStrokePath(a,o),np(this,"stroke",s,"trailing",h),_u(this,"labels",s,n))}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,highlighted:!0})}computeFocusBounds(e){return Zu(this,e)}};Mp.className="AreaSeries",Mp.type="area";var Ap={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",instanceConstructor:Mp,stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:zt,nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5},marker:{__extends__:Wt,enabled:!1,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:jt,color:Kt}}},paletteFactory:e=>{const{marker:t}=Pu(e);return{fill:t.fill,stroke:t.stroke,marker:t}}};function*Tp(e){for(const t of e.children)yield t}function Dp(e,t){for(const i of t){const t=i.datum;void 0===t?N.error("undefined datum"):e.addValue(i,t)}}function Ip(e,t){const{x:i,y:s}=e.contentGroup.transformPoint(t.x,t.y),{nearest:r,distanceSquared:n}=e.getQuadTree().find(i,s);if(void 0!==r)return{datum:r.value,distance:Math.sqrt(n)}}var Rp=class extends zd{constructor(){super(...arguments),this.direction="vertical"}};C([jr(kn)],Rp.prototype,"direction",2);var Pp=class extends Wd{constructor(){super(...arguments),this.groupScale=new zr,this.smallestDataInterval=void 0}getBandScalePadding(){return{inner:.2,outer:.1}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}updateGroupScale(e){const{groupScale:t,smallestDataInterval:i,ctx:{seriesStateManager:s}}=this,r=e.scale,n=qn.is(r)?r.calcBandwidth(i):r.bandwidth,o=[],{index:a,visibleGroupCount:l}=s.getVisiblePeerGroupIndex(this);for(let e=0;e<l;e++)o.push(String(e));return t.domain=o,t.range=[0,null!=n?n:0],e instanceof Tl?t.paddingInner=e.groupPaddingInner:t.padding=e instanceof Gl?.1:0,t.round=0!==t.padding,{barWidth:t.bandwidth>=1?t.bandwidth:t.rawBandwidth,groupIndex:a}}resolveKeyDirection(e){return"x"===this.getBarDirection()?"x"===e?"y":"x":e}initQuadTree(e){Dp(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Ip(this,e)}},kp=class extends Bo{constructor(){super(...arguments),this.placement="inside"}};C([jr(Ln)],kp.prototype,"placement",2);var Lp=class extends Rp{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new Bu,this.label=new kp,this.tooltip=new zu}};function Np({rect:e,config:t}){const{crisp:i=!0,fill:s,stroke:r,strokeWidth:n,fillOpacity:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,fillShadow:h,cornerRadius:d=0,topLeftCornerRadius:u=!0,topRightCornerRadius:p=!0,bottomRightCornerRadius:g=!0,bottomLeftCornerRadius:m=!0,visible:f=!0}=t;e.crisp=i,e.fill=s,e.stroke=r,e.strokeWidth=n,e.fillOpacity=o,e.strokeOpacity=a,e.lineDash=l,e.lineDashOffset=c,e.fillShadow=h,e.topLeftCornerRadius=u?d:0,e.topRightCornerRadius=p?d:0,e.bottomRightCornerRadius=g?d:0,e.bottomLeftCornerRadius=m?d:0,e.visible=f}function _p(e){var t,i,s,r,n,o,a=e,{datum:l,isHighlighted:c,style:h,highlightStyle:d,formatter:u,seriesId:p,ctx:{callbackCache:g}}=a,f=y(a,["datum","isHighlighted","style","highlightStyle","formatter","seriesId","ctx"]);const{fill:v,fillOpacity:C,stroke:b,strokeWidth:S}=qe(c&&d,h),{strokeOpacity:w,fillShadow:x,lineDash:E,lineDashOffset:M,cornerRadius:A=0,topLeftCornerRadius:T=!0,topRightCornerRadius:D=!0,bottomRightCornerRadius:I=!0,bottomLeftCornerRadius:R=!0}=h;let P;return u&&(P=g.call(u,m({datum:l.datum,xKey:l.xKey,fill:v,stroke:b,strokeWidth:S,cornerRadius:A,highlighted:c,seriesId:p},f))),{fill:null!=(t=null==P?void 0:P.fill)?t:v,stroke:null!=(i=null==P?void 0:P.stroke)?i:b,strokeWidth:null!=(s=null==P?void 0:P.strokeWidth)?s:S,fillOpacity:null!=(r=null==P?void 0:P.fillOpacity)?r:C,strokeOpacity:null!=(n=null==P?void 0:P.strokeOpacity)?n:w,lineDash:E,lineDashOffset:M,fillShadow:x,cornerRadius:null!=(o=null==P?void 0:P.cornerRadius)?o:A,topLeftCornerRadius:T,topRightCornerRadius:D,bottomRightCornerRadius:I,bottomLeftCornerRadius:R}}function Op(e=[]){const[t,i]=e;return!(0!==t||1!==i)}C([jr(Jr)],Lp.prototype,"xKey",2),C([jr(Jr,{optional:!0})],Lp.prototype,"xName",2),C([jr(Jr)],Lp.prototype,"yKey",2),C([jr(Jr,{optional:!0})],Lp.prototype,"yName",2),C([jr(Jr,{optional:!0})],Lp.prototype,"stackGroup",2),C([jr(en,{optional:!0})],Lp.prototype,"normalizedTo",2),C([jr(mn)],Lp.prototype,"fill",2),C([jr(rn)],Lp.prototype,"fillOpacity",2),C([jr(mn)],Lp.prototype,"stroke",2),C([jr(sn)],Lp.prototype,"strokeWidth",2),C([jr(rn)],Lp.prototype,"strokeOpacity",2),C([jr(En)],Lp.prototype,"lineDash",2),C([jr(sn)],Lp.prototype,"lineDashOffset",2),C([jr(sn)],Lp.prototype,"cornerRadius",2),C([jr(Qr,{optional:!0})],Lp.prototype,"formatter",2),C([jr(qr,{optional:!0})],Lp.prototype,"shadow",2),C([jr(qr)],Lp.prototype,"label",2),C([jr(qr)],Lp.prototype,"tooltip",2);var Fp=e=>{var t;return js(null!=(t=e.yValue)?t:0)};function Gp(e,t,i){const{startingX:s,startingY:r}=function(e,t){const i=t[e?"y":"x"];let s=1/0,r=0;return i?(e?r=i.scale.convert(qn.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(qn.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:r}):{startingX:s,startingY:r}}(e,t);return{isVertical:e,calculate:(t,i)=>{let n=e?t.x:s,o=e?r:t.y,a=e?t.width:0,l=e?0:t.height;const{opacity:c}=t;let h;return i&&(isNaN(n)||isNaN(o))&&(({x:n,y:o}=i),a=e?i.width:0,l=e?0:i.height,e&&!Fp(i)?o+=i.height:!e&&Fp(i)&&(n+=i.width)),h=null==t.clipBBox?void 0:Fp(t)?e?new Js(n,o-l,a,l):new Js(n-a,o,a,l):new Js(n,o,a,l),{x:n,y:o,width:a,height:l,clipBBox:h,opacity:c}},mode:i}}function Bp(e,t){return{isVertical:e,calculate:t=>({x:e?t.x:t.x+t.width/2,y:e?t.y+t.height/2:t.y,width:e?t.width:0,height:e?0:t.height,clipBBox:t.clipBBox,opacity:t.opacity}),mode:t}}function Vp(e){const t=e=>null==e||isNaN(e.x)||isNaN(e.y);return{toFn:(i,s,r)=>{let n;return n="removed"===r&&null==i.datum&&"fade"===e.mode?f(m({},Hp(0,s)),{opacity:0}):"removed"===r||t(s)?e.calculate(s,i.previousDatum):{x:s.x,y:s.y,width:s.width,height:s.height,clipBBox:s.clipBBox,opacity:s.opacity},n},fromFn:(i,s,r)=>{let n;"updated"===r&&t(s)?r="removed":"updated"===r&&t(i.previousDatum)&&(r="added"),n="added"===r&&null==i.previousDatum&&"fade"===e.mode?f(m({},Hp(0,s)),{opacity:0}):"unknown"===r||"added"===r?e.calculate(s,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity};const o=Dr[r];return f(m({},n),{phase:o})}}}function Hp(e,{x:t,y:i,width:s,height:r,clipBBox:n,opacity:o}){return{x:t,y:i,width:s,height:r,clipBBox:n,opacity:o}}function Up(e,t,i){if(void 0===e)return;const{x:s,y:r,width:n,height:o}=e;return t.inverseTransformBBox(new Js(s,r,n,o)).clip(i)}function zp(e,t,i){if(t.enabled&&i){const{x:s,y:r,text:n,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u}=t;e.setProperties({visible:!0,x:s,y:r,text:n,fill:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:o,textBaseline:a})}else e.visible=!1}function Wp({isPositive:e,isVertical:t,placement:i,padding:s=0,rect:r}){let n=r.x+r.width/2,o=r.y+r.height/2,a="center",l="middle";switch(i){case"start":t?(o=e?r.y+r.height+s:r.y-s,l=e?"top":"bottom"):(n=e?r.x-s:r.x+r.width+s,a=e?"start":"end");break;case"outside":case"end":t?(o=e?r.y-s:r.y+r.height+s,l=e?"bottom":"top"):(n=e?r.x+r.width+s:r.x-s,a=e?"start":"end")}return{x:n,y:o,textAlign:a,textBaseline:l}}var jp=class extends Pp{constructor(e){super({moduleCtx:e,directionKeys:Vd,directionNames:Hd,pickModes:[0],pathsPerSeries:0,hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Hp,label:Fu}}),this.properties=new Lp}processData(e){return S(this,null,function*(){var t,i,s;if(!this.properties.isValid()||!this.data)return;const{seriesGrouping:{groupIndex:r=this.id}={},data:n=[]}=this,{xKey:o,yKey:a,normalizedTo:l}=this.properties,c=!this.ctx.animationManager.isSkipped(),h=null==(t=this.getCategoryAxis())?void 0:t.scale,d=null==(i=this.getValueAxis())?void 0:i.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:d}),f=`bar-stack-${r}-yValues`,y=`${f}-trailing`,v=[];ze(l)&&v.push(Dh([f,y],Math.abs(l),"range")),c&&this.processedData&&v.push(_h(this.processedData)),c&&v.push(Ph());const C=this.visible?{}:{forceValue:0},{processedData:b}=yield this.requestDataModel(e,n,{props:[Uh(o,p,{id:"xValue"}),zh(a,g,m({id:"yValue-raw",invalidValue:null},C)),...$h(a,"normal","current",m({id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:f,separateNegative:!0},C),g),...$h(a,"trailing","current",m({id:"yValue-start",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0},C),g),...u?[Mh]:[],...v],groupByKeys:!0,groupByData:!1});this.smallestDataInterval=null==(s=b.reduced)?void 0:s.smallestKeyInterval,this.animationState.transition("updateData")})}getSeriesDomain(e){var t;const{processedData:i,dataModel:s,smallestDataInterval:r}=this;if(!i||!s||0===i.data.length)return[];const n=this.getCategoryAxis(),o=this.getValueAxis(),a=s.resolveProcessedDataDefById(this,"xValue"),l=s.getDomain(this,"xValue","key",i),c=s.getDomain(this,"yValue-end","value",i);if(e===this.getCategoryDirection()){if("key"===(null==a?void 0:a.def.type)&&"category"===a.def.valueType)return l;const e=ze(r)?.5*r:0,i=null!=(t=as(l))?t:[NaN,NaN];return Yc([i[0]+-e,i[1]+e],n)}return this.getValueAxis()instanceof eu?Yc(c,o):Yc([Math.min(0,c[0]),Math.max(0,c[1])],o)}createNodeData(){return S(this,null,function*(){const{dataModel:e}=this,t=this.getCategoryAxis(),i=this.getValueAxis();if(!(e&&t&&i&&this.properties.isValid()))return;const s=t.scale,r=i.scale,{xKey:n,yKey:o,xName:a,yName:l,fill:c,stroke:h,strokeWidth:d,cornerRadius:u,legendItemName:p,label:g}=this.properties,f=i.isReversed(),{barWidth:y,groupIndex:v}=this.updateGroupScale(t),C=qn.is(s)?-.5*y:0,b=e.resolveProcessedDataIndexById(this,"xValue"),S=e.resolveProcessedDataIndexById(this,"yValue-raw"),w=e.resolveProcessedDataIndexById(this,"yValue-start"),x=e.resolveProcessedDataIndexById(this,"yValue-end"),E=e.resolveProcessedDataIndexById(this,"yValue-range"),M=!this.ctx.animationManager.isSkipped(),A={itemId:o,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible||M},{groupScale:T,processedData:D}=this;return null==D||D.data.forEach(({keys:e,datum:t,values:i,aggValues:M})=>{i.forEach((i,D)=>{var I;const R=e[b],P=s.convert(R),k=+i[x],L=+i[w],N=i[S],_=N>=0&&!Object.is(N,-0),O=_!==f,F=null!=(I=null==M?void 0:M[E][_?1:0])?I:0,G=P+T.convert(String(v))+C;if(isNaN(k))return;const B=r.convert(k),V=r.convert(L),H="x"===this.getBarDirection(),U=r.convert(F),z=r.convert(0),W={x:H?Math.min(B,V):G,y:H?G:Math.min(B,V),width:H?Math.abs(V-B):y,height:H?y:Math.abs(V-B)},j=new Js(W.x,W.y,W.width,W.height),K={x:H?Math.min(z,U):G,y:H?G:Math.min(z,U),width:H?Math.abs(z-U):y,height:H?y:Math.abs(z-U),clipBBox:j},{fontStyle:$,fontWeight:Y,fontSize:q,fontFamily:X,color:Z,placement:Q}=g,J=this.getLabelText(this.properties.label,{datum:t[D],value:N,xKey:n,yKey:o,xName:a,yName:l,legendItemName:p},e=>ze(e)?e.toFixed(2):String(e)),ee=J?m({text:J,fill:Z,fontStyle:$,fontWeight:Y,fontSize:q,fontFamily:X},Wp({isPositive:_,isVertical:!H,placement:Q,rect:W})):void 0,te=this.shouldFlipXY()?W.height:W.width,ie={series:this,itemId:o,datum:t[D],valueIndex:D,cumulativeValue:k,xValue:R,yValue:N,yKey:o,xKey:n,capDefaults:{lengthRatioMultiplier:te,lengthMax:te},x:K.x,y:K.y,width:K.width,height:K.height,midPoint:{x:W.x+W.width/2,y:W.y+W.height/2},fill:c,stroke:h,opacity:1,strokeWidth:d,cornerRadius:u,topLeftCornerRadius:H!==O,topRightCornerRadius:O,bottomRightCornerRadius:H===O,bottomLeftCornerRadius:!O,clipBBox:j,label:ee,missing:null==N};A.nodeData.push(ie),A.labelData.push(ie)})}),A})}nodeFactory(){return new au}updateDatumSelection(e){return S(this,null,function*(){return e.datumSelection.update(e.nodeData,e=>{e.tag=0},e=>Oh(e.xValue,e.valueIndex))})}updateDatumNodes(e){return S(this,null,function*(){if(!this.properties.isValid())return;const{yKey:t,stackGroup:i,fill:s,fillOpacity:r,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,formatter:h,shadow:d,highlightStyle:{item:u}}=this.properties,p=this.axes.x,g=Op(null==p?void 0:p.visibleRange),m="x"===this.getCategoryDirection();e.datumSelection.each((p,f)=>{var y,v,C,b;const S={fill:s,stroke:n,fillOpacity:r,strokeOpacity:a,lineDash:l,lineDashOffset:c,fillShadow:d,strokeWidth:this.getStrokeWidth(o),cornerRadius:f.cornerRadius,topLeftCornerRadius:f.topLeftCornerRadius,topRightCornerRadius:f.topRightCornerRadius,bottomRightCornerRadius:f.bottomRightCornerRadius,bottomLeftCornerRadius:f.bottomLeftCornerRadius},w=m?(null!=(v=null==(y=f.clipBBox)?void 0:y.width)?v:f.width)>0:(null!=(b=null==(C=f.clipBBox)?void 0:C.height)?b:f.height)>0,x=_p({datum:f,ctx:this.ctx,seriesId:this.id,isHighlighted:e.isHighlight,highlightStyle:u,yKey:t,style:S,formatter:h,stackGroup:i});x.crisp=g,x.visible=w,Np({rect:p,config:x})})})}updateLabelSelection(e){return S(this,null,function*(){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,e=>{e.tag=1,e.pointerEvents=1})})}updateLabelNodes(e){return S(this,null,function*(){e.labelSelection.each((e,t)=>{zp(e,this.properties.label,t.label)})})}getTooltipHtml(e){var t;const{id:i,processedData:s,ctx:{callbackCache:r}}=this,n=this.getCategoryAxis(),o=this.getValueAxis();if(!(s&&this.properties.isValid()&&n&&o))return tl;const{xKey:a,yKey:l,xName:c,yName:h,fill:d,stroke:u,strokeWidth:p,tooltip:g,formatter:f,stackGroup:y,legendItemName:v}=this.properties,{xValue:C,yValue:b,datum:S,itemId:w}=e,x=n.formatDatum(C),E=o.formatDatum(b),M=Nu(h),A=Nu(x+": "+E);let T;f&&(T=r.call(f,{seriesId:i,datum:S,xKey:a,yKey:l,stackGroup:y,fill:d,stroke:u,strokeWidth:this.getStrokeWidth(p),highlighted:!1}));const D=null!=(t=null==T?void 0:T.fill)?t:d;return g.toTooltipHtml({title:M,content:A,backgroundColor:D},m({seriesId:i,itemId:w,datum:S,xKey:a,yKey:l,xName:c,yName:h,stackGroup:y,title:M,color:D,legendItemName:v},this.getModuleTooltipParams()))}getLegendData(e){var t,i;const{showInLegend:s}=this.properties;if("category"!==e||!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||!s)return[];const{yKey:r,yName:n,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,legendItemName:d,visible:u}=this.properties;return[{legendType:"category",id:this.id,itemId:r,seriesId:this.id,enabled:u,label:{text:null!=(i=null!=d?d:n)?i:r},marker:{fill:o,fillOpacity:c,stroke:a,strokeWidth:l,strokeOpacity:h},legendItemName:d}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const s=Vp(Gp(this.isVertical(),this.axes,"normal"));Ir(this.id,"nodes",this.ctx.animationManager,[e],s),_u(this,"labels",this.ctx.animationManager,t),_u(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){var t,i,s;const{datumSelection:r,labelSelection:n,annotationSelections:o,previousContextData:a}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff,c=null==a?"fade":"normal",h=Vp(Gp(this.isVertical(),this.axes,c));Ir(this.id,"nodes",this.ctx.animationManager,[r],h,(e,t)=>Oh(t.xValue,t.valueIndex),l),(null==(s=null==l?void 0:l.changed)||s)&&(_u(this,"labels",this.ctx.animationManager,n),_u(this,"annotations",this.ctx.animationManager,...o))}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e,seriesRect:t}){var i;return Up(null==(i=this.contextNodeData)?void 0:i.nodeData[e].clipBBox,this.contentGroup,t)}};jp.className="BarSeries",jp.type="bar";var Kp={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",instanceConstructor:jp,stackable:!0,groupable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],swapDefaultAxesCondition:e=>"horizontal"===(null==e?void 0:e.direction),themeTemplate:{series:{__extends__:zt,direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:"normal",fontSize:12,fontFamily:jt,color:Yt,placement:"inside"},shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Ru},$p=e=>{const t=ur.fromString(e),[i,s,r]=ur.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:r,a:t.a}},Yp=class{constructor(){this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map($p)}update(){const{domain:e,range:t}=this;e.length<2&&(N.warnOnce("`colorDomain` should have at least 2 values."),0===e.length?e.push(0,1):1===e.length&&e.push(e[0]+1));for(let t=1;t<e.length;t++)if(e[t-1]>=e[t]){N.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((e,t)=>e-t);break}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map($p)}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,r=t[0],n=t.at(-1),o=i[0],a=i[i.length-1];if(e<=r)return o;if(e>=n)return a;let l,c;if(2===t.length){const t=(e-r)/(n-r),s=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(t*(i.length-1)),i.length-2),c=(t-l*s)/s}else{for(l=0;l<t.length-2&&!(e<t[l+1]);l++);const i=t[l];c=(e-i)/(t[l+1]-i)}return((e,t,i)=>{let s,r;if(i=Vs(0,i,1),Number.isNaN(e.h)&&Number.isNaN(t.h))s=0,r=0;else if(Number.isNaN(e.h))s=t.h,r=t.c;else if(Number.isNaN(t.h))s=e.h,r=e.c;else{const n=e.h;let o=t.h;const a=t.h-e.h;a>180?o-=360:a<-180&&(o+=360),s=n*(1-i)+o*i,r=e.c*(1-i)+t.c*i}const n=e.l*(1-i)+t.l*i,o=e.a*(1-i)+t.a*i;return ur.fromOKLCH(n,r,s,o)})(s[l],s[l+1],c).toRgbaString()}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&N.warnOnce("Expected update to not invalidate scale"))}};C([Hr],Yp.prototype,"domain",2),C([Hr],Yp.prototype,"range",2);var qp=class extends Hu{constructor(){super(...arguments),this.maxSize=30}};C([jr(sn),ir({redraw:3})],qp.prototype,"maxSize",2),C([jr(vn,{optional:!0}),ir({redraw:3})],qp.prototype,"domain",2);var Xp=class extends Bo{constructor(){super(...arguments),this.placement="top"}};C([jr(_n)],Xp.prototype,"placement",2);var Zp=class extends zd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new qp,this.label=new Xp,this.tooltip=new zu}};C([jr(Jr)],Zp.prototype,"xKey",2),C([jr(Jr)],Zp.prototype,"yKey",2),C([jr(Jr)],Zp.prototype,"sizeKey",2),C([jr(Jr,{optional:!0})],Zp.prototype,"labelKey",2),C([jr(Jr,{optional:!0})],Zp.prototype,"colorKey",2),C([jr(Jr,{optional:!0})],Zp.prototype,"xName",2),C([jr(Jr,{optional:!0})],Zp.prototype,"yName",2),C([jr(Jr,{optional:!0})],Zp.prototype,"sizeName",2),C([jr(Jr,{optional:!0})],Zp.prototype,"labelName",2),C([jr(Jr,{optional:!0})],Zp.prototype,"colorName",2),C([jr(vn,{optional:!0})],Zp.prototype,"colorDomain",2),C([jr(fn)],Zp.prototype,"colorRange",2),C([jr(Jr,{optional:!0})],Zp.prototype,"title",2),C([jr(qr)],Zp.prototype,"marker",2),C([jr(qr)],Zp.prototype,"label",2),C([jr(qr)],Zp.prototype,"tooltip",2);var Qp=class extends Ud{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},Jp=class extends Wd{constructor(e){super({moduleCtx:e,directionKeys:Vd,directionNames:Hd,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Fu,marker:Yu}}),this.NodeEvent=Qp,this.properties=new Zp,this.sizeScale=new Xd,this.colorScale=new Yp}processData(e){return S(this,null,function*(){var t,i,s,r;if(!this.properties.isValid()||null==this.data||!this.visible)return;const n=null==(t=this.axes.x)?void 0:t.scale,o=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({xScale:n,yScale:o}),c=this.colorScale.type,h=this.sizeScale.type,{xKey:d,yKey:u,sizeKey:p,labelKey:g,colorDomain:m,colorRange:f,colorKey:y,marker:v}=this.properties,{dataModel:C,processedData:b}=yield this.requestDataModel(e,this.data,{props:[Uh(d,a,{id:"xKey-raw"}),Uh(u,l,{id:"yKey-raw"}),...g?[Uh(g,"band",{id:"labelKey-raw"})]:[],zh(d,a,{id:"xValue"}),zh(u,l,{id:"yValue"}),zh(p,h,{id:"sizeValue"}),...y?[zh(y,c,{id:"colorValue"})]:[],...g?[zh(g,"band",{id:"labelValue"})]:[]]}),S=C.resolveProcessedDataIndexById(this,"sizeValue"),w=null!=(s=b.domain.values[S])?s:[];if(this.sizeScale.domain=v.domain?v.domain:w,y){const e=C.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(r=null!=m?m:b.domain.values[e])?r:[],this.colorScale.range=f,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s="x"===e?"xValue":"yValue",r=t.resolveProcessedDataDefById(this,s),n=t.getDomain(this,s,"value",i);if("value"===(null==r?void 0:r.def.type)&&"category"===(null==r?void 0:r.def.valueType))return n;const o=this.axes[e];return Yc(as(n),o)}createNodeData(){return S(this,null,function*(){var e,t,i;const{axes:s,dataModel:r,processedData:n,colorScale:o,sizeScale:a}=this,{xKey:l,yKey:c,sizeKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f,label:y,colorKey:v,marker:C,visible:b}=this.properties,S=Ld(C.shape),{placement:w}=y,x=s.x,E=s.y;if(!(r&&n&&b&&x&&E))return;const M=r.resolveProcessedDataIndexById(this,"xValue"),A=r.resolveProcessedDataIndexById(this,"yValue"),T=h?r.resolveProcessedDataIndexById(this,"sizeValue"):-1,D=v?r.resolveProcessedDataIndexById(this,"colorValue"):-1,I=d?r.resolveProcessedDataIndexById(this,"labelValue"):-1,R=x.scale,P=E.scale,k=(null!=(e=R.bandwidth)?e:0)/2,L=(null!=(t=P.bandwidth)?t:0)/2,N=[];a.range=[C.size,C.maxSize];const _=y.getFont();for(const{values:e,datum:t}of null!=(i=n.data)?i:[]){const i=e[M],s=e[A],r=R.convert(i)+k,n=P.convert(s)+L,b=this.getLabelText(y,{value:d?e[I]:s,datum:t,xKey:l,yKey:c,sizeKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f}),x=Oo.getTextSize(String(b),_),E=h?a.convert(e[T]):C.size,O=v?o.convert(e[D]):void 0;N.push({series:this,itemId:c,yKey:c,xKey:l,datum:t,xValue:i,yValue:s,sizeValue:e[T],point:{x:r,y:n,size:E},midPoint:{x:r,y:n},fill:O,label:m({text:b},x),marker:S,placement:w})}return{itemId:c,nodeData:N,labelData:N,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var e,t;return null!=(t=null==(e=this.contextNodeData)?void 0:e.labelData)?t:[]}markerFactory(){const{shape:e}=this.properties.marker;return new(Ld(e))}updateMarkerSelection(e){return S(this,null,function*(){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?t:[];return i.update(s,void 0,e=>Oh([e.xValue,e.yValue,e.label.text]))})}updateMarkerNodes(e){return S(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,sizeKey:n,labelKey:o,marker:a}=this.properties,l=qe(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize],t.each((e,t)=>{this.updateMarkerStyle(e,a,{datum:t,highlighted:i,xKey:s,yKey:r,sizeKey:n,labelKey:o},l)}),i||this.properties.marker.markClean()})}updateLabelSelection(e){return S(this,null,function*(){var t,i;const s=this.properties.label.enabled&&null!=(i=null==(t=this.chart)?void 0:t.placeLabels().get(this))?i:[];return e.labelSelection.update(s.map(e=>f(m({},e.datum),{point:{x:e.x,y:e.y,size:e.datum.point.size}})))})}updateLabelNodes(e){return S(this,null,function*(){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{var s,r,n,o;e.text=i.label.text,e.fill=t.color,e.x=null!=(r=null==(s=i.point)?void 0:s.x)?r:0,e.y=null!=(o=null==(n=i.point)?void 0:n.y)?o:0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})})}getTooltipHtml(e){var t;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return tl;const{xKey:r,yKey:n,sizeKey:o,labelKey:a,xName:l,yName:c,sizeName:h,labelName:d,marker:u,tooltip:p}=this.properties,g=null!=(t=this.properties.title)?t:c,m=qe({fill:e.fill,strokeWidth:this.getStrokeWidth(u.strokeWidth)},u.getStyle()),{fill:f="gray"}=this.getMarkerStyle(u,{datum:e,highlighted:!1,xKey:r,yKey:n,sizeKey:o,labelKey:a},m),{datum:y,xValue:v,yValue:C,sizeValue:b,label:{text:S},itemId:w}=e,x=Nu(i.formatDatum(v)),E=Nu(s.formatDatum(C));let M=`<b>${Nu(null!=l?l:r)}</b>: ${x}<br><b>${Nu(null!=c?c:n)}</b>: ${E}`;return o&&(M+=`<br><b>${Nu(null!=h?h:o)}</b>: ${Nu(String(b))}`),a&&(M=`<b>${Nu(null!=d?d:a)}</b>: ${Nu(S)}<br>`+M),p.toTooltipHtml({title:g,content:M,backgroundColor:f},{datum:y,itemId:w,xKey:r,xName:l,yKey:n,yName:c,sizeKey:o,sizeName:h,labelKey:a,labelName:d,title:g,color:f,seriesId:this.id})}getLegendData(){var e,t;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid())return[];const{yKey:i,yName:s,title:r,marker:n,visible:o}=this.properties,{shape:a,fill:l,stroke:c,fillOpacity:h,strokeOpacity:d,strokeWidth:u}=n;return[{legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:o,label:{text:null!=(t=null!=r?r:s)?t:i},marker:{shape:a,fill:null!=l?l:"rgba(0, 0, 0, 0)",stroke:null!=c?c:"rgba(0, 0, 0, 0)",fillOpacity:null!=h?h:1,strokeOpacity:null!=d?d:1,strokeWidth:null!=u?u:0}}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){Ku(this,this.ctx.animationManager,e),_u(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:r}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,sizeKey:s,labelKey:r,highlighted:!1})}computeFocusBounds(e){return Zu(this,e)}};Jp.className="BubbleSeries",Jp.type="bubble";var eg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",instanceConstructor:Jp,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:zt,tooltip:{position:{type:"node"}},marker:{__extends__:Wt,maxSize:30,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:jt,color:Kt}}},paletteFactory:Pu},tg=class extends zd{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Bu,this.label=new Bo,this.tooltip=new zu}};C([jr(Jr)],tg.prototype,"xKey",2),C([jr(Jr,{optional:!0})],tg.prototype,"yKey",2),C([jr(Jr,{optional:!0})],tg.prototype,"xName",2),C([jr(Jr,{optional:!0})],tg.prototype,"yName",2),C([jr(mn,{optional:!0})],tg.prototype,"fill",2),C([jr(rn)],tg.prototype,"fillOpacity",2),C([jr(mn,{optional:!0})],tg.prototype,"stroke",2),C([jr(sn)],tg.prototype,"strokeWidth",2),C([jr(rn)],tg.prototype,"strokeOpacity",2),C([jr(En)],tg.prototype,"lineDash",2),C([jr(sn)],tg.prototype,"lineDashOffset",2),C([jr(sn)],tg.prototype,"cornerRadius",2),C([jr(Zr)],tg.prototype,"areaPlot",2),C([jr(an,{optional:!0})],tg.prototype,"bins",2),C([jr(On(["count","sum","mean"],"a histogram aggregation"))],tg.prototype,"aggregation",2),C([jr(sn,{optional:!0})],tg.prototype,"binCount",2),C([jr(qr)],tg.prototype,"shadow",2),C([jr(qr)],tg.prototype,"label",2),C([jr(qr)],tg.prototype,"tooltip",2);var ig=class extends Wd{constructor(e){super({moduleCtx:e,directionKeys:Vd,directionNames:Hd,pickModes:[0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Hp,label:Fu}}),this.properties=new tg,this.calculatedBins=[]}deriveBins(e){const t=co(e[0],e[1],10),i=uo(e[0],e[1],10),[s]=t;return[[s-i,s],...t.map(e=>[e,e+i])]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],r=t||1,{start:n,binSize:o}=this.calculateNiceStart(i,s,r);return this.getBins(n,s,o,r)}getBins(e,t,i,s){const r=[],n=this.calculatePrecision(i);for(let o=0;o<s;o++){const a=Math.round((e+o*i)*n)/n;let l=Math.round((e+(o+1)*i)*n)/n;o===s-1&&(l=Math.max(l,t)),r[o]=[a,l]}return r}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,r=Math.floor(Math.log10(s)),n=Math.pow(10,r);return{start:Math.floor(e/n)*n,binSize:s}}processData(e){return S(this,null,function*(){var t,i;this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:s,yKey:r,areaPlot:n,aggregation:o}=this.properties,a=null==(t=this.axes.x)?void 0:t.scale,l=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({yScale:l,xScale:a}),d=[Uh(s,c),Ah];if(r){let e=bh("groupAgg");"count"===o||("sum"===o?e=vh("groupAgg"):"mean"===o&&(e=Sh("groupAgg"))),n&&(e=wh("groupAgg",e)),d.push(zh(r,h,{invalidValue:void 0}),e)}else{let e=bh("groupAgg");n&&(e=wh("groupAgg",e)),d.push(e)}!this.ctx.animationManager.isSkipped()&&this.processedData&&d.push(_h(this.processedData,!1)),yield this.requestDataModel(e,this.data,{props:d,groupByFn:e=>{var t;const i=Yc(e.domain.keys[0]);if(0===i.length)return e.domain.groups=[],()=>[];const s=Ue(this.properties.binCount)?this.calculateNiceBins(i,this.properties.binCount):null!=(t=this.properties.bins)?t:this.deriveBins(i),r=s.length;return this.calculatedBins=[...s],e=>{const t=e.keys[0];for(let e=0;e<r;e++){const i=s[e];if(t>=i[0]&&t<i[1])return i;if(e===r-1&&t<=i[1])return i}return[]}}}),this.animationState.transition("updateData")})}getSeriesDomain(e){var t,i,s,r;const{processedData:n,dataModel:o}=this;if(!n||!o||!this.calculatedBins.length)return[];const a=o.getDomain(this,"groupAgg","aggregate",n),l=null==(t=this.calculatedBins)?void 0:t[0][0],c=null==(r=this.calculatedBins)?void 0:r[(null!=(s=null==(i=this.calculatedBins)?void 0:i.length)?s:0)-1][1];return Yc("x"===e?[l,c]:a)}createNodeData(){return S(this,null,function*(){var e;const{id:t,axes:i,processedData:s,ctx:{callbackCache:r}}=this,n=i.x,o=i.y;if(!n||!o)return;const{scale:a}=n,{scale:l}=o,{xKey:c,yKey:h,xName:d,yName:u,fill:p,stroke:g,strokeWidth:m,cornerRadius:f}=this.properties,{formatter:y=e=>String(e.value),fontStyle:v,fontWeight:C,fontSize:b,fontFamily:S,color:w}=this.properties.label,x=[],E={itemId:null!=(e=this.properties.yKey)?e:this.id,nodeData:x,labelData:x,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&s&&"grouped"===s.type?(s.data.forEach(e=>{var i;const{aggValues:[[s,n]]=[[0,0]],datum:E,datum:{length:M},keys:A,keys:[T,D]}=e,I=a.convert(T),R=a.convert(D),P=s+n,k=l.convert(0),L=l.convert(P),N=Math.abs(R-I),_=Math.abs(L-k),O=Math.min(I,R),F=Math.min(k,L);let G;0!==P&&(G={text:null!=(i=r.call(y,{value:P,datum:E,seriesId:t,xKey:c,yKey:h,xName:d,yName:u}))?i:String(P),fontStyle:v,fontWeight:C,fontSize:b,fontFamily:S,fill:w,x:O+N/2,y:F+_/2});const B={x:O+N/2,y:F+_/2},V=o.isReversed();x.push({series:this,datum:E,aggregatedValue:P,frequency:M,domain:A,yKey:h,xKey:c,x:O,y:F,xValue:I,yValue:L,width:N,height:_,midPoint:B,fill:p,stroke:g,cornerRadius:f,topLeftCornerRadius:!V,topRightCornerRadius:!V,bottomRightCornerRadius:V,bottomLeftCornerRadius:V,opacity:1,strokeWidth:m,label:G})}),x.sort((e,t)=>e.x-t.x),E):E})}nodeFactory(){return new au}updateDatumSelection(e){return S(this,null,function*(){const{nodeData:t,datumSelection:i}=e;return i.update(t,e=>{e.tag=0,e.crisp=!0},e=>e.domain.join("_"))})}updateDatumNodes(e){return S(this,null,function*(){const{isHighlight:t}=e,{fillOpacity:i,strokeOpacity:s,lineDash:r,lineDashOffset:n,shadow:o,highlightStyle:{item:{fill:a,fillOpacity:l=i,stroke:c,strokeWidth:h}}}=this.properties;e.datumSelection.each((e,d,u)=>{var p,g;const{cornerRadius:m,topLeftCornerRadius:f,topRightCornerRadius:y,bottomRightCornerRadius:v,bottomLeftCornerRadius:C}=d,b=t&&void 0!==h?h:d.strokeWidth,S=t?l:i;e.fill=null!=(p=t?a:void 0)?p:d.fill,e.stroke=null!=(g=t?c:void 0)?g:d.stroke,e.fillOpacity=S,e.strokeOpacity=s,e.strokeWidth=b,e.lineDash=r,e.lineDashOffset=n,e.topLeftCornerRadius=f?m:0,e.topRightCornerRadius=y?m:0,e.bottomRightCornerRadius=v?m:0,e.bottomLeftCornerRadius=C?m:0,e.fillShadow=o,e.zIndex=t?Xh.highlightedZIndex:u,e.visible=d.height>0})})}updateLabelSelection(e){return S(this,null,function*(){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.tag=1,e.pointerEvents=1,e.textAlign="center",e.textBaseline="middle"})})}updateLabelNodes(e){return S(this,null,function*(){const t=this.isLabelEnabled();e.labelSelection.each((e,i)=>{const s=i.label;s&&t?(e.text=s.text,e.x=s.x,e.y=s.y,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.fontSize=s.fontSize,e.fontFamily=s.fontFamily,e.fill=s.fill,e.visible=!0):e.visible=!1})})}initQuadTree(e){Dp(e,Tp(this.contentGroup.children[0]))}pickNodeClosestDatum(e){return Ip(this,e)}getTooltipHtml(e){const t=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!t||!i)return tl;const{xKey:s,yKey:r,xName:n,yName:o,fill:a,aggregation:l,tooltip:c}=this.properties,{aggregatedValue:h,frequency:d,domain:[u,p],itemId:g}=e,m=`${Nu(null!=n?n:s)}: ${t.formatDatum(u)} - ${t.formatDatum(p)}`;let f=r?`<b>${Nu(null!=o?o:r)} (${l})</b>: ${i.formatDatum(h)}<br>`:"";f+=`<b>Frequency</b>: ${d}`;const y={title:m,backgroundColor:a,content:f};return c.toTooltipHtml(y,{datum:{data:e.datum,aggregatedValue:e.aggregatedValue,domain:e.domain,frequency:e.frequency},itemId:g,xKey:s,xName:n,yKey:r,yName:o,color:a,title:m,seriesId:this.id})}getLegendData(e){var t,i;if(!(null==(t=this.data)?void 0:t.length)||"category"!==e)return[];const{xKey:s,yName:r,fill:n,fillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,visible:h}=this.properties;return[{legendType:"category",id:this.id,itemId:s,seriesId:this.id,enabled:h,label:{text:null!=(i=null!=r?r:s)?i:"Frequency"},marker:{fill:null!=n?n:"rgba(0, 0, 0, 0)",stroke:null!=a?a:"rgba(0, 0, 0, 0)",fillOpacity:o,strokeOpacity:c,strokeWidth:l}}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Vp(Gp(!0,this.axes,"normal"));Ir(this.id,"datums",this.ctx.animationManager,[e],i),_u(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){var t,i;const s=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff,r=Vp(Gp(!0,this.axes,"normal"));Ir(this.id,"datums",this.ctx.animationManager,[e.datumSelection],r,(e,t)=>Oh(t.domain),s),_u(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e,seriesRect:t}){var i;return Up(null==(i=this.contextNodeData)?void 0:i.nodeData[e],this.contentGroup,t)}};ig.className="HistogramSeries",ig.type="histogram";var sg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",instanceConstructor:ig,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:zt,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:12,fontFamily:jt,color:Yt},shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}}},rg=class extends zd{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new Hu,this.label=new Bo,this.tooltip=new zu,this.connectMissingData=!1}};C([jr(Jr)],rg.prototype,"xKey",2),C([jr(Jr)],rg.prototype,"yKey",2),C([jr(Jr,{optional:!0})],rg.prototype,"xName",2),C([jr(Jr,{optional:!0})],rg.prototype,"yName",2),C([jr(Jr,{optional:!0})],rg.prototype,"title",2),C([jr(mn)],rg.prototype,"stroke",2),C([jr(sn)],rg.prototype,"strokeWidth",2),C([jr(rn)],rg.prototype,"strokeOpacity",2),C([jr(En)],rg.prototype,"lineDash",2),C([jr(sn)],rg.prototype,"lineDashOffset",2),C([jr(qr)],rg.prototype,"marker",2),C([jr(qr)],rg.prototype,"label",2),C([jr(qr)],rg.prototype,"tooltip",2),C([jr(Zr)],rg.prototype,"connectMissingData",2);var ng=class extends Wd{constructor(e){super({moduleCtx:e,directionKeys:Vd,directionNames:Hd,hasMarkers:!0,pickModes:[2,3,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:ap({getOpacity:()=>this.getOpacity()}),label:Fu,marker:(e,t)=>m(m({},{opacity:1,scalingX:1,scalingY:1}),qu(0,t))}}),this.properties=new rg}processData(e){return S(this,null,function*(){var t,i;if(!this.properties.isValid()||null==this.data)return;const{xKey:s,yKey:r}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=null==(t=this.axes.x)?void 0:t.scale,a=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:a}),d=[];l||d.push(Uh(s,c,{id:"xKey"})),n&&(d.push(Ph(l?["xValue"]:void 0)),this.processedData&&d.push(_h(this.processedData))),d.push(zh(s,c,{id:"xValue"}),zh(r,h,{id:"yValue",invalidValue:void 0})),yield this.requestDataModel(e,this.data,{props:d}),this.animationState.transition("updateData")})}getSeriesDomain(e){const{axes:t,dataModel:i,processedData:s}=this;if(!s||!i)return[];const r=t.x,n=t.y,o=i.resolveProcessedDataDefById(this,"xValue");if("x"===e){const e=i.getDomain(this,"xValue","value",s);return"value"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?e:Yc(as(e),r)}return Yc(i.getDomain(this,"yValue","value",s),n)}createNodeData(){return S(this,null,function*(){var e,t,i;const{processedData:s,dataModel:r,axes:n}=this,o=n.x,a=n.y;if(!(s&&r&&o&&a))return;const{xKey:l,yKey:c,xName:h,yName:d,marker:u,label:p,connectMissingData:g,legendItemName:m}=this.properties,f=o.scale,y=a.scale,v=(null!=(e=f.bandwidth)?e:0)/2,C=(null!=(t=y.bandwidth)?t:0)/2,b=[],S=u.enabled?u.size:0,w=r.resolveProcessedDataIndexById(this,"xValue"),x=r.resolveProcessedDataIndexById(this,"yValue");let E,M=!0;for(let e=0;e<s.data.length;e++){const{datum:t,values:r}=null!=E?E:s.data[e],n=r[w],o=r[x];if(void 0===o)M=!g;else{const r=f.convert(n)+v;if(isNaN(r)){M=!g,E=void 0;continue}E=void 0===(null==(i=s.data[e+1])?void 0:i.values[x])?void 0:s.data[e+1];const a=y.convert(o)+C,u=this.getLabelText(p,{value:o,datum:t,xKey:l,yKey:c,xName:h,yName:d,legendItemName:m},e=>ze(e)?e.toFixed(2):String(e));b.push({series:this,datum:t,yKey:c,xKey:l,point:{x:r,y:a,moveTo:M,size:S},midPoint:{x:r,y:a},yValue:o,xValue:n,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},label:u?{text:u,fontStyle:p.fontStyle,fontWeight:p.fontWeight,fontSize:p.fontSize,fontFamily:p.fontFamily,textAlign:"center",textBaseline:"bottom",fill:p.color}:void 0}),M=!1}}return{itemId:c,nodeData:b,labelData:b,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:e}=this.properties.marker;return new(Ld(e))}updatePathNodes(e){return S(this,null,function*(){const{paths:[t],opacity:i,visible:s,animationEnabled:r}=e;t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),r||(t.visible=s),lp(this,t)})}updateMarkerSelection(e){return S(this,null,function*(){let{nodeData:t}=e;const{markerSelection:i}=e,{shape:s,enabled:r}=this.properties.marker;return t=s&&r?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,e=>Oh(e.xValue))})}updateMarkerNodes(e){return S(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,stroke:n,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=qe(i&&c.item,l.getStyle(),{stroke:n,strokeWidth:o,strokeOpacity:a}),d=this.ctx.animationManager.isSkipped();t.each((e,t)=>{this.updateMarkerStyle(e,l,{datum:t,highlighted:i,xKey:s,yKey:r},h,{applyTranslation:d})}),i||l.markClean()})}updateLabelSelection(e){return S(this,null,function*(){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])})}updateLabelNodes(e){return S(this,null,function*(){const{enabled:t,fontStyle:i,fontWeight:s,fontSize:r,fontFamily:n,color:o}=this.properties.label;e.labelSelection.each((e,a)=>{const{point:l,label:c}=a;a&&c&&t?(e.fontStyle=i,e.fontWeight=s,e.fontSize=r,e.fontFamily=n,e.textAlign=c.textAlign,e.textBaseline=c.textBaseline,e.text=c.text,e.x=l.x,e.y=l.y-10,e.fill=o,e.visible=!0):e.visible=!1})})}getTooltipHtml(e){var t;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return tl;const{xKey:r,yKey:n,xName:o,yName:a,strokeWidth:l,marker:c,tooltip:h}=this.properties,{datum:d,xValue:u,yValue:p,itemId:g}=e,f=i.formatDatum(u),y=s.formatDatum(p),v=Nu(null!=(t=this.properties.title)?t:a),C=Nu(f+": "+y),b=qe({fill:c.stroke},c.getStyle(),{strokeWidth:l}),{fill:S}=this.getMarkerStyle(c,{datum:e,xKey:r,yKey:n,highlighted:!1},b);return h.toTooltipHtml({title:v,content:C,backgroundColor:S},m({datum:d,itemId:g,xKey:r,xName:o,yKey:n,yName:a,title:v,color:S,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(e){var t,i,s,r,n,o,a,l,c,h;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||"category"!==e)return[];const{yKey:d,yName:u,stroke:p,strokeOpacity:g,strokeWidth:m,lineDash:f,title:y,marker:v,visible:C,legendItemName:b}=this.properties,S="rgba(0, 0, 0, 0)";return[{legendType:"category",id:this.id,itemId:d,legendItemName:b,seriesId:this.id,enabled:C,label:{text:null!=(s=null!=(i=null!=b?b:y)?i:u)?s:d},marker:{shape:v.shape,fill:null!=(r=v.fill)?r:S,stroke:null!=(o=null!=(n=v.stroke)?n:p)?o:S,fillOpacity:null!=(a=v.fillOpacity)?a:1,strokeOpacity:null!=(c=null!=(l=v.strokeOpacity)?l:g)?c:1,strokeWidth:null!=(h=v.strokeWidth)?h:0,enabled:v.enabled},line:{stroke:null!=p?p:S,strokeOpacity:g,strokeWidth:m,lineDash:f}}]}updatePaths(e){return S(this,null,function*(){this.updateLinePaths(e.paths,e.contextData)})}updateLinePaths(e,t){const{nodeData:i}=t,[s]=e,{path:r}=s;r.clear(!0);for(const e of i)e.point.moveTo?r.moveTo(e.point.x,e.point.y):r.lineTo(e.point.x,e.point.y);s.checkPathDirty()}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s,contextData:r,paths:n}=e,{animationManager:o}=this.ctx;this.updateLinePaths(n,r),rp(this,o,...n),ma([t],qu),$u(this,o,t),_u(this,"labels",o,i),_u(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){var t,i;const{animationManager:s}=this.ctx,{markerSelection:r,labelSelection:n,annotationSelections:o,contextData:a,paths:l,previousContextData:c}=e,[h]=l;super.resetAllAnimation(e);const d=()=>{this.updateLinePaths(l,a)};if(null==a||null==c)return d(),ju(this,s,"added",r),np(this,"path_properties",s,"add",h),_u(this,"labels",s,n),void _u(this,"annotations",s,...o);const u=bp(a,c,null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(ju(this,s,void 0,r),Ir(this.id,"path_properties",s,[h],u.pathProperties),ku(this.id,"path_update",s,[h],u.path),u.hasMotion&&(_u(this,"labels",s,n),_u(this,"annotations",s,...o)))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,highlighted:!0})}computeFocusBounds(e){return Zu(this,e)}};ng.className="LineSeries",ng.type="line";var og={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",instanceConstructor:ng,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:zt,tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,marker:{__extends__:Wt,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:jt,color:Kt}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:e=>{const{marker:t}=Pu(e);return{stroke:t.fill,marker:t}}},ag=class extends Bo{constructor(){super(...arguments),this.placement="top"}};C([jr(_n)],ag.prototype,"placement",2);var lg=class extends zd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new Hu,this.label=new ag,this.tooltip=new zu}};C([jr(Jr)],lg.prototype,"xKey",2),C([jr(Jr)],lg.prototype,"yKey",2),C([jr(Jr,{optional:!0})],lg.prototype,"labelKey",2),C([jr(Jr,{optional:!0})],lg.prototype,"colorKey",2),C([jr(Jr,{optional:!0})],lg.prototype,"xName",2),C([jr(Jr,{optional:!0})],lg.prototype,"yName",2),C([jr(Jr,{optional:!0})],lg.prototype,"labelName",2),C([jr(Jr,{optional:!0})],lg.prototype,"colorName",2),C([jr(vn,{optional:!0})],lg.prototype,"colorDomain",2),C([jr(fn)],lg.prototype,"colorRange",2),C([jr(Jr,{optional:!0})],lg.prototype,"title",2),C([jr(qr)],lg.prototype,"marker",2),C([jr(qr)],lg.prototype,"label",2),C([jr(qr)],lg.prototype,"tooltip",2);var cg=class extends Wd{constructor(e){super({moduleCtx:e,directionKeys:Vd,directionNames:Hd,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Yu,label:Fu}}),this.properties=new lg,this.colorScale=new Yp}processData(e){return S(this,null,function*(){var t,i,s;if(!this.properties.isValid()||null==this.data||!this.visible)return;const r=null==(t=this.axes.x)?void 0:t.scale,n=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:o,yScaleType:a}=this.getScaleInformation({xScale:r,yScale:n}),l=this.colorScale.type,{xKey:c,yKey:h,labelKey:d,colorKey:u,colorDomain:p,colorRange:g}=this.properties,{dataModel:m,processedData:f}=yield this.requestDataModel(e,this.data,{props:[Uh(c,o,{id:"xKey-raw"}),Uh(h,a,{id:"yKey-raw"}),...d?[Uh(d,"band",{id:"labelKey-raw"})]:[],zh(c,o,{id:"xValue"}),zh(h,a,{id:"yValue"}),...u?[zh(u,l,{id:"colorValue"})]:[],...d?[zh(d,"band",{id:"labelValue"})]:[]]});if(u){const e=m.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(s=null!=p?p:f.domain.values[e])?s:[],this.colorScale.range=g,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s="x"===e?"xValue":"yValue",r=t.resolveProcessedDataDefById(this,s),n=t.getDomain(this,s,"value",i);if("value"===(null==r?void 0:r.def.type)&&"category"===(null==r?void 0:r.def.valueType))return n;const o=this.axes[e];return Yc(as(n),o)}createNodeData(){return S(this,null,function*(){var e,t,i;const{axes:s,dataModel:r,processedData:n,colorScale:o}=this,{xKey:a,yKey:l,labelKey:c,colorKey:h,xName:d,yName:u,labelName:p,marker:g,label:f,visible:y}=this.properties,{placement:v}=f,C=Ld(g.shape),b=s.x,S=s.y;if(!(r&&n&&y&&b&&S))return;const w=r.resolveProcessedDataIndexById(this,"xValue"),x=r.resolveProcessedDataIndexById(this,"yValue"),E=h?r.resolveProcessedDataIndexById(this,"colorValue"):-1,M=c?r.resolveProcessedDataIndexById(this,"labelValue"):-1,A=b.scale,T=S.scale,D=(null!=(e=A.bandwidth)?e:0)/2,I=(null!=(t=T.bandwidth)?t:0)/2,R=[],P=f.getFont();for(const{values:e,datum:t}of null!=(i=n.data)?i:[]){const i=e[w],s=e[x],r=A.convert(i)+D,n=T.convert(s)+I,y=this.getLabelText(f,{value:c?e[M]:s,datum:t,xKey:a,yKey:l,labelKey:c,xName:d,yName:u,labelName:p}),b=Oo.getTextSize(y,P),S=h?o.convert(e[E]):void 0;R.push({series:this,itemId:l,yKey:l,xKey:a,datum:t,xValue:i,yValue:s,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:r,y:n,size:g.size},midPoint:{x:r,y:n},fill:S,label:m({text:y},b),marker:C,placement:v})}return{itemId:l,nodeData:R,labelData:R,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var e,t;return null!=(t=null==(e=this.contextNodeData)?void 0:e.labelData)?t:[]}markerFactory(){const{shape:e}=this.properties.marker;return new(Ld(e))}updateMarkerSelection(e){return S(this,null,function*(){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])})}updateMarkerNodes(e){return S(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,labelKey:n,marker:o,highlightStyle:a}=this.properties,l=qe(i&&a.item,o.getStyle());t.each((e,t)=>{this.updateMarkerStyle(e,o,{datum:t,highlighted:i,xKey:s,yKey:r,labelKey:n},l)}),i||o.markClean()})}updateLabelSelection(e){return S(this,null,function*(){var t,i;const s=this.isLabelEnabled()&&null!=(i=null==(t=this.chart)?void 0:t.placeLabels().get(this))?i:[];return e.labelSelection.update(s.map(({datum:e,x:t,y:i})=>f(m({},e),{point:{x:t,y:i,size:e.point.size},placement:"top"})),e=>{e.pointerEvents=1})})}updateLabelNodes(e){return S(this,null,function*(){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{var s,r,n,o;e.text=i.label.text,e.fill=t.color,e.x=null!=(r=null==(s=i.point)?void 0:s.x)?r:0,e.y=null!=(o=null==(n=i.point)?void 0:n.y)?o:0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})})}getTooltipHtml(e){const t=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!t||!i)return tl;const{xKey:s,yKey:r,labelKey:n,xName:o,yName:a,labelName:l,title:c=a,marker:h,tooltip:d}=this.properties,{datum:u,xValue:p,yValue:g,label:f,itemId:y}=e,v=qe({fill:e.fill,strokeWidth:this.getStrokeWidth(h.strokeWidth)},h.getStyle()),{fill:C="gray"}=this.getMarkerStyle(h,{datum:e,highlighted:!1,xKey:s,yKey:r,labelKey:n},v),b=Nu(t.formatDatum(p)),S=Nu(i.formatDatum(g));let w=`<b>${Nu(null!=o?o:s)}</b>: ${b}<br><b>${Nu(null!=a?a:r)}</b>: ${S}`;return n&&(w=`<b>${Nu(null!=l?l:n)}</b>: ${Nu(f.text)}<br>`+w),d.toTooltipHtml({title:c,content:w,backgroundColor:C},m({datum:u,itemId:y,xKey:s,xName:o,yKey:r,yName:a,labelKey:n,labelName:l,title:c,color:C,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(e){var t,i,s,r,n,o;const{yKey:a,yName:l,title:c,marker:h,visible:d}=this.properties,{fill:u,stroke:p,fillOpacity:g,strokeOpacity:m,strokeWidth:f}=h;return(null==(t=this.data)?void 0:t.length)&&this.properties.isValid()&&"category"===e?[{legendType:"category",id:this.id,itemId:a,seriesId:this.id,enabled:d,label:{text:null!=(i=null!=c?c:l)?i:a},marker:{shape:h.shape,fill:null!=(r=null!=(s=h.fill)?s:u)?r:"rgba(0, 0, 0, 0)",stroke:null!=(o=null!=(n=h.stroke)?n:p)?o:"rgba(0, 0, 0, 0)",fillOpacity:null!=g?g:1,strokeOpacity:null!=m?m:1,strokeWidth:null!=f?f:0}}]:[]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s}=e;Ku(this,this.ctx.animationManager,t),_u(this,"labels",this.ctx.animationManager,i),_u(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,labelKey:s,highlighted:!0})}computeFocusBounds(e){return Zu(this,e)}};cg.className="ScatterSeries",cg.type="scatter";var hg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",instanceConstructor:cg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:zt,tooltip:{position:{type:"node"}},marker:{__extends__:Wt,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:jt,color:Kt}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:Pu},dg=class e{constructor(e,t,i,s){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:r}=this;return new e(t,i,s,r)}[Gs](t,i){return new e(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function ug(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:r,outerRadius:n}=i;if(i.startAngle===i.endAngle||s<Math.min(r,n)||s>Math.max(r,n))return!1;const o=_r(i.startAngle),a=_r(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function pg(e,t){const{startAngle:i,endAngle:s,innerRadius:r,outerRadius:n}=t,o={x:n*Math.cos(i),y:n*Math.sin(i)},a={x:n*Math.cos(s),y:n*Math.sin(s)},l=0===r?{x:0,y:0}:{x:r*Math.cos(i),y:r*Math.sin(i)},c=0===r?{x:0,y:0}:{x:r*Math.cos(s),y:r*Math.sin(s)};return nd(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||nd(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||ld(0,0,n,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function gg(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},r={x:e.x,y:e.y+e.height},n={x:e.x+e.width,y:e.y+e.height};return pg({start:i,end:s},t)||pg({start:r,end:n},t)}function mg(e,t,i,s){if(0===i&&0===s)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let r=0,n=1;for(let o=0;o<8;o+=1){const o=(r+n)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*s)/(e+o*s))-t<0?r=o:n=o}return r}function fg(e,t){return Br(e,t)<1e-6?t:Lr(e-t)+t}function yg(e,t,i=0){const s=Math.abs(t-e)>=2*Math.PI?2*Math.PI:Lr(t-e);return{startAngle:e=fg(e,i),endAngle:t=e+s}}function vg(e,t,i,s,r,n){const o=Math.sin(n),a=Math.cos(n),l=p(e,2)+p(t,2)-p(i,2);let c=NaN,h=NaN,d=NaN,u=NaN;if(a>.5){const i=o/a,s=1+p(i,2),r=-2*(e+t*i),n=p(r,2)-4*s*l;if(n<0)return;const g=(-r+Math.sqrt(n))/(2*s),m=(-r-Math.sqrt(n))/(2*s);c=g,h=g*i,d=m,u=m*i}else{const i=a/o,s=1+p(i,2),r=-2*(t+e*i),n=p(r,2)-4*s*l;if(n<0)return;const g=(-r+Math.sqrt(n))/(2*s),m=(-r-Math.sqrt(n))/(2*s);c=g*i,h=g,d=m*i,u=m}const g=d*a+u*o,m=c*a+h*o>0?fg(Math.atan2(h-t,c-e),s):NaN,f=g>0?fg(Math.atan2(u-t,d-e),s):NaN;return m>=s&&m<=r?m:f>=s&&f<=r?f:void 0}function Cg(e,t,i,s,r,n){const o=Math.hypot(e,t),a=o-(p(o,2)-p(i,2)+p(n,2))/(2*o),l=Math.atan2(t,e),c=Math.acos(-a/i),h=fg(l+c,s),d=fg(l-c,s);return h>=s&&h<=r?h:d>=s&&d<=r?d:void 0}var bg=class{constructor(e,t,i,s,r){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=r,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){null==e||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){null==e||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Sg=class extends dd{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){const e=this.outerRadius;return new Js(this.centerX-e,this.centerY-e,2*e,2*e)}normalizedRadii(){const{concentricEdgeInset:e}=this;return{innerRadius:Math.max(Math.min(this.innerRadius,this.outerRadius)+e,0),outerRadius:Math.max(Math.max(this.innerRadius,this.outerRadius)-e,0)}}normalizedClipSector(){const{clipSector:e}=this;if(null==e)return;const{startAngle:t,endAngle:i}=yg(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:r}=this.normalizedRadii(),n=yg(e.startAngle,e.endAngle,t);return new dg(Math.max(t,n.startAngle),Math.min(i,n.endAngle),Math.max(s,e.innerRadius),Math.min(r,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,r,n,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=yg(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(a&&h<=0)return;const p=this.getAngleOffset(h),g=this.getAngleOffset(d),m=a?this.getAngleOffset(h+e):this.getAngleOffset(d-e),f=o?l+m+t:c-m-t,y=a?h+e:d-e,v=y*Math.cos(f),C=y*Math.sin(f);if(null!=u){const e=1e-6;if(!(o||f>=l-e&&f<=u.endAngle-e))return;if(o&&!(f>=u.startAngle+e&&f<=c-e))return;if(a&&!(y>=u.innerRadius-e))return;if(!(a||y<=u.outerRadius+e))return}const b=new bg(v,C,e,i,s);if(null!=u){let t,c;if(a?(b.clipStart(vg(v,C,e,i,s,u.endAngle-p)),b.clipEnd(vg(v,C,e,i,s,u.startAngle+p))):(b.clipStart(vg(v,C,e,i,s,u.startAngle+g)),b.clipEnd(vg(v,C,e,i,s,u.endAngle-g))),o?(t=Cg(v,C,e,i,s,u.innerRadius),c=Cg(v,C,e,i,s,u.outerRadius)):(t=Cg(v,C,e,i,s,u.outerRadius),c=Cg(v,C,e,i,s,u.innerRadius)),b.clipStart(t),b.clipEnd(c),null!=t){const{x:e,y:i}=b.pointAt(t),s=fg(Math.atan2(i,e),l);o?null==n||n.clipStart(s):r.clipEnd(s)}if(null!=c){const{x:e,y:t}=b.pointAt(c),i=fg(Math.atan2(t,e),l);o?r.clipStart(i):null==n||n.clipEnd(i)}}if(null!=u){const{x:e,y:t}=b.pointAt((b.a0+b.a1)/2);if(!ug(e,t,u))return}const{x:S,y:w}=b.pointAt(o===a?b.a0:b.a1),x=fg(Math.atan2(w,S),l),E=a?n:r;return o?null==E||E.clipStart(x):null==E||E.clipEnd(x),b}updatePath(){var e,t,i,s,r;const{path:n,centerX:o,centerY:a,concentricEdgeInset:l,radialEdgeInset:c}=this;let{startOuterCornerRadius:h,endOuterCornerRadius:d,startInnerCornerRadius:u,endInnerCornerRadius:p}=this;const{startAngle:g,endAngle:m}=yg(this.startAngle,this.endAngle),{innerRadius:f,outerRadius:y}=this.normalizedRadii(),v=this.normalizedClipSector(),C=m-g,b=C>=2*Math.PI-1e-6;if(n.clear(),(null!=(e=null==v?void 0:v.startAngle)?e:g)===(null!=(t=null==v?void 0:v.endAngle)?t:m))return;if(b&&null==this.clipSector&&0===h&&0===d&&0===u&&0===p)return n.moveTo(o+y*Math.cos(g),a+y*Math.sin(g)),n.arc(o,a,y,g,m),f>l&&(n.moveTo(o+f*Math.cos(m),a+f*Math.sin(m)),n.arc(o,a,f,m,g,!0)),void n.closePath();const S=this.getAngleOffset(f),w=this.getAngleOffset(y);if(C<2*w)return;const x=(null!=(i=null==v?void 0:v.innerRadius)?i:f)>l,E=f<l||C<2*S,M=y-f,A=Math.max(h,u,d,p),T=A>0?Math.min(M/A,1):1;h*=T,d*=T,u*=T,p*=T;const D=mg(y,C-2*w,-h,-d);if(h*=D,d*=D,!E&&x){const e=mg(f,C-2*S,u,p);u*=e,p*=e}else u=0,p=0;const I=Math.max(h+u,d+p),R=I>0?Math.min(M/I,1):1;h*=R,d*=R,u*=R,p*=R;let P=0,k=0;const L=h/(y-h),N=d/(y-d);if(L>=0&&L<.999999)P=Math.asin(L);else{P=C/2;const e=y/(1/Math.sin(P)+1);h=Math.min(e,h)}if(N>=0&&N<.999999)k=Math.asin(N);else{k=C/2;const e=y/(1/Math.sin(k)+1);d=Math.min(e,d)}const _=Math.asin(u/(f+u)),O=Math.asin(p/(f+p)),F=null!=(s=null==v?void 0:v.outerRadius)?s:y,G=this.getAngleOffset(F),B=new bg(0,0,F,g+G,m-G),V=null!=(r=null==v?void 0:v.innerRadius)?r:f,H=this.getAngleOffset(V),U=x?new bg(0,0,V,g+H,m-H):void 0;null!=v&&(B.clipStart(v.startAngle),B.clipEnd(v.endAngle),null==U||U.clipStart(v.startAngle),null==U||U.clipEnd(v.endAngle));const z=this.arc(h,P,g-.5*Math.PI,g+P,B,U,!0,!1),W=this.arc(d,k,m-k,m+.5*Math.PI,B,U,!1,!1),j=this.arc(p,O,m+.5*Math.PI,m+Math.PI-O,B,U,!1,!0),K=this.arc(u,_,g+Math.PI+_,g+1.5*Math.PI,B,U,!0,!0);if(E){const e=C<.5*Math.PI?c*(1+Math.cos(C))/Math.sin(C):NaN;let t;t=e>0&&e<y?Math.max(Math.hypot(c,e),f):f;const i=g+.5*C;n.moveTo(o+t*Math.cos(i),a+t*Math.sin(i))}else if(!0===(null==K?void 0:K.isValid())){const{x:e,y:t}=K.pointAt(K.a1);n.moveTo(o+e,a+t)}else if(!0===(null==U?void 0:U.isValid())){const{x:e,y:t}=U.pointAt(U.a0);n.moveTo(o+e,a+t)}else{const e=g+C/2,t=f*Math.cos(e),i=f*Math.sin(e);n.moveTo(o+t,a+i)}if(!0===(null==z?void 0:z.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=z;n.arc(o+e,a+t,i,s,r)}if(B.isValid()){const{r:e,a0:t,a1:i}=B;n.arc(o,a,e,t,i)}if(!0===(null==W?void 0:W.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=W;n.arc(o+e,a+t,i,s,r)}if(!E){if(!0===(null==j?void 0:j.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=j;n.arc(o+e,a+t,i,s,r)}if(!0===(null==U?void 0:U.isValid())){const{r:e,a0:t,a1:i}=U;n.arc(o,a,e,i,t,!0)}if(!0===(null==K?void 0:K.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=K;n.arc(o+e,a+t,i,s,r)}}n.closePath()}isPointInPath(e,t){var i;const s=this.transformPoint(e,t),{startAngle:r,endAngle:n,innerRadius:o,outerRadius:a}=null!=(i=this.clipSector)?i:this;return ug(s.x,s.y,{startAngle:r,endAngle:n,innerRadius:Math.min(o,a),outerRadius:Math.max(o,a)})}};Sg.className="Sector",C([hd()],Sg.prototype,"centerX",2),C([hd()],Sg.prototype,"centerY",2),C([hd()],Sg.prototype,"innerRadius",2),C([hd()],Sg.prototype,"outerRadius",2),C([hd()],Sg.prototype,"startAngle",2),C([hd()],Sg.prototype,"endAngle",2),C([hd()],Sg.prototype,"clipSector",2),C([hd()],Sg.prototype,"concentricEdgeInset",2),C([hd()],Sg.prototype,"radialEdgeInset",2),C([hd()],Sg.prototype,"startOuterCornerRadius",2),C([hd()],Sg.prototype,"endOuterCornerRadius",2),C([hd()],Sg.prototype,"startInnerCornerRadius",2),C([hd()],Sg.prototype,"endInnerCornerRadius",2);var wg=class extends ol{constructor(){super(...arguments),this.showInLegend=!1}};C([jr(Zr)],wg.prototype,"showInLegend",2);var xg=class extends Bo{constructor(){super(...arguments),this.margin=2}set(e,t){return super.set(e)}};C([jr(Jr)],xg.prototype,"text",2),C([jr(en)],xg.prototype,"margin",2);var Eg=class extends yt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};C([jr(mn)],Eg.prototype,"fill",2),C([jr(rn)],Eg.prototype,"fillOpacity",2);var Mg=class extends Bo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};C([jr(sn)],Mg.prototype,"offset",2),C([jr(nn)],Mg.prototype,"minAngle",2),C([jr(sn)],Mg.prototype,"minSpacing",2),C([jr(sn)],Mg.prototype,"maxCollisionOffset",2),C([jr(Zr)],Mg.prototype,"avoidCollisions",2);var Ag=class extends Bo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};C([jr(en)],Ag.prototype,"positionOffset",2),C([jr(rn)],Ag.prototype,"positionRatio",2);var Tg=class extends yt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};C([jr(fn,{optional:!0})],Tg.prototype,"colors",2),C([jr(sn)],Tg.prototype,"length",2),C([jr(sn)],Tg.prototype,"strokeWidth",2);var Dg=class extends Bd{constructor(){super(...arguments),this.fills=Object.values(Ot),this.strokes=Object.values(Ft),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=void 0,this.innerLabels=new vt(xg),this.title=new wg,this.innerCircle=new Eg,this.shadow=new Bu,this.calloutLabel=new Mg,this.sectorLabel=new Ag,this.calloutLine=new Tg,this.tooltip=new zu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}isValid(){const e=super.isValid();return null==this.innerRadiusRatio&&null==this.innerRadiusOffset?(N.warnOnce("Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series."),!1):e}};function Ig(e,t,i,s){const r=[i.convert(0),i.convert(1)],n=[s.convert(0),s.convert(1)],o=Math.PI/-2+Fr(t),a=e?"initial":"update";return{nodes:{toFn:(e,t,i,{prevLive:s})=>{var n,a;let{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d}=t;const{stroke:u,fill:p}=t.sectorFormat;if("removed"===i&&s?(l=null==(n=s.datum)?void 0:n.endAngle,c=null==(a=s.datum)?void 0:a.endAngle):"removed"!==i||s||(l=o,c=o),"removed"===i){const e=(({radius:e})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*e}))(t);h=e.innerRadius,d=e.outerRadius}return{startAngle:l,endAngle:c,outerRadius:d,innerRadius:h,stroke:u,fill:p}},fromFn:(t,i,s,{prevFromProps:r})=>{var l,c,h,d,u,p;let{startAngle:g,endAngle:m,innerRadius:f,outerRadius:y}=t,{fill:v,stroke:C}=i.sectorFormat;if("unknown"===s||"added"===s&&!r?(g=o,m=o,f=i.innerRadius,y=i.outerRadius):"added"===s&&r&&(g=null!=(l=r.endAngle)?l:o,m=null!=(c=r.endAngle)?c:o,f=null!=(h=r.innerRadius)?h:i.innerRadius,y=null!=(d=r.outerRadius)?d:i.outerRadius),"added"===s&&!e){const e=(({radius:e})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*e}))(i);f=e.innerRadius,y=e.outerRadius}return"updated"===s&&(v=null!=(u=t.fill)?u:v,C=null!=(p=t.stroke)?p:C),{startAngle:g,endAngle:m,innerRadius:f,outerRadius:y,fill:v,stroke:C,phase:a}}},innerCircle:{fromFn:(e,t)=>{var i,s,r;return{size:null!=(r=null!=(s=null==(i=e.previousDatum)?void 0:i.radius)?s:e.size)?r:0,phase:a}},toFn:(e,t)=>{var i;return{size:null!=(i=t.radius)?i:0}}}}}function Rg(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,fill:t.sectorFormat.fill,stroke:t.sectorFormat.stroke}}function Pg(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,r=Math.atan2(i,s),n=e.getItemNodes();for(const e of n)if(!0!==e.datum.missing&&Or(r,e.startAngle,e.endAngle)){const t=Math.sqrt(s*s+i*i);let r=0;return t<e.innerRadius?r=e.innerRadius-t:t>e.outerRadius&&(r=t-e.outerRadius),{datum:e.datum,distance:r}}}function kg(e,t){const i=e.getNodeData();if(void 0===i)return;const{centerX:s,centerY:r}=e,n=i[t.datumIndex],o=[{radius:n.innerRadius,angle:n.startAngle},{radius:n.innerRadius,angle:n.endAngle},{radius:n.outerRadius,angle:n.startAngle},{radius:n.outerRadius,angle:n.endAngle}],a=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const e of a)Or(e,n.startAngle,n.endAngle)&&o.push({radius:n.outerRadius,angle:e});const l=o.map(({radius:e,angle:t})=>Vr(s,r,e,t)),c=l.map(e=>e.x),h=l.map(e=>e.y),d=Math.min(...c),u=Math.min(...h),p=Math.max(...c)-d,g=Math.max(...h)-u;return new Js(d,u,p,g)}C([jr(Jr)],Dg.prototype,"angleKey",2),C([jr(Jr,{optional:!0})],Dg.prototype,"angleName",2),C([jr(Jr,{optional:!0})],Dg.prototype,"radiusKey",2),C([jr(Jr,{optional:!0})],Dg.prototype,"radiusName",2),C([jr(sn,{optional:!0})],Dg.prototype,"radiusMin",2),C([jr(sn,{optional:!0})],Dg.prototype,"radiusMax",2),C([jr(Jr,{optional:!0})],Dg.prototype,"calloutLabelKey",2),C([jr(Jr,{optional:!0})],Dg.prototype,"calloutLabelName",2),C([jr(Jr,{optional:!0})],Dg.prototype,"sectorLabelKey",2),C([jr(Jr,{optional:!0})],Dg.prototype,"sectorLabelName",2),C([jr(Jr,{optional:!0})],Dg.prototype,"legendItemKey",2),C([jr(fn)],Dg.prototype,"fills",2),C([jr(fn)],Dg.prototype,"strokes",2),C([jr(rn)],Dg.prototype,"fillOpacity",2),C([jr(rn)],Dg.prototype,"strokeOpacity",2),C([jr(En)],Dg.prototype,"lineDash",2),C([jr(sn)],Dg.prototype,"lineDashOffset",2),C([jr(sn)],Dg.prototype,"cornerRadius",2),C([jr(Qr,{optional:!0})],Dg.prototype,"formatter",2),C([jr(nn)],Dg.prototype,"rotation",2),C([jr(en)],Dg.prototype,"outerRadiusOffset",2),C([jr(rn)],Dg.prototype,"outerRadiusRatio",2),C([jr(en,{optional:!0})],Dg.prototype,"innerRadiusOffset",2),C([jr(rn,{optional:!0})],Dg.prototype,"innerRadiusRatio",2),C([jr(sn)],Dg.prototype,"strokeWidth",2),C([jr(sn,{optional:!0})],Dg.prototype,"sectorSpacing",2),C([jr(Sn)],Dg.prototype,"innerLabels",2),C([jr(qr)],Dg.prototype,"title",2),C([jr(qr)],Dg.prototype,"innerCircle",2),C([jr(qr)],Dg.prototype,"shadow",2),C([jr(qr)],Dg.prototype,"calloutLabel",2),C([jr(qr)],Dg.prototype,"sectorLabel",2),C([jr(qr)],Dg.prototype,"calloutLine",2),C([jr(qr)],Dg.prototype,"tooltip",2),C([jr(Jr,{optional:!0})],Dg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var Lg=class extends Nd{constructor(e){var t=e,{useLabelLayer:i=!1,pickModes:s=[0],canHaveAxes:r=!1,animationResetFns:n}=t,o=y(t,["useLabelLayer","pickModes","canHaveAxes","animationResetFns"]);super(f(m({},o),{useLabelLayer:i,pickModes:s,contentGroupVirtual:!1,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:r})),this.itemGroup=this.contentGroup.appendChild(new xo),this.nodeData=[],this.itemSelection=Na.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Na.select(this.labelGroup,Oo,!1),this.highlightSelection=Na.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.showFocusBox=!1,this.itemGroup.zIndexSubOrder=[()=>this._declarationOrder,1],this.animationResetFns=n,this.animationState=new fa("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return this.itemGroup.children}getNodeData(){return this.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}getLabelData(){return[]}computeLabelsBBox(e,t){return null}resetAllAnimation(){var e;const{item:t,label:i}=null!=(e=this.animationResetFns)?e:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&ma([this.itemSelection,this.highlightSelection],t),i&&ma([this.labelSelection],i),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){var t;const{item:i}=null!=(t=this.animationResetFns)?t:{};i&&ma([this.highlightSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(e){return{seriesRect:e}}},Ng=class extends Yh{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},_g=class extends Lg{constructor(e){super({moduleCtx:e,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Rg,label:Fu}}),this.properties=new Dg,this.previousRadiusScale=new Xd,this.radiusScale=new Xd,this.backgroundGroup=this.rootGroup.appendChild(new xo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new yd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new yd),this.innerCircleGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=Ng,this.angleScale=new Xd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const t=new xo({name:"pieCalloutLabels"}),i=new xo({name:"pieSectorLabels"}),s=new xo({name:"innerLabels"});this.labelGroup.append(t),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=Na.select(t,xo),this.sectorLabelSelection=Na.select(i,Oo),this.innerLabelsSelection=Na.select(s,Oo),this.innerCircleSelection=Na.select(this.innerCircleGroup,yd)}addChartEventListeners(){var e;this.destroyFns.push(null==(e=this.ctx.chartEventManager)?void 0:e.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(e=>e))}nodeFactory(){return new Sg}getSeriesDomain(e){return"x"===e?this.angleScale.domain:this.radiusScale.domain}processData(e){return S(this,null,function*(){var t,i,s,r,n;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:a,seriesItemEnabled:l}=this,{angleKey:c,radiusKey:h,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),y=[],v=[];p?y.push(Uh(p,"band",{id:"legendItemKey"})):d?y.push(Uh(d,"band",{id:"calloutLabelKey"})):u&&y.push(Uh(u,"band",{id:"sectorLabelKey"}));const C=this.radiusScale.type,b=this.radiusScale.type;h&&v.push(Wh(h,{id:"radiusValue",min:null!=(t=this.properties.radiusMin)?t:0,max:this.properties.radiusMax}),zh(h,C,{id:"radiusRaw"}),Rh({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&v.push(zh(d,"band",{id:"calloutLabelValue"})),u&&v.push(zh(u,"band",{id:"sectorLabelValue"})),p&&v.push(zh(p,"band",{id:"legendItemValue"})),g&&this.processedData&&y.length>0&&v.push(_h(this.processedData)),v.push(Ph()),o=o.map((e,t)=>a&&l[t]?e:f(m({},e),{[c]:0})),yield this.requestDataModel(e,o,{props:[...y,jh(c,b,{id:"angleValue",onlyPositive:!0}),zh(c,b,{id:"angleRaw"}),Rh({id:"angleValue"},[0,1],0,0),...v]});for(const e of null!=(n=null==(r=null==(s=this.processedData)?void 0:s.defs)?void 0:r.values)?n:[]){const{id:t,missing:i,property:s}=e,r=qc(this,i);"angleRaw"!==t&&r>0&&N.warnOnce(`no value was found for the key '${String(s)}' on ${r} data element${r>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return S(this,null,function*(){var e;if(!this.nodeDataRefresh)return;const{nodeData:t=[]}=null!=(e=yield this.createNodeData())?e:{};this.nodeData=t,this.nodeDataRefresh=!1})}getProcessedDataIndexes(e){return{angleIdx:e.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?e.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?e.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?e.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?e.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return S(this,null,function*(){const{id:e,processedData:t,dataModel:i,angleScale:s}=this,{rotation:r,innerRadiusRatio:n}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:e,nodeData:[],labelData:[]};if(!t||!i||"ungrouped"!==t.type)return;const{angleIdx:o,radiusIdx:a,calloutLabelIdx:l,sectorLabelIdx:c,legendItemIdx:h}=this.getProcessedDataIndexes(i);let d=0,u=0;const p=t.data.map((e,t)=>{var i;const{datum:n,values:p}=e,g=p[o],f=s.convert(d)+Fr(r);d=g,u+=g;const y=s.convert(d)+Fr(r),v=Math.abs(y-f),C=f+v/2,b=p[o+1],S=a>=0&&null!=(i=p[a])?i:1,w=a>=0?p[a+1]:void 0,x=h>=0?p[h]:void 0,E=this.getLabels(n,C,v,!0,p[l],p[c],x),M=this.getSectorFormat(n,t,!1);return m({itemId:t,series:this,datum:n,index:t,angleValue:b,midAngle:C,midCos:Math.cos(C),midSin:Math.sin(C),startAngle:f,endAngle:y,sectorFormat:M,radiusValue:w,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:x},E)});return this.zerosumOuterRing.visible=0===u,this.zerosumInnerRing.visible=0===u&&null!=n&&1!==n&&n>0,{itemId:e,nodeData:p,labelData:p}})}getLabels(e,t,i,s,r,n,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>Fr(a.minAngle)&&(p.calloutLabel=f(m({},this.getTextAlignment(t)),{text:this.getLabelText(a,f(m({},u),{value:r})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,f(m({},u),{value:n}))}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=_r(e)- -.75*Math.PI;return t[Ys(Math.floor(i/(Math.PI/2)),t.length)]}getSectorFormat(e,t,i){var s,r,n,o,a;const{callbackCache:l,highlightManager:c}=this.ctx,{angleKey:h,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:f}=this.properties,y=c.getActiveHighlight(),v=i&&(null==y?void 0:y.series)===this&&t===y.itemId;let C=p[t%p.length];null==m&&null==C&&(C=f);const{fill:b,fillOpacity:S,stroke:w,strokeWidth:x,strokeOpacity:E}=qe(v&&this.properties.highlightStyle.item,{fill:u.length>0?u[t%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:C,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let M;return g&&(M=l.call(g,{datum:e,angleKey:h,radiusKey:d,fill:b,stroke:w,fills:u,strokes:p,strokeWidth:x,highlighted:v,seriesId:this.id})),{fill:null!=(s=null==M?void 0:M.fill)?s:b,fillOpacity:null!=(r=null==M?void 0:M.fillOpacity)?r:S,stroke:null!=(n=null==M?void 0:M.stroke)?n:w,strokeWidth:null!=(o=null==M?void 0:M.strokeWidth)?o:x,strokeOpacity:null!=(a=null==M?void 0:M.strokeOpacity)?a:E}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t),this.nodeData=this.nodeData.map(e=>{var t=e,{radius:i}=t,s=y(t,["radius"]);return f(m({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var e,t;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(t=null==(e=this.properties.title)?void 0:e.spacing)?t:0))-Math.max(0,-i)}update(e){return S(this,arguments,function*({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:null==e?void 0:e.width,seriesRectHeight:null==e?void 0:e.height},s=null!=St(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY(),i=t.node.computeBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i,0,e),t.node.translationY=isFinite(e)?e:0}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(e)})}updateTitleNodes(){var e,t;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(e=this.labelGroup)||e.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(t=this.labelGroup)||t.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}})}updateSelections(){return S(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return S(this,null,function*(){const{itemSelection:e,highlightSelection:t,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:r}=this,n=(e,t)=>{let i=this.nodeData;t&&(i=i.map(e=>f(m({},e),{sectorFormat:m({},e.sectorFormat)}))),e.update(i,void 0,e=>this.getDatumId(e)),this.ctx.animationManager.isSkipped()&&e.cleanup()};n(e,!1),n(t,!0),i.update(this.nodeData,e=>{const t=new Ga;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Oo;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),s.update(this.nodeData,e=>{e.pointerEvents=1}),r.update(this.properties.innerLabels,e=>{e.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),s=1;t=Math.ceil(2*e+s)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){return S(this,null,function*(){const t=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==t?void 0:t.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{var i,s;e.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:t})});const s=(e,t,i,s)=>{const r=this.getSectorFormat(t.datum,t.itemId,s);t.sectorFormat.fill=r.fill,t.sectorFormat.stroke=r.stroke;const n=this.ctx.animationManager.isSkipped();n&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(s||n)&&(e.fill=r.fill,e.stroke=r.stroke),e.strokeWidth=r.strokeWidth,e.fillOpacity=r.fillOpacity,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,e.fillShadow=this.properties.shadow,e.cornerRadius=this.properties.cornerRadius,e.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=r.stroke?r.strokeWidth:0))/2:0,e.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((e,t,i)=>s(e,t,0,!1)),this.highlightSelection.each((e,i,r)=>{const n=(null==t?void 0:t.series)===this&&e.datum.itemId===t.itemId;s(e,i,0,!0),e.visible=n}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var e;const{calloutLine:t}=this.properties,i=t.length,s=t.strokeWidth,r=null!=(e=t.colors)?e:this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((e,t)=>{var o;const a=e.datum,{calloutLabel:l,outerRadius:c}=a;if((null==l?void 0:l.text)&&!l.hidden&&0!==c){e.visible=!0,e.strokeWidth=s,e.stroke=r[t%r.length],e.fill=void 0;const h=a.midCos*c,d=a.midSin*c;let u=a.midCos*(c+i),p=a.midSin*(c+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const e=l.box;let t=u,i=p;u<e.x?t=e.x:u>e.x+e.width&&(t=e.x+e.width),p<e.y?i=e.y:p>e.y+e.height&&(i=e.y+e.height);const s=t-u,r=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(r,2)),a=o-n;a>0&&(u+=s*a/o,p+=r*a/o)}e.x1=h,e.y1=d,e.x2=u,e.y2=p}else e.visible=!1})}getLabelOverflow(e,t,i){const s=i.x-this.centerX,r=i.x+i.width-this.centerX,n=i.y-this.centerY,o=i.y+i.height-this.centerY;let a=1;t.x+1<s?a=(t.x+t.width-s)/t.width:t.x+t.width-1>r&&(a=(r-t.x)/t.width);const l=t.y+1<n||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e,t=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const r=[{x:e.x+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+e.height+i},{x:e.x+t,y:e.y+e.height+i}],n=p(s,2);return r.some(e=>p(e.x,2)+p(e.y,2)>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:r}=t,n=e.convert(0),o=this.nodeData,a=this.nodeData.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>{var t;return e.midSin<0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),d=a.filter(e=>{var t;return e.midSin>=0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),u=new Oo,p=e=>{var t;const r=e.calloutLabel;if(null==r)return new Js(0,0,0,0);const n=e.outerRadius+i.length+s,o=e.midCos*n,a=e.midSin*n+r.collisionOffsetY;return u.text=r.text,u.x=o,u.y=a,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(t=r.collisionTextAlign)?t:r.textAlign,textBaseline:r.textBaseline}),u.computeBBox()},g=(e,t,i)=>{const s=p(e).grow(r/2),n=p(t).grow(r/2);if(s.x<n.x+n.width&&s.x+s.width>n.x&&("to-top"===i?s.y<n.y+n.height:s.y+s.height>n.y)){const e="to-top"===i?s.y-n.y-n.height:s.y+s.height-n.y;t.calloutLabel.collisionOffsetY=e}},m=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],s=e[t];g(i,s,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],s=e[t];g(i,s,"to-bottom")}},f=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>p(e)),s=i.map(e=>e.clone().grow(r/2));let l=!1;for(let t=0;t<s.length&&!l;t++){const i=s[t];for(let r=t+1;r<e.length;r++){const e=s[r];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:s}=e;return{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}}),h=i.some(e=>c.some(t=>gg(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};m(l),m(c),f(h),f(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,color:o}=i,a=new Oo;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:c}=s,h=c.calloutLabel,d=t.convert(c.radius),u=Math.max(0,d);if(!(null==h?void 0:h.text)||0===u||h.hidden)return void(s.visible=!1);const p=u+r+n,g=c.midCos*p,m=c.midSin*p+h.collisionOffsetY,f={textAlign:null!=(l=h.collisionTextAlign)?l:h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=m,a.setFont(this.properties.calloutLabel),a.setAlign(f);const y=a.computeBBox();let v=h.text,C=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,e);v=h.text.length===t?h.text:`${h.text.substring(0,t)}…`,C=!i}s.text=v,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(f),s.fill=o,s.visible=C})}computeLabelsBBox(e,t){return S(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Oo;let h;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=d.text,c.x=0,c.y=e,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.computeBBox(),l.push(h))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+r+n,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;c.text=d.text,c.x=p,c.y=g,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=c.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(h){const e=t.y-this.centerY,i=new Js(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(m.collidesBBox(i))return void(d.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,t),r=d.text.length>2&&e<2;if(i||r||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:Js.merge(l)})}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:r,fontFamily:n,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel;this.sectorLabelSelection.each((e,c)=>{const{sectorLabel:h,outerRadius:d}=c;let u=!1;if(h&&0!==d){const p=t*(1-a)+d*a+o;e.fill=l,e.fontStyle=s,e.fontWeight=r,e.fontSize=i,e.fontFamily=n,e.text=h.text,e.x=c.midCos*p,e.y=c.midSin*p,e.textAlign="center",e.textBaseline="middle";const g=e.computeBBox(),m=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:f,endAngle:y}=c,v={startAngle:f,endAngle:y,innerRadius:t,outerRadius:d};m.every(([e,t])=>ug(e,t,v))&&(u=!0)}e.visible=u})}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a,color:l}=s;i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.computeBBox()),t.push(s.margin)});const i=e=>0===e?0:t[e],s=e=>e===t.length-1?0:t[e],r=e.reduce((e,t,r)=>e+t.height+i(r)+s(r),0),n=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(n/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,n=-r/2;t<e.length;t++){const r=e[t].height+n+i(t);l.push(r),n=r+s(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(e){const{angleKey:t,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:r}=this.properties,{sectorLabel:n,calloutLabel:o,legendItem:a}=e;return r&&void 0!==a?a.text:i&&i!==t&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==t&&void 0!==(null==n?void 0:n.text)?n.text:void 0}pickNodeClosestDatum(e){return Pg(this,e)}getTooltipHtml(e){var t;if(!this.properties.isValid())return tl;const{datum:i,angleValue:s,sectorFormat:{fill:r},itemId:n}=e,o=Nu(null==(t=this.properties.title)?void 0:t.text),a=ze(s)?$s(s):String(s),l=this.getDatumLegendName(e);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${a}`:a,backgroundColor:r},{datum:i,itemId:n,title:o,color:r,seriesId:this.id,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey})}getLegendData(e){var t,i,s,r,n;const{visible:o,processedData:a,dataModel:l}=this;if(!l||!(null==a?void 0:a.data.length)||!this.properties.isValid()||"category"!==e)return[];const{angleKey:c,calloutLabelKey:h,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||h&&h!==c||d&&d!==c))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),f=(null==(t=this.properties.title)?void 0:t.showInLegend)&&this.properties.title.text,y=[];for(let e=0;e<a.data.length;e++){const{datum:t,values:l}=a.data[e],v=[];f&&v.push(f);const C=this.getLabels(t,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==C.legendItem?v.push(C.legendItem.text):h&&h!==c&&void 0!==(null==(i=C.calloutLabel)?void 0:i.text)?v.push(null==(s=C.calloutLabel)?void 0:s.text):d&&d!==c&&void 0!==(null==(r=C.sectorLabel)?void 0:r.text)&&v.push(null==(n=C.sectorLabel)?void 0:n.text),0===v.length)continue;const b=this.getSectorFormat(t,e,!1);y.push({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:o&&this.seriesItemEnabled[e],label:{text:v.join(" - ")},marker:{fill:b.fill,stroke:b.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?t[u]:void 0})}return y}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendItemName:r}=e;s.id===this.id?this.toggleSeriesItem(i,t):null!=r&&this.toggleOtherSeriesItems(r,t)}toggleSeriesItem(e,t){this.seriesItemEnabled[e]=t,this.nodeDataRefresh=!0}toggleOtherSeriesItems(e,t){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},r)=>{i[s]===e&&this.toggleSeriesItem(r,t)})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Ig(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Ir(this.id,"nodes",t,[this.itemSelection,this.highlightSelection],i.nodes),Ir(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),_u(this,"callout",t,this.calloutLabelSelection),_u(this,"sector",t,this.sectorLabelSelection),_u(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var e,t,i,s,r,n;const{itemSelection:o,highlightSelection:a,processedData:l,radiusScale:c,previousRadiusScale:h}=this,{animationManager:d}=this.ctx,u=null==(e=null==l?void 0:l.reduced)?void 0:e.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(t=null==u?void 0:u.moved.size)?t:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(n=null==(r=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:r.uniqueKeys)||n;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const f=Ig(!1,this.properties.rotation,c,h);Ir(this.id,"nodes",d,[o,a],f.nodes,(e,t)=>this.getDatumId(t),u),Ir(this.id,"innerCircle",d,[this.innerCircleSelection],f.innerCircle),_u(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),_u(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),_u(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,radiusScale:i,previousRadiusScale:s}=this,{animationManager:r}=this.ctx,n=Ig(!1,this.properties.rotation,i,s);Ir(this.id,"nodes",r,[e,t],n.nodes),Ir(this.id,"innerCircle",r,[this.innerCircleSelection],n.innerCircle),Ou(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ou(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Ou(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(e){var t,i,s;const{calloutLabelKey:r,sectorLabelKey:n,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?e[o]:r?e[r]:n?e[n]:void 0}getDatumId(e){const{index:t}=e,i=this.getDatumIdFromData(e.datum);return null!=i?String(i):`${t}`}onDataChange(){var e;const{data:t,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(e=null==t?void 0:t.map((e,t)=>{var s;return null==(s=i[t])||s}))?e:[]}computeFocusBounds(e){return kg(this,e)}};_g.className="DonutSeries",_g.type="donut";var Og={series:{__extends__:zt,title:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:14,fontFamily:jt,color:qt,spacing:5},calloutLabel:{enabled:!0,fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:jt,color:Kt,offset:3,minAngle:0},sectorLabel:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:12,fontFamily:jt,color:Yt,positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,rotation:0,shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5},innerLabels:{fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:jt,color:Kt,margin:2},__BACKGROUND_COLOR_DO_NOT_USE:Jt}},Fg=({takeColors:e,colorsCount:t,userPalette:i})=>{const{fills:s,strokes:r}=e(t);return{fills:s,strokes:i?r:[],calloutLine:{colors:r}}},Gg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",instanceConstructor:_g,themeTemplate:Og,paletteFactory:Fg},Bg=class extends ol{constructor(){super(...arguments),this.showInLegend=!1}};C([jr(Zr)],Bg.prototype,"showInLegend",2);var Vg=class extends Bo{set(e,t){return super.set(e)}};C([ks("Use a Donut Series instead"),jr(Jr,{optional:!0})],Vg.prototype,"text",2),C([ks("Use a Donut Series instead"),jr(en,{optional:!0})],Vg.prototype,"margin",2);var Hg=class extends yt{};C([ks("Use a Donut Series instead"),jr(mn,{optional:!0})],Hg.prototype,"fill",2),C([ks("Use a Donut Series instead"),jr(rn,{optional:!0})],Hg.prototype,"fillOpacity",2);var Ug=class extends Bo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};C([jr(sn)],Ug.prototype,"offset",2),C([jr(nn)],Ug.prototype,"minAngle",2),C([jr(sn)],Ug.prototype,"minSpacing",2),C([jr(sn)],Ug.prototype,"maxCollisionOffset",2),C([jr(Zr)],Ug.prototype,"avoidCollisions",2);var zg=class extends Bo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};C([jr(en)],zg.prototype,"positionOffset",2),C([jr(rn)],zg.prototype,"positionRatio",2);var Wg=class extends yt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};C([jr(fn,{optional:!0})],Wg.prototype,"colors",2),C([jr(sn)],Wg.prototype,"length",2),C([jr(sn)],Wg.prototype,"strokeWidth",2);var jg=class extends Bd{constructor(){super(...arguments),this.fills=Object.values(Ot),this.strokes=Object.values(Ft),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=void 0,this.innerLabels=new vt(Vg),this.title=new Bg,this.innerCircle=new Hg,this.shadow=new Bu,this.calloutLabel=new Ug,this.sectorLabel=new zg,this.calloutLine=new Wg,this.tooltip=new zu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}};C([jr(Jr)],jg.prototype,"angleKey",2),C([jr(Jr,{optional:!0})],jg.prototype,"angleName",2),C([jr(Jr,{optional:!0})],jg.prototype,"radiusKey",2),C([jr(Jr,{optional:!0})],jg.prototype,"radiusName",2),C([jr(sn,{optional:!0})],jg.prototype,"radiusMin",2),C([jr(sn,{optional:!0})],jg.prototype,"radiusMax",2),C([jr(Jr,{optional:!0})],jg.prototype,"calloutLabelKey",2),C([jr(Jr,{optional:!0})],jg.prototype,"calloutLabelName",2),C([jr(Jr,{optional:!0})],jg.prototype,"sectorLabelKey",2),C([jr(Jr,{optional:!0})],jg.prototype,"sectorLabelName",2),C([jr(Jr,{optional:!0})],jg.prototype,"legendItemKey",2),C([jr(fn)],jg.prototype,"fills",2),C([jr(fn)],jg.prototype,"strokes",2),C([jr(rn)],jg.prototype,"fillOpacity",2),C([jr(rn)],jg.prototype,"strokeOpacity",2),C([jr(En)],jg.prototype,"lineDash",2),C([jr(sn)],jg.prototype,"lineDashOffset",2),C([jr(sn)],jg.prototype,"cornerRadius",2),C([jr(Qr,{optional:!0})],jg.prototype,"formatter",2),C([jr(nn)],jg.prototype,"rotation",2),C([jr(en)],jg.prototype,"outerRadiusOffset",2),C([jr(rn)],jg.prototype,"outerRadiusRatio",2),C([ks("Use a Donut Series instead"),jr(en,{optional:!0})],jg.prototype,"innerRadiusOffset",2),C([ks("Use a Donut Series instead"),jr(rn,{optional:!0})],jg.prototype,"innerRadiusRatio",2),C([jr(sn)],jg.prototype,"strokeWidth",2),C([jr(sn,{optional:!0})],jg.prototype,"sectorSpacing",2),C([jr(Sn)],jg.prototype,"innerLabels",2),C([jr(qr)],jg.prototype,"title",2),C([jr(qr)],jg.prototype,"innerCircle",2),C([jr(qr)],jg.prototype,"shadow",2),C([jr(qr)],jg.prototype,"calloutLabel",2),C([jr(qr)],jg.prototype,"sectorLabel",2),C([jr(qr)],jg.prototype,"calloutLine",2),C([jr(qr)],jg.prototype,"tooltip",2),C([jr(Jr,{optional:!0})],jg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var Kg=class extends Yh{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},$g=class extends Lg{constructor(e){super({moduleCtx:e,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Rg,label:Fu}}),this.properties=new jg,this.previousRadiusScale=new Xd,this.radiusScale=new Xd,this.backgroundGroup=this.rootGroup.appendChild(new xo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new yd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new yd),this.innerCircleGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=Kg,this.angleScale=new Xd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const t=new xo({name:"pieCalloutLabels"}),i=new xo({name:"pieSectorLabels"}),s=new xo({name:"innerLabels"});this.labelGroup.append(t),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=Na.select(t,xo),this.sectorLabelSelection=Na.select(i,Oo),this.innerLabelsSelection=Na.select(s,Oo),this.innerCircleSelection=Na.select(this.innerCircleGroup,yd)}addChartEventListeners(){var e;this.destroyFns.push(null==(e=this.ctx.chartEventManager)?void 0:e.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(e=>e))}nodeFactory(){return new Sg}getSeriesDomain(e){return"x"===e?this.angleScale.domain:this.radiusScale.domain}processData(e){return S(this,null,function*(){var t,i,s,r,n;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:a,seriesItemEnabled:l}=this,{angleKey:c,radiusKey:h,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),y=[],v=[];p?y.push(Uh(p,"band",{id:"legendItemKey"})):d?y.push(Uh(d,"band",{id:"calloutLabelKey"})):u&&y.push(Uh(u,"band",{id:"sectorLabelKey"}));const C=this.radiusScale.type,b=this.radiusScale.type;h&&v.push(Wh(h,{id:"radiusValue",min:null!=(t=this.properties.radiusMin)?t:0,max:this.properties.radiusMax}),zh(h,C,{id:"radiusRaw"}),Rh({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&v.push(zh(d,"band",{id:"calloutLabelValue"})),u&&v.push(zh(u,"band",{id:"sectorLabelValue"})),p&&v.push(zh(p,"band",{id:"legendItemValue"})),g&&this.processedData&&y.length>0&&v.push(_h(this.processedData)),v.push(Ph()),o=o.map((e,t)=>a&&l[t]?e:f(m({},e),{[c]:0})),yield this.requestDataModel(e,o,{props:[...y,jh(c,b,{id:"angleValue",onlyPositive:!0}),zh(c,b,{id:"angleRaw"}),Rh({id:"angleValue"},[0,1],0,0),...v]});for(const e of null!=(n=null==(r=null==(s=this.processedData)?void 0:s.defs)?void 0:r.values)?n:[]){const{id:t,missing:i,property:s}=e,r=qc(this,i);"angleRaw"!==t&&r>0&&N.warnOnce(`no value was found for the key '${String(s)}' on ${r} data element${r>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return S(this,null,function*(){var e;if(!this.nodeDataRefresh)return;const{nodeData:t=[]}=null!=(e=yield this.createNodeData())?e:{};this.nodeData=t,this.nodeDataRefresh=!1})}getProcessedDataIndexes(e){return{angleIdx:e.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?e.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?e.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?e.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?e.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return S(this,null,function*(){const{id:e,processedData:t,dataModel:i,angleScale:s}=this,{rotation:r}=this.properties;if(!t||!i||"ungrouped"!==t.type)return;const{angleIdx:n,radiusIdx:o,calloutLabelIdx:a,sectorLabelIdx:l,legendItemIdx:c}=this.getProcessedDataIndexes(i);let h=0,d=0;const u=t.data.map((e,t)=>{var i;const{datum:u,values:p}=e,g=p[n],f=s.convert(h)+Fr(r);h=g,d+=g;const y=s.convert(h)+Fr(r),v=Math.abs(y-f),C=f+v/2,b=p[n+1],S=o>=0&&null!=(i=p[o])?i:1,w=o>=0?p[o+1]:void 0,x=c>=0?p[c]:void 0,E=this.getLabels(u,C,v,!0,p[a],p[l],x),M=this.getSectorFormat(u,t,!1);return m({itemId:t,series:this,datum:u,index:t,angleValue:b,midAngle:C,midCos:Math.cos(C),midSin:Math.sin(C),startAngle:f,endAngle:y,sectorFormat:M,radiusValue:w,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:x},E)});this.zerosumOuterRing.visible=0===d;const{innerRadiusRatio:p=1}=this.properties;return this.zerosumInnerRing.visible=0===d&&1!==p&&p>0,{itemId:e,nodeData:u,labelData:u}})}getLabels(e,t,i,s,r,n,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>Fr(a.minAngle)&&(p.calloutLabel=f(m({},this.getTextAlignment(t)),{text:this.getLabelText(a,f(m({},u),{value:r})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,f(m({},u),{value:n}))}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=_r(e)- -.75*Math.PI;return t[Ys(Math.floor(i/(Math.PI/2)),t.length)]}getSectorFormat(e,t,i){var s,r,n,o,a;const{callbackCache:l,highlightManager:c}=this.ctx,{angleKey:h,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:f}=this.properties,y=c.getActiveHighlight(),v=i&&(null==y?void 0:y.series)===this&&t===y.itemId;let C=p[t%p.length];null!=m&&(null!=C||(C=f));const{fill:b,fillOpacity:S,stroke:w,strokeWidth:x,strokeOpacity:E}=qe(v&&this.properties.highlightStyle.item,{fill:u.length>0?u[t%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:C,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let M;return g&&(M=l.call(g,{datum:e,angleKey:h,radiusKey:d,fill:b,stroke:w,fills:u,strokes:p,strokeWidth:x,highlighted:v,seriesId:this.id})),{fill:null!=(s=null==M?void 0:M.fill)?s:b,fillOpacity:null!=(r=null==M?void 0:M.fillOpacity)?r:S,stroke:null!=(n=null==M?void 0:M.stroke)?n:w,strokeWidth:null!=(o=null==M?void 0:M.strokeWidth)?o:x,strokeOpacity:null!=(a=null==M?void 0:M.strokeOpacity)?a:E}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t),this.nodeData=this.nodeData.map(e=>{var t=e,{radius:i}=t,s=y(t,["radius"]);return f(m({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var e,t;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(t=null==(e=this.properties.title)?void 0:e.spacing)?t:0))-Math.max(0,-i)}update(e){return S(this,arguments,function*({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:null==e?void 0:e.width,seriesRectHeight:null==e?void 0:e.height},s=null!=St(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY(),i=t.node.computeBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i,0,e),t.node.translationY=isFinite(e)?e:0}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(e)})}updateTitleNodes(){var e,t;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(e=this.labelGroup)||e.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(t=this.labelGroup)||t.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}})}updateSelections(){return S(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return S(this,null,function*(){const{itemSelection:e,highlightSelection:t,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:r}=this,n=(e,t)=>{let i=this.nodeData;t&&(i=i.map(e=>f(m({},e),{sectorFormat:m({},e.sectorFormat)}))),e.update(i,void 0,e=>this.getDatumId(e)),this.ctx.animationManager.isSkipped()&&e.cleanup()};n(e,!1),n(t,!0),i.update(this.nodeData,e=>{const t=new Ga;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Oo;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),s.update(this.nodeData,e=>{e.pointerEvents=1}),r.update(this.properties.innerLabels,e=>{e.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),s=1;t=Math.ceil(2*e+s)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){return S(this,null,function*(){const t=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==t?void 0:t.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{var i,s;e.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:t})});const s=(e,t,i,s)=>{const r=this.getSectorFormat(t.datum,t.itemId,s);t.sectorFormat.fill=r.fill,t.sectorFormat.stroke=r.stroke;const n=this.ctx.animationManager.isSkipped();n&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(s||n)&&(e.fill=r.fill,e.stroke=r.stroke),e.strokeWidth=r.strokeWidth,e.fillOpacity=r.fillOpacity,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,e.fillShadow=this.properties.shadow,e.cornerRadius=this.properties.cornerRadius,e.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=r.stroke?r.strokeWidth:0))/2:0,e.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((e,t,i)=>s(e,t,0,!1)),this.highlightSelection.each((e,i,r)=>{const n=(null==t?void 0:t.series)===this&&e.datum.itemId===t.itemId;s(e,i,0,!0),e.visible=n}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var e;const{calloutLine:t}=this.properties,i=t.length,s=t.strokeWidth,r=null!=(e=t.colors)?e:this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((e,t)=>{var o;const a=e.datum,{calloutLabel:l,outerRadius:c}=a;if((null==l?void 0:l.text)&&!l.hidden&&0!==c){e.visible=!0,e.strokeWidth=s,e.stroke=r[t%r.length],e.fill=void 0;const h=a.midCos*c,d=a.midSin*c;let u=a.midCos*(c+i),p=a.midSin*(c+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const e=l.box;let t=u,i=p;u<e.x?t=e.x:u>e.x+e.width&&(t=e.x+e.width),p<e.y?i=e.y:p>e.y+e.height&&(i=e.y+e.height);const s=t-u,r=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(r,2)),a=o-n;a>0&&(u+=s*a/o,p+=r*a/o)}e.x1=h,e.y1=d,e.x2=u,e.y2=p}else e.visible=!1})}getLabelOverflow(e,t,i){const s=i.x-this.centerX,r=i.x+i.width-this.centerX,n=i.y-this.centerY,o=i.y+i.height-this.centerY;let a=1;t.x+1<s?a=(t.x+t.width-s)/t.width:t.x+t.width-1>r&&(a=(r-t.x)/t.width);const l=t.y+1<n||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e,t=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const r=[{x:e.x+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+e.height+i},{x:e.x+t,y:e.y+e.height+i}],n=p(s,2);return r.some(e=>p(e.x,2)+p(e.y,2)>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:r}=t,n=e.convert(0),o=this.nodeData,a=this.nodeData.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>{var t;return e.midSin<0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),d=a.filter(e=>{var t;return e.midSin>=0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),u=new Oo,p=e=>{var t;const r=e.calloutLabel;if(null==r)return new Js(0,0,0,0);const n=e.outerRadius+i.length+s,o=e.midCos*n,a=e.midSin*n+r.collisionOffsetY;return u.text=r.text,u.x=o,u.y=a,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(t=r.collisionTextAlign)?t:r.textAlign,textBaseline:r.textBaseline}),u.computeBBox()},g=(e,t,i)=>{const s=p(e).grow(r/2),n=p(t).grow(r/2);if(s.x<n.x+n.width&&s.x+s.width>n.x&&("to-top"===i?s.y<n.y+n.height:s.y+s.height>n.y)){const e="to-top"===i?s.y-n.y-n.height:s.y+s.height-n.y;t.calloutLabel.collisionOffsetY=e}},m=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],s=e[t];g(i,s,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],s=e[t];g(i,s,"to-bottom")}},f=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>p(e)),s=i.map(e=>e.clone().grow(r/2));let l=!1;for(let t=0;t<s.length&&!l;t++){const i=s[t];for(let r=t+1;r<e.length;r++){const e=s[r];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:s}=e;return{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}}),h=i.some(e=>c.some(t=>gg(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};m(l),m(c),f(h),f(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,color:o}=i,a=new Oo;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:c}=s,h=c.calloutLabel,d=t.convert(c.radius),u=Math.max(0,d);if(!(null==h?void 0:h.text)||0===u||h.hidden)return void(s.visible=!1);const p=u+r+n,g=c.midCos*p,m=c.midSin*p+h.collisionOffsetY,f={textAlign:null!=(l=h.collisionTextAlign)?l:h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=m,a.setFont(this.properties.calloutLabel),a.setAlign(f);const y=a.computeBBox();let v=h.text,C=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,e);v=h.text.length===t?h.text:`${h.text.substring(0,t)}…`,C=!i}s.text=v,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(f),s.fill=o,s.visible=C})}computeLabelsBBox(e,t){return S(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Oo;let h;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=d.text,c.x=0,c.y=e,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.computeBBox(),l.push(h))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+r+n,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;c.text=d.text,c.x=p,c.y=g,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=c.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(h){const e=t.y-this.centerY,i=new Js(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(m.collidesBBox(i))return void(d.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,t),r=d.text.length>2&&e<2;if(i||r||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:Js.merge(l)})}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:r,fontFamily:n,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=1===this.seriesItemEnabled.filter(Boolean).length;this.sectorLabelSelection.each((e,d)=>{const{sectorLabel:u,outerRadius:p}=d;let g=!1;if(u&&0!==p){const m=t*(1-a)+p*a+o;e.fill=l,e.fontStyle=s,e.fontWeight=r,e.fontSize=i,e.fontFamily=n,e.text=u.text,!c&&h?(e.x=0,e.y=0):(e.x=d.midCos*m,e.y=d.midSin*m),e.textAlign="center",e.textBaseline="middle";const f=e.computeBBox(),y=[[f.x,f.y],[f.x+f.width,f.y],[f.x+f.width,f.y+f.height],[f.x,f.y+f.height]],{startAngle:v,endAngle:C}=d,b={startAngle:v,endAngle:C,innerRadius:t,outerRadius:p};y.every(([e,t])=>ug(e,t,b))&&(g=!0)}e.visible=g})}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a,color:l,margin:c=2}=s;i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.computeBBox()),t.push(c)});const i=e=>0===e?0:t[e],s=e=>e===t.length-1?0:t[e],r=e.reduce((e,t,r)=>e+t.height+i(r)+s(r),0),n=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(n/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,n=-r/2;t<e.length;t++){const r=e[t].height+n+i(t);l.push(r),n=r+s(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(e){const{angleKey:t,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:r}=this.properties,{sectorLabel:n,calloutLabel:o,legendItem:a}=e;return r&&void 0!==a?a.text:i&&i!==t&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==t&&void 0!==(null==n?void 0:n.text)?n.text:void 0}pickNodeClosestDatum(e){return Pg(this,e)}getTooltipHtml(e){var t;if(!this.properties.isValid())return tl;const{datum:i,angleValue:s,sectorFormat:{fill:r},itemId:n}=e,o=Nu(null==(t=this.properties.title)?void 0:t.text),a=ze(s)?$s(s):String(s),l=this.getDatumLegendName(e);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${a}`:a,backgroundColor:r},{datum:i,itemId:n,title:o,color:r,seriesId:this.id,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey})}getLegendData(e){var t,i,s,r,n;const{visible:o,processedData:a,dataModel:l}=this;if(!l||!(null==a?void 0:a.data.length)||"category"!==e)return[];const{angleKey:c,calloutLabelKey:h,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||h&&h!==c||d&&d!==c))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),f=(null==(t=this.properties.title)?void 0:t.showInLegend)&&this.properties.title.text,y=[];for(let e=0;e<a.data.length;e++){const{datum:t,values:l}=a.data[e],v=[];f&&v.push(f);const C=this.getLabels(t,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==C.legendItem?v.push(C.legendItem.text):h&&h!==c&&void 0!==(null==(i=C.calloutLabel)?void 0:i.text)?v.push(null==(s=C.calloutLabel)?void 0:s.text):d&&d!==c&&void 0!==(null==(r=C.sectorLabel)?void 0:r.text)&&v.push(null==(n=C.sectorLabel)?void 0:n.text),0===v.length)continue;const b=this.getSectorFormat(t,e,!1);y.push({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:o&&this.seriesItemEnabled[e],label:{text:v.join(" - ")},marker:{fill:b.fill,stroke:b.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?t[u]:void 0})}return y}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendItemName:r}=e;s.id===this.id?this.toggleSeriesItem(i,t):null!=r&&this.toggleOtherSeriesItems(r,t)}toggleSeriesItem(e,t){this.seriesItemEnabled[e]=t,this.nodeDataRefresh=!0}toggleOtherSeriesItems(e,t){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},r)=>{i[s]===e&&this.toggleSeriesItem(r,t)})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Ig(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Ir(this.id,"nodes",t,[this.itemSelection,this.highlightSelection],i.nodes),Ir(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),_u(this,"callout",t,this.calloutLabelSelection),_u(this,"sector",t,this.sectorLabelSelection),_u(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var e,t,i,s,r,n;const{itemSelection:o,highlightSelection:a,processedData:l,radiusScale:c,previousRadiusScale:h}=this,{animationManager:d}=this.ctx,u=null==(e=null==l?void 0:l.reduced)?void 0:e.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(t=null==u?void 0:u.moved.size)?t:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(n=null==(r=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:r.uniqueKeys)||n;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const f=Ig(!1,this.properties.rotation,c,h);Ir(this.id,"nodes",d,[o,a],f.nodes,(e,t)=>this.getDatumId(t),u),Ir(this.id,"innerCircle",d,[this.innerCircleSelection],f.innerCircle),_u(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),_u(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),_u(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,radiusScale:i,previousRadiusScale:s}=this,{animationManager:r}=this.ctx,n=Ig(!1,this.properties.rotation,i,s);Ir(this.id,"nodes",r,[e,t],n.nodes),Ir(this.id,"innerCircle",r,[this.innerCircleSelection],n.innerCircle),Ou(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ou(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Ou(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(e){var t,i,s;const{calloutLabelKey:r,sectorLabelKey:n,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?e[o]:r?e[r]:n?e[n]:void 0}getDatumId(e){const{index:t}=e,i=this.getDatumIdFromData(e.datum);return null!=i?String(i):`${t}`}onDataChange(){var e;const{data:t,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(e=null==t?void 0:t.map((e,t)=>{var s;return null==(s=i[t])||s}))?e:[]}computeFocusBounds(e){return kg(this,e)}};$g.className="PieSeries",$g.type="pie";var Yg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",instanceConstructor:$g,themeTemplate:Og,paletteFactory:Fg},qg=["start","center","end"],Xg=["annotations","ranges","zoom"],Zg=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e.FloatingTop="floating-top",e.FloatingBottom="floating-bottom",e))(Zg||{}),Qg=Object.values(Zg),Jg=class extends yt{constructor(e,t){super(),this.onChange=e,this.onButtonsChange=t,this.align="start",this.position="top"}};C([Xa(e=>{e.onChange(e.enabled)}),jr(Zr)],Jg.prototype,"enabled",2),C([Xa(e=>{e.onChange(e.enabled)}),jr(On(["start","center","end"]),{optional:!0})],Jg.prototype,"align",2),C([Xa(e=>{e.onChange(e.enabled)}),jr(On(["top","right","bottom","left","floating-top","floating-bottom"]),{optional:!0})],Jg.prototype,"position",2),C([Xa(e=>{e.onButtonsChange(e.buttons)}),jr(an,{optional:!0})],Jg.prototype,"buttons",2);var em="ag-charts-toolbar",tm={align:`${em}__align`,button:`${em}__button`,icon:`${em}__icon`,label:`${em}__label`},im={top:`${em}--top`,right:`${em}--right`,bottom:`${em}--bottom`,left:`${em}--left`,"floating-top":`${em}--floating-top`,"floating-bottom":`${em}--floating-bottom`,hidden:`${em}--hidden`,preventFlash:`${em}--prevent-flash`,floatingHidden:`${em}--floating-hidden`,align:{start:`${tm.align}--start`,center:`${tm.align}--center`,end:`${tm.align}--end`},button:{hidden:`${tm.button}--hidden`}},sm=`\n.${em} {\n    align-items: center;\n    background: var(--ag-charts-toolbar-background-color);\n    border-bottom: var(--ag-charts-toolbar-border-critical);\n    border-top: var(--ag-charts-toolbar-border-critical);\n    border-left: var(--ag-charts-toolbar-border);\n    border-right: var(--ag-charts-toolbar-border);\n    display: flex;\n    flex-wrap: nowrap;\n    opacity: 1;\n    position: absolute;\n    transform: translateY(0);\n    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.${im.hidden},\n.${im.preventFlash} {\n    visibility: hidden;\n}\n\n.${im.floatingHidden} {\n    opacity: 0;\n    transition: opacity 0.4s ease-in-out;\n}\n\n.${im.top},\n.${im.bottom} {\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    padding: 0 var(--ag-charts-toolbar-padding);\n    width: 100%;\n}\n\n.${im.left},\n.${im.right} {\n    flex-direction: column;\n    padding: var(--ag-charts-toolbar-padding) 0;\n    width: var(--ag-charts-toolbar-size);\n}\n\n.${im["floating-top"]},\n.${im["floating-bottom"]} {\n    background: none;\n    border: none;\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    overflow: hidden;\n    padding: 0 var(--ag-charts-toolbar-padding);\n    pointer-events: none;\n    width: 100%;\n}\n\n.${tm.align} {\n    display: flex;\n    flex-direction: inherit;\n    flex-wrap: inherit;\n    max-width: 100%;\n}\n\n.${im.align.center},\n.${im.align.end} {\n    margin-left: auto;\n}\n\n.${im.left} .${im.align.center},\n.${im.left} .${im.align.end},\n.${im.right} .${im.align.center},\n.${im.right} .${im.align.end} {\n    margin-left: 0;\n    margin-top: auto;\n}\n\n.${im["floating-top"]} .${tm.align},\n.${im["floating-bottom"]} .${tm.align} {\n    gap: var(--ag-charts-toolbar-gap);\n    transition: transform 0.4s ease-in-out;\n}\n\n.${tm.button} {\n    align-items: center;\n    border-radius: var(--ag-charts-button-radius);\n    color: var(--ag-charts-toolbar-foreground-color);\n    display: flex;\n    font-size: 14px;\n    font-weight: 500;\n    justify-content: center;\n    margin: 0;\n    padding: var(--ag-charts-button-padding);\n    pointer-events: all;\n    transition: background-color .25s ease-in-out;\n}\n\n.${im.left} .${tm.button},\n.${im.right} .${tm.button} {\n    height: var(--ag-charts-toolbar-size);\n    max-width: 100%;\n    overflow: hidden;\n}\n\n.${im["floating-top"]} .${tm.button},\n.${im["floating-bottom"]} .${tm.button} {\n    background: var(--ag-charts-toolbar-background-color);\n    border: var(--ag-charts-toolbar-border-critical);\n}\n\n.${im.button.hidden} {\n    display: none;\n}\n\n.${tm.button}:hover {\n    background: var(--ag-charts-toolbar-hover-color);\n}\n\n.${tm.button}:disabled {\n    background: var(--ag-charts-toolbar-disabled-background-color);\n    color: var(--ag-charts-toolbar-disabled-foreground-color);\n}\n\n.${tm.button}:not([disabled]) {\n    cursor: pointer;\n}\n\n.${tm.icon} {\n    height: 1.2em;\n    width: 1.2em;\n}\n\n.${tm.icon} + .${tm.label} {\n    margin-left: var(--ag-charts-size);\n}\n\n.${tm.icon},\n.${tm.label} {\n    pointer-events: none;\n}\n\n`,rm=class extends Se{constructor(e){super(),this.ctx=e,this.enabled=!0,this.annotations=new Jg(this.onGroupChanged.bind(this,"annotations"),this.onGroupButtonsChanged.bind(this,"annotations")),this.ranges=new Jg(this.onGroupChanged.bind(this,"ranges"),this.onGroupButtonsChanged.bind(this,"ranges")),this.zoom=new Jg(this.onGroupChanged.bind(this,"zoom"),this.onGroupButtonsChanged.bind(this,"zoom")),this.margin=10,this.floatingDetectionRange=28,this.positions={top:new Set,right:new Set,bottom:new Set,left:new Set,"floating-top":new Set,"floating-bottom":new Set},this.positionAlignments={top:{},right:{},bottom:{},left:{},"floating-top":{},"floating-bottom":{}},this.groupCallers={annotations:0,ranges:0,zoom:0},this.groupButtons={annotations:[],ranges:[],zoom:[]},this.pendingButtonToggledEvents=[],this.groupProxied=new Set,this.container=e.toolbarManager.element,this.elements={top:this.container.appendChild(ws("div")),right:this.container.appendChild(ws("div")),bottom:this.container.appendChild(ws("div")),left:this.container.appendChild(ws("div")),"floating-top":this.container.appendChild(ws("div")),"floating-bottom":this.container.appendChild(ws("div"))},Es(sm,em),this.renderToolbar("top"),this.renderToolbar("right"),this.renderToolbar("bottom"),this.renderToolbar("left"),this.renderToolbar("floating-top"),this.renderToolbar("floating-bottom"),this.toggleVisibilities(),this.destroyFns.push(e.interactionManager.addListener("hover",this.onHover.bind(this),31),e.interactionManager.addListener("leave",this.onLeave.bind(this),31),e.toolbarManager.addListener("button-toggled",this.onButtonToggled.bind(this)),e.toolbarManager.addListener("group-toggled",this.onGroupToggled.bind(this)),e.toolbarManager.addListener("proxy-group-options",this.onProxyGroupOptions.bind(this)),e.layoutService.addListener("layout-complete",this.onLayoutComplete.bind(this)),()=>this.destroyElements())}destroyElements(){for(const e of Object.values(this.elements))e.remove()}onHover(e){const{enabled:t,elements:i,floatingDetectionRange:s,ctx:{scene:r}}=this,{offsetY:n,sourceEvent:{target:o}}=e,{FloatingBottom:a,FloatingTop:l}=Zg;if(!t)return;const c=i[a],h=i[l],d=n>c.offsetTop-s&&n<r.canvas.element.offsetHeight||o===c,u=h.offsetTop+h.offsetHeight+s,p=n>0&&n<u||o===h;c.classList.toggle(im.floatingHidden,!d),h.classList.toggle(im.floatingHidden,!p),this.translateFloatingElements(a,d),this.translateFloatingElements(l,p)}onLeave(e){const{enabled:t,elements:i,ctx:{scene:s}}=this,{relatedTarget:r,target:n}=e.sourceEvent,{FloatingBottom:o,FloatingTop:a}=Zg;t&&n===s.canvas.element&&(Xg.some(e=>this.groupButtons[e].some(e=>e===r))||(i[o].classList.add(im.floatingHidden),i[a].classList.add(im.floatingHidden),this.translateFloatingElements(o,!1),this.translateFloatingElements(a,!1)))}onGroupChanged(e){null==this[e]||this.groupProxied.has(e)||(this.createGroup(e),this.toggleVisibilities())}onGroupButtonsChanged(e,t){this.enabled&&!this.groupProxied.has(e)&&(this.createGroupButtons(e,t),this.toggleVisibilities())}onLayoutComplete(){for(const e of Qg)this.elements[e].classList.remove(im.preventFlash)}onButtonToggled(e){const{group:t,value:i,enabled:s}=e;if(0!==this.groupButtons[t].length)for(const e of this.groupButtons[t])e.dataset.toolbarValue===`${i}`&&(e.disabled=!s);else this.pendingButtonToggledEvents.push(e)}onGroupToggled(e){const{group:t,visible:i}=e;this.toggleGroup(t,i),this.toggleVisibilities()}onProxyGroupOptions(e){const{group:t,options:i}=e;this.groupProxied.add(t),this.createGroup(t,i.enabled,i.position),this.createGroupButtons(t,i.buttons),this.toggleGroup(t,i.enabled),this[t].set(i)}createGroup(e,t,i){null!=t||(t=this[e].enabled),null!=i||(i=this[e].position);for(const s of Qg)t&&i===s?this.positions[s].add(e):this.positions[s].delete(e)}createGroupButtons(e,t){var i,s;for(const t of this.groupButtons[e])t.remove();this.groupButtons[e]=[];const r=null!=(i=this[e].align)?i:"start",n=null!=(s=this[e].position)?s:"top",o=this.positionAlignments[n][r];for(const i of null!=t?t:[]){const t=this.createButtonElement(e,i);null==o||o.appendChild(t),this.groupButtons[e].push(t)}}toggleGroup(e,t){t?this.groupCallers[e]+=1:this.groupCallers[e]=Math.max(0,this.groupCallers[e]-1)}processPendingEvents(){var e;const t=(null!=(e=this.pendingButtonToggledEvents)?e:[]).slice();for(const e of t)this.onButtonToggled(e);this.pendingButtonToggledEvents=[]}performLayout(e){return S(this,arguments,function*({shrinkRect:e}){const{elements:t,margin:i}=this;return t.top.classList.contains(im.hidden)||e.shrink(t.top.offsetHeight+2*i,"top"),t.right.classList.contains(im.hidden)||e.shrink(t.right.offsetWidth+i,"right"),t.bottom.classList.contains(im.hidden)||e.shrink(t.bottom.offsetHeight+2*i,"bottom"),t.left.classList.contains(im.hidden)||e.shrink(t.left.offsetWidth+i,"left"),{shrinkRect:e}})}performCartesianLayout(e){return S(this,null,function*(){const{elements:t,margin:i}=this,{seriesRect:s}=e,{FloatingBottom:r,FloatingTop:n}=Zg;t.top.style.top=s.y-t.top.offsetHeight-2*i+"px",t.top.style.left=`${i}px`,t.top.style.width=`calc(100% - ${2*i}px)`,t.right.style.top=`${s.y+i}px`,t.right.style.right=`${i}px`,t.right.style.height=`calc(100% - ${s.y+2*i}px)`,t.bottom.style.bottom=`${i}px`,t.bottom.style.left=`${i}px`,t.bottom.style.width=`calc(100% - ${2*i}px)`,t.left.style.top=`${s.y}px`,t.left.style.left=`${i}px`,t.left.style.height=`calc(100% - ${s.y+2*i}px)`,t[n].style.top=`${s.y}px`,t[n].style.paddingTop=`${i}px`,t[r].style.top=s.y+s.height-t[r].offsetHeight+"px",t[r].style.paddingBottom=`${i}px`})}toggleVisibilities(){var e;if(null==this.elements)return;const t=e=>this[e].enabled&&this.groupCallers[e]>0,i=e=>t=>"string"!=typeof t.value&&"number"!=typeof t.value||`${t.value}`===e.dataset.toolbarValue;for(const e of Qg){const i=this.enabled&&Array.from(this.positions[e].values()).some(t);this.elements[e].classList.toggle(im.hidden,!i)}for(const s of Xg){if(null==this[s])continue;const r=t(s);for(const t of this.groupButtons[s]){const n=r&&(null==(e=this[s].buttons)?void 0:e.some(i(t)));t.classList.toggle(im.button.hidden,!n)}}}translateFloatingElements(e,t){const{elements:i,margin:s,positionAlignments:r}=this,n=i[e],o=Object.values(r[e]);for(const e of o)e.style.transform=t&&""!==e.style.transform?"translateY(0)":`translateY(${n.offsetHeight+s}px)`}renderToolbar(e="top"){const t=this.elements[e];t.classList.add(em,im[e],im.preventFlash),"floating-top"!==e&&"floating-bottom"!==e||t.classList.add(im.floatingHidden);for(const i of qg){const s=ws("div");s.classList.add(tm.align,im.align[i]),t.appendChild(s),this.positionAlignments[e][i]=s}}createButtonElement(e,t){const i=ws("button");i.classList.add(tm.button),i.dataset.toolbarGroup=e,i.tabIndex=-1,"string"!=typeof t.value&&"number"!=typeof t.value||(i.dataset.toolbarValue=`${t.value}`),t.tooltip&&(i.title=t.tooltip);let s="";return null!=t.icon&&(s=`<span class="ag-charts-icon-${t.icon} ${tm.icon}"></span>`),null!=t.label&&(s=`${s}<span class="${tm.label}">${t.label}</span>`),i.innerHTML=s,i.onclick=this.onButtonPress.bind(this,e,t.value),this.destroyFns.push(()=>i.remove()),i}onButtonPress(e,t){this.ctx.toolbarManager.pressButton(e,t)}};C([Xa(e=>{e.processPendingEvents(),e.toggleVisibilities()}),jr(Zr)],rm.prototype,"enabled",2);var nm=864e5,om=30*nm,am={type:"root",optionsKey:"toolbar",packageType:"community",chartTypes:["cartesian"],instanceConstructor:rm,themeTemplate:{toolbar:{enabled:!0,annotations:{enabled:!1,position:"left",align:"start",buttons:[{label:"Li",value:"line"},{label:"PCh",value:"parallel-channel"}]},ranges:{enabled:!1,position:"top",align:"start",buttons:[{label:"1m",value:om},{label:"3m",value:3*om},{label:"6m",value:6*om},{label:"YTD",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"1y",value:365*nm},{label:"All",value:(e,t)=>[e,t]}]},zoom:{enabled:!1,position:"top",align:"end",buttons:[{icon:"zoom-out",tooltip:"Zoom out",value:"zoom-out"},{icon:"zoom-in",tooltip:"Zoom in",value:"zoom-in"},{icon:"pan-left",tooltip:"Pan left",value:"pan-left"},{icon:"pan-right",tooltip:"Pan right",value:"pan-right"},{icon:"pan-start",tooltip:"Pan to the start",value:"pan-start"},{icon:"pan-end",tooltip:"Pan to the end",value:"pan-end"},{icon:"reset",tooltip:"Reset the zoom",value:"reset"}]}}}};var lm=class e extends rd{constructor(e,t){super(e,t)}performLayout(){return S(this,null,function*(){const t=yield b(e.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:r,highlightRoot:n}=this,o=t.clone();t.shrink(i.left,"left"),t.shrink(i.top,"top"),t.shrink(i.right,"right"),t.shrink(i.bottom,"bottom"),this.seriesRect=t,this.animationRect=t,this.hoverRect=t;for(const e of[s,r,n])e.translationX=Math.floor(t.x),e.translationY=Math.floor(t.y);return yield Promise.all(this.series.map(e=>S(this,null,function*(){yield e.update({seriesRect:t})}))),s.visible=this.series[0].visible,s.setClipRectInGroupCoordinateSpace(new Js(t.x,t.y,t.width,t.height)),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:t,visible:!0},axes:[]}),t})}};lm.className="HierarchyChart",lm.type="hierarchy";var cm=lm,hm=class extends wl{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}computeLabelsBBox(e,t){return null}};C([jr(On(["polygon","circle"],"a polar axis shape"))],hm.prototype,"shape",2),C([jr(rn)],hm.prototype,"innerRadiusRatio",2);var dm=class e extends rd{constructor(e,t){super(e,t),this.padding=new Zl(40),this.axisGroup.zIndex=6}performLayout(){return S(this,null,function*(){const t=yield b(e.prototype,this,"performLayout").call(this),i=t.clone();return this.computeSeriesRect(t),yield this.computeCircle(t),this.axes.forEach(e=>e.update()),this.hoverRect=t,this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:i,paddedRect:t,visible:!0},axes:[]}),t})}updateAxes(e,t,i){var s,r;const n=this.axes.find(e=>"x"===e.direction),o=this.axes.find(e=>"y"===e.direction);if(!(n instanceof hm&&o instanceof hm))return;const a=n.scale,l=null==(s=a.ticks)?void 0:s.call(a).map(e=>a.convert(e)),c=o.innerRadiusRatio;n.innerRadiusRatio=c,null==(r=n.computeRange)||r.call(n),n.gridLength=i,o.gridAngles=l,o.gridRange=n.range,o.range=[i,i*c],[n,o].forEach(i=>{i.translation.x=e,i.translation.y=t,i.calculateLayout()})}computeSeriesRect(e){const{seriesArea:{padding:t}}=this;e.shrink(t.left,"left"),e.shrink(t.top,"top"),e.shrink(t.right,"right"),e.shrink(t.bottom,"bottom"),this.seriesRect=e,this.animationRect=e}computeCircle(e){return S(this,null,function*(){const t=this.series.filter(e=>e instanceof Lg),i=this.axes.filter(e=>e instanceof hm),s=(e,i,s)=>{this.updateAxes(e,i,s),t.forEach(t=>{t.centerX=e,t.centerY=i,t.radius=s});const r=t.filter(e=>e instanceof $g||e instanceof _g);if(r.length>1){const e=r.map(e=>{const t=e.getInnerRadius();return{series:e,innerRadius:t}}).sort((e,t)=>e.innerRadius-t.innerRadius);e.at(-1).series.surroundingRadius=void 0;for(let t=0;t<e.length-1;t++)e[t].series.surroundingRadius=e[t+1].innerRadius}},r=e.x+e.width/2,n=e.y+e.height/2,o=Math.max(0,Math.min(e.width,e.height)/2);let a=o;s(r,n,a);const l=(...l)=>S(this,[...l],function*({hideWhenNecessary:l=!1}={}){const c=[];for(const s of[...i,...t]){const t=yield s.computeLabelsBBox({hideWhenNecessary:l},e);t&&c.push(t)}if(0===c.length)return void s(r,n,o);const h=Js.merge(c),d=this.refineCircle(h,a,e);s(d.centerX,d.centerY,d.radius),d.radius!==a&&(a=d.radius)});return yield l(),yield l(),yield l(),yield l({hideWhenNecessary:!0}),yield l({hideWhenNecessary:!0}),{radius:a,centerX:r,centerY:n}})}refineCircle(e,t,i){const s=-t,r=-t,n=t,o=t;let a=Math.max(0,s-e.x),l=Math.max(0,r-e.y),c=Math.max(0,e.x+e.width-n),h=Math.max(0,e.y+e.height-o);a=c=Math.max(a,c),l=h=Math.max(l,h);const d=i.width-a-c,u=i.height-l-h;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,f=Math.min(g,m);if(p<f){p=f;const e=a+c;if(2*p+(l+h)>i.height){const e=i.height-2*p;2*Math.min(l,h)>e?(l=e/2,h=e/2):l>h?l=e-h:h=e-l}if(2*p+e>i.width){const e=i.width-2*p;2*Math.min(a,c)>e?(a=e/2,c=e/2):a>c?a=e-c:c=e-a}}const y=a+2*p+c,v=l+2*p+h;return{centerX:i.x+(i.width-y)/2+a+p,centerY:i.y+(i.height-v)/2+l+p,radius:p}}};dm.className="PolarChart",dm.type="polar";var um=dm,pm=Math.PI/180,gm=e=>e*pm,mm=e=>-Math.log(Math.tan(.25*Math.PI+e*pm*.5)),fm=e=>e/pm,ym=e=>(Math.atan(Math.exp(-e))-.25*Math.PI)/(.5*pm),vm=class e{constructor(t,i){this.domain=t,this.range=i,this.type="mercator",this.bounds=e.bounds(t)}static bounds(e){const[[t,i],[s,r]]=e,n=gm(t),o=mm(i),a=gm(s),l=mm(r);return new Js(Math.min(n,a),Math.min(o,l),Math.abs(a-n),Math.abs(l-o))}static fixedScale(){return new e([[fm(0),ym(0)],[fm(1),ym(1)]],[[0,0],[1,1]])}convert([e,t]){const[[i,s],[r,n]]=this.range,o=(r-i)/this.bounds.width,a=(n-s)/this.bounds.height;return[(gm(e)-this.bounds.x)*o+i,(mm(t)-this.bounds.y)*a+s]}invert([e,t]){const[[i,s],[r,n]]=this.range,o=(r-i)/this.bounds.width,a=(n-s)/this.bounds.height;return[fm((e-i)/o+this.bounds.x),ym((t-s)/a+this.bounds.y)]}};function Cm(e){return"map-shape"===e.type||"map-line"===e.type||"map-marker"===e.type||"map-shape-background"===e.type||"map-line-background"===e.type}var bm=class e extends rd{constructor(e,t){super(e,t),this.xAxis=new Qd(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Qd(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}updateData(){return S(this,null,function*(){yield b(e.prototype,this,"updateData").call(this);const{topology:t}=this.getOptions();this.series.forEach(e=>{Cm(e)&&e.setChartTopology(t)})})}performLayout(){return S(this,null,function*(){const t=yield b(e.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:r,highlightRoot:n}=this,o=t.clone();t.shrink(i.left,"left"),t.shrink(i.top,"top"),t.shrink(i.right,"right"),t.shrink(i.bottom,"bottom"),this.seriesRect=t,this.animationRect=t,this.hoverRect=t;const a=this.series.filter(Cm),l=a.reduce((e,t)=>{if(!t.visible)return e;const i=t.topologyBounds;return null==i?e:null==e?i:(e.merge(i),e)},void 0);let c;if(null!=l){const{lon0:e,lat0:i,lon1:s,lat1:r}=l,n=[[e,i],[s,r]],o=vm.bounds(n),{width:a,height:h}=t,d=Math.min(a/o.width,h/o.height),u=o.width*d,p=o.height*d,g=(a-u)/2,m=(h-p)/2,f=g,y=m,v=g+u,C=m+p,b=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),S=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),w=(v-f)/(b.max-b.min),x=f-w*b.min,E=(C-y)/(1-S.min-(1-S.max)),M=y-E*(1-S.max);c=new vm(n,[[x,M],[x+w,M+E]])}a.forEach(e=>{e.scale=c});const h=this.series.some(e=>e.visible);s.visible=h;for(const e of[s,r,n])e.translationX=Math.floor(t.x),e.translationY=Math.floor(t.y),e.setClipRectInGroupCoordinateSpace(new Js(t.x,t.y,t.width,t.height));return this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:t,visible:h},axes:[]}),t})}};bm.className="TopologyChart",bm.type="topology";var Sm=bm,wm=Ds.create(!0,"opts");function xm(e){if(ut(e))return"cartesian";if(pt(e))return"polar";if(gt(e))return"hierarchy";if(mt(e))return"topology";throw new Error(`AG Chart - unknown type of chart for options with type: ${e.type}`)}var Em=class e{static licenseCheck(e){var t,i,s,r;this.licenseChecked||(this.licenseManager=null==(i=(t=be).licenseManager)?void 0:i.call(t,e),null==(s=this.licenseManager)||s.setLicenseKey(this.licenseKey,this.gridContext),null==(r=this.licenseManager)||r.validateLicense(),this.licenseChecked=!0)}static setLicenseKey(e){this.licenseKey=e}static setGridContext(e){this.gridContext=e}static getLicenseDetails(e){var t,i;return null==(i=(t=be).licenseManager)?void 0:i.call(t,{}).getLicenseDetails(e)}static getInstance(e){return Dm.getInstance(e)}static create(e){var t,i,s;this.licenseCheck(e);const r=Dm.createOrUpdate(e);return(null==(t=this.licenseManager)?void 0:t.isDisplayWatermark())&&(null==(s=(i=be).injectWatermark)||s.call(i,r.chart.element,this.licenseManager.getWatermarkMessage())),r}static update(t,i){if(!qd.isInstance(t))throw new Error(e.INVALID_CHART_REF_MESSAGE);Dm.createOrUpdate(i,t)}static updateDelta(t,i){if(!qd.isInstance(t))throw new Error(e.INVALID_CHART_REF_MESSAGE);Dm.updateUserDelta(t,i)}static download(t,i){if(!(t instanceof qd))throw new Error(e.INVALID_CHART_REF_MESSAGE);Dm.download(t,i).catch(e=>N.errorOnce(e))}static getImageDataURL(t,i){if(!(t instanceof qd))throw new Error(e.INVALID_CHART_REF_MESSAGE);return Dm.getImageDataURL(t,i)}};Em.INVALID_CHART_REF_MESSAGE="AG Charts - invalid chart reference passed",Em.licenseChecked=!1,Em.gridContext=!1;var Mm=Em,Am=class{static warnDeprecated(e){Ps()(`AgChart.${e}`,`Use AgCharts.${e} instead`)}static create(e){return this.warnDeprecated("create"),Mm.create(e)}static update(e,t){return this.warnDeprecated("update"),Mm.update(e,t)}static updateDelta(e,t){return this.warnDeprecated("updateDelta"),Mm.updateDelta(e,t)}static download(e,t){return this.warnDeprecated("download"),Mm.download(e,t)}static getImageDataURL(e,t){return this.warnDeprecated("getImageDataURL"),Mm.getImageDataURL(e,t)}},Tm=class e{static getInstance(e){const t=rd.getInstance(e);return t?qd.chartInstances.get(t):void 0}static initialiseModules(){e.initialised||(function(){we.register(cu,Eu,Iu,am,Ap,Kp,eg,og,hg,Gg,Yg,sg);for(const e of[Qd,Tl,iu,Gl,eu])xe.register(e.type,{instanceConstructor:e,hidden:e===Gl})}(),function(){for(const e of we.modules){if("enterprise"!==e.packageType||ht(e)||N.errorOnce("Unexpected enterprise module registered: "+e.identifier),"root"===e.type&&e.themeTemplate)for(const t of e.chartTypes)at.set(t,e.themeTemplate);if("series"===e.type){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);Dt.register(e.identifier,e)}if("series-option"===e.type&&e.themeTemplate)for(const t of e.seriesTypes)Dt.setThemeTemplate(t,e.themeTemplate);if("axis-option"===e.type&&e.themeTemplate)for(const t of e.axisTypes){const i=e.themeTemplate[t],s=m(m({},e.themeTemplate),i);for(const t of e.axisTypes)delete s[t];xe.setThemeTemplate(t,s)}"axis"===e.type&&xe.register(e.identifier,e),"legend"===e.type&&It.register(e.identifier,e)}if(we.hasEnterpriseModules()){const e=lt.filter(({useCount:e})=>null==e||0===e);e.length>0&&N.errorOnce("Enterprise modules expected but not registered: ",e)}}(),e.initialised=!0)}static createOrUpdate(t,i){e.initialiseModules(),wm(">>> AgChartV2.createOrUpdate() user options",t);const s=t,{overrideDevicePixelRatio:r,document:n,window:o}=s,a=y(s,["overrideDevicePixelRatio","document","window"]),l=new Rs(a,{overrideDevicePixelRatio:r,document:n,window:o});let c=null==i?void 0:i.chart;return null!=c&&xm(a)===xm(c.processedOptions)||(c=e.createChartInstance(l,c)),null==i?i=new qd(c):i.chart=c,wm.check()&&"undefined"!=typeof window&&(null!=window.agChartInstances||(window.agChartInstances={}),window.agChartInstances[c.id]=c),c.queuedUserOptions.push(a),c.requestFactoryUpdate(e=>{e.applyOptions(l),e.queuedUserOptions.splice(0,e.queuedUserOptions.indexOf(a))}),i}static updateUserDelta(t,i){Et(i=wt(i,{shallow:["data"]}),e=>{if("object"==typeof e)for(const[t,i]of Object.entries(e))void 0===i&&Object.assign(e,{[t]:Symbol("UNSET")})},{skip:["data"]});const{chart:s}=t,r=s.getOptions(),n=qe(i,r);wm(">>> AgChartV2.updateUserDelta() user delta",i),wm("AgChartV2.updateUserDelta() - base options",r),e.createOrUpdate(n,t)}static download(t,i){return S(this,null,function*(){try{const s=yield e.prepareResizedChart(t,i);s.chart.ctx.scene.download(null==i?void 0:i.fileName,null==i?void 0:i.fileFormat),s.destroy()}catch(e){N.errorOnce(e)}})}static getImageDataURL(t,i){return S(this,null,function*(){const s=yield e.prepareResizedChart(t,i),r=s.chart.ctx.scene.getDataURL(null==i?void 0:i.fileFormat);return s.destroy(),r})}static prepareResizedChart(t){return S(this,arguments,function*({chart:t},i={}){var s,r,n,o;const a=null!=(r=null!=(s=i.width)?s:t.width)?r:t.ctx.scene.canvas.width,l=null!=(o=null!=(n=i.height)?n:t.height)?o:t.ctx.scene.canvas.height,c=qe({container:document.createElement("div"),overrideDevicePixelRatio:1,autoSize:!1,width:a,height:l},we.hasEnterpriseModules()&&{animation:{enabled:!1}},t.userOptions),h=e.createOrUpdate(c);return h.chart.ctx.zoomManager.updateZoom("agChartV2",t.ctx.zoomManager.getZoom()),t.series.forEach((e,t)=>{e.visible||(h.chart.series[t].visible=!1)}),t.update(0,{forceNodeDataRefresh:!0}),yield h.chart.waitForUpdate(),h})}static createChartInstance(t,i){const s=null==i?void 0:i.destroy({keepTransferableResources:!0});return new(e.getChartByOptions(t.processedOptions))(t,s)}static getChartByOptions(e){if(ut(e))return $d;if(gt(e))return cm;if(pt(e))return um;if(mt(e))return Sm;throw new Error("AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified")}};Tm.initialised=!1;var Dm=Tm,Im="9.3.2",Rm={};v(Rm,{Arc:()=>Pm,BBox:()=>Js,BandScale:()=>zr,Caption:()=>ol,ChangeDetectableProperties:()=>Gu,Circle:()=>yd,ContinuousScale:()=>qn,Diamond:()=>Sd,DropShadow:()=>Bu,ExtendedPath2D:()=>cd,Group:()=>xo,HdpiCanvas:()=>Vl,Image:()=>Om,Label:()=>Bo,Line:()=>Ga,LinearGradientFill:()=>km,LinearScale:()=>Xd,Marker:()=>fd,Node:()=>lr,OrdinalTimeScale:()=>vo,Path:()=>dd,PointerEvents:()=>or,RadialColumnShape:()=>Nm,Rect:()=>au,RedrawType:()=>er,Scene:()=>$l,SceneChangeDetection:()=>ir,ScenePathChangeDetection:()=>hd,Sector:()=>Sg,SectorBox:()=>dg,Selection:()=>Na,Shape:()=>Do,Square:()=>Ad,Text:()=>Oo,Tooltip:()=>nl,Triangle:()=>Id,easing:()=>gr,getFont:()=>Go,getMarker:()=>Ld,getRadialColumnWidth:()=>_m,motion:()=>Fm,nearestSquared:()=>Xs,nearestSquaredInContainer:()=>Zs,toRadians:()=>Fr,toTooltipHtml:()=>sl});var Pm=class extends dd{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return Ws(Lr(this.startAngle),Lr(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?e.closePath():2!==this.type||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new Js(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(e,t){const i=this.transformPoint(e,t),s=this.computeBBox();return 0!==this.type&&s.containsPoint(i.x,i.y)&&this.path.isPointInPath(i.x,i.y)}};Pm.className="Arc",Pm.defaultStyles=Object.assign({},Do.defaultStyles,{lineWidth:1,fillStyle:null}),C([hd()],Pm.prototype,"centerX",2),C([hd()],Pm.prototype,"centerY",2),C([hd()],Pm.prototype,"radius",2),C([hd()],Pm.prototype,"startAngle",2),C([hd()],Pm.prototype,"endAngle",2),C([hd()],Pm.prototype,"counterClockwise",2),C([hd()],Pm.prototype,"type",2);var km=class extends Do{constructor(){super(...arguments),this.direction="to-right",this.stops=void 0,this._mask=void 0}get mask(){return this._mask}set mask(e){null!=this._mask&&this.removeChild(this._mask),null!=e&&this.appendChild(e),this._mask=e}isPointInPath(e,t){var i,s;return null!=(s=null==(i=this.mask)?void 0:i.isPointInPath(e,t))&&s}computeBBox(){var e;return null==(e=this.mask)?void 0:e.computeBBox()}render(e){const{mask:t,stops:i}=this,{ctx:s,devicePixelRatio:r}=e,n=1/r,o=null==t?void 0:t.computeTransformedBBox();if(null==t||null==i||null==o)return;t.dirtyPath&&(t.updatePath(),t.dirtyPath=!1),s.save(),s.clip(t.path.getPath2D()),s.setTransform(r,0,0,r,0,0);const a=Math.floor(o.x),l=Math.ceil(o.x+o.width),c=Math.floor(o.y),h=Math.ceil(o.y+o.height),d=new Yp,[u,p]="to-right"===this.direction?[a,l]:[c,h];if(d.domain=i.map((e,t)=>u+(p-u)*t/(i.length-1)),d.range=i,d.update(),"to-right"===this.direction){const e=h-c;for(let t=a;t<=l;t+=n)s.fillStyle=d.convert(t),s.fillRect(t,c,n,e)}else{const e=l-a;for(let t=c;t<=h;t+=n)s.fillStyle=d.convert(t),s.fillRect(a,t,e,n)}s.restore()}};function Lm(e,t,i){const s=Math.sqrt(p(e,2)+p(t,2)),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}C([ir({redraw:3})],km.prototype,"direction",2),C([ir({redraw:3})],km.prototype,"stops",2),C([ir({redraw:3})],km.prototype,"_mask",2);var Nm=class extends dd{constructor(){super(...arguments),this.borderPath=new cd,this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}getRotation(){const{startAngle:e,endAngle:t}=this;return Lr(e+Br(e,t)/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,r=-e/2,n=e/2,o=-i,a=-t,l=this.getRotation(),c=[[r,a],[r,o],[n,o],[n,a],[r,a]].map(([e,t])=>Lm(e,t,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.lineTo(c[0].x,c[0].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:r,axisOuterRadius:n,isRadiusAxisReversed:o}=this,a=Ws(s,r),l=Math.asin(e/2/s),c=this.getRotation(),h=(e,t)=>Lm(e,t,c),d=(e,t)=>Math.sqrt(p(e,2)+p(t,2)),u=(e,t)=>t>e?0:Math.sqrt(p(e,2)-p(t,2)),g=(e,t,i)=>i?e<t:e>t,m=a&&!isNaN(l)&&l<Math.PI/6;let f=-e/2,y=e/2;const v=-i,C=-s*(m?Math.cos(l):1),b=g(n,d(s,e/2),!o);if(b){const e=u(n,s);f=-e,y=e}t.clear(!0);const S=h(f,C);t.moveTo(S.x,S.y);const w=Ws(s,i),x=g(n,d(i,e/2),!o);if(w&&m)t.arc(0,0,s,Lr(-l-Math.PI/2)+c,Lr(l-Math.PI/2)+c,!1);else if(x){const s=-u(n,e/2),r=u(n,i);if(!b){const e=h(f,s);t.lineTo(e.x,e.y)}if(t.arc(0,0,n,Math.atan2(s,f)+c,Math.atan2(v,-r)+c,!1),!Ws(r,0)){const e=h(r,v);t.lineTo(e.x,e.y)}t.arc(0,0,n,Math.atan2(v,r)+c,Math.atan2(s,y)+c,!1)}else{const e=h(f,v),i=h(y,v);t.lineTo(e.x,e.y),t.lineTo(i.x,i.y)}const E=h(y,C);if(t.lineTo(E.x,E.y),m)t.arc(0,0,s,Lr(l-Math.PI/2)+c,Lr(-l-Math.PI/2)+c,!0);else{const e=h(f,C);t.lineTo(e.x,e.y)}t.closePath()}};function _m(e,t,i,s,r){const n=Br(e,t),o=n*(1-s)/2;if(e+=o,t-=o,n<.001)return 2*i*r;if(n>=2*Math.PI){const i=e+n/2;e=i-Math.PI,t=i+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),d=Math.floor(Math.sqrt(p(a-c,2)+p(l-h,2))),u=2*i*r;return Math.max(1,Math.min(u,d))}Nm.className="RadialColumnShape",C([hd()],Nm.prototype,"isBeveled",2),C([hd()],Nm.prototype,"columnWidth",2),C([hd()],Nm.prototype,"startAngle",2),C([hd()],Nm.prototype,"endAngle",2),C([hd()],Nm.prototype,"outerRadius",2),C([hd()],Nm.prototype,"innerRadius",2),C([hd()],Nm.prototype,"axisInnerRadius",2),C([hd()],Nm.prototype,"axisOuterRadius",2),C([hd()],Nm.prototype,"isRadiusAxisReversed",2);var Om=class extends lr{constructor(e){super(),this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1,this.sourceImage=e}render(e){const{ctx:t,forceRender:i,stats:s}=e;if(0===this.dirty&&!i)return void(s&&s.nodesSkipped++);this.computeTransformMatrix(),this.matrix.toContext(t);const r=this.sourceImage;t.globalAlpha=this.opacity,t.drawImage(r,0,0,r.width,r.height,this.x,this.y,this.width,this.height),super.render(e)}};C([ir({redraw:3})],Om.prototype,"x",2),C([ir({redraw:3})],Om.prototype,"y",2),C([ir({redraw:3})],Om.prototype,"width",2),C([ir({redraw:3})],Om.prototype,"height",2),C([ir({redraw:3})],Om.prototype,"opacity",2);var Fm=m(m({},Ns),ga),Gm={};v(Gm,{CARTESIAN_AXIS_TYPE:()=>Lt,ChartTheme:()=>vi,DEFAULT_ANNOTATION_BACKGROUND_FILL:()=>di,DEFAULT_ANNOTATION_HANDLE_FILL:()=>ui,DEFAULT_ANNOTATION_STROKE:()=>hi,DEFAULT_AXIS_GRID_COLOUR:()=>Xt,DEFAULT_AXIS_LINE_COLOUR:()=>Zt,DEFAULT_BACKGROUND_COLOUR:()=>Jt,DEFAULT_COLOURS:()=>ti,DEFAULT_CROSS_LINES_COLOUR:()=>Qt,DEFAULT_DIVERGING_SERIES_COLOUR_RANGE:()=>ai,DEFAULT_FONT_FAMILY:()=>jt,DEFAULT_HIERARCHY_FILLS:()=>li,DEFAULT_HIERARCHY_STROKES:()=>ci,DEFAULT_INSIDE_SERIES_LABEL_COLOUR:()=>Yt,DEFAULT_INVERTED_LABEL_COLOUR:()=>$t,DEFAULT_LABEL_COLOUR:()=>Kt,DEFAULT_MUTED_LABEL_COLOUR:()=>qt,DEFAULT_POLAR_SERIES_STROKE:()=>oi,DEFAULT_SHADOW_COLOUR:()=>ei,DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE:()=>ni,DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS:()=>si,DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS:()=>ii,DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS:()=>ri,EXTENDS_AXES_DEFAULTS:()=>Bt,EXTENDS_AXES_GRID_LINE_DEFAULTS:()=>Ut,EXTENDS_AXES_LINE_DEFAULTS:()=>Vt,EXTENDS_AXES_TICK_DEFAULTS:()=>Ht,EXTENDS_CARTESIAN_MARKER_DEFAULTS:()=>Wt,EXTENDS_SERIES_DEFAULTS:()=>zt,FONT_SIZE:()=>Rt,FONT_WEIGHT:()=>Pt,IS_DARK_THEME:()=>Gt,POLAR_AXIS_SHAPE:()=>_t,POLAR_AXIS_TYPE:()=>Nt,POSITION:()=>kt,getChartTheme:()=>os,markerPaletteFactory:()=>Pu,singleSeriesPaletteFactory:()=>Ru,themes:()=>Bm});var Bm=Ze(ns,e=>null==e?void 0:e()),Vm={};v(Vm,{BandScale:()=>zr,ColorScale:()=>Yp,ContinuousScale:()=>qn,Invalidating:()=>Hr,LinearScale:()=>Xd,OrdinalTimeScale:()=>vo,TimeScale:()=>fo});var Hm={};function Um(e,t){const i={};if(Array.isArray(t))for(let s=0;s<e.length;s++)i[`${e[s]}`]=t[s];else for(let s=0;s<e.length;s++)i[`${e[s]}`]=t;return i}v(Hm,{Color:()=>ur,Logger:()=>N,Padding:()=>Zl,angleBetween:()=>Br,areArrayItemsStrictlyEqual:()=>Wa,areArrayNumbersEqual:()=>ja,bifurcate:()=>ms,checkDatum:()=>$o,clamp:()=>Vs,clampArray:()=>Hs,countFractionDigits:()=>qs,createId:()=>Fs,deepClone:()=>wt,displacePointFromVector:()=>Vr,extent:()=>as,findMinMax:()=>Us,findRangeExtent:()=>zs,isBetweenAngles:()=>Or,isContinuous:()=>Ko,isDate:()=>_e,isDenseInterval:()=>go,isEqual:()=>Ws,isNegative:()=>js,isNumber:()=>ze,isNumberEqual:()=>Ws,isNumberObject:()=>jo,isString:()=>He,isStringObject:()=>Wo,jsonApply:()=>Mt,jsonDiff:()=>St,jsonWalk:()=>Et,mod:()=>Ys,normalisedExtent:()=>ls,normalisedExtentWithMetadata:()=>cs,normalizeAngle180:()=>_r,normalizeAngle360:()=>Lr,normalizeAngle360Inclusive:()=>Nr,range:()=>po,resetIds:()=>Os,round:()=>Ks,sanitizeHtml:()=>Nu,setAttribute:()=>Za,shallowClone:()=>xt,tickFormat:()=>Pa,tickStep:()=>uo,ticks:()=>co,toDegrees:()=>Gr,toFixed:()=>$s,toRadians:()=>Fr,transformIntegratedCategoryValue:()=>Yo,zipObject:()=>Um});var zm={};function Wm({defs:e,values:t,xAxis:i,yAxis:s}){if(!i||!s)throw new Error("Axes must be defined");const r={};for(const[n,{def:o}]of e)if(Object.hasOwn(t,n)){const{scale:e}="key"===o.type?i:s;r[n]=Math.round(e.convert(t[n]))}return r}v(zm,{AND:()=>$r,ARRAY:()=>an,ARRAY_OF:()=>ln,AbstractBarSeries:()=>Pp,AbstractBarSeriesProperties:()=>Rp,ActionOnSet:()=>qa,Animation:()=>Tr,AnimationManager:()=>yc,AreaSeriesTag:()=>Sp,Axis:()=>wl,AxisLabel:()=>hl,AxisTick:()=>Wn,BOOLEAN:()=>Zr,BOOLEAN_ARRAY:()=>yn,Background:()=>lu,BackgroundModule:()=>cu,BaseModuleInstance:()=>Se,BaseProperties:()=>yt,COLOR_STRING:()=>mn,COLOR_STRING_ARRAY:()=>fn,CartesianAxis:()=>Ml,CartesianSeries:()=>Wd,CartesianSeriesNodeEvent:()=>Ud,CartesianSeriesProperties:()=>zd,CategoryAxis:()=>Tl,CategoryAxisTick:()=>Al,ChartAxisDirection:()=>jn,ChartEventManager:()=>Cc,ChartOptions:()=>Rs,ChartUpdateType:()=>Vc,ContextMenuRegistry:()=>bc,CursorManager:()=>wc,DATE:()=>un,DATE_ARRAY:()=>bn,DATE_OR_DATETIME_MS:()=>pn,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Vd,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Hd,DEFAULT_TOOLTIP_CLASS:()=>Ja,DEFAULT_TOOLTIP_DARK_CLASS:()=>el,DEGREE:()=>nn,DIRECTION:()=>kn,DataController:()=>Jc,DataModel:()=>Zc,DataModelSeries:()=>Nd,DataService:()=>sc,Default:()=>Wr,Deprecated:()=>ks,DeprecatedAndRenamedTo:()=>Ls,EMPTY_TOOLTIP_CONTENT:()=>tl,FONT_STYLE:()=>An,FONT_WEIGHT:()=>Tn,FUNCTION:()=>Qr,GREATER_THAN:()=>dn,GestureDetector:()=>Ec,GroupedCategoryAxis:()=>Gl,HierarchyNode:()=>Km,HierarchySeries:()=>$m,HierarchySeriesProperties:()=>Ym,HighlightManager:()=>Mc,HighlightStyle:()=>Gd,INTERACTION_RANGE:()=>Nn,InteractionManager:()=>mc,InteractionState:()=>pc,LABEL_PLACEMENT:()=>_n,LESS_THAN:()=>hn,LINE_CAP:()=>wn,LINE_DASH:()=>En,LINE_JOIN:()=>xn,Layers:()=>zo,LayoutService:()=>Gc,LonLatBBox:()=>qm,MARKER_SHAPE:()=>Vu,MATCHING_CROSSLINE_TYPE:()=>qo,MAX_SPACING:()=>Gn,MIN_SPACING:()=>Fn,MercatorScale:()=>vm,Motion:()=>gr,NAN:()=>tn,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Dr,NUMBER:()=>en,NUMBER_ARRAY:()=>vn,NUMBER_OR_NAN:()=>on,Navigator:()=>Du,NavigatorModule:()=>Iu,OBJECT:()=>qr,OBJECT_ARRAY:()=>Sn,OR:()=>Yr,OVERFLOW_STRATEGY:()=>Pn,ObserveChanges:()=>Xa,PHASE_METADATA:()=>Er,PHASE_ORDER:()=>xr,PLACEMENT:()=>Ln,PLAIN_OBJECT:()=>Xr,POINTER_INTERACTION_TYPES:()=>lc,POSITION:()=>Mn,POSITIVE_NUMBER:()=>sn,PolarAxis:()=>hm,PolarSeries:()=>Lg,PropertiesArray:()=>vt,ProxyOnWrite:()=>$a,ProxyProperty:()=>Ka,ProxyPropertyOnWrite:()=>Ya,QUICK_TRANSITION:()=>.2,RATIO:()=>rn,RepeatType:()=>Mr,SKIP_JS_BUILTINS:()=>et,SMALLEST_KEY_INTERVAL:()=>Mh,SORT_DOMAIN_GROUPS:()=>Ah,STRING:()=>Jr,STRING_ARRAY:()=>Cn,Series:()=>Xh,SeriesGroupingChangedEvent:()=>qh,SeriesItemHighlightStyle:()=>_d,SeriesMarker:()=>Hu,SeriesNodeEvent:()=>Yh,SeriesNodePickMode:()=>Fh,SeriesProperties:()=>Bd,SeriesTooltip:()=>zu,StateMachine:()=>fa,TEXT_ALIGN:()=>In,TEXT_WRAP:()=>Dn,ToolbarManager:()=>_c,Tooltip:()=>nl,TooltipManager:()=>Fc,TooltipPosition:()=>rl,UNION:()=>On,UpdateService:()=>Hc,VERTICAL_ALIGN:()=>Rn,Validate:()=>jr,ZoomManager:()=>ih,__FORCE_MODULE_DETECTION:()=>Xm,accumulateGroup:()=>Nh,accumulatedValue:()=>xh,accumulativeValueProperty:()=>jh,addHitTestersToQuadtree:()=>Dp,adjustLabelPlacement:()=>Wp,allInStringUnion:()=>ys,animationValidation:()=>Ph,area:()=>wh,arraysEqual:()=>hs,assignJsonApplyConstructedArray:()=>$n,backfillPathPointData:()=>tp,basicContinuousCheckDatumValidation:()=>Gh,bifurcate:()=>ms,buildFormatter:()=>so,buildResetPathFn:()=>ap,calculateDefaultTimeTickFormat:()=>oo,calculatePlacement:()=>Qa,checkCrisp:()=>Op,childrenIter:()=>Tp,circularSliceArray:()=>gs,clamp:()=>Vs,clampArray:()=>Hs,collapsedStartingBarPosition:()=>Gp,computeBarFocusBounds:()=>Up,computeMarkerFocusBounds:()=>Zu,computeSectorFocusBounds:()=>kg,convertValuesToScaleByDefs:()=>Wm,countFractionDigits:()=>qs,createDatumId:()=>Oh,createDeprecationWarning:()=>Ps,createElement:()=>ws,dateToNumber:()=>ro,deconstructSelectionsOrNodes:()=>Ar,deepClone:()=>wt,deepMerge:()=>Ye,defaultTimeTickFormat:()=>no,determinePathStatus:()=>vp,diff:()=>_h,downloadUrl:()=>xs,enterpriseModule:()=>be,extent:()=>as,extractDecoratedProperties:()=>Re,findMinMax:()=>Us,findQuadtreeMatch:()=>Ip,findRangeExtent:()=>zs,fixNumericExtent:()=>Yc,fromToMotion:()=>Ir,getDocument:()=>bs,getMissCount:()=>qc,getPath:()=>Je,getRectConfig:()=>_p,getWindow:()=>Ss,groupAccumulativeValueProperty:()=>$h,groupAverage:()=>Sh,groupBy:()=>ps,groupCount:()=>bh,groupSum:()=>vh,injectStyle:()=>Es,isArray:()=>ke,isBoolean:()=>Le,isDate:()=>Ne,isDecoratedObject:()=>De,isDefined:()=>Pe,isEnumKey:()=>je,isEnumValue:()=>Ke,isEqual:()=>Ws,isFiniteNumber:()=>ze,isFunction:()=>Fe,isHtmlElement:()=>We,isNegative:()=>js,isNumber:()=>Ue,isObject:()=>Ge,isObjectLike:()=>Be,isPlainObject:()=>Ve,isProperties:()=>Ct,isRegExp:()=>Oe,isString:()=>He,isSymbol:()=>$e,isValidDate:()=>_e,jsonApply:()=>Mt,jsonDiff:()=>St,jsonWalk:()=>Et,keyProperty:()=>Uh,listDecoratedProperties:()=>Ie,mapIterable:()=>fs,mapValues:()=>Ze,markerFadeInAnimation:()=>ju,markerPaletteFactory:()=>Pu,markerScaleInAnimation:()=>Ku,markerSwipeScaleInAnimation:()=>$u,mergeArrayDefaults:()=>Xe,mergeDefaults:()=>qe,midpointStartingBarPosition:()=>Bp,minMax:()=>Qu,mod:()=>Ys,moduleRegistry:()=>we,normaliseGroupTo:()=>Dh,normalisePropertyTo:()=>Rh,normalisedExtent:()=>ls,normalisedExtentWithMetadata:()=>cs,pairCategoryData:()=>yp,pairContinuousData:()=>fp,partialAssign:()=>it,pathFadeInAnimation:()=>np,pathFadeOutAnimation:()=>op,pathSwipeInAnimation:()=>rp,pickByMatchingAngle:()=>Pg,predicateWithMessage:()=>Bn,prepareAreaPathAnimation:()=>Ep,prepareAxisAnimationContext:()=>pl,prepareAxisAnimationFunctions:()=>fl,prepareBarAnimationFunctions:()=>Vp,prepareLinePathAnimation:()=>bp,prepareLinePathAnimationFns:()=>Cp,prepareMarkerAnimation:()=>Xu,preparePieSeriesAnimationFunctions:()=>Ig,range:()=>Ch,rangedValueProperty:()=>Wh,renderPartialPath:()=>sp,resetAxisGroupFn:()=>yl,resetAxisLabelSelectionFn:()=>Cl,resetAxisLineSelectionFn:()=>bl,resetAxisSelectionFn:()=>vl,resetBarSelectionsFn:()=>Hp,resetIds:()=>Os,resetLabelFn:()=>Fu,resetMarkerFn:()=>Yu,resetMarkerPositionFn:()=>qu,resetMotion:()=>ma,resetPieSelectionsFn:()=>Rg,round:()=>Ks,seriesLabelFadeInAnimation:()=>_u,seriesLabelFadeOutAnimation:()=>Ou,setDocument:()=>Ms,setPath:()=>tt,setWindow:()=>As,shallowClone:()=>xt,singleSeriesPaletteFactory:()=>Ru,staticFromToMotion:()=>Rr,stringify:()=>Un,sum:()=>yh,sumValues:()=>fh,toArray:()=>ds,toFixed:()=>$s,toTooltipHtml:()=>sl,trailingAccumulatedValue:()=>Eh,trailingAccumulatedValueProperty:()=>Kh,unique:()=>us,updateClipPath:()=>lp,updateLabelNode:()=>zp,updateRect:()=>Np,validateCrossLineValues:()=>Xo,valueProperty:()=>zh,without:()=>Qe});var jm=class e{constructor(e,t,i,s,r,n,o,a,l,c,h){this.series=e,this.index=t,this.datum=i,this.size=s,this.colorValue=r,this.fill=n,this.stroke=o,this.sumSize=a,this.depth=l,this.parent=c,this.children=h,this.midPoint={x:0,y:0}}contains(e){let t=e;for(;null!=t&&t.index>=this.index;){if(t===this)return!0;t=t.parent}return!1}walk(t,i=e.Walk.PreOrder){i===e.Walk.PreOrder&&t(this),this.children.forEach(e=>{e.walk(t,i)}),i===e.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*x(e)}};jm.Walk={PreOrder:0,PostOrder:1};var Km=jm,$m=class extends Xh{constructor(e){super({moduleCtx:e,pickModes:[0],contentGroupVirtual:!1}),this.rootNode=new Km(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.colorDomain=[0,0],this.maxDepth=0,this.animationState=new fa("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}processData(){return S(this,null,function*(){var e,t;const{childrenKey:i,sizeKey:s,colorKey:r,fills:n,strokes:o,colorRange:a}=this.properties;let l=0,c=0,h=1/0,d=-1/0;const u=new Array((null!=(t=null==(e=this.data)?void 0:e.length)?t:0)+1).fill(void 0),p=(e,t)=>{const n=(l+=1,l),o=null!=t.depth?t.depth+1:0,a=null!=i?e[i]:void 0,p=null==a||0===a.length;let m=null!=s?e[s]:void 0;m=Number.isFinite(m)?Math.max(m,0):p?1:0;const f=m;c=Math.max(c,o);const y=null!=r?e[r]:void 0;return"number"==typeof y&&(u[n]=y,h=Math.min(h,y),d=Math.max(d,y)),g(new Km(this,n,e,m,y,void 0,void 0,f,o,t,[]),a)},g=(e,t)=>(null==t||t.forEach(t=>{const i=p(t,e);e.children.push(i),e.sumSize+=i.sumSize}),e),m=g(new Km(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.data),f=[h,d];let y;null!=a&&Number.isFinite(h)&&Number.isFinite(d)&&(y=new Yp,y.domain=f,y.range=a,y.update()),m.children.forEach((e,t)=>{e.walk(e=>{let i;const s=u[e.index];null!=s&&(i=null==y?void 0:y.convert(s)),null!=i||(i=null==n?void 0:n[t%n.length]),e.fill=i,e.stroke=null==y?null==o?void 0:o[t%o.length]:"rgba(0, 0, 0, 0.2)"})}),this.rootNode=m,this.maxDepth=c,this.colorDomain=f})}update(e){return S(this,arguments,function*({seriesRect:e}){yield this.updateSelections(),yield this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)})}resetAllAnimation(e){var t;const i=null==(t=this.animationResetFns)?void 0:t.datum;this.ctx.animationManager.stopByAnimationGroupId(this.id),null!=i&&ma(e.datumSelections,i)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){var t;const i=null==(t=this.animationResetFns)?void 0:t.datum;null!=i&&ma([e],i)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(){return{datumSelections:[this.groupSelection]}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getLabelData(){return[]}getSeriesDomain(){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:s,visible:r}=this.properties;return"gradient"===e&&null!=t&&null!=s?[{legendType:"gradient",enabled:r,seriesId:this.id,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return`${e.index}`}getDatumId(e){return this.getDatumIdFromData(e)}},Ym=class extends Bd{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Ot),this.strokes=Object.values(Ft)}};C([jr(Jr)],Ym.prototype,"childrenKey",2),C([jr(Jr,{optional:!0})],Ym.prototype,"sizeKey",2),C([jr(Jr,{optional:!0})],Ym.prototype,"colorKey",2),C([jr(Jr,{optional:!0})],Ym.prototype,"colorName",2),C([jr(fn)],Ym.prototype,"fills",2),C([jr(fn)],Ym.prototype,"strokes",2),C([jr(fn,{optional:!0})],Ym.prototype,"colorRange",2);var qm=class{constructor(e,t,i,s){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=s}merge(e){this.lon0=Math.min(this.lon0,e.lon0),this.lat0=Math.min(this.lat0,e.lat0),this.lon1=Math.max(this.lon1,e.lon1),this.lat1=Math.max(this.lat1,e.lat1)}},Xm=0},98092(e){var t,i=Object.defineProperty,s=Object.defineProperties,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(e,t,s)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,d=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&h(e,i,t[i]);if(a)for(var i of a(t))c.call(t,i)&&h(e,i,t[i]);return e},u=(e,t)=>s(e,n(t)),p=(e,t)=>{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,n)=>{for(var o,a=n>1?void 0:n?r(t,s):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(n?o(t,s,a):o(a))||a);return n&&a&&i(t,s,a),a},m=(e,t)=>(i,s)=>t(i,s,e),f={};p(f,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>ht,AbstractHeaderCellCtrl:()=>el,AgAbstractField:()=>_r,AgAbstractLabel:()=>Nr,AgAutocomplete:()=>vc,AgCheckbox:()=>Ur,AgDialog:()=>dc,AgGroupComponent:()=>tc,AgInputDateField:()=>Kl,AgInputNumberField:()=>sn,AgInputRange:()=>$l,AgInputTextArea:()=>jl,AgInputTextField:()=>tn,AgMenuItemComponent:()=>lc,AgMenuItemRenderer:()=>uo,AgMenuList:()=>nc,AgMenuPanel:()=>oc,AgPanel:()=>hc,AgPickerField:()=>Or,AgPromise:()=>dr,AgPromiseStatus:()=>hr,AgRadioButton:()=>zr,AgRichSelect:()=>Zl,AgSelect:()=>Vr,AgSlider:()=>Jl,AgStackComponentsRegistry:()=>_t,AgToggleButton:()=>Wl,AlignedGridsService:()=>Ac,AnimateShowChangeCellRenderer:()=>Pn,AnimateSlideCellRenderer:()=>kn,AnimationFrameService:()=>Dl,AutoScrollService:()=>Fo,AutoWidthCalculator:()=>kl,Autowired:()=>de,BarColumnLabelPlacement:()=>Wh,BaseComponentWrapper:()=>Uh,BaseCreator:()=>xd,BaseGridSerializingSession:()=>Ed,Bean:()=>he,BeanStub:()=>rt,Beans:()=>la,BodyDropPivotTarget:()=>Ua,BodyDropTarget:()=>ja,CellComp:()=>Ba,CellCtrl:()=>ma,CellNavigationService:()=>Mc,CellPositionUtils:()=>Jc,CellRangeType:()=>sa,ChangedPath:()=>Gl,ChartMappings:()=>zh,CheckboxCellEditor:()=>ho,CheckboxCellRenderer:()=>co,CheckboxSelectionComponent:()=>_n,ClientSideRowModelModule:()=>td,ClientSideRowModelSteps:()=>Il,Column:()=>we,ColumnApi:()=>Dc,ColumnFactory:()=>nt,ColumnGroup:()=>lt,ColumnKeyCreator:()=>I,ColumnModel:()=>At,Component:()=>Cr,ComponentUtil:()=>Nt,Context:()=>oe,CssClassApplier:()=>ua,CssClassManager:()=>pr,CsvCreator:()=>Td,CsvExportModule:()=>Rd,CtrlsService:()=>ch,DataTypeService:()=>Dh,DateCellEditor:()=>no,DateFilter:()=>Zr,DateStringCellEditor:()=>ao,DisplayedGroupCreator:()=>It,Downloader:()=>Md,DragAndDropService:()=>Bn,DragService:()=>Bo,DragSourceType:()=>Gn,Environment:()=>Kc,EventService:()=>fe,Events:()=>ct,ExcelFactoryMode:()=>_o,ExpansionService:()=>Rl,ExpressionService:()=>Rc,FilterManager:()=>jo,FilterWrapperComp:()=>Ko,FloatingFilterMapper:()=>Lo,FocusService:()=>Oc,GROUP_AUTO_COLUMN_ID:()=>ut,Grid:()=>Bh,GridApi:()=>zo,GridBodyComp:()=>La,GridBodyCtrl:()=>ta,GridComp:()=>Nc,GridCoreCreator:()=>Hh,GridCtrl:()=>Lc,GridHeaderComp:()=>Cl,GridHeaderCtrl:()=>yl,GridOptionsService:()=>wh,GridSerializer:()=>Id,GroupCellRenderer:()=>Kn,GroupCellRendererCtrl:()=>Wn,GroupInstanceIdCreator:()=>dt,HeaderCellCtrl:()=>ol,HeaderFilterCellComp:()=>qo,HeaderFilterCellCtrl:()=>sl,HeaderGroupCellCtrl:()=>cl,HeaderNavigationDirection:()=>ml,HeaderNavigationService:()=>fl,HeaderPositionUtils:()=>nh,HeaderRowComp:()=>Za,HeaderRowContainerComp:()=>gl,HeaderRowContainerCtrl:()=>ul,HeaderRowCtrl:()=>dl,HeaderRowType:()=>Xa,HorizontalDirection:()=>Fn,HorizontalResizeService:()=>bl,InfiniteRowModelModule:()=>hd,KeyCode:()=>Xs,LargeTextCellEditor:()=>An,LayoutCssClasses:()=>Xo,LocaleService:()=>xh,Logger:()=>kc,LoggerFactory:()=>Pc,ManagedFocusFeature:()=>Dr,MenuService:()=>Pl,ModuleNames:()=>se,ModuleRegistry:()=>ne,MouseEventService:()=>_a,MoveColumnFeature:()=>Wa,NavigationService:()=>Oa,NumberCellEditor:()=>so,NumberFilter:()=>an,NumberSequence:()=>cr,Optional:()=>ue,PaginationProxy:()=>Ul,PillDragComp:()=>bc,PillDropZonePanel:()=>wc,PinnedRowModel:()=>Ol,PopupComponent:()=>En,PopupEditorWrapper:()=>Ga,PopupService:()=>pc,PositionableFeature:()=>Pr,PostConstruct:()=>le,PreConstruct:()=>ae,PreDestroy:()=>ce,PropertyKeys:()=>kt,ProvidedColumnGroup:()=>Ee,ProvidedFilter:()=>Lr,Qualifier:()=>ge,QuerySelector:()=>br,RefSelector:()=>Sr,ResizeObserverService:()=>Tl,RowAnimationCssClasses:()=>Jo,RowContainerComp:()=>Ha,RowContainerCtrl:()=>ka,RowContainerName:()=>Aa,RowContainerType:()=>Ta,RowCtrl:()=>va,RowHighlightPosition:()=>Oo,RowNode:()=>Nn,RowNodeBlock:()=>Vl,RowNodeBlockLoader:()=>Hl,RowNodeSorter:()=>lh,RowPositionUtils:()=>Qc,RowRenderer:()=>Nl,RowType:()=>Dd,ScalarFilter:()=>$r,ScrollVisibleService:()=>Na,SelectCellEditor:()=>Tn,SelectableService:()=>Yc,SelectionHandleType:()=>ia,ServerSideTransactionResultStatus:()=>Fl,SetLeftFeature:()=>tl,SimpleFilter:()=>Kr,SortController:()=>_c,SortIndicatorComp:()=>Cn,StandardMenuFactory:()=>Sl,StylingService:()=>zl,TabGuardClassNames:()=>wl,TabGuardComp:()=>El,TabGuardCtrl:()=>xl,TabbedLayout:()=>Al,TextCellEditor:()=>Rn,TextFilter:()=>hn,TextFloatingFilter:()=>mn,Timer:()=>ur,TooltipFeature:()=>fr,TooltipStateManager:()=>mr,TouchListener:()=>yn,UserComponentFactory:()=>No,UserComponentRegistry:()=>po,ValueCache:()=>Vc,ValueService:()=>Ic,VanillaFrameworkOverrides:()=>Ec,VerticalDirection:()=>On,VirtualList:()=>Xl,VirtualListDragFeature:()=>Ho,XmlFactory:()=>kd,ZipContainer:()=>Hd,_:()=>lr,createGrid:()=>Gh,getRowContainerTypeForName:()=>Da,provideGlobalGridOptions:()=>Fh}),e.exports=(t=f,((e,t,s,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))l.call(e,s)||void 0===s||i(e,s,{get:()=>t[s],enumerable:!(n=r(t,s))||n.enumerable});return e})(i({},"__esModule",{value:!0}),t));var y={};function v(e){return null==e||""===e?null:e}function C(e,t=!1){return null!=e&&(""!==e||t)}function b(e){return!C(e)}function S(e){return null==e||0===e.length}function w(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function x(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function E(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function M(e){if(null!=e&&""!==e)return e}function A(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function T(e,t,i=!1){const s=null==e,r=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&r)return 0;if(s)return-1;if(r)return 1;function n(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return n(e,t);if(!i)return n(e,t);try{return e.localeCompare(t)}catch(i){return n(e,t)}}function D(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(e=>t.push(e)),t}return Object.values(e)}p(y,{attrToBoolean:()=>E,attrToNumber:()=>x,attrToString:()=>M,defaultComparator:()=>T,exists:()=>C,jsonEquals:()=>A,makeNull:()=>v,missing:()=>b,missingOrEmpty:()=>S,toStringOrNull:()=>w,values:()=>D});var I=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=w(e);let i=0;for(;;){let s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},R={};p(R,{SKIP_JS_BUILTINS:()=>P,cloneObject:()=>L,deepCloneDefinition:()=>N,getAllValuesInObject:()=>_,getValueUsingField:()=>F,isNonNullObject:()=>B,iterateObject:()=>k,mergeDeep:()=>O,removeAllReferences:()=>G});var P=new Set(["__proto__","constructor","prototype"]);function k(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,s]of Object.entries(e))t(i,s)}function L(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(P.has(i[s]))continue;const r=i[s],n=e[r];t[r]=n}return t}function N(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(e=>{if(t&&t.indexOf(e)>=0||P.has(e))return;const r=i[e],n=B(r)&&r.constructor===Object;s[e]=n?N(r):r}),s}function _(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function O(e,t,i=!0,s=!1){C(t)&&k(t,(t,r)=>{if(P.has(t))return;let n=e[t];n!==r&&(s&&null==n&&null!=r&&"object"==typeof r&&r.constructor===Object&&(n={},e[t]=n),B(r)&&B(n)&&!Array.isArray(n)?O(n,r,i,s):(i||void 0!==r)&&(e[t]=r))})}function F(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let r=e;for(let e=0;e<s.length;e++){if(null==r)return;r=r[s[e]]}return r}function G(e,t=[],i){Object.keys(e).forEach(i=>{"object"!=typeof e[i]||t.includes(i)||(e[i]=void 0)});const s=Object.getPrototypeOf(e),r={};Object.getOwnPropertyNames(s).forEach(e=>{if("function"==typeof s[e]&&!t.includes(e)){const t=()=>{console.warn((e=>`AG Grid: Grid API function ${e}() cannot be called as the grid has been destroyed.\n    It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n    To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`)(e))};r[e]={value:t,writable:!0}}}),Object.defineProperties(e,r)}function B(e){return"object"==typeof e&&null!==e}var V={};p(V,{compose:()=>te,debounce:()=>Q,doOnce:()=>U,errorOnce:()=>W,executeAfter:()=>Z,executeInAWhile:()=>$,executeNextVMTurn:()=>X,getFunctionName:()=>j,isFunction:()=>K,noop:()=>ie,throttle:()=>J,waitUntil:()=>ee,warnOnce:()=>z});var H={};function U(e,t){H[t]||(e(),H[t]=!0)}function z(e){U(()=>console.warn("AG Grid: "+e),e)}function W(e){U(()=>console.error("AG Grid: "+e),e)}function j(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function K(e){return!!(e&&e.constructor&&e.call&&e.apply)}function $(e){Z(e,400)}var Y=[],q=!1;function X(e){Y.push(e),q||(q=!0,window.setTimeout(()=>{const e=Y.slice();Y.length=0,q=!1,e.forEach(e=>e())},0))}function Z(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(e=>e()),t)}function Q(e,t){let i;return function(...s){const r=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(r,s)},t)}}function J(e,t){let i=0;return function(...s){const r=(new Date).getTime();r-i<t||(i=r,e.apply(this,s))}}function ee(e,t,i=100,s){const r=(new Date).getTime();let n=null,o=!1;const a=()=>{const a=(new Date).getTime()-r>i;(e()||a)&&(t(),o=!0,null!=n&&(window.clearInterval(n),n=null),a&&s&&console.warn(s))};a(),o||(n=window.setInterval(a,10))}function te(...e){return t=>e.reduce((e,t)=>t(e),t)}var ie=()=>{},se=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(se||{}),re=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,s){e.runVersionChecks(t),void 0!==s?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[s]&&(e.gridModulesMap[s]={}),e.gridModulesMap[s][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,s){e.setModuleBased(i),t&&t.forEach(t=>e.__register(t,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[r,n]=e.currentModuleVersion.split(".")||[];return i===r&&s===n}static runVersionChecks(t){if(e.currentModuleVersion||(e.currentModuleVersion=t.version),t.version?e.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const e=t.validate();if(!e.isValid){const t=e;console.error(`AG Grid: ${t.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&U(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){e.isBundled=!0}static __assertRegistered(t,i,s){var r;if(this.__isRegistered(t,s))return!0;const n=i+t;let o;if(e.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n        \n        <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n        \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){let n=null==(r=Object.entries(se).find(([e,i])=>i===t))?void 0:r[0];o=`AG Grid: unable to use ${i} as the ${n} is not registered${e.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:\n           \n    import { ModuleRegistry } from '@ag-grid-community/core';\n    import { ${n} } from '${t}';\n    \n    ModuleRegistry.registerModules([ ${n} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n            \n    import 'ag-grid-enterprise';`;return U(()=>{console.warn(o)},n),!1}static __isRegistered(t,i){var s;return!!e.globalModulesMap[t]||!!(null==(s=e.gridModulesMap[i])?void 0:s[t])}static __getRegisteredModules(t){return[...D(e.globalModulesMap),...D(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return D(null!=(i=e.gridModulesMap[t])?i:{})||[]}static __isPackageBased(){return!e.moduleBased}};re.globalModulesMap={},re.gridModulesMap={},re.areGridScopedModules=!1;var ne=re,oe=class{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return D(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),C(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),k(this.beanWrappers,(e,t)=>{let i;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const s=this.getBeansForParameters(i,t.bean.name),r=new(t.bean.bind.apply(t.bean,[null,...s]));t.beanInstance=r});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let t;return t=e.prototype.constructor?j(e.prototype.constructor):""+e,void console.error(`Context item ${t} is not a bean`)}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{const s=t.agClassAttributes;s&&s.forEach(t=>{const s=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=s})})})}methodWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{k(t.autowireMethods,(t,s)=>{if("agConstructor"===t)return;const r=this.getBeansForParameters(s,i);e[t].apply(e,r)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const e=i.constructor;e.hasOwnProperty("__agBeanMetaData")&&t(e.__agBeanMetaData,this.getBeanName(e)),i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&k(e,(e,s)=>{const r=this.lookupBeanInstance(t,s);i[Number(e)]=r}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const s=this.beanWrappers[t];return s?s.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(e=>this.callLifeCycleMethodsOnBean(e,t))}callLifeCycleMethodsOnBean(e,t,i){const s={};this.forEachMetaDataInHierarchy(e,e=>{const r=e[t];r&&r.forEach(e=>{e!=i&&(s[e]=!0)})}),Object.keys(s).forEach(t=>e[t]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,ne.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;"function"==typeof t.destroy&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function ae(e,t,i){const s=me(e.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(t)}function le(e,t,i){const s=me(e.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(t)}function ce(e,t,i){const s=me(e.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(t)}function he(e){return t=>{me(t).beanName=e}}function de(e){return(t,i,s)=>{pe(t,e,!1,0,i,null)}}function ue(e){return(t,i,s)=>{pe(t,e,!0,0,i,null)}}function pe(e,t,i,s,r,n){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof n)return void console.error("AG Grid: Autowired should be on an attribute");const o=me(e.constructor);o.agClassAttributes||(o.agClassAttributes=[]),o.agClassAttributes.push({attributeName:r,beanName:t,optional:i})}function ge(e){return(t,i,s)=>{const r="function"==typeof t?t:t.constructor;let n;if("number"==typeof s){let t;i?(n=me(r),t=i):(n=me(r),t="agConstructor"),n.autowireMethods||(n.autowireMethods={}),n.autowireMethods[t]||(n.autowireMethods[t]={}),n.autowireMethods[t][s]=e}}}function me(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var fe=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setBeans(e,t,i=null,s=null){if(this.frameworkOverrides=t,this.gos=e,i){const t=e.useAsyncEvents();this.addGlobalListener(i,t)}s&&this.addGlobalListener(s,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let r=s.get(e);return!r&&i&&(r=new Set,s.set(e,r)),r}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),0===s.size)&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gos&&this.gos.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const s=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const r=null!=(i=this.getListeners(s,t,!1))?i:new Set,n=new Set(r);n.size>0&&((i,s)=>{i.forEach(i=>{if(!s.has(i))return;const r=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(e)):()=>i(e);t?this.dispatchAsync(r):r()})})(n,r),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(i=>{const r=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(s,e)):()=>i(s,e);t?this.dispatchAsync(r):r()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(e=>e())}};g([m(0,ge("gridOptionsService")),m(1,ge("frameworkOverrides")),m(2,ge("globalEventListener")),m(3,ge("globalSyncEventListener"))],fe.prototype,"setBeans",1),fe=g([he("eventService")],fe);var ye=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing(()=>e(t))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing(()=>e(t,i))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return null!=(t=this.wrappedListeners.get(e))?t:e}unwrapGlobal(e){var t;return null!=(t=this.wrappedGlobalListeners.get(e))?t:e}},ve={resizable:!0,sortable:!0},Ce=0;function be(){return Ce++}var Se=class e{constructor(e,t,i,s){this.instanceId=be(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new fe,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const s=e.hide,r=e.initialHide;this.visible=void 0!==s?!s:!r,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,o=e.initialFlex;void 0!==n?this.flex=n:void 0!==o&&(this.flex=o)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=C(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=C(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,t;const i=this.colDef;this.minWidth=null!=(e=i.minWidth)?e:this.environment.getMinColWidth(),this.maxWidth=null!=(t=i.maxWidth)?t:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=C(this.colDef.tooltipField)||C(this.colDef.tooltipValueGetter)||C(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){var t,i;const s=null!=(t=e.minWidth)?t:this.environment.getMinColWidth(),r=null!=(i=e.maxWidth)?i:Number.MAX_SAFE_INTEGER;let n;const o=x(e.width),a=x(e.initialWidth);return n=null!=o?o:null!=a?a:200,Math.max(Math.min(n,r),s)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(b(this.colDef)||b(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){var i,s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new ye(this.frameworkOverrides));const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?s:t;this.eventService.addEventListener(e,r)}removeEventListener(e,t){var i,s;const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?s:t;this.eventService.removeEventListener(e,r)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){var t;return null!=(t=this.colDef[e])?t:ve[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}setMoving(e,t){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return b(this.sort)}isSorting(){return C(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&O(s,i),this.eventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(b(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(b(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){null!=this.minWidth&&(e=Math.max(e,this.minWidth)),null!=this.maxWidth&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return null!=this.maxWidth&&e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){C(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(e){z("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return null==t&&(t=e),t}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:e.EVENT_STATE_UPDATED,key:t})}};Se.EVENT_MOVING_CHANGED="movingChanged",Se.EVENT_LEFT_CHANGED="leftChanged",Se.EVENT_WIDTH_CHANGED="widthChanged",Se.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",Se.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",Se.EVENT_VISIBLE_CHANGED="visibleChanged",Se.EVENT_FILTER_CHANGED="filterChanged",Se.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",Se.EVENT_SORT_CHANGED="sortChanged",Se.EVENT_COL_DEF_CHANGED="colDefChanged",Se.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",Se.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",Se.EVENT_PIVOT_CHANGED="columnPivotChanged",Se.EVENT_VALUE_CHANGED="columnValueChanged",Se.EVENT_STATE_UPDATED="columnStateUpdated",g([de("gridOptionsService")],Se.prototype,"gos",2),g([de("environment")],Se.prototype,"environment",2),g([de("columnHoverService")],Se.prototype,"columnHoverService",2),g([de("frameworkOverrides")],Se.prototype,"frameworkOverrides",2),g([le],Se.prototype,"initialise",1);var we=Se,xe=class e{constructor(e,t,i,s){this.localEventService=new fe,this.expandable=!1,this.instanceId=be(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some(e=>e.isVisible())}isPadding(){return this.padding}setExpanded(t){this.expanded=void 0!==t&&t;const i={type:e.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(i)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(t){this.children&&this.children.forEach(i=>{i instanceof we?t.push(i):i instanceof e&&i.addLeafColumns(t)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let t=!1,i=!1,s=!1;const r=this.findChildrenRemovingPadding();for(let e=0,n=r.length;e<n;e++){const n=r[e];if(!n.isVisible())continue;const o=n.getColumnGroupShow();"open"===o?(t=!0,s=!0):"closed"===o?(i=!0,s=!0):(t=!0,i=!0)}const n=t&&i&&s;if(this.expandable!==n){this.expandable=n;const t={type:e.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(t)}}findChildrenRemovingPadding(){const t=[],i=s=>{s.forEach(s=>{s instanceof e&&s.isPadding()?i(s.children):t.push(s)})};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};xe.EVENT_EXPANDED_CHANGED="expandedChanged",xe.EVENT_EXPANDABLE_CHANGED="expandableChanged",g([ce],xe.prototype,"destroy",1);var Ee=xe,Me={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Ae={};p(Ae,{addSafePassiveEventListener:()=>it,createEventPath:()=>et,getCtrlForEventTarget:()=>Qe,getEventPath:()=>tt,isElementInEventPath:()=>Je,isEventSupported:()=>Ze,isStopPropagationForAgGrid:()=>Xe,stopPropagationForAgGrid:()=>qe});var Te={};function De(e){return null!=e&&e.length>0}function Ie(e){if(e&&e.length)return e[e.length-1]}function Re(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,s)=>i?i(e,t[s]):t[s]===e)}function Pe(e,t){return Re(e,t)}function ke(e){return e.sort((e,t)=>e-t)}function Le(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,r=e[i+1]===t;s&&r&&e.splice(i+1,1)}}function Ne(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function _e(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function Oe(e,t){for(let i=0;i<t.length;i++)Ne(e,t[i])}function Fe(e,t){for(let i=0;i<t.length;i++)_e(e,t[i])}function Ge(e,t,i){e.splice(i,0,t)}function Be(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--)Ge(e,t[s],i)}function Ve(e,t,i){Fe(e,t),t.slice().reverse().forEach(t=>Ge(e,t,i))}function He(e,t){return e.indexOf(t)>-1}function Ue(e){return[].concat.apply([],e)}function ze(e,t){null!=t&&null!=e&&t.forEach(t=>e.push(t))}function We(e){return e.map(w)}function je(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}p(Te,{areEqual:()=>Re,existsAndNotEmpty:()=>De,flatten:()=>Ue,forEachReverse:()=>je,includes:()=>He,insertArrayIntoArray:()=>Be,insertIntoArray:()=>Ge,last:()=>Ie,moveInArray:()=>Ve,pushAll:()=>ze,removeAllFromArray:()=>Fe,removeAllFromUnorderedArray:()=>Oe,removeFromArray:()=>_e,removeFromUnorderedArray:()=>Ne,removeRepeatsFromArray:()=>Le,shallowCompare:()=>Pe,sortNumerically:()=>ke,toStrings:()=>We});var Ke="__ag_Grid_Stop_Propagation",$e=["touchstart","touchend","touchmove","touchcancel","scroll"],Ye={};function qe(e){e[Ke]=!0}function Xe(e){return!0===e[Ke]}var Ze=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof Ye[t])return Ye[t];const i=document.createElement(e[t]||"div");return Ye[t="on"+t]=t in i}})();function Qe(e,t,i){let s=t;for(;s;){const t=e.getDomData(s,i);if(t)return t;s=s.parentElement}return null}function Je(e,t){return!(!t||!e)&&tt(t).indexOf(e)>=0}function et(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function tt(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():et(t)}function it(e,t,i,s){const r=He($e,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var st=class e{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:e.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new fe),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,i){if(this.destroyed)return;e instanceof HTMLElement?it(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null)}setupGridOptionListener(e,t){this.gos.addEventListener(e,t);const i=()=>(this.gos.removeEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const s={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(s)};e.forEach(e=>this.setupGridOptionListener(e,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){if(e)for(let i=0;i<e.length;i++)this.destroyBean(e[i],t);return[]}};st.EVENT_DESTROYED="destroyed",g([de("frameworkOverrides")],st.prototype,"frameworkOverrides",2),g([de("context")],st.prototype,"context",2),g([de("eventService")],st.prototype,"eventService",2),g([de("gridOptionsService")],st.prototype,"gos",2),g([de("localeService")],st.prototype,"localeService",2),g([de("environment")],st.prototype,"environment",2),g([ce],st.prototype,"destroy",1);var rt=st,nt=class extends rt{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,s){const r=new I,{existingCols:n,existingGroups:o,existingColKeys:a}=this.extractExistingTreeData(i);r.addExistingKeys(a);const l=this.recursivelyCreateColumns(e,0,t,n,r,o,s),c=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+c);const h=this.balanceColumnTree(l,0,c,r);return ot(null,h,(e,t)=>{e instanceof Ee&&e.setupExpandable(),e.setOriginalParent(t)}),{columnTree:h,treeDept:c}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&ot(null,e,e=>{if(e instanceof Ee){const t=e;i.push(t)}else{const i=e;s.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map(e=>this.createAutoGroupTreeItem(t,e))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let e=i-1;e>=0;e--){const i=new Ee(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([s]),s.setOriginalParent(i),s=i}return 0===i&&t.setOriginalParent(null),s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof Ee;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const r=[];for(let n=0;n<e.length;n++){const o=e[n];if(o instanceof Ee){const e=o,n=this.balanceColumnTree(e.getChildren(),t+1,i,s);e.setChildren(n),r.push(e)}else{let n,a;for(let e=i-1;e>=t;e--){const e=s.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),r=new Ee(i,e,!0,t);this.createBean(r),a&&a.setChildren([r]),a=r,n||(n=a)}if(n&&a){if(r.push(n),e.some(e=>e instanceof Ee)){a.setChildren([o]);continue}a.setChildren(e);break}r.push(o)}}return r}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const r=e[s];if(r instanceof Ee){const e=r,s=this.findMaxDept(e.getChildren(),t+1);i<s&&(i=s)}}return i}recursivelyCreateColumns(e,t,i,s,r,n,o){if(!e)return[];const a=new Array(e.length);for(let l=0;l<a.length;l++){const c=e[l];this.isColumnGroup(c)?a[l]=this.createColumnGroup(i,c,t,s,r,n,o):a[l]=this.createColumn(i,c,s,r,o)}return a}createColumnGroup(e,t,i,s,r,n,o){const a=this.createMergedColGroupDef(t),l=r.getUniqueKey(a.groupId||null,null),c=new Ee(a,l,!1,i);this.createBean(c);const h=this.findExistingGroup(t,n);h&&n.splice(h.idx,1);let d=null==h?void 0:h.group;d&&c.setExpanded(d.isExpanded());const u=this.recursivelyCreateColumns(a.children,i+1,e,s,r,n,o);return c.setChildren(u),c}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,r){const n=this.findExistingColumn(t,i);n&&(null==i||i.splice(n.idx,1));let o=null==n?void 0:n.column;if(o){const e=this.addColumnDefaultAndTypes(t,o.getColId());o.setColDef(e,t,r),this.applyColumnState(o,e,r)}else{const i=s.getUniqueKey(t.colId,t.field),r=this.addColumnDefaultAndTypes(t,i);o=new we(r,t,i,e),this.context.createBean(o)}return this.dataTypeService.addColumnListeners(o),o}applyColumnState(e,t,i){const s=x(t.flex);if(void 0!==s&&e.setFlex(s),e.getFlex()<=0){const s=x(t.width);if(null!=s)e.setActualWidth(s,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const r=x(t.sortIndex);void 0!==r&&e.setSortIndex(r);const n=E(t.hide);void 0!==n&&e.setVisible(!n,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(s)if(null==e.colId){if(null!=e.field){if(s.field===e.field)return{idx:i,column:t[i]}}else if(s===e)return{idx:i,column:t[i]}}else if(t[i].getId()===e.colId)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const s=t[i];if(s.getColGroupDef()&&s.getId()===e.groupId)return{idx:i,group:s}}}addColumnDefaultAndTypes(e,t){const i={};O(i,this.gos.get("defaultColDef"),!1,!0);const s=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);s&&this.assignColumnTypes(s,i),O(i,e,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&n&&O(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Me);k(this.gos.get("columnTypes")||{},(e,t)=>{e in i?console.warn(`AG Grid: the column type '${e}' is a default column type and cannot be overridden.`):(t.type&&z("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t)}),e.forEach(e=>{const s=i[e.trim()];s?O(t,s,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};function ot(e,t,i){if(t)for(let s=0;s<t.length;s++){const r=t[s];r instanceof Ee&&ot(r,r.getChildren(),i),i(r,e)}}g([de("dataTypeService")],nt.prototype,"dataTypeService",2),g([m(0,ge("loggerFactory"))],nt.prototype,"setBeans",1),nt=g([he("columnFactory")],nt);var at=class e{constructor(e,t,i,s){this.displayedChildren=[],this.localEventService=new fe,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return e.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){if(this.displayedChildren.forEach(t=>{t instanceof e&&t.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=Ie(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(t){let i=!1;return this.children.forEach(s=>{t===s&&(i=!0),s instanceof e&&s.isChildInThisGroupDeepSearch(t)&&(i=!0)}),i}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(t){this.displayedChildren.forEach(i=>{i instanceof we?t.push(i):i instanceof e&&i.addDisplayedLeafColumns(t)})}addLeafColumns(t){this.children.forEach(i=>{i instanceof we?t.push(i):i instanceof e&&i.addLeafColumns(t)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;null!=t&&t.isPadding();)t=t.getParent();if(!t||!t.providedColumnGroup.isExpandable())return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach(i=>{if(!(i instanceof e)||i.displayedChildren&&i.displayedChildren.length)switch(i.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i)}}),this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED))}};at.EVENT_LEFT_CHANGED="leftChanged",at.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",g([de("gridOptionsService")],at.prototype,"gos",2);var lt=at,ct=class{};ct.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",ct.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",ct.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",ct.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",ct.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",ct.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",ct.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",ct.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",ct.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",ct.EVENT_COLUMN_MOVED="columnMoved",ct.EVENT_COLUMN_VISIBLE="columnVisible",ct.EVENT_COLUMN_PINNED="columnPinned",ct.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",ct.EVENT_COLUMN_RESIZED="columnResized",ct.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",ct.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",ct.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",ct.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",ct.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",ct.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",ct.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",ct.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",ct.EVENT_ROW_GROUP_OPENED="rowGroupOpened",ct.EVENT_ROW_DATA_UPDATED="rowDataUpdated",ct.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",ct.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",ct.EVENT_CHART_CREATED="chartCreated",ct.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",ct.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",ct.EVENT_CHART_DESTROYED="chartDestroyed",ct.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",ct.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",ct.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",ct.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",ct.EVENT_MODEL_UPDATED="modelUpdated",ct.EVENT_CUT_START="cutStart",ct.EVENT_CUT_END="cutEnd",ct.EVENT_PASTE_START="pasteStart",ct.EVENT_PASTE_END="pasteEnd",ct.EVENT_FILL_START="fillStart",ct.EVENT_FILL_END="fillEnd",ct.EVENT_RANGE_DELETE_START="rangeDeleteStart",ct.EVENT_RANGE_DELETE_END="rangeDeleteEnd",ct.EVENT_UNDO_STARTED="undoStarted",ct.EVENT_UNDO_ENDED="undoEnded",ct.EVENT_REDO_STARTED="redoStarted",ct.EVENT_REDO_ENDED="redoEnded",ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",ct.EVENT_CELL_CLICKED="cellClicked",ct.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",ct.EVENT_CELL_MOUSE_DOWN="cellMouseDown",ct.EVENT_CELL_CONTEXT_MENU="cellContextMenu",ct.EVENT_CELL_VALUE_CHANGED="cellValueChanged",ct.EVENT_CELL_EDIT_REQUEST="cellEditRequest",ct.EVENT_ROW_VALUE_CHANGED="rowValueChanged",ct.EVENT_CELL_FOCUSED="cellFocused",ct.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",ct.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",ct.EVENT_ROW_SELECTED="rowSelected",ct.EVENT_SELECTION_CHANGED="selectionChanged",ct.EVENT_TOOLTIP_SHOW="tooltipShow",ct.EVENT_TOOLTIP_HIDE="tooltipHide",ct.EVENT_CELL_KEY_DOWN="cellKeyDown",ct.EVENT_CELL_MOUSE_OVER="cellMouseOver",ct.EVENT_CELL_MOUSE_OUT="cellMouseOut",ct.EVENT_FILTER_CHANGED="filterChanged",ct.EVENT_FILTER_MODIFIED="filterModified",ct.EVENT_FILTER_OPENED="filterOpened",ct.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",ct.EVENT_SORT_CHANGED="sortChanged",ct.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",ct.EVENT_ROW_CLICKED="rowClicked",ct.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",ct.EVENT_GRID_READY="gridReady",ct.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",ct.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",ct.EVENT_VIEWPORT_CHANGED="viewportChanged",ct.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",ct.EVENT_FIRST_DATA_RENDERED="firstDataRendered",ct.EVENT_DRAG_STARTED="dragStarted",ct.EVENT_DRAG_STOPPED="dragStopped",ct.EVENT_CHECKBOX_CHANGED="checkboxChanged",ct.EVENT_ROW_EDITING_STARTED="rowEditingStarted",ct.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",ct.EVENT_CELL_EDITING_STARTED="cellEditingStarted",ct.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",ct.EVENT_BODY_SCROLL="bodyScroll",ct.EVENT_BODY_SCROLL_END="bodyScrollEnd",ct.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",ct.EVENT_PAGINATION_CHANGED="paginationChanged",ct.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",ct.EVENT_STORE_REFRESHED="storeRefreshed",ct.EVENT_STATE_UPDATED="stateUpdated",ct.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",ct.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged",ct.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",ct.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",ct.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",ct.EVENT_FLASH_CELLS="flashCells",ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",ct.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",ct.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",ct.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",ct.EVENT_ROW_DRAG_ENTER="rowDragEnter",ct.EVENT_ROW_DRAG_MOVE="rowDragMove",ct.EVENT_ROW_DRAG_LEAVE="rowDragLeave",ct.EVENT_ROW_DRAG_END="rowDragEnd",ct.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",ct.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",ct.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",ct.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",ct.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",ct.EVENT_STORE_UPDATED="storeUpdated",ct.EVENT_FILTER_DESTROYED="filterDestroyed",ct.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",ct.EVENT_ROW_COUNT_READY="rowCountReady",ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",ct.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",ct.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",ct.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",ct.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var ht=new Set([ct.EVENT_GRID_PRE_DESTROYED,ct.EVENT_FILL_START]),dt=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},ut="ag-Grid-AutoColumn",pt=class extends rt{createAutoGroupColumns(e){const t=[],i=this.gos.get("treeData");let s=this.gos.isGroupMultiAutoColumn();return i&&s&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),s=!1),s?e.forEach((e,i)=>{t.push(this.createOneAutoGroupColumn(e,i))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach((e,i)=>this.updateOneAutoGroupColumn(e,i,t))}createOneAutoGroupColumn(e,t){let i;i=e?`${ut}-${e.getId()}`:ut;const s=this.createAutoGroupColDef(i,e,t);s.colId=i;const r=new we(s,null,i,!0);return this.context.createBean(r),r}updateOneAutoGroupColumn(e,t,i){const s=e.getColDef(),r="string"==typeof s.showRowGroup?s.showRowGroup:void 0,n=null!=r?this.columnModel.getPrimaryColumn(r):void 0,o=this.createAutoGroupColDef(e.getId(),null!=n?n:void 0,t);e.setColDef(o,null,i),this.columnFactory.applyColumnState(e,o,i)}createAutoGroupColDef(e,t,i){let s=this.createBaseColDef(t);O(s,this.gos.get("autoGroupColumnDef")),s=this.columnFactory.addColumnDefaultAndTypes(s,e),this.gos.get("treeData")||b(s.field)&&b(s.valueGetter)&&b(s.filterValueGetter)&&"agGroupColumnFilter"!==s.filter&&(s.filter=!1),i&&i>0&&(s.headerCheckboxSelection=!1);const r=this.gos.isColumnsSortingCoupledToGroup(),n=s.valueGetter||null!=s.field;return r&&!n&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const t=e.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:t.headerValueGetter}),t.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:t.cellRenderer,innerRendererParams:t.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}};g([de("columnModel")],pt.prototype,"columnModel",2),g([de("columnFactory")],pt.prototype,"columnFactory",2),pt=g([he("autoGroupColService")],pt);var gt={};p(gt,{camelCaseToHumanText:()=>bt,camelCaseToHyphenated:()=>St,capitalise:()=>vt,escapeString:()=>Ct,utf8_encode:()=>yt});var mt=/[&<>"']/g,ft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function yt(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function s(e){if(e>=0&&e<=31&&10!==e)return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=i(e,12),s+=i(e,6)):(function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),s=t(e>>12&15|224),s+=i(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const r=function(e){const t=[];if(!e)return[];const i=e.length;let s,r,n=0;for(;n<i;)s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<i?(r=e.charCodeAt(n++),56320==(64512&r)?t.push(((1023&s)<<10)+(1023&r)+65536):(t.push(s),n--)):t.push(s);return t}(e),n=r.length;let o,a=-1,l="";for(;++a<n;)o=r[a],l+=s(o);return l}function vt(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function Ct(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(mt,e=>ft[e])}function bt(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" "):null}function St(e){return e.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var wt={};function xt(e){const t=new Map;return e.forEach(e=>t.set(e[0],e[1])),t}function Et(e,t){const i=new Map;return e.forEach(e=>i.set(t(e),e)),i}function Mt(e){const t=[];return e.forEach((e,i)=>t.push(i)),t}p(wt,{convertToMap:()=>xt,keys:()=>Mt,mapById:()=>Et});var At=class extends rt{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.changeEventsDispatching=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation");const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.buildAutoGroupColumns(Tt(e.source))),this.addManagedPropertyListener("autoGroupColumnDef",e=>this.onAutoGroupColumnDefChanged(Tt(e.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],e=>this.onSharedColDefChanged(Tt(e.source))),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Tt(e.source))),this.addManagedListener(this.eventService,ct.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;ot(null,e,e=>{i[e.getInstanceId()]=e}),t&&ot(null,t,e=>{i[e.getInstanceId()]=null});const s=Object.values(i).filter(e=>null!=e);this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,r=this.primaryColumnTree,n=this.columnFactory.createColumnTree(this.columnDefs,!0,r,t);this.destroyOldColumns(this.primaryColumnTree,n.columnTree),this.primaryColumnTree=n.columnTree,this.primaryHeaderRowCount=n.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(e=>this.primaryColumnsMap[e.getId()]=e),this.extractRowGroupColumns(t,s),this.extractPivotColumns(t,s),this.extractValueColumns(t,s),this.ready=!0;const o=void 0===this.gridColsArePrimary;(this.gridColsArePrimary||o||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispatching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){const t={type:ct.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t),"gridInitializing"===e&&this.onColumnsReady()}dispatchEverythingChanged(e){const t={type:ct.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(e=>this.gridColumns.indexOf(e)>=0),i=this.gridColumns.filter(e=>t.indexOf(e)<0);this.gridColumns=[...i,...t],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gos.get("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}checkViewportColumns(e=!1){if(null==this.displayedColumnsCenter)return;if(!this.extractViewport())return;const t={type:ct.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(z("Pivot mode not available with treeData."),!1)}setPivotMode(e,t){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;if(this.pivotMode=e,!this.gridColumns)return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:ct.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(b(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let s=null;return this.secondaryColumns.forEach(t=>{const r=t.getColDef().pivotKeys,n=t.getColDef().pivotValueColumn;Re(r,e)&&n===i&&(s=t)}),s}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?Ie(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?Ie(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));const{columns:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:r,source:n="api"}=e;this.animationFrameService.flushAllFrames();const o=[];let a=-1;const l=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),c=null!=s?s:l;for(;0!==a;)a=0,this.actionOnGridColumns(t,e=>{if(o.indexOf(e)>=0)return!1;const t=this.autoWidthCalculator.getPreferredWidthForColumn(e,l);if(t>0){const i=this.normaliseColumnWidth(e,t);e.setActualWidth(i,n),o.push(e),a++}return!0},n);c||this.autoSizeColumnGroupsByColumns(t,n,r),this.dispatchColumnResizedEvent(o,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,s=null){if(e&&e.length){const r={type:ct.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(r)}}dispatchColumnChangedEvent(e,t,i){const s={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:s,finished:r}=e,n={type:ct.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:r,source:i};this.eventService.dispatchEvent(n)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,e=>e.getPinned()),r={type:ct.EVENT_COLUMN_PINNED,pinned:null!=s?s:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(r)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,e=>e.isVisible()),r={type:ct.EVENT_COLUMN_VISIBLE,visible:s,columns:e,column:i,source:t};this.eventService.dispatchEvent(r)}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let r;this.getGridColumns(e).forEach(e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||s.add(t),t=t.getParent()});for(const e of s){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(r=t.getHeaderCtrlForColumn(e),r)break;r&&r.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=e=>{for(let s=0;s<e.length;s++){const r=e[s];r instanceof we?t.push(r):r instanceof Ee&&i(r.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,s){const r=[];let n=null;for(let o=0;o<t.length;o++){const a=t[o],l=t.length-o,c=Math.min(a.getColSpan(e),l),h=[a];if(c>1){const e=c-1;for(let i=1;i<=e;i++)h.push(t[o+i]);o+=e}let d;i?(d=!1,h.forEach(e=>{i(e)&&(d=!0)})):d=!0,d&&(0===r.length&&n&&s&&s(a)&&r.push(n),r.push(a)),n=a}return r}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,t,e=>{const t=e.getLeft();return C(t)&&t>this.viewportLeft})}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const s="first"===t;let r;if(e instanceof lt){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;r=s?t[0]:Ie(t)}else r=e;return(s?i[0]:Ie(i))===r}getAriaColumnIndex(e){let t;return t=e instanceof lt?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,r=this.viewportRight+200;return!(t<s&&i<s||t>r&&i>r)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,s,r,n){if(!e||S(e))return;let o=!1;if(e.forEach(e=>{if(!e)return;const r=this.getPrimaryColumn(e);if(r){if(i){if(t.indexOf(r)>=0)return;t.push(r)}else{if(t.indexOf(r)<0)return;_e(t,r)}s(r),o=!0}}),!o)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n);const a={type:r,columns:t,column:1===t.length?t[0]:null,source:n};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,e=>e.setPivotActive(!0,t),ct.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,ct.EVENT_COLUMN_PIVOT_CHANGED,!0,(e,i)=>{i.setPivotActive(e,t)},t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,e=>e.setPivotActive(!1,t),ct.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,s,r,n){if(!this.gridColumns)return;const o=new Map;t.forEach((e,t)=>o.set(e,t)),t.length=0,C(e)&&e.forEach(e=>{const i=this.getPrimaryColumn(e);i&&t.push(i)}),t.forEach((e,t)=>{const i=o.get(e);void 0!==i?s&&i!==t||o.delete(e):o.set(e,0)}),(this.primaryColumns||[]).forEach(e=>{const i=t.indexOf(e)>=0;r(i,e)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n),this.dispatchColumnChangedEvent(i,[...o.keys()],n)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,ct.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),ct.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),ct.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();C(i)&&t<i&&(t=i);const s=e.getMaxWidth();return C(s)&&e.isGreaterThanMax(t)&&(t=s),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,s){const r=[];e.forEach(e=>{const i=this.getPrimaryOrGridColumn(e.key);if(i&&(r.push({width:e.newWidth,ratios:[1],columns:[i]}),"shift"===this.gos.get("colResizeDefault")&&(t=!t),t)){const t=this.getDisplayedColAfter(i);if(!t)return;const s=i.getActualWidth()-e.newWidth,n=t.getActualWidth()+s;r.push({width:n,ratios:[1],columns:[t]})}}),0!==r.length&&this.resizeColumnSets({resizeSets:r,finished:i,source:s})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,r=0,n=!0;return t.forEach(e=>{const t=e.getMinWidth();s+=t||0;const i=e.getMaxWidth();C(i)&&i>0?r+=i:n=!1}),i>=s&&(!n||i<=r)}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(t&&!t.every(e=>this.checkMinAndMaxWidthsForSet(e))){if(i){const e=t&&t.length>0?t[0].columns:null;this.dispatchColumnResizedEvent(e,i,s)}return}const r=[],n=[];t.forEach(e=>{const{width:t,columns:i,ratios:o}=e,a={},l={};i.forEach(e=>n.push(e));let c=!0,h=0;for(;c;){if(h++,h>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}c=!1;const e=[];let s=0,r=t;i.forEach((t,i)=>{if(l[t.getId()])r-=a[t.getId()];else{e.push(t);const r=o[i];s+=r}});const n=1/s;e.forEach((i,s)=>{let h;s===e.length-1?h=r:(h=Math.round(o[s]*t*n),r-=h);const d=i.getMinWidth(),u=i.getMaxWidth();C(d)&&h<d?(h=d,l[i.getId()]=!0,c=!0):C(u)&&u>0&&h>u&&(h=u,l[i.getId()]=!0,c=!0),a[i.getId()]=h})}i.forEach(e=>{const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,s),r.push(e))})});const o=r.length>0;let a=[];o&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(s),this.updateBodyWidths(),this.checkViewportColumns());const l=n.concat(a);(o||i)&&this.dispatchColumnResizedEvent(l,i,s,a)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.getPrimaryColumn(e);s&&(s.setAggFunc(t),this.dispatchColumnChangedEvent(ct.EVENT_COLUMN_VALUE_CHANGED,[s],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupColumns[e],r=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,s);const n={type:ct.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:r,column:1===r.length?r[0]:null,source:i};this.eventService.dispatchEvent(n)}moveColumns(e,t,i,s=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const r=this.getGridColumns(e);!this.doesMovePassRules(r,t)||(Ve(this.gridColumns,r,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:r,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return Ve(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(e=>this.gridColumns.indexOf(e)<0).length>0||e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach(e=>{const s=(r=e.getColDef().lockPosition)?!0===r||"left"===r?0:2:1;var r;s<t&&(i=!1),t=s}),i}doesMovePassMarryChildren(e){let t=!0;return ot(null,this.gridBalancedTree,i=>{if(!(i instanceof Ee))return;const s=i,r=s.getColGroupDef();if(!r||!r.marryChildren)return;const n=[];s.getLeafColumns().forEach(t=>{const i=e.indexOf(t);n.push(i)}),Math.max.apply(Math,n)-Math.min.apply(Math,n)>s.getLeafColumns().length-1&&(t=!1)}),t}moveColumnByIndex(e,t,i){if(!this.gridColumns)return;const s=this.gridColumns[e];this.moveColumns([s],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)):this.lastPrimaryOrder&&e.sort((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const s={type:ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(s);const r={type:ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(r)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var e;return null!=(e=this.gridColumns)?e:[]}isRowGroupEmpty(){return S(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gos.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,e=>e.getPinned()!==s&&(e.setPinned(s),!0),i,()=>({type:ct.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,s){if(S(e))return;const r=[];if(e.forEach(e=>{if(!e)return;const i=this.getGridColumn(e);i&&!1!==t(i)&&r.push(i)}),r.length&&(this.updateDisplayedColumns(i),C(s)&&s)){const e=s();e.columns=r,e.column=1===r.length?r[0]:null,this.eventService.dispatchEvent(e)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),r="After"===t?Ie(s):s[0],n=`getDisplayedCol${t}`;for(;;){const t=this[n](r);if(!t)return null;const s=this.getColumnGroupAtLevel(t,i);if(s!==e)return s}}getColumnGroupAtLevel(e,t){let i,s,r=e.getParent();for(;i=r.getProvidedColumnGroup().getLevel(),s=r.getPaddingLevel(),!(i+s<=t);)r=r.getParent();return r}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,r=null!=e.getSort()?e.getSort():null,n=null!=e.getSortIndex()?e.getSortIndex():null,o=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:r,sortIndex:n,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:o}}getColumnState(){if(b(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(e){const t=xt(this.gridColumns.map((e,t)=>[e.getColId(),t]));e.sort((e,i)=>(t.has(e.colId)?t.get(e.colId):-1)-(t.has(i.colId)?t.get(i.colId):-1))}resetColumnState(e){if(S(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let s=1e3,r=1e3,n=[];this.groupAutoColumns&&(n=n.concat(this.groupAutoColumns)),t&&(n=n.concat(t)),n.forEach(e=>{const t=this.getColumnStateFromColDef(e);b(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=s++),b(t.pivotIndex)&&t.pivot&&(t.pivotIndex=r++),i.push(t)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),s=t(i.sort,i.initialSort),r=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),o=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),l=t(i.flex,i.initialFlex);let c=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null!=c||null!=h&&0!=h||(c=null,h=null);let d=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);null!=d||null!=u&&0!=u||(d=null,u=null);const p=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:r,hide:n,pinned:o,width:a,flex:l,rowGroup:h,rowGroupIndex:c,pivot:u,pivotIndex:d,aggFunc:p}}applyColumnState(e,t){if(S(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(i,s,r)=>{const n=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const o=s.slice(),a={},l={},c=[],h=[];let d=0;const u=this.rowGroupColumns.slice(),p=this.pivotColumns.slice();i.forEach(i=>{const s=i.colId||"";if(s.startsWith(ut))return c.push(i),void h.push(i);const n=r(s);n?(this.syncColumnWithStateItem(n,i,e.defaultState,a,l,!1,t),_e(o,n)):(h.push(i),d+=1)});const g=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,l,!1,t);o.forEach(g);const m=(e,t,i,s)=>{const r=e[i.getId()],n=e[s.getId()],o=null!=r,a=null!=n;if(o&&a)return r-n;if(o)return-1;if(a)return 1;const l=t.indexOf(i),c=t.indexOf(s),h=l>=0;return h&&c>=0?l-c:h?-1:1};this.rowGroupColumns.sort(m.bind(this,a,u)),this.pivotColumns.sort(m.bind(this,l,p)),this.updateGridColumns();const f=this.groupAutoColumns?this.groupAutoColumns.slice():[];return c.forEach(i=>{const s=this.getAutoColumn(i.colId);_e(f,s),this.syncColumnWithStateItem(s,i,e.defaultState,null,null,!0,t)}),f.forEach(g),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),n(),{unmatchedAndAutoStates:h,unmatchedCount:d}};this.columnAnimationService.start();let{unmatchedAndAutoStates:s,unmatchedCount:r}=i(e.state||[],this.primaryColumns||[],e=>this.getPrimaryColumn(e));return(s.length>0||C(e.defaultState))&&(r=i(s,this.secondaryColumns||[],e=>this.getSecondaryColumn(e)).unmatchedCount),this.columnAnimationService.finish(),0===r}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(e=>{if(!e.colId||i[e.colId])return;const s=this.gridColumnsMap[e.colId];s&&(t.push(s),i[e.colId]=!0)});let s=0;this.gridColumns.forEach(e=>{const r=e.getColId();null==i[r]&&(r.startsWith(ut)?Ge(t,e,s++):t.push(e))}),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),s={};return i.forEach(e=>{s[e.colId]=e}),()=>{const r=this.getPrimaryAndSecondaryAndAutoColumns(),n=(t,i,s,r)=>{if(Re(i.map(r),s.map(r)))return;const n=new Set(i);s.forEach(e=>{n.delete(e)||n.add(e)});const o=[...n],a={type:t,columns:o,column:1===o.length?o[0]:null,source:e};this.eventService.dispatchEvent(a)},o=e=>{const t=[];return r.forEach(i=>{const r=s[i.getColId()];r&&e(r,i)&&t.push(i)}),t},a=e=>e.getColId();n(ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,a),n(ct.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,a);const l=o((e,t)=>{const i=null!=e.aggFunc,s=i!=t.isValueActive(),r=i&&e.aggFunc!=t.getAggFunc();return s||r});l.length>0&&this.dispatchColumnChangedEvent(ct.EVENT_COLUMN_VALUE_CHANGED,l,e),this.dispatchColumnResizedEvent(o((e,t)=>e.width!=t.getActualWidth()),!0,e),this.dispatchColumnPinnedEvent(o((e,t)=>e.pinned!=t.getPinned()),e),this.dispatchColumnVisibleEvent(o((e,t)=>e.hide==t.isVisible()),e);const c=o((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex());c.length>0&&this.sortController.dispatchSortChangedEvents(e,c),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),s={};i.forEach(e=>s[e.colId]=e);const r={};e.forEach(e=>{s[e.colId]&&(r[e.colId]=!0)});const n=e.filter(e=>r[e.colId]),o=i.filter(e=>r[e.colId]),a=[];o.forEach((e,t)=>{const i=n&&n[t];if(i&&i.colId!==e.colId){const e=this.getGridColumn(i.colId);e&&a.push(e)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,s,r,n,o){var a;if(!e)return;const l=(e,s)=>{const r={value1:void 0,value2:void 0};let n=!1;return t&&(void 0!==t[e]&&(r.value1=t[e],n=!0),C(s)&&void 0!==t[s]&&(r.value2=t[s],n=!0)),!n&&i&&(void 0!==i[e]&&(r.value1=i[e]),C(s)&&void 0!==i[s]&&(r.value2=i[s])),r},c=l("hide").value1;void 0!==c&&e.setVisible(!c,o);const h=l("pinned").value1;void 0!==h&&e.setPinned(h);const d=null!=(a=e.getColDef().minWidth)?a:this.environment.getMinColWidth(),u=l("flex").value1;if(void 0!==u&&e.setFlex(u),null==u){const t=l("width").value1;null!=t&&null!=d&&t>=d&&e.setActualWidth(t,o)}const p=l("sort").value1;void 0!==p&&("desc"===p||"asc"===p?e.setSort(p,o):e.setSort(void 0,o));const g=l("sortIndex").value1;if(void 0!==g&&e.setSortIndex(g),n||!e.isPrimary())return;const m=l("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,o),this.valueColumns.push(e))):(C(m)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,o),_e(this.valueColumns,e))));const{value1:f,value2:y}=l("rowGroup","rowGroupIndex");void 0===f&&void 0===y||("number"==typeof y||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,o),this.rowGroupColumns.push(e)),s&&"number"==typeof y&&(s[e.getId()]=y)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,o),_e(this.rowGroupColumns,e)));const{value1:v,value2:b}=l("pivot","pivotIndex");void 0===v&&void 0===b||("number"==typeof b||v?(e.isPivotActive()||(e.setPivotActive(!0,o),this.pivotColumns.push(e)),r&&"number"==typeof b&&(r[e.getId()]=b)):e.isPivotActive()&&(e.setPivotActive(!1,o),_e(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(e=>{const s=t(e);s&&i.push(s)}),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if("string"==typeof e&&i[e])return i[e];for(let i=0;i<t.length;i++)if(this.columnsMatch(t[i],e))return t[i];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&C(this.groupAutoColumns)&&!b(this.groupAutoColumns)&&this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,r=e.getColId()==t;return i||s||r}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,r){const n=e.headerValueGetter;if(n){const o=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:r});return"function"==typeof n?n(o):"string"==typeof n?this.expressionService.evaluate(n,o):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?bt(e.field):""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let s,r=null;if(C(i)){const n=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,o=void 0!==e.getColDef().pivotTotalColumnIds;if(n&&!o)return t;r=i?i.getAggFunc():null,s=!0}else{const t=e.isValueActive(),i=this.pivotMode||!this.isRowGroupEmpty();t&&i?(r=e.getAggFunc(),s=!0):s=!1}if(s){const e="string"==typeof r?r:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof lt)return e;const i=this.getAllDisplayedTrees(),s="number"==typeof t;let r=null;return Dt(i,!1,i=>{if(i instanceof lt){const n=i;let o;o=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),o&&(r=n)}}),r}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(t,i)=>t.setValueActive(i,e),()=>{},()=>{},e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},e=>null!=e.initialAggFunc&&""!=e.initialAggFunc),this.valueColumns.forEach(e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(t,i)=>t.setRowGroupActive(i,e),e=>e.rowGroupIndex,e=>e.initialRowGroupIndex,e=>e.rowGroup,e=>e.initialRowGroup)}extractColumns(e=[],t=[],i,s,r,n,o){const a=[],l=[];(this.primaryColumns||[]).forEach(i=>{const c=e.indexOf(i)<0,h=i.getColDef(),d=E(n(h)),u=E(o(h)),p=x(s(h)),g=x(r(h));let m;m=void 0!==d?d:void 0!==p?null!==p&&p>=0:c?void 0!==u?u:!(void 0===g)&&null!=g&&g>=0:t.indexOf(i)>=0,m&&((c?null!=p||null!=g:null!=p)?a.push(i):l.push(i))});const c=e=>{const t=s(e.getColDef()),i=r(e.getColDef());return null!=t?t:i};a.sort((e,t)=>{const i=c(e),s=c(t);return i===s?0:i<s?-1:1});const h=[].concat(a);return t.forEach(e=>{l.indexOf(e)>=0&&h.push(e)}),l.forEach(e=>{h.indexOf(e)<0&&h.push(e)}),t.forEach(e=>{h.indexOf(e)<0&&i(e,!1)}),h.forEach(e=>{t.indexOf(e)<0&&i(e,!0)}),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(t,i)=>t.setPivotActive(i,e),e=>e.pivotIndex,e=>e.initialPivotIndex,e=>e.pivot,e=>e.initialPivot)}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];ot(null,this.primaryColumnTree,e=>{if(e instanceof Ee){const i=e.getColGroupDef(),s={groupId:e.getGroupId(),open:i?i.openByDefault:void 0};t.push(s)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return ot(null,this.gridBalancedTree,t=>{t instanceof Ee&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];if(e.forEach(e=>{const t=e.groupId,s=e.open,r=this.getProvidedColumnGroup(t);r&&r.isExpanded()!==s&&(this.logger.log("columnGroupOpened("+r.getGroupId()+","+s+")"),r.setExpanded(s),i.push(r))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length){const e={type:ct.EVENT_COLUMN_GROUP_OPENED,columnGroup:1===Ee.length?i[0]:void 0,columnGroups:i};this.eventService.dispatchEvent(e)}this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;s=e instanceof Ee?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return ot(null,this.gridBalancedTree,i=>{i instanceof Ee&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&b(this.secondaryColumns)?this.gridColumns.filter(e=>{const t=this.groupAutoColumns&&He(this.groupAutoColumns,e),i=this.valueColumns&&He(this.valueColumns,e);return t||i}):this.gridColumns.filter(e=>this.groupAutoColumns&&He(this.groupAutoColumns,e)||e.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(e=>{C(e.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={},this.gridColumns.forEach(e=>{const t=e.getColDef(),i=t.showRowGroup;t&&C(i)&&(this.groupDisplayColumns.push(e),"string"==typeof i?this.groupDisplayColumnsMap[i]=e:!0===i&&this.getRowGroupColumns().forEach(t=>{this.groupDisplayColumnsMap[t.getId()]=e}))})}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return C(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e;if(i||!b(this.secondaryColumns)){if(i){this.processSecondaryColumnDefinitions(e);const i=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,i.columnTree),this.secondaryBalancedTree=i.columnTree,this.secondaryHeaderRowCount=i.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(e=>this.secondaryColumnsMap[e.getId()]=e),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=e=>{e.forEach(e=>{if(C(e.children)){const t=e;i&&i(t),s(t.children)}else t&&t(e)})};e&&s(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const e=xt(this.groupAutoColumns.map(e=>[e,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(t=>!e.has(t)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(t=>!e.has(t)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const e=this.secondaryColumns.some(e=>void 0!==this.gridColumnsMap[e.getColId()]);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,e&&(t=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,t=this.lastPrimaryOrder);if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(t),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(e=>this.gridColumnsMap[e.getId()]=e),this.setAutoHeightActive(),!Re(e,this.gridBalancedTree)){const e={type:ct.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||z("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(b(e))return;const t=xt(e.map((e,t)=>[e,t]));let i=!0;if(this.gridColumns.forEach(e=>{t.has(e)&&(i=!1)}),i)return;const s=xt(this.gridColumns.map(e=>[e,!0])),r=e.filter(e=>s.has(e)),n=xt(r.map(e=>[e,!0])),o=this.gridColumns.filter(e=>!n.has(e)),a=r.slice();o.forEach(e=>{let t=e.getOriginalParent();if(!t)return void a.push(e);const i=[];for(;!i.length&&t;)t.getLeafColumns().forEach(e=>{const t=a.indexOf(e)>=0,s=i.indexOf(e)<0;t&&s&&i.push(e)}),t=t.getOriginalParent();if(!i.length)return void a.push(e);const s=i.map(e=>a.indexOf(e)),r=Math.max(...s);Ge(a,e,r+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!=(e=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?t:t.filter(e=>e.isVisible()||e.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(e=>{const r=e.getColDef().lockPosition;"right"===r?s.push(e):"left"===r||!0===r?t.push(e):i.push(e)}),[...t,...i,...s]}addAutoGroupToGridColumns(){if(b(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:ct.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],s=[];for(const r of e){const e=r.getPinned();e?!0===e||"left"===e?t.push(r):s.push(r):i.push(r)}this.ariaOrderColumns=t.concat(i).concat(s)}joinDisplayedColumns(){this.gos.get("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(s=>{if(i){let t=this.getWidthOfColsInList(s);s.forEach(i=>{t-=i.getActualWidth(),i.setLeft(t,e)})}else{let t=0;s.forEach(i=>{i.setLeft(t,e),t+=i.getActualWidth()})}Oe(t,s)}),t.forEach(t=>{t.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(e=>{e instanceof lt&&e.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,Dt(e,!0,e=>{e instanceof we&&t.push(e)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t]}return b(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(t=>e[t.getId()]=!0);const t=(i,s,r)=>{let n=!1;for(let o=0;o<i.length;o++){const a=i[o];let l=!1;if(a instanceof we)l=!0===e[a.getId()];else{const e=a.getDisplayedChildren();e&&(l=t(e,s,r+1))}l&&(n=!0,s[r]||(s[r]=[]),s[r].push(a))}return n};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.viewportColumns.map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let s=-1;if(e.resizingCols){const t=new Set(e.resizingCols);let i=this.displayedColumnsCenter;for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){s=e;break}}let r=0,n=[],o=0,a=0;for(let e=0;e<this.displayedColumnsCenter.length;e++)this.displayedColumnsCenter[e].getFlex()&&e>s?(n.push(this.displayedColumnsCenter[e]),a+=this.displayedColumnsCenter[e].getFlex(),o+=null!=(t=this.displayedColumnsCenter[e].getMinWidth())?t:0):r+=this.displayedColumnsCenter[e].getActualWidth();if(!n.length)return[];let l=[];r+o>this.flexViewportWidth&&(n.forEach(e=>{var t;return e.setActualWidth(null!=(t=e.getMinWidth())?t:0,i)}),l=n,n=[]);const c=[];let h;e:for(;;){h=this.flexViewportWidth-r;const e=h/a;for(let t=0;t<n.length;t++){const s=n[t],o=e*s.getFlex();let h=0;const d=s.getMinWidth(),u=s.getMaxWidth();if(C(d)&&o<d?h=d:C(u)&&o>u&&(h=u),h){s.setActualWidth(h,i),Ne(n,s),a-=s.getFlex(),l.push(s),r+=s.getActualWidth();continue e}c[t]=Math.round(o)}break}let d=h;return n.forEach((e,t)=>{e.setActualWidth(Math.min(c[t],d),i),l.push(e),d-=c[t]}),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,i,n),n}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var r,n,o,h,d;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,s));const u={};s&&(null==(r=null==s?void 0:s.columnLimits)||r.forEach(e=>{var t=e,{key:i}=t,s=((e,t)=>{var i={};for(var s in e)l.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&a)for(var s of a(e))t.indexOf(s)<0&&c.call(e,s)&&(i[s]=e[s]);return i})(t,["key"]);u["string"==typeof i?i:i.getColId()]=s}));const p=this.getAllDisplayedColumns(),g=e===this.getWidthOfColsInList(p);if(e<=0||!p.length||g)return;const m=[],f=[];p.forEach(e=>{!0===e.getColDef().suppressSizeToFit?f.push(e):m.push(e)});const y=m.slice(0);let v=!1;const b=e=>{_e(m,e),f.push(e)};for(m.forEach(e=>{var i,r;e.resetActualWidth(t);const n=null==u?void 0:u[e.getId()],o=null!=(i=null==n?void 0:n.minWidth)?i:null==s?void 0:s.defaultMinWidth,a=null!=(r=null==n?void 0:n.maxWidth)?r:null==s?void 0:s.defaultMaxWidth,l=e.getActualWidth();"number"==typeof o&&l<o?e.setActualWidth(o,t,!0):"number"==typeof a&&l>a&&e.setActualWidth(a,t,!0)});!v;){v=!0;const i=e-this.getWidthOfColsInList(f);if(i<=0)m.forEach(e=>{var i,r;const n=null!=(r=null==(i=null==u?void 0:u[e.getId()])?void 0:i.minWidth)?r:null==s?void 0:s.defaultMinWidth;"number"!=typeof n?e.setMinimum(t):e.setActualWidth(n,t,!0)});else{const e=i/this.getWidthOfColsInList(m);let r=i;for(let i=m.length-1;i>=0;i--){const a=m[i],l=null==u?void 0:u[a.getId()],c=null!=(n=null==l?void 0:l.minWidth)?n:null==s?void 0:s.defaultMinWidth,p=null!=(o=null==l?void 0:l.maxWidth)?o:null==s?void 0:s.defaultMaxWidth,g=null!=(h=a.getMinWidth())?h:0,f=null!=(d=a.getMaxWidth())?d:Number.MAX_VALUE,y="number"==typeof c&&c>g?c:a.getMinWidth(),S="number"==typeof p&&p<f?p:a.getMaxWidth();let w=Math.round(a.getActualWidth()*e);C(y)&&w<y?(w=y,b(a),v=!1):C(S)&&w>S?(w=S,b(a),v=!1):0===i&&(w=r),a.setActualWidth(w,t,!0),r-=w}}}y.forEach(e=>{e.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),i||this.dispatchColumnResizedEvent(y,!0,t)}buildDisplayedTrees(e){const t=[],i=[],s=[];e.forEach(e=>{switch(e.getPinned()){case"left":t.push(e);break;case"right":i.push(e);break;default:s.push(e)}});const r=new dt;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,r,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,r,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,r,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Dt(this.displayedTreeCentre,!1,e),Dt(this.displayedTreeLeft,!1,e),Dt(this.displayedTreeRight,!1,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Dt(this.getAllDisplayedTrees(),!1,e=>{e instanceof lt&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gos.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if(!(this.rowGroupColumns.length>0||this.gos.get("treeData"))||i||t)this.groupAutoColumns=null;else{const t=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(t,this.groupAutoColumns)||e)return this.groupAutoColumns=t,!0}return!1}isGroupSuppressAutoColumn(){return"custom"===this.gos.get("groupDisplayType")||"custom"===this.gos.get("treeDataDisplayType")}autoColsEqual(e,t){return Re(e,t,(e,t)=>e.getColId()===t.getColId())}getWidthOfColsInList(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getFirstDisplayedColumn(){const e=this.gos.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?Ie(s):s[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const t={type:ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(e=>e.isAutoHeaderHeight()).map(e=>e.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return null!=(e=this.gos.get("headerHeight"))?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!=(e=this.gos.get("floatingFiltersHeight"))?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!=(e=this.gos.get("groupHeaderHeight"))?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!=(e=this.gos.get("pivotHeaderHeight"))?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!=(e=this.gos.get("pivotGroupHeaderHeight"))?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}isColumnGroupingLocked(e){const t=this.gos.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===t)&&(-1===t||t>this.rowGroupColumns.findIndex(t=>t.getColId()===e.getColId()))}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const s=(e,t,s,r,n,o)=>{if(!t.length||!this.primaryColumns)return[];const a=Object.keys(e),l=new Set(a),c=new Set(a),h=new Set(t.map(e=>{const t=e.getColId();return c.delete(t),t}).concat(a)),d=[],u={};let p=0;for(let e=0;e<this.primaryColumns.length;e++){const t=this.primaryColumns[e].getColId();h.has(t)&&(d.push(t),u[t]=p++)}let g=1e3,m=!1,f=0;const y=t=>{const i=u[t];for(let t=f;t<i;t++){const i=d[t];c.has(i)&&(e[i][n]=g++,c.delete(i))}f=i};t.forEach(t=>{const a=t.getColId();if(l.has(a))y(a),e[a][n]=g++;else{const l=t.getColDef();(null===l[n]||void 0===l[n]&&null==l[o])&&(m||(l[s]||void 0===l[s]&&l[r]?y(a):(c.forEach(t=>{e[t][n]=g+u[t]}),g+=d.length,m=!0)),i[a]||(i[a]={colId:a}),i[a][n]=g++)}})};return s(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:s}=e,r=null==t?void 0:t.map(({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:s,columnLimits:r})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==(null==e?void 0:e.type))return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)})}};function Tt(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Dt(e,t,i){if(e)for(let s=0;s<e.length;s++){const r=e[s];r instanceof lt&&Dt(t?r.getDisplayedChildren():r.getChildren(),t,i),i(r)}}g([de("expressionService")],At.prototype,"expressionService",2),g([de("columnFactory")],At.prototype,"columnFactory",2),g([de("displayedGroupCreator")],At.prototype,"displayedGroupCreator",2),g([de("ctrlsService")],At.prototype,"ctrlsService",2),g([de("autoWidthCalculator")],At.prototype,"autoWidthCalculator",2),g([de("columnAnimationService")],At.prototype,"columnAnimationService",2),g([de("autoGroupColService")],At.prototype,"autoGroupColService",2),g([de("valueCache")],At.prototype,"valueCache",2),g([de("animationFrameService")],At.prototype,"animationFrameService",2),g([de("sortController")],At.prototype,"sortController",2),g([de("columnDefFactory")],At.prototype,"columnDefFactory",2),g([ue("aggFuncService")],At.prototype,"aggFuncService",2),g([le],At.prototype,"init",1),g([ce],At.prototype,"destroyColumns",1),g([m(0,ge("loggerFactory"))],At.prototype,"setBeans",1),At=g([he("columnModel")],At);var It=class extends rt{createDisplayedGroups(e,t,i,s){const r=this.mapOldGroupsById(s),n=[];let o=e;for(;o.length;){const e=o;o=[];let s=0;const a=a=>{const l=s;s=a;const c=e[l],h=(c instanceof lt?c.getProvidedColumnGroup():c).getOriginalParent();if(null==h){for(let t=l;t<a;t++)n.push(e[t]);return}const d=this.createColumnGroup(h,t,r,i);for(let t=l;t<a;t++)d.addChild(e[t]);o.push(d)};for(let t=1;t<e.length;t++){const i=e[t],r=(i instanceof lt?i.getProvidedColumnGroup():i).getOriginalParent(),n=e[s];r!==(n instanceof lt?n.getProvidedColumnGroup():n).getOriginalParent()&&a(t)}s<e.length&&a(e.length)}return this.setupParentsIntoColumns(n,null),n}createColumnGroup(e,t,i,s){const r=e.getGroupId(),n=t.getInstanceIdForKey(r);let o=i[lt.createUniqueId(r,n)];return o&&o.getProvidedColumnGroup()!==e&&(o=null),C(o)?o.reset():(o=new lt(e,r,n,s),this.context.createBean(o)),o}mapOldGroupsById(e){const t={},i=e=>{e.forEach(e=>{if(e instanceof lt){const s=e;t[e.getUniqueId()]=s,i(s.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(e=>{if(e.setParent(t),e instanceof lt){const t=e;this.setupParentsIntoColumns(t.getChildren(),t)}})}};It=g([he("displayedGroupCreator")],It);var Rt={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,excludeHiddenColumnsFromQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,enableChartToolPanelsButton:!0,suppressChartToolPanelsButton:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressParentsInRowNodes:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,suppressAggAtRootLevel:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,functionsPassive:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},Pt=class{};Pt.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],Pt.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],Pt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],Pt.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],Pt.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilterAllLevels","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval"],Pt.OTHER_PROPERTIES=["suppressStickyTotalRow"],Pt.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],Pt.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],Pt.FUNCTION_PROPERTIES=[...Pt.FUNCTIONAL_PROPERTIES,...Pt.CALLBACK_PROPERTIES],Pt.ALL_PROPERTIES=[...Pt.ARRAY_PROPERTIES,...Pt.OBJECT_PROPERTIES,...Pt.STRING_PROPERTIES,...Pt.NUMBER_PROPERTIES,...Pt.FUNCTION_PROPERTIES,...Pt.BOOLEAN_PROPERTIES,...Pt.OTHER_PROPERTIES];var kt=Pt,Lt=class e{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(t,i){"object"!=typeof t&&(t={});const s=d({},t);return e.getGridOptionKeys().forEach(t=>{const r=i[t];void 0!==r&&r!==e.VUE_OMITTED_PROPERTY&&(s[t]=r)}),s}static processOnChange(t,i,s){if(!t)return;const r={};let n=!1;if(Object.keys(t).filter(t=>e.ALL_PROPERTIES_AND_CALLBACKS_SET.has(t)).forEach(e=>{r[e]=t[e],n=!0}),!n)return;i.__internalUpdateGridOptions(r,!0);const o={type:ct.EVENT_COMPONENT_STATE_CHANGED};k(r,(e,t)=>{o[e]=t}),i.dispatchEvent(o)}};Lt.EVENTS=D(ct),Lt.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",Lt.EXCLUDED_INTERNAL_EVENTS=[ct.EVENT_SCROLLBAR_WIDTH_CHANGED,ct.EVENT_CHECKBOX_CHANGED,ct.EVENT_HEIGHT_SCALE_CHANGED,ct.EVENT_BODY_HEIGHT_CHANGED,ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,ct.EVENT_SCROLL_VISIBILITY_CHANGED,ct.EVENT_COLUMN_HOVER_CHANGED,ct.EVENT_FLASH_CELLS,ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,ct.EVENT_DISPLAYED_ROWS_CHANGED,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,ct.EVENT_STORE_UPDATED,ct.EVENT_COLUMN_PANEL_ITEM_DRAG_START,ct.EVENT_COLUMN_PANEL_ITEM_DRAG_END,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,ct.EVENT_FULL_WIDTH_ROW_FOCUSED,ct.EVENT_HEADER_HEIGHT_CHANGED,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,ct.EVENT_CELL_FOCUS_CLEARED,ct.EVENT_GRID_STYLES_CHANGED,ct.EVENT_FILTER_DESTROYED,ct.EVENT_ROW_DATA_UPDATE_STARTED,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,ct.EVENT_DATA_TYPES_INFERRED,ct.EVENT_FIELD_VALUE_CHANGED,ct.EVENT_FIELD_PICKER_VALUE_SELECTED,ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,ct.EVENT_SUPPRESS_MENU_HIDE_CHANGED,ct.EVENT_SUPPRESS_FIELD_DOT_NOTATION,ct.EVENT_ROW_COUNT_READY,ct.EVENT_SIDE_BAR_UPDATED],Lt.PUBLIC_EVENTS=Lt.EVENTS.filter(e=>!He(Lt.EXCLUDED_INTERNAL_EVENTS,e)),Lt.EVENT_CALLBACKS=Lt.EVENTS.map(e=>Lt.getCallbackForEvent(e)),Lt.BOOLEAN_PROPERTIES=kt.BOOLEAN_PROPERTIES,Lt.ALL_PROPERTIES=kt.ALL_PROPERTIES,Lt.ALL_PROPERTIES_AND_CALLBACKS=[...Lt.ALL_PROPERTIES,...Lt.EVENT_CALLBACKS],Lt.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(Lt.ALL_PROPERTIES_AND_CALLBACKS);var Nt=Lt,_t=class extends rt{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(e=>this.addComponent(e))}addComponent(e){const t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};_t=g([he("agStackComponentsRegistry")],_t);var Ot={};function Ft(e,t,i){null==i||"string"==typeof i&&""==i?Bt(e,t):Gt(e,t,i)}function Gt(e,t,i){e.setAttribute(Vt(t),i.toString())}function Bt(e,t){e.removeAttribute(Vt(t))}function Vt(e){return`aria-${e}`}function Ht(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Ut(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function zt(e){return parseInt(e.getAttribute("aria-level"),10)}function Wt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function jt(e){return e.getAttribute("aria-label")}function Kt(e,t){Ft(e,"label",t)}function $t(e,t){Ft(e,"labelledby",t)}function Yt(e,t){Ft(e,"describedby",t)}function qt(e,t){Ft(e,"live",t)}function Xt(e,t){Ft(e,"atomic",t)}function Zt(e,t){Ft(e,"relevant",t)}function Qt(e,t){Ft(e,"level",t)}function Jt(e,t){Ft(e,"disabled",t)}function ei(e,t){Ft(e,"hidden",t)}function ti(e,t){Ft(e,"activedescendant",t)}function ii(e,t){Gt(e,"expanded",t)}function si(e){Bt(e,"expanded")}function ri(e,t){Gt(e,"setsize",t)}function ni(e,t){Gt(e,"posinset",t)}function oi(e,t){Gt(e,"multiselectable",t)}function ai(e,t){Gt(e,"rowcount",t)}function li(e,t){Gt(e,"rowindex",t)}function ci(e,t){Gt(e,"colcount",t)}function hi(e,t){Gt(e,"colindex",t)}function di(e,t){Gt(e,"colspan",t)}function ui(e,t){Gt(e,"sort",t)}function pi(e){Bt(e,"sort")}function gi(e,t){Ft(e,"selected",t)}function mi(e,t){Gt(e,"checked",void 0===t?"mixed":t)}function fi(e,t){Ft(e,"controls",t.id),$t(t,e.id)}function yi(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}p(Ot,{getAriaCheckboxStateName:()=>yi,getAriaLabel:()=>jt,getAriaLevel:()=>zt,getAriaPosInSet:()=>Wt,getAriaSortState:()=>Ut,removeAriaExpanded:()=>si,removeAriaSort:()=>pi,setAriaActiveDescendant:()=>ti,setAriaAtomic:()=>Xt,setAriaChecked:()=>mi,setAriaColCount:()=>ci,setAriaColIndex:()=>hi,setAriaColSpan:()=>di,setAriaControls:()=>fi,setAriaDescribedBy:()=>Yt,setAriaDisabled:()=>Jt,setAriaExpanded:()=>ii,setAriaHidden:()=>ei,setAriaLabel:()=>Kt,setAriaLabelledBy:()=>$t,setAriaLevel:()=>Qt,setAriaLive:()=>qt,setAriaMultiSelectable:()=>oi,setAriaPosInSet:()=>ni,setAriaRelevant:()=>Zt,setAriaRole:()=>Ht,setAriaRowCount:()=>ai,setAriaRowIndex:()=>li,setAriaSelected:()=>gi,setAriaSetSize:()=>ri,setAriaSort:()=>ui});var vi,Ci,bi,Si,wi,xi,Ei,Mi,Ai={};function Ti(){return void 0===vi&&(vi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),vi}function Di(){if(void 0===Ci)if(Ti()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(Ci=null!=e[1]?parseFloat(e[1]):0)}else Ci=0;return Ci}function Ii(){if(void 0===bi){const e=window;bi=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return bi}function Ri(){return void 0===Si&&(Si=/(firefox)/i.test(navigator.userAgent)),Si}function Pi(){return void 0===wi&&(wi=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),wi}function ki(){return void 0===xi&&(xi=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),xi}function Li(){return!Ti()||Di()>=15}function Ni(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||Ri())?t.toString():null}function _i(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function Oi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientWidth)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientWidth)||-1}function Fi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientHeight)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientHeight)||-1}function Gi(){return null==Mi&&Bi(),Mi}function Bi(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(Mi=i,Ei=0===i)}function Vi(){return null==Ei&&Bi(),Ei}p(Ai,{browserSupportsPreventScroll:()=>Li,getBodyHeight:()=>Fi,getBodyWidth:()=>Oi,getMaxDivHeight:()=>_i,getSafariVersion:()=>Di,getScrollbarWidth:()=>Gi,getTabIndex:()=>Ni,isBrowserChrome:()=>Ii,isBrowserFirefox:()=>Ri,isBrowserSafari:()=>Ti,isIOSUserAgent:()=>ki,isInvisibleScrollbar:()=>Vi,isMacOsUserAgent:()=>Pi});var Hi={};p(Hi,{dateToFormattedString:()=>Qi,parseDateTimeFromString:()=>Ji,serialiseDate:()=>Xi});var Ui={};function zi(e,t){return e.toString().padStart(t,"0")}function Wi(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function ji(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null}function Ki(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}function $i(e,t,i){return"number"!=typeof e?"":Yi(Math.round(100*e)/100,t,i)}function Yi(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function qi(e){return null==e?null:e.reduce((e,t)=>e+t,0)}function Xi(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>zi(e,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>zi(e,2)).join(":")),s}p(Ui,{cleanNumber:()=>ji,createArrayOfNumbers:()=>Wi,decToHex:()=>Ki,formatNumberCommas:()=>Yi,formatNumberTwoDecimalPlacesAndCommas:()=>$i,padStartWidthZeros:()=>zi,sum:()=>qi});var Zi=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Qi(e,t="YYYY-MM-DD"){const i=zi(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>zi(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Zi(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Zi(e.getDate())}`,DD:()=>zi(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>r[e.getDay()],ddd:()=>r[e.getDay()].slice(0,3),dd:()=>r[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Zi(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(n).join("|"),"g");return t.replace(o,e=>e in n?n[e]():e)}function Ji(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(e=>parseInt(e,10));if(3!==s.filter(e=>!isNaN(e)).length)return null;const[r,n,o]=s,a=new Date(r,n-1,o);if(a.getFullYear()!==r||a.getMonth()!==n-1||a.getDate()!==o)return null;if(!i||"00:00:00"===i)return a;const[l,c,h]=i.split(":").map(e=>parseInt(e,10));return l>=0&&l<24&&a.setHours(l),c>=0&&c<60&&a.setMinutes(c),h>=0&&h<60&&a.setSeconds(h),a}var es,ts={};function is(e,t,i){const s=e.parentElement;let r=s&&s.firstChild;for(;r;)t&&r.classList.toggle(t,r===e),i&&r.classList.toggle(i,r!==e),r=r.nextSibling}p(ts,{FOCUSABLE_EXCLUDE:()=>rs,FOCUSABLE_SELECTOR:()=>ss,addOrRemoveAttribute:()=>Gs,addStylesToElement:()=>Ts,bindCellRendererToHtmlElement:()=>Vs,clearElement:()=>Cs,copyNodeList:()=>Os,ensureDomOrder:()=>Es,formatSize:()=>Ns,getAbsoluteHeight:()=>ps,getAbsoluteWidth:()=>gs,getElementRectWithOffset:()=>ms,getElementSize:()=>hs,getInnerHeight:()=>ds,getInnerWidth:()=>us,getScrollLeft:()=>ys,insertWithDomOrder:()=>As,isElementChildOfClass:()=>cs,isFocusableFormField:()=>ns,isHorizontalScrollShowing:()=>Ds,isInDOM:()=>Ss,isNodeOrElement:()=>_s,isRtlNegativeScroll:()=>fs,isVerticalScrollShowing:()=>Is,isVisible:()=>ws,iterateNamedNodeMap:()=>Fs,loadTemplate:()=>xs,nodeListForEach:()=>Bs,radioCssClass:()=>is,removeFromParent:()=>bs,setDisabled:()=>ls,setDisplayed:()=>os,setDomChildOrder:()=>Ms,setElementHeight:()=>ks,setElementWidth:()=>Rs,setFixedHeight:()=>Ls,setFixedWidth:()=>Ps,setScrollLeft:()=>vs,setVisible:()=>as});var ss="[tabindex], input, select, button, textarea, [href]",rs="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function ns(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),s=t.call(e,rs),r=ws(e);return i&&!s&&r}function os(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||ei(e,!t)}function as(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||ei(e,!t)}function ls(e,t){const i="disabled",s=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);s(e),Bs(e.querySelectorAll("input"),e=>s(e))}function cs(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function hs(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:r,borderBottomWidth:n,borderLeftWidth:o,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:h,marginTop:d,marginRight:u,marginBottom:p,marginLeft:g,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(r||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(o||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(c||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(d||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(p||"0"),marginLeft:parseFloat(g||"0"),boxSizing:m}}function ds(e){const t=hs(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function us(e){const t=hs(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function ps(e){const t=hs(e),i=t.marginBottom+t.marginTop;return Math.ceil(e.offsetHeight+i)}function gs(e){const t=hs(e),i=t.marginLeft+t.marginRight;return Math.ceil(e.offsetWidth+i)}function ms(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:r,borderBottomWidth:n}=hs(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(r||0),bottom:t.bottom+(n||0)}}function fs(){if("boolean"==typeof es)return es;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n            <span style="display: inline-block; width: 1px"></span>\n            <span style="display: inline-block; width: 1px"></span>\n        </div>',document.body.appendChild(e),e.scrollLeft=1,es=0===Math.floor(e.scrollLeft),document.body.removeChild(e),es}function ys(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),Ii()&&!fs()&&(i=e.scrollWidth-e.clientWidth-i)),i}function vs(e,t,i){i&&(fs()?t*=-1:(Ti()||Ii())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function Cs(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function bs(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ss(e){return!!e.offsetParent}function ws(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!Ss(e)||"visible"!==window.getComputedStyle(e).visibility)}function xs(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Es(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Ms(e,t){for(let i=0;i<t.length;i++){const s=t[i],r=e.children[i];r!==s&&e.insertBefore(s,r)}}function As(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function Ts(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const t=St(i),r=s.toString(),n=r.replace(/\s*!important/g,""),o=n.length!=r.length?"important":void 0;e.style.setProperty(t,n,o)}}function Ds(e){return e.clientWidth<e.scrollWidth}function Is(e){return e.clientHeight<e.scrollHeight}function Rs(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Ps(e,t)}function Ps(e,t){t=Ns(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function ks(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):Ls(e,t)}function Ls(e,t){t=Ns(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Ns(e){return"number"==typeof e?`${e}px`:e}function _s(e){return e instanceof Node||e instanceof HTMLElement}function Os(e){if(null==e)return[];const t=[];return Bs(e,e=>t.push(e)),t}function Fs(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function Gs(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Bs(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function Vs(e,t){e.then(e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)})}var Hs={};function Us(e,t,i){const s={},r=e.filter(e=>!t.some(t=>t===e));return r.length>0&&r.forEach(e=>s[e]=zs(e,i).values),s}function zs(e,t,i,s){let r=t.map((t,i)=>({value:t,relevance:Ws(e.toLowerCase(),t.toLocaleLowerCase()),idx:i}));if(r.sort((e,t)=>t.relevance-e.relevance),i&&(r=r.filter(e=>0!==e.relevance)),r.length>0&&s&&s>0){const e=r[0].relevance*s;r=r.filter(t=>e-t.relevance<0)}const n=[],o=[];for(const e of r)n.push(e.value),o.push(e.idx);return{values:n,indices:o}}function Ws(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let r=0,n=-1;for(let e=0;e<i.length;e++){const t=s.indexOf(i[e],n+1);-1!==t&&(n=t,r+=100-100*n/1e4*100)}return r}p(Hs,{fuzzyCheckStrings:()=>Us,fuzzySuggestions:()=>zs});var js={};p(js,{createIcon:()=>$s,createIconNoSpan:()=>Ys,iconNameClassMap:()=>Ks});var Ks={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus"};function $s(e,t,i){const s=Ys(e,t,i);if(s){const{className:e}=s;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return s}const r=document.createElement("span");return r.appendChild(s),r}function Ys(e,t,i,s){let r=null;const n=i&&i.getColDef().icons;if(n&&(r=n[e]),t&&!r){const i=t.get("icons");i&&(r=i[e])}if(!r){const t=document.createElement("span");let i=Ks[e];return i||(s?i=e:(console.warn(`AG Grid: Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),Ht(t,"presentation"),t}{let e;if("function"==typeof r)e=r();else{if("string"!=typeof r)throw new Error("icon from grid options needs to be a string or a function");e=r}if("string"==typeof e)return xs(e);if(_s(e))return e;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var qs={};p(qs,{isDeleteKey:()=>tr,isEventFromPrintableCharacter:()=>Zs,isUserSuppressingHeaderKeyboardEvent:()=>Js,isUserSuppressingKeyboardEvent:()=>Qs,normaliseQwertyAzerty:()=>er});var Xs=class{};function Zs(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key.length}function Qs(e,t,i,s,r){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const o=e.addGridCommonParams({event:t,editing:r,column:s,node:i,data:i.data,colDef:s.getColDef()});return!(!n||!n(o))}function Js(e,t,i,s){const r=s.getDefinition(),n=r&&r.suppressHeaderKeyboardEvent;return!!C(n)&&!!n(e.addGridCommonParams({colDef:r,column:s,headerRowIndex:i,event:t}))}function er(e){const{keyCode:t}=e;let i;switch(t){case 65:i=Xs.A;break;case 67:i=Xs.C;break;case 86:i=Xs.V;break;case 68:i=Xs.D;break;case 90:i=Xs.Z;break;case 89:i=Xs.Y;break;default:i=e.code}return i}function tr(e,t=!1){return e===Xs.DELETE||!t&&e===Xs.BACKSPACE&&Pi()}Xs.BACKSPACE="Backspace",Xs.TAB="Tab",Xs.ENTER="Enter",Xs.ESCAPE="Escape",Xs.SPACE=" ",Xs.LEFT="ArrowLeft",Xs.UP="ArrowUp",Xs.RIGHT="ArrowRight",Xs.DOWN="ArrowDown",Xs.DELETE="Delete",Xs.F2="F2",Xs.PAGE_UP="PageUp",Xs.PAGE_DOWN="PageDown",Xs.PAGE_HOME="Home",Xs.PAGE_END="End",Xs.A="KeyA",Xs.C="KeyC",Xs.D="KeyD",Xs.V="KeyV",Xs.X="KeyX",Xs.Y="KeyY",Xs.Z="KeyZ";var ir={};function sr(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),r=Math.abs(e.clientY-t.clientY);return Math.max(s,r)<=i}p(ir,{areEventsNear:()=>sr});var rr={};function nr(e,t){if(!e)return!1;const i=(e,i)=>{const s=t[e.id],r=t[i.id],n=void 0!==s,o=void 0!==r;return n&&o?s-r:n||o?n?1:-1:e.__objectId-i.__objectId};let s,r,n=!1;for(let t=0;t<e.length-1;t++)if(s=e[t],r=e[t+1],i(s,r)>0){n=!0;break}return!!n&&(e.sort(i),!0)}p(rr,{sortRowNodesByOrder:()=>nr});var or={};function ar(e){const t=new Set;return e.forEach(e=>t.add(e)),t}p(or,{convertToSet:()=>ar});var lr=d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d({},Ot),Te),Ai),Hi),ts),Ae),V),Hs),y),js),qs),wt),ir),Ui),R),rr),or),gt),cr=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},hr=(e=>(e[e.IN_PROGRESS=0]="IN_PROGRESS",e[e.RESOLVED=1]="RESOLVED",e))(hr||{}),dr=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(t){return new e(e=>{let i=t.length;const s=new Array(i);t.forEach((t,r)=>{t.then(t=>{s[r]=t,i--,0===i&&e(s)})})})}static resolve(t=null){return new e(e=>e(t))}then(t){return new e(e=>{1===this.status?e(t(this.resolution)):this.waiters.push(i=>e(t(i)))})}resolveNow(e,t){return 1===this.status?t(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}},ur=class{constructor(){this.timestamp=(new Date).getTime()}print(e){const t=(new Date).getTime()-this.timestamp;console.info(`${e} = ${t}`),this.timestamp=(new Date).getTime()}},pr=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.addCssClass(e));else if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.removeCssClass(e));else if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(e){if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach(e=>this.addOrRemoveCssClass(e,t))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}}},gr=class e extends rt{constructor(e,t,i,s){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=s,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();0===this.tooltipTrigger&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),1===this.tooltipTrigger&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&z(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,i;return"show"===e?null!=(t=this.tooltipShowDelayOverride)?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):null!=(i=this.tooltipHideDelayOverride)?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),ki()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,s=this.parentComp.getGui(),r=null==(t=this.tooltipComp)?void 0:t.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(null==r?void 0:r.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=d({},this.parentComp.getTooltipParams());if(!C(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:ct.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.getContext().destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});r&&(this.tooltipPopupDestroyFunc=r.hideFunc),this.positionTooltip(),1===this.tooltipTrigger&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(0===this.tooltipTrigger?(this.tooltipMouseEnterListener=this.addManagedListener(i,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(i,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(i,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(i,"focusout",this.onTooltipFocusOut.bind(this))||null));const n={type:ct.EVENT_TOOLTIP_SHOW,tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(n),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),s=null==(t=this.tooltipComp)?void 0:t.getGui(),r=e.relatedTarget;(null==s?void 0:s.contains(r))||(this.isInteractingWithTooltip=!1,i.contains(r)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(u(d({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(u(d({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=0===this.tooltipTrigger?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(e=>{e&&e()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){e.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};gr.isLocked=!1,g([de("popupService")],gr.prototype,"popupService",2),g([de("userComponentFactory")],gr.prototype,"userComponentFactory",2),g([le],gr.prototype,"postConstruct",1);var mr=gr,fr=class extends rt{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,s;if(null!=this.tooltipManager)return;const r={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new mr(r,null==(t=(e=this.ctrl).getTooltipShowDelayOverride)?void 0:t.call(e),null==(s=(i=this.ctrl).getTooltipHideDelayOverride)?void 0:s.call(i),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>{var e;return null==(e=this.tooltipManager)?void 0:e.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};g([de("beans")],fr.prototype,"beans",2),g([le],fr.prototype,"postConstruct",1);var yr=new cr,vr=class e extends rt{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=yr.next(),this.cssClassManager=new pr(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:i,hideDelayOverride:s,location:r,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);null!=t&&(this.tooltipFeature=this.createBean(new fr({getTooltipValue:()=>this.tooltipText,getGui:()=>this.getGui(),getLocation:()=>null!=r?r:"UNKNOWN",getColDef:null==e?void 0:e.getColDef,getColumn:null==e?void 0:e.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=s?()=>s:void 0,shouldDisplayTooltip:n})))}createChildComponentsFromTags(e,t){Os(e.childNodes).forEach(i=>{if(!(i instanceof HTMLElement))return;const s=this.createComponentFromElement(i,e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())},t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)})}createComponentFromElement(t,i,s){const r=t.nodeName,n=s?s[t.getAttribute("ref")]:void 0,o=this.agStackComponentsRegistry.getComponentClass(r);if(o){e.elementGettingCreated=t;const s=new o(n);return s.setParentComponent(this),this.createBean(s,null,i),s}return null}copyAttributesFromNode(e,t){Fs(e.attributes,(e,i)=>t.setAttribute(e,i))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(s=>{i[s.attributeName]===t&&(i[s.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;null!=t;){const i=t.__agComponentMetaData,s=j(t.constructor);i&&i[s]&&i[s].querySelectors&&i[s].querySelectors.forEach(t=>e(t)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(e=>e.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=xs(e);this.setTemplateFromElement(i,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(t=>{const i=i=>e[t.attributeName]=i;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const e=this.eGui.querySelector(t.querySelector);e&&i(e.__agComponent||e)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(null!=e)if(t||(t=this.eGui),_s(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;as(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;os(this.eGui,t,{skipAriaHidden:s});const r={type:e.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(r)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}};vr.EVENT_DISPLAYED_CHANGED="displayedChanged",g([de("agStackComponentsRegistry")],vr.prototype,"agStackComponentsRegistry",2),g([ae],vr.prototype,"preConstructOnComponent",1),g([ae],vr.prototype,"createChildComponentsPreConstruct",1);var Cr=vr;function br(e){return wr.bind(this,e,void 0)}function Sr(e){return wr.bind(this,`[ref=${e}]`,e)}function wr(e,t,i,s,r){null!==e?"number"!=typeof r?function(e,t,i){const s=function(e,t){return e.__agComponentMetaData||(e.__agComponentMetaData={}),e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={}),e.__agComponentMetaData[t]}(e,j(e.constructor));s[t]||(s[t]=[]),s[t].push(i)}(i,"querySelectors",{attributeName:s,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var xr=class extends Cr{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}}):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}};g([Sr("eFloatingFilterText")],xr.prototype,"eFloatingFilterText",2),g([de("columnModel")],xr.prototype,"columnModel",2);var Er=class{constructor(e,t,i,s,r){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(t=>{this.alive?(this.dateComp=t,t&&(s.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),null==r||r(this))):e.destroyBean(t)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){os(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let s=!1;(null==(t=this.dateComp)?void 0:t.refresh)&&"function"==typeof this.dateComp.refresh&&null!==this.dateComp.refresh(e)&&(s=!0),!s&&(null==(i=this.dateComp)?void 0:i.onParamsUpdated)&&"function"==typeof this.dateComp.onParamsUpdated&&null!==this.dateComp.onParamsUpdated(e)&&z("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Mr=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{"string"!=typeof e&&([["displayKey"],["displayName"],["predicate","test"]].every(t=>!!t.some(t=>null!=e[t])||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter(t=>t===e)||[])})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},Ar={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"},Tr=class e extends rt{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=d({shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(e.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",e=>{e.defaultPrevented||Xe(e)||(this.callbacks.shouldStopEventPropagation(e)?qe(e):e.key===Xs.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))})}};Tr.FOCUS_MANAGED_CLASS="ag-focus-managed",g([de("focusService")],Tr.prototype,"focusService",2),g([le],Tr.prototype,"postConstruct",1);var Dr=Tr,Ir="ag-resizer-wrapper",Rr=`<div class="${Ir}">\n        <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n        <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n        <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n        <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n        <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n        <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n        <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n        <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n    </div>`,Pr=class extends rt{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:r,height:n,x:o,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,c=0;const h=ws(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;c=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;l=parseInt(t.minHeight,10)-i}}if(this.minHeight=r||l,this.minWidth=i||c,s&&this.setWidth(s),n&&this.setHeight(n),s&&n||this.refreshSize(),e)this.center();else if(o||a)this.offsetElement(o,a);else if(h&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),s=parseFloat(e.style.left);t?this.offsetElement(isNaN(s)?0:s,isNaN(i)?0:i):this.setPosition(s,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const i=!!e[t],s=this.getResizerElement(t),r={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(r),this.resizeListeners.push(r),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=i)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Ls(i,e),e=ps(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?Ls(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,o=e?0:r.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-s.bottom}}return i+o-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Ps(t,e),e=gs(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Ps(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)}):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:r,topBuffer:n}=e,o=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!r,o)?0:o,movementY:this.shouldSkipY(t,!!s,n,a)?0:a}}shouldSkipX(e,t,i,s){const r=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:r.left;let l=a<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=o.right;return!!l||(l=t?s<0&&e.clientX>a+n.left||s>0&&e.clientX<a+n.left:i?s<0&&e.clientX>o.right||s>0&&e.clientX<a+n.left:s<0&&e.clientX>o.right||s>0&&e.clientX<o.right,l)}shouldSkipY(e,t,i=0,s){const r=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:r.top;let l=a<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=o.bottom;return!!l||(l=t?s<0&&e.clientY>a+n.top+i||s>0&&e.clientY<a+n.top:s<0&&e.clientY>o.bottom||s>0&&e.clientY<o.bottom,l)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(Rr,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Ir}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;i||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const r=e[s],n=!!r.style.flex&&"0 0 auto"!==r.style.flex;if(r===this.element)continue;let o=this.minHeight||0,a=this.minWidth||0;if(n){const e=window.getComputedStyle(r);e.minHeight&&(o=parseInt(e.minHeight,10)),e.minWidth&&(a=parseInt(e.minWidth,10))}else o=r.offsetHeight,a=r.offsetWidth;t+=o,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const r=i[s];r!==t&&(e?r.style.height=`${r.offsetHeight}px`:r.style.width=`${r.offsetWidth}px`,r.style.flex="0 0 auto",r===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:r,isBottom:n,isLeft:o}=this.currentResizer,a=r||o,l=n||s,{movementX:c,movementY:h}=this.calculateMouseMovement({e,isLeft:o,isTop:s}),d=this.position.x,u=this.position.y;let p=0,g=0;if(a&&c){const e=o?-1:1,t=this.getWidth(),i=t+c*e;let s=!1;o&&(p=t-i,(d+p<=0||i<=this.minWidth)&&(s=!0,p=0)),s||this.setWidth(i)}if(l&&h){const e=s?-1:1,t=this.getHeight(),i=t+h*e;let r=!1;s?(g=t-i,(u+g<=0||i<=this.minHeight)&&(r=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(r=!0),r||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&p||g)&&this.offsetElement(d+p,u+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:r,movementY:n}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+r,i+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};g([de("popupService")],Pr.prototype,"popupService",2),g([de("resizeObserverService")],Pr.prototype,"resizeObserverService",2),g([de("dragService")],Pr.prototype,"dragService",2);var kr=class e extends Cr{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new Dr(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Pr(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`\n            <form class="ag-filter-wrapper">\n                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n                    ${this.createBodyTemplate()}\n                </div>\n            </form>`;this.setTemplate(i,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetButtonsPanel()}updateParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Cs(this.eButtonsPanel),this.buttonListeners.forEach(e=>null==e?void 0:e()),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&bs(this.eButtonsPanel));const i=document.createDocumentFragment(),s=e=>{let t,s;switch(e){case"apply":t=this.translate("applyFilter"),s=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),s=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),s=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),s=e=>{this.onBtCancel(e)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const r=xs(`<button\n                    type="${"apply"===e?"submit":"button"}"\n                    ref="${e}FilterButton"\n                    class="ag-button ag-standard-button ag-filter-apply-panel-button"\n                >${t}\n                </button>`);this.buttonListeners.push(this.addManagedListener(r,"click",s)),i.append(r)};ar(e).forEach(e=>s(e)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const t=e.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),i=Q(this.checkApplyDebounce.bind(this),t);this.onBtApplyDebounce=()=>{this.debouncePending=!0,i()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),null==t||t()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;"Enter"!==i&&"Space"!==i||(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.getRefElement("applyFilterButton");t&&ls(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(null==e?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(t,i){return e.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:i}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Ar[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};g([de("rowModel")],kr.prototype,"rowModel",2),g([Sr("eFilterBody")],kr.prototype,"eFilterBody",2),g([le],kr.prototype,"postConstruct",1);var Lr=kr,Nr=class extends Cr{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:r}=this.config;null!=r&&this.setDisabled(r),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){Cs(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(os(this.eLabel,!1),Ht(this.eLabel,"presentation")):(os(this.eLabel,!0),Ht(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||Rs(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return ls(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}};g([le],Nr.prototype,"postConstruct",1);var _r=class extends Nr{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();null!==jt(e)?$t(e,""):$t(e,null!=t?t:"")}setAriaLabel(e){return Kt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,ct.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Ps(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED})),this}},Or=class extends _r{constructor(e){if(super(e,(null==e?void 0:e.template)||'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',null==e?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=null==e?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:r,maxPickerWidth:n}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=r&&this.setPickerMinWidth(r),null!=n&&this.setPickerMaxWidth(n)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i,inputWidth:s}=this.config;if(i){const e=Ys(i,this.gos);e&&this.eIcon.appendChild(e)}null!=s&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ii(e,!1),this.ariaRole&&Ht(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(null==e?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case Xs.UP:case Xs.DOWN:case Xs.ENTER:case Xs.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case Xs.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:r,modalPicker:n=!0}=this.config,o={modal:n,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,r)},a=this.popupService.addPopup(o),{maxPickerHeight:l,minPickerWidth:c,maxPickerWidth:h,variableWidth:d}=this;d?(c&&(t.style.minWidth=c),t.style.width=Ns(gs(this.eWrapper)),h&&(t.style.maxWidth=h)):Rs(t,null!=h?h:gs(this.eWrapper));const u=null!=l?l:`${ds(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",u),t.style.position="absolute",this.alignPickerToComponent(),a.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){this.isAlive()&&(ii(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e))}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(null==(t=this.pickerComponent)?void 0:t.getGui().contains(e.relatedTarget))||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return Rs(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}};g([de("popupService")],Or.prototype,"popupService",2),g([Sr("eLabel")],Or.prototype,"eLabel",2),g([Sr("eWrapper")],Or.prototype,"eWrapper",2),g([Sr("eDisplayField")],Or.prototype,"eDisplayField",2),g([Sr("eIcon")],Or.prototype,"eIcon",2);var Fr=class e extends Cr{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.options=[],this.itemEls=[]}init(){const e=this.getGui();this.addManagedListener(e,"mouseleave",()=>this.clearHighlighted()),this.unFocusable||this.addManagedListener(e,"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case Xs.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case Xs.DOWN:case Xs.UP:e.preventDefault(),this.navigate(t);break;case Xs.PAGE_DOWN:case Xs.PAGE_UP:case Xs.PAGE_HOME:case Xs.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===Xs.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,r=Math.floor(this.getGui().clientHeight/s);let n=-1;e===Xs.PAGE_HOME?n=0:e===Xs.PAGE_END?n=i:e===Xs.PAGE_DOWN?n=Math.min(t+r,i):e===Xs.PAGE_UP&&(n=Math.max(t-r,0)),-1!==n&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{bs(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{ni(t,i+1),ri(t,e.length)})}renderOption(e,t){const i=this.gos.getDocument(),s=i.createElement("div");Ht(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const r=i.createElement("span");s.appendChild(r),r.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListener(s,"mousemove",()=>this.highlightItem(s)),this.addManagedListener(s,"mousedown",t=>{t.preventDefault(),this.setValue(e)}),this.createManagedBean(new fr({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex(t=>t.value===e);if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(e=>e.value===this.value);-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(t){if(!ws(t))return;this.clearHighlighted(),this.highlightedEl=t,this.highlightedEl.classList.add(e.ACTIVE_CLASS),gi(this.highlightedEl,!0);const i=this.getGui(),{scrollTop:s,clientHeight:r}=i,{offsetTop:n,offsetHeight:o}=t;(n+o>s+r||n<s)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&ws(this.highlightedEl)&&(this.highlightedEl.classList.remove(e.ACTIVE_CLASS),gi(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}};Fr.EVENT_ITEM_SELECTED="selectedItem",Fr.ACTIVE_CLASS="ag-active-item",g([le],Fr.prototype,"init",1);var Gr=Fr,Br=class e extends Or{constructor(e){super(d({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},e))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new Gr("select",!0)),this.listComponent.setParentComponent(this);const t=this.listComponent.getAriaElement(),i=`ag-select-list-${this.listComponent.getCompId()}`;t.setAttribute("id",i),fi(this.getAriaElement(),t),this.listComponent.addManagedListener(this.listComponent,Gr.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,ct.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}onKeyDown(e){var t;const{key:i}=e;switch(i===Xs.TAB&&this.hidePicker(),i){case Xs.ENTER:case Xs.UP:case Xs.DOWN:case Xs.PAGE_UP:case Xs.PAGE_DOWN:case Xs.PAGE_HOME:case Xs.PAGE_END:e.preventDefault(),this.isPickerDisplayed?null==(t=this.listComponent)||t.handleKeyDown(e):super.onKeyDown(e);break;case Xs.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return null==(e=this.listComponent)||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let s=this.listComponent.getDisplayValue();return null==s&&this.config.placeholder&&(s=this.config.placeholder),this.eDisplayField.textContent=s,this.setTooltip({newTooltipText:null!=s?s:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}};Br.EVENT_ITEM_SELECTED="selectedItem";var Vr=Br,Hr=class extends _r{constructor(e,t,i="text",s="input"){super(e,`\n            <div role="presentation">\n                <div ref="eLabel" class="ag-input-field-label"></div>\n                <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n                    <${s} ref="eInput" class="ag-input-field-input"></${s}>\n                </div>\n            </div>`,t),this.inputType=i,this.displayFieldTag=s}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Rs(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Gs(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Kt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ls(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Gs(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Gs(this.eInput,"autocomplete",t)}return this}};g([Sr("eLabel")],Hr.prototype,"eLabel",2),g([Sr("eWrapper")],Hr.prototype,"eWrapper",2),g([Sr("eInput")],Hr.prototype,"eInput",2);var Ur=class extends Hr{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const s=this.getInputElement(),r={type:ct.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(r)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},zr=class extends Ur{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,ct.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},Wr=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e;let{conditions:s}=t;if(!s){const{condition1:e,condition2:i}=t;s=[e,i]}const r=s.map(e=>this.getModelAsString(e)),n="AND"===t.operator?"andCondition":"orCondition";return r.join(` ${i(n,Ar[n])} `)}if(e.type===Kr.BLANK||e.type===Kr.NOT_BLANK)return i(e.type,e.type);{const t=e,s=this.optionsFactory.getCustomOption(t.type),{displayKey:r,displayName:n,numberOfInputs:o}=s||{};return r&&n&&0===o?(i(r,n),n):this.conditionToString(t,s)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!=(t=this.valueFormatter(null!=e?e:null))?t:"":String(e)}},jr=class e extends Lr{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(t){const i=this.optionsFactory.getCustomOption(t);if(i){const{numberOfInputs:e}=i;return null!=e?e:1}const s=[e.EMPTY,e.NOT_BLANK,e.BLANK];return t&&s.indexOf(t)>=0?0:t===e.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let r;if(i){const i=e,s=t;r=this.areSimpleModelsEqual(i,s)}else{const i=e,s=t;r=i.operator===s.operator&&Re(i.conditions,s.conditions,(e,t)=>this.areSimpleModelsEqual(e,t))}return r}shouldRefresh(e){var t,i,s;const r=this.getModel(),n=r?null!=(t=r.conditions)?t:[r]:null,o=null!=(s=null==(i=e.filterOptions)?void 0:i.map(e=>"string"==typeof e?e:e.displayKey))?s:this.getDefaultFilterOptions();return!(n&&!n.every(e=>void 0!==o.find(t=>t===e.type))||"number"==typeof e.maxNumConditions&&n&&n.length>e.maxNumConditions)}refresh(e){return!!this.shouldRefresh(e)&&(!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0))}setModelIntoUi(e){if(e.operator){let t=e;t.conditions||(t.conditions=[t.condition1,t.condition2]);const i=this.validateAndUpdateConditions(t.conditions),s=this.getNumConditions();if(i<s)this.removeConditionsAndOperators(i);else if(i>s)for(let e=s;e<i;e++)this.createJoinOperatorPanel(),this.createOption();const r="OR"===t.operator;this.eJoinOperatorsAnd.forEach(e=>e.setValue(!r,!0)),this.eJoinOperatorsOr.forEach(e=>e.setValue(r,!0)),t.conditions.forEach((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)})}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),dr.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),z('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(null==i)return!0;const{operator:s}=i,r=[];if(s){const e=i;r.push(...null!=(t=e.conditions)?t:[])}else r.push(i);return r[s&&"OR"===s?"some":"every"](t=>this.individualConditionPasses(e,t))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Mr,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;null!=e.suppressAndOrCondition&&z('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),null!=e.alwaysShowBothConditions&&z('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=null!=(t=e.maxNumConditions)?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(z('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!=(i=e.numAlwaysVisibleConditions)?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(z('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(z('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Vr);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,e=>this.resetInput(e)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,r=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,r),this.resetJoinOperatorOr(i,s,r),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new zr);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,i=!0;for(let e=0;e<this.getNumConditions();e++)this.isConditionUiComplete(e)?t=e:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const i=null!=(e=this.lastUiCompletePosition)?e:this.getNumConditions()-2;if(t<i){this.removeConditionsAndOperators(i+1);const e=t+1,s=i-e;s>0&&this.removeConditionsAndOperators(e,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((t,i)=>{const s=this.isConditionDisabled(i,e);t.setDisabled(s||this.filterListOptions.length<=1),1===i&&(ls(this.eJoinOperatorPanels[0],s),this.eJoinOperatorsAnd[0].setDisabled(s),this.eJoinOperatorsOr[0].setDisabled(s))}),this.eConditionBodies.forEach((e,t)=>{os(e,this.isConditionBodyVisible(t))});const i="OR"===(null!=t?t:this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e,t)=>{e.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((e,t)=>{e.setValue(i,!0)}),this.forEachInput((t,i,s,r)=>{this.setElementDisplayed(t,i<r),this.setElementDisabled(t,this.isConditionDisabled(s,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(e=>bs(e))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(e=>{bs(e.getGui()),this.destroyBean(e)})}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(null==e?void 0:e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof Hr&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const r=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const r=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||r)&&(this.removeConditionsAndOperators(e,1),s=!0,r&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,r),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(K(this.filterPlaceholder)){const e=this.filterPlaceholder,s=this.eTypes[t].getValue();i=e({filterOptionKey:s,filterOption:this.translate(s),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,r)=>{if(!(t instanceof Hr))return;const n=0===i&&r>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",o=0===i&&r>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,s)),t.setInputAriaLabel(o)})}setElementValue(e,t,i){e instanceof Hr&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Cr&&os(e.getGui(),t)}setElementDisabled(e,t){e instanceof Cr&&ls(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Hr&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),r=this.getInputs(e);for(let t=0;t<r.length;t++){const n=r[t];null!=n&&i(n,t,e,s)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(t){return!(t>=this.getNumConditions())&&(this.getConditionType(t)!==e.EMPTY&&!this.getValues(t).some(e=>null==e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(e=>this.resetType(e)),this.eJoinOperatorsAnd.forEach((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t)),this.eJoinOperatorsOr.forEach((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t)),this.joinOperatorId++,this.forEachInput(e=>this.resetInput(e)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),dr.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,r){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${r}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((e,s,r,n)=>{r===t&&this.setElementValue(e,null!=i[s]?i[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s,r)=>{this.setElementValue(t,0===i&&0===s?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,e=>{this.attachElementOnChange(e,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),r=this.optionsFactory.getCustomOption(t.type),n=this.evaluateCustomFilter(r,s,i);return null!=n?n:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:s}=e;return null==s||t.some(e=>null==e)?void 0:s(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}};jr.EMPTY="empty",jr.BLANK="blank",jr.NOT_BLANK="notBlank",jr.EQUALS="equals",jr.NOT_EQUAL="notEqual",jr.LESS_THAN="lessThan",jr.LESS_THAN_OR_EQUAL="lessThanOrEqual",jr.GREATER_THAN="greaterThan",jr.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",jr.IN_RANGE="inRange",jr.CONTAINS="contains",jr.NOT_CONTAINS="notContains",jr.STARTS_WITH="startsWith",jr.ENDS_WITH="endsWith";var Kr=jr,$r=class e extends Kr{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(t){switch(t){case e.EQUALS:case e.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case e.GREATER_THAN:case e.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case e.LESS_THAN:case e.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case e.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case e.BLANK:return!0;case e.NOT_BLANK:return!1}return!1}evaluateNonNullValue(t,i,s){const r=this.comparator(),n=null!=t[0]?r(t[0],i):0;switch(s.type){case e.EQUALS:return 0===n;case e.NOT_EQUAL:return 0!==n;case e.GREATER_THAN:return n>0;case e.GREATER_THAN_OR_EQUAL:return n>=0;case e.LESS_THAN:return n<0;case e.LESS_THAN_OR_EQUAL:return n<=0;case e.IN_RANGE:{const e=r(t[1],i);return this.scalarFilterParams.inRangeInclusive?n>=0&&e<=0:n>0&&e<0}case e.BLANK:return this.isBlank(i);case e.NOT_BLANK:return!this.isBlank(i);default:return console.warn('AG Grid: Unexpected type of filter "'+s.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},Yr=1/0,qr=class extends Wr{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},r=i==Kr.IN_RANGE||2===s,n=Ji(e.dateFrom),o=Ji(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;return r?`${null!==n?Qi(n,a):"null"}-${null!==o?Qi(o,a):"null"}`:null!=n?Qi(n,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Xr=class e extends $r{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=Yr,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Ji(t)||null,i&&Ji(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);console.warn(`AG Grid: DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",Yr),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Ji(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Ji(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new qr(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Er(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const r=this.gos.getDocument().createElement("div");r.classList.add(`ag-filter-${s}`),r.classList.add(`ag-filter-date-${s}`),t.push(r),e.appendChild(r),i.push(this.createDateCompWrapper(r))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(e=>e.destroy())}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,r,n)=>{r!==e||!t||s>=n||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=Xi(s[0])),s.length>1&&(i.dateTo=Xi(s[1])),d({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,s,r)=>{i<r&&t.push(e.getDate())}),t}translate(e){return e===$r.LESS_THAN?super.translate("before"):e===$r.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};Xr.DEFAULT_FILTER_OPTIONS=[$r.EQUALS,$r.NOT_EQUAL,$r.LESS_THAN,$r.GREATER_THAN,$r.IN_RANGE,$r.BLANK,$r.NOT_BLANK],g([de("userComponentFactory")],Xr.prototype,"userComponentFactory",2);var Zr=Xr,Qr=class extends Cr{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return null==e?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;t=e.operator?e.conditions[0]:e,this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Mr,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[Kr.IN_RANGE,Kr.EMPTY,Kr.BLANK,Kr.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}};g([de("columnModel")],Qr.prototype,"columnModel",2);var Jr=class extends Qr{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n                <div ref="eDateWrapper" style="display: flex;"></div>\n            </div>')}getDefaultFilterOptions(){return Zr.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new qr(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(Ji(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){os(this.eDateWrapper,e),os(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=Xi(this.dateComp.getDate());this.params.parentFilterInstance(t=>{if(t){const i=Ji(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const e=Lr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Q(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Er(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}};g([de("userComponentFactory")],Jr.prototype,"userComponentFactory",2),g([Sr("eReadOnlyText")],Jr.prototype,"eReadOnlyText",2),g([Sr("eDateWrapper")],Jr.prototype,"eDateWrapper",2);var en=class extends Cr{constructor(){super('\n            <div class="ag-filter-filter">\n                <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListener(t,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()}),this.addManagedListener(t,"input",e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&Ti(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:r,minValidDate:n,maxValidDate:o}=e.filterParams||{};if(n&&s&&z("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),o&&r&&z("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),n&&o){const[e,t]=[n,o].map(e=>e instanceof Date?e:Ji(e));e&&t&&e.getTime()>t.getTime()&&z("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}n?n instanceof Date?t.min=Qi(n):t.min=n:s&&(t.min=`${s}-01-01`),o?o instanceof Date?t.max=Qi(o):t.max=o:r&&(t.max=`${r}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Ji(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Xi(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Ii()||Ri()||Ti()&&Di()>=14.1}};g([Sr("eDateInput")],en.prototype,"eDateInput",2);var tn=class extends Hr{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=C(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",t=>{Zs(t)&&t.key&&!e.test(t.key)&&t.preventDefault()}),this.addManagedListener(this.eInput,"paste",t=>{var i;const s=null==(i=t.clipboardData)?void 0:i.getData("text");s&&s.split("").some(t=>!e.test(t))&&t.preventDefault()})}},sn=class extends tn{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof s&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,Gs(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Gs(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Gs(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue(e=>super.setValue(e,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},e)}setValueOrInputValue(e,t,i){if(C(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(s||(s=(i=this.adjustPrecision(i))!=this.normalizeValue(i)),s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},rn=class extends Wr{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==Kr.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function nn(e){const{allowedCharPattern:t}=null!=e?e:{};return null!=t?t:null}var on=class e extends $r{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new rn(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(null!=t?t:null):t;super.setElementValue(e,s)}createValueElement(){const e=nn(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),Ht(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const r=this.createManagedBean(s?new tn({allowedCharPattern:s}):new sn);r.addCssClass(`ag-filter-${i}`),r.addCssClass("ag-filter-filter"),t.push(r),e.appendChild(r.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,s,r)=>{i<r&&t.push(this.processValue(this.stringToFloat(e.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=v(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}};on.DEFAULT_FILTER_OPTIONS=[$r.EQUALS,$r.NOT_EQUAL,$r.GREATER_THAN,$r.GREATER_THAN_OR_EQUAL,$r.LESS_THAN,$r.LESS_THAN_OR_EQUAL,$r.IN_RANGE,$r.BLANK,$r.NOT_BLANK];var an=on,ln=class extends Wr{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==Kr.IN_RANGE||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}},cn=class e extends Kr{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return""===t?e:t}getDefaultDebounceMs(){return 500}setParams(t){this.textFilterParams=t,super.setParams(t),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?e.DEFAULT_FORMATTER:e.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new ln(this.localeService,this.optionsFactory)}getTextMatcher(){const t=this.textFilterParams.textCustomComparator;return t?(lr.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:e,value:i,filterText:s})=>t(e,i,s)):this.textFilterParams.textMatcher||e.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(t,i){const s=[];return this.forEachPositionInput(t,(t,r,n,o)=>{var a;if(r<o){let r=v(t.getValue());i&&this.textFilterParams.trimInput&&(r=null!=(a=e.trimInput(r))?a:null,t.setValue(r,!0)),s.push(r)}}),s}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Ht(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new tn);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){const t=[Kr.NOT_EQUAL,Kr.NOT_CONTAINS,Kr.BLANK];return!!e&&t.indexOf(e)>=0}evaluateNonNullValue(e,t,i,s){const r=e.map(e=>this.formatter(e))||[],n=this.formatter(t),{api:o,colDef:a,column:l,columnApi:c,context:h,textFormatter:p}=this.textFilterParams;if(i.type===Kr.BLANK)return this.isBlank(t);if(i.type===Kr.NOT_BLANK)return!this.isBlank(t);const g={api:o,colDef:a,column:l,columnApi:c,context:h,node:s.node,data:s.data,filterOption:i.type,value:n,textFormatter:p};return r.some(e=>this.matcher(u(d({},g),{filterText:e})))}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};cn.DEFAULT_FILTER_OPTIONS=[Kr.CONTAINS,Kr.NOT_CONTAINS,Kr.EQUALS,Kr.NOT_EQUAL,Kr.STARTS_WITH,Kr.ENDS_WITH,Kr.BLANK,Kr.NOT_BLANK],cn.DEFAULT_FORMATTER=e=>e,cn.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),cn.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case cn.CONTAINS:return t.indexOf(i)>=0;case cn.NOT_CONTAINS:return t.indexOf(i)<0;case cn.EQUALS:return t===i;case cn.NOT_EQUAL:return t!=i;case cn.STARTS_WITH:return 0===t.indexOf(i);case cn.ENDS_WITH:const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length;default:return!1}};var hn=cn,dn=class extends rt{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new tn(null==(t=this.params)?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",e=>this.valueChangedListener(e)),this.addManagedListener(i,"keydown",e=>this.valueChangedListener(e))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},un=class extends Qr{postConstruct(){this.setTemplate('\n            <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n        ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!=(t=e.browserAutoComplete)&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=Lr.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const e=Lr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t=Q(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();Cs(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===Xs.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=hn.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}};g([Sr("eFloatingFilterInputContainer")],un.prototype,"eFloatingFilterInputContainer",2),g([le],un.prototype,"postConstruct",1);var pn=class extends rt{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new sn),this.eFloatingFilterTextInput=this.createManagedBean(new tn),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,e=>this.valueChangedListener(e)),this.setupListeners(i,e=>this.valueChangedListener(e))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},gn=class extends un{init(e){var t;super.init(e),this.filterModelFormatter=new rn(this.localeService,this.optionsFactory,null==(t=e.filterParams)?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){nn(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return an.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=nn(e.filterParams),this.allowedCharPattern?this.createManagedBean(new dn({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new pn)}},mn=class extends un{init(e){super.init(e),this.filterModelFormatter=new ln(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return hn.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new dn)}},fn=class e{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new fe,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",r,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",r,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(t){if(this.touching)return;this.touchStart=t.touches[0],this.touching=!0,this.moved=!1;const i=this.touchStart;window.setTimeout(()=>{const s=this.touchStart===i;if(this.touching&&s&&!this.moved){this.moved=!0;const i={type:e.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:t};this.eventService.dispatchEvent(i)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);t&&!sr(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(t){if(this.touching){if(!this.moved){const t={type:e.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&t.cancelable&&t.preventDefault(),this.touching=!1}}checkForDoubleTap(){const t=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0)if(t-this.lastTapTime>e.DOUBLE_TAP_MILLIS){const t={type:e.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.lastTapTime=null}else this.lastTapTime=t;else this.lastTapTime=t}destroy(){this.destroyFuncs.forEach(e=>e())}};fn.EVENT_TAP="tap",fn.EVENT_DOUBLE_TAP="doubleTap",fn.EVENT_LONG_TAP="longTap",fn.DOUBLE_TAP_MILLIS=500;var yn=fn,vn=class e extends Cr{constructor(t){super(),t||this.setTemplate(e.TEMPLATE)}attachCustomElements(e,t,i,s,r){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=r}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),(this.column.isSortable()||this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",()=>this.updateIcons()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const s=Ys(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;os(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;os(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;os(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);os(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=null!=(e=this.sortController.getDisplaySortIndexForColumn(this.column))?e:-1,s=t.some(e=>{var t;return null!=(t=this.sortController.getDisplaySortIndexForColumn(e))&&t}),r=i>=0&&s;os(this.eSortOrder,r,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():Cs(this.eSortOrder)}};vn.TEMPLATE='<span class="ag-sort-indicator-container">\n            <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n        </span>',g([Sr("eSortOrder")],vn.prototype,"eSortOrder",2),g([Sr("eSortAsc")],vn.prototype,"eSortAsc",2),g([Sr("eSortDesc")],vn.prototype,"eSortDesc",2),g([Sr("eSortMixed")],vn.prototype,"eSortMixed",2),g([Sr("eSortNone")],vn.prototype,"eSortNone",2),g([de("columnModel")],vn.prototype,"columnModel",2),g([de("sortController")],vn.prototype,"sortController",2);var Cn=vn,bn=class e extends Cr{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&t.enableFilterButton==e.enableFilterButton&&t.enableFilterIcon==e.enableFilterIcon&&(this.setDisplayName(e),!0)}workOutTemplate(){var t;let i=null!=(t=this.params.template)?t:e.TEMPLATE;return i=i&&i.trim?i.trim():i,i}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=Ct(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const s=Ys(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new yn(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&C(this.eMenu),r=s?new yn(this.eMenu,!0):t;if(this.params.enableMenu){const e=s?"EVENT_TAP":"EVENT_LONG_TAP",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListener(r,yn[e],t)}if(this.params.enableSorting){const e=e=>{var t,s;const r=e.touchStart.target;i&&((null==(t=this.eMenu)?void 0:t.contains(r))||(null==(s=this.eFilterButton)?void 0:s.contains(r)))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,yn.EVENT_TAP,e)}if(this.params.enableFilterButton){const e=new yn(this.eFilterButton,!0);this.addManagedListener(e,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>e.destroy())}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>r.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return bs(this.eMenu),void(this.eMenu=void 0);const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedListener(this.eMenu,"click",()=>this.params.showColumnMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){var t,i,s,r;const{column:n}=this.params,o=this.menuService.isLegacyMenuEnabled();if(e&&!o){if(this.menuService.isFilterMenuInHeaderEnabled(n))return this.params.showFilter(null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(null!=(r=null!=(s=this.eMenu)?s:this.eFilterButton)?r:this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new Cn(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListener(this.params.column,we.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=(new Date).getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!t&&!i){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}});const e=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const e=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),t=!(null==e?void 0:e.every(e=>this.params.column.getSort()==e.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",t)}};this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){this.eFilterButton&&(this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0)}configureFilter(e,t,i){if(!e)return bs(t),!1;const{column:s}=this.params;return this.addInIcon("filter",t,s),this.addManagedListener(s,we.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();os(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,i,s,r;return e?null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui():null!=(r=null!=(s=this.eMenu)?s:this.eFilterButton)?r:this.getGui()}};bn.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n            <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n            <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n            <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n                <span ref="eText" class="ag-header-cell-text"></span>\n                <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n                <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n            </div>\n        </div>',g([de("sortController")],bn.prototype,"sortController",2),g([de("menuService")],bn.prototype,"menuService",2),g([de("columnModel")],bn.prototype,"columnModel",2),g([Sr("eFilter")],bn.prototype,"eFilter",2),g([Sr("eFilterButton")],bn.prototype,"eFilterButton",2),g([Sr("eSortIndicator")],bn.prototype,"eSortIndicator",2),g([Sr("eMenu")],bn.prototype,"eMenu",2),g([Sr("eLabel")],bn.prototype,"eLabel",2),g([Sr("eText")],bn.prototype,"eText",2),g([Sr("eSortOrder")],bn.prototype,"eSortOrder",2),g([Sr("eSortAsc")],bn.prototype,"eSortAsc",2),g([Sr("eSortDesc")],bn.prototype,"eSortDesc",2),g([Sr("eSortMixed")],bn.prototype,"eSortMixed",2),g([Sr("eSortNone")],bn.prototype,"eSortNone",2);var Sn=bn,wn=class e extends Cr{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&z("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=e=>{if(Xe(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=e=>{qe(e)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,Ee.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,Ee.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new yn(e,!0);this.addManagedListener(i,yn.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();os(this.eOpenIcon,e),os(this.eCloseIcon,!e)}else os(this.eOpenIcon,!1),os(this.eCloseIcon,!1)}addInIcon(e,t){const i=Ys(e,this.gos,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return os(this.eOpenIcon,!1),void os(this.eCloseIcon,!1)}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(C(t)){const e=Ct(t,!0);this.getRefElement("agLabel").textContent=e}this.addOrRemoveCssClass("ag-sticky-label",!(null==(e=i.getColGroupDef())?void 0:e.suppressStickyLabel))}};wn.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n            <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n            <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n            <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n        </div>',g([de("columnModel")],wn.prototype,"columnModel",2),g([Sr("agOpened")],wn.prototype,"eOpenIcon",2),g([Sr("agClosed")],wn.prototype,"eCloseIcon",2);var xn=wn,En=class extends Cr{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},Mn=class e extends En{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),C(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===Xs.LEFT||t===Xs.UP||t===Xs.RIGHT||t===Xs.DOWN||e.shiftKey&&t===Xs.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return C(e)||C(this.params.value)?this.params.parseValue(e):this.params.value}};Mn.TEMPLATE='<div class="ag-large-text">\n            <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n        </div>',g([Sr("eTextArea")],Mn.prototype,"eTextArea",2);var An=Mn,Tn=class extends En{constructor(){super('<div class="ag-cell-edit-wrapper">\n                <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n            </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:r,value:n,eventKey:o}=e;if(b(r))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=o&&o===Xs.ENTER;let a=!1;r.forEach(s=>{const r={value:s},o=i.formatValue(e.column,null,s),l=null!=o;r.text=l?o:s,t.addOption(r),a=a||n===s}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:h}=e;null!=l&&t.setPickerGap(l),null!=h&&t.setPickerMaxHeight(h),null!=c&&t.setPickerMaxWidth(c),"fullRow"!==s.get("editType")&&this.addManagedListener(this.eSelect,Vr.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};g([de("valueService")],Tn.prototype,"valueService",2),g([Sr("eSelect")],Tn.prototype,"eSelect",2);var Dn=class extends En{constructor(e){super(`\n            <div class="ag-cell-edit-wrapper">\n                ${e.getTemplate()}\n            </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===Xs.BACKSPACE||e.eventKey===Xs.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==Xs.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",e=>{const{key:t}=e;t!==Xs.PAGE_UP&&t!==Xs.PAGE_DOWN||e.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Ti()||s.getFocusableElement().focus();const r=s.getInputElement();this.highlightAllOnFocus?r.select():null==(t=(e=this.cellEditorInput).setCaret)||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};g([Sr("eInput")],Dn.prototype,"eInput",2);var In=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return C(e)||C(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=C(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},Rn=class extends Dn{constructor(){super(new In)}},Pn=class extends Cr{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),r=C(s)?s:i,n=t>=0;this.eDelta.textContent=n?"↑"+r:"↓"+r,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Cs(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(C(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:C(e.value)?this.eValue.textContent=i:Cs(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}};g([de("filterManager")],Pn.prototype,"filterManager",2);var kn=class extends Cr{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let i=e.value;return b(i)&&(i=""),i!==this.lastValue&&!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,C(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:C(e.value)?this.eCurrent.textContent=i:Cs(this.eCurrent),!0)}};g([de("filterManager")],kn.prototype,"filterManager",2);var Ln=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:e.EVENT_DATA_CHANGED,node:this,oldData:i,newData:t,update:s}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=C(this.id)?this.createDaemonNode():null,s=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const r=this.createDataChangedEvent(e,s,!1);this.dispatchLocalEvent(r)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_SELECTABLE_CHANGED)),i)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:null!=e&&e,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getCallback("getRowId");if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!C(this.rowTop)||!C(this.rowHeight))&&e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_TOP_CHANGED)),this.setDisplayed(null!==t))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DISPLAYED_CHANGED)))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DRAGGING_CHANGED)))}setHighlighted(t){t!==this.highlighted&&(this.highlighted=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_MASTER_CHANGED)))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_GROUP_CHANGED)))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Q(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(null==s)return;if(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(r=>{let n=s[r.getId()];if(null==n){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(r.getPinned()){case"left":t=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":t=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:t=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(t.includes(r))return void(e=!0);n=-1}}else t=!1;n>i&&(i=n)}),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const r=this.beans.rowModel;r.onRowHeightChangedDebounced&&r.onRowHeightChangedDebounced()}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_UI_LEVEL_CHANGED)))}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_EXPANDED_CHANGED));const r=Object.assign({},this.createGlobalRowEvent(ct.EVENT_ROW_GROUP_OPENED),{expanded:t,event:i||null});this.beans.rowNodeEventThrottle.dispatchExpanded(r,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,i){const s=(()=>{var t;return"string"!=typeof e?e:null!=(t=this.beans.columnModel.getGridColumn(e))?t:this.beans.columnModel.getPrimaryColumn(e)})(),r=this.getValueFromValueService(s);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(s,r,t,i),!1;const n=this.beans.valueService.setValue(this,s,t,i);return this.dispatchCellChangedEvent(s,t,r),this.checkRowSelectable(),n}getValueFromValueService(e){var t,i;const s=this.leafGroup&&this.beans.columnModel.isPivotMode(),r=this.group&&this.expanded&&!this.footer&&!s;let n=!1;const o=null!=(t=this.beans.gos.get("groupTotalRow"))?t:this.beans.gos.get("groupIncludeFooter");n="function"!=typeof o?!!o:!!(null!=(i=this.beans.gos.getCallback("groupTotalRow"))?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const a=this.beans.gos.get("groupSuppressBlankHeader"),l=r&&n&&!a;return this.beans.valueService.getValue(e,this,!1,l)}dispatchEventForSaveValueReadOnly(e,t,i,s){const r=this.beans.gos.addGridCommonParams({type:ct.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s});this.beans.eventService.dispatchEvent(r)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);b(this.groupData)&&(this.groupData={});const s=i.getColId(),r=this.groupData[s];r!==t&&(this.groupData[s]=t,this.dispatchCellChangedEvent(i,t,r))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,s=t?t[e]:void 0;if(i===s)return;const r=this.beans.columnModel.lookupGridColumn(e);r&&this.dispatchCellChangedEvent(r,i,s)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const e=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(e?!!i&&i(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&S(this.childrenAfterGroup)}dispatchCellChangedEvent(t,i,s){const r={type:e.EVENT_CELL_CHANGED,node:this,column:t,newValue:i,oldValue:s};this.dispatchLocalEvent(r)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(t=>t.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let t=!1,i=!1,s=!1;if(!(null==(e=this.childrenAfterGroup)?void 0:e.length))return this.selectable?this.selected:null;for(let e=0;e<this.childrenAfterGroup.length;e++){const r=this.childrenAfterGroup[e];let n=r.isSelected();if(!r.selectable){const e=r.calculateSelectedFromChildren();if(null===e)continue;n=e}switch(n){case!0:t=!0;break;case!1:i=!0;break;default:s=!0}}return s||t&&i?void 0:!!t||!i&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}selectThisNode(t,i,s="api"){const r=!this.selectable&&t,n=this.selected===t;if(r||n)return!1;this.selected=t,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_ROW_SELECTED));const o=this.sibling;o&&o.footer&&o.eventService&&o.dispatchLocalEvent(o.createLocalRowEvent(e.EVENT_ROW_SELECTED));const a=u(d({},this.createGlobalRowEvent(ct.EVENT_ROW_SELECTED)),{event:i||null,source:s});return this.beans.eventService.dispatchEvent(a),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(u(d({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var i,s;this.eventService||(this.eventService=new fe),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new ye(this.beans.frameworkOverrides));const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?s:t;this.eventService.addEventListener(e,r)}removeEventListener(e,t){var i,s;if(!this.eventService)return;const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?s:t;this.eventService.removeEventListener(e,r),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,s=!1,r=null;for(;i&&!s;){const n=t.parent;C(n)&&t.firstChild?n.rowGroupColumn===e&&(s=!0,r=n):i=!1,t=n}return s?r:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach(e=>{t.has(e)||(i[e]=this[e])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};Ln.ID_PREFIX_ROW_GROUP="row-group-",Ln.ID_PREFIX_TOP_PINNED="t-",Ln.ID_PREFIX_BOTTOM_PINNED="b-",Ln.OBJECT_ID_SEQUENCE=0,Ln.EVENT_ROW_SELECTED="rowSelected",Ln.EVENT_DATA_CHANGED="dataChanged",Ln.EVENT_CELL_CHANGED="cellChanged",Ln.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",Ln.EVENT_MASTER_CHANGED="masterChanged",Ln.EVENT_GROUP_CHANGED="groupChanged",Ln.EVENT_MOUSE_ENTER="mouseEnter",Ln.EVENT_MOUSE_LEAVE="mouseLeave",Ln.EVENT_HEIGHT_CHANGED="heightChanged",Ln.EVENT_TOP_CHANGED="topChanged",Ln.EVENT_DISPLAYED_CHANGED="displayedChanged",Ln.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",Ln.EVENT_LAST_CHILD_CHANGED="lastChildChanged",Ln.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",Ln.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",Ln.EVENT_EXPANDED_CHANGED="expandedChanged",Ln.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",Ln.EVENT_SELECTABLE_CHANGED="selectableChanged",Ln.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",Ln.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",Ln.EVENT_DRAGGING_CHANGED="draggingChanged";var Nn=Ln,_n=class extends Cr{constructor(){super('\n            <div class="ag-selection-checkbox" role="presentation">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=yi(e,t),[s,r]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],n=e(s,r);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",e=>{qe(e)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",e=>{qe(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(i,t)?0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e):i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}),this.addManagedListener(this.rowNode,Nn.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.rowNode,Nn.EVENT_DATA_CHANGED,e),this.addManagedListener(this.rowNode,Nn.EVENT_CELL_CHANGED,e),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i;let s=this.rowNode.selectable;const r=this.getIsVisible();if(s)if("function"==typeof r){const t=null==(e=this.overrides)?void 0:e.callbackParams;if(this.column){const e=this.column.createColumnFunctionCallbackParams(this.rowNode);s=r(d(d({},t),e))}else s=r(u(d({},t),{node:this.rowNode,data:this.rowNode.data}))}else s=null!=r&&r;if(null==(t=this.column)?void 0:t.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!s),this.setVisible(!0),void this.setDisplayed(!0);(null==(i=this.overrides)?void 0:i.removeHidden)?this.setDisplayed(s):this.setVisible(s)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null==(t=null==(e=this.column)?void 0:e.getColDef())?void 0:t.checkboxSelection}};g([Sr("eCheckbox")],_n.prototype,"eCheckbox",2),g([le],_n.prototype,"postConstruct",1);var On=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(On||{}),Fn=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(Fn||{}),Gn=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Gn||{}),Bn=class extends rt{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=$s("columnMovePin",this.gos,null),this.eHideIcon=$s("columnMoveHide",this.gos,null),this.eMoveIcon=$s("columnMoveMove",this.gos,null),this.eLeftIcon=$s("columnMoveLeft",this.gos,null),this.eRightIcon=$s("columnMoveRight",this.gos,null),this.eGroupIcon=$s("columnMoveGroup",this.gos,null),this.eAggregateIcon=$s("columnMoveValue",this.gos,null),this.ePivotIcon=$s("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=$s("dropNotAllowed",this.gos,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(t=>t.dragSource===e);t&&(this.dragService.removeDragSource(t.params),_e(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,s,r,n;const o=this.getHorizontalDirection(e),a=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const l=this.dropTargets.filter(t=>this.isMouseOnDropTarget(e,t)),c=this.findCurrentDropTarget(e,l);if(c!==this.lastDropTarget)this.leaveLastTargetIfExists(e,o,a,t),null!==this.lastDropTarget&&null===c&&(null==(s=(i=this.dragSource).onGridExit)||s.call(i,this.dragItem)),null===this.lastDropTarget&&null!==c&&(null==(n=(r=this.dragSource).onGridEnter)||n.call(r,this.dragItem)),this.enterDragTargetIfExists(c,e,o,a,t),this.lastDropTarget=c;else if(c&&c.onDragging){const i=this.createDropTargetEvent(c,e,o,a,t);c.onDragging(i)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const s=e.clientX>=t.left&&e.clientX<t.right,r=e.clientY>=t.top&&e.clientY<t.bottom;if(!s||!r)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const t of i)if(this.allContainersIntersect(e,t)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const s=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of s)for(const i of t)if(-1!==Ue(this.getAllContainersFromDropTarget(i)).indexOf(e))return i;return null}enterDragTargetIfExists(e,t,i,s,r){if(e){if(e.onDragEnter){const n=this.createDropTargetEvent(e,t,i,s,r);e.onDragEnter(n)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const r=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(r)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(e=>e.external).find(t=>t.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,r){const n=e.getContainer(),o=n.getBoundingClientRect(),{gridApi:a,columnApi:l,dragItem:c,dragSource:h}=this;return{event:t,x:t.clientX-o.left,y:t.clientY-o.top,vDirection:s,hDirection:i,dragSource:h,fromNudge:r,dragItem:c,api:a,columnApi:l,dropZoneTarget:n}}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,s=Oi()-2,r=Fi()-2,n=ms(t.offsetParent),{clientY:o,clientX:a}=e;let l=o-n.top-i/2,c=a-n.left-10;const h=this.gos.getDocument(),d=h.defaultView||window,u=d.pageYOffset||h.documentElement.scrollTop,p=d.pageXOffset||h.documentElement.scrollLeft;s>0&&c+t.clientWidth>s+p&&(c=s+p-t.clientWidth),c<0&&(c=0),r>0&&l+t.clientHeight>r+u&&(l=r+u-t.clientHeight),l<0&&(l=0),t.style.left=`${c}px`,t.style.top=`${l}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=xs(Bn.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;K(i)&&(i=i()),t.innerHTML=Ct(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gos.getDocument();let r=null,n=null;try{r=s.fullscreenElement}catch(e){}finally{r||(r=this.gos.getRootNode());n=r.querySelector("body")||(r instanceof ShadowRoot?r:r instanceof Document?null==r?void 0:r.documentElement:r)}this.eGhostParent=n,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){Cs(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():Bn.ICON_NOT_ALLOWED),e){case Bn.ICON_PINNED:i=this.ePinnedIcon;break;case Bn.ICON_MOVE:i=this.eMoveIcon;break;case Bn.ICON_LEFT:i=this.eLeftIcon;break;case Bn.ICON_RIGHT:i=this.eRightIcon;break;case Bn.ICON_GROUP:i=this.eGroupIcon;break;case Bn.ICON_AGGREGATE:i=this.eAggregateIcon;break;case Bn.ICON_PIVOT:i=this.ePivotIcon;break;case Bn.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case Bn.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}};Bn.ICON_PINNED="pinned",Bn.ICON_MOVE="move",Bn.ICON_LEFT="left",Bn.ICON_RIGHT="right",Bn.ICON_GROUP="group",Bn.ICON_AGGREGATE="aggregate",Bn.ICON_PIVOT="pivot",Bn.ICON_NOT_ALLOWED="notAllowed",Bn.ICON_HIDE="hide",Bn.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n            <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n            <div class="ag-dnd-ghost-label"></div>\n        </div>',g([de("dragService")],Bn.prototype,"dragService",2),g([de("mouseEventService")],Bn.prototype,"mouseEventService",2),g([de("columnApi")],Bn.prototype,"columnApi",2),g([de("gridApi")],Bn.prototype,"gridApi",2),g([le],Bn.prototype,"init",1),g([ce],Bn.prototype,"clearDragSourceParamsList",1),Bn=g([he("dragAndDropService")],Bn);var Vn=class extends Cr{constructor(e,t,i,s,r,n){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=r,this.suppressVisibilityChange=n,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(Ys("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new zn(this,this.beans,this.rowNode,this.column):new Un(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&z("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var e;const i=this.getDragItem(),s=(null==(e=i.rowNodes)?void 0:e.length)||1,r=this.getRowDragText(this.column);return r?r(i,s):1===s?this.cellValueFn():`${s} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};g([de("beans")],Vn.prototype,"beans",2),g([le],Vn.prototype,"postConstruct",1),g([ce],Vn.prototype,"removeDragSource",1);var Hn=class extends rt{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=K(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},Un=class extends Hn{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}};g([le],Un.prototype,"postConstruct",1);var zn=class extends Hn{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,ct.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),i=this.gos.get("suppressRowDrag"),s=this.beans.dragAndDropService.hasExternalDropZones(),r=t&&!s||i;this.setDisplayedOrVisible(r)}};g([le],zn.prototype,"postConstruct",1);var Wn=class extends rt{init(e,t,i,s,r,n,o){var a,l,c,h;this.params=o,this.eGui=t,this.eCheckbox=i,this.eExpanded=s,this.eContracted=r,this.comp=e,this.compClass=n;const{node:d,value:u,colDef:p}=o,g=this.isTopLevelFooter();if(!g){if(this.isEmbeddedRowMismatch())return;if(d.footer&&this.gos.get("groupHideOpenParents")&&(p&&p.showRowGroup)!==(d.rowGroupColumn&&d.rowGroupColumn.getColId()))return}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!g){const e=o.node.footer&&o.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)}),t="multipleColumns"!=this.gos.get("groupDisplayType")||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!o.node.footer&&(!o.node.group||null!=o.node.rowGroupIndex&&o.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)})),i=!d.group&&((null==(a=this.params.colDef)?void 0:a.field)||(null==(l=this.params.colDef)?void 0:l.valueGetter)),s=this.isExpandable(),r=this.columnModel.isPivotMode()&&d.leafGroup&&(null==(c=d.rowGroupColumn)?void 0:c.getColId())===(null==(h=o.column)?void 0:h.getColDef().showRowGroup);if(!(this.showingValueForOpenedParent||s||i||t||e||r))return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=null==(e=this.params.colDef)?void 0:e.cellAriaRole,s=null==(t=this.params.column)?void 0:t.getColDef().cellAriaRole;return i||s||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void si(t);const i=()=>{ii(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,Nn.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow())return!1;if(null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e)return!0;if(!0===e.showRowGroup)return!0;const t=this.columnModel.getRowGroupColumns();return!t||0===t.length||t[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}b(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gos.get("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return void(this.showingValueForOpenedParent=!1)}const i=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:s,value:r}=t;let n=s;if(null==n){const t=this.displayedGroupNode.rowGroupColumn&&(null==(e=this.params.column)?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));n=""===this.displayedGroupNode.key&&this.displayedGroupNode.group&&t?this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):null!=r?r:null}this.comp.setInnerRenderer(i,n)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t&&!t.isRowGroupDisplayed(e.getId()))return this.params;const i=this.params,{value:s,node:r}=this.params,n=this.valueService.formatValue(e,r,s);return u(d({},i),{valueFormatted:n})}addFooterValue(){let e=this.params.totalValueGetter;if(!e){const t=this.params.footerValueGetter;t&&(e=t,z("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let t="";if(e){const i=L(this.params);i.value=this.params.value,"function"==typeof e?t=e(i):"string"==typeof e?t=this.expressionService.evaluate(e,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=e=>e&&e.componentClass==this.compClass;if(t&&!i(t))return t;const s=this.displayedGroupNode.rowGroupColumn,r=s?s.getColDef():void 0;if(!r)return;const n=this.userComponentFactory.getCellRendererDetails(r,e);return n&&!i(n)?n:i(n)&&r.cellRendererParams&&r.cellRendererParams.innerRenderer?this.userComponentFactory.getInnerRendererDetails(r.cellRendererParams,e):void 0}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,Nn.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,t=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(t)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=Ys("groupExpanded",this.gos,null),s=Ys("groupContracted",this.gos,null);i&&this.eExpanded.appendChild(i),s&&this.eContracted.appendChild(s);const r=t.eGridCell;(null==(e=this.params.column)?void 0:e.isCellEditable(t.node))&&this.gos.get("enableGroupEdit")||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(r,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(r,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,Nn.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Nn.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Nn.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Nn.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Nn.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(e){Xe(e)||(qe(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!e.isExpandable()||e.footer||t)return!1;const i=this.params.column;return null==i||"string"!=typeof i.getColDef().showRowGroup||this.isShowRowGroupForThisRow()}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:s}=e,r=this.isExpandable();if(r){const e=!!this.showingValueForOpenedParent||s.expanded;this.comp.setExpandedDisplayed(e),this.comp.setContractedDisplayed(!e)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const n=i.isPivotMode(),o=n&&t.leafGroup,a=r&&!o,l=s.footer&&-1===s.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),n?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",o):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,Nn.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,s=this.gos.get("treeData"),r=!i||s||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+r,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new Vn(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const e=new _n;this.getContext().createBean(e),e.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(e.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(e))}this.comp.setCheckboxVisible(t)}onKeyDown(e){e.key!==Xs.ENTER||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){Xe(e)||Je(this.eExpanded,e)||Je(this.eContracted,e)||this.onExpandOrContract(e)}};g([de("expressionService")],Wn.prototype,"expressionService",2),g([de("valueService")],Wn.prototype,"valueService",2),g([de("columnModel")],Wn.prototype,"columnModel",2),g([de("userComponentFactory")],Wn.prototype,"userComponentFactory",2),g([de("ctrlsService")],Wn.prototype,"ctrlsService",2);var jn=class e extends Cr{constructor(){super(e.TEMPLATE)}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setContractedDisplayed:e=>os(this.eContracted,e),setExpandedDisplayed:e=>os(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e)},i=this.createManagedBean(new Wn),s=!e.colDef,r=this.getGui();i.init(t,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&Ht(r,i.getCellAriaRole())}setRenderDetails(e,t){if(e){const t=e.newAgStackInstance();if(!t)return;t.then(e=>{if(!e)return;const t=()=>this.context.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};jn.TEMPLATE='<span class="ag-cell-wrapper">\n            <span class="ag-group-expanded" ref="eExpanded"></span>\n            <span class="ag-group-contracted" ref="eContracted"></span>\n            <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n            <span class="ag-group-value" ref="eValue"></span>\n            <span class="ag-group-child-count" ref="eChildCount"></span>\n        </span>',g([Sr("eExpanded")],jn.prototype,"eExpanded",2),g([Sr("eContracted")],jn.prototype,"eContracted",2),g([Sr("eCheckbox")],jn.prototype,"eCheckbox",2),g([Sr("eValue")],jn.prototype,"eValue",2),g([Sr("eChildCount")],jn.prototype,"eChildCount",2);var Kn=jn,$n=class e extends Cr{constructor(){super(e.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=Ys("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}};$n.TEMPLATE='<div class="ag-loading">\n            <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n            <span class="ag-loading-text" ref="eLoadingText"></span>\n        </div>',g([Sr("eLoadingIcon")],$n.prototype,"eLoadingIcon",2),g([Sr("eLoadingText")],$n.prototype,"eLoadingText",2);var Yn=$n,qn=class e extends Cr{constructor(){super(e.TEMPLATE)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>$t(e.eParentOfValue)),$t(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Kt(this.getGui(),t)}setupLoading(){const e=this.gos.getDocument().createElement("div");e.classList.add("ag-skeleton-effect"),this.getGui().appendChild(e);const t=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Kt(this.getGui(),t)}refresh(e){return!1}destroy(){super.destroy()}};qn.TEMPLATE='<div class="ag-skeleton-container"></div>';var Xn=qn,Zn=class e extends Cr{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_LOADING_OVERLAY_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("loadingOoo","Loading...")})}}};Zn.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var Qn=Zn,Jn=class e extends Cr{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_NO_ROWS_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")})}}};Jn.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var eo=Jn,to=class extends En{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=Ct(t,!0)}},io=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==Xs.UP&&e.key!==Xs.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!C(e)&&!C(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},so=class extends Dn{constructor(){super(new io)}},ro=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return C(e)||C(this.params.value)?null!=e?e:null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Xi(e,!1)}},no=class extends Dn{constructor(){super(new ro)}},oo=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return C(e)||C(this.params.value)?this.params.parseValue(null!=e?e:""):this.params.value}getStartValue(){var e,t;return Xi(null!=(t=this.parseDate(null!=(e=this.params.value)?e:void 0))?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}},ao=class extends Dn{constructor(){super(new oo(()=>this.dataTypeService))}};g([de("dataTypeService")],ao.prototype,"dataTypeService",2);var lo=class e extends Cr{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),qt(t,"polite"),this.addManagedListener(t,"click",e=>{if(qe(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)}),this.addManagedListener(t,"dblclick",e=>{qe(e)}),this.addManagedListener(this.params.eGridCell,"keydown",e=>{if(e.key===Xs.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,s;let r,n=!0;if(e.node.group&&e.column){const i=e.column.getColId();i.startsWith(ut)?r=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[i]?r=null!=(t=e.value)?t:void 0:n=!1}else r=null!=(i=e.value)?i:void 0;if(!n)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(r);const o=null!=e.disabled?e.disabled:!(null==(s=e.column)?void 0:s.isCellEditable(e.node));this.eCheckbox.setDisabled(o);const a=this.localeService.getLocaleTextFunc(),l=yi(a,r),c=o?l:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${l})`;this.eCheckbox.setInputAriaLabel(c)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:s,value:r}=this.params,n={type:ct.EVENT_CELL_EDITING_STARTED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:r};this.eventService.dispatchEvent(n);const o=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:ct.EVENT_CELL_EDITING_STOPPED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:r,oldValue:r,newValue:e,valueChanged:o};this.eventService.dispatchEvent(a)}};lo.TEMPLATE='\n        <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n            <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n        </div>',g([Sr("eCheckbox")],lo.prototype,"eCheckbox",2);var co=lo,ho=class extends En{constructor(){super('\n            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}init(e){var t;this.params=e;const i=null!=(t=e.value)?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,ct.EVENT_FIELD_VALUE_CHANGED,e=>this.setAriaLabel(e.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=yi(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}};g([Sr("eCheckbox")],ho.prototype,"eCheckbox",2);var uo=class extends Cr{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=null!=(t=this.params.cssClassPrefix)?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=xs(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(Ys("check",this.gos)):this.params.icon&&(_s(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=xs(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=xs(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=xs(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";ii(t,!1),e.appendChild(Ys(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},po=class extends rt{constructor(){super(...arguments),this.agGridDefaults={agDateInput:en,agColumnHeader:Sn,agColumnGroupHeader:xn,agSortIndicator:Cn,agTextColumnFloatingFilter:mn,agNumberColumnFloatingFilter:gn,agDateColumnFloatingFilter:Jr,agReadOnlyFloatingFilter:xr,agAnimateShowChangeCellRenderer:Pn,agAnimateSlideCellRenderer:kn,agGroupCellRenderer:Kn,agGroupRowRenderer:Kn,agLoadingCellRenderer:Yn,agSkeletonCellRenderer:Xn,agCheckboxCellRenderer:co,agCellEditor:Rn,agTextCellEditor:Rn,agNumberCellEditor:so,agDateCellEditor:no,agDateStringCellEditor:ao,agSelectCellEditor:Tn,agLargeTextCellEditor:An,agCheckboxCellEditor:ho,agTextColumnFilter:hn,agNumberColumnFilter:an,agDateColumnFilter:Zr,agLoadingOverlay:Qn,agNoRowsOverlay:eo,agTooltipComponent:to,agMenuItem:uo},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}init(){const e=this.gos.get("components");null!=e&&k(e,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=s)return i(s,!0);const r=this.jsComps[t];if(r)return i(r,this.getFrameworkOverrides().isFrameworkComponent(r));const n=this.agGridDefaults[t];if(n)return i(n,!1);const o=this.enterpriseAgDefaultCompsModule[t];return o?ne.__assertRegistered(o,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):U(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=zs(t,[...Object.keys(this.agGridDefaults).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(`         Did you mean: [${i.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};g([le],po.prototype,"init",1),po=g([he("userComponentRegistry")],po);var go={propertyName:"dateComponent",cellRenderer:!1},mo={propertyName:"headerComponent",cellRenderer:!1},fo={propertyName:"headerGroupComponent",cellRenderer:!1},yo={propertyName:"cellRenderer",cellRenderer:!0},vo={propertyName:"loadingCellRenderer",cellRenderer:!0},Co={propertyName:"cellEditor",cellRenderer:!1},bo={propertyName:"innerRenderer",cellRenderer:!0},So={propertyName:"loadingOverlayComponent",cellRenderer:!1},wo={propertyName:"noRowsOverlayComponent",cellRenderer:!1},xo={propertyName:"tooltipComponent",cellRenderer:!1},Eo={propertyName:"filter",cellRenderer:!1},Mo={propertyName:"floatingFilterComponent",cellRenderer:!1},Ao={propertyName:"toolPanel",cellRenderer:!1},To={propertyName:"statusPanel",cellRenderer:!1},Do={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Io={propertyName:"loadingCellRenderer",cellRenderer:!0},Ro={propertyName:"groupRowRenderer",cellRenderer:!0},Po={propertyName:"detailCellRenderer",cellRenderer:!0},ko={propertyName:"menuItem",cellRenderer:!1},Lo=class{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}};Lo.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var No=class extends rt{getHeaderCompDetails(e,t){return this.getCompDetails(e,mo,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,fo,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Do,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Io,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ro,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Po,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,bo,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,bo,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,yo,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,vo,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,Co,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,Eo,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,go,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,So,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,wo,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,xo,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,yo,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,Mo,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Ao,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,To,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,ko,"agMenuItem",t,!0)}getCompDetails(e,t,i,s,r=!1){const{propertyName:n,cellRenderer:o}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:h,popupFromSelector:d,popupPositionFromSelector:u}=this.getCompKeys(e,t,s);const p=e=>{const t=this.userComponentRegistry.retrieve(n,e);t&&(l=t.componentFromFramework?void 0:t.component,c=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==l&&null==c&&null!=i&&p(i),l&&o&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(n,l)),!l&&!c)return void(r&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`));const g=this.mergeParamsWithApplicationProvidedParams(e,t,s,h),m=null==l,f=l||c;return{componentFromFramework:m,componentClass:f,params:g,type:t,popupFromSelector:d,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(f,m,g,t)}}getCompKeys(e,t,i){const{propertyName:s}=t;let r,n,o,a,l,c;if(e){const t=e,h=t[s+"Selector"],d=h?h(i):null,u=e=>{"string"==typeof e?r=e:null!=e&&!0!==e&&(this.getFrameworkOverrides().isFrameworkComponent(e)?o=e:n=e)};d?(u(d.component),a=d.params,l=d.popup,c=d.popupPosition):u(t[s])}return{compName:r,jsComp:n,fwComp:o,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:c}}newAgStackInstance(e,t,i,s){const r=s.propertyName;let n;if(t){const t=this.componentMetadataProvider.retrieve(r);n=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,s)}else n=new e;const o=this.initComponent(n,i);return null==o?dr.resolve(n):o.then(()=>n)}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const r=this.gos.getGridCommonParams();O(r,i);const n=e&&e[t.propertyName+"Params"];return"function"==typeof n?O(r,n(i)):"object"==typeof n&&O(r,n),O(r,s),r}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:s,jsComp:r,fwComp:n}=this.getCompKeys(e,Eo);return s?i=Lo.getFloatingFilterType(s):null==r&&null==n&&!0===e.filter&&(i=t()),i}};g([de("gridOptions")],No.prototype,"gridOptions",2),g([de("agComponentUtils")],No.prototype,"agComponentUtils",2),g([de("componentMetadataProvider")],No.prototype,"componentMetadataProvider",2),g([de("userComponentRegistry")],No.prototype,"userComponentRegistry",2),g([ue("frameworkComponentWrapper")],No.prototype,"frameworkComponentWrapper",2),No=g([he("userComponentFactory")],No);var _o=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(_o||{}),Oo=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(Oo||{}),Fo=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),r=this.scrollByTick;this.tickLeft=e.clientX<s.left+r,this.tickRight=e.clientX>s.right-r,this.tickUp=e.clientY<s.top+r&&!i,this.tickDown=e.clientY>s.bottom-r&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Go=class extends rt{constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new Fo({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?Bn.ICON_NOT_ALLOWED:Bn.ICON_MOVE}shouldPreventRowMove(){return!!this.columnModel.getRowGroupColumns().length||(!!this.filterManager.isAnyFilterPresent()||!!this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(ct.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),r=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(r[0],t):this.moveRows(r,t))}getRowIndexNumber(e){return parseInt(Ie(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,s=this.mouseEventService.getNormalisedPosition(e).y,r=e.dragItem.rowNodes;let n=i?1:0;if(this.isFromThisGrid(e))r.forEach(e=>{e.rowTop<s&&(n-=1)}),this.moveRows(r,s,n);else{const e=this.gos.getCallback("getRowId");let t=this.clientSideRowModel.getRowIndexAtPixel(s)+1;0===this.clientSideRowModel.getHighlightPosition(s)&&t--,this.clientSideRowModel.updateRowData({add:r.map(e=>e.data).filter(t=>!this.clientSideRowModel.getRowNode(e?e({data:t,level:0}):t.id)),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var s;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),null==(s=this.rangeService)||s.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void z("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_ENTER,t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_LEAVE,t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_MOVE,t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(d({isInterestedIn:e=>2===e,getIconName:()=>Bn.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),r=this.onDragging.bind(this),n=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_ENTER,t))}:i,onDragLeave:e.onDragLeave?t=>{s(t),e.onDragLeave(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_LEAVE,t))}:s,onDragging:e.onDragging?t=>{r(t),e.onDragging(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_MOVE,t))}:r,onDragStop:e.onDragStop?t=>{n(t),e.onDragStop(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_END,t))}:n,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:r,onDragStop:n,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let s,r,n=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(n=this.rowModel.getRowIndexAtPixel(i),s=this.rowModel.getRow(n)),t.vDirection){case 1:r="down";break;case 0:r="up";break;default:r=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:s,y:i,vDirection:r})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_END,e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(e=>{e.setDragging(!1)})}};g([de("dragAndDropService")],Go.prototype,"dragAndDropService",2),g([de("rowModel")],Go.prototype,"rowModel",2),g([de("paginationProxy")],Go.prototype,"paginationProxy",2),g([de("columnModel")],Go.prototype,"columnModel",2),g([de("focusService")],Go.prototype,"focusService",2),g([de("sortController")],Go.prototype,"sortController",2),g([de("filterManager")],Go.prototype,"filterManager",2),g([de("selectionService")],Go.prototype,"selectionService",2),g([de("mouseEventService")],Go.prototype,"mouseEventService",2),g([de("ctrlsService")],Go.prototype,"ctrlsService",2),g([ue("rangeService")],Go.prototype,"rangeService",2),g([le],Go.prototype,"postConstruct",1);var Bo=class extends rt{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(t=>t.dragSource===e);t&&(this.removeListener(t),_e(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:r}=e;i.addEventListener("mousedown",t);let n=null;const o=this.gos.get("suppressTouch");s&&!o&&(n=t=>{ns(t.target)||(t.cancelable&&(t.preventDefault(),r&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=t=>this.onTouchUp(t,e.eElement),r=t.target,n=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:r,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:r,type:"touchend",listener:s,options:{passive:!0}},{target:r,type:"touchcancel",listener:s,options:{passive:!0}}];this.addTemporaryEvents(n),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=this.gos.getRootNode(),r=[{target:s,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:s,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:s,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(r),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(e=>{const{target:t,type:i,listener:s,options:r}=e;t.addEventListener(i,s,r)}),this.dragEndFunctions.push(()=>{e.forEach(e=>{const{target:t,type:i,listener:s,options:r}=e;t.removeEventListener(i,s,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return sr(e,t,C(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:ct.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;Ti()&&(null==(i=this.gos.getDocument().getSelection())||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=null==t?void 0:t.tagName.toLocaleLowerCase();return!!(null==i?void 0:i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:ct.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}};g([de("mouseEventService")],Bo.prototype,"mouseEventService",2),g([ce],Bo.prototype,"removeAllListeners",1),Bo=g([he("dragService")],Bo);var Vo="ag-list-item-hovered",Ho=class extends rt{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?Bn.ICON_PINNED:Bn.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new Fo({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const s=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,is(s,Vo),is(s,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),n=Math.max(0,(e.y-i+r)/s),o=this.params.getNumRows(this.comp)-1,a=0|Math.min(o,n);return{rowIndex:a,position:Math.round(n)>n||n>o?"bottom":"top",component:this.virtualList.getComponentAt(a)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${Vo}`).forEach(e=>{[Vo,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(t=>{e.classList.remove(t)})}),this.lastHoveredListItem=null}};function Uo(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}g([de("dragAndDropService")],Ho.prototype,"dragAndDropService",2),g([le],Ho.prototype,"postConstruct",1);var zo=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){delete this.detailGridInfoMap[e]}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;k(this.detailGridInfoMap,(i,s)=>{C(s)&&(e(s,t),t++)})}getDataAsCsv(e){if(ne.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){ne.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return!(!ne.__assertRegistered("@ag-grid-enterprise/excel-export","api."+e,this.context.getGridId())||1===this.excelCreator.getFactoryMode()&&(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),1))}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(ne.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(ne.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){ne.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),s=`aria-${e}`;null===t?i.removeAttribute(s):i.setAttribute(s,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,s){z(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${null!=s?s:""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(e))}flashCells(e={}){const t=e=>z(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);C(e.fadeDelay)&&t("fade"),C(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(e))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(t))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return z("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i,s){this.expansionService.setRowNodeExpanded(e,t,i,s)}onGroupExpandedOrCollapsed(){b(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){b(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return ne.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){ne.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(e=>e.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==e.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1)))return;const{nodes:t,source:i,newValue:s}=e,r=t;this.selectionService.setNodesSelected({nodes:r,source:null!=i?i:"api",newValue:s})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return b(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){b(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!b(this.clientSideRowModel))return this.selectionService.getBestCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t),"ensureVisible")}forEachLeafNode(e){b(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){b(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){b(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return z("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(ne.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return Uo(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(e))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return ne.__assertRegistered("@ag-grid-enterprise/side-bar","api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance"))return Uo(this.sideBarService.getSideBarComp().getToolPanelInstance(e))}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(C(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:e,rowNode:t})}getCellValue(e){var t;const{colKey:i,rowNode:s,useFormatter:r}=e;let n=null!=(t=this.columnModel.getPrimaryColumn(i))?t:this.columnModel.getGridColumn(i);if(b(n))return null;const o=this.valueService.getValue(n,s);if(r){const e=this.valueService.formatValue(n,s,o);return null!=e?e:Ct(o,!0)}return o}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){var e;const t=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const i={type:ct.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(i),this.destroyCalled=!0,null==(e=this.ctrlsService.get("gridCtrl"))||e.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},G(this,["isDestroyed"],t)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(ne.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):ne.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),ne.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(ne.__assertRegistered("@ag-grid-enterprise/charts","api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>t())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(e){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(e))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(e))}downloadChart(e){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(e))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(e))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(e.chartId))}createRangeChart(e){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(e))}createPivotChart(e){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(e))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(e))}updateChart(e){return this.assertChart("updateChart",()=>this.chartService.updateChart(e))}restoreChart(e,t){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(e,t))}assertClipboard(e,t){ne.__assertRegistered("@ag-grid-enterprise/clipboard","api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(e))}cutToClipboard(e){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(e))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(e))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(e))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(e,t){z("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){z("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"}):console.error(`AG Grid: column '${e}' not found`)}showContextMenu(e){const{rowNode:t,column:i,value:s,x:r,y:n}=e||{};let{x:o,y:a}=this.menuService.getContextMenuPosition(t,i);null!=r&&(o=r),null!=n&&(a=n),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:o,clientY:a}),rowNode:t,column:i,value:s})}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showColumnMenu({column:t,positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(Uo)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(Uo)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn(`AG Grid: no column found for ${e.colKey}`);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const s=this.navigationService.getCellByPosition(i);s&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),s.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const s=null!=(t=e.startRow)?t:0,r=null!=(i=e.route)?i:[];s<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,s,r):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(e));this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(e,t)):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions()):this.logMissingRowModel("flushAsyncTransactions","clientSide")}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){"number"==typeof e?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,s="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,s)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e,t){this.gos.updateGridOptions({options:e,force:t,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){z(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){z("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){z("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){z("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){z("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){z("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){z("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};g([de("rowRenderer")],zo.prototype,"rowRenderer",2),g([de("navigationService")],zo.prototype,"navigationService",2),g([de("filterManager")],zo.prototype,"filterManager",2),g([de("columnModel")],zo.prototype,"columnModel",2),g([de("selectionService")],zo.prototype,"selectionService",2),g([de("gridOptionsService")],zo.prototype,"gos",2),g([de("valueService")],zo.prototype,"valueService",2),g([de("alignedGridsService")],zo.prototype,"alignedGridsService",2),g([de("eventService")],zo.prototype,"eventService",2),g([de("pinnedRowModel")],zo.prototype,"pinnedRowModel",2),g([de("context")],zo.prototype,"context",2),g([de("rowModel")],zo.prototype,"rowModel",2),g([de("sortController")],zo.prototype,"sortController",2),g([de("paginationProxy")],zo.prototype,"paginationProxy",2),g([de("focusService")],zo.prototype,"focusService",2),g([de("dragAndDropService")],zo.prototype,"dragAndDropService",2),g([de("menuService")],zo.prototype,"menuService",2),g([de("valueCache")],zo.prototype,"valueCache",2),g([de("animationFrameService")],zo.prototype,"animationFrameService",2),g([de("ctrlsService")],zo.prototype,"ctrlsService",2),g([de("overlayService")],zo.prototype,"overlayService",2),g([de("stateService")],zo.prototype,"stateService",2),g([de("expansionService")],zo.prototype,"expansionService",2),g([de("apiEventService")],zo.prototype,"apiEventService",2),g([de("frameworkOverrides")],zo.prototype,"frameworkOverrides",2),g([de("undoRedoService")],zo.prototype,"undoRedoService",2),g([de("rowNodeBlockLoader")],zo.prototype,"rowNodeBlockLoader",2),g([ue("csvCreator")],zo.prototype,"csvCreator",2),g([ue("excelCreator")],zo.prototype,"excelCreator",2),g([ue("rangeService")],zo.prototype,"rangeService",2),g([ue("clipboardService")],zo.prototype,"clipboardService",2),g([ue("aggFuncService")],zo.prototype,"aggFuncService",2),g([ue("statusBarService")],zo.prototype,"statusBarService",2),g([ue("chartService")],zo.prototype,"chartService",2),g([ue("ssrmTransactionManager")],zo.prototype,"serverSideTransactionManager",2),g([ue("sideBarService")],zo.prototype,"sideBarService",2),g([le],zo.prototype,"init",1),zo=g([he("gridApi")],zo);var Wo=class extends rt{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return C(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:Wo.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:Wo.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:Wo.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(i=>{const s=this.getQuickFilterTextForColumn(i,e);return C(s)&&s.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:r}=this;return r(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const r=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(r)}return C(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(i=>{const s=this.getQuickFilterTextForColumn(i,e);C(s)&&t.push(s)}),t.join(Wo.QUICK_FILTER_SEPARATOR)}};Wo.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",Wo.QUICK_FILTER_SEPARATOR="\n",g([de("valueService")],Wo.prototype,"valueService",2),g([de("columnModel")],Wo.prototype,"columnModel",2),g([de("rowModel")],Wo.prototype,"rowModel",2),g([le],Wo.prototype,"postConstruct",1),Wo=g([he("quickFilterService")],Wo);var jo=class extends rt{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATED,()=>this.onNewRowsLoaded("rowDataUpdated")),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",e=>this.setAdvancedFilterModel(e.currentValue)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onAdvancedFilterEnabledChanged(e)),this.addManagedListener(this.eventService,ct.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,Wo.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=d({},null!=(i=null==(t=null==(e=this.gos.get("initialState"))?void 0:e.filter)?void 0:t.filterModel)?i:{})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],s=this.getFilterModel();if(e){const t=ar(Object.keys(e));this.allColumnFilters.forEach((s,r)=>{const n=e[r];i.push(this.setModelOnFilterWrapper(s.filterPromise,n)),t.delete(r)}),t.forEach(t=>{const s=this.columnModel.getPrimaryColumn(t)||this.columnModel.getGridColumn(t);if(!s)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+t);if(!s.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const r=this.getOrCreateFilterWrapper(s,"NO_UI");r?i.push(this.setModelOnFilterWrapper(r.filterPromise,e[t])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)})}else this.allColumnFilters.forEach(e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))});dr.all(i).then(()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach((t,r)=>{const n=s?s[r]:null,o=e?e[r]:null;lr.jsonEquals(n,o)||i.push(t.column)}),i.length>0&&this.onFilterChanged({columns:i,source:t})})}setModelOnFilterWrapper(e,t){return new dr(i=>{e.then(e=>{"function"!=typeof e.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||dr.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const s=this.getModelFromFilterWrapper(t);C(s)&&(e[i]=s)}),e}getModelFromFilterWrapper(e){var t;const i=e.filterPromise.resolveNow(null,e=>e);return null==i?null!=(t=this.initialFilterModel[e.column.getColId()])?t:null:"function"!=typeof i.getModel?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):i.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(null==(t=this.advancedFilterService)?void 0:t.isFilterPresent())&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!(null==(e=this.advancedFilterService)?void 0:e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gos.getGroupAggFiltering(),i=e=>{if(!e.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!e.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach(t=>{if(t.filterPromise.resolveNow(!1,e)){const e=t.filterPromise.resolveNow(null,e=>e);i(t.column)?this.activeAggregateFilters.push(e):this.activeColumnFilters.push(e)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const s=i.filterPromise.resolveNow(!1,e=>e.isFilterActive());i.column.setFilterActive(s,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:s,aggData:r}=e,n=i?this.activeAggregateFilters:this.activeColumnFilters,o=i?r:s;for(let i=0;i<n.length;i++){const s=n[i];if(null!=s&&s!==t){if("function"!=typeof s.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!s.doesFilterPass({node:e,data:o}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:s,columns:r}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",s),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(e=>{e.filterPromise&&e.filterPromise.then(e=>{e&&e!==i&&e.onAnyFilterChanged&&e.onAnyFilterChanged()})});const n={source:t,type:ct.EVENT_FILTER_CHANGED,columns:r||[]};s&&O(n,s),this.processingFilterChange=!0,this.eventService.dispatchEvent(n),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!(null!=(e=this.gos.get("allowShowChangeAfterFilter"))&&e)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach(e=>{e.filterPromise.then(e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getGridColumn(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}getFilterComponent(e,t,i=!0){var s;if(i)return(null==(s=this.getOrCreateFilterWrapper(e,t))?void 0:s.filterPromise)||null;const r=this.cachedFilter(e);return r?r.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,e=>e.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i||(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let s;const r=u(d({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(s,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(s,e)(t),doesRowPassOtherFilter:e=>this.doesRowPassOtherFilters(s,e)}),n=this.userComponentFactory.getFilterDetails(i,r,t);return n?{filterPromise:()=>{const e=n.newAgStackInstance();return e&&e.then(e=>s=e),e},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:L(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const s={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:r,compDetails:n}=this.createFilterInstance(e);return s.filterPromise=null!=(i=null==r?void 0:r())?i:null,s.compDetails=n,s}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),s&&s===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();null==e||e.forEach(e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled())return!1;if(!e.isFilterAllowed())return!1;const s=this.allColumnFilters.get(e.getColId());return null==(i=null==(t=null==s?void 0:s.filterPromise)?void 0:t.resolveNow(!0,e=>"function"!=typeof(null==e?void 0:e.isFilterAllowed)||(null==e?void 0:e.isFilterAllowed())))||i}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getFilterComponent(e,"NO_UI");null!=i&&i.then(e=>{t(Uo(e))})},s=e.getColDef(),r=u(d({},this.createFilterParams(e,s)),{filterChangedCallback:()=>i(t=>this.filterChangedCallbackFactory(t,e)())}),n=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,Eo,r);let o=this.userComponentFactory.getDefaultFloatingFilterType(s,()=>this.getDefaultFloatingFilter(e));null==o&&(o="agReadOnlyFloatingFilter");const a={column:e,filterParams:n,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,a,o)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,e=>e&&e.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:ct.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(s)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:ct.EVENT_FILTER_MODIFIED,column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{var s;const r=null!=(s=null==i?void 0:i.source)?s:"api",n={filter:e,additionalEventAttributes:i,columns:[t],source:r};this.callOnFilterChangedOutsideRenderCycle(n)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s))return void this.destroyFilter(i,"paramsUpdated");const r=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then(e=>{!1===(!(null==e?void 0:e.refresh)||e.refresh(d(u(d({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>this.doesRowPassOtherFilters(e,t)}),r)))&&this.destroyFilter(i,"paramsUpdated")}):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,we.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(i)))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(null==i?void 0:i.render)&&(null==s?void 0:s.render)&&i.render===s.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(null!=e?e:null),this.onFilterChanged({source:"advancedFilter"})))}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&this.columnModel.getAllGridColumns().some(e=>e.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,e=>{if(!t)return;const i=Uo(e);t(i)});return Uo(i)}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstance(e,e=>{t(e)})})}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const s=this.getFilterComponent(i,"NO_UI"),r=s&&s.resolveNow(null,e=>e);return r?setTimeout(t,0,r):s&&s.then(e=>{t(e)}),r}warnAdvancedFilters(){z("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;null==(t=this.advancedFilterService)||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let i=()=>{};const s=new Promise(e=>{i=e});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),s}const i=this.columnModel.getPrimaryColumn(e),s=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return s?(r=this.setModelOnFilterWrapper(s.filterPromise,t),new Promise(e=>{r.then(t=>e(t))})):Promise.resolve();var r}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&null!=(t=this.cachedFilter(i))?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};g([de("valueService")],jo.prototype,"valueService",2),g([de("columnModel")],jo.prototype,"columnModel",2),g([de("rowModel")],jo.prototype,"rowModel",2),g([de("userComponentFactory")],jo.prototype,"userComponentFactory",2),g([de("rowRenderer")],jo.prototype,"rowRenderer",2),g([de("dataTypeService")],jo.prototype,"dataTypeService",2),g([de("quickFilterService")],jo.prototype,"quickFilterService",2),g([ue("advancedFilterService")],jo.prototype,"advancedFilterService",2),g([le],jo.prototype,"init",1),jo=g([he("filterManager")],jo);var Ko=class extends Cr{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,ct.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var e,t;return null!=(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?t:null}afterInit(){var e,t,i;return null!=(i=null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?void 0:t.then(()=>{}))?i:dr.resolve()}afterGuiAttached(e){var t,i;null==(i=null==(t=this.filterWrapper)?void 0:t.filterPromise)||i.then(t=>{var i;null==(i=null==t?void 0:t.afterGuiAttached)||i.call(t,e)})}afterGuiDetached(){var e,t;null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)||t.then(e=>{var t;null==(t=null==e?void 0:e.afterGuiDetached)||t.call(e)})}createFilter(e){var t;const{column:i,source:s}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(i,s),(null==(t=this.filterWrapper)?void 0:t.filterPromise)&&this.filterWrapper.filterPromise.then(t=>{let r=t.getGui();if(C(r)||console.warn(`AG Grid: getGui method from filter returned ${r}, it should be a DOM element or an HTML template string.`),"string"==typeof r&&(r=xs(r)),this.appendChild(r),e){const e={type:ct.EVENT_FILTER_OPENED,column:i,source:s,eGui:this.getGui()};this.eventService.dispatchEvent(e)}})}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getPrimaryColumn(this.column)||(Cs(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};g([de("filterManager")],Ko.prototype,"filterManager",2),g([de("columnModel")],Ko.prototype,"columnModel",2),g([le],Ko.prototype,"postConstruct",1);var $o=class extends Cr{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Yo=class e extends $o{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>os(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}};Yo.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell">\n            <div ref="eFloatingFilterBody" role="presentation"></div>\n            <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n                <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n            </div>\n        </div>',g([Sr("eFloatingFilterBody")],Yo.prototype,"eFloatingFilterBody",2),g([Sr("eButtonWrapper")],Yo.prototype,"eButtonWrapper",2),g([Sr("eButtonShowMainFilter")],Yo.prototype,"eButtonShowMainFilter",2),g([le],Yo.prototype,"postConstruct",1),g([ce],Yo.prototype,"destroyFloatingFilterComp",1);var qo=Yo,Xo=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(Xo||{}),Zo=class extends rt{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=null!=(e=this.gos.get("domLayout"))?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(z(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}};g([le],Zo.prototype,"postConstruct",1);var Qo=class extends rt{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Q(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Q(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?Q(this.onVScroll.bind(this),100):this.onVScroll.bind(this),r=i?Q(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),t.onScrollCallback(r)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:s,stickyBottomCenter:r,centerHeader:n,bottomCenter:o,fakeHScrollComp:a}=this.ctrlsService.getParams();n.setHorizontalScroll(-t),o.setContainerTranslateX(t),i.setContainerTranslateX(t),s.setContainerTranslateX(t),r.setContainerTranslateX(t);const l=this.centerRowsCtrl.getViewportElement(),c=0===this.lastScrollSource[1];e=Math.abs(e),c?a.setScrollPosition(e):vs(l,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;s=0===e?ys(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:ct.EVENT_BODY_SCROLL,direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const e=u(d({},t),{type:ct.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(e)},100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!ki())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=ds(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&fs()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&fs()?e>0?0:i:Math.min(Math.max(e,0),i)),vs(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){s=t;break}}else if(e===i||e===i.data){s=t;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);const s=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{s||this.paginationProxy.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),r=i.getStickyTopHeight(),n=i.getStickyBottomHeight(),o=this.paginationProxy.getRow(e);let a;do{const e=o.rowTop,i=o.rowHeight,s=this.paginationProxy.getPixelOffset(),l=o.rowTop-s,c=l+o.rowHeight,h=this.getVScrollPosition(),d=this.heightScaler.getDivStretchOffset(),u=h.top+d,p=h.bottom+d,g=p-u,m=this.heightScaler.getScrollPositionForPixel(l),f=this.heightScaler.getScrollPositionForPixel(c-g),y=Math.min((m+f)/2,l);let v=null;"top"===t?v=m:"bottom"===t?v=f:"middle"===t?v=y:u+r>l?v=m-r:p-n<c&&(v=f+n),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),a=e!==o.rowTop||i!==o.rowHeight}while(a);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i)return;if(i.isPinned())return;if(!this.columnModel.isColumnDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{null!==s&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),r=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),n=this.centerRowsCtrl.getCenterWidth(),o=this.enableRtl;let a=(o?i:s)||r,l=o?s:i;"auto"!==t&&(a="start"===t,l="end"===t);const c="middle"===t;if(a||l||c){const{colLeft:t,colMiddle:i,colRight:s}=this.getColumnBounds(e);return c?i-n/2:a?o?s:t:o?t-n:s-n}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:r}=this.getColumnBounds(e),n=this.enableRtl;return{columnBeforeStart:n?t>r:i<r,columnAfterEnd:n?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),s=e.getActualWidth(),r=e.getLeft(),n=t?-1:1,o=t?i-r:r;return{colLeft:o,colMiddle:o+s/2*n,colRight:o+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}};g([de("ctrlsService")],Qo.prototype,"ctrlsService",2),g([de("animationFrameService")],Qo.prototype,"animationFrameService",2),g([de("paginationProxy")],Qo.prototype,"paginationProxy",2),g([de("rowModel")],Qo.prototype,"rowModel",2),g([de("rowContainerHeightService")],Qo.prototype,"heightScaler",2),g([de("rowRenderer")],Qo.prototype,"rowRenderer",2),g([de("columnModel")],Qo.prototype,"columnModel",2),g([le],Qo.prototype,"postConstruct",1);var Jo=(e=>(e.ANIMATION_ON="ag-row-animation",e.ANIMATION_OFF="ag-row-no-animation",e))(Jo||{}),ea="ag-force-vertical-scroll",ta=class extends rt{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,r,n,o){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=r,this.eStickyTop=n,this.eStickyBottom=o,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",e=>this.setCellTextSelection(e.currentValue)),this.createManagedBean(new Zo(this.comp)),this.bodyScrollFeature=this.createManagedBean(new Qo(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,r,n,o]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(e=>{this.addManagedListener(e,"focusin",t=>{const{target:i}=t,s=cs(i,"ag-root",e);e.classList.toggle("ag-has-focus",!s)}),this.addManagedListener(e,"focusout",t=>{const{target:i,relatedTarget:s}=t,r=e.contains(s),n=cs(s,"ag-root",e);cs(i,"ag-root",e)||r&&!n||e.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(Vi()?16:0)}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(t))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===Ni(i))return void this.rowRenderer.stopEditing();let s=t.some(e=>e.contains(i))&&this.mouseEventService.isElementInThisGrid(i);if(!s){const e=this.popupService;s=e.getActivePopups().some(e=>e.contains(i))||e.isElementWithinCustomPopup(i)}s||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(t=>this.addManagedListener(t,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?ea:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&Is(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(t,e)};e(),this.addManagedListener(this.eventService,ct.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",e=>this.onFullWidthContainerWheel(e,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!ki())return;const t=new yn(this.eBodyViewport);this.addManagedListener(t,yn.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Go(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,s=us(this.eGridBody)-i;s>0?this.columnModel.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}};g([de("animationFrameService")],ta.prototype,"animationFrameService",2),g([de("rowContainerHeightService")],ta.prototype,"rowContainerHeightService",2),g([de("ctrlsService")],ta.prototype,"ctrlsService",2),g([de("columnModel")],ta.prototype,"columnModel",2),g([de("scrollVisibleService")],ta.prototype,"scrollVisibleService",2),g([de("menuService")],ta.prototype,"menuService",2),g([de("headerNavigationService")],ta.prototype,"headerNavigationService",2),g([de("dragAndDropService")],ta.prototype,"dragAndDropService",2),g([de("pinnedRowModel")],ta.prototype,"pinnedRowModel",2),g([de("rowRenderer")],ta.prototype,"rowRenderer",2),g([de("popupService")],ta.prototype,"popupService",2),g([de("mouseEventService")],ta.prototype,"mouseEventService",2),g([de("rowModel")],ta.prototype,"rowModel",2),g([de("filterManager")],ta.prototype,"filterManager",2);var ia=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(ia||{}),sa=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(sa||{}),ra="ag-cell-range-selected",na=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(ra,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ra}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ra}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ra}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ra}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),gi(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,r=!t&&e.bottom,n=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",r),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",n)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>He([1,0],e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,r=!1;const n=this.cellCtrl.getCellPosition().column,o=this.beans.columnModel;let a,l;e?(a=o.getDisplayedColAfter(n),l=o.getDisplayedColBefore(n)):(a=o.getDisplayedColBefore(n),l=o.getDisplayedColAfter(n));const c=this.rangeService.getCellRanges().filter(e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e));a||(r=!0),l||(i=!0);for(let e=0;e<c.length&&!(t&&i&&s&&r);e++){const n=c[e],o=this.rangeService.getRangeStartRow(n),h=this.rangeService.getRangeEndRow(n);!t&&this.beans.rowPositionUtils.sameRow(o,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(h,this.cellCtrl.getCellPosition())&&(s=!0),!r&&a&&n.columns.indexOf(a)<0&&(r=!0),!i&&l&&n.columns.indexOf(l)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:r}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=Ie(t),r=this.cellCtrl.getCellPosition(),n=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),o=e.get("enableRangeHandle");let a=1===i&&!this.cellCtrl.isEditing()&&(n||o);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(r,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),a=0===s.type}return a&&null!=s.endRow&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,r)}addSelectionHandle(){const e=this.beans.gos,t=Ie(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&b(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},oa=class extends rt{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();Re(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let r=0;i&&r<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),i&&!b(i))&&s===i.getPinned();r++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?Ie(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===this.column.getPinned()?t+this.beans.columnModel.getBodyContainerWidth()+(e||0):t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},aa=class extends rt{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,e=>this.cellComp.addOrRemoveCssClass(e,!0),e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!0))}destroy(){super.destroy()}},la=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};g([de("resizeObserverService")],la.prototype,"resizeObserverService",2),g([de("paginationProxy")],la.prototype,"paginationProxy",2),g([de("context")],la.prototype,"context",2),g([de("gridOptionsService")],la.prototype,"gos",2),g([de("environment")],la.prototype,"environment",2),g([de("rowRenderer")],la.prototype,"rowRenderer",2),g([de("valueService")],la.prototype,"valueService",2),g([de("eventService")],la.prototype,"eventService",2),g([de("columnModel")],la.prototype,"columnModel",2),g([de("headerNavigationService")],la.prototype,"headerNavigationService",2),g([de("navigationService")],la.prototype,"navigationService",2),g([de("columnAnimationService")],la.prototype,"columnAnimationService",2),g([de("focusService")],la.prototype,"focusService",2),g([de("popupService")],la.prototype,"popupService",2),g([de("stylingService")],la.prototype,"stylingService",2),g([de("columnHoverService")],la.prototype,"columnHoverService",2),g([de("userComponentFactory")],la.prototype,"userComponentFactory",2),g([de("userComponentRegistry")],la.prototype,"userComponentRegistry",2),g([de("animationFrameService")],la.prototype,"animationFrameService",2),g([de("dragService")],la.prototype,"dragService",2),g([de("dragAndDropService")],la.prototype,"dragAndDropService",2),g([de("sortController")],la.prototype,"sortController",2),g([de("filterManager")],la.prototype,"filterManager",2),g([de("rowContainerHeightService")],la.prototype,"rowContainerHeightService",2),g([de("frameworkOverrides")],la.prototype,"frameworkOverrides",2),g([de("cellPositionUtils")],la.prototype,"cellPositionUtils",2),g([de("rowPositionUtils")],la.prototype,"rowPositionUtils",2),g([de("selectionService")],la.prototype,"selectionService",2),g([de("rowCssClassCalculator")],la.prototype,"rowCssClassCalculator",2),g([de("rowModel")],la.prototype,"rowModel",2),g([de("ctrlsService")],la.prototype,"ctrlsService",2),g([de("ctrlsFactory")],la.prototype,"ctrlsFactory",2),g([de("agStackComponentsRegistry")],la.prototype,"agStackComponentsRegistry",2),g([de("valueCache")],la.prototype,"valueCache",2),g([de("rowNodeEventThrottle")],la.prototype,"rowNodeEventThrottle",2),g([de("localeService")],la.prototype,"localeService",2),g([de("syncService")],la.prototype,"syncService",2),g([de("ariaAnnouncementService")],la.prototype,"ariaAnnouncementService",2),g([ue("rangeService")],la.prototype,"rangeService",2),g([ue("selectionHandleFactory")],la.prototype,"selectionHandleFactory",2),g([le],la.prototype,"postConstruct",1),la=g([he("beans")],la);var ca=class extends la{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Xe(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:s}=this.beans,r=e.ctrlKey||e.metaKey;i&&r&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const n=this.cellCtrl.createEvent(e,ct.EVENT_CELL_CLICKED);t.dispatchEvent(n);const o=this.column.getColDef();o.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{o.onCellClicked(n)})},0),!s.get("singleClickEdit")&&!o.singleClickEdit||s.get("suppressClickEdit")||e.shiftKey&&0!=(null==i?void 0:i.getCellRanges().length)||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!ki()||Ze("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,ct.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,r=e.target,{cellCtrl:n,beans:o}=this,{eventService:a,rangeService:l,focusService:c}=o;if(this.isRightClickInExistingRange(e))return;const h=l&&0!=l.getCellRanges().length;if(!s||!h){const e=Ti()&&!n.isEditing()&&!ns(r);n.focusCell(e)}if(s&&h&&!c.isCellFocused(n.getCellPosition())){e.preventDefault();const t=c.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:s}=t,r=o.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s}),n=null==r?void 0:r.getCellCtrl(e);(null==n?void 0:n.isEditing())&&n.stopEditing(),c.setFocusedCell({column:e,rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(r)){if(l){const e=this.cellCtrl.getCellPosition();if(s)l.extendLatestRangeToCell(e);else{const s=t||i;l.setRangeToCell(e,s)}}a.dispatchEvent(this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return cs(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){}},ha=class extends rt{constructor(e,t,i,s,r){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=r}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case Xs.ENTER:this.onEnterKeyDown(e);break;case Xs.F2:this.onF2KeyDown(e);break;case Xs.ESCAPE:this.onEscapeKeyDown(e);break;case Xs.TAB:this.onTabKeyDown(e);break;case Xs.BACKSPACE:case Xs.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case Xs.DOWN:case Xs.UP:case Xs.RIGHT:case Xs.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){var i;const{cellCtrl:s,beans:r,rowNode:n}=this,{gos:o,rangeService:a,eventService:l}=r;if(!s.isEditing()){if(l.dispatchEvent({type:ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),tr(e,o.get("enableCellEditingOnBackspace"))){if(a&&o.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){const e=s.getColumn(),t=null!=(i=this.beans.valueService.parseValue(e,n,"",n.getValueFromValueService(e)))?i:null;n.setDataValue(e,t,"cellClear")}}else s.startRowOrCellEdit(e,t);l.dispatchEvent({type:ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?Xs.UP:Xs.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(Xs.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(Xs.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===r&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},da=class extends Cr{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(Ys("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);t?t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e})):(()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}})()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}};g([le],da.prototype,"postConstruct",1);var ua=class{static getHeaderClassesFromColDef(e,t,i,s){return b(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}static getToolPanelClassesFromColDef(e,t,i,s){return b(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}static getColumnClassesFromCollDef(e,t,i,s,r){if(b(e))return[];let n;return n="function"==typeof e?e(this.getClassParams(t,i,s,r)):e,"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}},pa=0,ga=class e extends rt{constructor(e,t,i,s){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.instanceId=e.getId()+"-"+pa++,this.colIdSanitised=Ct(this.column.getId()),i.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new oa(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellPositionFeature)||e.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new aa(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellCustomStyleFeature)||e.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new ca(this,this.beans,this.column),this.addDestroyFunc(()=>{var e;null==(e=this.cellMouseListenerFeature)||e.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new ha(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var e;null==(e=this.cellKeyboardListenerFeature)||e.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new na(this.beans,this),this.addDestroyFunc(()=>{var e;null==(e=this.cellRangeFeature)||e.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const s={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&C(t))return F(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new fr(s,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,s,r){var n,o,a,l;this.cellComp=e,this.eGui=t,this.printLayout=s,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),null==(n=this.cellPositionFeature)||n.setComp(t),null==(o=this.cellCustomStyleFeature)||o.setComp(e),null==(a=this.tooltipFeature)||a.refreshToolTip(),null==(l=this.cellKeyboardListenerFeature)||l.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(e=>e()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,s=r=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:n,paddingBottom:o,borderBottomWidth:a,borderTopWidth:l}=hs(t),c=n+o+a+l,h=e.offsetHeight+c;if(r<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout(()=>s(r+1),0)}const d=Math.max(h,i);this.rowNode.setRowAutoHeight(d,this.column)},r=()=>s(0);r();const n=this.beans.resizeObserverService.observeResize(e,r);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return null!=(e=this.column.getColDef().cellAriaRole)?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){var e;return null!=(e=this.valueFormatted)?e:this.value}showValue(e=!1){var t;const i=this.getValueToDisplay();let s;if(this.rowNode.stub){const e=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(s,i,e),null==(t=this.cellRangeFeature)||t.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned||"function"!=typeof e&&!0!==e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return t||i||s||r}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});const s=this.createCellEditorParams(e,t),r=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(r,s);this.editCompDetails=n;const o=null!=(null==n?void 0:n.popupFromSelector)?n.popupFromSelector:!!r.cellEditorPopup,a=null!=(null==n?void 0:n.popupPositionFromSelector)?n.popupPositionFromSelector:r.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,o,a,this.beans.gos.get("reactiveCustomComponents"));const l=this.createEvent(i,ct.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(l)}setEditing(e){var t;this.editing!==e&&(this.editing=e,null==(t=this.cellRangeFeature)||t.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return i?i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}:t}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),s=this.rowNode.getValueFromValueService(this.column);let r=!1;return i&&(r=this.saveNewValue(s,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(s,t,!e&&!!r),r}dispatchEditingStoppedEvent(e,t,i){const s=u(d({},this.createEvent(null,ct.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(s)}createCellEditorParams(e,t){return this.beans.gos.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:t,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)})}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,i,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{var i;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),null==(i=this.tooltipFeature)||i.refreshToolTip()}})}parseValue(e){return this.beans.valueService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){var t;this.refreshShouldDestroy()?null==(t=this.rowCtrl)||t.recreateCell(this):this.refreshCell(e)}refreshCell(e){var t,i,s,r;if(this.suppressRefreshCell||this.editing)return;const n=this.column.getColDef(),o=null!=e&&!!e.newData,a=null!=e&&!!e.suppressFlash||!!n.suppressCellFlash,l=null==n.field&&null==n.valueGetter&&null==n.showRowGroup,c=e&&e.forceRefresh||l||o,h=!!this.cellComp,d=this.updateAndFormatValue(h);if(h){if(c||d){this.showValue(o);const e=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!e&&(this.beans.gos.get("enableCellChangeFlash")||n.enableCellChangeFlash)&&this.flashCell(),null==(t=this.cellCustomStyleFeature)||t.applyUserStyles(),null==(i=this.cellCustomStyleFeature)||i.applyClassesFromColDef()}null==(s=this.tooltipFeature)||s.refreshToolTip(),null==(r=this.cellCustomStyleFeature)||r.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const t=e?Xs.UP:Xs.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.getCellPosition(),!1)}}flashCell(e){var t,i;const s=null!=(t=null==e?void 0:e.flashDuration)?t:null==e?void 0:e.flashDelay,r=null!=(i=null==e?void 0:e.fadeDuration)?i:null==e?void 0:e.fadeDelay;this.animateCell("data-changed",s,r)}animateCell(e,t,i){if(!this.cellComp)return;const s=`ag-cell-${e}`,r=`ag-cell-${e}-animation`,{gos:n}=this.beans;t||(t=n.get("cellFlashDuration")),C(i)||(i=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(s,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},i))},t)})}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var t;return null!=(t=this.callValueFormatter(e))?t:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.processCharacter(e)}onKeyDown(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.onKeyDown(e)}onMouseEvent(e,t){var i;null==(i=this.cellMouseListenerFeature)||i.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&(null==(e=this.cellPositionFeature)||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;ua.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);hi(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return null==(e=this.cellPositionFeature)?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,t)})}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&(null==e?void 0:e.forceBrowserFocus)&&(this.focusEventToRestore=e));this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:v(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(this.cellComp)if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing){const e=this.getCellEditor();if(null==e?void 0:e.refresh){const{eventKey:t,cellStartedEdit:i}=this.editCompDetails.params,s=this.createCellEditorParams(t,i),r=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(r,s);e.refresh(n.params)}}else this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,ct.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(i)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new _n;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new da(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc(()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const s=this.beans.gos.get("pagination"),r=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(r){if(!n)return void z("managed row dragging is only allowed in the Client Side Row Model");if(s)return void z("managed row dragging is not possible when doing pagination")}const o=new Vn(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(o),o}};ga.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var ma=ga,fa=0,ya=class e extends rt{constructor(e,t,i,s,r){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=s,this.printLayout=r,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+fa++,this.rowId=Ct(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=Ct(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),"left"===i?this.leftGui=s:"right"===i?this.rightGui=s:"fullWidth"===i?this.fullWidthGui=s:this.centerGui=s,this.initialiseRowComp(s),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),e){case"left":this.leftGui=void 0;break;case"right":this.rightGui=void 0;break;case"fullWidth":this.fullWidthGui=void 0;break;case"center":this.centerGui=void 0}}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(e=>e.element.style.display=t)}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(e=>s.addOrRemoveCssClass(e,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&ii(t.element,1==this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=Ct(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(X(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(X(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void z("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new Vn(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),s=this.createBean(i,this.beans.context);this.rowDragComps.push(s)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!ne.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>{var t;return null==(t=null==e?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()}):[null==(t=null==(e=this.fullWidthGui)?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),r=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(s);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":r?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){this.isFullWidth()||(e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0))}createCellCtrls(e,t,i=null){const s={list:[],map:{}},r=(e,t)=>{s.list.push(t),s.map[e]=t};return t.forEach(t=>{const i=t.getInstanceId();let s=e.map[i];s||(s=new ma(t,this.rowNode,this.beans,this)),r(i,s)}),e.list.forEach(e=>{null==s.map[e.getColumn().getInstanceId()]&&(this.isCellEligibleToBeRemoved(e,i)?e.destroy():r(e.getColumn().getInstanceId(),e))}),s}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)})}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list;default:throw new Error(`Unhandled case: ${e}`)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const t=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t);const i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const s=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,s,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const s=e.isEditing(),r=this.beans.focusService.isCellFocused(e.getCellPosition());if(s||r){const t=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(t)>=0)&&i}return i}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=C(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),s=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=s}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=s}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(e.element,t).params),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),r=e(this.rightGui,"right");return t&&i&&s&&r}addListeners(){this.addManagedListener(this.rowNode,Nn.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,Nn.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,Nn.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,Nn.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,Nn.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,ct.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,ct.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,ct.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,ct.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,ct.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,ct.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,ct.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach(e=>{this.addRowDraggerToRow(e)}):(this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[])}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,Nn.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,Nn.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell())this.beans.rowRenderer.redrawRow(this.rowNode);else{if(this.isFullWidth())return void(this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode));this.getAllCellCtrls().forEach(t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)}),this.onRowSelected(),this.postProcessCss()}}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(t=>{const i=0===e,s=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),ii(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:v(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(t=>t.element.contains(e.target));if((t?t.element:null)!==e.target)return;const i=this.rowNode,s=this.beans.focusService.getFocusedCell(),r={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s&&s.column};this.beans.navigationService.navigateToNextCell(e,e.key,r,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Xe(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),i=t?t.element:null,s=i===e.target;let r=null;s||(r=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!r)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const t=null==(e=this.allRowGuis.find(e=>ws(e.element)))?void 0:e.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var t;const i=this.rowNode,s=!!e&&this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned,r=this.fullWidthGui?this.fullWidthGui.element:null==(t=this.centerGui)?void 0:t.element;r&&(r.classList.toggle("ag-full-width-focus",s),s&&r.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach(e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(Xe(e))return;const t=this.createRowEventWithSource(ct.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=cs(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(Xe(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource(ct.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,s=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const r=this.gos.get("rowMultiSelectWithClick"),n=!this.gos.get("suppressRowDeselection"),o="rowClicked";if(this.rowNode.isSelected())r?this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):i?n&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!s,rangeSelect:s,event:e,source:o});else{const t=!r&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:s,event:e,source:o})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const i=this.gos.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,i,s)=>this.addFullWidthRowDragging(e,t,i,s),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new fr(i,this.beans))}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const r=new Vn(()=>i,this.rowNode,void 0,e,t,s);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let s=!1;for(const r of t){const t=r.stopEditing(e);i&&!e&&!s&&t&&(s=!0)}if(s){const e=this.createRowEvent(ct.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(ct.EVENT_ROW_EDITING_STARTED):this.createRowEvent(ct.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){this.editingRow||this.getAllCellCtrls().reduce((s,r)=>{const n=r===t;return n?r.startEditing(e,n,i):r.startEditing(null,n,i),!!s||r.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach(e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return"left"===e?"left":"right"===e?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;return t&&(i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})),i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),gi(e.element,t),!e.element.contains(this.beans.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,Nn.EVENT_MOUSE_ENTER,()=>{this.beans.dragService.isDragging()||this.gos.get("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,Nn.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),s)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),s=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,r=s?Math.min(i,s)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=`${t}px`,r&&e.element.style.setProperty("--ag-line-height",r)})}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky())if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const t=this.createRowEvent(ct.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach(e=>e.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.paginationProxy.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&C(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,s=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?s:this.beans.rowContainerHeightService.getRealPixelPosition(s)}return t+"px"}setRowTopStyle(e){this.allRowGuis.forEach(t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach(i=>{i.getColumn()==e&&(t=i)}),null!=t||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),s=this.rowNode.rowIndex%2==0,r=i+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",s),e.rowComp.addOrRemoveCssClass("ag-row-odd",!s),li(e.element,r)})}};ya.DOM_DATA_KEY_ROW_CTRL="renderedRow";var va=ya,Ca=class extends rt{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Ze("touchstart")?"touchstart":"mousedown"].forEach(e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedListener(this.element,e,t)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Xe(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!ki())return;const e=new yn(this.element);this.addManagedListener(e,yn.EVENT_LONG_TAP,e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,va.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const r=i?i.getRowNode():null,n=s?s.getColumn():null;let o=null;if(n){const i=e||t;s.dispatchCellContextMenuEvent(null!=i?i:null),o=this.valueService.getValue(n,r)}const a=this.ctrlsService.getGridBodyCtrl(),l=s?s.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:r,column:n,value:o,anchorToElement:l})}getControlsForEventTarget(e){return{cellCtrl:Qe(this.gos,e,ma.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Qe(this.gos,e,va.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),r=e.getColumn(),n=e.isEditing();if(Qs(this.gos,i,s,r,n)||"keydown"!==t||(!n&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Zs(i)&&e.processCharacter(i)),"keydown"===t){const t=e.createEvent(i,ct.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),r=this.focusService.getFocusedCell(),n=r&&r.column;if(!Qs(this.gos,i,s,n,!1)){const s=i.key;if("keydown"===t)switch(s){case Xs.PAGE_HOME:case Xs.PAGE_END:case Xs.PAGE_UP:case Xs.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case Xs.UP:case Xs.DOWN:e.onKeyboardNavigate(i);break;case Xs.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent(ct.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=er(e);return i===Xs.A?this.onCtrlAndA(e):i===Xs.C?this.onCtrlAndC(e):i===Xs.D?this.onCtrlAndD(e):i===Xs.V?this.onCtrlAndV(e):i===Xs.X?this.onCtrlAndX(e):i===Xs.Y?this.onCtrlAndY():i===Xs.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[e,i]=[t.isEmpty("top"),t.isEmpty("bottom")],r=e?null:"top";let n,o;i?(n=null,o=this.paginationProxy.getRowCount()-1):(n="bottom",o=t.getPinnedBottomRowData().length-1);const a=this.columnModel.getAllDisplayedColumns();if(S(a))return;s.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:o,rowEndPinned:n,columnStart:a[0],columnEnd:Ie(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};g([de("mouseEventService")],Ca.prototype,"mouseEventService",2),g([de("valueService")],Ca.prototype,"valueService",2),g([de("menuService")],Ca.prototype,"menuService",2),g([de("ctrlsService")],Ca.prototype,"ctrlsService",2),g([de("navigationService")],Ca.prototype,"navigationService",2),g([de("focusService")],Ca.prototype,"focusService",2),g([de("undoRedoService")],Ca.prototype,"undoRedoService",2),g([de("columnModel")],Ca.prototype,"columnModel",2),g([de("paginationProxy")],Ca.prototype,"paginationProxy",2),g([de("pinnedRowModel")],Ca.prototype,"pinnedRowModel",2),g([ue("rangeService")],Ca.prototype,"rangeService",2),g([ue("clipboardService")],Ca.prototype,"clipboardService",2),g([le],Ca.prototype,"postConstruct",1);var ba=class extends rt{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=us(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");t.length&&(i&&(t=i({columns:t,viewportWidth:e})),this.columnModel.setColumnsPinned(t,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.columnModel.getDisplayedLeftColumns()],s=[...this.columnModel.getDisplayedRightColumns()];let r=0,n=0;const o=[];let a=t-0-e;for(;(n<i.length||r<s.length)&&a>0;){if(r<s.length){const e=s[r++];a-=e.getActualWidth(),o.push(e)}if(n<i.length&&a>0){const e=i[n++];a-=e.getActualWidth(),o.push(e)}}return o}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=ds(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:ct.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}};g([de("ctrlsService")],ba.prototype,"ctrlsService",2),g([de("pinnedWidthService")],ba.prototype,"pinnedWidthService",2),g([de("columnModel")],ba.prototype,"columnModel",2),g([de("scrollVisibleService")],ba.prototype,"scrollVisibleService",2),g([le],ba.prototype,"postConstruct",1);var Sa=class extends rt{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;os(this.element,t),Ps(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};g([de("pinnedWidthService")],Sa.prototype,"pinnedWidthService",2),g([le],Sa.prototype,"postConstruct",1);var wa=class extends rt{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;os(this.element,t),Ps(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};g([de("pinnedWidthService")],wa.prototype,"pinnedWidthService",2),g([le],wa.prototype,"postConstruct",1);var xa=class extends rt{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}};g([de("rowContainerHeightService")],xa.prototype,"maxDivHeightScaler",2),g([le],xa.prototype,"postConstruct",1);var Ea=class extends rt{constructor(e){super(),this.eContainer=e}postConstruct(){this.rangeService&&(this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature())}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};g([de("dragService")],Ea.prototype,"dragService",2),g([ue("rangeService")],Ea.prototype,"rangeService",2),g([le],Ea.prototype,"postConstruct",1);var Ma=class extends rt{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gos.isDomLayout("print"),i=e.getBodyContainerWidth(),s=e.getDisplayedColumnsLeftWidth(),r=e.getDisplayedColumnsRightWidth();let n;t?n=i+s+r:(n=i,this.addSpacer&&0===(this.gos.get("enableRtl")?s:r)&&this.scrollVisibleService.isVerticalScrollShowing()&&(n+=this.gos.getScrollbarWidth())),this.callback(n)}};g([de("columnModel")],Ma.prototype,"columnModel",2),g([de("scrollVisibleService")],Ma.prototype,"scrollVisibleService",2),g([le],Ma.prototype,"postConstruct",1);var Aa=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e.TOP_LEFT="topLeft",e.TOP_RIGHT="topRight",e.TOP_CENTER="topCenter",e.TOP_FULL_WIDTH="topFullWidth",e.STICKY_TOP_LEFT="stickyTopLeft",e.STICKY_TOP_RIGHT="stickyTopRight",e.STICKY_TOP_CENTER="stickyTopCenter",e.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",e.STICKY_BOTTOM_LEFT="stickyBottomLeft",e.STICKY_BOTTOM_RIGHT="stickyBottomRight",e.STICKY_BOTTOM_CENTER="stickyBottomCenter",e.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",e.BOTTOM_LEFT="bottomLeft",e.BOTTOM_RIGHT="bottomRight",e.BOTTOM_CENTER="bottomCenter",e.BOTTOM_FULL_WIDTH="bottomFullWidth",e))(Aa||{}),Ta=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e))(Ta||{});function Da(e){switch(e){case"center":case"topCenter":case"stickyTopCenter":case"bottomCenter":case"stickyBottomCenter":return"center";case"left":case"topLeft":case"stickyTopLeft":case"bottomLeft":case"stickyBottomLeft":return"left";case"right":case"topRight":case"stickyTopRight":case"bottomRight":case"stickyBottomRight":return"right";case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return"fullWidth";default:throw Error("Invalid Row Container Type")}}var Ia=xt([["center","ag-center-cols-container"],["left","ag-pinned-left-cols-container"],["right","ag-pinned-right-cols-container"],["fullWidth","ag-full-width-container"],["topCenter","ag-floating-top-container"],["topLeft","ag-pinned-left-floating-top"],["topRight","ag-pinned-right-floating-top"],["topFullWidth","ag-floating-top-full-width-container"],["stickyTopCenter","ag-sticky-top-container"],["stickyTopLeft","ag-pinned-left-sticky-top"],["stickyTopRight","ag-pinned-right-sticky-top"],["stickyTopFullWidth","ag-sticky-top-full-width-container"],["stickyBottomCenter","ag-sticky-bottom-container"],["stickyBottomLeft","ag-pinned-left-sticky-bottom"],["stickyBottomRight","ag-pinned-right-sticky-bottom"],["stickyBottomFullWidth","ag-sticky-bottom-full-width-container"],["bottomCenter","ag-floating-bottom-container"],["bottomLeft","ag-pinned-left-floating-bottom"],["bottomRight","ag-pinned-right-floating-bottom"],["bottomFullWidth","ag-floating-bottom-full-width-container"]]),Ra=xt([["center","ag-center-cols-viewport"],["topCenter","ag-floating-top-viewport"],["stickyTopCenter","ag-sticky-top-viewport"],["bottomCenter","ag-floating-bottom-viewport"],["stickyBottomCenter","ag-sticky-bottom-viewport"]]),Pa=class e extends rt{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer="topFullWidth"===this.name||"stickyTopFullWidth"===this.name||"stickyBottomFullWidth"===this.name||"bottomFullWidth"===this.name||"fullWidth"===this.name}static getRowContainerCssClasses(e){return{container:Ia.get(e),viewport:Ra.get(e)}}static getPinned(e){switch(e){case"bottomLeft":case"topLeft":case"stickyTopLeft":case"stickyBottomLeft":case"left":return"left";case"bottomRight":case"topRight":case"stickyTopRight":case"stickyBottomRight":case"right":return"right";default:return null}}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>this.viewportSizeFeature=this.createManagedBean(new ba(this)))}registerWithCtrlsService(){switch(this.name){case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return;default:this.ctrlsService.register(this.name,this)}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new Ca(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();this.forContainers(["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],()=>{this.pinnedWidthFeature=this.createManagedBean(new Sa(this.eContainer)),this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],()=>{this.pinnedWidthFeature=this.createManagedBean(new wa(this.eContainer)),this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["center","left","right","fullWidth"],()=>this.createManagedBean(new xa(this.eContainer,"center"===this.name?i:void 0))),this.forContainers(["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right","stickyTopCenter","stickyTopLeft","stickyTopRight","stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],()=>this.createManagedBean(new Ea(this.eContainer))),this.forContainers(["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>this.createManagedBean(new Ma(e=>this.comp.setContainerWidth(`${e}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(["stickyTopCenter","stickyTopLeft","stickyTopRight","stickyTopFullWidth","stickyBottomCenter","stickyBottomLeft","stickyBottomRight","stickyBottomFullWidth"].indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{this.addManagedListener(this.eViewport,"scroll",()=>this.eViewport.scrollLeft=0)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return us(this.eViewport)}getCenterViewportScrollLeft(){return ys(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return Ss(this.eViewport)}getViewportScrollLeft(){return ys(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||Ds(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){vs(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!e.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.getRowCtrls();if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),s=this.gos.get("embedFullWidthRows")||i,r=t.filter(e=>{const t=e.isFullWidth();return this.isFullWithContainer?!s&&t:s||!t});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}getRowCtrls(){switch(this.name){case"topCenter":case"topLeft":case"topRight":case"topFullWidth":return this.rowRenderer.getTopRowCtrls();case"stickyTopCenter":case"stickyTopLeft":case"stickyTopRight":case"stickyTopFullWidth":return this.rowRenderer.getStickyTopRowCtrls();case"stickyBottomCenter":case"stickyBottomLeft":case"stickyBottomRight":case"stickyBottomFullWidth":return this.rowRenderer.getStickyBottomRowCtrls();case"bottomCenter":case"bottomLeft":case"bottomRight":case"bottomFullWidth":return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}};g([de("dragService")],Pa.prototype,"dragService",2),g([de("ctrlsService")],Pa.prototype,"ctrlsService",2),g([de("columnModel")],Pa.prototype,"columnModel",2),g([de("resizeObserverService")],Pa.prototype,"resizeObserverService",2),g([de("rowRenderer")],Pa.prototype,"rowRenderer",2),g([le],Pa.prototype,"postConstruct",1);var ka=Pa,La=class extends Cr{constructor(){super('<div class="ag-root ag-unselectable" role="treegrid">\n        <ag-header-root ref="gridHeader"></ag-header-root>\n        <div class="ag-floating-top" ref="eTop" role="presentation">\n            <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>\n            <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>\n            <ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>\n            <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-body" ref="eBody" role="presentation">\n            <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n                <ag-row-container ref="leftContainer" name="left"></ag-row-container>\n                <ag-row-container ref="centerContainer" name="center"></ag-row-container>\n                <ag-row-container ref="rightContainer" name="right"></ag-row-container>\n                <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>\n            </div>\n            <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n        </div>\n        <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n            <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>\n            <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>\n            <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>\n            <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">\n            <ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>\n            <ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>\n            <ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>\n            <ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n            <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>\n            <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>\n            <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>\n            <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>\n        </div>\n        <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n        <ag-overlay-wrapper></ag-overlay-wrapper>\n    </div>')}init(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>ci(this.getGui(),e),setRowCount:e=>ai(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.toggle("ag-layout-print",t.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(ea,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(i=>i.classList.toggle(e,t))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new ta),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&oi(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};g([de("resizeObserverService")],La.prototype,"resizeObserverService",2),g([ue("rangeService")],La.prototype,"rangeService",2),g([Sr("eBodyViewport")],La.prototype,"eBodyViewport",2),g([Sr("eStickyTop")],La.prototype,"eStickyTop",2),g([Sr("eStickyBottom")],La.prototype,"eStickyBottom",2),g([Sr("eTop")],La.prototype,"eTop",2),g([Sr("eBottom")],La.prototype,"eBottom",2),g([Sr("gridHeader")],La.prototype,"headerRootComp",2),g([Sr("eBody")],La.prototype,"eBody",2),g([le],La.prototype,"init",1);var Na=class extends rt{postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:ct.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};g([de("ctrlsService")],Na.prototype,"ctrlsService",2),g([de("columnAnimationService")],Na.prototype,"columnAnimationService",2),g([le],Na.prototype,"postConstruct",1),Na=g([he("scrollVisibleService")],Na);var _a=class extends rt{constructor(){super(...arguments),this.gridInstanceId=_a.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[_a.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Qe(this.gos,e.target,ma.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[_a.GRID_DOM_KEY];if(C(e))return e===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let s,r;if(null!=i.clientX||null!=i.clientY?(s=i.clientX,r=i.clientY):(s=i.x,r=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();s+=e.getScrollFeature().getHScrollPosition().left,r+=t.top}return{x:s,y:r}}};_a.gridInstanceSequence=new cr,_a.GRID_DOM_KEY="__ag_grid_instance",g([de("ctrlsService")],_a.prototype,"ctrlsService",2),_a=g([he("mouseEventService")],_a);var Oa=class extends rt{constructor(){super(),this.onPageDown=J(this.onPageDown,100),this.onPageUp=J(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,r=e.ctrlKey||e.metaKey,n=!!this.rangeService&&e.shiftKey,o=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case Xs.PAGE_HOME:case Xs.PAGE_END:r||s||(this.onHomeOrEndKey(i),a=!0);break;case Xs.LEFT:case Xs.RIGHT:case Xs.UP:case Xs.DOWN:if(!o)return!1;!r||s||n||(this.onCtrlUpDownLeftRight(i,o),a=!0);break;case Xs.PAGE_DOWN:case Xs.PAGE_UP:r||s||(a=this.handlePageUpDown(i,o,t))}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===Xs.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){var t;const{scrollIndex:i,scrollType:s,scrollColumn:r,focusIndex:n,focusColumn:o}=e;C(r)&&!r.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(r),C(i)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i,s),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(n),this.focusService.setFocusedCell({rowIndex:n,column:o,rowPinned:null,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell({rowIndex:n,rowPinned:null,column:o})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),s=this.paginationProxy.getPixelOffset(),r=t.top+i,n=this.paginationProxy.getRowIndexAtPixel(r+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),s=t.top,r=this.paginationProxy.getRowIndexAtPixel(s+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),r=this.paginationProxy.getPageFirstRow(),n=this.paginationProxy.getPageLastRow(),o=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(e.rowIndex),l=i?(null==a?void 0:a.rowHeight)-s-o:s-o,c=(null==a?void 0:a.rowTop)+l;let h,d=this.paginationProxy.getRowIndexAtPixel(c+o);if(d===e.rowIndex){const s=i?-1:1;t=d=e.rowIndex+s}i?(h="bottom",d<r&&(d=r),t<r&&(t=r)):(h="top",d>n&&(d=n),t>n&&(t=n)),this.isRowTallerThanView(d)&&(t=d,h="top"),this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:d,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const s=t?-1:1,r=this.getViewportHeight(),n=this.paginationProxy.getPageLastRow();let o=0,a=e.rowIndex;for(;a>=0&&a<=n;){const e=this.paginationProxy.getRow(a);if(e){const t=null!=(i=e.rowHeight)?i:0;if(o+t>r)break;o+=t}a+=s}return Math.max(0,Math.min(a,n))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let r=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(r-=s),r}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s,column:r}=i;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:r,focusIndex:s,focusColumn:r})}onHomeOrEndKey(e){const t=e===Xs.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),s=t?i[0]:Ie(i),r=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:r,scrollType:null,scrollColumn:s,focusIndex:r,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(!1===s)if(i){const{rowIndex:i,rowPinned:s}=e.getRowPosition();(s?0===i:i===this.paginationProxy.getPageFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof ma&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else s&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s,r=e.isEditing();if(!r&&e instanceof ma){const t=e.getRowCtrl();t&&(r=t.isEditing())}return s=r?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===s?s:s||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const r=this.findNextCellToFocusOn(s,t,!0);return!1===r?null:null!=r&&(r.startEditing(null,!0,i),r.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),r=this.findNextCellToFocusOn(s,t,!0);if(!1===r)return null;if(null==r)return!1;const n=r.getCellPosition(),o=this.isCellEditable(s),a=this.isCellEditable(n),l=n&&s.rowIndex===n.rowIndex&&s.rowPinned===n.rowPinned;return o&&e.setFocusOutOnEditor(),l||(e.getRowCtrl().stopEditing(),r.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(r.setFocusInOnEditor(),r.focusCell()):r.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let s;s=e instanceof va?u(d({},e.getRowPosition()),{column:t?i[0]:Ie(i)}):e.getCellPosition();const r=this.findNextCellToFocusOn(s,t,!1);if(!1===r)return null;if(r instanceof ma)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r.getRowPosition(),t);return C(r)}findNextCellToFocusOn(e,t,i){var s;let r=e;for(;;){e!==r&&(e=r),t||(r=this.getLastCellOfColSpan(r)),r=this.cellNavigationService.getNextTabbedCell(r,t);const n=this.gos.getCallback("tabToNextCell");if(C(n)){const s=n({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:r||null});if(!0===s||null===s)null===s&&z("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),r=e;else{if(!1===s)return!1;s.floating&&(z("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),s.rowPinned=s.floating),r={rowIndex:s.rowIndex,column:s.column,rowPinned:s.rowPinned}}}if(!r)return null;if(r.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+r.rowIndex,column:r.column},fromCell:!0}),null}const o="fullRow"===this.gos.get("editType");if(i&&!o&&!this.isCellEditable(r))continue;this.ensureCellVisible(r);const a=this.getCellByPosition(r);if(!a){const e=this.rowRenderer.getRowByPosition(r);if(!e||!e.isFullWidth()||i)continue;return e}if(!a.isSuppressNavigable())return null==(s=this.rangeService)||s.setRangeToCell(r),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let r=i,n=!1;for(;r&&(r===i||!this.isValidNavigateCell(r));)this.gos.get("enableRtl")?t===Xs.LEFT&&(r=this.getLastCellOfColSpan(r)):t===Xs.RIGHT&&(r=this.getLastCellOfColSpan(r)),r=this.cellNavigationService.getNextCellToFocus(t,r),n=b(r);if(n&&e&&e.key===Xs.UP&&(r={rowIndex:-1,rowPinned:null,column:i.column}),s){const s=this.gos.getCallback("navigateToNextCell");if(C(s)){const n=s({key:t,previousCellPosition:i,nextCellPosition:r||null,event:e});C(n)?(n.floating&&(z("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),n.rowPinned=n.floating),r={rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}):r=null}}if(!r)return;if(r.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+r.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const o=this.getNormalisedPosition(r);o?this.focusPosition(o):this.tryToFocusFullWidthRow(r)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const r=this.focusService.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?Ie(i):i[0])};this.focusPosition(n);const o=null!=r&&this.rowPositionUtils.before(n,r),a={type:ct.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column,isFullWidthCell:!0,floating:n.rowPinned,fromBelow:o};return this.eventService.dispatchEvent(a),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:Ie(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(null==i?void 0:i.sticky))&&b(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};g([de("mouseEventService")],Oa.prototype,"mouseEventService",2),g([de("paginationProxy")],Oa.prototype,"paginationProxy",2),g([de("focusService")],Oa.prototype,"focusService",2),g([de("columnModel")],Oa.prototype,"columnModel",2),g([de("rowModel")],Oa.prototype,"rowModel",2),g([de("ctrlsService")],Oa.prototype,"ctrlsService",2),g([de("rowRenderer")],Oa.prototype,"rowRenderer",2),g([de("headerNavigationService")],Oa.prototype,"headerNavigationService",2),g([de("rowPositionUtils")],Oa.prototype,"rowPositionUtils",2),g([de("cellNavigationService")],Oa.prototype,"cellNavigationService",2),g([de("pinnedRowModel")],Oa.prototype,"pinnedRowModel",2),g([ue("rangeService")],Oa.prototype,"rangeService",2),g([le],Oa.prototype,"postConstruct",1),Oa=g([he("navigationService")],Oa);var Fa=class e extends En{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),e.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedListener(e,"keydown",e=>{Qs(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)})}};Fa.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",g([le],Fa.prototype,"postConstruct",1);var Ga=Fa,Ba=class extends Cr{constructor(e,t,i,s,r){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const o=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const a=(e,t)=>{null!=t&&""!=t?o.setAttribute(e,t):o.removeAttribute(e)};Ht(o,t.getCellAriaRole()),a("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&a("tabindex",l.toString());const c={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ts(o,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(c,this.getGui(),this.eCellWrapper,i,r)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!i&&!s&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;if(s){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const r=!i&&null!=this.eCellWrapper;r&&(bs(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,o=n&&null==this.eCellValue;if(o){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const a=!n&&null!=this.eCellValue;a&&(bs(this.eCellValue),this.eCellValue=void 0);const l=s||r||o||a;return l&&this.removeControls(),e||t&&this.addControls(),l}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,r=e.newAgStackInstance();if(!r)return;const{params:n}=e;r.then(e=>this.afterCellEditorCreated(s,e,n,t,i)),b(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();Cs(t);const i=null!=e?Ct(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),bs(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),bs(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:s}=e,r=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),r=this.afterCellRendererCreated.bind(this,i,s);t&&t.then(r)};t&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(this.isAlive()&&e===this.rendererVersion){if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();Cs(e),e.appendChild(this.cellRendererGui)}}else this.beans.context.destroyBean(i)}afterCellEditorCreated(e,t,i,s,r){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const n=s||void 0!==t.isPopup&&t.isPopup();n?this.addPopupCellEditor(i,r):this.addInCellEditor(),this.refreshEditStyles(!0,n),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null==(i=this.rowCtrl)||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){"fullRow"===this.beans.gos.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Ga(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const r=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),o=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",a=this.beans.gos.get("enableRtl"),l={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:o,alignSide:a?"right":"left",keepWithinBounds:!0},c=r.positionPopupByComponent.bind(r,l),h=this.beans.localeService.getLocaleTextFunc(),d=r.addPopup({modal:n,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});d&&(this.hideEditorPopup=d.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&Li()&&e.focus({preventScroll:!0}),Cs(this.getParentOfValue())}},Va=class extends Cr{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const r=this.getGui(),n=r.style;this.domOrder=this.rowCtrl.getDomOrder(),Ht(r,"row");const o=this.rowCtrl.getTabIndex();null!=o&&r.setAttribute("tabindex",o.toString());const a={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ts(r,e),setTop:e=>n.top=e,setTransform:e=>n.transform=e,setRowIndex:e=>r.setAttribute("row-index",e),setRowId:e=>r.setAttribute("row-id",e),setRowBusinessKey:e=>r.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(a,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then(e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)})}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null});const i=_(t).filter(e=>null!=e);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())}),Ms(this.getGui(),t)}newCellComp(e){const t=new Ba(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=_(this.cellComps).filter(e=>null!=e);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},Ha=class extends Cr{constructor(){super(function(){const e=Cr.elementGettingCreated.getAttribute("name"),t=ka.getRowContainerCssClasses(e);let i;return i="center"===e||"topCenter"===e||"stickyTopCenter"===e||"bottomCenter"===e||"stickyBottomCenter"===e?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n                <div class="${t.container}" ref="eContainer"></div>\n            </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=Cr.elementGettingCreated.getAttribute("name"),this.type=Da(this.name)}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e};this.createManagedBean(new ka(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=d({},this.rowComps);this.rowComps={},this.lastPlacedElement=null,e.forEach(e=>{const i=e.getInstanceId(),s=t[i];if(s)this.rowComps[i]=s,delete t[i],this.ensureDomOrder(s.getGui());else{if(!e.getRowNode().displayed)return;const t=new Va(e,this.beans,this.type);this.rowComps[i]=t,this.appendRow(t.getGui())}}),_(t).forEach(e=>{this.eContainer.removeChild(e.getGui()),e.destroy()}),Ht(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?As(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(Es(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};g([de("beans")],Ha.prototype,"beans",2),g([Sr("eViewport")],Ha.prototype,"eViewport",2),g([Sr("eContainer")],Ha.prototype,"eContainer",2),g([le],Ha.prototype,"postConstruct",1),g([ce],Ha.prototype,"preDestroy",1);var Ua=class{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?Bn.ICON_PINNED:Bn.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};g([de("columnModel")],Ua.prototype,"columnModel",2),g([de("gridOptionsService")],Ua.prototype,"gos",2);var za=class{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:r,fakeEvent:n,pinned:o,gos:a,columnModel:l}=e,c=0===i,h=1===i;let{allMovingColumns:d}=e;if(t){let e=[];d.forEach(t=>{var i;let s=null,r=t.getParent();for(;null!=r&&1===r.getDisplayedLeafColumns().length;)s=r,r=r.getParent();null!=s?((null==(i=s.getColGroupDef())?void 0:i.marryChildren)?s.getProvidedColumnGroup().getLeafColumns():s.getLeafColumns()).forEach(t=>{e.includes(t)||e.push(t)}):e.includes(t)||e.push(t)}),d=e}const u=d.slice();l.sortColumnsLikeGridColumns(u);const p=this.calculateValidMoves({movingCols:u,draggingRight:h,xPosition:s,pinned:o,gos:a,columnModel:l}),g=this.calculateOldIndex(u,l);if(0===p.length)return;const m=p[0];let f=null!==g&&!r;if(t&&(f=null!==g),f&&!n){if(c&&m>=g)return;if(h&&m<=g)return}const y=l.getAllDisplayedColumns();let v=[],C=null;for(let e=0;e<p.length;e++){const t=p[e],i=l.getProposedColumnOrder(u,t);if(!l.doesOrderPassRules(i))continue;const s=i.filter(e=>y.includes(e));if(null===C)C=s;else if(!Re(s,C))break;const r=this.groupFragCount(i);v.push({move:t,fragCount:r})}return 0!==v.length?(v.sort((e,t)=>e.fragCount-t.fragCount),this.moveColumns(d,v[0].move,"uiColumnMoved",!1,l)):void 0}static moveColumns(e,t,i,s,r){return r.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),s=ke(e.map(e=>i.indexOf(e))),r=s[0];return Ie(s)-r!==s.length-1?null:r}static groupFragCount(e){function t(e){let t=[],i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let s=0;s<e.length-1;s++){let r=t(e[s]),n=t(e[s+1]);[r,n]=r.length>n.length?[r,n]:[n,r],r.forEach(e=>{-1===n.indexOf(e)&&i++})}return i}static getDisplayedColumns(e,t){switch(t){case"left":return e.getDisplayedLeftColumns();case"right":return e.getDisplayedRightColumns();default:return e.getDisplayedCenterColumns()}}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:r,gos:n,columnModel:o}=e;if(n.get("suppressMovableColumns")||t.some(e=>e.getColDef().suppressMovable))return[];const a=this.getDisplayedColumns(o,r),l=o.getAllGridColumns(),c=a.filter(e=>He(t,e)),h=a.filter(e=>!He(t,e)),d=l.filter(e=>!He(t,e));let u,p=0,g=s;if(i){let e=0;c.forEach(t=>e+=t.getActualWidth()),g-=e}if(g>0){for(let e=0;e<h.length&&(g-=h[e].getActualWidth(),!(g<0));e++)p++;i&&p++}if(p>0){const e=h[p-1];u=d.indexOf(e)+1}else u=d.indexOf(h[0]),-1===u&&(u=0);const m=[u],f=(e,t)=>e-t;if(i){let e=u+1;const t=l.length-1;for(;e<=t;)m.push(e),e++;m.sort(f)}else{let e=u;const t=l.length-1;let i=l[e];for(;e<=t&&a.indexOf(i)<0;)e++,m.push(e),i=l[e];e=u-1;const s=0;for(;e>=s;)m.push(e),e--;m.sort(f).reverse()}return m}static normaliseX(e,t,i,s,r){const n=r.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=n.getBoundingClientRect().left),s.get("enableRtl")&&(e=n.clientWidth-e),null==t&&(e+=r.get("center").getCenterViewportScrollLeft()),e}},Wa=class{constructor(e){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!C(e)}init(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){return this.pinned?Bn.ICON_PINNED:Bn.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,s=(t||[]).filter(e=>i[e.getId()]);this.setColumnsVisible(s,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter(e=>!e.getColDef().lockPinned);this.columnModel.setColumnsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){var r;if(s){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;za.moveColumns(e,t,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,b(e.hDirection))return;const n=za.normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(n);const o=this.normaliseDirection(e.hDirection),a=e.dragSource.type,l=(null==(r=e.dragSource.getDragItem().columns)?void 0:r.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],c=za.attemptMoveColumns({allMovingColumns:l,isFromHeader:1===a,hDirection:o,xPosition:n,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel});c&&(this.lastMovedInfo=c)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Bn.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Bn.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Bn.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter(e=>!e.getColDef().lockPinned);if(e.length>0&&(this.dragAndDropService.setGhostIcon(Bn.ICON_PINNED),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};g([de("columnModel")],Wa.prototype,"columnModel",2),g([de("dragAndDropService")],Wa.prototype,"dragAndDropService",2),g([de("gridOptionsService")],Wa.prototype,"gos",2),g([de("ctrlsService")],Wa.prototype,"ctrlsService",2),g([le],Wa.prototype,"init",1);var ja=class extends rt{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Wa(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Ua(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}};g([de("dragAndDropService")],ja.prototype,"dragAndDropService",2),g([de("columnModel")],ja.prototype,"columnModel",2),g([de("ctrlsService")],ja.prototype,"ctrlsService",2),g([le],ja.prototype,"postConstruct",1),g([le],ja.prototype,"init",1);var Ka=class e extends $o{constructor(t){super(e.TEMPLATE,t),this.headerCompVersion=0,this.column=t.getColumnGroupChild(),this.pinned=t.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const s={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?ui(e,t):pi(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const r=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",r)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}};Ka.TEMPLATE='<div class="ag-header-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n            <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n        </div>',g([Sr("eResize")],Ka.prototype,"eResize",2),g([Sr("eHeaderCompWrapper")],Ka.prototype,"eHeaderCompWrapper",2),g([le],Ka.prototype,"postConstruct",1),g([ce],Ka.prototype,"destroyHeaderComp",1);var $a=Ka,Ya=class e extends $o{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>os(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(s=t)?e.setAttribute(i,s):e.removeAttribute(i);var i,s},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}};Ya.TEMPLATE='<div class="ag-header-group-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n        </div>',g([Sr("eResize")],Ya.prototype,"eResize",2),g([le],Ya.prototype,"postConstruct",1);var qa=Ya,Xa=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(Xa||{}),Za=class extends Cr{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){li(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(e=>{const t=e.getInstanceId();let s=i[t];delete i[t],null==s&&(s=this.createHeaderComp(e),this.getGui().appendChild(s.getGui())),this.headerComps[t]=s}),k(i,(e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)}),t){const e=_(this.headerComps);e.sort((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft());const t=e.map(e=>e.getGui());Ms(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new qa(e);break;case"filter":t=new qo(e);break;default:t=new $a(e)}return this.createBean(t),t.setParentComponent(this),t}};g([le],Za.prototype,"init",1),g([ce],Za.prototype,"destroyHeaderCtrls",1);var Qa=0,Ja=class e extends rt{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+Qa++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return Js(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){this.comp&&this.column&&(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:i}=this;ua.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.columnModel.getAriaColumnIndex(t);hi(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&(this.addManagedListener(this.eGui,"keydown",this.onGuiKeyDown.bind(this)),this.addManagedListener(this.eGui,"keyup",this.onGuiKeyUp.bind(this)))}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){var t;const i=this.gos.getActiveDomElement(),s=e.key===Xs.LEFT||e.key===Xs.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),i!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||s)&&(e.preventDefault(),e.stopImmediatePropagation()),!s)return;const r=e.key===Xs.LEFT!==this.gos.get("enableRtl"),n=Fn[r?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),null==(t=this.resizeFeature)||t.toggleColumnResizing(!0)}else this.moveHeader(n)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),s=us(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>s){if(!(s>e+i))return 0;t=s-e-i}}return t}getResizeDiff(e){let t=e.key===Xs.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),s=this.gos.get("enableRtl");return i&&s!==("right"===i)&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=setTimeout(()=>{var e;null==(e=this.resizeFeature)||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case Xs.PAGE_DOWN:case Xs.PAGE_UP:case Xs.PAGE_HOME:case Xs.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const s=null!=e?e:t;this.gos.get("preventDefaultOnContextMenu")&&s.preventDefault();const r=i instanceof we?i:void 0;this.menuService.isHeaderContextMenuEnabled(r)&&this.menuService.showHeaderContextMenu(r,e,t),this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};Ja.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",g([de("pinnedWidthService")],Ja.prototype,"pinnedWidthService",2),g([de("focusService")],Ja.prototype,"focusService",2),g([de("userComponentFactory")],Ja.prototype,"userComponentFactory",2),g([de("ctrlsService")],Ja.prototype,"ctrlsService",2),g([de("dragAndDropService")],Ja.prototype,"dragAndDropService",2),g([de("menuService")],Ja.prototype,"menuService",2),g([le],Ja.prototype,"postConstruct",1);var el=Ja,tl=class extends rt{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?Ie(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,we.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=C(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),r=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=r,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===r&&this.setLeft(r)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===e.getPinned()?i+this.beans.columnModel.getBodyContainerWidth()+t:i+t}setLeft(e){let t;if(C(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof we)t=this.columnOrGroup;else{const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&di(this.ariaEl,e.length),t=e[0]}}};g([le],tl.prototype,"postConstruct",1);var il=class extends rt{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}};g([de("columnHoverService")],il.prototype,"columnHoverService",2),g([le],il.prototype,"postConstruct",1);var sl=class extends el{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,we.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=Ys("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new Dr(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();Kt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Xs.UP:case Xs.DOWN:t||e.preventDefault();case Xs.LEFT:case Xs.RIGHT:if(t)return;e.stopPropagation();case Xs.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case Xs.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&cs(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==Xs.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const s=this.getRowIndex();this.beans.focusService.setFocusedHeader(s,this.column)}setupHover(){this.createManagedBean(new il([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new tl(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===(null==t?void 0:t.source)&&this.context.isDestroyed())return;const i=this.comp.getFloatingFilterComp();i&&i.then(i=>{var s;if(i){const r=e.getCurrentFloatingFilterParentModel(this.column);i.onParentModelChanged(r,t?this.gos.addGridCommonParams({columns:null!=(s=t.columns)?s:[],type:ct.EVENT_FILTER_CHANGED,source:"api"===t.source?"api":"columnFilter"}):null)}})};this.destroySyncListener=this.addManagedListener(this.column,we.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,we.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,we.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const s=!i&&this.active;i&&!this.active&&(null==(e=this.destroySyncListener)||e.call(this),null==(t=this.destroyFilterChangedListener)||t.call(this));const r=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();n&&r?n.then(e=>{var t;!e||this.beans.filterManager.areFilterCompsDifferent(null!=(t=this.userCompDetails)?t:null,r)?this.updateCompDetails(r,s):this.updateFloatingFilterParams(r)}):this.updateCompDetails(r,s)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null==(t=this.comp.getFloatingFilterComp())||t.then(e=>{let t=!1;(null==e?void 0:e.refresh)&&"function"==typeof e.refresh&&null!==e.refresh(i)&&(t=!0),!t&&(null==e?void 0:e.onParamsUpdated)&&"function"==typeof e.onParamsUpdated&&null!==e.onParamsUpdated(i)&&z("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},rl=class extends rt{constructor(e,t,i,s,r){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=r}postConstruct(){const e=[];let t,i;const s=()=>{if(os(this.eResize,t),!t)return;const s=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(s),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const s=new yn(this.eResize);s.addEventListener(yn.EVENT_DOUBLE_TAP,i),e.push(()=>{this.eResize.removeEventListener("dblclick",i),s.removeEventListener(yn.EVENT_DOUBLE_TAP,i),s.destroy()})}},r=()=>{e.forEach(e=>e()),e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||n!==i)&&(t=e,i=n,r(),s())};n(),this.addDestroyFunc(r),this.ctrl.addRefreshFunction(n)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:r}=this,n=this.normaliseResizeAmount(t),o=[{key:i,newWidth:r+n}];this.column.getPinned()&&this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(n-s)>us(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50||(this.lastResizeAmount=n,this.columnModel.setColumnWidths(o,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}};g([de("horizontalResizeService")],rl.prototype,"horizontalResizeService",2),g([de("pinnedWidthService")],rl.prototype,"pinnedWidthService",2),g([de("ctrlsService")],rl.prototype,"ctrlsService",2),g([de("columnModel")],rl.prototype,"columnModel",2),g([le],rl.prototype,"postConstruct",1);var nl=class extends rt{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new Ur),this.cbSelectAll.addCssClass("ag-header-select-all"),Ht(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,ct.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),ei(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection")&&(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),1))}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t&&(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const r={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(r):this.selectionService.deselectAllRowNodes(r)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;return"function"==typeof e&&(e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))),!!e&&this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection")}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};g([de("rowModel")],nl.prototype,"rowModel",2),g([de("selectionService")],nl.prototype,"selectionService",2);var ol=class extends el{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new rl(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new il([this.column],t)),this.createManagedBean(new tl(this.column,t,this.beans)),this.createManagedBean(new Dr(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListener(this.column,we.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,s;if(!this.column.isResizable())return;const r=this.column.getActualWidth(),n=null!=(i=this.column.getMinWidth())?i:0,o=null!=(s=this.column.getMaxWidth())?s:Number.MAX_SAFE_INTEGER,a=Math.min(Math.max(r+e,n),o);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:r}=this,n=this.getPinned(),o=t.getBoundingClientRect().left,a=i.getActualWidth(),l=0===e!==s.get("enableRtl"),c=za.normaliseX(l?o-20:o+a+20,n,!0,s,r);za.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:c,pinned:n,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel}),r.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new nl(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===Xs.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===Xs.ENTER&&this.onEnterKeyDown(e),e.key===Xs.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof Sn&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui,r=this.column.getColDef();t||!i||r.headerComponent||(t=()=>{const e=s.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>null!=e?e:this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},o=this.createManagedBean(new fr(n));this.refreshFunctions.push(()=>o.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const e=this.column.getColDef(),t=ua.getHeaderClassesFromColDef(e,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach(e=>{i.has(e)?i.delete(e):this.comp.addOrRemoveCssClass(e,!0)}),i.forEach(e=>this.comp.addOrRemoveCssClass(e,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:r,gos:n}=this,{columnModel:o}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?Bn.ICON_HIDE:Bn.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{a=!n.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};r.addDragSource(l,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,we.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,we.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,we.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,we.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,we.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:r,isSpanningTotal:n}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",r>0);const{columnModel:o}=s,a=o.getColumnHeaderRowHeight();if(0===r)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${a}px`);i.addOrRemoveCssClass("ag-header-span-total",n);const l=r*(o.isPivotMode()?o.getPivotGroupHeaderHeight():o.getGroupHeaderHeight());e.style.setProperty("top",-l+"px"),e.style.setProperty("height",`${a+l}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=i=>{if(!this.isAlive())return;const{paddingTop:r,paddingBottom:n,borderBottomWidth:o,borderTopWidth:a}=hs(this.getGui()),l=r+n+o+a,c=e.offsetHeight+l;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==c)return void window.setTimeout(()=>s(i+1),0)}t.setColumnHeaderHeight(this.column,c)};let r,n=!1;const o=()=>{const e=this.column.isAutoHeaderHeight();e&&!n&&a(),!e&&n&&l()},a=()=>{n=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=i.observeResize(e,()=>s(0))},l=()=>{n=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};o(),this.addDestroyFunc(()=>l()),this.addManagedListener(this.column,we.EVENT_WIDTH_CHANGED,()=>n&&s(0)),this.addManagedListener(this.eventService,we.EVENT_SORT_CHANGED,()=>{n&&window.setTimeout(()=>s(0))}),this.addRefreshFunction(o)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Ut(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>this.ariaDescriptionProperties.get(e)).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CLICKED,this.column)),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column))}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?ct.EVENT_COLUMN_HEADER_MOUSE_OVER:ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof Sn?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},al=class extends rt{constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach(e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())}),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),r=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(r,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let r=null;if(e&&(r=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),r){const e=r.getDisplayedLeafColumns(),t=s.groupAfterColumns=e.filter(e=>e.isResizable()),i=s.groupAfterStartWidth=this.getInitialSizeOfColumns(t);s.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else s.groupAfterColumns=void 0,s.groupAfterStartWidth=void 0,s.groupAfterRatios=void 0;return s}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:r,groupAfterStartWidth:n,groupAfterRatios:o}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=r,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=o}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var s,r,n;if(!this.resizeCols||!this.resizeRatios)return;const o={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:null!=(s=this.resizeTakeFromCols)?s:void 0,groupAfterStartWidth:null!=(r=this.resizeTakeFromStartWidth)?r:void 0,groupAfterRatios:null!=(n=this.resizeTakeFromRatios)?n:void 0};this.resizeColumns(o,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:r,resizeStartWidth:n,resizeRatios:o,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,h=[];if(h.push({columns:r,ratios:o,width:t}),a){const e=t-n;h.push({columns:a,ratios:c,width:l-e})}this.columnModel.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}getInitialSizeOfColumns(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(e=>e.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}};g([de("horizontalResizeService")],al.prototype,"horizontalResizeService",2),g([de("autoWidthCalculator")],al.prototype,"autoWidthCalculator",2),g([de("columnModel")],al.prototype,"columnModel",2),g([le],al.prototype,"postConstruct",1);var ll=class extends rt{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,lt.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}};g([le],ll.prototype,"postConstruct",1);var cl=class extends el{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),r=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new il(r,t)),this.createManagedBean(new tl(this.column,t,this.beans)),this.createManagedBean(new ll(e,this.column)),this.resizeFeature=this.createManagedBean(new al(e,i,s,this.column)),this.createManagedBean(new Dr(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:r,ctrlsService:n}=this,o=r.get("enableRtl"),a=0===e,l=this.getPinned(),c=i.getBoundingClientRect(),h=c.left,d=c.width,u=za.normaliseX(a!==o?h-20:h+d+20,l,!0,r,n),p=s.getGroupId(),g=this.focusService.getFocusedHeader();za.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:u,pinned:l,fromEnter:!1,fakeEvent:!1,gos:r,columnModel:t.columnModel});const m=s.getDisplayedLeafColumns(),f=a?m[0]:Ie(m);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(f,"auto"),!this.isAlive()&&g&&this.restoreFocus(p,s,g)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const r=s[0].getParent();if(!r)return;const n=this.findGroupWidthId(r,e);n&&this.focusService.focusHeaderPosition({headerPosition:u(d({},i),{column:n})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup())),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup()))}handleMouseOverChange(e){const t={type:e?ct.EVENT_COLUMN_HEADER_MOUSE_OVER:ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s="whenTruncated"===this.gos.get("tooltipShowMode"),r=this.eGui;t||!s||(null==i?void 0:i.headerGroupComponent)||(t=()=>{const e=r.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getGui:()=>r,getLocation:()=>"headerGroup",getTooltipValue:()=>null!=e?e:i&&i.headerTooltip,shouldDisplayTooltip:t};i&&(n.getColDef=()=>i),this.createBean(new fr(n))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,Ee.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,Ee.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=ua.getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(e=>this.comp.addOrRemoveCssClass(e,!0))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach(e=>{this.addManagedListener(e,we.EVENT_MOVING_CHANGED,t)}),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===Xs.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:s,gos:r,dragAndDropService:n}=this,{columnModel:o}=t,a=i.getProvidedColumnGroup().getLeafColumns();let l=!r.get("suppressDragLeaveHidesColumns");const c=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?Bn.ICON_HIDE:Bn.ICON_NOT_ALLOWED,dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),a.forEach(e=>e.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>a.forEach(e=>e.setMoving(!1,"uiColumnDragged")),onGridEnter:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};n.addDragSource(c,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(e=>i[e.getId()]=e.isVisible());const s=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(e=>{t.indexOf(e)>=0&&(s.push(e),_e(t,e))}),t.forEach(e=>s.push(e)),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}},hl=0,dl=class extends rt{constructor(e,t,i){super(),this.instanceId=hl++,this.rowIndex=e,this.pinned=t,this.type=i;const s="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return D(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let r=0;t.hasFloatingFilters()&&(i++,r=1);const n=e.getColumnGroupHeaderRowHeight(),o=e.getColumnHeaderRowHeight(),a=i-(1+r);for(let e=0;e<a;e++)s.push(n);s.push(o);for(let t=0;t<r;t++)s.push(e.getFloatingFiltersHeight());let l=0;for(let e=0;e<this.rowIndex;e++)l+=s[e];return{topOffset:l,rowHeight:s[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,columnModel:i}=this.beans;return!!t.isHeaderWrapperFocused(e)&&i.isDisplayed(e.getColumnGroupChild())};if(e)for(const[t,s]of e)i(s)?this.headerCellCtrls.set(t,s):this.destroyBean(s);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case"filter":s=this.createBean(new sl(e,this.beans,this));break;case"group":s=this.createBean(new cl(e,this.beans,this));break;default:s=this.createBean(new ol(e,this.beans,this))}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach(s=>{const r=i.getVirtualHeaderGroupRow(s,t);e=e.concat(r)}),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const i=Array.from(this.headerCellCtrls.values()).find(t=>t.getColumnGroupChild()==e);return!!i&&i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}};g([de("beans")],dl.prototype,"beans",2),g([le],dl.prototype,"postConstruct",1);var ul=class extends rt{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new ja(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new cr,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new dl(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),s=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(s||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),s&&(this.columnsRowCtrl=this.createBean(new dl(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const s=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==s;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new dl(s,this.pinned,"filter")))})();const s=this.getAllCtrls();this.comp.setCtrls(s),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null!=e&&e.column.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Ma(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const s=0==i,r=this.hidden!==s,n=this.gos.get("enableRtl"),o=this.gos.getScrollbarWidth(),a=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?i+o:i;this.comp.setPinnedContainerWidth(`${a}px`),this.comp.setDisplayed(!s),r&&(this.hidden=s,this.refresh())};this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof we){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const s=this.getAllCtrls()[e];return!!s&&s.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};g([de("ctrlsService")],ul.prototype,"ctrlsService",2),g([de("scrollVisibleService")],ul.prototype,"scrollVisibleService",2),g([de("pinnedWidthService")],ul.prototype,"pinnedWidthService",2),g([de("columnModel")],ul.prototype,"columnModel",2),g([de("focusService")],ul.prototype,"focusService",2),g([de("filterManager")],ul.prototype,"filterManager",2);var pl=class e extends Cr{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new ul(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const t="left"==this.pinned,i="right"==this.pinned,s=t?e.PINNED_LEFT_TEMPLATE:i?e.PINNED_RIGHT_TEMPLATE:e.CENTER_TEMPLATE;this.setTemplate(s),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let i;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&Es(this.eRowContainer,t,i),i=t};e.forEach(e=>{const i=e.getInstanceId(),r=t[i];delete t[i];const n=r||this.createBean(new Za(e));this.headerRowComps[i]=n,this.rowCompsList.push(n),s(n)}),_(t).forEach(e=>this.destroyRowComp(e))}};pl.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',pl.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',pl.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n            <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n        </div>',g([Sr("eCenterContainer")],pl.prototype,"eCenterContainer",2),g([le],pl.prototype,"init",1),g([ce],pl.prototype,"destroyRowComps",1);var gl=pl,ml=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(ml||{}),fl=class extends rt{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl});const e=this.gos.getDocument();this.addManagedListener(e,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s,column:r}=t,n=this.getHeaderRowCount(),o=0===e;let{headerRowIndex:a,column:l,headerRowIndexWithoutSpan:c}=o?this.headerPositionUtils.getColumnVisibleParent(r,s):this.headerPositionUtils.getColumnVisibleChild(r,s),h=!1;return a<0&&(a=0,l=r,h=!0),a>=n?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==c&&(this.currentHeaderRowWithoutSpan=c),!(!h&&!l)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),r=2===e,n=this.gos.get("enableRtl");let o,a;if(-1!==this.currentHeaderRowWithoutSpan?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,r!==n?(a="Before",o=this.headerPositionUtils.findHeader(s,a)):(a="After",o=this.headerPositionUtils.findHeader(s,a)),o||!t)return this.focusService.focusHeaderPosition({headerPosition:o,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:o,direction:a})}return this.focusNextHeaderRow(s,a,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let r,n=null;if("Before"===t?s>0&&(r=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!n)return!1;const{column:o,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,null==n?void 0:n.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof lt){const s=e.getDisplayedLeafColumns();i="Before"===t?Ie(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};g([de("focusService")],fl.prototype,"focusService",2),g([de("headerPositionUtils")],fl.prototype,"headerPositionUtils",2),g([de("ctrlsService")],fl.prototype,"ctrlsService",2),g([le],fl.prototype,"postConstruct",1),fl=g([he("headerNavigationService")],fl);var yl=class extends rt{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new Dr(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",s),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,s=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(s++,i=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),o=s-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=o*r,t+=n,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:ct.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(e=>e.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case Xs.LEFT:t=2;case Xs.RIGHT:C(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case Xs.UP:t=0;case Xs.DOWN:C(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=null!=e?e:t;s!==this.eGui&&s!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!ki())return;const t=new yn(this.eGui);this.addManagedListener(t,yn.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}};g([de("headerNavigationService")],yl.prototype,"headerNavigationService",2),g([de("focusService")],yl.prototype,"focusService",2),g([de("columnModel")],yl.prototype,"columnModel",2),g([de("ctrlsService")],yl.prototype,"ctrlsService",2),g([de("filterManager")],yl.prototype,"filterManager",2),g([de("menuService")],yl.prototype,"menuService",2);var vl=class e extends Cr{constructor(){super(e.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new yl).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new gl("left")),t(new gl(null)),t(new gl("right"))}};vl.TEMPLATE='<div class="ag-header" role="presentation"/>',g([le],vl.prototype,"postConstruct",1);var Cl=vl,bl=class extends rt{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};g([de("dragService")],bl.prototype,"dragService",2),g([de("ctrlsService")],bl.prototype,"ctrlsService",2),bl=g([he("horizontalResizeService")],bl);var Sl=class extends rt{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,r="left";const n=this.menuService.isLegacyMenuEnabled();!n&&this.gos.get("enableRtl")&&(s=1,r="right");let o=n?void 0:4*s,a=n?void 0:4;this.showPopup(e,s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,nudgeX:o,nudgeY:a,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},i,t,n)}showPopup(e,t,i,s,r){const n=e?this.createBean(new Ko(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!(null==n?void 0:n.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const o=document.createElement("div");let a;Ht(o,"presentation"),o.classList.add("ag-menu"),r||o.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(o,"keydown",e=>this.trapFocusWithin(e,o)),o.appendChild(null==n?void 0:n.getGui());const l=this.menuService.isColumnMenuAnchoringEnabled()?null!=s?s:this.ctrlsService.getGridBodyCtrl().getGui():void 0,c=this.localeService.getLocaleTextFunc(),h=r&&"columnFilter"!==i?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),d=this.popupService.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const r=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),r&&s&&ws(s)){const e=this.focusService.findTabbableParent(s);e&&e.focus()}null==n||n.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(o),anchorToElement:l,ariaLabel:h});d&&(this.hidePopup=a=d.hideFunc),n.afterInit().then(()=>{t(o),n.afterGuiAttached({container:i,hidePopup:a})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==Xs.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:ct.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:null!=i?i:null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){var t;return e.isFilterAllowed()&&(null!=(t=e.getColDef().menuTabs)?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};g([de("filterManager")],Sl.prototype,"filterManager",2),g([de("popupService")],Sl.prototype,"popupService",2),g([de("focusService")],Sl.prototype,"focusService",2),g([de("ctrlsService")],Sl.prototype,"ctrlsService",2),g([de("menuService")],Sl.prototype,"menuService",2),Sl=g([he("filterMenuFactory")],Sl);var wl=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(wl||{}),xl=class extends rt{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:r,forceFocusOutWhenTabGuardsAreEmpty:n,focusInnerElement:o,onFocusIn:a,onFocusOut:l,shouldStopEventPropagation:c,onTabKeyDown:h,handleKeyDown:d,eFocusableElement:u}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=o,this.eFocusableElement=u,this.focusTrapActive=!!r,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.providedFocusIn=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=c,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=d}postConstruct(){this.createManagedBean(new Dr(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===s)return;let r,n;e?(r=0,n=s):(r=s+1,n=i.length);const o=i.slice(r,n),a=this.gos.get("tabIndex");o.sort((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return s===a?1:i===a?-1:0===i?1:0===s?-1:i-s}),o[e?o.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}};g([de("focusService")],xl.prototype,"focusService",2),g([le],xl.prototype,"postConstruct",1);var El=class extends Cr{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:e=>{t.forEach(t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new xl({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),Ht(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Cs(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){_s(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},Ml=class e extends El{constructor(t){super(e.getTemplate(t.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=t}postConstruct(){this.setupHeader(),this.params.items&&this.params.items.forEach(e=>this.addItem(e)),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>{var e,t,i;return null==(i=null==(t=null==(e=this.activeItem)?void 0:e.tabbedItem)?void 0:t.afterDetachedCallback)?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">\n            <div ref="eHeader"></div>\n            <div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>\n        </div>`}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,i=(e,i)=>{e.classList.add(`ag-tabs-${i}`),t&&e.classList.add(`${t}-${i}`)};e?(this.setupCloseButton(i),this.eTabHeader=this.gos.getDocument().createElement("div"),i(this.eHeader,"header-wrapper"),Ht(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Ht(this.eTabHeader,"tablist"),i(this.eTabHeader,"header")}setupCloseButton(e){const t=this.gos.getDocument(),i=t.createElement("button");e(i,"close-button");const s=Ys("close",this.gos,void 0,!0);Kt(i,this.params.closeButtonAriaLabel),i.appendChild(s),this.addManagedListener(i,"click",()=>{var e,t;return null==(t=(e=this.params).onCloseClicked)?void 0:t.call(e)});const r=t.createElement("div");e(r,"close-button-wrapper"),Ht(r,"presentation"),r.appendChild(i),this.eHeader.appendChild(r),this.eCloseButton=i}handleKeyDown(e){switch(e.key){case Xs.RIGHT:case Xs.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const t=e.key===Xs.RIGHT,i=this.gos.get("enableRtl"),s=this.items.indexOf(this.activeItem),r=t!==i?Math.min(s+1,this.items.length-1):Math.max(s-1,0);if(s===r)return;e.preventDefault();const n=this.items[r];this.showItemWrapper(n),n.eHeaderButton.focus();break;case Xs.UP:case Xs.DOWN:e.stopPropagation()}}onTabKeyDown(e){var t,i,s,r;if(e.defaultPrevented)return;const{focusService:n,eHeader:o,eBody:a,activeItem:l,params:c}=this,{suppressTrapFocus:h,enableCloseButton:d}=c,u=this.gos.getActiveDomElement(),p=e.target,g=e.shiftKey;if(o.contains(u))return e.preventDefault(),void(d&&g&&!(null==(t=this.eCloseButton)?void 0:t.contains(u))?null==(i=this.eCloseButton)||i.focus():h&&g?null==(s=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,p))||s.focus():this.focusBody(e.shiftKey));let m=null;if(n.isTargetUnderManagedComponent(a,p)&&(g&&(m=this.focusService.findFocusableElementBeforeTabGuard(a,p)),m||h||(m=l.eHeaderButton)),!m&&a.contains(u)&&(m=n.findNextFocusableElement(a,!1,g),!m))return e.preventDefault(),void(h&&!g?this.forceFocusOutOfContainer(g):d&&!g?null==(r=this.eCloseButton)||r.focus():this.focusHeader());m&&(e.preventDefault(),m.focus())}focusInnerElement(e){e?this.focusHeader():this.focusBody(!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){this.focusService.focusInto(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");Ht(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),Kt(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i,s,r,n,o;const{tabbedItem:a,eHeaderButton:l}=e;null==(i=(t=this.params).onItemClicked)||i.call(t,{item:a}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Cs(this.eBody),a.bodyPromise.then(e=>{this.eBody.appendChild(e);const t=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,t),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const t=a.getScrollableContainer&&a.getScrollableContainer()||e;this.lastScrollListener=this.addManagedListener(t,"scroll",()=>{this.tabbedItemScrollMap.set(a.name,t.scrollTop)});const i=this.tabbedItemScrollMap.get(a.name);void 0!==i&&setTimeout(()=>{t.scrollTop=i},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null==(o=(n=this.activeItem.tabbedItem).afterDetachedCallback)||o.call(n)),l.classList.add("ag-tab-selected"),this.activeItem=e):null==(r=(s=this.params).onActiveItemClicked)||r.call(s)}};g([de("focusService")],Ml.prototype,"focusService",2),g([Sr("eHeader")],Ml.prototype,"eHeader",2),g([Sr("eBody")],Ml.prototype,"eBody",2),g([le],Ml.prototype,"postConstruct",1);var Al=Ml,Tl=class extends rt{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{var i,s;let r=null!=(i=null==e?void 0:e.clientWidth)?i:0,n=null!=(s=null==e?void 0:e.clientHeight)?s:0,o=!0;const a=()=>{var i,s;if(o){const o=null!=(i=null==e?void 0:e.clientWidth)?i:0,l=null!=(s=null==e?void 0:e.clientHeight)?s:0;(o!==r||l!==n)&&(r=o,n=l,t()),this.doNextPolyfillTurn(a)}};return a(),()=>o=!1},r=this.gos.get("suppressBrowserResizeObserver");return i.ResizeObserver&&!r?(()=>{const s=new i.ResizeObserver(t);return s.observe(e),()=>s.disconnect()})():this.getFrameworkOverrides().wrapIncoming(()=>s(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){this.polyfillScheduled||(this.polyfillScheduled=!0,window.setTimeout(()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(e=>e())},50))}};Tl=g([he("resizeObserverService")],Tl);var Dl=class extends rt{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationProxy.getCurrentPage();e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,r=s.list,n=this.destroyTasks,o=(new Date).getTime();let a=(new Date).getTime()-o;const l=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;l||a<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(r.length)this.sortTaskList(s),e=r.pop().task;else{if(!n.length){this.cancelledTasks.clear();break}e=n.pop()}this.cancelledTasks.has(e)||e()}a=(new Date).getTime()-o}i.length||r.length||n.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask(()=>{t=!1,e()})):window.setTimeout(e,0)}}};g([de("ctrlsService")],Dl.prototype,"ctrlsService",2),g([de("paginationProxy")],Dl.prototype,"paginationProxy",2),g([le],Dl.prototype,"init",1),Dl=g([he("animationFrameService")],Dl);var Il=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(Il||{}),Rl=class extends rt{postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(e=>{e.id&&t.has(e.id)&&(e.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};g([de("rowModel")],Rl.prototype,"rowModel",2),g([le],Rl.prototype,"postConstruct",1),Rl=g([he("expansionService")],Rl);var Pl=class extends rt{postConstruct(){var e;this.activeMenuFactory=null!=(e=this.enterpriseMenuFactory)?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const r=s.getBoundingClientRect();return{x:r.x+r.width/2,y:r.y+r.height/2}}showContextMenu(e){var t,i,s;const{column:r,rowNode:n}=e;let{anchorToElement:o,value:a}=e;n&&r&&null==a&&(a=n.getValueFromValueService(r)),null==o&&(o=this.getContextMenuAnchorElement(n,r)),null==(s=this.contextMenuFactory)||s.onContextMenu(null!=(t=e.mouseEvent)?t:null,null!=(i=e.touchEvent)?i:null,null!=n?n:null,null!=r?r:null,a,o)}showColumnChooser(e){var t;null==(t=this.columnChooserFactory)||t.showColumnChooser(e)}hidePopupMenu(){var e;null==(e=this.contextMenuFactory)||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;null==(e=this.columnChooserFactory)||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(null!=i?i:t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(null==e?void 0:e.getColDef().suppressHeaderContextMenu)&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(ki()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),s=null==(t=i.floatingFilterComponentParams)?void 0:t.suppressFilterButton;return null!=s&&z("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==i.suppressFloatingFilterButton?!s:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return null!=(e=this.gos.get("columnMenu"))?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?e:!this.gos.exists("suppressMenuHide")||e}showColumnMenuCommon(e,t,i,s){const{column:r,positionBy:n}=t;if("button"===n){const{buttonElement:n}=t;e.showMenuAfterButtonClick(r,n,i,s)}else if("mouse"===n){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(r,n,i,s)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).getHeaderCtrlForColumn(r);e.showMenuAfterButtonClick(r,t.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(null==i?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;return this.getCellGui(s,t)||(s.isFullWidth()?s.getFullWidthElement():i)}};g([de("filterMenuFactory")],Pl.prototype,"filterMenuFactory",2),g([de("ctrlsService")],Pl.prototype,"ctrlsService",2),g([de("animationFrameService")],Pl.prototype,"animationFrameService",2),g([de("filterManager")],Pl.prototype,"filterManager",2),g([de("rowRenderer")],Pl.prototype,"rowRenderer",2),g([ue("columnChooserFactory")],Pl.prototype,"columnChooserFactory",2),g([ue("contextMenuFactory")],Pl.prototype,"contextMenuFactory",2),g([ue("enterpriseMenuFactory")],Pl.prototype,"enterpriseMenuFactory",2),g([le],Pl.prototype,"postConstruct",1),Pl=g([he("menuService")],Pl);var kl=class extends rt{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(e=>this.cloneItemIntoDummy(e,t)),i.appendChild(t);const s=t.offsetWidth;return i.removeChild(t),s+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),r=s.classList;["ag-header-cell","ag-header-group-cell"].some(e=>i.classList.contains(e))?(r.add("ag-header","ag-header-row"),s.style.position="static"):r.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(e=>n.classList.contains(e))){for(let e=0;e<n.classList.length;e++){const t=n.classList[e];"ag-row-position-absolute"!=t&&r.add(t)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}};g([de("rowRenderer")],kl.prototype,"rowRenderer",2),g([de("ctrlsService")],kl.prototype,"ctrlsService",2),g([de("rowCssClassCalculator")],kl.prototype,"rowCssClassCalculator",2),g([le],kl.prototype,"postConstruct",1),kl=g([he("autoWidthCalculator")],kl);var Ll=class extends rt{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i,s,r;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let n=null==(t=e.childStore)?void 0:t.getStoreBounds();return e.footer&&(n=null==(i=e.sibling.childStore)?void 0:i.getStoreBounds()),(null!=(s=null==n?void 0:n.heightPx)?s:0)+(null!=(r=null==n?void 0:n.topPx)?r:0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){const t=e.footer&&0===e.rowIndex,i=!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex);if(t||i){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=Ie(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),r=new Set,n=e=>{if(r.add(e),t){const t=this.getLastPixelOfGroup(e),r=s+i+e.rowHeight;e.stickyRowTop=t<r?i+(t-r):i}else{const t=this.getFirstPixelOfGroup(e),r=s-(i+e.rowHeight);e.stickyRowTop=t>r?i-(t-r):i}i=0,r.forEach(e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)})},o=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=e=>!!e.displayed&&(e.footer?!0!==o&&(("grand"!==o||-1!==e.level)&&(!("group"===o&&e.level>-1)&&!r.has(e))):!!e.isExpandable()&&(!0!==a&&(!r.has(e)&&e.expanded)));for(let e=0;e<100;e++){let e=s+i;t||(e=s-i);const r=this.rowModel.getRowIndexAtPixel(e),o=this.rowModel.getRow(r);if(null==o)break;const a=this.getStickyAncestors(o).find(e=>(t?e.rowIndex<r:e.rowIndex>r)&&l(e));if(a)n(a);else{if(!(t?o.rowTop<e:o.rowTop+o.rowHeight>e)||!l(o))break;n(o)}}return t||r.forEach(e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,r,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(t=>t.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const s="top"===e,r=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,n={},o=[];for(let e=0;e<r.length;e++){const i=r[e].getRowNode();t.has(i)?o.push(r[e]):(n[i.id]=r[e],i.sticky=!1)}const a=new Set;for(let e=0;e<o.length;e++)a.add(o[e].getRowNode());const l=[];t.forEach(e=>{a.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))});let c=!!l.length||o.length!==r.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),c=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),c=!0),this.destroyRowCtrls(n,!1);const h=[...o,...l];return h.sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex),s||h.reverse(),h.forEach(e=>e.setRowTop(e.getRowNode().stickyRowTop)),!!c&&(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0)}};g([de("rowModel")],Ll.prototype,"rowModel",2),g([de("rowRenderer")],Ll.prototype,"rowRenderer",2),g([de("ctrlsService")],Ll.prototype,"ctrlsService",2),g([le],Ll.prototype,"postConstruct",1);var Nl=class extends rt{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(e=>e.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener(ct.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(ct.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(ct.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(ct.EVENT_COLUMN_VISIBLE,t)},s=()=>{this.eventService.removeEventListener(ct.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(ct.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(ct.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(ct.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?i():s()}),this.gos.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new Ll(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new _l(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=_(this.rowCtrlsByRowIndex),t=_(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,ct.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(e=>{const t=t=>{this.getAllCellCtrls().forEach(i=>{i.getColumn()===e&&t(i)})},i=()=>{t(e=>e.onLeftChanged())},s=()=>{t(e=>e.onWidthChanged())},r=()=>{t(e=>e.onFirstRightPinnedChanged())},n=()=>{t(e=>e.onLastLeftPinnedChanged())},o=()=>{t(e=>e.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",s),e.addEventListener("firstRightPinnedChanged",r),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",o),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",s),e.removeEventListener("firstRightPinnedChanged",r),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",o)})})}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(e=>{e.destroyFirstPass(),e.destroySecondPass()}),e.length=0,t&&t.forEach(t=>{const i=new va(t,this.beans,!1,!1,this.printLayout);e.push(i)})}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(null==(i=this.cachedRowCtrls)?void 0:i.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return null==e||e.forEach(e=>this.redrawRow(e,!0)),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=(null==e?void 0:e.suppressKeepFocus)?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,ma.DOM_DATA_KEY_CELL_CTRL),r=this.gos.getDomData(i,va.DOM_DATA_KEY_ROW_CTRL);return s||r?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),r=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(r,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const i=t[s].getAllCellCtrls(),r=i.length;for(let t=0;t<r;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>e.refreshOrDestroyCell(t)),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(e=>{e.isFullWidth()&&(e.refreshFullWidth()||this.redrawRow(e.getRowNode(),!0))}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(e=>e.getCellRenderer()).filter(e=>null!=e);if(null==(t=e.columns)?void 0:t.length)return i;const s=[],r=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(e=>{if(r&&!this.isRowInMap(e.getRowNode(),r))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const i=t[e];null!=i&&s.push(i)}}),[...s,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>{const i=e.getCellEditor();i&&t.push(i)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter(e=>{const i=e.getRowNode();return this.isRowInMap(i,t)}):i}getCellCtrls(e,t){let i;C(t)&&(i={},t.forEach(e=>{const t=this.columnModel.getGridColumn(e);C(t)&&(i[t.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(e=>{e.getAllCellCtrls().forEach(e=>{const t=e.getColumn().getId();i&&!i[t]||s.push(e)})}),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];k(this.rowCtrlsByRowIndex,(t,i)=>{null==i.getRowNode().id&&e.push(t)}),this.removeRowCtrls(e);const t={};return k(this.rowCtrlsByRowIndex,(e,i)=>{const s=i.getRowNode();t[s.id]=i}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]})}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&Li()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,r=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let n=!1;this.stickyRowFeature&&(n=this.stickyRowFeature.checkStickyRows());const o=this.firstRenderedRow!==s||this.lastRenderedRow!==r;if((!t||n||o)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!n),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(e=>i[e]=!0);const s=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!i[e]);this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){let t=Wi(this.firstRenderedRow,this.lastRenderedRow);const i=(e,i)=>{const s=i.getRowNode().rowIndex;null!=s&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(s)};k(this.rowCtrlsByRowIndex,i),k(e,i),t.sort((e,t)=>e-t);const s=[];for(let e=0;e<t.length;e++){const i=t[e],r=this.paginationProxy.getRow(i);r&&!r.sticky&&s.push(i)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const r=[];s.forEach(s=>{const n=this.createOrUpdateRowCtrl(s,e,t,i);C(n)&&r.push(n)}),e&&(!i||this.gos.get("suppressAnimationFrame")||this.printLayout?this.destroyRowCtrls(e,t):this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:ct.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))})}createOrUpdateRowCtrl(e,t,i,s){let r,n=this.rowCtrlsByRowIndex[e];if(n||(r=this.paginationProxy.getRow(e),C(r)&&C(t)&&t[r.id]&&r.alreadyRendered&&(n=t[r.id],t[r.id]=null)),!n){if(r||(r=this.paginationProxy.getRow(e)),!C(r))return;n=this.createRowCon(r,i,s)}return r&&(r.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];k(e,(e,s)=>{s&&(this.cachedRowCtrls&&s.isCacheable()?this.cachedRowCtrls.addRow(s):(s.destroyFirstPass(!t),t?(this.zombieRowCtrls[s.getInstanceId()]=s,i.push(()=>{s.destroySecondPass(),delete this.zombieRowCtrls[s.getInstanceId()]})):s.destroySecondPass()))}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),$(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const i=this.getRowBufferInPixels(),s=this.ctrlsService.getGridBodyCtrl(),r=this.gos.get("suppressRowVirtualisation");let n,o,a=!1;do{const e=this.paginationProxy.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:l}=this.paginationProxy.getCurrentPagePixelRange(),c=this.rowContainerHeightService.getDivStretchOffset(),h=s.getScrollFeature().getVScrollPosition(),d=h.top,u=h.bottom;r?(n=t+c,o=l+c):(n=Math.max(d+e-i,t)+c,o=Math.min(u+e+i,l)+c),this.firstVisibleVPixel=Math.max(d+e,t)+c,this.lastVisibleVPixel=Math.min(u+e,l)+c,a=this.ensureAllRowsInRangeHaveHeightsCalculated(n,o)}while(a);let l=this.paginationProxy.getRowIndexAtPixel(n),c=this.paginationProxy.getRowIndexAtPixel(o);const h=this.paginationProxy.getPageFirstRow(),d=this.paginationProxy.getPageLastRow();l<h&&(l=h),c>d&&(c=d),e=l,t=c}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),r=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>r&&(t=e+r);const n=e!==this.firstRenderedRow,o=t!==this.lastRenderedRow;if(n||o){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:ct.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:ct.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),s=this.focusService.isRowNodeFocused(i),r=e.isEditing(),n=i.detail;return(s||r||n)&&!!this.paginationProxy.isRowPresent(i)||t}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const r=this.gos.get("suppressAnimationFrame"),n=i&&!r&&!this.printLayout;return new va(e,this.beans,t,n,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(e=>e.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow||i)}};g([de("animationFrameService")],Nl.prototype,"animationFrameService",2),g([de("paginationProxy")],Nl.prototype,"paginationProxy",2),g([de("columnModel")],Nl.prototype,"columnModel",2),g([de("pinnedRowModel")],Nl.prototype,"pinnedRowModel",2),g([de("rowModel")],Nl.prototype,"rowModel",2),g([de("focusService")],Nl.prototype,"focusService",2),g([de("beans")],Nl.prototype,"beans",2),g([de("rowContainerHeightService")],Nl.prototype,"rowContainerHeightService",2),g([de("ctrlsService")],Nl.prototype,"ctrlsService",2),g([le],Nl.prototype,"postConstruct",1),Nl=g([he("rowRenderer")],Nl);var _l=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],_e(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],_e(this.entriesList,e)}getEntries(){return this.entriesList}},Ol=class extends rt{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(e){return S("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(S(i))return 0;for(let t=0;t<i.length;t++){const s=i[t];if(s.rowTop+s.rowHeight-1>=e)return t}return i.length-1}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:ct.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:ct.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let s=0;e.forEach((e,r)=>{const n=new Nn(this.beans);n.data=e;const o=t?Nn.ID_PREFIX_TOP_PINNED:Nn.ID_PREFIX_BOTTOM_PINNED;n.id=o+r,n.rowPinned=t?"top":"bottom",n.setRowTop(s),n.setRowHeight(this.gos.getRowHeightForNode(n).height),n.setRowIndex(r),s+=n.rowHeight,i.push(n)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){S(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){S(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=Ie(e);return t.rowTop+t.rowHeight}};g([de("beans")],Ol.prototype,"beans",2),g([le],Ol.prototype,"init",1),Ol=g([he("pinnedRowModel")],Ol);var Fl=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Fl||{}),Gl=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const r=e.childrenAfterGroup[s];r.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(r)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(e=>this.nodeIdsToColumns[i.id][e.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>i[e.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>!i[e.getId()])}},Bl=class e extends rt{constructor(t){super(),this.state=e.STATE_WAITING_TO_LOAD,this.version=0,this.id=t}getId(){return this.id}load(){this.state=e.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=e.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(t){this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(t,i){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_LOADED,this.processServerResult(i))}dispatchLoadCompleted(t=!0){const i={type:e.EVENT_LOAD_COMPLETE,success:t,block:this};this.dispatchEvent(i)}};Bl.EVENT_LOAD_COMPLETE="loadComplete",Bl.STATE_WAITING_TO_LOAD="needsLoading",Bl.STATE_LOADING="loading",Bl.STATE_LOADED="loaded",Bl.STATE_FAILED="failed";var Vl=Bl,Hl=class extends rt{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=lr.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(Vl.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){lr.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:Hl.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:Hl.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter(e=>e.getState()===Vl.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(e=>e.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};Hl.BLOCK_LOADED_EVENT="blockLoaded",Hl.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",g([de("rowModel")],Hl.prototype,"rowModel",2),g([le],Hl.prototype,"postConstruct",1),g([m(0,ge("loggerFactory"))],Hl.prototype,"setBeans",1),Hl=g([he("rowNodeBlockLoader")],Hl);var Ul=class extends rt{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,s){const r=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return r&&this.calculatePages(),r}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const e={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){if(!this.active||this.currentPage===e||"number"!=typeof this.currentPage)return;this.currentPage=e,this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return b(this.topRowBounds)||b(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex)}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let s=t;s<=i;s++){const t=this.getRow(s);t&&e(t)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return!this.active||this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return C(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:C(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:C(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:C(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===e)return;this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}if(i!==this.pageSize){this.calculatePages();const e={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(C(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};g([de("rowModel")],Ul.prototype,"rowModel",2),g([le],Ul.prototype,"postConstruct",1),Ul=g([he("paginationProxy")],Ul);var zl=class extends rt{processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,r){if(null==t&&null==e)return;const n={},o={},a=(e,t)=>{e.split(" ").forEach(e=>{""!=e.trim()&&t(e)})};if(t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const r=e[s],l=t[r];let c;"string"==typeof l?c=this.expressionService.evaluate(l,i):"function"==typeof l&&(c=l(i)),a(r,e=>{c?n[e]=!0:o[e]=!0})}}e&&r&&Object.keys(e).forEach(e=>a(e,e=>{n[e]||(o[e]=!0)})),r&&Object.keys(o).forEach(r),Object.keys(n).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return s="function"==typeof i?i(t):i,"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(e=>{i(e)})}};g([de("expressionService")],zl.prototype,"expressionService",2),zl=g([he("stylingService")],zl);var Wl=class extends Ur{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},jl=class extends Hr{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Kl=class extends tn{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=Ti();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!=(t=Xi(null!=e?e:null,!1))?t:void 0:e;return this.min===i||(this.min=i,Gs(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!=(t=Xi(null!=e?e:null,!1))?t:void 0:e;return this.max===i||(this.max=i,Gs(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,Gs(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!=(e=Ji(this.getValue()))?e:void 0}setDate(e,t){this.setValue(Xi(null!=e?e:null,!1),t)}},$l=class extends Hr{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}},Yl=class extends Cr{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!C(t))return;let i=C(e);if(i){const s=null==t?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){const i=s+e.length,r=Ct(t.slice(0,s),!0),n=Ct(t.slice(s,i),!0),o=Ct(t.slice(i));this.renderValueWithoutRenderer(`${r}<span class="ag-rich-select-row-text-highlight">${n}</span>${o}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),s=`ag-rich-select-row-${this.getCompId()}`;null==(t=i.parentElement)||t.setAttribute("id",s),e&&(ti(this.getParentComponent().getAriaElement(),s),this.wrapperEl.setAttribute("data-active-option",s)),gi(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gos.getDocument(),s=this.getGui(),r=i.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const n=Ct(C(t)?t:e,!0);this.parsedValue=C(n)?n:null,s.appendChild(r),this.renderValueWithoutRenderer(n),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=C(e)?e:"&nbsp;")}populateWithRenderer(e,t){let i,s;return this.params.cellRenderer&&(s=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,shouldDisplayTooltip:t})}})),s&&(i=s.newAgStackInstance()),i&&Vs(i,this.getGui()),!!i&&(i.then(e=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(e)})}),!0)}onClick(){const e=this.getParentComponent(),t={type:ct.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};null==e||e.dispatchEvent(t)}};g([de("userComponentFactory")],Yl.prototype,"userComponentFactory",2),g([le],Yl.prototype,"postConstruct",1);var ql=class e extends El{constructor(t){super(e.getTemplate((null==t?void 0:t.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:i="default",ariaRole:s="listbox",listName:r}=t||{};this.cssIdentifier=i,this.ariaRole=s,this.listName=r}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const e=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;Ht(t,this.ariaRole),Kt(t,e)}addResizeObserver(){const e=this.resizeObserverService.observeResize(this.getGui(),()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()));this.addDestroyFunc(e)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=Wt(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case Xs.UP:case Xs.DOWN:this.navigate(e.key===Xs.UP)&&e.preventDefault();break;case Xs.PAGE_HOME:case Xs.PAGE_END:case Xs.PAGE_UP:case Xs.PAGE_DOWN:null!==this.navigateToPage(e.key)&&e.preventDefault()}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(qe(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(null==this.lastFocusedRowIndex)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return!(t<0||t>=this.model.getRowCount()||(this.focusRow(t),0))}navigateToPage(e,t="focused"){let i=!1;"focused"===t&&(t=this.getLastFocusedRow(),i=!0);const s=this.model.getRowCount()-1;let r=-1;return e===Xs.PAGE_HOME?r=0:e===Xs.PAGE_END?r=s:e===Xs.PAGE_DOWN?r=Math.min(t+this.pageSize,s):e===Xs.PAGE_UP&&(r=Math.max(t-this.pageSize,0)),-1===r?null:(i?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame(()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,i)=>e(t.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">\n                <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>\n            </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if("number"!=typeof e||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const s=e*this.rowHeight,r=s+this.rowHeight,n=this.getGui(),o=n.scrollTop,a=n.offsetHeight,l=o+a,c=t?0:this.rowHeight,h=l<r-c;if(o>s+c)return n.scrollTop=s,!0;if(h){const e=r-a;return n.scrollTop=e,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",ee(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,s=i+t.offsetHeight,r=Math.floor(i/this.rowHeight),n=Math.floor(s/this.rowHeight);this.pageSize=Math.floor((s-i)/this.rowHeight),this.ensureRowsRendered(r,n,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((i,s)=>{(s<e||s>t)&&s!==this.lastFocusedRowIndex&&this.removeRow(s)}),i&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),Ht(i,"tree"===this.ariaRole?"treeitem":"option"),ri(i,this.model.getRowCount()),ni(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=this.rowHeight*e+"px";const s=this.componentCreator(t,i);s.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(s.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:s,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,i)=>{var s,r;if(i>=e)this.removeRow(i);else{const e=this.model.getRow(i);(null==(r=(s=this.model).areRowsEqual)?void 0:r.call(s,t.value,e))?this.componentUpdater(e,t.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};g([de("resizeObserverService")],ql.prototype,"resizeObserverService",2),g([de("animationFrameService")],ql.prototype,"animationFrameService",2),g([Sr("eContainer")],ql.prototype,"eContainer",2),g([le],ql.prototype,"postConstruct",1);var Xl=ql,Zl=class extends Or{constructor(e){var t,i;super(u(d({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!=(t=null==e?void 0:e.template)?t:'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',modalPicker:!1},e),{maxPickerHeight:null!=(i=null==e?void 0:e.maxPickerHeight)?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:s,value:r,valueList:n,searchStringCreator:o}=e||{};null!=s&&(this.cellRowHeight=s),void 0!==r&&(this.value=r),null!=n&&(this.values=n),o&&(this.searchStringCreator=o)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Q(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange(e=>this.searchTextFromString(e)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gos.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new Xl({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setComponentUpdater((e,t)=>{}),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,ct.EVENT_FIELD_PICKER_VALUE_SELECTED,e=>{this.onListValueSelected(e.value,e.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",e=>e.preventDefault()),t.classList.add("ag-rich-select-list");const s=`ag-rich-select-list-${this.listComponent.getCompId()}`;i.setAttribute("id",s),Kt(i,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),fi(this.eWrapper,i)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:s,initialInputValue:r}=this.config,n=this.config.valueFormatter?this.config.valueFormatter(e):e;if(s)return void this.eInput.setValue(null!=r?r:n);let o,a;if(i.cellRenderer&&(o=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:n})),o&&(a=o.newAgStackInstance()),a)Cs(t),Vs(a,t),a.then(e=>{this.addDestroyFunc(()=>this.getContext().destroyBean(e))});else{if(C(this.value))t.innerText=n,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:e}=i;C(e)?(t.innerHTML=`${Ct(e)}`,t.classList.add("ag-display-as-placeholder")):Cs(t)}this.setTooltip({newTooltipText:null!=n?n:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null==(e=this.listComponent)||e.forEachRenderedRow((e,t)=>{e.highlightString(this.searchString)})}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null==(t=this.listComponent)||t.forEachRenderedRow((t,i)=>{const s=-1!==e&&this.highlightedItem===i;t.updateHighlighted(s)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:e=>t[e],areRowsEqual:(e,t)=>e===t}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));(null==(e=this.eLoading)?void 0:e.offsetParent)&&(null==(t=this.eLoading.parentElement)||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===Xs.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Zs(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=e=>e}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map(e=>t(e)):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],s=[];if(!e.length)return{suggestions:i,filteredValues:s};const{searchType:r="fuzzy",filterList:n}=this.config;if("fuzzy"===r){const e=zs(this.searchString,t,!0);i=e.values;const r=e.indices;if(n&&r.length)for(let e=0;e<r.length;e++)s.push(this.values[r[e]])}else i=t.filter((e,t)=>{const i=e.toLocaleLowerCase(),o=this.searchString.toLocaleLowerCase(),a="match"===r?i.startsWith(o):-1!==i.indexOf(o);return n&&a&&s.push(this.values[t]),a});return{suggestions:i,filteredValues:s}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,s=this.buildSearchStrings(i);if(!s)return void this.highlightSelectedValue(-1);const{suggestions:r,filteredValues:n}=this.getSuggestionsAndFilteredValues(this.searchString,s),{filterList:o,highlightMatch:a,searchType:l="fuzzy"}=this.config,c=n.length,h=!(!o||""===this.searchString);if(this.filterListModel(h?n:i),r.length){const e=h?0:s.indexOf(r[0]);this.selectListItem(e)}else if(this.highlightSelectedValue(-1),!h||c)null==(e=this.listComponent)||e.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const e=null==(t=this.listComponent)?void 0:t.getAriaElement();e&&ti(e,null)}a&&"fuzzy"!==l&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=null==(e=this.listComponent)?void 0:e.getGui(),i=!!this.currentList&&0===this.currentList.length;null==t||t.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length||(this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e))}setValue(e,t,i){const s=this.currentList?this.currentList.indexOf(e):-1;return-1===s?this:(this.value=e,i||this.selectListItem(s),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new Yl(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:s="fuzzy"}=this.config;return i&&"fuzzy"!==s&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const i=(null==t?void 0:t.getGui()).getBoundingClientRect(),s=t.getScrollTop(),r=e.clientY-i.top+s;return Math.floor(r/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===Xs.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const s=this.highlightedItem,r=-1===s?0:s+(i?1:-1);this.selectListItem(r)}onPageNavigation(e){var t;if(!this.isPickerDisplayed)return;const i=null==(t=this.listComponent)?void 0:t.navigateToPage(e,this.highlightedItem);null!=i&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightSelectedValue(i)})}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){this.isPickerDisplayed&&this.currentList&&this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:ct.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case Xs.LEFT:case Xs.RIGHT:i||e.preventDefault();break;case Xs.PAGE_HOME:case Xs.PAGE_END:if(i){e.preventDefault();const i=this.eInput.getInputElement(),s=t===Xs.PAGE_HOME?0:i.value.length;i.setSelectionRange(s,s);break}case Xs.PAGE_UP:case Xs.PAGE_DOWN:e.preventDefault(),this.onPageNavigation(t);break;case Xs.DOWN:case Xs.UP:this.onNavigationKeyDown(e,t);break;case Xs.ESCAPE:this.isPickerDisplayed&&(ws(this.listComponent.getGui())&&(e.preventDefault(),qe(e)),this.hidePicker());break;case Xs.ENTER:this.onEnterKeyDown(e);break;case Xs.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};g([de("userComponentFactory")],Zl.prototype,"userComponentFactory",2),g([de("animationFrameService")],Zl.prototype,"animationFrameService",2),g([Sr("eInput")],Zl.prototype,"eInput",2);var Ql=class e extends Nr{constructor(t){super(t,e.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:i,step:s,value:r,onValueChange:n}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),null!=i&&this.setTextFieldWidth(i),null!=s&&this.setStep(s),null!=r&&this.setValue(r),null!=n&&this.onValueChange(n)}onValueChange(e){const t=ct.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}),this.addManagedListener(this.eSlider,t,()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,t){return this.getValue()===e||(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED})),this}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};Ql.TEMPLATE='<div class="ag-slider">\n            <label ref="eLabel"></label>\n            <div class="ag-wrapper ag-slider-wrapper">\n                <ag-input-range ref="eSlider"></ag-input-range>\n                <ag-input-number-field ref="eText"></ag-input-number-field>\n            </div>\n        </div>',g([Sr("eLabel")],Ql.prototype,"eLabel",2),g([Sr("eSlider")],Ql.prototype,"eSlider",2),g([Sr("eText")],Ql.prototype,"eText",2),g([le],Ql.prototype,"init",1);var Jl=Ql,ec=class e extends Cr{constructor(t={}){super(e.getTemplate(t)),this.params=t,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:i,items:s,suppressEnabledCheckbox:r,expanded:n,suppressToggleExpandOnEnableChange:o,useToggle:a}=t;this.cssIdentifier=t.cssIdentifier||"default",this.enabled=null==i||i,this.items=s||[],this.useToggle=null!=a&&a,this.alignItems=t.alignItems||"center",this.expanded=null==n||n,null!=r&&(this.suppressEnabledCheckbox=r),null!=o&&(this.suppressToggleExpandOnEnableChange=o)}static getTemplate(e){const t=e.cssIdentifier||"default";return`\n            <div class="ag-group ag-${t}-group" role="presentation">\n                <div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">\n                    <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n                </div>\n                <div ref="eContainer" class="ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container"></div>\n            </div>\n        `}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(null!=i&&i),this.refreshChildDisplay(),os(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),null!=t&&this.onEnableChange(t)}refreshChildDisplay(){var e;os(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),null==(e=this.eTitleBar)||e.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(t){var i;let s=!1;if((null==(i=this.eTitleBar)?void 0:i.isSuppressCollapse())&&!this.useToggle)t=!0,s=!0;else if(t=null!=t?t:!this.expanded,this.expanded===t)return this;return this.expanded=t,this.refreshChildDisplay(),os(this.eContainer,t),s||this.dispatchEvent({type:t?e.EVENT_EXPANDED:e.EVENT_COLLAPSED}),this}addItems(e){e.forEach(e=>this.addItem(e))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const i=this.eContainer,s=e instanceof Cr?e.getGui():e;s.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(i.insertAdjacentElement("afterbegin",s),this.items.unshift(s)):(i.appendChild(s),this.items.push(s))}hideItem(e,t){os(this.items[t],!e)}getItemIndex(e){const t=e instanceof Cr?e.getGui():e;return this.items.indexOf(t)}setTitle(e){var t;return null==(t=this.eTitleBar)||t.setTitle(e),this}addTitleBarWidget(e){var t;return null==(t=this.eTitleBar)||t.addWidget(e),this}addCssClassToTitleBar(e){var t;null==(t=this.eTitleBar)||t.addCssClass(e)}dispatchEnableChangeEvent(t){const i={type:e.EVENT_ENABLE_CHANGE,enabled:t};this.dispatchEvent(i)}setEnabled(e,t,i){var s;return this.enabled=e,this.refreshDisabledStyles(),i||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),null==(s=this.eToggle)||s.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(t){return this.addManagedListener(this,e.EVENT_ENABLE_CHANGE,e=>t(e.enabled)),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var t;return null==(t=this.eTitleBar)||t.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const t=!this.enabled;this.eContainer.classList.toggle("ag-disabled",t),null==(e=this.eTitleBar)||e.refreshDisabledStyles(this.suppressEnabledCheckbox&&t),this.eContainer.classList.toggle("ag-disabled-group-container",t)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new rc(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,rc.EVENT_EXPAND_CHANGED,e=>this.toggleGroupExpand(e.expanded)),e}createToggleTitleBar(){var e;const t=this.createManagedBean(new Wl({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return t.addCssClass("ag-group-title-bar"),t.addCssClass(`ag-${null!=(e=this.params.cssIdentifier)?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=t,this.toggleGroupExpand(this.enabled),t}};ec.EVENT_EXPANDED="expanded",ec.EVENT_COLLAPSED="collapsed",ec.EVENT_ENABLE_CHANGE="enableChange",g([Sr("eToolbar")],ec.prototype,"eToolbar",2),g([Sr("cbGroupEnabled")],ec.prototype,"cbGroupEnabled",2),g([Sr("eContainer")],ec.prototype,"eContainer",2),g([le],ec.prototype,"postConstruct",1);var tc=ec,ic="ag-disabled-group-title-bar",sc=class e extends Cr{constructor(t={}){super(e.getTemplate(t)),this.suppressOpenCloseIcons=!1;const{title:i,suppressOpenCloseIcons:s}=t;i&&i.length>0&&(this.title=i),null!=s&&(this.suppressOpenCloseIcons=s)}static getTemplate(e){var t;const i=null!=(t=e.cssIdentifier)?t:"default";return`\n            <div class="ag-group-title-bar ag-${i}-group-title-bar ag-unselectable" role="button">\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n                <span ref="eTitle" class="ag-group-title ag-${i}-group-title"></span>\n            </div>\n        `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild($s("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild($s("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",e=>{switch(e.key){case Xs.ENTER:case Xs.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case Xs.RIGHT:case Xs.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===Xs.RIGHT)}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ii(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;os(this.eGroupOpenedIcon,t&&e),os(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(t){const i={type:e.EVENT_EXPAND_CHANGED,expanded:t};this.dispatchEvent(i)}setTitle(e){const t=this.getGui(),i=!!e&&e.length>0;e=i?e:void 0,this.eTitle.textContent=null!=e?e:"",os(t,i),e!==this.title&&(this.title=e);const s=t.classList.contains(ic);return this.refreshDisabledStyles(s),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(ic),t.removeAttribute("tabindex")):(t.classList.remove(ic),"string"==typeof this.title?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}};sc.EVENT_EXPAND_CHANGED="expandedChanged",g([Sr("eGroupOpenedIcon")],sc.prototype,"eGroupOpenedIcon",2),g([Sr("eGroupClosedIcon")],sc.prototype,"eGroupClosedIcon",2),g([Sr("eTitle")],sc.prototype,"eTitle",2),g([le],sc.prototype,"postConstruct",1);var rc=sc,nc=class extends El{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=null!=t?t:{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case Xs.UP:case Xs.RIGHT:case Xs.DOWN:case Xs.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case Xs.ESCAPE:this.closeIfIsChild()&&qe(e)}}handleFocusIn(e){var t,i;const s=e.relatedTarget;(this.tabGuardCtrl.isTabGuard(s)||!this.getGui().contains(s)&&!(null==(i=null==(t=this.activeMenuItem)?void 0:t.getSubMenuGui())?void 0:i.contains(s)))&&(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||(null==(t=this.activeMenuItem.getSubMenuGui())?void 0:t.contains(i))||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&dr.all(e.map(e=>"separator"===e?dr.resolve({eGui:this.createSeparator()}):"string"==typeof e?(console.warn(`AG Grid: unrecognised menu item ${e}`),dr.resolve({eGui:null})):this.addItem(e))).then(e=>{e.forEach(e=>{(null==e?void 0:e.eGui)&&(this.appendChild(e.eGui),e.comp&&this.menuItems.push(e.comp))})})}addItem(e){const t=this.createManagedBean(new lc);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListener(t,lc.EVENT_CLOSE_MENU,e=>{this.dispatchEvent(e)}),this.addManagedListener(t,lc.EVENT_MENU_ITEM_ACTIVATED,e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){return xs('\n            <div class="ag-menu-separator" aria-hidden="true">\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n            </div>')}handleNavKey(e){switch(e){case Xs.UP:case Xs.DOWN:const t=this.findNextItem(e===Xs.UP);return void(t&&t!==this.activeMenuItem&&t.activate())}e===(this.gos.get("enableRtl")?Xs.RIGHT:Xs.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof lc)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(e=>!e.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?Ie(t):t[0];let i;e&&t.reverse();let s=!1;for(let e=0;e<t.length;e++){const r=t[e];if(s){i=r;break}r===this.activeMenuItem&&(s=!0)}return s&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};g([de("focusService")],nc.prototype,"focusService",2),g([le],nc.prototype,"postConstruct",1);var oc=class extends El{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===Xs.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}};g([le],oc.prototype,"postConstruct",1);var ac=class e extends rt{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){var t,i;const{menuItemDef:s,isAnotherSubMenuOpen:r,level:n,childComponent:o,contextParams:a}=e;return this.params=e.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=r,this.childComponent=o,this.contextParams=a,this.cssClassPrefix=null!=(i=null==(t=this.params.menuItemParams)?void 0:t.cssClassPrefix)?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,u(d({},s),{level:n,isAnotherSubMenuOpen:r,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(e=>{var t;this.menuItemComp=e;const i=null==(t=e.configureDefaults)?void 0:t.call(e);i&&this.configureDefaults(!0===i?void 0:i)})}addListeners(e,t){(null==t?void 0:t.suppressClick)||this.addManagedListener(e,"click",e=>this.onItemSelected(e)),(null==t?void 0:t.suppressKeyboardSelect)||this.addManagedListener(e,"keydown",e=>{e.key!==Xs.ENTER&&e.key!==Xs.SPACE||(e.preventDefault(),this.onItemSelected(e))}),(null==t?void 0:t.suppressMouseDown)||this.addManagedListener(e,"mousedown",e=>{e.stopPropagation(),e.preventDefault()}),(null==t?void 0:t.suppressMouseOver)||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(t=!1){var i,s;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const r=xs('<div class="ag-menu" role="presentation"></div>');let n;this.eSubMenuGui=r;let o=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new oc(this.childComponent));e.setParentComponent(this);const t=e.getGui(),i="mouseenter",s=()=>this.cancelDeactivate();t.addEventListener(i,s),n=()=>t.removeEventListener(i,s),r.appendChild(t),this.childComponent.afterGuiAttached&&(o=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const i=this.createBean(new nc(this.level+1,this.contextParams));i.setParentComponent(this),i.addMenuItems(this.params.subMenu),r.appendChild(i.getGui()),this.addManagedListener(i,e.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e)),i.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),n=()=>this.destroyBean(i),t&&(o=()=>{i.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:r}),l=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:r,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:o});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var e,t;c&&c.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),n(),null==(t=(e=this.menuItemComp).setExpanded)||t.call(e,!1),this.eSubMenuGui=void 0},null==(s=(i=this.menuItemComp).setExpanded)||s.call(i,!0)}setAriaExpanded(e){this.suppressAria||ii(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e){var t,i;this.cancelActivate(),this.params.disabled||(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),null==(i=(t=this.menuItemComp).setActive)||i.call(t,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){var e,t;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),null==(t=(e=this.menuItemComp).setActive)||t.call(e,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){var t,i;null==(i=(t=this.menuItemComp).select)||i.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gos.addGridCommonParams(d({},this.contextParams)))):this.openSubMenu(e&&"keydown"===e.type),this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect||this.closeMenu(e)}closeMenu(t){const i={type:e.EVENT_CLOSE_MENU};t&&(t instanceof MouseEvent?i.mouseEvent=t:i.keyboardEvent=t),this.dispatchEvent(i)}onItemActivated(){const t={type:e.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(t)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),e.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),e.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,i,s;if(!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(e));let r=this.menuItemComp.getGui();const n=null==(i=(t=this.menuItemComp).getRootElement)?void 0:i.call(t);n&&((null==e?void 0:e.suppressRootStyles)||r.classList.add("ag-menu-option-custom"),r=n),this.eGui=r,this.suppressRootStyles=!!(null==e?void 0:e.suppressRootStyles),this.suppressRootStyles||(r.classList.add(this.cssClassPrefix),null==(s=this.params.cssClasses)||s.forEach(e=>r.classList.add(e)),this.params.disabled&&r.classList.add(`${this.cssClassPrefix}-disabled`)),(null==e?void 0:e.suppressTooltip)||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!(null==e?void 0:e.suppressAria),this.suppressAria||(Ht(r,"treeitem"),Qt(r,this.level+1),this.params.disabled&&Jt(r,!0)),(null==e?void 0:e.suppressTabIndex)||r.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(r,e),this.suppressFocus=!!(null==e?void 0:e.suppressFocus)}refreshTooltip(e,t){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),e&&this.menuItemComp&&(this.tooltipFeature=this.createBean(new fr({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};ac.EVENT_CLOSE_MENU="closeMenu",ac.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",ac.ACTIVATION_DELAY=80,g([de("popupService")],ac.prototype,"popupService",2),g([de("userComponentFactory")],ac.prototype,"userComponentFactory",2);var lc=ac,cc=class e extends Cr{constructor(t){super(e.getTemplate(t)),this.config=t,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">\n            <div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">\n                <span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>\n                <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>\n            </div>\n            <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>\n        </div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:s,minWidth:r=250,width:n,minHeight:o=250,height:a,centered:l,popup:c,x:h,y:d}=this.config;this.positionableFeature=new Pr(this.getGui(),{minWidth:r,width:n,minHeight:o,height:a,centered:l,x:h,y:d,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const u=this.getGui();e&&this.setBodyComponent(e),i?os(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(null!=t?t:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",e=>{if(u.contains(e.relatedTarget)||u.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()}),c&&this.positionableFeature.isPositioned()||(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(t){if(t!==this.closable&&(this.closable=t),t){const t=this.closeButtonComp=new Cr(e.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),s=Ys("close",this.gos);s.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(s),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const e=this.closeButtonComp.getGui();e.parentElement.removeChild(e),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,s=i.children,r=s.length;null==t&&(t=r),t=Math.max(0,Math.min(t,r)),e.addCssClass("ag-panel-title-bar-button");const n=e.getGui();0===t?i.insertAdjacentElement("afterbegin",n):t===r?i.insertAdjacentElement("beforeend",n):s[t-1].insertAdjacentElement("afterend",n),e.setParentComponent(this)}getBodyHeight(){return ds(this.eContentWrapper)}getBodyWidth(){return us(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&ws(e)&&this.close(),super.destroy()}};cc.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',g([Sr("eContentWrapper")],cc.prototype,"eContentWrapper",2),g([Sr("eTitleBar")],cc.prototype,"eTitleBar",2),g([Sr("eTitleBarButtons")],cc.prototype,"eTitleBarButtons",2),g([Sr("eTitle")],cc.prototype,"eTitle",2),g([le],cc.prototype,"postConstruct",1);var hc=cc,dc=class extends hc{constructor(e){super(u(d({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",t=>{this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),s&&this.setMaximizable(s),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:s,afterGuiAttached:r}=this.config,n=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:s||n("ariaLabelDialog","Dialog"),afterGuiAttached:r});o&&(this.close=o.hideFunc)}onClosed(e){var t,i;this.destroy(),null==(i=(t=this.config).closedCallback)||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:i,height:s}=this.lastPosition;this.setWidth(i),this.setHeight(s),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){os(this.maximizeIcon,!this.isMaximized),os(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new Cr('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=Ys("maximize",this.gos),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=Ys("minimize",this.gos),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}};g([de("popupService")],dc.prototype,"popupService",2);var uc=0,pc=class extends rt{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){return this.gos.get("popupParent")||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);-1!==s&&(this.popupList[s].alignedToElement=t);const r=t.getBoundingClientRect(),n=this.getParentRect(),o=this.keepXYWithinBounds(i,r.top-n.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const l=n.right-n.left-a;let c;function h(){return r.right-n.left-2}function d(){return r.left-n.left-a}this.gos.get("enableRtl")?(c=d(),c<0&&(c=h(),this.setAlignedStyles(i,"left")),c>l&&(c=0,this.setAlignedStyles(i,"right"))):(c=h(),c>l&&(c=d(),this.setAlignedStyles(i,"right")),c<0&&(c=0,this.setAlignedStyles(i,"left"))),i.style.left=`${c}px`,i.style.top=`${o}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:r}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:r,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:r,eventSource:n,alignSide:o="left",position:a="over",column:l,rowNode:c,type:h}=e,d=n.getBoundingClientRect(),u=this.getParentRect(),p=this.getPopupIndex(t);-1!==p&&(this.popupList[p].alignedToElement=n),this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:r,updatePosition:()=>{let i,r=d.left-u.left;return"right"===o&&(r-=t.offsetWidth-d.width),"over"===a?(i=d.top-u.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),i="under"===this.shouldRenderUnderOrAbove(t,d,u,e.nudgeY||0)?d.top-u.top+d.height:d.top-t.offsetHeight-2*(s||0)-u.top),{x:r,y:i}},postProcessCallback:()=>this.callPostProcessPopup(h,t,n,null,l,c)})}shouldRenderUnderOrAbove(e,t,i,s){const r=i.bottom-t.bottom,n=t.top-i.top,o=e.offsetHeight+s;return r>o?"under":n>o||n>r?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:r}=s;r&&(["right","left","over","above","under"].forEach(t=>{r.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)}),t&&(r.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`)))}callPostProcessPopup(e,t,i,s,r,n){const o=this.gos.getCallback("postProcessPopup");o&&o({column:r,rowNode:n,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:r,skipObserver:n,updatePosition:o}=e,a={width:0,height:0},l=(n=!1)=>{let{x:l,y:c}=o();n&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(l+=s),r&&(c+=r),i&&(l=this.keepXYWithinBounds(t,l,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${l}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!n){const e=this.resizeObserverService.observeResize(t,()=>l(!0));setTimeout(()=>e(),pc.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),ms(t)}keepXYWithinBounds(e,t,i){const s=0===i,r=s?"clientHeight":"clientWidth",n=s?"top":"left",o=s?"offsetHeight":"offsetWidth",a=s?"scrollTop":"scrollLeft",l=this.gos.getDocument(),c=l.documentElement,h=this.getPopupParent(),d=h.getBoundingClientRect(),u=l.documentElement.getBoundingClientRect(),p=h===l.body,g=e[o];let m=p?(s?ps:gs)(c)+c[a]:h[r];p&&(m-=Math.abs(u[n]-d[n]));const f=m-g;return Math.min(Math.max(t,0),Math.abs(f))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:r,positionCallback:n,anchorToElement:o}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const l=this.createPopupWrapper(i,s,!!r),c=this.addEventListenersToPopup(u(d({},e),{wrapperEl:l}));return n&&n(),this.addPopupToPopupList(i,l,c,o),{hideFunc:c}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();C(e.style.top)||(e.style.top=-1*t.top+"px"),C(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),r=document.createElement("div"),{allThemes:n}=this.environment.getTheme();return n.length&&r.classList.add(...n),r.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Ht(e,"dialog"),Kt(e,t),r.appendChild(e),s.appendChild(r),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),r}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const e of Array.from(t.wrapper.classList))e.startsWith("ag-theme-")&&t.wrapper.classList.remove(e);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:r,closedCallback:n,afterGuiAttached:o,closeOnEsc:a,modal:l}=e;let c=!1;const h=e=>{s.contains(this.gos.getActiveDomElement())&&(e.key!==Xs.ESCAPE||Xe(e)||p({keyboardEvent:e}))},d=e=>p({mouseEvent:e}),u=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:o,touchEvent:a,keyboardEvent:l,forceHide:p}=e;(p||!this.isEventFromCurrentPopup({mouseEvent:o,touchEvent:a},r)&&!c)&&(c=!0,i.removeChild(s),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",d),this.eventService.removeEventListener(ct.EVENT_DRAG_STARTED,d),n&&n(o||a||l),this.removePopupFromPopupList(r))};return o&&o({hidePopup:p}),window.setTimeout(()=>{a&&t.addEventListener("keydown",h),l&&(t.addEventListener("mousedown",d),this.eventService.addEventListener(ct.EVENT_DRAG_STARTED,d),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",d))},0),p}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:uc++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(e=>e&&e()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const r=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=r,s.isAnchored=!0,r}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:r}=e,n=s.getBoundingClientRect(),o=i.top-n.top,a=i.left-n.left;let l=o,c=a;const h=r.style.top,d=parseInt(h.substring(0,h.length-1),10),u=r.style.left,p=parseInt(u.substring(0,u.length-1),10);return new dr(i=>{this.getFrameworkOverrides().setInterval(()=>{const i=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const h=i.top-n.top;if(h!=l){const e=this.keepXYWithinBounds(r,d+o-h,0);r.style.top=`${e}px`}l=h;const u=i.left-n.left;if(u!=c){const e=this.keepXYWithinBounds(r,p+a-u,1);r.style.left=`${e}px`}c=u},200).then(e=>{i(()=>{null!=e&&window.clearInterval(e)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,r=i||s;if(!r)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let e=n;e<this.popupList.length;e++)if(Je(this.popupList[e].element,r))return!0;return this.isElementWithinCustomPopup(r.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,r=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),n=r.length,o=this.getWrapper(e);if(!o||s<=1||!t.contains(e))return;const a=i.indexOf(o),l=o.querySelectorAll("div"),c=[];for(l.forEach(e=>{0!==e.scrollTop&&c.push([e,e.scrollTop])}),n?o.classList.contains("ag-always-on-top")?a!==s-1&&Ie(r).insertAdjacentElement("afterend",o):a!==s-n-1&&r[0].insertAdjacentElement("beforebegin",o):a!==s-1&&Ie(i).insertAdjacentElement("afterend",o);c.length;){const e=c.pop();e[0].scrollTop=e[1]}}};pc.WAIT_FOR_POPUP_CONTENT_RESIZE=200,g([de("focusService")],pc.prototype,"focusService",2),g([de("ctrlsService")],pc.prototype,"ctrlsService",2),g([de("resizeObserverService")],pc.prototype,"resizeObserverService",2),g([le],pc.prototype,"postConstruct",1),pc=g([he("popupService")],pc);var gc=class extends Cr{constructor(){super('\n        <div class="ag-autocomplete-row" role="presentation">\n            <div class="ag-autocomplete-row-label"></div>\n        </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(C(e)){const s=null==(t=this.value)?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){i=!0,this.hasHighlighting=!0;const t=s+e.length,r=Ct(this.value.slice(0,s)),n=Ct(this.value.slice(s,t)),o=Ct(this.value.slice(t));this.getGui().lastElementChild.innerHTML=`${r}<b>${n}</b>${o}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!=(e=Ct(this.value))?e:"&nbsp;"}},mc=class e extends En{constructor(t){super(e.TEMPLATE),this.params=t,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Xl({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:e=>this.autocompleteEntries[e]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",e=>e.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),s=t===Xs.UP?i-1:i+1;this.checkSetSelectedValue(s)}setSearch(e){this.searchString=e,C(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,s=!1;const r=e.toLocaleLowerCase(),n=t.filter(e=>{const t=e.toLocaleLowerCase().indexOf(r),n=0===t,o=t>=0;return o&&(!i||!s&&n||s===n&&e.length<i.length)&&(i=e,s=n),o});return!i&&n.length&&(i=n[0]),{topMatch:i,allMatches:n}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,s=i.map(e=>{var t;return null!=(t=e.displayValue)?t:e.key});let r,n;if(this.params.useFuzzySearch)r=zs(this.searchString,s,!0).values,n=r.length?r[0]:void 0;else{const e=this.runContainsSearch(this.searchString,s);r=e.allMatches,n=e.topMatch}let o=i.filter(({key:e,displayValue:t})=>r.includes(null!=t?t:e));if(!o.length&&this.selectedValue&&(null==(t=null==(e=this.params)?void 0:e.forceLastSelection)?void 0:t.call(e,this.selectedValue,this.searchString))&&(o=[this.selectedValue]),this.autocompleteEntries=o,this.virtualList.refresh(),!n)return;const a=r.indexOf(n);this.checkSetSelectedValue(a)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((t,i)=>{t.updateSelected(e===i)}))}createRowComponent(e){var t;const i=new gc;return this.getContext().createBean(i),i.setState(null!=(t=e.displayValue)?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),s=e.clientY-t.top+i,r=Math.floor(s/this.virtualList.getRowHeight());this.checkSetSelectedValue(r)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&null!=(e=this.selectedValue)?e:null}};mc.TEMPLATE='<div class="ag-autocomplete-list-popup">\n            <div ref="eList" class="ag-autocomplete-list"></div>\n        <div>',g([Sr("eList")],mc.prototype,"eList",2),g([le],mc.prototype,"init",1);var fc=mc,yc=class e extends Cr{constructor(){super('\n            <div class="ag-autocomplete" role="presentation">\n                <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n            </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(e){const t=v(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(t){this.updateLastPosition(),this.dispatchEvent({type:e.EVENT_VALUE_CHANGED,value:t}),this.validate(t)}updateAutocompleteList(e){var t,i,s,r;const n=null!=(i=null==(t=this.listGenerator)?void 0:t.call(this,e,this.lastPosition))?i:{enabled:!1};if(n.type&&n.type===(null==(s=this.autocompleteListParams)?void 0:s.type)||this.isListOpen&&this.closeList(),this.autocompleteListParams=n,null==(r=this.autocompleteListParams)?void 0:r.enabled){this.isListOpen||this.openList();const{searchString:e}=this.autocompleteListParams;this.autocompleteList.setSearch(null!=e?e:"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case Xs.ENTER:this.onEnterKeyDown(e);break;case Xs.TAB:this.onTabKeyDown(e);break;case Xs.DOWN:case Xs.UP:this.onUpDownKeyDown(e,t);break;case Xs.LEFT:case Xs.RIGHT:case Xs.PAGE_HOME:case Xs.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case Xs.ESCAPE:this.onEscapeKeyDown(e);break;case Xs.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){var t;const i=null==(t=this.autocompleteList)?void 0:t.getSelectedValue();i&&(this.closeList(),this.dispatchEvent({type:e.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:i,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){var i;e.preventDefault(),this.isListOpen?null==(i=this.autocompleteList)||i.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList(null!=(e=this.eAutocompleteInput.getValue())?e:null)}setCaret(e,t){const i=this.gos.getDocument(),s=this.gos.getActiveDomElement();!t||s&&s!==i.body||this.eAutocompleteInput.getFocusableElement().focus();const r=this.eAutocompleteInput.getInputElement();r.setSelectionRange(e,e),e===r.value.length&&(r.scrollLeft=r.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=null!=(e=this.eAutocompleteInput.getInputElement().selectionStart)?e:0}validate(t){var i;this.validator&&(this.validationMessage=this.validator(t),this.eAutocompleteInput.getInputElement().setCustomValidity(null!=(i=this.validationMessage)?i:""),this.valid=!this.validationMessage,this.dispatchEvent({type:e.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new fc({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:e.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return v(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:i,silent:s,updateListOnlyIfOpen:r,restoreFocus:n}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(null!=i?i:this.lastPosition,n),s||this.updateValue(t),r&&!this.isListOpen||this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};yc.EVENT_VALUE_CHANGED="eventValueChanged",yc.EVENT_VALUE_CONFIRMED="eventValueConfirmed",yc.EVENT_OPTION_SELECTED="eventOptionSelected",yc.EVENT_VALID_CHANGED="eventValidChanged",g([de("popupService")],yc.prototype,"popupService",2),g([Sr("eAutocompleteInput")],yc.prototype,"eAutocompleteInput",2),g([le],yc.prototype,"postConstruct",1);var vc=yc,Cc=class e extends Cr{constructor(e,t,i,s){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=i,this.template=s}init(){var t;this.setTemplate(null!=(t=this.template)?t:e.TEMPLATE);const i=this.getGui();this.addElementClasses(i),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(Ys("columnDrag",this.gos)),this.eButton.appendChild(Ys("cancel",this.gos)),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.localeService.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),Kt(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const i=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(i)}}setupTooltip(){const e=()=>{const e=this.getTooltip();this.setTooltip({newTooltipText:e})};e(),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return Bn.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:t}=this,i=this.createGetDragItem(),s=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>s,getDragItem:i,dragItemName:this.getDisplayName()};e.addDragSource(r,!0),this.addDestroyFunc(()=>e.removeDragSource(r))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){os(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const t={type:e.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addManagedListener(this.eButton,"click",e=>{this.dispatchEvent(t),e.stopPropagation()});const i=new yn(this.eButton);this.addManagedListener(i,yn.EVENT_TAP,()=>{this.dispatchEvent(t)}),this.addDestroyFunc(i.destroy.bind(i))}onKeyDown(t){t.key===Xs.DELETE&&this.isRemovable()&&(t.preventDefault(),this.dispatchEvent({type:e.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=Ct(this.getDisplayValue());this.eText.innerHTML=e}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${i}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};Cc.EVENT_COLUMN_REMOVE="columnRemove",Cc.TEMPLATE='<span role="option">\n          <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n          <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n          <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n        </span>',g([de("dragAndDropService")],Cc.prototype,"dragAndDropService",2),g([Sr("eText")],Cc.prototype,"eText",2),g([Sr("eDragHandle")],Cc.prototype,"eDragHandle",2),g([Sr("eButton")],Cc.prototype,"eButton",2),g([le],Cc.prototype,"init",1);var bc=Cc,Sc=class e extends Cr{constructor(t){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=t,this.state=e.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),Ht(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:i}=e;return t.contains(i.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Cs(this.getGui()),Cs(this.ePillDropList)}init(e){this.params=null!=e?e:{},this.createManagedBean(new Dr(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Pr(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),Kt(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const t=!this.horizontal;let i=e.key===Xs.DOWN,s=e.key===Xs.UP;if(!t){const t=this.gos.get("enableRtl");i=!t&&e.key===Xs.RIGHT||t&&e.key===Xs.LEFT,s=!t&&e.key===Xs.LEFT||t&&e.key===Xs.RIGHT}if(!i&&!s)return;const r=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,s);r&&(e.preventDefault(),r.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${i}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.dragAndDropService.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);if(t<0)return!1;const i=this.minimumAllowedNewInsertIndex(),s=Math.max(i,t),r=s!==this.insertIndex;return r&&(this.insertIndex=s),r}getNewInsertIndex(e){const t=e.event,i=this.horizontal?t.clientX:t.clientY,s=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),r=s.findIndex(e=>this.horizontal?e.right>i&&e.left<i:e.top<i&&e.bottom>i);if(-1===r){const e=this.gos.get("enableRtl");return s.every(e=>i>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:s.every(e=>i<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(t){this.state===e.STATE_NOT_DRAGGING&&(this.state=e.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(t.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(t){const i=this.getItems(t.dragSource.getDragItem());this.state=e.STATE_NEW_ITEMS_IN;const s=i.filter(e=>this.isItemDroppable(e,t)),r=s.every(e=>-1!==this.childPillComponents.map(e=>e.getItem()).indexOf(e));0!==s.length&&(this.potentialDndItems=s,r?this.state=e.STATE_NOT_DRAGGING:(this.handleDragEnterEnd(t),this.checkInsertIndex(t),this.refreshGui()))}isPotentialDndItems(){return De(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(t){if(this.state===e.STATE_REARRANGE_ITEMS){const e=this.getItems(t.dragSource.getDragItem());this.removeItems(e)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(t),this.potentialDndItems=[],this.refreshGui()),this.state=e.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let t=!1;this.state===e.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),t=!0):t=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],!this.refreshOnDragStop()&&t||this.refreshGui()}this.state=e.STATE_NOT_DRAGGING}removeItems(e){const t=this.getExistingItems().filter(t=>!He(e,t));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),i=e.filter(e=>t.indexOf(e)<0);Be(t,i,this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e){const t=this.getNonGhostItems().slice();return Be(t,e,this.insertIndex),!Re(t,this.getExistingItems())&&(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,i=this.getFocusedItem();let s=this.focusService.findNextFocusableElement();s||(s=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.isHorizontal()||(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),this.focusService.isKeyboardMode()&&this.restoreFocus(i,s)}getFocusedItem(){const e=this.getGui(),t=this.gos.getActiveDomElement();return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}restoreFocus(e,t){const i=this.getGui(),s=Array.from(i.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===s.length&&t.focus();const r=s[Math.min(s.length-1,e)];r&&r.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(e=>!He(this.potentialDndItems,e)):e}addItemsToGui(){const e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map(e=>this.createItemComponent(e,!0));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,t)=>{const i=e.getGui();ni(i,t+1),ri(i,this.childPillComponents.length)})}createItemComponent(e,t){const i=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return i.addEventListener(bc.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(i),this.guiDestroyFunctions.push(()=>this.destroyBean(i)),t||this.childPillComponents.push(i),i}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const i=document.createElement("div");if(ei(i,!0),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),i.appendChild(t),!this.horizontal){const t=document.createElement("span");this.addElementClasses(t,"title"),t.innerHTML=e,i.appendChild(t)}this.appendChild(i)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=document.createElement("span");t.innerHTML=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=Ys(this.gos.get("enableRtl")?"smallLeft":"smallRight",this.gos);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}};Sc.STATE_NOT_DRAGGING="notDragging",Sc.STATE_NEW_ITEMS_IN="newItemsIn",Sc.STATE_REARRANGE_ITEMS="rearrangeItems",g([de("focusService")],Sc.prototype,"focusService",2),g([de("dragAndDropService")],Sc.prototype,"dragAndDropService",2);var wc=Sc,xc=["touchstart","touchend","touchmove","touchcancel"],Ec=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new dr(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const r=He(xc,t);e.addEventListener(t,i,{capture:!!s,passive:r})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},Mc=class extends rt{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===Xs.UP,s=e===Xs.DOWN,r=e===Xs.LEFT;let n,o;if(i||s)o=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),n=t.column;else{const e=this.columnModel.getAllDisplayedColumns(),i=this.gos.get("enableRtl");o=t.rowIndex,n=r!==i?e[0]:Ie(e)}return{rowIndex:o,rowPinned:null,column:n}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case Xs.UP:i=this.getCellAbove(i);break;case Xs.DOWN:i=this.getCellBelow(i);break;case Xs.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case Xs.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}return!!i&&!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s)||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some(t=>t.getRowNode().rowIndex===e.rowIndex)?[...this.rowRenderer.getStickyTopRowCtrls()].sort((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex):[...this.rowRenderer.getStickyBottomRowCtrls()].sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex);const s=t?-1:1,r=i.findIndex(t=>t.getRowNode().rowIndex===e.rowIndex),n=i[r+s];return n?{rowIndex:n.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return"top"===t?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:"bottom"===t?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s,!0)||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,r=this.columnModel.getDisplayedColAfter(e.column);if(!r){r=t[0];const n=this.getRowBelow(e);if(b(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:r,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,r=this.columnModel.getDisplayedColBefore(e.column);if(!r){r=Ie(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(b(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:r,rowPinned:s}}};g([de("columnModel")],Mc.prototype,"columnModel",2),g([de("rowModel")],Mc.prototype,"rowModel",2),g([de("rowRenderer")],Mc.prototype,"rowRenderer",2),g([de("pinnedRowModel")],Mc.prototype,"pinnedRowModel",2),g([de("paginationProxy")],Mc.prototype,"paginationProxy",2),Mc=g([he("cellNavigationService")],Mc);var Ac=class extends rt{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=null!=(e=this.gos.get("alignedGrids"))?e:[];const i="function"==typeof t;"function"==typeof t&&(t=t());const s=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map(e=>{var t;if(!e)return W("alignedGrids contains an undefined option."),i||W('You may want to configure via a callback to avoid setup race conditions:\n                     "alignedGrids: () => [linkedGrid]"'),void W(s());if(e instanceof zo)return e;const r=e;return"current"in r?null==(t=r.current)?void 0:t.api:(r.api||W(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${s()}`),r.api)}).filter(e=>!!e&&!e.isDestroyed())}init(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{if(t.isDestroyed())return;const i=t.__getAlignedGridService();e(i)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case ct.EVENT_COLUMN_MOVED:case ct.EVENT_COLUMN_VISIBLE:case ct.EVENT_COLUMN_PINNED:case ct.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case ct.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case ct.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const e=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(e)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))})}processColumnEvent(e){var t;const i=e.column;let s=null;if(i&&(s=this.columnModel.getPrimaryColumn(i.getColId())),i&&!s)return;const r=this.getMasterColumns(e);switch(e.type){case ct.EVENT_COLUMN_MOVED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId}));this.columnModel.applyColumnState({state:i,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${t.toIndex}`)}break;case ct.EVENT_COLUMN_VISIBLE:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,hide:e.hide}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${t.visible}`)}break;case ct.EVENT_COLUMN_PINNED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,pinned:e.pinned}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${t.pinned}`)}break;case ct.EVENT_COLUMN_RESIZED:const i=e,s={};r.forEach(t=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${t.getActualWidth()}`),s[t.getId()]={key:t.getColId(),newWidth:t.getActualWidth()}}),null==(t=i.flexColumns)||t.forEach(e=>{s[e.getId()]&&delete s[e.getId()]}),this.columnModel.setColumnWidths(Object.values(s),!1,i.finished,"alignedGridChanged")}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(e=>{e.setGridOption("alwaysShowVerticalScroll",n)})}};g([de("columnModel")],Ac.prototype,"columnModel",2),g([de("ctrlsService")],Ac.prototype,"ctrlsService",2),g([m(0,ge("loggerFactory"))],Ac.prototype,"setBeans",1),g([le],Ac.prototype,"init",1),Ac=g([he("alignedGridsService")],Ac);var Tc=class extends rt{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedListener(this.eventService,ct.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;const{newValue:i,clearSelection:s,suppressFinishActions:r,rangeSelect:n,nodes:o,event:a,source:l="api"}=e;if(0===o.length)return 0;if(o.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const c=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=o.map(e=>e.footer?e.sibling:e);if(n){if(o.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let e=null;if("checkboxSelected"===l&&!1===i&&this.lastRowNode&&(this.lastRowNode.id?e=this.lastRowNode:this.lastRowNode=null),null==e&&(e=this.getLastSelectedNode()),e){const t=h[0];if(t!==e&&this.isMultiselect())return this.selectRange(t,e,i,l)}}this.lastRowNode=i?null:h[0];let d=0;for(let e=0;e<h.length;e++){const s=h[e];c&&s.group||s.selectThisNode(i,a,l)&&d++,this.groupSelectsChildren&&(null==(t=s.childrenAfterGroup)?void 0:t.length)&&(d+=this.selectChildren(s,i,c,l))}if(!r&&(i&&(s||!this.isMultiselect())&&(d+=this.clearOtherNodes(h[0],l)),d>0)){this.updateGroupsFromChildrenSelections(l);const e={type:ct.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(e)}return d}selectRange(e,t,i=!0,s){const r=this.rowModel.getNodesInRangeForSelection(e,t);let n=0;r.forEach(e=>{e.group&&this.groupSelectsChildren||e.selectThisNode(i,void 0,s)&&n++}),this.updateGroupsFromChildrenSelections(s);const o={type:ct.EVENT_SELECTION_CHANGED,source:s};return this.eventService.dispatchEvent(o),n}selectChildren(e,t,i,s){const r=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return b(r)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:r})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());if(0==e.length)return null;return this.selectedNodes.get(Ie(e))||null}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new Gl(!0,i)).setInactive();let s=!1;return t.forEachChangedNodeDepthFirst(t=>{if(t!==i){const i=t.calculateSelectedFromChildren();s=t.selectThisNode(null!==i&&i,void 0,e)||s}}),s}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(r=>{if(r&&r.id!==e.id){const e=this.selectedNodes.get(r.id);s+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&r.parent&&i.set(r.parent.id,r.parent)}}),i.forEach(e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(C(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();if(this.resetNodes(),t){const t={type:ct.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(t)}}resetNodes(){var e;null==(e=this.selectedNodes)||e.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isSelected())t.push(r);else{const t=r;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:r,justCurrentPage:n}=e;if(n||r){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(r,n).forEach(t)}else this.selectedNodes.forEach(e=>{e&&t(e)}),this.reset(s);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s);const o={type:ct.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(o)}getSelectedCounts(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach(e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&s++)}),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(e=>e.selectable).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(e=>{if(e.group){if(!e.expanded){const t=e=>{var s;i.push(e),(null==(s=e.childrenAfterFilter)?void 0:s.length)&&e.childrenAfterFilter.forEach(t)};return void t(e)}this.groupSelectsChildren||i.push(e)}else i.push(e)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(e=>{i.push(e)}),i):(s.forEachNode(e=>{i.push(e)}),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e;this.getNodesToSelect(i,s).forEach(e=>e.selectThisNode(!0,void 0,t)),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const r={type:ct.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(r)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{(null==t?void 0:t.id)&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode(e=>{i.has(e.id)&&s.push(e)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}};g([de("rowModel")],Tc.prototype,"rowModel",2),g([de("paginationProxy")],Tc.prototype,"paginationProxy",2),g([le],Tc.prototype,"init",1),Tc=g([he("selectionService")],Tc);var Dc=class{constructor(e){this.viaApi=(e,...t)=>(z(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...t)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,s){this.viaApi("setColumnWidth",e,t,i,s)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};g([de("gridApi")],Dc.prototype,"api",2),Dc=g([he("columnApi")],Dc);var Ic=class extends rt{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener(ct.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener(ct.EVENT_CELL_VALUE_CHANGED,e,t)),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const r=e.getColDef(),n=r.field,o=e.getColId(),a=t.data;let l;const c=t.groupData&&void 0!==t.groupData[o],h=!s&&t.aggData&&void 0!==t.aggData[o],d=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&r.filterValueGetter?l=this.executeFilterValueGetter(r.filterValueGetter,a,e,t):this.isTreeData&&h?l=t.aggData[o]:this.isTreeData&&r.valueGetter?l=this.executeValueGetter(r.valueGetter,a,e,t):this.isTreeData&&n&&a?l=F(a,n,e.isFieldContainsDots()):c?l=t.groupData[o]:h?l=t.aggData[o]:r.valueGetter?l=this.executeValueGetter(r.valueGetter,a,e,t):u?l=F(a,t.field,e.isFieldContainsDots()):n&&a&&!d&&(l=F(a,n,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof l&&0===l.indexOf("=")){const i=l.substring(1);l=this.executeValueGetter(i,a,e,t)}if(null==l){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return l}parseValue(e,t,i,s){const r=e.getColDef(),n=this.gos.addGridCommonParams({node:t,data:null==t?void 0:t.data,oldValue:s,newValue:i,colDef:r,column:e}),o=r.valueParser;return C(o)?"function"==typeof o?o(n):this.expressionService.evaluate(o,n):i}formatValue(e,t,i,s,r=!0){let n,o=null;const a=e.getColDef();if(s?n=s:r&&(n=a.valueFormatter),n){const s=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});o="function"==typeof n?n(s):this.expressionService.evaluate(n,s)}else if(a.refData)return a.refData[i]||"";return null==o&&Array.isArray(i)&&(o=i.join(", ")),o}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let s=e.parent;for(;null!=s;){if(s.rowGroupColumn&&(!0===i||i===s.rowGroupColumn.getColId()))return s.key;s=s.parent}}setValue(e,t,i,s){const r=this.columnModel.getPrimaryColumn(t);if(!e||!r)return!1;b(e.data)&&(e.data={});const{field:n,valueSetter:o}=r.getColDef();if(b(n)&&b(o))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(r,i))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const a=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(r,e),newValue:i,colDef:r.getColDef(),column:r});let l;if(a.newValue=i,l=C(o)?"function"==typeof o?o(a):this.expressionService.evaluate(o,a):this.setValueUsingField(e.data,n,i,r.isFieldContainsDots()),void 0===l&&(l=!0),!l)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(r,e);const c={type:ct.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:e.data,node:e,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:s};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let r=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(r=n[e]===i,r||(n[e]=i)):n=n[e]}}else r=e[t]===i,r||(e[t]=i);return!r}executeFilterValueGetter(e,t,i,s){const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return"function"==typeof e?e(r):this.expressionService.evaluate(e,r)}executeValueGetter(e,t,i,s){const r=i.getColId(),n=this.valueCache.getValue(s,r);if(void 0!==n)return n;const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let a;return a="function"==typeof e?e(o):this.expressionService.evaluate(e,o),this.valueCache.setValue(s,r,a),a}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let r=i;return s&&(r=s(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof r||null==r||(r=String(r),"[object Object]"===r&&z("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),r}};g([de("expressionService")],Ic.prototype,"expressionService",2),g([de("columnModel")],Ic.prototype,"columnModel",2),g([de("valueCache")],Ic.prototype,"valueCache",2),g([de("dataTypeService")],Ic.prototype,"dataTypeService",2),g([le],Ic.prototype,"init",1),Ic=g([he("valueService")],Ic);var Rc=class extends rt{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};g([m(0,ge("loggerFactory"))],Rc.prototype,"setBeans",1),Rc=g([he("expressionService")],Rc);var Pc=class extends rt{setBeans(e){this.logging=e.get("debug")}create(e){return new kc(e,this.isLogging.bind(this))}isLogging(){return this.logging}};g([m(0,ge("gridOptionsService"))],Pc.prototype,"setBeans",1),Pc=g([he("loggerFactory")],Pc);var kc=class{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}},Lc=class extends rt{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>Bn.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new Zo(this.view)),this.addRtlSupport();const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>s()),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null==(e=null==t?void 0:t.getAttribute("row-id"))?void 0:e.startsWith("detail"))||!1}showDropZones(){return ne.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return ne.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return ne.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return ne.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const e={type:ct.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.view.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex(e=>e.contains(i))+(e?-1:1);return!(s<=0||s>=t.length)&&this.focusService.focusInto(t[s])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(Ie(t),!0);const e=Ie(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}};g([de("focusService")],Lc.prototype,"focusService",2),g([de("resizeObserverService")],Lc.prototype,"resizeObserverService",2),g([de("columnModel")],Lc.prototype,"columnModel",2),g([de("ctrlsService")],Lc.prototype,"ctrlsService",2),g([de("mouseEventService")],Lc.prototype,"mouseEventService",2),g([de("dragAndDropService")],Lc.prototype,"dragAndDropService",2);var Nc=class extends El{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}};this.ctrl=this.createManagedBean(new Lc);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.ctrl.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n                ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n                <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n                    <ag-grid-body ref="gridBody"></ag-grid-body>\n                    ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n                </div>\n                ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n                <ag-pagination></ag-pagination>\n                ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n            </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(e=>ws(e))}};g([de("loggerFactory")],Nc.prototype,"loggerFactory",2),g([Sr("gridBody")],Nc.prototype,"gridBodyComp",2),g([Sr("sideBar")],Nc.prototype,"sideBarComp",2),g([Sr("rootWrapperBody")],Nc.prototype,"eRootWrapperBody",2),g([le],Nc.prototype,"postConstruct",1);var _c=class extends rt{progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let r=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(e),i=null==t?void 0:t.filter(e=>e.isSortable());i&&(r=[e,...i])}r.forEach(e=>e.setSort(t,s));const n=[];if(!i&&!this.gos.get("alwaysMultiSort")||this.gos.get("suppressMultiSort")){const e=this.clearSortBarTheseColumns(r,s);n.push(...e)}this.updateSortIndex(e),n.push(...r),this.dispatchSortChangedEvents(s,n)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),s=t&&i||e,r=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(e=>e.setSortIndex(null));const n=r.filter(e=>!(t&&e.getColDef().showRowGroup||e===s));(s.getSort()?[...n,s]:n).forEach((e,t)=>{e.setSortIndex(t)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:ct.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):_c.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,r=i==t.length-1;let n;return n=s||r?t[0]:t[i+1],_c.DEFAULT_SORTING_ORDER.indexOf(n)<0?(console.warn("AG Grid: invalid sort type "+n),null):n}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter(e=>{const i=!!e.getAggFunc(),s=!e.isPrimary(),r=t?this.columnModel.getGroupDisplayColumnForGroup(e.getId()):e.getColDef().showRowGroup;return i||s||r})}const t=this.columnModel.getRowGroupColumns().filter(e=>!!e.getSort()),i={};e.forEach((e,t)=>i[e.getId()]=t),e.sort((e,t)=>{const s=e.getSortIndex(),r=t.getSortIndex();return null!=s&&null!=r?s-r:null==s&&null==r?i[e.getId()]>i[t.getId()]?1:-1:null==r?-1:1});const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map(e=>{var t;return null!=(t=this.columnModel.getGroupDisplayColumnForGroup(e.getId()))?t:e}))]);const r=new Map;return e.forEach((e,t)=>r.set(e,t)),s&&t.forEach(e=>{const t=this.columnModel.getGroupDisplayColumnForGroup(e.getId());r.set(e,r.get(t))}),r}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(null==t?void 0:t.length))return e.getSort();const i=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,s=i[0].getSort();return i.every(e=>e.getSort()==s)?s:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};_c.DEFAULT_SORTING_ORDER=["asc","desc",null],g([de("columnModel")],_c.prototype,"columnModel",2),_c=g([he("sortController")],_c);var Oc=class extends rt{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",Oc.toggleKeyboardMode),e.addEventListener("mousedown",Oc.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",Oc.toggleKeyboardMode),e.addEventListener("mousedown",Oc.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=Oc.keyboardModeActive,i="keydown"===e.type;i&&(e.ctrlKey||e.metaKey||e.altKey)||t!==i&&(Oc.keyboardModeActive=i)}static unregisterGridCompController(e){Oc.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}registerKeyboardFocusEvents(){const e=this.gos.getDocument();Oc.addKeyboardModeEvents(e),Oc.instanceCount++,this.addDestroyFunc(()=>{Oc.instanceCount--,Oc.unregisterGridCompController(e)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return Oc.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),va.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),el.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return r&&(s.isFullWidthCell=r.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=d({type:ct.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:n=!1}=e,o=this.columnModel.getGridColumn(t);if(!o)return void(this.focusedCellPosition=null);this.focusedCellPosition=o?{rowIndex:i,rowPinned:v(s),column:o}:null;const a=u(d({type:ct.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:r,preventScrollOnBrowserFocus:n,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:r,headerRowIndex:n}=this.focusedHeaderPosition;return t===r&&i===n&&s==r.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:s,event:r,fromCell:n,rowWithoutSpanValue:o}=e;let{headerPosition:a}=e;if(n&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(s){const e=this.getFocusedHeader(),s=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:a,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");t&&r&&(a=t({key:r.key,previousHeaderPosition:e,nextHeaderPosition:a,headerRowCount:s,event:r}))}}return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:t,event:r,fromCell:n,rowWithoutSpanValue:o})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:s,event:r}=e,n=this.getFocusedHeader(),o=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:i,headerRowCount:o});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:s,event:r})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:s,headerPosition:r,headerRowCount:n}=e,o=t({backwards:"Before"===i,previousHeaderPosition:s,nextHeaderPosition:r,headerRowCount:n});return!0===o||null===o?(null===o&&z("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),s):!1===o?null:o}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:s,rowWithoutSpanValue:r,event:n}=e;if(-1===t.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(t.column);this.headerNavigationService.scrollToColumn(t.column,i);const o=this.ctrlsService.getHeaderRowContainerCtrl(t.column.getPinned()).focusHeader(t.headerRowIndex,t.column,n);return o&&(null!=r||s)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(null!=r?r:-1),o}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=Ie(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===v(t)}findFocusableElements(e,t,i=!1){const s=ss;let r=rs;t&&(r+=", "+t),i&&(r+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(s)).filter(e=>ws(e)),o=Array.prototype.slice.apply(e.querySelectorAll(r));return o.length?(a=o,n.filter(e=>-1===a.indexOf(e))):n;var a}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),r=t?Ie(s):s[0];return!!r&&(r.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let r=-1;for(let e=s-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){r=e;break}return r<=0?null:i[r-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),r=this.gos.getActiveDomElement();let n;n=t?s.findIndex(e=>e.contains(r)):s.indexOf(r);const o=n+(i?-1:1);return o<0||o>=s.length?null:s[o]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${Dr.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===Ni(e)&&++i<=t;)e=e.parentElement;return null===Ni(e)?null:e}focusGridView(e,t){var i;if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:r,rowPinned:n}=s,o=this.getFocusedHeader();return!e&&o&&(e=o.column),!(null==r||!e||(this.navigationService.ensureCellVisible({rowIndex:r,column:e,rowPinned:n}),this.setFocusedCell({rowIndex:r,column:e,rowPinned:v(n),forceBrowserFocus:!0}),null==(i=this.rangeService)||i.setRangeToCell({rowIndex:r,rowPinned:n,column:e}),0))}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){var t,i;return this.advancedFilterFocusColumn=null==e?void 0:e.column,null!=(i=null==(t=this.advancedFilterService)?void 0:t.getCtrl().focusHeaderComp())&&i}focusNextFromAdvancedFilter(e,t){var i,s;const r=null!=(s=t?void 0:this.advancedFilterFocusColumn)?s:null==(i=this.columnModel.getAllDisplayedColumns())?void 0:i[0];return e?this.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(r)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};Oc.keyboardModeActive=!1,Oc.instanceCount=0,g([de("eGridDiv")],Oc.prototype,"eGridDiv",2),g([de("columnModel")],Oc.prototype,"columnModel",2),g([de("headerNavigationService")],Oc.prototype,"headerNavigationService",2),g([de("headerPositionUtils")],Oc.prototype,"headerPositionUtils",2),g([de("rowRenderer")],Oc.prototype,"rowRenderer",2),g([de("rowPositionUtils")],Oc.prototype,"rowPositionUtils",2),g([de("cellPositionUtils")],Oc.prototype,"cellPositionUtils",2),g([de("navigationService")],Oc.prototype,"navigationService",2),g([de("ctrlsService")],Oc.prototype,"ctrlsService",2),g([de("filterManager")],Oc.prototype,"filterManager",2),g([ue("rangeService")],Oc.prototype,"rangeService",2),g([ue("advancedFilterService")],Oc.prototype,"advancedFilterService",2),g([le],Oc.prototype,"init",1),Oc=g([he("focusService")],Oc);var Fc=class extends rt{setMouseOver(e){this.selectedColumns=e;const t={type:ct.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:ct.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};Fc=g([he("columnHoverService")],Fc);var Gc=class extends rt{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{e(),t(this.executeLaterFuncs)},200)})}};g([de("ctrlsService")],Gc.prototype,"ctrlsService",2),g([le],Gc.prototype,"postConstruct",1),Gc=g([he("columnAnimationService")],Gc);var Bc=class extends rt{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=this.gos.getRowHeightAsNumber(),i=Math.floor(e/t);this.paginationProxy.setPageSize(i,"autoCalculated")};this.isBodyRendered?Q(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};g([de("ctrlsService")],Bc.prototype,"ctrlsService",2),g([de("paginationProxy")],Bc.prototype,"paginationProxy",2),g([le],Bc.prototype,"postConstruct",1),Bc=g([he("paginationAutoPageSizeService")],Bc);var Vc=class extends rt{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};g([le],Vc.prototype,"init",1),Vc=g([he("valueCache")],Vc);var Hc=class extends rt{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,ct.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),r=new Gl(s,this.clientSideRowModel.getRootNode());r.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(r),r.forEachChangedNodeDepthFirst(e=>{i.push(e)})}this.rowRenderer.refreshCells({rowNodes:i})}};g([de("rowModel")],Hc.prototype,"rowModel",2),g([de("rowRenderer")],Hc.prototype,"rowRenderer",2),g([le],Hc.prototype,"init",1),Hc=g([he("changeDetectionService")],Hc);var Uc=class extends rt{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(e){return!1}getGui(){return this.eGui}init(t){const i=e(t),s=typeof i;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=i?i:xs("<span></span>"):xs("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&e.prototype&&"getGui"in e.prototype}};g([de("componentMetadataProvider")],Uc.prototype,"componentMetadataProvider",2),Uc=g([he("agComponentUtils")],Uc);var zc=class extends rt{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}};g([de("agComponentUtils")],zc.prototype,"agComponentUtils",2),g([le],zc.prototype,"postConstruct",1),zc=g([he("componentMetadataProvider")],zc);var Wc={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:260}},jc={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},Kc=class extends rt{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var e;const t=null!=(e=this.getTheme().el)?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:ct.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||0!==t.indexOf("ag-theme"))return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const s=this.calculatedSizes[t][e];return null!=s?s:(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const s="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),r=Wc[s][e],n=this.gos.getDocument();if(i||(i=this.eGridDiv),!jc[e])return r;const o=jc[e],a=n.createElement("div"),l=Array.from(i.classList);a.classList.add(t,...l),a.style.position="absolute";const c=o.reduce((e,t)=>{const i=n.createElement("div");return i.style.position="static",i.classList.add(t),e.appendChild(i),i},a);let h=0;if(n.body){n.body.appendChild(a);const t=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(c)[t],10),n.body.removeChild(a)}return h||r}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,s=[];for(;t;){if(i=e.exec(t.className),i){const i=t.className.match(e);i&&(s=i);break}t=t.parentElement||void 0}if(!i)return{allThemes:s};const r=i[0];return this.calculatedTheme={theme:r,el:t,themeFamily:r.replace(/-dark$/,""),allThemes:s},this.calculatedTheme}getFromTheme(e,t){var i;return null!=(i=this.getSassVariable(t))?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return C(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};g([de("eGridDiv")],Kc.prototype,"eGridDiv",2),g([le],Kc.prototype,"postConstruct",1),Kc=g([he("environment")],Kc);var $c=class extends rt{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=_i(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:ct.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}};g([de("ctrlsService")],$c.prototype,"ctrlsService",2),g([m(0,ge("loggerFactory"))],$c.prototype,"agWire",1),g([le],$c.prototype,"postConstruct",1),$c=g([he("rowContainerHeightService")],$c);var Yc=class extends rt{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),r="clientSide"===this.rowModel.getType()&&s,n=[],o=t=>{if(e&&!t.group)return;if(r&&t.group){const e=t.childrenAfterGroup.some(e=>!0===e.selectable);return void t.setRowSelectable(e,!0)}const s=!i||i(t);t.setRowSelectable(s,!0),!s&&t.isSelected()&&n.push(t)};if(r){const e=this.rowModel;new Gl(!1,e.getRootNode()).forEachChangedNodeDepthFirst(o,!0,!0)}else this.rowModel.forEachNode(o);n.length&&this.selectionService.setNodesSelected({nodes:n,newValue:!1,source:"selectableChanged"}),r&&this.selectionService instanceof Tc&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};g([de("rowModel")],Yc.prototype,"rowModel",2),g([de("selectionService")],Yc.prototype,"selectionService",2),g([le],Yc.prototype,"init",1),Yc=g([he("selectableService")],Yc);var qc=class extends Cr{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:s,btLast:r,pageSizeComp:n}=this;this.activateTabIndex([t,i,s,r]),t.insertAdjacentElement("afterbegin",Ys(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",Ys(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",Ys(e?"previous":"next",this.gos)),r.insertAdjacentElement("afterbegin",Ys(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.onPaginationChanged()}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",e=>{e.key!==Xs.ENTER&&e.key!==Xs.SPACE||(e.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc();return Yi(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),r=e("firstPage","First Page"),n=e("previousPage","Previous Page"),o=e("nextPage","Next Page"),a=e("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">\n                <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>\n                <span class="ag-paging-row-summary-panel" role="status">\n                    <span id="ag-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-to">${i}</span>\n                    <span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-of">${s}</span>\n                    <span id="ag-${l}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n                </span>\n                <span class="ag-paging-page-summary-panel" role="presentation">\n                    <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n                    <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n                    <span class="ag-paging-description" role="status">\n                        <span id="ag-${l}-start-page">${t}</span>\n                        <span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n                        <span id="ag-${l}-of-page">${s}</span>\n                        <span id="ag-${l}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n                    </span>\n                    <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n                    <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>\n                </span>\n            </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),r=e===i-1;this.nextButtonDisabled=r||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Jt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let r,n;if(this.isZeroPagesToDisplay()?r=n=0:(r=t*e+1,n=r+t-1,i&&n>s&&(n=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(r),this.rowNodeBlockLoader.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(n)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const e=this.paginationProxy.getRow(0);if(e&&e.group&&!e.groupData&&!e.aggData)return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}};g([de("paginationProxy")],qc.prototype,"paginationProxy",2),g([de("rowNodeBlockLoader")],qc.prototype,"rowNodeBlockLoader",2),g([Sr("btFirst")],qc.prototype,"btFirst",2),g([Sr("btPrevious")],qc.prototype,"btPrevious",2),g([Sr("btNext")],qc.prototype,"btNext",2),g([Sr("btLast")],qc.prototype,"btLast",2),g([Sr("lbRecordCount")],qc.prototype,"lbRecordCount",2),g([Sr("lbFirstRowOnPage")],qc.prototype,"lbFirstRowOnPage",2),g([Sr("lbLastRowOnPage")],qc.prototype,"lbLastRowOnPage",2),g([Sr("lbCurrent")],qc.prototype,"lbCurrent",2),g([Sr("lbTotal")],qc.prototype,"lbTotal",2),g([Sr("pageSizeComp")],qc.prototype,"pageSizeComp",2),g([le],qc.prototype,"postConstruct",1);var Xc=class e extends Cr{constructor(){super(e.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new Zo(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(e=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(e.getGui()),this.activeOverlay=e,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),null==(e=this.updateListenerDestroyFunc)||e.call(this),Cs(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};Xc.TEMPLATE='\n        <div class="ag-overlay" role="presentation">\n            <div class="ag-overlay-panel" role="presentation">\n                <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>\n            </div>\n        </div>',g([de("overlayService")],Xc.prototype,"overlayService",2),g([Sr("eOverlayWrapper")],Xc.prototype,"eOverlayWrapper",2),g([le],Xc.prototype,"postConstruct",1);var Zc=Xc,Qc=class extends rt{getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(C(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}};g([de("rowModel")],Qc.prototype,"rowModel",2),g([de("pinnedRowModel")],Qc.prototype,"pinnedRowModel",2),g([de("paginationProxy")],Qc.prototype,"paginationProxy",2),Qc=g([he("rowPositionUtils")],Qc);var Jc=class extends rt{createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${null==i?"null":i}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,r=e.rowIndex===t.rowIndex;return i&&s&&r}};Jc=g([he("cellPositionUtils")],Jc);var eh=class{constructor(e){this.cellValueChanges=e}},th=class extends eh{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},ih=class e{constructor(t){this.actionStack=[],this.maxStackSize=t||e.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};ih.DEFAULT_STACK_SIZE=10;var sh=ih,rh=class extends rt{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:o,oldValue:a,value:l}=e,c={rowPinned:r,rowIndex:n,columnId:o.getColId(),newValue:l,oldValue:a};this.cellValueChanges.push(c)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new sh(e),this.redoStack=new sh(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,ct.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:ct.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:ct.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:ct.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:ct.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,r){if(!e)return!1;const n=e.pop();return!(!n||!n.cellValueChanges||(this.processAction(n,e=>e[s],r),n instanceof th?this.processRange(this.rangeService,n.ranges||[n[i]]):this.processCell(n.cellValueChanges),t.push(n),0))}processAction(e,t,i){e.cellValueChanges.forEach(e=>{const{rowIndex:s,rowPinned:r,columnId:n}=e,o={rowIndex:s,rowPinned:r},a=this.rowPositionUtils.getRowNode(o);a.displayed&&a.setDataValue(n,t(e),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,r)=>{if(!s)return;const n=s.startRow,o=s.endRow;r===t.length-1&&(i={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,r={rowIndex:i,rowPinned:s},n=this.rowPositionUtils.getRowNode(r),o={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(o,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:r}=e,n=this.gridBodyCtrl.getScrollFeature(),o=this.columnModel.getGridColumn(s);if(!o)return;n.ensureIndexVisible(i),n.ensureColumnVisible(o);const a={rowIndex:i,column:o,rowPinned:r};this.focusService.setFocusedCell(u(d({},a),{forceBrowserFocus:!0})),null==t||t.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,ct.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,ct.EVENT_ROW_EDITING_STOPPED,()=>{const e=new eh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,ct.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,ct.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new eh(this.cellValueChanges);this.pushActionsToUndoStack(e)}})}addPasteListeners(){this.addManagedListener(this.eventService,ct.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,ct.EVENT_PASTE_END,()=>{const e=new eh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,ct.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,ct.EVENT_FILL_END,e=>{const t=new th(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new th(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new eh(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};g([de("focusService")],rh.prototype,"focusService",2),g([de("ctrlsService")],rh.prototype,"ctrlsService",2),g([de("cellPositionUtils")],rh.prototype,"cellPositionUtils",2),g([de("rowPositionUtils")],rh.prototype,"rowPositionUtils",2),g([de("columnModel")],rh.prototype,"columnModel",2),g([ue("rangeService")],rh.prototype,"rangeService",2),g([le],rh.prototype,"init",1),rh=g([he("undoRedoService")],rh);var nh=class extends rt{findHeader(e,t){let i,s;if(e.column instanceof lt?i=this.columnModel.getDisplayedGroupAtDirection(e.column,t):(s=`getDisplayedCol${t}`,i=this.columnModel[s](e.column)),!i)return;let{headerRowIndex:r}=e;if("filter"!==this.getHeaderRowType(r)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-r]}const{column:n,headerRowIndex:o}=this.getHeaderIndexToFocus(i,r);return{column:n,headerRowIndex:o}}getHeaderIndexToFocus(e,t){let i;if(e instanceof lt&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let r=i;for(;r!==s;)t++,r=r.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some(e=>e.isSpanHeaderHeight())}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s="column"===i;let r="filter"===i?e:e.getParent(),n=t-1,o=n;if(s&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;o=n,n<0&&(r=e,n=t,o=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:o}}getColumnVisibleChild(e,t,i="After"){let s=e,r=t+1,n=r;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),n="After"===i?t[0]:Ie(t),o=[];let a=n;for(;a.getParent()!==e;)a=a.getParent(),o.push(a);if(s=n,n.isSpanHeaderHeight())for(let e=o.length-1;e>=0;e--){const t=o[e];if(!t.isPadding()){s=t;break}r++}else s=Ie(o),s||(s=n)}return{column:s,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i["start"===t?0:i.length-1];if(!s)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);return"group"==r?{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(s,e)}:{headerRowIndex:null==r?-1:e,column:s}}};g([de("columnModel")],nh.prototype,"columnModel",2),g([de("ctrlsService")],nh.prototype,"ctrlsService",2),nh=g([he("headerPositionUtils")],nh);var oh=class{buildColumnDefs(e,t,i){const s=[],r={};return e.forEach(e=>{let n=!0,o=this.createDefFromColumn(e,t,i),a=e.getOriginalParent(),l=null;for(;a;){let e=null;if(a.isPadding()){a=a.getOriginalParent();continue}const t=r[a.getGroupId()];if(t){t.children.push(o),n=!1;break}if(e=this.createDefFromGroup(a),e&&(e.children=[o],r[e.groupId]=e,o=e,a=a.getOriginalParent()),null!=a&&l===a){n=!1;break}l=a}n&&s.push(o)}),s}createDefFromGroup(e){const t=N(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=N(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}};oh=g([he("columnDefFactory")],oh);var ah=class{getInitialRowClasses(e){const t=[];return C(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),ze(t,this.processClassesFromGridOptions(e.rowNode)),ze(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach(e=>t.push(e))},s=this.gos.get("rowClass");if(s){if("function"==typeof s)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(s)}const r=this.gos.getCallback("getRowClass");return r&&i(r({data:e.data,node:e,rowIndex:e.rowIndex})),t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,e=>{t.push(e)},e=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};g([de("stylingService")],ah.prototype,"stylingService",2),g([de("gridOptionsService")],ah.prototype,"gos",2),ah=g([he("rowCssClassCalculator")],ah);var lh=class extends rt{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=e.map((e,t)=>({currentPos:t,rowNode:e}));return i.sort(this.compareRowNodes.bind(this,t)),i.map(e=>e.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,r=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],n="desc"===i.sort,o=this.getValue(s,i.column),a=this.getValue(r,i.column);let l;const c=this.getComparator(i,s);if(l=c?c(o,a,s,r,n):lr.defaultComparator(o,a,this.isAccentedSort),!isNaN(l)&&0!==l)return"asc"===i.sort?l:-1*l}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const r=!t.group&&i.getColDef().field;if(!r)return;const n=this.columnModel.getPrimaryColumn(r);return n?n.getColDef().comparator:void 0}getValue(e,t){var i,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const s=null==(i=e.allLeafChildren)?void 0:i[0];return s?this.valueService.getValue(t,s,!1,!1):void 0}const r=this.columnModel.getGroupDisplayColumnForGroup(t.getId());if(!r)return;return null==(s=e.groupData)?void 0:s[r.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};g([de("valueService")],lh.prototype,"valueService",2),g([de("columnModel")],lh.prototype,"columnModel",2),g([le],lh.prototype,"init",1),lh=g([he("rowNodeSorter")],lh);var ch=class extends rt{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.params.leftHeader=e;break;case"right":this.params.rightHeader=e;break;default:this.params.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};ch.NAME="ctrlsService",ch=g([he(ch.NAME)],ch);var hh=class extends rt{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};hh=g([he("ctrlsFactory")],hh);var dh=class extends Cr{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Pi()||ki())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=Vi(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui();["mouseenter","mousedown","touchstart"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),["mouseleave","touchend"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();ee(()=>ws(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}};g([Sr("eViewport")],dh.prototype,"eViewport",2),g([Sr("eContainer")],dh.prototype,"eContainer",2),g([de("scrollVisibleService")],dh.prototype,"scrollVisibleService",2),g([de("ctrlsService")],dh.prototype,"ctrlsService",2),g([de("animationFrameService")],dh.prototype,"animationFrameService",2);var uh=class e extends dh{constructor(){super(e.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Ma(e=>this.eContainer.style.width=`${e}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gos.getScrollbarWidth();i&&(t+=s),Ps(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let r=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(r+=s),Ps(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.gos.getScrollbarWidth()||0,r=i?0:0===s&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ls(this.getGui(),r),Ls(this.eViewport,r),Ls(this.eContainer,r),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return ys(this.getViewport(),this.enableRtl)}setScrollPosition(e){ws(this.getViewport())||this.attemptSettingScrollPosition(e),vs(this.getViewport(),e,this.enableRtl)}};uh.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n            <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n            <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n                <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n            </div>\n            <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n        </div>',g([Sr("eLeftSpacer")],uh.prototype,"eLeftSpacer",2),g([Sr("eRightSpacer")],uh.prototype,"eRightSpacer",2),g([de("columnModel")],uh.prototype,"columnModel",2),g([de("pinnedRowModel")],uh.prototype,"pinnedRowModel",2),g([le],uh.prototype,"postConstruct",1);var ph=uh,gh=class extends rt{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:ct.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};g([de("columnModel")],gh.prototype,"columnModel",2),g([le],gh.prototype,"postConstruct",1),gh=g([he("pinnedWidthService")],gh);var mh=class extends rt{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(e=>this.eventService.dispatchEvent(e)),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}};g([de("animationFrameService")],mh.prototype,"animationFrameService",2),g([de("rowModel")],mh.prototype,"rowModel",2),g([le],mh.prototype,"postConstruct",1),mh=g([he("rowNodeEventThrottle")],mh);var fh=(e,t)=>{var i;return"clientSide"===(null!=(i=t.rowModelType)?i:"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null},yh={enableRowGroup:fh,rowGroup:fh,rowGroupIndex:fh,enablePivot:fh,enableValue:fh,pivot:fh,pivotIndex:fh,aggFunc:fh,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var t;const i=["columnsMenuTab","generalMenuTab"];return(null==(t=e.menuTabs)?void 0:t.some(e=>i.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>vh},vh={objectName:"colDef",allProperties:Object.keys({headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},validations:yh},Ch={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},bh={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{var t;const i=null!=(t=e.rowModelType)?t:"clientSide";switch(i){case"clientSide":const t=`treeData requires 'getDataPath' in the ${i} row model.`;return e.getDataPath?null:t;case"serverSide":const s=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:s}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{var t;switch(null!=(t=e.rowModelType)?t:"clientSide"){case"clientSide":return null;case"serverSide":const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t:null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},suppressParentsInRowNodes:{dependencies:{groupSelectsChildren:[void 0,!1]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>vh,defaultColDef:()=>vh,defaultColGroupDef:()=>vh,autoGroupColumnDef:()=>vh},Sh={objectName:"gridOptions",allProperties:[...kt.ALL_PROPERTIES,...Nt.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:{enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using  `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},validations:bh},wh=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new fe,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const s=ht.has(t);if(s&&!e||!s&&e)return;const r=Nt.getCallbackForEvent(t),n=this.gridOptions[r];"function"==typeof n&&this.frameworkOverrides.wrapOutgoing(()=>{n(i)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new Dc(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return null!=(t=this.gridOptions[e])?t:Ch[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return C(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>{const i=t;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,e(i)}:e}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}static toConstrainedNum(e,t){return i=>{const s=wh.toNumber(i);if(!(null==s||s<e||s>t))return s}}static getCoercedValue(e,t){const i=wh.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([e,i])=>{const s=wh.getCoercedValue(e,i);t[e]=s}),t}updateGridOptions({options:e,force:t,source:i="api"}){const s={id:wh.changeSetId++,properties:[]},r=[];Object.entries(e).forEach(([e,n])=>{"api"===i&&Rt[e]&&z(`${e} is an initial property and cannot be updated.`);const o=wh.getCoercedValue(e,n),a=t||"object"==typeof o&&"api"===i,l=this.gridOptions[e];if(a||l!==o){this.gridOptions[e]=o;const t={type:e,currentValue:o,previousValue:l,changeSet:s,source:i};r.push(t)}}),this.validationService.processGridOptions(this.gridOptions),s.properties=r.map(e=>e.type),r.forEach(e=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${e.type} from `,e.previousValue," to  ",e.currentValue),this.propertyEventService.dispatchEvent(e)})}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Gi();null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:ct.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&b(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!=(t=this.gridOptions.domLayout)?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const s={node:e,data:e.data},r=this.getCallback("getRowHeight")(s);if(this.isNumeric(r))return 0===r&&z("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,r),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||b(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let r=e[s];b(r)&&(r={},e[s]=r),r[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&C(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&C(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return C(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!(null==e?void 0:e.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;return e||(this.gridOptions.groupIncludeTotalFooter?"bottom":void 0)}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};wh.PROPERTY_COERCIONS=new Map([...kt.BOOLEAN_PROPERTIES.map(e=>[e,wh.toBoolean]),...kt.NUMBER_PROPERTIES.map(e=>[e,wh.toNumber]),["groupAggFiltering",e=>"function"==typeof e?e:wh.toBoolean(e)],["pageSize",wh.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",wh.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",wh.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",wh.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",wh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",wh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",wh.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",wh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",wh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",wh.toConstrainedNum(0,Number.MAX_VALUE)]]),wh.changeSetId=0,g([de("gridOptions")],wh.prototype,"gridOptions",2),g([de("eventService")],wh.prototype,"eventService",2),g([de("environment")],wh.prototype,"environment",2),g([de("frameworkOverrides")],wh.prototype,"frameworkOverrides",2),g([de("eGridDiv")],wh.prototype,"eGridDiv",2),g([de("validationService")],wh.prototype,"validationService",2),g([de("gridApi")],wh.prototype,"api",2),g([le],wh.prototype,"init",1),g([ce],wh.prototype,"destroy",1),wh=g([he("gridOptionsService")],wh);var xh=class extends rt{getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,s)=>e({key:t,defaultValue:i,variableValues:s});const t=this.gos.get("localeText");return(e,i,s)=>{let r=t&&t[e];if(r&&s&&s.length){let e=0;for(;!(e>=s.length)&&-1!==r.indexOf("${variable}");)r=r.replace("${variable}",s[e++])}return null!=r?r:i}}};xh=g([he("localeService")],xh);var Eh=class e extends dh{constructor(){super(e.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new xa(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ps(this.getGui(),s),Ps(this.eViewport,s),Ps(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),s=t.scrollTop;i!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||ws(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};Eh.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n            <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n                <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n            </div>\n        </div>',g([le],Eh.prototype,"postConstruct",1);var Mh=Eh,Ah={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Th=["january","february","march","april","may","june","july","august","september","october","november","december"],Dh=class extends rt{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Tt(e.source))})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([e,t])=>{this.dataTypeDefinitions[e]=u(d({},t),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(t)})});const i=null!=(e=this.gos.get("dataTypeDefinitions"))?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([e,s])=>{const r=this.processDataTypeDefinition(s,i,[e],t);r&&(this.dataTypeDefinitions[e]=r,s.dataTypeMatcher&&(this.dataTypeMatchers[e]=s.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(e=>{const i=this.dataTypeMatchers[e];i&&delete this.dataTypeMatchers[e],this.dataTypeMatchers[e]=null!=i?i:t[e].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=d(d({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let r;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=s[n];const o=t[n];if(i&&o&&(i=o),!this.validateDataTypeDefinition(e,i,n))return;r=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(n))return void z('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const o=t[n];if(!this.validateDataTypeDefinition(e,o,n))return;const a=this.processDataTypeDefinition(o,t,[...i,n],s);if(!a)return;r=this.mergeDataTypeDefinitions(a,e)}return u(d({},r),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(r)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(z('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(z(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if(null==(i=t.node)?void 0:i.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(u(d({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(u(d({},t),{value:t.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||(null==(s=e.dataTypeMatcher)?void 0:s.call(e,t.value)))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:s}=t;const{field:r}=t;if(void 0===s&&(s=e.cellDataType),null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(r,i)),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,i),n.columnTypes;z(`Missing data type definition - "${s}"`)}updateColDefAndGetColumnType(e,t,i){var s,r;const n=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),o=null!=(r=null!=(s=t.type)?s:n)?r:e.type;return e.type=o,o?this.convertColumnTypes(o):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener(we.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(we.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,s))return!1;const r=null===t.type?e.type:t.type;if(r){const e=null!=(i=this.gos.get("columnTypes"))?i:{};if(this.convertColumnTypes(r).some(t=>{const i=e[t.trim()];return i&&this.doColDefPropsPreventInference(i,s)}))return!1}return!this.doColDefPropsPreventInference(e,s)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const r=e[i];return null===r?(t[i]=!1,!1):void 0===s?!!r:r===s}inferCellDataType(e,t){var i;if(!e)return;let s;const r=this.getInitialData();if(r){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");s=F(r,e,t)}else this.initWaitForRowData(t);if(null==s)return;const[n]=null!=(i=Object.entries(this.dataTypeMatchers).find(([e,t])=>t(s)))?i:["object"];return n}getInitialData(){const e=this.gos.get("rowData");if(null==e?void 0:e.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(null==e?void 0:e.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATE_STARTED,e=>{const{firstRowData:s}=e;if(!s)return;null==i||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(s,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const r={type:ct.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(r)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[];const s={},r={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([e,n])=>{const o=this.columnModel.getGridColumn(e);if(!o)return;const a=o.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(o,"cellDataTypeInferred"))return;const l=o.getColDef();if(t&&l.type&&l.type!==a.type){const t=this.getUpdatedColumnState(o,n);t.rowGroup&&null==t.rowGroupIndex&&(s[e]=t),t.pivot&&null==t.pivotIndex&&(r[e]=t),i.push(t)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,r)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(e=>"string"!=typeof e)?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:"string"==typeof e?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e&&null!=(t=this.getDataTypeDefinition(e))?t:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null==(t=this.getDataTypeDefinition(e))?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const s=null==(i=this.getDataTypeDefinition(e))?void 0:i.dataTypeMatcher;return!s||s(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||z('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&z('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const s=(e,i,s)=>{let r=e.getColDef().valueFormatter;return r===t.groupSafeValueFormatter&&(r=t.valueFormatter),this.valueService.formatValue(e,i,s,r)},r=ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),n=this.localeService.getLocaleTextFunc(),o=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?d(d({},i),t):t};switch(t.baseDataType){case"number":e.cellEditor="agNumberCellEditor",r&&o({comparator:(e,t)=>{const i=null==e?0:parseInt(e),s=null==t?0:parseInt(t);return i===s?0:i>s?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===Xs.SPACE,o(r?{valueFormatter:e=>C(e.value)?n(String(e.value),e.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=e=>s(e.column,e.node,e.value),r&&o({valueFormatter:e=>{const t=s(e.column,e.node,e.value);return C(t)?t:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Th[Number(e)-1];return n(t,Ah[t])}return null!=e?e:n("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=e=>s(e.column,e.node,e.value);const i=t.dateParser;o(r?{valueFormatter:e=>{const t=s(e.column,e.node,e.value);return C(t)?t:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const t=i(null!=e?e:void 0);return t?[String(t.getFullYear()),String(t.getMonth()+1),String(t.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Th[Number(e)-1];return n(t,Ah[t])}return null!=e?e:n("blanks","(Blanks)")}}:{comparator:(e,t)=>{const s=i(t);return null==t||s<e?-1:s>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const r=this.columnModel.getPrimaryColumn(i),n=null==r?void 0:r.getColDef();if(!r||!n)return 0;const o=null==e?"":s(r,null,e),a=null==t?"":s(r,null,t);return o===a?0:o>a?1:-1},e.keyCreator=e=>s(e.column,e.node,e.value),r?o({valueFormatter:e=>{const t=s(e.column,e.node,e.value);return C(t)?t:n("blanks","(Blanks)")}}):e.filterValueGetter=e=>s(e.column,e.node,this.valueService.getValue(e.column,e.node))}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>{var t,i;return""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:Number(e.newValue)},valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:w(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>{var t,i;return null==e.newValue?e.newValue:""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:"true"===String(e.newValue).toLowerCase()},valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Ji(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>{var i;return null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?null!=(i=Xi(e.value,!1))?i:"":t("invalidDate","Invalid Date")},dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>{var t;return null!=(t=Ji(e))?t:void 0},dateFormatter:e=>{var t;return null!=(t=Xi(null!=e?e:null,!1))?t:void 0},valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>{var t;return null!=(t=w(e.value))?t:""}}}}};g([de("rowModel")],Dh.prototype,"rowModel",2),g([de("columnModel")],Dh.prototype,"columnModel",2),g([de("valueService")],Dh.prototype,"valueService",2),g([le],Dh.prototype,"init",1),Dh=g([he("dataTypeService")],Dh);var Ih=class extends rt{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(null!=e?e:[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=ne.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new kc("AG Grid",()=>this.gos.get("debug")).log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:ct.EVENT_GRID_READY};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,Tt(e.source))}};g([de("ctrlsService")],Ih.prototype,"ctrlsService",2),g([de("columnModel")],Ih.prototype,"columnModel",2),g([de("rowModel")],Ih.prototype,"rowModel",2),g([le],Ih.prototype,"postConstruct",1),Ih=g([he("syncService")],Ih);var Rh=class extends rt{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const e=this.userComponentFactory.getLoadingOverlayCompDetails({});this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const e=this.userComponentFactory.getNoRowsOverlayCompDetails({});this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const s=e.newAgStackInstance(),r=this.addManagedPropertyListener(i,({currentValue:e})=>{s.then(t=>{t.refresh&&t.refresh(this.gos.addGridCommonParams(d({},null!=e?e:{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(s,t,r)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gos.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){!this.columnModel.isReady()||this.paginationProxy.isEmpty()||this.manuallyDisplayed||this.hideOverlay()}};g([de("userComponentFactory")],Rh.prototype,"userComponentFactory",2),g([de("paginationProxy")],Rh.prototype,"paginationProxy",2),g([de("columnModel")],Rh.prototype,"columnModel",2),g([le],Rh.prototype,"postConstruct",1),Rh=g([he("overlayService")],Rh);var Ph=class extends rt{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Q(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Q(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Q(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var e;this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=null!=(e=this.gos.get("initialState"))?e:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const t=this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,({source:e})=>{"gridInitializing"===e&&(null==t||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),i=this.addManagedListener(this.eventService,ct.EVENT_ROW_COUNT_READY,()=>{null==i||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),s=this.addManagedListener(this.eventService,ct.EVENT_FIRST_DATA_RENDERED,()=>{null==s||s(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,ct.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,ct.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var e;const t=null!=(e=this.gos.get("initialState"))?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:s,pagination:r}=null!=(e=this.gos.get("initialState"))?e:{},n=this.gos.get("advancedFilterModel");(t||n)&&this.setFilterState(t,n),i&&this.setRowGroupExpansionState(i),s&&this.setRowSelectionState(s),r&&this.setPaginationState(r),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,ct.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,ct.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,ct.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:s,columnOrder:r}=null!=(e=this.gos.get("initialState"))?e:{};s&&this.setFocusedCellState(s),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!(null==r?void 0:r.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,ct.EVENT_RANGE_SELECTION_CHANGED,e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],r=[],n=[],o=[],a=[],l=[],c=[],h=this.columnModel.getColumnState();for(let e=0;e<h.length;e++){const{colId:d,sort:u,sortIndex:p,rowGroup:g,rowGroupIndex:m,aggFunc:f,pivot:y,pivotIndex:v,pinned:C,hide:b,width:S,flex:w}=h[e];c.push(d),u&&(t[null!=p?p:0]={colId:d,sort:u}),g&&(i[null!=m?m:0]=d),"string"==typeof f&&s.push({colId:d,aggFunc:f}),y&&(r[null!=v?v:0]=d),C&&("right"===C?o:n).push(d),b&&a.push(d),(w||S)&&l.push({colId:d,flex:null!=w?w:void 0,width:S})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:r.length||e?{pivotMode:e,pivotColIds:r}:void 0,columnPinning:n.length||o.length?{leftColIds:n,rightColIds:o}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:c.length?{orderedColIds:c}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:r,columnPinning:n,columnVisibility:o,columnSizing:a,columnOrder:l}=e,c={},h=e=>{let t=c[e];return t||(t={colId:e},c[e]=t,t)};t&&t.sortModel.forEach(({colId:e,sort:t},i)=>{const s=h(e);s.sort=t,s.sortIndex=i}),i&&i.groupColIds.forEach((e,t)=>{const i=h(e);i.rowGroup=!0,i.rowGroupIndex=t}),s&&s.aggregationModel.forEach(({colId:e,aggFunc:t})=>{h(e).aggFunc=t}),r&&(r.pivotColIds.forEach((e,t)=>{const i=h(e);i.pivot=!0,i.pivotIndex=t}),this.gos.updateGridOptions({options:{pivotMode:r.pivotMode},source:"gridInitializing"})),n&&(n.leftColIds.forEach(e=>{h(e).pinned="left"}),n.rightColIds.forEach(e=>{h(e).pinned="right"})),o&&o.hiddenColIds.forEach(e=>{h(e).hide=!0}),a&&a.columnSizingModel.forEach(({colId:e,flex:t,width:i})=>{const s=h(e);s.flex=null!=t?t:null,s.width=i});const d=null==l?void 0:l.orderedColIds,u=!!(null==d?void 0:d.length),p=u?d.map(e=>h(e)):Object.values(c);if(p.length){this.columnStates=p;const e={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnModel.applyColumnState({state:p,applyOrder:u,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.columnModel.isSecondaryColumnsPresent()){if(t){let i=[];for(const e of t)this.columnModel.getSecondaryColumn(e.colId)&&i.push(e);this.columnModel.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach(({groupId:e,open:i})=>{i&&t.push(e)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set(null==(t=e.columnGroup)?void 0:t.openColumnGroupIds),s=this.columnModel.getColumnGroupState().map(({groupId:e})=>{const t=i.has(e);return t&&i.delete(e),{groupId:e,open:t}});i.forEach(e=>{s.push({groupId:e,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnModel.setColumnGroupState(s,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&0===Object.keys(t).length&&(t=void 0);const i=null!=(e=this.filterManager.getAdvancedFilterModel())?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=null!=e?e:{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),s&&this.filterManager.setAdvancedFilterModel(s)}getRangeSelectionState(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges().map(e=>{const{id:t,type:i,startRow:s,endRow:r,columns:n,startColumn:o}=e;return{id:t,type:i,startRow:s,endRow:r,colIds:n.map(e=>e.getColId()),startColId:o.getColId()}});return(null==t?void 0:t.length)?{cellRanges:t}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach(e=>{const i=[];if(e.colIds.forEach(e=>{const t=this.columnModel.getGridColumn(e);t&&i.push(t)}),!i.length)return;let s=this.columnModel.getGridColumn(e.startColId);if(!s){const e=this.columnModel.getAllDisplayedColumns(),t=new Set(i);s=e.find(e=>t.has(e))}t.push(u(d({},e),{columns:i,startColumn:s}))}),this.rangeService.setCellRanges(t)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const s=null==(e=this.ctrlsService.getGridBodyCtrl())?void 0:e.getScrollFeature(),{left:r}=null!=(t=null==s?void 0:s.getHScrollPosition())?t:{left:0},{top:n}=null!=(i=null==s?void 0:s.getVScrollPosition())?i:{top:0};return n||r?{top:n,left:r}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:s}=e;null==(t=this.ctrlsService.getGridBodyCtrl())||t.getScrollFeature().setScrollPosition(i,s)}getSideBarState(){var e,t;return null==(t=null==(e=this.sideBarService)?void 0:e.getSideBarComp())?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(e||t)return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||(null==(e=null==t?void 0:t.toggledNodes)?void 0:e.length))?t:void 0}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([e,t])=>{A(t,this.cachedState[e])||(i=!0)}),this.cachedState=d(d({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),A(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState=u(d({},this.cachedState),{[e]:t})}refreshStaleState(){this.staleStateKeys.forEach(e=>{"rowSelection"===e&&this.setCachedStateValue(e,this.getRowSelectionState())}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(e=>this.queuedUpdateSources.add(e)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:ct.EVENT_STATE_UPDATED,sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};g([de("filterManager")],Ph.prototype,"filterManager",2),g([de("ctrlsService")],Ph.prototype,"ctrlsService",2),g([de("focusService")],Ph.prototype,"focusService",2),g([de("columnModel")],Ph.prototype,"columnModel",2),g([de("paginationProxy")],Ph.prototype,"paginationProxy",2),g([de("rowModel")],Ph.prototype,"rowModel",2),g([de("selectionService")],Ph.prototype,"selectionService",2),g([de("expansionService")],Ph.prototype,"expansionService",2),g([de("columnAnimationService")],Ph.prototype,"columnAnimationService",2),g([ue("sideBarService")],Ph.prototype,"sideBarService",2),g([ue("rangeService")],Ph.prototype,"rangeService",2),g([le],Ph.prototype,"postConstruct",1),Ph=g([he("stateService")],Ph);var kh=class extends rt{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,Sh)}processColumnDefs(e){this.processOptions(e,vh)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:r,propertyExceptions:n,objectName:o,docsUrl:a}=t;r&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...null!=n?n:[],...Object.keys(s)],r,o,a);const l=new Set;Object.keys(e).forEach(t=>{var r;const n=s[t];if(n)if("renamed"in n){const{renamed:i,version:s}=n;l.add(`As of v${s}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=n;l.add(`As of v${i}, ${String(t)} is deprecated. ${null!=e?e:""}`)}const o=e[t];if(null==o||!1===o)return;const a=i[t];let c;if(!a)return;if("function"==typeof a){const i=a(e,this.gridOptions);if(!i)return;if("objectName"in i){const s=e[t];return Array.isArray(s)?void s.forEach(e=>{this.processOptions(e,i)}):void this.processOptions(e[t],i)}c=i}else c=a;const{module:h,dependencies:d,supportedRowModels:u}=c;if(u){const e=null!=(r=this.gridOptions.rowModelType)?r:"clientSide";if(!u.includes(e))return void l.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach(e=>{ne.__assertRegistered(e,String(t),this.context.getGridId())||(i=!1,l.add(`${String(t)} is only available when ${e} is loaded.`))}),!i)return}if(d){const i=this.checkForWarning(t,d,e);if(i)return void l.add(i)}}),l.size>0&&l.forEach(e=>{z(e)})}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const s=Object.entries(t).find(([e,t])=>{const s=i[e];return!t.includes(s)});if(!s)return null;const[r,n]=s;return n.length>1?`'${String(e)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${n[0]}.`}checkProperties(e,t,i,s,r){const n=Us(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(k(n,(e,t)=>{z(`invalid ${s} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}`)}),Object.keys(n).length>0&&r){const e=this.getFrameworkOverrides().getDocLink(r);z(`to see all the valid ${s} properties please check: ${e}`)}}};g([de("gridOptions")],kh.prototype,"gridOptions",2),g([le],kh.prototype,"init",1),kh=g([he("validationService")],kh);var Lh=class extends rt{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new ye(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!ht.has(e),r=s?this.asyncEventListeners:this.syncEventListeners;r.has(e)||r.set(e,new Set),r.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var i;const s=this.frameworkEventWrappingService.unwrap(t),r=this.asyncEventListeners.get(e),n=!!(null==r?void 0:r.delete(s));n||null==(i=this.syncEventListeners.get(e))||i.delete(s),this.eventService.removeEventListener(e,s,n)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{ht.has(e)&&t(e,i)},s=(e,i)=>{ht.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:s}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(s,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:s}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(s,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((e,i)=>{e.forEach(e=>this.eventService.removeEventListener(i,e,t)),e.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(e=>this.eventService.removeGlobalListener(e,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}};g([le],Lh.prototype,"postConstruct",1),Lh=g([he("apiEventService")],Lh);var Nh=class extends Cr{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,e=>this.handlePaginationChanged(e))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(null==e?void 0:e.newPageSize))return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){Cs(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),z("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n                Please make sure that the paginationPageSize grid option is set to one of the values in the \n                paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const s=this.localeService.getLocaleTextFunc(),r=s("pageSizeSelectorLabel","Page Size:"),n=e.map(e=>({value:String(e),text:String(e)})),o=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Vr).addOptions(n).setValue(String(i?"":t)).setAriaLabel(o).setLabel(r).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=this.gos.get("paginationPageSizeSelector");return Array.isArray(e)&&this.validateValues(e)?[...e].sort((e,t)=>e-t):[20,50,100]}validateValues(e){if(!e.length)return z("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n                If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],s=i>0;if("number"!=typeof i)return z("The paginationPageSizeSelector grid option contains a non-numeric value.\n                    Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!s)return z("The paginationPageSizeSelector grid option contains a negative number or zero.\n                    Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};g([de("paginationProxy")],Nh.prototype,"paginationProxy",2),g([le],Nh.prototype,"init",1);var _h=class extends rt{constructor(){super(),this.descriptionContainer=null,this.announceValue=Q(this.announceValue.bind(this),200)}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),qt(t,"polite"),Zt(t,"additions text"),Xt(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(Cs(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};g([de("eGridDiv")],_h.prototype,"eGridDiv",2),g([le],_h.prototype,"postConstruct",1),_h=g([he("ariaAnnouncementService")],_h);var Oh=class{};function Fh(e){Oh.gridOptions=e}function Gh(e,t,i){if(!t)return W("No gridOptions provided to createGrid"),{};const s=(new Hh).create(e,t,t=>{const i=new Nc(e);t.createBean(i)},void 0,i);if(!Object.isFrozen(t)&&!(null==i?void 0:i.frameworkOverrides)){const e="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{W(`gridOptions.api is no longer supported. See ${e}.`)},configurable:!0}),Object.defineProperty(t,"columnApi",{get:()=>{W(`gridOptions.columnApi is no longer supported and all methods moved to the grid api. See ${e}.`)},configurable:!0})}return s}Oh.gridOptions=void 0;var Bh=class{constructor(e,t,i){if(z("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t)return void W("No gridOptions provided to the grid");this.gridOptions=t;const s=(new Hh).create(e,t,t=>{const i=new Nc(e);t.createBean(i).addDestroyFunc(()=>{this.destroy()})},void 0,i);this.gridOptions.api=s,this.gridOptions.columnApi=new Dc(s)}destroy(){var e;this.gridOptions&&(null==(e=this.gridOptions.api)||e.destroy(),delete this.gridOptions.api,delete this.gridOptions.columnApi)}},Vh=1,Hh=class{create(e,t,i,s,r){var n;let o={};Oh.gridOptions?(O(o,Oh.gridOptions,!0,!0),o=d(d({},o),t)):o=t;const a=wh.getCoercedGridOptions(o),l=!!a.debug,c=null!=(n=a.gridId)?n:String(Vh++),h=this.getRegisteredModules(r,c),u=this.createBeansList(a.rowModelType,h,c),p=this.createProvidedBeans(e,a,r);if(!u)return void W("Failed to create grid.");const g={providedBeanInstances:p,beanClasses:u,debug:l,gridId:c},m=new kc("Context",()=>g.debug),f=new oe(g,m),y=f.getBean("beans");return this.registerModuleUserComponents(y,h),this.registerStackComponents(y,h),this.registerControllers(y,h),i(f),y.syncService.start(),s&&s(f),f.getBean("gridApi")}registerControllers(e,t){t.forEach(t=>{t.controllers&&t.controllers.forEach(t=>e.ctrlsFactory.register(t))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,s=ne.__getRegisteredModules(t),r=[],n={},o=(e,t,i)=>{var s;n[(s=t).moduleName]||(n[s.moduleName]=!0,r.push(s),ne.__register(s,e,i)),t.dependantModules&&t.dependantModules.forEach(t=>o(e,t,i))};return i&&i.forEach(e=>o(!0,e,t)),s&&s.forEach(e=>o(!ne.__isPackageBased(),e,void 0)),r}registerModuleUserComponents(e,t){this.extractModuleEntity(t,e=>e.userComponents?e.userComponents:[]).forEach(t=>{e.userComponentRegistry.registerDefaultComponent(t.componentName,t.componentClass)})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;b(s)&&(s=new Ec);const r={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(r,i.providedBeanInstances),r}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:Ur},{componentName:"AgRadioButton",componentClass:zr},{componentName:"AgToggleButton",componentClass:Wl},{componentName:"AgInputTextField",componentClass:tn},{componentName:"AgInputTextArea",componentClass:jl},{componentName:"AgInputNumberField",componentClass:sn},{componentName:"AgInputDateField",componentClass:Kl},{componentName:"AgInputRange",componentClass:$l},{componentName:"AgRichSelect",componentClass:Zl},{componentName:"AgSelect",componentClass:Vr},{componentName:"AgSlider",componentClass:Jl},{componentName:"AgGridBody",componentClass:La},{componentName:"AgHeaderRoot",componentClass:Cl},{componentName:"AgSortIndicator",componentClass:Cn},{componentName:"AgPagination",componentClass:qc},{componentName:"AgPageSizeSelector",componentClass:Nh},{componentName:"AgOverlayWrapper",componentClass:Zc},{componentName:"AgGroupComponent",componentClass:tc},{componentName:"AgRowContainer",componentClass:Ha},{componentName:"AgFakeHorizontalScroll",componentClass:ph},{componentName:"AgFakeVerticalScroll",componentClass:Mh},{componentName:"AgAutocomplete",componentClass:vc}];const i=this.extractModuleEntity(e,e=>e.agStackComponents?e.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const s=t.filter(t=>!t.rowModel||t.rowModel===e),r={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!r[e])return void W("Could not find row model for rowModelType = "+e);if(!ne.__assertRegistered(r[e],`rowModelType = '${e}'`,i))return;const n=[la,Qc,Jc,nh,Bc,zo,po,Uc,zc,Tl,No,$c,bl,xh,kh,Ol,Bo,It,fe,wh,pc,Tc,jo,At,fl,Ul,Nl,Rc,nt,Ac,Oa,Vc,Ic,Pc,kl,Sl,Bn,Dc,Oc,_a,Kc,Mc,zl,Na,_c,Fc,Gc,Yc,pt,Hc,Dl,rh,_t,oh,ah,Hl,lh,ch,gh,mh,hh,Dh,Wo,Ih,Rh,Ph,Rl,Lh,_h,Pl],o=this.extractModuleEntity(s,e=>e.beans?e.beans:[]);n.push(...o);const a=[];return n.forEach(e=>{a.indexOf(e)<0&&a.push(e)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Uh=class{wrap(e,t,i=[],s){const r=this.createWrapper(e,s);return t.forEach(e=>{this.createMethod(r,e,!0)}),i.forEach(e=>{this.createMethod(r,e,!1)}),r}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}},zh=class{};zh.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},zh.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],zh.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var Wh=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(Wh||{}),jh="undefined"==typeof globalThis?{}:globalThis;jh.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,jh.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,jh.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,jh.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,jh.Node="undefined"==typeof Node?{}:Node,jh.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var Kh=class e{constructor(t,i,s,r,n,o){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=t,this.gos=i,this.eventService=s,this.columnModel=r,this.beans=o,this.selectionService=n,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return lr.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(t){if("string"==typeof t)return void console.warn("AG Grid: rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t);const i=this.rootNode,s=this.rootNode.sibling;i.childrenAfterFilter=null,i.childrenAfterGroup=null,i.childrenAfterAggFilter=null,i.childrenAfterSort=null,i.childrenMapped=null,i.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?i.allLeafChildren=t.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL)):(i.allLeafChildren=[],i.childrenAfterGroup=[]),s&&(s.childrenAfterFilter=i.childrenAfterFilter,s.childrenAfterGroup=i.childrenAfterGroup,s.childrenAfterAggFilter=i.childrenAfterAggFilter,s.childrenAfterSort=i.childrenAfterSort,s.childrenMapped=i.childrenMapped,s.allLeafChildren=i.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&lr.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:ct.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:ct.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(e)}}executeAdd(t,i){var s;const{add:r,addIndex:n}=t;if(lr.missingOrEmpty(r))return;const o=r.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL));if("number"==typeof n&&n>=0){const{allLeafChildren:e}=this.rootNode,t=e.length;let i=n;if(this.gos.get("treeData")&&n>0&&t>0)for(let r=0;r<t;r++)if((null==(s=e[r])?void 0:s.rowIndex)==n-1){i=r+1;break}const r=e.slice(0,i),a=e.slice(i,e.length);this.rootNode.allLeafChildren=[...r,...o,...a]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=o}executeRemove(e,t,i){const{remove:s}=e;if(lr.missingOrEmpty(s))return;const r={};s.forEach(e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),r[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(e=>!r[e.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(t,i,s){const{update:r}=t;lr.missingOrEmpty(r)||r.forEach(t=>{const r=this.lookupRowNode(t);r&&(r.updateData(t),!r.selectable&&r.isSelected()&&s.push(r),this.setMasterForRow(r,t,e.TOP_LEVEL,!1),i.update.push(r))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(t=>t.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new Nn(this.beans);s.group=!1,this.setMasterForRow(s,e,i,!0);const r=this.gos.get("suppressParentsInRowNodes");return t&&!r&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const t=this.columnModel.getRowGroupColumns(),s=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}};Kh.TOP_LEVEL=0,Kh.ROOT_NODE_ID="ROOT_NODE_ID";var $h=Kh,Yh=class extends rt{constructor(){super(...arguments),this.onRowHeightChanged_debounced=lr.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new Nn(this.beans),this.nodeManager=new $h(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),r=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),n=new Set(["postSortRows","groupDisplayType","accentedSort"]),o=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...e,...t,...i,...s,...s,...r,...n,...o,...a];this.addManagedPropertyListeners(l,l=>{var c;const h=null==(c=l.changeSet)?void 0:c.properties;if(!h)return;const d=e=>h.some(t=>e.has(t));d(e)?this.setRowData(this.rootNode.allLeafChildren.map(e=>e.data)):d(t)?this.refreshModel({step:"group"}):d(i)?this.refreshModel({step:"filter"}):d(s)?this.refreshModel({step:"pivot"}):d(r)?this.refreshModel({step:"aggregate"}):d(n)?this.refreshModel({step:"sort"}):d(o)?this.refreshModel({step:"filter_aggregates"}):d(a)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let r,n=!1;do{r=!1;const o=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(o,i),c=Math.min(a,s);for(let e=l;e<=c;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),r=!0,n=!0}}r&&this.setRowTopAndRowIndex()}while(r);return n}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let r=0;r<this.rowsToDisplay.length;r++){const n=this.rowsToDisplay[r];if(null!=n.id&&i.add(n.id),null==n.rowHeight){const t=this.gos.getRowHeightForNode(n,s,e);n.setRowHeight(t.height,t.estimated)}n.setRowTop(t),n.setRowIndex(r),t+=n.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},r=e=>{if(s(e),s(e.detailNode),s(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(r)}};r(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),r=this.getRow(s),n=!this.gos.get("suppressAnimationFrame");return r!==e[0]&&(e.forEach(e=>{lr.removeFromArray(this.rootNode.allLeafChildren,e)}),e.forEach((e,t)=>{lr.insertIntoArray(this.rootNode.allLeafChildren,e,Math.max(s+i,0)+t)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:n}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const r=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(r),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=this.rootNode.childrenAfterSort[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(e){if(lr.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some(e=>e.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=lr.missingOrEmpty(e),i=new Gl(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter(e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0);return null==t||0==t.length}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(lr.exists(e)&&(t=i[e]),!lr.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")};console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`)}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const r={type:ct.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(r)}isEmpty(){const e=lr.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return lr.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return lr.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,s=!1;const r=[],n=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(o=>{if(!s)if(i&&(o===t||o===e)&&(s=!0,o.group&&n))r.push(...o.allLeafChildren);else{if(!i){if(o!==t&&o!==e)return;i=!0}(!o.group||!n)&&r.push(o)}}),r}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(lr.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let s=-1,r=-1;for(;;){const n=Math.floor((t+i)/2),o=this.rowsToDisplay[n];if(this.isRowInPixel(o,e))return n;if(o.rowTop<e?t=n+1:o.rowTop>e&&(i=n-1),s===t&&r===i)return n;s=t,r=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:r}=e;let{index:n}=e;const o=e=>{var s;const o=null==(s=t[0])?void 0:s.parent;if(!o)return;const a=r&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),c=r&&l({node:o});o===this.rootNode?a===e&&(o.createFooter(),i(o.sibling,n++)):c===e&&(o.createFooter(),i(o.sibling,n++))};o("top");for(let e=0;e<t.length;e++){const o=t[e];if(i(o,n++),o.hasChildren()&&!o.footer){let e=null;switch(s){case 0:e=o.childrenAfterGroup;break;case 1:e=o.childrenAfterAggFilter;break;case 2:e=o.childrenAfterSort;break;case 3:e=o.leafGroup?null:o.childrenAfterSort}e&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:s,index:n,includeFooterNodes:r}))}}return o("bottom"),n}doAggregate(e){var t;null==(t=this.aggregationStage)||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=r=>{r&&r.forEach(r=>{const n=()=>{r.expanded=e,s(r.childrenAfterGroup)};t?lr.exists(r.childrenAfterGroup)&&n():i?!r.leafGroup&&n():r.group&&n()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const r=e?"expandAll":"collapseAll",n={type:ct.EVENT_EXPAND_COLLAPSE_ALL,source:r};this.eventService.dispatchEvent(n)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:ct.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:ct.EVENT_ROW_COUNT_READY}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;null==(t=this.pivotStage)||t.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(Nn.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:ct.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const r=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(r),s.callback&&e.push(s.callback.bind(null,r)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),t.length>0){const e={type:ct.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++)e[this.rootNode.allLeafChildren[t].id]=t;return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const r={type:ct.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(r),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};g([de("columnModel")],Yh.prototype,"columnModel",2),g([de("selectionService")],Yh.prototype,"selectionService",2),g([de("valueCache")],Yh.prototype,"valueCache",2),g([de("beans")],Yh.prototype,"beans",2),g([de("filterStage")],Yh.prototype,"filterStage",2),g([de("sortStage")],Yh.prototype,"sortStage",2),g([de("flattenStage")],Yh.prototype,"flattenStage",2),g([ue("groupStage")],Yh.prototype,"groupStage",2),g([ue("aggregationStage")],Yh.prototype,"aggregationStage",2),g([ue("pivotStage")],Yh.prototype,"pivotStage",2),g([ue("filterAggregatesStage")],Yh.prototype,"filterAggregatesStage",2),g([le],Yh.prototype,"init",1),Yh=g([he("rowModel")],Yh);var qh=class extends rt{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};g([de("filterService")],qh.prototype,"filterService",2),qh=g([he("filterStage")],qh);var Xh=class extends rt{execute(e){const t=this.sortController.getSortOptions(),i=lr.exists(t)&&t.length>0,s=i&&lr.exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),r=t.some(e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,r)}};g([de("sortService")],Xh.prototype,"sortService",2),g([de("sortController")],Xh.prototype,"sortController",2),Xh=g([he("sortStage")],Xh);var Zh=class extends rt{execute(e){const t=e.rowNode,i=[],s=this.beans.columnModel.isPivotMode(),r=s&&t.leafGroup,n=r?[t]:t.childrenAfterSort,o=this.getFlattenDetails();if(this.recursivelyAddToRowsToDisplay(o,n,i,s,0),!r&&i.length>0&&o.grandTotalRow){t.createFooter();const e="top"===o.grandTotalRow;this.addRowNodeToRowsToDisplay(o,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,r){if(!lr.missingOrEmpty(t))for(let n=0;n<t.length;n++){const o=t[n],a=o.hasChildren(),l=s&&!a,c=e.groupRemoveSingleChildren&&a&&1===o.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&a&&o.leafGroup&&1===o.childrenAfterGroup.length,d=s&&o.leafGroup,u=e.hideOpenParents&&o.expanded&&!o.master&&!d;if(!(l||u||c||h)&&this.addRowNodeToRowsToDisplay(e,o,i,r),!s||!o.leafGroup)if(a){const t=c||h;if(o.expanded||t){const n=e.groupTotalRow({node:o});n||o.destroyFooter();const a=t?r:r+1;"top"===n&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a)),this.recursivelyAddToRowsToDisplay(e,o.childrenAfterSort,i,s,a),"bottom"===n&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a))}}else if(o.master&&o.expanded){const t=this.createDetailNode(o);this.addRowNodeToRowsToDisplay(e,t,i,r)}}}addRowNodeToRowsToDisplay(e,t,i,s,r){r?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(lr.exists(e.detailNode))return e.detailNode;const t=new Nn(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,lr.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};g([de("beans")],Zh.prototype,"beans",2),Zh=g([he("flattenStage")],Zh);var Qh=class extends rt{sort(e,t,i,s,r,n){const o=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(e=>e.isRowGroupActive());let l={};i&&s&&(l=this.calculateDirtyNodes(s));const c=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows");r&&r.forEachChangedNodeDepthFirst(s=>{var d;this.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter,!0);const u=c&&s.leafGroup;if(o&&a&&!s.leafGroup&&!n){const e=null==(d=this.columnModel.getRowGroupColumns())?void 0:d[s.level+1],t=null===(null==e?void 0:e.getSort()),i=s.childrenAfterAggFilter.slice(0);if(s.childrenAfterSort&&!t){const e={};s.childrenAfterSort.forEach((t,i)=>{e[t.id]=i}),i.sort((t,i)=>{var s,r;return(null!=(s=e[t.id])?s:0)-(null!=(r=e[i.id])?r:0)})}s.childrenAfterSort=i}else s.childrenAfterSort=!t||u?s.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(s,l,r,e):this.rowNodeSorter.doFullSort(s.childrenAfterAggFilter,e);if(s.sibling&&(s.sibling.childrenAfterSort=s.childrenAfterSort),this.updateChildIndexes(s),h){const e={nodes:s.childrenAfterSort};h(e)}}),this.updateGroupDataForHideOpenParents(r)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach(e=>t[e.id]=!0)};return e&&e.forEach(e=>{i(e.add),i(e.update),i(e.remove)}),t}doDeltaSort(e,t,i,s){const r=e.childrenAfterAggFilter,n=e.childrenAfterSort;if(!n)return this.rowNodeSorter.doFullSort(r,s);const o={},a=[];r.forEach(e=>{t[e.id]||!i.canSkip(e)?a.push(e):o[e.id]=!0});const l=n.filter(e=>o[e.id]),c=(e,t)=>({currentPos:t,rowNode:e}),h=a.map(c).sort((e,t)=>this.rowNodeSorter.compareRowNodes(s,e,t));return this.mergeSortedArrays(s,h,l.map(c)).map(({rowNode:e})=>e)}mergeSortedArrays(e,t,i){const s=[];let r=0,n=0;for(;r<t.length&&n<i.length;)this.rowNodeSorter.compareRowNodes(e,t[r],i[n])<0?s.push(t[r++]):s.push(i[n++]);for(;r<t.length;)s.push(t[r++]);for(;n<i.length;)s.push(i[n++]);return s}updateChildIndexes(e){if(lr.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],r=0===i,n=i===e.childrenAfterSort.length-1;s.setFirstChild(r),s.setLastChild(n),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return lr.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach(e=>{e.hasChildren()&&t(e)})};e&&e.executeFromRootNode(e=>t(e))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!lr.missing(e)&&e.forEach(e=>{this.columnModel.getGroupDisplayColumns().forEach(i=>{const s=i.getColDef().showRowGroup;if("string"!=typeof s)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const r=s,n=this.columnModel.getPrimaryColumn(r);if(n!==e.rowGroupColumn)if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(n);t&&e.setGroupValue(i.getId(),t.key)}})})}};g([de("columnModel")],Qh.prototype,"columnModel",2),g([de("rowNodeSorter")],Qh.prototype,"rowNodeSorter",2),Qh=g([he("sortService")],Qh);var Jh=class extends rt{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let r=0;r<t.childrenAfterGroup.length;r++){const n=t.childrenAfterGroup[r],o=s||this.filterManager.doesRowPassFilter({rowNode:n});n.childrenAfterGroup?e(t.childrenAfterGroup[r],o):i(n,o)}i(t,s)},s=t=>e(t,!1);t.executeFromRootNode(s)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};g([de("filterManager")],Jh.prototype,"filterManager",2),Jh=g([he("filterService")],Jh);var ed=class extends rt{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(lr.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gos.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return lr.exists(e)&&e.forEach((e,n)=>{const o=t({data:e,level:0}),a=s[o];r&&(r[o]=n),a?(a.data!==e&&i.update.push(e),s[o]=void 0):i.add.push(e)}),lr.iterateObject(s,(e,t)=>{t&&i.remove.push(t.data)}),[i,r]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}};g([de("rowModel")],ed.prototype,"rowModel",2),g([de("rowRenderer")],ed.prototype,"rowRenderer",2),g([de("selectionService")],ed.prototype,"selectionService",2),g([le],ed.prototype,"postConstruct",1);var td={version:"31.3.4",moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[Yh,qh,Xh,Zh,Qh,Jh,ed=g([he("immutableService")],ed)]},id=Object.defineProperty,sd=Object.getOwnPropertyDescriptor,rd=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?sd(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&id(t,i,n),n},nd=class extends Vl{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){lr.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();lr.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,r)=>{this.startRow+r<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new Nn(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((t,i)=>{const s=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&s&&(this.rowNodes[i]=new Nn(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],s,this.startRow+i)});const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}};rd([de("beans")],nd.prototype,"beans",2),rd([le],nd.prototype,"postConstruct",1),rd([ce],nd.prototype,"destroyRowNodes",1);var od,ad=class e extends rt{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new nd(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach(e=>e.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(t){const i=this.getBlocksInOrder().filter(e=>e!=t);i.sort((e,t)=>t.getLastAccessed()-e.getLastAccessed());const s=this.params.maxBlocksInCache>0,r=s?this.params.maxBlocksInCache-1:null,n=e.MAX_EMPTY_BLOCKS_TO_KEEP-1;i.forEach((e,t)=>{if(e.getState()===nd.STATE_WAITING_TO_LOAD&&t>=n||s&&t>=r){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,lr.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new cr;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){return lr.getAllValuesInObject(this.blocks).sort((e,t)=>e.getId()-t.getId())}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:ct.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(e=>this.destroyBlock(e))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,r=!1;const n=new cr;lr.missing(e)&&(r=!0);let o=!1;return this.getBlocksInOrder().forEach(a=>{o||(r&&s+1!==a.getId()?o=!0:(s=a.getId(),a.forEachNode(s=>{const n=s===e||s===t;(r||n)&&i.push(s),n&&(r=!r)},n,this.rowCount)))}),o||r?[]:i}};ad.MAX_EMPTY_BLOCKS_TO_KEEP=2,rd([de("rowRenderer")],ad.prototype,"rowRenderer",2),rd([de("focusService")],ad.prototype,"focusService",2),rd([(od=ge("loggerFactory"),(e,t)=>od(e,t,0))],ad.prototype,"setBeans",1),rd([ce],ad.prototype,"destroyAllBlocks",1);var ld=ad,cd=class extends rt{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&lr.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!lr.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){this.datasource&&(null!=this.gos.getCallback("getRowId")||this.selectionService.reset("rowDataChanged"),this.resetCache())}createModelUpdatedEvent(){return{type:ct.EVENT_MODEL_UPDATED,newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new cr},this.infiniteCache=this.createBean(new ld(this.cacheParams)),this.eventService.dispatchEventOnce({type:ct.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};rd([de("filterManager")],cd.prototype,"filterManager",2),rd([de("sortController")],cd.prototype,"sortController",2),rd([de("selectionService")],cd.prototype,"selectionService",2),rd([de("rowRenderer")],cd.prototype,"rowRenderer",2),rd([de("rowNodeBlockLoader")],cd.prototype,"rowNodeBlockLoader",2),rd([le],cd.prototype,"init",1),rd([ce],cd.prototype,"destroyDatasource",1);var hd={version:"31.3.4",moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[cd=rd([he("rowModel")],cd)]},dd=Object.defineProperty,ud=Object.defineProperties,pd=Object.getOwnPropertyDescriptor,gd=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,fd=Object.prototype.hasOwnProperty,yd=Object.prototype.propertyIsEnumerable,vd=(e,t,i)=>t in e?dd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Cd=(e,t)=>{for(var i in t||(t={}))fd.call(t,i)&&vd(e,i,t[i]);if(md)for(var i of md(t))yd.call(t,i)&&vd(e,i,t[i]);return e},bd=(e,t)=>ud(e,gd(t)),Sd=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?pd(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&dd(t,i,n),n},wd=(e,t,i)=>new Promise((s,r)=>{var n=e=>{try{a(i.next(e))}catch(e){r(e)}},o=e=>{try{a(i.throw(e))}catch(e){r(e)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);a((i=i.apply(e,t)).next())}),xd=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},Ed=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gos:s,processCellCallback:r,processHeaderCallback:n,processGroupHeaderCallback:o,processRowGroupCallback:a}=e;this.columnModel=t,this.valueService=i,this.gos=s,this.processCellCallback=r,this.processHeaderCallback=n,this.processGroupHeaderCallback=o,this.processRowGroupCallback=a}prepare(e){this.groupColumns=e.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""}extractRowCellValue(e,t,i,s,r){const n=this.gos.get("groupHideOpenParents")&&!r.footer||!this.shouldRenderGroupSummaryCell(r,e,t)?this.valueService.getValue(e,r):this.createValueForGroupNode(e,r);return this.processCell({accumulatedRowIndex:i,rowNode:r,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var s;if(!e||!e.group)return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null==(s=e.groupData)?void 0:s[t.getId()]))return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const r=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&r}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),r=t=>{var r,n;if(i||s)return t.key;const o=null==(r=t.groupData)?void 0:r[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(n=this.valueService.formatValue(t.rowGroupColumn,t,o))?n:o},n=t.footer,o=[r(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,o.push(r(t));const a=o.reverse().join(" -> ");return n?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:s,column:r,value:n,processCellCallback:o,type:a}=e;return o?{value:null!=(t=o(this.gos.addGridCommonParams({accumulatedRowIndex:i,column:r,node:s,value:n,type:a,parseValue:e=>this.valueService.parseValue(r,s,e,this.valueService.getValue(r,s)),formatValue:e=>{var t;return null!=(t=this.valueService.formatValue(r,s,e))?t:e}})))?t:""}:!1!==r.getColDef().useValueFormatterForExport?{value:null!=n?n:"",valueFormatted:this.valueService.formatValue(r,s,n)}:{value:null!=n?n:""}}},Md=class{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const s=document.createElement("a"),r=i.URL.createObjectURL(t);s.setAttribute("href",r),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(r)},0)}},Ad=class extends Ed{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var s;0!=t&&(this.result+=this.columnSeparator);const r=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!=(s=r.valueFormatted)?s:r.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},Td=class extends xd{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"}),r="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;Md.download(this.getFileName(r),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:s}=this,{processCellCallback:r,processHeaderCallback:n,processGroupHeaderCallback:o,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:c}=e;return new Ad({columnModel:t,valueService:i,gos:s,processCellCallback:r||void 0,processHeaderCallback:n||void 0,processGroupHeaderCallback:o||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};Sd([de("columnModel")],Td.prototype,"columnModel",2),Sd([de("valueService")],Td.prototype,"valueService",2),Sd([de("gridSerializer")],Td.prototype,"gridSerializer",2),Sd([de("gridOptionsService")],Td.prototype,"gos",2),Sd([le],Td.prototype,"postConstruct",1),Td=Sd([he("csvCreator")],Td);var Dd=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(Dd||{}),Id=class extends rt{serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:r}=t,n=this.getColumnsToExport(i,r,s);return lr.compose(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const r=t.shouldRowBeSkipped||(()=>!1),n=this.gos.get("groupRemoveSingleChildren"),o=this.gos.get("groupRemoveLowestSingleChildren"),a=null!=t.rowPositions||!!t.onlySelected,l=this.gos.get("groupHideOpenParents")&&!a,c=this.columnModel.isPivotMode()?s.leafGroup:!s.group,h=!!s.footer,d=(t.skipRowGroups,o&&s.leafGroup),u=1===s.allChildrenCount&&(n||d);if(!c&&!h&&(t.skipRowGroups||u||l)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned)return;if(-1===s.level&&!c&&!h)return;if(r(this.gos.addGridCommonParams({node:s})))return;const p=e.onNewBodyRow(s);if(i.forEach((e,t)=>{p.onColumn(e,t,s)}),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new dt,r=this.displayedGroupCreator.createDisplayedGroups(t,s,null);this.recursivelyAddHeaderGroups(r,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach((t,i)=>{e.onColumn(t,i,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,r=s.getType(),n="clientSide"===r,o="serverSide"===r,a=!n&&e.onlySelected,l=this.processRow.bind(this,i,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>s.getRow(e.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(l,!0):o?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);else if(e.onlySelectedAllPages||a){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(l)}else"all"===c?s.forEachNode(l):n||o?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,s)=>{var r,n,o,a;return null!=e.rowIndex&&null!=s.rowIndex?e.rowIndex-s.rowIndex:e.level===s.level?(null==(r=e.parent)?void 0:r.id)===(null==(n=s.parent)?void 0:n.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:null!=(o=e.rowIndex)?o:-1},{rowNode:s,currentPos:null!=(a=s.rowIndex)?a:-1}):i(e.parent,s.parent):e.level>s.level?i(e.parent,s):i(e,s.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getGridColumns(i);const r=this.gos.get("treeData");let n=[];return n=e&&!s?this.columnModel.getAllGridColumns():this.columnModel.getAllDisplayedColumns(),t&&!r&&(n=n.filter(e=>e.getColId()!==ut)),n}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(e=>{const t=e;t.getChildren&&t.getChildren().forEach(e=>s.push(e))}),e.length>0&&e[0]instanceof lt&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let r=0;t.forEach(e=>{const t=e;let n;n=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnModel.getDisplayNameForColumnGroup(t,"header");const o=t.getLeafColumns().reduce((e,t,i,s)=>{let r=lr.last(e);return"open"===t.getColumnGroupShow()?r&&null==r[1]||(r=[i],e.push(r)):r&&null==r[1]&&(r[1]=i-1),i===s.length-1&&r&&null==r[1]&&(r[1]=i),e},[]);s.onColumn(t,n||"",r++,t.getLeafColumns().length-1,o)})}};Sd([de("displayedGroupCreator")],Id.prototype,"displayedGroupCreator",2),Sd([de("columnModel")],Id.prototype,"columnModel",2),Sd([de("rowModel")],Id.prototype,"rowModel",2),Sd([de("pinnedRowModel")],Id.prototype,"pinnedRowModel",2),Sd([de("selectionService")],Id.prototype,"selectionService",2),Sd([de("rowNodeSorter")],Id.prototype,"rowNodeSorter",2),Sd([de("sortController")],Id.prototype,"sortController",2),Id=Sd([he("gridSerializer")],Id);var Rd={version:"31.3.4",moduleName:"@ag-grid-community/csv-export",beans:[Td,Id]},Pd="\r\n",kd=class{static createHeader(e={}){const t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),`<?xml ${t.map(t=>`${t}="${e[t]}"`).join(" ")} ?>`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(e=>{Object.keys(e.map).forEach(s=>{i+=this.returnAttributeIfPopulated(e.prefix+s,e.map[s],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(s=>{i+=this.returnAttributeIfPopulated(s,e.properties.rawMap[s],t)}));let s="<"+e.name+i;return e.children||null!=e.textNode?null!=e.textNode?s+">"+e.textNode+"</"+e.name+">"+Pd:(s+=">\r\n",e.children&&e.children.forEach(e=>{s+=this.createXml(e,t)}),s+"</"+e.name+">"+Pd):s+"/>"+Pd}static returnAttributeIfPopulated(e,t,i){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&i&&(s=i(t)),` ${e}="${s}"`}};function Ld(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}var Nd=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,i=0,s=0,r=0;for(let n=0;n<e.length;n++)i=e[n],s=255&(t^i),r=_d[s],t=t>>>8^r;return-1^t})("string"==typeof e?(new TextEncoder).encode(e):e):0,_d=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),{utf8_encode:Od}=lr,Fd=(e,t)=>wd(void 0,null,function*(){const{content:i}=e,{size:s,content:r}=i?Vd(i):{size:0,content:Uint8Array.from([])};let n,o,a=!1;if("file"===e.type&&r&&s>0){const e=yield(e=>wd(void 0,null,function*(){const t=new Blob([e]),{size:i,content:s}=yield(r=t,wd(void 0,null,function*(){let e=0;const t=[],i=new WritableStream({write:i=>{t.push(i),e+=i.length}}),s=new ReadableStream({start:e=>{const t=new FileReader;t.onload=t=>{var i;(null==(i=t.target)?void 0:i.result)&&e.enqueue(t.target.result),e.close()},t.readAsArrayBuffer(r)}}),n=new window.CompressionStream("deflate-raw");return yield s.pipeThrough(n).pipeTo(i),{size:e,content:new Blob(t)}}));var r;return{size:i,content:new Uint8Array(yield s.arrayBuffer())}}))(r);n=e.content,o=e.size,a=!0}const l=Bd(e,a,t,s,r,o);return bd(Cd({},l),{content:n||r,isCompressed:a})}),Gd=(e,t)=>{const{content:i}=e,{content:s}=i?Vd(i):{content:Uint8Array.from([])},r=Bd(e,!1,t,s.length,s,void 0);return bd(Cd({},r),{content:s,isCompressed:!1})},Bd=(e,t,i,s,r,n)=>{const{content:o,path:a,created:l}=e,c=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),h=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),d=Nd(r),u=void 0!==n?n:s,p=Od(a),g=p!==a;let m="";if(g){const e=Ld(1,1)+Ld(Nd(p),4)+p;m="up"+Ld(e.length,2)+e}const f="\0"+(g?"\0\b":"\0\0")+Ld(t?8:0,2)+Ld(c,2)+Ld(h,2)+Ld(u?d:0,4)+Ld(null!=n?n:s,4)+Ld(s,4)+Ld(p.length,2)+Ld(m.length,2),y="PK"+f+p+m,v="PK\0"+f+"\0\0\0\0\0\0"+(o?"\0\0\0\0":"\0\0\0")+Ld(i,4)+p+m;return{localFileHeader:Uint8Array.from(y,e=>e.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,e=>e.charCodeAt(0))}},Vd=e=>{let t;return t="string"==typeof e?(e=>{const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t})(atob(e.split(";base64,")[1])):e,{size:t.length,content:t}},Hd=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static getZipFile(e="application/zip"){return wd(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),i=new Uint8Array(0),s=0,r=0;for(const n of e){const{localFileHeader:e,centralDirectoryHeader:o,content:a}=n,l=new Uint8Array(t.length+e.length);l.set(t),l.set(e,t.length),t=l;const c=new Uint8Array(t.length+a.length);c.set(t),c.set(a,t.length),t=c;const h=new Uint8Array(i.length+o.length);h.set(i),h.set(o,i.length),i=h,s+=e.length+a.length,r+=o.length}const n=((e,t,i)=>{const s="PK\0\0\0\0"+Ld(e,2)+Ld(e,2)+Ld(t,4)+Ld(i,4)+"\0\0";return Uint8Array.from(s,e=>e.charCodeAt(0))})(e.length,r,s),o=new Uint8Array(t.length+i.length+n.length);return o.set(t),o.set(i,t.length),o.set(n,t.length+i.length),o}static buildCompressedFileStream(){return wd(this,null,function*(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=yield Fd(s,i),{localFileHeader:r,content:n}=e;t.push(e),i+=r.length+n.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=Gd(s,i),{localFileHeader:r,content:n}=e;t.push(e),i+=r.length+n.length}return this.packageFiles(t)}};Hd.folders=[],Hd.files=[],ne.__registerModules([td,hd,Rd],!1,void 0)},67748(e,t,i){var s,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})},c=(e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===i||r(e,l,{get:()=>t[l],enumerable:!(s=n(t,l))||s.enumerable});return e},h=(e,t,i)=>(c(e,t,"default"),i&&c(i,t,"default")),d=(e,t,i,s)=>{for(var o,a=s>1?void 0:s?n(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s?o(t,i,a):o(a))||a);return s&&a&&r(t,i,a),a},u={};l(u,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>qy.ALWAYS_SYNC_GLOBAL_EVENTS,AbstractHeaderCellCtrl:()=>Xy.AbstractHeaderCellCtrl,AdvancedFilterModule:()=>Fe,AgAbstractField:()=>Zy.AgAbstractField,AgAbstractLabel:()=>Qy.AgAbstractLabel,AgAutocomplete:()=>Jy.AgAutocomplete,AgCheckbox:()=>ev.AgCheckbox,AgDialog:()=>tv.AgDialog,AgGroupComponent:()=>iv.AgGroupComponent,AgInputDateField:()=>sv.AgInputDateField,AgInputNumberField:()=>rv.AgInputNumberField,AgInputRange:()=>nv.AgInputRange,AgInputTextArea:()=>ov.AgInputTextArea,AgInputTextField:()=>av.AgInputTextField,AgMenuItemComponent:()=>lv.AgMenuItemComponent,AgMenuItemRenderer:()=>cv.AgMenuItemRenderer,AgMenuList:()=>hv.AgMenuList,AgMenuPanel:()=>dv.AgMenuPanel,AgPanel:()=>uv.AgPanel,AgPickerField:()=>pv.AgPickerField,AgPromise:()=>gv.AgPromise,AgPromiseStatus:()=>mv.AgPromiseStatus,AgRadioButton:()=>fv.AgRadioButton,AgRichSelect:()=>yv.AgRichSelect,AgSelect:()=>vv.AgSelect,AgSlider:()=>Cv.AgSlider,AgStackComponentsRegistry:()=>bv.AgStackComponentsRegistry,AgToggleButton:()=>Sv.AgToggleButton,AlignedGridsService:()=>wv.AlignedGridsService,AnimateShowChangeCellRenderer:()=>xv.AnimateShowChangeCellRenderer,AnimateSlideCellRenderer:()=>Ev.AnimateSlideCellRenderer,AnimationFrameService:()=>Mv.AnimationFrameService,AutoScrollService:()=>Av.AutoScrollService,AutoWidthCalculator:()=>Tv.AutoWidthCalculator,Autowired:()=>Dv.Autowired,BarColumnLabelPlacement:()=>Iv.BarColumnLabelPlacement,BaseComponentWrapper:()=>Rv.BaseComponentWrapper,Bean:()=>Pv.Bean,BeanStub:()=>kv.BeanStub,Beans:()=>Lv.Beans,BodyDropPivotTarget:()=>Nv.BodyDropPivotTarget,BodyDropTarget:()=>_v.BodyDropTarget,CellComp:()=>Ov.CellComp,CellCtrl:()=>Fv.CellCtrl,CellNavigationService:()=>Gv.CellNavigationService,CellPositionUtils:()=>Bv.CellPositionUtils,CellRangeType:()=>Vv.CellRangeType,ChangedPath:()=>Hv.ChangedPath,ChartMappings:()=>Uv.ChartMappings,CheckboxCellEditor:()=>zv.CheckboxCellEditor,CheckboxCellRenderer:()=>Wv.CheckboxCellRenderer,CheckboxSelectionComponent:()=>jv.CheckboxSelectionComponent,ClientSideRowModelSteps:()=>Kv.ClientSideRowModelSteps,ClipboardModule:()=>pl,Column:()=>$v.Column,ColumnApi:()=>Yv.ColumnApi,ColumnFactory:()=>qv.ColumnFactory,ColumnGroup:()=>Xv.ColumnGroup,ColumnKeyCreator:()=>Zv.ColumnKeyCreator,ColumnModel:()=>Qv.ColumnModel,ColumnsToolPanelModule:()=>_h,Component:()=>Jv.Component,ComponentUtil:()=>eC.ComponentUtil,Context:()=>tC.Context,CssClassApplier:()=>iC.CssClassApplier,CssClassManager:()=>sC.CssClassManager,CtrlsService:()=>rC.CtrlsService,DataTypeService:()=>nC.DataTypeService,DateCellEditor:()=>oC.DateCellEditor,DateFilter:()=>aC.DateFilter,DateStringCellEditor:()=>lC.DateStringCellEditor,DisplayedGroupCreator:()=>cC.DisplayedGroupCreator,DragAndDropService:()=>hC.DragAndDropService,DragService:()=>dC.DragService,DragSourceType:()=>uC.DragSourceType,EnterpriseCoreModule:()=>D,Environment:()=>pC.Environment,EventService:()=>gC.EventService,Events:()=>mC.Events,ExcelExportModule:()=>ju,ExcelFactoryMode:()=>fC.ExcelFactoryMode,ExpansionService:()=>yC.ExpansionService,ExpressionService:()=>vC.ExpressionService,FilterManager:()=>CC.FilterManager,FilterWrapperComp:()=>bC.FilterWrapperComp,FiltersToolPanelModule:()=>mp,FloatingFilterMapper:()=>SC.FloatingFilterMapper,FocusService:()=>wC.FocusService,GROUP_AUTO_COLUMN_ID:()=>xC.GROUP_AUTO_COLUMN_ID,Grid:()=>EC.Grid,GridApi:()=>MC.GridApi,GridBodyComp:()=>AC.GridBodyComp,GridBodyCtrl:()=>TC.GridBodyCtrl,GridChartsModule:()=>Ja,GridComp:()=>DC.GridComp,GridCoreCreator:()=>IC.GridCoreCreator,GridCtrl:()=>RC.GridCtrl,GridHeaderComp:()=>PC.GridHeaderComp,GridHeaderCtrl:()=>kC.GridHeaderCtrl,GridOptionsService:()=>LC.GridOptionsService,GroupCellRenderer:()=>NC.GroupCellRenderer,GroupCellRendererCtrl:()=>_C.GroupCellRendererCtrl,GroupInstanceIdCreator:()=>OC.GroupInstanceIdCreator,HeaderCellCtrl:()=>FC.HeaderCellCtrl,HeaderFilterCellComp:()=>GC.HeaderFilterCellComp,HeaderFilterCellCtrl:()=>BC.HeaderFilterCellCtrl,HeaderGroupCellCtrl:()=>VC.HeaderGroupCellCtrl,HeaderNavigationDirection:()=>HC.HeaderNavigationDirection,HeaderNavigationService:()=>UC.HeaderNavigationService,HeaderPositionUtils:()=>zC.HeaderPositionUtils,HeaderRowComp:()=>WC.HeaderRowComp,HeaderRowContainerComp:()=>jC.HeaderRowContainerComp,HeaderRowContainerCtrl:()=>KC.HeaderRowContainerCtrl,HeaderRowCtrl:()=>$C.HeaderRowCtrl,HeaderRowType:()=>YC.HeaderRowType,HorizontalDirection:()=>qC.HorizontalDirection,HorizontalResizeService:()=>XC.HorizontalResizeService,KeyCode:()=>ZC.KeyCode,LargeTextCellEditor:()=>QC.LargeTextCellEditor,LayoutCssClasses:()=>JC.LayoutCssClasses,LicenseManager:()=>M,LocaleService:()=>eb.LocaleService,Logger:()=>tb.Logger,LoggerFactory:()=>ib.LoggerFactory,ManagedFocusFeature:()=>sb.ManagedFocusFeature,MasterDetailModule:()=>Ip,MenuModule:()=>cg,MenuService:()=>rb.MenuService,ModuleNames:()=>nb.ModuleNames,ModuleRegistry:()=>ob.ModuleRegistry,MouseEventService:()=>ab.MouseEventService,MoveColumnFeature:()=>lb.MoveColumnFeature,MultiFilter:()=>Mg,MultiFilterModule:()=>Tg,NavigationService:()=>cb.NavigationService,NumberCellEditor:()=>hb.NumberCellEditor,NumberFilter:()=>db.NumberFilter,NumberSequence:()=>ub.NumberSequence,Optional:()=>pb.Optional,PaginationProxy:()=>gb.PaginationProxy,PillDragComp:()=>mb.PillDragComp,PillDropZonePanel:()=>fb.PillDropZonePanel,PinnedRowModel:()=>yb.PinnedRowModel,PivotDropZonePanel:()=>uc,PopupComponent:()=>vb.PopupComponent,PopupEditorWrapper:()=>Cb.PopupEditorWrapper,PopupService:()=>bb.PopupService,PositionableFeature:()=>Sb.PositionableFeature,PostConstruct:()=>wb.PostConstruct,PreConstruct:()=>xb.PreConstruct,PreDestroy:()=>Eb.PreDestroy,PrimaryColsPanel:()=>wh,PropertyKeys:()=>Mb.PropertyKeys,ProvidedColumnGroup:()=>Ab.ProvidedColumnGroup,ProvidedFilter:()=>Tb.ProvidedFilter,Qualifier:()=>Db.Qualifier,QuerySelector:()=>Ib.QuerySelector,RangeSelectionModule:()=>dt,RefSelector:()=>Rb.RefSelector,ResizeObserverService:()=>Pb.ResizeObserverService,RichSelectModule:()=>Pg,RowAnimationCssClasses:()=>kb.RowAnimationCssClasses,RowContainerComp:()=>Lb.RowContainerComp,RowContainerCtrl:()=>Nb.RowContainerCtrl,RowContainerName:()=>_b.RowContainerName,RowContainerType:()=>Ob.RowContainerType,RowCtrl:()=>Fb.RowCtrl,RowGroupDropZonePanel:()=>dc,RowGroupingModule:()=>vc,RowHighlightPosition:()=>Gb.RowHighlightPosition,RowNode:()=>Bb.RowNode,RowNodeBlock:()=>Vb.RowNodeBlock,RowNodeBlockLoader:()=>Hb.RowNodeBlockLoader,RowNodeSorter:()=>Ub.RowNodeSorter,RowPositionUtils:()=>zb.RowPositionUtils,RowRenderer:()=>Wb.RowRenderer,ScalarFilter:()=>jb.ScalarFilter,ScrollVisibleService:()=>Kb.ScrollVisibleService,SelectCellEditor:()=>$b.SelectCellEditor,SelectableService:()=>Yb.SelectableService,SelectionHandleType:()=>qb.SelectionHandleType,ServerSideRowModelModule:()=>Tm,ServerSideTransactionResultStatus:()=>Xb.ServerSideTransactionResultStatus,SetFilter:()=>Xm,SetFilterModule:()=>tf,SetLeftFeature:()=>Zb.SetLeftFeature,SideBarModule:()=>Zc,SimpleFilter:()=>Qb.SimpleFilter,SortController:()=>Jb.SortController,SortIndicatorComp:()=>eS.SortIndicatorComp,SparklinesModule:()=>by,StandardMenuFactory:()=>tS.StandardMenuFactory,StatusBarModule:()=>Hy,StylingService:()=>iS.StylingService,TabGuardClassNames:()=>sS.TabGuardClassNames,TabGuardComp:()=>rS.TabGuardComp,TabGuardCtrl:()=>nS.TabGuardCtrl,TabbedLayout:()=>oS.TabbedLayout,TextCellEditor:()=>aS.TextCellEditor,TextFilter:()=>lS.TextFilter,TextFloatingFilter:()=>cS.TextFloatingFilter,Timer:()=>hS.Timer,ToolPanelColDefService:()=>qc,TooltipFeature:()=>dS.TooltipFeature,TooltipStateManager:()=>uS.TooltipStateManager,TouchListener:()=>pS.TouchListener,UserComponentFactory:()=>gS.UserComponentFactory,UserComponentRegistry:()=>mS.UserComponentRegistry,ValueCache:()=>fS.ValueCache,ValueService:()=>yS.ValueService,ValuesDropZonePanel:()=>Cc,VanillaFrameworkOverrides:()=>vS.VanillaFrameworkOverrides,VerticalDirection:()=>CS.VerticalDirection,ViewportRowModelModule:()=>Yy,VirtualList:()=>bS.VirtualList,VirtualListDragFeature:()=>SS.VirtualListDragFeature,_:()=>wS._,__FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT:()=>el,agCharts:()=>tl,createGrid:()=>xS.createGrid,exportMultipleSheetsAsExcel:()=>zu,getMultipleSheetsAsExcel:()=>Uu,getRowContainerTypeForName:()=>ES.getRowContainerTypeForName,provideGlobalGridOptions:()=>MS.provideGlobalGridOptions}),e.exports=(s=u,c(r({},"__esModule",{value:!0}),s));var p=i(98092),g=i(98092),m=i(98092),f=i(98092),y=i(98092),v=i(98092),C=i(98092),b=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(e,t){let i=e[0],s=e[1],r=e[2],n=e[3];i=this.ff(i,s,r,n,t[0],7,-680876936),n=this.ff(n,i,s,r,t[1],12,-389564586),r=this.ff(r,n,i,s,t[2],17,606105819),s=this.ff(s,r,n,i,t[3],22,-1044525330),i=this.ff(i,s,r,n,t[4],7,-176418897),n=this.ff(n,i,s,r,t[5],12,1200080426),r=this.ff(r,n,i,s,t[6],17,-1473231341),s=this.ff(s,r,n,i,t[7],22,-45705983),i=this.ff(i,s,r,n,t[8],7,1770035416),n=this.ff(n,i,s,r,t[9],12,-1958414417),r=this.ff(r,n,i,s,t[10],17,-42063),s=this.ff(s,r,n,i,t[11],22,-1990404162),i=this.ff(i,s,r,n,t[12],7,1804603682),n=this.ff(n,i,s,r,t[13],12,-40341101),r=this.ff(r,n,i,s,t[14],17,-1502002290),s=this.ff(s,r,n,i,t[15],22,1236535329),i=this.gg(i,s,r,n,t[1],5,-165796510),n=this.gg(n,i,s,r,t[6],9,-1069501632),r=this.gg(r,n,i,s,t[11],14,643717713),s=this.gg(s,r,n,i,t[0],20,-373897302),i=this.gg(i,s,r,n,t[5],5,-701558691),n=this.gg(n,i,s,r,t[10],9,38016083),r=this.gg(r,n,i,s,t[15],14,-660478335),s=this.gg(s,r,n,i,t[4],20,-405537848),i=this.gg(i,s,r,n,t[9],5,568446438),n=this.gg(n,i,s,r,t[14],9,-1019803690),r=this.gg(r,n,i,s,t[3],14,-187363961),s=this.gg(s,r,n,i,t[8],20,1163531501),i=this.gg(i,s,r,n,t[13],5,-1444681467),n=this.gg(n,i,s,r,t[2],9,-51403784),r=this.gg(r,n,i,s,t[7],14,1735328473),s=this.gg(s,r,n,i,t[12],20,-1926607734),i=this.hh(i,s,r,n,t[5],4,-378558),n=this.hh(n,i,s,r,t[8],11,-2022574463),r=this.hh(r,n,i,s,t[11],16,1839030562),s=this.hh(s,r,n,i,t[14],23,-35309556),i=this.hh(i,s,r,n,t[1],4,-1530992060),n=this.hh(n,i,s,r,t[4],11,1272893353),r=this.hh(r,n,i,s,t[7],16,-155497632),s=this.hh(s,r,n,i,t[10],23,-1094730640),i=this.hh(i,s,r,n,t[13],4,681279174),n=this.hh(n,i,s,r,t[0],11,-358537222),r=this.hh(r,n,i,s,t[3],16,-722521979),s=this.hh(s,r,n,i,t[6],23,76029189),i=this.hh(i,s,r,n,t[9],4,-640364487),n=this.hh(n,i,s,r,t[12],11,-421815835),r=this.hh(r,n,i,s,t[15],16,530742520),s=this.hh(s,r,n,i,t[2],23,-995338651),i=this.ii(i,s,r,n,t[0],6,-198630844),n=this.ii(n,i,s,r,t[7],10,1126891415),r=this.ii(r,n,i,s,t[14],15,-1416354905),s=this.ii(s,r,n,i,t[5],21,-57434055),i=this.ii(i,s,r,n,t[12],6,1700485571),n=this.ii(n,i,s,r,t[3],10,-1894986606),r=this.ii(r,n,i,s,t[10],15,-1051523),s=this.ii(s,r,n,i,t[1],21,-2054922799),i=this.ii(i,s,r,n,t[8],6,1873313359),n=this.ii(n,i,s,r,t[15],10,-30611744),r=this.ii(r,n,i,s,t[6],15,-1560198380),s=this.ii(s,r,n,i,t[13],21,1309151649),i=this.ii(i,s,r,n,t[4],6,-145523070),n=this.ii(n,i,s,r,t[11],10,-1120210379),r=this.ii(r,n,i,s,t[2],15,718787259),s=this.ii(s,r,n,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(n,e[3])}cmn(e,t,i,s,r,n){return t=this.add32(this.add32(t,e),this.add32(s,n)),this.add32(t<<r|t>>>32-r,i)}ff(e,t,i,s,r,n,o){return this.cmn(t&i|~t&s,e,t,r,n,o)}gg(e,t,i,s,r,n,o){return this.cmn(t&s|i&~s,e,t,r,n,o)}hh(e,t,i,s,r,n,o){return this.cmn(t^i^s,e,t,r,n,o)}ii(e,t,i,s,r,n,o){return this.cmn(i^(t|~s),e,t,r,n,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)r[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(r[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,r),s=0;s<16;s++)r[s]=0;return r[14]=8*t,this.md5cycle(i,r),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>8*s+4&15]+t[e>>8*s&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}};function S(e){return null==e||0===e.length}var w={"01":"GRID","02":"CHARTS","0102":"BOTH"},x=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new b,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey),i=`AG Grid ${"BOTH"===t.currentLicenseType?"and AG Charts ":""}Enterprise`,s=void 0===t.suppliedLicenseType?"":`AG ${"BOTH"===t.suppliedLicenseType?"Grid and AG Charts":"GRID"===t.suppliedLicenseType?"Grid":"Charts"} Enterprise`;if(t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(i);else if(t.expired){const r=e.getGridReleaseDate(),n=e.formatDate(r);this.outputExpiredKey(t.expiry,n,i,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,r=i.substring(s),n=i.substring(0,s),[o,a,l]=e.extractBracketedInformation(i);return{md5:r,license:n,version:o,isTrial:a,type:l}}getLicenseDetails(t){const i=e.chartsLicenseManager?"BOTH":"GRID";if(S(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:i};const s=e.getGridReleaseDate(),{md5:r,license:n,version:o,isTrial:a,type:l}=e.extractLicenseComponents(t);let c,h,d,u=r===this.md5.md5(n)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),p=null,g=!1;function m(){c=p<new Date,h=void 0}if(u&&(p=e.extractExpiry(n),u=!isNaN(p.getTime()),u))switch(h=s>p,o){case"legacy":case"2":a&&m();break;case"3":S(l)?u=!1:(d=l,l!==w["01"]&&l!==w["0102"]||"BOTH"===i&&"BOTH"!==d?(u=!1,g=!0):a&&m())}return u?{licenseKey:t,valid:u,expiry:e.formatDate(p),expired:h,version:o,isTrial:a,trialExpired:c,incorrectLicenseType:g,currentLicenseType:i,suppliedLicenseType:d}:{licenseKey:t,valid:u,incorrectLicenseType:g,currentLicenseType:i,suppliedLicenseType:d}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!S(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const e=(this.document.defaultView||window).location,{hostname:t=""}=e;return t}isForceWatermark(){const e=(this.document.defaultView||window).location,{pathname:t}=e;return!!t&&-1!==t.indexOf("forceWatermark")}isWebsiteUrl(){return null!==this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)}isLocalhost(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)}static formatDate(e){const t=e.getDate(),i=e.getMonth(),s=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+s}static getGridReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,r,n,o,a,l,c,h="",d=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)o=i.indexOf(u.charAt(d++)),a=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),s=o<<2|a>>4,r=(15&a)<<4|l>>2,n=(3&l)<<6|c,h+=String.fromCharCode(s),64!=l&&(h+=String.fromCharCode(r)),64!=c&&(h+=String.fromCharCode(n));return h=e.utf8_decode(h),h}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);s<128?t+=String.fromCharCode(s):s>127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}static setChartsLicenseManager(e){this.chartsLicenseManager=e}static setLicenseKey(e){this.licenseKey=e,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(e,!0)}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const i=1===t.filter(e=>"TRIAL"===e).length,s=t.filter(e=>0===e.indexOf("v"))[0];return[s?s.replace("v",""):"legacy",i,w[t.filter(e=>w[e])[0]]]}centerPadAndOutput(e){const t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,t="*",i=""){console.error(e.padEnd(this.totalMessageLength-i.length,t)+i)}outputInvalidLicenseKey(e,t,i){e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to obtain a combined license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid - please contact info@ag-grid.com to obtain a valid license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,t,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,t,i,s){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};x.RELEASE_INFORMATION="MTcxNTc3NTcyODYxNg==";var E=x,M=class extends C.BeanStub{validateLicense(){this.licenseManager=new E(this.gos.getDocument()),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new E(null).getLicenseDetails(e)}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){E.setLicenseKey(e)}static setChartsLicenseManager(e){E.setChartsLicenseManager(e)}};d([C.PreConstruct],M.prototype,"validateLicense",1),M=d([(0,C.Bean)("licenseManager")],M);var A=i(98092),T=class extends A.Component{constructor(){super('<div class="ag-watermark">\n                <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n            </div>')}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}};d([(0,A.Autowired)("licenseManager")],T.prototype,"licenseManager",2),d([(0,A.RefSelector)("eLicenseTextRef")],T.prototype,"eLicenseTextRef",2),d([A.PostConstruct],T.prototype,"postConstruct",1);var D={version:"31.3.4",moduleName:v.ModuleNames.EnterpriseCoreModule,beans:[M],agStackComponents:[{componentName:"AgWatermark",componentClass:T}]},I=i(98092),R=i(98092),P=i(98092),k=i(98092),L=i(98092),N=i(98092),_=i(98092),O=i(98092),F=i(98092),G=i(98092),B=i(98092),V=i(98092),H=i(98092),U=i(98092),z=i(98092),W=Object.defineProperty,j=Object.defineProperties,K=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,Z=(e,t,i)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Q=(e,t)=>{for(var i in t||(t={}))q.call(t,i)&&Z(e,i,t[i]);if(Y)for(var i of Y(t))X.call(t,i)&&Z(e,i,t[i]);return e},J=(e,t)=>j(e,$(t)),ee=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?K(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&W(t,i,n),n},te=class extends P.Component{constructor(e){super('\n            <div class="ag-advanced-filter-header" role="row">\n            </div>'),this.enabled=e}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter)),this.addManagedListener(this.eventService,P.Events.EVENT_GRID_COLUMNS_CHANGED,()=>this.onGridColumnsChanged()),this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addGuiEventListener("focusout",e=>{this.getFocusableElement().contains(e.relatedTarget)||this.focusService.clearAdvancedFilterColumn()})}getFocusableElement(){var e,t;return null!=(t=null==(e=this.eAdvancedFilter)?void 0:e.getGui())?t:this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){var e;null==(e=this.eAdvancedFilter)||e.refresh()}getHeight(){return this.height}setInputDisabled(e){var t;null==(t=this.eAdvancedFilter)||t.setInputDisabled(e)}setupAdvancedFilter(e){const t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new ye);const e=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCssClass("ag-advanced-filter-header-cell"),this.height=this.columnModel.getFloatingFiltersHeight();const i=`${this.height}px`;t.style.height=i,t.style.minHeight=i,this.setAriaRowIndex(),P._.setAriaRole(e,"gridcell"),P._.setAriaColIndex(e,1),this.setAriaColumnCount(e),t.appendChild(e)}else P._.clearElement(t),this.destroyBean(this.eAdvancedFilter),this.height=0;P._.setDisplayed(t,e),this.enabled=e}setAriaColumnCount(e){P._.setAriaColSpan(e,this.columnModel.getAllGridColumns().length)}setAriaRowIndex(){P._.setAriaRowIndex(this.getGui(),this.headerNavigationService.getHeaderRowCount())}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case P.KeyCode.ENTER:this.hasFocus()&&this.focusService.focusInto(this.getFocusableElement())&&e.preventDefault();break;case P.KeyCode.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case P.KeyCode.UP:this.navigateUpDown(!0,e);break;case P.KeyCode.DOWN:this.navigateUpDown(!1,e);break;case P.KeyCode.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{const t=this.focusService.findNextFocusableElement(this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}}}navigateUpDown(e,t){this.hasFocus()&&this.focusService.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusService.focusLastHeader():this.focusService.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return this.gos.getActiveDomElement()===this.getFocusableElement()}};ee([(0,P.Autowired)("columnModel")],te.prototype,"columnModel",2),ee([(0,P.Autowired)("focusService")],te.prototype,"focusService",2),ee([(0,P.Autowired)("headerNavigationService")],te.prototype,"headerNavigationService",2),ee([P.PostConstruct],te.prototype,"postConstruct",1);var ie=class extends N.AgRichSelect{constructor(e){super(J(Q({},e),{template:'\n                <div class="ag-picker-field" role="presentation">\n                    <div ref="eLabel"></div>\n                    <div ref="eWrapper" class="ag-wrapper ag-picker-collapsed">\n                        <div ref="eDisplayField" class="ag-picker-field-display"></div>\n                        <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n                        <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n                    </div>\n                </div>'})),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;N._.setDisplayed(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),N._.setAriaLabelledBy(this.eWrapper,""),N._.setAriaLabel(this.eWrapper,t)}onEnterKeyDown(e){N._.stopPropagationForAgGrid(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},se=class e extends _.BeanStub{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new _.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:_.DragSourceType.AdvancedFilterBuilder,listItemDragStartEvent:e.EVENT_DRAG_STARTED,listItemDragEndEvent:e.EVENT_DRAG_ENDED,eventSource:this,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:()=>!1,getNumRows:e=>e.getNumItems(),moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.item}moveItem(e,t){this.comp.moveItem(e,t)}};se.EVENT_DRAG_STARTED="advancedFilterBuilderDragStarted",se.EVENT_DRAG_ENDED="advancedFilterBuilderDragEnded",ee([_.PostConstruct],se.prototype,"postConstruct",1);var re=se,ne=class extends O.BeanStub{constructor(e,t,i){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=i}postConstruct(){this.addManagedListener(this.eGui,"keydown",e=>{switch(e.key){case O.KeyCode.TAB:e.defaultPrevented||O._.stopPropagationForAgGrid(e);break;case O.KeyCode.UP:case O.KeyCode.DOWN:O._.stopPropagationForAgGrid(e);break;case O.KeyCode.ESCAPE:if(O._.isStopPropagationForAgGrid(e))return;this.eGui.contains(this.gos.getActiveDomElement())&&(e.preventDefault(),O._.stopPropagationForAgGrid(e),this.focusWrapper.focus())}}),this.addManagedListener(this.focusWrapper,"keydown",e=>{if(e.key===O.KeyCode.ENTER){if(O._.isStopPropagationForAgGrid(e))return;this.gos.getActiveDomElement()===this.focusWrapper&&(e.preventDefault(),O._.stopPropagationForAgGrid(e),this.eFocusableComp.getFocusableElement().focus())}}),this.addManagedListener(this.focusWrapper,"focusin",()=>{this.focusWrapper.classList.add("ag-advanced-filter-builder-virtual-list-item-highlight")}),this.addManagedListener(this.focusWrapper,"focusout",e=>{this.focusWrapper.contains(e.relatedTarget)||this.focusWrapper.classList.remove("ag-advanced-filter-builder-virtual-list-item-highlight")})}};function oe(e,t){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:e("advancedFilterBuilderAddCondition")},{key:"join",displayValue:e("advancedFilterBuilderAddJoin")}],valueFormatter:e=>{var t;return null==e?null:null!=(t=e.displayValue)?t:e.key},pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${null!=t?t:120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:e("advancedFilterBuilderAddButtonTooltip")}}ee([O.PostConstruct],ne.prototype,"postConstruct",1);var ae=class{};ae.EVENT_ADDED="advancedFilterBuilderAdded",ae.EVENT_MOVED="advancedFilterBuilderMoved",ae.EVENT_REMOVED="advancedFilterBuilderRemoved",ae.EVENT_VALUE_CHANGED="advancedFilterBuilderValueChanged",ae.EVENT_VALID_CHANGED="advancedFilterBuilderValidChanged";var le=class extends F.Component{constructor(){super('\n            <div class="ag-advanced-filter-builder-item-condition" role="presentation"></div>\n        '),this.validationMessage=null}init(e){const{item:t,createPill:i}=e;this.item=t,this.createPill=i,this.filterModel=t.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advancedFilterExpressionService.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){var t;const i=this.advancedFilterExpressionService.getColumnDetails(e.colId);this.baseCellDataType=i.baseCellDataType,this.column=i.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:null!=(t=this.getColumnDisplayValue())?t:this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advancedFilterExpressionService.getColumnAutocompleteEntries()}),update:e=>this.setColumnKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),F._.exists(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){var e;this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:null!=(e=this.getOperatorDisplayValue())?e:this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:e=>this.setOperatorKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){var e;const t=null!=(e=this.getOperandDisplayValue())?e:"";this.eOperandPill=this.createPill({key:t,displayValue:t,baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:e=>this.setOperand(e),ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advancedFilterExpressionService.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advancedFilterExpressionService.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advancedFilterExpressionService.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advancedFilterExpressionService.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();const t=this.advancedFilterExpressionService.getColumnDetails(e);this.column=t.column;const i=t.baseCellDataType;this.baseCellDataType!==i&&(this.baseCellDataType=i,this.setOperatorKey(void 0),this.eOperatorPill&&(F._.removeFromParent(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){const t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,0===t?this.destroyOperandPill():(this.createOperandPill(),"number"!==this.baseCellDataType&&this.setOperand(""))),this.filterModel.type=e,this.validate()}setOperand(e){var t;let i=e;this.column&&(i=null!=(t=this.advancedFilterExpressionService.getOperandModelValue(e,this.baseCellDataType,this.column))?t:""),this.filterModel.filter=i,this.validate()}getNumOperands(e){var t,i;return null!=(i=null==(t=this.advancedFilterExpressionService.getExpressionOperator(this.baseCellDataType,e))?void 0:t.numOperands)?i:0}destroyOperandPill(){delete this.filterModel.filter,this.getGui().removeChild(this.eOperandPill.getGui()),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;F._.exists(this.getColumnKey())?F._.exists(this.getOperatorKey())?this.numOperands>0&&!F._.exists(this.getOperandDisplayValue())&&(e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationEnterValue")):e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationSelectOption"):e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationSelectColumn"),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchEvent({type:ae.EVENT_VALID_CHANGED}))}getDefaultColumnDisplayValue(){return this.advancedFilterExpressionService.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advancedFilterExpressionService.translate("advancedFilterBuilderSelectOption")}};ee([(0,F.Autowired)("advancedFilterExpressionService")],le.prototype,"advancedFilterExpressionService",2),ee([(0,F.Autowired)("valueService")],le.prototype,"valueService",2);var ce=class extends G.Component{constructor(e){super('\n            <div class="ag-advanced-filter-builder-pill-wrapper" role="presentation">\n                <div ref="ePill" class="ag-advanced-filter-builder-pill" role="button">\n                    <span ref="eLabel" class="ag-advanced-filter-builder-pill-display"></span>\n                </div>\n            </div>\n        '),this.params=e,this.value=e.value}postConstruct(){const{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,G._.setAriaDescribedBy(this.ePill,this.eLabel.id),G._.setAriaLabel(this.ePill,t),this.renderValue(),this.addManagedListener(this.ePill,"click",e=>{e.preventDefault(),this.showEditor()}),this.addManagedListener(this.ePill,"keydown",e=>{e.key===G.KeyCode.ENTER&&(e.preventDefault(),G._.stopPropagationForAgGrid(e),this.showEditor())}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;G._.setDisplayed(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);const e=this.eEditor.getGui();this.eEditor.addManagedListener(e,"keydown",e=>{switch(e.key){case G.KeyCode.ENTER:e.preventDefault(),G._.stopPropagationForAgGrid(e),this.updateValue(!0);break;case G.KeyCode.ESCAPE:e.preventDefault(),G._.stopPropagationForAgGrid(e),this.hideEditor(!0)}}),this.eEditor.addManagedListener(e,"focusout",()=>{this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){let t;switch(e){case"text":t=new G.AgInputTextField;break;case"number":t=new G.AgInputNumberField;break;case"date":t=new G.AgInputDateField}return this.createBean(t)}hideEditor(e){const{eEditor:t}=this;t&&(this.eEditor=void 0,this.getGui().removeChild(t.getGui()),this.destroyBean(t),G._.setDisplayed(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e;this.eLabel.classList.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),G._.exists(this.value)?"number"===this.params.type?(e=this.value,this.eLabel.classList.add("ag-advanced-filter-builder-value-number")):(e=`"${this.value}"`,this.eLabel.classList.add("ag-advanced-filter-builder-value-text")):(e=this.advancedFilterExpressionService.translate("advancedFilterBuilderEnterValue"),this.eLabel.classList.add("ag-advanced-filter-builder-value-empty")),this.eLabel.innerText=e}updateValue(e){var t;if(!this.eEditor)return;const i=null!=(t=this.eEditor.getValue())?t:"";this.dispatchEvent({type:G.Events.EVENT_FIELD_VALUE_CHANGED,value:i}),this.value=i,this.renderValue(),this.hideEditor(e)}};ee([(0,G.RefSelector)("ePill")],ce.prototype,"ePill",2),ee([(0,G.RefSelector)("eLabel")],ce.prototype,"eLabel",2),ee([(0,G.Autowired)("advancedFilterExpressionService")],ce.prototype,"advancedFilterExpressionService",2),ee([G.PostConstruct],ce.prototype,"postConstruct",1);var he=class extends B.Component{constructor(){super('\n            <div class="ag-advanced-filter-builder-item-condition" role="presentation"></div>\n        ')}init(e){const{item:t,createPill:i}=e,s=t.filterModel;this.filterModel=s,this.ePill=i({key:s.type,displayValue:this.advancedFilterExpressionService.parseJoinOperator(s),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advancedFilterExpressionService.getJoinOperatorAutocompleteEntries()}),update:e=>s.type=e,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advancedFilterExpressionService.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}};ee([(0,B.Autowired)("advancedFilterExpressionService")],he.prototype,"advancedFilterExpressionService",2);var de=class extends V.AgRichSelect{constructor(e){super(J(Q({},e),{template:'\n                <div class="ag-picker-field ag-advanced-filter-builder-pill-wrapper" role="presentation">\n                    <div ref="eLabel"></div>\n                    <div ref="eWrapper" class="ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed">\n                        <div ref="eDisplayField" class="ag-picker-field-display ag-advanced-filter-builder-pill-display"></div>\n                        <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n                        <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n                    </div>\n                </div>'})),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),V._.setAriaLabelledBy(this.eWrapper,""),V._.setAriaLabel(this.eWrapper,t)}createPickerComponent(){var e;if(!this.values){const{values:t}=this.params.getEditorParams();this.values=t;const i=this.value.key,s=null!=(e=t.find(e=>e.key===i))?e:{key:i,displayValue:this.value.displayValue};this.value=s}return super.createPickerComponent()}onEnterKeyDown(e){V._.stopPropagationForAgGrid(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},ue=class extends L.TabGuardComp{constructor(e,t,i){super('\n            <div class="ag-advanced-filter-builder-item-wrapper" role="presentation">\n                <div ref="eItem" class="ag-advanced-filter-builder-item" role="presentation">\n                    <div ref="eTreeLines" class="ag-advanced-filter-builder-item-tree-lines" aria-hidden="true"></div>\n                    <span ref="eDragHandle" class="ag-drag-handle" aria-hidden="true"></span>\n                    <span ref="eValidation" class="ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid" aria-hidden="true"></span>\n                </div>\n                <div ref="eButtons" class="ag-advanced-filter-builder-item-buttons">\n                    <span ref="eMoveUpButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                    <span ref="eMoveDownButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                    <div ref="eAddButton" role="presentation"></div>\n                    <span ref="eRemoveButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                </div>\n            </div>\n        '),this.item=e,this.dragFeature=t,this.focusWrapper=i,this.moveUpDisabled=!1,this.moveDownDisabled=!1}postConstruct(){const{filterModel:e,level:t,showMove:i}=this.item,s="join"===e.filterType;if(this.ePillWrapper=this.createManagedBean(s?new he:new le),this.ePillWrapper.init({item:this.item,createPill:e=>this.createPill(e)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),0===t){const e=document.createElement("div");e.classList.add("ag-advanced-filter-builder-item-tree-line-vertical-bottom"),e.classList.add("ag-advanced-filter-builder-item-tree-line-root"),this.eTreeLines.appendChild(e),L._.setDisplayed(this.eDragHandle,!1),L._.setDisplayed(this.eButtons,!1),L._.setAriaExpanded(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(L._.createIconNoSpan("advancedFilterBuilderDrag",this.gos)),this.setupValidation(),this.setupMoveButtons(i),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();L._.setAriaLevel(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new ne(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListener(this.ePillWrapper,ae.EVENT_VALUE_CHANGED,()=>this.dispatchEvent({type:ae.EVENT_VALUE_CHANGED})),this.addManagedListener(this.ePillWrapper,ae.EVENT_VALID_CHANGED,()=>this.updateValidity())}setState(e){const{level:t}=this.item;if(0===t)return;const{showMove:i}=this.item,{disableMoveUp:s,disableMoveDown:r,treeLines:n,showStartTreeLine:o}=e;this.updateTreeLines(n,o),this.updateAriaExpanded(),i&&(this.moveUpDisabled=!!s,this.moveDownDisabled=!!r,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",s),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",r),L._.setAriaDisabled(this.eMoveUpButton,!!s),L._.setAriaDisabled(this.eMoveDownButton,!!r),this.moveUpTooltipFeature.refreshToolTip(),this.moveDownTooltipFeature.refreshToolTip())}focusMoveButton(e){(e?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(e){for(let t=0;t<e;t++){const e=document.createElement("div");this.eTreeLines.appendChild(e)}}updateTreeLines(e,t){const i=e.length-1,{children:s}=this.eTreeLines;for(let t=0;t<i;t++){const i=s.item(t);i&&i.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!e[t])}const r=s.item(i);if(r){r.classList.add("ag-advanced-filter-builder-item-tree-line-horizontal");const t=e[i];r.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-top",t),r.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!t)}this.eDragHandle.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-bottom",t)}setupValidation(){this.eValidation.appendChild(L._.createIconNoSpan("advancedFilterBuilderInvalid",this.gos)),this.validationTooltipFeature=this.createManagedBean(new L.TooltipFeature({getGui:()=>this.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){var e;const t=oe(e=>this.advancedFilterExpressionService.translate(e),null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.addSelectWidth),i=this.createManagedBean(new ie(t));this.addManagedListener(i,L.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>this.dispatchEvent({type:ae.EVENT_ADDED,item:this.item,isJoin:"join"===e.key})),this.eAddButton.appendChild(i.getGui()),this.createManagedBean(new L.TooltipFeature({getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(L._.createIconNoSpan("advancedFilterBuilderRemove",this.gos)),this.addManagedListener(this.eRemoveButton,"click",()=>this.removeItem()),this.addManagedListener(this.eRemoveButton,"keydown",e=>{e.key===L.KeyCode.ENTER&&(e.preventDefault(),L._.stopPropagationForAgGrid(e),this.removeItem())}),this.createManagedBean(new L.TooltipFeature({getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderRemoveButtonTooltip")})),L._.setAriaLabel(this.eRemoveButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(L._.createIconNoSpan("advancedFilterBuilderMoveUp",this.gos)),this.addManagedListener(this.eMoveUpButton,"click",()=>this.moveItem(!0)),this.addManagedListener(this.eMoveUpButton,"keydown",e=>{e.key===L.KeyCode.ENTER&&(e.preventDefault(),L._.stopPropagationForAgGrid(e),this.moveItem(!0))}),this.moveUpTooltipFeature=this.createManagedBean(new L.TooltipFeature({getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveUpButtonTooltip")})),L._.setAriaLabel(this.eMoveUpButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(L._.createIconNoSpan("advancedFilterBuilderMoveDown",this.gos)),this.addManagedListener(this.eMoveDownButton,"click",()=>this.moveItem(!1)),this.addManagedListener(this.eMoveDownButton,"keydown",e=>{e.key===L.KeyCode.ENTER&&(e.preventDefault(),L._.stopPropagationForAgGrid(e),this.moveItem(!1))}),this.moveDownTooltipFeature=this.createManagedBean(new L.TooltipFeature({getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveDownButtonTooltip")})),L._.setAriaLabel(this.eMoveDownButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(L._.setDisplayed(this.eMoveUpButton,!1),L._.setDisplayed(this.eMoveDownButton,!1))}updateValidity(){L._.setVisible(this.eValidation,!this.item.valid),this.validationTooltipFeature.refreshToolTip(),this.updateAriaLabel()}createPill(e){var t,i;const{key:s,displayValue:r,cssClass:n,update:o,ariaLabel:a}=e,l=e=>{null!=e&&(o(e),this.dispatchEvent({type:ae.EVENT_VALUE_CHANGED}))};if(e.isSelect){const{getEditorParams:o,pickerAriaLabelKey:c,pickerAriaLabelValue:h}=e,d=this.gos.get("advancedFilterBuilderParams"),u=`${null!=(t=null==d?void 0:d.pillSelectMinWidth)?t:140}px`,p=`${null!=(i=null==d?void 0:d.pillSelectMaxWidth)?i:200}px`,g=this.createBean(new de({pickerAriaLabelKey:c,pickerAriaLabelValue:h,pickerType:"ag-list",value:{key:s,displayValue:r},valueFormatter:e=>{var t;return null==e?null:null!=(t=e.displayValue)?t:e.key},variableWidth:!0,minPickerWidth:u,maxPickerWidth:p,getEditorParams:o,wrapperClassName:n,ariaLabel:a}));return this.addManagedListener(g,L.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>l(null==e?void 0:e.key)),g}{const t=this.createBean(new ce({value:r,cssClass:n,type:this.getInputType(e.baseCellDataType),ariaLabel:a}));return this.addManagedListener(t,L.Events.EVENT_FIELD_VALUE_CHANGED,({value:e})=>l(e)),t}}getInputType(e){switch(e){case"text":case"object":case"boolean":return"text";case"number":return"number";case"date":case"dateString":return"date"}}setupDragging(){const e={type:L.DragSourceType.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>L.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchEvent({type:re.EVENT_DRAG_STARTED,item:this.item}),onDragStopped:()=>this.dragFeature.dispatchEvent({type:re.EVENT_DRAG_ENDED})};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}updateAriaLabel(){const e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,i=this.ePillWrapper.getValidationMessage();let s;s=i?this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItemValidation",[e,t,i]):this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItem",[e,t]),L._.setAriaLabel(this.focusWrapper,s)}updateAriaExpanded(){L._.removeAriaExpanded(this.focusWrapper);const{filterModel:e}=this.item;"join"===(null==e?void 0:e.filterType)&&e.conditions.length&&L._.setAriaExpanded(this.focusWrapper,!0)}removeItem(){this.dispatchEvent({type:ae.EVENT_REMOVED,item:this.item})}moveItem(e){this.dispatchEvent({type:ae.EVENT_MOVED,item:this.item,backwards:e})}};ee([(0,L.RefSelector)("eTreeLines")],ue.prototype,"eTreeLines",2),ee([(0,L.RefSelector)("eDragHandle")],ue.prototype,"eDragHandle",2),ee([(0,L.RefSelector)("eItem")],ue.prototype,"eItem",2),ee([(0,L.RefSelector)("eButtons")],ue.prototype,"eButtons",2),ee([(0,L.RefSelector)("eValidation")],ue.prototype,"eValidation",2),ee([(0,L.RefSelector)("eMoveUpButton")],ue.prototype,"eMoveUpButton",2),ee([(0,L.RefSelector)("eMoveDownButton")],ue.prototype,"eMoveDownButton",2),ee([(0,L.RefSelector)("eAddButton")],ue.prototype,"eAddButton",2),ee([(0,L.RefSelector)("eRemoveButton")],ue.prototype,"eRemoveButton",2),ee([(0,L.Autowired)("beans")],ue.prototype,"beans",2),ee([(0,L.Autowired)("dragAndDropService")],ue.prototype,"dragAndDropService",2),ee([(0,L.Autowired)("advancedFilterExpressionService")],ue.prototype,"advancedFilterExpressionService",2),ee([L.PostConstruct],ue.prototype,"postConstruct",1);var pe=class extends H.Component{constructor(e,t){super('\n            <div class="ag-advanced-filter-builder-item-wrapper" role="presentation">\n                <div ref="eItem" class="ag-advanced-filter-builder-item" role="presentation">\n                    <div class="ag-advanced-filter-builder-item-tree-lines" aria-hidden="true">\n                        <div class="ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal"></div>\n                    </div>\n                </div>\n            </div>\n        '),this.item=e,this.focusWrapper=t}postConstruct(){var e;H._.setAriaLevel(this.focusWrapper,2);const t=oe(e=>this.advancedFilterExpressionService.translate(e),null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.addSelectWidth),i=this.createManagedBean(new ie(t));this.addManagedListener(i,H.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>{this.dispatchEvent({type:ae.EVENT_ADDED,item:this.item,isJoin:"join"===e.key})}),this.eItem.appendChild(i.getGui()),this.createManagedBean(new H.TooltipFeature({getGui:()=>i.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new ne(this.getGui(),this.focusWrapper,i)),H._.setAriaLabel(this.focusWrapper,this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItem",[this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}};ee([(0,H.Autowired)("beans")],pe.prototype,"beans",2),ee([(0,H.Autowired)("advancedFilterExpressionService")],pe.prototype,"advancedFilterExpressionService",2),ee([(0,H.RefSelector)("eItem")],pe.prototype,"eItem",2),ee([H.PostConstruct],pe.prototype,"postConstruct",1);var ge=class extends k.Component{constructor(){super('\n            <div role="presentation" class="ag-advanced-filter-builder" tabindex="-1">\n                <div role="presentation" class="ag-advanced-filter-builder-list" ref="eList"></div>\n                <div role="presentation" class="ag-advanced-filter-builder-button-panel">\n                    <button class="ag-button ag-standard-button ag-advanced-filter-builder-apply-button" ref="eApplyFilterButton"></button>\n                    <button class="ag-button ag-standard-button ag-advanced-filter-builder-cancel-button" ref="eCancelFilterButton"></button>\n                </div>\n            </div>'),this.validationMessage=null}postConstruct(){var e;const{showMoveButtons:t}=null!=(e=this.gos.get("advancedFilterBuilderParams"))?e:{};this.showMove=!!t,this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:e})=>{this.showMove=!!(null==e?void 0:e.showMoveButtons),this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new re(this,this.virtualList)),this.setupButtons()}refresh(){let e=this.virtualList.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),null!=e&&(this.virtualList.getComponentAt(e)||(e=0),this.virtualList.focusRow(e))}getNumItems(){return this.items.length}moveItem(e,t){t&&e&&this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.focusRow(0)}setupVirtualList(){this.virtualList=this.createManagedBean(new k.VirtualList({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderList")})),this.virtualList.setComponentCreator(this.createItemComponent.bind(this)),this.virtualList.setComponentUpdater(this.updateItemComponent.bind(this)),this.virtualList.setRowHeight(40),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.items.length,getRow:e=>this.items[e],areRowsEqual:(e,t)=>e===t}),this.buildList(),this.virtualList.refresh()}setupButtons(){this.eApplyFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilderApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedListener(this.eApplyFilterButton,"click",()=>{this.advancedFilterService.setModel(this.filterModel),this.filterManager.onFilterChanged({source:"advancedFilter"}),this.close()}),this.validationTooltipFeature=this.createManagedBean(new k.TooltipFeature({getGui:()=>this.eApplyFilterButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.validationMessage,getTooltipShowDelayOverride:()=>1e3})),this.validate(),this.addManagedListener(this.eApplyFilterButton,"mouseenter",()=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",!0)),this.addManagedListener(this.eApplyFilterButton,"mouseleave",()=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",!1)),this.eCancelFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilderCancel"),this.activateTabIndex([this.eCancelFilterButton]),this.addManagedListener(this.eCancelFilterButton,"click",()=>this.close())}removeItemFromParent(e){const t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,i){var s;const r=this.items[t],n="join"===(null==(s=r.filterModel)?void 0:s.filterType)&&"bottom"===i,o=n?r.filterModel:r.parent;if(!o)return;if(this.isChildOrSelf(o,e.filterModel)||r===e)return;let a;this.removeItemFromParent(e),n?a=0:(a=o.conditions.indexOf(r.filterModel),-1===a?a=o.conditions.length:"bottom"===i&&(a+=1)),o.conditions.splice(a,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||"join"===t.filterType&&t.conditions.some(t=>this.isChildOrSelf(e,t))}setupFilterModel(){const e=this.formatFilterModel(this.advancedFilterService.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return"join"!==(e=null!=e?e:{filterType:"join",type:"AND",conditions:[]}).filterType&&(e={filterType:"join",type:"AND",conditions:[e]}),e}buildList(){const e=(t,i,s,r)=>{i.push({filterModel:t,level:s,parent:r,valid:!0,showMove:this.showMove}),"join"===t.filterType&&(t.conditions.forEach(r=>e(r,i,s+1,t)),0===s&&i.push({filterModel:null,level:s+1,parent:t,valid:!0}))};this.items=[],e(this.filterModel,this.items,0)}refreshList(e){if(!e){const e=[];this.items.forEach(t=>{t.valid||e.push(t.filterModel)}),this.buildList(),e.length&&this.items.forEach(t=>{t.filterModel&&e.includes(t.filterModel)&&(t.valid=!1)})}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){const i=this.items.indexOf(e),s=(e,t)=>{const i=this.items.find(t=>t.filterModel===e),r=null==i?void 0:i.parent;if(r){const{conditions:i}=r;s(r,t),t.push(i[i.length-1]===e)}},r=[],{filterModel:n}=e;n&&(s(n,r),r[0]=!1);const o="join"===(null==n?void 0:n.filterType)&&!!n.conditions.length;t.setState({disableMoveUp:1===i,disableMoveDown:!this.canMoveDown(e,i),treeLines:r,showStartTreeLine:o})}createItemComponent(e,t){const i=this.createBean(e.filterModel?new ue(e,this.dragFeature,t):new pe(e,t));return i.addManagedListener(i,ae.EVENT_REMOVED,({item:e})=>this.removeItem(e)),i.addManagedListener(i,ae.EVENT_VALUE_CHANGED,()=>this.validate()),i.addManagedListener(i,ae.EVENT_ADDED,({item:e,isJoin:t})=>this.addItem(e,t)),i.addManagedListener(i,ae.EVENT_MOVED,({item:e,backwards:t})=>this.moveItemUpDown(e,t)),i instanceof ue&&this.updateItemComponent(e,i),i}addItem(e,t){var i;const{parent:s,level:r,filterModel:n}=e,o="join"===(null==n?void 0:n.filterType),a=t?{filterType:"join",type:"AND",conditions:[]}:{},l=o?n:s;let c=o?0:l.conditions.indexOf(n);c>=0?(o||(c+=1),l.conditions.splice(c,0,a)):l.conditions.push(a);let h=this.items.indexOf(e);const d=h>=0;if(d){e.filterModel&&h++;const i=[{filterModel:a,level:o?r+1:r,parent:l,valid:t,showMove:this.showMove}];this.items.splice(h,0,...i)}this.refreshList(d),d&&(null==(i=this.virtualList.getComponentAt(h))||i.afterAdd())}removeItem(e){var t;const i=e.parent,{filterModel:s}=e,r=i.conditions.indexOf(s);i.conditions.splice(r,1);const n="join"===(null==(t=e.filterModel)?void 0:t.filterType),o=this.items.indexOf(e),a=!n&&o>=0;a&&this.items.splice(o,1),this.refreshList(a),o>=0&&this.virtualList.focusRow(o)}moveItemUpDown(e,t){const i=this.items.indexOf(e),s=t?i-1:i+1;if(0===s||!t&&!this.canMoveDown(e,i))return;const r=this.items[s],n=this.removeItemFromParent(e),{level:o,filterModel:a,parent:l}=e,{level:c,filterModel:h,parent:d}=r;if(t)if(c===o&&"join"===h.filterType)h.conditions.push(a);else if(c<=o){const e=d.conditions.indexOf(h);d.conditions.splice(e,0,a)}else l.conditions[n-1].conditions.push(a);else if(c===o)if("join"===h.filterType)h.conditions.splice(0,0,a);else{const e=d.conditions.indexOf(h);d.conditions.splice(e+1,0,a)}else if(n<l.conditions.length)l.conditions.splice(n+1,0,a);else{const e=this.items.find(e=>e.filterModel===l),t=e.parent.conditions.indexOf(e.filterModel)+1;e.parent.conditions.splice(t,0,a)}this.refreshList(!1);const u=this.items.findIndex(({filterModel:e})=>e===a);if(u>=0){const e=this.virtualList.getComponentAt(u);e instanceof ue&&e.focusMoveButton(t)}}canMoveDown(e,t){return!(1===e.level&&t===this.items.length-2||1===e.level&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilterService.getCtrl().toggleFilterBuilder("ui")}validate(){let e=!this.items.every(({valid:e})=>e);e?this.validationMessage=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationIncomplete"):(e=JSON.stringify(this.filterModel)===this.stringifiedModel,this.validationMessage=e?this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationAlreadyApplied"):null),k._.setDisabled(this.eApplyFilterButton,e),this.validationTooltipFeature.refreshToolTip()}validateItems(){const e=e=>{e.type=void 0},t=e=>{delete e.filter};this.items.forEach(i=>{if(!i.valid||!i.filterModel||"join"===i.filterModel.filterType)return;const{filterModel:s}=i,{colId:r}=s,n=this.advancedFilterExpressionService.getColumnAutocompleteEntries().find(({key:e})=>e===r),o=this.advancedFilterExpressionService.getColumnDetails(s.colId);if(!n||!o.column)return i.valid=!1,s.colId=void 0,e(s),void t(s);const a=this.advancedFilterExpressionService.getDataTypeExpressionOperator(o.baseCellDataType).operators[s.type];if(!a)return i.valid=!1,e(s),void t(s);a.numOperands>0&&!k._.exists(s.filter)&&(i.valid=!1)})}};ee([(0,k.RefSelector)("eList")],ge.prototype,"eList",2),ee([(0,k.RefSelector)("eApplyFilterButton")],ge.prototype,"eApplyFilterButton",2),ee([(0,k.RefSelector)("eCancelFilterButton")],ge.prototype,"eCancelFilterButton",2),ee([(0,k.Autowired)("filterManager")],ge.prototype,"filterManager",2),ee([(0,k.Autowired)("advancedFilterService")],ge.prototype,"advancedFilterService",2),ee([(0,k.Autowired)("advancedFilterExpressionService")],ge.prototype,"advancedFilterExpressionService",2),ee([(0,k.Autowired)("beans")],ge.prototype,"beans",2),ee([k.PostConstruct],ge.prototype,"postConstruct",1);var me=class e extends R.BeanStub{constructor(e){super(),this.enabled=e}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsService.whenReady(()=>this.setAdvancedFilterComp()),this.addManagedListener(this.eventService,R.Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onEnabledChanged(e)),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog&&this.eBuilderDialog.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp=this.createManagedBean(new te(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){return!!this.eHeaderComp&&(this.eHeaderComp.getFocusableElement().focus(),!0)}refreshComp(){var e,t;null==(e=this.eFilterComp)||e.refresh(),null==(t=this.eHeaderComp)||t.refresh()}refreshBuilderComp(){var e;null==(e=this.eBuilderComp)||e.refresh()}getHeaderHeight(){var e,t;return null!=(t=null==(e=this.eHeaderComp)?void 0:e.getHeight())?t:0}setInputDisabled(e){var t,i;null==(t=this.eFilterComp)||t.setInputDisabled(e),null==(i=this.eHeaderComp)||i.setInputDisabled(e)}toggleFilterBuilder(t,i){if(i&&this.eBuilderDialog||!1===i&&!this.eBuilderDialog)return;if(this.eBuilderDialog)return this.builderDestroySource=t,void this.destroyBean(this.eBuilderDialog);this.setInputDisabled(!0);const{width:s,height:r,minWidth:n}=this.getBuilderDialogSize();this.eBuilderComp=this.createBean(new ge),this.eBuilderDialog=this.createBean(new R.AgDialog({title:this.advancedFilterExpressionService.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:s,height:r,resizable:!0,movable:!0,maximizable:!0,centered:!0,closable:!0,minWidth:n,afterGuiAttached:()=>{var e;return null==(e=this.eBuilderComp)?void 0:e.afterGuiAttached()}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener(R.AgDialog.EVENT_DESTROYED,()=>{var t;this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchEvent({type:e.EVENT_BUILDER_CLOSED}),this.dispatchFilterBuilderVisibleChangedEvent(null!=(t=this.builderDestroySource)?t:"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){const i={type:R.Events.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED,source:e,visible:t};this.eventService.dispatchEvent(i)}getBuilderDialogSize(){var e,t;const i=null!=(t=null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.minWidth)?t:500,s=this.popupService.getPopupParent(),r=Math.round(R._.getAbsoluteWidth(s))-2,n=Math.round(.75*R._.getAbsoluteHeight(s))-2;return{width:Math.min(Math.max(600,i),r),height:Math.min(600,n),minWidth:i}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventService.dispatchEvent({type:R.Events.EVENT_HEADER_HEIGHT_CHANGED})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;const e=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!e,e){const t=this.createBean(new ye),i=t.getGui(),{allThemes:s}=this.environment.getTheme();s.length&&i.classList.add(...s),i.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),e.appendChild(i),this.eFilterComp=t}}setHeaderCompEnabled(){var e;null==(e=this.eHeaderComp)||e.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(R._.removeFromParent(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}};me.EVENT_BUILDER_CLOSED="advancedFilterBuilderClosed",ee([(0,R.Autowired)("focusService")],me.prototype,"focusService",2),ee([(0,R.Autowired)("ctrlsService")],me.prototype,"ctrlsService",2),ee([(0,R.Autowired)("popupService")],me.prototype,"popupService",2),ee([(0,R.Autowired)("advancedFilterExpressionService")],me.prototype,"advancedFilterExpressionService",2),ee([R.PostConstruct],me.prototype,"postConstruct",1);var fe=me,ye=class extends I.Component{constructor(){super('\n            <div class="ag-advanced-filter" role="presentation" tabindex="-1">\n                <ag-autocomplete ref="eAutocomplete"></ag-autocomplete>\n                <button class="ag-button ag-standard-button ag-advanced-filter-apply-button" ref="eApplyFilterButton"></button>\n                <button class="ag-advanced-filter-builder-button" ref="eBuilderFilterButton">\n                    <span ref="eBuilderFilterButtonIcon" aria-hidden="true"></span>\n                    <span class="ag-advanced-filter-builder-button-label" ref="eBuilderFilterButtonLabel"></span>\n                </button>\n            </div>'),this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}postConstruct(){this.eAutocomplete.setListGenerator((e,t)=>this.generateAutocompleteListParams(t)).setValidator(()=>this.validateValue()).setForceLastSelection((e,t)=>this.forceLastSelection(e,t)).setInputAriaLabel(this.advancedFilterExpressionService.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advancedFilterExpressionService.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_VALUE_CHANGED,({value:e})=>this.onValueChanged(e)),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_VALUE_CONFIRMED,({isValid:e})=>this.onValueConfirmed(e)),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_OPTION_SELECTED,({position:e,updateEntry:t,autocompleteType:i})=>this.onOptionSelected(e,t,i)),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_VALID_CHANGED,({isValid:e,validationMessage:t})=>this.onValidChanged(e,t)),this.setupApplyButton(),this.setupBuilderButton()}refresh(){const e=this.advancedFilterService.getExpressionDisplayValue();this.eAutocomplete.setValue({value:null!=e?e:"",position:null==e?void 0:e.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),I._.setDisabled(this.eApplyFilterButton,e||this.isApplyDisabled)}getTooltipParams(){const e=super.getTooltipParams();return e.location="advancedFilter",e}setupApplyButton(){this.eApplyFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedListener(this.eApplyFilterButton,"click",()=>this.onValueConfirmed(this.eAutocomplete.isValid())),I._.setDisabled(this.eApplyFilterButton,this.isApplyDisabled)}setupBuilderButton(){this.eBuilderFilterButtonIcon.appendChild(I._.createIconNoSpan("advancedFilterBuilder",this.gos)),this.eBuilderFilterButtonLabel.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedListener(this.eBuilderFilterButton,"click",()=>this.openBuilder()),this.addManagedListener(this.advancedFilterService.getCtrl(),fe.EVENT_BUILDER_CLOSED,()=>this.closeBuilder())}onValueChanged(e){var t;e=I._.makeNull(e),this.advancedFilterService.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilterService.createExpressionParser(e);const i=null==(t=this.expressionParser)?void 0:t.parseExpression();i&&i!==e&&this.eAutocomplete.setValue({value:i,silent:!0,restoreFocus:!0})}onValueConfirmed(e){e&&!this.isApplyDisabled&&(I._.setDisabled(this.eApplyFilterButton,!0),this.advancedFilterService.applyExpression(),this.filterManager.onFilterChanged({source:"advancedFilter"}))}onOptionSelected(e,t,i){const{updatedValue:s,updatedPosition:r,hideAutocomplete:n}=this.updateExpression(e,t,i);this.eAutocomplete.setValue({value:s,position:r,updateListOnlyIfOpen:n,restoreFocus:!0})}validateValue(){var e,t,i;return(null==(e=this.expressionParser)?void 0:e.isValid())?null:null!=(i=null==(t=this.expressionParser)?void 0:t.getValidationMessage())?i:null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilterService.isCurrentExpressionApplied(),I._.setDisabled(this.eApplyFilterButton,this.isApplyDisabled),this.setTooltip({newTooltipText:t,showDelayOverride:1e3})}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advancedFilterExpressionService.getDefaultAutocompleteListParams("")}updateExpression(e,t,i){var s,r;return this.advancedFilterExpressionService.updateAutocompleteCache(t,i),null!=(r=null==(s=this.expressionParser)?void 0:s.updateExpression(e,t,i))?r:this.advancedFilterService.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},i){return!!i.toLocaleLowerCase().match(`^${(null!=t?t:e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,I._.setDisabled(this.eBuilderFilterButton,!0),this.advancedFilterService.getCtrl().toggleFilterBuilder("ui"))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,I._.setDisabled(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}};ee([(0,I.RefSelector)("eAutocomplete")],ye.prototype,"eAutocomplete",2),ee([(0,I.RefSelector)("eApplyFilterButton")],ye.prototype,"eApplyFilterButton",2),ee([(0,I.RefSelector)("eBuilderFilterButton")],ye.prototype,"eBuilderFilterButton",2),ee([(0,I.RefSelector)("eBuilderFilterButtonIcon")],ye.prototype,"eBuilderFilterButtonIcon",2),ee([(0,I.RefSelector)("eBuilderFilterButtonLabel")],ye.prototype,"eBuilderFilterButtonLabel",2),ee([(0,I.Autowired)("advancedFilterService")],ye.prototype,"advancedFilterService",2),ee([(0,I.Autowired)("advancedFilterExpressionService")],ye.prototype,"advancedFilterExpressionService",2),ee([(0,I.Autowired)("filterManager")],ye.prototype,"filterManager",2),ee([I.PostConstruct],ye.prototype,"postConstruct",1);var ve={ariaAdvancedFilterBuilderItem:e=>`${e[0]}. Level ${e[1]}. Press ENTER to edit.`,ariaAdvancedFilterBuilderItemValidation:e=>`${e[0]}. Level ${e[1]}. ${e[2]} Press ENTER to edit.`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:e=>`Expression has an error. ${e[0]} - ${e[1]}.`,advancedFilterValidationMessageAtEnd:e=>`Expression has an error. ${e[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};function Ce(e,t,i){if(!e)return"";const s=i-t;return s?e.slice(0,e.length-s):e}function be(e,t,i,s,r,n,o){const a=i+(!e.length||o?0:1);let l=0;return r&&(" "===e[a]?l=1:(s+=" ",n&&(s+='"'))),{updatedValue:e.slice(0,t)+s+e.slice(a),updatedPosition:t+s.length+l}}function Se(e,t,i,s){let r=t,n=!1;for(;r<e.length;){const t=e[r];if("("===t){s&&" "===e[r-1]?n=!0:r-=1;break}if(" "===t||i&&")"===t){r-=1;break}r++}return{endPosition:r,isEmpty:n}}function we(e,t,i,s){i!==t&&(e.expression=be(e.expression,s-t.length+1,s,i).updatedValue)}var xe=class{constructor(e,t){this.params=e,this.startPosition=t,this.type="column",this.valid=!0,this.hasStartChar=!1,this.hasEndChar=!1,this.colName=""}parse(e,t){if(e!==Ae.COL_START_CHAR||this.colName)if(e===Ae.COL_END_CHAR&&this.hasStartChar){if(this.parseColumn(!1,t))return this.hasEndChar=!0,!1;this.colName+=e}else this.colName+=e;else this.hasStartChar=!0}getDisplayValue(){return(this.hasStartChar?Ae.COL_START_CHAR:"")+this.colName+(this.hasEndChar?Ae.COL_END_CHAR:"")}getColId(){return this.colId}complete(e){this.parseColumn(!0,e)}getValidationError(){var e;return this.valid?null:{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidColumn"),startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}}parseColumn(e,t){var i;this.endPosition=t;const s=this.params.advancedFilterExpressionService.getColId(this.colName);return s&&this.hasStartChar&&(this.colId=s.colId,we(this.params,this.colName,s.columnName,t-1),this.colName=s.columnName,this.column=this.params.columnModel.getPrimaryColumn(this.colId),this.column)?(this.baseCellDataType=null!=(i=this.params.dataTypeService.getBaseDataType(this.column))?i:"text",!0):(e&&(this.valid=!1),this.baseCellDataType="text",!1)}},Ee=class{constructor(e,t,i){this.params=e,this.startPosition=t,this.baseCellDataType=i,this.type="operator",this.valid=!0,this.expectedNumOperands=0,this.operator=""}parse(e,t){if(" "===e||")"===e){if(this.parseOperator(!1,t-1))return!0;this.operator+=e}else this.operator+=e}complete(e){this.parseOperator(!0,e)}getValidationError(){var e;return this.valid?null:{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidOption"),startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}}getDisplayValue(){return this.operator}getOperatorKey(){return this.parsedOperator}parseOperator(e,t){const i=this.params.advancedFilterExpressionService.getDataTypeExpressionOperator(this.baseCellDataType),s=i.findOperator(this.operator);if(this.endPosition=t,s){this.parsedOperator=s;const e=i.operators[s];this.expectedNumOperands=e.numOperands;const r=e.displayValue;return we(this.params,this.operator,r,t),this.operator=r,!0}return!e&&null===s||(this.valid=!1),!1}},Me=class{constructor(e,t,i,s){this.params=e,this.startPosition=t,this.baseCellDataType=i,this.column=s,this.type="operand",this.valid=!0,this.operand="",this.validationMessage=null}parse(e,t){if(" "===e){if(!this.quotes)return this.parseOperand(!1,t),!0;this.operand+=e}else if(")"===e){if("number"===this.baseCellDataType||!this.quotes)return this.parseOperand(!1,t-1),!0;this.operand+=e}else if(this.operand||this.quotes||"'"!==e&&'"'!==e){if(this.quotes&&e===this.quotes)return this.parseOperand(!1,t),!1;this.operand+=e}else this.quotes=e}complete(e){this.parseOperand(!0,e)}getValidationError(){var e;return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(e,t){const{advancedFilterExpressionService:i}=this.params;if(this.endPosition=t,this.modelValue=this.operand,e&&this.quotes)this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationMissingQuote");else if(""===this.modelValue)this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationMissingValue");else{const e=i.getOperandModelValue(this.operand,this.baseCellDataType,this.column);switch(null!=e&&(this.modelValue=e),this.baseCellDataType){case"number":(this.quotes||isNaN(this.modelValue))&&(this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationNotANumber"));break;case"date":case"dateString":null==e&&(this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationInvalidDate"))}}}},Ae=class{constructor(e,t){this.params=e,this.startPosition=t,this.isAwaiting=!0}parseExpression(){var e,t;let i=this.startPosition;const{expression:s}=this.params;for(;i<s.length;){const e=s[i];if(" "===e&&this.isAwaiting);else{if(this.isAwaiting=!1,!this.parser){let e;this.columnParser?this.operatorParser?(this.operandParser=new Me(this.params,i,this.columnParser.baseCellDataType,this.columnParser.column),e=this.operandParser):(this.operatorParser=new Ee(this.params,i,this.columnParser.baseCellDataType),e=this.operatorParser):(this.columnParser=new xe(this.params,i),e=this.columnParser),this.parser=e}const t=this.parser.parse(e,i);if(null!=t){if(this.isComplete())return this.returnEndPosition(t?i-1:i,!0);this.parser=void 0,this.isAwaiting=!0}}i++}return null==(t=null==(e=this.parser)?void 0:e.complete)||t.call(e,i-1),this.returnEndPosition(i)}isValid(){return this.isComplete()&&this.columnParser.valid&&this.operatorParser.valid&&(!this.operandParser||this.operandParser.valid)}getValidationError(){var e,t,i,s,r;const n=null!=(r=null!=(i=null==(e=this.columnParser)?void 0:e.getValidationError())?i:null==(t=this.operatorParser)?void 0:t.getValidationError())?r:null==(s=this.operandParser)?void 0:s.getValidationError();if(n)return n;const o=this.params.expression.length;let a;return this.columnParser?this.operatorParser?this.operatorParser.expectedNumOperands&&!this.operandParser&&(a="advancedFilterValidationMissingValue"):a="advancedFilterValidationMissingOption":a="advancedFilterValidationMissingColumn",a?{message:this.params.advancedFilterExpressionService.translate(a),startPosition:o,endPosition:o}:null}getFunctionString(e){return this.getFunctionCommon(e,(e,t,i,s)=>`params.operators[${t}].evaluator(expressionProxy.getValue('${i.replace(/(['"])/,"\\$1")}', node), node, params.evaluatorParams[${s}]${null==e?"":`, params.operands[${e}]`})`)}getFunctionParsed(e){return this.getFunctionCommon(e,(e,t,i,s)=>(r,n,o)=>o.operators[t].evaluator(r.getValue(i,n),n,o.evaluatorParams[s],null==e?void 0:o.operands[e]))}getAutocompleteListParams(e){return this.isColumnPosition(e)?this.getColumnAutocompleteListParams(e):this.isOperatorPosition(e)?this.getOperatorAutocompleteListParams(e):this.isBeyondEndPosition(e)?void 0:{enabled:!1}}updateExpression(e,t,i){var s,r,n,o,a;const{expression:l}=this.params;if(this.isColumnPosition(e))return be(this.params.expression,this.startPosition,(null==(s=this.columnParser)?void 0:s.getColId())?this.columnParser.endPosition:Se(l,e).endPosition,this.params.advancedFilterExpressionService.getColumnValue(t),!0);if(this.isOperatorPosition(e)){const s=this.getBaseCellDataTypeFromOperatorAutocompleteType(i),c=this.hasOperand(s,t.key),h=c&&this.doesOperandNeedQuotes(s);let d;if(null!=(null==(r=this.operatorParser)?void 0:r.startPosition)&&e<this.operatorParser.startPosition)d=be(l,e,e,null!=(n=t.displayValue)?n:t.key,c,h);else{let i,s=!1;if(null==(o=this.operatorParser)?void 0:o.getOperatorKey())i=this.operatorParser.endPosition;else{const{endPosition:t,isEmpty:r}=Se(l,e,!0,!0);i=t,s=r}d=be(l,function(e,t,i){let s=t;for(;s<i&&" "===e[s];)s++;return s}(l,this.columnParser.endPosition+1,i),i,null!=(a=t.displayValue)?a:t.key,c,h,s)}return J(Q({},d),{hideAutocomplete:!c})}return null}getModel(){const e=this.columnParser.getColId(),t={filterType:this.columnParser.baseCellDataType,colId:e,type:this.operatorParser.getOperatorKey()};return this.operatorParser.expectedNumOperands&&(t.filter=this.operandParser.getModelValue()),t}getFunctionCommon(e,t){var i,s;const r=this.columnParser.getColId(),n=null==(i=this.operatorParser)?void 0:i.getOperatorKey(),{operators:o,evaluatorParams:a,operands:l}=e,c=this.params.advancedFilterExpressionService.getExpressionOperator(this.columnParser.baseCellDataType,n),h=this.addToListAndGetIndex(o,c),d=this.params.advancedFilterExpressionService.getExpressionEvaluatorParams(r),u=this.addToListAndGetIndex(a,d);return t(0===(null==(s=this.operatorParser)?void 0:s.expectedNumOperands)?void 0:this.addToListAndGetIndex(l,this.getOperandValue()),h,r,u)}getOperandValue(){let e=this.operandParser.getRawValue();const{baseCellDataType:t,column:i}=this.columnParser;switch(t){case"number":e=Number(e);break;case"date":case"dateString":e=this.params.valueService.parseValue(i,null,e,void 0)}return"dateString"===t?this.params.dataTypeService.getDateParserFunction(i)(e):e}isComplete(){return!(!this.operatorParser||!(!this.operatorParser.expectedNumOperands||this.operatorParser.expectedNumOperands&&this.operandParser))}isColumnPosition(e){return!this.columnParser||null==this.columnParser.endPosition||e<=this.columnParser.endPosition+1}isOperatorPosition(e){return!this.operatorParser||null==this.operatorParser.endPosition||e<=this.operatorParser.endPosition+1}isBeyondEndPosition(e){return this.isComplete()&&null!=this.endPosition&&e>this.endPosition+1&&this.endPosition+1<this.params.expression.length}returnEndPosition(e,t){return this.endPosition=t?e:e-1,e}getColumnAutocompleteListParams(e){return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getColumnAutocompleteEntries(),"column",this.getColumnSearchString(e))}getColumnSearchString(e){var t,i,s,r,n;const o=null!=(i=null==(t=this.columnParser)?void 0:t.getDisplayValue())?i:"",a=Ce(o,e,null==(null==(s=this.columnParser)?void 0:s.endPosition)?this.params.expression.length:this.columnParser.endPosition+1),l=(null==(r=this.columnParser)?void 0:r.hasStartChar)&&a.length>0,c=(null==(n=this.columnParser)?void 0:n.hasEndChar)&&a.length===o.length+2;return l?a.slice(1,c?-1:void 0):a}getOperatorAutocompleteListParams(e){var t,i,s,r,n;const o=null==(t=this.columnParser)?void 0:t.column;if(!o)return{enabled:!1};const a=this.columnParser.baseCellDataType,l=null!=(null==(i=this.operatorParser)?void 0:i.startPosition)&&e<this.operatorParser.startPosition?"":Ce(null!=(r=null==(s=this.operatorParser)?void 0:s.getDisplayValue())?r:"",e,null==(null==(n=this.operatorParser)?void 0:n.endPosition)?this.params.expression.length:this.operatorParser.endPosition+1);return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getOperatorAutocompleteEntries(o,a),`operator-${a}`,l)}getBaseCellDataTypeFromOperatorAutocompleteType(e){return null==e?void 0:e.replace("operator-","")}hasOperand(e,t){var i,s;return!e||!t||(null!=(s=null==(i=this.params.advancedFilterExpressionService.getExpressionOperator(e,t))?void 0:i.numOperands)?s:0)>0}doesOperandNeedQuotes(e){return"number"!==e}addToListAndGetIndex(e,t){const i=e.length;return e.push(t),i}};function Te(e,t,i){let s=!1;const r=e.toLocaleLowerCase(),n=r+" ",o=Object.entries(t).find(([e,t])=>{const o=i(t).toLocaleLowerCase();return o.startsWith(n)&&(s=!0),o===r});return o?o[0]:s?null:void 0}function De(e,t){return(null!=t?t:Object.keys(e)).map(t=>({key:t,displayValue:e[t].displayValue}))}Ae.COL_START_CHAR="[",Ae.COL_END_CHAR="]";var Ie=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return De(this.operators,e)}findOperator(e){return Te(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e}=this.params;this.operators={contains:{displayValue:e("advancedFilterContains"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e.includes(t)),numOperands:1},notContains:{displayValue:e("advancedFilterNotContains"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!0,(e,t)=>!e.includes(t)),numOperands:1},equals:{displayValue:e("advancedFilterTextEquals"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e===t),numOperands:1},notEqual:{displayValue:e("advancedFilterTextNotEqual"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!0,(e,t)=>e!=t),numOperands:1},startsWith:{displayValue:e("advancedFilterStartsWith"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e.startsWith(t)),numOperands:1},endsWith:{displayValue:e("advancedFilterEndsWith"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e.endsWith(t)),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e||"string"==typeof e&&0===e.trim().length,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e&&("string"!=typeof e||e.trim().length>0),numOperands:0}}}evaluateExpression(e,t,i,s,r,n){return null==e?r:i.caseSensitive?n(i.valueConverter(e,t),s):n(i.valueConverter(e,t).toLocaleLowerCase(),s.toLocaleLowerCase())}},Re=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return De(this.operators,e)}findOperator(e){return Te(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e("advancedFilterEquals"),evaluator:(e,i,s,r)=>this.evaluateSingleOperandExpression(e,i,s,r,!!s.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e("advancedFilterNotEqual"),evaluator:(e,i,s,r)=>this.evaluateSingleOperandExpression(e,i,s,r,!!s.includeBlanksInEquals,(e,i)=>!t(e,i)),numOperands:1},greaterThan:{displayValue:e("advancedFilterGreaterThan"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInGreaterThan,(e,t)=>e>t),numOperands:1},greaterThanOrEqual:{displayValue:e("advancedFilterGreaterThanOrEqual"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInGreaterThan,(e,t)=>e>=t),numOperands:1},lessThan:{displayValue:e("advancedFilterLessThan"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInLessThan,(e,t)=>e<t),numOperands:1},lessThanOrEqual:{displayValue:e("advancedFilterLessThanOrEqual"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInLessThan,(e,t)=>e<=t),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e,numOperands:0}}}evaluateSingleOperandExpression(e,t,i,s,r,n){return null==e?r:n(i.valueConverter(e,t),s)}},Pe=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return De(this.operators,e)}findOperator(e){return Te(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e}=this.params;this.operators={true:{displayValue:e("advancedFilterTrue"),evaluator:e=>!!e,numOperands:0},false:{displayValue:e("advancedFilterFalse"),evaluator:e=>!1===e,numOperands:0},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e,numOperands:0}}}},ke=class extends U.BeanStub{constructor(){super(...arguments),this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){var t;const{type:i}=e;return null!=(t=this.expressionJoinOperators[i])?t:i}getColumnDisplayValue(e){const{colId:t}=e,i=this.getColumnAutocompleteEntries().find(({key:e})=>e===t);let s;return i?(s=i.displayValue,this.columnNameToIdMap[s.toLocaleUpperCase()]={colId:t,columnName:s}):s=t,s}getOperatorDisplayValue(e){var t,i;return null!=(i=null==(t=this.getExpressionOperator(e.filterType,e.type))?void 0:t.displayValue)?i:e.type}getOperandModelValue(e,t,i){var s;switch(t){case"number":return U._.exists(e)?Number(e):null;case"date":return U._.serialiseDate(this.valueService.parseValue(i,null,e,void 0),!1);case"dateString":const t=this.valueService.parseValue(i,null,e,void 0);return U._.serialiseDate(null!=(s=this.dataTypeService.getDateParserFunction(i)(t))?s:null,!1)}return e}getOperandDisplayValue(e,t){var i,s;const{colId:r,filter:n}=e,o=this.columnModel.getPrimaryColumn(r);let a="";if(null!=n){let r;switch(e.filterType){case"number":r=null!=(i=U._.toStringOrNull(n))?i:"";break;case"date":const e=U._.parseDateTimeFromString(n);r=o?this.valueService.formatValue(o,null,e):null;break;case"dateString":const t=U._.parseDateTimeFromString(n),s=o?this.dataTypeService.getDateFormatterFunction(o)(null!=t?t:void 0):null;r=o?this.valueService.formatValue(o,null,s):null}"number"!==e.filterType&&(r=null!=(s=null!=r?r:U._.toStringOrNull(n))?s:"",t||(r=`"${r}"`)),a=t?r:` ${r}`}return a}parseColumnFilterModel(e){var t,i;return`[${null!=(t=this.getColumnDisplayValue(e))?t:""}] ${null!=(i=this.getOperatorDisplayValue(e))?i:""}${this.getOperandDisplayValue(e)}`}updateAutocompleteCache(e,t){if("column"===t){const{key:t,displayValue:i}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:t,columnName:i}}}translate(e,t){let i=ve[e];return"function"==typeof i&&(i=i(t)),this.localeService.getLocaleTextFunc()(e,i,t)}generateAutocompleteListParams(e,t,i){return{enabled:!0,type:t,searchString:i,entries:e}}getColumnAutocompleteEntries(){var e;if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;const t=null!=(e=this.columnModel.getAllPrimaryColumns())?e:[],i=[],s=this.gos.get("includeHiddenColumnsInAdvancedFilter");return t.forEach(e=>{e.getColDef().filter&&(s||e.isVisible()||e.isRowGroupActive())&&i.push({key:e.getColId(),displayValue:this.columnModel.getDisplayNameForColumn(e,"advancedFilter")})}),i.sort((e,t)=>{var i,s;const r=null!=(i=e.displayValue)?i:"",n=null!=(s=t.displayValue)?s:"";return r<n?-1:n>r?1:0}),i}getOperatorAutocompleteEntries(e,t){const i=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(i)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([e,t])=>({key:e,displayValue:t}))}getDefaultAutocompleteListParams(e){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",e)}getDataTypeExpressionOperator(e){return this.expressionOperators[e]}getExpressionOperator(e,t){var i,s;return null==(s=null==(i=this.getDataTypeExpressionOperator(e))?void 0:i.operators)?void 0:s[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){const t=e.toLocaleUpperCase(),i=this.columnNameToIdMap[t];if(i)return i;const s=this.getColumnAutocompleteEntries().find(({displayValue:e})=>e.toLocaleUpperCase()===t);if(s){const{key:e,displayValue:i}=s,r={colId:e,columnName:i};return this.columnNameToIdMap[t]=r,r}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;const i=this.columnModel.getPrimaryColumn(e);if(!i)return{valueConverter:e=>e};switch(this.dataTypeService.getBaseDataType(i)){case"dateString":t={valueConverter:this.dataTypeService.getDateParserFunction(i)};break;case"object":t=i.getColDef().filterValueGetter?{valueConverter:e=>e}:{valueConverter:(e,t)=>{var s;return null!=(s=this.valueService.formatValue(i,t,e))?s:"function"==typeof e.toString?e.toString():""}};break;case"text":case void 0:t={valueConverter:e=>U._.toStringOrNull(e)};break;default:t={valueConverter:e=>e}}const{filterParams:s}=i.getColDef();return s&&["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach(e=>{const i=s[e];i&&(t[e]=i)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){var t,i;const s=null!=(t=this.columnModel.getPrimaryColumn(e))?t:void 0;return{column:s,baseCellDataType:null!=(i=s?this.dataTypeService.getBaseDataType(s):void 0)?i:"text"}}generateExpressionOperators(){const e=(e,t)=>this.translate(e,t);return{text:new Ie({translate:e}),boolean:new Pe({translate:e}),object:new Ie({translate:e}),number:new Re({translate:e,equals:(e,t)=>e===t}),date:new Re({translate:e,equals:(e,t)=>e.getTime()===t.getTime()}),dateString:new Re({translate:e,equals:(e,t)=>e.getTime()===t.getTime()})}}getColumnValue({displayValue:e}){return`${Ae.COL_START_CHAR}${e}${Ae.COL_END_CHAR}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(e){var t;const i=null==(t=e.getColDef().filterParams)?void 0:t.filterOptions;if(i)return i.every(e=>"string"==typeof e)?i:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}};ee([(0,U.Autowired)("valueService")],ke.prototype,"valueService",2),ee([(0,U.Autowired)("columnModel")],ke.prototype,"columnModel",2),ee([(0,U.Autowired)("dataTypeService")],ke.prototype,"dataTypeService",2),ee([U.PostConstruct],ke.prototype,"postConstruct",1),ke=ee([(0,U.Bean)("advancedFilterExpressionService")],ke);var Le=class{constructor(e){this.params=e,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(e){this.operators.push(""),this.operatorStartPositions.push(e),this.operatorEndPositions.push(void 0);const{expression:t}=this.params;for(;e<t.length;){const i=t[e];if(" "===i){if(this.parseOperator(e-1))return this.activeOperator++,e-1;this.operators[this.activeOperator]+=i}else this.operators[this.activeOperator]+=i;e++}return this.parseOperator(e-1),e}isValid(){return!(this.validationError||this.operators.length&&!this.parsedOperator)}getValidationError(){return this.validationError}getFunction(){return"OR"===this.parsedOperator?"||":"&&"}getModel(){return"OR"===this.parsedOperator?"OR":"AND"}getAutocompleteListParams(e,t){let i;if(null==t)i="";else{const s=this.operators[t],r=this.operatorEndPositions[t];i=Ce(s,e,null==r?this.params.expression.length:r+1)}let s=this.params.advancedFilterExpressionService.getJoinOperatorAutocompleteEntries();return(t||null==t&&this.activeOperator)&&(s=s.filter(({key:e})=>e===this.parsedOperator)),this.params.advancedFilterExpressionService.generateAutocompleteListParams(s,"join",i)}updateExpression(e,t,i){var s,r;let{expression:n}=this.params;const o=null!=(s=t.displayValue)?s:t.key;if(0===i)for(let e=this.operatorEndPositions.length-1;e>0;e--){const t=this.operatorEndPositions[e];null!=t&&(n=be(n,this.operatorStartPositions[e],t,o).updatedValue)}return be(n,this.operatorStartPositions.length>i?this.operatorStartPositions[i]:e,null!=(r=this.operatorEndPositions.length>i?this.operatorEndPositions[i]:void 0)?r:Se(n,e,!0).endPosition,o,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){const t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",i=this.params.advancedFilterExpressionService.getExpressionJoinOperators(),s=Te(t,i,e=>e);if(s){this.operatorEndPositions[this.activeOperator]=e;const r=i[s];if(this.activeOperator){if(s!==this.parsedOperator)return this.validationError||(this.validationError={message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:e-t.length+1,endPosition:e}),!1}else this.parsedOperator=s;return t!==r&&(we(this.params,t,r,e),this.operators[this.activeOperator]=r),!0}return null!==s&&(this.validationError||(this.validationError={message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:e-t.length+1,endPosition:e}),!0)}},Ne=class e{constructor(e,t){this.params=e,this.startPosition=t,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new Le(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let t=this.startPosition;const{expression:i}=this.params;for(;t<i.length;){const s=i[t];if("("!==s||this.expectingOperator){if(")"===s)return this.endPosition=t-1,0===this.startPosition&&(this.extraEndBracket=!0),t;if(" "===s);else if(this.expectingExpression){const e=new Ae(this.params,t);t=e.parseExpression(),this.expressionParsers.push(e),this.expectingExpression=!1,this.expectingOperator=!0}else this.expectingOperator&&(t=this.operatorParser.parseExpression(t),this.expectingOperator=!1,this.expectingExpression=!0)}else{const i=new e(this.params,t+1);t=i.parseExpression(),this.expressionParsers.push(i),this.expectingExpression=!1,this.expectingOperator=!0}t++}return this.startPosition>0&&(this.missingEndBracket=!0),t}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(e=>e.isValid())}getValidationError(){const e=this.operatorParser.getValidationError();for(let t=0;t<this.expressionParsers.length;t++){const i=this.expressionParsers[t].getValidationError();if(i)return e&&e.startPosition<i.startPosition?e:i}if(e)return e;if(this.extraEndBracket)return{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationExtraEndBracket"),startPosition:this.endPosition+1,endPosition:this.endPosition+1};let t;return this.expressionParsers.length===this.operatorParser.getNumOperators()?t="advancedFilterValidationMissingCondition":this.missingEndBracket&&(t="advancedFilterValidationMissingEndBracket"),t?{message:this.params.advancedFilterExpressionService.translate(t),startPosition:this.params.expression.length,endPosition:this.params.expression.length}:null}getFunctionString(e){const t=this.expressionParsers.length>1,i=this.expressionParsers.map(t=>t.getFunctionString(e)).join(` ${this.operatorParser.getFunction()} `);return t?`(${i})`:i}getFunctionParsed(e){const t=this.operatorParser.getFunction(),i=this.expressionParsers.map(t=>t.getFunctionParsed(e)),s="&&"===t?"every":"some";return(e,t,r)=>i[s](i=>i(e,t,r))}getAutocompleteListParams(e){if(null!=this.endPosition&&e>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();const t=this.getExpressionParserIndex(e);if(null==t)return"("===this.params.expression[e]?{enabled:!1}:this.getColumnAutocompleteListParams();const i=this.expressionParsers[t].getAutocompleteListParams(e);if(!i){if(t<this.expressionParsers.length-1)return this.operatorParser.getAutocompleteListParams(e,t);if(this.expressionParsers.length===this.operatorParser.getNumOperators()){const t=this.operatorParser.getLastOperatorEndPosition();return null==t||e<=t+1?this.operatorParser.getAutocompleteListParams(e,this.operatorParser.getNumOperators()-1):this.getColumnAutocompleteListParams()}return")"===this.params.expression[e-1]?{enabled:!1}:this.operatorParser.getAutocompleteListParams(e)}return i}updateExpression(e,t,i){var s;const r=this.params.expression,n=this.getExpressionParserIndex(e);if(null==n){const e="column"===i?this.params.advancedFilterExpressionService.getColumnValue(t):null!=(s=t.displayValue)?s:t.key;return be(r,this.startPosition,this.startPosition,e,!0)}const o=this.expressionParsers[n].updateExpression(e,t,i);return null==o?"column"===i?be(r,e,r.length-1,this.params.advancedFilterExpressionService.getColumnValue(t),!0):null!=this.endPosition&&e>this.endPosition+1?null:this.operatorParser.updateExpression(e,t,n):o}getModel(){return this.expressionParsers.length>1?{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map(e=>e.getModel())}:this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(e){let t;for(let i=0;i<this.expressionParsers.length&&!(this.expressionParsers[i].startPosition>e);i++)t=i;return t}},_e=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new Ne(this.params,0);const e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){const e=this.joinExpressionParser.getValidationError();if(!e)return null;const{message:t,startPosition:i,endPosition:s}=e;return i<this.params.expression.length?this.params.advancedFilterExpressionService.translate("advancedFilterValidationMessage",[t,this.params.expression.slice(i,s+1).trim()]):this.params.advancedFilterExpressionService.translate("advancedFilterValidationMessageAtEnd",[t])}getFunctionString(){const e=this.createFunctionParams();return{functionString:`return ${this.joinExpressionParser.getFunctionString(e)};`,params:e}}getFunctionParsed(){const e=this.createFunctionParams();return{expressionFunction:this.joinExpressionParser.getFunctionParsed(e),params:e}}getAutocompleteListParams(e){var t;return null!=(t=this.joinExpressionParser.getAutocompleteListParams(e))?t:{enabled:!1}}updateExpression(e,t,i){return this.joinExpressionParser.updateExpression(e,t,i)}getModel(){return this.isValid()?this.joinExpressionParser.getModel():null}createFunctionParams(){return{operands:[],operators:[],evaluatorParams:[]}}},Oe=class extends z.BeanStub{constructor(){super(...arguments),this.appliedExpression=null,this.expression=null,this.isValid=!0}postConstruct(){this.setEnabled(this.gos.get("enableAdvancedFilter"),!0),this.ctrl=this.createManagedBean(new fe(this.enabled)),this.expressionProxy={getValue:(e,t)=>{const i=this.columnModel.getPrimaryColumn(e);return i?this.valueService.getValue(i,t,!0):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",e=>this.setEnabled(!!e.currentValue)),this.addManagedListener(this.eventService,z.Events.EVENT_NEW_COLUMNS_LOADED,e=>this.onNewColumnsLoaded(e)),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>this.updateValidity())}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){var e;const t=this.createExpressionParser(this.appliedExpression);return null==t||t.parseExpression(),null!=(e=null==t?void 0:t.getModel())?e:null}setModel(e){const t=(e,i)=>{if("join"===e.filterType){const s=this.advancedFilterExpressionService.parseJoinOperator(e),r=e.conditions.map(e=>t(e)).filter(e=>z._.exists(e)).join(` ${s} `);return i||e.conditions.length<=1?r:`(${r})`}return this.advancedFilterExpressionService.parseColumnFilterModel(e)},i=e?t(e,!0):null;this.setExpressionDisplayValue(i),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(e){this.expression=e}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(e){return e?new _e({expression:e,columnModel:this.columnModel,dataTypeService:this.dataTypeService,valueService:this.valueService,advancedFilterExpressionService:this.advancedFilterExpressionService}):null}getDefaultExpression(e){const t=this.advancedFilterExpressionService.getColumnValue(e)+" ";return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(e,t){const i=this.enabled,s=this.rowModel.getType(),r="clientSide"===s||"serverSide"===s;if(e&&!s&&z._.warnOnce("Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model."),this.enabled=e&&r,!t&&this.enabled!==i){const e={type:z.Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,enabled:this.enabled};this.eventService.dispatchEvent(e)}}applyExpression(){const e=this.createExpressionParser(this.expression);null==e||e.parseExpression(),this.applyExpressionFromParser(e)}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid)return this.expressionFunction=null,this.expressionParams=null,void(this.appliedExpression=null);const{expressionFunction:t,params:i}=this.getFunction(e);this.expressionFunction=t,this.expressionParams=i,this.appliedExpression=this.expression}getFunction(e){if(this.gos.get("suppressAdvancedFilterEval"))return e.getFunctionParsed();{const{functionString:t,params:i}=e.getFunctionString();return{expressionFunction:new Function("expressionProxy","node","params",t),params:i}}}updateValidity(){this.advancedFilterExpressionService.resetColumnCaches();const e=this.createExpressionParser(this.expression);null==e||e.parseExpression();const t=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),t}onNewColumnsLoaded(e){if("gridInitializing"!==e.source||!this.dataTypeService.isPendingInference())return;this.ctrl.setInputDisabled(!0);const t=this.addManagedListener(this.eventService,z.Events.EVENT_DATA_TYPES_INFERRED,()=>{null==t||t(),this.ctrl.setInputDisabled(!1)})}};ee([(0,z.Autowired)("valueService")],Oe.prototype,"valueService",2),ee([(0,z.Autowired)("columnModel")],Oe.prototype,"columnModel",2),ee([(0,z.Autowired)("dataTypeService")],Oe.prototype,"dataTypeService",2),ee([(0,z.Autowired)("rowModel")],Oe.prototype,"rowModel",2),ee([(0,z.Autowired)("advancedFilterExpressionService")],Oe.prototype,"advancedFilterExpressionService",2),ee([z.PostConstruct],Oe.prototype,"postConstruct",1),Oe=ee([(0,z.Bean)("advancedFilterService")],Oe);var Fe={version:"31.3.4",moduleName:y.ModuleNames.AdvancedFilterModule,beans:[Oe,ke],agStackComponents:[{componentName:"agAdvancedFilter",componentClass:ye}],dependantModules:[D]},Ge={};l(Ge,{GridChartsModule:()=>Ja,__FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT:()=>el,agCharts:()=>tl});var Be=i(98092),Ve=i(98092),He=i(98092),Ue=i(98092),ze=i(98092),We=i(98092),je=i(98092),Ke=Object.defineProperty,$e=Object.defineProperties,Ye=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Je=(e,t,i)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,et=(e,t)=>{for(var i in t||(t={}))Ze.call(t,i)&&Je(e,i,t[i]);if(Xe)for(var i of Xe(t))Qe.call(t,i)&&Je(e,i,t[i]);return e},tt=(e,t)=>$e(e,qe(t)),it=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Ye(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Ke(t,i,n),n},st=class extends He.BeanStub{constructor(){super(...arguments),this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}init(){this.addManagedListener(this.eventService,He.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_PIVOT_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new He.AutoScrollService({scrollContainer:t.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),getHorizontalPosition:()=>t.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:e=>t.getScrollFeature().setHorizontalScrollPosition(e),shouldSkipVerticalScroll:()=>!this.gos.isDomLayout("normal"),shouldSkipHorizontalScroll:()=>!t.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach(t=>{const i=t.columns;t.columns=t.columns.filter(t=>t.isVisible()&&-1!==e.indexOf(t)),!He._.areEqual(i,t.columns)&&this.dispatchChangedEvent(!1,!0,t.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(e=>e.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=He._.last(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const i=this.columnModel.getAllDisplayedColumns(),s=t.map(e=>i.indexOf(e)).sort((e,t)=>e-t);return He._.last(s)-s[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!this.gos.get("enableRangeSelection"))return;const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;(this.gos.get("suppressMultiRangeSelection")||!t||He._.missing(this.cellRanges))&&this.removeAllCellRanges(!0);const s={rowIndex:e.rowIndex,rowPinned:e.rowPinned},r={startRow:s,endRow:s,columns:i,startColumn:e.column};this.cellRanges.push(r),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=He._.last(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,i=!1){const s=t.column,r=this.calculateColumnsBetween(e.startColumn,s);r&&!this.isLastCellOfRange(e,t)&&(e.columns=r,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},i||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:i}=e,s=(t,i)=>{const s=e.columns.filter(e=>e!==t);t?(e.startColumn=t,e.columns=i?[t,...s]:[...s,t]):e.columns=s},{left:r,right:n}=this.getRangeEdgeColumns(e);t!==i[0]||t===r?t===He._.last(i)&&t===n&&s(n,!1):s(r,!0)}getRangeEdgeColumns(e){const t=this.columnModel.getAllDisplayedColumns(),i=e.columns.map(e=>t.indexOf(e)).filter(e=>e>-1).sort((e,t)=>e-t);return{left:t[i[0]],right:t[He._.last(i)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,i=e.ctrlKey||e.metaKey,s=He._.last(this.cellRanges),r=this.newestRangeStartCell,n=s.columns[0],o=He._.last(s.columns),a=s.endRow.rowIndex,l=s.endRow.rowPinned,c={column:r.column===n?o:n,rowIndex:a,rowPinned:l},h=this.cellNavigationService.getNextCellToFocus(t,c,i);return h?(this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:h.rowIndex,rowEndPinned:h.rowPinned,columnStart:r.column,columnEnd:h.column}),h):void 0}setCellRange(e){this.gos.get("enableRangeSelection")&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){He._.shallowCompare(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(e=>{e.columns&&e.startRow&&this.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.columns[0]}),this.cellRanges.push(e)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:i="rangeService",dispatchWrapperEvents:s,wrapperEventSource:r="deleteKey"}=e;if(s){const e={type:He.Events.EVENT_RANGE_DELETE_START,source:r};this.eventService.dispatchEvent(e)}if(t||(t=this.cellRanges),t.forEach(e=>{this.forEachRowInRange(e,t=>{var s;const r=this.rowPositionUtils.getRowNode(t);if(r)for(let t=0;t<e.columns.length;t++){const n=this.columnModel.getGridColumn(e.columns[t]);if(!n||!n.isCellEditable(r))continue;const o=null!=(s=this.valueService.parseValue(n,r,"",r.getValueFromValueService(n)))?s:null;r.setDataValue(n,o,i)}})}),s){const e={type:He.Events.EVENT_RANGE_DELETE_END,source:r};this.eventService.dispatchEvent(e)}}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let i,s=!1;if(e.columns)i=e.columns.map(e=>this.columnModel.getColumnWithValidation(e)).filter(e=>e);else{const t=this.columnModel.getColumnWithValidation(e.columnStart),r=this.columnModel.getColumnWithValidation(e.columnEnd);if(!t||!r)return;i=this.calculateColumnsBetween(t,r),i&&i.length&&(s=i[0]!==t)}if(i&&(t||0!==i.length))return{startRow:null!=e.rowStartIndex?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,endRow:null!=e.rowEndIndex?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0,columns:i,startColumn:s?He._.last(i):i[0]}}addCellRange(e){if(!this.gos.get("enableRangeSelection"))return;const t=this.createCellRangeFromCellRangeParams(e);t&&(t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.startColumn}),this.cellRanges.push(t),this.dispatchChangedEvent(!1,!0,t.id))}getCellRanges(){return this.cellRanges}isEmpty(){return 0===this.cellRanges.length}isMoreThanOneCell(){const e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;const t=this.cellRanges[0],i=this.getRangeStartRow(t),s=this.getRangeEndRow(t);return i.rowPinned!==s.rowPinned||i.rowIndex!==s.rowIndex||1!==t.columns.length}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;let t;this.cellRanges.forEach(t=>{this.forEachRowInRange(t,i=>{const s=`${i.rowPinned||"normal"}_${i.rowIndex}`,r=e.get(s),n=t.columns.map(e=>e.getId());if(r){const e=n.filter(e=>-1===r.indexOf(e));r.push(...e)}else e.set(s,n)})});for(const i of e.values()){const e=i.sort().join();if(void 0!==t){if(t!==e)return!1}else t=e}return!0}forEachRowInRange(e,t){const i=this.getRangeStartRow(e),s=this.getRangeEndRow(e);let r=i;for(;r&&(t(r),!this.rowPositionUtils.sameRow(r,s));)r=this.cellNavigationService.getRowBelow(r)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const i=null!==t.columns&&He._.includes(t.columns,e.column),s=this.isRowInRange(e.rowIndex,e.rowPinned,t);return i&&s}isLastCellOfRange(e,t){const{startRow:i,endRow:s}=e,r=this.rowPositionUtils.before(i,s)?s:i,n=t.rowIndex===r.rowIndex&&t.rowPinned===r.rowPinned,o=e.columns[0],a=He._.last(e.columns),l=e.startColumn===o?a:o;return t.column===l&&n}isBottomRightCell(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=e.columns.map(e=>i.indexOf(e)).sort((e,t)=>e-t),{startRow:r,endRow:n}=e,o=this.rowPositionUtils.before(r,n)?n:r,a=i.indexOf(t.column)===He._.last(s),l=t.rowIndex===o.rowIndex&&He._.makeNull(t.rowPinned)===He._.makeNull(o.rowPinned);return a&&l}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,i){const s=this.getRangeStartRow(i),r=this.getRangeEndRow(i),n={rowIndex:e,rowPinned:t||null},o=n.rowIndex===s.rowIndex&&n.rowPinned==s.rowPinned,a=n.rowIndex===r.rowIndex&&n.rowPinned==r.rowPinned;if(o||a)return!0;const l=!this.rowPositionUtils.before(n,s),c=this.rowPositionUtils.before(n,r);return l&&c}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!this.gos.get("enableRangeSelection"))return;const{ctrlKey:t,metaKey:i,shiftKey:s}=e,r=t||i,n=!this.gos.get("suppressMultiRangeSelection")&&r,o=s&&He._.existsAndNotEmpty(this.cellRanges);n||o&&!He._.exists(He._.last(this.cellRanges).type)||this.removeAllCellRanges(!0);const a=this.dragService.getStartTarget();if(a&&this.updateValuesOnMove(a),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=n&&this.getCellRangeCount(this.lastCellHovered)>1,o||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=He._.last(this.cellRanges);else{const e={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:e,endRow:e,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging)return;if(this.gos.get("suppressMultiRangeSelection"))return;if(this.isEmpty())return;const t=this.rowPositionUtils,i=He._.last(this.cellRanges),s=this.getRangeStartRow(i),r=this.getRangeEndRow(i),n=[];this.cellRanges.slice(0,-1).forEach(e=>{const o=this.getRangeStartRow(e),a=this.getRangeEndRow(e),l=e.columns,c=l.filter(e=>-1===i.columns.indexOf(e));if(c.length===l.length)return void n.push(e);if(t.before(r,o)||t.before(a,s))return void n.push(e);const h=n.length;if(t.before(o,s)){const e={columns:[...l],startColumn:i.startColumn,startRow:et({},o),endRow:this.cellNavigationService.getRowAbove(s)};n.push(e)}if(c.length>0){const e={columns:c,startColumn:He._.includes(c,i.startColumn)?i.startColumn:c[0],startRow:this.rowMax([et({},s),et({},o)]),endRow:this.rowMin([et({},r),et({},a)])};n.push(e)}t.before(r,a)&&n.push({columns:[...l],startColumn:i.startColumn,startRow:this.cellNavigationService.getRowBelow(r),endRow:et({},a)}),n.length-h===1&&(n[n.length-1].id=e.id)}),this.cellRanges=n,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(e=>{(void 0===t||this.rowPositionUtils.before(t,e))&&(t=e)}),t}rowMin(e){let t;return e.forEach(e=>{(void 0===t||this.rowPositionUtils.before(e,t))&&(t=e)}),t}updateValuesOnMove(e){const t=He._.getCtrlForEventTarget(this.gos,e,He.CellCtrl.DOM_DATA_KEY_CELL_CTRL),i=null==t?void 0:t.getCellPosition();this.cellHasChanged=!1,!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i)}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,i=e=>t&&t.rowPinned===e&&this.newestRangeStartCell.rowPinned===e,s=i("top")||i("bottom");if(this.autoScrollService.check(e,s),!this.cellHasChanged)return;const r=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);r&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=r,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,i){const s={type:He.Events.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:t,id:i};this.eventService.dispatchEvent(s)}calculateColumnsBetween(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=e===t,r=i.indexOf(e);if(r<0)return void console.warn(`AG Grid: column ${e.getId()} is not visible`);const n=s?r:i.indexOf(t);if(n<0)return void console.warn(`AG Grid: column ${t.getId()} is not visible`);if(s)return[e];const o=Math.min(r,n),a=o===r?n:r,l=[];for(let e=o;e<=a;e++)l.push(i[e]);return l}};it([(0,He.Autowired)("rowModel")],st.prototype,"rowModel",2),it([(0,He.Autowired)("dragService")],st.prototype,"dragService",2),it([(0,He.Autowired)("columnModel")],st.prototype,"columnModel",2),it([(0,He.Autowired)("cellNavigationService")],st.prototype,"cellNavigationService",2),it([(0,He.Autowired)("pinnedRowModel")],st.prototype,"pinnedRowModel",2),it([(0,He.Autowired)("rowPositionUtils")],st.prototype,"rowPositionUtils",2),it([(0,He.Autowired)("cellPositionUtils")],st.prototype,"cellPositionUtils",2),it([(0,He.Autowired)("ctrlsService")],st.prototype,"ctrlsService",2),it([(0,He.Autowired)("valueService")],st.prototype,"valueService",2),it([He.PostConstruct],st.prototype,"init",1),st=it([(0,He.Bean)("rangeService")],st);var rt=class extends ze.Component{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}init(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){this.cellHoverListener=this.addManagedListener(this.ctrlsService.get("gridCtrl").getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===ze.SelectionHandleType.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),i=this.getGui(),s=ze._.last(this.rangeService.getCellRanges()),r=s.startRow,n=s.endRow;if(r&&n&&(this.rowPositionUtils.before(n,r)?(this.setRangeStartRow(n),this.setRangeEndRow(r)):(this.setRangeStartRow(r),this.setRangeEndRow(n))),t!==e||!ze._.isVisible(i)){this.setCellCtrl(e);const t=e.getComp().getParentOfValue();t&&t.appendChild(i)}this.setCellRange(s)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return ze._.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function nt(e){const t=e.length;let i=0;if(t<=1)return e;for(let t=0;t<e.length;t++){const s=e[t],r=s.toString().split("e-");r.length>1?i=Math.max(i,parseInt(r[1],10)):Math.floor(s)!==s&&(i=Math.max(i,s.toString().split(".")[1].length))}let s=0,r=0,n=0,o=0,a=0;for(let i=0;i<t;i++)a=e[i],s+=i,r+=a,o+=i*i,n+=i*a;const l=(t*n-s*r)/(t*o-s*s),c=r/t-l*s/t,h=[];for(let e=0;e<=t;e++)h.push(parseFloat((e*l+c).toFixed(i)));return h}it([(0,ze.Autowired)("rowRenderer")],rt.prototype,"rowRenderer",2),it([(0,ze.Autowired)("dragService")],rt.prototype,"dragService",2),it([(0,ze.Autowired)("rangeService")],rt.prototype,"rangeService",2),it([(0,ze.Autowired)("mouseEventService")],rt.prototype,"mouseEventService",2),it([(0,ze.Autowired)("columnModel")],rt.prototype,"columnModel",2),it([(0,ze.Autowired)("cellNavigationService")],rt.prototype,"cellNavigationService",2),it([(0,ze.Autowired)("navigationService")],rt.prototype,"navigationService",2),it([(0,ze.Autowired)("rowPositionUtils")],rt.prototype,"rowPositionUtils",2),it([(0,ze.Autowired)("cellPositionUtils")],rt.prototype,"cellPositionUtils",2),it([(0,ze.Autowired)("ctrlsService")],rt.prototype,"ctrlsService",2),it([ze.PostConstruct],rt.prototype,"init",1);var ot=class e extends rt{constructor(){super(e.TEMPLATE),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=Ue.SelectionHandleType.FILL}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:i}=this.initialXY,{x:s,y:r}=this.mouseEventService.getNormalisedPosition(e),n=Math.abs(t-s),o=Math.abs(i-r),a=this.getFillHandleDirection();let l;l="xy"===a?n>o?"x":"y":a,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const e=this.getCellCtrl();if(!e)return;this.initialPosition=e.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t="x"===this.dragAxis,i=this.getCellRange(),s=i.columns.length,r=this.getRangeStartRow(),n=this.getRangeEndRow();let o;if(this.isUp||this.isLeft){const e=t?r:this.lastCellMarked;o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:e.rowIndex,rowStartPinned:e.rowPinned,columnStart:t?this.lastCellMarked.column:i.columns[0],rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnEnd:i.columns[s-1]})}else o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,columnStart:i.columns[0],rowEndIndex:t?n.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?n.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:i.columns[s-1]});o&&(this.raiseFillStartEvent(),this.handleValueChanged(i,o,e),this.rangeService.setCellRanges([o]),this.raiseFillEndEvent(i,o))}getFillHandleDirection(){const e=this.gos.get("fillHandleDirection");return e?"x"!==e&&"y"!==e&&"xy"!==e?(Ue._.warnOnce("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}raiseFillStartEvent(){const e={type:Ue.Events.EVENT_FILL_START};this.eventService.dispatchEvent(e)}raiseFillEndEvent(e,t){const i={type:Ue.Events.EVENT_FILL_END,initialRange:e,finalRange:t};this.eventService.dispatchEvent(i)}handleValueChanged(e,t,i){const s=this.rangeService.getRangeEndRow(e),r=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(t),o=this.rangeService.getRangeStartRow(t),a="y"===this.dragAxis;if(this.isReduce&&!this.gos.get("suppressClearOnFillReduction")){const i=a?e.columns:e.columns.filter(e=>t.columns.indexOf(e)<0),r=a?this.cellNavigationService.getRowBelow(n):o;return void(r&&this.clearCellsInRange(r,s,i))}const l=[],c=[],h=[],d=[];let u=!0,p=0;const g=()=>{l.length=0,c.length=0,h.length=0,d.length=0,p=0},m=(t,i)=>{let c=this.isUp?s:r,h=!1;for(a&&(u=!0,g());!h&&c;){const d=this.rowPositionUtils.getRowNode(c);if(!d)break;a&&t?f(l,t,d,()=>!this.rowPositionUtils.sameRow(c,this.isUp?r:s)):i&&(u=!0,g(),i.forEach(t=>f(l,t,d,()=>t!==(this.isLeft?e.columns[0]:Ue._.last(e.columns))))),h=this.rowPositionUtils.sameRow(c,this.isUp?o:n),c=this.isUp?this.cellNavigationService.getRowAbove(c):this.cellNavigationService.getRowBelow(c)}},f=(e,t,s,r)=>{var n,o;let a,l=!1;if(u)a=this.valueService.getValue(t,s),c.push(a),h.push(this.valueService.getValue(t,s,void 0,!0)),d.push(this.valueService.formatValue(t,s,a)),u=r();else{const{value:r,fromUserFunction:u,sourceCol:g,sourceRowNode:m}=this.processValues({event:i,values:e,initialValues:c,initialNonAggregatedValues:h,initialFormattedValues:d,col:t,rowNode:s,idx:p++});if(a=r,t.isCellEditable(s)){const e=this.valueService.getValue(t,s);u||(g&&!1!==(null==(n=g.getColDef())?void 0:n.useValueFormatterForExport)&&(a=null!=(o=this.valueService.formatValue(g,m,a))?o:a),!1!==t.getColDef().useValueParserForImport&&(a=this.valueService.parseValue(t,s,g?a:Ue._.toStringOrNull(a),e))),u&&e===a?l=!0:s.setDataValue(t,a,"rangeService")}}l||e.push({value:a,column:t,rowNode:s})};if(a)e.columns.forEach(e=>{m(e)});else{const e=this.isLeft?[...t.columns].reverse():t.columns;m(void 0,e)}}clearCellsInRange(e,t,i){const s={startRow:e,endRow:t,columns:i,startColumn:i[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[s]})}processValues(e){const{event:t,values:i,initialValues:s,initialNonAggregatedValues:r,initialFormattedValues:n,col:o,rowNode:a,idx:l}=e,c=this.gos.getCallback("fillOperation");let h;if(h="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",c){const e=c({event:t,values:i.map(({value:e})=>e),initialValues:s,initialNonAggregatedValues:r,initialFormattedValues:n,currentIndex:l,currentCellValue:this.valueService.getValue(o,a),direction:h,column:o,rowNode:a});if(!1!==e)return{value:e,fromUserFunction:!0}}const d=!i.some(({value:e})=>{const t=parseFloat(e);return isNaN(t)||t.toString()!==e.toString()});if(t.altKey||!d){if(d&&1===s.length){const e=this.isUp||this.isLeft?-1:1;return{value:parseFloat(Ue._.last(i).value)+1*e,fromUserFunction:!1}}const{value:e,column:t,rowNode:r}=i[l%i.length];return{value:e,fromUserFunction:!1,sourceCol:t,sourceRowNode:r}}return{value:Ue._.last(nt(i.map(({value:e})=>Number(e)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(t,e))return;const i=this.rowPositionUtils.before(t,e),s=this.getRangeStartRow(),r=this.getRangeEndRow();i&&(t.rowPinned==s.rowPinned&&t.rowIndex>=s.rowIndex||s.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,i),this.isReduce=!1)}else{const i=e.column,s=t.column;if(i===s)return;const r=this.columnModel.getAllDisplayedColumns(),n=r.indexOf(i),o=r.indexOf(s);o<=n&&o>=r.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,o<n),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,i){const{navigationService:s,rangeService:r}=this;let n=e;do{const o=this.getCellRange(),a=o.columns.length;for(let l=0;l<a;l++){const c=o.columns[l],h={rowIndex:n.rowIndex,rowPinned:n.rowPinned},d=tt(et({},h),{column:c}),u=r.isCellInSpecificRange(d,o),p=this.rowPositionUtils.sameRow(n,e);if(i&&(this.isUp=!0),!p){const e=s.getCellByPosition(d);if(e){this.markedCells.push(e);const s=e.getComp();u||(s.addOrRemoveCssClass("ag-selection-fill-left",0===l),s.addOrRemoveCssClass("ag-selection-fill-right",l===a-1)),s.addOrRemoveCssClass(i?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,t))}}}if(this.rowPositionUtils.sameRow(n,t))break}while(n=i?this.cellNavigationService.getRowAbove(n):this.cellNavigationService.getRowBelow(n))}reduceVertical(e,t){let i=e;do{const e=this.getCellRange(),s=e.columns.length,r=this.rowPositionUtils.sameRow(i,t);for(let r=0;r<s;r++){const s={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n=tt(et({},s),{column:e.columns[r]}),o=this.navigationService.getCellByPosition(n);o&&(this.markedCells.push(o),o.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(i,t)))}if(r)break}while(i=this.cellNavigationService.getRowAbove(i))}extendHorizontal(e,t,i){const s=this.columnModel.getAllDisplayedColumns(),r=s.indexOf(i?t.column:e.column),n=s.indexOf(i?this.getCellRange().columns[0]:t.column),o=i?0:1,a=s.slice(r+o,n+o),l=this.getRangeStartRow(),c=this.getRangeEndRow();a.forEach(e=>{let t=l,s=!1;do{s=this.rowPositionUtils.sameRow(t,c);const r=this.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(r){this.markedCells.push(r);const s=r.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(t,l)),s.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(t,c)),i?(this.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",e===a[0])):s.addOrRemoveCssClass("ag-selection-fill-right",e===Ue._.last(a))}t=this.cellNavigationService.getRowBelow(t)}while(!s)})}reduceHorizontal(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i.indexOf(t.column),r=i.indexOf(e.column),n=i.slice(s,r),o=this.getRangeStartRow(),a=this.getRangeEndRow();n.forEach(e=>{let t=o,i=!1;do{i=this.rowPositionUtils.sameRow(t,a);const s=this.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});s&&(this.markedCells.push(s),s.getComp().addOrRemoveCssClass("ag-selection-fill-right",e===n[0])),t=this.cellNavigationService.getRowBelow(t)}while(!i)})}refresh(e){const t=this.rangeService.getCellRanges()[0];t.startRow&&t.endRow?super.refresh(e):this.destroy()}};ot.TEMPLATE='<div class="ag-fill-handle"></div>',it([(0,Ue.Autowired)("valueService")],ot.prototype,"valueService",2);var at=ot,lt=class e extends rt{constructor(){super(e.TEMPLATE),this.type=We.SelectionHandleType.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const i=this.rangeService.getCellRanges(),s=We._.last(i);this.rangeFixed||(this.fixRangeStartEnd(s),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},2===i.length&&i[0].type===We.CellRangeType.DIMENSION&&s.type===We.CellRangeType.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(s))&&this.rangeService.updateRangeEnd(i[0],tt(et({},this.endPosition),{column:i[0].columns[0]}),!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=We._.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),i=this.rangeService.getRangeEndRow(e),s=e.columns[0];e.startRow=t,e.endRow=i,e.startColumn=s}};lt.TEMPLATE='<div class="ag-range-handle"></div>';var ct=lt,ht=class extends je.BeanStub{createSelectionHandle(e){return this.createBean(e===je.SelectionHandleType.RANGE?new ct:new at)}};ht=it([(0,je.Bean)("selectionHandleFactory")],ht);var dt={version:"31.3.4",moduleName:Ve.ModuleNames.RangeSelectionModule,beans:[st,ht],agStackComponents:[{componentName:"AgFillHandle",componentClass:at},{componentName:"AgRangeHandle",componentClass:ct}],dependantModules:[D]},ut=i(98092),pt=i(21371),gt=i(98092),mt=i(98092),ft=i(98092),yt=i(98092),vt=i(98092),Ct=i(98092),bt=i(98092),St=i(98092),wt=i(98092),xt=i(98092),Et=i(21371),Mt=i(98092),At=i(21371),Tt=i(98092),Dt=i(21371),It=i(98092),Rt=i(98092),Pt=i(98092),kt=i(98092),Lt=i(98092),Nt=i(98092),_t=i(98092),Ot=i(98092),Ft=i(98092),Gt=i(98092),Bt=i(98092),Vt=i(98092),Ht=i(98092),Ut=i(98092),zt=i(98092),Wt=i(98092),jt=i(98092),Kt=i(98092),$t=i(98092),Yt=i(98092),qt=i(98092),Xt=i(98092),Zt=i(98092),Qt=i(21371),Jt=i(98092),ei=i(98092),ti=i(98092),ii=i(98092),si=i(98092),ri=i(98092),ni=i(98092),oi=i(98092),ai=i(98092),li=i(98092),ci=i(98092),hi=i(98092),di=i(98092),ui=i(98092),pi=i(21371),gi=i(21371),mi=i(21371),fi=i(21371),yi=i(21371),vi=i(21371),Ci=i(21371),bi=i(21371),Si=i(21371),wi=i(21371),xi=i(21371),Ei=i(21371),Mi=i(98092),Ai=i(21371),Ti=i(21371),Di=i(21371),Ii=i(21371),Ri=i(21371),Pi=i(21371),ki=i(21371),Li=i(21371),Ni=i(21371),_i=i(21371),Oi=i(21371),Fi=i(21371),Gi=i(98092),Bi=i(98092),Vi=i(98092),Hi=i(21371),Ui=i(21371),zi=i(98092),Wi=i(21371),ji=i(98092),Ki=i(98092),$i=i(98092),Yi=i(98092),qi=i(98092),Xi=i(98092),Zi=i(98092),Qi=i(98092),Ji=i(98092),es=i(98092),ts=i(98092),is=i(21371);h(Ge,i(21371));var ss=Object.defineProperty,rs=Object.defineProperties,ns=Object.getOwnPropertyDescriptor,os=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,ls=Object.prototype.hasOwnProperty,cs=Object.prototype.propertyIsEnumerable,hs=(e,t,i)=>t in e?ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,ds=(e,t)=>{for(var i in t||(t={}))ls.call(t,i)&&hs(e,i,t[i]);if(as)for(var i of as(t))cs.call(t,i)&&hs(e,i,t[i]);return e},us=(e,t)=>rs(e,os(t)),ps=(e,t)=>{var i={};for(var s in e)ls.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&as)for(var s of as(e))t.indexOf(s)<0&&cs.call(e,s)&&(i[s]=e[s]);return i},gs=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?ns(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&ss(t,i,n),n},ms=class e extends bt.BeanStub{getData(e){if(e.crossFiltering){if(e.grouping)return console.warn("AG Grid: crossing filtering with row grouping is not supported."),{chartData:[],columnNames:{}};if(!this.gos.isRowModelType("clientSide"))return console.warn("AG Grid: crossing filtering is only supported in the client side row model."),{chartData:[],columnNames:{}}}this.gos.isRowModelType("serverSide")&&e.pivoting&&this.updatePivotKeysForSSRM();const t=this.extractRowsFromGridRowModel(e);return t.chartData=this.aggregateRowsByDimension(e,t.chartData),t}extractRowsFromGridRowModel(t){const{crossFiltering:i,startRow:s,endRow:r,valueCols:n,dimensionCols:o,grouping:a}=t;let l=[];const c={},h={},d={};let u,p={},g=[];if(i)p=this.getFilteredRowNodes(),g=this.getAllRowNodes(),u=g.length;else{const e=this.gridRowModel.getRowCount()-1;u=s===r&&0===s&&0===o.length&&0===n.length?0:(r>=0?Math.min(r,e):e)-s+1}u>0&&n.forEach(e=>{let t=[];const i=e.getColDef().pivotKeys;i&&(t=i.slice());const s=e.getColDef().headerName;s&&t.push(s),t.length>0&&(c[e.getId()]=t)});let m,f=0;for(let r=0;r<u;r++){const c=i?g[r]:this.gridRowModel.getRow(r+s);if(c.footer){f++;continue}const u={};o.forEach(t=>{const i=t.colId,s=this.columnModel.getGridColumn(i);if(s){const t=this.valueService.getValue(s,c);if(a){const s=t&&t.toString?String(t.toString()):"",n=e.getGroupLabels(c,s);u[i]={labels:n,toString:function(){return this.labels.filter(e=>!!e).reverse().join(" - ")}},c.group&&(h[n.toString()]=r-f);const o=n.slice(1,n.length).toString();o&&(d[o]=h[o])}else u[i]=t}else u[_s.DEFAULT_CATEGORY]=r+1}),n.forEach(e=>{const s=e.getColId();if(i){const i=s+"-filtered-out",r=this.valueService.getValue(e,c),n=null!=r&&"function"==typeof r.toNumber?r.toNumber():r;p[c.id]?(u[s]=n,u[i]=t.aggFunc||t.isScatter?void 0:0):(u[s]=t.aggFunc||t.isScatter?void 0:0,u[i]=n)}else{let t=this.valueService.getValue(e,c);t&&t.hasOwnProperty("toString")&&(t=parseFloat(t.toString())),u[s]=null!=t&&"function"==typeof t.toNumber?t.toNumber():t}}),l.push(u)}if(a){const e=bt._.values(d),t=l;l=[],m=[];for(let i=0;i<t.length;i++)(bt._.includes(e,i)?m:l).push(t[i])}return{chartData:l,columnNames:c,groupChartData:m}}aggregateRowsByDimension(e,t){const i=e.dimensionCols;if(!e.aggFunc||0===i.length)return t;const s=bt._.last(i),r=s&&s.colId,n={},o=[];if(t.forEach(e=>{let t=n;i.forEach(s=>{const n=s.colId,a=e[n];if(n===r){let s=t[a];s||(s={__children:[]},i.forEach(t=>{const i=t.colId;s[i]=e[i]}),t[a]=s,o.push(s)),s.__children.push(e)}else t[a]||(t[a]={}),t=t[a]})}),bt.ModuleRegistry.__assertRegistered(bt.ModuleNames.RowGroupingModule,"Charting Aggregation",this.context.getGridId())){const t=this.aggregationStage;o.forEach(i=>e.valueCols.forEach(s=>{if(e.crossFiltering)e.valueCols.forEach(s=>{const r=s.getColId(),n=i.__children.filter(e=>void 0!==e[r]).map(e=>e[r]);let o=t.aggregateValues(n,e.aggFunc);i[s.getId()]=o&&void 0!==o.value?o.value:o;const a=`${r}-filtered-out`,l=i.__children.filter(e=>void 0!==e[a]).map(e=>e[a]);let c=t.aggregateValues(l,e.aggFunc);i[a]=c&&void 0!==c.value?c.value:c});else{const r=i.__children.map(e=>e[s.getId()]);let n=t.aggregateValues(r,e.aggFunc);i[s.getId()]=n&&void 0!==n.value?n.value:n}}))}return o}updatePivotKeysForSSRM(){const e=this.columnModel.getSecondaryColumns();if(!e)return;const t=this.extractPivotKeySeparator(e);e.forEach(e=>{if(""===t)e.getColDef().pivotKeys=[];else{const i=e.getColId().split(t);e.getColDef().pivotKeys=i.slice(0,i.length-1)}})}extractPivotKeySeparator(e){if(0===e.length)return"";const t=(e,i)=>{const s=e.getGroupId();return e.getParent()?t(e.getParent(),s):i.split(s)[1][0]},i=e[0];return null==i.getParent()?"":t(i.getParent(),i.getColId())}static getGroupLabels(e,t){const i=[t];for(;e&&0!==e.level;)(e=e.parent)&&i.push(e.key);return i}getFilteredRowNodes(){const e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(){let e=[];return this.gridRowModel.forEachNode(t=>{e.push(t)}),this.sortRowNodes(e)}sortRowNodes(e){const t=this.sortController.getSortOptions();return t&&0!=t.length?this.rowNodeSorter.doFullSort(e,t):e}};gs([(0,bt.Autowired)("rowModel")],ms.prototype,"gridRowModel",2),gs([(0,bt.Autowired)("valueService")],ms.prototype,"valueService",2),gs([(0,bt.Autowired)("columnModel")],ms.prototype,"columnModel",2),gs([(0,bt.Autowired)("rowNodeSorter")],ms.prototype,"rowNodeSorter",2),gs([(0,bt.Autowired)("sortController")],ms.prototype,"sortController",2),gs([(0,bt.Optional)("aggregationStage")],ms.prototype,"aggregationStage",2);var fs=ms,ys=class extends St.BeanStub{constructor(){super(...arguments),this.valueColsWithoutSeriesType=new Set}postConstruct(){const e=()=>this.valueColsWithoutSeriesType.clear();this.addManagedListener(this.eventService,St.Events.EVENT_NEW_COLUMNS_LOADED,e),this.addManagedListener(this.eventService,St.Events.EVENT_ROW_DATA_UPDATED,e)}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getColDisplayName(e){return this.columnModel.getDisplayNameForColumn(e,"chart")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}getGroupDisplayColumns(){return this.columnModel.getGroupDisplayColumns()}isPivotMode(){return this.columnModel.isPivotMode()}isPivotActive(){return this.columnModel.isPivotActive()}getChartColumns(){const e=this.columnModel.getAllGridColumns(),t=new Set,i=new Set;return e.forEach(e=>{const s=e.getColDef(),r=s.chartDataType;if(r)switch(r){case"category":case"time":return void t.add(e);case"series":return void i.add(e);case"excluded":return;default:console.warn(`AG Grid: unexpected chartDataType value '${r}' supplied, instead use 'category', 'series' or 'excluded'`)}"ag-Grid-AutoColumn"!==s.colId?e.isPrimary()?(this.isInferredValueCol(e)?i:t).add(e):i.add(e):t.add(e)}),{dimensionCols:t,valueCols:i}}isInferredValueCol(e){const t=e.getColId();if("ag-Grid-AutoColumn"===t)return!1;const i=this.rowPositionUtils.getRowNode({rowIndex:0,rowPinned:null});if(!i)return this.valueColsWithoutSeriesType.has(t);let s=this.valueService.getValue(e,i);null==s&&(s=this.extractLeafData(i,e)),null!=s&&"function"==typeof s.toNumber&&(s=s.toNumber());const r="number"==typeof s;return r&&this.valueColsWithoutSeriesType.add(t),r}extractLeafData(e,t){if(!e.allLeafChildren)return null;for(let i=0;i<e.allLeafChildren.length;i++){const s=e.allLeafChildren[i],r=this.valueService.getValue(t,s);if(null!=r)return r}return null}destroy(){this.valueColsWithoutSeriesType.clear(),super.destroy()}};gs([(0,St.Autowired)("columnModel")],ys.prototype,"columnModel",2),gs([(0,St.Autowired)("valueService")],ys.prototype,"valueService",2),gs([(0,St.Autowired)("rowPositionUtils")],ys.prototype,"rowPositionUtils",2),gs([St.PostConstruct],ys.prototype,"postConstruct",1),ys=gs([(0,St.Bean)("chartColumnService")],ys);var vs=class e extends wt.BeanStub{constructor(e){var t;super(),this.suppressComboChartWarnings=!1,this.chartDataModel=e,this.seriesChartTypes=null!=(t=e.params.seriesChartTypes)?t:[]}init(){this.initComboCharts()}update(e){this.seriesChartTypes=null!=e?e:this.seriesChartTypes,this.initComboCharts(),this.updateSeriesChartTypes()}initComboCharts(){const e=this.seriesChartTypes&&this.seriesChartTypes.length>0;("customCombo"===this.chartDataModel.chartType||e)&&(this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){this.chartDataModel.isComboChart()&&(this.seriesChartTypes=this.seriesChartTypes.map(e=>{const t=["groupedColumn","stackedColumn","stackedArea"].includes(e.chartType);return e.secondaryAxis=!t&&e.secondaryAxis,e}),"customCombo"!==this.chartDataModel.chartType?this.updateChartSeriesTypesForBuiltInCombos():this.updateSeriesChartTypesForCustomCombo())}updateSeriesChartTypesForCustomCombo(){this.seriesChartTypes&&this.seriesChartTypes.length>0||this.suppressComboChartWarnings||console.warn("AG Grid: 'seriesChartTypes' are required when the 'customCombo' chart type is specified."),this.seriesChartTypes=this.seriesChartTypes.map(t=>(e.SUPPORTED_COMBO_CHART_TYPES.includes(t.chartType)||(console.warn(`AG Grid: invalid chartType '${t.chartType}' supplied in 'seriesChartTypes', converting to 'line' instead.`),t.chartType="line"),t));const t=this.chartDataModel.valueColState.map(e=>{this.savedCustomSeriesChartTypes&&0!==this.savedCustomSeriesChartTypes.length||(this.savedCustomSeriesChartTypes=this.seriesChartTypes);return this.savedCustomSeriesChartTypes.find(t=>t.colId===e.colId)||(e.selected&&!this.suppressComboChartWarnings&&console.warn(`AG Grid: no 'seriesChartType' found for colId = '${e.colId}', defaulting to 'line'.`),{colId:e.colId,chartType:"line",secondaryAxis:!1})});this.seriesChartTypes=t,this.savedCustomSeriesChartTypes=t,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){const{chartType:e,valueColState:t}=this.chartDataModel;let i="columnLineCombo"===e?"groupedColumn":"stackedArea",s="columnLineCombo"===e?"line":"groupedColumn";const r=t.filter(e=>e.selected),n=Math.ceil(r.length/2);this.seriesChartTypes=r.map((e,t)=>{const r=t>=n?s:i;return{colId:e.colId,chartType:r,secondaryAxis:!1}})}};vs.SUPPORTED_COMBO_CHART_TYPES=["line","groupedColumn","stackedColumn","area","stackedArea"],gs([wt.PostConstruct],vs.prototype,"init",1);var Cs=vs,bs={area:{isCartesian:!0,canInvert:!0},bar:{isCartesian:!0,canInvert:!0},histogram:{isCartesian:!0},line:{isCartesian:!0,canInvert:!0},pie:{isPie:!0},donut:{isPie:!0,canInvert:!0},scatter:{isCartesian:!0},bubble:{isCartesian:!0},"radial-column":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radial-bar":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radar-line":{isPolar:!0,isEnterprise:!0,canInvert:!0},"radar-area":{isPolar:!0,isEnterprise:!0,canInvert:!0},nightingale:{isPolar:!0,isEnterprise:!0,canInvert:!0},"range-bar":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},"range-area":{isCartesian:!0,isEnterprise:!0},"box-plot":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},treemap:{isEnterprise:!0,isHierarchical:!0},sunburst:{isEnterprise:!0,isHierarchical:!0},heatmap:{isCartesian:!0,isEnterprise:!0},waterfall:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0}};function Ss(e){return xt.ChartMappings.COMBO_CHART_TYPES.includes(e)}function ws(e,t){var i;return!!(null==(i=bs[e])?void 0:i[t])}var xs=new Set(["stackedColumn","normalizedColumn","stackedBar","normalizedBar"]);function Es(e){return ws(e,"isCartesian")}function Ms(e){return ws(e,"isPolar")}function As(e){return ws(e,"isHierarchical")}function Ts(e){return"doughnut"===e?"donut":e}function Ds(e){return xt.ChartMappings.CHART_TYPE_TO_SERIES_TYPE[e]}function Is(e){var t;return null!=(t=Ds(e))?t:"line"}function Rs(e){return ws(e,"isPie")}function Ps(e){return As(Is(e))?void 0:1}function ks(e){return As(Is(e))?2:function(e){return"pie"===e||"waterfall"===e||"histogram"===e}(e)?1:void 0}function Ls(e){return ws(Is(e),"canInvert")}var Ns=class e extends Ct.BeanStub{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.columnNames={},this.crossFiltering=!1,this.grouping=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}setParams(e){const{chartType:t,pivotChart:i,chartThemeName:s,switchCategorySeries:r,aggFunc:n,cellRange:o,suppressChartRanges:a,unlinkChart:l,crossFiltering:c,seriesGroupType:h}=e;this.chartType=t,this.pivotChart=null!=i&&i,this.chartThemeName=s,this.switchCategorySeries=!!r,this.aggFunc=n,this.referenceCellRange=o,this.suppliedCellRange=o,this.suppressChartRanges=null!=a&&a,this.unlinked=!!l,this.crossFiltering=!!c,this.seriesGroupType=h}init(){this.datasource=this.createManagedBean(new fs),this.chartColumnService=this.createManagedBean(new ys),this.comboChartModel=this.createManagedBean(new Cs(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){const{cellRange:t,seriesChartTypes:i}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(null==t?void 0:t.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||i)&&this.comboChartModel.update(i),this.unlinked||this.updateData()}updateCellRanges(e){const{updatedColState:t,resetOrder:i,maintainColState:s,setColsFromRange:r}=null!=e?e:{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);const{dimensionCols:n,valueCols:o}=this.chartColumnService.getChartColumns(),a=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,i),this.setDimensionCellRange(n,a,t),this.setValueCellRange(o,a,r),t||s||(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){const{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();const i={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:Ct._.includes(["scatter","bubble"],this.chartType)},{chartData:s,columnNames:r,groupChartData:n}=this.datasource.getData(i);this.chartData=s,this.groupChartData=n,this.columnNames=r,this.categoryAxisType=void 0}isGrouping(){const e=this.gos.get("treeData"),t=e?null:this.chartColumnService.getRowGroupColumns(),i=e||t&&t.length>0,s=this.getSelectedDimensions().map(({colId:e})=>e),r=this.chartColumnService.getGroupDisplayColumns().map(e=>e.getColId()).some(e=>s.includes(e));return!!i&&r}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getColDisplayName(e){return this.chartColumnService.getColDisplayName(e)}isPivotMode(){return this.chartColumnService.isPivotMode()}getChartDataType(e){const t=this.chartColumnService.getColumn(e);return t?t.getColDef().chartDataType:void 0}isPivotActive(){return this.chartColumnService.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===Ct.CellRangeType.DIMENSION||null==this.referenceCellRange.startColumn?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return Ct._.convertToSet(this.chartColumnService.getAllDisplayedColumns());const e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),Ct._.convertToSet(e)}getRowIndexes(){let e=0,t=0;const{rangeService:i,valueCellRange:s,dimensionCellRange:r}=this,n=s||r;if(i&&n){e=i.getRangeStartRow(n).rowIndex;const s=i.getRangeEndRow(n);t="bottom"===s.rowPinned?-1:s.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){const{dimensionCols:t,valueCols:i}=this.chartColumnService.getChartColumns(),s=this.getAllColumnsFromRanges(),r=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];const n=As(Is(this.chartType));let o=!1,a=1;const l=this.suppliedCellRange.columns[0];t.forEach(e=>{const t="ag-Grid-AutoColumn"===e.getColId();let i=!1;this.crossFiltering&&this.aggFunc?l.getColId()===e.getColId()&&(i=!0):i=!!t||(!o||n)&&s.has(e),this.dimensionColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:i,order:a++}),i&&(o=!0)});const c={colId:e.DEFAULT_CATEGORY,displayName:this.chartTranslationService.translate("defaultCategory"),selected:!o,order:0};this.dimensionColState.unshift(c);const h=this.referenceCellRange.columns.filter(e=>i.has(e));i.forEach(e=>{r&&Ct._.includes(this.referenceCellRange.columns,e)&&(e=h.shift()),this.valueColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:s.has(e),order:a++})})}updateColumnState(e,t){const i=t=>t.colId===e.colId,{dimensionColState:s,valueColState:r}=this,n=s.find(i),o=r.find(i);if(n)if(As(Is(this.chartType)))n.selected=e.selected;else{const t=e.selected?n:s.filter(e=>e!==n).find(({selected:e})=>e);s.forEach(e=>e.selected=e===t)}else o&&(o.selected=e.selected);const a=[...s,...r],l=[];t||(a.forEach((t,i)=>{i===e.order&&l.push(e.colId),t.colId!==e.colId&&l.push(t.colId)}),a.forEach(e=>{const t=l.indexOf(e.colId);e.order=t>=0?l.indexOf(e.colId):a.length-1})),this.reorderColState()}reorderColState(){const e=(e,t)=>e.order-t.order;this.dimensionColState.sort(e),this.valueColState.sort(e)}setDimensionCellRange(t,i,s){this.dimensionCellRange=void 0;const r=As(Is(this.chartType));if(!s&&!this.dimensionColState.length){const e=new Array;return t.forEach(t=>{e.length>0&&!r||!i.has(t)||e.push(t)}),void(e.length>0&&(this.dimensionCellRange=this.createCellRange(Ct.CellRangeType.DIMENSION,...e)))}let n=s?[s]:[];if(this.crossFiltering&&this.aggFunc){const e=this.suppliedCellRange.columns[0];n=this.dimensionColState.filter(t=>t.colId===e.getColId())}else(r||0===n.length||n.some(({column:e})=>!e||!t.has(e)))&&(n=this.dimensionColState.filter(e=>e.selected));const o=1===n.length&&n[0].colId===e.DEFAULT_CATEGORY,a=n.map(({column:e})=>e).filter(e=>null!=e);a.length>0&&!o&&(this.dimensionCellRange=this.createCellRange(Ct.CellRangeType.DIMENSION,...a))}setValueCellRange(e,t,i){this.valueCellRange=void 0;const s=[],r=ks(this.chartType);let n=0;if(e.forEach(e=>{i?(null==r||n<r)&&t.has(e)&&(s.push(e),n++):this.valueColState.some(t=>t.selected&&t.colId===e.getColId())&&s.push(e)}),s.length>0){let e=[];this.valueColState.length>0?e=this.valueColState.map(e=>e.colId):t.forEach(t=>e.push(t.getColId())),s.sort((t,i)=>e.indexOf(t.getColId())-e.indexOf(i.getColId())),this.valueCellRange=this.createCellRange(Ct.CellRangeType.VALUE,...s)}}resetCellRanges(e,t){if(!e&&!t)return;const{dimensionCols:i,valueCols:s}=this.chartColumnService.getChartColumns(),r=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(i,r),t&&this.setValueCellRange(s,r)}updateSelectedDimensions(e){const t=new Set(e.map(e=>e.getColId()));if(As(Is(this.chartType))){const e=this.dimensionColState.filter(e=>t.has(e.colId)),i=new Set(e.map(e=>e.colId));this.dimensionColState=this.dimensionColState.map(e=>us(ds({},e),{selected:i.has(e.colId)}))}else{const e=(this.dimensionColState.find(e=>t.has(e.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(t=>us(ds({},t),{selected:t.colId===e}))}}syncDimensionCellRange(){const e=this.getSelectedDimensions();if(0===e.length)return;const t=e.map(({column:e})=>e).filter(e=>null!=e);t.length>0&&(this.dimensionCellRange=this.createCellRange(Ct.CellRangeType.DIMENSION,...t))}isComboChart(e){return Ss(null!=e?e:this.chartType)}};Ns.DEFAULT_CATEGORY="AG-GRID-DEFAULT-CATEGORY",gs([(0,Ct.Autowired)("rangeService")],Ns.prototype,"rangeService",2),gs([(0,Ct.Autowired)("chartTranslationService")],Ns.prototype,"chartTranslationService",2),gs([Ct.PostConstruct],Ns.prototype,"init",1);var _s=Ns,Os=["number","category","grouped-category","log","time"];function Fs(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Us(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function Gs(e,t,i){return e.concat(t).map(function(e){return Fs(e,i)})}function Bs(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function Vs(e,t){try{return t in e}catch(e){return!1}}function Hs(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){const t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t}(e)}function Us(e,t,i){(i=i||{}).arrayMerge=i.arrayMerge||Gs,i.isMergeableObject=i.isMergeableObject||Hs,i.cloneUnlessOtherwiseSpecified=Fs;const s=Array.isArray(t);return s===Array.isArray(e)?s?i.arrayMerge(e,t,i):function(e={},t={},i){const s={};return i.isMergeableObject(e)&&Bs(e).forEach(function(t){s[t]=Fs(e[t],i)}),Bs(t).forEach(function(r){(function(e,t){return Vs(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(Vs(e,r)&&i.isMergeableObject(t[r])?s[r]=function(e,t){if(!t.customMerge)return Us;const i=t.customMerge(e);return"function"==typeof i?i:Us}(r,i)(e[r],t[r],i):s[r]=Fs(t[r],i))}),s}(e,t,i):Fs(t,i)}function zs(e,t,i){if(null==e)return i;const s=t.split(".");let r=e;for(;s.length>1;)if(r=r[s.shift()],null==r)return i;const n=r[s[0]];return null!=n?n:i}function Ws(e){return Mt._.includes(Object.keys(At._Theme.themes),e)}var js=Os.reduce((e,t)=>us(ds({},e),{[t]:{title:{_enabledFromTheme:!0}}}),{});function Ks(e,t,i){const s=e.getExtraPaddingDirections();return{common:us(ds({},t?{animation:{duration:500}}:void 0),{axes:js,padding:{top:!i&&s.includes("top")?40:20,right:s.includes("right")?30:20,bottom:s.includes("bottom")?40:20,left:s.includes("left")?30:20}}),pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function $s(e,t){const{customChartThemes:i}=e,s=i&&i[t];return s||console.warn(`AG Grid: no stock theme exists with the name '${t}' and no custom chart theme with that name was supplied to 'customChartThemes'`),s}var Ys=e=>t=>null==t||e(t),qs=e=>"string"==typeof e,Xs=e=>"boolean"==typeof e,Zs=e=>"object"==typeof e,Qs=(e,t)=>i=>`AG Grid - unable to update chart as invalid params supplied:  \`${e}: ${i}\`, expected ${t}.`,Js=e=>`${e} is not supported in AG Charts Community (either 'ag-grid-charts-enterprise' or '@ag-grid-enterprise/charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,er=class e{static isEnterprise(){return Dt._ModuleSupport.enterpriseModule.isEnterprise}static isValidChartType(e){return!!Ds(e)||Ss(e)}static isLegacyChartType(t){return e.legacyChartTypes.includes(t)}static validateUpdateParams(t){switch(t.type){case"rangeChartUpdate":return e.validateUpdateRangeChartParams(t);case"pivotChartUpdate":return e.validateUpdatePivotChartParams(t);case"crossFilterChartUpdate":return e.validateUpdateCrossFilterChartParams(t);default:return console.warn(`AG Grid - Invalid value supplied for 'type': ${t.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}static validateCreateParams(t){return e.validateProperties(t,[e.enterpriseChartTypeValidation,e.switchCategorySeriesValidation])}static validateUpdateRangeChartParams(t){const i=[...e.commonUpdateValidations,e.enterpriseChartTypeValidation,...e.cellRangeValidations,{property:"seriesChartTypes",validationFn:e=>void 0===e||Array.isArray(e)&&e.every(Zs),warnMessage:Qs("seriesChartTypes","Array of SeriesChartType")}];return e.validateProperties(t,i,[...e.baseUpdateChartParams,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType"],"UpdateRangeChartParams")}static validateUpdatePivotChartParams(t){const i=[...e.commonUpdateValidations];return e.validateProperties(t,i,[...e.baseUpdateChartParams],"UpdatePivotChartParams")}static validateUpdateCrossFilterChartParams(t){const i=[...e.commonUpdateValidations,...e.cellRangeValidations];return e.validateProperties(t,i,[...e.baseUpdateChartParams,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}static validateProperties(e,t,i,s){let r;for(const i of t){const{property:t,validationFn:s,warnMessage:n,warnIfFixed:o}=i;if(t in e){const i=e[t],a=s(i);if(!0===a)continue;if(!1===a)return console.warn(n(i)),!1;r=r||ds({},e),r[t]=a,o&&console.warn(n(i))}}if(i)for(const t in e)if(!i.includes(t))return console.warn(`AG Grid - Unexpected property supplied. ${s} does not contain: \`${t}\`.`),!1;return r||!0}};er.legacyChartTypes=["doughnut"],er.baseUpdateChartParams=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"],er.validateChartType=Ys(e=>{if(er.isValidChartType(e))return!0;if(er.isLegacyChartType(e)){const t=Ts(e);return Tt._.warnOnce(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),er.validateAgChartThemeOverrides=Ys(e=>"object"==typeof e),er.validateChartParamsCellRange=Ys(e=>"object"==typeof e),er.validateAggFunc=Ys(e=>"string"==typeof e||"function"==typeof e),er.enterpriseChartTypeValidation={property:"chartType",validationFn:Ys(e=>er.isEnterprise()||!e||!function(e){return ws(Is(e),"isEnterprise")}(e)),warnMessage:e=>Js(`The '${e}' chart type`)},er.switchCategorySeriesValidation={property:"switchCategorySeries",validationFn:Ys(e=>{if(!e||er.isEnterprise())return!0}),warnMessage:()=>Js("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0},er.commonUpdateValidations=[{property:"chartId",validationFn:qs,warnMessage:Qs("chartId","string")},{property:"chartType",validationFn:er.validateChartType,warnMessage:Qs("chartType","ChartType")},{property:"chartThemeName",validationFn:qs,warnMessage:Qs("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:er.validateAgChartThemeOverrides,warnMessage:Qs("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:Xs,warnMessage:Qs("unlinkChart","boolean")}],er.cellRangeValidations=[{property:"cellRange",validationFn:er.validateChartParamsCellRange,warnMessage:Qs("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:Xs,warnMessage:Qs("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:er.validateAggFunc,warnMessage:Qs("aggFunc","string or IAggFunc")},er.switchCategorySeriesValidation];var tr=er,ir=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],sr=class e extends vt.BeanStub{constructor(e){super(),this.model=e,this.isEnterprise=()=>Et._ModuleSupport.enterpriseModule.isEnterprise}init(){this.setChartRange(),this.addManagedListener(this.eventService,vt.Events.EVENT_RANGE_SELECTION_CHANGED,e=>{e.id&&e.id===this.model.chartId&&this.updateForRangeChange()}),this.model.unlinked&&this.rangeService&&this.rangeService.setCellRanges([]),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_MOVED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_PINNED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_VISIBLE,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_MODEL_UPDATED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_CELL_VALUE_CHANGED,this.updateForDataChange.bind(this))}update(e){if(!this.validUpdateType(e))return!1;const t=tr.validateUpdateParams(e);if(!t)return!1;const i=!0===t?e:t;return this.applyValidatedChartParams(i),!0}applyValidatedChartParams(e){var t,i,s,r,n,o,a,l,c;const{chartId:h,chartType:d,chartThemeName:u,unlinkChart:p}=e,g={chartId:h,pivotChart:this.model.pivotChart,chartType:null!=d?d:this.model.chartType,chartThemeName:null!=u?u:this.model.chartThemeName,unlinkChart:null!=p?p:this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1};let m=ds({},g);switch(e.type){case"rangeChartUpdate":m.cellRange=null!=(t=this.createCellRange(e))?t:this.model.suppliedCellRange,m.switchCategorySeries=null!=(i=e.switchCategorySeries)?i:this.model.switchCategorySeries,m.aggFunc=null!=(s=e.aggFunc)?s:this.model.aggFunc,m.seriesChartTypes=e.seriesChartTypes,m.suppressChartRanges=null!=(r=e.suppressChartRanges)?r:this.model.suppressChartRanges,m.seriesGroupType=null!=(n=e.seriesGroupType)?n:this.model.seriesGroupType;break;case"crossFilterChartUpdate":m.cellRange=null!=(o=this.createCellRange(e))?o:this.model.suppliedCellRange,m.switchCategorySeries=!1,m.aggFunc=null!=(a=e.aggFunc)?a:this.model.aggFunc,m.crossFiltering=!0,m.suppressChartRanges=null!=(l=e.suppressChartRanges)?l:this.model.suppressChartRanges;break;case"pivotChartUpdate":m.switchCategorySeries=!1}this.model.updateModel(m),m.unlinkChart||m.suppressChartRanges?null==(c=this.rangeService)||c.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;const{maintainColState:t,setColsFromRange:i}=null!=e?e:{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:i}),this.model.updateData(),this.setChartRange()}updateForDataChange(){this.model.unlinked||(this.model.updateData(),this.raiseChartModelUpdateEvent())}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(e){this.model.updateCellRanges(e),this.model.updateData(),e.skipAnimation&&this.getChartProxy().getChartRef().skipAnimations(),this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(e){this.chartProxy.updateThemeOverrides(e)}getChartUpdateParams(e){const t=this.getSelectedValueColState().map(e=>({colId:e.colId,displayName:e.displayName})),i=this.getChartData(),s=this.getSelectedDimensions(),r={data:i,groupData:this.model.groupChartData,grouping:this.isGrouping(),categories:s.map(e=>{var t;return{id:e.colId,name:e.displayName,chartDataType:null!=(t=this.model.categoryAxisType)?t:this.model.getChartDataType(e.colId)}}),fields:t,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:this.model.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(r):r}invertCategorySeriesParams(e){const[t]=e.categories,i=[{id:_s.DEFAULT_CATEGORY,name:""}],s=e.data.map((e,i)=>{const s=`${t.id}:${i}`,r=e[t.id];return{colId:s,displayName:null==r?"":String(r)}}),r=e.fields.map(i=>{const s={[_s.DEFAULT_CATEGORY]:i.displayName};for(const[r,n]of e.data.entries()){const e=`${t.id}:${r}`,o=n[i.colId];s[e]=o}return s});return us(ds({},e),{categories:i,fields:s,data:r})}getChartModel(){const e=this.model.pivotChart?"pivot":"range",t=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:e,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy.getChartThemeOverrides(),chartPalette:this.chartProxy.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:t,seriesGroupType:this.model.seriesGroupType}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(e){this.updateMultiSeriesAndCategory(this.model.chartType,e),this.model.chartType=e,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent(),this.raiseChartOptionsChangedEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){Ls(this.getChartType())&&(this.model.switchCategorySeries=e,this.raiseChartModelUpdateEvent())}getAggFunc(){return this.model.aggFunc}setAggFunc(e,t){this.model.aggFunc!==e&&(this.model.aggFunc=e,t||(this.model.updateData(),this.raiseChartModelUpdateEvent()))}updateMultiSeriesAndCategory(e,t){var i,s;const r=(e,t)=>{let i=0;for(const s of e)s.selected&&(i>=t?s.selected=!1:i++);0===i&&(e[0].selected=!0)},n=Ps(t),o=ks(t),a=null!=n&&(null!=(i=Ps(e))?i:100)>(null!=n?n:100),l=null!=o&&(null!=(s=ks(e))?s:100)>(null!=o?o:100);a&&r(this.model.dimensionColState,n),l&&r(this.model.valueColState,o),(a||l)&&(this.model.resetCellRanges(a,l),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||(this.raiseChartModelUpdateEvent(),this.raiseChartOptionsChangedEvent())}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||ir}getThemes(){return this.getThemeNames().map(e=>{const t=Ws(e)?e:this.chartProxy.lookupCustomChartTheme(e);return Et._Theme.getChartTheme(t)})}getPalettes(){return this.getThemes().map(e=>e.palette)}getThemeTemplateParameters(){return this.getThemes().map(e=>e.getTemplateParameters())}getValueColState(){return this.model.valueColState.map(this.displayNameMapper.bind(this))}getSelectedValueColState(){return this.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}displayNameMapper(e){const t=this.model.columnNames[e.colId];return e.displayName=t?t.join(" - "):this.model.getColDisplayName(e.column),e}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.getValueColState()}}setChartRange(e=!1){!this.rangeService||this.model.suppressChartRanges||this.model.unlinked||this.rangeService.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeService&&this.rangeService.setCellRanges([]):this.updateForGridChange(),this.dispatchEvent({type:e.EVENT_CHART_LINKED_CHANGED})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return vt._.includes(["scatter","bubble"],this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){const e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(t,i,s){const r=this.model.comboChartModel.seriesChartTypes.find(e=>e.colId===t);if(r){const t="customCombo"!==this.model.chartType;t&&(this.model.chartType="customCombo");const n=r.chartType;null!=i&&(r.chartType=i),null!=s&&(r.secondaryAxis=s),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),t&&this.dispatchEvent({type:e.EVENT_CHART_TYPE_CHANGED}),n!==i&&this.dispatchEvent({type:e.EVENT_CHART_SERIES_CHART_TYPE_CHANGED}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){const e=this.getSelectedValueColState().map(e=>e.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){const t=null!=e?e:this.getChartType();return this.isComboChart(t)?["line","bar","area"]:[Is(t)]}getChartSeriesType(){const e=this.getSeriesChartTypes();if(0===e.length)return"bar";const t=e[0].chartType;return"columnLineCombo"===t?"bar":"areaColumnCombo"===t?"area":Is(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){var t;return e.cellRange&&(null==(t=this.rangeService)?void 0:t.createPartialCellRangeFromRangeParams(e.cellRange,!0))}validUpdateType(e){var t;if(!e.type)return console.warn("AG Grid - Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'."),!1;const i={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},s=null!=(t=Object.keys(i).find(e=>i[e]()))?t:"Range Chart",r=e.type===`${s[0].toLowerCase()}${s.slice(1).replace(/ /g,"")}Update`;return r||console.warn(`AG Grid - Unable to update chart as a '${e.type}' update type is not permitted on a ${s}.`),r}getCellRangeParams(){const e=this.getCellRanges(),t=e[0],i=t&&t.startRow||null,s=t&&t.endRow||null;return{rowStartIndex:i&&i.rowIndex,rowStartPinned:i&&i.rowPinned,rowEndIndex:s&&s.rowIndex,rowEndPinned:s&&s.rowPinned,columns:e.reduce((e,t)=>e.concat(t.columns.map(e=>e.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){var e;return null!=(e=this.model.seriesGroupType)?e:this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){const t={type:e.EVENT_CHART_MODEL_UPDATE};this.dispatchEvent(t)}raiseChartUpdatedEvent(){const t={type:e.EVENT_CHART_UPDATED};this.dispatchEvent(t)}raiseChartApiUpdateEvent(){const t={type:e.EVENT_CHART_API_UPDATE};this.dispatchEvent(t)}raiseChartOptionsChangedEvent(){const{chartId:e,chartType:t}=this.getChartModel(),i={type:vt.Events.EVENT_CHART_OPTIONS_CHANGED,chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy.getChartThemeOverrides()};this.eventService.dispatchEvent(i)}raiseChartRangeSelectionChangedEvent(){const e={type:vt.Events.EVENT_CHART_RANGE_SELECTION_CHANGED,id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()};this.eventService.dispatchEvent(e)}destroy(){super.destroy(),this.rangeService&&this.rangeService.setCellRanges([])}};sr.EVENT_CHART_UPDATED="chartUpdated",sr.EVENT_CHART_API_UPDATE="chartApiUpdate",sr.EVENT_CHART_MODEL_UPDATE="chartModelUpdate",sr.EVENT_CHART_TYPE_CHANGED="chartTypeChanged",sr.EVENT_CHART_SERIES_CHART_TYPE_CHANGED="chartSeriesChartTypeChanged",sr.EVENT_CHART_LINKED_CHANGED="chartLinkedChanged",gs([(0,vt.Autowired)("rangeService")],sr.prototype,"rangeService",2),gs([vt.PostConstruct],sr.prototype,"init",1);var rr=sr,nr=class e extends Pt.Component{constructor(t){super(e.TEMPLATE),this.config=null!=t?t:{};const{selectedValueList:i,valueFormatter:s,valueList:r}=this.config;this.selectedValues=null!=i?i:[],this.valueList=null!=r?r:[],this.valueFormatter=null!=s?s:e=>Pt._.escapeString(e)}init(){const{ariaLabel:e,onValuesChange:t,dragSourceId:i}=this.config;this.dropZonePanel=this.createManagedBean(new lr({getValues:()=>this.selectedValues,setValues:e=>this.updateValues(e),isDraggable:()=>this.selectedValues.length>1},e=>this.valueFormatter(e),e,i)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),null!=t&&(this.onValuesChange=t)}setValues(e,t){const{added:i,removed:s,updated:r}=this.getChanges(this.valueList,e);let n=!1;return(i.length||s.length||r.length)&&(n=!0),this.valueList=e,this.updateValues(t,n,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){const e=this.createSelectOptions();if(!e.length)return!1;const{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new Pt.AgSelect({options:e,placeholder:t,onValueChange:e=>this.addValue(e),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){let e=[];const{maxSelection:t}=this.config;return t&&this.selectedValues.length>=t||this.valueList.forEach(t=>{this.selectedValues.includes(t)||e.push({value:t,text:this.valueFormatter(t)})}),e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,i){var s,r,n,o,a;const l=this.selectedValues;this.selectedValues=e;const c=this.getChanges(l,e),h=t||c.added.length||c.removed.length,d=this.gos.getActiveDomElement(),u=null==(s=this.eSelect)?void 0:s.getGui().contains(d),p=null==(r=this.dropZonePanel)?void 0:r.getGui().contains(d);i||null==(n=this.onValuesChange)||n.call(this,c);const g=!!h&&!this.refreshSelect();this.dropZonePanel.refreshGui(),h&&u&&(g?this.dropZonePanel.focusList(!0):null==(o=this.eSelect)||o.getFocusableElement().focus()),p&&!e.length&&(null==(a=this.eSelect)||a.getFocusableElement().focus())}getChanges(e,t){return{added:t.filter(t=>!e.includes(t)),removed:e.filter(e=>!t.includes(e)),updated:t.filter((t,i)=>e[i]!==t),selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();const e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(Pt._.removeFromParent(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}};nr.TEMPLATE='<div class="ag-pill-select" role="presentation"></div>',gs([Pt.PostConstruct],nr.prototype,"init",1);var or=nr,ar=class extends Pt.PillDragComp{constructor(e,t,i,s,r,n){super(t,i,!1),this.value=e,this.valueFormatter=s,this.draggable=r,this.sourceId=n}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return Pt.DragSourceType.ChartPanel}getDragSourceId(){return this.sourceId}isDraggable(){return this.draggable}},lr=class extends Pt.PillDropZonePanel{constructor(e,t,i,s){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=i,this.sourceId=s}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||null!=this.sourceId&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?Pt.DragAndDropService.ICON_MOVE:Pt.DragAndDropService.ICON_NOT_ALLOWED}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,i){return new ar(e,t,i,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===Pt.DragSourceType.ChartPanel}};gs([Pt.PostConstruct],lr.prototype,"postConstruct",1);var cr=class extends Rt.Component{constructor(e,t,i,s,r){super(r),this.chartController=e,this.autoScrollService=t,this.allowMultipleSelection=i,this.maxSelection=s,this.columnComps=new Map}refreshColumnComps(e){return!!Rt._.areEqual(Rt._.keys(this.columnComps),e.map(({colId:e})=>e))&&(e.forEach(e=>{this.columnComps.get(e.colId).setValue(e.selected,!0)}),!0)}createGroup(e,t,i,s,r){if(this.allowMultipleSelection){const r=e.filter(e=>e.selected);this.valuePillSelect=this.groupComp.createManagedBean(new or({valueList:e,selectedValueList:r,valueFormatter:t,selectPlaceholder:this.chartTranslationService.translate(i),dragSourceId:s,onValuesChange:e=>this.onValueChange(e),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{const t=this.createValueSelectParams(e);t.onValueChange=t=>{e.forEach(e=>{e.selected=!1}),t.selected=!0,t.colId===_s.DEFAULT_CATEGORY&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:t,skipAnimation:null==r?void 0:r()})},this.valueSelect=this.groupComp.createManagedBean(new Rt.AgSelect(t)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;const{options:t,value:i}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(i,!0)}createValueSelectParams(e){let t;return{options:e.map(e=>{var i;const s=null!=(i=e.displayName)?i:"";return e.selected&&(t=e),{value:e,text:s}}),value:t}}onDragging(e){const t=this.checkHoveredItem(e);if(!t)return;this.lastDraggedColumn=e.dragItem.columns[0];const{comp:i,position:s}=t,{comp:r,position:n}=this.lastHoveredItem||{};i===r&&s===n||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredItem={comp:i,position:s},i.getGui().classList.add("ag-list-item-hovered",`ag-item-highlight-${s}`))}checkHoveredItem(e){if(Rt._.missing(e.vDirection))return null;const t=e.event;for(const e of this.columnComps.values()){const i=e.getGui();if(!i.querySelector(".ag-chart-data-column-drag-handle"))continue;const s=i.getBoundingClientRect();if(t.clientY>=s.top&&t.clientY<=s.bottom){const r=i.clientHeight;return{comp:e,position:t.clientY>s.top+r/2?"bottom":"top"}}}return null}onDragLeave(){this.clearHoveredItems()}onDragStop(){if(this.lastHoveredItem){const{dimensionCols:e,valueCols:t}=this.chartController.getColStateForMenu(),i=[...e,...t].find(e=>e.column===this.lastDraggedColumn);if(i){let e=Array.from(this.columnComps.values()).indexOf(this.lastHoveredItem.comp);"bottom"===this.lastHoveredItem.position&&e++,i.order=e,this.chartController.updateForPanelChange({updatedColState:i})}}this.clearHoveredItems(),this.lastDraggedColumn=void 0,this.autoScrollService.ensureCleared()}clearHoveredItems(){this.columnComps.forEach(e=>{e.getGui().classList.remove("ag-list-item-hovered","ag-item-highlight-top","ag-item-highlight-bottom")}),this.lastHoveredItem=void 0}addDragHandle(e,t){const i=Rt._.createIconNoSpan("columnDrag",this.gos);i.classList.add("ag-drag-handle","ag-chart-data-column-drag-handle"),e.getGui().insertAdjacentElement("beforeend",i);const s={type:Rt.DragSourceType.ChartPanel,eElement:i,dragItemName:t.displayName,getDragItem:()=>({columns:[t.column]}),onDragStopped:()=>this.onDragStop()};this.dragAndDropService.addDragSource(s,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(s))}addChangeListener(e,t){this.addManagedListener(e,Rt.Events.EVENT_FIELD_VALUE_CHANGED,()=>{t.selected=e.getValue(),this.chartController.updateForPanelChange({updatedColState:t})})}isInterestedIn(e){return e===Rt.DragSourceType.ChartPanel}onValueChange({added:e,updated:t,removed:i,selected:s}){let r,n;const o=()=>{s.forEach((e,t)=>{e.order=t}),n=!0};e.length?(r=e[0],r.selected=!0,o()):i.length?(r=i[0],r.selected=!1):t.length&&(o(),r=t[0]),r&&this.chartController.updateForPanelChange({updatedColState:r,resetOrder:n})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}};gs([(0,Rt.Autowired)("dragAndDropService")],cr.prototype,"dragAndDropService",2),gs([(0,Rt.Autowired)("chartTranslationService")],cr.prototype,"chartTranslationService",2);var hr=class e extends cr{constructor(t,i,s,r,n,o){super(t,i,r,void 0,e.TEMPLATE),this.title=s,this.dimensionCols=n,this.isOpen=o}init(){this.groupComp=this.createBean(new It.AgGroupComponent({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartMenuService.isLegacyFormat()?(this.createLegacyCategoriesGroup(this.dimensionCols),this.clearAggFuncControls()):(this.createCategoriesGroup(this.dimensionCols),this.createAggFuncControls(this.dimensionCols)),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){var t;this.chartMenuService.isLegacyFormat()?this.refreshColumnComps(e)||this.recreate(e):(null==(t=this.valuePillSelect)||t.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc()))}recreate(e){this.isOpen=this.groupComp.isExpanded(),It._.clearElement(this.getGui()),this.destroyBean(this.groupComp),this.dimensionCols=e,this.init()}createCategoriesGroup(e){this.createGroup(e,e=>{var t;return null!=(t=e.displayName)?t:""},"categoryAdd","categorySelect",()=>!this.chartController.getAggFunc())}createLegacyCategoriesGroup(e){const t=`chartDimension${this.groupComp.getCompId()}`,i=this.allowMultipleSelection;if(e.forEach(e=>{var s;const r={label:null!=(s=e.displayName)?s:"",value:e.selected,inputName:t},n=this.groupComp.createManagedBean(i?(()=>{const e=new It.AgCheckbox(r);return e.addCssClass("ag-data-select-checkbox"),e})():new It.AgRadioButton(r));this.addChangeListener(n,e),this.groupComp.addItem(n),this.columnComps.set(e.colId,n),i&&this.addDragHandle(n,e)}),i){const e=this.groupComp.getGui(),t={getIconName:()=>It.DragAndDropService.ICON_MOVE,getContainer:()=>e,onDragging:e=>this.onDragging(e),onDragLeave:()=>this.onDragLeave(),isInterestedIn:this.isInterestedIn.bind(this),targetContainsSource:!0};this.dragAndDropService.addDropTarget(t),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(t))}}createAggFuncControls(e){const t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new It.AgToggleButton({label:this.chartTranslationService.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:null!=t,onValueChange:e=>{var t,i;const s=e?"sum":void 0;this.chartController.setAggFunc(s),null==(t=this.aggFuncSelect)||t.setValue(s,!0),null==(i=this.aggFuncSelect)||i.setDisplayed(null!=s)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new It.AgSelect({options:[{value:"sum",text:this.chartTranslationService.translate("sum")},{value:"first",text:this.chartTranslationService.translate("first")},{value:"last",text:this.chartTranslationService.translate("last")},{value:"min",text:this.chartTranslationService.translate("min")},{value:"max",text:this.chartTranslationService.translate("max")},{value:"count",text:this.chartTranslationService.translate("count")},{value:"avg",text:this.chartTranslationService.translate("avg")}],value:"string"==typeof t?t:void 0,onValueChange:e=>{this.chartController.setAggFunc(e)}}))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){var i,s,r,n;const o=e.filter(e=>e.selected).some(e=>e.colId!==_s.DEFAULT_CATEGORY);null==(i=this.aggFuncToggle)||i.setValue(null!=t),null==(s=this.aggFuncSelect)||s.setValue("string"==typeof t?t:void 0,!0),null==(r=this.aggFuncToggle)||r.setDisplayed(o),null==(n=this.aggFuncSelect)||n.setDisplayed(o&&null!=t)}clearAggFuncControls(){this.aggFuncToggle=this.aggFuncToggle&&this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.aggFuncSelect&&this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};hr.TEMPLATE='<div id="categoriesGroup"></div>',gs([(0,It.Autowired)("chartMenuService")],hr.prototype,"chartMenuService",2),gs([It.PostConstruct],hr.prototype,"init",1);var dr=hr,ur=class e extends cr{constructor(t,i,s,r,n,o,a,l){super(t,i,n,o,e.TEMPLATE),this.chartOptionsService=s,this.title=r,this.valueCols=a,this.isOpen=l}init(){if(this.groupComp=this.createBean(new kt.AgGroupComponent({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){const e=this.groupComp.createManagedBean(new kt.AgToggleButton({label:this.chartTranslationService.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:e=>{this.chartOptionsService.setPairedMode(!!e),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(e)}this.chartMenuService.isLegacyFormat()?this.createLegacySeriesGroup(this.valueCols):this.createSeriesGroup(this.valueCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){var t,i;if(this.chartMenuService.isLegacyFormat())if(this.refreshColumnComps(e)){if(this.chartController.isActiveXYChart()){const t=this.generateGetSeriesLabel(e);e.forEach(e=>{this.columnComps.get(e.colId).setLabel(t(e))})}}else this.recreate(e);else null==(t=this.valuePillSelect)||t.setValueFormatter(this.generateGetSeriesLabel(e)),null==(i=this.valuePillSelect)||i.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e)}recreate(e){this.isOpen=this.groupComp.isExpanded(),kt._.clearElement(this.getGui()),this.destroyBean(this.groupComp),this.valueCols=e,this.init()}createSeriesGroup(e){this.createGroup(e,this.generateGetSeriesLabel(e),"seriesAdd","seriesSelect")}createLegacySeriesGroup(e){const t=this.generateGetSeriesLabel(e);e.forEach(e=>{const i=t(e),s=this.groupComp.createManagedBean(new kt.AgCheckbox({label:i,value:e.selected}));s.addCssClass("ag-data-select-checkbox"),this.addChangeListener(s,e),this.groupComp.addItem(s),this.columnComps.set(e.colId,s),this.addDragHandle(s,e)});const i=this.groupComp.getGui(),s={getIconName:()=>kt.DragAndDropService.ICON_MOVE,getContainer:()=>i,onDragging:e=>this.onDragging(e),onDragLeave:()=>this.onDragLeave(),isInterestedIn:this.isInterestedIn.bind(this),targetContainsSource:!0};this.dragAndDropService.addDropTarget(s),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(s))}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return e=>{var t;return null!=(t=e.displayName)?t:""};const t=e.filter(e=>e.selected),i="bubble"===this.chartController.getChartType(),s=this.chartOptionsService.getPairedMode(),r=new Map;return r.set(0,"X"),r.set(1,"Y"),r.set(2,"size"),e=>{var n;const o=null!=(n=e.displayName)?n:"";if(!e.selected)return o;const a=t.indexOf(e);if(-1===a)return o;let l;return l=s?r.get(a%(i?3:2)):0===a?"X":i&&a%2==0?"size":"Y",`${o} (${l})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};ur.TEMPLATE='<div id="seriesGroup"></div>',gs([(0,kt.Autowired)("chartMenuService")],ur.prototype,"chartMenuService",2),gs([kt.PostConstruct],ur.prototype,"init",1);var pr=ur,gr=class e extends Lt.Component{constructor(t,i,s){super(e.TEMPLATE),this.chartController=t,this.columns=i,this.isOpen=s,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}init(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){Lt._.areEqual(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),Lt._.clearElement(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.init()}getValidColIds(e){const t=this.chartController.getSeriesChartTypes();return e.filter(e=>e.selected&&!!t.filter(t=>t.colId===e.colId)[0]).map(({colId:e})=>e)}createSeriesChartTypeGroup(e){this.seriesChartTypeGroupComp=this.createBean(new Lt.AgGroupComponent({title:this.chartTranslationService.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));const t=this.chartController.getSeriesChartTypes();e.forEach(e=>{if(!e.selected)return;const i=t.filter(t=>t.colId===e.colId)[0];if(!i)return;this.selectedColIds.push(e.colId);const s=this.seriesChartTypeGroupComp.createManagedBean(new Lt.AgGroupComponent({title:e.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),r=this.seriesChartTypeGroupComp.createManagedBean(new Lt.AgCheckbox({label:this.chartTranslationService.translate("secondaryAxis"),labelWidth:"flex",disabled:(n=i.chartType,["groupedColumn","stackedColumn","stackedArea"].includes(n)),value:!!i.secondaryAxis,onValueChange:t=>this.chartController.updateSeriesChartType(e.colId,void 0,t)}));var n;s.addItem(r);const o=e=>this.chartTranslationService.translate(e),a=[{value:"line",text:o("line")},{value:"area",text:o("area")},{value:"stackedArea",text:o("stackedArea")},{value:"groupedColumn",text:o("groupedColumn")},{value:"stackedColumn",text:o("stackedColumn")}],l=s.createManagedBean(new Lt.AgSelect({labelAlignment:"left",labelWidth:"flex",options:a,value:i.chartType,onValueChange:t=>this.chartController.updateSeriesChartType(e.colId,t)}));s.addItem(l),this.seriesChartTypeGroupComp.addItem(s),this.chartTypeComps.set(e.colId,l),this.secondaryAxisComps.set(e.colId,r)}),this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){const e=this.chartController.getSeriesChartTypes();this.selectedColIds.forEach(t=>{const i=e.find(e=>e.colId===t);if(!i)return;const s=this.chartTypeComps.get(t),r=this.secondaryAxisComps.get(t);null==s||s.setValue(i.chartType),null==r||r.setValue(!!i.secondaryAxis),null==r||r.setDisabled(this.isSecondaryAxisDisabled(i.chartType))})}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(e){return["groupedColumn","stackedColumn","stackedArea"].includes(e)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}};gr.TEMPLATE='<div id="seriesChartTypeGroup"></div>',gs([(0,Lt.Autowired)("chartTranslationService")],gr.prototype,"chartTranslationService",2),gs([Lt.PostConstruct],gr.prototype,"init",1);var mr=gr,fr=class e extends Nt.Component{constructor(e,t){super(),this.getValue=e,this.setValue=t}init(){this.switchCategorySeriesToggleButton=this.createManagedBean(new Nt.AgToggleButton({label:this.chartTranslationService.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.getValue(),onValueChange:e=>{this.setValue(e)}}));const t={title:void 0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-data",expanded:!0,items:[this.switchCategorySeriesToggleButton]};this.setTemplate(e.TEMPLATE,{switchCategorySeriesGroup:t})}refresh(){var e;null==(e=this.switchCategorySeriesToggleButton)||e.setValue(this.getValue(),!0)}};fr.TEMPLATE='<div>\n        <ag-group-component ref="switchCategorySeriesGroup"></ag-group-component>\n    </div>',gs([(0,Nt.Autowired)("chartTranslationService")],fr.prototype,"chartTranslationService",2),gs([Nt.PostConstruct],fr.prototype,"init",1);var yr=fr,vr={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0}]},Cr=class e extends yt.Component{constructor(t,i){super(e.TEMPLATE),this.chartController=t,this.chartOptionsService=i,this.isSwitchCategorySeriesToggled=!1}init(){this.switchCategorySeriesPanel=this.addComponent(this.createManagedBean(new yr(()=>this.chartController.isCategorySeriesSwitched(),e=>this.chartController.switchCategorySeries(e)))),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.createAutoScrollService(),this.updatePanels(),this.addManagedListener(this.chartController,rr.EVENT_CHART_MODEL_UPDATE,this.updatePanels.bind(this)),this.addManagedListener(this.chartController,rr.EVENT_CHART_API_UPDATE,this.updatePanels.bind(this))}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){var e,t,i,s,r;const n=this.chartType,o=this.isSwitchCategorySeriesToggled,{dimensionCols:a,valueCols:l}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();const c=this.isSwitchCategorySeriesToggled!==o;this.canRefresh(n,this.chartType)&&!c?(null==(e=this.categoriesDataPanel)||e.refresh(a),null==(t=this.seriesDataPanel)||t.refresh(l),null==(i=this.seriesChartTypePanel)||i.refresh(l)):this.recreatePanels(a,l),null==(s=this.switchCategorySeriesPanel)||s.setDisplayed(Ls(this.chartType)&&!this.chartMenuService.isLegacyFormat()&&!this.chartController.isGrouping()),c&&(null==(r=this.switchCategorySeriesPanel)||r.refresh())}canRefresh(e,t){if(void 0===e)return!1;if(e===t)return!0;const i=e=>["columnLineCombo","areaColumnCombo","customCombo"].includes(e);return!(!i(e)||!i(t))}recreatePanels(e,t){var i;this.clearPanelComponents();const{chartType:s}=this;if(!s)return;const r=this.chartController.isCategorySeriesSwitched(),n=null==(i=this.getDataPanelDef().groups)?void 0:i.map(({type:i,isOpen:n})=>i===(r?"series":"categories")?this.categoriesDataPanel=this.createBean(new dr(this.chartController,this.autoScrollService,this.getCategoryGroupTitle(r),this.getCategoryGroupMultipleSelect(s,r),e,n)):i===(r?"categories":"series")?this.seriesDataPanel=this.createBean(new pr(this.chartController,this.autoScrollService,this.chartOptionsService,this.getSeriesGroupTitle(r),this.getSeriesGroupMultipleSelect(s,r),this.getSeriesGroupMaxSelection(s,r),t,n)):"seriesChartType"===i?this.chartController.isComboChart()?this.seriesChartTypePanel=this.createBean(new mr(this.chartController,t,n)):null:(yt._.warnOnce(`Invalid charts data panel group name supplied: '${i}'`),null)).filter(e=>null!=e);n&&this.addPanelComponents(n)}addPanelComponents(e){var t;const i=document.createDocumentFragment();for(const t of e)this.registerComponent(t),i.appendChild(t.getGui());const s=null==(t=this.switchCategorySeriesPanel)?void 0:t.getGui();return this.getGui().insertBefore(i,null!=s?s:null),e}clearPanelComponents(){const e=this.getGui();this.categoriesDataPanel&&e.removeChild(this.categoriesDataPanel.getGui()),this.seriesDataPanel&&e.removeChild(this.seriesDataPanel.getGui()),this.seriesChartTypePanel&&e.removeChild(this.seriesChartTypePanel.getGui()),this.categoriesDataPanel=this.destroyBean(this.categoriesDataPanel),this.seriesDataPanel=this.destroyBean(this.seriesDataPanel),this.seriesChartTypePanel=this.destroyBean(this.seriesChartTypePanel)}createAutoScrollService(){const e=this.getGui();this.autoScrollService=new yt.AutoScrollService({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}addComponent(e){return this.registerComponent(e),this.getGui().appendChild(e.getGui()),e}registerComponent(e){e.addCssClass("ag-chart-data-section")}getDataPanelDef(){var e,t;return null!=(t=null==(e=this.gos.get("chartToolPanelsDef"))?void 0:e.dataPanel)?t:vr}getCategoryGroupTitle(e){return e?this.chartTranslationService.translate("seriesLabels"):this.chartTranslationService.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(e,t){return!t&&1!==Ps(e)}getSeriesGroupTitle(e){return e?this.chartTranslationService.translate("categoryValues"):this.chartTranslationService.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(e,t){return 1!==this.getSeriesGroupMaxSelection(e,t)}getSeriesGroupMaxSelection(e,t){if(!t)return ks(e)}};Cr.TEMPLATE='<div class="ag-chart-data-wrapper ag-scrollable-container"></div>',gs([(0,yt.Autowired)("chartTranslationService")],Cr.prototype,"chartTranslationService",2),gs([(0,yt.Autowired)("chartMenuService")],Cr.prototype,"chartMenuService",2),gs([yt.PostConstruct],Cr.prototype,"init",1);var br=Cr,Sr=class e extends Ft.Component{constructor(e){super(),this.activeComps=[],this.params=e,this.chartOptions=e.chartMenuUtils.getChartOptions()}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.params.name||this.chartTranslationService.translate("font"),enabled:this.params.enabled,suppressEnabledCheckbox:!!this.params.suppressEnabledCheckbox,onEnableChange:e=>{this.params.onEnableChange&&this.params.onEnableChange(e)}};this.setTemplate(e.TEMPLATE,{fontGroup:t,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:this.params.chartMenuUtils.getDefaultColorPickerParams(this.params.keyMapper("color"))})}addCompToPanel(e){this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){const e=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua,  serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode,  sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],t=this.getInitialFontValue("fontFamily");let i=e[0];if(t){const s=e.map(e=>e.toLowerCase()).indexOf(t.toLowerCase());if(s>=0)i=e[s];else{const s=Ft._.capitalise(t);e.push(s),i=s}}return{options:e.sort().map(e=>({value:e,text:e})),inputWidth:"flex",value:`${i}`,onValueChange:e=>this.setFont({fontFamily:e})}}getSizeSelectParams(){const e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue("fontSize");return Ft._.includes(e,t)||e.push(t),{options:e.sort((e,t)=>e-t).map(e=>({value:`${e}`,text:`${e}`})),inputWidth:"flex",value:`${t}`,onValueChange:e=>this.setFont({fontSize:parseInt(e,10)}),label:this.chartTranslationService.translate("size")}}getWeightStyleSelectParams(){var e,t;const i=null!=(e=this.getInitialFontValue("fontWeight"))?e:"normal",s=null!=(t=this.getInitialFontValue("fontStyle"))?t:"normal",r=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}];let n=r.find(e=>e.weight===i&&e.style===s);return n||(n={name:"predefined",weight:i,style:s},r.unshift(n)),{options:r.map(e=>({value:e.name,text:this.chartTranslationService.translate(e.name)})),inputWidth:"flex",value:n.name,onValueChange:e=>{const t=r.find(t=>t.name===e);this.setFont({fontWeight:t.weight,fontStyle:t.style})}}}addItemToPanel(e){this.fontGroup.addItem(e),this.activeComps.push(e)}destroyActiveComps(){this.activeComps.forEach(e=>{Ft._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){const{keyMapper:t}=this.params;Object.entries(e).forEach(([e,i])=>{i&&this.chartOptions.setValue(t(e),i)})}getInitialFontValue(e){const{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}};Sr.TEMPLATE='<div class="ag-font-panel">\n            <ag-group-component ref="fontGroup">\n                <ag-select ref="familySelect"></ag-select>\n                <ag-select ref="weightStyleSelect"></ag-select>\n                <div class="ag-charts-font-size-color">\n                    <ag-select ref="sizeSelect"></ag-select>\n                    <ag-color-picker ref="colorPicker"></ag-color-picker>\n                </div>\n            </ag-group-component>\n        </div>',gs([(0,Ft.RefSelector)("fontGroup")],Sr.prototype,"fontGroup",2),gs([(0,Ft.Autowired)("chartTranslationService")],Sr.prototype,"chartTranslationService",2),gs([Ft.PostConstruct],Sr.prototype,"init",1);var wr=Sr,xr=class e extends Ot.Component{constructor({chartMenuParamsFactory:e,isExpandedOnInit:t=!1}){super(),this.chartMenuUtils=e,this.isExpandedOnInit=t}init(){const t=this.chartMenuUtils.addEnableParams("legend.enabled",{cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("legend"),suppressEnabledCheckbox:!1,suppressToggleExpandOnEnableChange:!0,expanded:this.isExpandedOnInit,items:[this.createLabelPanel()]});this.setTemplate(e.TEMPLATE,{legendGroup:t,legendPositionSelect:this.chartMenuUtils.getDefaultLegendParams("legend.position"),legendPaddingSlider:this.getSliderParams("spacing","spacing",200),markerSizeSlider:this.getSliderParams("item.marker.size","markerSize",40),markerStrokeSlider:this.getSliderParams("item.marker.strokeWidth","markerStroke",10),markerPaddingSlider:this.getSliderParams("item.marker.padding","itemSpacing",20),itemPaddingXSlider:this.getSliderParams("item.paddingX","layoutHorizontalSpacing",50),itemPaddingYSlider:this.getSliderParams("item.paddingY","layoutVerticalSpacing",50)})}getSliderParams(e,t,i){return this.chartMenuUtils.getDefaultSliderParams(`legend.${e}`,t,i)}createLabelPanel(){const e={enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`legend.item.label.${e}`};return this.createManagedBean(new wr(e))}};xr.TEMPLATE='<div>\n            <ag-group-component ref="legendGroup">\n                <ag-select ref="legendPositionSelect"></ag-select>\n                <ag-slider ref="legendPaddingSlider"></ag-slider>\n                <ag-slider ref="markerSizeSlider"></ag-slider>\n                <ag-slider ref="markerStrokeSlider"></ag-slider>\n                <ag-slider ref="markerPaddingSlider"></ag-slider>\n                <ag-slider ref="itemPaddingXSlider"></ag-slider>\n                <ag-slider ref="itemPaddingYSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,Ot.Autowired)("chartTranslationService")],xr.prototype,"chartTranslationService",2),gs([Ot.PostConstruct],xr.prototype,"init",1);var Er=xr,Mr=class e extends Bt.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t=this.chartMenuUtils.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("ticks"),suppressEnabledCheckbox:!1}),i=this.chartMenuUtils.getDefaultColorPickerParams("tick.color"),s=this.chartMenuUtils.getDefaultSliderParams("tick.width","width",10),r=this.chartMenuUtils.getDefaultSliderParams("tick.size","length",30);this.setTemplate(e.TEMPLATE,{axisTicksGroup:t,axisTicksColorPicker:i,axisTicksWidthSlider:s,axisTicksSizeSlider:r})}};Mr.TEMPLATE='<div>\n            <ag-group-component ref="axisTicksGroup">\n                <ag-color-picker ref="axisTicksColorPicker"></ag-color-picker>\n                <ag-slider ref="axisTicksWidthSlider"></ag-slider>\n                <ag-slider ref="axisTicksSizeSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,Bt.Autowired)("chartTranslationService")],Mr.prototype,"chartTranslationService",2),gs([Bt.PostConstruct],Mr.prototype,"init",1);var Ar=Mr,Tr=class e extends Vt.Component{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}init(){const t=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("gridLines"),suppressEnabledCheckbox:!1}),i=this.getGridLineColorPickerParams("color"),s=this.getGridLineWidthSliderParams("thickness"),r=this.getGridLineDashSliderParams("lineDash");this.setTemplate(e.TEMPLATE,{gridLineGroup:t,gridLineColorPicker:i,gridLineWidthSlider:s,gridLineLineDashSlider:r})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",e,{formatInputValue:e=>{var t;return null==(t=null==e?void 0:e[0])?void 0:t.stroke},parseInputValue:e=>{var t;const i=null!=(t=this.chartOptions.getValue("gridLine.style"))?t:[];return 0===i.length?[{stroke:e,lineDash:[]}]:[us(ds({},i[0]),{stroke:e})]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",e,10)}getGridLineDashSliderParams(e){var t,i;const s=this.chartOptions.getValue("gridLine.style"),r=null==(i=null==(t=null==s?void 0:s[0])?void 0:t.lineDash)?void 0:i[0],n=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(null!=r?r:0,e,30);return n.onValueChange=e=>{const t=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[e],stroke:t}])},n}};Tr.TEMPLATE='<div>\n            <ag-group-component ref="gridLineGroup">\n                <ag-color-picker ref="gridLineColorPicker"></ag-color-picker>\n                <ag-slider ref="gridLineWidthSlider"></ag-slider>\n                <ag-slider ref="gridLineLineDashSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,Vt.Autowired)("chartTranslationService")],Tr.prototype,"chartTranslationService",2),gs([Vt.PostConstruct],Tr.prototype,"init",1);var Dr=Tr,Ir=class e extends Ht.AgAbstractLabel{constructor(t){super(t,e.TEMPLATE),this.radius=0,this.offsetX=0,this.offsetY=0}postConstruct(){super.postConstruct();const{value:e,onValueChange:t}=this.config;null!=e&&this.setValue(e,void 0,!0),null!=t&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:e=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:e=>this.calculateAngleDrag(e),onDragStop:()=>{}},this.dragService.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(e=>{null!=e&&""!==e||(e="0"),e=this.eAngleValue.normalizeValue(e);let t=parseFloat(e);t>180&&(t-=360),this.setValue(t)}),this.updateNumberInput(),Ht._.exists(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListener(this,Ht.Events.EVENT_FIELD_VALUE_CHANGED,()=>{this.eAngleValue.getInputElement().contains(this.gos.getActiveDomElement())||this.updateNumberInput()})}updateNumberInput(){const e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){const t=this.parentCircleRect||{width:24,height:24},i=this.eChildCircle,s=t.width/2,r=t.height/2;i.style.left=`${s+8*Math.cos(e)}px`,i.style.top=`${r+8*Math.sin(e)}px`}calculatePolar(){const e=this.offsetX,t=this.offsetY,i=Math.atan2(t,e);this.degrees=this.toDegrees(i),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(i)}calculateCartesian(){const e=this.toRadians(this.getValue()),t=this.getRadius();this.setOffsetX(Math.cos(e)*t).setOffsetY(Math.sin(e)*t)}setOffsetX(e){return this.offsetX!==e&&(this.offsetX=e,this.calculatePolar()),this}setOffsetY(e){return this.offsetY!==e&&(this.offsetY=e,this.calculatePolar()),this}calculateAngleDrag(e){const t=this.parentCircleRect,i=t.width/2,s=t.height/2,r=e.clientX-t.left-i,n=e.clientY-t.top-s,o=Math.atan2(n,r);this.setValue(o,!0)}toDegrees(e){return e/Math.PI*180}toRadians(e){return e/180*Math.PI}normalizeNegativeValue(e){return e<0?360+e:e}normalizeAngle180(e){return(e%=2*Math.PI)<-Math.PI?e+=2*Math.PI:e>=Math.PI&&(e-=2*Math.PI),e}getRadius(){return this.radius}setRadius(e){return this.radius===e||(this.radius=e,this.calculateCartesian()),this}onValueChange(e){return this.addManagedListener(this,Ht.Events.EVENT_FIELD_VALUE_CHANGED,()=>{e(this.degrees)}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,i){let s;return s=t?e:this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(s),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(s),i||this.dispatchEvent({type:Ht.Events.EVENT_FIELD_VALUE_CHANGED})),this}setWidth(e){return Ht._.setFixedWidth(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragService.removeDragSource(this.dragListener),super.destroy()}};Ir.TEMPLATE='<div class="ag-angle-select">\n            <div ref="eLabel"></div>\n            <div class="ag-wrapper ag-angle-select-wrapper">\n                <div ref="eAngleSelectField" class="ag-angle-select-field">\n                    <div ref="eParentCircle" class="ag-angle-select-parent-circle">\n                        <div ref="eChildCircle" class="ag-angle-select-child-circle"></div>\n                    </div>\n                </div>\n                <ag-input-number-field ref="eAngleValue"></ag-input-number-field>\n            </div>\n        </div>',gs([(0,Ht.RefSelector)("eLabel")],Ir.prototype,"eLabel",2),gs([(0,Ht.RefSelector)("eParentCircle")],Ir.prototype,"eParentCircle",2),gs([(0,Ht.RefSelector)("eChildCircle")],Ir.prototype,"eChildCircle",2),gs([(0,Ht.RefSelector)("eAngleValue")],Ir.prototype,"eAngleValue",2),gs([(0,Ht.Autowired)("dragService")],Ir.prototype,"dragService",2);var Rr=Ir,Pr=class extends Ut.BeanStub{constructor(e){super(),this.chartOptionsProxy=e}getDefaultColorPickerParams(e,t,i){return this.addValueParams(e,{label:this.chartTranslationService.translate(null!=t?t:"color"),labelWidth:"flex",inputWidth:"flex"},i)}getDefaultNumberInputParams(e,t,i){return this.addValueParams(e,{label:this.chartTranslationService.translate(t),labelWidth:"flex",inputWidth:"flex",precision:null==i?void 0:i.precision,step:null==i?void 0:i.step,min:null==i?void 0:i.min,max:null==i?void 0:i.max},{parseInputValue:e=>{const t=Number(e);return isNaN(t)?void 0:t},formatInputValue:e=>null==e?"":`${e}`})}getDefaultSliderParams(e,t,i,s){var r;let n=null!=(r=this.chartOptionsProxy.getValue(e))?r:0;s&&Array.isArray(n)&&(n=n[0]);const o=this.getDefaultSliderParamsWithoutValueParams(n,t,i);return o.onValueChange=t=>this.chartOptionsProxy.setValue(e,s?[t]:t),o}getDefaultSliderParamsWithoutValueParams(e,t,i){return{label:this.chartTranslationService.translate(t),minValue:0,maxValue:Math.max(e,i),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,i){const s=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslationService.translate(t),value:s,readOnly:null==i?void 0:i.readOnly,passive:null==i?void 0:i.passive};return r.onValueChange=t=>{this.chartOptionsProxy.setValue(e,"boolean"==typeof t?t:void 0)},r}getDefaultSelectParams(e,t,i,s){const r=this.chartOptionsProxy.getValue(e),n={label:this.chartTranslationService.translate(t),value:r,options:i,pickerType:null==s?void 0:s.pickerType,pickerAriaLabelKey:null==s?void 0:s.pickerAriaLabelKey,pickerAriaLabelValue:null==s?void 0:s.pickerAriaLabelValue};return n.onValueChange=t=>{this.chartOptionsProxy.setValue(e,t)},n}getDefaultLegendParams(e){return this.addValueParams(e,{label:this.chartTranslationService.translate("position"),labelWidth:"flex",inputWidth:"flex",options:["top","right","bottom","left"].map(e=>({value:e,text:this.chartTranslationService.translate(e)}))})}getDefaultFontPanelParams(e,t){const i=t=>`${e}.${t}`;return this.addEnableParams(i("enabled"),{name:this.chartTranslationService.translate(t),suppressEnabledCheckbox:!1,chartMenuUtils:this,keyMapper:i})}addValueParams(e,t,i){const s=this.chartOptionsProxy.getValue(e);return t.value=(null==i?void 0:i.formatInputValue)?i.formatInputValue(s):s,t.onValueChange=t=>{const s=(null==i?void 0:i.parseInputValue)?i.parseInputValue(t):t;this.chartOptionsProxy.setValue(e,s)},t}addEnableParams(e,t){var i;return t.enabled=null!=(i=this.chartOptionsProxy.getValue(e))&&i,t.onEnableChange=t=>this.chartOptionsProxy.setValue(e,t),t}getChartOptions(){return this.chartOptionsProxy}};gs([(0,Ut.Autowired)("chartTranslationService")],Pr.prototype,"chartTranslationService",2);var kr=class e extends Gt.Component{constructor(e,{chartController:t,chartOptionsService:i,isExpandedOnInit:s=!1,seriesType:r}){super(),this.activePanels=[],this.axisLabelUpdateFuncs=[],this.axisType=e,this.chartController=t,this.chartAxisOptionsProxy=i.getCartesianAxisOptionsProxy(e),this.chartAxisThemeOverridesProxy=i.getCartesianAxisThemeOverridesProxy(e),this.chartAxisAppliedThemeOverridesProxy=i.getCartesianAxisAppliedThemeOverridesProxy(e),this.chartOptionsSeriesProxy=i.getSeriesOptionsProxy(()=>null!=r?r:this.chartController.getChartSeriesType()),this.chartOptionsService=i,this.isExpandedOnInit=s}init(){var t;const i=this.axisType,s={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(i),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0},r=this.createManagedBean(new Pr(this.chartAxisOptionsProxy)),n=this.createManagedBean(new Pr(this.chartAxisThemeOverridesProxy)),o=this.getAxisTypeSelectParams(r,this.chartAxisAppliedThemeOverridesProxy),a=this.getAxisPositionSelectParams(r),l=this.getAxisTimeFormatSelectParams(r),c=this.getAxisColorInputParams(n),h=this.getAxisLineWidthSliderParams(n);this.setTemplate(e.TEMPLATE,{axisGroup:s,axisTypeSelect:null!=o?o:void 0,axisPositionSelect:null!=a?a:void 0,axisTimeFormatSelect:null!=l?l:void 0,axisColorInput:c,axisLineWidthSlider:h}),this.axisTypeSelect.setDisplayed(!!(null==(t=o.options)?void 0:t.length)),a||this.removeTemplateComponent(this.axisPositionSelect);const d=()=>{const e="time"===this.chartAxisOptionsProxy.getValue("type");Gt._.setDisplayed(this.axisTimeFormatSelect.getGui(),e)};l?(d(),this.addManagedListener(this.eventService,Gt.Events.EVENT_CHART_OPTIONS_CHANGED,e=>{d()})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(n),this.initAxisTicks(n),this.initAxisLabels(n),this.addManagedListener(this.chartController,rr.EVENT_CHART_UPDATED,()=>this.axisLabelUpdateFuncs.forEach(e=>e())),this.addManagedListener(this.chartController,rr.EVENT_CHART_MODEL_UPDATE,()=>setTimeout(()=>{this.refreshAxisTypeSelect(r),d()}))}getAxisTypeSelectParams(e,t){const i=e.getChartOptions(),s=this.getAxisTypeSelectOptions(),r=e.getDefaultSelectParams("type","axisType",s);return r.onValueChange=e=>{var s;const r=i.getValue("type");if(e===r)return;const n=t.getValue("*"),o="time"===e,a="time"===r!==o?o?"%d %B %Y":void 0:null;if(this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,e),null!==a){const e=null!=(s=i.getValue("label"))?s:{};i.setValue("label",us(ds({},e),{format:a}))}t.setValue("*",n)},r}refreshAxisTypeSelect(e){const t=this.getAxisTypeSelectOptions(),i=!!t.length;this.axisTypeSelect.setDisplayed(i),i&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){const e=this.chartController.getChartType();return["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(e)||this.chartController.isGrouping()||!this.isCategoryAxis()||this.chartController.isCategorySeriesSwitched()||!(()=>{const e=this.chartController.getChartData()[0];return!!e&&this.chartController.getSelectedDimensions().every(t=>!isNaN(parseFloat(e[t.colId])))})()?[]:["category","number","time"].map(e=>({value:e,text:this.translate(e)}))}isCategoryAxis(){const e="horizontal"===this.chartOptionsSeriesProxy.getValue("direction");return e&&"yAxis"===this.axisType||!e&&"xAxis"===this.axisType}getAxisPositionSelectParams(e){const t=((e,t)=>{if("heatmap"===e)return null;switch(t){case"xAxis":return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];case"yAxis":return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]}})(this.chartController.getChartType(),this.axisType);return t?e.getDefaultSelectParams("position","position",t):null}getAxisTimeFormatSelectParams(e){if(!this.isCategoryAxis())return null;const t=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return e.getDefaultSelectParams("label.format","timeFormat",t)}getAxisColorInputParams(e){return e.getDefaultColorPickerParams("line.color")}getAxisLineWidthSliderParams(e){var t;const i=e.getChartOptions(),s=e.getDefaultSliderParamsWithoutValueParams(null!=(t=i.getValue("line.enabled")?i.getValue("line.width"):null)?t:0,"thickness",10);return s.onValueChange=e=>{var t;t=0===e?null:e,i.setValues([{expression:"line.enabled",value:null!=t},{expression:"line.width",value:null!=t?t:0}])},s}initGridLines(e){if("heatmap"!==this.chartController.getChartType()){const t=this.createBean(new Dr(e));this.axisGroup.addItem(t),this.activePanels.push(t)}}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;const t=this.createBean(new Ar(e));this.axisGroup.addItem(t),this.activePanels.push(t)}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(e){const t={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:e,keyMapper:e=>`label.${e}`},i=this.createBean(new wr(t));this.axisGroup.addItem(i),this.activePanels.push(i),this.addAdditionalLabelComps(i,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);const i=this.createRotationWidget("labelRotation",t),s=this.initLabelRotation(i,t);e.addCompToPanel(s),e.addCompToPanel(i)}initLabelRotation(e,t){const i=t.getChartOptions(),s=()=>i.getValue("label.rotation"),r="number"!=typeof s()&&i.getValue("label.autoRotate"),n=this.createBean(new Gt.AgCheckbox({label:this.translate("autoRotate"),value:r,onValueChange:t=>{t&&(this.prevRotation=s()),i.setValues([{expression:"label.autoRotate",value:t},{expression:"label.rotation",value:t?void 0:this.prevRotation}]),e.setDisabled(t)}}));return e.setDisabled(r),n}createRotationWidget(e,t){var i;const s=t.getChartOptions(),r=()=>s.getValue("label.rotation"),n=String.fromCharCode(176),o=`${this.chartTranslationService.translate(e)} ${n}`,a=new Rr({label:o,labelWidth:"flex",value:null!=(i=r())?i:0,onValueChange:e=>s.setValue("label.rotation",e)});return this.axisLabelUpdateFuncs.push(()=>{var e;a.setValue(null!=(e=r())?e:0)}),this.createBean(a)}addLabelPadding(e,t){const i=this.createBean(new Gt.AgSlider(t.getDefaultSliderParams("label.padding","padding",30)));e.addCompToPanel(i)}translate(e){return this.chartTranslationService.translate(e)}removeTemplateComponent(e){Gt._.removeFromParent(e.getGui()),this.destroyBean(e)}destroyActivePanels(){this.activePanels.forEach(e=>{Gt._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};kr.TEMPLATE='<div>\n            <ag-group-component ref="axisGroup">\n                <ag-select ref="axisTypeSelect"></ag-select>\n                <ag-select ref="axisTimeFormatSelect"></ag-select>\n                <ag-select ref="axisPositionSelect"></ag-select>\n                <ag-color-picker ref="axisColorInput"></ag-color-picker>\n                <ag-slider ref="axisLineWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,Gt.RefSelector)("axisGroup")],kr.prototype,"axisGroup",2),gs([(0,Gt.RefSelector)("axisTypeSelect")],kr.prototype,"axisTypeSelect",2),gs([(0,Gt.RefSelector)("axisPositionSelect")],kr.prototype,"axisPositionSelect",2),gs([(0,Gt.RefSelector)("axisTimeFormatSelect")],kr.prototype,"axisTimeFormatSelect",2),gs([(0,Gt.Autowired)("chartTranslationService")],kr.prototype,"chartTranslationService",2),gs([Gt.PostConstruct],kr.prototype,"init",1);var Lr=kr,Nr=class e extends zt.Component{constructor({chartController:e,chartAxisMenuParamsFactory:t,isExpandedOnInit:i=!1}){super(),this.chartController=e,this.chartMenuUtils=t,this.isExpandedOnInit=i}init(){const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0},i=this.chartMenuUtils.getDefaultColorPickerParams("line.color"),s=this.chartMenuUtils.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(e.TEMPLATE,{axisGroup:t,axisColorInput:i,axisLineWidthSlider:s}),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){const e=this.chartController.getChartType();if(["radarLine","radarArea"].includes(e)){const e=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:e,property:"shape"}))}"pie"!==e&&this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){const e={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`label.${e}`},t=this.createManagedBean(new wr(e)),i=this.createOrientationWidget();t.addItemToPanel(i),this.axisGroup.addItem(t)}createOrientationWidget(){const e=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:e,property:"label.orientation"})}initRadiusAxis(){if(!ws(Is(this.chartController.getChartType()),"isRadial"))return;const e=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],t=this.createManagedBean(new zt.AgGroupComponent({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:e})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(t)}createSlider(e){const{labelKey:t,defaultMaxValue:i,step:s=.05,property:r}=e,n=this.chartMenuUtils.getDefaultSliderParams(r,t,i);return n.step=s,this.createManagedBean(new zt.AgSlider(n))}createSelect(e){const{labelKey:t,options:i,property:s}=e;return this.createManagedBean(new zt.AgSelect(this.chartMenuUtils.addValueParams(s,{label:this.chartTranslationService.translate(t),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:i})))}translate(e){return this.chartTranslationService.translate(e)}};Nr.TEMPLATE='<div>\n            <ag-group-component ref="axisGroup">\n                <ag-color-picker ref="axisColorInput"></ag-color-picker>\n                <ag-slider ref="axisLineWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,zt.RefSelector)("axisGroup")],Nr.prototype,"axisGroup",2),gs([(0,zt.Autowired)("chartTranslationService")],Nr.prototype,"chartTranslationService",2),gs([zt.PostConstruct],Nr.prototype,"init",1);var _r=Nr,Or=class e extends jt.Component{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("padding"),suppressEnabledCheckbox:!0},i=e=>this.chartMenuUtils.getDefaultSliderParams("padding."+e,e,200);this.setTemplate(e.TEMPLATE,{chartPaddingGroup:t,paddingTopSlider:i("top"),paddingRightSlider:i("right"),paddingBottomSlider:i("bottom"),paddingLeftSlider:i("left")}),this.addManagedListener(this.eventService,jt.Events.EVENT_CHART_OPTIONS_CHANGED,e=>{this.updateTopPadding(e.chartOptions)})}updateTopPadding(e){const t=[...this.chartController.getChartSeriesTypes(),"common"].map(t=>{var i,s;return null==(s=null==(i=e[t])?void 0:i.padding)?void 0:s.top}).find(e=>null!=e);null!=t&&this.paddingTopSlider.setValue(`${t}`)}};Or.TEMPLATE='<div>\n            <ag-group-component ref="chartPaddingGroup">\n                <ag-slider ref="paddingTopSlider"></ag-slider>\n                <ag-slider ref="paddingRightSlider"></ag-slider>\n                <ag-slider ref="paddingBottomSlider"></ag-slider>\n                <ag-slider ref="paddingLeftSlider"></ag-slider>\n            </ag-group-component>\n        <div>',gs([(0,jt.RefSelector)("paddingTopSlider")],Or.prototype,"paddingTopSlider",2),gs([(0,jt.Autowired)("chartTranslationService")],Or.prototype,"chartTranslationService",2),gs([jt.PostConstruct],Or.prototype,"init",1);var Fr=Or,Gr=class e extends Kt.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("background"),suppressEnabledCheckbox:!1}),i=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(e.TEMPLATE,{chartBackgroundGroup:t,colorPicker:i})}};Gr.TEMPLATE='<div>\n            <ag-group-component ref="chartBackgroundGroup">\n                <ag-color-picker ref="colorPicker"></ag-color-picker>\n            </ag-group-component>\n        <div>',gs([(0,Kt.Autowired)("chartTranslationService")],Gr.prototype,"chartTranslationService",2),gs([Kt.PostConstruct],Gr.prototype,"init",1);var Br=Gr,Vr=class e extends $t.Component{constructor(t,i){super(e.TEMPLATE),this.chartMenuUtils=t,this.chartController=i,this.activePanels=[],this.chartOptions=t.getChartOptions()}init(){this.initFontPanel(),this.titlePlaceholder=this.chartTranslationService.translate("titlePlaceholder")}hasTitle(){const e=this.chartOptions.getValue("title");return e&&e.enabled&&e.text&&e.text.length>0}initFontPanel(){const e=this.hasTitle(),t={name:this.chartTranslationService.translate("title"),enabled:e,suppressEnabledCheckbox:!1,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`title.${e}`,onEnableChange:e=>{if(this.chartMenuService.doesChartToolbarExist(this.chartController)){const t=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",e?t-20:t+20)}this.chartOptions.setValue("title.enabled",e);const t=this.chartOptions.getValue("title.text"),i="Title"===t||0===(null==t?void 0:t.trim().length);e&&i&&this.chartOptions.setValue("title.text",this.titlePlaceholder)}},i=this.createBean(new wr(t));i.addItemToPanel(this.createSpacingSlicer()),this.getGui().appendChild(i.getGui()),this.activePanels.push(i),this.addManagedListener(this.eventService,"chartTitleEdit",()=>{i.setEnabled(this.hasTitle())})}createSpacingSlicer(){const e=this.chartMenuUtils.getDefaultSliderParams("title.spacing","spacing",100);return e.value="10",this.createBean(new $t.AgSlider(e))}destroyActivePanels(){this.activePanels.forEach(e=>{$t._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};Vr.TEMPLATE="<div></div>",gs([(0,$t.Autowired)("chartTranslationService")],Vr.prototype,"chartTranslationService",2),gs([(0,$t.Autowired)("chartMenuService")],Vr.prototype,"chartMenuService",2),gs([$t.PostConstruct],Vr.prototype,"init",1);var Hr=Vr,Ur=class e extends Wt.Component{constructor({chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:i=!1,chartOptionsService:s,seriesType:r}){super(),this.chartController=e,this.chartMenuParamsFactory=t,this.chartOptionsSeriesProxy=s.getSeriesOptionsProxy(()=>null!=r?r:this.chartController.getChartSeriesType()),this.isExpandedOnInit=i}init(){this.chartSeriesMenuParamsFactory=this.createManagedBean(new Pr(this.chartOptionsSeriesProxy));const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("chart"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new Hr(this.chartMenuParamsFactory,this.chartController)),this.createManagedBean(new Fr(this.chartMenuParamsFactory,this.chartController)),this.createManagedBean(new Br(this.chartMenuParamsFactory)),...this.createDirectionSelect()]};this.setTemplate(e.TEMPLATE,{chartGroup:t}),this.addManagedListener(this.eventService,Wt.Events.EVENT_CHART_OPTIONS_CHANGED,()=>this.refresh())}refresh(){this.updateDirectionSelect()}createDirectionSelect(){if(this.chartMenuService.isLegacyFormat())return[];const e=["horizontal","vertical"].map(e=>({value:e,text:this.chartTranslationService.translate(e)})),t=this.chartSeriesMenuParamsFactory.getDefaultSelectParams("direction","direction",e);t.labelWidth="flex",t.inputWidth="flex";const i=t.onValueChange;return t.onValueChange=e=>{i(e),this.chartController.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new Wt.AgSelect(t)),this.updateDirectionSelect(),[this.directionSelect]}updateDirectionSelect(){var e;null==(e=this.directionSelect)||e.setDisplayed(ws(Is(this.chartController.getChartType()),"canSwitchDirection"))}};Ur.TEMPLATE='<div>\n            <ag-group-component ref="chartGroup"></ag-group-component>\n        </div>',gs([(0,Wt.Autowired)("chartTranslationService")],Ur.prototype,"chartTranslationService",2),gs([(0,Wt.Autowired)("chartMenuService")],Ur.prototype,"chartMenuService",2),gs([Wt.PostConstruct],Ur.prototype,"init",1);var zr=Ur,Wr=class e extends qt.Component{constructor(e,t="shadow"){super(),this.chartMenuUtils=e,this.propertyKey=t}init(){const t=this.propertyKey,i=this.chartMenuUtils.addEnableParams(`${t}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("shadow"),suppressEnabledCheckbox:!1}),s=this.chartMenuUtils.getDefaultColorPickerParams(`${t}.color`);this.setTemplate(e.TEMPLATE,{shadowGroup:i,shadowColorPicker:s,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(e,t,i){const s=`${this.propertyKey}.${e}`,r=this.chartMenuUtils.getDefaultSliderParams(s,e,i);return r.minValue=t,r}};Wr.TEMPLATE='<div>\n            <ag-group-component ref="shadowGroup">\n                <ag-color-picker ref="shadowColorPicker"></ag-color-picker>\n                <ag-slider ref="shadowBlurSlider"></ag-slider>\n                <ag-slider ref="shadowXOffsetSlider"></ag-slider>\n                <ag-slider ref="shadowYOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,qt.Autowired)("chartTranslationService")],Wr.prototype,"chartTranslationService",2),gs([qt.PostConstruct],Wr.prototype,"init",1);var jr=Wr,Kr=class e extends Xt.Component{constructor(e,t){super(),this.chartOptionsService=e,this.chartMenuUtils=t}init(){const t=this.chartOptionsService.getChartType(),i=Xt._.includes(["scatter","bubble"],t),s=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("markers"),suppressEnabledCheckbox:i,suppressOpenCloseIcons:!0}),r="bubble"===t;let n,o;r?(n=this.getSliderParams("marker.maxSize","maxSize",60),o=this.getSliderParams("marker.size","minSize",60)):(n={},o=this.getSliderParams("marker.size","size",60)),this.setTemplate(e.TEMPLATE,{seriesMarkersGroup:s,seriesMarkerShapeSelect:this.getMarkerShapeSelectParams(),seriesMarkerMinSizeSlider:n,seriesMarkerSizeSlider:o,seriesMarkerStrokeWidthSlider:this.getSliderParams("marker.strokeWidth","strokeWidth",10)}),r||this.seriesMarkerMinSizeSlider.setDisplayed(!1)}getMarkerShapeSelectParams(){return this.chartMenuUtils.addValueParams("marker.shape",{options:[{value:"square",text:"Square"},{value:"circle",text:"Circle"},{value:"cross",text:"Cross"},{value:"diamond",text:"Diamond"},{value:"plus",text:"Plus"},{value:"triangle",text:"Triangle"},{value:"heart",text:"Heart"}],label:this.chartTranslationService.translate("shape")})}getSliderParams(e,t,i){return this.chartMenuUtils.getDefaultSliderParams(e,t,i)}};Kr.TEMPLATE='<div>\n            <ag-group-component ref="seriesMarkersGroup">\n                <ag-select ref="seriesMarkerShapeSelect"></ag-select>\n                <ag-slider ref="seriesMarkerMinSizeSlider"></ag-slider>\n                <ag-slider ref="seriesMarkerSizeSlider"></ag-slider>\n                <ag-slider ref="seriesMarkerStrokeWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,Xt.RefSelector)("seriesMarkerMinSizeSlider")],Kr.prototype,"seriesMarkerMinSizeSlider",2),gs([(0,Xt.Autowired)("chartTranslationService")],Kr.prototype,"chartTranslationService",2),gs([Xt.PostConstruct],Kr.prototype,"init",1);var $r=Kr,Yr=class e extends Zt.Component{constructor(t){super(e.TEMPLATE),this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.picker=t.picker}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",e=>{e.key!==Jt.KeyCode.ENTER||e.defaultPrevented||this.destroy()}),this.addManagedListener(this.spectrumColor,"keydown",e=>this.moveDragger(e)),this.addManagedListener(this.spectrumAlphaSlider,"keydown",e=>this.moveAlphaSlider(e)),this.addManagedListener(this.spectrumHueSlider,"keydown",e=>this.moveHueSlider(e)),this.addManagedListener(this.spectrumVal,"mousedown",this.onSpectrumDraggerDown.bind(this)),this.addManagedListener(this.spectrumHue,"mousedown",this.onSpectrumHueDown.bind(this)),this.addManagedListener(this.spectrumAlpha,"mousedown",this.onSpectrumAlphaDown.bind(this)),this.addGuiEventListener("mousemove",e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListener(document,"mouseup",this.onMouseUp.bind(this)),this.addManagedListener(this.recentColors,"click",this.onRecentColorClick.bind(this)),this.addManagedListener(this.recentColors,"keydown",e=>{e.key!==Jt.KeyCode.ENTER&&e.key!==Jt.KeyCode.SPACE||(e.preventDefault(),this.onRecentColorClick(e))})}initTabIndex(){const e=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",e),this.spectrumHueSlider.setAttribute("tabindex",e),this.spectrumAlphaSlider.setAttribute("tabindex",e)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(e){this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(e)}onSpectrumDraggerMove(e){this.isSpectrumDragging&&this.moveDragger(e)}onSpectrumHueDown(e){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(e)}onSpectrumHueMove(e){this.isSpectrumHueDragging&&this.moveHueSlider(e)}onSpectrumAlphaDown(e){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(e)}onSpectrumAlphaMove(e){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(e)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(e){const t=this.spectrumValRect;if(!t)return;let i,s;if(e instanceof MouseEvent)i=e.clientX-t.left,s=e.clientY-t.top;else{const t=e.key===Jt.KeyCode.LEFT,r=e.key===Jt.KeyCode.RIGHT,n=e.key===Jt.KeyCode.UP,o=e.key===Jt.KeyCode.DOWN,a=n||o,l=t||r;if(!a&&!l)return;e.preventDefault();const{x:c,y:h}=this.getSpectrumValue();i=c+(l?t?-5:5:0),s=h+(a?n?-5:5:0)}i=Math.max(i,0),i=Math.min(i,t.width),s=Math.max(s,0),s=Math.min(s,t.height),this.setSpectrumValue(i/t.width,1-s/t.height)}moveHueSlider(e){const t=this.spectrumHueRect;if(!t)return;const i=this.moveSlider(this.spectrumHueSlider,e);null!=i&&(this.H=1-i/t.width,this.update())}moveAlphaSlider(e){const t=this.spectrumAlphaRect;if(!t)return;const i=this.moveSlider(this.spectrumAlphaSlider,e);null!=i&&(this.A=i/t.width,this.update())}moveSlider(e,t){var i;const s=e.getBoundingClientRect(),r=null==(i=e.parentElement)?void 0:i.getBoundingClientRect();if(!e||!r)return null;let n;if(t instanceof MouseEvent)n=t.clientX-r.left;else{const i=t.key===Jt.KeyCode.LEFT,r=t.key===Jt.KeyCode.RIGHT;if(!i&&!r)return null;t.preventDefault();const o=i?-5:5;n=parseFloat(e.style.left)-s.width/2+o}return n=Math.max(n,0),n=Math.min(n,r.width),e.style.left=n+s.width/2+"px",n}update(){const e=Qt._Util.Color.fromHSB(360*this.H,this.S,this.B,this.A),t=Qt._Util.Color.fromHSB(360*this.H,1,1),i=e.toRgbaString(),s=this.picker;Qt._Util.Color.fromString(s.getValue()).toRgbaString()!==i&&(this.colorChanged=!0),s.setValue(i),this.spectrumColor.style.backgroundColor=t.toRgbaString(),this.spectrumDragger.style.backgroundColor=i}setSpectrumValue(e,t){const i=this.spectrumValRect||this.refreshSpectrumRect();if(null==i)return;const s=this.spectrumDragger,r=s.getBoundingClientRect();e=Math.max(0,e),e=Math.min(1,e),t=Math.max(0,t),t=Math.min(1,t),this.S=e,this.B=t,s.style.left=e*i.width-r.width/2+"px",s.style.top=(1-t)*i.height-r.height/2+"px",this.update()}getSpectrumValue(){const e=this.spectrumDragger,t=e.getBoundingClientRect();return{x:parseFloat(e.style.left)+t.width/2,y:parseFloat(e.style.top)+t.height/2}}initRecentColors(){const t=e.recentColors.map((e,t)=>`<div class="ag-recent-color" id=${t} style="background-color: ${e}; width: 15px; height: 15px;" recent-color="${e}" tabIndex="${this.tabIndex}"></div>`);this.recentColors.innerHTML=t.join("")}setValue(e){const t=Qt._Util.Color.fromString(e),[i,s,r]=t.toHSB();this.H=(isNaN(i)?0:i)/360,this.A=t.a;const n=this.spectrumHueRect||this.refreshHueRect(),o=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=(this.H-1)*-n.width+"px",this.spectrumAlphaSlider.style.left=this.A*o.width+"px",this.setSpectrumValue(s,r)}onRecentColorClick(t){const i=t.target;if(!Zt._.exists(i.id))return;const s=parseInt(i.id,10);this.setValue(e.recentColors[s]),this.destroy()}addRecentColor(){const t=Qt._Util.Color.fromHSB(360*this.H,this.S,this.B,this.A).toRgbaString();let i=e.recentColors;this.colorChanged&&i[0]!==t&&(i=i.filter(e=>e!=t),i=[t].concat(i),i.length>e.maxRecentColors&&(i=i.slice(0,e.maxRecentColors)),e.recentColors=i)}destroy(){this.addRecentColor(),super.destroy()}};Yr.maxRecentColors=8,Yr.recentColors=[],Yr.TEMPLATE='<div class="ag-color-panel" tabindex="-1">\n            <div ref="spectrumColor" class="ag-spectrum-color">\n                <div class="ag-spectrum-sat ag-spectrum-fill">\n                    <div ref="spectrumVal" class="ag-spectrum-val ag-spectrum-fill">\n                        <div ref="spectrumDragger" class="ag-spectrum-dragger"></div>\n                    </div>\n                </div>\n            </div>\n            <div class="ag-spectrum-tools">\n                <div ref="spectrumHue" class="ag-spectrum-hue ag-spectrum-tool">\n                    <div class="ag-spectrum-hue-background"></div>\n                    <div ref="spectrumHueSlider" class="ag-spectrum-slider"></div>\n                </div>\n                <div ref="spectrumAlpha" class="ag-spectrum-alpha ag-spectrum-tool">\n                    <div class="ag-spectrum-alpha-background"></div>\n                    <div ref="spectrumAlphaSlider" class="ag-spectrum-slider"></div>\n                </div>\n                <div ref="recentColors" class="ag-recent-colors"></div>\n            </div>\n        </div>',gs([(0,Zt.RefSelector)("spectrumColor")],Yr.prototype,"spectrumColor",2),gs([(0,Zt.RefSelector)("spectrumVal")],Yr.prototype,"spectrumVal",2),gs([(0,Zt.RefSelector)("spectrumDragger")],Yr.prototype,"spectrumDragger",2),gs([(0,Zt.RefSelector)("spectrumHue")],Yr.prototype,"spectrumHue",2),gs([(0,Zt.RefSelector)("spectrumHueSlider")],Yr.prototype,"spectrumHueSlider",2),gs([(0,Zt.RefSelector)("spectrumAlpha")],Yr.prototype,"spectrumAlpha",2),gs([(0,Zt.RefSelector)("spectrumAlphaSlider")],Yr.prototype,"spectrumAlphaSlider",2),gs([(0,Zt.RefSelector)("recentColors")],Yr.prototype,"recentColors",2),gs([Zt.PostConstruct],Yr.prototype,"postConstruct",1);var qr=Yr,Xr=class extends ei.AgPickerField{constructor(e){super(ds({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"colorPicker"},e))}postConstruct(){super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){const e=this.getGui().getBoundingClientRect();return this.createBean(new ei.AgDialog({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-190,y:e.top-250}))}renderAndPositionPicker(){const e=this.pickerComponent,t=this.createBean(new qr({picker:this}));return e.addCssClass("ag-color-dialog"),t.addDestroyFunc(()=>{e.isAlive()&&this.destroyBean(e)}),e.setParentComponent(this),e.setBodyComponent(t),t.setValue(this.getValue()),t.getGui().focus(),e.addDestroyFunc(()=>{this.isDestroyingPicker?this.isDestroyingPicker=!1:(this.beforeHidePicker(),this.isDestroyingPicker=!0,t.isAlive()&&this.destroyBean(t),this.isAlive()&&this.getFocusableElement().focus())}),()=>{var e;return null==(e=this.pickerComponent)?void 0:e.close()}}setValue(e){return this.value===e?this:(this.eDisplayField.style.backgroundColor=e,super.setValue(e))}getValue(){return this.value}},Zr=class e extends ti.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{calloutGroup:t,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}};Zr.TEMPLATE='<div>\n            <ag-group-component ref="calloutGroup">\n                <ag-slider ref="calloutLengthSlider"></ag-slider>\n                <ag-slider ref="calloutStrokeWidthSlider"></ag-slider>\n                <ag-slider ref="labelOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,ti.Autowired)("chartTranslationService")],Zr.prototype,"chartTranslationService",2),gs([ti.PostConstruct],Zr.prototype,"init",1);var Qr=Zr,Jr=class e extends ii.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},i=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);i.step=.05,this.setTemplate(e.TEMPLATE,{capsGroup:t,capLengthRatioSlider:i})}};Jr.TEMPLATE='<div>\n            <ag-group-component ref="capsGroup">\n                <ag-slider ref="capLengthRatioSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,ii.Autowired)("chartTranslationService")],Jr.prototype,"chartTranslationService",2),gs([ii.PostConstruct],Jr.prototype,"init",1);var en=Jr,tn=class e extends si.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{lineGroup:t,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",.05)})}getSliderParams(e,t,i,s=1,r=!1){const n=this.chartMenuUtils.getDefaultSliderParams(i,e,t,r);return n.step=s,n}};tn.TEMPLATE='<div>\n            <ag-group-component ref="lineGroup">\n                <ag-color-picker ref="lineColorPicker"></ag-color-picker>\n                <ag-slider ref="lineStrokeWidthSlider"></ag-slider>\n                <ag-slider ref="lineOpacitySlider"></ag-slider>\n                <ag-slider ref="lineDashSlider"></ag-slider>                \n            </ag-group-component>\n        </div>',gs([(0,si.Autowired)("chartTranslationService")],tn.prototype,"chartTranslationService",2),gs([si.PostConstruct],tn.prototype,"init",1);var sn=tn,rn=class e extends ri.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{whiskersGroup:t,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}};rn.TEMPLATE='<div>\n            <ag-group-component ref="whiskersGroup">\n                <ag-color-picker ref="whiskerColorPicker"></ag-color-picker>\n                <ag-slider ref="whiskerThicknessSlider"></ag-slider>\n                <ag-slider ref="whiskerOpacitySlider"></ag-slider>\n                <ag-slider ref="whiskerLineDashSlider"></ag-slider>\n                <ag-slider ref="whiskerLineDashOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,ri.Autowired)("chartTranslationService")],rn.prototype,"chartTranslationService",2),gs([ri.PostConstruct],rn.prototype,"init",1);var nn=rn,on=class e extends ni.Component{constructor(e){super(),this.chartMenuUtils=e,this.activePanels=[]}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{seriesItemsGroup:t,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){const e=[{value:"positive",text:this.chartTranslationService.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslationService.translate("seriesItemNegative")}];return{label:this.chartTranslationService.translate("seriesItemType"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:e,value:"positive",onValueChange:e=>{this.destroyActivePanels(),this.initSeriesControls(e)}}}initSeriesControls(e="positive"){this.initSlider("strokeWidth",10,`item.${e}.strokeWidth`),this.initSlider("lineDash",30,`item.${e}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${e}.strokeOpacity`,.05,!1),this.initSlider("fillOpacity",1,`item.${e}.fillOpacity`,.05,!1),this.initItemLabels(e)}initSlider(e,t,i,s=1,r=!1){const n=this.chartMenuUtils.getDefaultSliderParams(i,e,t,r);n.step=s;const o=this.seriesItemsGroup.createManagedBean(new ni.AgSlider(n));this.seriesItemsGroup.addItem(o),this.activePanels.push(o)}initItemLabels(e){const t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,"seriesItemLabels"),i=this.createBean(new wr(t));this.seriesItemsGroup.addItem(i),this.activePanels.push(i)}destroyActivePanels(){this.activePanels.forEach(e=>{ni._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};on.TEMPLATE='<div>\n            <ag-group-component ref="seriesItemsGroup">\n                <ag-select ref="seriesItemSelect"></ag-select>\n            </ag-group-component>\n        </div>',gs([(0,ni.RefSelector)("seriesItemsGroup")],on.prototype,"seriesItemsGroup",2),gs([(0,ni.Autowired)("chartTranslationService")],on.prototype,"chartTranslationService",2),gs([ni.PostConstruct],on.prototype,"init",1);var an=on,ln=class e extends oi.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{groupSpacing:us(ds({},t),{title:this.chartTranslationService.translate("group")}),tileSpacing:us(ds({},t),{title:this.chartTranslationService.translate("tile")}),groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};ln.TEMPLATE='<div>\n            <ag-group-component ref="groupSpacing">\n                <ag-slider ref="groupPaddingSlider"></ag-slider>\n                <ag-slider ref="groupSpacingSlider"></ag-slider>\n            </ag-group-component>\n            <ag-group-component ref="tileSpacing">\n                <ag-slider ref="tilePaddingSlider"></ag-slider>\n                <ag-slider ref="tileSpacingSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,oi.Autowired)("chartTranslationService")],ln.prototype,"chartTranslationService",2),gs([oi.PostConstruct],ln.prototype,"init",1);var cn=ln,hn=class e extends Yt.Component{constructor({chartController:e,chartOptionsService:t,seriesType:i,isExpandedOnInit:s=!1}){super(),this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth("lineWidth"),strokeWidth:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),lineDash:()=>this.initLineDash(),lineOpacity:()=>this.initLineOpacity(),fillOpacity:()=>this.initFillOpacity(),markers:()=>this.initMarkers(),labels:()=>this.initLabels(),shadow:()=>this.initShadow(),tooltips:()=>this.initTooltips(),bins:()=>this.initBins(),whiskers:()=>this.initWhiskers(),caps:()=>this.initCaps(),connectorLine:()=>this.initConnectorLine(),seriesItems:()=>this.initSeriesItemsPanel(),tileSpacing:()=>this.initTileSpacingPanel(),groupType:()=>this.initGroupType()},this.seriesWidgetMappings={bar:["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","shadow"],pie:["tooltips","strokeWidth","lineOpacity","fillOpacity","labels","shadow"],donut:["tooltips","strokeWidth","lineOpacity","fillOpacity","labels","shadow"],line:["tooltips","lineWidth","lineDash","lineOpacity","markers","labels"],scatter:["tooltips","markers","labels"],bubble:["tooltips","markers","labels"],area:["tooltips","lineWidth","lineDash","lineOpacity","fillOpacity","markers","labels","shadow"],histogram:["tooltips","bins","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","shadow"],"radial-column":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"radial-bar":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"radar-line":["tooltips","strokeWidth","lineDash","lineOpacity","markers","labels"],"radar-area":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","markers","labels"],nightingale:["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"box-plot":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","whiskers","caps"],"range-bar":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels"],"range-area":["tooltips","lineWidth","lineDash","lineOpacity","fillOpacity","markers","labels","shadow"],treemap:["tooltips","tileSpacing"],sunburst:["tooltips"],heatmap:["tooltips","labels","lineColor","lineWidth","lineOpacity"],waterfall:["tooltips","connectorLine","seriesItems"]},this.chartController=e,this.chartOptionsService=t,this.seriesType=i||this.chartController.getChartSeriesType(),this.isExpandedOnInit=s}init(){const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{seriesGroup:t}),this.chartMenuUtils=this.createManagedBean(new Pr(this.chartOptionsService.getSeriesOptionsProxy(()=>this.seriesType))),this.chartOptions=this.chartMenuUtils.getChartOptions(),this.addManagedListener(this.chartController,rr.EVENT_CHART_SERIES_CHART_TYPE_CHANGED,this.refreshWidgets.bind(this)),this.refreshWidgets()}refreshWidgets(){this.destroyActivePanels(),this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>{var e;!this.isAlive()||(this.chartController.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect()),(null!=(e=this.seriesWidgetMappings[this.seriesType])?e:[]).forEach(e=>this.widgetFuncs[e]()))}).catch(e=>console.error("AG Grid - chart rendering failed",e))}initSeriesSelect(){const e=this.seriesGroup.createManagedBean(new Yt.AgSelect({label:this.translate("seriesType"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:this.getSeriesSelectOptions(),value:`${this.seriesType}`,onValueChange:e=>{this.seriesType=e,this.refreshWidgets()}}));this.seriesGroup.addItem(e),this.activePanels.push(e)}initTooltips(){const e=this.createBean(new Yt.AgToggleButton(this.chartMenuUtils.addValueParams("tooltip.enabled",{label:this.translate("tooltips"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex"})));this.addWidget(e)}initLineColor(){const e=this.createBean(new Xr(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor")));this.addWidget(e)}initStrokeWidth(e){const t=this.createBean(new Yt.AgSlider(this.chartMenuUtils.getDefaultSliderParams("strokeWidth",e,10)));this.addWidget(t)}initLineDash(){const e=this.createBean(new Yt.AgSlider(this.chartMenuUtils.getDefaultSliderParams("lineDash","lineDash",30,!0)));this.addWidget(e)}initLineOpacity(){const e=this.chartMenuUtils.getDefaultSliderParams("strokeOpacity","strokeOpacity",1);e.step=.05;const t=this.createBean(new Yt.AgSlider(e));this.addWidget(t)}initFillOpacity(){const e=this.chartMenuUtils.getDefaultSliderParams("fillOpacity","fillOpacity",1);e.step=.05;const t=this.createBean(new Yt.AgSlider(e));this.addWidget(t)}initLabels(){const e=Rs(this.seriesType),t=e?"calloutLabel":"label",i=e?"calloutLabels":"labels",s=this.chartMenuUtils.getDefaultFontPanelParams(t,i),r=this.createBean(new wr(s));if(e){const e=this.createBean(new Qr(this.chartMenuUtils));r.addCompToPanel(e),this.activePanels.push(e)}if(this.addWidget(r),e){const e=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels"),t=this.createBean(new wr(e)),i=this.getSectorLabelPositionRatio();t.addCompToPanel(i),this.addWidget(t)}if("range-bar"===this.seriesType){const e=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],t=r.createManagedBean(new Yt.AgSelect(this.chartMenuUtils.addValueParams("label.placement",{label:this.translate("labelPlacement"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:e})));r.addCompToPanel(t),this.activePanels.push(t);const i=r.createManagedBean(new Yt.AgSlider(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));r.addCompToPanel(i),this.activePanels.push(i)}}getSectorLabelPositionRatio(){const e=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);return e.step=.05,this.createBean(new Yt.AgSlider(e))}initShadow(){const e=this.createBean(new jr(this.chartMenuUtils));this.addWidget(e)}initMarkers(){const e=this.createBean(new $r(this.chartOptionsService,this.chartMenuUtils));this.addWidget(e)}initBins(){var e;const t=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),i=(null!=(e=this.chartOptions.getValue("bins"))?e:this.chartOptions.getValue("calculatedBins",!0)).length;t.value=`${i}`,t.maxValue=Math.max(i,20);const s=this.createBean(new Yt.AgSlider(t));this.addWidget(s)}initWhiskers(){const e=this.createBean(new nn(this.chartMenuUtils));this.addWidget(e)}initCaps(){const e=this.createBean(new en(this.chartMenuUtils));this.addWidget(e)}initConnectorLine(){const e=this.createBean(new sn(this.chartMenuUtils));this.addWidget(e)}initSeriesItemsPanel(){const e=this.createBean(new an(this.chartMenuUtils));this.addWidget(e)}initTileSpacingPanel(){const e=this.createBean(new cn(this.chartMenuUtils));this.addWidget(e)}initGroupType(){const e=this.createBean(new Yt.AgSelect({label:this.chartTranslationService.translate("seriesGroupType"),options:Yt.ChartMappings.SERIES_GROUP_TYPES.map(e=>({value:e,text:this.chartTranslationService.translate(`${e}SeriesGroupType`)})),value:this.chartController.getSeriesGroupType(),onValueChange:e=>this.chartController.setSeriesGroupType(e)}));this.addWidget(e)}addWidget(e){this.seriesGroup.addItem(e),this.activePanels.push(e)}getSeriesSelectOptions(){const e=this.getActiveSeriesTypes();return["area","bar","line"].filter(t=>e.includes(t)).map(e=>({value:e,text:this.translate(e)}))}updateSeriesType(){const e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.chartController.getActiveSeriesChartTypes().map(e=>Is(e.chartType))}translate(e){return this.chartTranslationService.translate(e)}destroyActivePanels(){this.activePanels.forEach(e=>{Yt._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};hn.TEMPLATE='<div>\n            <ag-group-component ref="seriesGroup">\n            </ag-group-component>\n        </div>',gs([(0,Yt.RefSelector)("seriesGroup")],hn.prototype,"seriesGroup",2),gs([(0,Yt.Autowired)("chartTranslationService")],hn.prototype,"chartTranslationService",2),gs([Yt.PostConstruct],hn.prototype,"init",1);var dn=hn,un=class e extends ai.Component{constructor({chartMenuParamsFactory:e,isExpandedOnInit:t=!1}){super(),this.chartMenuUtils=e,this.isExpandedOnInit=t}init(){const t=this.chartMenuUtils.addEnableParams("gradientLegend.enabled",{cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("legend"),suppressEnabledCheckbox:!1,suppressToggleExpandOnEnableChange:!0,expanded:this.isExpandedOnInit,items:[this.createLabelPanel()]});this.setTemplate(e.TEMPLATE,{legendGroup:t,legendPositionSelect:this.chartMenuUtils.getDefaultLegendParams("gradientLegend.position"),gradientReverseCheckbox:this.getGradientReverseCheckboxParams(),gradientThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.gradient.thickness","thickness",40),gradientPreferredLengthSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.gradient.preferredLength","preferredLength",300),legendSpacingSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.spacing","spacing",200)})}getGradientReverseCheckboxParams(){return this.chartMenuUtils.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslationService.translate("reverseDirection"),labelWidth:"flex"})}createLabelPanel(){const e={enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`gradientLegend.scale.label.${e}`};return this.createManagedBean(new wr(e))}};un.TEMPLATE='<div>\n            <ag-group-component ref="legendGroup">\n                <ag-select ref="legendPositionSelect"></ag-select>\n                <ag-checkbox ref="gradientReverseCheckbox"></ag-checkbox>\n                <ag-slider ref="gradientThicknessSlider"></ag-slider>\n                <ag-slider ref="gradientPreferredLengthSlider"></ag-slider>\n                <ag-slider ref="legendSpacingSlider"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,ai.Autowired)("chartTranslationService")],un.prototype,"chartTranslationService",2),gs([ai.PostConstruct],un.prototype,"init",1);var pn=un,gn=class extends li.BeanStub{constructor(e,t,i,s){super(),this.chartController=e,this.eGui=t,this.cssClass=i,this.createPanels=s,this.panels=[]}postConstruct(){this.addManagedListener(this.chartController,rr.EVENT_CHART_UPDATED,()=>this.refreshPanels(!0)),this.addManagedListener(this.chartController,rr.EVENT_CHART_API_UPDATE,()=>this.refreshPanels(!1))}addComponent(e){this.createBean(e),this.panels.push(e),e.addCssClass(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){const t=this.chartController.getChartType(),i=this.chartController.isGrouping(),s=Is(t);e&&t===this.chartType&&i===this.isGrouping||(this.destroyPanels(),this.createPanels(t,s),this.chartType=t,this.isGrouping=i)}destroyPanels(){this.panels.forEach(e=>{li._.removeFromParent(e.getGui()),this.destroyBean(e)}),this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}};gs([li.PostConstruct],gn.prototype,"postConstruct",1);var mn={groups:[{type:"chart"},{type:"legend"},{type:"series"},{type:"axis"}]},fn=class e extends _t.Component{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}init(){this.chartPanelFeature=this.createManagedBean(new gn(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){var i;null==(i=this.getFormatPanelDef().groups)||i.forEach(i=>{const s=i.type;if(!this.isGroupPanelShownInSeries(s,t))return;const r=us(ds({},this.chartMenuContext),{isExpandedOnInit:i.isOpen,seriesType:t});switch(s){case"chart":this.chartPanelFeature.addComponent(new zr(r));break;case"legend":const s=["treemap","sunburst","heatmap"].includes(e)?new pn(r):new Er(r);this.chartPanelFeature.addComponent(s);break;case"axis":Ms(t)?this.chartPanelFeature.addComponent(new _r(r)):Es(t)&&(this.chartPanelFeature.addComponent(new Lr("xAxis",r)),this.chartPanelFeature.addComponent(new Lr("yAxis",r)));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new Lr("xAxis",r));break;case"verticalAxis":this.chartPanelFeature.addComponent(new Lr("yAxis",r));break;case"series":this.chartPanelFeature.addComponent(new dn(r));break;case"navigator":_t._.warnOnce("'navigator' is now displayed in the charts advanced settings instead of the format panel, and this setting will be ignored.");default:_t._.warnOnce(`Invalid charts format panel group name supplied: '${i.type}'`)}})}getFormatPanelDef(){var e;return(null==(e=this.gos.get("chartToolPanelsDef"))?void 0:e.formatPanel)||mn}isGroupPanelShownInSeries(e,t){return["chart","legend","series"].includes(e)||Es(t)&&["axis","horizontalAxis","verticalAxis"].includes(e)||Ms(t)&&"axis"===e}};fn.TEMPLATE='<div class="ag-chart-format-wrapper"></div>',gs([_t.PostConstruct],fn.prototype,"init",1);var yn=fn,vn=class extends ui.Component{constructor(e,t){super(),this.tooltipName=t,this.size=58,this.padding=5,this.root=new pi._Scene.Group;const i=new pi._Scene.Scene({width:this.size,height:this.size});i.canvas.element.classList.add("ag-chart-mini-thumbnail-canvas"),i.setRoot(this.root),i.setContainer(e),this.scene=i}init(){this.scene.canvas.element.title=this.chartTranslationService.translate(this.tooltipName),this.scene.render().catch(e=>{console.error("AG Grid - chart update failed",e)})}};gs([(0,ui.Autowired)("chartTranslationService")],vn.prototype,"chartTranslationService",2),gs([ui.PostConstruct],vn.prototype,"init",1);var Cn=class extends vn{constructor(e,t){super(e,t),this.stroke="gray",this.axisOvershoot=3}addAxes(){const e=this.size,t=this.padding,i=new gi._Scene.Line;i.x1=t,i.y1=t,i.x2=t,i.y2=e-t+this.axisOvershoot,i.stroke=this.stroke;const s=new gi._Scene.Line;s.x1=t-this.axisOvershoot+1,s.y1=e-t,s.x2=e-t+1,s.y2=e-t,s.stroke=this.stroke;const r=this.root;r.append(i),r.append(s)}};function bn(e){const{stacked:t,size:i,padding:s,xScalePadding:r,xScaleDomain:n,yScaleDomain:o}=e,a=new mi._Scene.BandScale;a.domain=n,a.range=[s,i-s],a.paddingInner=r,a.paddingOuter=r;const l=new mi._Scene.LinearScale;l.domain=o,l.range=[i-s,s];const c=(e,t,i)=>e.map((e,s)=>{const r=i.convert(e),n=new mi._Scene.Rect;return n.x=t.convert(s),n.y=r,n.width=t.bandwidth,n.height=i.convert(0)-r,n.strokeWidth=0,n.crisp=!0,n});return t?e.data.map(e=>c(e,a,l)):c(e.data,a,l)}function Sn(e,t,i,s){const r=new mi._Scene.LinearScale;r.domain=[0,4],r.range=[s,i-s];const n=new mi._Scene.LinearScale;n.domain=[0,10],n.range=[i-s,s];const o=t.map(e=>{const t=new mi._Scene.Path;return t.strokeWidth=3,t.lineCap="round",t.fill=void 0,e.forEach((e,i)=>{t.path[i>0?"lineTo":"moveTo"](r.convert(i),n.convert(e))}),t}),a=new mi._Scene.Group;return a.setClipRectInGroupCoordinateSpace(new mi._Scene.BBox(s,s,i-2*s,i-2*s)),a.append(o),e.append(a),o}function wn(e,t,i,s,r,n=0){const o=new mi._Scene.LinearScale;o.domain=[0,7],o.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const a=new mi._Scene.LinearScale;a.domain=[0,10],a.range=[s,r];const l=[],c=t.map(e=>{const t=new mi._Scene.Path;return t.strokeWidth=1,t.strokeOpacity=.5,t.lineCap="round",t.fill=void 0,t.fillOpacity=.8,e.forEach((e,i)=>{const c=o.convert(i),h=s+r-a.convert(e),d=h*Math.cos(c),u=h*Math.sin(c);if(t.path[i>0?"lineTo":"moveTo"](d,u),n>0){const e=new mi._Scene.Circle;e.x=d,e.y=u,e.size=n,l.push(e)}}),t.path.closePath(),t}),h=new mi._Scene.Group,d=i/2;return h.translationX=d,h.translationY=d,h.append([...c,...l]),e.append(h),{paths:c,markers:l}}function xn(e){let[t,i]=[1/0,-1/0];return{processedData:e.reduce((e,s,r)=>{const n=r>0?e[r-1]:void 0;null!=e[r]||(e[r]=[]);const o=e[r];return s.forEach((e,s)=>{n&&(e+=n[s]),o[s]=e,o[s]<t&&(t=o[s]),o[s]>i&&(i=o[s])}),e},[]),min:t,max:i}}gs([di.PostConstruct],Cn.prototype,"addAxes",1);var En=class extends Cn{constructor(e,t,i){super(e,"groupedColumnTooltip"),this.columnData=[2,3,4];const{root:s,columnData:r,size:n,padding:o}=this;this.columns=bn({stacked:!1,root:s,data:r,size:n,padding:o,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3}),s.append(this.columns),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};En.chartType="groupedColumn";var Mn=class e extends Cn{constructor(t,i,s,r,n,o=e.data,a=[0,16],l="stackedColumnTooltip"){super(t,l);const{root:c,size:h,padding:d}=this;this.stackedColumns=bn({stacked:!0,root:c,data:o,size:h,padding:d,xScaleDomain:[0,1,2],yScaleDomain:a,xScalePadding:.3}),c.append([].concat.apply([],this.stackedColumns)),this.updateColors(i,s)}updateColors(e,t){this.stackedColumns.forEach((i,s)=>i.forEach(i=>{i.fill=e[s],i.stroke=t[s]}))}};Mn.chartType="stackedColumn",Mn.data=[[8,12,16],[6,9,12],[2,3,4]];var An=Mn,Tn=class e extends An{constructor(t,i,s,r,n){super(t,i,s,r,n,e.data,[0,10],"normalizedColumnTooltip")}};Tn.chartType="normalizedColumn",Tn.data=[[10,10,10],[6,7,8],[2,4,6]];var Dn=Tn,In=class extends Cn{constructor(e,t,i){super(e,"groupedBarTooltip");const s=this.padding,r=this.size,n=new fi._Scene.BandScale;n.domain=[0,1,2],n.range=[s,r-s],n.paddingInner=.3,n.paddingOuter=.3;const o=new fi._Scene.LinearScale;o.domain=[0,4],o.range=[r-s,s];const a=o.convert(0),l=n.bandwidth;this.bars=[2,3,4].map((e,t)=>{const i=new fi._Scene.Rect;return i.x=s,i.y=n.convert(t),i.width=a-o.convert(e),i.height=l,i.strokeWidth=0,i.crisp=!0,i}),this.updateColors(t,i),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};In.chartType="groupedBar";var Rn=class e extends Cn{constructor(t,i,s,r,n,o=e.data,a=[0,16],l="stackedBarTooltip"){super(t,l);const c=this.size,h=this.padding,d=new yi._Scene.BandScale;d.domain=[0,1,2],d.range=[h,c-h],d.paddingInner=.3,d.paddingOuter=.3;const u=new yi._Scene.LinearScale;u.domain=a,u.range=[c-h,h];const p=u.convert(0),g=d.bandwidth;this.bars=o.map(e=>e.map((e,t)=>{const i=new yi._Scene.Rect;return i.x=h,i.y=d.convert(t),i.width=p-u.convert(e),i.height=g,i.strokeWidth=0,i.crisp=!0,i})),this.updateColors(i,s),this.root.append([].concat.apply([],this.bars))}updateColors(e,t){this.bars.forEach((i,s)=>i.forEach(i=>{i.fill=e[s],i.stroke=t[s]}))}};Rn.chartType="stackedBar",Rn.data=[[8,12,16],[6,9,12],[2,3,4]];var Pn=Rn,kn=class e extends Pn{constructor(t,i,s,r,n){super(t,i,s,r,n,e.data,[0,10],"normalizedBarTooltip")}};kn.chartType="normalizedBar",kn.data=[[10,10,10],[6,7,8],[2,4,6]];var Ln=kn,Nn=vi._Scene.toRadians,_n=class extends vn{constructor(e,t,i,s,r,n=.6,o="donutTooltip"){super(e,o);const a=(this.size-2*this.padding)/2,l=a+this.padding,c=[[Nn(-90),Nn(30)],[Nn(30),Nn(120)],[Nn(120),Nn(180)],[Nn(180),Nn(210)],[Nn(210),Nn(240)],[Nn(240),Nn(270)]];this.sectors=c.map(([e,t])=>{const i=new vi._Scene.Sector;return i.centerX=l,i.centerY=l,i.innerRadius=a*n,i.outerRadius=a,i.startAngle=e,i.endAngle=t,i.stroke=void 0,i.strokeWidth=0,i.inset=.75,i}),this.updateColors(t,i),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((i,s)=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})}};_n.chartType="donut";var On=class extends _n{constructor(e,t,i,s,r){super(e,t,i,s,r,0,"pieTooltip")}};On.chartType="pie";var Fn=class extends Cn{constructor(e,t,i){super(e,"lineTooltip"),this.data=[[9,7,8,5,6],[5,6,3,4,1],[1,3,4,8,7]],this.lines=Sn(this.root,this.data,this.size,this.padding),this.updateColors(t,i)}updateColors(e,t){this.lines.forEach((t,i)=>{t.stroke=e[i]})}};Fn.chartType="line";var Gn=class extends Cn{constructor(e,t,i){super(e,"scatterTooltip");const s=this.size,r=this.padding,n=new Ci._Scene.LinearScale;n.domain=[-.5,4],n.range=[2*r,s-r];const o=new Ci._Scene.LinearScale;o.domain=[-.5,3.5],o.range=[s-r,r];const a=[];[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]].forEach(e=>{e.forEach(([e,t])=>{const i=new Ci._Scene.Arc;i.strokeWidth=0,i.centerX=n.convert(e),i.centerY=o.convert(t),i.radius=2.5,a.push(i)})}),this.points=a,this.updateColors(t,i);const l=new Ci._Scene.Group;l.setClipRectInGroupCoordinateSpace(new Ci._Scene.BBox(r,r,s-2*r,s-2*r)),l.append(this.points),this.root.append(l)}updateColors(e,t){this.points.forEach((i,s)=>{i.stroke=t[s%t.length],i.fill=e[s%e.length]})}};Gn.chartType="scatter";var Bn=class extends Cn{constructor(e,t,i){super(e,"bubbleTooltip");const s=this.size,r=this.padding,n=new bi._Scene.LinearScale;n.domain=[0,1],n.range=[2*r,s-r];const o=new bi._Scene.LinearScale;o.domain=[0,1],o.range=[s-r,r];const a=[];[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]].forEach(e=>{e.forEach(([e,t,i])=>{const s=new bi._Scene.Arc;s.strokeWidth=0,s.centerX=n.convert(e),s.centerY=o.convert(t),s.radius=i,s.fillOpacity=.7,a.push(s)})}),this.points=a,this.updateColors(t,i);const l=new bi._Scene.Group;l.setClipRectInGroupCoordinateSpace(new bi._Scene.BBox(r,r,s-2*r,s-2*r)),l.append(this.points),this.root.append(l)}updateColors(e,t){this.points.forEach((i,s)=>{i.stroke=t[s%t.length],i.fill=e[s%e.length]})}};Bn.chartType="bubble";var Vn=class e extends Cn{constructor(t,i,s,r,n,o=e.data){super(t,"groupedAreaTooltip");const a=this.size,l=this.padding,c=new Si._Scene.BandScale;c.domain=[0,1,2],c.paddingInner=1,c.paddingOuter=0,c.range=[l+.5,a-l-.5];const h=new Si._Scene.LinearScale;h.domain=[0,6],h.range=[a-l+.5,l];const d=2*o.length-1,u=[],p=h.convert(0);o.forEach((e,t)=>{const i=c.convert(t);e.forEach((e,s)=>{const r=h.convert(e),n=u[s]||(u[s]=[]);n[t]={x:i,y:r},n[d-t]={x:i,y:p}})}),this.areas=u.reverse().map(e=>{const t=new Si._Scene.Path;t.strokeWidth=1,t.strokeOpacity=.75,t.fillOpacity=.7;const i=t.path;return i.clear(),e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),i.closePath(),t}),this.updateColors(i,s),this.root.append(this.areas)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};Vn.chartType="area",Vn.data=[[1,3,5],[2,6,4],[5,3,1]];var Hn=Vn,Un=class e extends Cn{constructor(t,i,s,r,n,o=e.data,a="stackedAreaTooltip"){super(t,a);const l=this.size,c=this.padding,h=new wi._Scene.BandScale;h.domain=[0,1,2],h.paddingInner=1,h.paddingOuter=0,h.range=[c+.5,l-c-.5];const d=new wi._Scene.LinearScale;d.domain=[0,16],d.range=[l-c+.5,c+.5];const u=2*o.length-1,p=[];o.forEach((e,t)=>{const i=h.convert(t);let s=0;e.forEach((e,r)=>{const n=d.convert(s+e),o=p[r]||(p[r]=[]);o[t]={x:i,y:n},o[u-t]={x:i,y:d.convert(s)},s+=e})}),this.areas=p.map(e=>{const t=new wi._Scene.Path;t.strokeWidth=0;const i=t.path;return i.clear(),e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),i.closePath(),t}),this.updateColors(i,s),this.root.append(this.areas)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};Un.chartType="stackedArea",Un.data=[[2,3,2],[3,6,5],[6,2,2]];var zn=Un,Wn=class e extends zn{constructor(t,i,s,r,n,o=e.data){super(t,i,s,r,n,o,"normalizedAreaTooltip")}};Wn.chartType="normalizedArea",Wn.data=zn.data.map(e=>{const t=e.reduce((e,t)=>e+t,0);return e.map(e=>e/t*16)});var jn=Wn,Kn=class extends Cn{constructor(e,t,i){super(e,"histogramTooltip");const s=this.padding,r=this.size,n=[2,5,11,13,10,6,1],o=new xi._Scene.LinearScale;o.domain=[0,n.length],o.range=[s,r-s];const a=new xi._Scene.LinearScale;a.domain=[0,n.reduce((e,t)=>Math.max(e,t),0)],a.range=[r-s,s];const l=a.convert(0);this.bars=n.map((e,t)=>{const i=a.convert(e),s=o.convert(t),r=o.convert(t+1),n=new xi._Scene.Rect;return n.x=s,n.y=i,n.width=r-s,n.height=l-i,n.strokeWidth=1,n.strokeOpacity=.75,n.crisp=!0,n}),this.updateColors(t,i),this.root.append(this.bars)}updateColors([e],[t]){this.bars.forEach(i=>{i.fill=e,i.stroke=t})}};Kn.chartType="histogram";var $n=class extends vn{constructor(e,t){super(e,t),this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}addAxes(){const e=this.size,t=this.padding,i=(e-2*t)/2,s=this.showAngleAxisLines?[i,.8*i,.6*i,.4*i]:[],r=new Ai._Scene.Line;r.x1=e/2,r.y1=t,r.x2=e/2,r.y2=e-t-i-s[s.length-1],r.stroke=this.stroke,r.strokeOpacity=.5,r.fill=void 0,r.visible=this.showRadiusAxisLine;const n=t+i;this.gridLines=s.map((e,t)=>{const i=new Ai._Scene.Path;return i.path.arc(n,n,e,0,2*Math.PI),i.strokeWidth=1,i.stroke=this.stroke,i.strokeOpacity=0===t?.5:.2,i.fill=void 0,i});const o=this.root;o.append(r),this.gridLines.length>0&&o.append(this.gridLines)}};gs([Mi.PostConstruct],$n.prototype,"addAxes",1);var Yn=class extends $n{constructor(e,t,i){super(e,"radialColumnTooltip"),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;const{padding:s,size:r,data:n}=this,o=(r-2*s)/2,a=.4*o,l=new Ei._Scene.BandScale;l.domain=n[0].map((e,t)=>t),l.range=[0,2*Math.PI],l.paddingInner=0,l.paddingOuter=0;const c=.7*l.bandwidth,{processedData:h,max:d}=xn(n),u=new Ei._Scene.LinearScale;u.domain=[0,d],u.range=[a,o];const p=this.size/2;this.series=h.map((e,t)=>{const i=0===t?void 0:h[t-1],s=new Ei._Scene.Group({zIndex:1e6}),r=e.map((e,t)=>{const s=null==i?void 0:i[t],r=u.convert(e),n=u.convert(null!=s?s:0),h=l.convert(t),d=h+c,g=Ei._Scene.getRadialColumnWidth(h,d,o,.5,.5),m=new Ei._Scene.RadialColumnShape;return m.scalingCenterX=p,m.scalingCenterY=p,m.columnWidth=g,m.innerRadius=n,m.outerRadius=r,m.startAngle=h,m.endAngle=d,m.isBeveled=!0,m.axisInnerRadius=a,m.axisOuterRadius=o,m.stroke=void 0,m.strokeWidth=0,m});return s.append(r),s.translationX=p,s.translationY=p,s}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};Yn.chartType="radialColumn";var qn=class extends $n{constructor(e,t,i){super(e,"radialBarTooltip"),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;const s=(this.size-this.padding)/2,r=.4*s,n=s+r,o=new Ti._Scene.BandScale;o.domain=this.data[0].map((e,t)=>t),o.range=[s,r],o.paddingInner=.5,o.paddingOuter=0;const a=o.bandwidth,{processedData:l,max:c}=xn(this.data),h=new Ti._Scene.LinearScale;h.domain=[0,Math.ceil(1.5*c)];const d=1.5*Math.PI,u=d+2*Math.PI;h.range=[d,u];const p=this.size/2;this.series=l.map((e,t)=>{const i=t<0?void 0:l[t-1],s=new Ti._Scene.Group({zIndex:1e6}),r=e.map((e,t)=>{var s;const r=null!=(s=null==i?void 0:i[t])?s:0,l=n-o.convert(t),c=l+a,d=h.convert(r),u=h.convert(e),g=new Ti._Scene.Sector;return g.centerX=p,g.centerY=p,g.innerRadius=l,g.outerRadius=c,g.startAngle=d,g.endAngle=u,g.stroke=void 0,g.strokeWidth=0,g});return s.append(r),s}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};qn.chartType="radialBar";var Xn=class extends $n{constructor(e,t,i){super(e,"radarLineTooltip"),this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;const s=(this.size-2*this.padding)/2,{paths:r,markers:n}=wn(this.root,this.data,this.size,s,0,this.markerSize);this.lines=r,this.markers=n,this.updateColors(t,i)}updateColors(e,t){this.lines.forEach((i,s)=>{const r=this.data[s].length;i.stroke=e[s];const n=s*r,o=n+r;this.markers.slice(n,o).forEach(i=>{i.stroke=t[s],i.fill=e[s]})})}};Xn.chartType="radarLine";var Zn=class extends $n{constructor(e,t,i){super(e,"radarAreaTooltip"),this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]],this.showRadiusAxisLine=!1;const s=(this.size-2*this.padding)/2,r=s-.3*this.size;this.areas=wn(this.root,this.data,this.size,s,r).paths,this.updateColors(t,i)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};Zn.chartType="radarArea";var Qn=class extends $n{constructor(e,t,i){super(e,"nightingaleTooltip"),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;const s=(this.size-2*this.padding)/2,r=new Di._Scene.BandScale;r.domain=this.data[0].map((e,t)=>t),r.range=[-Math.PI,Math.PI],r.paddingInner=0,r.paddingOuter=0;const n=.7*r.bandwidth,{processedData:o,max:a}=xn(this.data),l=new Di._Scene.LinearScale;l.domain=[0,a],l.range=[0,s];const c=this.size/2;this.series=o.map((e,t)=>{const i=t<0?void 0:o[t-1],s=new Di._Scene.Group({zIndex:1e6}),a=e.map((e,t)=>{const s=null==i?void 0:i[t],o=l.convert(e),a=l.convert(null!=s?s:0),h=r.convert(t),d=h+n,u=new Di._Scene.Sector;return u.centerX=c,u.centerY=c,u.innerRadius=a,u.outerRadius=o,u.startAngle=h,u.endAngle=d,u.stroke=void 0,u.strokeWidth=0,u});return s.append(a),s}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};Qn.chartType="nightingale";var Jn=class extends Cn{constructor(e,t,i){super(e,"rangeBarTooltip"),this.bars=this.createRangeBar(this.root,[3,3.5,3],this.size,this.padding,"vertical"),this.updateColors(t,i)}updateColors(e,t){this.bars.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}createRangeBar(e,t,i,s,r){const n="horizontal"===r,o=2*s,a=new Ii._Scene.BandScale;a.domain=t.map((e,t)=>t),a.range=[s,i-s],a.paddingInner=.3,a.paddingOuter=.3;const l=new Ii._Scene.LinearScale;l.domain=[.7*t.reduce((e,t)=>Math.min(e,t),1/0),1.3*t.reduce((e,t)=>Math.max(e,t),0)],l.range=[o,i-o];const c=a.bandwidth,h=t.map((e,t)=>{const[i,s]=[.7*e,1.3*e],r=a.convert(t),o=l.convert(i),h=l.convert(s)-o,d=new Ii._Scene.Rect;return d.x=n?o:r,d.y=n?r:o,d.width=n?h:c,d.height=n?c:h,d.strokeWidth=0,d.crisp=!0,d});return e.append(h),h}};Jn.chartType="rangeBar";var eo=class extends Cn{constructor(e,t,i){super(e,"rangeAreaTooltip");const s=[to({offset:1.5,length:4,pattern:{low:3,high:5,period:4}}),to({offset:1.5,length:4,pattern:{low:2.25,high:4.25,period:4}}),to({offset:3,length:4,pattern:{low:2.5,high:4.5,period:4}})].map(e=>e.map(([e,t])=>({x:e,low:t-.875,high:t+.875}))),{lines:r,areas:n}=this.createRangeArea(this.root,s,this.size,this.padding);this.lines=r,this.areas=n,this.updateColors(t,i)}updateColors(e,t){e=so(e,1,2),t=so(t,1,2),this.lines.forEach(([e,i],s)=>{e.fill=void 0,e.stroke=t[s],i.fill=void 0,i.stroke=t[s]}),this.areas.forEach((t,i)=>{t.fill=e[i]})}createRangeArea(e,t,i,s){const r=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.min(e,t),e),1/0),n=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.max(e,t),e),-1/0),o=t.reduce((e,t)=>t.reduce((e,{low:t})=>Math.min(e,t),e),1/0),a=t.reduce((e,t)=>t.reduce((e,{high:t})=>Math.max(e,t),e),-1/0),l=new Ri._Scene.LinearScale;l.domain=[r,n],l.range=[s,i-s];const c=2*s,h=new Ri._Scene.LinearScale;h.domain=[o,a],h.range=[i-c,c];const d=[],u=[];return t.map(e=>{const t=new Ri._Scene.Path,i=new Ri._Scene.Path,s=new Ri._Scene.Path;return d.push([t,i]),u.push(s),t.strokeWidth=0,i.strokeWidth=0,s.strokeWidth=0,s.fillOpacity=.8,t.path.clear(),i.path.clear(),s.path.clear(),e.map((e,r)=>{const{x:n,low:o,high:a}=e,c=l.convert(n),d=h.convert(o),u=h.convert(a),p=r>0?"lineTo":"moveTo";return t.path[p](c,u),i.path[p](c,d),s.path[p](c,u),[c,d]})}).forEach((e,t)=>{const i=e.length-1,s=u[t];for(let t=i;t>=0;t--){const[i,r]=e[t];s.path.lineTo(i,r)}}),e.append(u.concat(...d)),{lines:d,areas:u}}};function to(e){const{offset:t,length:i,pattern:s}=e,r=function(e,t,i){const{period:s}=i,r=e/s,n=[0,.5].map(e=>e-r).map(io).sort((e,t)=>e-t);return Array.from({length:Math.floor(n.length*(s/t))},(e,t)=>n[t%n.length]+Math.floor(t/n.length)).map(e=>e*s).map(t=>o(t,e,i))}(t,i,s),n=i;return 0!==r.length&&0===r[0][0]||r.unshift(o(0,t,s)),r[r.length-1][0]!==n&&r.push(o(n,t,s)),r;function o(e,t,i){return[e,a(t+e,i)]}function a(e,t){const{low:i,high:s,period:r}=t,n=io(e/r);return i+(s-i)*(n>.5?1-2*(n-.5):2*n)}}function io(e){const t=e%1;return t<0?t+1:t}function so(e,t,i){const s=[...e],r=s[t];return s[t]=s[i],s[i]=r,s}eo.chartType="rangeArea";var ro=class extends Cn{constructor(e,t,i,s,r){super(e,"boxPlotTooltip");const n=this.padding,o=this.size,a=[11,11.5,10.5],l=new Pi._Scene.LinearScale;l.domain=[.8*a.reduce((e,t)=>Math.min(e,t),1/0),1.2*a.reduce((e,t)=>Math.max(e,t),0)],l.range=[o-1.5*n,n];const c=new Pi._Scene.BandScale;c.domain=a.map((e,t)=>t),c.range=[n,o-n],c.paddingInner=.4,c.paddingOuter=.2;const h=Math.round(c.bandwidth),d=Math.round(c.bandwidth/2);this.boxPlotGroups=a.map((e,t)=>{let[i,s,r,n]=[.8*e,.9*e,1.1*e,1.2*e];const o=Math.round(l.convert(r)),a=Math.round(c.convert(t)),u=Math.round(a+h),p=Math.round(l.convert(s)),g=Math.round(l.convert(i)),m=Math.round(l.convert(e)),f=Math.round(l.convert(n)),y=a+d,v=new Pi._Scene.Group,C=new Pi._Scene.Rect,b=new Pi._Scene.Line,S=new Pi._Scene.Line,w=new Pi._Scene.Line,x=new Pi._Scene.Line,E=new Pi._Scene.Line;return C.x=a,C.y=o,C.width=h,C.height=p-o,C.strokeWidth=1,C.strokeOpacity=.75,C.crisp=!0,this.setLineProperties(b,a,u,m,m),this.setLineProperties(S,y,y,f,o),this.setLineProperties(w,y,y,g,p),this.setLineProperties(x,a,u,f,f),this.setLineProperties(E,a,u,g,g),v.append([C,b,S,w,x,E]),v}),this.updateColors(t,i,s,r),this.root.append(this.boxPlotGroups)}updateColors(e,t,i,s){var r;const n=null==i?void 0:i.properties.get(Pi._Theme.DEFAULT_BACKGROUND_COLOUR),o=null!=(r=Array.isArray(n)?n[0]:n)?r:"white";this.boxPlotGroups.forEach((i,r)=>{var n;null==(n=i.children)||n.forEach(i=>{const n=e[r%e.length];i.fill=s?n:Pi._Util.Color.interpolate(n,o)(.7),i.stroke=t[r%t.length]})})}setLineProperties(e,t,i,s,r){e.x1=t,e.x2=i,e.y1=s,e.y2=r,e.strokeOpacity=.75}};ro.chartType="boxPlot";var no=class extends vn{constructor(e,t,i,s,r){super(e,"treemapTooltip");const{size:n,padding:o}=this,a=[[1,1],[3,2,1]],l=a.length%2==0?.3:.2,c=[o,n-o],h=a.length,d=h*(h+1)/2,u=l/(h-1),p=c[1]-c[0],g=p-l;let m=c[0];this.rects=a.reduce((e,t,i)=>{null!=e||(e=[]);const s=g*((h-i)/d),r=t.length,n=t.reduce((e,t)=>e+t,0),o=l/(r-1||1),a=r>1?p-l:p;let f=c[0];const y=t.map(e=>{const t=new ki._Scene.Rect,i=a*e/n;return t.x=m,t.y=f,t.width=s,t.height=i,t.strokeWidth=.75,t.crisp=!0,f+=i+o,t});return m+=s+u,e.push(...y),e},[]),this.updateColors(t,i,s,r);const f=new ki._Scene.Group;f.setClipRectInGroupCoordinateSpace(new ki._Scene.BBox(o,o,n-o,n-o)),f.append(this.rects),this.root.append(f)}updateColors(e,t,i,s){var r;const{properties:n}=null!=i?i:{},o=null==n?void 0:n.get(ki._Theme.DEFAULT_BACKGROUND_COLOUR),a=null!=(r=Array.isArray(o)?o[0]:o)?r:"white";this.rects.forEach((i,r)=>{i.fill=e[r%t.length],i.stroke=s?t[r%t.length]:a})}};no.chartType="treemap";var oo=class extends $n{constructor(e,t,i){super(e,"sunburstTooltip"),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;const{data:s,size:r,padding:n,angleOffset:o,innerRadiusRatio:a}=this,l=(r-2*n)/2,c=[o+0,o+2*Math.PI],h=Math.abs(c[1]-c[0]),d=[l*a,l],u=Math.abs(d[1]-d[0]);let p=0;const g=(e,t)=>{e.forEach(e=>{const i=t+1;p=Math.max(p,i),g(e,i)})};g(s,0);const m=u/p,f=this.size/2,y=c[0];this.series=[];const v=(e,t,i,s,r)=>{if(!Array.isArray(e))return;const n=t+1;let o=i;e.forEach((e,i,a)=>{let l=r;l||(l=new Li._Scene.Group,this.series.push(l));const c=d[0]+t*m,h=d[0]+n*m,u=1/a.length,p=o,g=p+s*u,y=new Li._Scene.Sector;y.centerX=f,y.centerY=f,y.innerRadius=c,y.outerRadius=h,y.startAngle=p,y.endAngle=g,y.stroke=void 0,y.strokeWidth=0,y.inset=.75,o=g,l.append(y),v(e,n,p,Math.abs(g-p),l)})};v(s,0,y,h),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};oo.chartType="sunburst";var ao=class extends vn{constructor(e,t,i,s,r){var n,o;super(e,"heatmapTooltip");const{size:a,padding:l}=this,c=Array.from({length:3},(e,t)=>Array.from({length:3},(e,t)=>t)),h=c.map((e,t)=>t),d=new Ni._Scene.BandScale;d.domain=h,d.range=[l,a-l],d.paddingInner=.01,d.paddingOuter=.1;const u=new Ni._Scene.BandScale;u.domain=h,u.range=[l,a-l],u.paddingInner=.01,u.paddingOuter=.1;const p=null!=(n=d.bandwidth)?n:0,g=null!=(o=u.bandwidth)?o:0;this.rects=c.reduce((e,t,i)=>{null!=e||(e=[]);const s=t.map((e,t)=>{const s=new Ni._Scene.Rect;return s.x=d.convert(i),s.y=u.convert(t),s.width=p,s.height=g,s.strokeWidth=0,s.crisp=!0,s});return e.push(...s),e},[]),this.updateColors(t,i,s,r);const m=new Ni._Scene.Group;m.setClipRectInGroupCoordinateSpace(new Ni._Scene.BBox(l,l,a-l,a-l)),m.append(this.rects),this.root.append(m)}updateColors(e,t,i,s){var r;const{properties:n}=null!=i?i:{},o=null==n?void 0:n.get(Ni._Theme.DEFAULT_DIVERGING_SERIES_COLOUR_RANGE),a=null==n?void 0:n.get(Ni._Theme.DEFAULT_BACKGROUND_COLOUR),l=null!=(r=Array.isArray(a)?a[0]:a)?r:"white",c=s?[e[0],e[1]]:o,h=s?t[0]:l;this.rects.forEach((e,t)=>{e.fill=Ni._Util.Color.interpolate(c[0],c[1])(.2*t),e.stroke=h})}};ao.chartType="heatmap";var lo=class extends Cn{constructor(e,t,i,s,r){super(e,"waterfallTooltip"),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(t,i,s,r)}updateColors(e,t,i,s){var r,n;const{data:o}=this,{properties:a}=null!=i?i:{},l={fill:e[0],stroke:t[0]},c={fill:e[1],stroke:t[1]},h=s?l:null!=(r=null==a?void 0:a.get(_i._Theme.DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS))?r:l,d=s?c:null!=(n=null==a?void 0:a.get(_i._Theme.DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS))?n:c;this.bars.forEach((e,t)=>{const i=o[t]>=0;e.fill=i?h.fill:d.fill,e.stroke=i?h.stroke:d.stroke})}createWaterfall(e,t,i,s,r){const n=2*s,{processedData:o,min:a,max:l}=xn(t.map(e=>[e])),c=o.reduce((e,t)=>e.concat(t),[]),h=new _i._Scene.LinearScale;h.domain=[Math.min(a,0),l],h.range=[i-n,n];const d=new _i._Scene.BandScale;d.domain=t.map((e,t)=>t),d.range=[s,i-s],d.paddingInner=.2,d.paddingOuter=.3;const u=d.bandwidth,p=new _i._Scene.Path;p.stroke="#575757",p.strokeWidth=0;const g=Math.floor(p.strokeWidth)%2/2,m=p.path;m.clear();const f="horizontal"===r,y=c.map((e,i)=>{const s=i>0?c[i-1]:0,r=t[i]>0,n=Math.round(h.convert(e)),o=Math.round(h.convert(s)),a=(r?n:o)-g,l=(r?o:n)+g,p=Math.abs(l-a),y=d.convert(i),v=new _i._Scene.Rect;v.x=f?a:y,v.y=f?y:a,v.width=f?p:u,v.height=f?u:p,v.strokeWidth=0,v.crisp=!0;const C=n+g,b=o+g;if(i>0){const e=f?b:v.x,t=f?v.y:b;m.lineTo(e,t)}const S=f?C:v.x,w=f?v.y:C;return m.moveTo(S,w),v});return e.append([p,...y]),{bars:y}}};lo.chartType="waterfall";var co=class extends Cn{constructor(e,t,i){super(e,"columnLineComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:s,columnData:r,lineData:n,size:o,padding:a}=this;this.columns=bn({stacked:!1,root:s,data:r,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5}),s.append(this.columns),this.lines=Sn(s,n,o,a),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]}),this.lines.forEach((t,i)=>{t.stroke=e[i+2]})}};co.chartType="columnLineCombo";var ho=class extends Cn{constructor(e,t,i){super(e,"areaColumnComboTooltip"),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];const{root:s,columnData:r,areaData:n,size:o,padding:a}=this;this.columns=bn({stacked:!1,root:s,data:r,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5});const l=new Oi._Scene.BandScale;l.range=[a,o-a],l.domain=[0,1,2,3,4],l.paddingInner=1,l.paddingOuter=0;const c=new Oi._Scene.LinearScale;c.range=[o-a,a],c.domain=[0,6];const h=[],d=c.convert(0),u=l.convert(0);n.forEach((e,t)=>{const i=h[t]||(h[t]=[]);e.forEach((e,t)=>{const s=e,r=t,n=l.convert(r),o=c.convert(s);i[t]={x:n,y:o}});const s=l.convert(e.length-1);h[t].push({x:s,y:d},{x:u,y:d})}),this.areas=h.map(e=>{const t=new Oi._Scene.Path;t.strokeWidth=0,t.fillOpacity=.8;const i=t.path;return e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),t}),s.append(this.areas),s.append([].concat.apply([],this.columns)),this.updateColors(t,i)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]}),this.columns.forEach((i,s)=>{i.fill=e[s+1],i.stroke=t[s+1]})}};ho.chartType="areaColumnCombo";var uo=class extends vn{constructor(e,t,i){super(e,"customComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:s,columnData:r,lineData:n,size:o,padding:a}=this;this.columns=bn({stacked:!1,root:s,data:r,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5}),s.append(this.columns),this.lines=Sn(s,n,o,a);const l="grey",c=new Fi._Scene.Line;c.x1=a,c.y1=a,c.x2=a,c.y2=o-a+3,c.stroke=l;const h=new Fi._Scene.Line;h.x1=a-3+1,h.y1=o-a,h.x2=o-a+1,h.y2=o-a,h.stroke=l;const d=new Fi._Scene.Path;this.buildPenIconPath(d),d.fill="whitesmoke",d.stroke="darkslategrey",d.strokeWidth=1,s.append([h,c,d]),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]}),this.lines.forEach((t,i)=>{t.stroke=e[i+2]})}buildPenIconPath(e){const{path:t}=e;t.moveTo(25.76,43.46),t.lineTo(31.27,48.53),t.moveTo(49.86,22),t.lineTo(49.86,22),t.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),t.lineTo(46.86,21.41),t.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),t.lineTo(25.51,43.8),t.lineTo(25.43,43.89),t.lineTo(23.01,51.89),t.lineTo(22.83,52.46),t.lineTo(31.02,48.86),t.lineTo(49.02,28.52),t.lineTo(49.02,28.52),t.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),t.lineTo(50.75,24.93),t.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),t.closePath(),t.moveTo(41.76,25.5),t.lineTo(47.34,30.5),t.moveTo(40.74,26.65),t.lineTo(46.25,31.71)}};uo.chartType="customCombo";var po={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:En},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:An},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Dn}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:In},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:Pn},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:Ln}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:On},donut:{range:!0,pivot:!0,enterprise:!1,icon:_n},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:_n}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:Fn}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:Gn},bubble:{range:!0,pivot:!0,enterprise:!1,icon:Bn}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:Hn},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:zn},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:jn}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:Xn},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:Zn},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:Qn},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:Yn},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:qn}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:ro},histogram:{range:!0,pivot:!1,enterprise:!1,icon:Kn},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:Jn},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:eo}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:no},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:oo}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:ao},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:lo}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:co},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:ho},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:uo}}},go={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line"],scatterGroup:["scatter","bubble"],areaGroup:["area","stackedArea","normalizedArea"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},mo=class e extends hi.Component{constructor(t,i,s,r,n,o=go){super(e.TEMPLATE),this.wrappers={},this.chartController=t,this.fills=i,this.strokes=s,this.themeTemplateParameters=r,this.isCustomTheme=n,this.chartGroups=ds({},o)}init(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(e=>"customCombo"!==e));const e=this.getGui(),t=this.chartController.isEnterprise(),i=this.chartController.isPivotChart(),s=!i,r=Object.keys(this.chartGroups).map(e=>{var r;const n=e in po?po[e]:void 0;if(!n)return hi._.warnOnce(`invalid chartGroupsDef config '${e}'`),null;const o=(null!=(r=this.chartGroups[e])?r:[]).map(r=>{const o=r in n?n[r]:void 0;return o?!t&&o.enterprise?null:s&&o.range||i&&o.pivot?o:null:(hi._.warnOnce(`invalid chartGroupsDef config '${e}.${r}'`),null)}).filter(e=>null!=e);return 0===o.length?null:{label:this.chartTranslationService.translate(e),items:o}}).filter(e=>null!=e);for(const{label:t,items:i}of r){const s=this.createBean(new hi.AgGroupComponent({title:t,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal"}));for(const e of i){const t=e.icon,i=document.createElement("div");i.classList.add("ag-chart-mini-thumbnail");const r=t.chartType;this.addManagedListener(i,"click",()=>{this.chartController.setChartType(r),this.updateSelectedMiniChart()}),this.wrappers[r]=i,this.createBean(new t(i,this.fills,this.strokes,this.themeTemplateParameters,this.isCustomTheme)),s.addItem(i)}e.appendChild(s.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){const e=this.chartController.getChartType();for(const t in this.wrappers){const i=t===e;this.wrappers[t].classList.toggle("ag-selected",i)}}};mo.TEMPLATE='<div class="ag-chart-settings-mini-wrapper"></div>',gs([(0,hi.Autowired)("chartTranslationService")],mo.prototype,"chartTranslationService",2),gs([hi.PostConstruct],mo.prototype,"init",1);var fo=mo,yo=class e extends ci.Component{constructor(t){super(e.TEMPLATE),this.chartController=t,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes(),this.ePrevBtn.insertAdjacentElement("afterbegin",ci._.createIconNoSpan("previous",this.gos)),this.eNextBtn.insertAdjacentElement("afterbegin",ci._.createIconNoSpan("next",this.gos)),this.addManagedListener(this.ePrevBtn,"click",()=>this.setActivePalette(this.getPrev(),"left")),this.addManagedListener(this.eNextBtn,"click",()=>this.setActivePalette(this.getNext(),"right")),this.addManagedListener(this.chartController,rr.EVENT_CHART_TYPE_CHANGED,()=>this.resetPalettes(!0)),this.addManagedListener(this.chartController,rr.EVENT_CHART_API_UPDATE,()=>this.resetPalettes(!0)),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{const e=this.miniChartsContainers.find(e=>!e.getGui().classList.contains("ag-hidden")).getGui().querySelector(".ag-selected");if(e){const t=e.offsetParent;t&&this.eMiniChartsContainer.scrollTo(0,t.offsetTop)}},250)}resetPalettes(e){var t,i;const s=this.chartController.getPalettes(),r=this.chartController.getThemeTemplateParameters(),n=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.settingsPanel)?void 0:i.chartGroupsDef;if(ci._.shallowCompare(s,this.palettes)&&!e||this.isAnimating)return;this.palettes=s,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(e=>e===this.chartController.getChartThemeName()),this.cardItems=[],ci._.clearElement(this.eCardSelector),this.destroyMiniCharts();const{themes:o}=this;this.palettes.forEach((e,t)=>{const i=this.activePaletteIndex===t,{fills:s,strokes:a}=e,l=!Ws(o[t]),c=this.createBean(new fo(this.chartController,s,a,r[t],l,n));this.miniChartsContainers.push(c),this.eMiniChartsContainer.appendChild(c.getGui()),this.addCardLink(t),i?c.updateSelectedMiniChart():c.setDisplayed(!1)}),ci._.setDisplayed(this.eNavBar,this.palettes.length>1),ci._.radioCssClass(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(e){const t=document.createElement("div");t.classList.add("ag-chart-settings-card-item"),this.addManagedListener(t,"click",()=>{this.setActivePalette(e,e<this.activePaletteIndex?"left":"right")}),this.eCardSelector.appendChild(t),this.cardItems.push(t)}getPrev(){let e=this.activePaletteIndex-1;return e<0&&(e=this.palettes.length-1),e}getNext(){let e=this.activePaletteIndex+1;return e>=this.palettes.length&&(e=0),e}setActivePalette(e,t){if(this.isAnimating||this.activePaletteIndex===e)return;ci._.radioCssClass(this.cardItems[e],"ag-selected","ag-not-selected");const i=this.miniChartsContainers[this.activePaletteIndex],s=i.getGui(),r=this.miniChartsContainers[e],n=r.getGui();i.updateSelectedMiniChart(),r.updateSelectedMiniChart();const o="left"===t?-1:1,a=n.style.left=ci._.getAbsoluteWidth(this.getGui())*o+"px";this.activePaletteIndex=e,this.isAnimating=!0;const l="ag-animating";r.setDisplayed(!0),i.addCssClass(l),r.addCssClass(l),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{s.style.left=-parseFloat(a)+"px",n.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,i.removeCssClass(l),r.removeCssClass(l),i.setDisplayed(!1)},300)}destroyMiniCharts(){ci._.clearElement(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}};yo.TEMPLATE='<div class="ag-chart-settings-wrapper">\n            <div ref="eMiniChartsContainer" class="ag-chart-settings-mini-charts-container ag-scrollable-container"></div>\n            <div ref="eNavBar" class="ag-chart-settings-nav-bar">\n                <div ref="ePrevBtn" class="ag-chart-settings-prev">\n                    <button type="button" class="ag-button ag-chart-settings-prev-button"></button>\n                </div>\n                <div ref="eCardSelector" class="ag-chart-settings-card-selector"></div>\n                <div ref="eNextBtn" class="ag-chart-settings-next">\n                    <button type="button" class="ag-button ag-chart-settings-next-button"></button>\n                </div>\n            </div>\n        </div>',gs([(0,ci.RefSelector)("eMiniChartsContainer")],yo.prototype,"eMiniChartsContainer",2),gs([(0,ci.RefSelector)("eNavBar")],yo.prototype,"eNavBar",2),gs([(0,ci.RefSelector)("eCardSelector")],yo.prototype,"eCardSelector",2),gs([(0,ci.RefSelector)("ePrevBtn")],yo.prototype,"ePrevBtn",2),gs([(0,ci.RefSelector)("eNextBtn")],yo.prototype,"eNextBtn",2),gs([ci.PostConstruct],yo.prototype,"postConstruct",1);var vo=yo,Co=class e extends ft.Component{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}init(){this.panels.forEach(e=>{const t=e.replace("chart","").toLowerCase(),i=this.createPanel(t),s=this.createTab(e,t,i);this.tabs.push(s),this.addDestroyFunc(()=>this.destroyBean(i))}),this.tabbedLayout=new ft.TabbedLayout({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!this.chartMenuService.isLegacyFormat(),closeButtonAriaLabel:this.chartTranslationService.translate("ariaChartMenuClose"),onCloseClicked:()=>{var t;null==(t=this.eventSource)||t.focus({preventScroll:!0}),this.dispatchEvent({type:e.EVENT_CLOSED})}}),this.getContext().createBean(this.tabbedLayout)}createTab(e,t,i){const s=document.createElement("div");s.classList.add("ag-chart-tab",`ag-chart-${t}`),this.getContext().createBean(i),s.appendChild(i.getGui());const r=document.createElement("div"),n=this.chartTranslationService.translate(t);return r.innerText=n,{title:r,titleLabel:n,bodyPromise:ft.AgPromise.resolve(s),getScrollableContainer:()=>s.querySelector(".ag-scrollable-container")||s,name:e}}showTab(e){const t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout&&this.tabbedLayout.getGui()}showMenu(e,t){var i;this.eventSource=e,t||null==(i=this.tabbedLayout)||i.focusHeader(!0)}destroy(){this.parentComponent&&this.parentComponent.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(t){const{chartController:i,chartOptionsService:s}=this.chartMenuContext;switch(t){case e.TAB_DATA:return new br(i,s);case e.TAB_FORMAT:return new yn(this.chartMenuContext);default:return new vo(i)}}};Co.EVENT_CLOSED="closed",Co.TAB_DATA="data",Co.TAB_FORMAT="format",gs([(0,ft.Autowired)("chartTranslationService")],Co.prototype,"chartTranslationService",2),gs([(0,ft.Autowired)("chartMenuService")],Co.prototype,"chartMenuService",2),gs([ft.PostConstruct],Co.prototype,"init",1);var bo=Co,So=class extends Gi.Component{constructor(){super('<div class="ag-chart-menu" ref="eMenu"></div>'),this.buttonListenersDestroyFuncs=[]}updateParams(e){const{buttons:t}=e;this.createButtons(t)}createButtons(e){this.buttonListenersDestroyFuncs.forEach(e=>null==e?void 0:e()),this.buttonListenersDestroyFuncs=[];const t=this.eMenu;Gi._.clearElement(t),e.forEach(e=>{const{buttonName:i,iconName:s,callback:r}=e,n=this.createButton(s),o=this.chartTranslationService.translate(i+"ToolbarTooltip");o&&n instanceof HTMLElement&&(n.title=o),this.buttonListenersDestroyFuncs.push(this.addManagedListener(n,"click",e=>r(e.target))),t.appendChild(n)})}createButton(e){let t=Gi._.createIconNoSpan(e,this.gos,void 0,!0);return t.classList.add("ag-chart-menu-icon"),this.chartMenuService.isLegacyFormat()||(t=this.wrapButton(t)),t}wrapButton(e){const t=this.gos.getDocument().createElement("button");return t.appendChild(e),t.classList.add("ag-chart-menu-toolbar-button"),t}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}};gs([(0,Gi.Autowired)("chartTranslationService")],So.prototype,"chartTranslationService",2),gs([(0,Gi.Autowired)("chartMenuService")],So.prototype,"chartMenuService",2),gs([(0,Gi.RefSelector)("eMenu")],So.prototype,"eMenu",2);var wo=class e extends mt.Component{constructor(t,i,s){super(e.TEMPLATE),this.eChartContainer=t,this.eMenuPanelContainer=i,this.chartMenuContext=s,this.buttons={chartSettings:{iconName:"menu",callback:()=>this.showMenu({panel:this.defaultPanel})},chartData:{iconName:"menu",callback:()=>this.showMenu({panel:"chartData"})},chartFormat:{iconName:"menu",callback:()=>this.showMenu({panel:"chartFormat"})},chartLink:{iconName:"linked",callback:()=>this.chartMenuService.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuService.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"save",callback:()=>this.chartMenuService.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"menuAlt",callback:e=>this.showMenuList(e)}},this.panels=[],this.menuVisible=!1,this.chartController=s.chartController}postConstruct(){this.legacyFormat=this.chartMenuService.isLegacyFormat(),this.chartToolbar=this.createManagedBean(new So),this.getGui().appendChild(this.chartToolbar.getGui()),this.legacyFormat&&this.createLegacyToggleButton(),this.refreshToolbarAndPanels(),this.addManagedListener(this.eventService,mt.Events.EVENT_CHART_CREATED,e=>{var t;e.chartId===this.chartController.getChartId()&&Boolean(null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.defaultToolPanel)&&this.showMenu({panel:this.defaultPanel,animate:!1,suppressFocus:!0})}),this.addManagedListener(this.chartController,rr.EVENT_CHART_LINKED_CHANGED,this.refreshToolbarAndPanels.bind(this)),this.refreshMenuClasses(),this.legacyFormat&&!this.gos.get("suppressChartToolPanelsButton")&&this.panels.length>0&&(this.getGui().classList.add("ag-chart-tool-panel-button-enable"),this.eHideButton&&this.addManagedListener(this.eHideButton,"click",this.toggleMenu.bind(this))),this.legacyFormat||this.getGui().classList.add("ag-chart-menu-wrapper"),this.addManagedListener(this.chartController,rr.EVENT_CHART_API_UPDATE,this.refreshToolbarAndPanels.bind(this))}isVisible(){return this.menuVisible}getExtraPaddingDirections(){const e=[];return["chartMenu","chartLink","chartUnlink","chartDownload"].some(e=>this.chartToolbarOptions.includes(e))&&e.push("top"),["chartSettings","chartData","chartFormat"].some(e=>this.chartToolbarOptions.includes(e))&&e.push(this.gos.get("enableRtl")?"left":"right"),e}createLegacyToggleButton(){const e=this.gos.getDocument();this.eHideButton=e.createElement("button"),this.eHideButton.classList.add("ag-button","ag-chart-menu-close"),this.eHideButtonIcon=e.createElement("span"),this.eHideButtonIcon.classList.add("ag-icon","ag-icon-contracted"),this.eHideButton.appendChild(this.eHideButtonIcon),this.getGui().appendChild(this.eHideButton)}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){const{panels:e,defaultPanel:t,chartToolbarOptions:i}=this.chartMenuService.getToolbarOptionsAndPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=i}updateToolbar(){const e=this.chartToolbarOptions.map(e=>{const{iconName:t,callback:i}=this.buttons[e];return{buttonName:e,iconName:t,callback:i}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){const t=this.environment.chartMenuPanelWidth(),i=this.menuPanel=this.createBean(new mt.AgPanel({minWidth:t,width:t,height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return i.setParentComponent(this),this.eMenuPanelContainer.appendChild(i.getGui()),this.tabbedMenu=this.createBean(new bo(this.panels,this.chartMenuContext)),this.addManagedListener(this.tabbedMenu,bo.EVENT_CLOSED,()=>{this.hideMenu(!1)}),this.addManagedListener(i,mt.Component.EVENT_DESTROYED,()=>this.destroyBean(this.tabbedMenu)),new mt.AgPromise(t=>{window.setTimeout(()=>{i.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),t(i),this.legacyFormat&&this.addManagedListener(this.eChartContainer,"click",e=>{this.getGui().contains(e.target)||this.menuVisible&&this.hideMenu()})},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.showParent(this.menuPanel.getWidth()),this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}toggleMenu(){this.menuVisible?this.hideMenu(this.legacyFormat):this.showMenu({animate:this.legacyFormat})}showMenu(e){const{panel:t,animate:i=!0,eventSource:s,suppressFocus:r}=e;if(i||this.eMenuPanelContainer.classList.add("ag-no-transition"),this.menuPanel&&!t)this.showContainer(s,r);else{const e=t||this.defaultPanel;let i=this.panels.indexOf(e);i<0&&(console.warn(`AG Grid: '${t}' is not a valid Chart Tool Panel name`),i=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(i),this.showContainer(s,r)):this.createMenuPanel(i).then(()=>this.showContainer(s,r))}i||setTimeout(()=>{this.isAlive()&&this.eMenuPanelContainer.classList.remove("ag-no-transition")},500)}hideMenu(e=!0){e||this.eMenuPanelContainer.classList.add("ag-no-transition"),this.hideParent(),window.setTimeout(()=>{this.menuVisible=!1,this.refreshMenuClasses(),e||this.eMenuPanelContainer.classList.remove("ag-no-transition")},500)}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible),this.legacyFormat&&!this.gos.get("suppressChartToolPanelsButton")&&(this.eHideButtonIcon.classList.toggle("ag-icon-contracted",this.menuVisible),this.eHideButtonIcon.classList.toggle("ag-icon-expanded",!this.menuVisible))}showParent(e){this.eMenuPanelContainer.style.minWidth=`${e}px`}hideParent(){this.eMenuPanelContainer.style.minWidth="0"}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({animate:!1,eventSource:e}),chartMenuContext:this.chartMenuContext})}destroy(){super.destroy(),this.menuPanel&&this.menuPanel.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu&&this.tabbedMenu.isAlive()&&this.destroyBean(this.tabbedMenu)}};wo.TEMPLATE="<div></div>",gs([(0,mt.Autowired)("chartMenuService")],wo.prototype,"chartMenuService",2),gs([(0,mt.Autowired)("chartMenuListFactory")],wo.prototype,"chartMenuListFactory",2),gs([mt.PostConstruct],wo.prototype,"postConstruct",1);var xo=wo,Eo=class e extends Bi.Component{constructor(t){super(e.TEMPLATE),this.chartMenu=t,this.destroyableChartListeners=[],this.editing=!1}init(){this.addManagedListener(this.getGui(),"keydown",e=>{this.editing&&"Enter"===e.key&&!e.shiftKey&&(this.handleEndEditing(),e.preventDefault())}),this.addManagedListener(this.getGui(),"input",()=>{this.editing&&this.updateHeight()}),this.addManagedListener(this.getGui(),"blur",()=>this.endEditing())}refreshTitle(e){this.chartController=e.chartController,this.chartOptionsService=e.chartOptionsService,this.chartMenuUtils=e.chartMenuParamsFactory.getChartOptions();for(const e of this.destroyableChartListeners)e();this.destroyableChartListeners=[];const t=this.chartController.getChartProxy().getChart(),i=t.canvasElement,s=this.addManagedListener(i,"dblclick",e=>{const{title:s}=t;if(s&&s.node.containsPoint(e.offsetX,e.offsetY)){const e=s.node.computeBBox(),t=s.node.inverseTransformPoint(e.x,e.y);this.startEditing(ds(ds({},e),t),i.width)}});let r=!1;const n=this.addManagedListener(i,"mousemove",e=>{const{title:s}=t,n=!!(s&&s.enabled&&s.node.containsPoint(e.offsetX,e.offsetY));r!==n&&(i.style.cursor=n?"pointer":""),r=n});this.destroyableChartListeners=[s,n]}startEditing(e,t){if(this.chartMenuService.isLegacyFormat()&&this.chartMenu&&this.chartMenu.isVisible())return;if(this.editing)return;this.editing=!0;const i=Math.max(Math.min(e.width+20,t),300),s=this.getGui();s.classList.add("currently-editing");const r=s.style;r.fontFamily=this.chartMenuUtils.getValue("title.fontFamily"),r.fontWeight=this.chartMenuUtils.getValue("title.fontWeight"),r.fontStyle=this.chartMenuUtils.getValue("title.fontStyle"),r.fontSize=this.chartMenuUtils.getValue("title.fontSize")+"px",r.color=this.chartMenuUtils.getValue("title.color");const n=this.chartMenuUtils.getValue("title.text"),o=n===this.chartTranslationService.translate("titlePlaceholder");s.value=o?"":n;const a=n.split(/\r?\n/g).length;r.left=Math.round(e.x+e.width/2-i/2-1)+"px",r.top=Math.round(e.y+e.height/2-a*this.getLineHeight()/2-2)+"px",r.width=Math.round(i)+"px",r.lineHeight=this.getLineHeight()+"px",this.updateHeight(),s.focus()}updateHeight(){const e=this.getGui(),t=this.chartMenuUtils.getValue("title.text").split(/\r?\n/g).length,i=e.value.split(/\r?\n/g).length;e.style.height=Math.round(Math.max(t,i)*this.getLineHeight())+4+"px"}getLineHeight(){const e=this.chartMenuUtils.getValue("title.lineHeight");return e?parseInt(e):Math.round(1.2*parseInt(this.chartMenuUtils.getValue("title.fontSize")))}handleEndEditing(){const e=this.chartMenuUtils.getValue("title.color");this.chartMenuUtils.setValue("title.color","rgba(0, 0, 0, 0)"),this.chartOptionsService.awaitChartOptionUpdate(()=>this.endEditing()),this.chartOptionsService.awaitChartOptionUpdate(()=>{this.chartMenuUtils.setValue("title.color",e)})}endEditing(){if(!this.editing)return;this.editing=!1;const e=this.getGui().value;e&&""!==e.trim()?(this.chartMenuUtils.setValue("title.text",e),this.chartMenuUtils.setValue("title.enabled",!0)):(this.chartMenuUtils.setValue("title.text",""),this.chartMenuUtils.setValue("title.enabled",!1)),this.getGui().classList.remove("currently-editing"),this.chartOptionsService.awaitChartOptionUpdate(()=>{this.eventService.dispatchEvent({type:"chartTitleEdit"})})}};Eo.TEMPLATE='<textarea\n             class="ag-chart-title-edit"\n             style="padding:0; border:none; border-radius: 0; min-height: 0; text-align: center; resize: none;" />\n        ',gs([(0,Bi.Autowired)("chartTranslationService")],Eo.prototype,"chartTranslationService",2),gs([(0,Bi.Autowired)("chartMenuService")],Eo.prototype,"chartMenuService",2),gs([Bi.PostConstruct],Eo.prototype,"init",1);var Mo=Eo;function Ao(e){return null!=e.chart?e.chart:e}var To=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.isEnterpriseCharts=Hi._ModuleSupport.enterpriseModule.isEnterprise,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=Is(this.chartType),null==this.chart?this.chart=Hi.AgCharts.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){Hi.AgCharts.update(this.getChartRef(),this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){Hi.AgCharts.updateDelta(this.getChartRef(),{theme:{overrides:e}})}getChart(){return Ao(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,i){const{chart:s}=this,r=Ao(s),n=t||(r.title?r.title.text:"chart"),{width:o,height:a}=e||{};Hi.AgCharts.download(s,{width:o,height:a,fileName:n,fileFormat:i})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){var e;return null!=(e=this.getChartOptions().theme.overrides)?e:{}}getChartPalette(){return Hi._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){const t=Is(this.chartProxyParams.chartType);Hi.AgCharts.updateDelta(this.chart,{theme:{overrides:{[t]:{paired:e}}}})}isPaired(){const e=Is(this.chartProxyParams.chartType);return zs(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return $s(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((e,i)=>{const s=e[t],r=s&&s.toString?s.toString():"",n=ds({},e);return n[t]={id:i,value:s,toString:()=>r},n})}getCommonChartOptions(e){var t,i;const s=this.clearThemeOverrides?{}:null!=(i=null==(t=this.chart)?void 0:t.getOptions())?i:{},r=null!=this.chart?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;const n=function(e,t,i,s,r){var n;const{chartOptionsToRestore:o,chartPaletteToRestore:a,chartThemeToRestore:l}=e,c=function(e){let t=e.getChartThemeName();const i=e.getChartThemes();return Mt._.includes(i,t)||(t=i[0]),t}(e),h=Ws(c),d=h?{baseTheme:c}:null!=(n=$s(e,c))?n:{},u=e.getGridOptionsChartThemeOverrides(),p=e.apiChartThemeOverrides,g=Is(e.chartType),m=e.crossFiltering?function(e,t,i){const s={listeners:{legendItemClick:t=>{e.getChart().series.forEach(e=>{e.toggleSeriesItem(t.itemId,t.enabled),e.toggleSeriesItem(`${t.itemId}-filtered-out`,t.enabled)})}}};return{[i]:{tooltip:{delay:500},legend:s,listeners:{click:e=>t.crossFilterCallback(e,!0)}}}}(t,e,g):void 0,f=[h?Ks(e,i,(()=>{const e=e=>!!e&&Object.keys(e).some(t=>zs(e[t],"title.enabled",!1));return e(u)||e(p)})()):void 0,s,m,u,p,ds({},null!=o?o:{}),r].filter(e=>!!e).reduce((e,t)=>({baseTheme:e,overrides:t}),d);return a&&c===l&&(function(e,t){const i=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]);return i(e.fills,t.fills)&&i(e.strokes,t.strokes)}(a,At._Theme.getChartTheme(d).palette)||(f.palette=a)),f}(this.chartProxyParams,this,this.isEnterpriseCharts,this.getChartThemeDefaults(),null!=e?e:r),o=us(ds({},s),{mode:"integrated"});return o.theme=n,o.container=this.chartProxyParams.parentElement,o}getChartThemeDefaults(){const e=this.getSeriesChartThemeDefaults(),t=e?{[this.standaloneChartType]:e}:{},i={enabled:!0,snap:!0,label:{enabled:!1}};return ds({common:{navigator:{enabled:!1},zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:i},category:{crosshair:i},log:{crosshair:i},time:{crosshair:i}}}},t)}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){var e,t;if(this.clearThemeOverrides)return{};const i=null==(e=this.chart)?void 0:e.getOptions().theme;return null!=(t=null==i?void 0:i.overrides)?t:{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&(this.chart.destroy(),this.chart=void 0)}},Do=class extends To{constructor(e){super(e),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[]}getUpdateOptions(e,t){const i=this.getAxes(e,t);return us(ds({},t),{data:this.getData(e,i),axes:i,series:this.getSeries(e)})}getData(e,t){const i=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&i?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){const i=t[0].type,{categories:s,data:r}=e,[n]=s;switch(i){case"category":return this.transformCategoryData(r,n.id);case"time":return this.transformTimeData(r,n.id);default:return r}}getXAxisType(e){return e.grouping?"grouped-category":this.isXAxisOfType(e,"time",e=>e instanceof Date)?"time":this.isXAxisOfType(e,"number")?"number":"category"}isXAxisOfType(e,t,i){const[s]=e.categories;if(null==s?void 0:s.chartDataType)return s.chartDataType===t;if(!i)return!1;const r=e.data[0];return!!r&&i(r[s.id])}transformTimeData(e,t){var i;return(null==(i=e[0])?void 0:i[t])instanceof Date?e:e.map(e=>{const i=e[t];return"string"==typeof i?us(ds({},e),{[t]:new Date(i)}):e})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return 0==this.crossFilteringSelectedPoints.length||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){const[i]=t.categories,s=e=>"area"===this.standaloneChartType?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?e+"-total":e:e+"-total";return e.map(e=>(e.yKey=s(e.yKey),e.listeners={nodeClick:t=>{const i=t.datum[e.xKey],s=t.event.metaKey||t.event.ctrlKey;this.crossFilteringAddSelectedPoint(s,i),this.crossFilterCallback(t)}},e.marker={formatter:e=>{const t=e.datum[i.id];return{fill:e.highlighted?"yellow":e.fill,size:e.highlighted?14:this.crossFilteringPointSelected(t)?8:0}}},"area"===this.standaloneChartType&&(e.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),"line"===this.standaloneChartType&&(e.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),e))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();const[t]=e.categories,i=e.fields[0].colId,s=`${i}-filtered-out`,r=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(n=>{const o=n[t.id];this.crossFilteringAllPoints.add(o);const a=this.crossFilteringPointSelected(o);return"area"===this.standaloneChartType&&r===e.chartId&&(n[`${i}-total`]=a?n[i]:n[i]+n[s]),"line"===this.standaloneChartType&&(n[`${i}-total`]=a?n[i]:n[i]+n[s]),n})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){const t=this.standaloneChartType;if("waterfall"!==t&&"box-plot"!==t&&"range-bar"!==t)return!1;const i=e.theme,s=e=>{var i,r,n;const o=null==(n=null==(r=null==(i=null==e?void 0:e.overrides)?void 0:i[t])?void 0:r.series)?void 0:n.direction;return null!=o?"horizontal"===o:"object"==typeof(null==e?void 0:e.baseTheme)&&s(e.baseTheme)};return s(i)}};function Io(e,t){const i=parseInt(e.slice(1,3),16),s=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return t?`rgba(${i}, ${s}, ${r}, ${t})`:`rgba(${i}, ${s}, ${r})`}function Ro(e,t){return e.map(e=>{const i=Ui._Util.Color.fromString(e);return new Ui._Util.Color(i.r,i.g,i.b,t).toHexString()})}var Po=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),ko=class extends Do{constructor(e){super(e)}getAxes(e){const t=[{type:this.getXAxisType(e),position:this.isHorizontal()?"left":"bottom"},{type:"number",position:this.isHorizontal()?"bottom":"left"}];if(this.isNormalised()){const e=t[1];e.label=us(ds({},e.label),{formatter:e=>Math.round(e.value)+"%"})}return t}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>{return{type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||(i=this.chartType,xs.has(i)),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName};var i});return this.crossFiltering?this.extractCrossFilterSeries(i):i}extractCrossFilterSeries(e){const t=this.getChartPalette(),i=(e,i)=>us(ds({},e),{highlightStyle:{item:{fill:void 0}},fill:null==t?void 0:t.fills[i],stroke:null==t?void 0:t.strokes[i],listeners:{nodeClick:this.crossFilterCallback}}),s=e=>{const t=e.yKey+"-filtered-out";return us(ds({},Us({},e)),{yKey:t,fill:Io(e.fill,"0.3"),stroke:Io(e.stroke,"0.3"),showInLegend:!1})},r=[];for(let t=0;t<e.length;t++){const n=i(e[t],t);r.push(n),r.push(s(n))}return r}isNormalised(){return!this.crossFiltering&&Vi._.includes(["normalizedColumn","normalizedBar"],this.chartType)}isHorizontal(){return Po.has(this.chartType)}},Lo=class extends Do{constructor(e){super(e)}getAxes(e){const t=[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}];if(this.isNormalised()){const e=t[1];e.label=us(ds({},e.label),{formatter:e=>Math.round(e.value)+"%"})}return t}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName,normalizedTo:"normalizedArea"===this.chartType?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}isNormalised(){return!this.crossFiltering&&"normalizedArea"===this.chartType}},No=class extends Do{constructor(e){super(e)}getAxes(e){return[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}},_o=class extends To{constructor(e){super(e)}getAxes(e){const t="radial-bar"===this.standaloneChartType;return[{type:t?"angle-number":"angle-category"},{type:t?"radius-category":"radius-number"}]}getSeries(e){const{fields:t,categories:i,seriesGroupType:s}=e,[r]=i,n="radial-bar"===this.standaloneChartType,o=this.getSeriesGroupTypeOptions(s);return t.map(e=>{var t,i;return ds({type:this.standaloneChartType,angleKey:n?e.colId:r.id,angleName:n?null!=(t=e.displayName)?t:void 0:r.name,radiusKey:n?r.id:e.colId,radiusName:n?r.name:null!=(i=e.displayName)?i:void 0},o)})}getSeriesGroupType(){var e,t;const i=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(i))return;const s=null==(t=null==(e=this.getChart().series)?void 0:e[0])?void 0:t.properties.toJson(),r=()=>s.normalizedTo?"normalized":"stacked";return"nightingale"===i?s.grouped?"grouped":r():s.stacked?r():"grouped"}getUpdateOptions(e,t){const i=this.getAxes(e);return us(ds({},t),{data:this.getData(e,i),axes:i,series:this.getSeries(e)})}getData(e,t){if(t.some(e=>"angle-category"===e.type||"radius-category"===e.type)){const[t]=e.categories;return this.transformCategoryData(e.data,t.id)}return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:"grouped"===e||void 0,stacked:"grouped"!==e||void 0,normalizedTo:"normalized"===e?100:void 0}:{}}},Oo=class e extends To{constructor(e){super(e)}getUpdateOptions(e,t){return us(ds({},t),{data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)})}getSeries(t){const[i]=t.categories,s=t.fields.length,r={currentOffset:0,offsetAmount:s>1?20:40},n=this.getFields(t).map(t=>{var n;const o={type:this.standaloneChartType,angleKey:t.colId,angleName:t.displayName,sectorLabelKey:t.colId,calloutLabelName:i.name,calloutLabelKey:i.id};if("donut"===this.chartType||"doughnut"===this.chartType){const{outerRadiusOffset:i,innerRadiusOffset:a}=e.calculateOffsets(r),l=t.displayName?{title:{text:t.displayName,showInLegend:s>1}}:void 0;return us(ds(us(ds({},o),{type:"donut",outerRadiusOffset:i,innerRadiusOffset:a}),l),{calloutLine:{colors:null==(n=this.getChartPalette())?void 0:n.strokes}})}return o});return this.crossFiltering?this.extractCrossFilterSeries(n):n}getCrossFilterData(e){const t=e.fields[0].colId,i=`${t}-filtered-out`;return e.data.map(e=>{const s=e[t]+e[i];return e[`${t}-total`]=s,e[i]=1,e[t]=e[t]/s,e})}extractCrossFilterSeries(e){const t=this.getChartPalette(),i=e[0],s=i.angleKey,r=(e=>us(ds({},e),{legendItemKey:e.calloutLabelKey,calloutLabel:{enabled:!1},highlightStyle:{item:{fill:void 0}},radiusKey:e.angleKey,angleKey:e.angleKey+"-total",radiusMin:0,radiusMax:1,listeners:{nodeClick:this.crossFilterCallback}}))(i);return[(n=i,o=s,us(ds({},Us({},r)),{radiusKey:o+"-filtered-out",fills:Ro(null!=(a=n.fills)?a:t.fills,.3),strokes:Ro(null!=(l=n.strokes)?l:t.strokes,.3),showInLegend:!1})),r];var n,o,a,l}static calculateOffsets(e){const t=e.currentOffset;e.currentOffset-=e.offsetAmount;const i=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:i}}getFields(e){return"pie"===this.chartType?e.fields.slice(0,1):e.fields}},Fo=class extends Do{constructor(e){super(e)}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,i=this.isPaired(),s=this.getSeriesDefinitions(e.fields,i),r=t.id===_s.DEFAULT_CATEGORY?void 0:t,n=s.map(e=>{var t,i,s,n,o;return(null==e?void 0:e.sizeField)?{type:"bubble",xKey:e.xField.colId,xName:null!=(t=e.xField.displayName)?t:void 0,yKey:e.yField.colId,yName:null!=(i=e.yField.displayName)?i:void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,sizeKey:e.sizeField.colId,sizeName:null!=(s=e.sizeField.displayName)?s:"",labelKey:r?r.id:e.yField.colId,labelName:r?r.name:void 0}:{type:"scatter",xKey:e.xField.colId,xName:null!=(n=e.xField.displayName)?n:void 0,yKey:e.yField.colId,yName:null!=(o=e.yField.displayName)?o:void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,labelKey:r?r.id:e.yField.colId,labelName:r?r.name:void 0}});return this.crossFiltering?this.extractCrossFilterSeries(n,e):n}extractCrossFilterSeries(e,t){const{data:i}=t,s=this.getChartPalette(),r=e=>`${e}-filtered-out`,n=e.map((e,t)=>{const n=null==s?void 0:s.fills[t],o=null==s?void 0:s.strokes[t];let a;if("bubble"===e.type){const{sizeKey:t}=e;a=((e,t)=>{var i;const s=[1/0,-1/0];if(null!=t)for(const n of e){const e=null!=(i=n[t])?i:n[r(t)];e<s[0]&&(s[0]=e),e>s[1]&&(s[1]=e)}if(s[0]<=s[1])return s})(i,t)}const l=us(ds({},e.marker),{fill:n,stroke:o,domain:a});return us(ds({},e),{marker:l,highlightStyle:{item:{fill:"yellow"}},listeners:us(ds({},e.listeners),{nodeClick:this.crossFilterCallback})})});return[...n,...n.map(e=>{let{yKey:t,xKey:i}=e,s={};return"bubble"===e.type&&(s={sizeKey:r(e.sizeKey)}),us(ds(ds({},e),s),{yKey:r(t),xKey:r(i),marker:us(ds({},e.marker),{fillOpacity:.3,strokeOpacity:.3}),showInLegend:!1,listeners:us(ds({},e.listeners),{nodeClick:e=>{const t=e.datum[r(i)],s=us(ds({},e),{xKey:i,datum:us(ds({},e.datum),{[i]:t})});this.crossFilterCallback(s)}})})})]}getSeriesDefinitions(e,t){if(e.length<2)return[];const i="bubble"===this.chartType;if(t)return i?e.map((t,i)=>i%3==0?{xField:t,yField:e[i+1],sizeField:e[i+2]}:null).filter(e=>e&&e.yField&&e.sizeField):e.map((t,i)=>i%2==0?{xField:t,yField:e[i+1]}:null).filter(e=>e&&e.yField);const s=e[0];return i?e.map((t,i)=>i%2==1?{xField:s,yField:t,sizeField:e[i+1]}:null).filter(e=>e&&e.sizeField):e.filter((e,t)=>t>0).map(e=>({xField:s,yField:e}))}},Go=class extends Do{constructor(e){super(e)}getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}computeSeriesStatistics(e,t){const{data:i,fields:s}=e,[r]=e.categories,n=r.id||_s.DEFAULT_CATEGORY,o=this.groupDataByCategory(n,i);return Array.from(o).map(([e,i])=>{const n={[r.id]:e};return s.forEach((e,s)=>{const r=i.map(t=>t[e.colId]).filter(e=>"number"==typeof e&&!isNaN(e));Object.entries(t(r)).forEach(([e,t])=>{n[`${e}:${s}`]=r.length>0?t:null})}),n})}groupDataByCategory(e,t){return t.reduce((t,i)=>{let s=(t=>{if(e===_s.DEFAULT_CATEGORY)return 1;const i=t[e];return null==i?"":i instanceof Date?i.getTime():i})(i);const r=t.get(s);return r?r.push(i):t.set(s,[i]),t},new Map)}},Bo=class extends Go{constructor(e){super(e)}getSeries(e){const[t]=e.categories;return e.fields.map((e,i)=>{var s;return{type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:null!=(s=e.displayName)?s:void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${i}`,yHighKey:`max:${i}`}})}getData(e){return this.computeSeriesStatistics(e,e=>({min:Math.min(...e),max:Math.max(...e)}))}},Vo=class extends Do{constructor(e){super(e)}getSeries(e){const t=e.fields[0];return[{type:this.standaloneChartType,xKey:t.colId,xName:t.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}},Ho=class extends Go{constructor(e){super(e)}getSeries(e){const[t]=e.categories;return e.fields.map((e,i)=>{var s;return{type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:null!=(s=e.displayName)?s:void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${i}`,q1Key:`q1:${i}`,medianKey:`median:${i}`,q3Key:`q3:${i}`,maxKey:`max:${i}`}})}getData(e){return this.computeSeriesStatistics(e,e=>{const t=e.sort((e,t)=>e-t);return{min:t[0],q1:this.quantile(t,.25),median:this.quantile(t,.5),q3:this.quantile(t,.75),max:t[t.length-1]}})}quantile(e,t){const i=(e.length-1)*t,s=Math.floor(i),r=i-s;return void 0!==e[s+1]?e[s]+r*(e[s+1]-e[s]):e[s]}},Uo=class extends To{constructor(e){super(e)}getUpdateOptions(e,t){const i="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",s="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY",r="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY";return us(ds({},t),{series:this.getSeries(e,i,s,r),data:this.getData(e,i,s,r)})}getSeries(e,t,i,s){const[r]=e.categories;return[{type:this.standaloneChartType,yKey:s,xKey:t,colorKey:i,yName:r.name,xName:void 0,colorName:void 0}]}getData(e,t,i,s){const[r]=e.categories;return n=e.data,o=(n,o)=>{const a=n[r.id],l=null==a?"":String(a),c={id:o,value:a,toString:()=>l};return e.fields.map(({colId:e,displayName:r})=>us(ds({},n),{[t]:r,[i]:n[e],[s]:c}))},n.reduce((e,t,i,s)=>e.concat(o(t,i)),new Array);var n,o}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}},series:{tooltip:{renderer:zo}}}}};function zo(e){const{xKey:t,yKey:i,colorKey:s,yName:r,datum:n}=e;return{title:"",content:[{label:r,value:n[i]},{label:n[t],value:s&&n[s]}].map(({label:e,value:t})=>`<b>${Wo(String(e))}:</b> ${Wo(String(t))}`).join("<br>")}}function Wo(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;"},i=`[${Object.keys(t).join("")}]`,s=new RegExp(i,"g");return e.replace(s,e=>t[e])}var jo=class extends Do{constructor(e){super(e)}getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}getSeries(e){var t;const[i]=e.categories,[s]=e.fields;return[{type:this.standaloneChartType,xKey:i.id,xName:i.name,yKey:s.colId,yName:null!=(t=s.displayName)?t:void 0}]}},Ko=["number","category","time","grouped-category"],$o=[...Ko,"angle-category","angle-number","radius-category","radius-number"],Yo=class e extends zi.BeanStub{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>this.setChartThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setChartThemeOverrides(e)}}getAxisThemeOverridesProxy(){return{getValue:e=>this.getAxisProperty(e),setValue:(e,t)=>this.setAxisThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setAxisThemeOverrides(e)}}getCartesianAxisOptionsProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,i)=>this.setCartesianAxisOptions(e,[{expression:t,value:i}]),setValues:t=>this.setCartesianAxisOptions(e,t)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,i)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:i}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,"*"===t?null:t),setValue:(t,i)=>this.setCartesianAxisThemeOverrides(e,[{expression:"*"===t?null:t,value:i}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,i)=>this.getSeriesOption(e(),t,i),setValue:(t,i)=>this.setSeriesOptions(e(),[{expression:t,value:i}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,i,s){const r=this.getRetainedChartThemeOverrideKeys(i,s),n=this.getRetainedChartAxisThemeOverrideKeys(null,i,s),o=this.createChartOptions();for(const t of r){const r=this.retrieveChartOptionsThemeOverride(e,i,t);void 0!==r&&this.assignChartOptionsThemeOverride(o,s,t,r)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:n,existingChartOptions:e,targetChartOptions:o,existingChartType:i,targetChartType:s}),o.theme.overrides}assignPersistedAxisOverrides(e){const{existingAxes:t,retainedChartAxisThemeOverrideKeys:i,existingChartOptions:s,targetChartOptions:r,existingChartType:n,targetChartType:o}=e;for(const{expression:e,targetAxisTypes:a}of i)for(const i of t.map(e=>e.type)){const t=this.retrieveChartOptionsThemeOverride(s,n,["axes",i,e].join("."));if(void 0!==t)for(const i of a)this.assignChartOptionsThemeOverride(r,o,["axes",i,e].join("."),t)}}getRetainedChartThemeOverrideKeys(e,t){const i=["zoom","navigator"];return["animation",...((e,t)=>{const s=new Array;return Es(Is(e))&&Es(Is(t))&&s.push(...i),s})(e,t)]}getRetainedChartAxisThemeOverrideKeys(e,t,i){return Es(Is(t))&&Es(Is(i))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(e=>({expression:e,targetAxisTypes:Ko})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){const t="xAxis"===e?["",".top",".bottom"]:"yAxis"===e?["",".left",".right"]:["",".left",".right",".top",".bottom"],i=["crosshair"],s=new Array;for(const e of i)for(const i of t)s.push(`${e}${i}`);return s}getChartOption(e){return zs(this.getChart(),e,void 0)}setChartThemeOverrides(e){const t=this.getChartType(),i=this.createChartOptions();for(const{expression:s,value:r}of e)this.assignChartOptionsThemeOverride(i,t,s,r);this.applyChartOptions(i)}applyChartOptions(e,t){0!==Object.keys(e).length&&(this.updateChart(e),!(null==t?void 0:t.silent)&&this.raiseChartOptionsChangedEvent())}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(e=>console.error("AG Grid - chart update failed",e))}getAxisProperty(e){var t;return zs(null==(t=this.getChart().axes)?void 0:t[0],e,void 0)}setAxisThemeOverrides(e){var t;const i=this.getChart(),s=this.getChartType();let r=this.createChartOptions();for(const{expression:n,value:o}of e){const e=null==(t=i.axes)?void 0:t.filter(e=>{const t=n.split(".");let i=e;for(const e of t){if(!(e in i))return!1;i=i[e]}return!0});if(e)for(const t of e)this.isValidAxisType(t)&&this.assignChartAxisThemeOverride(r,s,t.type,null,n,o)}this.applyChartOptions(r)}getCartesianAxisProperty(e,t){const i=this.getChartAxes();return zs(this.getCartesianAxis(i,e),t,void 0)}getCartesianAxisThemeOverride(e,t){const i=this.getChartAxes(),s=this.getCartesianAxis(i,e);if(!s||!this.isValidAxisType(s))return;const r=this.getChartType(),n=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(n,r,s.type,"yAxis"===e?["left","right"]:["bottom","top"],t)}setCartesianAxisThemeOverrides(e,t){const i=this.getChartAxes(),s=this.getCartesianAxis(i,e);if(!s||!this.isValidAxisType(s))return;const r=this.getChartType();let n=this.createChartOptions();for(const{expression:i,value:o}of t)this.assignChartAxisThemeOverride(n,r,s.type,"yAxis"===e?["left","right"]:["bottom","top"],i,o);this.applyChartOptions(n)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,(e,i,s)=>{const r=i.indexOf(s);for(const{expression:i,value:s}of t)this.assignChartOption(e,`axes.${r}.${i}`,s)})}updateCartesianAxisOptions(e,t){const i=this.getChart().getOptions(),s="axes"in i?i.axes:void 0;if(!i||!s)return;const r=this.getChartAxes(),n=this.getCartesianAxis(r,e);if(!n)return;let o=this.createChartOptions();o.axes=s,t(o,r,n,i),this.applyChartOptions(o)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(i,s,r,n)=>{const o=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[r],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,o,o),existingChartOptions:n,targetChartOptions:i,existingChartType:o,targetChartType:o}),this.assignChartOption(i,"axes.0.type",t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case"xAxis":return"x"===e[0].direction?e[0]:e[1];case"yAxis":return"y"===e[1].direction?e[1]:e[0]}}getSeriesOption(t,i,s){const r=this.getChart().series.find(i=>e.isMatchingSeries(t,i));return zs(s?r:null==r?void 0:r.properties.toJson(),i,void 0)}setSeriesOptions(e,t){let i=this.createChartOptions();for(const{expression:s,value:r}of t)this.assignChartOptionsSeriesThemeOverride(i,e,`series.${s}`,r);this.applyChartOptions(i)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){var e;return null!=(e=this.getChart().axes)?e:[]}retrieveChartAxisThemeOverride(e,t,i,s,r){if(!s)return this.retrieveChartOptionsThemeOverride(e,t,["axes",i,...r?[r]:[]].join("."));for(const n of s){const s=this.retrieveChartOptionsThemeOverride(e,t,["axes",i,n,...r?[r]:[]].join("."));if(void 0!==s)return s}}assignChartAxisThemeOverride(e,t,i,s,r,n){if(s)for(const o of s)this.assignChartOptionsThemeOverride(e,t,["axes",i,o,...r?[r]:[]].join("."),n);else this.assignChartOptionsThemeOverride(e,t,["axes",i,...r?[r]:[]].join("."),n)}isValidAxisType(e){return $o.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){const t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),Wi.AgCharts.updateDelta(t,e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,i){const s=this.getChartThemeOverridesSeriesTypeKeys(t);for(const t of s){const s=this.retrieveChartOptionsSeriesThemeOverride(e,t,i);if(void 0!==s)return s}}assignChartOptionsThemeOverride(e,t,i,s){const r=this.getChartThemeOverridesSeriesTypeKeys(t);for(const t of r)this.assignChartOptionsSeriesThemeOverride(e,t,i,s)}retrieveChartOptionsSeriesThemeOverride(e,t,i){return this.retrieveChartOption(e,["theme","overrides",t,...i?[i]:[]].join("."))}assignChartOptionsSeriesThemeOverride(e,t,i,s){this.assignChartOption(e,["theme","overrides",t,...i?[i]:[]].join("."),s)}getChartThemeOverridesSeriesTypeKeys(e){const t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push("common"),t}retrieveChartOption(e,t){return zs(e,t,void 0)}assignChartOption(e,t,i){!function(e,t,i){if(null==e)return;const s=t.split(".");let r=e;s.forEach((e,t)=>{r[e]||(r[e]={}),t<s.length-1&&(r=r[e])}),r[s[s.length-1]]=i}(e,t,i)}raiseChartOptionsChangedEvent(){const e=this.chartController.getChartModel(),t={type:zi.Events.EVENT_CHART_OPTIONS_CHANGED,chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions};this.eventService.dispatchEvent(t)}static isMatchingSeries(e,t){return function(e){return!!bs[e]}(e)&&t.type===e}destroy(){super.destroy()}},qo=class extends Do{constructor(e){super(e)}getAxes(e){const t=e?e.fields:[],i=new Map(t.map(e=>[e.colId,e])),{primaryYKeys:s,secondaryYKeys:r}=this.getYKeys(t,e.seriesChartTypes),n=[{type:this.getXAxisType(e),position:"bottom"}];return s.length>0&&n.push({type:"number",keys:s,position:"left"}),r.length>0&&r.forEach(e=>{const t=i.get(e);if(!t||t.colId!==e)return;const s={type:"number",keys:[e],position:"right"};n.push(s)}),n}getSeries(e){const{fields:t,seriesChartTypes:i}=e,[s]=e.categories;return t.map(e=>{const t=i.find(t=>t.colId===e.colId);if(t){const i=t.chartType,r=["groupedColumn","groupedBar"].includes(i)?{grouped:!0}:{};return ds({type:Is(i),xKey:s.id,yKey:e.colId,yName:e.displayName,stacked:["stackedArea","stackedColumn"].includes(i)},r)}})}getYKeys(e,t){const i=[],s=[];return e.forEach(e=>{const r=e.colId,n=t.find(e=>e.colId===r);n&&(n.secondaryAxis?s.push(r):i.push(r))}),{primaryYKeys:i,secondaryYKeys:s}}},Xo=["chartSettings","chartData","chartFormat"],Zo=["chartUnlink","chartLink","chartDownload"],Qo={settings:"chartSettings",data:"chartData",format:"chartFormat"},Jo=class extends ji.BeanStub{isLegacyFormat(){return!this.chartService.isEnterprise()}downloadChart(e,t,i,s){e.chartController.getChartProxy().downloadChart(t,i,s)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advancedSettingsMenuFactory.showMenu(e,t)}hideAdvancedSettings(){this.advancedSettingsMenuFactory.hideMenu()}getToolbarOptionsAndPanels(e){var t,i,s;const r=this.isLegacyFormat();let n,o,a;if(Boolean(this.gos.get("chartToolPanelsDef"))||!r){const l=r?[e.isChartLinked()?"chartLink":"chartUnlink","chartDownload"]:["chartMenu"],c=this.gos.getCallback("getChartToolbarItems");a=c?c({defaultItems:l}).filter(e=>{if(!(r?Zo:[...Zo,"chartMenu"]).includes(e)){let t;return t=Xo.includes(e)?`'${e}' is a Chart Tool Panel option and will be ignored since 'chartToolPanelsDef' is used. Please use 'chartToolPanelsDef.panels' grid option instead`:"chartMenu"===e?"'chartMenu' is only allowed as a Chart Toolbar Option when using AG Charts Enterprise":`'${e}' is not a valid Chart Toolbar Option`,ji._.warnOnce(t),!1}return!0}):l;const h=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.panels)?void 0:i.map(e=>{const t=Qo[e];return t||ji._.warnOnce(`Invalid panel in chartToolPanelsDef.panels: '${e}'`),t}).filter(e=>Boolean(e));n=h||Object.values(Qo),e.isPivotChart()&&(n=n.filter(e=>"chartData"!==e));const d=null==(s=this.gos.get("chartToolPanelsDef"))?void 0:s.defaultToolPanel;o=d&&Qo[d]||n[0],r&&(a=n.length>0?[n[0],...a]:a)}else{let t=["chartSettings","chartData","chartFormat",e.isChartLinked()?"chartLink":"chartUnlink","chartDownload"];const i=this.gos.getCallback("getChartToolbarItems");if(i){const e=this.gos.get("suppressChartToolPanelsButton");t=i({defaultItems:e?t:Zo}).filter(t=>{if(!Xo.includes(t)&&!Zo.includes(t))return ji._.warnOnce(`'${t}' is not a valid Chart Toolbar Option`),!1;if(!e&&Xo.includes(t)){const e=`'${t}' is a Chart Tool Panel option and will be ignored. Please use 'chartToolPanelsDef.panels' grid option instead`;return ji._.warnOnce(e),!1}return!0}),e||(t=t.concat(Xo))}e.isPivotChart()&&(t=t.filter(e=>"chartData"!==e));const s=["chartUnlink","chartLink","chartDownload"];n=t.filter(e=>-1===s.indexOf(e)),o=n[0],a=t.filter(e=>-1!==s.indexOf(e)||n.length&&e===n[0])}return{panels:n,defaultPanel:o,chartToolbarOptions:a}}doesChartToolbarExist(e){const{chartToolbarOptions:t}=this.getToolbarOptionsAndPanels(e);return["chartMenu",...Zo].some(e=>t.includes(e))}doChartToolPanelsExist(e){const{panels:t}=this.getToolbarOptionsAndPanels(e);return t.length>0}};gs([(0,ji.Autowired)("chartService")],Jo.prototype,"chartService",2),gs([(0,ji.Autowired)("advancedSettingsMenuFactory")],Jo.prototype,"advancedSettingsMenuFactory",2),Jo=gs([(0,ji.Bean)("chartMenuService")],Jo);var ea="AG-GRID-DEFAULT-LABEL-KEY";function ta(e,t=null,i){const{depth:s,rootValues:r,value:n,children:o}=e;if(r)return r.map(e=>ds({[ea]:t},e));if(0===s)return[ds({[ea]:t},n)];const a=[];for(const[e,t]of o.entries())a.push(...ta(t,e,!0));return i?[ds({[ea]:t,children:a},null!=n?n:{})]:a}function ia(e,t,i){const s={depth:0,children:new Map};return e.forEach(e=>{r(e,t(e),i,0,s)}),s;function r(e,t,i,s,n){if(s===t)return 0===s?(n.rootValues||(n.rootValues=[]),n.rootValues.push(e)):n.value=e,n;{const o=i(e,s),a=r(e,t,i,s+1,n.children.get(o)||{depth:0,children:new Map});return n.children.set(o,a),n.depth=Math.max(1+a.depth,n.depth),n}}}var sa=class extends To{constructor(e){super(e)}getUpdateOptions(e,t){const{fields:i}=e,[s,r]=i;return us(ds({},t),{series:this.getSeries(s,r),data:this.getData(e,s,r)})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}}}}getSeries(e,t){var i,s;return[{type:this.standaloneChartType,labelKey:ea,sizeKey:null==e?void 0:e.colId,sizeName:null!=(i=null==e?void 0:e.displayName)?i:void 0,colorKey:null==t?void 0:t.colId,colorName:null!=(s=null==t?void 0:t.displayName)?s:void 0}]}getData(e,t,i){var s;const{categories:r,data:n,groupData:o,grouping:a}=e;return a?function(e,t){return ta(ia(e,function(e){var i,s;return null!=(s=null==(i=t(e))?void 0:i.length)?s:0},function(e,i){const s=t(e);return s?s[s.length-1-i]:null}))}(i?n.concat(null!=(s=null==o?void 0:o.map(e=>{const i=ds({},e);return delete i[t.colId],i}))?s:[]):n,e=>{var t,i;return null!=(i=null==(t=e[Ki.GROUP_AUTO_COLUMN_ID])?void 0:t.labels)?i:null}):function(e,t){return ta(ia(e,function(e){return t.length},function(e,i){return null==(s=e[t[i]])?null:String(s);var s}))}(n,r.map(({id:e})=>e))}},ra=class e extends gt.Component{constructor(t){super(e.TEMPLATE),this.params=t}init(){const e=us(ds({},this.params),{chartType:Ts(this.params.chartType),chartThemeName:this.getThemeName()}),t=this.gos.get("enableRtl");this.addCssClass(t?"ag-rtl":"ag-ltr");const i=this.createBean(new _s(e));this.chartController=this.createManagedBean(new rr(i)),this.chartOptionsService=this.createManagedBean(new Yo(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog&&this.addDialog(),this.addMenu(),this.addTitleEditComp(),this.addManagedListener(this.getGui(),"focusin",this.setActiveChartCellRange.bind(this)),this.addManagedListener(this.chartController,rr.EVENT_CHART_MODEL_UPDATE,this.update.bind(this)),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}createChart(){var t;let i;this.chartProxy&&(i=this.chartProxy.destroy({keepChartInstance:!0}));const s=this.chartController.getChartType(),r={chartType:s,chartInstance:i,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>{var e,t;return null!=(t=null==(e=this.chartMenu)?void 0:e.getExtraPaddingDirections())?t:[]},apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:null!=(t=this.params.crossFiltering)&&t,crossFilterCallback:(e,t)=>{this.params.crossFilteringContext.lastSelectedChartId=t?"":this.chartController.getChartId(),t&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(e,t)},parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:e=>this.chartTranslationService.translate(e)};if(this.params.chartOptionsToRestore=void 0,this.chartType=s,this.chartProxy=e.createChartProxy(r),!this.chartProxy)return void console.warn("AG Grid: invalid chart type supplied: ",r.chartType);const n=this.eChart.querySelector("canvas");n&&n.classList.add("ag-charts-canvas"),this.chartController.setChartProxy(this.chartProxy),this.createMenuContext(),this.titleEdit&&this.titleEdit.refreshTitle(this.chartMenuContext)}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new Pr(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new Pr(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}static createChartProxy(e){switch(e.chartType){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new ko(e);case"pie":case"donut":case"doughnut":return new Oo(e);case"area":case"stackedArea":case"normalizedArea":return new Lo(e);case"line":return new No(e);case"scatter":case"bubble":return new Fo(e);case"histogram":return new Vo(e);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new _o(e);case"rangeBar":case"rangeArea":return new Bo(e);case"boxPlot":return new Ho(e);case"treemap":case"sunburst":return new sa(e);case"heatmap":return new Uo(e);case"waterfall":return new jo(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new qo(e);default:throw`AG Grid: Unable to create chart as an invalid chartType = '${e.chartType}' was supplied.`}}addDialog(){const e=this.chartTranslationService.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:i}=this.getBestDialogSize();this.chartDialog=new gt.AgDialog({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:i,component:this,centered:!0,closable:!0}),this.getContext().createBean(this.chartDialog),this.chartDialog.addEventListener(gt.AgDialog.EVENT_DESTROYED,()=>{this.destroy(),this.chartMenuService.hideAdvancedSettings()})}getBestDialogSize(){const e=this.popupService.getPopupParent(),t=.75*gt._.getAbsoluteWidth(e),i=.75*gt._.getAbsoluteHeight(e),s=this.chartProxy.getChart();let r=this.params.insideDialog?850:s.width,n=this.params.insideDialog?470:s.height;return(r>t||n>i)&&(r=Math.min(r,t),n=Math.round(.553*r),n>i&&(n=i,r=Math.min(r,Math.round(n/.553)))),{width:r,height:n}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new xo(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}addTitleEditComp(){this.titleEdit=this.createBean(new Mo(this.chartMenu)),this.eTitleEditContainer.appendChild(this.titleEdit.getGui()),this.chartProxy&&this.titleEdit.refreshTitle(this.chartMenuContext)}update(e){if((null==e?void 0:e.chartId)&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),i=t||this.chartEmpty?(e=>{const t=this.chartType,i=e,s=this.chartProxy.getChart(),r=null==s?void 0:s.getOptions(),n=null==s?void 0:s.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(r,n,t,null!=i?i:t)})(t):void 0;t&&this.createChart();const s=i&&(null==e?void 0:e.chartThemeOverrides)?Us(i,e.chartThemeOverrides):i||(null==e?void 0:e.chartThemeOverrides);this.updateChart(s),(null==e?void 0:e.chartId)&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,i=this.chartController.getSelectedValueColState(),s=this.chartController.getChartData(),r=this.handleEmptyChart(s,i.length);if(this.chartEmpty=r,r)return void(e&&this.chartController.updateThemeOverrides(e));let n=this.chartController.getChartUpdateParams(e);t.update(n),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()}),this.titleEdit.refreshTitle(this.chartMenuContext)}chartTypeChanged(e){const[t,i]=[this.chartController.getChartType(),null==e?void 0:e.chartType],s=i?Ts(i):void 0;return this.chartType!==t?null!=s?s:t:s&&t!==s?s:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const i=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),s=this.chartController.getChartType();let r=1;this.chartController.isActiveXYChart()?r="bubble"===s?3:2:As(Is(s))&&(r=0);const n=t<r||0===e.length;if(this.eChart){const e=i||n;gt._.setDisplayed(this.eChart,!e),gt._.setDisplayed(this.eEmpty,e)}return i?(this.eEmpty.innerText=this.chartTranslationService.translate("pivotChartRequiresPivotMode"),!0):!!n&&(this.eEmpty.innerText=this.chartTranslationService.translate("noDataToChart"),!0)}downloadChart(e,t,i){this.chartProxy.downloadChart(e,t,i)}openChartToolPanel(e){const t=e?Qo[e]:e;this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||(this.chartController.setChartRange(!0),this.focusService.clearFocusedCell())}getThemeName(){const e=this.gos.get("chartThemes")||ir;if(0===e.length)throw new Error("Cannot create chart: no chart themes available.");const{chartThemeName:t}=this.params;return gt._.includes(e,t)?t:e[0]}getAllKeysInObjects(e){const t={};return e.filter(e=>null!=e).forEach(e=>{Object.keys(e).forEach(e=>t[e]=null)}),Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");t&&this.getAllKeysInObjects([t]).forEach(t=>{gt._.includes(e,t)||console.warn("AG Grid: a custom chart theme with the name '"+t+"' has been supplied but not added to the 'chartThemes' list")})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,i=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:i})}raiseChartCreatedEvent(){const e={type:gt.Events.EVENT_CHART_CREATED,chartId:this.chartController.getChartId()};this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventService.dispatchEvent(e)})}raiseChartDestroyedEvent(){const e={type:gt.Events.EVENT_CHART_DESTROYED,chartId:this.chartController.getChartId()};this.eventService.dispatchEvent(e)}destroy(){var e;super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.destroyBean(this.titleEdit),this.chartDialog&&this.chartDialog.isAlive()&&this.destroyBean(this.chartDialog),null==(e=this.onDestroyColorSchemeChangeListener)||e.call(this);const t=this.getGui();gt._.clearElement(t),gt._.removeFromParent(t),this.raiseChartDestroyedEvent()}};ra.TEMPLATE='<div class="ag-chart" tabindex="-1">\n            <div ref="eChartContainer" tabindex="-1" class="ag-chart-components-wrapper">\n                <div ref="eChart" class="ag-chart-canvas-wrapper"></div>\n                <div ref="eEmpty" class="ag-chart-empty-text ag-unselectable"></div>\n            </div>\n            <div ref="eTitleEditContainer"></div>\n            <div ref="eMenuContainer" class="ag-chart-docked-container" style="min-width: 0px;"></div>\n        </div>',gs([(0,gt.RefSelector)("eChart")],ra.prototype,"eChart",2),gs([(0,gt.RefSelector)("eChartContainer")],ra.prototype,"eChartContainer",2),gs([(0,gt.RefSelector)("eMenuContainer")],ra.prototype,"eMenuContainer",2),gs([(0,gt.RefSelector)("eEmpty")],ra.prototype,"eEmpty",2),gs([(0,gt.RefSelector)("eTitleEditContainer")],ra.prototype,"eTitleEditContainer",2),gs([(0,gt.Autowired)("chartCrossFilterService")],ra.prototype,"crossFilterService",2),gs([(0,gt.Autowired)("chartTranslationService")],ra.prototype,"chartTranslationService",2),gs([(0,gt.Autowired)("chartMenuService")],ra.prototype,"chartMenuService",2),gs([(0,gt.Autowired)("focusService")],ra.prototype,"focusService",2),gs([(0,gt.Autowired)("popupService")],ra.prototype,"popupService",2),gs([gt.PostConstruct],ra.prototype,"init",1);var na=ra,oa="31.3.4";function aa(e){return e=Ta("chartOptions.legend.item.marker.type","shape",e),e=Ta("chartOptions.seriesDefaults.marker.type","shape",e),Ta("chartOptions.legend.padding","spacing",e)}function la(e){var t;const i=e=Da("chartOptions.seriesDefaults.marker.minSize",e),{chartType:s,chartPalette:r,chartOptions:n}=i,o=n,{xAxis:a,yAxis:l}=o,c=ps(o,["xAxis","yAxis"]),h=ps(i,["chartType","chartPalette","chartOptions"]),d=function(e){switch(e){case"bar":case"stackedBar":case"normalizedBar":return["number","category"];case"groupedBar":return["number","grouped-category"];case"column":case"stackedColumn":case"normalizedColumn":case"line":case"area":case"stackedArea":case"normalizedArea":case"histogram":return["category","number"];case"groupedColumn":return["grouped-category","number"];case"scatter":case"bubble":return["number","number"];default:return}}(s),u=null==d?void 0:d.map((e,t)=>ds({type:e},0===t?a:l));return ds({chartType:s,chartThemeName:null!=(t={borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[r])?t:"ag-default",chartOptions:us(ds({},c),{axes:u,xAxis:a,yAxis:l})},h)}function ca(e){return Ta("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e)}function ha(e){return e=Da("chart",e=Ra("chartOptions.seriesDefaults.highlightStyle",e,e=>{var t=e,{dimOpacity:i}=t,s=ps(t,["dimOpacity"]);return ds(ds({},s),null!=i?{series:{dimOpacity:i}}:{})})),e=Da("chartOptions.seriesDefaults.tooltipClass",e),e=wa("chartOptions.axes[].label.rotation",0,e=Da("chartOptions.seriesDefaults.tooltipTracking",e)),wa("chartOptions.axes[].label.rotation",335,e)}function da(e){const t=e=>{var t=e,{item:i,series:s}=t,r=ps(t,["item","series"]);return ds({item:ds(ds({},r),i)},s?{series:s}:{})};return e=Ra("chartOptions.seriesDefaults.highlightStyle",e,t),Ra("chartOptions.series[].highlightStyle",e,t)}function ua(e){e=Ma("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=Ma("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=Da("chartOptions.seriesDefaults.fill",e=Ma("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e)),e=Da("chartOptions.seriesDefaults.stroke",e),e=Da("chartOptions.seriesDefaults.callout.colors",e),e=Da("chartOptions.xAxis",e);const t=e=Da("chartOptions.yAxis",e),{chartType:i,chartOptions:s}=t,r=s,{axes:n,series:o,seriesDefaults:a}=r,l=ps(r,["axes","series","seriesDefaults"]),c=ps(t,["chartType","chartOptions"]),h=Ts(i),d=Is(h),u=[d],p={};if(!Rs(d)){const e={top:{},bottom:{},left:{},right:{}},t=n.map(t=>{var i=t,{type:s}=i,r=ps(i,["type"]);return{[s]:ds(ds({},e),r)}}).reduce(Pa,{});Os.filter(e=>null==t[e]).forEach(i=>{t[i]=ds({},e)}),p.axes=t}const g=u.map(e=>({[e]:ds(us(ds({},p),{series:a}),l)})).reduce(Pa,{});return us(ds({},c),{chartType:h,chartOptions:g})}function pa(e){return e=Da("chartOptions.*.title.padding",e),e=Da("chartOptions.*.subtitle.padding",e),xa("chartOptions.*.axes.*.title.enabled",!1,e=Da("chartOptions.*.axes.*.title.padding",e))}function ga(e){return e=Ta("chartOptions.pie.series.callout","calloutLine",e),e=Ta("chartOptions.pie.series.label","calloutLabel",e),e=Ta("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=Ta("chartOptions.pie.series.labelName","sectorLabelName",e),e=Ta("chartOptions.donut.series.callout","calloutLine",e),e=Ta("chartOptions.donut.series.label","calloutLabel",e),e=Ta("chartOptions.donut.series.labelKey","sectorLabelKey",e),Ta("chartOptions.donut.series.labelName","sectorLabelName",e)}function ma(e){return e=Aa("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=Aa("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=Aa("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=Aa("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),Ma("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e=Aa("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e))}function fa(e){return Da("chartOptions.axes[].tick.count",e)}function ya(e){return Ra("chartOptions.*.tooltip",e,e=>{var t=e,{tracking:i}=t,s=ps(t,["tracking"]);const r=ds({},s);return!1===i?(null!=r.position||(r.position={type:"pointer"}),null!=r.range||(r.range="nearest")):!0===i&&(null!=r.position||(r.position={type:"node"}),null!=r.range||(r.range="nearest")),r})}function va(e){return e=Ta("chartOptions.pie.series.labelKey","sectorLabelKey",e),xa("chartOptions.common.legend.position","right",e=Ea("chartOptions.common.legend.enabled",!0,e=Da("chartOptions.*.series.flipXY",e=ya(e=fa(e=Ta("chartOptions.pie.series.labelName","sectorLabelName",e))))))}function Ca(e){const t=Ta("chartOptions.column","bar",e),i={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"}[t.chartThemeName]||t.chartThemeName;return us(ds({},t),{chartThemeName:i})}function ba(e,t,i){if(Sa(e)>Sa(t.version)){const s=i(t);return s.version=e,s}return t}function Sa(e){const{major:t,minor:i,patch:s}=function(e){const t="string"==typeof e?e.split(".").map(e=>Number(e)):[];if(3!==t.length||t.some(e=>isNaN(e)))throw new Error("AG Grid - Illegal version string: "+e);return{major:t[0],minor:t[1],patch:t[2]}}(e);return 1e4*t+100*i+s}function wa(e,t,i){return Ia(e,!0,i,(e,i)=>{e[i]===t&&delete e[i]})}function xa(e,t,i){return Ia(e,!1,i,(e,i)=>{null==e[i]&&(e[i]=t)})}function Ea(e,t,i){var s;"string"==typeof e&&(e=e.split("."));const r=e[0];return e.length>1&&(i[r]=Ea(e.slice(1),t,null!=(s=i[r])?s:{})),Object.keys(i).includes(r)||(i[r]=t),i}function Ma(e,t,i){let s,r=!1;return i=Ia(e,!0,i,(e,t)=>{r=!0,s=e[t],delete e[t]}),r?Ia(t,!1,i,(e,t)=>{e[t]=s}):i}function Aa(e,t,i){let s,r=!1;return i=Ia(e,!0,i,(e,t)=>{r=!0,s=e[t],delete e[t]}),r?Ia(t,!1,i,(e,t)=>{void 0===e[t]&&(e[t]=s)}):i}function Ta(e,t,i){return Ia(e,!0,i,(e,i)=>{e[t]=e[i],delete e[i]})}function Da(e,t){return Ia(e,!0,t,(e,t)=>delete e[t])}function Ia(e,t,i,s){const r=e instanceof Array?e:e.split("."),n=r.slice(0,r.length-1),o=r[r.length-1];return Ra(n,i,e=>{const i=Object.keys(e).includes(o);if(t&&!i)return e;const r=ds({},e);return s(r,o),r})}function Ra(e,t,i){const s=e instanceof Array?e:e.split(".");if(t=ds({},t),0===s.length)return i(t);if(s[0].startsWith("{")){const e=s[0].substring(1,s[0].lastIndexOf("}")).split(",");for(const r of e)null!=t[r]&&(t[r]=Ra(s.slice(1),t[r],i))}else if(s[0].endsWith("[]")){const r=s[0].substring(0,e[0].indexOf("["));t[r]instanceof Array&&(t[r]=t[r].map(e=>Ra(s.slice(1),e,i)))}else if("*"===s[0])for(const e in t)t[e]=Ra(s.slice(1),t[e],i);else null!=t[s[0]]&&(t[s[0]]=Ra(s.slice(1),t[s[0]],i));return t}var Pa=(e,t)=>ds(ds({},e),t),ka=class extends ut.BeanStub{constructor(){super(...arguments),this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>pt._ModuleSupport.enterpriseModule.isEnterprise}updateChart(e){if(0===this.activeChartComps.size)return void console.warn("AG Grid - No active charts to update.");const t=[...this.activeChartComps].find(t=>t.getChartId()===e.chartId);t?t.update(e):console.warn(`AG Grid - Unable to update chart. No active chart found with ID: ${e.chartId}.`)}getChartModels(){const e=[];return this.activeChartComps.forEach(t=>e.push((e=>us(ds({},e),{version:oa}))(t.getChartModel()))),e}getChartRef(e){let t;return this.activeCharts.forEach(i=>{i.chartId===e&&(t=i)}),t}getChartComp(e){let t;return this.activeChartComps.forEach(i=>{i.getChartId()===e&&(t=i)}),t}getChartImageDataURL(e){let t;return this.activeChartComps.forEach(i=>{i.getChartId()===e.chartId&&(t=i.getChartImageDataURL(e.fileFormat))}),t}downloadChart(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId);null==t||t.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId);null==t||t.openChartToolPanel(e.panel)}closeChartToolPanel(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e);null==t||t.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn"){const t=this.getSelectedRange();return this.createChart({cellRange:t,chartType:e})}restoreChart(e,t){if(!e)return void console.warn("AG Grid - unable to restore chart as no chart model is provided");let i,s,r,n;return e.version!==oa&&(e=function(e){return e.version,null==e.version&&(e.version=function(e){var t,i;const s=e;if(null!=e.version)return e.version;const r=(e,...t)=>Object.keys(e||{}).some(e=>t.includes(e)),n=s.chartOptions,o=r(n,"seriesDefaults")?null==n?void 0:n.seriesDefaults:null==n?void 0:n[Object.keys(n)[0]],a={"27.0.0":r(s,"seriesChartTypes"),"26.2.0":!r(n,"seriesDefaults"),"26.1.0":r(null==o?void 0:o.highlightStyle,"item"),"26.0.0":r(null==o?void 0:o.highlightStyle,"series"),"25.1.0":r(null==o?void 0:o.label,"minAngle"),"25.0.0":r(s,"modelType","aggFunc","unlinkChart","suppressChartRanges")||r(o,"lineDash","lineDashOffset"),"24.0.0":r(s,"chartThemeName","chart")||r(n,"series"),"23.2.0":r(n,"navigator"),"23.0.0":r(null==(i=null==(t=null==n?void 0:n.legend)?void 0:t.item)?void 0:i.marker,"shape"),"22.1.0":r(s,"chartPalette","chartType")},l="27.1.0",c=Object.entries(a).filter(([e,t])=>t),[h=l]=c[0];return h}(e)),e=ba("23.0.0",e,aa),e=ba("24.0.0",e,la),e=ba("25.1.0",e,ca),e=ba("26.0.0",e,ha),e=ba("26.1.0",e,da),e=ba("26.2.0",e,ua),e=ba("28.0.0",e,pa),e=ba("28.2.0",e,ga),e=ba("29.0.0",e,ma),e=ba("29.1.0",e,fa),e=ba("29.2.0",e,ya),e=ba("30.0.0",e,va),e=function(e){return e=Da("chartOptions.*.width",e),xa("chartOptions.*.axes.category.label.autoRotate",!0,e=Da("chartOptions.*.height",e))}(e=ba("31.0.0",e,Ca)),ba(oa,e,e=>e)}(e)),"pivot"===e.modelType?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),i=this.createCellRange(void 0,!0),s=!0,r=!0):(i=this.createCellRange(e.cellRange),n=e.chartPalette),i?this.createChart(us(ds({},e),{cellRange:i,pivotChart:s,suppressChartRanges:r,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:n})):void 0}createRangeChart(e){const t=this.createCellRange(e.cellRange);if(t)return this.createChart(us(ds({},e),{cellRange:t}))}createPivotChart(e){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const t=this.createCellRange(void 0,!0);if(t)return this.createChart(us(ds({},e),{cellRange:t,pivotChart:!0,suppressChartRanges:!0}))}createCrossFilterChart(e){const t=this.createCellRange(e.cellRange);if(!t)return;const i=!(void 0!==e.suppressChartRanges&&null!==e.suppressChartRanges)||e.suppressChartRanges;return this.createChart(us(ds({},e),{cellRange:t,suppressChartRanges:i,crossFiltering:!0}))}createChart(e){const t=tr.validateCreateParams(e);if(!t)return;e=!0===t?e:t;const{chartType:i,chartContainer:s}=e,r=this.gos.getCallback("createChartContainer"),n=us(ds({},e),{chartId:this.generateId(),chartType:Ts(i),insideDialog:!(s||r),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>this.activeChartComps.forEach(e=>e.crossFilteringReset())}),o=new na(n);this.context.createBean(o);const a=this.createChartRef(o);if(s){s.appendChild(o.getGui());const e=this.environment.getTheme();e.el&&!e.el.contains(s)&&s.classList.add(e.theme)}else r?r(a):o.addEventListener(na.EVENT_DESTROYED,()=>{this.activeChartComps.delete(o),this.activeCharts.delete(a)});return a}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.context.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){var e,t;const i=null!=(t=null==(e=this.rangeService)?void 0:e.getCellRanges())?t:[];return i.length>0?i[0]:{columns:[]}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){var i;const s=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.columnModel.getAllDisplayedColumns().map(e=>e.getColId())}:e,r=s&&(null==(i=this.rangeService)?void 0:i.createPartialCellRangeFromRangeParams(s,!0));return r||console.warn(`AG Grid - unable to create chart as ${t?"there are no columns in the grid":"no range is selected"}.`),r}destroyAllActiveCharts(){this.activeCharts.forEach(e=>e.destroyChart())}};ka.CHARTS_VERSION=pt.VERSION,gs([(0,ut.Autowired)("columnModel")],ka.prototype,"columnModel",2),gs([(0,ut.Optional)("rangeService")],ka.prototype,"rangeService",2),gs([ut.PreDestroy],ka.prototype,"destroyAllActiveCharts",1),ka=gs([(0,ut.Bean)("chartService")],ka);var La=class extends $i.BeanStub{translate(e){return this.localeService.getLocaleTextFunc()(e,La.DEFAULT_TRANSLATIONS[e])}};La.DEFAULT_TRANSLATIONS={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Data",format:"Format",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",orientation:"Orientation",polygon:"Polygon",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chart:"Chart",title:"Title",titlePlaceholder:"Chart title - double click to edit",background:"Background",font:"Font",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",heatmapTooltip:"Heatmap",waterfallTooltip:"Waterfall",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",group:"Group",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",area:"Area",bar:"Bar",column:"Column",line:"Line",scatter:"Scatter",histogram:"Histogram",radialColumn:"Radial Column",radialBar:"Radial Bar",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",boxPlot:"Box Plot",pie:"Pie",donut:"Donut",stackedArea:"StackedArea",groupedColumn:"Grouped Column",stackedColumn:"Stacked Column",advancedSettings:"Advanced Settings",ariaChartMenuClose:"Close Chart Edit Menu",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked"},La=gs([(0,$i.Bean)("chartTranslationService")],La);var Na=class extends Yi.BeanStub{filter(e,t=!1){const i=this.gridApi.getFilterModel();if(t)return void this.resetFilters(i);let s=Na.extractFilterColId(e);this.isValidColumnFilter(s)?this.updateFilters(i,e,s):console.warn("AG Grid: cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: '"+s+"'")}resetFilters(e){Object.keys(e).length>0&&(this.gridApi.setFilterModel(null),this.gridApi.onFilterChanged())}updateFilters(e,t,i){let s=Na.extractFilterColId(t),r=t.datum[s];if(void 0===r)return;let n=r.toString();if(t.event.metaKey||t.event.ctrlKey){const t=this.getCurrentGridValuesForCategory(i);let s;Yi._.includes(t,n)?s=t.filter(e=>e!==n):(s=t,s.push(n)),e[i]=this.getUpdatedFilterModel(i,s)}else{const t=[n];e={[i]:this.getUpdatedFilterModel(i,t)}}this.gridApi.setFilterModel(e)}getUpdatedFilterModel(e,t){return"agMultiColumnFilter"===this.getColumnFilterType(e)?{filterType:"multi",filterModels:[null,{filterType:"set",values:t}]}:{filterType:"set",values:t}}getCurrentGridValuesForCategory(e){let t=[];const i=this.getColumnById(e);return this.gridApi.forEachNodeAfterFilter(e=>{if(i&&!e.group){const s=this.valueService.getValue(i,e)+"";t.includes(s)||t.push(s)}}),t}static extractFilterColId(e){return e.xKey||e.calloutLabelKey}isValidColumnFilter(e){e.indexOf("-filtered-out")&&(e=e.replace("-filtered-out",""));let t=this.getColumnFilterType(e);return"boolean"==typeof t?t:Yi._.includes(["agSetColumnFilter","agMultiColumnFilter"],t)}getColumnFilterType(e){let t=this.getColumnById(e);if(t)return t.getColDef().filter}getColumnById(e){return this.columnModel.getGridColumn(e)}};function _a(e){return e&&e.match(/\d+\.\d+\.\d+/)}function Oa({type:e,gridVersion:t,chartsVersion:i}){const s="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return s;const r=function(e){if(!e||!_a(e))return;const[t,i]=e.split(".")||[],s=`${t}.${i}.x`,r=parseInt(t,10)-28+6;return r<0?void 0:{gridMajorMinor:s,chartsMajorMinor:`${r}.${i}.x`}}(t);if(!r)return s;const{gridMajorMinor:n,chartsMajorMinor:o}=r;return"incompatible"===e?`AG Grid version ${t} and AG Charts version ${i} is not supported. AG Grid version ${n} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:"invalidCharts"===e?`AG Grid version ${n} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:s}gs([(0,Yi.Autowired)("gridApi")],Na.prototype,"gridApi",2),gs([(0,Yi.Autowired)("columnModel")],Na.prototype,"columnModel",2),gs([(0,Yi.Autowired)("valueService")],Na.prototype,"valueService",2),Na=gs([(0,Yi.Bean)("chartCrossFilterService")],Na);var Fa=class extends qi.BeanStub{showMenuList(e){const{eventSource:t,showMenu:i,chartMenuContext:s}=e,r=this.chartMenuService.doChartToolPanelsExist(s.chartController),n=this.mapWithStockItems(this.getMenuItems(s.chartController,r),s,i,t,r);if(!n.length)return;const o=this.createBean(new Ga(n));this.activeChartMenuList=o;let a=-1,l="left";this.gos.get("enableRtl")&&(a=1,l="right");const c=o.getGui();this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:()=>{this.destroyBean(o),this.activeChartMenuList=void 0;const e=this.gos.getDocument(),i=this.gos.getActiveDomElement();i&&i!==e.body||t.focus({preventScroll:!0})},afterGuiAttached:e=>o.afterGuiAttached(e),positionCallback:()=>{this.popupService.positionPopupByComponent({type:"chartMenu",eventSource:t,ePopup:c,alignSide:l,nudgeX:4*a,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(e,t){const i=[...t?["chartEdit"]:[],...e.isEnterprise()?["chartAdvancedSettings"]:[],e.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],s=this.gos.get("chartMenuItems");return s?Array.isArray(s)?s:s(this.gos.addGridCommonParams({defaultItems:i})):i}mapWithStockItems(e,t,i,s,r){if(!e)return[];const n=[];return e.forEach(e=>{let o;if(o="string"==typeof e?this.getStockMenuItem(e,t,i,s,r):ds({},e),!o)return;const{subMenu:a}=o;Array.isArray(a)&&(o.subMenu=this.mapWithStockItems(a,t,i,s,r)),n.push(o)}),n}getStockMenuItem(e,t,i,s,r){switch(e){case"chartEdit":return r?this.createMenuItem(this.chartTranslationService.translate("chartEdit"),"chartsMenuEdit",i):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslationService.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuService.openAdvancedSettings(t,s));case"chartUnlink":return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslationService.translate("chartUnlink"),"unlinked",()=>this.chartMenuService.toggleLinked(t)):null;case"chartLink":return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslationService.translate("chartLink"),"linked",()=>this.chartMenuService.toggleLinked(t));case"chartDownload":return this.createMenuItem(this.chartTranslationService.translate("chartDownload"),"save",()=>this.chartMenuService.downloadChart(t))}return null}createMenuItem(e,t,i){return{name:e,icon:qi._.createIconNoSpan(t,this.gos,null),action:i}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}};gs([(0,qi.Autowired)("popupService")],Fa.prototype,"popupService",2),gs([(0,qi.Autowired)("chartMenuService")],Fa.prototype,"chartMenuService",2),gs([(0,qi.Autowired)("chartTranslationService")],Fa.prototype,"chartTranslationService",2),Fa=gs([(0,qi.Bean)("chartMenuListFactory")],Fa);var Ga=class extends qi.Component{constructor(e){super('\n            <div ref="eChartsMenu" role="presentation" class="ag-menu ag-chart-menu-popup"></div>\n        '),this.menuItems=e}init(){this.mainMenuList=this.createManagedBean(new qi.AgMenuList(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener(qi.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){var e;null==(e=this.hidePopupFunc)||e.call(this)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};gs([(0,qi.Autowired)("focusService")],Ga.prototype,"focusService",2),gs([(0,qi.RefSelector)("eChartsMenu")],Ga.prototype,"eChartsMenu",2),gs([qi.PostConstruct],Ga.prototype,"init",1);var Ba=class e extends Qi.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(e.TEMPLATE,{animationGroup:t,animationHeightInput:i})}};Ba.TEMPLATE='<div>\n            <ag-group-component ref="animationGroup">\n                <ag-input-number-field ref="animationHeightInput"></ag-input>\n            </ag-group-component>\n        </div>',gs([(0,Qi.Autowired)("chartTranslationService")],Ba.prototype,"chartTranslationService",2),gs([Qi.PostConstruct],Ba.prototype,"init",1);var Va=Ba,Ha=class e extends Ji.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),s=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),r=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(e.TEMPLATE,{crosshairGroup:t,crosshairLabelCheckbox:i,crosshairSnapCheckbox:s,crosshairStrokeColorPicker:r})}};Ha.TEMPLATE='<div>\n            <ag-group-component ref="crosshairGroup">\n                <ag-checkbox ref="crosshairLabelCheckbox"></ag-checkbox>\n                <ag-checkbox ref="crosshairSnapCheckbox"></ag-checkbox>\n                <ag-color-picker ref="crosshairStrokeColorPicker"></ag-color-picker>\n            </ag-group-component>\n        </div>',gs([(0,Ji.Autowired)("chartTranslationService")],Ha.prototype,"chartTranslationService",2),gs([Ji.PostConstruct],Ha.prototype,"init",1);var Ua=Ha,za=class e extends es.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);i.minValue=10;const s=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(e.TEMPLATE,{navigatorGroup:t,navigatorHeightSlider:i,navigatorMiniChartCheckbox:s})}};za.TEMPLATE='<div>\n            <ag-group-component ref="navigatorGroup">\n                <ag-slider ref="navigatorHeightSlider"></ag-slider>\n                <ag-checkbox ref="navigatorMiniChartCheckbox"></ag-checkbox>\n            </ag-group-component>\n        </div>',gs([(0,es.Autowired)("chartTranslationService")],za.prototype,"chartTranslationService",2),gs([es.PostConstruct],za.prototype,"init",1);var Wa=za,ja=class e extends ts.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),s=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);s.step=.01,s.minValue=s.step;const r=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");i.onValueChange=(e=>t=>{e&&(e(t),this.zoomScrollingStepInput.setDisabled(!t))})(i.onValueChange),this.setTemplate(e.TEMPLATE,{zoomGroup:t,zoomScrollingCheckbox:i,zoomScrollingStepInput:s,zoomSelectingCheckbox:r}),this.zoomScrollingStepInput.setDisabled(!i.value)}};ja.TEMPLATE='<div>\n            <ag-group-component ref="zoomGroup">\n                <ag-checkbox ref="zoomSelectingCheckbox"></ag-checkbox>\n                <ag-checkbox ref="zoomScrollingCheckbox"></ag-checkbox>\n                <ag-slider ref="zoomScrollingStepInput"></ag-slider>\n            </ag-group-component>\n        </div>',gs([(0,ts.Autowired)("chartTranslationService")],ja.prototype,"chartTranslationService",2),gs([(0,ts.RefSelector)("zoomScrollingStepInput")],ja.prototype,"zoomScrollingStepInput",2),gs([ts.PostConstruct],ja.prototype,"init",1);var Ka=ja,$a=["navigator","zoom","animation","crosshair"],Ya=class e extends Zi.Component{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}postConstruct(){this.chartPanelFeature=this.createManagedBean(new gn(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){$a.forEach(e=>{if(!this.isGroupPanelShownForSeries(e,t))return;const i=this.createPanel(e);this.chartPanelFeature.addComponent(i)})}isGroupPanelShownForSeries(e,t){return"animation"===e||Es(t)}createPanel(e){const{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:i}=this.chartMenuContext;switch(e){case"navigator":return new Wa(t);case"zoom":return new Ka(t);case"animation":return new Va(t);case"crosshair":return new Ua(i)}}};Ya.TEMPLATE='<div class="ag-chart-advanced-settings-wrapper"></div>',gs([Zi.PostConstruct],Ya.prototype,"postConstruct",1);var qa=Ya,Xa=class extends Xi.BeanStub{showMenu(e,t){this.hideMenu();const i=this.createBean(new Qa(e));this.activeDialog=this.createBean(new Xi.AgDialog({title:this.chartTranslationService.translate("advancedSettings"),component:i,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var e;null==(e=this.focusService.findFocusableElements(i.getGui())[0])||e.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,null==t||t.focus({preventScroll:!0})}})),this.activeMenu=i}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}};gs([(0,Xi.Autowired)("focusService")],Xa.prototype,"focusService",2),gs([(0,Xi.Autowired)("chartTranslationService")],Xa.prototype,"chartTranslationService",2),Xa=gs([(0,Xi.Bean)("advancedSettingsMenuFactory")],Xa);var Za=class e extends Xi.TabGuardComp{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new qa(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(e){if(e.defaultPrevented)return;e.preventDefault();const t=e.shiftKey,i=this.advancedSettingsPanel.getGui(),s=this.focusService.findNextFocusableElement(i,!1,t);if(s)s.focus();else{const e=this.focusService.findFocusableElements(i);e.length&&e[t?e.length-1:0].focus()}}};Za.TEMPLATE='<div class="ag-chart-advanced-settings"></div>',gs([(0,Xi.Autowired)("focusService")],Za.prototype,"focusService",2),gs([Xi.PostConstruct],Za.prototype,"postConstruct",1);var Qa=Za,Ja={version:oa,validate:()=>function({gridVersion:e,chartsVersion:t}){if(!_a(t))return{isValid:!1,message:Oa({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!_a(e))return{isValid:!1,message:Oa({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[i,s]=e.split(".")||[],[r,n,o]=t.split(".")||[],a=function({gridMajorVersion:e,chartsMajorVersion:t}){const i=parseInt(e,10)-28;return i===parseInt(t,10)-6&&i>=0}({gridMajorVersion:i,chartsMajorVersion:r});return a&&s===n||o.includes("beta")?{isValid:!0}:a&&s===n?{isValid:!1,message:Oa({type:"invalid",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:Oa({type:"incompatible",gridVersion:e,chartsVersion:t})}}({gridVersion:oa,chartsVersion:ka.CHARTS_VERSION}),moduleName:Be.ModuleNames.GridChartsModule,beans:[ka,La,Na,Fa,Jo,Xa],agStackComponents:[{componentName:"AgColorPicker",componentClass:Xr},{componentName:"AgAngleSelect",componentClass:Rr},{componentName:"AgPillSelect",componentClass:or}],dependantModules:[dt,D]},el=0,tl={time:is.time,AgChart:is.AgChart},il=i(98092),sl=i(98092),rl=i(98092),nl=Object.defineProperty,ol=Object.getOwnPropertyDescriptor,al=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?ol(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&nl(t,i,n),n},ll="paste",cl="dragCopy",hl="clipboard",dl=e=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,ul=class extends rl.BeanStub{constructor(){super(...arguments),this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}init(){this.logger=this.loggerFactory.create("ClipboardService"),"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}pasteFromClipboard(){this.logger.log("pasteFromClipboard"),!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(e=>{rl._.doOnce(()=>{console.warn(e),console.warn(dl("readText"))},"clipboardApiError"),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=t=>{const i=(new Date).getTime();i-this.lastPasteOperationTime<50&&(e=!0,t.preventDefault()),this.lastPasteOperationTime=i};this.executeOnTempElement(e=>{e.addEventListener("paste",t),e.focus({preventScroll:!0})},i=>{const s=i.value;e?this.refocusLastFocusedCell():this.processClipboardData(s),i.removeEventListener("paste",t)})}refocusLastFocusedCell(){const e=this.focusService.getFocusedCell();e&&this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return rl._.exists(e)?e:"\t"}processClipboardData(e){if(null==e)return;let t=ul.stringToArray(e,this.getClipboardDelimiter());const i=this.gos.getCallback("processDataFromClipboard");i&&(t=i({data:t})),null!=t&&(this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t),this.doPasteOperation((e,i,s,r)=>{var n;(null==(n=this.rangeService)?void 0:n.isMoreThanOneCell())&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(this.rangeService,t,e,i,r):this.pasteStartingFromFocusedCell(t,e,i,s,r)}))}static stringToArray(e,t=","){const i=[],s=e=>"\r"===e||"\n"===e;let r=!1;if(""===e)return[[""]];for(let n=0,o=0,a=0;a<e.length;a++){const l=e[a-1],c=e[a],h=e[a+1],d=()=>{i[n]||(i[n]=[]),i[n][o]||(i[n][o]="")};if(d(),'"'===c&&(r?'"'===h?(i[n][o]+='"',a++):r=!1:(void 0===l||l===t||s(l))&&(r=!0)),!r&&'"'!==c){if(c===t){o++,d();continue}if(s(c)){o=0,n++,d(),"\r"===c&&"\n"===h&&a++;continue}}i[n][o]+=c}return i}doPasteOperation(e){const t="clipboard";let i;if(this.eventService.dispatchEvent({type:rl.Events.EVENT_PASTE_START,source:t}),this.clientSideRowModel){const e=this.gos.get("aggregateOnlyChangedColumns");i=new rl.ChangedPath(e,this.clientSideRowModel.getRootNode())}const s={},r=[];e(s,r,this.focusService.getFocusedCell(),i);const n=[...r];i&&(this.clientSideRowModel.doAggregate(i),i.forEachChangedNodeDepthFirst(e=>{n.push(e)})),this.rowRenderer.refreshCells({rowNodes:n}),this.dispatchFlashCells(s),this.fireRowChanged(r),this.refocusLastFocusedCell();const o={type:rl.Events.EVENT_PASTE_END,source:t};this.eventService.dispatchEvent(o)}pasteIntoActiveRange(e,t,i,s,r){const n=this.getRangeSize(e)%t.length!=0;let o=0,a=0;this.iterateActiveRanges(!1,(e,l,c,h)=>{if(h-o>=t.length){if(n)return;o+=a,a=0}const d=t[h-o];s.push(l);const u=this.gos.getCallback("processCellFromClipboard");c.forEach((t,s)=>{if(!t.isCellEditable(l)||t.isSuppressPaste(l))return;s>=d.length&&(s%=d.length);const n=this.processCell(l,t,d[s],cl,u,!0);l.setDataValue(t,n,ll),r&&r.addParentNode(l.parent,[t]);const{rowIndex:o,rowPinned:a}=e,c=this.cellPositionUtils.createIdFromValues({rowIndex:o,column:t,rowPinned:a});i[c]=!0}),a++})}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;null!=t;)i.push(t),t=this.columnModel.getDisplayedColAfter(t);return i}pasteStartingFromFocusedCell(e,t,i,s,r){if(!s)return;const n={rowIndex:s.rowIndex,rowPinned:s.rowPinned},o=this.getDisplayedColumnsStartingAt(s.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,i,t,r):this.pasteMultipleValues(e,n,i,o,t,hl,r)}isPasteSingleValueIntoRange(e){return this.hasOnlyOneValueToPaste(e)&&null!=this.rangeService&&!this.rangeService.isEmpty()}pasteSingleValueIntoRange(e,t,i,s){const r=e[0][0];this.iterateActiveRanges(!1,(e,n,o)=>{t.push(n),o.forEach(e=>this.updateCellValue(n,e,r,i,hl,s))})}hasOnlyOneValueToPaste(e){return 1===e.length&&1===e[0].length}copyRangeDown(){if(!this.rangeService||this.rangeService.isEmpty())return;const e=[];this.doPasteOperation((t,i,s,r)=>{const n=this.gos.getCallback("processCellForClipboard"),o=this.gos.getCallback("processCellFromClipboard");this.iterateActiveRanges(!0,(s,a,l)=>{e.length?(i.push(a),l.forEach((i,n)=>{if(!i.isCellEditable(a)||i.isSuppressPaste(a))return;const l=this.processCell(a,i,e[n],cl,o,!0);a.setDataValue(i,l,ll),r&&r.addParentNode(a.parent,[i]);const{rowIndex:c,rowPinned:h}=s,d=this.cellPositionUtils.createIdFromValues({rowIndex:c,column:i,rowPinned:h});t[d]=!0})):l.forEach(t=>{const i=this.processCell(a,t,this.valueService.getValue(t,a),cl,n,!1,!0);e.push(i)})})})}removeLastLineIfBlank(e){const t=rl._.last(e);if(t&&1===t.length&&""===t[0]){if(1===e.length)return;rl._.removeFromArray(e,t)}}fireRowChanged(e){"fullRow"===this.gos.get("editType")&&e.forEach(e=>{const t={type:rl.Events.EVENT_ROW_VALUE_CHANGED,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned};this.eventService.dispatchEvent(t)})}pasteMultipleValues(e,t,i,s,r,n,o){let a=t;const l=null!=this.clientSideRowModel&&!this.gos.get("enableGroupEdit")&&!this.gos.get("treeData"),c=()=>{for(;;){if(!a)return null;const e=this.rowPositionUtils.getRowNode(a);if(a=this.cellNavigationService.getRowBelow({rowPinned:a.rowPinned,rowIndex:a.rowIndex}),null==e)return null;if(!(e.detail||e.footer||l&&e.group))return e}};e.forEach(e=>{const t=c();t&&(e.forEach((e,i)=>this.updateCellValue(t,s[i],e,r,n,o)),i.push(t))})}updateCellValue(e,t,i,s,r,n){if(!e||!t||!t.isCellEditable(e)||t.isSuppressPaste(e))return;if(e.group&&t.isValueActive())return;const o=this.processCell(e,t,i,r,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,o,ll);const{rowIndex:a,rowPinned:l}=e;s[this.cellPositionUtils.createIdFromValues({rowIndex:a,column:t,rowPinned:l})]=!0,n&&n.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){if(this.gos.get("suppressCutToClipboard"))return;const i={type:rl.Events.EVENT_CUT_START,source:t};this.eventService.dispatchEvent(i),this.copyOrCutToClipboard(e,!0);const s={type:rl.Events.EVENT_CUT_END,source:t};this.eventService.dispatchEvent(s)}copyOrCutToClipboard(e,t){let{includeHeaders:i,includeGroupHeaders:s}=e;this.logger.log(`copyToClipboard: includeHeaders = ${i}`),null==i&&(i=this.gos.get("copyHeadersToClipboard")),null==s&&(s=this.gos.get("copyGroupHeadersToClipboard"));const r={includeHeaders:i,includeGroupHeaders:s},n=!this.gos.get("suppressCopyRowsToClipboard");let o=null;!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange(this.rangeService)?n&&!this.selectionService.isEmpty()?(this.copySelectedRowsToClipboard(r),o=1):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(r),o=2):(this.copySelectedRangeToClipboard(r),o=0),t&&null!==o&&this.clearCellsAfterCopy(o)}clearCellsAfterCopy(e){if(this.eventService.dispatchEvent({type:rl.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),0===e)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(1===e)this.clearSelectedRows();else{const e=this.focusService.getFocusedCell();if(null==e)return;const t=this.rowPositionUtils.getRowNode(e);t&&this.clearCellValue(t,e.column)}this.eventService.dispatchEvent({type:rl.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}clearSelectedRows(){const e=this.selectionService.getSelectedNodes(),t=this.columnModel.getAllDisplayedColumns();for(const i of e)for(const e of t)this.clearCellValue(i,e)}clearCellValue(e,t){var i;if(!t.isCellEditable(e))return;const s=null!=(i=this.valueService.parseValue(t,e,"",e.getValueFromValueService(t)))?i:null;e.setDataValue(t,s,"clipboardService")}shouldSkipSingleCellRange(e){return this.gos.get("suppressCopySingleCellRanges")&&!e.isMoreThanOneCell()}iterateActiveRanges(e,t,i){if(!this.rangeService||this.rangeService.isEmpty())return;const s=this.rangeService.getCellRanges();e?this.iterateActiveRange(s[0],t,i,!0):s.forEach((e,r)=>this.iterateActiveRange(e,t,i,r===s.length-1))}iterateActiveRange(e,t,i,s){if(!this.rangeService)return;let r=this.rangeService.getRangeStartRow(e);const n=this.rangeService.getRangeEndRow(e);i&&e.columns&&i(e.columns);let o=0,a=!1;for(;!a&&null!=r;){const i=this.rowPositionUtils.getRowNode(r);a=this.rowPositionUtils.sameRow(r,n),t(r,i,e.columns,o++,a&&s),r=this.cellNavigationService.getRowBelow(r)}}copySelectedRangeToClipboard(e={}){if(!this.rangeService||this.rangeService.isEmpty())return;const t=this.rangeService.areAllRangesAbleToMerge(),{data:i,cellsToFlash:s}=t?this.buildDataFromMergedRanges(this.rangeService,e):this.buildDataFromRanges(this.rangeService,e);this.copyDataToClipboard(i),this.dispatchFlashCells(s)}buildDataFromMergedRanges(e,t){const i=new Set,s=e.getCellRanges(),r=new Map,n=[],o={};s.forEach(t=>{t.columns.forEach(e=>i.add(e));const{rowPositions:s,cellsToFlash:a}=this.getRangeRowPositionsAndCellsToFlash(e,t);s.forEach(e=>{const t=`${e.rowIndex}-${e.rowPinned||"null"}`;r.get(t)||(r.set(t,!0),n.push(e))}),Object.assign(o,a)});const a=this.columnModel.getAllDisplayedColumns(),l=Array.from(i);return l.sort((e,t)=>a.indexOf(e)-a.indexOf(t)),{data:this.buildExportParams({columns:l,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:o}}buildDataFromRanges(e,t){const i=e.getCellRanges(),s=[],r={};return i.forEach(i=>{const{rowPositions:n,cellsToFlash:o}=this.getRangeRowPositionsAndCellsToFlash(e,i);Object.assign(r,o),s.push(this.buildExportParams({columns:i.columns,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}),{data:s.join("\n"),cellsToFlash:r}}getRangeRowPositionsAndCellsToFlash(e,t){const i=[],s={},r=e.getRangeStartRow(t),n=e.getRangeEndRow(t);let o=r;for(;o&&(i.push(o),t.columns.forEach(e=>{const{rowIndex:t,rowPinned:i}=o,r=this.cellPositionUtils.createIdFromValues({rowIndex:t,column:e,rowPinned:i});s[r]=!0}),!this.rowPositionUtils.sameRow(o,n));)o=this.cellNavigationService.getRowBelow(o);return{rowPositions:i,cellsToFlash:s}}getCellsToFlashFromRowNodes(e){const t=this.columnModel.getAllDisplayedColumns(),i={};for(let s=0;s<e.length;s++){const{rowIndex:r,rowPinned:n}=e[s];if(null!=r)for(let e=0;e<t.length;e++){const s=t[e];i[this.cellPositionUtils.createIdFromValues({rowIndex:r,column:s,rowPinned:n})]=!0}}return i}copyFocusedCellToClipboard(e={}){const t=this.focusService.getFocusedCell();if(null==t)return;const i=this.cellPositionUtils.createId(t),s={rowPinned:t.rowPinned,rowIndex:t.rowIndex},r=t.column,n=this.buildExportParams({columns:[r],rowPositions:[s],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(n),this.dispatchFlashCells({[i]:!0})}copySelectedRowsToClipboard(e={}){const{columnKeys:t,includeHeaders:i,includeGroupHeaders:s}=e,r=this.buildExportParams({columns:t,includeHeaders:i,includeGroupHeaders:s});this.copyDataToClipboard(r);const n=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(n))}buildExportParams(e){const{columns:t,rowPositions:i,includeHeaders:s=!1,includeGroupHeaders:r=!1}=e,n={columnKeys:t,rowPositions:i,skipColumnHeaders:!s,skipColumnGroupHeaders:!r,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!i,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:e=>this.processRowGroupCallback(e),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(n,!0)}processRowGroupCallback(e){const{node:t,column:i}=e,s=this.gos.get("treeData"),r=this.gos.get("suppressGroupMaintainValueType");let n=(()=>{var e,n;if(s||r||!i)return t.key;const o=null==(e=t.groupData)?void 0:e[i.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(n=this.valueService.formatValue(t.rowGroupColumn,t,o))?n:o})();if(e.node.footer){let e="";n&&n.length&&(e=` ${n}`),n=`Total${e}`}const o=this.gos.getCallback("processCellForClipboard");if(o){let e=t.rowGroupColumn;return!e&&t.footer&&-1===t.level&&(e=this.columnModel.getRowGroupColumns()[0]),o({value:n,node:t,column:e,type:"clipboard",formatValue:i=>{var s;return null!=(s=this.valueService.formatValue(e,t,i))?s:i},parseValue:i=>this.valueService.parseValue(e,t,i,this.valueService.getValue(e,t))})}return n}dispatchFlashCells(e){window.setTimeout(()=>{const t={type:rl.Events.EVENT_FLASH_CELLS,cells:e};this.eventService.dispatchEvent(t)},0)}processCell(e,t,i,s,r,n,o){var a;return r?r({column:t,node:e,value:i,type:s,formatValue:i=>{var s;return null!=(s=this.valueService.formatValue(t,null!=e?e:null,i))?s:i},parseValue:i=>this.valueService.parseValue(t,null!=e?e:null,i,this.valueService.getValue(t,e))}):n&&!1!==t.getColDef().useValueParserForImport?this.valueService.parseValue(t,null!=e?e:null,i,this.valueService.getValue(t,e)):o&&!1!==t.getColDef().useValueFormatterForExport&&null!=(a=this.valueService.formatValue(t,null!=e?e:null,i))?a:i}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");t?t({data:e}):!this.gos.get("suppressClipboardApi")&&navigator.clipboard?navigator.clipboard.writeText(e).catch(t=>{rl._.doOnce(()=>{console.warn(t),console.warn(dl("writeText"))},"clipboardApiError"),this.copyDataToClipboardLegacy(e)}):this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const i=this.gos.getDocument(),s=this.gos.getActiveDomElement();t.value=e||" ",t.select(),t.focus({preventScroll:!0}),i.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=s&&null!=s.focus&&s.focus({preventScroll:!0})})}executeOnTempElement(e,t){const i=this.gos.getDocument(),s=i.createElement("textarea");s.style.width="1px",s.style.height="1px",s.style.top=i.documentElement.scrollTop+"px",s.style.left=i.documentElement.scrollLeft+"px",s.style.position="absolute",s.style.opacity="0";const r=this.gridCtrl.getGui();r.appendChild(s);try{e(s)}catch(e){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout(()=>{t(s),r.removeChild(s)},100):r.removeChild(s)}getRangeSize(e){const t=e.getCellRanges();let i=0,s=0;return t.length>0&&(i=e.getRangeStartRow(t[0]).rowIndex,s=e.getRangeEndRow(t[0]).rowIndex),i-s+1}};al([(0,rl.Autowired)("csvCreator")],ul.prototype,"csvCreator",2),al([(0,rl.Autowired)("loggerFactory")],ul.prototype,"loggerFactory",2),al([(0,rl.Autowired)("selectionService")],ul.prototype,"selectionService",2),al([(0,rl.Autowired)("rowModel")],ul.prototype,"rowModel",2),al([(0,rl.Autowired)("ctrlsService")],ul.prototype,"ctrlsService",2),al([(0,rl.Autowired)("valueService")],ul.prototype,"valueService",2),al([(0,rl.Autowired)("focusService")],ul.prototype,"focusService",2),al([(0,rl.Autowired)("rowRenderer")],ul.prototype,"rowRenderer",2),al([(0,rl.Autowired)("columnModel")],ul.prototype,"columnModel",2),al([(0,rl.Autowired)("cellNavigationService")],ul.prototype,"cellNavigationService",2),al([(0,rl.Autowired)("cellPositionUtils")],ul.prototype,"cellPositionUtils",2),al([(0,rl.Autowired)("rowPositionUtils")],ul.prototype,"rowPositionUtils",2),al([(0,rl.Optional)("rangeService")],ul.prototype,"rangeService",2),al([rl.PostConstruct],ul.prototype,"init",1),ul=al([(0,rl.Bean)("clipboardService")],ul);var pl={version:"31.3.4",moduleName:il.ModuleNames.ClipboardModule,beans:[ul],dependantModules:[D,sl.CsvExportModule]},gl=i(98092),ml=i(98092),fl=i(98092),yl=i(98092),vl=i(98092),Cl=i(98092),bl=i(98092),Sl=i(98092),wl=i(98092),xl=i(98092),El=i(98092),Ml=i(98092),Al=i(98092),Tl=i(98092),Dl=i(98092),Il=i(98092),Rl=i(98092),Pl=i(98092),kl=i(98092),Ll=i(98092),Nl=i(98092),_l=i(98092),Ol=i(98092),Fl=i(98092),Gl=i(98092),Bl=Object.defineProperty,Vl=Object.defineProperties,Hl=Object.getOwnPropertyDescriptor,Ul=Object.getOwnPropertyDescriptors,zl=Object.getOwnPropertySymbols,Wl=Object.prototype.hasOwnProperty,jl=Object.prototype.propertyIsEnumerable,Kl=(e,t,i)=>t in e?Bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,$l=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Hl(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Bl(t,i,n),n},Yl=class extends Ml.BeanStub{execute(e){const t=Ml._.missingOrEmpty(this.columnModel.getValueColumns()),i=!this.gos.getCallback("getGroupRowAgg"),s=e.changedPath&&e.changedPath.isActive();if(t&&i&&s)return;const r=this.createAggDetails(e);this.recursivelyCreateAggData(r)}createAggDetails(e){const t=this.columnModel.isPivotActive(),i=this.columnModel.getValueColumns(),s=t?this.columnModel.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!this.gos.getGrandTotalRow(),changedPath:e.changedPath,valueColumns:i,pivotColumns:s,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return void 0!==this.gos.getGroupAggFiltering()||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{if(t.hasChildren()){if(-1===t.level&&!e.groupIncludeTotalFooter){const i=!this.columnModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&i)return void t.setAggData(null)}this.aggregateRowNode(t,e)}else t.aggData&&t.setAggData(null)},!0)}aggregateRowNode(e,t){const i=0===t.valueColumns.length,s=0===t.pivotColumns.length;let r;r=t.userAggFunc?t.userAggFunc({nodes:e.childrenAfterFilter}):i?null:s?this.aggregateRowNodeUsingValuesOnly(e,t):this.aggregateRowNodeUsingValuesAndPivot(e),e.setAggData(r),e.sibling&&e.sibling.setAggData(r)}aggregateRowNodeUsingValuesAndPivot(e){var t,i;const s={},r=null!=(t=this.columnModel.getSecondaryColumns())?t:[];let n=!0;for(let t=0;t<r.length;t++){const o=r[t],a=o.getColDef();if(null!=a.pivotTotalColumnIds){n=!1;continue}const l=null!=(i=a.pivotKeys)?i:[];let c;c=e.leafGroup?this.getValuesFromMappedSet(e.childrenMapped,l,a.pivotValueColumn):this.getValuesPivotNonLeaf(e,a.colId),s[a.colId]=this.aggregateValues(c,a.pivotValueColumn.getAggFunc(),a.pivotValueColumn,e,o)}if(!n)for(let t=0;t<r.length;t++){const i=r[t],n=i.getColDef();if(null==n.pivotTotalColumnIds||!n.pivotTotalColumnIds.length)continue;const o=n.pivotTotalColumnIds.map(e=>s[e]);s[n.colId]=this.aggregateValues(o,n.pivotValueColumn.getAggFunc(),n.pivotValueColumn,e,i)}return s}aggregateRowNodeUsingValuesOnly(e,t){const i={},s=t.changedPath.isActive()?t.changedPath.getValueColumnsForNode(e,t.valueColumns):t.valueColumns,r=t.changedPath.isActive()?t.changedPath.getNotValueColumnsForNode(e,t.valueColumns):null,n=this.getValuesNormal(e,s,t.filteredOnly),o=e.aggData;return s.forEach((t,s)=>{i[t.getId()]=this.aggregateValues(n[s],t.getAggFunc(),t,e)}),r&&o&&r.forEach(e=>{i[e.getId()]=o[e.getId()]}),i}getValuesPivotNonLeaf(e,t){return e.childrenAfterFilter.map(e=>e.aggData[t])}getValuesFromMappedSet(e,t,i){let s=e;for(let e=0;e<t.length;e++){const i=t[e];s=s?s[i]:null}return s?s.map(e=>this.valueService.getValue(i,e)):[]}getValuesNormal(e,t,i){const s=[];t.forEach(()=>s.push([]));const r=t.length,n=i?e.childrenAfterFilter:e.childrenAfterGroup,o=n.length;for(let e=0;e<o;e++){const i=n[e];for(let e=0;e<r;e++){const r=t[e],n=this.valueService.getValue(r,i);s[e].push(n)}}return s}aggregateValues(e,t,i,s,r){const n="string"==typeof t?this.aggFuncService.getAggFunc(t):t;return"function"!=typeof n?(console.error(`AG Grid: unrecognised aggregation function ${t}`),null):n(this.gos.addGridCommonParams({values:e,column:i,colDef:i?i.getColDef():void 0,pivotResultColumn:r,rowNode:s,data:s?s.data:void 0}))}};$l([(0,Ml.Autowired)("columnModel")],Yl.prototype,"columnModel",2),$l([(0,Ml.Autowired)("valueService")],Yl.prototype,"valueService",2),$l([(0,Ml.Autowired)("aggFuncService")],Yl.prototype,"aggFuncService",2),Yl=$l([(0,Ml.Bean)("aggregationStage")],Yl);var ql=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(e,t){this.getSet(e).removeFromChildrenAfterGroup[t.id]=!0}isRemoveFromAllLeafChildren(e,t){return!!this.getSet(e).removeFromAllLeafChildren[t.id]}preventRemoveFromAllLeafChildren(e,t){delete this.getSet(e).removeFromAllLeafChildren[t.id]}removeFromAllLeafChildren(e,t){this.getSet(e).removeFromAllLeafChildren[t.id]=!0}getSet(e){return this.allSets[e.id]||(this.allSets[e.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(e)),this.allSets[e.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(e=>{const t=this.allSets[e.id];e.childrenAfterGroup=e.childrenAfterGroup.filter(e=>!t.removeFromChildrenAfterGroup[e.id]),e.allLeafChildren=e.allLeafChildren.filter(e=>!t.removeFromAllLeafChildren[e.id]),e.updateHasChildren(),e.sibling&&(e.sibling.childrenAfterGroup=e.childrenAfterGroup,e.sibling.allLeafChildren=e.allLeafChildren)}),this.allSets={},this.allParents.length=0}},Xl=class extends Al.BeanStub{execute(e){const t=this.createGroupingDetails(e);if(t.transactions)this.handleTransaction(t);else{const i=!0===e.afterColumnsChanged;this.shotgunResetEverything(t,i)}t.usingTreeData||(this.positionLeafsAndGroups(e.changedPath),this.orderGroups(t)),this.selectableService.updateSelectableAfterGrouping()}positionLeafsAndGroups(e){e.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const t=[],i=[];let s;e.childrenAfterGroup.forEach(e=>{var r;(null==(r=e.childrenAfterGroup)?void 0:r.length)?""!==e.key||s?i.push(e):s=e:t.push(e)}),s&&i.push(s),e.childrenAfterGroup=[...t,...i]}},!1)}createGroupingDetails(e){var t;const{rowNode:i,changedPath:s,rowNodeTransactions:r,rowNodeOrder:n}=e,o=this.gos.get("treeData"),a=o?null:this.columnModel.getRowGroupColumns();return{includeParents:!this.gos.get("suppressParentsInRowNodes"),expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:a,rootNode:i,pivotMode:this.columnModel.isPivotMode(),groupedColCount:o||!a?0:a.length,rowNodeOrder:n,transactions:r,changedPath:s,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),usingTreeData:o,suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),getDataPath:o?this.gos.get("getDataPath"):void 0,keyCreators:null!=(t=null==a?void 0:a.map(e=>e.getColDef().keyCreator))?t:[]}}handleTransaction(e){e.transactions.forEach(t=>{const i=e.usingTreeData?void 0:new ql;if(Al._.existsAndNotEmpty(t.remove)&&this.removeNodes(t.remove,e,i),Al._.existsAndNotEmpty(t.update)&&this.moveNodesInWrongPath(t.update,e,i),Al._.existsAndNotEmpty(t.add)&&this.insertNodes(t.add,e,!1),i){const t=i.getAllParents().slice();i.flush(),this.removeEmptyGroups(t,e)}}),e.rowNodeOrder&&this.sortChildren(e)}sortChildren(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{t.childrenAfterGroup&&Al._.sortRowNodesByOrder(t.childrenAfterGroup,e.rowNodeOrder)&&e.changedPath.addParentNode(t)},!1,!0)}orderGroups(e){const t=e.initialGroupOrderComparator;Al._.exists(t)&&function e(i){Al._.exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((e,i)=>t({nodeA:e,nodeB:i})),i.childrenAfterGroup.forEach(t=>e(t)))}(e.rootNode)}getExistingPathForNode(e,t){const i=[];let s=t.usingTreeData?e:e.parent;for(;s&&s!==t.rootNode;)i.push({key:s.key,rowGroupColumn:s.rowGroupColumn,field:s.field}),s=s.parent;return i.reverse(),i}moveNodesInWrongPath(e,t,i){e.forEach(e=>{t.changedPath.isActive()&&t.changedPath.addParentNode(e.parent);const s=e=>e.key,r=this.getExistingPathForNode(e,t).map(s),n=this.getGroupInfo(e,t).map(s);Al._.areEqual(r,n)||this.moveNode(e,t,i)})}moveNode(e,t,i){if(this.removeNodesInStages([e],t,i),this.insertOneNode(e,t,!0,i),e.setData(e.data),t.changedPath.isActive()){const i=e.parent;t.changedPath.addParentNode(i)}}removeNodes(e,t,i){this.removeNodesInStages(e,t,i),t.changedPath.isActive()&&e.forEach(e=>t.changedPath.addParentNode(e.parent))}removeNodesInStages(e,t,i){if(this.removeNodesFromParents(e,t,i),t.usingTreeData){this.postRemoveCreateFillerNodes(e,t);const i=e.map(e=>e.parent);this.removeEmptyGroups(i,t)}}forEachParentGroup(e,t,i){let s=t;for(;s&&s!==e.rootNode;)i(s),s=s.parent}removeNodesFromParents(e,t,i){const s=null==i,r=i||new ql;e.forEach(e=>{this.removeFromParent(e,r),this.forEachParentGroup(t,e.parent,t=>{r.removeFromAllLeafChildren(t,e)})}),s&&r.flush()}postRemoveCreateFillerNodes(e,t){e.forEach(e=>{if(e.hasChildren()){const i=this.getExistingPathForNode(e,t),s=this.findParentForNode(e,i,t);s.expanded=e.expanded,s.allLeafChildren=e.allLeafChildren,s.childrenAfterGroup=e.childrenAfterGroup,s.childrenMapped=e.childrenMapped,s.updateHasChildren(),s.childrenAfterGroup.forEach(e=>e.parent=s)}})}removeEmptyGroups(e,t){let i=!0;const s=e=>{const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),i=e.parent;return!!(i&&i.childrenMapped&&i.childrenMapped[t]&&e.isEmptyRowGroupNode())};for(;i;){i=!1;const r=new ql;e.forEach(e=>{this.forEachParentGroup(t,e,e=>{s(e)&&(i=!0,this.removeFromParent(e,r),e.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),r.flush()}}removeFromParent(e,t){e.parent&&(t?t.removeFromChildrenAfterGroup(e.parent,e):(Al._.removeFromArray(e.parent.childrenAfterGroup,e),e.parent.updateHasChildren()));const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);e.parent&&e.parent.childrenMapped&&(e.parent.childrenMapped[i]=void 0),e.setRowTop(null),e.setRowIndex(null)}addToParent(e,t){const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);t&&(null!=t.childrenMapped&&(t.childrenMapped[i]=e),t.childrenAfterGroup.push(e),t.updateHasChildren())}areGroupColsEqual(e,t){return null!=e&&null!=t&&e.pivotMode===t.pivotMode&&Al._.areEqual(e.groupedCols,t.groupedCols)&&Al._.areEqual(e.keyCreators,t.keyCreators)}checkAllGroupDataAfterColsChanged(e){const t=i=>{i&&i.forEach(i=>{if(!e.usingTreeData&&!i.group)return;const s={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:i.allLeafChildren[0]};this.setGroupData(i,s,e),t(i.childrenAfterGroup)})};t(e.rootNode.childrenAfterGroup)}shotgunResetEverything(e,t){if(this.noChangeInGroupingColumns(e,t))return;this.selectionService.filterFromSelection(e=>e&&!e.group);const{rootNode:i,groupedCols:s}=e;i.leafGroup=!e.usingTreeData&&0===s.length,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const r=i.sibling;r&&(r.childrenAfterGroup=i.childrenAfterGroup,r.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,e,!1)}noChangeInGroupingColumns(e,t){let i=!1;const s=this.columnModel.getGroupDisplayColumns(),r=s?s.map(e=>e.getId()).join("-"):"";return t&&(i=e.usingTreeData||this.areGroupColsEqual(e,this.oldGroupingDetails),this.oldGroupDisplayColIds!==r&&this.checkAllGroupDataAfterColsChanged(e)),this.oldGroupingDetails=e,this.oldGroupDisplayColIds=r,i}insertNodes(e,t,i){e.forEach(e=>{this.insertOneNode(e,t,i),t.changedPath.isActive()&&t.changedPath.addParentNode(e.parent)})}insertOneNode(e,t,i,s){const r=this.getGroupInfo(e,t),n=this.findParentForNode(e,r,t,s);n.group||console.warn("AG Grid: duplicate group keys for row data, keys should be unique",[n.data,e.data]),t.usingTreeData?this.swapGroupWithUserNode(n,e,i):(e.parent=n,e.level=r.length,n.childrenAfterGroup.push(e),n.updateHasChildren())}findParentForNode(e,t,i,s){let r=i.rootNode;return t.forEach((t,n)=>{r=this.getOrCreateNextNode(r,t,n,i),(null==s?void 0:s.isRemoveFromAllLeafChildren(r,e))?null==s||s.preventRemoveFromAllLeafChildren(r,e):r.allLeafChildren.push(e)}),r}swapGroupWithUserNode(e,t,i){t.parent=e.parent,t.key=e.key,t.field=e.field,t.groupData=e.groupData,t.level=e.level,i||(t.expanded=e.expanded),t.leafGroup=e.leafGroup,t.rowGroupIndex=e.rowGroupIndex,t.allLeafChildren=e.allLeafChildren,t.childrenAfterGroup=e.childrenAfterGroup,t.childrenMapped=e.childrenMapped,t.sibling=e.sibling,t.updateHasChildren(),this.removeFromParent(e),t.childrenAfterGroup.forEach(e=>e.parent=t),this.addToParent(t,e.parent)}getOrCreateNextNode(e,t,i,s){const r=this.getChildrenMappedKey(t.key,t.rowGroupColumn);let n=e.childrenMapped?e.childrenMapped[r]:void 0;return n||(n=this.createGroup(t,e,i,s),this.addToParent(n,e)),n}createGroup(e,t,i,s){const r=new Al.RowNode(this.beans);return r.group=!0,r.field=e.field,r.rowGroupColumn=e.rowGroupColumn,this.setGroupData(r,e,s),r.key=e.key,r.id=this.createGroupId(r,t,s.usingTreeData,i),r.level=i,r.leafGroup=!s.usingTreeData&&i===s.groupedColCount-1,r.allLeafChildren=[],r.setAllChildrenCount(0),r.rowGroupIndex=s.usingTreeData?null:i,r.childrenAfterGroup=[],r.childrenMapped={},r.updateHasChildren(),r.parent=s.includeParents?t:null,this.setExpandedInitialValue(s,r),r}createGroupId(e,t,i,s){let r;return r=i?(e,t,i)=>{if(i<0)return null;const s=t?r(t,t.parent,i-1):null;return`${null==s?"":s+"-"}${i}-${e.key}`}:(e,t)=>{if(!e.rowGroupColumn)return null;const i=t?r(t,t.parent,0):null;return`${null==i?"":i+"-"}${e.rowGroupColumn.getColId()}-${e.key}`},Al.RowNode.ID_PREFIX_ROW_GROUP+r(e,t,s)}setGroupData(e,t,i){e.groupData={},this.columnModel.getGroupDisplayColumns().forEach(s=>{if(i.usingTreeData)return void(e.groupData[s.getColId()]=t.key);const r=e.rowGroupColumn;null!==r&&s.isRowGroupDisplayed(r.getId())&&(i.suppressGroupMaintainValueType?e.groupData[s.getColId()]=t.key:e.groupData[s.getColId()]=this.valueService.getValue(r,t.leafNode))})}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}setExpandedInitialValue(e,t){if(e.pivotMode&&t.leafGroup)return void(t.expanded=!1);const i=e.isGroupOpenByDefault;if(i){const e={rowNode:t,field:t.field,key:t.key,level:t.level,rowGroupColumn:t.rowGroupColumn};return void(t.expanded=1==i(e))}const{expandByDefault:s}=e;-1!==e.expandByDefault?t.expanded=t.level<s:t.expanded=!0}getGroupInfo(e,t){return t.usingTreeData?this.getGroupInfoFromCallback(e,t):this.getGroupInfoFromGroupColumns(e,t)}getGroupInfoFromCallback(e,t){const i=t.getDataPath?t.getDataPath(e.data):null;return null!=i&&0!==i.length||Al._.warnOnce(`getDataPath() should not return an empty path for data ${e.data}`),i?i.map(e=>({key:e,field:null,rowGroupColumn:null})):[]}getGroupInfoFromGroupColumns(e,t){const i=[];return t.groupedCols.forEach(s=>{let r=this.valueService.getKeyForNode(s,e),n=null!=r&&""!==r;if((t.pivotMode||!t.groupAllowUnbalanced)&&!n&&(r="",n=!0),n){const t={key:r,field:s.getColDef().field,rowGroupColumn:s,leafNode:e};i.push(t)}}),i}};$l([(0,Al.Autowired)("columnModel")],Xl.prototype,"columnModel",2),$l([(0,Al.Autowired)("selectableService")],Xl.prototype,"selectableService",2),$l([(0,Al.Autowired)("valueService")],Xl.prototype,"valueService",2),$l([(0,Al.Autowired)("beans")],Xl.prototype,"beans",2),$l([(0,Al.Autowired)("selectionService")],Xl.prototype,"selectionService",2),Xl=$l([(0,Al.Bean)("groupStage")],Xl);var Zl=class extends Tl.BeanStub{init(){const e=()=>{var e;return null!=(e=this.gos.get("serverSidePivotResultFieldSeparator"))?e:"_"};this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e),i=function e(t,i=[]){return t.forEach(t=>{void 0!==t.children?e(t.children,i):i.push(t)}),i}(t);return this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i),{pivotColumnGroupDefs:t,pivotColumnDefs:i.map(e=>Tl._.cloneObject(e))}}createPivotColumnsFromUniqueValues(e){const t=this.columnModel.getPivotColumns(),i=t.length;return this.recursivelyBuildGroup(0,e,[],i,t)}recursivelyBuildGroup(e,t,i,s,r){const n=this.columnModel.getValueColumns();if(e>=s)return this.buildMeasureCols(i);const o=r[e].getColDef(),a=this.headerNameComparator.bind(this,o.pivotComparator);if(1===n.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===s-1){const e=[];return Tl._.iterateObject(t,t=>{const s=[...i,t],r=this.createColDef(n[0],t,s);r.columnGroupShow="open",e.push(r)}),e.sort(a),e}const l=[];return Tl._.iterateObject(t,(t,n)=>{const o=-1===this.pivotDefaultExpanded||e<this.pivotDefaultExpanded,a=[...i,t];l.push({children:this.recursivelyBuildGroup(e+1,n,a,s,r),headerName:t,pivotKeys:a,columnGroupShow:"open",openByDefault:o,groupId:this.generateColumnGroupId(a)})}),l.sort(a),l}buildMeasureCols(e){const t=this.columnModel.getValueColumns();return 0===t.length?[this.createColDef(null,"-",e)]:t.map(t=>{const i=this.columnModel.getDisplayNameForColumn(t,"header");return s=((e,t)=>{for(var i in t||(t={}))Wl.call(t,i)&&Kl(e,i,t[i]);if(zl)for(var i of zl(t))jl.call(t,i)&&Kl(e,i,t[i]);return e})({},this.createColDef(t,i,e)),Vl(s,Ul({columnGroupShow:"open"}));var s})}addExpandablePivotGroups(e,t){if(this.gos.get("suppressExpandablePivotGroups")||this.gos.get("pivotColumnGroupTotals"))return;const i=(e,t,s)=>{const r=e;if(r.children){const n=new Map;r.children.forEach(e=>{i(e,t,n)});const o=!r.children.some(e=>e.children);this.columnModel.getValueColumns().forEach(i=>{const s=this.columnModel.getDisplayNameForColumn(i,"header"),r=this.createColDef(i,s,e.pivotKeys);r.pivotTotalColumnIds=n.get(i.getColId()),r.columnGroupShow="closed",r.aggFunc=i.getAggFunc(),o||(e.children.push(r),t.push(r))}),this.merge(s,n)}else{const t=e;if(!t.pivotValueColumn)return;const i=t.pivotValueColumn.getColId(),r=s.has(i)?s.get(i):[];r.push(t.colId),s.set(i,r)}};e.forEach(e=>{i(e,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const i="after"===this.gos.get("pivotColumnGroupTotals"),s=this.columnModel.getValueColumns(),r=s.map(e=>e.getAggFunc());if(!r||r.length<1||!this.sameAggFuncs(r))return;const n=s[0];e.forEach(e=>{this.recursivelyAddPivotTotal(e,t,n,i)})}recursivelyAddPivotTotal(e,t,i,s){const r=e;if(!r.children){const t=e;return t.colId?[t.colId]:null}let n=[];if(r.children.forEach(e=>{const r=this.recursivelyAddPivotTotal(e,t,i,s);r&&(n=n.concat(r))}),r.children.length>1){const r=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),o=this.createColDef(i,r,e.pivotKeys,!0);o.pivotTotalColumnIds=n,o.aggFunc=i.getAggFunc();const a=e.children;s?a.push(o):a.unshift(o),t.push(o)}return n}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const i="after"===this.gos.get("pivotRowTotals"),s=this.columnModel.getValueColumns(),r=i?s.slice():s.slice().reverse();for(let s=0;s<r.length;s++){const n=r[s];let o=[];e.forEach(e=>{o=o.concat(this.extractColIdsForValueColumn(e,n))});const a=r.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");this.createRowGroupTotal(e,t,n,o,i,a)}}extractColIdsForValueColumn(e,t){const i=e;if(!i.children){const e=i;return e.pivotValueColumn===t&&e.colId?[e.colId]:[]}let s=[];return i.children.forEach(e=>{this.extractColIdsForValueColumn(e,t);const i=this.extractColIdsForValueColumn(e,t);s=s.concat(i)}),s}createRowGroupTotal(e,t,i,s,r,n){let o;if(0===this.columnModel.getValueColumns().length)o=this.createColDef(null,"-",[]);else{const e=this.columnModel.getDisplayNameForColumn(i,"header");o=this.createColDef(i,e,[]),o.pivotTotalColumnIds=s}o.colId=Zl.PIVOT_ROW_TOTAL_PREFIX+o.colId,t.push(o);const a=n?{children:[o],pivotKeys:[],groupId:`${Zl.PIVOT_ROW_TOTAL_PREFIX}_pivotGroup_${i.getColId()}`}:o;r?e.push(a):e.unshift(a)}createColDef(e,t,i,s=!1){const r={};if(e){const t=e.getColDef();Object.assign(r,t),r.hide=!1}return r.headerName=t,r.colId=this.generateColumnId(i||[],e&&!s?e.getColId():""),r.field=r.colId,r.valueGetter=e=>{var t;return null==(t=e.data)?void 0:t[e.colDef.field]},r.pivotKeys=i,r.pivotValueColumn=e,!0===r.filter&&(r.filter="agNumberColumnFilter"),r}sameAggFuncs(e){if(1==e.length)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}headerNameComparator(e,t,i){return e?e(t.headerName,i.headerName):t.headerName&&!i.headerName?1:!t.headerName&&i.headerName?-1:t.headerName&&i.headerName?t.headerName<i.headerName?-1:t.headerName>i.headerName?1:0:0}merge(e,t){t.forEach((t,i,s)=>{const r=[...e.has(i)?e.get(i):[],...t];e.set(i,r)})}generateColumnGroupId(e){return`pivotGroup_${this.columnModel.getPivotColumns().map(e=>e.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${this.columnModel.getPivotColumns().map(e=>e.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t={};for(let i=0;i<e.length;i++){const s=e[i].split(this.fieldSeparator);let r=t;for(let e=0;e<s.length;e++){const t=s[e];null==r[t]&&(r[t]={}),r=r[t]}}const i=(e,t,s,r)=>{var n;const o=[];for(let t in s){const n=s[t],a=i(`${e}${this.fieldSeparator}${t}`,t,n,r+1);o.push(a)}if(0===o.length){const i=this.columnModel.getPrimaryColumn(t);if(i){const s=null!=(n=this.columnModel.getDisplayNameForColumn(i,"header"))?n:t,r=this.createColDef(i,s,void 0,!1);return r.colId=e,r.aggFunc=i.getAggFunc(),r.valueGetter=t=>{var i;return null==(i=t.data)?void 0:i[e]},r}return{colId:e,headerName:t,valueGetter:t=>{var i;return null==(i=t.data)?void 0:i[e]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===o.length&&"colId"in o[0]?(o[0].headerName=t,o[0]):{openByDefault:-1===this.pivotDefaultExpanded||r<this.pivotDefaultExpanded,groupId:e,headerName:t,children:o}},s=[];for(let e in t){const r=i(e,e,t[e],0);s.push(r)}return s}};Zl.PIVOT_ROW_TOTAL_PREFIX="PivotRowTotal_",$l([(0,Tl.Autowired)("columnModel")],Zl.prototype,"columnModel",2),$l([Tl.PostConstruct],Zl.prototype,"init",1),Zl=$l([(0,Tl.Bean)("pivotColDefService")],Zl);var Ql=class extends Dl.BeanStub{constructor(){super(...arguments),this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}execute(e){const t=e.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(t):this.executePivotOff(t)}executePivotOff(e){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.columnModel.isSecondaryColumnsPresent()&&(this.columnModel.setSecondaryColumns(null,"rowModelUpdated"),e&&e.setInactive())}executePivotOn(e){var t;const i=null!=(t=this.columnModel.getValueColumns().length)?t:1,s=this.gos.get("pivotMaxGeneratedColumns");let r;this.maxUniqueValues=-1===s?-1:s/i;try{r=this.bucketUpRowNodes(e)}catch(e){if(e.message===Ql.EXCEEDED_MAX_UNIQUE_VALUES){this.columnModel.setSecondaryColumns([],"rowModelUpdated");const t={type:Dl.Events.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED,message:e.message};return this.eventService.dispatchEvent(t),void(this.lastTimeFailed=!0)}throw e}const n=this.setUniqueValues(r),o=this.columnModel.getValueColumns(),a=o.map(e=>`${e.getId()}-${e.getColDef().headerName}`).join("#"),l=o.map(e=>e.getAggFunc().toString()).join("#"),c=this.aggregationColumnsHashLastTime!==a,h=this.aggregationFuncsHashLastTime!==l;this.aggregationColumnsHashLastTime=a,this.aggregationFuncsHashLastTime=l;const d=this.columnModel.getRowGroupColumns().map(e=>e.getId()).join("#"),u=d!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=d;const p=this.gos.get("pivotRowTotals"),g=this.gos.get("pivotColumnGroupTotals"),m=this.gos.get("suppressExpandablePivotGroups"),f=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),y=p!==this.pivotRowTotalsLastTime||g!==this.pivotColumnGroupTotalsLastTime||m!==this.suppressExpandablePivotGroupsLastTime||f!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=p,this.pivotColumnGroupTotalsLastTime=g,this.suppressExpandablePivotGroupsLastTime=m,this.removePivotHeaderRowWhenSingleValueColumnLastTime=f,this.lastTimeFailed||n||c||u||h||y){const{pivotColumnGroupDefs:t,pivotColumnDefs:i}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=i,this.columnModel.setSecondaryColumns(t,"rowModelUpdated"),e&&e.setInactive()}this.lastTimeFailed=!1}setUniqueValues(e){return!(JSON.stringify(e)===JSON.stringify(this.uniqueValues)||(this.uniqueValues=e,0))}bucketUpRowNodes(e){this.currentUniqueCount=0;const t={};e.forEachChangedNodeDepthFirst(e=>{e.leafGroup&&(e.childrenMapped=null)});const i=e=>{var s;e.leafGroup?this.bucketRowNode(e,t):null==(s=e.childrenAfterFilter)||s.forEach(i)};return e.executeFromRootNode(i),t}bucketRowNode(e,t){const i=this.columnModel.getPivotColumns();0===i.length?e.childrenMapped=null:e.childrenMapped=this.bucketChildren(e.childrenAfterFilter,i,0,t),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t,i,s){const r={},n=t[i];if(e.forEach(e=>{let t=this.valueService.getKeyForNode(n,e);if(Dl._.missing(t)&&(t=""),!s[t]){this.currentUniqueCount+=1,s[t]={};const e=-1!==this.maxUniqueValues,i=this.currentUniqueCount>this.maxUniqueValues;if(e&&i)throw Error(Ql.EXCEEDED_MAX_UNIQUE_VALUES)}r[t]||(r[t]=[]),r[t].push(e)}),i===t.length-1)return r;{const e={};return Dl._.iterateObject(r,(r,n)=>{e[r]=this.bucketChildren(n,t,i+1,s[r])}),e}}getPivotColumnDefs(){return this.pivotColumnDefs}};Ql.EXCEEDED_MAX_UNIQUE_VALUES="Exceeded maximum allowed pivot column count.",$l([(0,Dl.Autowired)("valueService")],Ql.prototype,"valueService",2),$l([(0,Dl.Autowired)("columnModel")],Ql.prototype,"columnModel",2),$l([(0,Dl.Autowired)("pivotColDefService")],Ql.prototype,"pivotColDefService",2),Ql=$l([(0,Dl.Bean)("pivotStage")],Ql);var Jl={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},ec=class extends Il.BeanStub{constructor(){super(...arguments),this.aggFuncsMap={},this.initialised=!1}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){this.aggFuncsMap[ec.AGG_SUM]=tc,this.aggFuncsMap[ec.AGG_FIRST]=ic,this.aggFuncsMap[ec.AGG_LAST]=sc,this.aggFuncsMap[ec.AGG_MIN]=rc,this.aggFuncsMap[ec.AGG_MAX]=nc,this.aggFuncsMap[ec.AGG_COUNT]=oc,this.aggFuncsMap[ec.AGG_AVG]=ac,this.initialised=!0}isAggFuncPossible(e,t){const i=this.getFuncNames(e),s=Il._.includes(i,t),r=Il._.exists(this.aggFuncsMap[t]);return s&&r}getDefaultFuncLabel(e){var t;return null!=(t=Jl[e])?t:e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(Il._.exists(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,ec.AGG_SUM))return ec.AGG_SUM;const i=this.getFuncNames(e);return Il._.existsAndNotEmpty(i)?i[0]:null}addAggFuncs(e){this.init(),Il._.iterateObject(e,(e,t)=>{this.aggFuncsMap[e]=t})}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return null==t?Object.keys(this.aggFuncsMap).sort():t}clear(){this.aggFuncsMap={}}};function tc(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const s=t[e];"number"==typeof s?null===i?i=s:i+="number"==typeof i?s:BigInt(s):"bigint"==typeof s&&(i=null===i?s:("bigint"==typeof i?i:BigInt(i))+s)}return i}function ic(e){return e.values.length>0?e.values[0]:null}function sc(e){return e.values.length>0?Il._.last(e.values):null}function rc(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const s=t[e];"number"!=typeof s&&"bigint"!=typeof s||!(null===i||i>s)||(i=s)}return i}function nc(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const s=t[e];"number"!=typeof s&&"bigint"!=typeof s||!(null===i||i<s)||(i=s)}return i}function oc(e){var t,i;const{values:s}=e;let r=0;for(let e=0;e<s.length;e++){const t=s[e];r+=null!=t&&"number"==typeof t.value?t.value:1}const n=null==(i=null==(t=e.rowNode)?void 0:t.aggData)?void 0:i[e.column.getColId()];return n&&n.value===r?n:{value:r,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function ac(e){var t,i,s;const{values:r}=e;let n=0,o=0;for(let e=0;e<r.length;e++){const t=r[e];let i=null;"number"==typeof t||"bigint"==typeof t?(i=t,o++):null==t||"number"!=typeof t.value&&"bigint"!=typeof t.value||"number"!=typeof t.count||(i=t.value*("number"==typeof t.value?t.count:BigInt(t.count)),o+=t.count),"number"==typeof i?n+="number"==typeof n?i:BigInt(i):"bigint"==typeof i&&(n=("bigint"==typeof n?n:BigInt(n))+i)}let a=null;o>0&&(a=n/("number"==typeof n?o:BigInt(o)));const l=null==(s=null==(t=e.rowNode)?void 0:t.aggData)?void 0:s[null==(i=e.column)?void 0:i.getColId()];return l&&l.count===o&&l.value===a?l:{count:o,value:a,toString:function(){return"number"==typeof this.value||"bigint"==typeof this.value?this.value.toString():""},toNumber:function(){return this.value}}}ec.AGG_SUM="sum",ec.AGG_FIRST="first",ec.AGG_LAST="last",ec.AGG_MIN="min",ec.AGG_MAX="max",ec.AGG_COUNT="count",ec.AGG_AVG="avg",$l([Il.PostConstruct],ec.prototype,"init",1),ec=$l([(0,Il.Bean)("aggFuncService")],ec);var lc=class extends Ll.PillDragComp{constructor(e,t,i,s,r){super(t,i,r,'\n                <span role="option">\n                    <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n                    <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n                    <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n                    <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n                </span>\n            '),this.column=e,this.dropZonePurpose=s,this.popupShowing=!1}init(){this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnDrop"),super.init(),this.setupSort(),this.addManagedListener(this.eventService,Ll.Column.EVENT_SORT_CHANGED,()=>{this.setupAria()}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const i=this.gos.get("rowGroupPanelSuppressSort"),s=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!s){const i=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!i){const i=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(i)}super.addAdditionalAriaInstructions(e,t)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.localeService.getLocaleTextFunc(),{name:t,aggFuncName:i}=this.getColumnAndAggFuncName(),s=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),r={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},n=this.column.getSort(),o=this.gos.get("rowGroupPanelSuppressSort");return[i&&`${i}${s}`,t,this.isGroupingZone()&&!o&&n&&`, ${r[n]}`].filter(e=>!!e).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const e=this.column.getAggFunc(),i="string"==typeof e?e:"agg";t=this.localeService.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){const e=this.column.isSortable(),t=this.isGroupingZone();if(e&&t&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const e=e=>{e.preventDefault();const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.sortController.progressSort(this.column,t,"uiColumnSorted")};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===Ll.KeyCode.ENTER&&this.isGroupingZone()&&e(t)})}}getDefaultIconName(){return Ll.DragAndDropService.ICON_HIDE}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===Ll.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const e=new Ll.VirtualList({cssIdentifier:"select-agg-func"}),t=this.aggFuncService.getFuncNames(this.column),i=this.getGui(),s=e.getGui();e.setModel({getRow:function(e){return t[e]},getRowCount:function(){return t.length}}),this.getContext().createBean(e);const r=Ll._.loadTemplate('<div class="ag-select-agg-func-popup"></div>');r.style.top="0px",r.style.left="0px",r.appendChild(s),r.style.width=`${i.clientWidth}px`;const n=this.addManagedListener(r,"focusout",e=>{!r.contains(e.relatedTarget)&&a&&a.hideFunc()}),o=this.localeService.getLocaleTextFunc(),a=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:t=>{this.destroyBean(e),this.popupShowing=!1,"Escape"===(null==t?void 0:t.key)&&i.focus(),n&&n()},ariaLabel:o("ariaLabelAggregationFunction","Aggregation Function")});a&&e.setComponentCreator(this.createAggSelect.bind(this,a.hideFunc)),e.addGuiEventListener("keydown",t=>{if(t.key===Ll.KeyCode.ENTER||t.key===Ll.KeyCode.SPACE){const t=e.getLastFocusedRow();if(null==t)return;const i=e.getComponentAt(t);i&&i.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:i,ePopup:r,keepWithinBounds:!0,column:this.column,position:"under"}),e.refresh();let l=t.findIndex(e=>e===this.column.getAggFunc());-1===l&&(l=0),e.focusRow(l)}createAggSelect(e,t){const i=this.localeService.getLocaleTextFunc(),s=t.toString(),r=i(s,s);return new cc(()=>{if(e(),this.gos.get("functionsPassive")){const e={type:Ll.Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST,columns:[this.column],aggFunc:t};this.eventService.dispatchEvent(e)}else this.columnModel.setColumnAggFunc(this.column,t,"toolPanelDragAndDrop")},r)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColumnGroupingLocked(this.column)}isAggregationZone(){return"aggregation"===this.dropZonePurpose}isGroupingZone(){return"rowGroup"===this.dropZonePurpose}getDragSourceType(){return Ll.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}};$l([(0,Ll.Autowired)("popupService")],lc.prototype,"popupService",2),$l([(0,Ll.Autowired)("sortController")],lc.prototype,"sortController",2),$l([(0,Ll.Autowired)("columnModel")],lc.prototype,"columnModel",2),$l([(0,Ll.Optional)("aggFuncService")],lc.prototype,"aggFuncService",2),$l([(0,Ll.RefSelector)("eSortIndicator")],lc.prototype,"eSortIndicator",2);var cc=class extends Ll.Component{constructor(e,t){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=e,this.getGui().innerText=t,this.addGuiEventListener("click",this.selectItem)}},hc=class extends kl.PillDropZonePanel{constructor(e,t){super(e),this.dropZonePurpose=t}init(e){super.init(e),this.addManagedListener(this.eventService,kl.Events.EVENT_NEW_COLUMNS_LOADED,this.refreshGui.bind(this)),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){var t;return null!=(t=e.columns)?t:[]}isInterestedIn(e){return e===kl.DragSourceType.HeaderCell||e===kl.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const e=this.gos.get("groupLockGroupColumns"),t=this.columnModel.getRowGroupColumns().length;return-1===e?t:Math.min(e,t)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem().columns;this.setColumnsVisible(t,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,i){if(e){const s=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}isRowGroupPanel(){return"rowGroup"===this.dropZonePurpose}refreshOnDragStop(){return!this.gos.get("functionsPassive")}createPillComponent(e,t,i,s){return new lc(e,t,i,this.dropZonePurpose,s)}};$l([(0,kl.Autowired)("columnModel")],hc.prototype,"columnModel",2);var dc=class extends hc{constructor(e){super(e,"rowGroup")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),i=e("groups","Row Groups");super.init({icon:Pl._.createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,Pl.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.refreshGui.bind(this))}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const e=super.getTooltipParams();return e.location="rowGroupColumnsList",e}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:Pl.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setRowGroupColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?Pl.DragAndDropService.ICON_GROUP:Pl.DragAndDropService.ICON_NOT_ALLOWED}getExistingItems(){return this.columnModel.getRowGroupColumns()}};$l([Pl.PostConstruct],dc.prototype,"passBeansUp",1);var uc=class extends hc{constructor(e){super(e,"pivot")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),i=e("pivots","Column Labels");super.init({icon:Nl._.createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,Nl.Events.EVENT_NEW_COLUMNS_LOADED,this.refresh.bind(this)),this.addManagedListener(this.eventService,Nl.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,Nl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.checkVisibility.bind(this)),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const e=super.getTooltipParams();return e.location="pivotColumnsList",e}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(e);break;case"onlyWhenPivoting":const t=this.columnModel.isPivotActive();this.setDisplayed(e&&t);break;default:this.setDisplayed(!1)}else this.setDisplayed(e)}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:Nl.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setPivotColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?Nl.DragAndDropService.ICON_PIVOT:Nl.DragAndDropService.ICON_NOT_ALLOWED}getExistingItems(){return this.columnModel.getPivotColumns()}};$l([Nl.PostConstruct],uc.prototype,"passBeansUp",1);var pc=class extends Rl.Component{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel()),this.addManagedListener(this.eventService,Rl.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onRowGroupChanged()),this.addManagedListener(this.eventService,Rl.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onRowGroupChanged()),this.addManagedPropertyListener("rowGroupPanelShow",()=>this.onRowGroupChanged()),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const e=document.createElement("div");return e.classList.add("ag-column-drop-wrapper"),Rl._.setAriaRole(e,"presentation"),this.rowGroupComp=new dc(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new uc(!0),this.createManagedBean(this.pivotComp),e.appendChild(this.rowGroupComp.getGui()),e.appendChild(this.pivotComp.getGui()),this.addManagedListener(this.rowGroupComp,Rl.Component.EVENT_DISPLAYED_CHANGED,()=>this.onDropPanelVisible()),this.addManagedListener(this.pivotComp,Rl.Component.EVENT_DISPLAYED_CHANGED,()=>this.onDropPanelVisible()),this.onDropPanelVisible(),e}onDropPanelVisible(){const e=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed();this.rowGroupComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",e),this.pivotComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",e)}onRowGroupChanged(){if(!this.rowGroupComp)return;const e=this.gos.get("rowGroupPanelShow");if("always"===e)this.rowGroupComp.setDisplayed(!0);else if("onlyWhenGrouping"===e){const e=!this.columnModel.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const e=this.gos.get("pivotPanelShow");if("always"===e)this.pivotComp.setDisplayed(!0);else if("onlyWhenPivoting"===e){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}};$l([(0,Rl.Autowired)("columnModel")],pc.prototype,"columnModel",2),$l([Rl.PostConstruct],pc.prototype,"postConstruct",1);var gc=class extends _l.BeanStub{execute(e){const t=this.columnModel.isPivotMode(),i=this.filterManager.isAggregateFilterPresent()||this.filterManager.isAggregateQuickFilterPresent(),s=this.gos.getGroupAggFiltering()||(t?e=>e.node.leafGroup:e=>!e.node.group),{changedPath:r}=e,n=(e,t=!1)=>{e.childrenAfterFilter&&(e.childrenAfterAggFilter=e.childrenAfterFilter,t&&e.childrenAfterAggFilter.forEach(e=>n(e,t)),this.setAllChildrenCount(e)),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)};r.forEachChangedNodeDepthFirst(i?e=>{var t;e.childrenAfterAggFilter=(null==(t=e.childrenAfterFilter)?void 0:t.filter(e=>{var t;return s({node:e})&&this.filterManager.doesRowPassAggregateFilters({rowNode:e})?(n(e,!0),!0):null==(t=e.childrenAfterAggFilter)?void 0:t.length}))||null,this.setAllChildrenCount(e),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)}:n,!0)}setAllChildrenCountTreeData(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{t++,t+=e.allChildrenCount}),e.setAllChildrenCount(t)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{e.group?t+=e.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){e.hasChildren()?this.gos.get("treeData")?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e):e.setAllChildrenCount(null)}};$l([(0,_l.Autowired)("filterManager")],gc.prototype,"filterManager",2),$l([(0,_l.Autowired)("columnModel")],gc.prototype,"columnModel",2),gc=$l([(0,_l.Bean)("filterAggregatesStage")],gc);var mc=class e extends Ol.TabGuardComp{constructor(){super('\n            <div class="ag-group-filter">\n                <div ref="eGroupField"></div>\n                <div ref="eUnderlyingFilter"></div>\n            </div>\n        ')}postConstruct(){this.initialiseTabGuard({})}init(e){return this.params=e,this.validateParams(),this.updateGroups().then(()=>{this.addManagedListener(this.eventService,Ol.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onColumnRowGroupChanged())})}validateParams(){const{colDef:e}=this.params;e.field&&Ol._.warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),e.filterValueGetter&&Ol._.warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),e.filterParams&&Ol._.warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const e=this.updateGroupField();return this.getUnderlyingFilters(e)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return Ol._.warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];return this.columnModel.getSourceColumnsForGroupColumn(this.groupColumn)||(Ol._.warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){Ol._.clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const e=this.getSourceColumns(),t=e.filter(e=>e.isFilterAllowed());return t.length?(1===e.length?(this.selectedColumn=t[0],Ol._.setDisplayed(this.eGroupField,!1)):(this.selectedColumn&&t.some(e=>e.getId()===this.selectedColumn.getId())||(this.selectedColumn=t[0]),this.createGroupFieldSelectElement(t),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(Ol._.loadTemplate('<div class="ag-filter-separator"></div>')),Ol._.setDisplayed(this.eGroupField,!0)),t):(this.selectedColumn=void 0,Ol._.setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(e){this.eGroupFieldSelect=this.createManagedBean(new Ol.AgSelect);const t=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(t("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(e.map(e=>{var t;return{value:e.getId(),text:null!=(t=this.columnModel.getDisplayNameForColumn(e,"groupFilter",!1))?t:void 0}})),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(e=>this.updateSelectedColumn(e)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),1===e.length&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(e){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),Ol.AgPromise.resolve();const t=[],i=[];return e.forEach(e=>{const s=this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU");(null==s?void 0:s.filterPromise)&&t.push(s.filterPromise.then(t=>(t&&i.push({filter:t,column:e}),e.getId()===this.selectedColumn.getId()&&(this.selectedFilter=null!=t?t:void 0),t)))}),Ol.AgPromise.all(t).then(()=>{this.filterColumnPairs=i,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e,t;if(Ol._.clearElement(this.eUnderlyingFilter),!this.selectedColumn)return Ol.AgPromise.resolve();const i=this.createManagedBean(new Ol.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=i,i.hasFilter()?(this.eUnderlyingFilter.appendChild(i.getGui()),null!=(t=null==(e=i.getFilter())?void 0:e.then(()=>{var e,t;null==(e=i.afterGuiAttached)||e.call(i,this.afterGuiAttachedParams),(null==(t=this.afterGuiAttachedParams)?void 0:t.suppressFocus)||!this.eGroupFieldSelect||this.eGroupFieldSelect.isDisabled()||this.eGroupFieldSelect.getFocusableElement().focus()}))?t:Ol.AgPromise.resolve()):Ol.AgPromise.resolve()}updateSelectedColumn(t){var i;if(!t)return;null==(i=this.filterWrapperComp)||i.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const s=this.getFilterColumnPair(t);this.selectedColumn=null==s?void 0:s.column,this.selectedFilter=null==s?void 0:s.filter,this.dispatchEvent({type:e.EVENT_SELECTED_COLUMN_CHANGED}),this.addUnderlyingFilterElement()}isFilterActive(){var e;return!!(null==(e=this.filterColumnPairs)?void 0:e.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return Ol.AgPromise.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement()}afterGuiDetached(){var e,t;Ol._.clearElement(this.eUnderlyingFilter),null==(t=null==(e=this.selectedFilter)?void 0:e.afterGuiDetached)||t.call(e)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchEvent({type:e.EVENT_COLUMN_ROW_GROUP_CHANGED}),this.eventService.dispatchEvent({type:"filterAllowedUpdated"})})}getFilterColumnPair(e){var t;if(e)return null==(t=this.filterColumnPairs)?void 0:t.find(({column:t})=>t.getId()===e)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}};mc.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",mc.EVENT_SELECTED_COLUMN_CHANGED="selectedColumnChanged",$l([(0,Ol.Autowired)("filterManager")],mc.prototype,"filterManager",2),$l([(0,Ol.Autowired)("columnModel")],mc.prototype,"columnModel",2),$l([(0,Ol.RefSelector)("eGroupField")],mc.prototype,"eGroupField",2),$l([(0,Ol.RefSelector)("eUnderlyingFilter")],mc.prototype,"eUnderlyingFilter",2),$l([Ol.PostConstruct],mc.prototype,"postConstruct",1);var fc=mc,yc=class extends Fl.Component{constructor(){super('\n            <div ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>\n        '),this.haveAddedColumnListeners=!1}init(e){this.params=e;const t="multipleColumns"===this.gos.get("groupDisplayType");return new Fl.AgPromise(e=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,t?this.setupUnderlyingFloatingFilterElement().then(()=>e()):(this.setupReadOnlyFloatingFilterElement(),e())})}).then(()=>{this.addManagedListener(this.parentFilterInstance,fc.EVENT_SELECTED_COLUMN_CHANGED,()=>this.onSelectedColumnChanged()),this.addManagedListener(this.parentFilterInstance,fc.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onColumnRowGroupChanged())})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams()}setParams(){var e;const t=this.columnModel.getDisplayNameForColumn(this.params.column,"header",!0),i=this.localeService.getLocaleTextFunc();null==(e=this.eFloatingFilterText)||e.setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new Fl.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,Fl._.clearElement(this.eFloatingFilter);const e=this.parentFilterInstance.getSelectedColumn();if(e&&!e.isVisible()){const t=this.filterManager.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(t)return this.compDetails=t,this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListener(e,Fl.Column.EVENT_VISIBLE_CHANGED,this.onColumnVisibleChanged.bind(this)),this.addManagedListener(e,Fl.Column.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))),t.newAgStackInstance().then(e=>{var t,i;this.underlyingFloatingFilter=e,null==(i=this.underlyingFloatingFilter)||i.onParentModelChanged(null==(t=this.parentFilterInstance.getSelectedFilter())?void 0:t.getModel()),this.appendChild(e.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),Fl.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){var t,i,s;if(!e.column)return;const r=this.filterManager.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);r&&((null==(t=this.underlyingFloatingFilter)?void 0:t.refresh)?this.underlyingFloatingFilter.refresh(r.params):null==(s=null==(i=this.underlyingFloatingFilter)?void 0:i.onParamsUpdated)||s.call(i,r.params))}onParentModelChanged(e,t){var i,s;this.showingUnderlyingFloatingFilter?null==(s=this.underlyingFloatingFilter)||s.onParentModelChanged(null==(i=this.parentFilterInstance.getSelectedFilter())?void 0:i.getModel(),t):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const e=this.parentFilterInstance.getSelectedFilter();if(!e)return this.eFloatingFilterText.setValue(""),void this.eFloatingFilterText.setDisplayed(!1);if(this.eFloatingFilterText.setDisplayed(!0),e.getModelAsString){const t=e.getModel();this.eFloatingFilterText.setValue(null==t?"":e.getModelAsString(t))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}};$l([(0,Fl.Autowired)("columnModel")],yc.prototype,"columnModel",2),$l([(0,Fl.Autowired)("filterManager")],yc.prototype,"filterManager",2),$l([(0,Fl.RefSelector)("eFloatingFilter")],yc.prototype,"eFloatingFilter",2);var vc={version:"31.3.4",moduleName:El.ModuleNames.RowGroupingModule,beans:[Yl,gc,Xl,Zl,Ql,ec],agStackComponents:[{componentName:"AgGridHeaderDropZones",componentClass:pc}],userComponents:[{componentName:"agGroupColumnFilter",componentClass:fc},{componentName:"agGroupColumnFloatingFilter",componentClass:yc}],dependantModules:[D]},Cc=class extends hc{constructor(e){super(e,"aggregation")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),i=e("values","Values");super.init({icon:Gl._.createIconNoSpan("valuePanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,Gl.Events.EVENT_COLUMN_VALUE_CHANGED,this.refreshGui.bind(this))}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const e=super.getTooltipParams();return e.location="valueColumnsList",e}getIconName(){return this.isPotentialDndItems()?Gl.DragAndDropService.ICON_AGGREGATE:Gl.DragAndDropService.ICON_NOT_ALLOWED}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:Gl.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setValueColumns(e,"toolPanelUi")}getExistingItems(){return this.columnModel.getValueColumns()}};$l([Gl.PostConstruct],Cc.prototype,"passBeansUp",1);var bc=i(98092),Sc=i(98092),wc=i(98092),xc=i(98092),Ec=i(98092),Mc=i(98092),Ac=i(98092),Tc=i(98092),Dc=i(98092),Ic=Object.defineProperty,Rc=Object.defineProperties,Pc=Object.getOwnPropertyDescriptor,kc=Object.getOwnPropertyDescriptors,Lc=Object.getOwnPropertySymbols,Nc=Object.prototype.hasOwnProperty,_c=Object.prototype.propertyIsEnumerable,Oc=(e,t,i)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Fc=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Pc(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Ic(t,i,n),n},Gc=class extends wc.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}setElementToResize(e){this.elementToResize=e}postConstruct(){const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(e,t,i){const s={type:wc.Events.EVENT_TOOL_PANEL_SIZE_CHANGED,width:i,started:e,ended:t};this.eventService.dispatchEvent(s)}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const i=this.inverted?-1:1;let s=Math.max(this.minWidth,Math.floor(this.startingWidth-e*i));null!=this.maxWidth&&(s=Math.min(this.maxWidth,s)),this.elementToResize.style.width=`${s}px`,this.dispatchResizeEvent(!1,t,s)}setInverted(e){this.inverted=e}setMaxWidth(e){this.maxWidth=e}setMinWidth(e){this.minWidth=null!=e?e:100}};Fc([(0,wc.Autowired)("horizontalResizeService")],Gc.prototype,"horizontalResizeService",2),Fc([wc.PostConstruct],Gc.prototype,"postConstruct",1);var Bc=class e extends Mc.Component{constructor(e){super(),this.toolPanelDef=e}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const e=this.createTemplate();this.setTemplate(e),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this)),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return'<div class="ag-side-button" role="presentation">\n                <button type="button" ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">\n                    <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n                    <span ref ="eLabel" class="ag-side-button-label"></span>\n                </button>\n            </div>'}setLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.toolPanelDef,i=e(t.labelKey,t.labelDefault);this.eLabel.innerText=i}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",Mc._.createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchEvent({type:e.EVENT_TOGGLE_BUTTON_CLICKED})}setSelected(e){this.addOrRemoveCssClass("ag-selected",e),Mc._.setAriaExpanded(this.eToggleButton,e)}getButtonElement(){return this.eToggleButton}};Bc.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",Fc([(0,Mc.RefSelector)("eToggleButton")],Bc.prototype,"eToggleButton",2),Fc([(0,Mc.RefSelector)("eIconWrapper")],Bc.prototype,"eIconWrapper",2),Fc([(0,Mc.RefSelector)("eLabel")],Bc.prototype,"eLabel",2),Fc([Mc.PostConstruct],Bc.prototype,"postConstruct",1);var Vc=Bc,Hc=class e extends Ec.Component{constructor(){super(e.TEMPLATE),this.buttonComps=[]}postConstruct(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){if(e.key!==Ec.KeyCode.TAB||!e.shiftKey)return;const t=Ec._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(t,!0)&&e.preventDefault()}setActiveButton(e){this.buttonComps.forEach(t=>{t.setSelected(e===t.getToolPanelId())})}addButtonComp(t){const i=this.createBean(new Vc(t));return this.buttonComps.push(i),this.appendChild(i),i.addEventListener(Vc.EVENT_TOGGLE_BUTTON_CLICKED,()=>{this.dispatchEvent({type:e.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}),i}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),Ec._.clearElement(this.getGui())}};Hc.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",Hc.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',Fc([(0,Ec.Autowired)("focusService")],Hc.prototype,"focusService",2),Fc([(0,Ec.Autowired)("columnModel")],Hc.prototype,"columnModel",2),Fc([Ec.PostConstruct],Hc.prototype,"postConstruct",1),Fc([Ec.PreDestroy],Hc.prototype,"clearButtons",1);var Uc=Hc,zc=class e{static parse(t){if(t){if(!0===t)return{toolPanels:[e.DEFAULT_COLUMN_COMP,e.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if("string"==typeof t)return e.parse([t]);if(Array.isArray(t)){const i=[];if(t.forEach(t=>{const s=e.DEFAULT_BY_KEY[t];s?i.push(s):console.warn(`AG Grid: the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(e.DEFAULT_BY_KEY).join(",")}`)}),0===i.length)return;return{toolPanels:i,defaultToolPanel:i[0].id}}return{toolPanels:e.parseComponents(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}}static parseComponents(t){const i=[];return t?(t.forEach(t=>{let s=null;if("string"==typeof t){const i=e.DEFAULT_BY_KEY[t];if(!i)return void console.warn(`AG Grid: the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(e.DEFAULT_BY_KEY).join(",")}`);s=i}else s=t;i.push(s)}),i):i}};zc.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},zc.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},zc.DEFAULT_BY_KEY={columns:zc.DEFAULT_COLUMN_COMP,filters:zc.DEFAULT_FILTER_COMP};var Wc=zc,jc=class e extends Ac.Component{constructor(){super(e.TEMPLATE)}setupResize(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new Gc);e.setAttribute("id",`ag-${this.getCompId()}`),t.setElementToResize(e),this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){const{id:i,minWidth:s,maxWidth:r,width:n}=e;this.toolPanelId=i,this.width=n;const o=this.userComponentFactory.getToolPanelCompDetails(e,t),a=o.newAgStackInstance();this.params=o.params,null!=a?(a.then(this.setToolPanelComponent.bind(this)),null!=s&&this.resizeBar.setMinWidth(s),null!=r&&this.resizeBar.setMaxWidth(r)):console.warn(`AG Grid: error processing tool panel component ${i}. You need to specify 'toolPanel'`)}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t="left"===e,i=this.gos.get("enableRtl")?t:!t;this.resizeBar.setInverted(i)}refresh(){this.toolPanelCompInstance.refresh(this.params)}};jc.TEMPLATE='<div class="ag-tool-panel-wrapper" role="tabpanel"/>',Fc([(0,Ac.Autowired)("userComponentFactory")],jc.prototype,"userComponentFactory",2),Fc([Ac.PostConstruct],jc.prototype,"setupResize",1);var Kc=jc,$c=class e extends xc.Component{constructor(){super(e.TEMPLATE),this.toolPanelWrappers=[]}postConstruct(){var e;this.sideBarButtonsComp.addEventListener(Uc.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=null!=(e=this.gos.get("initialState"))?e:{};this.setSideBarDef({sideBarDef:Wc.parse(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this),this.createManagedBean(new xc.ManagedFocusFeature(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))}onTabKeyDown(e){if(e.defaultPrevented)return;const{focusService:t,sideBarButtonsComp:i}=this,s=this.getGui(),r=i.getGui(),n=this.gos.getActiveDomElement(),o=s.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target;if(!o)return;if(r.contains(n))return void(t.focusInto(o,e.shiftKey)&&e.preventDefault());if(!e.shiftKey)return;let l=null;o.contains(n)?l=this.focusService.findNextFocusableElement(o,void 0,!0):t.isTargetUnderManagedComponent(o,a)&&e.shiftKey&&(l=this.focusService.findFocusableElementBeforeTabGuard(o,a)),l||(l=r.querySelector(".ag-selected button")),l&&l!==e.target&&(e.preventDefault(),l.focus())}handleKeyDown(e){const t=this.gos.getActiveDomElement();if(!this.sideBarButtonsComp.getGui().contains(t))return;const i=this.sideBarButtonsComp.getGui(),s=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),r=s.findIndex(e=>e.contains(t));let n=null;switch(e.key){case xc.KeyCode.LEFT:case xc.KeyCode.UP:n=Math.max(0,r-1);break;case xc.KeyCode.RIGHT:case xc.KeyCode.DOWN:n=Math.min(r+1,s.length-1)}if(null===n)return;const o=s[n].querySelector("button");o&&(o.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:i}){if(this.setDisplayed(!1),this.sideBar=e,this.sideBar&&this.sideBar.toolPanels){const e=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(e,t,i),!this.toolPanelWrappers.length)return;const s=t?t.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(t?t.position:this.sideBar.position),s)if(t){const{openToolPanel:e}=t;e&&this.openToolPanel(e,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t="left"===e,i=t?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",t),this.addOrRemoveCssClass("ag-side-bar-right",!t),this.toolPanelWrappers.forEach(e=>{e.setResizerSizerSide(i)}),this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED}),this}setDisplayed(e,t){super.setDisplayed(e,t),this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED})}getState(){const e={};return this.toolPanelWrappers.forEach(t=>{var i,s;e[t.getToolPanelId()]=null==(s=null==(i=t.getToolPanelInstance())?void 0:i.getState)?void 0:s.call(i)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,i){var s;for(const r of e)this.createToolPanelAndSideButton(r,null==(s=null==t?void 0:t.toolPanels)?void 0:s[r.id],null==i?void 0:i[r.id])}validateDef(e){if(null==e.id)return console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if("agColumnsToolPanel"===e.toolPanel&&!xc.ModuleRegistry.__assertRegistered(xc.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel",this.context.getGridId()))return!1;if("agFiltersToolPanel"===e.toolPanel){if(!xc.ModuleRegistry.__assertRegistered(xc.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel",this.context.getGridId()))return!1;if(this.filterManager.isAdvancedFilterEnabled())return xc._.warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(e,t,i){if(!this.validateDef(e))return;const s=this.sideBarButtonsComp.addButtonComp(e);let r;i?r=i:(r=this.getContext().createBean(new Kc),r.setToolPanelDef(e,{initialState:t,onStateUpdated:()=>this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED})})),r.setDisplayed(!1);const n=r.getGui();this.appendChild(n),this.toolPanelWrappers.push(r),xc._.setAriaControls(s.getButtonElement(),n)}refresh(){this.toolPanelWrappers.forEach(e=>e.refresh())}openToolPanel(e,t="api"){const i=this.openedItem();i!==e&&(this.toolPanelWrappers.forEach(t=>{const i=e===t.getToolPanelId();t.setDisplayed(i)}),i!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,null!=i?i:void 0,t)))}getToolPanelInstance(e){const t=this.toolPanelWrappers.filter(t=>t.getToolPanelId()===e)[0];if(t)return t.getToolPanelInstance();console.warn(`AG Grid: unable to lookup Tool Panel as invalid key supplied: ${e}`)}raiseToolPanelVisibleEvent(e,t,i){const s=!!e&&!!t;if(t){const e={type:xc.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:i,key:t,visible:!1,switchingToolPanel:s};this.eventService.dispatchEvent(e)}if(e){const t={type:xc.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:i,key:e,visible:!0,switchingToolPanel:s};this.eventService.dispatchEvent(t)}}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;return this.toolPanelWrappers.forEach(t=>{t.isDisplayed()&&(e=t.getToolPanelId())}),e}onSideBarUpdated(){var e;const t=Wc.parse(this.gos.get("sideBar"));let i={};t&&this.sideBar&&(null==(e=t.toolPanels)||e.forEach(e=>{var t,s;const{id:r}=e;if(!r)return;const n=null==(t=this.sideBar.toolPanels)?void 0:t.find(e=>e.id===r);if(!n||e.toolPanel!==n.toolPanel)return;const o=this.toolPanelWrappers.find(e=>e.getToolPanelId()===r);if(!o)return;const a=this.gos.addGridCommonParams((l=((e,t)=>{for(var i in t||(t={}))Nc.call(t,i)&&Oc(e,i,t[i]);if(Lc)for(var i of Lc(t))_c.call(t,i)&&Oc(e,i,t[i]);return e})({},null!=(s=e.toolPanelParams)?s:{}),Rc(l,kc({onStateUpdated:()=>this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED})}))));var l;!0===o.getToolPanelInstance().refresh(a)&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(e=>e!==o),xc._.removeFromParent(o.getGui()),i[r]=o)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:i})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(e=>{xc._.removeFromParent(e.getGui()),this.destroyBean(e)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};$c.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n            <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n        </div>',Fc([(0,xc.Autowired)("focusService")],$c.prototype,"focusService",2),Fc([(0,xc.Autowired)("filterManager")],$c.prototype,"filterManager",2),Fc([(0,xc.Autowired)("sideBarService")],$c.prototype,"sideBarService",2),Fc([(0,xc.RefSelector)("sideBarButtons")],$c.prototype,"sideBarButtonsComp",2),Fc([xc.PostConstruct],$c.prototype,"postConstruct",1);var Yc=$c,qc=class extends Tc.BeanStub{constructor(){super(...arguments),this.isColGroupDef=e=>e&&void 0!==e.children,this.getId=e=>this.isColGroupDef(e)?e.groupId:e.colId}createColumnTree(e){const t=[],i=(e,s)=>{if(this.isColGroupDef(e)){const t=e,r=void 0!==t.groupId?t.groupId:t.headerName,n=new Tc.ProvidedColumnGroup(t,r,!1,s),o=[];return t.children.forEach(e=>{const t=i(e,s+1);t&&o.push(t)}),n.setChildren(o),n}{const i=e,s=i.colId?i.colId:i.field,r=this.columnModel.getPrimaryColumn(s);return r||t.push(i),r}},s=[];return e.forEach(e=>{const t=i(e,0);t&&s.push(t)}),t.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",t),s}syncLayoutWithGrid(e){const t=this.getLeafPathTrees();e(this.mergeLeafPathTrees(t))}getLeafPathTrees(){const e=(t,i)=>{let s;if(t instanceof Tc.ProvidedColumnGroup)if(t.isPadding())s=i;else{const e=Object.assign({},t.getColGroupDef());e.groupId=t.getGroupId(),e.children=[i],s=e}else{const e=Object.assign({},t.getColDef());e.colId=t.getColId(),s=e}const r=t.getOriginalParent();return r?e(r,s):s};return this.columnModel.getAllGridColumns().filter(e=>{const t=e.getColDef();return e.isPrimary()&&!t.showRowGroup}).map(t=>e(t,t.getColDef()))}mergeLeafPathTrees(e){const t=(e,t)=>this.isColGroupDef(e)&&this.isColGroupDef(t)&&this.getId(e)===this.getId(t),i=(e,t)=>{if(!this.isColGroupDef(t))return e;const s=e,r=t;return r.children&&r.groupId&&this.addChildrenToGroup(s,r.groupId,r.children[0])||r.children.forEach(e=>i(s,e)),s},s=[];for(let r=1;r<=e.length;r++){const n=e[r-1],o=e[r];t(n,o)?e[r]=i(n,o):s.push(n)}return s}addChildrenToGroup(e,t,i){if(!this.isColGroupDef(e))return!0;const s=e,r=i;if(((e,t)=>{const i=e.children.map(this.getId),s=Tc._.includes(i,this.getId(t)),r=Tc._.last(e.children),n=r&&this.getId(r)!==this.getId(t);return s&&n})(s,r))return s.children.push(r),!0;if(s.groupId===t){const e=s.children.map(this.getId);if(!Tc._.includes(e,this.getId(r)))return s.children.push(r),!0}return s.children.forEach(e=>this.addChildrenToGroup(e,t,i)),!1}};Fc([(0,Tc.Autowired)("columnModel")],qc.prototype,"columnModel",2),qc=Fc([(0,Tc.Bean)("toolPanelColDefService")],qc);var Xc=class extends Dc.BeanStub{registerSideBarComp(e){this.sideBarComp=e}getSideBarComp(){return this.sideBarComp}};Xc=Fc([(0,Dc.Bean)("sideBarService")],Xc);var Zc={version:"31.3.4",moduleName:Sc.ModuleNames.SideBarModule,beans:[qc,Xc],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:Gc},{componentName:"AgSideBar",componentClass:Yc},{componentName:"AgSideBarButtons",componentClass:Uc}],dependantModules:[D]},Qc=i(98092),Jc=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=Object.getOwnPropertySymbols,ih=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable,rh=(e,t,i)=>t in e?Jc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,nh=(e,t)=>{for(var i in t||(t={}))ih.call(t,i)&&rh(e,i,t[i]);if(th)for(var i of th(t))sh.call(t,i)&&rh(e,i,t[i]);return e},oh=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?eh(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Jc(t,i,n),n},ah=class e extends ml.Component{constructor(){super(e.TEMPLATE)}postConstruct(){this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",e=>{e.key===ml.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedListener(this.eFilterTextField.getInputElement(),"keydown",this.onMiniFilterKeyDown.bind(this)),this.addManagedListener(this.eventService,ml.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));const e=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=ml._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=ml._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=ml._.createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,i=!this.params.suppressColumnExpandAll,s=this.columnModel.isPrimaryColumnGroupsPresent(),r=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(r("searchOoo","Search...")),ml._.setDisplayed(this.eFilterTextField.getGui(),e),ml._.setDisplayed(this.eSelect.getGui(),t),ml._.setDisplayed(this.eExpand,i&&s)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=ml._.debounce(()=>{const e=this.eFilterTextField.getValue();this.dispatchEvent({type:"filterChanged",filterText:e})},e.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===ml.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),e.DEBOUNCE_DELAY)}onSelectClicked(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchEvent({type:0===this.expandState?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,ml._.setDisplayed(this.eExpandChecked,0===this.expandState),ml._.setDisplayed(this.eExpandUnchecked,1===this.expandState),ml._.setDisplayed(this.eExpandIndeterminate,2===this.expandState)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}};ah.DEBOUNCE_DELAY=300,ah.TEMPLATE='<div class="ag-column-select-header" role="presentation">\n            <div ref="eExpand" class="ag-column-select-header-icon"></div>\n            <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n            <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n        </div>',oh([(0,ml.Autowired)("columnModel")],ah.prototype,"columnModel",2),oh([(0,ml.RefSelector)("eExpand")],ah.prototype,"eExpand",2),oh([(0,ml.RefSelector)("eSelect")],ah.prototype,"eSelect",2),oh([(0,ml.RefSelector)("eFilterTextField")],ah.prototype,"eFilterTextField",2),oh([ml.PostConstruct],ah.prototype,"postConstruct",1);var lh=ah,ch=class e{constructor(e,t,i,s=!1,r){this.eventService=new Cl.EventService,this.displayName=e,this.dept=i,this.group=s,s?(this.columnGroup=t,this.expanded=r,this.children=[]):this.column=t}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.eventService.dispatchEvent({type:e.EVENT_EXPANDED_CHANGED}))}setPassesFilter(e){this.passesFilter=e}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}};ch.EVENT_EXPANDED_CHANGED="expandedChanged";var hh=ch,dh=class extends bl.Component{constructor(e,t,i){super('<div class="ag-menu"></div>'),this.column=e,this.mouseEvent=t,this.parentEl=i,this.displayName=null}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),this.column instanceof bl.Column?this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const e=this.getMappedMenuItems();if(0===e.length)return;this.displayContextMenu(e)}}initializeProperties(e){e instanceof bl.ProvidedColumnGroup?this.columns=e.getLeafColumns():this.columns=[e],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const e=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColumnGroupingLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${e("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${e("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>e("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>e("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>e("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(e){return[...e].concat(this.columns.filter(t=>-1===e.indexOf(t)))}removeColumnsFromList(e){return e.filter(e=>-1===this.columns.indexOf(e))}displayContextMenu(e){const t=this.getGui(),i=this.createBean(new bl.AgMenuList),s=this.localeService.getLocaleTextFunc();let r=()=>{};t.appendChild(i.getGui()),i.addMenuItems(e),i.addManagedListener(i,bl.AgMenuItemComponent.EVENT_CLOSE_MENU,()=>{this.parentEl.focus(),r()});const n=this.popupService.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(i.getGui()),ariaLabel:s("ariaLabelContextMenu","Context Menu"),closedCallback:e=>{e instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(i)}});n&&(r=n.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[];for(const t of this.menuItemMap.values()){const i=this.columns.some(e=>t.allowedFunction(e)&&!t.activeFunction(e)),s=this.columns.some(e=>t.allowedFunction(e)&&t.activeFunction(e));i&&e.push({name:t.activateLabel(this.displayName),icon:bl._.createIconNoSpan(t.addIcon,this.gos,null),action:()=>t.activateFunction()}),s&&e.push({name:t.deactivateLabel(this.displayName),icon:bl._.createIconNoSpan(t.removeIcon,this.gos,null),action:()=>t.deActivateFunction()})}return e}};oh([(0,bl.Autowired)("columnModel")],dh.prototype,"columnModel",2),oh([(0,bl.Autowired)("popupService")],dh.prototype,"popupService",2),oh([(0,bl.Autowired)("focusService")],dh.prototype,"focusService",2),oh([bl.PostConstruct],dh.prototype,"postConstruct",1);var uh=class e extends vl.Component{constructor(e,t,i,s){super(),this.modelItem=e,this.allowDragging=t,this.eventType=i,this.focusWrapper=s,this.processingColumnStateChange=!1,this.modelItem=e,this.columnGroup=e.getColumnGroup(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName(),this.allowDragging=t}init(){this.setTemplate(e.TEMPLATE),this.eDragHandle=vl._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,vl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,vl.Events.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,hh.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),vl.CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(e=>this.addOrRemoveCssClass(e,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;let t;"whenTruncated"===this.gos.get("tooltipShowMode")&&(t=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const i=e.headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:t})};i(),this.addManagedListener(this.eventService,vl.Events.EVENT_NEW_COLUMNS_LOADED,i)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumnGroup",e}handleKeyDown(e){switch(e.key){case vl.KeyCode.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case vl.KeyCode.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case vl.KeyCode.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}}onContextMenu(e){const{columnGroup:t,gos:i}=this;if(i.get("functionsReadOnly"))return;const s=this.createBean(new dh(t,e,this.focusWrapper));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}addVisibilityListenersToAllChildren(){this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListener(e,vl.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,vl.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,vl.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,vl.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this))})}setupDragging(){if(!this.allowDragging)return void vl._.setDisplayed(this.eDragHandle,!1);let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:vl.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?vl.DragAndDropService.ICON_HIDE:vl.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:vl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.columnGroup};this.eventService.dispatchEvent(t)},onDragStopped:()=>{const e={type:vl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(e)},onGridEnter:t=>{e&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:null==t?void 0:t.visibleState,pivotState:null==t?void 0:t.pivotState,eventType:this.eventType})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},i={};return e.forEach(e=>{const s=e.getId();t[s]=e.isVisible(),i[s]=this.modelItemUtils.createPivotState(e)}),{columns:e,visibleState:t,pivotState:i}}setupExpandContract(){this.eGroupClosedIcon.appendChild(vl._.createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(vl._.createIcon("columnSelectOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));const e=new vl.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListener(e,vl.TouchListener.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=i=>{i.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?t(i.getChildren()):e.push(i.getColumn()))})};return t(this.modelItem.getChildren()),e}onChangeCommon(e){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),i=this.cbSelect.getValue(),s=void 0===i?e("ariaIndeterminate","indeterminate"):i?e("ariaVisible","visible"):e("ariaHidden","hidden"),r=e("ariaToggleVisibility","Press SPACE to toggle visibility");vl._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${r} (${s})`),vl._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(e),this.cbSelect.setReadOnly(t),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.columnModel.isPivotMode(),t=this.getVisibleLeafColumns();let i=0,s=0;if(t.forEach(t=>{!e&&t.getColDef().lockVisible||(this.isColumnChecked(t,e)?i++:s++)}),!(i>0&&s>0))return i>0}workOutReadOnlyValue(){const e=this.columnModel.isPivotMode();let t=0;return this.columnGroup.getLeafColumns().forEach(i=>{e?i.isAnyFunctionAllowed()&&t++:i.getColDef().lockVisible||t++}),0===t}isColumnChecked(e,t){if(t){const t=e.isPivotActive(),i=e.isRowGroupActive(),s=e.isValueActive();return t||i||s}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.isExpanded();vl._.setDisplayed(this.eGroupClosedIcon,!e),vl._.setDisplayed(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){vl._.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}};uh.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n            <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n                <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n                <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n            </span>\n            <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n            <span class="ag-column-select-column-label" ref="eLabel"></span>\n        </div>',oh([(0,vl.Autowired)("columnModel")],uh.prototype,"columnModel",2),oh([(0,vl.Autowired)("dragAndDropService")],uh.prototype,"dragAndDropService",2),oh([(0,vl.Autowired)("modelItemUtils")],uh.prototype,"modelItemUtils",2),oh([(0,vl.RefSelector)("cbSelect")],uh.prototype,"cbSelect",2),oh([(0,vl.RefSelector)("eLabel")],uh.prototype,"eLabel",2),oh([(0,vl.RefSelector)("eGroupOpenedIcon")],uh.prototype,"eGroupOpenedIcon",2),oh([(0,vl.RefSelector)("eGroupClosedIcon")],uh.prototype,"eGroupClosedIcon",2),oh([(0,vl.RefSelector)("eColumnGroupIcons")],uh.prototype,"eColumnGroupIcons",2),oh([vl.PostConstruct],uh.prototype,"init",1);var ph=uh,gh=class extends yl.BeanStub{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new yl.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:yl.DragSourceType.ToolPanel,listItemDragStartEvent:yl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,listItemDragEndEvent:yl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,eventSource:this.eventService,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:e=>this.isMoveBlocked(e),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.column}isMoveBlocked(e){return!!this.gos.get("suppressMovableColumns")||!!this.getCurrentColumns(e).find(e=>{const t=e.getColDef();return!!t.suppressMovable||!!t.lockPosition})}moveItem(e,t){const i=this.getTargetIndex(e,t),s=this.getCurrentColumns(e);null!=i&&this.columnModel.moveColumns(s,i,"toolPanelUi")}getMoveDiff(e,t){const i=this.columnModel.getAllGridColumns(),s=this.getCurrentColumns(e),r=s[0],n=s.length;return i.indexOf(r)<t?n:0}getCurrentColumns(e){return e instanceof yl.ProvidedColumnGroup?e.getLeafColumns():[e]}getTargetIndex(e,t){if(!t)return null;const i=t.component;let s,r="top"===t.position;if(i instanceof ph?(s=i.getColumns()[0],r=!0):s=i.getColumn(),-1!==this.getCurrentColumns(e).indexOf(s))return null;const n=this.columnModel.getAllGridColumns().indexOf(s),o=r?n:n+1;return o-this.getMoveDiff(e,o)}};oh([(0,yl.Autowired)("columnModel")],gh.prototype,"columnModel",2),oh([yl.PostConstruct],gh.prototype,"postConstruct",1);var mh=class e extends Sl.Component{constructor(e,t,i,s){super(),this.allowDragging=t,this.groupsExist=i,this.focusWrapper=s,this.processingColumnStateChange=!1,this.column=e.getColumn(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName()}init(){this.setTemplate(e.TEMPLATE),this.eDragHandle=Sl._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1");const s=Sl._.escapeString(this.displayName);this.eLabel.innerHTML=s;const r=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${r}`),this.setupDragging(),this.addManagedListener(this.eventService,Sl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,Sl.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,Sl.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,Sl.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,Sl.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,Sl.Events.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),Sl.CssClassApplier.getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(e=>this.addOrRemoveCssClass(e,!0))}getColumn(){return this.column}setupTooltip(){let e;"whenTruncated"===this.gos.get("tooltipShowMode")&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const t=()=>{const t=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:t,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};t(),this.addManagedListener(this.eventService,Sl.Events.EVENT_NEW_COLUMNS_LOADED,t)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumn",e.colDef=this.column.getColDef(),e}onContextMenu(e){const{column:t,gos:i}=this;if(i.get("functionsReadOnly"))return;const s=this.createBean(new dh(t,e,this.focusWrapper));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}handleKeyDown(e){e.key===Sl.KeyCode.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumn","Column"),i=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),s=e("ariaToggleVisibility","Press SPACE to toggle visibility");Sl._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${s} (${i})`),Sl._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging)return void Sl._.setDisplayed(this.eDragHandle,!1);let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:Sl.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?Sl.DragAndDropService.ICON_HIDE:Sl.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:Sl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.column};this.eventService.dispatchEvent(t)},onDragStopped:()=>{const e={type:Sl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(e)},onGridEnter:t=>{e&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:null==t?void 0:t.visibleState,pivotState:null==t?void 0:t.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},i={[e]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:t,pivotState:i}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.columnModel.isPivotMode();if(e){const e=this.column.isAnyFunctionActive();this.cbSelect.setValue(e)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,i=!0;if(e){const e=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();t=!e&&!s,i=t}else{const{enableRowGroup:e,enableValue:s,lockPosition:r,suppressMovable:n,lockVisible:o}=this.column.getColDef();t=!o,i=!!e||!!s||!(r||n)}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!i),this.addOrRemoveCssClass("ag-column-select-column-readonly",!i&&!t);const s=e&&this.gos.get("functionsPassive");this.cbSelect.setPassive(s),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){console.warn("AG Grid: can not expand a column item that does not represent a column group header")}};mh.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n            <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n            <span class="ag-column-select-column-label" ref="eLabel"></span>\n        </div>',oh([(0,Sl.Autowired)("columnModel")],mh.prototype,"columnModel",2),oh([(0,Sl.Autowired)("dragAndDropService")],mh.prototype,"dragAndDropService",2),oh([(0,Sl.Autowired)("modelItemUtils")],mh.prototype,"modelItemUtils",2),oh([(0,Sl.RefSelector)("eLabel")],mh.prototype,"eLabel",2),oh([(0,Sl.RefSelector)("cbSelect")],mh.prototype,"cbSelect",2),oh([Sl.PostConstruct],mh.prototype,"init",1);var fh=mh,yh=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},vh=class e extends fl.Component{constructor(){super(e.TEMPLATE),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(e=>e()),this.destroyColumnItemFuncs=[]}init(e,t,i){this.params=e,this.allowDragging=t,this.eventType=i,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,fl.Events.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,fl.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[fl.Events.EVENT_COLUMN_PIVOT_CHANGED,fl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,fl.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,fl.Events.EVENT_COLUMN_VALUE_CHANGED,fl.Events.EVENT_COLUMN_VISIBLE,fl.Events.EVENT_NEW_COLUMNS_LOADED].forEach(e=>{this.addManagedListener(this.eventService,e,this.fireSelectionChangedEvent.bind(this))}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new fl.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((e,t)=>(fl._.setAriaLevel(t,e.getDept()+1),this.createComponentFromItem(e,t))),this.columnModel.isReady()&&this.onColumnsChanged(),this.params.suppressColumnMove||this.createManagedBean(new gh(this,this.virtualList))}createComponentFromItem(e,t){if(e.isGroup()){const i=new ph(e,this.allowDragging,this.eventType,t);return this.getContext().createBean(i),i}const i=new fh(e,this.allowDragging,this.groupsExist,t);return this.getContext().createBean(i),i}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const e=this.getExpandedStates(),t=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||t?this.buildTreeFromProvidedColumnDefs():this.buildTreeFromWhatGridIsDisplaying(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;return t.forEach(t=>{e[t]=!0}),e}return this.allColsTree?(this.forEachItem(t=>{if(!t.isGroup())return;const i=t.getColumnGroup();i&&(e[i.getId()]=t.isExpanded())}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(i=>{if(!i.isGroup())return;const s=i.getColumnGroup();if(s){const r=e[s.getId()];(null!=r||t)&&i.setExpanded(!!r)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(e){const t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some(e=>e&&void 0!==e.children),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()}buildListModel(e){const t=this.onColumnExpanded.bind(this),i=e=>{e.addEventListener(hh.EVENT_EXPANDED_CHANGED,t);const i=e.removeEventListener.bind(e,hh.EVENT_EXPANDED_CHANGED,t);this.destroyColumnItemFuncs.push(i)},s=(e,t,i)=>{e.forEach(e=>{e instanceof fl.ProvidedColumnGroup?r(e,t,i):n(e,t,i)})},r=(e,t,r)=>{const n=e.getColGroupDef();if(n&&n.suppressColumnsToolPanel)return;if(e.isPadding())return void s(e.getChildren(),t,r);const o=this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),a=new hh(o,e,t,!0,this.expandGroupsByDefault);r.push(a),i(a),s(e.getChildren(),t+1,a.getChildren())},n=(e,t,i)=>{if(e.getColDef()&&e.getColDef().suppressColumnsToolPanel)return;const s=this.columnModel.getDisplayNameForColumn(e,"columnToolPanel");i.push(new hh(s,e,t))};this.destroyColumnTree(),s(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=t=>{t.isPassesFilter()&&(this.displayedColsList.push(t),t.isGroup()&&t.isExpanded()&&t.getChildren().forEach(e))};this.allColsTree.forEach(e),this.virtualList.setModel(new yh(this.displayedColsList));const t=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=t&&this.focusRowIfAlive(t),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),i=e("columns","Columns"),s=this.displayedColsList.length;fl._.setAriaLabel(this.virtualList.getAriaElement(),`${t} ${s} ${i}`)}focusRowIfAlive(e){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}forEachItem(e){const t=i=>{i.forEach(i=>{e(i),i.isGroup()&&t(i.getChildren())})};this.allColsTree&&t(this.allColsTree)}doSetExpandedAll(e){this.forEachItem(t=>{t.isGroup()&&t.setExpanded(e)})}setGroupsExpanded(e,t){if(!t)return void this.doSetExpandedAll(e);const i=[];this.forEachItem(s=>{if(!s.isGroup())return;const r=s.getColumnGroup().getId();t.indexOf(r)>=0&&(s.setExpanded(e),i.push(r))});const s=t.filter(e=>!fl._.includes(i,e));s.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",s)}getExpandState(){let e=0,t=0;return this.forEachItem(i=>{i.isGroup()&&(i.isExpanded()?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const i=this.columnModel.isPivotMode();if(this.forEachItem(s=>{if(s.isGroup())return;if(!s.isPassesFilter())return;const r=s.getColumn(),n=r.getColDef();let o;if(i){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;o=r.isValueActive()||r.isPivotActive()||r.isRowGroupActive()}else{if(n.lockVisible)return;o=r.isVisible()}o?e++:t++}),!(e>0&&t>0))return!(0===e||t>0)}setFilterText(e){this.filterText=fl._.exists(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=e=>{if(!fl._.exists(this.filterText))return!0;const t=e.getDisplayName();return null==t||-1!==t.toLowerCase().indexOf(this.filterText)},t=(i,s)=>{let r=!1;if(i.isGroup()){const n=e(i);i.getChildren().forEach(e=>{const i=t(e,n||s);i&&(r=i)})}const n=!(!s&&!r)||e(i);return i.setPassesFilter(n),n};this.allColsTree.forEach(e=>t(e,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree?(this.forEachItem(t=>{t.isGroup()&&t.isExpanded()&&e.push(t.getColumnGroup().getId())}),e):e}};vh.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',oh([(0,fl.Autowired)("columnModel")],vh.prototype,"columnModel",2),oh([(0,fl.Autowired)("toolPanelColDefService")],vh.prototype,"colDefService",2),oh([(0,fl.Autowired)("modelItemUtils")],vh.prototype,"modelItemUtils",2),oh([fl.PreDestroy],vh.prototype,"destroyColumnTree",1);var Ch=vh,bh=class extends xl.Component{createTemplate(){return'<div class="ag-pivot-mode-panel">\n                <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n            </div>'}init(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const e=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(e("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,xl.Events.EVENT_FIELD_VALUE_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,xl.Events.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,xl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))}onBtPivotMode(){const e=!!this.cbPivotMode.getValue();if(e!==this.columnModel.isPivotMode()){this.gos.updateGridOptions({options:{pivotMode:e},source:"toolPanelUi"});const{api:t}=this;t&&t.refreshHeader()}}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.cbPivotMode.setValue(e)}};oh([(0,xl.Autowired)("columnModel")],bh.prototype,"columnModel",2),oh([(0,xl.Autowired)("gridApi")],bh.prototype,"api",2),oh([(0,xl.RefSelector)("cbPivotMode")],bh.prototype,"cbPivotMode",2),oh([xl.PreConstruct],bh.prototype,"init",1);var Sh=class e extends bc.Component{constructor(){super(e.TEMPLATE)}init(e,t,i){this.allowDragging=e,this.params=t,this.eventType=i,this.primaryColsHeaderPanel.init(this.params);const s=this.params.suppressColumnFilter,r=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&s&&r&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new bc.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}onFilterChanged(e){this.primaryColsListPanel.setFilterText(e.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(e){this.primaryColsHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}onSelectionChange(e){this.primaryColsHeaderPanel.setSelectionState(e.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}};Sh.TEMPLATE='<div class="ag-column-select">\n            <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n            <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n        </div>',oh([(0,bc.RefSelector)("primaryColsHeaderPanel")],Sh.prototype,"primaryColsHeaderPanel",2),oh([(0,bc.RefSelector)("primaryColsListPanel")],Sh.prototype,"primaryColsListPanel",2);var wh=Sh,xh=class e extends wl.Component{constructor(){super(e.TEMPLATE),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params=nh(nh({},t),e),this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new bh),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new wh),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new dc(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Cc(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new uc(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const e=this.addManagedListener(this.eventService,wl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>{this.resetChildrenHeight(),this.setLastVisible()});this.childDestroyFuncs.push(()=>e())}this.initialised=!0}setPivotModeSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new bh),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new dc(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new Cc(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new uc(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(e=>{if(!e)return;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))})}setLastVisible(){const e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach(e=>e.classList.remove("ag-last-column-drop"));const t=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=wl._.last(t);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let t=0;t<e.length;t++){const i=e[t];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return wl.ModuleRegistry.__assertRegistered(wl.ModuleNames.RowGroupingModule,"Row Grouping",this.context.getGridId())}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(e=>e()),this.childDestroyFuncs.length=0,wl._.clearElement(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}};xh.TEMPLATE='<div class="ag-column-panel"></div>';var Eh=xh,Mh=class{selectAllChildren(e,t,i){const s=this.extractAllLeafColumns(e);this.setAllColumns(s,t,i)}setColumn(e,t,i){this.setAllColumns([e],t,i)}setAllColumns(e,t,i){this.columnModel.isPivotMode()?this.setAllPivot(e,t,i):this.setAllVisible(e,t,i)}extractAllLeafColumns(e){const t=[],i=e=>{e.forEach(e=>{e.isPassesFilter()&&(e.isGroup()?i(e.getChildren()):t.push(e.getColumn()))})};return i(e),t}setAllVisible(e,t,i){const s=[];e.forEach(e=>{e.getColDef().lockVisible||e.isVisible()!=t&&s.push({colId:e.getId(),hide:!t})}),s.length>0&&this.columnModel.applyColumnState({state:s},i)}setAllPivot(e,t,i){this.gos.get("functionsPassive")?this.setAllPivotPassive(e,t):this.setAllPivotActive(e,t,i)}setAllPivotPassive(e,t){const i=this.columnModel.getPivotColumns().slice(),s=this.columnModel.getValueColumns().slice(),r=this.columnModel.getRowGroupColumns().slice();let n=!1,o=!1,a=!1;const l=t?e=>{e.isAnyFunctionActive()||(e.isAllowValue()?(s.push(e),o=!0):e.isAllowRowGroup()?(r.push(e),n=!0):e.isAllowPivot()&&(i.push(e),a=!0))}:e=>{e.isAnyFunctionActive()&&(i.indexOf(e)>=0&&(Qc._.removeFromArray(i,e),n=!0),s.indexOf(e)>=0&&(Qc._.removeFromArray(s,e),o=!0),r.indexOf(e)>=0&&(Qc._.removeFromArray(r,e),a=!0))};if(e.forEach(l),n){const e={type:Qc.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:i};this.eventService.dispatchEvent(e)}if(a){const e={type:Qc.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:r};this.eventService.dispatchEvent(e)}if(o){const e={type:Qc.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:r};this.eventService.dispatchEvent(e)}}setAllPivotActive(e,t,i){const s=[],r=t?e=>{if(!e.isAnyFunctionActive())if(e.isAllowValue()){const t="string"==typeof e.getAggFunc()?e.getAggFunc():this.aggFuncService.getDefaultAggFunc(e);s.push({colId:e.getId(),aggFunc:t})}else e.isAllowRowGroup()?s.push({colId:e.getId(),rowGroup:!0}):e.isAllowPivot()&&s.push({colId:e.getId(),pivot:!0})}:e=>{(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&s.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};e.forEach(r),s.length>0&&this.columnModel.applyColumnState({state:s},i)}updateColumns(e){const{columns:t,visibleState:i,pivotState:s,eventType:r}=e,n=t.map(e=>{const t=e.getColId();if(this.columnModel.isPivotMode()){const e=null==s?void 0:s[t];return{colId:t,pivot:null==e?void 0:e.pivot,rowGroup:null==e?void 0:e.rowGroup,aggFunc:null==e?void 0:e.aggFunc}}return{colId:t,hide:!(null==i?void 0:i[t])}});this.columnModel.applyColumnState({state:n},r)}createPivotState(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}};oh([(0,Qc.Autowired)("aggFuncService")],Mh.prototype,"aggFuncService",2),oh([(0,Qc.Autowired)("columnModel")],Mh.prototype,"columnModel",2),oh([(0,Qc.Autowired)("gridOptionsService")],Mh.prototype,"gos",2),oh([(0,Qc.Autowired)("eventService")],Mh.prototype,"eventService",2),Mh=oh([(0,Qc.Bean)("modelItemUtils")],Mh);var Ah,Th,Dh,Ih,Rh,Ph,kh,Lh,Nh,_h={version:"31.3.4",moduleName:gl.ModuleNames.ColumnsToolPanelModule,beans:[Mh],agStackComponents:[{componentName:"AgPrimaryColsHeader",componentClass:lh},{componentName:"AgPrimaryColsList",componentClass:Ch},{componentName:"AgPrimaryCols",componentClass:wh}],userComponents:[{componentName:"agColumnsToolPanel",componentClass:Eh}],dependantModules:[D,vc,Zc]},Oh=i(98092),Fh=i(98092),Gh=i(98092),Bh=i(98092),Vh=i(98092),Hh=i(98092),Uh=i(98092),zh=i(98092),Wh=i(98092),jh=i(98092),Kh=i(98092),$h=i(98092),Yh=i(98092),qh=Object.defineProperty,Xh=Object.defineProperties,Zh=Object.getOwnPropertyDescriptor,Qh=Object.getOwnPropertyDescriptors,Jh=Object.getOwnPropertySymbols,ed=Object.prototype.hasOwnProperty,td=Object.prototype.propertyIsEnumerable,id=(e,t,i)=>t in e?qh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,sd=(e,t)=>{for(var i in t||(t={}))ed.call(t,i)&&id(e,i,t[i]);if(Jh)for(var i of Jh(t))td.call(t,i)&&id(e,i,t[i]);return e},rd=(e,t)=>Xh(e,Qh(t)),nd=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Zh(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&qh(t,i,n),n},od={getTemplate(e){const t=(new Date).toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t}]}}},ad={getTemplate(e){const{name:t,ContentType:i,Extension:s,PartName:r}=e;return{name:t,properties:{rawMap:{Extension:s,PartName:r,ContentType:i}}}}},ld={getTemplate(e){const t=new Array(e).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${t+1}.xml`})),i=Ou.worksheetImages.size,s=Ou.worksheetHeaderFooterImages.size,r=Ou.worksheetDataTables.size,n={};Ou.workbookImageIds.forEach(e=>{const t="jpg"===e.type?"jpeg":e.type;n[t]=!0});const o=new Array(i).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${t+1}.xml`})),a=new Array(r).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${Ou.getTableNameFromIndex(t)}.xml`})),l=Object.keys(n).map(e=>({name:"Default",ContentType:`image/${e}`,Extension:e}));return s&&l.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:[...l,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...t,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...o,...a,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"}].map(e=>ad.getTemplate(e))}}},cd={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},hd=e=>Math.round(96*e/72),dd=e=>Math.ceil(9525*e),ud=(e,t)=>{if(!t)return;let i;return i="number"==typeof t?t:t({rowIndex:e}),s=i,Math.round(72*s/96);var s},pd=(e,t)=>{const i=Bh.XmlFactory.createHeader({encoding:"UTF-8",standalone:"yes"}),s=Bh.XmlFactory.createXml(e);return t?s:`${i}${s}`},gd=e=>{const t=String.fromCharCode,i=Math.floor(e/26),s=e%26;return i&&26!==e?s?i<26?t(65+i-1)+t(65+s-1):gd(i)+t(65+s-1):gd(i-1)+"Z":t(65+e-1)},md=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),fd=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor&&e.recolor.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},yd=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:null!=e.altText?e.altText:void 0}},children:[fd(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),vd=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:1e3*e.saturation}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:1e3*e.tint}}}),t},Cd=(e,t)=>{let i;if(e.transparency){const t=Math.min(Math.max(e.transparency,0),100);i=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(1e3*t)}}}]}if(e.recolor)switch(i||(i=[]),e.recolor.toLocaleLowerCase()){case"grayscale":i.push({name:"a:grayscl"});break;case"sepia":i.push((r={color:"D9C3A5",tint:50,saturation:180},{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:(s={color:"black"}).color}},children:vd(s)},{name:"a:srgbClr",properties:{rawMap:{val:r.color}},children:vd(r)}]}));break;case"washout":i.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}})}var s,r;return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:i},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},bd=(e,t)=>{const i={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const t=e.rotation;i.properties={rawMap:{rot:6e4*Math.min(Math.max(t,0),360)}}}return{name:"xdr:spPr",children:[i,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},Sd=(e,t,i,s)=>({name:"xdr:pic",children:[yd(e,t+1),Cd(e,i+1),bd(e,s)]}),wd={getTemplate(e){const{sheetIndex:t}=e,i=Ou.worksheetImages.get(t),s=Ou.worksheetImageIds.get(t);return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:i.map((e,t)=>{const i=(e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:i,width:s=0,height:r=0,totalHeight:n,totalWidth:o}=e,{offsetX:a=0,offsetY:l=0,row:c=1,rowSpan:h=1,column:d=1,colSpan:u=1}=t;return{from:{row:c-1,col:d-1,offsetX:dd(a),offsetY:dd(l)},to:{row:c-1+(i?1:h-1),col:d-1+(i?1:u-1),offsetX:dd(s+a),offsetY:dd(r+l)},height:dd(n||r),width:dd(o||s)}})(e);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[md("from",i.from),md("to",i.to),Sd(e,t,s.get(e.id).index,i),{name:"xdr:clientData"}]}})}}},xd={getTemplate(e,t){const{name:i,columns:s,rowCount:r,displayName:n,headerRowIndex:o,showRowStripes:a,showColumnStripes:l,showFilterButtons:c,highlightFirstColumn:h,highlightLastColumn:d}=e||{};if(!(e&&i&&Array.isArray(s)&&s.length&&r))return{name:"table"};const u=s.map((e,t)=>({name:"filterColumn",properties:{rawMap:{colId:t.toString(),hiddenButton:c[t]?0:1}}})),p=o+1,g=(t+1).toString(),m=`A${p}:${String.fromCharCode(64+s.length)}${p+r}`;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:i,displayName:t?`${n}_${t+1}`:n,ref:m,totalsRowShown:0,id:g}},children:[{name:"autoFilter",properties:{rawMap:{ref:m}},children:u},{name:"tableColumns",properties:{rawMap:{count:s.length}},children:s.map((e,t)=>({name:"tableColumn",properties:{rawMap:{id:(t+1).toString(),name:e,dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:h?1:0,showLastColumn:d?1:0,showRowStripes:a?1:0,showColumnStripes:l?1:0}}}]}}},Ed=e=>{const[t,i,s,r]=e;return{name:`a:${t}`,children:[{name:`a:${i}`,properties:{rawMap:{val:s,lastClr:r}}}]}},Md=()=>({name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[Ed(["dk1","sysClr","windowText","000000"]),Ed(["lt1","sysClr","window","FFFFFF"]),Ed(["dk2","srgbClr","44546A"]),Ed(["lt2","srgbClr","E7E6E6"]),Ed(["accent1","srgbClr","4472C4"]),Ed(["accent2","srgbClr","ED7D31"]),Ed(["accent3","srgbClr","A5A5A5"]),Ed(["accent4","srgbClr","FFC000"]),Ed(["accent5","srgbClr","5B9BD5"]),Ed(["accent6","srgbClr","70AD47"]),Ed(["hlink","srgbClr","0563C1"]),Ed(["folHlink","srgbClr","954F72"])]}),Ad=e=>{const[t,i,s,r]=e;return{name:`a:${t}`,properties:{rawMap:{script:s,typeface:i,panose:r}}}},Td=()=>({name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[Ad(["latin","Calibri Light",void 0,"020F0302020204030204"]),Ad(["ea",""]),Ad(["cs",""]),Ad(["font","游ゴシック Light","Jpan"]),Ad(["font","맑은 고딕","Hang"]),Ad(["font","等线 Light","Hans"]),Ad(["font","新細明體","Hant"]),Ad(["font","Times New Roman","Arab"]),Ad(["font","Times New Roman","Hebr"]),Ad(["font","Tahoma","Thai"]),Ad(["font","Nyala","Ethi"]),Ad(["font","Vrinda","Beng"]),Ad(["font","Shruti","Gujr"]),Ad(["font","MoolBoran","Khmr"]),Ad(["font","Tunga","Knda"]),Ad(["font","Raavi","Guru"]),Ad(["font","Euphemia","Cans"]),Ad(["font","Plantagenet Cherokee","Cher"]),Ad(["font","Microsoft Yi Baiti","Yiii"]),Ad(["font","Microsoft Himalaya","Tibt"]),Ad(["font","MV Boli","Thaa"]),Ad(["font","Mangal","Deva"]),Ad(["font","Gautami","Telu"]),Ad(["font","Latha","Taml"]),Ad(["font","Estrangelo Edessa","Syrc"]),Ad(["font","Kalinga","Orya"]),Ad(["font","Kartika","Mlym"]),Ad(["font","DokChampa","Laoo"]),Ad(["font","Iskoola Pota","Sinh"]),Ad(["font","Mongolian Baiti","Mong"]),Ad(["font","Times New Roman","Viet"]),Ad(["font","Microsoft Uighur","Uigh"]),Ad(["font","Sylfaen","Geor"]),Ad(["font","Arial","Armn"]),Ad(["font","Leelawadee UI","Bugi"]),Ad(["font","Microsoft JhengHei","Bopo"]),Ad(["font","Javanese Text","Java"]),Ad(["font","Segoe UI","Lisu"]),Ad(["font","Myanmar Text","Mymr"]),Ad(["font","Ebrima","Nkoo"]),Ad(["font","Nirmala UI","Olck"]),Ad(["font","Ebrima","Osma"]),Ad(["font","Phagspa","Phag"]),Ad(["font","Estrangelo Edessa","Syrn"]),Ad(["font","Estrangelo Edessa","Syrj"]),Ad(["font","Estrangelo Edessa","Syre"]),Ad(["font","Nirmala UI","Sora"]),Ad(["font","Microsoft Tai Le","Tale"]),Ad(["font","Microsoft New Tai Lue","Talu"]),Ad(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[Ad(["latin","Calibri",void 0,"020F0502020204030204"]),Ad(["ea",""]),Ad(["cs",""]),Ad(["font","游ゴシック","Jpan"]),Ad(["font","맑은 고딕","Hang"]),Ad(["font","等线","Hans"]),Ad(["font","新細明體","Hant"]),Ad(["font","Arial","Arab"]),Ad(["font","Arial","Hebr"]),Ad(["font","Tahoma","Thai"]),Ad(["font","Nyala","Ethi"]),Ad(["font","Vrinda","Beng"]),Ad(["font","Shruti","Gujr"]),Ad(["font","DaunPenh","Khmr"]),Ad(["font","Tunga","Knda"]),Ad(["font","Raavi","Guru"]),Ad(["font","Euphemia","Cans"]),Ad(["font","Plantagenet Cherokee","Cher"]),Ad(["font","Microsoft Yi Baiti","Yiii"]),Ad(["font","Microsoft Himalaya","Tibt"]),Ad(["font","MV Boli","Thaa"]),Ad(["font","Mangal","Deva"]),Ad(["font","Gautami","Telu"]),Ad(["font","Latha","Taml"]),Ad(["font","Estrangelo Edessa","Syrc"]),Ad(["font","Kalinga","Orya"]),Ad(["font","Kartika","Mlym"]),Ad(["font","DokChampa","Laoo"]),Ad(["font","Iskoola Pota","Sinh"]),Ad(["font","Mongolian Baiti","Mong"]),Ad(["font","Arial","Viet"]),Ad(["font","Microsoft Uighur","Uigh"]),Ad(["font","Sylfaen","Geor"]),Ad(["font","Arial","Armn"]),Ad(["font","Leelawadee UI","Bugi"]),Ad(["font","Microsoft JhengHei","Bopo"]),Ad(["font","Javanese Text","Java"]),Ad(["font","Segoe UI","Lisu"]),Ad(["font","Myanmar Text","Mymr"]),Ad(["font","Ebrima","Nkoo"]),Ad(["font","Nirmala UI","Olck"]),Ad(["font","Ebrima","Osma"]),Ad(["font","Phagspa","Phag"]),Ad(["font","Estrangelo Edessa","Syrn"]),Ad(["font","Estrangelo Edessa","Syrj"]),Ad(["font","Estrangelo Edessa","Syre"]),Ad(["font","Nirmala UI","Sora"]),Ad(["font","Microsoft Tai Le","Tale"]),Ad(["font","Microsoft New Tai Lue","Talu"]),Ad(["font","Ebrima","Tfng"])]}]}),Dd=(e,t,i)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:i}),Id=e=>{const[t,i,s,r,n,o]=e,a=[];return a.push(Dd("satMod",s)),r&&a.push(Dd("lumMod",r)),n&&a.push(Dd("tint",n)),o&&a.push(Dd("shade",o)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:i}},children:a}]}},Rd=(e,t)=>({name:"a:solidFill",children:[Dd("schemeClr",e,t)]}),Pd=e=>{const[t,i,s,r,n]=e,[o,a]=n;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[Id(i),Id(s),Id(r)]},{name:"a:lin",properties:{rawMap:{ang:o,scaled:a}}}]}},kd=e=>{const[t,i,s,r]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:i,cmpd:s,algn:r}},children:[Rd("phClr"),Dd("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},Ld=e=>{const t=[];if(e){const[i,s,r,n,o]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:i,dist:s,dir:r,algn:n,rotWithShape:o}},children:[Dd("srgbClr","000000",[Dd("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},Nd=()=>({name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:fillStyleLst",children:[Rd("phClr"),Pd(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),Pd(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]},{name:"a:lnStyleLst",children:[kd(["6350","flat","sng","ctr"]),kd(["12700","flat","sng","ctr"]),kd(["19050","flat","sng","ctr"])]},{name:"a:effectStyleLst",children:[Ld(),Ld(),Ld(["57150","19050","5400000","ctr","0"])]},{name:"a:bgFillStyleLst",children:[Rd("phClr"),Rd("phClr",[Dd("tint","95000"),Dd("satMod","170000")]),Pd(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}]}),_d=()=>({name:"a:themeElements",children:[Md(),Td(),Nd()]}),Od=()=>({name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[_d(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}),Fd=e=>{const t=[];for(const i of e.keys()){const e=i.toString(),s={name:"t",textNode:Vh._.escapeString(e)};e.trim().length!==e.length&&(s.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[s]})}return t},Gd=e=>({name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:Fd(e)}),Bd={getTemplate(e){let{formatCode:t,numFmtId:i}=e;return t.length&&(t=function(e){const t=e.split(/(\[[^\]]*\])/);for(let e=0;e<t.length;e++){let i=t[e];i.length&&(i.startsWith("[")||(i=i.replace(/\$/g,'"$"')),t[e]=Hh._.escapeString(i))}return t.join("")}(t)),{name:"numFmt",properties:{rawMap:{formatCode:t,numFmtId:i}}}}},Vd=e=>({name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map(e=>Bd.getTemplate(e))}),Hd={getTemplate(e){const{size:t,colorTheme:i,color:s="FF000000",fontName:r="Calibri",family:n,scheme:o,italic:a,bold:l,strikeThrough:c,outline:h,shadow:d,underline:u,verticalAlign:p}=e,g=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:i,rgb:s}}},{name:"name",properties:{rawMap:{val:r}}}];return n&&g.push({name:"family",properties:{rawMap:{val:n}}}),o&&g.push({name:"scheme",properties:{rawMap:{val:o}}}),a&&g.push({name:"i"}),l&&g.push({name:"b"}),c&&g.push({name:"strike"}),h&&g.push({name:"outline"}),d&&g.push({name:"shadow"}),u&&g.push({name:"u",properties:{rawMap:{val:u}}}),p&&g.push({name:"vertAlign",properties:{rawMap:{val:p}}}),{name:"font",children:g}}},Ud=e=>({name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(e=>Hd.getTemplate(e))}),zd={getTemplate(e){const{patternType:t,fgTheme:i,fgTint:s,fgRgb:r,bgRgb:n,bgIndexed:o}=e,a={name:"patternFill",properties:{rawMap:{patternType:t}}};return(i||s||r)&&(a.children=[{name:"fgColor",properties:{rawMap:{theme:i,tint:s,rgb:r}}}]),(o||n)&&(a.children||(a.children=[]),a.children.push({name:"bgColor",properties:{rawMap:{indexed:o,rgb:n}}})),{name:"fill",children:[a]}}},Wd=e=>({name:"fills",properties:{rawMap:{count:e.length}},children:e.map(e=>zd.getTemplate(e))}),jd={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot"},Kd=["Dashed","DashDot","DashDotDot"],$d={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},Yd={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},qd={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},Xd=e=>null==e?e:("#"===e.charAt(0)&&(e=e.substring(1)),6===e.length?"FF"+e:e),Zd=(e,t)=>{if(!e)return"thin";const i=(e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}})(t),s=jd[e];return"Continuous"===e?i:"medium"===i&&-1!==Kd.indexOf(s)?`medium${s}`:s.charAt(0).toLowerCase()+s.substring(1)},Qd=e=>Yd[e]||"general",Jd=e=>qd[e]||void 0,eu=e=>({name:"color",properties:{rawMap:{rgb:Xd(e||"#000000")}}}),tu={getTemplate(e){const{left:t,right:i,top:s,bottom:r,diagonal:n}=e,o=t?[eu(t.color)]:void 0,a=i?[eu(i.color)]:void 0,l=s?[eu(s.color)]:void 0,c=r?[eu(r.color)]:void 0,h=n?[eu(n.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t&&t.style}},children:o},{name:"right",properties:{rawMap:{style:i&&i.style}},children:a},{name:"top",properties:{rawMap:{style:s&&s.style}},children:l},{name:"bottom",properties:{rawMap:{style:r&&r.style}},children:c},{name:"diagonal",properties:{rawMap:{style:n&&n.style}},children:h}]}}},iu=e=>({name:"borders",properties:{rawMap:{count:e.length}},children:e.map(e=>tu.getTemplate(e))}),su=e=>{const t=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(t,0)},ru={getTemplate(e){const{horizontal:t,indent:i,readingOrder:s,rotate:r,shrinkToFit:n,vertical:o,wrapText:a}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&Qd(t),indent:i,readingOrder:s&&su(s),textRotation:r,shrinkToFit:n,vertical:o&&Jd(o),wrapText:a}}}}},nu={getTemplate(e){const t=!1===e.protected?0:1;return{name:"protection",properties:{rawMap:{hidden:!0===e.hideFormula?1:0,locked:t}}}}},ou={getTemplate(e){const{alignment:t,borderId:i,fillId:s,fontId:r,numFmtId:n,protection:o,quotePrefix:a,xfId:l}=e,c=[];return t&&c.push(ru.getTemplate(t)),o&&c.push(nu.getTemplate(o)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:o?1:void 0,applyBorder:i?1:void 0,applyFill:s?1:void 0,borderId:i,fillId:s,applyFont:r?1:void 0,fontId:r,applyNumberFormat:n?1:void 0,numFmtId:n,quotePrefix:a?1:void 0,xfId:l}},children:c.length?c:void 0}}},au=e=>({name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>ou.getTemplate(e))}),lu=e=>({name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>ou.getTemplate(e))}),cu={getTemplate(e){const{builtinId:t,name:i,xfId:s}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:i,xfId:s}}}}},hu=e=>({name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(e=>cu.getTemplate(e))}),du=(e,t)=>(-1!==e.indexOf("mixedStyle")&&t>1&&(e+=`_${t}`),e),uu=()=>{Ah={base:0},Th=[],Dh=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],Ih=[{patternType:"none"},{patternType:"gray125"}],Rh=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],Ph=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],kh=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],Lh=[{builtinId:0,name:"Normal",xfId:0}]},pu=e=>{const{alignment:t,borders:i,font:s,interior:r,numberFormat:n,protection:o,quotePrefix:a}=e;let{id:l}=e,c=0,h=0,d=0,u=0;l&&(l=du(l,Nh),null==Ah[l]&&(r&&(c=(e=>{const t=(i=e.pattern)?$d[i]||i:"none";var i;const s=Xd(e.color),r=Xd(e.patternColor);let n=Ih.findIndex(e=>{const{patternType:i,fgRgb:n,bgRgb:o}=e;return i==t&&n==s&&o==r});return-1===n&&(n=Ih.length,Ih.push({patternType:t,fgRgb:s,bgRgb:r})),n})(r)),i&&(h=(e=>{const{borderBottom:t,borderTop:i,borderLeft:s,borderRight:r}=e;let n,o,a,l,c,h,d,u;s&&(a=Zd(s.lineStyle,s.weight),d=Xd(s.color)),r&&(l=Zd(r.lineStyle,r.weight),u=Xd(r.color)),t&&(n=Zd(t.lineStyle,t.weight),c=Xd(t.color)),i&&(o=Zd(i.lineStyle,i.weight),h=Xd(i.color));let p=Rh.findIndex(e=>{const{left:t,right:i,top:s,bottom:r}=e;if(!t&&(a||d))return!1;if(!i&&(l||u))return!1;if(!s&&(o||h))return!1;if(!r&&(n||c))return!1;const{style:p,color:g}=t||{},{style:m,color:f}=i||{},{style:y,color:v}=s||{},{style:C,color:b}=r||{};return p==a&&g==d&&m==l&&f==u&&y==o&&v==h&&C==n&&b==c});return-1===p&&(p=Rh.length,Rh.push({left:{style:a,color:d},right:{style:l,color:u},top:{style:o,color:h},bottom:{style:n,color:c},diagonal:{style:void 0,color:void 0}})),p})(i)),s&&(d=(e=>{const{fontName:t="Calibri",color:i,size:s,bold:r,italic:n,outline:o,shadow:a,strikeThrough:l,underline:c,family:h,verticalAlign:d}=e,u=Xd(i),p=(e=>{if(void 0===e)return;const t=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(t,0)})(h),g=c?c.toLocaleLowerCase():void 0,m=d?d.toLocaleLowerCase():void 0;let f=Dh.findIndex(e=>e.fontName==t&&e.color==u&&e.size==s&&e.bold==r&&e.italic==n&&e.outline==o&&e.shadow==a&&e.strikeThrough==l&&e.underline==g&&e.verticalAlign==m&&e.family==p);return-1===f&&(f=Dh.length,Dh.push({fontName:t,color:u,size:s,bold:r,italic:n,outline:o,shadow:a,strikeThrough:l,underline:g,verticalAlign:m,family:null!=p?p.toString():void 0})),f})(s)),n&&(u=(e=>{if(cd[e])return cd[e];let t=Th.findIndex(t=>t.formatCode===e);return-1===t?(t=Th.length+164,Th.push({formatCode:e,numFmtId:t})):t=Th[t].numFmtId,t})(n.format)),Ah[l]=kh.length,kh.push({alignment:t,borderId:h||0,fillId:c||0,fontId:d||0,numFmtId:u||0,protection:o,quotePrefix:a,xfId:0})))},gu=(e,t)=>Ah[du(e,t)]||0,mu={getTemplate(e){const t=Vd(Th),i=Ud(Dh.map(t=>rd(sd({},t),{size:null!=t.size?t.size:e}))),s=Wd(Ih),r=iu(Rh),n=au(Ph),o=lu(kh),a=hu(Lh);return uu(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,i,s,r,n,o,a,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},fu={getTemplate(e,t){const i=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:i,"r:id":`rId${i}`}}}}},yu=e=>({name:"sheets",children:e.map((e,t)=>fu.getTemplate(e,t))}),vu=e=>({name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[yu(e)]}),Cu={getTemplate(e){const{min:t,max:i,outlineLevel:s,s:r,width:n,hidden:o,bestFit:a}=e;let l=1,c="0";return n>1&&(l=(e=>Math.ceil((e-12)/7+1))(n),c="1"),{name:"col",properties:{rawMap:{min:t,max:i,outlineLevel:null!=s?s:void 0,width:l,style:r,hidden:o?"1":"0",bestFit:a?"1":"0",customWidth:c}}}}},bu={getTemplate(e,t,i){const{ref:s,data:r,styleId:n}=e,{type:o,value:a}=r||{type:"empty",value:null};let l=o;"f"===o?l="str":o.charAt(0)===o.charAt(0).toUpperCase()&&(l=(e=>{const t=e.charAt(0).toLowerCase();return"s"===t?"inlineStr":t})(o));const c={name:"c",properties:{rawMap:{r:s,t:"empty"===l?void 0:l,s:n?gu(n,i):void 0}}};if("empty"===l)return c;let h;return h="str"===l&&"f"===o?[{name:"f",textNode:zh._.escapeString(a)}]:"inlineStr"===l?[{name:"is",children:[{name:"t",textNode:zh._.escapeString(a)}]}]:[{name:"v",textNode:a}],Object.assign({},c,{children:h})}},Su=e=>{var t;return""!==(null==(t=e.data)?void 0:t.value)||void 0!==e.styleId},wu={getTemplate(e,t,i){const{collapsed:s,hidden:r,height:n,outlineLevel:o,cells:a=[]}=e;return((e,t)=>{const i=[];let s=0;for(let t=0;t<e.length;t++){const r=e[t];r.mergeAcross&&(i.push({pos:t,excelPos:s}),s+=r.mergeAcross),s++}if(i.length)for(let s=i.length-1;s>=0;s--){const r=[],n=e[i[s].pos];for(let e=1;e<=n.mergeAcross;e++)r.push({ref:`${gd(i[s].excelPos+1+e)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});r.length&&e.splice(i[s].pos+1,0,...r)}})(a,t),{name:"row",properties:{rawMap:{r:t+1,collapsed:s?"1":"0",hidden:r?"1":"0",ht:n,customHeight:null!=n?"1":"0",spans:"1:1",outlineLevel:o||void 0}},children:a.filter(Su).map((e,t)=>bu.getTemplate(e,t,i))}}},xu=e=>({name:"mergeCell",properties:{rawMap:{ref:e}}}),Eu=e=>{if(null==e)return 1;const t=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return-1===t?1:t+1},Mu=(e,t,i)=>e.reduce((e,s,r)=>{const n="Center"===(o=s.position)?"C":"Right"===o?"R":"L";var o;const a=(l=`${e}&amp;${n}`,(c=s.font)?(l+="&amp;&quot;",l+=c.fontName||"Calibri",c.bold!==c.italic?l+=c.bold?",Bold":",Italic":c.bold?l+=",Bold Italic":l+=",Regular",l+="&quot;",c.size&&(l+=`&amp;${c.size}`),c.strikeThrough&&(l+="&amp;S"),c.underline&&(l+="&amp;"+("Double"===c.underline?"E":"U")),c.color&&(l+=`&amp;K${c.color.replace("#","").toUpperCase()}`),l):l);var l,c;s.position||(s.position=["Left","Center","Right"][r]);const{image:h}=s;if("&[Picture]"===s.value&&h){const e=`${n}${t}${i}`;Ou.addHeaderFooterImageToMap(h,e)}return`${a}${Uh._.escapeString((d=s.value,Uh._.iterateObject({"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"},(e,t)=>{d=d.replace(e,t)}),d))}`;var d},""),Au=e=>{const t=[];return["all","first","even"].forEach(i=>{const s=e[i],r="all"===i?"odd":i;if(s)for(const[e,n]of Object.entries(s)){const s=`${e.charAt(0).toUpperCase()}${e.slice(1)}`,o=e[0].toUpperCase();if(n){const e="all"===i?"":i.toUpperCase();t.push({name:`${r}${s}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:Mu(n,o,e)})}}}),t},Tu={getTemplate(e){const{worksheet:t,currentSheet:i,config:s}=e,{margins:r={},pageSetup:n,headerFooterConfig:o,suppressColumnOutline:a}=s,{table:l}=t,{rows:c,columns:h}=l,d=h&&h.length?((e,t,i)=>{const s=[],r=[];e.forEach((e,i)=>{const n=e.cells;let o,a=0;n.forEach((e,n)=>{const l=n+a+1,c=gd(l),h=i+1;if(e.mergeAcross){a+=e.mergeAcross;const t=gd(n+a+1);s.push(`${c}${h}:${t}${h}`)}t[l-1]||(t[l-1]={});const{collapsibleRanges:d}=e;d&&d.forEach(e=>{r.push([l+e[0],l+e[1]])}),o=t[l-1],o.min=l,o.max=l,e.ref=`${c}${h}`})}),r.sort((e,t)=>e[0]!==t[0]?e[0]-t[0]:t[1]-e[1]);const n=new Map,o=new Map;return r.filter(e=>{const t=e.toString();return!n.get(t)&&(n.set(t,!0),!0)}).forEach(e=>{const s=t.find(t=>t.min==e[0]&&t.max==e[1]),r=o.get(e[0]);t.push({min:e[0],max:e[1],outlineLevel:i?void 0:r||1,width:(s||{width:100}).width}),o.set(e[0],(r||0)+1)}),s})(c,h,!!a):[],{worksheetDataTables:u}=Ou,p=u.get(i),g=Uh._.compose(e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),(e=>t=>{const i=e.reduce((e,t)=>t.outlineLevel&&t.outlineLevel>e?t.outlineLevel:e,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:i||void 0}}}),t})(c),(e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(e=>Cu.getTemplate(e))}),t))(h),((e,t)=>i=>(e.length&&i.children.push({name:"sheetData",children:e.map((e,i)=>wu.getTemplate(e,i,t))}),i))(c,i+1),(f=d,e=>(f.length&&e.children.push({name:"mergeCells",properties:{rawMap:{count:f.length}},children:f.map(e=>xu(e))}),e)),(e=>t=>{const{top:i=.75,right:s=.7,bottom:r=.75,left:n=.7,header:o=.3,footer:a=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:r,footer:a,header:o,left:n,right:s,top:i}}}),t})(r),(e=>t=>{var i;return e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:(i=e.orientation,!i||"Portrait"!==i&&"Landscape"!==i?"portrait":i.toLocaleLowerCase()),paperSize:Eu(e.pageSize)}}}),t})(n),(e=>t=>{if(!e)return t;const i=null!=e.first?1:0,s=null!=e.even?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:i,differentOddEven:s}},children:Au(e)}),t})(o),(e=>t=>{const i=Ou.worksheetImages.get(e);return(null==i?void 0:i.length)&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t})(i),(e=>t=>(Ou.worksheetHeaderFooterImages.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t))(i),(m=p,e=>(m&&e.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":"rId"+ ++e.rIdCounter}}}]}),e)));var m,f;const{children:y}=g({children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:y}}},Du={getTemplate(e){const{Id:t,Type:i,Target:s}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:i,Target:s}}}}},Iu=e=>({name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:e.map(e=>Du.getTemplate(e))}),Ru=e=>{const{aspectratio:t,rotation:i}=e||{},s={};return t&&(s.aspectratio="t"),i&&(s.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:s}}},Pu={0:"0",5:"6554f",10:"13107f",15:"19661f",20:"26214f",25:".5",30:"39322f",35:"45875f",40:"52429f",45:"58982f",50:"1",55:"72818f",60:"1.25",65:"93623f",70:"109227f",75:"2",80:"2.5",85:"3.4",90:"5",95:"10",96:"12.5",97:"1092267f",98:"25",99:"50",100:"2147483647f"},ku=(e,t)=>{var i;let s;const{recolor:r,brightness:n,contrast:o,id:a}=e;var l;return r&&(s={},"Washout"!==r&&"Grayscale"!==r||(s.gain="19661f",s.blacklevel="22938f"),"Black & White"!==r&&"Grayscale"!==r||(s.grayscale="t","Black & White"===r&&(s.bilevel="t"))),r&&"Grayscale"!==r||(s||(s={}),null!=o&&50!==o&&(s.gain=null!=(i=Pu[o])?i:"1"),null!=n&&50!==n&&(s.blacklevel=(l=n,(l-0)/100*1-.5).toString())),{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:a}}],rawMap:s}}},Lu=e=>Math.floor(.74999943307122*(null!=e?e:0)),Nu={getTemplate(e){const t=Ou.worksheetHeaderFooterImages.get(e.sheetIndex)||[];var i;return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:[{name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]},{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[{name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}},(i=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"],{name:"v:formulas",children:i.map(e=>({name:"v:f",properties:{rawMap:{eqn:e}}}))}),{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}},Ru({aspectratio:!0})]},...t.map((e,t)=>((e,t)=>{const{width:i=0,height:s=0,altText:r}=e,n=Lu(i),o=Lu(s);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${n}pt; height: ${o}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:r}},children:[ku(e,t+1),Ru({rotation:!0})]}})(e,t))]}}},_u=class e{static createExcel(e,t,i){this.addSheetName(t),((e,t)=>{1===(Nh=t)&&uu(),e.forEach(pu)})(e,this.sheetNames.length);let s=Object.assign({},i);return i.exportAsExcelTable&&(i.columnModel.isPivotActive()&&(this.showExcelTableNonCompatibleFeaturesWarning("pivot mode"),s.exportAsExcelTable=!1),i.gos.get("masterDetail")&&(this.showExcelTableNonCompatibleFeaturesWarning("master/detail"),s.exportAsExcelTable=!1)),this.processTableConfig(t,s),this.createWorksheet(t,s)}static showExcelTableNonCompatibleFeaturesWarning(e){console.warn(`AG Grid: Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables.\nPlease turn off ${e} to enable Excel table exports.`)}static getTableNameFromIndex(e){return`table${e+1}`}static getSanitizedTableName(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}static addTableToSheet(e,t){this.worksheetDataTables.has(e)?console.warn("Unable to add data table to Excel sheet: A table already exists."):this.worksheetDataTables.set(e,t)}static processTableConfig(t,i){var s;if(!i.exportAsExcelTable)return;const r="boolean"==typeof i.exportAsExcelTable?{}:i.exportAsExcelTable,{name:n,showColumnStripes:o,showRowStripes:a,showFilterButton:l,highlightFirstColumn:c,highlightLastColumn:h}=r,d=this.getSanitizedTableName(n||e.defaultTableDisplayName),u=this.sheetNames.length-1,{table:p}=t,{rows:g,columns:m}=p,f=i.columnModel.getHeaderRowCount(),y=f-1,v=g.length,C=m.length,b=[],S=[];for(let e=0;e<C;e++){const t=m[e];b.push(t.displayName||""),S.push("match"===l||void 0===l?null!=(s=t.filterAllowed)&&s:l)}b&&b.length&&v&&d?this.addTableToSheet(u,{name:this.getTableNameFromIndex(u),displayName:d,columns:b,showFilterButtons:S,headerRowIndex:y,rowCount:v-f,showRowStripes:null==a||a,showColumnStripes:null!=o&&o,highlightFirstColumn:null!=c&&c,highlightLastColumn:null!=h&&h}):console.warn("Unable to add data table to Excel sheet: Missing required parameters.")}static addHeaderFooterImageToMap(e,t){const i=this.sheetNames.length-1,s=e;s.headerFooterPosition=t,this.buildImageMap({imageToAdd:s,idx:i});let r=this.worksheetHeaderFooterImages.get(i);r||(r=[],this.worksheetHeaderFooterImages.set(i,r)),r.find(t=>t.id===e.id)||r.push(e)}static addBodyImageToMap(e,t,i,s,r){let n=this.sheetNames.length;const{row:o,column:a}=e.position||{},l=e;s&&(null==t||null==i||o&&a||(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:s.indexOf(i)+1})),((e,t)=>{const{colSpan:i,column:s}=e.position;if(e.width)if(i){const r=t.slice(s-1,s+i-1);let n=0;for(let t=0;t<r.length;t++){const i=r[t].getActualWidth();if(e.width<n+i){e.position.colSpan=t+1,e.totalWidth=e.width,e.width=e.totalWidth-n;break}n+=i}}else e.totalWidth=e.width})(l,s),((e,t)=>{const{rowSpan:i,row:s}=e.position;if(e.height)if(i){let r=0,n=0;for(let o=s;o<s+i;o++){const i=hd(ud(o,t)||20);if(e.height<r+i){e.position.rowSpan=n+1,e.totalHeight=e.height,e.height=e.totalHeight-r;break}r+=i,n++}}else e.totalHeight=e.height})(l,r)),this.buildImageMap({imageToAdd:l,idx:n});let c=this.worksheetImageIds.get(n);c||(c=new Map,this.worksheetImageIds.set(n,c));const h=this.worksheetImages.get(n);h?h.push(l):this.worksheetImages.set(n,[l]),c.get(e.id)||c.set(e.id,{index:c.size,type:e.imageType})}static buildImageMap(e){const{imageToAdd:t,idx:i}=e,s=this.images.get(t.id);if(s){const e=s.find(e=>e.sheetId===i);e?e.image.push(t):s.push({sheetId:i,image:[t]})}else this.images.set(t.id,[{sheetId:i,image:[t]}]),this.workbookImageIds.set(t.id,{type:t.imageType,index:this.workbookImageIds.size})}static addSheetName(e){const t=Gh._.escapeString(e.name)||"";let i="";for(;-1!==this.sheetNames.indexOf(`${t}${i}`);)if(""===i)i="_1";else{const e=parseInt(i.slice(1),10);i=`_${e+1}`}e.name=`${t}${i}`,this.sheetNames.push(e.name)}static getStringPosition(e){return this.sharedStrings.has(e)?this.sharedStrings.get(e):(this.sharedStrings.set(e,this.sharedStrings.size),this.sharedStrings.size-1)}static resetFactory(){this.sharedStrings=new Map,this.images=new Map,this.worksheetImages=new Map,this.worksheetHeaderFooterImages=new Map,this.workbookImageIds=new Map,this.worksheetImageIds=new Map,this.worksheetDataTables=new Map,this.sheetNames=[],this.factoryMode=Gh.ExcelFactoryMode.SINGLE_SHEET}static createWorkbook(){return pd(vu(this.sheetNames))}static createStylesheet(e){return pd(mu.getTemplate(e))}static createSharedStrings(){return pd(Gd(this.sharedStrings))}static createCore(e){return pd(od.getTemplate(e))}static createContentTypes(e){return pd(ld.getTemplate(e))}static createRels(){const e=Iu([{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}]);return pd(e)}static createTheme(){return pd(Od())}static createTable(e,t){return pd(xd.getTemplate(e,t))}static createWorkbookRels(e){const t=new Array(e).fill(void 0).map((e,t)=>({Id:`rId${t+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t+1}.xml`})),i=Iu([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return pd(i)}static createDrawing(e){return pd(wd.getTemplate({sheetIndex:e}))}static createDrawingRel(e){const t=this.worksheetImageIds.get(e)||[],i=[];for(const[e,s]of t)i.push({Id:`rId${s.index+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${this.workbookImageIds.get(e).index+1}.${s.type}`});return pd(Iu(i))}static createVmlDrawing(e){return pd(Nu.getTemplate({sheetIndex:e}),!0)}static createVmlDrawingRel(e){const t=this.worksheetHeaderFooterImages.get(e)||[],i=[];for(let e=0;e<t.length;e++){const s=t[e],r=this.workbookImageIds.get(s.id);if(!r)continue;const{index:n,type:o}=r,a="jpg"===o?"jpeg":o;i.push({Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${n+1}.${a}`})}return pd(Iu(i))}static createRelationships({drawingIndex:e,vmlDrawingIndex:t,tableIndex:i}={}){if(void 0===e&&void 0===t&&void 0===i)return"";const s=[];null!=e&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),null!=t&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`}),null!=i&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${this.getTableNameFromIndex(i)}.xml`});const r=Iu(s);return pd(r)}static createWorksheet(e,t){return pd(Tu.getTemplate({worksheet:e,currentSheet:this.sheetNames.length-1,config:t}))}};_u.sharedStrings=new Map,_u.sheetNames=[],_u.images=new Map,_u.worksheetImages=new Map,_u.worksheetHeaderFooterImages=new Map,_u.workbookImageIds=new Map,_u.worksheetImageIds=new Map,_u.worksheetDataTables=new Map,_u.defaultTableDisplayName="AG-GRID-TABLE",_u.factoryMode=Gh.ExcelFactoryMode.SINGLE_SHEET;var Ou=_u,Fu=class extends Kh.BaseGridSerializingSession{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.config=Object.assign({},e),this.stylesByIds={},this.config.baseExcelStyles.forEach(e=>{this.stylesByIds[e.id]=e}),this.excelStyles=[...this.config.baseExcelStyles,{id:"_quotePrefix",quotePrefix:1}]}addCustomContent(e){e.forEach(e=>{const t=this.rows.length+1;let i;this.config.suppressRowOutline||null==e.outlineLevel||(i=e.outlineLevel);const s={height:ud(t,e.height||this.config.rowHeight),cells:(e.cells||[]).map((e,i)=>{var s,r,n;const o=this.addImage(t,this.columnsToExport[i],null==(s=e.data)?void 0:s.value);let a=null;e.styleId&&(a="string"==typeof e.styleId?[e.styleId]:e.styleId);const l=this.getStyleId(a);if(o)return this.createCell(l,this.getDataTypeForValue(o.value),null==o.value?"":o.value);const c=null!=(n=null==(r=e.data)?void 0:r.value)?n:"",h=this.getDataTypeForValue(c);return e.mergeAcross?this.createMergedCell(l,h,c,e.mergeAcross):this.createCell(l,h,c)}),outlineLevel:i};null!=e.collapsed&&(s.collapsed=e.collapsed),null!=e.hidden&&(s.hidden=e.hidden),this.rows.push(s)})}onNewHeaderGroupingRow(){const e=[];return this.rows.push({cells:e,height:ud(this.rows.length+1,this.config.headerRowHeight)}),{onColumn:(t,i,s,r,n)=>{const o=this.config.styleLinker({rowType:Kh.RowType.HEADER_GROUPING,rowIndex:1,value:`grouping-${i}`,columnGroup:t});e.push(rd(sd({},this.createMergedCell(this.getStyleId(o),this.getDataTypeForValue("string"),i,r)),{collapsibleRanges:n}))}}}onNewHeaderRow(){return this.onNewRow(this.onNewHeaderColumn,this.config.headerRowHeight)}onNewBodyRow(e){const t=this.onNewRow(this.onNewBodyColumn,this.config.rowHeight);return e&&this.addRowOutlineIfNecessary(e),t}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((e,t)=>this.convertColumnToExcel(e,t))}parse(){const e=this.rows.reduce((e,t)=>Math.max(e,t.cells.length),0);for(;this.cols.length<e;)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));const t={name:this.config.sheetName,table:{columns:this.cols,rows:this.rows}};return this.createExcel(t)}addRowOutlineIfNecessary(e){const{gos:t,suppressRowOutline:i,rowGroupExpandState:s="expanded"}=this.config;if(t.get("groupHideOpenParents")||i||null==e.level)return;const r=e.footer?1:0,n=jh._.last(this.rows);if(n.outlineLevel=e.level+r,"expanded"===s)return;const o="collapsed"===s;if(e.isExpandable()){const t=!o&&e.expanded;n.collapsed=!t}n.hidden=!!e.parent&&-1!==e.parent.level&&(o||this.isAnyParentCollapsed(e.parent))}isAnyParentCollapsed(e){for(;e&&-1!==e.level;){if(!e.expanded)return!0;e=e.parent}return!1}convertColumnToExcel(e,t){const i=this.config.columnWidth,s=e?this.extractHeaderValue(e):void 0,r=null!=s?s:"",n=!!e&&e.isFilterAllowed();if(i)return"number"==typeof i?{width:i,displayName:r,filterAllowed:n}:{width:i({column:e,index:t}),displayName:r,filterAllowed:n};if(e){const t=75;return{width:Math.max(e.getActualWidth(),t),displayName:r,filterAllowed:n}}return{displayName:r,filterAllowed:n}}onNewHeaderColumn(e,t){return i=>{const s=this.extractHeaderValue(i),r=this.config.styleLinker({rowType:Kh.RowType.HEADER,rowIndex:e,value:s,column:i});t.push(this.createCell(this.getStyleId(r),this.getDataTypeForValue("string"),s))}}onNewBodyColumn(e,t){let i=0;return(s,r,n)=>{if(i>0)return void(i-=1);const{value:o,valueFormatted:a}=this.extractRowCellValue(s,r,e,"excel",n),l=this.config.styleLinker({rowType:Kh.RowType.BODY,rowIndex:e,value:o,column:s,node:n}),c=this.getStyleId(l),h=s.getColSpan(n),d=this.addImage(e,s,o);d?t.push(this.createCell(c,this.getDataTypeForValue(d.value),null==d.value?"":d.value)):h>1?(i=h-1,t.push(this.createMergedCell(c,this.getDataTypeForValue(o),o,h-1))):t.push(this.createCell(c,this.getDataTypeForValue(o),o,a))}}onNewRow(e,t){const i=[];return this.rows.push({cells:i,height:ud(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,i)()}}createExcel(e){const{excelStyles:t,config:i}=this;return Ou.createExcel(t,e,i)}getDataTypeForValue(e){return void 0===e?"empty":this.isNumerical(e)?"n":"s"}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e&&e.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:console.warn(`AG Grid: Unrecognized data type for excel export [${e.id}.dataType=${e.dataType}]`)}return null}addImage(e,t,i){if(!this.config.addImageToCell)return;const s=this.config.addImageToCell(e,t,i);return s?(Ou.addBodyImageToMap(s.image,e,t,this.columnsToExport,this.config.rowHeight),s):void 0}createCell(e,t,i,s){const r=this.getStyleById(e);!(null==r?void 0:r.dataType)&&"s"===t&&s&&(i=s);const n=this.getTypeFromStyle(r,i)||t,{value:o,escaped:a}=this.getCellValue(n,i),l=[];return r&&l.push(e),a&&l.push("_quotePrefix"),{styleId:e=this.getStyleId(l)||void 0,data:{type:n,value:o}}}createMergedCell(e,t,i,s){const r=null==i?"":i;return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:"s"===t?Ou.getStringPosition(r).toString():i},mergeAcross:s}}getCellValue(e,t){let i=!1;if(null==t&&(e="s",t=""),"s"===e)t&&"'"===t[0]&&(i=!0,t=t.slice(1)),t=Ou.getStringPosition(t).toString();else if("f"===e)t=t.slice(1);else if("n"===e){const e=Number(t);isNaN(e)?t="":""!==t&&(t=e.toString())}return{value:t,escaped:i}}getStyleId(e){if(!e||!e.length)return null;if(1===e.length)return e[0];const t=e.join("-");return this.mixedStyles[t]||this.addNewMixedStyle(e),this.mixedStyles[t].excelID}deepCloneObject(e){return JSON.parse(JSON.stringify(e))}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,i={};for(const t of e)for(const e of this.excelStyles)e.id===t&&jh._.mergeDeep(i,this.deepCloneObject(e));i.id=t,i.name=t;const s=e.join("-");this.mixedStyles[s]={excelID:t,key:s,result:i},this.excelStyles.push(i),this.stylesByIds[t]=i}isFormula(e){return null!=e&&this.config.autoConvertFormulas&&e.toString().startsWith("=")}isNumerical(e){return"bigint"==typeof e||isFinite(e)&&""!==e&&!isNaN(parseFloat(e))}getStyleById(e){return null==e?null:this.stylesByIds[e]||null}},Gu=(e,t)=>{const i="xl/drawings",s=`${i}/drawing${t+1}.xml`,r=`${i}/_rels/drawing${t+1}.xml.rels`;Wh.ZipContainer.addFile(r,Ou.createDrawingRel(e)),Wh.ZipContainer.addFile(s,Ou.createDrawing(e))},Bu=(e,t)=>{const i="xl/drawings",s=`${i}/vmlDrawing${t+1}.vml`,r=`${i}/_rels/vmlDrawing${t+1}.vml.rels`;Wh.ZipContainer.addFile(s,Ou.createVmlDrawing(e)),Wh.ZipContainer.addFile(r,Ou.createVmlDrawingRel(e))},Vu=(e,t={})=>{if(!e||0===e.length)return console.warn("AG Grid: Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty."),Ou.resetFactory(),!1;const{fontSize:i=11,author:s="AG Grid"}=t;return(()=>{Wh.ZipContainer.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]);const{images:e}=Ou;if(!e.size)return;Wh.ZipContainer.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;e.forEach(e=>{const i=e[0].image[0],{base64:s,imageType:r}=i,n="jpg"===r?"jpeg":r;Wh.ZipContainer.addFile(`xl/media/image${++t}.${n}`,s,!0)})})(),(()=>{const{worksheetDataTables:e}=Ou,t=e,i=Array.from(t.keys());for(let e=0;e<i.length;e++){const s=i[e],r=t.get(s);r&&Wh.ZipContainer.addFile(`xl/tables/${r.name}.xml`,Ou.createTable(r,e))}})(),(e=>{let t=0,i=0,s=0;const{images:r,worksheetDataTables:n,worksheetImages:o,worksheetHeaderFooterImages:a}=Ou;for(let l=0;l<e.length;l++){const c=e[l];Wh.ZipContainer.addFile(`xl/worksheets/sheet${l+1}.xml`,c,!1);const h=r.size>0&&o.has(l),d=n.size>0&&n.has(l),u=r.size&&a.has(l);if(!h&&!d&&!u)continue;let p,g,m;h&&(Gu(l,t),g=t,t++),u&&(Bu(l,i),m=i,i++),d&&(p=s++);const f=`xl/worksheets/_rels/sheet${l+1}.xml.rels`;Wh.ZipContainer.addFile(f,Ou.createRelationships({tableIndex:p,drawingIndex:g,vmlDrawingIndex:m}))}})(e),((e,t,i)=>{Wh.ZipContainer.addFile("xl/workbook.xml",Ou.createWorkbook()),Wh.ZipContainer.addFile("xl/styles.xml",Ou.createStylesheet(e)),Wh.ZipContainer.addFile("xl/sharedStrings.xml",Ou.createSharedStrings()),Wh.ZipContainer.addFile("xl/theme/theme1.xml",Ou.createTheme()),Wh.ZipContainer.addFile("xl/_rels/workbook.xml.rels",Ou.createWorkbookRels(i)),Wh.ZipContainer.addFile("docProps/core.xml",Ou.createCore(t)),Wh.ZipContainer.addFile("[Content_Types].xml",Ou.createContentTypes(i)),Wh.ZipContainer.addFile("_rels/.rels",Ou.createRels())})(i,s,e.length),Ou.resetFactory(),!0},Hu=e=>{const{data:t,fontSize:i,author:s}=e,r=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return Vu(t,{author:s,fontSize:i})?Wh.ZipContainer.getZipFile(r):Promise.resolve(void 0)},Uu=e=>{const{data:t,fontSize:i,author:s}=e,r=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(Vu(t,{author:s,fontSize:i}))return Wh.ZipContainer.getUncompressedZipFile(r)},zu=e=>{const{fileName:t="export.xlsx"}=e;Hu(e).then(e=>{if(e){const i="function"==typeof t?t():t;Wh.Downloader.download(i,e)}})},Wu=class extends Wh.BaseCreator{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};this.packageCompressedFile(i).then(e=>{if(e){const{fileName:i}=t,s="function"==typeof i?i(this.gos.getGridCommonParams()):i;Wh.Downloader.download(this.getFileName(s),e)}})}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};return this.packageFile(i)}setFactoryMode(e){Ou.factoryMode=e}getFactoryMode(){return Ou.factoryMode}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return Uu(e)}exportMultipleSheetsAsExcel(e){zu(e)}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:s}=this;let r;if(null!=e.sheetName){const{sheetName:t}=e,i="function"==typeof t?t(this.gos.getGridCommonParams()):t;r=String(i).substring(0,31)}else r="ag-grid";const n=rd(sd({},e),{sheetName:r,columnModel:t,valueService:i,gos:s,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:this.gos.get("excelStyles")||[],styleLinker:this.styleLinker.bind(this)});return new Fu(n)}styleLinker(e){const{rowType:t,rowIndex:i,value:s,column:r,columnGroup:n,node:o}=e,a=t===Wh.RowType.HEADER,l=t===Wh.RowType.HEADER_GROUPING,c=a?r:n;let h=[];if(a||l)return h.push("header"),l&&h.push("headerGroup"),c&&(h=h.concat(Fh.CssClassApplier.getHeaderClassesFromColDef(c.getDefinition(),this.gos,r||null,n||null))),h;const d=this.gos.get("excelStyles"),u=["cell"];if(!d||!d.length)return u;const p=d.map(e=>e.id);return this.stylingService.processAllCellClasses(r.getDefinition(),this.gos.addGridCommonParams({value:s,data:o.data,node:o,colDef:r.getDefinition(),column:r,rowIndex:i}),e=>{p.indexOf(e)>-1&&u.push(e)}),u.sort((e,t)=>p.indexOf(e)<p.indexOf(t)?-1:1)}isExportSuppressed(){return this.gos.get("suppressExcelExport")}packageCompressedFile(e){return Hu(e)}packageFile(e){return Uu(e)}};nd([(0,Fh.Autowired)("columnModel")],Wu.prototype,"columnModel",2),nd([(0,Fh.Autowired)("valueService")],Wu.prototype,"valueService",2),nd([(0,Fh.Autowired)("stylingService")],Wu.prototype,"stylingService",2),nd([(0,Fh.Autowired)("gridSerializer")],Wu.prototype,"gridSerializer",2),nd([(0,Fh.Autowired)("gridOptionsService")],Wu.prototype,"gos",2),nd([Fh.PostConstruct],Wu.prototype,"postConstruct",1),Wu=nd([(0,Fh.Bean)("excelCreator")],Wu);var ju={version:"31.3.4",moduleName:Oh.ModuleNames.ExcelExportModule,beans:[Wu,$h.GridSerializer,$h.CsvCreator],dependantModules:[Yh.CsvExportModule,D]},Ku=i(98092),$u=i(98092),Yu=i(98092),qu=i(98092),Xu=i(98092),Zu=i(98092),Qu=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,ep=Object.getOwnPropertySymbols,tp=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,sp=(e,t,i)=>t in e?Qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,rp=(e,t)=>{for(var i in t||(t={}))tp.call(t,i)&&sp(e,i,t[i]);if(ep)for(var i of ep(t))ip.call(t,i)&&sp(e,i,t[i]);return e},np=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Ju(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Qu(t,i,n),n},op=class extends $u.Component{preConstruct(){this.setTemplate('<div class="ag-filter-toolpanel-search" role="presentation">\n                <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n                <ag-input-text-field ref="eFilterTextField" class="ag-filter-toolpanel-search-input"></ag-input-text-field>\n            </div>')}postConstruct(){const e=this.localeService.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eventService,$u.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this))}init(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=$u._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=$u._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=$u._.createIconNoSpan("columnSelectIndeterminate",this.gos))}showOrHideOptions(){const e=!this.params.suppressFilterSearch,t=!this.params.suppressExpandAll,i=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search..."));const s=this.columnModel.getAllGridColumns().some(e=>e.getOriginalParent()&&e.isFilterAllowed());$u._.setDisplayed(this.eFilterTextField.getGui(),e),$u._.setDisplayed(this.eExpand,t&&s)}onSearchTextChanged(){this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=$u._.debounce(()=>{this.dispatchEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()})},300)),this.onSearchTextChangedDebounced()}onExpandClicked(){const e=0===this.currentExpandState?{type:"collapseAll"}:{type:"expandAll"};this.dispatchEvent(e)}setExpandState(e){this.currentExpandState=e,$u._.setDisplayed(this.eExpandChecked,0===this.currentExpandState),$u._.setDisplayed(this.eExpandUnchecked,1===this.currentExpandState),$u._.setDisplayed(this.eExpandIndeterminate,2===this.currentExpandState)}};np([(0,$u.Autowired)("columnModel")],op.prototype,"columnModel",2),np([(0,$u.RefSelector)("eExpand")],op.prototype,"eExpand",2),np([(0,$u.RefSelector)("eFilterTextField")],op.prototype,"eFilterTextField",2),np([$u.PreConstruct],op.prototype,"preConstruct",1),np([$u.PostConstruct],op.prototype,"postConstruct",1);var ap=class e extends qu.Component{constructor(t,i){super(e.TEMPLATE),this.expandedCallback=i,this.expanded=!1,this.hideHeader=t}postConstruct(){this.eExpandChecked=qu._.createIconNoSpan("columnSelectOpen",this.gos),this.eExpandUnchecked=qu._.createIconNoSpan("columnSelectClosed",this.gos),this.eExpand.appendChild(this.eExpandChecked),this.eExpand.appendChild(this.eExpandUnchecked)}setColumn(e){this.column=e,this.eFilterName.innerText=this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)||"",this.addManagedListener(this.eFilterToolPanelHeader,"click",this.toggleExpanded.bind(this)),this.addManagedListener(this.eFilterToolPanelHeader,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eventService,qu.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addInIcon("filter",this.eFilterIcon,this.column),qu._.setDisplayed(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),qu._.setDisplayed(this.eExpandChecked,!1),this.hideHeader?(qu._.setDisplayed(this.eFilterToolPanelHeader,!1),this.eFilterToolPanelHeader.removeAttribute("tabindex")):this.eFilterToolPanelHeader.setAttribute("tabindex","0"),this.addManagedListener(this.column,qu.Column.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))}onKeyDown(e){const{key:t}=e,{ENTER:i,SPACE:s,LEFT:r,RIGHT:n}=qu.KeyCode;t!==i&&t!==s&&t!==r&&t!==n||(e.preventDefault(),t===i||t===s?this.toggleExpanded():t===qu.KeyCode.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,i){if(null==t)return;const s=qu._.createIconNoSpan(e,this.gos,i);t.appendChild(s)}isFilterActive(){return this.filterManager.isFilterActive(this.column)}onFilterChanged(){qu._.setDisplayed(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),this.dispatchEvent({type:qu.Column.EVENT_FILTER_CHANGED})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,qu._.setAriaExpanded(this.eFilterToolPanelHeader,!0),qu._.setDisplayed(this.eExpandChecked,!0),qu._.setDisplayed(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){var t;const i=qu._.loadTemplate('<div class="ag-filter-toolpanel-instance-filter"></div>'),s=this.createManagedBean(new qu.FilterWrapperComp(this.column,"TOOLBAR"));this.filterWrapperComp=s,s.hasFilter()&&(null==(t=s.getFilter())||t.then(t=>{this.underlyingFilter=t,t&&(i.appendChild(s.getGui()),this.agFilterToolPanelBody.appendChild(i),s.afterGuiAttached({container:"toolPanel",suppressFocus:e}))}))}collapse(){var e;this.expanded&&(this.expanded=!1,qu._.setAriaExpanded(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),qu._.setDisplayed(this.eExpandChecked,!1),qu._.setDisplayed(this.eExpandUnchecked,!0),null==(e=this.filterWrapperComp)||e.afterGuiDetached(),this.destroyBean(this.filterWrapperComp),this.expandedCallback())}removeFilterElement(){qu._.clearElement(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}refreshFilter(e){var t;if(!this.expanded)return;const i=this.underlyingFilter;i&&(e?"function"==typeof i.refreshVirtualList&&i.refreshVirtualList():null==(t=i.afterGuiDetached)||t.call(i))}onFilterOpened(e){"COLUMN_MENU"===e.source&&e.column===this.column&&this.expanded&&this.collapse()}};ap.TEMPLATE='\n        <div class="ag-filter-toolpanel-instance">\n            <div class="ag-filter-toolpanel-header ag-filter-toolpanel-instance-header" ref="eFilterToolPanelHeader" role="button" aria-expanded="false">\n                <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n                <span ref="eFilterName" class="ag-header-cell-text"></span>\n                <span ref="eFilterIcon" class="ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon" aria-hidden="true"></span>\n            </div>\n            <div class="ag-filter-toolpanel-instance-body ag-filter" ref="agFilterToolPanelBody"></div>\n        </div>',np([(0,qu.RefSelector)("eFilterToolPanelHeader")],ap.prototype,"eFilterToolPanelHeader",2),np([(0,qu.RefSelector)("eFilterName")],ap.prototype,"eFilterName",2),np([(0,qu.RefSelector)("agFilterToolPanelBody")],ap.prototype,"agFilterToolPanelBody",2),np([(0,qu.RefSelector)("eFilterIcon")],ap.prototype,"eFilterIcon",2),np([(0,qu.RefSelector)("eExpand")],ap.prototype,"eExpand",2),np([(0,qu.Autowired)("filterManager")],ap.prototype,"filterManager",2),np([(0,qu.Autowired)("columnModel")],ap.prototype,"columnModel",2),np([qu.PostConstruct],ap.prototype,"postConstruct",1);var lp=ap,cp=class e extends Xu.Component{constructor(e,t,i,s,r){super(),this.columnGroup=e,this.childFilterComps=t,this.depth=s,this.expandedCallback=i,this.showingColumn=r}preConstruct(){this.setTemplate(e.TEMPLATE,{filterGroupComp:{cssIdentifier:"filter-toolpanel",direction:"vertical"}})}init(){this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),this.filterGroupComp.addCssClass(`ag-filter-toolpanel-group-level-${this.depth}`),this.filterGroupComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth}-header`),this.childFilterComps.forEach(e=>{this.filterGroupComp.addItem(e),e.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth+1}-header`)}),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filter")}setupTooltip(){if(!this.showingColumn)return;let e;"whenTruncated"===this.gos.get("tooltipShowMode")&&(e=()=>{const e=this.filterGroupComp.getGui().querySelector(".ag-group-title");return!e||e.scrollWidth>e.clientWidth});const t=()=>{const t=this.columnGroup.getColDef().headerTooltip;this.setTooltip({newTooltipText:t,location:"filterToolPanelColumnGroup",shouldDisplayTooltip:e})};t(),this.addManagedListener(this.eventService,Xu.Events.EVENT_NEW_COLUMNS_LOADED,t)}getTooltipParams(){const e=super.getTooltipParams();return e.location="filterToolPanelColumnGroup",e}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}refreshFilters(t){this.childFilterComps.forEach(i=>{i instanceof e?i.refreshFilters(t):i.refreshFilter(t)})}isColumnGroup(){return this.columnGroup instanceof Xu.ProvidedColumnGroup}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName?this.filterGroupName:""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,t){this.filterGroupComp.hideItem(e,t)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const t=Xu._.createIconNoSpan(e,this.gos);t&&t.classList.add("ag-filter-toolpanel-group-instance-header-icon"),this.filterGroupComp.addTitleBarWidget(t)}forEachToolPanelFilterChild(e){this.childFilterComps.forEach(t=>{t instanceof lp&&e(t)})}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.expand()),t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.collapse());this.addManagedListener(this.filterGroupComp,Xu.AgGroupComponent.EVENT_EXPANDED,e),this.addManagedListener(this.filterGroupComp,Xu.AgGroupComponent.EVENT_COLLAPSED,t)}getColumns(){return this.columnGroup instanceof Xu.ProvidedColumnGroup?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){this.getColumns().forEach(e=>{this.addManagedListener(e,Xu.Column.EVENT_FILTER_CHANGED,()=>this.refreshFilterClass())}),this.columnGroup instanceof Xu.ProvidedColumnGroup||this.addManagedListener(this.eventService,Xu.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this))}refreshFilterClass(){const e=this.getColumns();this.filterGroupComp.addOrRemoveCssClass("ag-has-filter",e.some(e=>e.isFilterActive()))}onFilterOpened(e){"COLUMN_MENU"===e.source&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){this.filterGroupName=this.columnGroup instanceof Xu.ProvidedColumnGroup?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")}getColumnGroupName(e){return this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.columnModel.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),Xu._.clearElement(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}};cp.TEMPLATE='<div class="ag-filter-toolpanel-group-wrapper">\n            <ag-group-component ref="filterGroupComp"></ag-group-component>\n        </div>',np([(0,Xu.RefSelector)("filterGroupComp")],cp.prototype,"filterGroupComp",2),np([(0,Xu.Autowired)("columnModel")],cp.prototype,"columnModel",2),np([Xu.PreConstruct],cp.prototype,"preConstruct",1),np([Xu.PostConstruct],cp.prototype,"init",1);var hp=cp,dp=class e extends Yu.Component{constructor(){super(e.TEMPLATE),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}init(e){this.initialised=!0;const t=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});Yu._.mergeDeep(t,e),this.params=t,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,Yu.Events.EVENT_COLUMN_MOVED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,Yu.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,Yu.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,e=>{"filters"===e.key&&this.refreshFilters(e.visible)}),this.addManagedListener(this.eventService,Yu.Events.EVENT_DRAG_STARTED,()=>{this.suppressOnColumnsChanged=!0}),this.addManagedListener(this.eventService,Yu.Events.EVENT_DRAG_STOPPED,()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}),this.columnModel.isReady()&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged)return void(this.onColumnsChangedPending=!0);const e=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||e?this.buildTreeFromProvidedColumnDefs():this.syncFilterLayout(),this.refreshAriaLabel()}syncFilterLayout(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const e=this.columnModel.getPrimaryColumnTree();this.recreateFilters(e)}setFiltersLayout(e){const t=this.toolPanelColDefService.createColumnTree(e);this.recreateFilters(t)}recreateFilters(e){const t=this.gos.getActiveDomElement();this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const i=this.getExpansionState();this.destroyFilters(),this.filterGroupComps=this.recursivelyAddComps(e,0,i);const s=this.filterGroupComps.length;s&&(this.filterGroupComps.forEach(e=>this.appendChild(e)),this.setFirstAndLastVisible(0,s-1)),Yu._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,i){return Yu._.flatten(e.map(e=>{if(e instanceof Yu.ProvidedColumnGroup)return Yu._.flatten(this.recursivelyAddFilterGroupComps(e,t,i));const s=e;if(!this.shouldDisplayFilter(s))return[];const r=new lp(0===t,()=>this.onFilterExpanded());if(this.createBean(r),r.setColumn(s),i.get(s.getId())&&r.expand(),t>0)return r;const n=this.createBean(new hp(s,[r],this.onGroupExpanded.bind(this),t,!0));return n.addCssClassToTitleBar("ag-filter-toolpanel-header"),i.get(n.getFilterGroupId())||n.collapse(),n}))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaFilterPanelList","Filter List"),i=e("filters","Filters"),s=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;Yu._.setAriaLabel(this.getAriaElement(),`${t} ${s} ${i}`)}recursivelyAddFilterGroupComps(e,t,i){if(!this.filtersExistInChildren(e.getChildren()))return;const s=e.getColGroupDef();if(s&&s.suppressFiltersToolPanel)return[];const r=e.isPadding()?t:t+1,n=Yu._.flatten(this.recursivelyAddComps(e.getChildren(),r,i));if(e.isPadding())return n;const o=new hp(e,n,this.onGroupExpanded.bind(this),t,!1);this.createBean(o),o.addCssClassToTitleBar("ag-filter-toolpanel-header");const a=i.get(o.getFilterGroupId());return(this.isInitialState&&!a||!1===a)&&o.collapse(),[o]}filtersExistInChildren(e){return e.some(e=>e instanceof Yu.ProvidedColumnGroup?this.filtersExistInChildren(e.getChildren()):this.shouldDisplayFilter(e))}shouldDisplayFilter(e){const t=e.getColDef()&&e.getColDef().suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){const e=new Map;if(this.isInitialState){const{expandedColIds:t,expandedGroupIds:i}=this.params.initialState;return t.forEach(t=>e.set(t,!0)),i.forEach(t=>e.set(t,!0)),e}const t=i=>{e.set(i.getFilterGroupId(),i.isExpanded()),i.getChildren().forEach(i=>{i instanceof hp?t(i):e.set(i.getColumn().getId(),i.isExpanded())})};return this.filterGroupComps.forEach(t),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){const i=[],s=r=>{const n=r.getFilterGroupId();(!t||Yu._.includes(t,n))&&(e&&r.isColumnGroup()?r.expand():r.collapse(),i.push(n)),r.getChildren().forEach(e=>{e instanceof hp&&s(e)})};if(this.filterGroupComps.forEach(s),this.onGroupExpanded(),t){const e=t.filter(e=>i.indexOf(e)<0);e.length>0&&console.warn("AG Grid: unable to find groups for these supplied groupIds:",e)}}expandFilters(e,t){const i=[],s=r=>{if(r instanceof hp){let t=!1;return r.getChildren().forEach(i=>{s(i)&&(e?(r.expand(),t=!0):r.isColumnGroup()||r.collapse())}),t}const n=r.getColumn().getColId(),o=!t||Yu._.includes(t,n);return o&&(e?r.expand():r.collapse(),i.push(n)),o};if(this.filterGroupComps.forEach(s),this.onGroupExpanded(),t){const e=t.filter(e=>i.indexOf(e)<0);e.length>0&&console.warn("AG Grid: unable to find columns for these supplied colIds:",e)}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchEvent({type:"filterExpanded"})}fireExpandedEvent(){let e=0,t=0;const i=s=>{s.isColumnGroup()&&(s.isExpanded()?e++:t++,s.getChildren().forEach(e=>{e instanceof hp&&i(e)}))};let s;this.filterGroupComps.forEach(i),s=e>0&&t>0?2:t>0?1:0,this.dispatchEvent({type:"groupExpanded",state:s})}performFilterSearch(e){this.searchFilterText=Yu._.exists(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){const t=t=>!Yu._.exists(e)||-1!==t.toLowerCase().indexOf(e),i=(e,s)=>{if(!(e instanceof hp))return t(e.getColumnFilterName()||"");const r=e.getChildren(),n=t(e.getFilterGroupName()),o=s||n;if(o){e.hideGroup(!1);for(let t=0;t<r.length;t++)i(r[t],o),e.hideGroupItem(!1,t);return!0}let a=!1;return r.forEach((t,r)=>{const n=i(t,s);e.hideGroupItem(!n,r),n&&(a=!0)}),e.hideGroup(!a),a};let s,r;this.filterGroupComps.forEach((e,t)=>{i(e,!1),void 0===s?e.containsCssClass("ag-hidden")||(s=t,r=t):e.containsCssClass("ag-hidden")||r===t||(r=t)}),this.setFirstAndLastVisible(s,r),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((i,s)=>{i.removeCssClass("ag-first-group-visible"),i.removeCssClass("ag-last-group-visible"),s===e&&i.addCssClass("ag-first-group-visible"),s===t&&i.addCssClass("ag-last-group-visible")})}refreshFilters(e){this.filterGroupComps.forEach(t=>t.refreshFilters(e))}getExpandedFiltersAndGroups(){const e=[],t=new Set,i=s=>{if(s instanceof hp){s.getChildren().forEach(e=>i(e));const r=s.getFilterGroupId();s.isExpanded()&&!t.has(r)&&e.push(r)}else s.isExpanded()&&t.add(s.getColumn().getColId())};return this.filterGroupComps.forEach(i),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),Yu._.clearElement(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}};dp.TEMPLATE='<div class="ag-filter-list-panel"></div>',np([(0,Yu.Autowired)("toolPanelColDefService")],dp.prototype,"toolPanelColDefService",2),np([(0,Yu.Autowired)("columnModel")],dp.prototype,"columnModel",2);var up=dp,pp=class e extends Zu.Component{constructor(){super(e.TEMPLATE),this.initialised=!1,this.listenerDestroyFuncs=[]}init(e){this.initialised&&(this.listenerDestroyFuncs.forEach(e=>e()),this.listenerDestroyFuncs=[]),this.initialised=!0;const t=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});this.params=rp(rp({},t),e),this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);const i=this.params.suppressExpandAll,s=this.params.suppressFilterSearch;i&&s&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(this.addManagedListener(this.filtersToolPanelHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"searchChanged",this.onSearchChanged.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"filterExpanded",this.onFilterExpanded.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"groupExpanded",this.onGroupExpanded.bind(this)))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}onExpandAll(){this.filtersToolPanelListPanel.expandFilterGroups(!0)}onCollapseAll(){this.filtersToolPanelListPanel.expandFilterGroups(!1)}onSearchChanged(e){this.filtersToolPanelListPanel.performFilterSearch(e.searchText)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}onFilterExpanded(){this.params.onStateUpdated()}onGroupExpanded(e){this.filtersToolPanelHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}expandFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)}collapseFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)}expandFilters(e){this.filtersToolPanelListPanel.expandFilters(!0,e)}collapseFilters(e){this.filtersToolPanelListPanel.expandFilters(!1,e)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(e){return this.init(e),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}destroy(){super.destroy()}};pp.TEMPLATE='<div class="ag-filter-toolpanel">\n            <ag-filters-tool-panel-header ref="filtersToolPanelHeaderPanel"></ag-filters-tool-panel-header>\n            <ag-filters-tool-panel-list ref="filtersToolPanelListPanel"></ag-filters-tool-panel-list>\n         </div>',np([(0,Zu.RefSelector)("filtersToolPanelHeaderPanel")],pp.prototype,"filtersToolPanelHeaderPanel",2),np([(0,Zu.RefSelector)("filtersToolPanelListPanel")],pp.prototype,"filtersToolPanelListPanel",2);var gp=pp,mp={version:"31.3.4",moduleName:Ku.ModuleNames.FiltersToolPanelModule,beans:[],agStackComponents:[{componentName:"AgFiltersToolPanelHeader",componentClass:op},{componentName:"AgFiltersToolPanelList",componentClass:up}],userComponents:[{componentName:"agFiltersToolPanel",componentClass:gp}],dependantModules:[Zc,D]},fp=i(98092),yp=i(98092),vp=i(98092),Cp=Object.defineProperty,bp=Object.getOwnPropertyDescriptor,Sp=Object.getOwnPropertySymbols,wp=Object.prototype.hasOwnProperty,xp=Object.prototype.propertyIsEnumerable,Ep=(e,t,i)=>t in e?Cp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Mp=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?bp(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Cp(t,i,n),n},Ap=class extends vp.BeanStub{constructor(){super(...arguments),this.loadRowDataVersion=0}init(e,t){this.params=t,this.comp=e,null!=t.pinned||(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.addThemeToDetailGrid(),this.createDetailGrid(),this.loadRowData(),this.addManagedListener(this.eventService,vp.Events.EVENT_FULL_WIDTH_ROW_FOCUSED,this.onFullWidthRowFocused.bind(this)))}onFullWidthRowFocused(e){const t=this.params,i={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},s={rowIndex:e.rowIndex,rowPinned:e.rowPinned};this.rowPositionUtils.sameRow(i,s)&&this.focusService.focusInto(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",i=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height";this.comp.addOrRemoveCssClass(t,!0),this.comp.addOrRemoveDetailGridCssClass(i,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;"everything"==e||"nothing"==e||"rows"==e?this.refreshStrategy=e:(null!=e&&console.warn("AG Grid: invalid cellRendererParams.refreshStrategy = '"+e+"' supplied, defaulting to refreshStrategy = 'rows'."),this.refreshStrategy="rows")}addThemeToDetailGrid(){const{theme:e}=this.environment.getTheme();e&&this.comp.addOrRemoveDetailGridCssClass(e,!0)}createDetailGrid(){if(vp._.missing(this.params.detailGridOptions))return void console.warn("AG Grid: could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions");const e=this.gos.get("detailRowAutoHeight"),t=((e,t)=>{for(var i in t||(t={}))wp.call(t,i)&&Ep(e,i,t[i]);if(Sp)for(var i of Sp(t))xp.call(t,i)&&Ep(e,i,t[i]);return e})({},this.params.detailGridOptions);e&&(t.domLayout="autoHeight"),this.comp.setDetailGrid(t)}registerDetailWithMaster(e,t){const i=this.params.node.id,s=this.params.api,r={id:i,api:e,columnApi:t},n=this.params.node;s.isDestroyed()||(s.addDetailGridInfo(i,r),n.detailGridInfo=r,this.addDestroyFunc(()=>{n.detailGridInfo===r&&(s.isDestroyed()||s.removeDetailGridInfo(i),n.detailGridInfo=null)}))}loadRowData(){var e,t,i;this.loadRowDataVersion++;const s=this.loadRowDataVersion;if("serverSide"===(null==(e=this.params.detailGridOptions)?void 0:e.rowModelType))return void(null==(i=null==(t=this.params.node.detailGridInfo)?void 0:t.api)||i.refreshServerSide({purge:!0}));const r=this.params.getDetailRowData;r?r({node:this.params.node,data:this.params.node.data,successCallback:e=>{this.loadRowDataVersion===s&&this.comp.setRowData(e)},context:this.gos.getGridCommonParams().context}):console.warn("AG Grid: could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData")}refresh(){const e=!0;switch(this.refreshStrategy){case"nothing":return e;case"everything":return!1}return this.loadRowData(),e}};Mp([(0,vp.Autowired)("rowPositionUtils")],Ap.prototype,"rowPositionUtils",2),Mp([(0,vp.Autowired)("focusService")],Ap.prototype,"focusService",2);var Tp=class e extends yp.Component{init(e){this.params=e,this.selectAndSetTemplate();const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveDetailGridCssClass:(e,t)=>this.eDetailGrid.classList.toggle(e,t),setDetailGrid:e=>this.setDetailGrid(e),setRowData:e=>this.setRowData(e),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new Ap),this.ctrl.init(t,e)}refresh(){return this.ctrl&&this.ctrl.refresh()}destroy(){super.destroy()}selectAndSetTemplate(){if(this.params.pinned)return void this.setTemplate('<div class="ag-details-row"></div>');const t=()=>{this.setTemplate(e.TEMPLATE)};if(yp._.missing(this.params.template))t();else if("string"==typeof this.params.template)this.setTemplate(this.params.template);else if("function"==typeof this.params.template){const e=(0,this.params.template)(this.params);this.setTemplate(e)}else console.warn("AG Grid: detailCellRendererParams.template should be function or string"),t();null==this.eDetailGrid&&console.warn('AG Grid: reference to eDetailGrid was missing from the details template. Please add ref="eDetailGrid" to the template.')}setDetailGrid(e){if(!this.eDetailGrid)return;const t=this.context.getBean("agGridReact"),i=t?yp._.cloneObject(t):void 0,s=this.context.getBean("frameworkComponentWrapper"),r=this.getFrameworkOverrides(),n=(0,yp.createGrid)(this.eDetailGrid,e,{frameworkOverrides:r,providedBeanInstances:{agGridReact:i,frameworkComponentWrapper:s},modules:yp.ModuleRegistry.__getGridRegisteredModules(this.params.api.getGridId())});this.detailApi=n,this.ctrl.registerDetailWithMaster(n,new yp.ColumnApi(n)),this.addDestroyFunc(()=>{null==n||n.destroy()})}setRowData(e){this.detailApi&&this.detailApi.setGridOption("rowData",e)}};Tp.TEMPLATE='<div class="ag-details-row" role="gridcell">\n            <div ref="eDetailGrid" class="ag-details-grid" role="presentation"></div>\n        </div>',Mp([(0,yp.RefSelector)("eDetailGrid")],Tp.prototype,"eDetailGrid",2);var Dp=Tp,Ip={version:"31.3.4",moduleName:fp.ModuleNames.MasterDetailModule,beans:[],userComponents:[{componentName:"agDetailCellRenderer",componentClass:Dp}],controllers:[{controllerName:"detailCellRenderer",controllerClass:Ap}],dependantModules:[D]},Rp=i(98092),Pp=i(98092),kp=i(98092),Lp=i(98092),Np=i(98092),_p=i(98092),Op=i(98092),Fp=i(98092),Gp=Object.defineProperty,Bp=Object.defineProperties,Vp=Object.getOwnPropertyDescriptor,Hp=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,zp=Object.prototype.hasOwnProperty,Wp=Object.prototype.propertyIsEnumerable,jp=(e,t,i)=>t in e?Gp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Kp=(e,t)=>{for(var i in t||(t={}))zp.call(t,i)&&jp(e,i,t[i]);if(Up)for(var i of Up(t))Wp.call(t,i)&&jp(e,i,t[i]);return e},$p=(e,t)=>Bp(e,Hp(t)),Yp=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Vp(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Gp(t,i,n),n},qp=class extends Pp.BeanStub{hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,i,s){const r=s?"filterMenuTab":void 0;this.showMenu(e,s=>{var n;const o=s.getGui();this.popupService.positionPopupUnderMouseEvent({type:i,column:e,mouseEvent:t,ePopup:o}),r&&(null==(n=s.showTab)||n.call(s,r)),this.dispatchVisibleChangedEvent(!0,!1,e,r)},i,r,void 0,t.target)}showMenuAfterButtonClick(e,t,i,s){let r=-1,n="left";this.gos.get("enableRtl")&&(r=1,n="right");const o=s?"filterMenuTab":void 0,a=o?[o]:void 0,l=this.menuService.isLegacyMenuEnabled();let c=(l?9:4)*r,h=l?-23:4;this.showMenu(e,s=>{var r;const a=s.getGui();this.popupService.positionPopupByComponent({type:i,column:e,eventSource:t,ePopup:a,alignSide:n,nudgeX:c,nudgeY:h,position:"under",keepWithinBounds:!0}),o&&(null==(r=s.showTab)||r.call(s,o)),this.dispatchVisibleChangedEvent(!0,!1,e,o)},i,o,a,t)}showMenu(e,t,i,s,r,n){var o;const{menu:a,eMenuGui:l,anchorToElement:c,restoreFocusParams:h}=this.getMenuParams(e,r,n),d=[];d.push(t=>{const i=a.getGui();this.destroyBean(a),e&&(e.setMenuVisible(!1,"contextMenu"),this.menuUtils.restoreFocusOnClose(h,i,t))});const u=this.localeService.getLocaleTextFunc();if(this.popupService.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:t=>{d.forEach(e=>e(t)),this.dispatchVisibleChangedEvent(!1,!1,e,s)},afterGuiAttached:e=>a.afterGuiAttached(Object.assign({},{container:i},e)),positionCallback:s?()=>t(a):void 0,ariaLabel:u("ariaLabelColumnMenu","Column Menu")}),s||(null==(o=a.showTabBasedOnPreviousSelection)||o.call(a),t(a)),this.menuService.isColumnMenuAnchoringEnabled()){const t=this.popupService.setPopupPositionRelatedToElement(l,c);t&&e&&this.addStopAnchoring(t,e,d)}a.addEventListener(Zp.EVENT_TAB_SELECTED,t=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=t.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),null==e||e.setMenuVisible(!0,"contextMenu"),this.activeMenu=a,a.addEventListener(Pp.BeanStub.EVENT_DESTROYED,()=>{this.activeMenu===a&&(this.activeMenu=null)})}addStopAnchoring(e,t,i){e.then(e=>{t.addEventListener("leftChanged",e),t.addEventListener("visibleChanged",e),i.push(()=>{t.removeEventListener("leftChanged",e),t.removeEventListener("visibleChanged",e)})})}getMenuParams(e,t,i){const s={column:e,headerPosition:this.focusService.getFocusedHeader(),columnIndex:this.columnModel.getAllDisplayedColumns().indexOf(e),eventSource:i},r=this.createMenu(e,s,t,i);return{menu:r,eMenuGui:r.getGui(),anchorToElement:i||this.ctrlsService.getGridBodyCtrl().getGui(),restoreFocusParams:s}}createMenu(e,t,i,s){return this.menuService.isLegacyMenuEnabled()?this.createBean(new Zp(e,t,this.lastSelectedTab,i,s)):this.createBean(new Qp(e,t,s))}dispatchVisibleChangedEvent(e,t,i,s){var r,n;const o={type:Pp.Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:t,key:null!=(n=null!=(r=this.lastSelectedTab)?r:s)?n:this.menuService.isLegacyMenuEnabled()?Zp.TAB_GENERAL:"columnMenu",column:null!=i?i:null};this.eventService.dispatchEvent(o)}isMenuEnabled(e){var t;if(!this.menuService.isLegacyMenuEnabled())return!0;const i=!this.filterManager.isFilterAllowed(e),s=null!=(t=e.getColDef().menuTabs)?t:Zp.TABS_DEFAULT;return(i&&s.includes(Zp.TAB_FILTER)?s.length-1:s.length)>0}showMenuAfterContextMenuEvent(e,t,i){this.menuUtils.onContextMenu(t,i,t=>(this.showMenuAfterMouseEvent(e,t,"columnMenu"),!0))}};Yp([(0,Pp.Autowired)("popupService")],qp.prototype,"popupService",2),Yp([(0,Pp.Autowired)("focusService")],qp.prototype,"focusService",2),Yp([(0,Pp.Autowired)("ctrlsService")],qp.prototype,"ctrlsService",2),Yp([(0,Pp.Autowired)("columnModel")],qp.prototype,"columnModel",2),Yp([(0,Pp.Autowired)("filterManager")],qp.prototype,"filterManager",2),Yp([(0,Pp.Autowired)("menuUtils")],qp.prototype,"menuUtils",2),Yp([(0,Pp.Autowired)("menuService")],qp.prototype,"menuService",2),qp=Yp([(0,Pp.Bean)("enterpriseMenuFactory")],qp);var Xp=class e extends Pp.BeanStub{constructor(t,i,s,r,n){super(),this.column=t,this.restoreFocusParams=i,this.initialSelection=s,this.restrictTo=r,this.sourceElement=n,this.tabFactories={},this.includeChecks={},this.tabFactories[e.TAB_GENERAL]=this.createMainPanel.bind(this),this.tabFactories[e.TAB_FILTER]=this.createFilterPanel.bind(this),this.tabFactories[e.TAB_COLUMNS]=this.createColumnsPanel.bind(this),this.includeChecks[e.TAB_GENERAL]=()=>!0,this.includeChecks[e.TAB_FILTER]=()=>!!t&&this.filterManager.isFilterAllowed(t),this.includeChecks[e.TAB_COLUMNS]=()=>!0}init(){const e=this.getTabsToCreate().map(e=>this.createTab(e));this.tabbedLayout=new Pp.TabbedLayout({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout),this.addDestroyFunc(()=>this.destroyBean(this.tabbedLayout))}getTabsToCreate(){var t,i;return this.restrictTo?this.restrictTo:(null!=(i=null==(t=this.column)?void 0:t.getColDef().menuTabs)?i:e.TABS_DEFAULT).filter(e=>this.isValidMenuTabItem(e)).filter(e=>this.isNotSuppressed(e)).filter(e=>this.isModuleLoaded(e))}isModuleLoaded(t){return t!==e.TAB_COLUMNS||Pp.ModuleRegistry.__isRegistered(Pp.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())}isValidMenuTabItem(t){let i=!0,s=e.TABS_DEFAULT;return null!=this.restrictTo&&(i=this.restrictTo.indexOf(t)>-1,s=this.restrictTo),i=i&&e.TABS_DEFAULT.indexOf(t)>-1,i||console.warn(`AG Grid: Trying to render an invalid menu item '${t}'. Check that your 'menuTabs' contains one of [${s}]`),i}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(t){this.tabItemColumns&&t===e.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&t===e.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&t===e.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()}onTabItemClicked(t){let i=null;switch(t.item){case this.tabItemColumns:i=e.TAB_COLUMNS;break;case this.tabItemFilter:i=e.TAB_FILTER;break;case this.tabItemGeneral:i=e.TAB_GENERAL}i&&this.activateTab(i)}activateTab(t){const i={type:e.EVENT_TAB_SELECTED,key:t};this.dispatchEvent(i)}createMainPanel(){return this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return null!=(e=this.sourceElement)?e:this.getGui()}),this.mainMenuList.addEventListener(Pp.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.tabItemGeneral={title:Pp._.createIconNoSpan("menu",this.gos,this.column),titleLabel:e.TAB_GENERAL.replace("MenuTab",""),bodyPromise:Pp.AgPromise.resolve(this.mainMenuList.getGui()),name:e.TAB_GENERAL},this.tabItemGeneral}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const t=this.column?this.createManagedBean(new Pp.FilterWrapperComp(this.column,"COLUMN_MENU")):null;if(!(null==t?void 0:t.hasFilter()))throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:Pp._.createIconNoSpan("filter",this.gos,this.column),titleLabel:e.TAB_FILTER.replace("MenuTab",""),bodyPromise:Pp.AgPromise.resolve(null==t?void 0:t.getGui()),afterAttachedCallback:e=>t.afterGuiAttached(e),afterDetachedCallback:()=>t.afterGuiDetached(),name:e.TAB_FILTER},this.tabItemFilter}createColumnsPanel(){const t=document.createElement("div");t.classList.add("ag-menu-column-select-wrapper");const i=this.columnChooserFactory.createColumnSelectPanel(this,this.column).getGui();return i.classList.add("ag-menu-column-select"),t.appendChild(i),this.tabItemColumns={title:Pp._.createIconNoSpan("columns",this.gos,this.column),titleLabel:e.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:Pp.AgPromise.resolve(t),name:e.TAB_COLUMNS},this.tabItemColumns}afterGuiAttached(e){const{container:t,hidePopup:i}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:i}),i&&(this.hidePopupFunc=i,this.addDestroyFunc(i))}getGui(){return this.tabbedLayout.getGui()}};Xp.EVENT_TAB_SELECTED="tabSelected",Xp.TAB_FILTER="filterMenuTab",Xp.TAB_GENERAL="generalMenuTab",Xp.TAB_COLUMNS="columnsMenuTab",Xp.TABS_DEFAULT=[Xp.TAB_GENERAL,Xp.TAB_FILTER,Xp.TAB_COLUMNS],Yp([(0,Pp.Autowired)("filterManager")],Xp.prototype,"filterManager",2),Yp([(0,Pp.Autowired)("columnChooserFactory")],Xp.prototype,"columnChooserFactory",2),Yp([(0,Pp.Autowired)("columnMenuFactory")],Xp.prototype,"columnMenuFactory",2),Yp([(0,Pp.Autowired)("menuUtils")],Xp.prototype,"menuUtils",2),Yp([Pp.PostConstruct],Xp.prototype,"init",1);var Zp=Xp,Qp=class extends Pp.Component{constructor(e,t,i){super('\n            <div ref="eColumnMenu" role="presentation" class="ag-menu ag-column-menu"></div>\n        '),this.column=e,this.restoreFocusParams=t,this.sourceElement=i}init(){this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return null!=(e=this.sourceElement)?e:this.getGui()}),this.mainMenuList.addEventListener(Pp.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};Yp([(0,Pp.Autowired)("columnMenuFactory")],Qp.prototype,"columnMenuFactory",2),Yp([(0,Pp.Autowired)("menuUtils")],Qp.prototype,"menuUtils",2),Yp([(0,Pp.Autowired)("focusService")],Qp.prototype,"focusService",2),Yp([(0,Pp.RefSelector)("eColumnMenu")],Qp.prototype,"eColumnMenu",2),Yp([Pp.PostConstruct],Qp.prototype,"init",1);var Jp="ag-context-menu-open",eg=class extends kp.BeanStub{hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(e,t,i){const s=[];if(kp._.exists(e)&&kp.ModuleRegistry.__isRegistered(kp.ModuleNames.ClipboardModule,this.context.getGridId())&&t&&(this.gos.get("suppressCutToClipboard")||s.push("cut"),s.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gos.get("enableCharts")&&kp.ModuleRegistry.__isRegistered(kp.ModuleNames.GridChartsModule,this.context.getGridId())&&(this.columnModel.isPivotMode()&&s.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&s.push("chartRange")),kp._.exists(e)){const e=!kp.ModuleRegistry.__isRegistered(kp.ModuleNames.CsvExportModule,this.context.getGridId()),t=!kp.ModuleRegistry.__isRegistered(kp.ModuleNames.ExcelExportModule,this.context.getGridId()),i=this.gos.get("suppressExcelExport")||t,r=this.gos.get("suppressCsvExport")||e;!(kp._.isIOSUserAgent()||i&&r)&&s.push("export")}const r=s.length?s:void 0,n=null==t?void 0:t.getColDef().contextMenuItems;if(Array.isArray(n))return n;if("function"==typeof n)return n(this.gos.addGridCommonParams({column:t,node:e,value:i,defaultItems:r}));const o=this.gos.getCallback("getContextMenuItems");return o?o({column:t,node:e,value:i,defaultItems:r}):s}onContextMenu(e,t,i,s,r,n){this.menuUtils.onContextMenu(e,t,e=>this.showMenu(i,s,r,e,n))}showMenu(e,t,i,s,r){const n=this.getMenuItems(e,t,i),o=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===n||kp._.missingOrEmpty(n))return!1;const a=new tg(n,t,e,i);this.createBean(a);const l=a.getGui(),c={column:t,rowNode:e,type:"contextMenu",mouseEvent:s,ePopup:l,nudgeY:1},h=this.localeService.getLocaleTextFunc(),d=this.popupService.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:e=>{o.classList.remove(Jp),this.destroyBean(a),this.dispatchVisibleChangedEvent(!1,void 0===e?"api":"ui")},click:s,positionCallback:()=>{const e=this.gos.get("enableRtl");this.popupService.positionPopupUnderMouseEvent($p(Kp({},c),{nudgeX:e?-1*(l.offsetWidth+1):1}))},anchorToElement:r,ariaLabel:h("ariaLabelContextMenu","Context Menu")});d&&(o.classList.add(Jp),a.afterGuiAttached({container:"contextMenu",hidePopup:d.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=a,a.addEventListener(kp.BeanStub.EVENT_DESTROYED,()=>{this.activeMenu===a&&(this.activeMenu=null)}),d&&a.addEventListener(kp.AgMenuItemComponent.EVENT_CLOSE_MENU,e=>{var t,i;return d.hideFunc({mouseEvent:null!=(t=e.mouseEvent)?t:void 0,keyboardEvent:null!=(i=e.keyboardEvent)?i:void 0,forceHide:!0})});const u=s&&s instanceof MouseEvent&&"mousedown"===s.type;return this.dispatchVisibleChangedEvent(!0,u?"api":"ui"),!0}dispatchVisibleChangedEvent(e,t="ui"){const i={type:kp.Events.EVENT_CONTEXT_MENU_VISIBLE_CHANGED,visible:e,source:t};this.eventService.dispatchEvent(i)}};Yp([(0,kp.Autowired)("popupService")],eg.prototype,"popupService",2),Yp([(0,kp.Autowired)("ctrlsService")],eg.prototype,"ctrlsService",2),Yp([(0,kp.Autowired)("columnModel")],eg.prototype,"columnModel",2),Yp([(0,kp.Autowired)("menuUtils")],eg.prototype,"menuUtils",2),Yp([(0,kp.Optional)("rangeService")],eg.prototype,"rangeService",2),eg=Yp([(0,kp.Bean)("contextMenuFactory")],eg);var tg=class extends kp.Component{constructor(e,t,i,s){super('<div class="ag-menu" role="presentation"></div>'),this.menuItems=e,this.column=t,this.node=i,this.value=s,this.menuList=null,this.focusedCell=null}addMenuItems(){const e=this.createManagedBean(new kp.AgMenuList(0,{column:this.column,node:this.node,value:this.value})),t=this.menuItemMapper.mapWithStockItems(this.menuItems,null,()=>this.getGui());e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener(kp.AgMenuItemComponent.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e))}afterGuiAttached(e){e.hidePopup&&this.addDestroyFunc(e.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())}restoreFocusedCell(){const e=this.focusService.getFocusedCell();if(e&&this.focusedCell&&this.cellPositionUtils.equals(e,this.focusedCell)){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCell,s=this.gos.getDocument(),r=this.gos.getActiveDomElement();r&&r!==s.body||this.focusService.setFocusedCell({rowIndex:e,column:i,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!this.focusService.isKeyboardMode()})}}destroy(){this.restoreFocusedCell(),super.destroy()}};Yp([(0,kp.Autowired)("menuItemMapper")],tg.prototype,"menuItemMapper",2),Yp([(0,kp.Autowired)("focusService")],tg.prototype,"focusService",2),Yp([(0,kp.Autowired)("cellPositionUtils")],tg.prototype,"cellPositionUtils",2),Yp([kp.PostConstruct],tg.prototype,"addMenuItems",1);var ig=class extends Lp.BeanStub{mapWithStockItems(e,t,i){if(!e)return[];const s=[];return e.forEach(e=>{let r;if(r="string"==typeof e?this.getStockMenuItem(e,t,i):Kp({},e),!r)return;const n=r,{subMenu:o}=n;o&&o instanceof Array&&(n.subMenu=this.mapWithStockItems(o,t,i)),null!=r&&s.push(r)}),s}getStockMenuItem(e,t,i){var s;const r=this.localeService.getLocaleTextFunc(),n=this.gos.get("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:r("pinColumn","Pin Column"),icon:Lp._.createIconNoSpan("menuPin",this.gos,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:r("pinLeft","Pin Left"),action:()=>this.columnModel.setColumnsPinned([t],"left","contextMenu"),checked:!!t&&t.isPinnedLeft()};case"pinRight":return{name:r("pinRight","Pin Right"),action:()=>this.columnModel.setColumnsPinned([t],"right","contextMenu"),checked:!!t&&t.isPinnedRight()};case"clearPinned":return{name:r("noPin","No Pin"),action:()=>this.columnModel.setColumnsPinned([t],null,"contextMenu"),checked:!!t&&!t.isPinned()};case"valueAggSubMenu":return Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.RowGroupingModule,"Aggregation from Menu",this.context.getGridId())&&((null==t?void 0:t.isPrimary())||(null==t?void 0:t.getColDef().pivotValueColumn))?{name:r("valueAggregation","Value Aggregation"),icon:Lp._.createIconNoSpan("menuValue",this.gos,null),subMenu:this.createAggregationSubMenu(t,this.aggFuncService)}:null;case"autoSizeThis":return{name:r("autosizeThiscolumn","Autosize This Column"),action:()=>this.columnModel.autoSizeColumn(t,"contextMenu",n)};case"autoSizeAll":return{name:r("autosizeAllColumns","Autosize All Columns"),action:()=>this.columnModel.autoSizeAllColumns("contextMenu",n)};case"rowGroup":return{name:r("groupBy","Group by")+" "+Lp._.escapeString(this.columnModel.getDisplayNameForColumn(t,"header")),disabled:(null==t?void 0:t.isRowGroupActive())||!(null==t?void 0:t.getColDef().enableRowGroup),action:()=>this.columnModel.addRowGroupColumns([t],"contextMenu"),icon:Lp._.createIconNoSpan("menuAddRowGroup",this.gos,null)};case"rowUnGroup":const o=Lp._.createIconNoSpan("menuRemoveRowGroup",this.gos,null),a=null==t?void 0:t.getColDef().showRowGroup,l=this.gos.get("groupLockGroupColumns");if(!0===a)return{name:r("ungroupAll","Un-Group All"),disabled:-1===l||l>=this.columnModel.getRowGroupColumns().length,action:()=>this.columnModel.setRowGroupColumns(this.columnModel.getRowGroupColumns().slice(0,l),"contextMenu"),icon:o};if("string"==typeof a){const e=this.columnModel.getPrimaryColumn(a),t=null!=e?Lp._.escapeString(this.columnModel.getDisplayNameForColumn(e,"header")):a;return{name:r("ungroupBy","Un-Group by")+" "+t,disabled:null!=e&&this.columnModel.isColumnGroupingLocked(e),action:()=>this.columnModel.removeRowGroupColumns([a],"contextMenu"),icon:o}}return{name:r("ungroupBy","Un-Group by")+" "+Lp._.escapeString(this.columnModel.getDisplayNameForColumn(t,"header")),disabled:!(null==t?void 0:t.isRowGroupActive())||!(null==t?void 0:t.getColDef().enableRowGroup)||this.columnModel.isColumnGroupingLocked(t),action:()=>this.columnModel.removeRowGroupColumns([t],"contextMenu"),icon:o};case"resetColumns":return{name:r("resetColumns","Reset Columns"),action:()=>this.columnModel.resetColumnState("contextMenu")};case"expandAll":return{name:r("expandAll","Expand All Row Groups"),action:()=>this.gridApi.expandAll()};case"contractAll":return{name:r("collapseAll","Collapse All Row Groups"),action:()=>this.gridApi.collapseAll()};case"copy":return Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:r("copy","Copy"),shortcut:r("ctrlC","Ctrl+C"),icon:Lp._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard()}:null;case"copyWithHeaders":return Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:r("copyWithHeaders","Copy with Headers"),icon:Lp._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:r("copyWithGroupHeaders","Copy with Group Headers"),icon:Lp._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.ClipboardModule,"Cut from Menu",this.context.getGridId())){const e=this.focusService.getFocusedCell(),t=e?this.rowPositionUtils.getRowNode(e):null,i=!!t&&(null==e?void 0:e.column.isCellEditable(t));return{name:r("cut","Cut"),shortcut:r("ctrlX","Ctrl+X"),icon:Lp._.createIconNoSpan("clipboardCut",this.gos,null),disabled:!i||this.gos.get("suppressCutToClipboard"),action:()=>this.clipboardService.cutToClipboard(void 0,"contextMenu")}}return null;case"paste":return Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:r("paste","Paste"),shortcut:r("ctrlV","Ctrl+V"),disabled:!0,icon:Lp._.createIconNoSpan("clipboardPaste",this.gos,null),action:()=>this.clipboardService.pasteFromClipboard()}:null;case"export":const c=[],h=Lp.ModuleRegistry.__isRegistered(Lp.ModuleNames.CsvExportModule,this.context.getGridId()),d=Lp.ModuleRegistry.__isRegistered(Lp.ModuleNames.ExcelExportModule,this.context.getGridId());return!this.gos.get("suppressCsvExport")&&h&&c.push("csvExport"),!this.gos.get("suppressExcelExport")&&d&&c.push("excelExport"),{name:r("export","Export"),subMenu:c,icon:Lp._.createIconNoSpan("save",this.gos,null)};case"csvExport":return{name:r("csvExport","CSV Export"),icon:Lp._.createIconNoSpan("csvExport",this.gos,null),action:()=>this.gridApi.exportDataAsCsv({})};case"excelExport":return{name:r("excelExport","Excel Export"),icon:Lp._.createIconNoSpan("excelExport",this.gos,null),action:()=>this.gridApi.exportDataAsExcel()};case"separator":return"separator";case"pivotChart":case"chartRange":return null!=(s=this.chartMenuItemMapper.getChartItems(e))?s:null;case"columnFilter":return t?{name:r("columnFilter","Column Filter"),icon:Lp._.createIconNoSpan("filter",this.gos,null),action:()=>this.menuService.showFilterMenu({column:t,buttonElement:i(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":return Lp.ModuleRegistry.__isRegistered(Lp.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())?{name:r("columnChooser","Choose Columns"),icon:Lp._.createIconNoSpan("columns",this.gos,null),action:()=>this.menuService.showColumnChooser({column:t,eventSource:i()})}:null;case"sortAscending":return{name:r("sortAscending","Sort Ascending"),icon:Lp._.createIconNoSpan("sortAscending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"asc",!1,"columnMenu")};case"sortDescending":return{name:r("sortDescending","Sort Descending"),icon:Lp._.createIconNoSpan("sortDescending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"desc",!1,"columnMenu")};case"sortUnSort":return{name:r("sortUnSort","Clear Sort"),icon:Lp._.createIconNoSpan("sortUnSort",this.gos,null),action:()=>this.sortController.setSortForColumn(t,null,!1,"columnMenu")};default:return console.warn(`AG Grid: unknown menu item type ${e}`),null}}createAggregationSubMenu(e,t){const i=this.localeService.getLocaleTextFunc();let s;if(e.isPrimary())s=e;else{const t=e.getColDef().pivotValueColumn;s=Lp._.exists(t)?t:void 0}const r=[];if(s){const e=s.isValueActive(),n=t.getFuncNames(s);r.push({name:i("noAggregation","None"),action:()=>{this.columnModel.removeValueColumns([s],"contextMenu"),this.columnModel.setColumnAggFunc(s,void 0,"contextMenu")},checked:!e}),n.forEach(n=>{r.push({name:i(n,t.getDefaultFuncLabel(n)),action:()=>{this.columnModel.setColumnAggFunc(s,n,"contextMenu"),this.columnModel.addValueColumns([s],"contextMenu")},checked:e&&s.getAggFunc()===n})})}return r}};Yp([(0,Lp.Autowired)("columnModel")],ig.prototype,"columnModel",2),Yp([(0,Lp.Autowired)("gridApi")],ig.prototype,"gridApi",2),Yp([(0,Lp.Autowired)("focusService")],ig.prototype,"focusService",2),Yp([(0,Lp.Autowired)("rowPositionUtils")],ig.prototype,"rowPositionUtils",2),Yp([(0,Lp.Autowired)("chartMenuItemMapper")],ig.prototype,"chartMenuItemMapper",2),Yp([(0,Lp.Autowired)("menuService")],ig.prototype,"menuService",2),Yp([(0,Lp.Autowired)("sortController")],ig.prototype,"sortController",2),Yp([(0,Lp.Optional)("clipboardService")],ig.prototype,"clipboardService",2),Yp([(0,Lp.Optional)("aggFuncService")],ig.prototype,"aggFuncService",2),ig=Yp([(0,Lp.Bean)("menuItemMapper")],ig);var sg=class extends Np.BeanStub{getChartItems(e){var t,i;if(!this.chartService)return void Np.ModuleRegistry.__assertRegistered(Np.ModuleNames.GridChartsModule,`the Context Menu key "${e}"`,this.context.getGridId());const s="pivotChart"===e?new rg(this.gos,this.chartService,this.localeService):new ng(this.gos,this.chartService,this.localeService),r=this.chartService.isEnterprise();let n=s.getMenuItem();if(n&&n.subMenu&&!r){const e=t=>{var i;return $p(Kp({},t),{subMenu:null==(i=t.subMenu)?void 0:i.filter(e=>!e._enterprise).map(t=>e(t))})};n=e(n)}const o=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.settingsPanel)?void 0:i.chartGroupsDef;return o&&(n=sg.filterAndOrderChartMenu(n,o,s.getConfigLookup())),this.cleanInternals(n)}cleanInternals(e){if(!e)return e;const t=e=>{var i;return null==e||delete e._key,null==e||delete e._enterprise,null==(i=null==e?void 0:e.subMenu)||i.forEach(e=>t(e)),e};return t(e)}static buildLookup(e){let t={};const i=e=>{t[e._key]=e,e.subMenu&&e.subMenu.forEach(e=>i(e))};return i(e),t}static filterAndOrderChartMenu(e,t,i){var s;const r=this.buildLookup(e);let n=$p(Kp({},e),{subMenu:[]});if(Object.entries(t).forEach(([e,t])=>{var s,o;const a=i[e];if(null===a)return;if(null==a)return void Np._.warnOnce(`invalid chartGroupsDef config '${e}'`);const l=r[a._key];if(l)if(l.subMenu){const i=t.map(t=>{const i=a[t];if(null!=i)return r[i];Np._.warnOnce(`invalid chartGroupsDef config '${e}.${t}'`)}).filter(e=>void 0!==e);i.length>0&&(l.subMenu=i,null==(s=n.subMenu)||s.push(l))}else null==(o=n.subMenu)||o.push(l)}),0!=(null==(s=n.subMenu)?void 0:s.length))return n}};Yp([(0,Np.Optional)("chartService")],sg.prototype,"chartService",2),sg=Yp([(0,Np.Bean)("chartMenuItemMapper")],sg);var rg=class{constructor(e,t,i){this.gos=e,this.chartService=t,this.localeService=i}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(t,i,s,r,n=!1)=>({name:e(t,i),action:()=>this.chartService.createPivotChart({chartType:s}),_key:r,_enterprise:n});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","pivotPie"),t("donut","Donut&lrm;","donut","pivotDonut")]},t("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","pivotScatter"),t("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","pivotArea"),t("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram&lrm;","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap&lrm;","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst&lrm;","sunburst","pivotSunburst",!0)]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:Np._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},polarGroup:null,specializedGroup:null}}},ng=class{constructor(e,t,i){this.gos=e,this.chartService=t,this.localeService=i}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(t,i,s,r,n=!1)=>({name:e(t,i),action:()=>this.chartService.createChartFromCurrentRange(s),_key:r,_enterprise:n});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","rangePie"),t("donut","Donut&lrm;","donut","rangeDonut")],_key:"rangePieChart"},t("line","Line&lrm;","line","rangeLineChart"),{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","rangeScatter"),t("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","rangeArea"),t("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line&lrm;","radarLine","rangeRadarLine"),t("radarArea","Radar Area&lrm;","radarArea","rangeRadarArea"),t("nightingale","Nightingale&lrm;","nightingale","rangeNightingale"),t("radialColumn","Radial Column&lrm;","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar&lrm;","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot&lrm;","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram&lrm;","histogram","rangeHistogram",!1),t("rangeBar","Range Bar&lrm;","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area&lrm;","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap&lrm;","treemap","rangeTreemap"),t("sunburst","Sunburst&lrm;","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap&lrm;","heatmap","rangeHeatmap"),t("waterfall","Waterfall&lrm;","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:Np._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},og=class extends _p.BeanStub{createColumnSelectPanel(e,t,i,s){var r,n;const o=e.createManagedBean(new wh),a=null!=(n=null!=(r=null!=s?s:null==t?void 0:t.getColDef().columnChooserParams)?r:null==t?void 0:t.getColDef().columnsMenuParams)?n:{},{contractColumnSelection:l,suppressColumnExpandAll:c,suppressColumnFilter:h,suppressColumnSelectAll:d,suppressSyncLayoutWithGrid:u,columnLayout:p}=a;return o.init(!!i,this.gos.addGridCommonParams({suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!l,suppressColumnExpandAll:!!c,suppressColumnFilter:!!h,suppressColumnSelectAll:!!d,suppressSyncLayoutWithGrid:!!p||!!u,onStateUpdated:()=>{}}),"columnMenu"),p&&o.setColumnLayout(p),o}showColumnChooser({column:e,chooserParams:t,eventSource:i}){this.hideActiveColumnChooser();const s=this.createColumnSelectPanel(this,e,!0,t),r=this.localeService.getLocaleTextFunc(),n=this.columnModel.getAllDisplayedColumns().indexOf(e),o=e?this.focusService.getFocusedHeader():null;this.activeColumnChooserDialog=this.createBean(new _p.AgDialog({title:r("chooseColumns","Choose Columns"),component:s,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var t;null==(t=this.focusService.findNextFocusableElement(s.getGui()))||t.focus(),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:t=>{const s=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&this.menuUtils.restoreFocusOnClose({column:e,headerPosition:o,columnIndex:n,eventSource:i},s,t,!0)}})),this.activeColumnChooser=s}hideActiveColumnChooser(){this.activeColumnChooserDialog&&this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){const i={type:_p.Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:"columnChooser",column:null!=t?t:null};this.eventService.dispatchEvent(i)}};Yp([(0,_p.Autowired)("focusService")],og.prototype,"focusService",2),Yp([(0,_p.Autowired)("menuUtils")],og.prototype,"menuUtils",2),Yp([(0,_p.Autowired)("columnModel")],og.prototype,"columnModel",2),og=Yp([(0,_p.Bean)("columnChooserFactory")],og);var ag=class extends Op.BeanStub{createMenu(e,t,i){const s=e.createManagedBean(new Op.AgMenuList(0,{column:null!=t?t:null,node:null,value:null})),r=this.getMenuItems(t),n=this.menuItemMapper.mapWithStockItems(r,null!=t?t:null,i);return s.addMenuItems(n),s}getMenuItems(e){const t=this.getDefaultMenuOptions(e);let i;const s=null==e?void 0:e.getColDef().mainMenuItems;if(Array.isArray(s))i=s;else if("function"==typeof s)i=s(this.gos.addGridCommonParams({column:e,defaultItems:t}));else{const s=this.gos.getCallback("getMainMenuItems");i=s&&e?s({column:e,defaultItems:t}):t}return Op._.removeRepeatsFromArray(i,ag.MENU_ITEM_SEPARATOR),i}getDefaultMenuOptions(e){const t=[],i=this.menuService.isLegacyMenuEnabled();if(!e)return i||t.push("columnChooser"),t.push("resetColumns"),t;const s=!e.getColDef().lockPinned,r=this.columnModel.getRowGroupColumns().length,n=r>0,o=e.isAllowValue(),a=e.isAllowRowGroup(),l=e.isPrimary(),c=this.columnModel.isPivotMode(),h="clientSide"===this.rowModel.getType(),d=this.gos.get("treeData"),u=l&&n&&o||!l;if(!i&&e.isSortable()){const i=e.getSort();"asc"!==i&&t.push("sortAscending"),"desc"!==i&&t.push("sortDescending"),i&&t.push("sortUnSort"),t.push(ag.MENU_ITEM_SEPARATOR)}return this.menuService.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(ag.MENU_ITEM_SEPARATOR)),s&&t.push("pinSubMenu"),u&&t.push("valueAggSubMenu"),(s||u)&&t.push(ag.MENU_ITEM_SEPARATOR),t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(ag.MENU_ITEM_SEPARATOR),e.getColDef().showRowGroup?t.push("rowUnGroup"):a&&e.isPrimary()&&(e.isRowGroupActive()?this.columnModel.isColumnGroupingLocked(e)||t.push("rowUnGroup"):t.push("rowGroup")),t.push(ag.MENU_ITEM_SEPARATOR),i||t.push("columnChooser"),t.push("resetColumns"),h&&(d||r>(c?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}};ag.MENU_ITEM_SEPARATOR="separator",Yp([(0,Op.Autowired)("menuItemMapper")],ag.prototype,"menuItemMapper",2),Yp([(0,Op.Autowired)("columnModel")],ag.prototype,"columnModel",2),Yp([(0,Op.Autowired)("rowModel")],ag.prototype,"rowModel",2),Yp([(0,Op.Autowired)("filterManager")],ag.prototype,"filterManager",2),Yp([(0,Op.Autowired)("menuService")],ag.prototype,"menuService",2),ag=Yp([(0,Op.Bean)("columnMenuFactory")],ag);var lg=class extends Fp.BeanStub{restoreFocusOnClose(e,t,i,s){const{eventSource:r}=e,n=i instanceof KeyboardEvent;if(!s&&!n||!r)return;const o=this.gos.getDocument(),a=this.gos.getActiveDomElement();(t.contains(a)||a===o.body)&&this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,i){let s;i&&i.keyboardEvent&&(s=i.keyboardEvent),e(s&&{keyboardEvent:s});const r=this.focusService.getFocusedCell(),n=this.gos.getDocument(),o=this.gos.getActiveDomElement();if(!o||o===n.body)if(r){const{rowIndex:e,rowPinned:t,column:i}=r;this.focusService.setFocusedCell({rowIndex:e,column:i,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e,t,i){if((this.gos.get("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gos.get("suppressContextMenu")&&i(null!=e?e:t.touches[0]))){const i=null!=e?e:t;i&&i.cancelable&&i.preventDefault()}}focusHeaderCell(e){const{column:t,columnIndex:i,headerPosition:s,eventSource:r}=e;if(this.columnModel.getAllDisplayedColumns().some(e=>e===t)&&r&&Fp._.isVisible(r)){const e=this.focusService.findTabbableParent(r);e&&(t&&this.headerNavigationService.scrollToColumn(t),e.focus())}else if(s&&-1!==i){const e=this.columnModel.getAllDisplayedColumns(),t=e[i]||Fp._.last(e);t&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:s.headerRowIndex,column:t}})}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&2===e.which&&e.preventDefault()}};Yp([(0,Fp.Autowired)("focusService")],lg.prototype,"focusService",2),Yp([(0,Fp.Autowired)("headerNavigationService")],lg.prototype,"headerNavigationService",2),Yp([(0,Fp.Autowired)("columnModel")],lg.prototype,"columnModel",2),lg=Yp([(0,Fp.Bean)("menuUtils")],lg);var cg={version:"31.3.4",moduleName:Rp.ModuleNames.MenuModule,beans:[qp,eg,ig,sg,og,ag,lg],dependantModules:[D]},hg=i(98092),dg=i(98092),ug=i(98092),pg=Object.defineProperty,gg=Object.defineProperties,mg=Object.getOwnPropertyDescriptor,fg=Object.getOwnPropertyDescriptors,yg=Object.getOwnPropertySymbols,vg=Object.prototype.hasOwnProperty,Cg=Object.prototype.propertyIsEnumerable,bg=(e,t,i)=>t in e?pg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Sg=(e,t)=>{for(var i in t||(t={}))vg.call(t,i)&&bg(e,i,t[i]);if(yg)for(var i of yg(t))Cg.call(t,i)&&bg(e,i,t[i]);return e},wg=(e,t)=>gg(e,fg(t)),xg=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?mg(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&pg(t,i,n),n},Eg=class e extends dg.TabGuardComp{constructor(){super('<div class="ag-multi-filter ag-menu-list-compact"></div>'),this.filterDefs=[],this.filters=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.activeFilterIndices=[],this.lastActivatedMenuItem=null,this.afterFiltersReadyFuncs=[]}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}static getFilterDefs(e){const{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}init(t){this.params=t,this.filterDefs=e.getFilterDefs(t);const{column:i,filterChangedCallback:s}=t;this.column=i,this.filterChangedCallback=s;const r=[];return this.filterDefs.forEach((e,t)=>{const i=this.createFilter(e,t);null!=i&&r.push(i)}),new dg.AgPromise(e=>{dg.AgPromise.all(r).then(t=>{this.filters=t,this.refreshGui("columnMenu").then(()=>{e()})})}).then(()=>{this.afterFiltersReadyFuncs.forEach(e=>e()),this.afterFiltersReadyFuncs.length=0})}refreshGui(e){return e===this.lastOpenedInContainer?dg.AgPromise.resolve():(this.removeAllChildrenExceptTabGuards(),this.destroyChildren(),dg.AgPromise.all(this.filters.map((t,i)=>{const s=this.filterDefs[i],r=this.getFilterTitle(t,s);let n;if("subMenu"===s.display&&"toolPanel"!==e)n=this.insertFilterMenu(t,r).then(e=>e.getGui());else if("subMenu"===s.display||"accordion"===s.display){const e=this.insertFilterGroup(t,r);n=dg.AgPromise.resolve(e.getGui())}else n=dg.AgPromise.resolve(t.getGui());return n})).then(t=>{t.forEach((e,t)=>{t>0&&this.appendChild(dg._.loadTemplate('<div class="ag-filter-separator"></div>')),this.appendChild(e)}),this.filterGuis=t,this.lastOpenedInContainer=e}))}getFilterTitle(e,t){return null!=t.title?t.title:e instanceof dg.ProvidedFilter?e.getFilterTitle():"Filter"}destroyChildren(){this.guiDestroyFuncs.forEach(e=>e()),this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t){const i=this.createBean(new dg.AgMenuItemComponent);return i.init({menuItemDef:{name:t,subMenu:[],cssClasses:["ag-multi-filter-menu-item"],menuItem:dg.AgMenuItemRenderer,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:e,contextParams:{column:null,node:null,value:null}}).then(()=>{i.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(i)),this.addManagedListener(i,dg.AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED,e=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==e.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=e.menuItem});const e=i.getGui();return i.addManagedListener(e,"keydown",e=>{const{key:t}=e;switch(t){case dg.KeyCode.UP:case dg.KeyCode.RIGHT:case dg.KeyCode.DOWN:case dg.KeyCode.LEFT:e.preventDefault(),t===dg.KeyCode.RIGHT&&i.openSubMenu(!0)}}),i.addManagedListener(e,"focusin",()=>i.activate()),i.addManagedListener(e,"focusout",()=>{i.isSubMenuOpen()||i.isSubMenuOpening()||i.deactivate()}),i})}insertFilterGroup(e,t){const i=this.createBean(new dg.AgGroupComponent({title:t,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(i)),i.addItem(e.getGui()),i.toggleGroupExpand(!1),e.afterGuiAttached&&i.addManagedListener(i,dg.AgGroupComponent.EVENT_EXPANDED,()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})),i}isFilterActive(){return this.filters.some(e=>e.isFilterActive())}getLastActiveFilterIndex(){return this.activeFilterIndices.length>0?this.activeFilterIndices[this.activeFilterIndices.length-1]:null}doesFilterPass(e,t){let i=!0;return this.filters.forEach(s=>{i&&s!==t&&s.isFilterActive()&&(i=s.doesFilterPass(e))}),i}getFilterType(){return"multi"}getModelFromUi(){return{filterType:this.getFilterType(),filterModels:this.filters.map(e=>{const t=e;return"function"==typeof t.getModelFromUi?t.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.getFilterType(),filterModels:this.filters.map(e=>e.isFilterActive()?e.getModel():null)}:null}setModel(e){const t=(e,t)=>new dg.AgPromise(i=>{const s=e.setModel(t);s?s.then(()=>i()):i()});let i=[];return null==e?i=this.filters.map((e,i)=>t(e,null).then(()=>{this.updateActiveList(i)})):this.filters.forEach((s,r)=>{const n=e.filterModels.length>r?e.filterModels[r]:null,o=t(s,n).then(()=>{this.updateActiveList(r)});i.push(o)}),dg.AgPromise.all(i).then(()=>{})}applyModel(e="api"){let t=!1;return this.filters.forEach(i=>{i instanceof dg.ProvidedFilter&&(t=i.applyModel(e)||t)}),t}getChildFilterInstance(e){return this.filters[e]}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=dg.AgPromise.resolve()),t.then(()=>{const{filterDefs:t}=this;let i=!1;t&&dg._.forEachReverse(t,(t,s)=>{var r;const n=0===s,o=!n||"inline"!==t.display,a=wg(Sg({},null!=e?e:{}),{suppressFocus:o}),l=null==(r=this.filters)?void 0:r[s];if(l&&(this.executeFunctionIfExistsOnFilter(l,"afterGuiAttached",a),n&&(i=!0)),n&&o){const e=this.filterGuis[s];e&&(e.focus(),i=!0)}});const s=this.gos.getDocument(),r=this.gos.getActiveDomElement();i||r&&r!==s.body&&!this.getGui().contains(r)||this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged")}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded")}destroy(){this.filters.forEach(e=>this.destroyBean(e)),this.filters.length=0,this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeFunctionIfExists(e,...t){dg._.forEachReverse(this.filters,i=>{this.executeFunctionIfExistsOnFilter(i,e,t)})}executeFunctionIfExistsOnFilter(e,t,...i){const s=e[t];"function"==typeof s&&s.apply(e,i)}createFilter(e,t){const{filterModifiedCallback:i,doesRowPassOtherFilter:s}=this.params;let r;const n=wg(Sg({},this.filterManager.createFilterParams(this.column,this.column.getColDef())),{filterModifiedCallback:i,filterChangedCallback:e=>{this.executeWhenAllFiltersReady(()=>this.filterChanged(t,e))},doesRowPassOtherFilter:e=>s(e)&&this.doesFilterPass({node:e,data:e.data},r)}),o=this.userComponentFactory.getFilterDetails(e,n,"agTextColumnFilter");if(!o)return null;const a=o.newAgStackInstance();return a&&a.then(e=>r=e),a}executeWhenAllFiltersReady(e){this.filters&&this.filters.length>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveList(e){const t=this.filters[e];dg._.removeFromArray(this.activeFilterIndices,e),t.isFilterActive()&&this.activeFilterIndices.push(e)}filterChanged(e,t){this.updateActiveList(e),this.filterChangedCallback(t);const i=this.filters[e];this.filters.forEach(e=>{e!==i&&"function"==typeof e.onAnyFilterChanged&&e.onAnyFilterChanged()})}onFocusIn(e){null==this.lastActivatedMenuItem||this.lastActivatedMenuItem.getGui().contains(e.target)||(this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=null)}getModelAsString(e){var t,i,s,r;if(!this.filters||!(null==(t=null==e?void 0:e.filterModels)?void 0:t.length))return"";const n=null!=(i=this.getLastActiveFilterIndex())?i:0,o=this.filters[n];return null!=(r=null==(s=o.getModelAsString)?void 0:s.call(o,e.filterModels[n]))?r:""}};xg([(0,dg.Autowired)("filterManager")],Eg.prototype,"filterManager",2),xg([(0,dg.Autowired)("userComponentFactory")],Eg.prototype,"userComponentFactory",2),xg([dg.PostConstruct],Eg.prototype,"postConstruct",1);var Mg=Eg,Ag=class extends ug.Component{constructor(){super('<div class="ag-multi-floating-filter ag-floating-filter-input"></div>'),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(e=>{const i=null==e?void 0:e.newAgStackInstance();null!=i&&(this.compDetailsList.push(e),t.push(i))}),ug.AgPromise.all(t).then(e=>{e.forEach((e,t)=>{this.floatingFilters.push(e);const i=e.getGui();this.appendChild(i),t>0&&ug._.setDisplayed(i,!1)})})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:i}=this.getCompDetailsList(e);t.length===this.compDetailsList.length&&t.every((e,t)=>!this.filterManager.areFilterCompsDifferent(this.compDetailsList[t],e))?i.forEach((e,t)=>{var i;const s=this.floatingFilters[t];let r=!1;s.refresh&&null!==s.refresh(e)&&(r=!0),r||null==(i=s.onParamsUpdated)||i.call(s,e)}):(ug._.clearElement(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t))}getCompDetailsList(e){const t=[],i=[],s=e.filterParams;return Mg.getFilterDefs(s).forEach((s,r)=>{const n=wg(Sg({},e),{parentFilterInstance:e=>{this.parentMultiFilterInstance(t=>{const i=t.getChildFilterInstance(r);null!=i&&e(i)})}});ug._.mergeDeep(n.filterParams,s.filterParams);const o=this.getCompDetails(s,n);o&&(t.push(o),i.push(n))}),{compDetailsList:t,floatingFilterParamsList:i}}onParentModelChanged(e,t){t&&t.afterFloatingFilter||this.parentMultiFilterInstance(i=>{if(null==e)this.floatingFilters.forEach((e,i)=>{e.onParentModelChanged(null,t),ug._.setDisplayed(e.getGui(),0===i)});else{const s=i.getLastActiveFilterIndex();this.floatingFilters.forEach((i,r)=>{const n=e.filterModels.length>r?e.filterModels[r]:null;i.onParentModelChanged(n,t);const o=null==s?0===r:r===s;ug._.setDisplayed(i.getGui(),o)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){var i;let s=null!=(i=this.userComponentFactory.getDefaultFloatingFilterType(e,()=>this.filterManager.getDefaultFloatingFilter(this.params.column)))?i:"agReadOnlyFloatingFilter";return this.userComponentFactory.getFloatingFilterCompDetails(e,t,s)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof Mg))throw new Error("AG Grid - MultiFloatingFilterComp expects MultiFilter as its parent");e(t)})}};xg([(0,ug.Autowired)("userComponentFactory")],Ag.prototype,"userComponentFactory",2),xg([(0,ug.Autowired)("filterManager")],Ag.prototype,"filterManager",2);var Tg={version:"31.3.4",moduleName:hg.ModuleNames.MultiFilterModule,beans:[],userComponents:[{componentName:"agMultiColumnFilter",componentClass:Mg},{componentName:"agMultiColumnFloatingFilter",componentClass:Ag}],dependantModules:[D]},Dg=i(98092),Ig=i(98092),Rg=class extends Ig.PopupComponent{constructor(){super('<div class="ag-cell-edit-wrapper"></div>')}init(e){this.params=e;const{cellStartedEdit:t,cellHeight:i,values:s}=e;Ig._.missing(s)&&console.warn("AG Grid: agRichSelectCellEditor requires cellEditorParams.values to be set");const{params:r,valuesPromise:n}=this.buildRichSelectParams();this.richSelect=this.createManagedBean(new Ig.AgRichSelect(r)),this.richSelect.addCssClass("ag-cell-editor"),this.appendChild(this.richSelect),n&&n.then(e=>{this.richSelect.setValueList({valueList:e,refresh:!0});const t=this.getSearchStringCallback(e);t&&this.richSelect.setSearchStringCreator(t)}),this.addManagedListener(this.richSelect,Ig.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,this.onEditorPickerValueSelected.bind(this)),this.addManagedListener(this.richSelect.getGui(),"focusout",this.onEditorFocusOut.bind(this)),this.focusAfterAttached=t,Ig._.exists(i)&&this.richSelect.setRowHeight(i)}onEditorPickerValueSelected(e){this.params.stopEditing(!e.fromEnterKey)}onEditorFocusOut(e){this.richSelect.getGui().contains(e.relatedTarget)||this.params.stopEditing(!0)}buildRichSelectParams(){const{cellRenderer:e,value:t,values:i,formatValue:s,searchDebounceDelay:r,valueListGap:n,valueListMaxHeight:o,valueListMaxWidth:a,allowTyping:l,filterList:c,searchType:h,highlightMatch:d,valuePlaceholder:u,eventKey:p}=this.params,g={value:t,cellRenderer:e,searchDebounceDelay:r,valueFormatter:s,pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:n,allowTyping:l,filterList:c,searchType:h,highlightMatch:d,maxPickerHeight:o,maxPickerWidth:a,placeholder:u,initialInputValue:1===(null==p?void 0:p.length)?p:void 0};let m,f;return m="function"==typeof i?i(this.params):null!=i?i:[],Array.isArray(m)?(g.valueList=m,g.searchStringCreator=this.getSearchStringCallback(m)):f=m,{params:g,valuesPromise:f}}getSearchStringCallback(e){const{colDef:t}=this.params;if("object"==typeof e[0]&&t.keyCreator)return e=>e.map(e=>{const i=this.gos.addGridCommonParams({value:e,colDef:this.params.colDef,column:this.params.column,node:this.params.node,data:this.params.data});return t.keyCreator(i)})}afterGuiAttached(){const{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;if(e){const e=this.richSelect.getFocusableElement();e.focus();const{allowTyping:t,eventKey:i}=this.params;!t||i&&1===i.length||e.select()}this.richSelect.showPicker();const{eventKey:i}=t;i&&1===(null==i?void 0:i.length)&&this.richSelect.searchTextFromString(i)})}getValue(){return this.richSelect.getValue()}isPopup(){return!1}},Pg={version:"31.3.4",moduleName:Dg.ModuleNames.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:Rg},{componentName:"agRichSelectCellEditor",componentClass:Rg}],dependantModules:[D]},kg=i(98092),Lg=i(98092),Ng=i(98092),_g=i(98092),Og=i(98092),Fg=i(98092),Gg=i(98092),Bg=i(98092),Vg=i(98092),Hg=i(98092),Ug=i(98092),zg=i(98092),Wg=i(98092),jg=i(98092),Kg=i(98092),$g=i(98092),Yg=i(98092),qg=i(98092),Xg=i(98092),Zg=Object.defineProperty,Qg=Object.defineProperties,Jg=Object.getOwnPropertyDescriptor,em=Object.getOwnPropertyDescriptors,tm=Object.getOwnPropertySymbols,im=Object.prototype.hasOwnProperty,sm=Object.prototype.propertyIsEnumerable,rm=(e,t,i)=>t in e?Zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,nm=(e,t)=>{for(var i in t||(t={}))im.call(t,i)&&rm(e,i,t[i]);if(tm)for(var i of tm(t))sm.call(t,i)&&rm(e,i,t[i]);return e},om=(e,t)=>{var i={};for(var s in e)im.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&tm)for(var s of tm(e))t.indexOf(s)<0&&sm.call(e,s)&&(i[s]=e[s]);return i},am=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Jg(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Zg(t,i,n),n},lm=class extends Ng.RowNodeBlock{constructor(e,t,i){super(0),this.nodeIdSequence=new Ng.NumberSequence,this.info={},this.ssrmParams=e,this.parentRowNode=i,this.level=i.level+1,this.groupLevel=e.rowGroupCols?this.level<e.rowGroupCols.length:void 0,this.leafGroup=!!e.rowGroupCols&&this.level===e.rowGroupCols.length-1}postConstruct(){if(this.usingTreeData=this.gos.get("treeData"),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel){const e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}let e=1;const t=-1===this.parentRowNode.level,i=this.storeUtils.getServerSideInitialRowCount();t&&null!=i&&(e=i),this.initialiseRowNodes(e),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc(()=>this.rowNodeBlockLoader.removeBlock(this)),this.postSortFunc=this.gos.getCallback("postSortRows"),null!=i&&this.eventService.dispatchEventOnce({type:Ng.Events.EVENT_ROW_COUNT_READY})}destroyRowNodes(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}}initialiseRowNodes(e,t=!1){this.destroyRowNodes();for(let i=0;i<e;i++){const e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});t&&(e.failedLoad=!0),this.allRowNodes.push(e),this.nodesAfterFilter.push(e),this.nodesAfterSort.push(e)}}getBlockStateJson(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}}loadFromDatasource(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,success:this.success.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})}getStartRow(){return 0}getEndRow(){return this.nodesAfterSort.length}createDataNode(e,t){const i=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=t?Ng._.insertIntoArray(this.allRowNodes,i,t):this.allRowNodes.push(i);const s=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(i,e,s,void 0),this.nodeManager.addRowNode(i),this.blockUtils.checkOpenByDefault(i),this.allNodesMap[i.id]=i,i}prefixId(e){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+e:e.toString()}processServerFail(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}processServerResult(e){if(!this.isAlive())return;const t=e.groupLevelInfo;t&&Object.assign(this.info,t),e.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(e.pivotResultFields);const i=this.allRowNodes.length>0?this.allNodesMap:void 0;this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},e.rowData||Ng._.warnOnce('"params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.'),this.createOrRecycleNodes(i,e.rowData),i&&this.blockUtils.destroyRowNodes(Ng._.getAllValuesInObject(i)),0===this.level&&this.eventService.dispatchEventOnce({type:Ng.Events.EVENT_ROW_COUNT_READY}),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}createOrRecycleNodes(e,t){if(!t)return;const i=t=>{if(!e)return;const i=this.gos.getCallback("getRowId");if(!i)return;const s=this.parentRowNode.getGroupKeys(),r=this.level,n=i({data:t,parentKeys:s.length>0?s:void 0,level:r}),o=e[n];return o?(delete e[n],o):void 0},s=(e,t)=>{this.allNodesMap[e.id]=e,this.blockUtils.updateDataIntoRowNode(e,t),this.allRowNodes.push(e)};t.forEach(e=>{const t=i(e);t?s(t,e):this.createDataNode(e)})}flushAsyncTransactions(){window.setTimeout(()=>this.transactionManager.flushAsyncTransactions(),0)}filterAndSortNodes(){this.filterRowNodes(),this.sortRowNodes()}sortRowNodes(){const e=this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerSideSortOnServer(),t=this.sortController.getSortOptions(),i=!t||0==t.length;if(e||i)this.nodesAfterSort=this.nodesAfterFilter;else if(this.nodesAfterSort=this.rowNodeSorter.doFullSort(this.nodesAfterFilter,t),this.postSortFunc){const e={nodes:this.nodesAfterSort};this.postSortFunc(e)}}filterRowNodes(){const e=!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerSideFilterOnServer(),t=this.groupLevel;this.nodesAfterFilter=e||t?this.allRowNodes:this.allRowNodes.filter(e=>this.filterManager.doesRowPassFilter({rowNode:e}))}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach(e=>this.blockUtils.clearDisplayIndex(e))}getDisplayIndexEnd(){return this.displayIndexEnd}isDisplayIndexInStore(e){return 0!==this.getRowCount()&&e>=this.displayIndexStart&&e<this.displayIndexEnd}setDisplayIndexes(e,t){this.displayIndexStart=e.peek(),this.topPx=t.value;const i={};this.nodesAfterSort.forEach(s=>{this.blockUtils.setDisplayIndex(s,e,t),i[s.id]=!0}),this.allRowNodes.forEach(e=>{i[e.id]||this.blockUtils.clearDisplayIndex(e)}),this.displayIndexEnd=e.peek(),this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t=new Ng.NumberSequence){e(this,t.next()),this.allRowNodes.forEach(i=>{const s=i.childStore;s&&s.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t=new Ng.NumberSequence){this.allRowNodes.forEach(i=>{e(i,t.next());const s=i.childStore;s&&s.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t=new Ng.NumberSequence,i=!1){this.nodesAfterSort.forEach(s=>{e(s,t.next());const r=s.childStore;r&&r.forEachNodeDeepAfterFilterAndSort(e,t,i)}),i&&this.parentRowNode.sibling&&e(this.parentRowNode.sibling,t.next())}getRowUsingDisplayIndex(e){if(this.isDisplayIndexInStore(e))return this.blockUtils.binarySearchForDisplayIndex(e,this.nodesAfterSort)}getRowBounds(e){for(let t=0;t<this.nodesAfterSort.length;t++){const i=this.nodesAfterSort[t],s=this.blockUtils.extractRowBounds(i,e);if(s)return s}return null}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(e>=this.topPx+this.heightPx){const t=this.nodesAfterSort[this.nodesAfterSort.length-1],i=t.rowTop+t.rowHeight;if(e>=i&&t.expanded){if(t.childStore&&t.childStore.getRowCount()>0)return t.childStore.getRowIndexAtPixel(e);if(t.detailNode)return t.detailNode.rowIndex}return t.rowIndex}let t=null;return this.nodesAfterSort.forEach(i=>{const s=this.blockUtils.getIndexAtPixel(i,e);null!=s&&(t=s)}),null==t?this.displayIndexEnd-1:t}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>this.allRowNodes.find(t=>t.key==e))}forEachChildStoreShallow(e){this.allRowNodes.forEach(t=>{const i=t.childStore;i&&e(i)})}refreshAfterFilter(e){const t=this.storeUtils.isServerSideFilterOnServer(),i=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e);if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||t&&i)return this.refreshStore(!0),void this.sortRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshAfterSort(e){const t=this.storeUtils.isServerSideSortOnServer(),i=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e);if(this.storeUtils.isServerSideSortAllLevels()||t&&i)return this.refreshStore(!0),void this.filterRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}applyTransaction(e){switch(this.getState()){case Ng.RowNodeBlock.STATE_FAILED:return{status:Ng.ServerSideTransactionResultStatus.StoreLoadingFailed};case Ng.RowNodeBlock.STATE_LOADING:return{status:Ng.ServerSideTransactionResultStatus.StoreLoading};case Ng.RowNodeBlock.STATE_WAITING_TO_LOAD:return{status:Ng.ServerSideTransactionResultStatus.StoreWaitingToLoad}}const t=this.gos.getCallback("isApplyServerSideTransaction");if(t&&!t({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:Ng.ServerSideTransactionResultStatus.Cancelled};const i={status:Ng.ServerSideTransactionResultStatus.Applied,remove:[],update:[],add:[]},s=[];return this.executeAdd(e,i),this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.filterAndSortNodes(),this.updateSelection(s),i}updateSelection(e){if(e.length>0){this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,clearSelection:!1,source:"rowDataChanged"});const t={type:Ng.Events.EVENT_SELECTION_CHANGED,source:"rowDataChanged"};this.eventService.dispatchEvent(t)}}executeAdd(e,t){const{add:i,addIndex:s}=e;Ng._.missingOrEmpty(i)||("number"==typeof s&&s>=0?i.reverse().forEach(e=>{const i=this.createDataNode(e,s);t.add.push(i)}):i.forEach(e=>{const i=this.createDataNode(e);t.add.push(i)}))}executeRemove(e,t,i){const{remove:s}=e;if(null==s)return;const r={};s.forEach(e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),r[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s),this.nodeManager.removeNode(s))}),this.allRowNodes=this.allRowNodes.filter(e=>!r[e.id])}executeUpdate(e,t,i){const{update:s}=e;null!=s&&s.forEach(e=>{const s=this.lookupRowNode(e);s&&(this.blockUtils.updateDataIntoRowNode(s,e),!s.selectable&&s.isSelected()&&i.push(s),t.update.push(s))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(null!=t){const s=this.level,r=this.parentRowNode.getGroupKeys(),n=t({data:e,parentKeys:r.length>0?r:void 0,level:s});if(i=this.allNodesMap[n],!i)return console.error(`AG Grid: could not find row id=${n}, data item was not found for this id`),null}else if(i=this.allRowNodes.find(t=>t.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),null;return i}addStoreStates(e){e.push({suppressInfiniteScroll:!0,route:this.parentRowNode.getGroupKeys(),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}refreshStore(e){if(e){const e=this.nodesAfterSort?this.nodesAfterSort.length:1;this.initialiseRowNodes(e)}this.scheduleLoad(),this.fireStoreUpdatedEvent()}retryLoads(){this.getState()===Ng.RowNodeBlock.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow(e=>e.retryLoads())}scheduleLoad(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()}fireStoreUpdatedEvent(){const e={type:Ng.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}getRowCount(){return this.nodesAfterSort.length}getTopLevelRowDisplayedIndex(e){return this.nodesAfterSort[e].rowIndex}isLastRowIndexKnown(){return this.getState()==Ng.RowNodeBlock.STATE_LOADED}getRowNodesInRange(e,t){const i=[];let s=!1;return Ng._.missing(e)&&(s=!0),this.nodesAfterSort.forEach(r=>{const n=r===e||r===t;(s||n)&&i.push(r),n&&(s=!s)}),s?[]:i}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}};am([(0,Ng.Autowired)("ssrmStoreUtils")],lm.prototype,"storeUtils",2),am([(0,Ng.Autowired)("ssrmBlockUtils")],lm.prototype,"blockUtils",2),am([(0,Ng.Autowired)("columnModel")],lm.prototype,"columnModel",2),am([(0,Ng.Autowired)("rowNodeBlockLoader")],lm.prototype,"rowNodeBlockLoader",2),am([(0,Ng.Autowired)("rowNodeSorter")],lm.prototype,"rowNodeSorter",2),am([(0,Ng.Autowired)("sortController")],lm.prototype,"sortController",2),am([(0,Ng.Autowired)("selectionService")],lm.prototype,"selectionService",2),am([(0,Ng.Autowired)("ssrmNodeManager")],lm.prototype,"nodeManager",2),am([(0,Ng.Autowired)("filterManager")],lm.prototype,"filterManager",2),am([(0,Ng.Autowired)("ssrmTransactionManager")],lm.prototype,"transactionManager",2),am([(0,Ng.Autowired)("rowModel")],lm.prototype,"serverSideRowModel",2),am([Ng.PostConstruct],lm.prototype,"postConstruct",1),am([Ng.PreDestroy],lm.prototype,"destroyRowNodes",1);var cm=class{constructor(...e){if(e.length<1)throw new Error("AG Grid: At least one index must be provided.");this.indexes=e,this.maps=new Map(this.indexes.map(e=>[e,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(e,t){const i=this.maps.get(e);if(!i)throw new Error(`AG Grid: ${String(e)} not found`);return i.get(t)}set(e){this.indexes.forEach(t=>{const i=this.maps.get(t);if(!i)throw new Error(`AG Grid: ${String(t)} not found`);i.set(e[t],e)})}delete(e){this.indexes.forEach(t=>{const i=this.maps.get(t);if(!i)throw new Error(`AG Grid: ${String(t)} not found`);i.delete(e[t])})}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){const t=this.maps.get(e);if(!t)throw new Error(`AG Grid: ${String(e)} not found`);return t.values()}forEach(e){const t=this.getIterator(this.indexes[0]);let i;for(;(i=t.next())&&!i.done;)e(i.value)}find(e){const t=this.getIterator(this.indexes[0]);let i;for(;(i=t.next())&&!i.done;)if(e(i.value))return i.value}filter(e){const t=this.getIterator(this.indexes[0]);let i;const s=[];for(;(i=t.next())&&!i.done;)e(i.value)&&s.push(i.value);return s}},hm=class extends Fg.BeanStub{constructor(){super(...arguments),this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}init(){this.addManagedListener(this.rowNodeBlockLoader,Fg.RowNodeBlockLoader.BLOCK_LOADED_EVENT,()=>this.queueLoadCheck())}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,window.queueMicrotask(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}queueLoadAction(){const e=this.getBlockToLoad();if(!e)return;const t=this.nextBlockToLoad&&this.nextBlockToLoad.cache===e.cache&&this.nextBlockToLoad.index===e.index;if(!(t||this.nextBlockToLoad&&t)){this.nextBlockToLoad=e,window.clearTimeout(this.loaderTimeout);const t=Number(this.nextBlockToLoad.index),i=this.nextBlockToLoad.cache,s=e.index+e.cache.getBlockSize();this.loaderTimeout=window.setTimeout(()=>{i.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(i,t,s),this.nextBlockToLoad=void 0)},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(e,t,i){const s=this.rowNodeBlockLoader.getAvailableLoadingCount();null!=s&&0===s||(this.rowNodeBlockLoader.registerLoads(1),this.executeLoad(e,t,i),this.queueLoadCheck())}executeLoad(e,t,i){var s;const r=e.getSsrmParams(),n={startRow:t,endRow:i,rowGroupCols:r.rowGroupCols,valueCols:r.valueCols,pivotCols:r.pivotCols,pivotMode:r.pivotMode,groupKeys:e.store.getParentNode().getGroupKeys(),filterModel:r.filterModel,sortModel:r.sortModel},o=this.cacheLoadingNodesMap.get(e),a=()=>{for(let e=0;e<i-t;e++)o.delete(t+e)},l=this.gos.addGridCommonParams({request:n,success:s=>{this.rowNodeBlockLoader.loadComplete(),e.onLoadSuccess(t,i-t,s),a()},fail:()=>{this.rowNodeBlockLoader.loadComplete(),e.onLoadFailed(t,i-t),a()},parentNode:e.store.getParentNode()});(()=>{for(let e=0;e<i-t;e++)o.add(t+e)})(),null==(s=e.getSsrmParams().datasource)||s.getRows(l)}getBlockToLoad(){var e;const t=this.rowRenderer.getFirstVirtualRenderedRow(),i=this.rowRenderer.getLastVirtualRenderedRow();for(let e=t;e<=i;e++){const t=this.rowModel.getRow(e);if(!t)continue;const i=t.parent&&t.parent.childStore;if(!(i&&i instanceof um))continue;const s=i.getCache(),r=s.getNodes().getBy("node",t);if(!r)continue;const n=this.cacheLoadingNodesMap.get(s);if(!(null==n?void 0:n.has(r.index))&&(t.__needsRefreshWhenVisible||t.stub&&!t.failedLoad))return{cache:s,index:s.getBlockStartIndex(r.index)}}let s=null,r=null,n=Number.MAX_SAFE_INTEGER;for(const e of this.cacheLoadingNodesMap.keys())e.getNodesToRefresh().forEach(o=>{if(null==o.rowIndex)return r=o,void(s=e);const a=e.getNodes().getBy("node",o);if(!a)return;const l=this.cacheLoadingNodesMap.get(e);if(null==l?void 0:l.has(a.index))return;const c=Math.abs(t-o.rowIndex),h=Math.abs(o.rowIndex-i);c<n&&(r=o,n=c,s=e),h<n&&(r=o,n=h,s=e)});if(!s)return;const o=s,a=null==(e=o.getNodes().getBy("node",r))?void 0:e.index;return null==a?void 0:{cache:o,index:o.getBlockStartIndex(a)}}isRowLoading(e,t){var i,s;return null!=(s=null==(i=this.cacheLoadingNodesMap.get(e))?void 0:i.has(t))&&s}};hm.DEFAULT_BLOCK_SIZE=100,am([(0,Fg.Autowired)("rowNodeBlockLoader")],hm.prototype,"rowNodeBlockLoader",2),am([(0,Fg.Autowired)("rowRenderer")],hm.prototype,"rowRenderer",2),am([(0,Fg.Autowired)("rowModel")],hm.prototype,"rowModel",2),am([Fg.PostConstruct],hm.prototype,"init",1),hm=am([(0,Fg.Bean)("lazyBlockLoadingService")],hm);var dm=class extends Og.BeanStub{constructor(e,t,i){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=!1,this.storeParams=i}init(){this.lazyBlockLoadingService.subscribe(this),this.nodeMap=new cm("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set,this.defaultNodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),this.getRowIdFunc=this.gos.getCallback("getRowId"),this.isMasterDetail=this.gos.get("masterDetail")}destroyRowNodes(){this.lazyBlockLoadingService.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1}getRowByDisplayIndex(e){var t,i,s,r;if(!this.store.isDisplayIndexInStore(e))return;const n=this.nodeDisplayIndexMap.get(e);if(n)return(n.stub||n.__needsRefreshWhenVisible)&&this.lazyBlockLoadingService.queueLoadCheck(),n;if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);const o=this.nodeDisplayIndexMap.get(e-1);if(o){if(this.isMasterDetail&&o.master&&o.expanded)return o.detailNode;if(o.expanded&&(null==(t=o.childStore)?void 0:t.isDisplayIndexInStore(e)))return null==(i=o.childStore)?void 0:i.getRowUsingDisplayIndex(e);const s=this.nodeMap.getBy("node",o);return this.createStubNode(s.index+1,e)}const a=this.getSurroundingNodesByDisplayIndex(e);if(null==a){const t=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(t,e)}const{previousNode:l,nextNode:c}=a;if(l&&l.node.expanded&&(null==(s=l.node.childStore)?void 0:s.isDisplayIndexInStore(e)))return null==(r=l.node.childStore)?void 0:r.getRowUsingDisplayIndex(e);if(c){const t=c.node.rowIndex-e,i=c.index-t;return this.createStubNode(i,e)}const h=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(h,e)}createStubNode(e,t){const i=this.store.getRowBounds(t),s=this.createRowAtIndex(e,null,e=>{e.setRowIndex(t),e.setRowTop(i.rowTop),this.nodeDisplayIndexMap.set(t,e)});return this.lazyBlockLoadingService.queueLoadCheck(),s}getRowByStoreIndex(e){var t;return null==(t=this.nodeMap.getBy("index",e))?void 0:t.node}skipDisplayIndexes(e,t,i){if(0===e)return;const s=this.gos.getRowHeightAsNumber();t.skip(e),i.value+=e*s}setDisplayIndexes(e,t){this.nodeDisplayIndexMap.clear();const i={};this.nodeMap.forEach(e=>{i[e.index]=e.node});let s=-1;for(const r in i){const n=i[r],o=Number(r),a=o-1-s;this.skipDisplayIndexes(a,e,t),this.blockUtils.setDisplayIndex(n,e,t),this.nodeDisplayIndexMap.set(n.rowIndex,n),s=o}const r=this.numberOfRows-1-s;this.skipDisplayIndexes(r,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){if(e<0)throw new Error("AG Grid: setRowCount can only accept a positive row count.");this.numberOfRows=e,null!=t&&(this.isLastRowKnown=t,!1===t&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){var t;return null!=(t=this.nodeDisplayIndexMap.get(e))?t:null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,i;return this.nodeMap.forEach(s=>{e>s.node.rowIndex?(null==i||i.node.rowIndex<s.node.rowIndex)&&(i=s):(null==t||t.node.rowIndex>s.node.rowIndex)&&(t=s)}),i||t?{previousNode:i,nextNode:t}:null}getDisplayIndexFromStoreIndex(e){var t,i;const s=this.nodeMap.getBy("index",e);if(s)return s.node.rowIndex;let r,n;if(this.nodeMap.forEach(t=>{e>t.index?(null==n||n.index<t.index)&&(n=t):(null==r||r.index>t.index)&&(r=t)}),!r)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!n)return this.store.getDisplayIndexStart()+e;const o=e-n.index;return(null!=(i=null==(t=n.node.childStore)?void 0:t.getDisplayIndexEnd())?i:n.node.rowIndex)+o}createRowAtIndex(e,t,i){var s,r;const n=this.nodeMap.getBy("index",e);if(n){const{node:i}=n;if(i.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,i))return this.blockUtils.updateDataIntoRowNode(i,t),this.nodesToRefresh.delete(i),i;if(null==this.getRowIdFunc&&i.hasChildren()&&i.expanded)return this.nodesToRefresh.delete(i),i;this.destroyRowAtIndex(e)}if(t&&null!=this.getRowIdFunc){const i=this.getRowId(t),n=i&&(null==(s=this.removedNodeCache)?void 0:s.get(i));if(n)return null==(r=this.removedNodeCache)||r.delete(i),this.blockUtils.updateDataIntoRowNode(n,t),this.nodeMap.set({id:n.id,node:n,index:e}),n;const o=this.nodeMap.getBy("id",i);if(o){this.nodeMap.delete(o);const{node:i,index:s}=o;return this.blockUtils.updateDataIntoRowNode(i,t),this.nodeMap.set({id:i.id,node:i,index:e}),this.nodesToRefresh.delete(i),this.getBlockStartIndex(s)===this.getBlockStartIndex(e)||this.markBlockForVerify(s),i}}const o=this.blockUtils.createRowNode(this.store.getRowDetails());if(null!=t){const e=this.getPrefixedId(this.store.getIdSequence().next());this.blockUtils.setDataIntoRowNode(o,t,e,void 0),this.serverSideRowModel.setPaused(!0),this.blockUtils.checkOpenByDefault(o),this.serverSideRowModel.setPaused(!1),this.nodeManager.addRowNode(o)}return this.nodeMap.set({id:o.id,node:o,index:e}),i&&i(o),o}getBlockStates(){const e={},t={};this.nodeMap.forEach(({node:i,index:s})=>{var r;const n=this.getBlockStartIndex(s);i.stub||i.failedLoad||(e[n]=(null!=(r=e[n])?r:0)+1);let o="loaded";i.failedLoad?o="failed":this.lazyBlockLoadingService.isRowLoading(this,n)?o="loading":(this.nodesToRefresh.has(i)||i.stub)&&(o="needsLoading"),t[n]||(t[n]=new Set),t[n].add(o)});const i={loading:4,failed:3,needsLoading:2,loaded:1},s=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),r={};return Object.entries(t).forEach(([t,n])=>{var o;const a=[...n].sort((e,t)=>{var s,r;return(null!=(s=i[e])?s:0)-(null!=(r=i[t])?r:0)})[0],l=Number(t)/this.getBlockSize(),c=s?`${s}-${l}`:String(l);r[c]={blockNumber:l,startRow:Number(t),endRow:Number(t)+this.getBlockSize(),pageStatus:a,loadedRowCount:null!=(o=e[t])?o:0}}),r}destroyRowAtIndex(e){const t=this.nodeMap.getBy("index",e);t&&(this.nodeMap.delete(t),this.nodeDisplayIndexMap.delete(t.node.rowIndex),this.nodesToRefresh.size>0?this.removedNodeCache.set(t.node.id,t.node):this.blockUtils.destroyRowNode(t.node),this.nodesToRefresh.delete(t.node))}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(e){return this.defaultNodeIdPrefix?this.defaultNodeIdPrefix+"-"+e:e.toString()}markBlockForVerify(e){const[t,i]=this.getBlockBounds(e);this.nodeMap.filter(e=>e.index>=t&&e.index<i).forEach(({node:e})=>{e.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;if(null!=this.getRowIdFunc){const i=this.getRowId(e);return t.id===i}return t.data===e}purgeStubsOutsideOfViewport(){const e=this.api.getFirstDisplayedRowIndex(),t=this.api.getLastDisplayedRowIndex(),i=this.getBlockStartIndex(e),[s,r]=this.getBlockBounds(t);this.nodeMap.forEach(e=>{this.lazyBlockLoadingService.isRowLoading(this,e.index)||e.node.failedLoad||e.node.stub&&(e.index<i||e.index>r)&&this.destroyRowAtIndex(e.index)})}getBlocksDistanceFromRow(e,t){const i={};return e.forEach(({node:e,index:s})=>{const[r,n]=this.getBlockBounds(s);if(r in i)return;const o=Math.abs(e.rowIndex-t);let a;const l=this.nodeMap.getBy("index",[n-1]);l&&(a=Math.abs(l.node.rowIndex-t));const c=null==a||o<a?o:a;i[r]=c}),Object.entries(i)}purgeExcessRows(){var e;if(this.purgeStubsOutsideOfViewport(),null==this.store.getDisplayIndexEnd()||null==this.storeParams.maxBlocksInCache)return;const t=this.api.getFirstDisplayedRowIndex(),i=this.api.getLastDisplayedRowIndex(),s=new Set,r=new Set;this.nodeMap.forEach(({index:e,node:n})=>{const o=this.getBlockStartIndex(e);s.add(o),n.rowIndex>=t&&n.rowIndex<=i&&r.add(o)});const n=Math.max(r.size,null!=(e=this.storeParams.maxBlocksInCache)?e:0),o=s.size-n;if(o<=0)return;let a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;r.forEach(e=>{a>e&&(a=e),l<e&&(l=e)});const c=this.nodeMap.filter(({node:e,index:t})=>{const i=this.getBlockStartIndex(t);return!(i>=a&&i<=l||this.isNodeCached(e))});if(0===c.length)return;const h=t+(i-t)/2,d=this.getBlocksDistanceFromRow(c,h),u=this.getBlockSize();d.sort((e,t)=>Math.sign(t[1]-e[1]));for(let e=0;e<Math.min(o,d.length);e++){const t=Number(d[e][0]);for(let e=t;e<t+u;e++){const t=this.nodeMap.getBy("index",e);t&&!this.isNodeCached(t.node)&&this.destroyRowAtIndex(e)}}}isNodeFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!!t&&(null==t.rowPinned&&t.rowIndex===e.rowIndex)}isNodeCached(e){return e.isExpandable()&&e.expanded||this.isNodeFocused(e)}extractDuplicateIds(e){if(null==this.getRowIdFunc)return[];const t=new Set,i=new Set;return e.forEach(e=>{const s=this.getRowId(e);t.has(s)?i.add(s):t.add(s)}),[...i]}onLoadSuccess(e,t,i){if(!this.live)return;const s=i.groupLevelInfo;if(this.store.setStoreInfo(s),null!=this.getRowIdFunc){const s=this.extractDuplicateIds(i.rowData);if(s.length>0){const i=s.join(", ");return console.warn(`AG Grid: Unable to display rows as duplicate row ids (${i}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`),void this.onLoadFailed(e,t)}}i.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(i.pivotResultFields);const r=this.nodesToRefresh.size>0;if(i.rowData.forEach((t,i)=>{var s;const r=e+i,n=this.nodeMap.getBy("index",r);if(!(null==(s=null==n?void 0:n.node)?void 0:s.stub))return n&&this.doesNodeMatch(t,n.node)?(this.blockUtils.updateDataIntoRowNode(n.node,t),this.nodesToRefresh.delete(n.node),void(n.node.__needsRefreshWhenVisible=!1)):void this.createRowAtIndex(r,t);this.createRowAtIndex(r,t)}),null!=i.rowCount&&-1!==i.rowCount)this.numberOfRows=i.rowCount,this.isLastRowKnown=!0;else if(t>i.rowData.length)this.numberOfRows=e+i.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){const t=e+i.rowData.length+1;t>this.numberOfRows&&(this.numberOfRows=t)}this.isLastRowKnown&&this.nodeMap.filter(e=>e.index>=this.numberOfRows).forEach(e=>this.destroyRowAtIndex(e.index)),this.fireStoreUpdatedEvent();const n=0===this.nodesToRefresh.size;r&&n&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){0===this.nodesToRefresh.size&&(this.removedNodeCache.forEach(e=>{this.blockUtils.destroyRowNode(e)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){const e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t)return;if(this.nodesToRefresh.size>0)return;let i=-1;return null==this.nodeMap.find(e=>(i+=1,e.index!==i||!!e.node.__needsRefreshWhenVisible||!!e.node.stub))}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){var i;if(!this.live)return;const s=this.nodesToRefresh.size>0;for(let s=e;s<e+t&&s<this.getRowCount();s++){let{node:e}=null!=(i=this.nodeMap.getBy("index",s))?i:{};e&&this.nodesToRefresh.delete(e),e&&e.stub||(e&&!e.stub&&this.destroyRowAtIndex(s),e=this.createRowAtIndex(s)),e.__needsRefreshWhenVisible=!1,e.failedLoad=!0}const r=0===this.nodesToRefresh.size;s&&r&&this.fireRefreshFinishedEvent(),this.fireStoreUpdatedEvent()}markNodesForRefresh(){this.nodeMap.forEach(e=>{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingService.queueLoadCheck(),this.isLastRowKnown&&0===this.numberOfRows&&(this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent())}isNodeInCache(e){return!!this.nodeMap.getBy("id",e)}fireStoreUpdatedEvent(){this.live&&this.store.fireStoreUpdatedEvent()}getRowId(e){if(null==this.getRowIdFunc)return null;const{level:t}=this.store.getRowDetails(),i=this.store.getParentNode().getGroupKeys(),s=this.getRowIdFunc({data:e,parentKeys:i.length>0?i:void 0,level:t});return String(s)}getOrderedNodeMap(){const e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){const e=this.sortController.getSortOptions();if(!e.some(e=>null!=e.sort))return;const t=new Array(this.nodeMap.getSize());this.nodeMap.forEach(e=>t[e.index]=e.node),this.nodeMap.clear(),this.rowNodeSorter.doFullSort(t,e).forEach((e,t)=>{this.nodeMap.set({id:e.id,node:e,index:t})})}updateRowNodes(e){if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const t=[];return e.forEach(e=>{const i=this.getRowId(e),s=this.nodeMap.getBy("id",i);s&&(this.blockUtils.updateDataIntoRowNode(s.node,e),t.push(s.node))}),t}insertRowNodes(e,t){const i=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),s=null==t&&this.isLastRowKnown?i:t;if(null==s||i<s)return[];if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const r={};e.forEach(e=>{const t=this.getRowId(e);t&&this.isNodeInCache(t)||(r[t]=e)});const n=Object.values(r);let o=n.length;if(0===o)return[];const a=this.nodeMap.filter(e=>e.index>=s);return a.forEach(e=>this.nodeMap.delete(e)),a.forEach(e=>{this.nodeMap.set({node:e.node,index:e.index+o,id:e.id})}),this.numberOfRows+=o,n.map((e,t)=>this.createRowAtIndex(s+t,e))}removeRowNodes(e){if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const t=[],i=[];let s=0;const r=[...e],n=this.getOrderedNodeMap();let o=-1;for(let e in n){o+=1;const a=n[e],l=r.findIndex(e=>e===a.id);if(-1!==l){r.splice(l,1),this.destroyRowAtIndex(Number(e)),t.push(a.node),s+=1;continue}if(0===s)continue;const c=Number(e);o!==c&&i.push(a.node),this.nodeMap.delete(n[e]),this.nodeMap.set({id:a.id,node:a.node,index:c-s})}return this.numberOfRows-=this.isLastRowIndexKnown()?e.length:s,r.length>0&&i.length>0&&(i.forEach(e=>e.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingService.queueLoadCheck()),t}getBlockSize(){return this.storeParams.cacheBlockSize||hm.DEFAULT_BLOCK_SIZE}getBlockStartIndex(e){return e-e%this.getBlockSize()}getBlockBounds(e){const t=this.getBlockStartIndex(e);return[t,t+this.getBlockSize()]}};am([(0,Og.Autowired)("gridApi")],dm.prototype,"api",2),am([(0,Og.Autowired)("ssrmBlockUtils")],dm.prototype,"blockUtils",2),am([(0,Og.Autowired)("focusService")],dm.prototype,"focusService",2),am([(0,Og.Autowired)("ssrmNodeManager")],dm.prototype,"nodeManager",2),am([(0,Og.Autowired)("rowModel")],dm.prototype,"serverSideRowModel",2),am([(0,Og.Autowired)("rowNodeSorter")],dm.prototype,"rowNodeSorter",2),am([(0,Og.Autowired)("sortController")],dm.prototype,"sortController",2),am([(0,Og.Autowired)("lazyBlockLoadingService")],dm.prototype,"lazyBlockLoadingService",2),am([Og.PostConstruct],dm.prototype,"init",1),am([Og.PreDestroy],dm.prototype,"destroyRowNodes",1);var um=class extends _g.BeanStub{constructor(e,t,i){super(),this.idSequence=new _g.NumberSequence,this.ssrmParams=e,this.parentRowNode=i,this.storeParams=t,this.level=i.level+1,this.group=!!e.rowGroupCols&&this.level<e.rowGroupCols.length,this.leafGroup=!!e.rowGroupCols&&this.level===e.rowGroupCols.length-1,this.info={}}init(){var e;let t=1;if(0===this.level&&(t=null!=(e=this.storeUtils.getServerSideInitialRowCount())?e:1,this.eventService.dispatchEventOnce({type:_g.Events.EVENT_ROW_COUNT_READY})),this.cache=this.createManagedBean(new dm(this,t,this.storeParams)),!this.gos.get("treeData")&&this.group){const e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}}destroyRowNodes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.destroyBean(this.cache)}applyRowData(e,t,i){this.cache.onLoadSuccess(t,i,e)}applyTransaction(e){var t,i,s;const r=this.gos.getCallback("getRowId");if(!r)return console.warn("AG Grid: getRowId callback must be implemented for transactions to work. Transaction was ignored."),{status:_g.ServerSideTransactionResultStatus.Cancelled};const n=this.gos.getCallback("isApplyServerSideTransaction");if(n&&!n({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:_g.ServerSideTransactionResultStatus.Cancelled};const o=this.cache.isStoreFullyLoaded();let a,l,c;if((null==(t=e.update)?void 0:t.length)&&(a=this.cache.updateRowNodes(e.update)),null==(i=e.add)?void 0:i.length){let t=e.addIndex;null!=t&&t<0&&(t=void 0),l=this.cache.insertRowNodes(e.add,t)}if(null==(s=e.remove)?void 0:s.length){const t=e.remove.map(e=>r({level:this.level,parentKeys:this.parentRowNode.getGroupKeys(),data:e})),i=[...new Set(t)];c=this.cache.removeRowNodes(i)}const h=this.gos.get("serverSideEnableClientSideSort"),d=(null==a?void 0:a.length)||(null==l?void 0:l.length);return o&&h&&d&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(a,c),{status:_g.ServerSideTransactionResultStatus.Applied,update:a,add:l,remove:c}}updateSelectionAfterTransaction(e,t){const i=[];null==e||e.forEach(e=>{e.isSelected()&&!e.selectable&&i.push(e)}),null==t||t.forEach(e=>{e.isSelected()&&i.push(e)}),i.length&&this.selectionService.setNodesSelected({newValue:!1,clearSelection:!1,nodes:i,source:"rowDataChanged"})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach(e=>this.blockUtils.clearDisplayIndex(e.node)),this.parentRowNode.sibling&&this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling),this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){return this.parentRowNode.sibling?this.cache.getRowCount()+1:this.cache.getRowCount()}setRowCount(e,t){this.cache.setRowCount(e,t)}isDisplayIndexInStore(e){return 0!==this.cache.getRowCount()&&this.displayIndexStart<=e&&e<this.getDisplayIndexEnd()}setDisplayIndexes(e,t){this.displayIndexStart=e.peek(),this.topPx=t.value;const i=this.parentRowNode.level>-1&&this.gos.getGroupTotalRowCallback()({node:this.parentRowNode});i||this.parentRowNode.destroyFooter(),"top"===i&&(this.parentRowNode.createFooter(),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t)),this.cache.setDisplayIndexes(e,t),"bottom"===i&&(this.parentRowNode.createFooter(),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t)),this.displayIndexEnd=e.peek(),this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t=new _g.NumberSequence){e(this,t.next()),this.cache.getNodes().forEach(i=>{const s=i.node.childStore;s&&s.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t=new _g.NumberSequence){this.cache.getNodes().forEach(i=>{e(i.node,t.next());const s=i.node.childStore;s&&s.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t=new _g.NumberSequence,i=!1){const s=this.parentRowNode.level>-1&&this.gos.getGroupTotalRowCallback()({node:this.parentRowNode});"top"===s&&e(this.parentRowNode.sibling,t.next());const r=this.cache.getOrderedNodeMap();for(let s in r){const n=r[s];e(n.node,t.next());const o=n.node.childStore;o&&o.forEachNodeDeepAfterFilterAndSort(e,t,i)}"bottom"===s&&e(this.parentRowNode.sibling,t.next())}retryLoads(){this.cache.getNodes().forEach(({node:e})=>{e.failedLoad&&(e.failedLoad=!1,e.__needsRefreshWhenVisible=!0,e.stub=!0)}),this.forEachChildStoreShallow(e=>e.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(e){return this.parentRowNode.sibling&&e===this.parentRowNode.sibling.rowIndex?this.parentRowNode.sibling:this.cache.getRowByDisplayIndex(e)}getRowBounds(e){var t;if(!this.isDisplayIndexInStore(e))return null;const i=this.cache.getNodeCachedByDisplayIndex(e);if(i){const t=this.blockUtils.extractRowBounds(i,e);if(t)return t}const{previousNode:s,nextNode:r}=null!=(t=this.cache.getSurroundingNodesByDisplayIndex(e))?t:{};if(s){const t=this.blockUtils.extractRowBounds(s.node,e);if(null!=t)return t}const n=this.gos.getRowHeightAsNumber();if(r){const t=(r.node.rowIndex-e)*n;return{rowTop:r.node.rowTop-t,rowHeight:n}}return{rowTop:this.topPx+this.heightPx-(this.getDisplayIndexEnd()-e)*n,rowHeight:n}}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<this.topPx)return this.getDisplayIndexStart();if(e>=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&e>this.parentRowNode.sibling.rowTop&&e<this.parentRowNode.sibling.rowTop+this.parentRowNode.sibling.rowHeight)return this.parentRowNode.sibling.rowIndex;let t=Number.MAX_SAFE_INTEGER,i=null,s=Number.MAX_SAFE_INTEGER,r=null;if(this.cache.getNodes().forEach(({node:n})=>{const o=Math.abs(e-n.rowTop);n.rowTop<e?o<t&&(t=o,i=n):o<s&&(s=o,r=n)}),i){const t=this.blockUtils.getIndexAtPixel(i,e);if(null!=t)return t}const n=this.gos.getRowHeightAsNumber();if(r){const t=r.rowTop,i=Math.ceil((t-e)/n);return r.rowIndex-i}const o=this.topPx+this.heightPx,a=Math.floor((o-e)/n);return this.getDisplayIndexEnd()-a}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>{const t=this.cache.getNodes().find(t=>t.node.key==e);return t?t.node:null})}forEachChildStoreShallow(e){this.cache.getNodes().forEach(({node:t})=>{t.childStore&&e(t.childStore)})}refreshAfterSort(e){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){const e=this.cache.isStoreFullyLoaded(),t=this.gos.get("serverSideEnableClientSideSort");if(!e||!t){const e=this.cache.getRowCount();return this.destroyBean(this.cache),void(this.cache=this.createManagedBean(new dm(this,e,this.storeParams)))}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}refreshAfterFilter(e){!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)?this.refreshStore(!0):this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshStore(e){if(e)return this.destroyBean(this.cache),this.cache=this.createManagedBean(new dm(this,1,this.storeParams)),void this.fireStoreUpdatedEvent();this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){const t=this.cache.getDisplayIndexFromStoreIndex(e);return null!=t?t:e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){let i=!1;return _g._.missing(e)&&!0,this.cache.getNodes().filter(({node:i})=>i.rowIndex>=e.rowIndex&&i.rowIndex<=t.rowIndex).map(({node:e})=>e)}addStoreStates(e){e.push({suppressInfiniteScroll:!1,route:this.parentRowNode.getGroupKeys(),rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(e){e&&Object.assign(this.info,e)}fireStoreUpdatedEvent(){const e={type:_g.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}fireRefreshFinishedEvent(){const e={type:_g.Events.EVENT_STORE_REFRESHED,route:this.parentRowNode.getRoute()};this.eventService.dispatchEvent(e)}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}};am([(0,_g.Autowired)("ssrmBlockUtils")],um.prototype,"blockUtils",2),am([(0,_g.Autowired)("ssrmStoreUtils")],um.prototype,"storeUtils",2),am([(0,_g.Autowired)("columnModel")],um.prototype,"columnModel",2),am([(0,_g.Autowired)("selectionService")],um.prototype,"selectionService",2),am([_g.PostConstruct],um.prototype,"init",1),am([_g.PreDestroy],um.prototype,"destroyRowNodes",1);var pm=class extends Lg.BeanStub{constructor(){super(...arguments),this.onRowHeightChanged_debounced=Lg._.debounce(this.onRowHeightChanged.bind(this),100),this.pauseStoreUpdateListening=!1,this.started=!1,this.managingPivotResultColumns=!1}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)}addEventListeners(){this.addManagedListener(this.eventService,Lg.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,Lg.Events.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));const e=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,Lg.Events.EVENT_COLUMN_VALUE_CHANGED,e),this.addManagedListener(this.eventService,Lg.Events.EVENT_COLUMN_PIVOT_CHANGED,e),this.addManagedListener(this.eventService,Lg.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,Lg.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","suppressServerSideInfiniteScroll","cacheBlockSize"],e),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){const e=this.gos.get("serverSideDatasource");e&&this.setDatasource(e)}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&Lg._.warnOnce("initialGroupOrderComparator cannot be used with Server Side Row Model."),this.gos.isRowSelection()&&!this.gos.exists("getRowId")&&Lg._.warnOnce("getRowId callback must be provided for Server Side Row Model selection to work correctly.")}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,i){const s=this.getRootStore();if(!s)return;const r=s.getChildStore(i);r&&(r instanceof um?r.applyRowData(e,t,e.rowData.length):r instanceof lm&&r.processServerResult(e))}isLastRowIndexKnown(){const e=this.getRootStore();return!!e&&e.isLastRowIndexKnown()}onColumnEverything(){if(!this.storeParams)return void this.resetRootStore();const e=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),t=this.columnsToValueObjects(this.columnModel.getValueColumns()),i=this.columnsToValueObjects(this.columnModel.getPivotColumns()),s=e=>{const t={};e.oldCols.forEach(e=>t[e.id]=e);const i=e.newCols.every(e=>{const i=t[e.id];return i&&delete t[e.id],i&&i.field===e.field&&i.aggFunc===e.aggFunc}),s=!e.allowRemovedColumns&&!!Object.values(t).length;return i&&!s},r=!Lg._.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),n=!s({oldCols:this.storeParams.rowGroupCols,newCols:e}),o=!s({oldCols:this.storeParams.pivotCols,newCols:i}),a=!!(null==e?void 0:e.length)&&!s({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(r||n||o||a)this.resetRootStore();else{const e=this.createStoreParams();this.storeParams.rowGroupCols=e.rowGroupCols,this.storeParams.pivotCols=e.pivotCols,this.storeParams.valueCols=e.valueCols}}destroyRootStore(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);const i=this.getRootStore();i&&(i.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefService)return void Lg.ModuleRegistry.__assertRegistered(Lg.ModuleNames.RowGroupingModule,"pivotResultFields",this.context.getGridId());const t=this.pivotColDefService.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.columnModel.setSecondaryColumns(t,"rowModelUpdated")}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes(),t=this.gos.getRowHeightForNode(this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){const e=this.gos.getRowHeightForNode(this.rootNode.sibling);this.rootNode.sibling.setRowHeight(e.height,e.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{const i=this.gos.getRowHeightForNode(t);t.setRowHeight(i.height,i.estimated);const s=t.detailNode;if(s){const e=this.gos.getRowHeightForNode(s);s.setRowHeight(e.height,e.estimated)}if(t.sibling){const e=this.gos.getRowHeightForNode(t.sibling);s.setRowHeight(e.height,e.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new Lg.RowNode(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.managingPivotResultColumns&&(this.columnModel.setSecondaryColumns(null,"api"),this.managingPivotResultColumns=!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e){return e.map(e=>({id:e.getId(),aggFunc:e.getAggFunc(),displayName:this.columnModel.getDisplayNameForColumn(e,"model"),field:e.getColDef().field}))}createStoreParams(){const e=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),t=this.columnsToValueObjects(this.columnModel.getValueColumns()),i=this.columnsToValueObjects(this.columnModel.getPivotColumns()),s=this.gos.isGetRowHeightFunction();return{valueCols:t,rowGroupCols:e,pivotCols:i,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.isAdvancedFilterEnabled()?this.filterManager.getAdvancedFilterModel():this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),datasource:this.datasource,lastAccessedSequence:new Lg.NumberSequence,dynamicRowHeight:s}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){const t={type:Lg.Events.EVENT_MODEL_UPDATED,animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1};this.eventService.dispatchEvent(t)}onStoreUpdated(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){const e=this.getRootStore();e&&e.setDisplayIndexes(new Lg.NumberSequence,{value:0})}retryLoads(){const e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){const t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}setPaused(e){this.pauseStoreUpdateListening=e}expandAll(e){this.pauseStoreUpdateListening=!0,this.forEachNode(t=>{t.stub||t.hasChildren()&&t.setExpanded(e)}),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);const i=this.getRootStore();i&&(i.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore}getRowCount(){const e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){const e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){const t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){const t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:this.gos.getRowHeightAsNumber()}}getBlockStates(){const e=this.getRootStore();if(!e)return;const t={};return e.forEachStoreDeep(e=>{if(e instanceof lm){const{id:i,state:s}=e.getBlockStateJson();t[i]=s}else{if(!(e instanceof um))throw new Error("AG Grid: Unsupported store type");Object.entries(e.getBlockStates()).forEach(([e,i])=>{t[e]=i})}}),t}getRowIndexAtPixel(e){const t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}isRowsToRender(){return null!=this.getRootStore()&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(e){const t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachNodeAfterFilterAndSort(e,t=!1){const i=this.getRootStore();i&&i.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;const i=this.getRootStore();if(!i)return!0;const s=i.getChildStore(e);return s&&t(s),!0}refreshStore(e={}){const t=e.route?e.route:[];this.executeOnStore(t,t=>t.refreshStore(1==e.purge))}getStoreState(){const e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){if(!Lg._.exists(e))return[];if(!t)return[e];const i=e.rowIndex,s=t.rowIndex;if(null===i||null===s)return[e];const r=[],[n,o]=[i,s].sort((e,t)=>e-t);return this.forEachNode(e=>{const t=e.rowIndex;null==t||e.stub||t>=n&&t<=o&&r.push(e)}),r.length!==o-n+1?[e]:r}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i),i.detailNode&&i.detailNode.id===e&&(t=i.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){const i=this.getRootStore();if(i){if(i instanceof um)return void i.setRowCount(e,t);console.error("AG Grid: Infinite scrolling must be enabled in order to set the row count.")}}};am([(0,Lg.Autowired)("columnModel")],pm.prototype,"columnModel",2),am([(0,Lg.Autowired)("filterManager")],pm.prototype,"filterManager",2),am([(0,Lg.Autowired)("sortController")],pm.prototype,"sortController",2),am([(0,Lg.Autowired)("rowRenderer")],pm.prototype,"rowRenderer",2),am([(0,Lg.Autowired)("ssrmNodeManager")],pm.prototype,"nodeManager",2),am([(0,Lg.Autowired)("ssrmStoreFactory")],pm.prototype,"storeFactory",2),am([(0,Lg.Autowired)("beans")],pm.prototype,"beans",2),am([(0,Lg.Optional)("pivotColDefService")],pm.prototype,"pivotColDefService",2),am([Lg.PreDestroy],pm.prototype,"destroyDatasource",1),am([Lg.PostConstruct],pm.prototype,"addEventListeners",1),am([Lg.PreDestroy],pm.prototype,"destroyRootStore",1),pm=am([(0,Lg.Bean)("rowModel")],pm);var gm=class extends Gg.BeanStub{loadFromDatasource(e){const{storeParams:t,parentBlock:i,parentNode:s}=e,r=s.getGroupKeys();if(!t.datasource)return;const n={startRow:e.startRow,endRow:e.endRow,rowGroupCols:t.rowGroupCols,valueCols:t.valueCols,pivotCols:t.pivotCols,pivotMode:t.pivotMode,groupKeys:r,filterModel:t.filterModel,sortModel:t.sortModel},o=this.gos.addGridCommonParams({success:e.success,fail:e.fail,request:n,parentNode:e.parentNode});window.setTimeout(()=>{t.datasource&&i.isAlive()?t.datasource.getRows(o):e.fail()},0)}getChildStore(e,t,i){if(Gg._.missingOrEmpty(e))return t;const s=i(e[0]);if(s){if(1===e.length&&!s.childStore){const e=this.serverSideRowModel.getParams();s.childStore=this.createBean(this.storeFactory.createStore(e,s))}const t=e.slice(1,e.length),i=s.childStore;return i?i.getChildStore(t):null}return null}isServerRefreshNeeded(e,t,i){if(i.valueColChanged||i.secondaryColChanged)return!0;const s=e.level+1;if(!(s<t.length))return!0;const r=t[s].id;return i.changedColumns.indexOf(r)>-1||this.columnModel.getAllGridColumns().filter(e=>e.getColDef().showRowGroup&&i.changedColumns.includes(e.getId())).map(e=>e.getColDef().showRowGroup).some(e=>!0===e||e===r)}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}assertRowModelIsServerSide(e){return!!this.gos.isRowModelType("serverSide")||(Gg._.warnOnce(`The '${e}' property can only be used with the Server Side Row Model.`),!1)}assertNotTreeData(e){return!this.gos.get("treeData")||(Gg._.warnOnce(`The '${e}' property cannot be used while using tree data.`),!1)}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&this.assertRowModelIsServerSide("serverSideSortAllLevels")}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&this.assertRowModelIsServerSide("serverSideOnlyRefreshFilteredGroups")}isServerSideSortOnServer(){return this.gos.get("serverSideSortOnServer")&&this.assertRowModelIsServerSide("serverSideSortOnServer")&&this.assertNotTreeData("serverSideSortOnServer")}isServerSideFilterOnServer(){return this.gos.get("serverSideFilterOnServer")&&this.assertRowModelIsServerSide("serverSideFilterOnServer")&&this.assertNotTreeData("serverSideFilterOnServer")}};am([(0,Gg.Autowired)("columnModel")],gm.prototype,"columnModel",2),am([(0,Gg.Autowired)("rowModel")],gm.prototype,"serverSideRowModel",2),am([(0,Gg.Autowired)("ssrmStoreFactory")],gm.prototype,"storeFactory",2),gm=am([(0,Gg.Bean)("ssrmStoreUtils")],gm);var mm=class extends Bg.BeanStub{createRowNode(e){const t=new Bg.RowNode(this.beans),i=null!=e.rowHeight?e.rowHeight:this.gos.getRowHeightAsNumber();return t.setRowHeight(i),t.group=e.group,t.leafGroup=e.leafGroup,t.level=e.level,t.uiLevel=e.level,t.parent=e.parent,t.stub=!0,t.__needsRefreshWhenVisible=!1,t.group&&(t.expanded=!1,t.field=e.field,t.rowGroupColumn=e.rowGroupColumn),t}destroyRowNodes(e){e&&e.forEach(e=>this.destroyRowNode(e))}destroyRowNode(e,t=!1){e.childStore&&!t&&(this.destroyBean(e.childStore),e.childStore=null),e.sibling&&!e.footer&&this.destroyRowNode(e.sibling,!1),e.clearRowTopAndRowIndex(),null!=e.id&&this.nodeManager.removeNode(e)}setTreeGroupInfo(e){e.updateHasChildren();const t=this.gos.get("getServerSideGroupKey");e.hasChildren()&&null!=t&&(e.key=t(e.data)),e.hasChildren()||null==e.childStore||(this.destroyBean(e.childStore),e.childStore=null,e.expanded=!1)}setRowGroupInfo(e){e.key=this.valueService.getValue(e.rowGroupColumn,e),null!==e.key&&void 0!==e.key||Bg._.doOnce(()=>{console.warn("AG Grid: null and undefined values are not allowed for server side row model keys"),e.rowGroupColumn&&console.warn(`column = ${e.rowGroupColumn.getId()}`),console.warn("data is ",e.data)},"ServerSideBlock-CannotHaveNullOrUndefinedForKey"),this.beans.gos.getGroupTotalRowCallback()({node:e})&&(e.createFooter(),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){const t=this.gos.get("isRowMaster");e.master=null==t||t(e.data)}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get("treeData")?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e)):e.group?(this.setChildCountIntoRowNode(e),e.footer||(this.beans.gos.getGroupTotalRowCallback()({node:e})?e.sibling?e.sibling.updateData(t):e.createFooter():e.sibling&&e.destroyFooter())):this.gos.get("masterDetail")}setDataIntoRowNode(e,t,i,s){var r;e.stub=!1;const n=this.gos.get("treeData");Bg._.exists(t)?(e.setDataAndId(t,i),n?this.setTreeGroupInfo(e):e.group?this.setRowGroupInfo(e):this.gos.get("masterDetail")&&this.setMasterDetailInfo(e)):(e.setDataAndId(void 0,void 0),e.key=null),(n||e.group)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),Bg._.exists(t)&&(e.setRowHeight(this.gos.getRowHeightForNode(e,!1,s).height),null==(r=e.sibling)||r.setRowHeight(this.gos.getRowHeightForNode(e.sibling,!1,s).height))}setChildCountIntoRowNode(e){const t=this.gos.get("getChildCount");t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){const t=this.columnModel.getGroupDisplayColumns(),i=this.gos.get("treeData");t.forEach(t=>{if(null==e.groupData&&(e.groupData={}),i)e.groupData[t.getColId()]=e.key;else if(t.isRowGroupDisplayed(e.rowGroupColumn.getId())){const i=this.valueService.getValue(e.rowGroupColumn,e);e.groupData[t.getColId()]=i}})}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&Bg._.exists(e.childStore)&&e.childStore.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode.clearRowTopAndRowIndex()}setDisplayIndex(e,t,i){if(e.setRowIndex(t.next()),e.setRowTop(i.value),i.value+=e.rowHeight,!e.footer&&(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.next()),e.detailNode.setRowTop(i.value),i.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&Bg._.exists(e.childStore))){const s=e.childStore;e.expanded?s.setDisplayIndexes(t,i):s.clearDisplayIndexes()}}binarySearchForDisplayIndex(e,t){let i=0,s=t.length-1;if(Bg._.missing(s)||Bg._.missing(i))console.warn(`AG Grid: error: topPointer = ${s}, bottomPointer = ${i}`);else for(;;){const r=Math.floor((i+s)/2),n=t[r];if(n.rowIndex===e)return n;const o=n.master&&n.expanded,a=n.detailNode;if(o&&a&&a.rowIndex===e)return n.detailNode;const l=n.childStore;if(n.expanded&&l&&l.isDisplayIndexInStore(e))return l.getRowUsingDisplayIndex(e);if(n.rowIndex<e)i=r+1;else{if(!(n.rowIndex>e))return void console.warn(`AG Grid: error: unable to locate rowIndex = ${e} in cache`);s=r-1}}}extractRowBounds(e,t){const i=e=>({rowHeight:e.rowHeight,rowTop:e.rowTop});if(e.rowIndex===t)return i(e);if(e.hasChildren()&&e.expanded&&Bg._.exists(e.childStore)){const i=e.childStore;if(i.isDisplayIndexInStore(t))return i.getRowBounds(t)}else if(e.master&&e.expanded&&Bg._.exists(e.detailNode)&&e.detailNode.rowIndex===t)return i(e.detailNode)}getIndexAtPixel(e,t){if(e.isPixelInRange(t))return e.rowIndex;const i=e.master&&e.expanded,s=e.detailNode;if(i&&s&&s.isPixelInRange(t))return e.detailNode.rowIndex;if(e.hasChildren()&&e.expanded&&Bg._.exists(e.childStore)){const i=e.childStore;if(i.isPixelInRange(t))return i.getRowIndexAtPixel(t)}return null}createNodeIdPrefix(e){const t=[];let i=e;for(;i&&i.level>=0;)""===i.key?t.push("ag-Grid-MissingKey"):t.push(i.key),i=i.parent;if(t.length>0)return t.reverse().join("-")}checkOpenByDefault(e){return this.expansionService.checkOpenByDefault(e)}};am([(0,Bg.Autowired)("valueService")],mm.prototype,"valueService",2),am([(0,Bg.Autowired)("columnModel")],mm.prototype,"columnModel",2),am([(0,Bg.Autowired)("ssrmNodeManager")],mm.prototype,"nodeManager",2),am([(0,Bg.Autowired)("beans")],mm.prototype,"beans",2),am([(0,Bg.Autowired)("expansionService")],mm.prototype,"expansionService",2),mm=am([(0,Bg.Bean)("ssrmBlockUtils")],mm);var fm=class{constructor(){this.rowNodes={}}addRowNode(e){const t=e.id;this.rowNodes[t]&&(console.warn(`AG Grid: Duplicate node id ${e.id}. Row ID's are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`),console.warn("first instance",this.rowNodes[t].data),console.warn("second instance",e.data)),this.rowNodes[t]=e}removeNode(e){const t=e.id;this.rowNodes[t]&&(this.rowNodes[t]=void 0)}clear(){this.rowNodes={}}};am([Vg.PreDestroy],fm.prototype,"clear",1),fm=am([(0,Vg.Bean)("ssrmNodeManager")],fm);var ym=class extends Hg.BeanStub{constructor(){super(...arguments),this.asyncTransactions=[]}postConstruct(){this.gos.isRowModelType("serverSide")}applyTransactionAsync(e,t){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){const e=this.gos.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;const e=[],t=[],i=[];let s=!1;if(this.asyncTransactions.forEach(r=>{let n;this.serverSideRowModel.executeOnStore(r.transaction.route,e=>{n=e.applyTransaction(r.transaction)})?null==n&&(n={status:Hg.ServerSideTransactionResultStatus.StoreNotFound}):n={status:Hg.ServerSideTransactionResultStatus.StoreNotStarted},t.push(n),n.status==Hg.ServerSideTransactionResultStatus.StoreLoading?i.push(r):(r.callback&&e.push(()=>r.callback(n)),n.status===Hg.ServerSideTransactionResultStatus.Applied&&(s=!0))}),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=i,s&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:Hg.Events.EVENT_STORE_UPDATED})),t.length>0){const e={type:Hg.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}}flushAsyncTransactions(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(this.serverSideRowModel.executeOnStore(e.route,i=>{t=i.applyTransaction(e)})){if(t){if(this.valueCache.onDataChanged(),t.remove){const i=t.remove.map(e=>e.id);this.selectionService.deleteSelectionStateFromParent(e.route||[],i)}return this.eventService.dispatchEvent({type:Hg.Events.EVENT_STORE_UPDATED}),t}return{status:Hg.ServerSideTransactionResultStatus.StoreNotFound}}return{status:Hg.ServerSideTransactionResultStatus.StoreNotStarted}}};am([(0,Hg.Autowired)("rowNodeBlockLoader")],ym.prototype,"rowNodeBlockLoader",2),am([(0,Hg.Autowired)("valueCache")],ym.prototype,"valueCache",2),am([(0,Hg.Autowired)("rowModel")],ym.prototype,"serverSideRowModel",2),am([(0,Hg.Autowired)("rowRenderer")],ym.prototype,"rowRenderer",2),am([(0,Hg.Autowired)("selectionService")],ym.prototype,"selectionService",2),am([Hg.PostConstruct],ym.prototype,"postConstruct",1),ym=am([(0,Hg.Bean)("ssrmTransactionManager")],ym);var vm=class extends Ug.BeanStub{postConstruct(){this.gos.isRowModelType("serverSide")&&this.addManagedListener(this.eventService,Ug.Events.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))}onRowGroupOpened(e){const t=e.node;if(t.expanded){if(t.master)this.createDetailNode(t);else if(Ug._.missing(t.childStore)){const e=this.serverSideRowModel.getParams();t.childStore=this.createBean(this.storeFactory.createStore(e,t))}}else this.gos.get("purgeClosedRowNodes")&&Ug._.exists(t.childStore)&&(t.childStore=this.destroyBean(t.childStore));const i={type:Ug.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(i)}createDetailNode(e){if(Ug._.exists(e.detailNode))return e.detailNode;const t=new Ug.RowNode(this.beans);t.detail=!0,t.selectable=!1,t.parent=e,Ug._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1;const i=this.gos.getRowHeightForNode(t).height;return t.rowHeight=i||200,e.detailNode=t,t}};am([(0,Ug.Autowired)("rowModel")],vm.prototype,"serverSideRowModel",2),am([(0,Ug.Autowired)("ssrmStoreFactory")],vm.prototype,"storeFactory",2),am([(0,Ug.Autowired)("beans")],vm.prototype,"beans",2),am([Ug.PostConstruct],vm.prototype,"postConstruct",1),vm=am([(0,Ug.Bean)("ssrmExpandListener")],vm);var Cm=class extends zg.BeanStub{postConstruct(){this.gos.isRowModelType("serverSide")&&this.addManagedListener(this.eventService,zg.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))}onSortChanged(){const e=this.serverSideRowModel.getParams();if(!e)return;const t=this.sortController.getSortModel(),i=e.sortModel,s=this.findChangedColumnsInSort(t,i),r={valueColChanged:this.listenerUtils.isSortingWithValueColumn(s),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(s),changedColumns:s};this.serverSideRowModel.refreshAfterSort(t,r)}findChangedColumnsInSort(e,t){let i=[];return[e,t].forEach(e=>{if(e){const t=e.map(e=>e.colId);i=i.concat(t)}}),i.filter(i=>{const s=t.find(e=>e.colId===i),r=e.find(e=>e.colId===i);return((e,t)=>(e?e.sort:null)!==(t?t.sort:null))(s,r)||((i,s)=>(i?t.indexOf(i):-1)!==(s?e.indexOf(s):-1))(s,r)})}};am([(0,zg.Autowired)("sortController")],Cm.prototype,"sortController",2),am([(0,zg.Autowired)("rowModel")],Cm.prototype,"serverSideRowModel",2),am([(0,zg.Autowired)("ssrmListenerUtils")],Cm.prototype,"listenerUtils",2),am([zg.PostConstruct],Cm.prototype,"postConstruct",1),Cm=am([(0,zg.Bean)("ssrmSortService")],Cm);var bm=class extends Wg.BeanStub{postConstruct(){this.gos.isRowModelType("serverSide")&&(this.addManagedListener(this.eventService,Wg.Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,()=>this.onFilterChanged(!0)),this.addManagedListener(this.eventService,Wg.Events.EVENT_FILTER_CHANGED,()=>this.onFilterChanged()))}onFilterChanged(e){const t=this.serverSideRowModel.getParams();if(!t)return;const i=t.filterModel;let s,r;if(this.filterManager.isAdvancedFilterEnabled()){s=this.filterManager.getAdvancedFilterModel();const t=e?Object.keys(null!=i?i:{}):this.getAdvancedFilterColumns(i),n=this.getAdvancedFilterColumns(s);t.forEach(e=>n.add(e)),r=Array.from(n)}else if(s=this.filterManager.getFilterModel(),e){const e=this.getAdvancedFilterColumns(i);Object.keys(s).forEach(t=>e.add(t)),r=Array.from(e)}else r=this.findChangedColumns(i,s);const n={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),changedColumns:r};this.serverSideRowModel.refreshAfterFilter(s,n)}findChangedColumns(e,t){const i={};Object.keys(e).forEach(e=>i[e]=!0),Object.keys(t).forEach(e=>i[e]=!0);const s=[];return Object.keys(i).forEach(i=>{JSON.stringify(e[i])!=JSON.stringify(t[i])&&s.push(i)}),s}getAdvancedFilterColumns(e){const t=new Set;if(!e)return t;const i=e=>{"join"===e.filterType?e.conditions.forEach(e=>i(e)):t.add(e.colId)};return i(e),t}};am([(0,Wg.Autowired)("rowModel")],bm.prototype,"serverSideRowModel",2),am([(0,Wg.Autowired)("filterManager")],bm.prototype,"filterManager",2),am([(0,Wg.Autowired)("ssrmListenerUtils")],bm.prototype,"listenerUtils",2),am([Wg.PostConstruct],bm.prototype,"postConstruct",1),bm=am([(0,Wg.Bean)("ssrmFilterListener")],bm);var Sm=class{createStore(e,t){const i=this.getStoreParams(e,t);return new(i.suppressInfiniteScroll?lm:um)(e,i,t)}getStoreParams(e,t){const i=this.getLevelSpecificParams(t),s=this.isInfiniteScroll(i);return{suppressInfiniteScroll:!s,cacheBlockSize:this.getBlockSize(s,i),maxBlocksInCache:this.getMaxBlocksInCache(s,e,i)}}getMaxBlocksInCache(e,t,i){if(!e)return;const s=i&&null!=i.maxBlocksInCache?i.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(null!=s&&s>=0){if(t.dynamicRowHeight){const e="Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.";return void jg._.warnOnce(e)}if(this.columnModel.isAutoRowHeightActive()){const e="Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.";return void jg._.warnOnce(e)}return s}}getBlockSize(e,t){if(!e)return;const i=t&&null!=t.cacheBlockSize?t.cacheBlockSize:this.gos.get("cacheBlockSize");return null!=i&&i>0?i:100}getLevelSpecificParams(e){const t=this.gos.getCallback("getServerSideGroupLevelParams");if(t)return t({level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()})}isInfiniteScroll(e){return!(e&&null!=e.suppressInfiniteScroll?e.suppressInfiniteScroll:this.isSuppressServerSideInfiniteScroll())}isSuppressServerSideInfiniteScroll(){return this.gos.get("suppressServerSideInfiniteScroll")}};am([(0,jg.Autowired)("gridOptionsService")],Sm.prototype,"gos",2),am([(0,jg.Autowired)("columnModel")],Sm.prototype,"columnModel",2),Sm=am([(0,jg.Bean)("ssrmStoreFactory")],Sm);var wm=class{isSortingWithValueColumn(e){const t=this.columnModel.getValueColumns().map(e=>e.getColId());for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}isSortingWithSecondaryColumn(e){if(!this.columnModel.getSecondaryColumns())return!1;const t=this.columnModel.getSecondaryColumns().map(e=>e.getColId());for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}};am([(0,Kg.Autowired)("columnModel")],wm.prototype,"columnModel",2),wm=am([(0,Kg.Bean)("ssrmListenerUtils")],wm);var xm=class extends Yg.BeanStub{constructor(){super(...arguments),this.selectedState={selectAll:!1,toggledNodes:new Set},this.lastSelected=null,this.selectAllUsed=!1,this.selectedNodes={}}init(){this.rowSelection=this.gos.get("rowSelection"),this.addManagedPropertyListener("rowSelection",e=>{this.rowSelection=e.currentValue})}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){const t={selectAll:!1,toggledNodes:new Set};"object"==typeof e?"selectAll"in e&&"boolean"==typeof e.selectAll?(t.selectAll=e.selectAll,"toggledNodes"in e&&Array.isArray(e.toggledNodes)?(e.toggledNodes.forEach(e=>{"string"==typeof e?t.toggledNodes.add(e):console.warn(`AG Grid: Provided ids must be of string type. Invalid id provided: ${e}`)}),this.selectedState=t):console.error("AG Grid: `toggledNodes` must be an array of string ids.")):console.error("AG Grid: Select all status should be of boolean type."):console.error("AG Grid: The provided selection state should be an object.")}deleteSelectionStateFromParent(e,t){if(0===this.selectedState.toggledNodes.size)return!1;let i=!1;return t.forEach(e=>{this.selectedState.toggledNodes.delete(e)&&(i=!0)}),i}setNodesSelected(e){if(0===e.nodes.length)return 0;const t=e.clearSelection&&e.newValue&&!e.rangeSelect;if("multiple"!==this.rowSelection||t){if(e.nodes.length>1)throw new Error("AG Grid: cannot select multiple rows when rowSelection is set to 'single'");const t=e.nodes[0];return e.newValue?(this.selectedNodes={[t.id]:t},this.selectedState={selectAll:!1,toggledNodes:new Set([t.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),this.lastSelected=t.id,1}const i=t=>{e.newValue?this.selectedNodes[t.id]=t:delete this.selectedNodes[t.id];const i=t.selectable;e.newValue!==this.selectedState.selectAll&&i?this.selectedState.toggledNodes.add(t.id):this.selectedState.toggledNodes.delete(t.id)};if(e.rangeSelect&&this.lastSelected){if(e.nodes.length>1)throw new Error("AG Grid: cannot select multiple rows when using rangeSelect");const t=e.nodes[0],s=this.rowModel.getRowNode(this.lastSelected);return this.rowModel.getNodesInRangeForSelection(t,null!=s?s:null).forEach(i),this.lastSelected=t.id,1}return e.nodes.forEach(i),this.lastSelected=e.nodes[e.nodes.length-1].id,1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){const t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(){return this.selectAllUsed&&console.warn("AG Grid: getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model.\n                Use `api.getServerSideSelectionState()` instead."),Object.values(this.selectedNodes)}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}clearOtherNodes(e,t){const i=this.selectedState.selectAll?1:this.selectedState.toggledNodes.size-1;this.selectedState={selectAll:!1,toggledNodes:new Set([e.id])},this.rowModel.forEachNode(i=>{i!==e&&i.selectThisNode(!1,void 0,t)});const s={type:Yg.Events.EVENT_SELECTION_CHANGED,source:t};return this.eventService.dispatchEvent(s),i}isEmpty(){var e;return!this.selectedState.selectAll&&!(null==(e=this.selectedState.toggledNodes)?void 0:e.size)}selectAllRowNodes(e){this.selectedState={selectAll:!0,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed=!0}deselectAllRowNodes(e){this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectedNodes={}}getSelectAllState(e,t){return this.selectedState.selectAll?!(this.selectedState.toggledNodes.size>0)||null:this.selectedState.toggledNodes.size>0&&null}};am([(0,Yg.Autowired)("rowModel")],xm.prototype,"rowModel",2),am([Yg.PostConstruct],xm.prototype,"init",1);var Em=class extends qg.BeanStub{constructor(){super(...arguments),this.selectedState={selectAllChildren:!1,toggledNodes:new Map},this.lastSelected=null}init(){this.addManagedListener(this.eventService,qg.Events.EVENT_MODEL_UPDATED,()=>this.removeRedundantState()),this.addManagedListener(this.eventService,qg.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.selectionService.reset("rowGroupChanged"))}getSelectedState(){const e=this.gos.get("treeData"),t=(i,s,r)=>{const n={nodeId:r};if((e||s<=this.columnModel.getRowGroupColumns().length)&&(n.selectAllChildren=i.selectAllChildren),i.toggledNodes.size){const e=[];i.toggledNodes.forEach((i,r)=>{const n=t(i,s+1,r);e.push(n)}),n.toggledNodes=e}return n};return t(this.selectedState,0)}setSelectedState(e){const t=(e,i)=>{var s,r;if("object"!=typeof e)throw new Error("AG Grid: Each provided state object must be an object.");if("selectAllChildren"in e&&"boolean"!=typeof e.selectAllChildren)throw new Error("AG Grid: `selectAllChildren` must be a boolean value or undefined.");if("toggledNodes"in e){if(!Array.isArray(e.toggledNodes))throw new Error("AG Grid: `toggledNodes` must be an array.");if(!e.toggledNodes.every(e=>"object"==typeof e&&"nodeId"in e&&"string"==typeof e.nodeId))throw new Error("AG Grid: Every `toggledNode` requires an associated string id.")}const n=null!=(s=e.selectAllChildren)?s:!i,o=null==(r=e.toggledNodes)?void 0:r.map(e=>[e.nodeId,t(e,n)]);if(null==o?void 0:o.some(([e,t])=>n===t.selectAllChildren&&0===t.toggledNodes.size))throw new Error("\n                    AG Grid: AG Grid: Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule.\n                    Please rebuild the selection state and reapply it.\n                ");return{selectAllChildren:n,toggledNodes:new Map(o)}};try{this.selectedState=t(e,!!e.selectAllChildren)}catch(e){console.error(e.message)}}deleteSelectionStateFromParent(e,t){let i=this.selectedState;const s=[...e];for(;i&&s.length;)i=i.toggledNodes.get(s.pop());if(!i)return!1;let r=!1;return t.forEach(e=>{(null==i?void 0:i.toggledNodes.delete(e))&&(r=!0)}),r&&this.removeRedundantState(),r}setNodesSelected(e){const t=e,{nodes:i}=t,s=om(t,["nodes"]);if(0===i.length)return 0;if(e.rangeSelect){if(i.length>1)throw new Error("AG Grid: cannot select multiple rows when using rangeSelect");const e=i[0],t=this.rowModel.getNodesInRangeForSelection(e,this.lastSelected).map(this.getRouteToNode).sort((e,t)=>t.length-e.length),r=new Set;return t.forEach(t=>{r.has(t[t.length-1])||(t.forEach(e=>r.add(e)),this.recursivelySelectNode(t,this.selectedState,nm({node:e},s)))}),this.removeRedundantState(),this.lastSelected=e,1}return e.nodes.forEach(e=>{const t=this.getRouteToNode(e);var i;this.recursivelySelectNode(t,this.selectedState,(i=nm({},s),Qg(i,em({node:e}))))}),this.removeRedundantState(),this.lastSelected=e.nodes[e.nodes.length-1],1}isNodeSelected(e){const t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],i){if(0===t.length){const t=i.toggledNodes.has(e.id);if(e.hasChildren()){const t=i.toggledNodes.get(e.id);if(t&&t.toggledNodes.size)return}return i.selectAllChildren?!t:t}if(i.toggledNodes.has(e.id)){const s=i.toggledNodes.get(e.id);if(s)return this.isNodePathSelected(t,s)}return!!i.selectAllChildren}getRouteToNode(e){const t=[];let i=e;for(;i.parent;)t.push(i),i=i.parent;return t.reverse()}removeRedundantState(){if(this.filterManager.isAnyFilterPresent())return;const e=(t=this.selectedState,i,s)=>{if(t.toggledNodes.forEach((i,s)=>{e(i,s,t)}),i){const e=this.rowModel.getRowNode(i),s=null==e?void 0:e.childStore;if((null==s?void 0:s.isLastRowIndexKnown())&&t.toggledNodes.size>=s.getRowCount()){for(const e of t.toggledNodes.entries()){const[t,i]=e;if(i.toggledNodes.size>0)return;if(!this.rowModel.getRowNode(t))return}t.selectAllChildren=!t.selectAllChildren,t.toggledNodes.clear()}}const r=0===t.toggledNodes.size,n=(null==s?void 0:s.selectAllChildren)===t.selectAllChildren;r&&n&&(null==s||s.toggledNodes.delete(i))};e()}recursivelySelectNode([e,...t],i,s){if(!e)return;if(!t.length){const t=e.selectable;if(i.selectAllChildren===s.newValue||!t)return void i.toggledNodes.delete(e.id);const r={selectAllChildren:s.newValue,toggledNodes:new Map};return void i.toggledNodes.set(e.id,r)}const r=i.toggledNodes.has(e.id),n=r?i.toggledNodes.get(e.id):{selectAllChildren:i.selectAllChildren,toggledNodes:new Map};r||i.toggledNodes.set(e.id,n),this.recursivelySelectNode(t,n,s),i.selectAllChildren===n.selectAllChildren&&0===n.toggledNodes.size&&i.toggledNodes.delete(e.id)}getSelectedNodes(){console.warn("AG Grid: `getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model.\n            Use `api.getServerSideSelectionState()` instead.");const e=[];return this.rowModel.forEachNode(t=>{t.isSelected()&&e.push(t)}),e}processNewRow(e){}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return-1}isEmpty(){var e;return!this.selectedState.selectAllChildren&&!(null==(e=this.selectedState.toggledNodes)?void 0:e.size)}selectAllRowNodes(e){this.selectedState={selectAllChildren:!0,toggledNodes:new Map}}deselectAllRowNodes(e){this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}getSelectAllState(e,t){return this.selectedState.selectAllChildren?!(this.selectedState.toggledNodes.size>0)||null:this.selectedState.toggledNodes.size>0&&null}};am([(0,qg.Autowired)("rowModel")],Em.prototype,"rowModel",2),am([(0,qg.Autowired)("columnModel")],Em.prototype,"columnModel",2),am([(0,qg.Autowired)("filterManager")],Em.prototype,"filterManager",2),am([(0,qg.Autowired)("rowModel")],Em.prototype,"serverSideRowModel",2),am([(0,qg.Autowired)("selectionService")],Em.prototype,"selectionService",2),am([qg.PostConstruct],Em.prototype,"init",1);var Mm=class extends $g.BeanStub{init(){const e=this.gos.get("groupSelectsChildren");this.addManagedPropertyListener("groupSelectsChildren",e=>{this.destroyBean(this.selectionStrategy);const t=e.currentValue?Em:xm;this.selectionStrategy=this.createManagedBean(new t),this.shotgunResetNodeSelectionState();const i={type:$g.Events.EVENT_SELECTION_CHANGED,source:"api"};this.eventService.dispatchEvent(i)}),this.addManagedPropertyListener("rowSelection",()=>this.deselectAllRowNodes({source:"api"}));const t=e?Em:xm;this.selectionStrategy=this.createManagedBean(new t)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(Array.isArray(e))return;this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState();const i={type:$g.Events.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(i)}setNodesSelected(e){const t=e,{nodes:i}=t,s=om(t,["nodes"]),r=this.gos.get("rowSelection");if(i.length>1&&"multiple"!==r)return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;if(i.length>1&&e.rangeSelect)return console.warn("AG Grid: cannot use range selection when multi selecting rows"),0;const n=nm({nodes:i.filter(e=>e.selectable)},s);if(!n.nodes.length)return 0;const o=this.selectionStrategy.setNodesSelected(n);this.shotgunResetNodeSelectionState(n.source);const a={type:$g.Events.EVENT_SELECTION_CHANGED,source:n.source};return this.eventService.dispatchEvent(a),o}deleteSelectionStateFromParent(e,t){if(!this.selectionStrategy.deleteSelectionStateFromParent(e,t))return;this.shotgunResetNodeSelectionState();const i={type:$g.Events.EVENT_SELECTION_CHANGED,source:"api"};this.eventService.dispatchEvent(i)}shotgunResetNodeSelectionState(e){this.rowModel.forEachNode(t=>{if(t.stub)return;const i=this.selectionStrategy.isNodeSelected(t);i!==t.isSelected()&&t.selectThisNode(i,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e,t){this.selectionStrategy.processNewRow(e);const i=this.selectionStrategy.isNodeSelected(e);if(0!=i&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState();const t={type:$g.Events.EVENT_SELECTION_CHANGED,source:"api"};return void this.eventService.dispatchEvent(t)}e.setSelectedInitialValue(i)}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"})}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(e=!1,t=!1){return!0}selectAllRowNodes(e){(e.justCurrentPage||e.justFiltered)&&console.warn("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"),this.selectionStrategy.selectAllRowNodes(e),this.rowModel.forEachNode(t=>{t.stub||t.selectThisNode(!0,void 0,e.source)});const t={type:$g.Events.EVENT_SELECTION_CHANGED,source:e.source};this.eventService.dispatchEvent(t)}deselectAllRowNodes(e){(e.justCurrentPage||e.justFiltered)&&console.warn("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"),this.selectionStrategy.deselectAllRowNodes(e),this.rowModel.forEachNode(t=>{t.stub||t.selectThisNode(!1,void 0,e.source)});const t={type:$g.Events.EVENT_SELECTION_CHANGED,source:e.source};this.eventService.dispatchEvent(t)}getSelectAllState(e,t){return this.selectionStrategy.getSelectAllState(e,t)}updateGroupsFromChildrenSelections(e,t){return!1}getBestCostNodeSelection(){console.warn("AG Grid: calling gridApi.getBestCostNodeSelection() is only possible when using rowModelType=`clientSide`.")}filterFromSelection(){}};am([(0,$g.Autowired)("rowModel")],Mm.prototype,"rowModel",2),am([$g.PostConstruct],Mm.prototype,"init",1),Mm=am([(0,$g.Bean)("selectionService")],Mm);var Am=class extends Xg.ExpansionService{constructor(){super(...arguments),this.queuedRowIds=new Set}postConstruct(){super.postConstruct(),this.addManagedListener(this.eventService,Xg.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>{this.queuedRowIds.clear()})}checkOpenByDefault(e){if(!e.isExpandable())return;if(this.queuedRowIds.has(e.id))return this.queuedRowIds.delete(e.id),void e.setExpanded(!0);const t=this.gos.getCallback("isServerSideGroupOpenByDefault");t&&t({data:e.data,rowNode:e})&&e.setExpanded(!0)}expandRows(e){e.forEach(e=>{const t=this.serverSideRowModel.getRowNode(e);t?t.setExpanded(!0):this.queuedRowIds.add(e)})}expandAll(e){this.serverSideRowModel.expandAll(e)}onGroupExpandedOrCollapsed(){}};am([(0,Xg.Autowired)("rowModel")],Am.prototype,"serverSideRowModel",2),Am=am([(0,Xg.Bean)("expansionService")],Am);var Tm={version:"31.3.4",moduleName:kg.ModuleNames.ServerSideRowModelModule,rowModel:"serverSide",beans:[pm,vm,Cm,gm,mm,fm,ym,bm,Sm,wm,Mm,Am,hm],dependantModules:[D]},Dm=i(98092),Im=i(98092),Rm=i(98092),Pm=i(98092),km=i(98092),Lm=i(98092),Nm=i(98092),_m=Object.defineProperty,Om=Object.getOwnPropertyDescriptor,Fm=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Om(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&_m(t,i,n),n},Gm=class{constructor(e,t,i,s,r,n,o,a,l,c,h){this.rowModel=e,this.filterParams=t,this.createKey=i,this.caseFormat=s,this.columnModel=r,this.valueService=n,this.treeDataOrGrouping=o,this.treeData=a,this.getDataPath=l,this.groupAllowUnbalanced=c,this.addManagedListener=h}extractUniqueValuesAsync(e,t){return new Pm.AgPromise(i=>{if(this.rowModel.isRowDataLoaded())i(this.extractUniqueValues(e,t));else{const s=this.addManagedListener(Pm.Events.EVENT_ROW_COUNT_READY,()=>{null==s||s(),i(this.extractUniqueValues(e,t))})}})}extractUniqueValues(e,t){const i=new Map,s=this.extractExistingFormattedKeys(t),r=new Set,n=this.treeData&&!!this.getDataPath,o=this.columnModel.getRowGroupColumns(),a=(e,n)=>{const o=this.caseFormat(e);if(!r.has(o)){r.add(o);let a=e,l=Pm._.makeNull(n);const c=null==s?void 0:s.get(o);null!=c&&(a=c,l=t.get(c)),i.set(a,l)}};return this.rowModel.forEachLeafNode(t=>{if(!t.data||!e(t))return;if(this.treeDataOrGrouping)return void this.addValueForTreeDataOrGrouping(t,n,o,a);let i=this.getValue(t);this.filterParams.convertValuesToStrings?this.addValueForConvertValuesToString(t,i,a):null!=i&&Array.isArray(i)?(i.forEach(e=>{a(this.createKey(e,t),e)}),0===i.length&&a(null,null)):a(this.createKey(i,t),i)}),i}addValueForConvertValuesToString(e,t,i){const s=this.createKey(t,e);null!=s&&Array.isArray(s)?(s.forEach(e=>{const t=Pm._.toStringOrNull(Pm._.makeNull(e));i(t,t)}),0===s.length&&i(null,null)):i(s,s)}addValueForTreeDataOrGrouping(e,t,i,s){var r;let n;if(t){if(null==(r=e.childrenAfterGroup)?void 0:r.length)return;n=this.getDataPath(e.data)}else n=i.map(t=>this.valueService.getKeyForNode(t,e)),n.push(this.getValue(e));n&&(n=n.map(e=>Pm._.toStringOrNull(Pm._.makeNull(e)))),!t&&this.groupAllowUnbalanced&&(null==n?void 0:n.some(e=>null==e))&&(n=n.filter(e=>null!=e)),s(this.createKey(n),n)}getValue(e){return this.filterParams.getValue(e)}extractExistingFormattedKeys(e){if(!e)return null;const t=new Map;return e.forEach((e,i)=>{t.set(this.caseFormat(i),i)}),t}},Bm=class{};Bm.SELECT_ALL="__AG_SELECT_ALL__",Bm.ADD_SELECTION_TO_FILTER="__AG_ADD_SELECTION_TO_FILTER__";var Vm=class{constructor(e,t,i,s){this.valueService=e,this.valueFormatter=t,this.formatter=i,this.column=s,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,i){this.displayedKeys=Array.from(i)}updateDisplayedValuesToMatchMiniFilter(e,t,i,s,r){this.displayedKeys=[];for(let t of i)if(null==t)r&&this.displayedKeys.push(t);else{const i=e(t),r=this.valueService.formatValue(this.column,null,i,this.valueFormatter,!1);s(this.formatter(r))&&this.displayedKeys.push(t)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return Bm.SELECT_ALL}getAddSelectionToFilterItem(){return Bm.ADD_SELECTION_TO_FILTER}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}},Hm=class e{constructor(e,t,i,s){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=i,this.treeDataOrGrouping=s,this.allDisplayedItemsTree=[],this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:Bm.SELECT_ALL,children:this.allDisplayedItemsTree,expanded:!0,key:Bm.SELECT_ALL,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:Bm.ADD_SELECTION_TO_FILTER,expanded:!0,key:Bm.ADD_SELECTION_TO_FILTER,parentTreeKeys:[]}}updateDisplayedValuesToAllAvailable(e,t,i,s){"reload"===s?this.generateItemTree(e,t,i):"otherFilter"===s?(this.updateAvailable(i),this.updateExpandAll()):"miniFilter"===s&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,i,s,r,n){"reload"===n?this.generateItemTree(e,t,i):"otherFilter"===n&&this.updateAvailable(i),this.updateFilter(s,r),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,i){var s;this.allDisplayedItemsTree=[],this.groupsExist=!1;const r=this.getTreeListPathGetter(e,i);for(let n of t){const t=null!=(s=r(e(n)))?s:[null];t.length>1&&(this.groupsExist=!0);const o=i.has(n);let a,l=this.allDisplayedItemsTree,c=[];t.forEach((e,i)=>{l||(l=[],a.children=l),a=l.find(t=>{var i;return(null==(i=t.treeKey)?void 0:i.toUpperCase())===(null==e?void 0:e.toUpperCase())}),a||(a={treeKey:e,depth:i,filterPasses:!0,expanded:!1,available:o,parentTreeKeys:c},i===t.length-1&&(a.key=n),l.push(a)),l=a.children,c=[...c,e]})}this.updateAvailable(i),this.selectAllItem.children=this.allDisplayedItemsTree,this.selectAllItem.expanded=!1}getTreeListPathGetter(t,i){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return e=>e;let s=!1;for(const e of i){const i=t(e);if(i instanceof Date){s=!0;break}if(null!=i)break}return s?e.DATE_TREE_LIST_PATH_GETTER:(km._.warnOnce("property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date."),e=>[String(e)])}flattenItems(){this.activeDisplayedItemsFlat=[];const e=t=>{t.forEach(t=>{t.filterPasses&&t.available&&(this.activeDisplayedItemsFlat.push(t),t.children&&t.expanded&&e(t.children))})};e(this.allDisplayedItemsTree)}resetFilter(){const e=t=>{t.children&&t.children.forEach(t=>{e(t)}),t.filterPasses=!0};this.allDisplayedItemsTree.forEach(t=>e(t))}updateFilter(e,t){const i=i=>!!i.available&&(null==i.treeKey?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey)));this.allDisplayedItemsTree.forEach(e=>this.recursiveItemCheck(e,!1,i,"filterPasses"))}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){const e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){const t=(i,s)=>{i.children?i.expanded&&s||i.children.forEach(e=>{e.filterPasses&&t(e,!1)}):e(i.key)};this.activeDisplayedItemsFlat.forEach(e=>t(e,!0))}someDisplayedKey(e){const t=(i,s)=>i.children?(!i.expanded||!s)&&i.children.some(e=>!!e.filterPasses&&t(e,!1)):e(i.key);return this.activeDisplayedItemsFlat.some(e=>t(e,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){const e=(t,i,s)=>{for(const r of t){if(!r.filterPasses||!r.available||!r.children)continue;if(i=i||!!r.expanded,s=s||!r.expanded,i&&s)return;const t=e(r.children,i,s);if(void 0===t)return;t?i=!0:s=!0}return i&&s?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,i,s){let r=!1;e.children&&e.children.forEach(n=>{const o=this.recursiveItemCheck(n,t||i(e),i,s);r=r||o});const n=t||r||i(e);return e[s]=n,n}updateAvailable(e){const t=t=>e.has(t.key);this.allDisplayedItemsTree.forEach(e=>this.recursiveItemCheck(e,!1,t,"available"))}};Hm.DATE_TREE_LIST_PATH_GETTER=e=>e?[String(e.getFullYear()),String(e.getMonth()+1),String(e.getDate())]:null;var Um=Hm,zm=class{constructor({caseFormat:e}){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1,this.caseFormat=e}allFilteringKeys(){return this.filteringKeys}allFilteringKeysCaseFormatted(){return this.filteringKeysCaseFormatted}noAppliedFilteringKeys(){return this.hasNoAppliedFilteringKeys}setFilteringKeys(e){this.filteringKeys=new Set(e),this.hasNoAppliedFilteringKeys=!this.filteringKeys||0===this.filteringKeys.size,this.filteringKeysCaseFormatted=new Set,this.filteringKeys.forEach(e=>this.filteringKeysCaseFormatted.add(this.caseFormat(e)))}addFilteringKey(e){null==this.filteringKeys&&(this.filteringKeys=new Set,this.filteringKeysCaseFormatted=new Set),this.filteringKeys.add(e),this.filteringKeysCaseFormatted.add(this.caseFormat(e)),this.hasNoAppliedFilteringKeys&&(this.hasNoAppliedFilteringKeys=!1)}hasCaseFormattedFilteringKey(e){return this.filteringKeysCaseFormatted.has(this.caseFormat(e))}hasFilteringKey(e){return this.filteringKeys.has(e)}reset(){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1}},Wm=class e{constructor(e){this.localEventService=new Rm.EventService,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.providedValues=null,this.allValues=new Map,this.availableKeys=new Set,this.selectedKeys=new Set,this.initialised=!1;const{usingComplexObjects:t,columnModel:i,valueService:s,treeDataTreeList:r,groupingTreeList:n,filterParams:o,gos:a,valueFormatter:l,addManagedListener:c}=e,{column:h,colDef:d,textFormatter:u,doesRowPassOtherFilter:p,suppressSorting:g,comparator:m,rowModel:f,values:y,caseSensitive:v,convertValuesToStrings:C,treeList:b,treeListPathGetter:S,treeListFormatter:w}=o;this.filterParams=o,this.gos=a,this.setIsLoading=e.setIsLoading,this.translate=e.translate,this.caseFormat=e.caseFormat,this.createKey=e.createKey,this.usingComplexObjects=!!e.usingComplexObjects,this.formatter=u||Rm.TextFilter.DEFAULT_FORMATTER,this.doesRowPassOtherFilters=p,this.suppressSorting=g||!1,this.convertValuesToStrings=!!C,this.filteringKeys=new zm({caseFormat:this.caseFormat});const x=null!=m?m:d.comparator,E=!!r||!!n;this.compareByValue=!!(t&&x||E||b&&!S),this.entryComparator=E&&!x?this.createTreeDataOrGroupingComparator():!b||S||x?([e,t],[i,s])=>x(t,s):([e,t],[i,s])=>Rm._.defaultComparator(t,s),this.keyComparator=null!=x?x:Rm._.defaultComparator,this.caseSensitive=!!v;const M=a.get("getDataPath"),A=a.get("groupAllowUnbalanced");"clientSide"===f.getType()&&(this.clientSideValuesExtractor=new Gm(f,this.filterParams,this.createKey,this.caseFormat,i,s,E,!!r,M,A,c)),null==y?this.valuesType=2:(this.valuesType=Array.isArray(y)?0:1,this.providedValues=y),this.displayValueModel=b?new Um(this.formatter,S,w,r||n):new Vm(s,l,this.formatter,h),this.updateAllValues().then(e=>this.resetSelectionState(e||[]))}addEventListener(e,t,i){this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService.removeEventListener(e,t,i)}updateOnParamsChange(e){return new Rm.AgPromise(t=>{const{values:i,textFormatter:s,suppressSorting:r}=e,n=this.providedValues,o=this.suppressSorting;if(this.filterParams=e,this.formatter=s||Rm.TextFilter.DEFAULT_FORMATTER,this.suppressSorting=r||!1,this.providedValues=null!=i?i:null,this.providedValues!==n||this.suppressSorting!==o){i&&0!==i.length?this.valuesType=Array.isArray(i)?0:1:(this.valuesType=2,this.providedValues=null);const e=this.getModel();this.updateAllValues().then(i=>{this.setModel(e).then(()=>t())})}else t()})}refreshValues(){return new Rm.AgPromise(e=>{this.allValuesPromise.then(()=>{const t=this.getModel();this.updateAllValues(),this.setModel(t).then(()=>e())})})}overrideValues(e){return new Rm.AgPromise(t=>{this.allValuesPromise.then(()=>{this.valuesType=0,this.providedValues=e,this.refreshValues().then(()=>t())})})}refreshAfterAnyFilterChanged(){return this.showAvailableOnly()?this.allValuesPromise.then(e=>(this.updateAvailableKeys(null!=e?e:[],"otherFilter"),!0)):Rm.AgPromise.resolve(!1)}isInitialised(){return this.initialised}updateAllValues(){return this.allValuesPromise=new Rm.AgPromise(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync(!1).then(t=>e(this.processAllValues(t)));break;case 0:e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break;case 1:{this.setIsLoading(!0);const t=this.providedValues,{column:i,colDef:s}=this.filterParams,r=this.gos.addGridCommonParams({success:t=>{this.setIsLoading(!1),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(t))))},colDef:s,column:i});window.setTimeout(()=>t(r),0);break}default:throw new Error("Unrecognised valuesType")}}),this.allValuesPromise.then(e=>this.updateAvailableKeys(e||[],"reload")).then(()=>this.initialised=!0),this.allValuesPromise}processAllValues(e){const t=this.sortKeys(e);return this.allValues=null!=e?e:new Map,t}validateProvidedValues(e){if(this.usingComplexObjects&&(null==e?void 0:e.length)){const t=e[0];t&&"object"!=typeof t&&"function"!=typeof t&&(null==this.createKey(t)?Rm._.warnOnce("Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects or set convertValuesToStrings=true in the filterParams. See https://www.ag-grid.com/javascript-data-grid/filter-set-filter-list/#filter-value-types"):Rm._.warnOnce("Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects or enable convertValuesToStrings?"))}return e}setValuesType(e){this.valuesType=e}getValuesType(){return this.valuesType}isKeyAvailable(e){return this.availableKeys.has(e)}showAvailableOnly(){return 2===this.valuesType}updateAvailableKeys(t,i){const s=this.showAvailableOnly()?this.sortKeys(this.getValuesFromRows(!0)):t;this.availableKeys=new Set(s),this.localEventService.dispatchEvent({type:e.EVENT_AVAILABLE_VALUES_CHANGED}),this.updateDisplayedValues(i,t)}sortKeys(e){const t=null!=e?e:new Map;if(this.suppressSorting)return Array.from(t.keys());let i;return i=this.compareByValue?Array.from(t.entries()).sort(this.entryComparator).map(([e])=>e):Array.from(t.keys()).sort(this.keyComparator),this.filterParams.excelMode&&t.has(null)&&(i=i.filter(e=>null!=e),i.push(null)),i}getParamsForValuesFromRows(e=!1){return this.clientSideValuesExtractor?{predicate:t=>!e||this.doesRowPassOtherFilters(t),existingValues:e&&!this.caseSensitive?this.allValues:void 0}:(Rm._.doOnce(()=>{console.error("AG Grid: Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values")},"setFilterValueNotCSRM"),null)}getValuesFromRows(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValues(t.predicate,t.existingValues):null}getValuesFromRowsAsync(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValuesAsync(t.predicate,t.existingValues):Rm.AgPromise.resolve(null)}setMiniFilter(e){return e=Rm._.makeNull(e),this.miniFilterText!==e&&(null===e&&this.setAddCurrentSelectionToFilter(!1),this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0)}getMiniFilter(){return this.miniFilterText}updateDisplayedValues(e,t){if("expansion"===e)return void this.displayValueModel.refresh();if(null==this.miniFilterText)return void this.displayValueModel.updateDisplayedValuesToAllAvailable(e=>this.getValue(e),t,this.availableKeys,e);const i=this.caseFormat(this.formatter(this.miniFilterText)||""),s=e=>null!=e&&this.caseFormat(e).indexOf(i)>=0,r=!!this.filterParams.excelMode&&s(this.translate("blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(e=>this.getValue(e),t,this.availableKeys,s,r,e)}getDisplayedValueCount(){return this.displayValueModel.getDisplayedValueCount()}getDisplayedItem(e){return this.displayValueModel.getDisplayedItem(e)}getSelectAllItem(){return this.displayValueModel.getSelectAllItem()}getAddSelectionToFilterItem(){return this.displayValueModel.getAddSelectionToFilterItem()}hasSelections(){return this.filterParams.defaultToNothingSelected?this.selectedKeys.size>0:this.allValues.size!==this.selectedKeys.size}getKeys(){return Array.from(this.allValues.keys())}getValues(){return Array.from(this.allValues.values())}getValue(e){return this.allValues.get(e)}setAddCurrentSelectionToFilter(e){this.addCurrentSelectionToFilter=e}isInWindowsExcelMode(){return"windows"===this.filterParams.excelMode}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&Rm._.exists(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){null==this.miniFilterText?this.selectedKeys=new Set(this.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.add(e)))}deselectAllMatchingMiniFilter(){null==this.miniFilterText?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}selectKey(e){this.selectedKeys.add(e)}deselectKey(e){this.filterParams.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e)}isKeySelected(e){return this.selectedKeys.has(e)}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.isKeySelected(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.isKeySelected(e))}getModel(){if(!this.hasSelections())return null;const e=this.isAddCurrentSelectionToFilterChecked()?this.filteringKeys.allFilteringKeys():null;if(e&&e.size>0){if(this.selectedKeys){const t=new Set([...Array.from(e),...Array.from(this.selectedKeys).filter(t=>!e.has(t))]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setModel(e){return this.allValuesPromise.then(t=>{if(null==e)this.resetSelectionState(null!=t?t:[]);else{this.selectedKeys.clear();const t=new Map;this.allValues.forEach((e,i)=>{t.set(this.caseFormat(i),i)}),e.forEach(e=>{const i=this.caseFormat(Rm._.makeNull(e)),s=t.get(i);void 0!==s&&this.selectKey(s)})}})}uniqueValues(e){const t=new Map,i=new Set;return(null!=e?e:[]).forEach(e=>{const s=Rm._.makeNull(e),r=this.convertAndGetKey(s),n=this.caseFormat(r);i.has(n)||(i.add(n),t.set(r,s))}),t}convertAndGetKey(e){return this.convertValuesToStrings?e:this.createKey(e)}resetSelectionState(e){this.filterParams.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}hasGroups(){return this.displayValueModel.hasGroups()}createTreeDataOrGroupingComparator(){return([e,t],[i,s])=>{if(null==t)return null==s?0:-1;if(null==s)return 1;for(let e=0;e<t.length;e++){if(e>=s.length)return 1;const i=Rm._.defaultComparator(t[e],s[e]);if(0!==i)return i}return 0}}setAppliedModelKeys(e){this.filteringKeys.setFilteringKeys(e)}addToAppliedModelKeys(e){this.filteringKeys.addFilteringKey(e)}getAppliedModelKeys(){return this.filteringKeys.allFilteringKeys()}getCaseFormattedAppliedModelKeys(){return this.filteringKeys.allFilteringKeysCaseFormatted()}hasAppliedModelKey(e){return this.filteringKeys.hasCaseFormattedFilteringKey(e)}hasAnyAppliedModelKey(){return!this.filteringKeys.noAppliedFilteringKeys()}};Wm.EVENT_AVAILABLE_VALUES_CHANGED="availableValuesChanged";var jm=Wm,Km=class e extends Lm.Component{constructor(t){var i;super(t.isGroup?e.GROUP_TEMPLATE:e.TEMPLATE),this.focusWrapper=t.focusWrapper,this.value=t.value,this.params=t.params,this.translate=t.translate,this.valueFormatter=t.valueFormatter,this.item=t.item,this.isSelected=t.isSelected,this.isTree=t.isTree,this.depth=null!=(i=t.depth)?i:0,this.isGroup=t.isGroup,this.groupsExist=t.groupsExist,this.isExpanded=t.isExpanded,this.hasIndeterminateExpandState=t.hasIndeterminateExpandState}init(){this.addDestroyFunc(()=>{var e;return null==(e=this.destroyCellRendererComponent)?void 0:e.call(this)}),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree&&(this.depth>0&&this.addCssClass("ag-set-filter-indent-"+this.depth),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCssClass("ag-set-filter-add-group-indent"),Lm._.setAriaLevel(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),this.params.readOnly||this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){this.eGroupClosedIcon.appendChild(Lm._.createIcon("setFilterGroupClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Lm._.createIcon("setFilterGroupOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.hasIndeterminateExpandState&&(this.eGroupIndeterminateIcon.appendChild(Lm._.createIcon("setFilterGroupIndeterminate",this.gos,null)),this.addManagedListener(this.eGroupIndeterminateIcon,"click",this.onExpandOrContractClicked.bind(this))),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(t,i){if(this.isGroup&&t!==this.isExpanded){this.isExpanded=t;const s={type:e.EVENT_EXPANDED_CHANGED,isExpanded:!!t,item:this.item};i||this.dispatchEvent(s),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){Lm._.setDisplayed(this.eGroupClosedIcon,this.hasIndeterminateExpandState?!1===this.isExpanded:!this.isExpanded),Lm._.setDisplayed(this.eGroupOpenedIcon,!0===this.isExpanded),this.hasIndeterminateExpandState&&Lm._.setDisplayed(this.eGroupIndeterminateIcon,void 0===this.isExpanded)}onCheckboxChanged(t){this.isSelected=t;const i={type:e.EVENT_SELECTION_CHANGED,isSelected:t,item:this.item};this.dispatchEvent(i),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){this.params.readOnly||this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;const e=this.localeService.getLocaleTextFunc(),t=this.eCheckbox.getValue(),i=void 0===t?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),s=e("ariaToggleVisibility","Press SPACE to toggle visibility");Lm._.setAriaLabelledBy(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}setupFixedAriaLabels(e){if(!this.isTree)return;const t=this.localeService.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();Lm._.setAriaLabel(i,`${e} ${t}`),Lm._.setAriaDescribedBy(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){const e=this.getAriaElement();Lm._.setAriaChecked(e,this.eCheckbox.getValue())}refreshAriaExpanded(){Lm._.setAriaExpanded(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,i){var s,r;if(this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(i,!0),this.valueFunction){const e=this.valueFunction();this.setTooltipAndCellRendererParams(e,e),this.cellRendererComponent||this.renderCellWithoutCellRenderer()}if(this.cellRendererComponent&&!(null==(r=(s=this.cellRendererComponent).refresh)?void 0:r.call(s,this.cellRendererParams))){const e=this.cellRendererComponent;this.renderCell(),this.destroyBean(e)}}render(){const{params:{column:e}}=this;let{value:t}=this,i=null;"function"==typeof t?(this.valueFunction=t,i=this.valueFunction(),t=i):i=this.isTree?Lm._.toStringOrNull(t):this.getFormattedValue(e,t),this.setTooltipAndCellRendererParams(t,i),this.renderCell()}setTooltipAndCellRendererParams(e,t){const i="whenTruncated"===this.gos.get("tooltipShowMode");if(this.params.showTooltips&&(!i||!this.params.cellRenderer)){const s=null!=t?t:Lm._.toStringOrNull(e);let r;i&&(r=()=>{const e=this.eCheckbox.getGui().querySelector(".ag-label");return!e||e.scrollWidth>e.clientWidth}),this.setTooltip({newTooltipText:s,location:"setFilterValue",getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,shouldDisplayTooltip:r})}this.cellRendererParams=this.gos.addGridCommonParams({value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,location:"setFilterValue",shouldDisplayTooltip:t})}})}getTooltipParams(){const e=super.getTooltipParams();return e.location="setFilterValue",e.colDef=this.getComponentHolder(),this.isTree&&(e.level=this.depth),e}getFormattedValue(e,t){return this.valueService.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){const e=this.userComponentFactory.getSetFilterCellRendererDetails(this.params,this.cellRendererParams),t=e?e.newAgStackInstance():void 0;null!=t?t.then(e=>{e&&(this.cellRendererComponent=e,this.eCheckbox.setLabel(e.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(e))}):this.renderCellWithoutCellRenderer()}renderCellWithoutCellRenderer(){var e;let t=null!=(e=null==this.cellRendererParams.valueFormatted?this.cellRendererParams.value:this.cellRendererParams.valueFormatted)?e:this.translate("blanks");"string"!=typeof t&&(Lm._.warnOnce(`Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects, or set convertValuesToStrings=true in the filterParams. See ${this.getFrameworkOverrides().getDocLink("filter-set-filter-list/#filter-value-types")}`),t=""),this.eCheckbox.setLabel(t),this.setupFixedAriaLabels(t)}getComponentHolder(){return this.params.column.getColDef()}};Km.EVENT_SELECTION_CHANGED="selectionChanged",Km.EVENT_EXPANDED_CHANGED="expandedChanged",Km.GROUP_TEMPLATE='\n        <div class="ag-set-filter-item" aria-hidden="true">\n            <span class="ag-set-filter-group-icons">\n                <span class="ag-set-filter-group-closed-icon" ref="eGroupClosedIcon"></span>\n                <span class="ag-set-filter-group-opened-icon" ref="eGroupOpenedIcon"></span>\n                <span class="ag-set-filter-group-indeterminate-icon" ref="eGroupIndeterminateIcon"></span>\n            </span>\n            <ag-checkbox ref="eCheckbox" class="ag-set-filter-item-checkbox"></ag-checkbox>\n        </div>',Km.TEMPLATE='\n        <div class="ag-set-filter-item">\n            <ag-checkbox ref="eCheckbox" class="ag-set-filter-item-checkbox"></ag-checkbox>\n        </div>',Fm([(0,Lm.Autowired)("valueService")],Km.prototype,"valueService",2),Fm([(0,Lm.Autowired)("userComponentFactory")],Km.prototype,"userComponentFactory",2),Fm([(0,Lm.RefSelector)("eCheckbox")],Km.prototype,"eCheckbox",2),Fm([(0,Lm.RefSelector)("eGroupOpenedIcon")],Km.prototype,"eGroupOpenedIcon",2),Fm([(0,Lm.RefSelector)("eGroupClosedIcon")],Km.prototype,"eGroupClosedIcon",2),Fm([(0,Lm.RefSelector)("eGroupIndeterminateIcon")],Km.prototype,"eGroupIndeterminateIcon",2),Fm([Lm.PostConstruct],Km.prototype,"init",1);var $m=Km,Ym={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches."},qm=class{getModelAsString(e,t){const{values:i}=e||t.getModel()||{},s=t.getValueModel();if(null==i||null==s)return"";const r=i.filter(e=>s.isKeyAvailable(e)),n=r.length;return`(${n}) ${r.slice(0,10).map(e=>t.getFormattedValue(e)).join(",")}${n>10?",...":""}`}},Xm=class extends Im.ProvidedFilter{constructor(){super("setFilter"),this.valueModel=null,this.setFilterParams=null,this.virtualList=null,this.caseSensitive=!1,this.convertValuesToStrings=!1,this.treeDataTreeList=!1,this.groupingTreeList=!1,this.hardRefreshVirtualList=!1,this.noValueFormatterSupplied=!1,this.filterModelFormatter=new qm,this.updateSetFilterOnParamsChange=e=>{var t;this.setFilterParams=e,this.convertValuesToStrings=!!e.convertValuesToStrings,this.caseSensitive=!!e.caseSensitive;const i=null!=(t=e.keyCreator)?t:e.colDef.keyCreator;this.setValueFormatter(e.valueFormatter,i,this.convertValuesToStrings,!!e.treeList,!!e.colDef.refData);const s=e.column.getId().startsWith(Im.GROUP_AUTO_COLUMN_ID);this.treeDataTreeList=this.gos.get("treeData")&&!!e.treeList&&s,this.getDataPath=this.gos.get("getDataPath"),this.groupingTreeList=!!this.columnModel.getRowGroupColumns().length&&!!e.treeList&&s,this.createKey=this.generateCreateKey(i,this.convertValuesToStrings,this.treeDataTreeList||this.groupingTreeList)}}postConstruct(){super.postConstruct()}updateUiVisibility(){}createBodyTemplate(){return`\n            <div class="ag-set-filter">\n                <div ref="eFilterLoading" class="ag-filter-loading ag-hidden">${this.translateForSetFilter("loadingOoo")}</div>\n                <ag-input-text-field class="ag-mini-filter" ref="eMiniFilter"></ag-input-text-field>\n                <div ref="eFilterNoMatches" class="ag-filter-no-matches ag-hidden">${this.translateForSetFilter("noMatches")}</div>\n                <div ref="eSetFilterList" class="ag-set-filter-list" role="presentation"></div>\n            </div>`}handleKeyDown(e){if(super.handleKeyDown(e),!e.defaultPrevented)switch(e.key){case Im.KeyCode.SPACE:this.handleKeySpace(e);break;case Im.KeyCode.ENTER:this.handleKeyEnter(e);break;case Im.KeyCode.LEFT:this.handleKeyLeft(e);break;case Im.KeyCode.RIGHT:this.handleKeyRight(e)}}handleKeySpace(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.toggleSelected()}handleKeyEnter(e){if(!this.setFilterParams)return;const{excelMode:t,readOnly:i}=this.setFilterParams||{};t&&!i&&(e.preventDefault(),this.onBtApply(!1,!1,e),"mac"===this.setFilterParams.excelMode&&this.eMiniFilter.getInputElement().select())}handleKeyLeft(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.setExpanded(!1)}handleKeyRight(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.setExpanded(!0)}getComponentForKeyEvent(e){var t;if(!this.eSetFilterList.contains(this.gos.getActiveDomElement())||!this.virtualList)return;const i=this.virtualList.getLastFocusedRow();if(null==i)return;const s=this.virtualList.getComponentAt(i);if(null==s)return;e.preventDefault();const{readOnly:r}=null!=(t=this.setFilterParams)?t:{};return r?void 0:s}getCssIdentifier(){return"set-filter"}setModel(e){var t;return null==e&&null==(null==(t=this.valueModel)?void 0:t.getModel())?(this.setMiniFilter(null),Im.AgPromise.resolve()):super.setModel(e)}refresh(e){var t,i,s;return!!super.refresh(e)&&(!["treeList","treeListFormatter","treeListPathGetter","keyCreator","convertValuesToStrings","caseSensitive","comparator","suppressSelectAll","excelMode"].some(t=>{var i;return e[t]!==(null==(i=this.setFilterParams)?void 0:i[t])})&&!this.haveColDefParamsChanged(e.colDef)&&(super.updateParams(e),this.updateSetFilterOnParamsChange(e),this.updateMiniFilter(),e.cellRenderer===(null==(t=this.setFilterParams)?void 0:t.cellRenderer)&&e.valueFormatter===(null==(i=this.setFilterParams)?void 0:i.valueFormatter)||this.checkAndRefreshVirtualList(),null==(s=this.valueModel)||s.updateOnParamsChange(e).then(()=>{var e;(null==(e=this.valueModel)?void 0:e.hasSelections())&&this.refreshFilterValues()}),!0))}haveColDefParamsChanged(e){var t;const i=null==(t=this.setFilterParams)?void 0:t.colDef;return["keyCreator","filterValueGetter"].some(t=>e[t]!==(null==i?void 0:i[t]))}setModelAndRefresh(e){return this.valueModel?this.valueModel.setModel(e).then(()=>this.checkAndRefreshVirtualList()):Im.AgPromise.resolve()}resetUiToDefaults(){return this.setMiniFilter(null),this.setModelAndRefresh(null)}setModelIntoUi(e){this.setMiniFilter(null);const t=null==e?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getModel();return e?{values:e,filterType:this.getFilterType()}:null}getFilterType(){return"set"}getValueModel(){return this.valueModel}areModelsEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&Im._.areEqual(e.values,t.values)}setParams(e){var t;this.applyExcelModeOptions(e),super.setParams(e),this.updateSetFilterOnParamsChange(e);const i=null!=(t=e.keyCreator)?t:e.colDef.keyCreator;this.valueModel=new jm({filterParams:e,setIsLoading:e=>this.setIsLoading(e),translate:e=>this.translateForSetFilter(e),caseFormat:e=>this.caseFormat(e),createKey:this.createKey,valueFormatter:this.valueFormatter,usingComplexObjects:!!i,gos:this.gos,columnModel:this.columnModel,valueService:this.valueService,treeDataTreeList:this.treeDataTreeList,groupingTreeList:this.groupingTreeList,addManagedListener:(e,t)=>this.addManagedListener(this.eventService,e,t)}),this.initialiseFilterBodyUi(),this.addEventListenersForDataChanges()}onAddCurrentSelectionToFilterChange(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setAddCurrentSelectionToFilter(e)}setValueFormatter(e,t,i,s,r){let n=e;if(!n){if(t&&!i&&!s)throw new Error("AG Grid: Must supply a Value Formatter in Set Filter params when using a Key Creator unless convertValuesToStrings is enabled");this.noValueFormatterSupplied=!0,r||(n=e=>Im._.toStringOrNull(e.value))}this.valueFormatter=n}generateCreateKey(e,t,i){if(i&&!e)throw new Error("AG Grid: Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.");return e?(t,i=null)=>{const s=this.getKeyCreatorParams(t,i);return Im._.makeNull(e(s))}:t?e=>Array.isArray(e)?e:Im._.makeNull(Im._.toStringOrNull(e)):e=>Im._.makeNull(Im._.toStringOrNull(e))}getFormattedValue(e){var t;let i=this.valueModel.getValue(e);this.noValueFormatterSupplied&&(this.treeDataTreeList||this.groupingTreeList)&&Array.isArray(i)&&(i=Im._.last(i));const s=this.valueService.formatValue(this.setFilterParams.column,null,i,this.valueFormatter,!1);return null!=(t=null==s?Im._.toStringOrNull(i):s)?t:this.translateForSetFilter("blanks")}applyExcelModeOptions(e){"windows"===e.excelMode?(e.buttons||(e.buttons=["apply","cancel"]),null==e.closeOnApply&&(e.closeOnApply=!0)):"mac"===e.excelMode&&(e.buttons||(e.buttons=["reset"]),null==e.applyMiniFilterWhileTyping&&(e.applyMiniFilterWhileTyping=!0),null==e.debounceMs&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,Im._.warnOnce('The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.'))}addEventListenersForDataChanges(){this.isValuesTakenFromGrid()&&(this.addManagedListener(this.eventService,Im.Events.EVENT_CELL_VALUE_CHANGED,e=>{this.setFilterParams&&e.column===this.setFilterParams.column&&this.syncAfterDataChange()}),this.addManagedPropertyListeners(["treeData","getDataPath","groupAllowUnbalanced"],()=>{this.syncAfterDataChange()}))}syncAfterDataChange(){if(!this.valueModel)throw new Error("Value model has not been created.");return this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),this.onBtApply(!1,!0)})}setIsLoading(e){Im._.setDisplayed(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter()}initVirtualList(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.localeService.getLocaleTextFunc()("ariaFilterList","Filter List"),t=!!this.setFilterParams.treeList,i=this.virtualList=this.createBean(new Im.VirtualList({cssIdentifier:"filter",ariaRole:t?"tree":"listbox",listName:e})),s=this.getRefElement("eSetFilterList");t&&s.classList.add("ag-set-filter-tree-list"),s&&s.appendChild(i.getGui());const{cellHeight:r}=this.setFilterParams;let n;null!=r&&i.setRowHeight(r),i.setComponentCreator((e,i)=>this.createSetListItem(e,t,i)),i.setComponentUpdater((e,t)=>this.updateSetListItem(e,t)),n=this.setFilterParams.suppressSelectAll?new Zm(this.valueModel):new Qm(this.valueModel,()=>this.isSelectAllSelected()),t&&(n=new Jm(n)),i.setModel(n)}getSelectAllLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=null!=this.valueModel.getMiniFilter()&&this.setFilterParams.excelMode?"selectAllSearchResults":"selectAll";return this.translateForSetFilter(e)}getAddSelectionToFilterLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.translateForSetFilter("addCurrentSelectionToFilter")}createSetListItem(e,t,i){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const s=this.valueModel.hasGroups(),{isSelected:r,isExpanded:n}=this.isSelectedExpanded(e),{value:o,depth:a,isGroup:l,hasIndeterminateExpandState:c,selectedListener:h,expandedListener:d}=this.newSetListItemAttributes(e,t),u={focusWrapper:i,value:o,params:this.setFilterParams,translate:e=>this.translateForSetFilter(e),valueFormatter:this.valueFormatter,item:e,isSelected:r,isTree:t,depth:a,groupsExist:s,isGroup:l,isExpanded:n,hasIndeterminateExpandState:c},p=this.createBean(new $m(u));return p.addEventListener($m.EVENT_SELECTION_CHANGED,h),d&&p.addEventListener($m.EVENT_EXPANDED_CHANGED,d),p}newSetTreeItemAttributes(e,t){var i,s,r,n,o,a;if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const l=this.valueModel.hasGroups();return e.key===Bm.SELECT_ALL?{value:()=>this.getSelectAllLabel(),isGroup:l,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:e=>this.onSelectAll(e.isSelected),expandedListener:e=>this.onExpandAll(e.item,e.isExpanded)}:e.key===Bm.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:e=>{this.onAddCurrentSelectionToFilterChange(e.isSelected)}}:e.children?{value:null!=(r=null==(s=(i=this.setFilterParams).treeListFormatter)?void 0:s.call(i,e.treeKey,e.depth,e.parentTreeKeys))?r:e.treeKey,depth:e.depth,isGroup:!0,selectedListener:e=>this.onGroupItemSelected(e.item,e.isSelected),expandedListener:e=>this.onExpandedChanged(e.item,e.isExpanded)}:{value:null!=(a=null==(o=(n=this.setFilterParams).treeListFormatter)?void 0:o.call(n,e.treeKey,e.depth,e.parentTreeKeys))?a:e.treeKey,depth:e.depth,selectedListener:e=>this.onItemSelected(e.item.key,e.isSelected)}}newSetListItemAttributes(e,t){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e,t):e===Bm.SELECT_ALL?{value:()=>this.getSelectAllLabel(),selectedListener:e=>this.onSelectAll(e.isSelected)}:e===Bm.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:e=>{this.onAddCurrentSelectionToFilterChange(e.isSelected)}}:{value:this.valueModel.getValue(e),selectedListener:e=>this.onItemSelected(e.item,e.isSelected)}}updateSetListItem(e,t){const{isSelected:i,isExpanded:s}=this.isSelectedExpanded(e);t.refresh(e,i,s)}isSelectedExpanded(e){let t,i;return this.isSetFilterModelTreeItem(e)?(i=e.expanded,t=e.key===Bm.SELECT_ALL?this.isSelectAllSelected():e.key===Bm.ADD_SELECTION_TO_FILTER?this.valueModel.isAddCurrentSelectionToFilterChecked():e.children?this.areAllChildrenSelected(e):this.valueModel.isKeySelected(e.key)):t=e===Bm.SELECT_ALL?this.isSelectAllSelected():e===Bm.ADD_SELECTION_TO_FILTER?this.valueModel.isAddCurrentSelectionToFilterChecked():this.valueModel.isKeySelected(e),{isSelected:t,isExpanded:i}}isSetFilterModelTreeItem(e){return void 0!==(null==e?void 0:e.treeKey)}initMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e,localeService:t}=this,i=t.getLocaleTextFunc();e.setDisplayed(!this.setFilterParams.suppressMiniFilter),e.setValue(this.valueModel.getMiniFilter()),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(i("ariaSearchFilterValues","Search filter values")),this.addManagedListener(e.getInputElement(),"keydown",e=>this.onMiniFilterKeyDown(e))}updateMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e}=this;e.isDisplayed()!==!this.setFilterParams.suppressMiniFilter&&e.setDisplayed(!this.setFilterParams.suppressMiniFilter);const t=this.valueModel.getMiniFilter();e.getValue()!==t&&e.setValue(t)}afterGuiAttached(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(this.translateForSetFilter("searchOoo")),e&&e.suppressFocus||t.getFocusableElement().focus()}afterGuiDetached(){var e,t;super.afterGuiDetached(),(null==(e=this.setFilterParams)?void 0:e.excelMode)&&this.resetMiniFilter();const i=this.getModel();!(null==(t=this.setFilterParams)?void 0:t.excelMode)&&this.areModelsEqual(i,this.getModelFromUi())||(this.resetUiToActiveModel(i),this.showOrHideResults())}applyModel(e="api"){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");this.setFilterParams.excelMode&&"rowDataUpdated"!==e&&this.valueModel.isEverythingVisibleSelected()&&this.valueModel.selectAllMatchingMiniFilter();const t=this.valueModel.showAddCurrentSelectionToFilter()&&this.valueModel.isAddCurrentSelectionToFilterChecked();if(t&&!this.getModel())return!1;const i=super.applyModel(e),s=this.getModel();return s?(t||this.valueModel.setAppliedModelKeys(new Set),s.values.forEach(e=>{this.valueModel.addToAppliedModelKeys(e)})):t||this.valueModel.setAppliedModelKeys(null),i}isModelValid(e){return!this.setFilterParams||!this.setFilterParams.excelMode||null==e||e.values.length>0}doesFilterPass(e){if(!this.setFilterParams||!this.valueModel||!this.valueModel.getCaseFormattedAppliedModelKeys())return!0;if(!this.valueModel.hasAnyAppliedModelKey())return!1;const{node:t,data:i}=e;if(this.treeDataTreeList)return this.doesFilterPassForTreeData(t,i);if(this.groupingTreeList)return this.doesFilterPassForGrouping(t);let s=this.getValueFromNode(t);return this.convertValuesToStrings?this.doesFilterPassForConvertValuesToString(t,s):null!=s&&Array.isArray(s)?0===s.length?this.valueModel.hasAppliedModelKey(null):s.some(e=>this.isInAppliedModel(this.createKey(e,t))):this.isInAppliedModel(this.createKey(s,t))}doesFilterPassForConvertValuesToString(e,t){const i=this.createKey(t,e);return null!=i&&Array.isArray(i)?0===i.length?this.valueModel.hasAppliedModelKey(null):i.some(e=>this.isInAppliedModel(e)):this.isInAppliedModel(i)}doesFilterPassForTreeData(e,t){var i;return!(null==(i=e.childrenAfterGroup)?void 0:i.length)&&this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(this.getDataPath(t))))}doesFilterPassForGrouping(e){const t=this.columnModel.getRowGroupColumns().map(t=>this.valueService.getKeyForNode(t,e));return t.push(this.getValueFromNode(e)),this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(t)))}checkMakeNullDataPath(e){return e&&(e=e.map(e=>Im._.toStringOrNull(Im._.makeNull(e)))),(null==e?void 0:e.some(e=>null==e))?null:e}isInAppliedModel(e){return this.valueModel.hasAppliedModelKey(e)}getValueFromNode(e){return this.setFilterParams.getValue(e)}getKeyCreatorParams(e,t=null){return{value:e,colDef:this.setFilterParams.colDef,column:this.setFilterParams.column,node:t,data:null==t?void 0:t.data,api:this.setFilterParams.api,columnApi:this.setFilterParams.columnApi,context:this.setFilterParams.context}}onNewRowsLoaded(){this.isValuesTakenFromGrid()&&this.syncAfterDataChange()}isValuesTakenFromGrid(){return!!this.valueModel&&2===this.valueModel.getValuesType()}setFilterValues(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.overrideValues(e).then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}resetFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setValuesType(2),this.syncAfterDataChange()}refreshFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.isInitialised()&&this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}onAnyFilterChanged(){setTimeout(()=>{if(this.isAlive()){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.refreshAfterAnyFilterChanged().then(e=>{e&&(this.checkAndRefreshVirtualList(),this.showOrHideResults())})}},0)}onMiniFilterInput(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.valueModel.setMiniFilter(this.eMiniFilter.getValue()))return;const{applyMiniFilterWhileTyping:e,readOnly:t}=this.setFilterParams||{};!t&&e?this.filterOnAllVisibleValues(!1):this.updateUiAfterMiniFilterChange()}updateUiAfterMiniFilterChange(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{excelMode:e,readOnly:t}=this.setFilterParams||{};null==e||t?this.checkAndRefreshVirtualList():null==this.valueModel.getMiniFilter()?this.resetUiToActiveModel(this.getModel()):(this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged()),this.showOrHideResults()}showOrHideResults(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=null!=this.valueModel.getMiniFilter()&&this.valueModel.getDisplayedValueCount()<1;Im._.setDisplayed(this.eNoMatches,e),Im._.setDisplayed(this.eSetFilterList,!e)}resetMiniFilter(){var e;this.eMiniFilter.setValue(null,!0),null==(e=this.valueModel)||e.setMiniFilter(null)}resetUiToActiveModel(e,t){this.setModelAndRefresh(null==e?null:e.values).then(()=>{this.onUiChanged(!1,"prevent"),null==t||t()})}handleCancelEnd(e){this.setMiniFilter(null),super.handleCancelEnd(e)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:i}=this.setFilterParams||{};e.key!==Im.KeyCode.ENTER||t||i||this.filterOnAllVisibleValues()}filterOnAllVisibleValues(e=!0){const{readOnly:t}=this.setFilterParams||{};if(!this.valueModel)throw new Error("Value model has not been created.");if(t)throw new Error("Unable to filter in readOnly mode.");this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged(!1,e?"immediately":"debounce"),this.showOrHideResults()}focusRowIfAlive(e){null!=e&&window.setTimeout(()=>{if(!this.virtualList)throw new Error("Virtual list has not been created.");this.isAlive()&&this.virtualList.focusRow(e)},0)}onSelectAll(e){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");e?this.valueModel.selectAllMatchingMiniFilter():this.valueModel.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const i=e=>{e.children?e.children.forEach(e=>i(e)):this.selectItem(e.key,t)};i(e),this.refreshAfterSelection()}onItemSelected(e,t){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");this.selectItem(e,t),this.refreshAfterSelection()}selectItem(e,t){t?this.valueModel.selectKey(e):this.valueModel.deselectKey(e)}onExpandAll(e,t){const i=e=>{e.filterPasses&&e.available&&e.children&&(e.children.forEach(e=>i(e)),e.expanded=t)};i(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.valueModel.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e){this.eMiniFilter.setValue(e),this.onMiniFilterInput()}getMiniFilter(){return this.valueModel?this.valueModel.getMiniFilter():null}checkAndRefreshVirtualList(){if(!this.virtualList)throw new Error("Virtual list has not been created.");this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return this.valueModel?this.valueModel.getKeys():[]}getFilterValues(){return this.valueModel?this.valueModel.getValues():[]}getValues(){return this.getFilterKeys()}refreshVirtualList(){this.setFilterParams&&this.setFilterParams.refreshValuesOnOpen?this.refreshFilterValues():this.checkAndRefreshVirtualList()}translateForSetFilter(e){return this.localeService.getLocaleTextFunc()(e,Ym[e])}isSelectAllSelected(){if(!this.setFilterParams||!this.valueModel)return!1;if(this.setFilterParams.defaultToNothingSelected){if(this.valueModel.hasSelections()&&this.valueModel.isEverythingVisibleSelected())return!0;if(this.valueModel.isNothingVisibleSelected())return!1}else{if(this.valueModel.hasSelections()&&this.valueModel.isNothingVisibleSelected())return!1;if(this.valueModel.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=e=>{if(e.children){let i=!1,s=!1;return e.children.some(e=>{if(!e.filterPasses||!e.available)return!1;const r=t(e);return void 0===r||(r?i=!0:s=!0,i&&s)})?void 0:i}return this.valueModel.isKeySelected(e.key)};return this.setFilterParams.defaultToNothingSelected?this.valueModel.hasSelections()&&t(e):t(e)}destroy(){null!=this.virtualList&&(this.virtualList.destroy(),this.virtualList=null),super.destroy()}caseFormat(e){return null==e||"string"!=typeof e||this.caseSensitive?e:e.toUpperCase()}resetExpansion(){var e,t;if(!(null==(e=this.setFilterParams)?void 0:e.treeList))return;const i=null==(t=this.valueModel)?void 0:t.getSelectAllItem();if(this.isSetFilterModelTreeItem(i)){const e=t=>{t.children&&(t.children.forEach(t=>e(t)),t.expanded=!1)};e(i),this.valueModel.updateDisplayedValues("expansion")}}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e,this)}getPositionableElement(){return this.eSetFilterList}};Fm([(0,Im.RefSelector)("eMiniFilter")],Xm.prototype,"eMiniFilter",2),Fm([(0,Im.RefSelector)("eFilterLoading")],Xm.prototype,"eFilterLoading",2),Fm([(0,Im.RefSelector)("eSetFilterList")],Xm.prototype,"eSetFilterList",2),Fm([(0,Im.RefSelector)("eFilterNoMatches")],Xm.prototype,"eNoMatches",2),Fm([(0,Im.Autowired)("columnModel")],Xm.prototype,"columnModel",2),Fm([(0,Im.Autowired)("valueService")],Xm.prototype,"valueService",2);var Zm=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},Qm=class{constructor(e,t){this.model=e,this.isSelectAllSelected=t}getRowCount(){const e=this.model.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+e}getRow(e){if(0===e)return this.model.getSelectAllItem();const t=this.model.showAddCurrentSelectionToFilter(),i=t?2:1;return 1===e&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-i)}areRowsEqual(e,t){return e===t}},Jm=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&e.treeKey===t.treeKey&&e.depth===t.depth}},ef=class extends Nm.Component{constructor(){super('\n            <div class="ag-floating-filter-input ag-set-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>'),this.availableValuesListenerAdded=!1,this.filterModelFormatter=new qm}destroy(){super.destroy()}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof Xm))throw new Error("AG Grid - SetFloatingFilter expects SetFilter as its parent");e(t)})}addAvailableValuesListener(){this.parentSetFilterInstance(e=>{const t=e.getValueModel();t&&this.addManagedListener(t,jm.EVENT_AVAILABLE_VALUES_CHANGED,()=>this.updateFloatingFilterText())}),this.availableValuesListenerAdded=!0}updateFloatingFilterText(e){this.availableValuesListenerAdded||this.addAvailableValuesListener(),this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(this.filterModelFormatter.getModelAsString(e,t))})}};Fm([(0,Nm.RefSelector)("eFloatingFilterText")],ef.prototype,"eFloatingFilterText",2),Fm([(0,Nm.Autowired)("columnModel")],ef.prototype,"columnModel",2);var tf={version:"31.3.4",moduleName:Dm.ModuleNames.SetFilterModule,beans:[],userComponents:[{componentName:"agSetColumnFilter",componentClass:Xm},{componentName:"agSetColumnFloatingFilter",componentClass:ef}],dependantModules:[D]},sf=i(98092),rf=i(98092),nf=i(21371),of=i(21371),af=i(21371),lf=i(21371),cf=i(21371),hf=i(21371),df=i(21371),uf=i(21371),pf=i(98092),gf=Object.defineProperty,mf=Object.getOwnPropertyDescriptor,ff=Object.getOwnPropertySymbols,yf=Object.prototype.hasOwnProperty,vf=Object.prototype.propertyIsEnumerable,Cf=(e,t,i)=>t in e?gf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,bf=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?mf(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&gf(t,i,n),n},{extent:Sf,isNumber:wf,isString:xf,isStringObject:Ef,isDate:Mf,createId:Af,Padding:Tf}=of._Util,{LinearScale:Df,BandScale:If,TimeScale:Rf}=of._Scale,Pf=class{constructor(){this.type="category",this.stroke="rgb(204, 214, 235)",this.strokeWidth=1}},kf=class e{constructor(){this.id=Af(this),this.seriesRect={x:0,y:0,width:0,height:0},this._context=void 0,this._container=void 0,this._data=void 0,this.padding=new Tf(3),this.xKey="x",this.yKey="y",this.dataType=void 0,this.xData=[],this.yData=[],this.min=void 0,this.max=void 0,this.yScale=new Df,this.axis=new Pf,this.highlightStyle={size:6,fill:"yellow",stroke:"silver",strokeWidth:1},this._width=100,this._height=100,this.smallestInterval=void 0,this.layoutId=0,this.defaultDateFormatter=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseOut=this.onMouseOut.bind(this);const t=new of._Scene.Group;this.rootGroup=t;const i=document.createElement("div");i.setAttribute("class","ag-sparkline-wrapper");const s=new of._Scene.Scene({});this.scene=s,this.canvasElement=s.canvas.element,s.setRoot(t),s.setContainer(i),this.resizeAndSetDimensions(this.width,this.height),e.tooltipDocuments.includes(document)||this.initialiseTooltipStyles(),this.setupDomEventListeners(this.canvasElement)}set context(e){this._context!==e&&(this._context=e)}get context(){return this._context}set container(e){if(this._container!==e){const{parentNode:t}=this.canvasElement;null!=t&&t.removeChild(this.canvasElement),e&&e.appendChild(this.canvasElement),this._container=e}}get container(){return this._container}set data(e){this._data!==e&&(this._data=e,this.processData(),this.mouseMoveEvent&&this.highlightedDatum&&this.updateHitPoint(this.mouseMoveEvent))}get data(){return this._data}resizeAndSetDimensions(e,t){this.scene.resize(e,t),this.seriesRect.width=e,this.seriesRect.height=t}initialiseTooltipStyles(){const t=document.createElement("style");t.innerHTML="\n.ag-sparkline-tooltip-wrapper {\n    position: absolute;\n    user-select: none;\n    pointer-events: none;\n}\n\n.ag-sparkline-tooltip {\n    position: relative;\n    font: 12px arial,sans-serif;\n    border-radius: 2px;\n    box-shadow: 0 1px 3px rgb(0 0 0 / 20%), 0 1px 1px rgb(0 0 0 / 14%);\n    line-height: 1.7em;\n    overflow: hidden;\n    white-space: nowrap;\n    z-index: 99999;\n    background-color: rgb(255, 255, 255);\n    color: rgba(0,0,0, 0.67);\n}\n\n.ag-sparkline-tooltip-content {\n    padding: 0 7px;\n    opacity: 1;\n}\n\n.ag-sparkline-tooltip-title {\n    padding-left: 7px;\n    opacity: 1;\n}\n\n.ag-sparkline-tooltip-wrapper-hidden {\n    top: -10000px !important;\n}\n\n.ag-sparkline-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n",document.head.insertBefore(t,document.head.querySelector("style")),e.tooltipDocuments.push(document)}set width(e){this._width!==e&&(this._width=e,this.scene.resize(e,this.height),this.scheduleLayout())}get width(){return this._width}set height(e){this._height!==e&&(this._height=e,this.scene.resize(this.width,e),this.scheduleLayout())}get height(){return this._height}update(){}updateYScale(){this.updateYScaleRange(),this.updateYScaleDomain()}updateYScaleDomain(){}updateYScaleRange(){const{yScale:e,seriesRect:t}=this;e.range=[t.height,0]}updateXScale(){const{type:e}=this.axis;this.xScale=this.getXScale(e),this.updateXScaleRange(),this.updateXScaleDomain()}updateXScaleRange(){this.xScale.range=[0,this.seriesRect.width]}updateXScaleDomain(){const{xData:e,xScale:t}=this;let i;(t instanceof Df||t instanceof Rf)&&(i=Sf(e)),this.xScale.domain=i?i.slice():e}getXScale(e="category"){switch(e){case"number":return new Df;case"time":return new Rf;default:return new If}}updateAxisLine(){}updateAxes(){this.updateYScale(),this.updateXScale(),this.updateAxisLine()}updateCrosshairs(){this.updateXCrosshairLine(),this.updateYCrosshairLine()}generateNodeData(){return[]}getNodeData(){return[]}updateNodes(){}updateXCrosshairLine(){}updateYCrosshairLine(){}highlightDatum(e){this.updateNodes()}dehighlightDatum(){this.highlightedDatum=void 0,this.updateNodes(),this.updateCrosshairs()}onMouseMove(e){this.mouseMoveEvent=e,this.updateHitPoint(e)}updateHitPoint(e){var t,i,s;const r=this.pickClosestSeriesNodeDatum(e.offsetX,e.offsetY);if(!r)return;const n=this.highlightedDatum;this.highlightedDatum=r,(this.highlightedDatum&&!n||this.highlightedDatum&&n&&this.highlightedDatum!==n)&&(this.highlightDatum(r),this.updateCrosshairs(),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e))),(null==(s=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.enabled)||s)&&this.handleTooltip(e,r)}onMouseOut(e){this.dehighlightDatum(),this.tooltip.toggle(!1),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e))}processData(){const{data:e,yData:t,xData:i}=this;if(!e||this.invalidData(this.data))return;t.length=0,i.length=0;const s=e.length,r=this.getDataType(e);this.dataType=r;const{type:n}=this.axis,o="number"!==n&&"time"!==n?"category":n,a="number"===o||"time"===o,l=(e,t)=>{null==this.smallestInterval&&(this.smallestInterval={x:1/0,y:1/0});const{x:i}=this.smallestInterval,s=Math.abs(e-t);s>0&&s<i&&(this.smallestInterval.x=s)};let c;if("number"===r)for(let r=0;r<s;r++){const s=r,n=e[r],h=this.getDatum(s,o),d=this.getDatum(n,"number");a&&l(h,c),i.push(h),t.push(d),c=h}else if("array"===r)for(let r=0;r<s;r++){const s=e[r];if(Array.isArray(s)){const e=s[0],r=s[1],n=this.getDatum(e,o),h=this.getDatum(r,"number");if(null==n)continue;a&&l(n,c),i.push(n),t.push(h),c=n}}else if("object"===r){const{yKey:r,xKey:n}=this;for(let h=0;h<s;h++){const s=e[h];if("object"==typeof s&&!Array.isArray(s)){const e=s[n],h=s[r],d=this.getDatum(e,o),u=this.getDatum(h,"number");if(null==d)continue;a&&l(d,c),i.push(d),t.push(u),c=d}}}this.updateAxes(),this.immediateLayout()}getDataType(e){for(const t of e)if(null!=t){if(wf(t))return"number";if(Array.isArray(t))return"array";if("object"==typeof t)return"object"}}getDatum(e,t){if("number"===t&&wf(e)||"time"===t&&(wf(e)||Mf(e)))return e;if("category"===t){if(xf(e)||Mf(e)||wf(e))return{toString:()=>String(e)};if(Ef(e))return e}}get layoutScheduled(){return!!this.layoutId}scheduleLayout(){this.layoutId&&cancelAnimationFrame(this.layoutId),this.layoutId=requestAnimationFrame(()=>{this.immediateLayout(),this.layoutId=0})}immediateLayout(){this.setSparklineDimensions(),this.invalidData(this.data)||(this.updateXScaleRange(),this.updateYScaleRange(),this.updateAxisLine(),this.update(),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e)))}setSparklineDimensions(){const{width:e,height:t,padding:i,seriesRect:s,rootGroup:r}=this,n=e-i.left-i.right,o=t-i.top-i.bottom;s.width=n,s.height=o,s.x=i.left,s.y=i.top,r.translationX=s.x,r.translationY=s.y}pickClosestSeriesNodeDatum(e,t){let i,s=1/0;const r=this.rootGroup.transformPoint(e,t),n=this.getNodeData();for(let e=0;e<n.length;e++){const t=n[e];if(!t.point)return;const o=this.getDistance(r,t.point);o<=s&&(s=o,i=t)}return i}getDistance(e,t){return Math.abs(e.x-t.x)}handleTooltip(e,t){var i,s;const{seriesDatum:r}=t,{canvasElement:n}=this,{clientX:o,clientY:a}=e,l=null==(i=this.processedOptions)?void 0:i.tooltip,c={pageX:o,pageY:a,position:{xOffset:null==l?void 0:l.xOffset,yOffset:null==l?void 0:l.yOffset},container:null==l?void 0:l.container};null==c.container&&(c.container=n);const h=r.y,d=r.x;let u=null==(s=null==l?void 0:l.enabled)||s;const p=null==l?void 0:l.renderer;if(p){const e=p({context:this.context,datum:r,yValue:h,xValue:d});u="string"!=typeof e&&void 0!==e.enabled?e.enabled:u}const g=u&&void 0!==r.y&&this.getTooltipHtml(t);g&&this.tooltip.show(c,g)}formatNumericDatum(e){return String(Math.round(10*e)/10)}formatDatum(e){const t=this.axis.type||"category";return"number"===t&&"number"==typeof e?this.formatNumericDatum(e):"time"===t&&(e instanceof Date||wf(e))?this.defaultDateFormatter.format(e):String(e)}setupDomEventListeners(e){e.addEventListener("mousemove",this._onMouseMove),e.addEventListener("mouseout",this._onMouseOut)}cleanupDomEventListeners(e){e.removeEventListener("mousemove",this._onMouseMove),e.removeEventListener("mouseout",this._onMouseOut)}invalidData(e){return!e||!Array.isArray(e)}destroy(){this.cleanupDomEventListeners(this.canvasElement),this.scene.destroy(),this.container=void 0}};kf.tooltipDocuments=[];var Lf=kf;function Nf(e,t){var i,s,r;if("string"==typeof e)return e;t=null!=t?t:{};const{content:n=(null!=(i=t.content)?i:""),title:o=(null!=(s=t.title)?s:void 0),color:a=t.color,backgroundColor:l=t.backgroundColor,opacity:c=(null!=(r=t.opacity)?r:1)}=e;let h,d;a?(h=o?`<span class="${Of.class}-title"; style="color: ${a}">${o}</span>`:"",d=`<span class="${Of.class}-content" style="color: ${a}">${n}</span>`):(h=o?`<span class="${Of.class}-title">${o}</span>`:"",d=`<span class="${Of.class}-content">${n}</span>`);let u=`opacity: ${c}`;return l&&(u+=`; background-color: ${l.toLowerCase()}`),`<div class="${Of.class}" style="${u}">\n                ${h}\n                ${d}\n            </div>`}var _f=class e{constructor(){this.element=document.createElement("div"),document.body.appendChild(this.element)}isVisible(){const{element:t}=this;if(t.classList)return!t.classList.contains(`${e.class}-wrapper-hidden`);const i=t.getAttribute("class");return!!i&&i.split(" ").indexOf(`${e.class}-wrapper-hidden`)<0}updateClass(t){const i=[`${e.class}-wrapper`];!0!==t&&i.push(`${e.class}-wrapper-hidden`),this.element.setAttribute("class",i.join(" "))}show(e,t){var i,s,r,n;this.toggle(!1);const{element:o}=this;if(void 0!==t)o.innerHTML=t;else if(!o.innerHTML)return;const a=null!=(s=null==(i=e.position)?void 0:i.xOffset)?s:10,l=null!=(n=null==(r=e.position)?void 0:r.yOffset)?n:0;let c=e.pageX+a,h=e.pageY+l;const d=o.getBoundingClientRect();let u=window.innerWidth-d.width;if(e.container){const t=e.container.getBoundingClientRect();u=t.left+(t.width-d.width)}c>u&&(c=e.pageX-o.clientWidth-a),"undefined"!=typeof scrollX&&(c+=scrollX),"undefined"!=typeof scrollY&&(h+=scrollY),o.style.left=`${Math.round(c)}px`,o.style.top=`${Math.round(h)}px`,this.toggle(!0)}toggle(e){this.updateClass(e)}destroy(){const{parentNode:e}=this.element;e&&e.removeChild(this.element)}};_f.class="ag-sparkline-tooltip";var Of=_f;function Ff(e){switch(e){case"circle":default:return af._Scene.Circle;case"square":return af._Scene.Square;case"diamond":return af._Scene.Diamond}}function Gf(e,t="solid"){const i={solid:[],dash:[4,3],dot:[1,3],dashDot:[4,3,1,3],dashDotDot:[4,3,1,3,1,3],shortDot:[1,1],shortDash:[3,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],longDash:[8,3],longDashDot:[8,3,1,3],longDashDotDot:[8,3,1,3,1,3]},s={solid:[],dash:[3,3],dot:[0,3],dashDot:[3,3,0,3],dashDotDot:[3,3,0,3,0,3],shortDot:[0,2],shortDash:[2,2],shortDashDot:[2,2,0,2],shortDashDotDot:[2,2,0,2,0,2],longDash:[7,3],longDashDot:[7,3,0,3],longDashDotDot:[7,3,0,3,0,3]};return"round"===e||"square"===e?null==s[t]?(console.warn(`'${t}' is not a valid 'lineDash' option.`),s.solid):s[t]:null==i[t]?(console.warn(`'${t}' is not a valid 'lineDash' option.`),i.solid):i[t]}var{extent:Bf}=nf._Util,{BandScale:Vf}=nf._Scale,Hf=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},Uf=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},zf=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},Wf=class extends Lf{constructor(){super(),this.fill="rgba(124, 181, 236, 0.25)",this.strokePath=new nf._Scene.Path,this.fillPath=new nf._Scene.Path,this.xCrosshairLine=new nf._Scene.Line,this.yCrosshairLine=new nf._Scene.Line,this.areaSparklineGroup=new nf._Scene.Group,this.xAxisLine=new nf._Scene.Line,this.markers=new nf._Scene.Group,this.markerSelection=nf._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new Hf,this.line=new Uf,this.crosshairs=new zf,this.rootGroup.append(this.areaSparklineGroup),this.xAxisLine.zIndex=500,this.fillPath.zIndex=50,this.strokePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.areaSparklineGroup.append([this.fillPath,this.xAxisLine,this.strokePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}markerFactory(){const{shape:e}=this.marker;return new(Ff(e))}getNodeData(){return this.markerSelectionData}update(){const e=this.generateNodeData();if(!e)return;const{nodeData:t,fillData:i,strokeData:s}=e;this.markerSelectionData=t,this.updateSelection(t),this.updateNodes(),this.updateStroke(s),this.updateFill(i)}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=Bf(e);let s=0,r=1;void 0!==i&&(s=this.min=i[0],r=this.max=i[1]),s=s<0?s:0,r=r<0?0:r,t.domain=[s,r]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r}=this;if(!e)return;const n=!(s instanceof Vf),o=n?0:s.bandwidth/2,a=t.length,l=[],c=[],h=[];let d,u,p,g;const m=r.convert(0);for(let e=0;e<a;e++){const f=t[e],y=i[e],v=s.convert(n?s.toDomain(y):y)+o,C=void 0===f?NaN:r.convert(f);e+1<a&&(g=s.convert(n?s.toDomain(i[e+1]):i[e+1])+o),h.push({seriesDatum:{x:y,y:f},point:{x:v,y:C}}),void 0===f&&void 0!==p?(c.push({seriesDatum:void 0,point:{x:p,y:m}}),void 0!==g&&c.push({seriesDatum:void 0,point:{x:g,y:m}})):void 0!==f&&(c.push({seriesDatum:{x:y,y:f},point:{x:v,y:C}}),l.push({seriesDatum:{x:y,y:f},point:{x:v,y:C}}),d=void 0!==d?d:v,u=v),p=v}return c.push({seriesDatum:void 0,point:{x:u,y:m}},{seriesDatum:void 0,point:{x:d,y:m}}),{nodeData:l,fillData:c,strokeData:h}}updateAxisLine(){const{xScale:e,yScale:t,axis:i,xAxisLine:s}=this;s.x1=e.range[0],s.x2=e.range[1],s.y1=s.y2=0,s.stroke=i.stroke,s.strokeWidth=i.strokeWidth;const r=t.convert(0);s.translationY=r}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:s,fill:r,stroke:n,strokeWidth:o}=t,a=i.formatter;this.markerSelection.each((t,l,c)=>{const{point:h,seriesDatum:d}=l;if(!h)return;const u=l===e,p=u&&void 0!==r?r:i.fill,g=u&&void 0!==n?n:i.stroke,m=u&&void 0!==o?o:i.strokeWidth,f=u&&void 0!==s?s:i.size;let y;if(a){const e=0===c,t=c===this.markerSelectionData.length-1,i=d.y===this.min,s=d.y===this.max;y=a({datum:l,xValue:d.x,yValue:d.y,min:i,max:s,first:e,last:t,fill:p,stroke:g,strokeWidth:m,size:f,highlighted:u})}t.size=y&&null!=y.size?y.size:f,t.fill=y&&null!=y.fill?y.fill:p,t.stroke=y&&null!=y.stroke?y.stroke:g,t.strokeWidth=y&&null!=y.strokeWidth?y.strokeWidth:m,t.translationX=h.x,t.translationY=h.y,t.visible=y&&null!=y.enabled?y.enabled:i.enabled&&t.size>0})}updateStroke(e){const{strokePath:t,yData:i,line:s}=this,r=t.path;if(r.clear(),i.length<2)return;const n=e.length;let o=!0;for(let t=0;t<n;t++){const{point:i,seriesDatum:s}=e[t],n=i.x,a=i.y;null==s.y?o=!0:o?(r.moveTo(n,a),o=!1):r.lineTo(n,a)}t.lineJoin=t.lineCap="round",t.fill=void 0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth}updateFill(e){const{fillPath:t,yData:i,fill:s}=this,r=t.path,n=e.length;if(r.clear(),!(i.length<2)){for(let t=0;t<n;t++){const{point:i}=e[t],s=i.x,n=i.y;t>0?r.lineTo(s,n):r.moveTo(s,n)}r.closePath(),t.lineJoin="round",t.stroke=void 0,t.fill=s}}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:s,crosshairs:{xLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:Gf(i.lineCap,r.lineDash),i.translationX=s.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:s,crosshairs:{yLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:Gf(i.lineCap,r.lineDash),i.translationY=s.point.y}getTooltipHtml(e){var t,i;const{dataType:s}=this,{seriesDatum:r}=e,n=r.y,o=r.x,a={content:this.formatNumericDatum(n),title:"array"===s||"object"===s?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?Nf(l({context:this.context,datum:r,yValue:n,xValue:o}),a):Nf(a)}};Wf.className="AreaSparkline";var{extent:jf}=lf._Util,{BandScale:Kf}=lf._Scale,$f=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},Yf=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},qf=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},Xf=class extends Lf{constructor(){super(),this.linePath=new lf._Scene.Path,this.xCrosshairLine=new lf._Scene.Line,this.yCrosshairLine=new lf._Scene.Line,this.lineSparklineGroup=new lf._Scene.Group,this.markers=new lf._Scene.Group,this.markerSelection=lf._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new $f,this.line=new Yf,this.crosshairs=new qf,this.rootGroup.append(this.lineSparklineGroup),this.linePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.lineSparklineGroup.append([this.linePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}getNodeData(){return this.markerSelectionData}markerFactory(){const{shape:e}=this.marker;return new(Ff(e))}onMarkerShapeChange(){this.markerSelection=this.markerSelection.clear(),this.scheduleLayout()}update(){const e=this.generateNodeData();e&&(this.markerSelectionData=e,this.updateSelection(e),this.updateNodes(),this.updateLine())}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=jf(e);let s=0,r=1;if(void 0!==i&&(s=this.min=i[0],r=this.max=i[1]),s===r){const e=Math.abs(.01*s);s-=e,r+=e}t.domain=[s,r]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r}=this;if(!e)return;const n=!(s instanceof Kf),o=n?0:s.bandwidth/2,a=[];for(let e=0;e<t.length;e++){const l=t[e],c=i[e];if(null==l)continue;const h=s.convert(n?s.toDomain(c):c)+o,d=void 0===l?NaN:r.convert(l);a.push({seriesDatum:{x:c,y:l},point:{x:h,y:d}})}return a}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:s,fill:r,stroke:n,strokeWidth:o}=t,a=i.formatter;this.markerSelection.each((t,l,c)=>{const h=l===e,d=h&&void 0!==r?r:i.fill,u=h&&void 0!==n?n:i.stroke,p=h&&void 0!==o?o:i.strokeWidth,g=h&&void 0!==s?s:i.size;let m;const{seriesDatum:f,point:y}=l;if(a){const e=0===c,t=c===this.markerSelectionData.length-1,i=f.y===this.min,s=f.y===this.max;m=a({datum:l,xValue:f.x,yValue:f.y,min:i,max:s,first:e,last:t,fill:d,stroke:u,strokeWidth:p,size:g,highlighted:h})}t.size=m&&null!=m.size?m.size:g,t.fill=m&&null!=m.fill?m.fill:d,t.stroke=m&&null!=m.stroke?m.stroke:u,t.strokeWidth=m&&null!=m.strokeWidth?m.strokeWidth:p,t.translationX=y.x,t.translationY=y.y,t.visible=m&&null!=m.enabled?m.enabled:i.enabled&&t.size>0})}updateLine(){const{linePath:e,yData:t,xData:i,xScale:s,yScale:r,line:n}=this,o=e.path;if(o.clear(),t.length<2)return;const a=!(s instanceof Kf),l=t.length,c=a?0:s.bandwidth/2;let h=!0;for(let e=0;e<l;e++){const n=i[e],l=t[e],d=s.convert(a?s.toDomain(n):n)+c,u=void 0===l?NaN:r.convert(l);null==l?h=!0:h?(o.moveTo(d,u),h=!1):o.lineTo(d,u)}e.fill=void 0,e.stroke=n.stroke,e.strokeWidth=n.strokeWidth}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:s,crosshairs:{xLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:Gf(i.lineCap,r.lineDash),i.translationX=s.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:s,crosshairs:{yLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:Gf(i.lineCap,r.lineDash),i.translationY=s.point.y}getTooltipHtml(e){var t,i;const{dataType:s}=this,{seriesDatum:r}=e,n=r.y,o=r.x,a={content:this.formatNumericDatum(n),title:"array"===s||"object"===s?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?Nf(l({context:this.context,datum:r,yValue:n,xValue:o}),a):Nf(a)}};Xf.className="LineSparkline";var Zf=class{constructor(){this.enabled=!0,this.fontSize=8,this.fontFamily="Verdana, sans-serif",this.fontStyle=void 0,this.fontWeight=void 0,this.color="rgba(70, 70, 70, 1)"}},{extent:Qf}=hf._Util,Jf=class extends Zf{constructor(){super(...arguments),this.formatter=void 0,this.placement="insideEnd"}},ey=class extends Lf{constructor(){super(),this.fill="rgb(124, 181, 236)",this.stroke="silver",this.strokeWidth=0,this.paddingInner=.1,this.paddingOuter=.2,this.valueAxisDomain=void 0,this.formatter=void 0,this.axisLine=new hf._Scene.Line,this.bandWidth=0,this.sparklineGroup=new hf._Scene.Group,this.rectGroup=new hf._Scene.Group,this.labelGroup=new hf._Scene.Group,this.rectSelection=hf._Scene.Selection.select(this.rectGroup,hf._Scene.Rect),this.labelSelection=hf._Scene.Selection.select(this.labelGroup,hf._Scene.Text),this.nodeSelectionData=[],this.label=new Jf,this.rootGroup.append(this.sparklineGroup),this.rectGroup.zIndex=50,this.axisLine.zIndex=500,this.labelGroup.zIndex=1500,this.sparklineGroup.append([this.rectGroup,this.axisLine,this.labelGroup]),this.axisLine.lineCap="round",this.label.enabled=!1}getNodeData(){return this.nodeSelectionData}update(){this.updateSelections(),this.updateNodes()}updateSelections(){const e=this.generateNodeData();e&&(this.nodeSelectionData=e,this.updateRectSelection(e),this.updateLabelSelection(e))}updateNodes(){this.updateRectNodes(),this.updateLabelNodes()}calculateStep(e){var t;const{xScale:i,paddingInner:s,paddingOuter:r,smallestInterval:n}=this;let o=(i.domain[1]-i.domain[0])/(null!=(t=null==n?void 0:n.x)?t:1)+1;const a=Math.min(o,50),l=a-1;return e/Math.max(1,2*r+l*s+a)}updateYScaleDomain(){const{yScale:e,yData:t,valueAxisDomain:i}=this,s=Qf(t);let r=0,n=1;void 0!==s&&(r=this.min=s[0],n=this.max=s[1]),r=r<0?r:0,n=n<0?0:n,i&&(i[1]<n&&(i[1]=n),i[0]>r&&(i[0]=r)),e.domain=i||[r,n]}updateRectSelection(e){this.rectSelection.update(e)}updateRectNodes(){const{highlightedDatum:e,formatter:t,fill:i,stroke:s,strokeWidth:r}=this,{fill:n,stroke:o,strokeWidth:a}=this.highlightStyle;this.rectSelection.each((l,c,h)=>{const d=c===e,u=d&&void 0!==n?n:i,p=d&&void 0!==o?o:s,g=d&&void 0!==a?a:r;let m;const{x:f,y,width:v,height:C,seriesDatum:b}=c;if(t){const e=0===h,i=h===this.nodeSelectionData.length-1,s=b.y===this.min,r=b.y===this.max;m=t({datum:c,xValue:b.x,yValue:b.y,width:v,height:C,min:s,max:r,first:e,last:i,fill:u,stroke:p,strokeWidth:g,highlighted:d})}l.fill=m&&m.fill||u,l.stroke=m&&m.stroke||p,l.strokeWidth=m&&m.strokeWidth||g,l.x=l.y=0,l.width=v,l.height=C,l.visible=l.height>0,l.translationX=f,l.translationY=y})}updateLabelSelection(e){this.labelSelection.update(e,e=>{e.tag=1,e.pointerEvents=hf._Scene.PointerEvents.None})}updateLabelNodes(){const{label:{enabled:e,fontStyle:t,fontWeight:i,fontSize:s,fontFamily:r,color:n}}=this;this.labelSelection.each((o,a)=>{const l=a.label;l&&e?(o.fontStyle=t,o.fontWeight=i,o.fontSize=s,o.fontFamily=r,o.textAlign=l.textAlign,o.textBaseline=l.textBaseline,o.text=l.text,o.x=l.x,o.y=l.y,o.fill=n,o.visible=!0):o.visible=!1})}getTooltipHtml(e){var t,i;const{dataType:s}=this,{seriesDatum:r}=e,n=r.y,o=r.x,a={content:this.formatNumericDatum(n),title:"array"===s||"object"===s?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?Nf(l({context:this.context,datum:r,yValue:n,xValue:o}),a):Nf(a)}formatLabelValue(e){return e%1!=0?e.toFixed(1):e.toFixed(0)}},{isNumber:ty}=cf._Util,{BandScale:iy}=cf._Scale,sy=class extends ey{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[0,e.width]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:s}=this;if(e instanceof iy)e.range=[0,t.height],e.paddingInner=s,e.paddingOuter=i;else{const r=this.calculateStep(t.height),n=r*i;this.bandWidth=r*(1-s),e.range=[n,t.height-n-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:s}=this,{strokeWidth:r}=t;i.x1=0,i.x2=0,i.y1=0,i.y2=s.height,i.stroke=t.stroke,i.strokeWidth=r+(r%2==1?1:0);const n=e.convert(0);i.translationX=n}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r,fill:n,stroke:o,strokeWidth:a,label:l}=this;if(!e)return;const{fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,color:p,formatter:g,placement:m}=l,f=[],y=r.convert(0),v=!(s instanceof iy);for(let e=0,l=t.length;e<l;e++){let l=t[e];const C=i[e],b=void 0===l;b&&(l=0);const S=s.convert(v?s.toDomain(C):C),w=Math.min(void 0===l?NaN:r.convert(l),y),x=Math.max(void 0===l?NaN:r.convert(l),y),E=v?this.bandWidth:s.bandwidth,M=x-w,A={x:y,y:S};let T;T=g?g({value:l}):void 0!==l&&ty(l)?this.formatLabelValue(l):"";const D=S+E/2;let I;const R="middle";let P;const k=void 0!==l&&l>=0,L=4;if("center"===m)I=w+M/2,P="center";else if("outsideEnd"===m)I=w+(k?M+L:-L),P=k?"start":"end";else if("insideEnd"===m){I=w+(k?M-L:L),P=k?"end":"start";const e=cf._Scene.Text.getTextSize(T,u).width||20;(k&&I<y+e||!k&&I>y-e)&&(I=y+L*(k?1:-1),P=k?"start":"end")}else I=y+L*(k?1:-1),P=k?"start":"end";f.push({x:w,y:S,width:M,height:E,fill:n,stroke:o,strokeWidth:a,seriesDatum:{x:C,y:b?void 0:l},point:A,label:{x:I,y:D,text:T,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:P,textBaseline:R,fill:p}})}return f}getDistance(e,t){return Math.abs(e.y-t.y)}};sy.className="BarSparkline";var{isNumber:ry}=df._Util,{BandScale:ny}=df._Scale,oy=class extends ey{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[e.height,0]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:s}=this;if(e instanceof ny)e.range=[0,t.width],e.paddingInner=s,e.paddingOuter=i;else{const r=this.calculateStep(t.width),n=r*i;this.bandWidth=r*(1-s),e.range=[n,t.width-n-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:s}=this,{strokeWidth:r}=t;i.x1=0,i.x2=s.width,i.y1=0,i.y2=0,i.stroke=t.stroke,i.strokeWidth=r+(r%2==1?1:0);const n=e.convert(0);i.translationY=n}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r,fill:n,stroke:o,strokeWidth:a,label:l}=this;if(!e)return;const{fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,color:p,formatter:g,placement:m}=l,f=[],y=r.convert(0),v=!(s instanceof ny);for(let e=0,l=t.length;e<l;e++){let l=t[e];const C=i[e],b=void 0===l;b&&(l=0);const S=Math.min(void 0===l?NaN:r.convert(l),y),w=s.convert(v?s.toDomain(C):C),x=Math.max(void 0===l?NaN:r.convert(l),y),E=v?this.bandWidth:s.bandwidth,M=x-S,A={x:w+E/2,y};let T;T=g?g({value:l}):void 0!==l&&ry(l)?this.formatLabelValue(l):"";const D=w+E/2;let I;const R="center";let P;const k=void 0!==l&&l>=0,L=2;if("center"===m)I=S+M/2,P="middle";else if("outsideEnd"===m)I=S+(k?-L:M+L),P=k?"bottom":"top";else if("insideEnd"===m){I=S+(k?L:M-L),P=k?"top":"bottom";const e=df._Scene.Text.getTextSize(T,u).height||10;(k&&I>y-e||!k&&I<y+e)&&(I=y+L*(k?-1:1),P=k?"bottom":"top")}else I=y+L*(k?-1:1),P=k?"bottom":"top";f.push({x:w,y:S,width:E,height:M,fill:n,stroke:o,strokeWidth:a,seriesDatum:{x:C,y:b?void 0:l},point:A,label:{x:D,y:I,text:T,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:R,textBaseline:P,fill:p}})}return f}};oy.className="ColumnSparkline";var{isNumber:ay}=uf._Util,ly=class{static create(e,t){const i=function(e="line"){switch(e){case"column":return new oy;case"bar":return new sy;case"area":return new Wf;default:return new Xf}}((e=uf._Util.deepClone(e)).type);return t&&(i.tooltip=t),function(e,t){fy(e,"context",t.context,t),fy(e,"width",t.width,t),fy(e,"height",t.height,t),fy(e,"container",t.container,t),fy(e,"xKey",t.xKey,t),fy(e,"yKey",t.yKey,t),t.padding&&function(e,t){fy(e,"top",t.top,t),fy(e,"right",t.right,t),fy(e,"bottom",t.bottom,t),fy(e,"left",t.left,t)}(e.padding,t.padding),t.axis&&function(e,t){fy(e,"type",t.type,t),fy(e,"stroke",t.stroke,t),fy(e,"strokeWidth",t.strokeWidth,t)}(e.axis,t.axis),t.highlightStyle&&function(e,t){fy(e,"fill",t.fill,t),fy(e,"size",t.size,t),fy(e,"stroke",t.stroke,t),fy(e,"strokeWidth",t.strokeWidth,t)}(e.highlightStyle,t.highlightStyle)}(i,e),function(e,t){switch(t.type){case"bar":case"column":!function(e,t){fy(e,"valueAxisDomain",t.valueAxisDomain,t),fy(e,"fill",t.fill,t),fy(e,"stroke",t.stroke,t),fy(e,"strokeWidth",t.strokeWidth,t),fy(e,"paddingInner",t.paddingInner,t),fy(e,"paddingOuter",t.paddingOuter,t),fy(e,"formatter",t.formatter,t),t.label&&function(e,t){fy(e,"enabled",t.enabled,t),fy(e,"fontStyle",t.fontStyle,t),fy(e,"fontWeight",t.fontWeight,t),fy(e,"fontSize",t.fontSize,t),fy(e,"fontFamily",t.fontFamily,t),fy(e,"textAlign",t.textAlign,t),fy(e,"textBaseline",t.textBaseline,t),fy(e,"color",t.color,t),fy(e,"formatter",t.formatter,t),fy(e,"placement",t.placement,t)}(e.label,t.label)}(e,t);break;case"area":!function(e,t){fy(e,"fill",t.fill,t),t.marker&&cy(e.marker,t.marker),t.line&&hy(e.line,t.line),t.crosshairs&&dy(e.crosshairs,t.crosshairs)}(e,t);break;default:!function(e,t){t.marker&&cy(e.marker,t.marker),t.line&&hy(e.line,t.line),t.crosshairs&&dy(e.crosshairs,t.crosshairs)}(e,t)}}(i,e),e.data&&(i.data=e.data),i.processedOptions=e,i}};function cy(e,t){fy(e,"enabled",t.enabled,t),fy(e,"size",t.size,t),fy(e,"shape",t.shape,t),fy(e,"fill",t.fill,t),fy(e,"stroke",t.stroke,t),fy(e,"strokeWidth",t.strokeWidth,t),fy(e,"formatter",t.formatter,t)}function hy(e,t){fy(e,"stroke",t.stroke,t),fy(e,"strokeWidth",t.strokeWidth,t)}function dy(e,t){e.xLine&&t.xLine&&uy(e.xLine,t.xLine),e.yLine&&t.yLine&&uy(e.yLine,t.yLine)}function uy(e,t){fy(e,"enabled",t.enabled,t),fy(e,"stroke",t.stroke,t),fy(e,"strokeWidth",t.strokeWidth,t),fy(e,"lineDash",t.lineDash,t),fy(e,"lineCap",t.lineCap,t)}var py={},gy=(e,t,i)=>{if(ay(t))return!0;const s=`AG Charts: ${e} must be a number, the value you provided is not a valid number. Using the default of ${i}px.`;var r,n;return r=()=>console.warn(s),py[n=`${e} not a number`]||(r(),py[n]=!0),!1},my={xOffset:gy,yOffset:gy};function fy(e,t,i,s){if(t in s)if(t in e){const s=my[t];(!s||s(t,i,e[t]))&&e[t]!==i&&(e[t]=i)}else console.warn(`Property ${t} does not exist on the target object.`)}var yy=class e extends rf.Component{constructor(){super(e.TEMPLATE)}init(e){let t=!0;const i=this.resizeObserverService.observeResize(this.getGui(),()=>{const{clientWidth:i,clientHeight:s}=this.getGui();if(0!==i&&0!==s)if(t){const r=((e,t)=>{for(var i in t||(t={}))yf.call(t,i)&&Cf(e,i,t[i]);if(ff)for(var i of ff(t))vf.call(t,i)&&Cf(e,i,t[i]);return e})({data:e.value,width:i,height:s,context:{data:e.data}},e.sparklineOptions);this.sparkline=ly.create(r,this.sparklineTooltipSingleton.getSparklineTooltip()),this.eSparkline.appendChild(this.sparkline.canvasElement),t=!1}else this.sparkline.width=i,this.sparkline.height=s});this.addDestroyFunc(()=>i())}refresh(e){return!!this.sparkline&&(this.sparkline.data=e.value,!0)}destroy(){this.sparkline&&this.sparkline.destroy(),super.destroy()}};yy.TEMPLATE='<div class="ag-sparkline-wrapper">\n            <span ref="eSparkline"></span>\n        </div>',bf([(0,rf.RefSelector)("eSparkline")],yy.prototype,"eSparkline",2),bf([(0,rf.Autowired)("resizeObserverService")],yy.prototype,"resizeObserverService",2),bf([(0,rf.Autowired)("sparklineTooltipSingleton")],yy.prototype,"sparklineTooltipSingleton",2);var vy=yy,Cy=class extends pf.BeanStub{postConstruct(){this.tooltip=new Of}getSparklineTooltip(){return this.tooltip}destroyTooltip(){this.tooltip&&this.tooltip.destroy()}};bf([pf.PostConstruct],Cy.prototype,"postConstruct",1),bf([pf.PreDestroy],Cy.prototype,"destroyTooltip",1),Cy=bf([(0,pf.Bean)("sparklineTooltipSingleton")],Cy);var by={version:"31.3.4",moduleName:sf.ModuleNames.SparklinesModule,beans:[Cy],userComponents:[{componentName:"agSparklineCellRenderer",componentClass:vy}],dependantModules:[D]},Sy=i(98092),wy=i(98092),xy=class extends wy.BeanStub{constructor(){super(),this.allComponents=new Map}registerStatusPanel(e,t){this.allComponents.set(e,t)}unregisterStatusPanel(e){this.allComponents.delete(e)}unregisterAllComponents(){this.allComponents.clear()}getStatusPanel(e){return this.allComponents.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}};xy=d([(0,wy.Bean)("statusBarService")],xy);var Ey=i(98092),My=class e extends Ey.Component{constructor(){super(e.TEMPLATE),this.compDestroyFunctions={}}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this))}processStatusPanels(e){var t;const i=null==(t=this.gos.get("statusBar"))?void 0:t.statusPanels;if(i){const t=i.filter(e=>"left"===e.align);this.createAndRenderComponents(t,this.eStatusBarLeft,e);const s=i.filter(e=>"center"===e.align);this.createAndRenderComponents(s,this.eStatusBarCenter,e);const r=i.filter(e=>!e.align||"right"===e.align);this.createAndRenderComponents(r,this.eStatusBarRight,e)}else this.setDisplayed(!1)}handleStatusBarChanged(){var e;const t=null==(e=this.gos.get("statusBar"))?void 0:e.statusPanels,i=Array.isArray(t)&&t.length>0;this.setDisplayed(i);const s=new Map;i&&t.forEach(e=>{var t,i;const r=null!=(t=e.key)?t:e.statusPanel,n=this.statusBarService.getStatusPanel(r);if(null==n?void 0:n.refresh){const t=this.gos.addGridCommonParams(null!=(i=e.statusPanelParams)?i:{});n.refresh(t)&&(s.set(r,n),delete this.compDestroyFunctions[r],Ey._.removeFromParent(n.getGui()))}}),this.resetStatusBar(),i&&this.processStatusPanels(s)}resetStatusBar(){this.eStatusBarLeft.innerHTML="",this.eStatusBarCenter.innerHTML="",this.eStatusBarRight.innerHTML="",this.destroyComponents(),this.statusBarService.unregisterAllComponents()}destroyComponents(){Object.values(this.compDestroyFunctions).forEach(e=>e()),this.compDestroyFunctions={}}createAndRenderComponents(e,t,i){const s=[];e.forEach(e=>{const t=e.key||e.statusPanel,r=i.get(t);let n;if(r)n=Ey.AgPromise.resolve(r);else{const t={};if(n=this.userComponentFactory.getStatusPanelCompDetails(e,t).newAgStackInstance(),!n)return}s.push({key:t,promise:n})}),Ey.AgPromise.all(s.map(e=>e.promise)).then(()=>{s.forEach(e=>{e.promise.then(i=>{const s=()=>{this.getContext().destroyBean(i)};this.isAlive()?(this.statusBarService.registerStatusPanel(e.key,i),t.appendChild(i.getGui()),this.compDestroyFunctions[e.key]=s):s()})})})}};My.TEMPLATE='<div class="ag-status-bar">\n            <div ref="eStatusBarLeft" class="ag-status-bar-left" role="status"></div>\n            <div ref="eStatusBarCenter" class="ag-status-bar-center" role="status"></div>\n            <div ref="eStatusBarRight" class="ag-status-bar-right" role="status"></div>\n        </div>',d([(0,Ey.Autowired)("userComponentFactory")],My.prototype,"userComponentFactory",2),d([(0,Ey.Autowired)("statusBarService")],My.prototype,"statusBarService",2),d([(0,Ey.RefSelector)("eStatusBarLeft")],My.prototype,"eStatusBarLeft",2),d([(0,Ey.RefSelector)("eStatusBarCenter")],My.prototype,"eStatusBarCenter",2),d([(0,Ey.RefSelector)("eStatusBarRight")],My.prototype,"eStatusBarRight",2),d([Ey.PostConstruct],My.prototype,"postConstruct",1),d([Ey.PreDestroy],My.prototype,"destroyComponents",1);var Ay=My,Ty=i(98092),Dy=class e extends Ty.Component{constructor(){super(e.TEMPLATE)}setLabel(e,t){this.setDisplayed(!1);const i=this.localeService.getLocaleTextFunc();this.eLabel.innerHTML=i(e,t)}setValue(e){this.eValue.innerHTML=e}};Dy.TEMPLATE='<div class="ag-status-name-value">\n            <span ref="eLabel"></span>:&nbsp;\n            <span ref="eValue" class="ag-status-name-value-value"></span>\n        </div>',d([(0,Ty.RefSelector)("eLabel")],Dy.prototype,"eLabel",2),d([(0,Ty.RefSelector)("eValue")],Dy.prototype,"eValue",2);var Iy=Dy,Ry=i(98092),Py=class extends Iy{postConstruct(){"clientSide"===this.rowModel.getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,Ry.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this)),this.onDataChanged()):Ry._.warnOnce("agTotalAndFilteredRowCountComponent should only be used with the client side row model.")}onDataChanged(){const e=this.localeService.getLocaleTextFunc(),t=e("thousandSeparator",","),i=e("decimalSeparator","."),s=Ry._.formatNumberCommas(this.getFilteredRowCountValue(),t,i),r=Ry._.formatNumberCommas(this.getTotalRowCount(),t,i);if(s===r)this.setValue(s);else{const e=this.localeService.getLocaleTextFunc();this.setValue(`${s} ${e("of","of")} ${r}`)}}getFilteredRowCountValue(){let e=0;return this.rowModel.forEachNodeAfterFilter(t=>{t.group||e++}),e}getTotalRowCount(){let e=0;return this.rowModel.forEachNode(t=>{t.group||e++}),e}init(){}refresh(){return!0}destroy(){super.destroy()}};d([(0,Ry.Autowired)("rowModel")],Py.prototype,"rowModel",2),d([Ry.PostConstruct],Py.prototype,"postConstruct",1);var ky=i(98092),Ly=class extends Iy{postConstruct(){if(this.setLabel("filteredRows","Filtered"),"clientSide"!==this.rowModel.getType())return void ky._.warnOnce("agFilteredRowCountComponent should only be used with the client side row model.");this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,ky.Events.EVENT_MODEL_UPDATED,e),e()}onDataChanged(){const e=this.getTotalRowCountValue(),t=this.getFilteredRowCountValue(),i=this.localeService.getLocaleTextFunc(),s=i("thousandSeparator",","),r=i("decimalSeparator",".");this.setValue(ky._.formatNumberCommas(t,s,r)),this.setDisplayed(e!==t)}getTotalRowCountValue(){let e=0;return this.rowModel.forEachNode(t=>e+=1),e}getFilteredRowCountValue(){let e=0;return this.rowModel.forEachNodeAfterFilter(t=>{t.group||(e+=1)}),e}init(){}refresh(){return!0}destroy(){super.destroy()}};d([(0,ky.Autowired)("rowModel")],Ly.prototype,"rowModel",2),d([ky.PostConstruct],Ly.prototype,"postConstruct",1);var Ny=i(98092),_y=class extends Iy{postConstruct(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.rowModel.getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,Ny.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this)),this.onDataChanged()):Ny._.warnOnce("agTotalRowCountComponent should only be used with the client side row model.")}onDataChanged(){const e=this.localeService.getLocaleTextFunc(),t=e("thousandSeparator",","),i=e("decimalSeparator",".");this.setValue(Ny._.formatNumberCommas(this.getRowCountValue(),t,i))}getRowCountValue(){let e=0;return this.rowModel.forEachLeafNode(t=>e+=1),e}init(){}refresh(){return!0}destroy(){super.destroy()}};d([(0,Ny.Autowired)("rowModel")],_y.prototype,"rowModel",2),d([Ny.PostConstruct],_y.prototype,"postConstruct",1);var Oy=i(98092),Fy=class extends Iy{postConstruct(){if(!this.isValidRowModel())return void console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.");this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count"),this.onRowSelectionChanged();const e=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,Oy.Events.EVENT_MODEL_UPDATED,e),this.addManagedListener(this.eventService,Oy.Events.EVENT_SELECTION_CHANGED,e)}isValidRowModel(){const e=this.rowModel.getType();return"clientSide"===e||"serverSide"===e}onRowSelectionChanged(){const e=this.selectionService.getSelectionCount();if(e<0)return this.setValue("?"),void this.setDisplayed(!0);const t=this.localeService.getLocaleTextFunc(),i=t("thousandSeparator",","),s=t("decimalSeparator",".");this.setValue(Oy._.formatNumberCommas(e,i,s)),this.setDisplayed(e>0)}init(){}refresh(){return!0}destroy(){super.destroy()}};d([(0,Oy.Autowired)("rowModel")],Fy.prototype,"rowModel",2),d([(0,Oy.Autowired)("selectionService")],Fy.prototype,"selectionService",2),d([Oy.PostConstruct],Fy.prototype,"postConstruct",1);var Gy=i(98092),By=class e extends Gy.Component{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}postConstruct(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,Gy.Events.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,Gy.Events.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")}isValidRowModel(){const e=this.rowModel.getType();return"clientSide"===e||"serverSide"===e}init(e){this.params=e}refresh(e){return this.params=e,this.onRangeSelectionChanged(),!0}setAggregationComponentValue(e,t,i){var s;const r=this.getAllowedAggregationValueComponent(e);if(Gy._.exists(r)&&r){const e=this.localeService.getLocaleTextFunc(),s=e("thousandSeparator",","),n=e("decimalSeparator",".");r.setValue(Gy._.formatNumberTwoDecimalPlacesAndCommas(t,s,n)),r.setDisplayed(i)}else null==(s=this.getAggregationValueComponent(e))||s.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){return this[`${e}AggregationComp`]}onRangeSelectionChanged(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges();let i=0,s=0,r=0,n=null,o=null;const a={};if(t&&!Gy._.missingOrEmpty(t)&&this.rangeService)for(let e=0;e<t.length;e++){const l=t[e];let c=this.rangeService.getRangeStartRow(l);const h=this.rangeService.getRangeEndRow(l);for(;!Gy._.missing(c)&&c&&!this.rowPositionUtils.before(h,c)&&c&&l.columns;)l.columns.forEach(e=>{if(null===c)return;const t=this.cellPositionUtils.createId({rowPinned:c.rowPinned,column:e,rowIndex:c.rowIndex});if(a[t])return;a[t]=!0;const l=this.rowPositionUtils.getRowNode(c);if(Gy._.missing(l))return;let h=this.valueService.getValue(e,l);Gy._.missing(h)||""===h||(s++,"object"==typeof h&&"value"in h&&(h=h.value,""===h)||("string"==typeof h&&(h=Number(h)),"number"!=typeof h||isNaN(h)||(i+=h,(null===o||h>o)&&(o=h),(null===n||h<n)&&(n=h),r++)))}),c=this.cellNavigationService.getRowBelow(c)}const l=s>1,c=r>1;this.setAggregationComponentValue("count",s,l),this.setAggregationComponentValue("sum",i,c),this.setAggregationComponentValue("min",n,c),this.setAggregationComponentValue("max",o,c),this.setAggregationComponentValue("avg",i/r,c)}};By.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n            <ag-name-value ref="avgAggregationComp"></ag-name-value>\n            <ag-name-value ref="countAggregationComp"></ag-name-value>\n            <ag-name-value ref="minAggregationComp"></ag-name-value>\n            <ag-name-value ref="maxAggregationComp"></ag-name-value>\n            <ag-name-value ref="sumAggregationComp"></ag-name-value>\n        </div>',d([(0,Gy.Optional)("rangeService")],By.prototype,"rangeService",2),d([(0,Gy.Autowired)("valueService")],By.prototype,"valueService",2),d([(0,Gy.Autowired)("cellNavigationService")],By.prototype,"cellNavigationService",2),d([(0,Gy.Autowired)("rowModel")],By.prototype,"rowModel",2),d([(0,Gy.Autowired)("cellPositionUtils")],By.prototype,"cellPositionUtils",2),d([(0,Gy.Autowired)("rowPositionUtils")],By.prototype,"rowPositionUtils",2),d([(0,Gy.RefSelector)("sumAggregationComp")],By.prototype,"sumAggregationComp",2),d([(0,Gy.RefSelector)("countAggregationComp")],By.prototype,"countAggregationComp",2),d([(0,Gy.RefSelector)("minAggregationComp")],By.prototype,"minAggregationComp",2),d([(0,Gy.RefSelector)("maxAggregationComp")],By.prototype,"maxAggregationComp",2),d([(0,Gy.RefSelector)("avgAggregationComp")],By.prototype,"avgAggregationComp",2),d([Gy.PostConstruct],By.prototype,"postConstruct",1);var Vy=By,Hy={version:"31.3.4",moduleName:Sy.ModuleNames.StatusBarModule,beans:[xy],agStackComponents:[{componentName:"AgStatusBar",componentClass:Ay},{componentName:"AgNameValue",componentClass:Iy}],userComponents:[{componentName:"agAggregationComponent",componentClass:Vy},{componentName:"agSelectedRowCountComponent",componentClass:Fy},{componentName:"agTotalRowCountComponent",componentClass:_y},{componentName:"agFilteredRowCountComponent",componentClass:Ly},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:Py}],dependantModules:[D]},Uy=i(98092),zy=i(98092),Wy=Object.defineProperty,jy=Object.getOwnPropertyDescriptor,Ky=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?jy(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Wy(t,i,n),n},$y=class extends zy.BeanStub{constructor(){super(...arguments),this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.rowHeight=this.gos.getRowHeightAsNumber(),this.addManagedListener(this.eventService,zy.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this)),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroyDatasource(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getViewportRowModelPageSize(){return this.gos.get("viewportRowModelPageSize")}getViewportRowModelBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getViewportRowModelBufferSize(),i=this.getViewportRowModelPageSize(),s=e-t;return s<0?0:Math.floor(s/i)*i}calculateLastRow(e){if(-1===e)return e;const t=this.getViewportRowModelBufferSize(),i=this.getViewportRowModelPageSize(),s=e+t,r=Math.ceil(s/i)*i,n=this.rowCount-1;return Math.min(r,n)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),i=this.calculateLastRow(e.lastRow);this.firstRow===t&&this.lastRow===i||(this.firstRow=t,this.lastRow=i,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))}purgeRowsNotInViewport(){Object.keys(this.rowNodesByIndex).forEach(e=>{const t=parseInt(e,10);if(t<this.firstRow||t>this.lastRow){if(this.isRowFocused(t))return;delete this.rowNodesByIndex[t]}})}isRowFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!!t&&(null==t.rowPinned&&t.rowIndex===e)}setViewportDatasource(e){this.destroyDatasource(),this.viewportDatasource=e,this.rowCount=-1,e.init?e.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):console.warn("AG Grid: viewport is missing init method.")}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}getRowCount(){return-1===this.rowCount?0:this.rowCount}getRowIndexAtPixel(e){return 0!==this.rowHeight?Math.floor(e/this.rowHeight):0}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e={type:zy.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1};this.eventService.dispatchEvent(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const i=zy._.missing(e)?0:e.rowIndex,s=t.rowIndex,r=i<this.firstRow||i>this.lastRow,n=s<this.firstRow||s>this.lastRow;if(r||n)return[];const o=[],a=i<=s?s:i;for(let e=i<=s?i:s;e<=a;e++)o.push(this.rowNodesByIndex[e]);return o}forEachNode(e){let t=0;Object.keys(this.rowNodesByIndex).forEach(i=>{const s=parseInt(i,10),r=this.rowNodesByIndex[s];e(r,t),t++})}setRowData(e){zy._.iterateObject(e,(e,t)=>{const i=parseInt(e,10);if(i>=this.firstRow&&i<=this.lastRow){let e=this.rowNodesByIndex[i];zy._.missing(e)&&(e=this.createBlankRowNode(i),this.rowNodesByIndex[i]=e),e.setDataAndId(t,i.toString())}})}createBlankRowNode(e){const t=new zy.RowNode(this.beans);return t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e,this.eventService.dispatchEventOnce({type:zy.Events.EVENT_ROW_COUNT_READY});const i={type:zy.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:t,animate:!1};this.eventService.dispatchEvent(i)}isRowPresent(e){return!!this.getRowNode(e.id)}};Ky([(0,zy.Autowired)("rowRenderer")],$y.prototype,"rowRenderer",2),Ky([(0,zy.Autowired)("focusService")],$y.prototype,"focusService",2),Ky([(0,zy.Autowired)("beans")],$y.prototype,"beans",2),Ky([zy.PostConstruct],$y.prototype,"init",1),Ky([zy.PreDestroy],$y.prototype,"destroyDatasource",1),$y=Ky([(0,zy.Bean)("rowModel")],$y);var Yy={version:"31.3.4",moduleName:Uy.ModuleNames.ViewportRowModelModule,rowModel:"viewport",beans:[$y],dependantModules:[D]},qy=i(98092),Xy=i(98092),Zy=i(98092),Qy=i(98092),Jy=i(98092),ev=i(98092),tv=i(98092),iv=i(98092),sv=i(98092),rv=i(98092),nv=i(98092),ov=i(98092),av=i(98092),lv=i(98092),cv=i(98092),hv=i(98092),dv=i(98092),uv=i(98092),pv=i(98092),gv=i(98092),mv=i(98092),fv=i(98092),yv=i(98092),vv=i(98092),Cv=i(98092),bv=i(98092),Sv=i(98092),wv=i(98092),xv=i(98092),Ev=i(98092),Mv=i(98092),Av=i(98092),Tv=i(98092),Dv=i(98092),Iv=i(98092),Rv=i(98092),Pv=i(98092),kv=i(98092),Lv=i(98092),Nv=i(98092),_v=i(98092),Ov=i(98092),Fv=i(98092),Gv=i(98092),Bv=i(98092),Vv=i(98092),Hv=i(98092),Uv=i(98092),zv=i(98092),Wv=i(98092),jv=i(98092),Kv=i(98092),$v=i(98092),Yv=i(98092),qv=i(98092),Xv=i(98092),Zv=i(98092),Qv=i(98092),Jv=i(98092),eC=i(98092),tC=i(98092),iC=i(98092),sC=i(98092),rC=i(98092),nC=i(98092),oC=i(98092),aC=i(98092),lC=i(98092),cC=i(98092),hC=i(98092),dC=i(98092),uC=i(98092),pC=i(98092),gC=i(98092),mC=i(98092),fC=i(98092),yC=i(98092),vC=i(98092),CC=i(98092),bC=i(98092),SC=i(98092),wC=i(98092),xC=i(98092),EC=i(98092),MC=i(98092),AC=i(98092),TC=i(98092),DC=i(98092),IC=i(98092),RC=i(98092),PC=i(98092),kC=i(98092),LC=i(98092),NC=i(98092),_C=i(98092),OC=i(98092),FC=i(98092),GC=i(98092),BC=i(98092),VC=i(98092),HC=i(98092),UC=i(98092),zC=i(98092),WC=i(98092),jC=i(98092),KC=i(98092),$C=i(98092),YC=i(98092),qC=i(98092),XC=i(98092),ZC=i(98092),QC=i(98092),JC=i(98092),eb=i(98092),tb=i(98092),ib=i(98092),sb=i(98092),rb=i(98092),nb=i(98092),ob=i(98092),ab=i(98092),lb=i(98092),cb=i(98092),hb=i(98092),db=i(98092),ub=i(98092),pb=i(98092),gb=i(98092),mb=i(98092),fb=i(98092),yb=i(98092),vb=i(98092),Cb=i(98092),bb=i(98092),Sb=i(98092),wb=i(98092),xb=i(98092),Eb=i(98092),Mb=i(98092),Ab=i(98092),Tb=i(98092),Db=i(98092),Ib=i(98092),Rb=i(98092),Pb=i(98092),kb=i(98092),Lb=i(98092),Nb=i(98092),_b=i(98092),Ob=i(98092),Fb=i(98092),Gb=i(98092),Bb=i(98092),Vb=i(98092),Hb=i(98092),Ub=i(98092),zb=i(98092),Wb=i(98092),jb=i(98092),Kb=i(98092),$b=i(98092),Yb=i(98092),qb=i(98092),Xb=i(98092),Zb=i(98092),Qb=i(98092),Jb=i(98092),eS=i(98092),tS=i(98092),iS=i(98092),sS=i(98092),rS=i(98092),nS=i(98092),oS=i(98092),aS=i(98092),lS=i(98092),cS=i(98092),hS=i(98092),dS=i(98092),uS=i(98092),pS=i(98092),gS=i(98092),mS=i(98092),fS=i(98092),yS=i(98092),vS=i(98092),CS=i(98092),bS=i(98092),SS=i(98092),wS=i(98092),xS=i(98092),ES=i(98092),MS=i(98092);h(u,Ge,e.exports),p.ModuleRegistry.__registerModules([g.ClientSideRowModelModule,m.InfiniteRowModelModule,f.CsvExportModule,Fe,Ja,pl,_h,ju,mp,Ip,cg,Tg,dt,Pg,vc,Tm,tf,Zc,by,Hy,Yy],!1,void 0)},19270(e,t,i){"use strict";var s,r=Object.create,n=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,g=(e,t,i)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,m=(e,t)=>{for(var i in t||(t={}))u.call(t,i)&&g(e,i,t[i]);if(h)for(var i of h(t))p.call(t,i)&&g(e,i,t[i]);return e},f=(e,t)=>o(e,l(t)),y=(e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of c(t))u.call(e,r)||r===i||n(e,r,{get:()=>t[r],enumerable:!(s=a(t,r))||s.enumerable});return e},v=(e,t,i)=>(i=null!=e?r(d(e)):{},y(!t&&e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)),C={};((e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})})(C,{AgGridReact:()=>ht,ChangeDetectionStrategyType:()=>dt,getInstance:()=>De,useGridCellEditor:()=>gt,useGridDate:()=>mt,useGridFilter:()=>ft,useGridFloatingFilter:()=>yt,useGridMenuItem:()=>vt,warnReactiveCustomComponents:()=>Ie}),e.exports=(s=C,y(n({},"__esModule",{value:!0}),s));var b=v(i(22155)),S=i(98092),w=v(i(22155)),x=i(98092),E=v(i(22155)),M=(0,i(22155).createContext)({setMethods:()=>{}}),A=(0,E.memo)(e=>{const{initialProps:t,addUpdateCallback:i,CustomComponentClass:s,setMethods:r}=e,[n,o]=(0,E.useState)(t);return(0,E.useEffect)(()=>{i(e=>o(e))},[]),E.default.createElement(M.Provider,{value:{setMethods:r}},E.default.createElement(s,m({},n)))}),T=i(22155),D=i(98092),I=0;function R(){return"agPortalKey_"+ ++I}var P=i(70316),k=i(32431),L=class{constructor(e,t,i,s){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=i,this.suppressFallbackMethods=!!s,this.statelessComponent=this.isStateless(this.reactComponent),this.key=R(),this.portalKey=R(),this.instanceCreated=this.isStatelessComponent()?D.AgPromise.resolve(!1):new D.AgPromise(e=>{this.resolveInstanceCreated=e})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),i=document.createElement(t||"div");return i.classList.add("ag-react-container"),e.reactContainer=i,i}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(D._.warnOnce('Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),Object.assign(this.eParentElement.style,this.componentInstance.getReactContainerStyle())),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses())&&(D._.warnOnce('Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),this.componentInstance.getReactContainerClasses().forEach(e=>this.eParentElement.classList.add(e)))}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return"function"==typeof Symbol&&Symbol.for}isStateless(e){return"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&null!=t[e]||this.fallbackMethodAvailable(e)}callMethod(e,t){const i=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!i)return void setTimeout(()=>this.callMethod(e,t));const s=i[e];return s?s.apply(i,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.params=e,this.createOrUpdatePortal(e),new D.AgPromise(e=>this.createReactComponent(e))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=e=>{var t;this.componentInstance=e,this.addParentContainerStyleAndClasses(),null==(t=this.resolveInstanceCreated)||t.call(this,!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,f(m({},e),{key:this.key})),this.portal=(0,P.createPortal)(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return(0,T.createElement)(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,t=>{e(t)})}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())}valueRenderedIsNull(e){if(!this.componentType.cellRenderer)return!1;const t=console.error;try{return console.error=()=>{},""===(0,k.renderToStaticMarkup)((0,T.createElement)(this.reactComponent,e))}catch(e){}finally{console.error=t}return!1}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const i=this[`${e}Component`];if(!this.suppressFallbackMethods&&i)return i.bind(this)(t)}fallbackMethodAvailable(e){return!this.suppressFallbackMethods&&!!this[`${e}Component`]}};function N(e,t,i){e.forEach(e=>{const s=t[e];s&&(i[e]=s)})}var _=class extends L{constructor(){super(...arguments),this.awaitUpdateCallback=new x.AgPromise(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=A}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:e=>this.setMethods(e),addUpdateCallback:e=>{this.updateCallback=()=>(e(this.getProps()),new x.AgPromise(e=>{setTimeout(()=>{e()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,N(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return f(m({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new x.AgPromise(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},O=class extends _{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},F=class extends _{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return null!=this.model}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.model=e,this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(e){this.setModel(e).then(()=>this.sourceParams.filterChangedCallback())}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,delete e.filterModifiedCallback,delete e.valueGetter,e}},G=i(98092);function B(e,t){e.parentFilterInstance(i=>{(i.setModel(t)||G.AgPromise.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var V=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=e=>this.updateModel(e)}getProps(){return f(m({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){N(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),B(this.floatingFilterParams,e)}},H=class extends _{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),B(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},U=class extends _{refresh(e){this.sourceParams=e,this.refreshProps()}},z=class extends _{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},W=class extends _{refresh(e){this.sourceParams=e,this.refreshProps()}},j=class extends _{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},K=class extends _{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}},$=class e{constructor(t,i,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=i||"div",this.refresher=t,this.maxComponentCreationTimeMs=s||e.MAX_COMPONENT_CREATION_TIME_IN_MS}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,i){this.portals=[...this.portals,e],this.waitForInstance(t,i),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,i=Date.now()){if(this.destroyed)t(null);else if(e.rendered())t(e);else{if(Date.now()-i>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate)return e.isNullValue()?void t(e):(console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),void console.error("    If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`"));window.setTimeout(()=>{this.waitForInstance(e,t,i)})}}};$.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var Y=$,q=v(i(22155)).default.createContext({}),X=v(i(70316)),Z=(...e)=>e.filter(e=>null!=e&&""!==e).join(" "),Q=class e{constructor(...e){this.classesMap={},e.forEach(e=>{this.classesMap[e]=!0})}setClass(t,i){if(!!this.classesMap[t]==i)return this;const s=new e;return s.classesMap=m({},this.classesMap),s.classesMap[t]=i,s}toString(){return Object.keys(this.classesMap).filter(e=>this.classesMap[e]).join(" ")}},J=e=>"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===("function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115),ee=null!=X.default.createRoot&&null!=X.default.flushSync,te=!1,ie=(e,t)=>{ee&&e&&!te?X.default.flushSync(t):t()};function se(e,t,i){if(null==t||null==e)return t;if(e===t||0===t.length&&0===e.length)return e;if(i||0===e.length&&t.length>0||e.length>0&&0===t.length)return t;const s=[],r=[],n=new Map,o=new Map;for(let e=0;e<t.length;e++){const i=t[e];o.set(i.getInstanceId(),i)}for(let t=0;t<e.length;t++){const i=e[t];n.set(i.getInstanceId(),i),o.has(i.getInstanceId())&&s.push(i)}for(let e=0;e<t.length;e++){const i=t[e],s=i.getInstanceId();n.has(s)||r.push(i)}return s.length===e.length&&0===r.length?e:0===s.length&&r.length===t.length?t:0===s.length?r:0===r.length?s:[...s,...r]}var re=i(98092),ne=v(i(22155)),oe=(e,t,i,s)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const r=e.newAgStackInstance();if(!r)return;let n,o,a=!1;return r.then(e=>{a?t.destroyBean(e):(n=e,o=n.getGui(),i.appendChild(o),ae(s,n))}),()=>{a=!0,n&&(o&&o.parentElement&&o.parentElement.removeChild(o),t.destroyBean(n),s&&ae(s,void 0))}},ae=(e,t)=>{e&&(e instanceof Function?e(t):e.current=t)},le=(0,ne.forwardRef)((e,t)=>{var i;const s=(0,ne.useContext)(q).context,r=(0,ne.useRef)(null),n=(0,ne.useRef)(null),o=(0,ne.useRef)(null),a=(0,ne.useRef)(null),l=(0,ne.useRef)(null),c=(0,ne.useRef)(),[h,d]=(0,ne.useState)(),[u,p]=(0,ne.useState)(),[g,f]=(0,ne.useState)(),[y,v]=(0,ne.useState)(()=>new Q),[C,b]=(0,ne.useState)(()=>new Q("ag-hidden")),[S,w]=(0,ne.useState)(()=>new Q("ag-hidden")),[x,E]=(0,ne.useState)(()=>new Q("ag-invisible"));(0,ne.useImperativeHandle)(t,()=>({refresh:()=>!1})),(0,ne.useLayoutEffect)(()=>oe(h,s,n.current),[h]);const M=(0,ne.useCallback)(t=>{if(r.current=t,!r.current)return s.destroyBean(c.current),void(c.current=null);const i={setInnerRenderer:(e,t)=>{d(e),f(t)},setChildCount:e=>p(e),addOrRemoveCssClass:(e,t)=>v(i=>i.setClass(e,t)),setContractedDisplayed:e=>w(t=>t.setClass("ag-hidden",!e)),setExpandedDisplayed:e=>b(t=>t.setClass("ag-hidden",!e)),setCheckboxVisible:e=>E(t=>t.setClass("ag-invisible",!e))};c.current=s.createBean(new re.GroupCellRendererCtrl),c.current.init(i,r.current,o.current,a.current,l.current,le,e)},[]),A=(0,ne.useMemo)(()=>`ag-cell-wrapper ${y.toString()}`,[y]),T=(0,ne.useMemo)(()=>`ag-group-expanded ${C.toString()}`,[C]),D=(0,ne.useMemo)(()=>`ag-group-contracted ${S.toString()}`,[S]),I=(0,ne.useMemo)(()=>`ag-group-checkbox ${x.toString()}`,[x]),R=h&&h.componentFromFramework,P=R?h.componentClass:void 0,k=null==h&&null!=g,L=re._.escapeString(g,!0);return ne.default.createElement("span",m({className:A,ref:M},e.colDef?{}:{role:null==(i=c.current)?void 0:i.getCellAriaRole()}),ne.default.createElement("span",{className:T,ref:a}),ne.default.createElement("span",{className:D,ref:l}),ne.default.createElement("span",{className:I,ref:o}),ne.default.createElement("span",{className:"ag-group-value",ref:n},k&&ne.default.createElement(ne.default.Fragment,null,L),R&&ne.default.createElement(P,m({},h.params))),ne.default.createElement("span",{className:"ag-group-child-count"},u))}),ce=le,he=i(98092),de=v(i(22155)),ue=i(98092),pe=v(i(22155)),ge=v(i(22155)),me=i(98092),fe=v(i(22155)),ye=i(98092),ve=i(98092),Ce=v(i(22155)),be=v(i(22155)),Se=i(98092),we=(0,be.memo)(e=>{const{ctrl:t}=e,i=t.isAlive(),{context:s}=(0,be.useContext)(q),r=i?t.getColId():void 0,[n,o]=(0,be.useState)(),a=(0,be.useRef)(null),l=(0,be.useRef)(null),c=(0,be.useRef)(null),h=(0,be.useRef)();let d=(0,be.useRef)();i&&!d.current&&(d.current=new Se.CssClassManager(()=>a.current));const u=(0,be.useCallback)(e=>{var s;if(a.current=e,!a.current||!i)return;const r={setWidth:e=>{a.current&&(a.current.style.width=e)},addOrRemoveCssClass:(e,t)=>d.current.addOrRemoveCssClass(e,t),setAriaSort:e=>{a.current&&(e?Se._.setAriaSort(a.current,e):Se._.removeAriaSort(a.current))},setUserCompDetails:e=>o(e),getUserCompInstance:()=>h.current||void 0};t.setComp(r,a.current,l.current,c.current);const n=t.getSelectAllGui();null==(s=l.current)||s.insertAdjacentElement("afterend",n)},[]);(0,be.useLayoutEffect)(()=>oe(n,s,c.current,h),[n]),(0,be.useEffect)(()=>{t.setDragSource(a.current)},[n]);const p=(0,be.useMemo)(()=>!(!(null==n?void 0:n.componentFromFramework)||!J(n.componentClass)),[n]),g=n&&n.componentFromFramework,y=n&&n.componentClass;return be.default.createElement("div",{ref:u,className:"ag-header-cell","col-id":r,role:"columnheader"},be.default.createElement("div",{ref:l,className:"ag-header-cell-resize",role:"presentation"}),be.default.createElement("div",{ref:c,className:"ag-header-cell-comp-wrapper",role:"presentation"},g&&p&&be.default.createElement(y,m({},n.params)),g&&!p&&be.default.createElement(y,f(m({},n.params),{ref:h}))))}),xe=v(i(22155)),Ee=(0,xe.memo)(e=>{const{context:t}=(0,xe.useContext)(q),{ctrl:i}=e,[s,r]=(0,xe.useState)(()=>new Q),[n,o]=(0,xe.useState)(()=>new Q),[a,l]=(0,xe.useState)("false"),[c,h]=(0,xe.useState)(),[d,u]=(0,xe.useState)(),p=(0,xe.useMemo)(()=>i.getColId(),[]),g=(0,xe.useRef)(null),y=(0,xe.useRef)(null),v=(0,xe.useRef)(),C=(0,xe.useCallback)(e=>{if(g.current=e,!g.current)return;const t={setWidth:e=>{g.current&&(g.current.style.width=e)},addOrRemoveCssClass:(e,t)=>r(i=>i.setClass(e,t)),setUserCompDetails:e=>u(e),setResizableDisplayed:e=>{o(t=>t.setClass("ag-hidden",!e)),l(e?"false":"true")},setAriaExpanded:e=>h(e),getUserCompInstance:()=>v.current||void 0};i.setComp(t,g.current,y.current)},[]);(0,xe.useLayoutEffect)(()=>oe(d,t,g.current),[d]),(0,xe.useEffect)(()=>{g.current&&i.setDragSource(g.current)},[d]);const b=(0,xe.useMemo)(()=>!(!(null==d?void 0:d.componentFromFramework)||!J(d.componentClass)),[d]),S=(0,xe.useMemo)(()=>"ag-header-group-cell "+s.toString(),[s]),w=(0,xe.useMemo)(()=>"ag-header-cell-resize "+n.toString(),[n]),x=d&&d.componentFromFramework,E=d&&d.componentClass;return xe.default.createElement("div",{ref:C,className:S,"col-id":p,role:"columnheader","aria-expanded":c},x&&b&&xe.default.createElement(E,m({},d.params)),x&&!b&&xe.default.createElement(E,f(m({},d.params),{ref:v})),xe.default.createElement("div",{ref:y,"aria-hidden":a,className:w}))}),Me=v(i(22155)),Ae=i(98092),Te=i(98092);function De(e,t){var i,s;(null!=(s=null==(i=null==e?void 0:e.getInstance)?void 0:i.call(e))?s:Te.AgPromise.resolve(void 0)).then(e=>t(e))}function Ie(){Te._.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var Re=(0,Me.memo)(e=>{const{context:t,gos:i}=(0,Me.useContext)(q),[s,r]=(0,Me.useState)(()=>new Q("ag-header-cell","ag-floating-filter")),[n,o]=(0,Me.useState)(()=>new Q),[a,l]=(0,Me.useState)(()=>new Q("ag-floating-filter-button","ag-hidden")),[c,h]=(0,Me.useState)("false"),[d,u]=(0,Me.useState)(),[p,g]=(0,Me.useState)(1),y=(0,Me.useRef)(null),v=(0,Me.useRef)(null),C=(0,Me.useRef)(null),b=(0,Me.useRef)(null),S=(0,Me.useRef)(),w=(0,Me.useRef)(),x=e=>{null!=e&&S.current&&S.current(e)},{ctrl:E}=e,A=(0,Me.useCallback)(e=>{if(y.current=e,!y.current)return;w.current=new Ae.AgPromise(e=>{S.current=e});const t={addOrRemoveCssClass:(e,t)=>r(i=>i.setClass(e,t)),addOrRemoveBodyCssClass:(e,t)=>o(i=>i.setClass(e,t)),setButtonWrapperDisplayed:e=>{l(t=>t.setClass("ag-hidden",!e)),h(e?"false":"true")},setWidth:e=>{y.current&&(y.current.style.width=e)},setCompDetails:e=>u(e),getFloatingFilterComp:()=>w.current?w.current:null,setMenuIcon:e=>{var t;return null==(t=b.current)?void 0:t.appendChild(e)}};E.setComp(t,y.current,b.current,v.current)},[]);(0,Me.useLayoutEffect)(()=>oe(d,t,v.current,x),[d]);const T=(0,Me.useMemo)(()=>s.toString(),[s]),D=(0,Me.useMemo)(()=>n.toString(),[n]),I=(0,Me.useMemo)(()=>a.toString(),[a]),R=(0,Me.useMemo)(()=>!!(d&&d.componentFromFramework&&J(d.componentClass)),[d]),P=(0,Me.useMemo)(()=>i.get("reactiveCustomComponents"),[]),k=(0,Me.useMemo)(()=>{if(d){if(P){const e=new V(d.params,()=>g(e=>e+1));return x(e),e}d.componentFromFramework&&Ie()}},[d]),L=null==k?void 0:k.getProps(),N=d&&d.componentFromFramework,_=d&&d.componentClass;return Me.default.createElement("div",{ref:A,className:T,role:"gridcell"},Me.default.createElement("div",{ref:v,className:D,role:"presentation"},N&&!P&&Me.default.createElement(_,f(m({},d.params),{ref:R?()=>{}:x})),N&&P&&Me.default.createElement(M.Provider,{value:{setMethods:e=>k.setMethods(e)}},Me.default.createElement(_,m({},L)))),Me.default.createElement("div",{ref:C,"aria-hidden":c,className:I,role:"presentation"},Me.default.createElement("button",{ref:b,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))}),Pe=(0,Ce.memo)(e=>{const{ctrl:t}=e,{topOffset:i,rowHeight:s}=(0,Ce.useMemo)(()=>t.getTopAndHeight(),[]),r=t.getAriaRowIndex(),n=t.getHeaderRowClass(),[o,a]=(0,Ce.useState)(()=>s+"px"),[l,c]=(0,Ce.useState)(()=>i+"px"),h=(0,Ce.useRef)(null),d=(0,Ce.useRef)(null),[u,p]=(0,Ce.useState)(()=>t.getHeaderCtrls()),g=(0,Ce.useRef)(null),m=(0,Ce.useCallback)(e=>{if(g.current=e,!e)return;const i={setHeight:e=>a(e),setTop:e=>c(e),setHeaderCtrls:(e,t,i)=>{d.current=h.current,h.current=e;const s=se(d.current,e,t);s!==d.current&&ie(i,()=>p(s))},setWidth:e=>{g.current&&(g.current.style.width=e)}};t.setComp(i,!1)},[]),f=(0,Ce.useMemo)(()=>({height:o,top:l}),[o,l]),y=(0,Ce.useCallback)(e=>{switch(t.getType()){case ve.HeaderRowType.COLUMN_GROUP:return Ce.default.createElement(Ee,{ctrl:e,key:e.getInstanceId()});case ve.HeaderRowType.FLOATING_FILTER:return Ce.default.createElement(Re,{ctrl:e,key:e.getInstanceId()});default:return Ce.default.createElement(we,{ctrl:e,key:e.getInstanceId()})}},[]);return Ce.default.createElement("div",{ref:m,className:n,role:"row",style:f,"aria-rowindex":r},u.map(y))}),ke=(0,fe.memo)(e=>{const[t,i]=(0,fe.useState)(!0),[s,r]=(0,fe.useState)([]),{context:n}=(0,fe.useContext)(q),o=(0,fe.useRef)(null),a=(0,fe.useRef)(null),l=(0,fe.useRef)(null),c="left"===e.pinned,h="right"===e.pinned,d=!c&&!h,u=(0,fe.useCallback)(t=>{if(o.current=t,!o.current)return n.destroyBean(l.current),void(l.current=null);const s={setDisplayed:i,setCtrls:e=>r(e),setCenterWidth:e=>{a.current&&(a.current.style.width=e)},setViewportScrollLeft:e=>{o.current&&(o.current.scrollLeft=e)},setPinnedContainerWidth:e=>{o.current&&(o.current.style.width=e,o.current.style.minWidth=e,o.current.style.maxWidth=e)}};l.current=n.createBean(new ye.HeaderRowContainerCtrl(e.pinned)),l.current.setComp(s,o.current)},[]),p=t?"":"ag-hidden",g=()=>s.map(e=>fe.default.createElement(Pe,{ctrl:e,key:e.getInstanceId()}));return fe.default.createElement(fe.default.Fragment,null,c&&fe.default.createElement("div",{ref:u,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},g()),h&&fe.default.createElement("div",{ref:u,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},g()),d&&fe.default.createElement("div",{ref:u,className:"ag-header-viewport "+p,role:"presentation"},fe.default.createElement("div",{ref:a,className:"ag-header-container",role:"rowgroup"},g())))}),Le=(0,ge.memo)(()=>{const[e,t]=(0,ge.useState)(()=>new Q),[i,s]=(0,ge.useState)(),{context:r}=(0,ge.useContext)(q),n=(0,ge.useRef)(null),o=(0,ge.useRef)(null),a=(0,ge.useCallback)(e=>{if(n.current=e,!e)return r.destroyBean(o.current),void(o.current=null);const i={addOrRemoveCssClass:(e,i)=>t(t=>t.setClass(e,i)),setHeightAndMinHeight:e=>s(e)};o.current=r.createBean(new me.GridHeaderCtrl),o.current.setComp(i,n.current,n.current)},[]),l=(0,ge.useMemo)(()=>"ag-header "+e.toString(),[e]),c=(0,ge.useMemo)(()=>({height:i,minHeight:i}),[i]);return ge.default.createElement("div",{ref:a,className:l,style:c,role:"presentation"},ge.default.createElement(ke,{pinned:"left"}),ge.default.createElement(ke,{pinned:null}),ge.default.createElement(ke,{pinned:"right"}))}),Ne=i(22155),_e=(e,t)=>{(0,Ne.useEffect)(()=>{const i=t.current;if(i){const t=i.parentElement;if(t){const s=document.createComment(e);return t.insertBefore(s,i),()=>{t.removeChild(s)}}}},[e])},Oe=i(98092),Fe=v(i(22155)),Ge=v(i(22155)),Be=i(98092),Ve=i(98092),He=v(i(22155)),Ue=i(98092),ze=v(i(22155)),We=i(70316),je=i(22155),Ke=(0,ze.memo)(e=>{const[t,i]=(0,ze.useState)(),{context:s,popupService:r,localeService:n,gos:o}=(0,ze.useContext)(q);return(()=>{const t=(0,je.useRef)(()=>{const{editDetails:t,cellCtrl:a,eParentCell:l}=e,{compDetails:c}=t,h=o.get("stopEditingWhenCellsLoseFocus"),d=s.createBean(new Ue.PopupEditorWrapper(c.params)),u=d.getGui();if(e.jsChildComp){const t=e.jsChildComp.getGui();t&&u.appendChild(t)}const p={column:a.getColumn(),rowNode:a.getRowNode(),type:"popupCellEditor",eventSource:l,ePopup:u,position:t.popupPosition,keepWithinBounds:!0},g=r.positionPopupByComponent.bind(r,p),m=n.getLocaleTextFunc(),f=r.addPopup({modal:h,eChild:u,closeOnEsc:!0,closedCallback:()=>{a.onPopupEditorClosed()},anchorToElement:l,positionCallback:g,ariaLabel:m("ariaLabelCellEditor","Cell Editor")}),y=f?f.hideFunc:void 0;return i(d),e.jsChildComp&&e.jsChildComp.afterGuiAttached&&e.jsChildComp.afterGuiAttached(),()=>{null!=y&&y(),s.destroyBean(d)}}),a=(0,je.useRef)(),l=(0,je.useRef)(!1),c=(0,je.useRef)(!1),[,h]=(0,je.useState)(0);l.current&&(c.current=!0),(0,je.useEffect)(()=>(l.current||(a.current=t.current(),l.current=!0),h(e=>e+1),()=>{c.current&&a.current&&a.current()}),[])})(),ze.default.createElement(ze.default.Fragment,null,t&&e.wrappedContent&&(0,We.createPortal)(e.wrappedContent,t.getGui()))}),$e=i(22155),Ye=i(98092),qe=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Ye.AgPromise(e=>{this.resolveInstanceCreated=e}),this.onValueChange=e=>this.updateValue(e),this.value=e.value}getProps(){return f(m({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){N(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){var t;this.componentInstance=e,null==(t=this.resolveInstanceCreated)||t.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(e){this.value=e,this.refreshProps()}},Xe=(e,t,i)=>{const s=e.compProxy;return He.default.createElement(He.default.Fragment,null,!s&&He.default.createElement(t,f(m({},e.compDetails.params),{ref:i})),s&&((e,t,i)=>{const{compProxy:s}=e;i(s);const r=s.getProps(),n=J(t);return He.default.createElement(M.Provider,{value:{setMethods:e=>s.setMethods(e)}},n&&He.default.createElement(t,m({},r)),!n&&He.default.createElement(t,f(m({},r),{ref:e=>s.setRef(e)})))})(e,t,i))},Ze=(0,He.memo)(e=>{const{context:t}=(0,He.useContext)(q),{cellCtrl:i,printLayout:s,editingRow:r}=e,n=i.getTabIndex(),o=i.getColumnIdSanitised(),a=i.getInstanceId(),[l,c]=(0,He.useState)(()=>i.isCellRenderer()?void 0:{compDetails:void 0,value:i.getValueToDisplay(),force:!1}),[h,d]=(0,He.useState)(),[u,p]=(0,He.useState)(1),[g,y]=(0,He.useState)(),[v,C]=(0,He.useState)(!1),[b,S]=(0,He.useState)(!1),[w,x]=(0,He.useState)(!1),[E,M]=(0,He.useState)(),A=(0,He.useMemo)(()=>i.isForceWrapper(),[i]),T=(0,He.useMemo)(()=>i.getCellAriaRole(),[i]),D=(0,He.useRef)(null),I=(0,He.useRef)(null),R=(0,He.useRef)(),P=(0,He.useRef)(),k=(0,He.useRef)(),L=(0,He.useRef)([]),N=(0,He.useRef)(),[_,O]=(0,He.useState)(0),F=(0,He.useCallback)(e=>{N.current=e,O(e=>e+1)},[]),G=A||null!=l&&(v||w||b),B=(0,He.useCallback)((e,t)=>{P.current=t,t&&(((e,t,i)=>{const s=i.getColumn();if(!e&&t.isPopup&&t.isPopup()){const e=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor is a popup using colDef.cellEditorPopup=true. AG Grid React cannot depend on the editor component specifying if it's in a popup (via the isPopup() method on the editor), as React needs to know this information BEFORE the component is created.`;Ve._.doOnce(()=>console.warn(e),"jsEditorComp-isPopup-"+i.getColumn().getColId())}if(e&&t.getPopupPosition&&null!=t.getPopupPosition()){const e=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor popup position using colDef.cellEditorPopupPosition=true. AG Grid React cannot depend on the editor component specifying it's position (via the getPopupPosition() method on the editor), as React needs to know this information BEFORE the component is created.`;Ve._.doOnce(()=>console.warn(e),"jsEditorComp-getPopupPosition-"+i.getColumn().getColId())}})(e,t,i),t.isCancelBeforeStart&&t.isCancelBeforeStart()&&setTimeout(()=>{i.stopEditing(!0),i.focusCell(!0)}))},[i]),V=(0,He.useCallback)(e=>B(!0,e),[B]),H=(0,He.useCallback)(e=>B(!1,e),[B]);let U=(0,He.useRef)();U.current||(U.current=new Ve.CssClassManager(()=>D.current)),((e,t,i,s,r,n)=>{const{context:o}=(0,$e.useContext)(q),a=(0,$e.useCallback)(()=>{const e=r.current;if(!e)return;const t=e.getGui();t&&t.parentElement&&t.parentElement.removeChild(t),o.destroyBean(e),r.current=void 0},[]);(0,$e.useEffect)(()=>{const s=null!=e,o=e&&e.compDetails&&!e.compDetails.componentFromFramework;if(!s||!o||t&&null==i)return void a();const l=e.compDetails;if(r.current){const t=r.current,i=!(null==t.refresh||0!=e.force)&&t.refresh(l.params);if(!0===i||void 0===i)return;a()}const c=l.newAgStackInstance();if(!c)return;const h=c.resolveNow(null,e=>e);if(!h)return;const d=h.getGui();d&&((t?i:n.current).appendChild(d),r.current=h)},[e,t,s]),(0,$e.useEffect)(()=>a,[])})(l,G,N.current,_,R,D);const z=(0,He.useRef)();(0,He.useLayoutEffect)(()=>{const e=z.current,t=l;if(z.current=l,null==e||null==e.compDetails||null==t||null==t.compDetails)return;const i=e.compDetails,s=t.compDetails;i.componentClass==s.componentClass&&null!=I.current&&null!=I.current.refresh&&1!=I.current.refresh(s.params)&&p(e=>e+1)},[l]),(0,He.useLayoutEffect)(()=>{if(!h||h.compDetails.componentFromFramework)return;const e=h.compDetails,i=!0===h.popup,s=(e=>{const t=e.newAgStackInstance();if(t)return t.resolveNow(null,e=>e)})(e);if(!s)return;const r=s.getGui();if(B(i,s),!i){const e=(A?k:D).current;null==e||e.appendChild(r),s.afterGuiAttached&&s.afterGuiAttached()}return M(s),()=>{t.destroyBean(s),B(i,void 0),M(void 0),r&&r.parentElement&&r.parentElement.removeChild(r)}},[h]);const W=(0,He.useCallback)(e=>{if(k.current=e,!k.current)return L.current.forEach(e=>e()),void(L.current=[]);const s=e=>{var i;if(e){const s=e.getGui();null==(i=k.current)||i.insertAdjacentElement("afterbegin",s),L.current.push(()=>{t.destroyBean(e),Ve._.removeFromParent(s)})}return e};v&&s(i.createSelectionCheckbox()),w&&s(i.createDndSource()),b&&s(i.createRowDragComp())},[i,t,w,b,v]),j=(0,He.useCallback)(e=>{if(D.current=e,!D.current)return;if(!i)return;const t={addOrRemoveCssClass:(e,t)=>U.current.addOrRemoveCssClass(e,t),setUserStyles:e=>y(e),getFocusableElement:()=>D.current,setIncludeSelection:e=>C(e),setIncludeRowDrag:e=>S(e),setIncludeDndSource:e=>x(e),getCellEditor:()=>P.current||null,getCellRenderer:()=>I.current?I.current:R.current,getParentOfValue:()=>N.current?N.current:k.current?k.current:D.current,setRenderDetails:(e,t,i)=>{c(s=>(null==s?void 0:s.compDetails)!==e||(null==s?void 0:s.value)!==t||(null==s?void 0:s.force)!==i?{value:t,compDetails:e,force:i}:s)},setEditDetails:(e,t,i,s)=>{if(e){let r;s?r=new qe(e.params,()=>p(e=>e+1)):e.componentFromFramework&&Ie(),d({compDetails:e,popup:t,popupPosition:i,compProxy:r}),t||c(void 0)}else d(e=>{(null==e?void 0:e.compProxy)&&(P.current=void 0)})}},n=k.current||void 0;i.setComp(t,D.current,n,s,r)},[]),K=(0,He.useMemo)(()=>!!(l&&l.compDetails&&l.compDetails.componentFromFramework&&J(l.compDetails.componentClass)),[l]);(0,He.useLayoutEffect)(()=>{var e;D.current&&(U.current.addOrRemoveCssClass("ag-cell-value",!G),U.current.addOrRemoveCssClass("ag-cell-inline-editing",!!h&&!h.popup),U.current.addOrRemoveCssClass("ag-cell-popup-editing",!!h&&!!h.popup),U.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!h||!!h.popup),null==(e=i.getRowCtrl())||e.setInlineEditingCss(!!h),i.shouldRestoreFocus()&&!i.isEditing()&&D.current.focus({preventScroll:!0}))});const $=()=>He.default.createElement(He.default.Fragment,null,null!=l&&((e,t,i,s,r,n,o)=>{const{compDetails:a,value:l}=e,c=!a,h=a&&a.componentFromFramework,d=a&&a.componentClass,u=(null==l?void 0:l.toString)?l.toString():l,p=()=>He.default.createElement(He.default.Fragment,null,c&&He.default.createElement(He.default.Fragment,null,u),h&&!n&&He.default.createElement(d,f(m({},a.params),{key:t,ref:s})),h&&n&&He.default.createElement(d,f(m({},a.params),{key:t})));return He.default.createElement(He.default.Fragment,null,r?He.default.createElement("span",{role:"presentation",id:`cell-${i}`,className:"ag-cell-value",ref:o},p()):p())})(l,u,a,I,G,K,F),null!=h&&((e,t,i,s,r,n)=>{const o=e.compDetails,a=o.componentClass,l=o.componentFromFramework&&!e.popup,c=o.componentFromFramework&&e.popup,h=!o.componentFromFramework&&e.popup;return He.default.createElement(He.default.Fragment,null,l&&Xe(e,a,t),c&&He.default.createElement(Ke,{editDetails:e,cellCtrl:r,eParentCell:s,wrappedContent:Xe(e,a,i)}),h&&n&&He.default.createElement(Ke,{editDetails:e,cellCtrl:r,eParentCell:s,jsChildComp:n}))})(h,H,V,D.current,i,E));return He.default.createElement("div",{ref:j,style:g,tabIndex:n,role:T,"col-id":o},G?He.default.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:W},$()):$())}),Qe=(0,Ge.memo)(e=>{const{context:t,gos:i}=(0,Ge.useContext)(q),{rowCtrl:s,containerType:r}=e,n=s.getTabIndex(),o=(0,Ge.useRef)(s.getDomOrder()),a=s.isFullWidth(),l=s.getRowNode().displayed,[c,h]=(0,Ge.useState)(()=>l?s.getRowIndex():null),[d,u]=(0,Ge.useState)(()=>s.getRowId()),[p,g]=(0,Ge.useState)(()=>s.getBusinessKey()),[y,v]=(0,Ge.useState)(()=>s.getRowStyles()),C=(0,Ge.useRef)(null),b=(0,Ge.useRef)(null),[S,w]=(0,Ge.useState)(()=>null),[x,E]=(0,Ge.useState)(),[M,A]=(0,Ge.useState)(()=>l?s.getInitialRowTop(r):void 0),[T,D]=(0,Ge.useState)(()=>l?s.getInitialTransform(r):void 0),I=(0,Ge.useRef)(null),R=(0,Ge.useRef)(),P=(0,Ge.useRef)(!1),[k,L]=(0,Ge.useState)(0);(0,Ge.useEffect)(()=>{var e;if(P.current)return;if(!x)return;if(k>10)return;const t=null==(e=I.current)?void 0:e.firstChild;t?(s.setupDetailRowAutoHeight(t),P.current=!0):L(e=>e+1)},[x,k]);let N=(0,Ge.useRef)();N.current||(N.current=new Be.CssClassManager(()=>I.current));const _=(0,Ge.useCallback)(e=>{if(I.current=e,!I.current)return void s.unsetComp(r);if(!s.isAlive())return;const t={setTop:A,setTransform:D,addOrRemoveCssClass:(e,t)=>N.current.addOrRemoveCssClass(e,t),setDomOrder:e=>o.current=e,setRowIndex:h,setRowId:u,setRowBusinessKey:g,setUserStyles:v,setCellCtrls:(e,t)=>{b.current=C.current,C.current=e;const i=se(b.current,e,o.current);i!==b.current&&ie(t,()=>w(i))},showFullWidth:e=>E(e),getFullWidthCellRenderer:()=>R.current,refreshFullWidth:e=>V.current?(E(t=>f(m({},t),{params:e()})),!0):!(!R.current||!R.current.refresh)&&R.current.refresh(e())};s.setComp(t,I.current,r)},[]);(0,Ge.useLayoutEffect)(()=>oe(x,t,I.current,R),[x]);const O=(0,Ge.useMemo)(()=>{const e={top:M,transform:T};return Object.assign(e,y),e},[M,T,y]),F=a&&x&&x.componentFromFramework,G=!a&&null!=S,B=(0,Ge.useMemo)(()=>!(!(null==x?void 0:x.componentFromFramework)||!J(x.componentClass)),[x]),V=(0,Ge.useRef)(!1);return(0,Ge.useEffect)(()=>{V.current=B&&!!x&&!!i.get("reactiveCustomComponents")},[B,x]),Ge.default.createElement("div",{ref:_,role:"row",style:O,"row-index":c,"row-id":d,"row-business-key":p,tabIndex:n},G&&(null==S?void 0:S.map(e=>Ge.default.createElement(Ze,{cellCtrl:e,editingRow:s.isEditing(),printLayout:s.isPrintLayout(),key:e.getInstanceId()}))),F&&(()=>{const e=x.componentClass;return Ge.default.createElement(Ge.default.Fragment,null,B&&Ge.default.createElement(e,m({},x.params)),!B&&Ge.default.createElement(e,f(m({},x.params),{ref:R})))})())}),Je=(0,Fe.memo)(e=>{const{context:t}=(0,Fe.useContext)(q),{name:i}=e,s=(0,Fe.useMemo)(()=>(0,Oe.getRowContainerTypeForName)(i),[i]),r=(0,Fe.useRef)(null),n=(0,Fe.useRef)(null),o=(0,Fe.useRef)([]),a=(0,Fe.useRef)([]),[l,c]=(0,Fe.useState)(()=>[]),h=(0,Fe.useRef)(!1),d=(0,Fe.useRef)(),u=(0,Fe.useMemo)(()=>Oe.RowContainerCtrl.getRowContainerCssClasses(i),[i]),p=(0,Fe.useMemo)(()=>Z(u.viewport),[u]),g=(0,Fe.useMemo)(()=>Z(u.container),[u]),m=i===Oe.RowContainerName.CENTER||i===Oe.RowContainerName.TOP_CENTER||i===Oe.RowContainerName.BOTTOM_CENTER||i===Oe.RowContainerName.STICKY_TOP_CENTER||i===Oe.RowContainerName.STICKY_BOTTOM_CENTER;_e(" AG Row Container "+i+" ",m?r:n);const f=(0,Fe.useCallback)(()=>m?null!=r.current&&null!=n.current:null!=n.current,[]),y=(0,Fe.useCallback)(()=>m?null==r.current&&null==n.current:null==n.current,[]),v=(0,Fe.useCallback)(()=>{if(y()&&(t.destroyBean(d.current),d.current=null),f()){const e=e=>{const t=se(a.current,o.current,h.current);t!==a.current&&(a.current=t,ie(e,()=>c(t)))},s={setViewportHeight:e=>{r.current&&(r.current.style.height=e)},setRowCtrls:({rowCtrls:t,useFlushSync:i})=>{const s=!!i&&o.current.length>0&&t.length>0;o.current=t,e(s)},setDomOrder:t=>{h.current!=t&&(h.current=t,e(!1))},setContainerWidth:e=>{n.current&&(n.current.style.width=e)}};d.current=t.createBean(new Oe.RowContainerCtrl(i)),d.current.setComp(s,n.current,r.current)}},[f,y]),C=(0,Fe.useCallback)(e=>{n.current=e,v()},[v]),b=(0,Fe.useCallback)(e=>{r.current=e,v()},[v]),S=()=>Fe.default.createElement("div",{className:g,ref:C,role:"rowgroup"},l.map(e=>Fe.default.createElement(Qe,{rowCtrl:e,containerType:s,key:e.getInstanceId()})));return Fe.default.createElement(Fe.default.Fragment,null,m?Fe.default.createElement("div",{className:p,ref:b,role:"presentation"},S()):S())}),et=(0,pe.memo)(()=>{const{context:e,agStackComponentsRegistry:t,resizeObserverService:i}=(0,pe.useContext)(q),[s,r]=(0,pe.useState)(""),[n,o]=(0,pe.useState)(0),[a,l]=(0,pe.useState)(0),[c,h]=(0,pe.useState)("0px"),[d,u]=(0,pe.useState)("0px"),[p,g]=(0,pe.useState)("100%"),[m,f]=(0,pe.useState)("0px"),[y,v]=(0,pe.useState)("0px"),[C,b]=(0,pe.useState)("100%"),[S,w]=(0,pe.useState)(""),[x,E]=(0,pe.useState)(""),[M,A]=(0,pe.useState)(null),[T,D]=(0,pe.useState)(""),[I,R]=(0,pe.useState)(null),[P,k]=(0,pe.useState)("ag-layout-normal");let L=(0,pe.useRef)();L.current||(L.current=new ue.CssClassManager(()=>N.current));const N=(0,pe.useRef)(null),_=(0,pe.useRef)(null),O=(0,pe.useRef)(null),F=(0,pe.useRef)(null),G=(0,pe.useRef)(null),B=(0,pe.useRef)(null),V=(0,pe.useRef)(null),H=(0,pe.useRef)([]),U=(0,pe.useRef)([]);_e(" AG Grid Body ",N),_e(" AG Pinned Top ",_),_e(" AG Sticky Top ",O),_e(" AG Middle ",B),_e(" AG Pinned Bottom ",V);const z=(0,pe.useCallback)(s=>{if(N.current=s,!N.current)return e.destroyBeans(H.current),U.current.forEach(e=>e()),H.current=[],void(U.current=[]);if(!e)return;const n=i=>{const s=t.getComponentClass(i),r=e.createBean(new s);return H.current.push(r),r},a=(e,t)=>{e.appendChild(t),U.current.push(()=>e.removeChild(t))};a(N.current,document.createComment(" AG Fake Horizontal Scroll ")),a(N.current,n("AG-FAKE-HORIZONTAL-SCROLL").getGui()),a(N.current,document.createComment(" AG Overlay Wrapper ")),a(N.current,n("AG-OVERLAY-WRAPPER").getGui()),G.current&&(a(G.current,document.createComment(" AG Fake Vertical Scroll ")),a(G.current,n("AG-FAKE-VERTICAL-SCROLL").getGui()));const c={setRowAnimationCssOnBodyViewport:r,setColumnCount:e=>{N.current&&ue._.setAriaColCount(N.current,e)},setRowCount:e=>{N.current&&ue._.setAriaRowCount(N.current,e)},setTopHeight:o,setBottomHeight:l,setStickyTopHeight:h,setStickyTopTop:u,setStickyTopWidth:g,setTopDisplay:w,setBottomDisplay:E,setColumnMovingCss:(e,t)=>L.current.addOrRemoveCssClass(e,t),updateLayoutClasses:k,setAlwaysVerticalScrollClass:A,setPinnedTopBottomOverflowY:D,setCellSelectableCss:(e,t)=>R(t?e:null),setBodyViewportWidth:e=>{B.current&&(B.current.style.width=e)},registerBodyViewportResizeListener:e=>{if(B.current){const t=i.observeResize(B.current,e);U.current.push(()=>t())}},setStickyBottomHeight:f,setStickyBottomBottom:v,setStickyBottomWidth:b},d=e.createBean(new ue.GridBodyCtrl);H.current.push(d),d.setComp(c,N.current,B.current,_.current,V.current,O.current,F.current)},[]),W=(0,pe.useMemo)(()=>Z("ag-root","ag-unselectable",P),[P]),j=(0,pe.useMemo)(()=>Z("ag-body-viewport",s,P,M,I),[s,P,M,I]),K=(0,pe.useMemo)(()=>Z("ag-body",P),[P]),$=(0,pe.useMemo)(()=>Z("ag-floating-top",I),[I]),Y=(0,pe.useMemo)(()=>Z("ag-sticky-top",I),[I]),X=(0,pe.useMemo)(()=>Z("ag-sticky-bottom",I),[I]),Q=(0,pe.useMemo)(()=>Z("ag-floating-bottom",I),[I]),J=(0,pe.useMemo)(()=>({height:n,minHeight:n,display:S,overflowY:T}),[n,S,T]),ee=(0,pe.useMemo)(()=>({height:c,top:d,width:p}),[c,d,p]),te=(0,pe.useMemo)(()=>({height:m,bottom:y,width:C}),[m,y,C]),ie=(0,pe.useMemo)(()=>({height:a,minHeight:a,display:x,overflowY:T}),[a,x,T]),se=e=>pe.default.createElement(Je,{name:e,key:`${e}-container`}),re=({section:e,children:t,className:i,style:s})=>pe.default.createElement("div",{ref:e,className:i,role:"presentation",style:s},t.map(se));return pe.default.createElement("div",{ref:z,className:W,role:"treegrid"},pe.default.createElement(Le,null),re({section:_,className:$,style:J,children:[ue.RowContainerName.TOP_LEFT,ue.RowContainerName.TOP_CENTER,ue.RowContainerName.TOP_RIGHT,ue.RowContainerName.TOP_FULL_WIDTH]}),pe.default.createElement("div",{className:K,ref:G,role:"presentation"},re({section:B,className:j,children:[ue.RowContainerName.LEFT,ue.RowContainerName.CENTER,ue.RowContainerName.RIGHT,ue.RowContainerName.FULL_WIDTH]})),re({section:O,className:Y,style:ee,children:[ue.RowContainerName.STICKY_TOP_LEFT,ue.RowContainerName.STICKY_TOP_CENTER,ue.RowContainerName.STICKY_TOP_RIGHT,ue.RowContainerName.STICKY_TOP_FULL_WIDTH]}),re({section:F,className:X,style:te,children:[ue.RowContainerName.STICKY_BOTTOM_LEFT,ue.RowContainerName.STICKY_BOTTOM_CENTER,ue.RowContainerName.STICKY_BOTTOM_RIGHT,ue.RowContainerName.STICKY_BOTTOM_FULL_WIDTH]}),re({section:V,className:Q,style:ie,children:[ue.RowContainerName.BOTTOM_LEFT,ue.RowContainerName.BOTTOM_CENTER,ue.RowContainerName.BOTTOM_RIGHT,ue.RowContainerName.BOTTOM_FULL_WIDTH]}))}),tt=v(i(22155)),it=i(98092),st=(0,tt.forwardRef)((e,t)=>{const{children:i,eFocusableElement:s,onTabKeyDown:r,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:o}=e,{context:a}=(0,tt.useContext)(q),l=(0,tt.useRef)(null),c=(0,tt.useRef)(null),h=(0,tt.useRef)(),d=e=>{const t=null==e?void 0:parseInt(e,10).toString();[l,c].forEach(e=>{var i,s;void 0===t?null==(i=e.current)||i.removeAttribute("tabindex"):null==(s=e.current)||s.setAttribute("tabindex",t)})};(0,tt.useImperativeHandle)(t,()=>({forceFocusOutOfContainer(e){var t;null==(t=h.current)||t.forceFocusOutOfContainer(e)}}));const u=(0,tt.useCallback)(()=>{if(!l.current&&!c.current)return a.destroyBean(h.current),void(h.current=null);if(l.current&&c.current){const e={setTabIndex:d};h.current=a.createBean(new it.TabGuardCtrl({comp:e,eTopGuard:l.current,eBottomGuard:c.current,eFocusableElement:s,onTabKeyDown:r,forceFocusOutWhenTabGuardsAreEmpty:o,focusInnerElement:e=>n.focusInnerElement(e)}))}},[]),p=(0,tt.useCallback)(e=>{l.current=e,u()},[u]),g=(0,tt.useCallback)(e=>{c.current=e,u()},[u]),m=e=>{const t="top"===e?it.TabGuardClassNames.TAB_GUARD_TOP:it.TabGuardClassNames.TAB_GUARD_BOTTOM;return tt.default.createElement("div",{className:`${it.TabGuardClassNames.TAB_GUARD} ${t}`,role:"presentation",ref:"top"===e?p:g})};return tt.default.createElement(tt.default.Fragment,null,m("top"),i,m("bottom"))}),rt=(0,tt.memo)(st),nt=(0,de.memo)(({context:e})=>{const[t,i]=(0,de.useState)(""),[s,r]=(0,de.useState)(""),[n,o]=(0,de.useState)(""),[a,l]=(0,de.useState)(null),[c,h]=(0,de.useState)(null),[d,u]=(0,de.useState)(!1),[p,g]=(0,de.useState)(),m=(0,de.useRef)(null),f=(0,de.useRef)(null),y=(0,de.useRef)(),[v,C]=(0,de.useState)(null),b=(0,de.useRef)(()=>{}),S=(0,de.useCallback)(()=>{},[]),w=(0,de.useMemo)(()=>e.isDestroyed()?null:e.getBean("beans"),[e]);_e(" AG Grid ",f);const x=(0,de.useCallback)(t=>{if(f.current=t,!f.current)return e.destroyBean(m.current),void(m.current=null);if(e.isDestroyed())return;m.current=e.createBean(new he.GridCtrl);const s=m.current;b.current=s.focusInnerElement.bind(s);const r={destroyGridUi:()=>{},setRtlClass:i,forceFocusOutOfContainer:e=>{var t;null==(t=y.current)||t.forceFocusOutOfContainer(e)},updateLayoutClasses:o,getFocusableContainers:()=>{var e,t;const i=[],s=null==(e=f.current)?void 0:e.querySelector(".ag-root"),r=null==(t=f.current)?void 0:t.querySelector(".ag-side-bar:not(.ag-hidden)");return s&&i.push(s),r&&i.push(r),i},setCursor:l,setUserSelect:h};s.setComp(r,f.current,f.current),u(!0)},[]);(0,de.useEffect)(()=>{if(!(p&&w&&m.current&&v&&f.current))return;const t=m.current,i=[],{agStackComponentsRegistry:s}=w,r=s.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),n=s.getComponentClass("AG-SIDE-BAR"),o=s.getComponentClass("AG-STATUS-BAR"),a=s.getComponentClass("AG-WATERMARK"),l=s.getComponentClass("AG-PAGINATION"),c=[],h=f.current;if(t.showDropZones()&&r){const t=e.createBean(new r),s=t.getGui();h.insertAdjacentElement("afterbegin",s),c.push(s),i.push(t)}if(t.showSideBar()&&n){const t=e.createBean(new n),s=t.getGui(),r=v.querySelector(".ag-tab-guard-bottom");r&&(r.insertAdjacentElement("beforebegin",s),c.push(s)),i.push(t)}if(t.showStatusBar()&&o){const t=e.createBean(new o),s=t.getGui();h.insertAdjacentElement("beforeend",s),c.push(s),i.push(t)}if(l){const t=e.createBean(new l),s=t.getGui();h.insertAdjacentElement("beforeend",s),c.push(s),i.push(t)}if(t.showWatermark()&&a){const t=e.createBean(new a),s=t.getGui();h.insertAdjacentElement("beforeend",s),c.push(s),i.push(t)}return()=>{e.destroyBeans(i),c.forEach(e=>{e.parentElement&&e.parentElement.removeChild(e)})}},[p,v,w]);const E=(0,de.useMemo)(()=>Z("ag-root-wrapper",t,s,n),[t,s,n]),M=(0,de.useMemo)(()=>Z("ag-root-wrapper-body","ag-focus-managed",n),[n]),A=(0,de.useMemo)(()=>({userSelect:null!=c?c:"",WebkitUserSelect:null!=c?c:"",cursor:null!=a?a:""}),[c,a]),T=(0,de.useCallback)(e=>{y.current=e,g(null!==e)},[]);return de.default.createElement("div",{ref:x,className:E,style:A,role:"presentation"},de.default.createElement("div",{className:M,ref:C,role:"presentation"},d&&v&&w&&de.default.createElement(q.Provider,{value:w},de.default.createElement(rt,{ref:T,eFocusableElement:v,onTabKeyDown:S,gridCtrl:m.current,forceFocusOutWhenTabGuardsAreEmpty:!0},de.default.createElement(et,null)))))}),ot=e=>{var t,i;const s=(0,w.useRef)(),r=(0,w.useRef)(null),n=(0,w.useRef)(null),o=(0,w.useRef)([]),a=(0,w.useRef)([]),l=(0,w.useRef)(e),c=(0,w.useRef)(!1),[h,d]=(0,w.useState)(void 0),[,u]=(0,w.useState)(0),p=(0,w.useCallback)(t=>{if(r.current=t,!r.current)return o.current.forEach(e=>e()),void(o.current.length=0);const i=e.modules||[];n.current||(n.current=new Y(()=>u(e=>e+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),o.current.push(()=>{var e;null==(e=n.current)||e.destroy(),n.current=null}));const l=S.ComponentUtil.combineAttributesAndGridOptions(e.gridOptions,e),h={providedBeanInstances:{frameworkComponentWrapper:new at(n.current,!!l.reactiveCustomComponents)},modules:i,frameworkOverrides:new ct},p=new S.GridCoreCreator;s.current=p.create(r.current,l,t=>{d(t),o.current.push(()=>{t.destroy()}),t.getBean(S.CtrlsService.NAME).whenReady(()=>{if(t.isDestroyed())return;const i=s.current;i&&e.setGridApi&&e.setGridApi(i,new S.ColumnApi(i))})},e=>{e.getBean(S.CtrlsService.NAME).whenReady(()=>{a.current.forEach(e=>e()),a.current.length=0,c.current=!0})},h)},[]),g=(0,w.useMemo)(()=>m({height:"100%"},e.containerStyle||{}),[e.containerStyle]),f=(0,w.useCallback)(e=>{c.current?e():a.current.push(e)},[]);return(0,w.useEffect)(()=>{const t=function(e,t){const i={};return Object.keys(t).forEach(s=>{const r=t[s];e[s]!==r&&(i[s]=r)}),i}(l.current,e);l.current=e,f(()=>{s.current&&S.ComponentUtil.processOnChange(t,s.current)})},[e]),w.default.createElement("div",{style:g,className:e.className,ref:p},h&&!h.isDestroyed()?w.default.createElement(nt,{context:h}):null,null!=(i=null==(t=n.current)?void 0:t.getPortals())?i:null)},at=class extends S.BaseComponentWrapper{constructor(e,t){super(),this.parent=e,this.reactiveCustomComponents=t}createWrapper(e,t){if(this.reactiveCustomComponents){const i=(e=>{switch(e){case"filter":return F;case"floatingFilterComponent":return H;case"dateComponent":return O;case"loadingOverlayComponent":return U;case"noRowsOverlayComponent":return W;case"statusPanel":return j;case"toolPanel":return K;case"menuItem":return z}})(t.propertyName);if(i)return new i(e,this.parent,t)}else switch(t.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":Ie()}const i=!t.cellRenderer&&"toolPanel"!==t.propertyName;return new L(e,this.parent,t,i)}},lt=(0,w.forwardRef)((e,t)=>{const{ctrlsFactory:i,context:s,gos:r,resizeObserverService:n,clientSideRowModel:o,serverSideRowModel:a}=(0,w.useContext)(q),[l,c]=(0,w.useState)(()=>new Q),[h,d]=(0,w.useState)(()=>new Q),[u,p]=(0,w.useState)(),[g,y]=(0,w.useState)(),v=(0,w.useRef)(),C=(0,w.useRef)(null),b=(0,w.useRef)(),x=(0,w.useMemo)(()=>S.ModuleRegistry.__getGridRegisteredModules(e.api.getGridId()),[e]),E=(0,w.useMemo)(()=>l.toString()+" ag-details-row",[l]),M=(0,w.useMemo)(()=>h.toString()+" ag-details-grid",[h]);t&&(0,w.useImperativeHandle)(t,()=>({refresh(){var e,t;return null!=(t=null==(e=v.current)?void 0:e.refresh())&&t}})),e.template&&S._.warnOnce("detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/");const A=(0,w.useCallback)(t=>{if(C.current=t,!C.current)return s.destroyBean(v.current),void(b.current&&b.current());const l={addOrRemoveCssClass:(e,t)=>c(i=>i.setClass(e,t)),addOrRemoveDetailGridCssClass:(e,t)=>d(i=>i.setClass(e,t)),setDetailGrid:e=>p(e),setRowData:e=>y(e),getGui:()=>C.current},h=i.getInstance("detailCellRenderer");if(h&&(s.createBean(h),h.init(l,e),v.current=h,r.get("detailRowAutoHeight"))){const t=()=>{if(null==C.current)return;const t=C.current.clientHeight;null!=t&&t>0&&setTimeout(()=>{e.node.setRowHeight(t),o?o.onRowHeightChanged():a&&a.onRowHeightChanged()},0)};b.current=n.observeResize(C.current,t),t()}},[]),T=(0,w.useCallback)((e,t)=>{var i;null==(i=v.current)||i.registerDetailWithMaster(e,t)},[]);return w.default.createElement("div",{className:E,ref:A},u&&w.default.createElement(ot,f(m({className:M},u),{modules:x,rowData:g,setGridApi:T})))}),ct=class extends S.VanillaFrameworkOverrides{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:ce,agGroupRowRenderer:ce,agDetailCellRenderer:lt},this.wrapIncoming=(e,t)=>{return"ensureVisible"===t?(i=e,te||setTimeout(()=>te=!1,0),te=!0,i()):e();var i},this.renderingEngine="react"}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}},ht=class extends b.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(e,t)=>{this.api=e,this.columnApi=t,this.apiListeners.forEach(t=>t(e))}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return b.default.createElement(ot,f(m({},this.props),{setGridApi:this.setGridApi}))}},dt=(e=>(e.IdentityCheck="IdentityCheck",e.DeepValueCheck="DeepValueCheck",e.NoCheck="NoCheck",e))(dt||{}),ut=i(22155);function pt(e){const{setMethods:t}=(0,ut.useContext)(M);t(e)}function gt(e){pt(e)}function mt(e){return pt(e)}function ft(e){return pt(e)}function yt(e){pt(e)}function vt(e){pt(e)}},32535(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(28825),r=i(38994),n=i(28261),o=i(36023),a=i(28425),l=i(86660),c="errorMessage",h=new s.Name("emUsed"),d={required:"missingProperty",dependencies:"property",dependentRequired:"property"},u=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,g=/^""\s*\+\s*|\s*\+\s*""$/g;const m=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:c,schemaType:["string","object"],post:!0,code(t){const{gen:i,data:m,schema:f,schemaValue:y,it:v}=t;if(!1===v.createErrors)return;const C=f,b=r.strConcat(l.default.instancePath,v.errorPath);function S(e,t){return r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${h}`,s._`${e}.instancePath === ${b}`,s._`${e}.keyword in ${t}`,s._`${e}.schemaPath.indexOf(${v.errSchemaPath}) === 0`,s._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${v.errSchemaPath.length}))`)}function w(e,t){const s=[];for(const i in e){const e=t[i];u.test(e)&&s.push([i,E(e)])}return i.object(...s)}function x(e){return u.test(e)?new n._Code(n.safeStringify(e).replace(p,(e,t)=>`" + JSON.stringify(${o.getData(t,v)}) + "`).replace(g,"")):s.stringify(e)}function E(e){return s._`function(){return ${x(e)}}`}i.if(s._`${l.default.errors} > 0`,()=>{if("object"==typeof C){const[n,o]=function(e){let t,i;for(const s in e){if("properties"===s||"items"===s)continue;const r=e[s];if("object"==typeof r){t||(t={});const e=t[s]={};for(const t in r)e[t]=[]}else i||(i={}),i[s]=[]}return[t,i]}(C);o&&function(r){const n=i.const("emErrors",s.stringify(r)),o=i.const("templates",w(r,f));i.forOf("err",l.default.vErrors,e=>i.if(S(e,n),()=>i.code(s._`${n}[${e}.keyword].push(${e})`).assign(s._`${e}.${h}`,!0)));const{singleError:c}=e;if(c){const e=i.let("message",s._`""`),r=i.let("paramsErrors",s._`[]`);d(t=>{i.if(e,()=>i.code(s._`${e} += ${"string"==typeof c?c:";"}`)),i.code(s._`${e} += ${u(t)}`),i.assign(r,s._`${r}.concat(${n}[${t}])`)}),a.reportError(t,{message:e,params:s._`{errors: ${r}}`})}else d(e=>a.reportError(t,{message:u(e),params:s._`{errors: ${n}[${e}]}`}));function d(e){i.forIn("key",n,t=>i.if(s._`${n}[${t}].length`,()=>e(t)))}function u(e){return s._`${e} in ${o} ? ${o}[${e}]() : ${y}[${e}]`}}(o),n&&function(e){const r=i.const("emErrors",s.stringify(e)),n=[];for(const t in e)n.push([t,w(e[t],f[t])]);const o=i.const("templates",i.object(...n)),c=i.scopeValue("obj",{ref:d,code:s.stringify(d)}),u=i.let("emPropParams"),p=i.let("emParamsErrors");i.forOf("err",l.default.vErrors,e=>i.if(S(e,r),()=>{i.assign(u,s._`${c}[${e}.keyword]`),i.assign(p,s._`${r}[${e}.keyword][${e}.params[${u}]]`),i.if(p,()=>i.code(s._`${p}.push(${e})`).assign(s._`${e}.${h}`,!0))})),i.forIn("key",r,e=>i.forIn("keyProp",s._`${r}[${e}]`,n=>{i.assign(p,s._`${r}[${e}][${n}]`),i.if(s._`${p}.length`,()=>{const r=i.const("tmpl",s._`${o}[${e}] && ${o}[${e}][${n}]`);a.reportError(t,{message:s._`${r} ? ${r}() : ${y}[${e}][${n}]`,params:s._`{errors: ${p}}`})})}))}(n),function(e){const{props:n,items:o}=e;if(!n&&!o)return;const d=s._`typeof ${m} == "object"`,u=s._`Array.isArray(${m})`,p=i.let("emErrors");let g,v;const C=i.let("templates");function S(e,t){i.assign(p,s.stringify(e)),i.assign(C,w(e,t))}n&&o?(g=i.let("emChildKwd"),i.if(d),i.if(u,()=>{S(o,f.items),i.assign(g,s.str`items`)},()=>{S(n,f.properties),i.assign(g,s.str`properties`)}),v=s._`[${g}]`):o?(i.if(u),S(o,f.items),v=s._`.items`):n&&(i.if(r.and(d,r.not(u))),S(n,f.properties),v=s._`.properties`),i.forOf("err",l.default.vErrors,e=>function(e,t,n){i.if(r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${h}`,s._`${e}.instancePath.indexOf(${b}) === 0`),()=>{const r=i.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:s._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),o=i.const("emMatches",s._`${r}.exec(${e}.instancePath.slice(${b}.length))`),a=i.const("emChild",s._`${o} && ${o}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);i.if(s._`${a} !== undefined && ${a} in ${t}`,()=>n(a))})}(e,p,t=>i.code(s._`${p}[${t}].push(${e})`).assign(s._`${e}.${h}`,!0))),i.forIn("key",p,e=>i.if(s._`${p}[${e}].length`,()=>{a.reportError(t,{message:s._`${e} in ${C} ? ${C}[${e}]() : ${y}${v}[${e}]`,params:s._`{errors: ${p}[${e}]}`}),i.assign(s._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,s._`${b} + "/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),i.endIf()}(function({properties:e,items:t}){const i={};if(e){i.props={};for(const t in e)i.props[t]=[]}if(t){i.items={};for(let e=0;e<t.length;e++)i.items[e]=[]}return i}(C))}const n="string"==typeof C?C:C._;n&&function(e){const n=i.const("emErrs",s._`[]`);i.forOf("err",l.default.vErrors,e=>i.if(function(e){return r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${h}`,r.or(s._`${e}.instancePath === ${b}`,r.and(s._`${e}.instancePath.indexOf(${b}) === 0`,s._`${e}.instancePath[${b}.length] === "/"`)),s._`${e}.schemaPath.indexOf(${v.errSchemaPath}) === 0`,s._`${e}.schemaPath[${v.errSchemaPath}.length] === "/"`)}(e),()=>i.code(s._`${n}.push(${e})`).assign(s._`${e}.${h}`,!0))),i.if(s._`${n}.length`,()=>a.reportError(t,{message:x(e),params:s._`{errors: ${n}}`}))}(n),e.keepErrors||function(){const e=i.const("emErrs",s._`[]`);i.forOf("err",l.default.vErrors,t=>i.if(s._`!${t}.${h}`,()=>i.code(s._`${e}.push(${t})`))),i.assign(l.default.vErrors,e).assign(l.default.errors,s._`${e}.length`)}()})},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(t))};t.default=m,e.exports=m,e.exports.default=m},5888(e,t){"use strict";function i(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:i(n,o),time:i(l(!0),c),"date-time":i(u(!0),p),"iso-time":i(l(),h),"iso-date-time":i(u(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return m.test(e)&&f.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(C.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=2147483647&&e>=-2147483648}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:i(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"iso-date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(e){const t=s.exec(e);if(!t)return!1;const i=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(2===n&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:r[n])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(e){return function(t){const i=a.exec(t);if(!i)return!1;const s=+i[1],r=+i[2],n=+i[3],o=i[4],l="-"===i[5]?-1:1,c=+(i[6]||0),h=+(i[7]||0);if(c>23||h>59||e&&!o)return!1;if(s<=23&&r<=59&&n<60)return!0;const d=r-h*l,u=s-c*l-(d<0?1:0);return(23===u||-1===u)&&(59===d||-1===d)&&n<61}}function c(e,t){if(!e||!t)return;const i=new Date("2020-01-01T"+e).valueOf(),s=new Date("2020-01-01T"+t).valueOf();return i&&s?i-s:void 0}function h(e,t){if(!e||!t)return;const i=a.exec(e),s=a.exec(t);return i&&s?(e=i[1]+i[2]+i[3])>(t=s[1]+s[2]+s[3])?1:e<t?-1:0:void 0}const d=/t|\s/i;function u(e){const t=l(e);return function(e){const i=e.split(d);return 2===i.length&&n(i[0])&&t(i[1])}}function p(e,t){if(!e||!t)return;const i=new Date(e).valueOf(),s=new Date(t).valueOf();return i&&s?i-s:void 0}function g(e,t){if(!e||!t)return;const[i,s]=e.split(d),[r,n]=t.split(d),a=o(i,r);return void 0!==a?a||c(s,n):void 0}const m=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(){return!0}const C=/[^\\]\\Z/},91712(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(5888),r=i(59035),n=i(38994),o=new n.Name("fullFormats"),a=new n.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,s.fullFormats,o),e;const[i,n]="fast"===t.mode?[s.fastFormats,a]:[s.fullFormats,o];return c(e,t.formats||s.formatNames,i,n),t.keywords&&(0,r.default)(e),e};function c(e,t,i,s){var r,o;null!==(r=(o=e.opts.code).formats)&&void 0!==r||(o.formats=n._`require("ajv-formats/dist/formats").${s}`);for(const s of t)e.addFormat(s,i[s])}l.get=(e,t="full")=>{const i=("fast"===t?s.fastFormats:s.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l},59035(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const s=i(28825),r=i(38994),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},a={message:({keyword:e,schemaCode:t})=>r.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:i,schemaCode:n,keyword:a,it:l}=e,{opts:c,self:h}=l;if(!c.validateFormats)return;const d=new s.KeywordCxt(l,h.RULES.all.format.definition,"format");function u(e){return r._`${e}.compare(${i}, ${n}) ${o[a].fail} 0`}d.$data?function(){const i=t.scopeValue("formats",{ref:h.formats,code:c.code.formats}),s=t.const("fmt",r._`${i}[${d.schemaCode}]`);e.fail$data((0,r.or)(r._`typeof ${s} != "object"`,r._`${s} instanceof RegExp`,r._`typeof ${s}.compare != "function"`,u(s)))}():function(){const i=d.schema,s=h.formats[i];if(!s||!0===s)return;if("object"!=typeof s||s instanceof RegExp||"function"!=typeof s.compare)throw new Error(`"${a}": format "${i}" does not define "compare" function`);const n=t.scopeValue("formats",{key:i,ref:s,code:c.code.formats?r._`${c.code.formats}${(0,r.getProperty)(i)}`:void 0});e.fail$data(u(n))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},28825(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const s=i(51967),r=i(83959),n=i(29376),o=i(7456),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends s.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var h=i(36023);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var d=i(38994);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var u=i(74383);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return u.default}});var p=i(4220);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},28261(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class i{}t._CodeOrName=i,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends i{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class r extends i{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function n(e,...t){const i=[e[0]];let s=0;for(;s<t.length;)l(i,t[s]),i.push(e[++s]);return new r(i)}t._Code=r,t.nil=new r(""),t._=n;const o=new r("+");function a(e,...t){const i=[h(e[0])];let s=0;for(;s<t.length;)i.push(o),l(i,t[s]),i.push(o,h(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const i=c(e[t-1],e[t+1]);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(i),new r(i)}function l(e,t){var i;t instanceof r?e.push(...t._items):t instanceof s?e.push(t):e.push("number"==typeof(i=t)||"boolean"==typeof i||null===i?i:h(Array.isArray(i)?i.join(","):i))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof s?void 0:`"${e}${t.slice(1)}`}function h(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new r(h(e))},t.safeStringify=h,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new r(`.${e}`):n`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new r(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new r(e.toString())}},38994(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const s=i(28261),r=i(44490);var n=i(28261);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var o=i(44490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,i){super(),this.varKind=e,this.name=t,this.rhs=i}render({es5:e,_n:t}){const i=e?r.varKinds.var:this.varKind,s=void 0===this.rhs?"":` = ${this.rhs}`;return`${i} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=P(this.rhs,e,t)),this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,i){super(),this.lhs=e,this.rhs=t,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof s.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=P(this.rhs,e,t),this}get names(){return R(this.lhs instanceof s.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(e,t,i,s){super(e,i,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class g extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=P(this.code,e,t),this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,i)=>t+i.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const i=e[t].optimizeNodes();Array.isArray(i)?e.splice(t,1,...i):i?e[t]=i:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:i}=this;let s=i.length;for(;s--;){const r=i[s];r.optimizeNames(e,t)||(k(e,r.names),i.splice(s,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>I(e,t.names),{})}}class f extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class v extends f{}v.kind="else";class C extends f{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof C?t:t.nodes:this.nodes.length?this:new C(L(e),t instanceof C?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var i;if(this.else=null===(i=this.else)||void 0===i?void 0:i.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=P(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&I(e,this.else.names),e}}C.kind="if";class b extends f{}b.kind="for";class S extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=P(this.iteration,e,t),this}get names(){return I(super.names,this.iteration.names)}}class w extends b{constructor(e,t,i,s){super(),this.varKind=e,this.name=t,this.from=i,this.to=s}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:i,from:s,to:n}=this;return`for(${t} ${i}=${s}; ${i}<${n}; ${i}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class x extends b{constructor(e,t,i,s){super(),this.loop=e,this.varKind=t,this.name=i,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=P(this.iterable,e,t),this}get names(){return I(super.names,this.iterable.names)}}class E extends f{constructor(e,t,i){super(),this.name=e,this.args=t,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class M extends m{render(e){return"return "+super.render(e)}}M.kind="return";class A extends f{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var i,s;return super.optimizeNames(e,t),null===(i=this.catch)||void 0===i||i.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&I(e,this.catch.names),this.finally&&I(e,this.finally.names),e}}class T extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}T.kind="catch";class D extends f{render(e){return"finally"+super.render(e)}}function I(e,t){for(const i in t)e[i]=(e[i]||0)+(t[i]||0);return e}function R(e,t){return t instanceof s._CodeOrName?I(e,t.names):e}function P(e,t,i){return e instanceof s.Name?n(e):(r=e)instanceof s._Code&&r._items.some(e=>e instanceof s.Name&&1===t[e.str]&&void 0!==i[e.str])?new s._Code(e._items.reduce((e,t)=>(t instanceof s.Name&&(t=n(t)),t instanceof s._Code?e.push(...t._items):e.push(t),e),[])):e;var r;function n(e){const s=i[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function k(e,t){for(const i in t)e[i]=(e[i]||0)-(t[i]||0)}function L(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:s._`!${F(e)}`}D.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const i=this._extScope.value(e,t);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,i,s){const r=this._scope.toName(t);return void 0!==i&&s&&(this._constants[r.str]=i),this._leafNode(new l(e,r,i)),r}const(e,t,i){return this._def(r.varKinds.const,e,t,i)}let(e,t,i){return this._def(r.varKinds.let,e,t,i)}var(e,t,i){return this._def(r.varKinds.var,e,t,i)}assign(e,t,i){return this._leafNode(new c(e,t,i))}add(e,i){return this._leafNode(new h(e,t.operators.ADD,i))}code(e){return"function"==typeof e?e():e!==s.nil&&this._leafNode(new g(e)),this}object(...e){const t=["{"];for(const[i,r]of e)t.length>1&&t.push(","),t.push(i),(i!==r||this.opts.es5)&&(t.push(":"),(0,s.addCodeArg)(t,r));return t.push("}"),new s._Code(t)}if(e,t,i){if(this._blockNode(new C(e)),t&&i)this.code(t).else().code(i).endIf();else if(t)this.code(t).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new C(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(C,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new S(e),t)}forRange(e,t,i,s,n=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const o=this._scope.toName(e);return this._for(new w(n,o,t,i),()=>s(o))}forOf(e,t,i,n=r.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,s._`${e}.length`,t=>{this.var(o,s._`${e}[${t}]`),i(o)})}return this._for(new x("of",n,o,t),()=>i(o))}forIn(e,t,i,n=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,s._`Object.keys(${t})`,i);const o=this._scope.toName(e);return this._for(new x("in",n,o,t),()=>i(o))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new M;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(M)}try(e,t,i){if(!t&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new A;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new T(e),t(e)}return i&&(this._currNode=s.finally=new D,this.code(i)),this._endBlockNode(T,D)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-t;if(i<0||void 0!==e&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=s.nil,i,r){return this._blockNode(new E(e,t,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const i=this._currNode;if(i instanceof e||t&&i instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof C))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=L;const N=O(t.operators.AND);t.and=function(...e){return e.reduce(N)};const _=O(t.operators.OR);function O(e){return(t,i)=>t===s.nil?i:i===s.nil?t:s._`${F(t)} ${e} ${F(i)}`}function F(e){return e instanceof s.Name?e:s._`(${e})`}t.or=function(...e){return e.reduce(_)}},44490(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const s=i(28261);class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var n;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n||(t.UsedValueState=n={})),t.varKinds={const:new s.Name("const"),let:new s.Name("let"),var:new s.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof s.Name?e:this.name(e)}name(e){return new s.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,i;if((null===(i=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===i?void 0:i.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends s.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:i}){this.value=e,this.scopePath=s._`.${new s.Name(t)}[${i}]`}}t.ValueScopeName=a;const l=s._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:s.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var i;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:r}=s,n=null!==(i=t.key)&&void 0!==i?i:t.ref;let o=this._values[r];if(o){const e=o.get(n);if(e)return e}else o=this._values[r]=new Map;o.set(n,s);const a=this._scope[r]||(this._scope[r]=[]),l=a.length;return a[l]=t.ref,s.setValue(t,{property:r,itemIndex:l}),s}getValue(e,t){const i=this._values[e];if(i)return i.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return s._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,i){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,i)}_reduceValues(e,i,o={},a){let l=s.nil;for(const c in e){const h=e[c];if(!h)continue;const d=o[c]=o[c]||new Map;h.forEach(e=>{if(d.has(e))return;d.set(e,n.Started);let o=i(e);if(o){const i=this.opts.es5?t.varKinds.var:t.varKinds.const;l=s._`${l}${i} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new r(e);l=s._`${l}${o}${this.opts._n}`}d.set(e,n.Completed)})}return l}}},28425(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const s=i(38994),r=i(67218),n=i(86660);function o(e,t){const i=e.const("err",t);e.if(s._`${n.default.vErrors} === null`,()=>e.assign(n.default.vErrors,s._`[${i}]`),s._`${n.default.vErrors}.push(${i})`),e.code(s._`${n.default.errors}++`)}function a(e,t){const{gen:i,validateName:r,schemaEnv:n}=e;n.$async?i.throw(s._`new ${e.ValidationError}(${t})`):(i.assign(s._`${r}.errors`,t),i.return(!1))}t.keywordError={message:({keyword:e})=>s.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?s.str`"${e}" keyword must be ${t} ($data)`:s.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,i=t.keywordError,r,n){const{it:l}=e,{gen:h,compositeRule:d,allErrors:u}=l,p=c(e,i,r);(null!=n?n:d||u)?o(h,p):a(l,s._`[${p}]`)},t.reportExtraError=function(e,i=t.keywordError,s){const{it:r}=e,{gen:l,compositeRule:h,allErrors:d}=r;o(l,c(e,i,s)),h||d||a(r,n.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(n.default.errors,t),e.if(s._`${n.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(s._`${n.default.vErrors}.length`,t),()=>e.assign(n.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:i,data:r,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,n.default.errors,o=>{e.const(l,s._`${n.default.vErrors}[${o}]`),e.if(s._`${l}.instancePath === undefined`,()=>e.assign(s._`${l}.instancePath`,(0,s.strConcat)(n.default.instancePath,a.errorPath))),e.assign(s._`${l}.schemaPath`,s.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(s._`${l}.schema`,i),e.assign(s._`${l}.data`,r))})};const l={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function c(e,t,i){const{createErrors:r}=e.it;return!1===r?s._`{}`:function(e,t,i={}){const{gen:r,it:o}=e,a=[h(o,i),d(e,i)];return function(e,{params:t,message:i},r){const{keyword:o,data:a,schemaValue:c,it:h}=e,{opts:d,propertyName:u,topSchemaRef:p,schemaPath:g}=h;r.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||s._`{}`]),d.messages&&r.push([l.message,"function"==typeof i?i(e):i]),d.verbose&&r.push([l.schema,c],[l.parentSchema,s._`${p}${g}`],[n.default.data,a]),u&&r.push([l.propertyName,u])}(e,t,a),r.object(...a)}(e,t,i)}function h({errorPath:e},{instancePath:t}){const i=t?s.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[n.default.instancePath,(0,s.strConcat)(n.default.instancePath,i)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:i,parentSchema:n}){let o=n?t:s.str`${t}/${e}`;return i&&(o=s.str`${o}${(0,r.getErrorPath)(i,r.Type.Str)}`),[l.schemaPath,o]}},91688(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const s=i(38994),r=i(74383),n=i(86660),o=i(89008),a=i(67218),l=i(36023);class c{constructor(e){var t;let i;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==i?void 0:i[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==i?void 0:i.$async,this.refs={}}}function h(e){const t=u.call(this,e);if(t)return t;const i=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,d=new s.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let p;e.$async&&(p=d.scopeValue("Error",{ref:r.default,code:s._`require("ajv/dist/runtime/validation_error").default`}));const g=d.scopeName("validate");e.validateName=g;const m={gen:d,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:g,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:i,baseId:e.baseId||i,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:s._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();f=`${d.scopeRefs(n.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const i=new Function(`${n.default.self}`,`${n.default.scope}`,f)(this,this.scope.get());if(this.scope.value(g,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:g,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;i.evaluated={props:e instanceof s.Name?void 0:e,items:t instanceof s.Name?void 0:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name},i.source&&(i.source.evaluated=(0,s.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function d(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:h.call(this,e)}function u(e){for(const t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function g(e,t){let i;for(;"string"==typeof(i=this.refs[t]);)t=i;return i||this.schemas[t]||m.call(this,e,t)}function m(e,t){const i=this.opts.uriResolver.parse(t),s=(0,o._getFullPath)(this.opts.uriResolver,i);let r=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===r)return y.call(this,i,e);const n=(0,o.normalizeId)(s),a=this.refs[n]||this.schemas[n];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,i,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||h.call(this,a),n===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:i}=this.opts,s=t[i];return s&&(r=(0,o.resolveUrl)(this.opts.uriResolver,r,s)),new c({schema:t,schemaId:i,root:e,baseId:r})}return y.call(this,i,a)}}t.SchemaEnv=c,t.compileSchema=h,t.resolveRef=function(e,t,i){var s;i=(0,o.resolveUrl)(this.opts.uriResolver,t,i);const r=e.refs[i];if(r)return r;let n=g.call(this,e,i);if(void 0===n){const r=null===(s=e.localRefs)||void 0===s?void 0:s[i],{schemaId:o}=this.opts;r&&(n=new c({schema:r,schemaId:o,root:e,baseId:t}))}return void 0!==n?e.refs[i]=d.call(this,n):void 0},t.getCompilingSchema=u,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:i,root:s}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof i)return;const e=i[(0,a.unescapeFragment)(s)];if(void 0===e)return;const r="object"==typeof(i=e)&&i[this.opts.schemaId];!f.has(s)&&r&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,r))}let n;if("boolean"!=typeof i&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,i.$ref);n=m.call(this,s,e)}const{schemaId:l}=this.opts;return n=n||new c({schema:i,schemaId:l,root:s,baseId:t}),n.schema!==n.root.schema?n:void 0}},86660(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")};t.default=r},4220(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(89008);class r extends Error{constructor(e,t,i,r){super(r||`can't resolve reference ${i} from id ${t}`),this.missingRef=(0,s.resolveUrl)(e,t,i),this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}t.default=r},89008(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const s=i(67218),r=i(67371),n=i(50205),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const i=e[t];if(Array.isArray(i)&&i.some(l))return!0;if("object"==typeof i&&l(i))return!0}return!1}function c(e){let t=0;for(const i in e){if("$ref"===i)return 1/0;if(t++,!o.has(i)&&("object"==typeof e[i]&&(0,s.eachItem)(e[i],e=>t+=c(e)),t===1/0))return 1/0}return t}function h(e,t="",i){!1!==i&&(t=p(t));const s=e.parse(t);return d(e,s)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=h,t._getFullPath=d;const u=/#\/?$/;function p(e){return e?e.replace(u,""):""}t.normalizeId=p,t.resolveUrl=function(e,t,i){return i=p(i),e.resolve(t,i)};const g=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:i,uriResolver:s}=this.opts,o=p(e[i]||t),a={"":o},l=h(s,o,!1),c={},d=new Set;return n(e,{allKeys:!0},(e,t,s,r)=>{if(void 0===r)return;const n=l+t;let o=a[r];function h(t){const i=this.opts.uriResolver.resolve;if(t=p(o?i(o,t):t),d.has(t))throw m(t);d.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?u(e,s.schema,t):t!==p(n)&&("#"===t[0]?(u(e,c[t],t),c[t]=e):this.refs[t]=n),t}function f(e){if("string"==typeof e){if(!g.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[i]&&(o=h.call(this,e[i])),f.call(this,e.$anchor),f.call(this,e.$dynamicAnchor),a[t]=o}),c;function u(e,t,i){if(void 0!==t&&!r(e,t))throw m(i)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},6247(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&i.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},67218(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const s=i(38994),r=i(28261);function n(e,t=e.schema){const{opts:i,self:s}=e;if(!i.strictSchema)return;if("boolean"==typeof t)return;const r=s.RULES.keywords;for(const i in t)r[i]||g(e,`unknown keyword: "${i}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const i in e)if(t[i])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:i,resultToName:r}){return(n,o,a,l)=>{const c=void 0===a?o:a instanceof s.Name?(o instanceof s.Name?e(n,o,a):t(n,o,a),a):o instanceof s.Name?(t(n,a,o),o):i(o,a);return l!==s.Name||c instanceof s.Name?c:r(n,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const i=e.var("props",s._`{}`);return void 0!==t&&d(e,i,t),i}function d(e,t,i){Object.keys(i).forEach(i=>e.assign(s._`${t}${(0,s.getProperty)(i)}`,!0))}t.toHash=function(e){const t={};for(const i of e)t[i]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=n,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const i in e)if("$ref"!==i&&t.all[i])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},i,r,n){if(!n){if("number"==typeof i||"boolean"==typeof i)return i;if("string"==typeof i)return s._`${i}`}return s._`${e}${t}${(0,s.getProperty)(r)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const i of e)t(i);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,i)=>e.if(s._`${i} !== true && ${t} !== undefined`,()=>{e.if(s._`${t} === true`,()=>e.assign(i,!0),()=>e.assign(i,s._`${i} || {}`).code(s._`Object.assign(${i}, ${t})`))}),mergeToName:(e,t,i)=>e.if(s._`${i} !== true`,()=>{!0===t?e.assign(i,!0):(e.assign(i,s._`${i} || {}`),d(e,i,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),items:c({mergeNames:(e,t,i)=>e.if(s._`${i} !== true && ${t} !== undefined`,()=>e.assign(i,s._`${t} === true ? true : ${i} > ${t} ? ${i} : ${t}`)),mergeToName:(e,t,i)=>e.if(s._`${i} !== true`,()=>e.assign(i,!0===t||s._`${i} > ${t} ? ${i} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=h,t.setEvaluated=d;const u={};var p;function g(e,t,i=e.opts.strictSchema){if(i){if(t=`strict mode: ${t}`,!0===i)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p||(t.Type=p={})),t.getErrorPath=function(e,t,i){if(e instanceof s.Name){const r=t===p.Num;return i?r?s._`"[" + ${e} + "]"`:s._`"['" + ${e} + "']"`:r?s._`"/" + ${e}`:s._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,s.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=g},238(e,t){"use strict";function i(e,t){return t.rules.some(t=>s(e,t))}function s(e,t){var i;return void 0!==e[t.keyword]||(null===(i=t.definition.implements)||void 0===i?void 0:i.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},s){const r=t.RULES.types[s];return r&&!0!==r&&i(e,r)},t.shouldUseGroup=i,t.shouldUseRule=s},40564(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const s=i(28425),r=i(38994),n=i(86660),o={message:"boolean schema is false"};function a(e,t){const{gen:i,data:r}=e,n={gen:i,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,s.reportError)(n,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:i,validateName:s}=e;!1===i?a(e,!1):"object"==typeof i&&!0===i.$async?t.return(n.default.data):(t.assign(r._`${s}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:i,schema:s}=e;!1===s?(i.var(t,!1),a(e)):i.var(t,!0)}},26419(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const s=i(6247),r=i(238),n=i(28425),o=i(38994),a=i(67218);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(s.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:i,data:s,opts:n}=e,a=function(e,t){return t?e.filter(e=>h.has(e)||"array"===t&&"array"===e):[]}(t,n.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(c){const r=u(t,s,n.strictNumbers,l.Wrong);i.if(r,()=>{a.length?function(e,t,i){const{gen:s,data:r,opts:n}=e,a=s.let("dataType",o._`typeof ${r}`),l=s.let("coerced",o._`undefined`);"array"===n.coerceTypes&&s.if(o._`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>s.assign(r,o._`${r}[0]`).assign(a,o._`typeof ${r}`).if(u(t,r,n.strictNumbers),()=>s.assign(l,r))),s.if(o._`${l} !== undefined`);for(const e of i)(h.has(e)||"array"===e&&"array"===n.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void s.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${r}`).elseIf(o._`${r} === null`).assign(l,o._`""`);case"number":return void s.elseIf(o._`${a} == "boolean" || ${r} === null
              || (${a} == "string" && ${r} && ${r} == +${r})`).assign(l,o._`+${r}`);case"integer":return void s.elseIf(o._`${a} === "boolean" || ${r} === null
              || (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(l,o._`+${r}`);case"boolean":return void s.elseIf(o._`${r} === "false" || ${r} === 0 || ${r} === null`).assign(l,!1).elseIf(o._`${r} === "true" || ${r} === 1`).assign(l,!0);case"null":return s.elseIf(o._`${r} === "" || ${r} === 0 || ${r} === false`),void s.assign(l,null);case"array":s.elseIf(o._`${a} === "string" || ${a} === "number"
              || ${a} === "boolean" || ${r} === null`).assign(l,o._`[${r}]`)}}s.else(),g(e),s.endIf(),s.if(o._`${l} !== undefined`,()=>{s.assign(r,l),function({gen:e,parentData:t,parentDataProperty:i},s){e.if(o._`${t} !== undefined`,()=>e.assign(o._`${t}[${i}]`,s))}(e,l)})}(e,t,a):g(e)})}return c};const h=new Set(["string","number","integer","boolean","null"]);function d(e,t,i,s=l.Correct){const r=s===l.Correct?o.operators.EQ:o.operators.NEQ;let n;switch(e){case"null":return o._`${t} ${r} null`;case"array":n=o._`Array.isArray(${t})`;break;case"object":n=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":n=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":n=a();break;default:return o._`typeof ${t} ${r} ${e}`}return s===l.Correct?n:(0,o.not)(n);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,i?o._`isFinite(${t})`:o.nil)}}function u(e,t,i,s){if(1===e.length)return d(e[0],t,i,s);let r;const n=(0,a.toHash)(e);if(n.array&&n.object){const e=o._`typeof ${t} != "object"`;r=n.null?e:o._`!${t} || ${e}`,delete n.null,delete n.array,delete n.object}else r=o.nil;n.number&&delete n.integer;for(const e in n)r=(0,o.and)(r,d(e,t,i,s));return r}t.checkDataType=d,t.checkDataTypes=u;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function g(e){const t=function(e){const{gen:t,data:i,schema:s}=e,r=(0,a.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:i,schema:s.type,schemaCode:r,schemaValue:r,parentSchema:s,params:{},it:e}}(e);(0,n.reportError)(t,p)}t.reportTypeError=g},76593(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const s=i(38994),r=i(67218);function n(e,t,i){const{gen:n,compositeRule:o,data:a,opts:l}=e;if(void 0===i)return;const c=s._`${a}${(0,s.getProperty)(t)}`;if(o)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let h=s._`${c} === undefined`;"empty"===l.useDefaults&&(h=s._`${h} || ${c} === null || ${c} === ""`),n.if(h,s._`${c} = ${(0,s.stringify)(i)}`)}t.assignDefaults=function(e,t){const{properties:i,items:s}=e.schema;if("object"===t&&i)for(const t in i)n(e,t,i[t].default);else"array"===t&&Array.isArray(s)&&s.forEach((t,i)=>n(e,i,t.default))}},36023(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const s=i(40564),r=i(26419),n=i(238),o=i(26419),a=i(76593),l=i(29820),c=i(3826),h=i(38994),d=i(86660),u=i(89008),p=i(67218),g=i(28425);function m({gen:e,validateName:t,schema:i,schemaEnv:s,opts:r},n){r.code.es5?e.func(t,h._`${d.default.data}, ${d.default.valCxt}`,s.$async,()=>{e.code(h._`"use strict"; ${f(i,r)}`),function(e,t){e.if(d.default.valCxt,()=>{e.var(d.default.instancePath,h._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,h._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,h._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,h._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{e.var(d.default.instancePath,h._`""`),e.var(d.default.parentData,h._`undefined`),e.var(d.default.parentDataProperty,h._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`{}`)})}(e,r),e.code(n)}):e.func(t,h._`${d.default.data}, ${function(e){return h._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?h._`, ${d.default.dynamicAnchors}={}`:h.nil}}={}`}(r)}`,s.$async,()=>e.code(f(i,r)).code(n))}function f(e,t){const i="object"==typeof e&&e[t.schemaId];return i&&(t.code.source||t.code.process)?h._`/*# sourceURL=${i} */`:h.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const i in e)if(t.RULES.all[i])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function C(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:i,opts:s,self:r}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}(e)}function b(e,t){if(e.opts.jtd)return w(e,[],!1,t);const i=(0,r.getSchemaTypes)(e.schema);w(e,i,!(0,r.coerceAndCheckDataType)(e,i),t)}function S({gen:e,schemaEnv:t,schema:i,errSchemaPath:s,opts:r}){const n=i.$comment;if(!0===r.$comment)e.code(h._`${d.default.self}.logger.log(${n})`);else if("function"==typeof r.$comment){const i=h.str`${s}/$comment`,r=e.scopeValue("root",{ref:t.root});e.code(h._`${d.default.self}.opts.$comment(${n}, ${i}, ${r}.schema)`)}}function w(e,t,i,s){const{gen:r,schema:a,data:l,allErrors:c,opts:u,self:g}=e,{RULES:m}=g;function f(p){(0,n.shouldUseGroup)(a,p)&&(p.type?(r.if((0,o.checkDataType)(p.type,l,u.strictNumbers)),x(e,p),1===t.length&&t[0]===p.type&&i&&(r.else(),(0,o.reportTypeError)(e)),r.endIf()):x(e,p),c||r.if(h._`${d.default.errors} === ${s||0}`))}!a.$ref||!u.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,m)?(u.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{E(e.dataTypes,t)||M(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const i=[];for(const s of e.dataTypes)E(t,s)?i.push(s):t.includes("integer")&&"number"===s&&i.push("integer");e.dataTypes=i}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&M(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const i=e.self.RULES.all;for(const s in i){const r=i[s];if("object"==typeof r&&(0,n.shouldUseRule)(e.schema,r)){const{type:i}=r.definition;i.length&&!i.some(e=>{return s=e,(i=t).includes(s)||"number"===s&&i.includes("integer");var i,s})&&M(e,`missing type "${i.join(",")}" for keyword "${s}"`)}}}(e,e.dataTypes))}(e,t),r.block(()=>{for(const e of m.rules)f(e);f(m.post)})):r.block(()=>T(e,"$ref",m.all.$ref.definition))}function x(e,t){const{gen:i,schema:s,opts:{useDefaults:r}}=e;r&&(0,a.assignDefaults)(e,t.type),i.block(()=>{for(const i of t.rules)(0,n.shouldUseRule)(s,i)&&T(e,i.keyword,i.definition,t.type)})}function E(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function M(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(C(e),y(e))?function(e){const{schema:t,opts:i,gen:s}=e;m(e,()=>{i.$comment&&t.$comment&&S(e),function(e){const{schema:t,opts:i}=e;void 0!==t.default&&i.useDefaults&&i.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),s.let(d.default.vErrors,null),s.let(d.default.errors,0),i.unevaluated&&function(e){const{gen:t,validateName:i}=e;e.evaluated=t.const("evaluated",h._`${i}.evaluated`),t.if(h._`${e.evaluated}.dynamicProps`,()=>t.assign(h._`${e.evaluated}.props`,h._`undefined`)),t.if(h._`${e.evaluated}.dynamicItems`,()=>t.assign(h._`${e.evaluated}.items`,h._`undefined`))}(e),b(e),function(e){const{gen:t,schemaEnv:i,validateName:s,ValidationError:r,opts:n}=e;i.$async?t.if(h._`${d.default.errors} === 0`,()=>t.return(d.default.data),()=>t.throw(h._`new ${r}(${d.default.vErrors})`)):(t.assign(h._`${s}.errors`,d.default.vErrors),n.unevaluated&&function({gen:e,evaluated:t,props:i,items:s}){i instanceof h.Name&&e.assign(h._`${t}.props`,i),s instanceof h.Name&&e.assign(h._`${t}.items`,s)}(e),t.return(h._`${d.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,s.topBoolOrEmptySchema)(e))};class A{constructor(e,t,i){if((0,l.validateKeywordUsage)(e,t,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",R(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,i){this.failResult((0,h.not)(e),t,i)}failResult(e,t,i){this.gen.if(e),i?i():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,h.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(h._`${t} !== undefined && (${(0,h.or)(this.invalid$data(),e)})`)}error(e,t,i){if(t)return this.setParams(t),this._error(e,i),void this.setParams({});this._error(e,i)}_error(e,t){(e?g.reportExtraError:g.reportError)(this,this.def.error,t)}$dataError(){(0,g.reportError)(this,this.def.$dataError||g.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,g.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,i=h.nil){this.gen.block(()=>{this.check$data(e,i),t()})}check$data(e=h.nil,t=h.nil){if(!this.$data)return;const{gen:i,schemaCode:s,schemaType:r,def:n}=this;i.if((0,h.or)(h._`${s} === undefined`,t)),e!==h.nil&&i.assign(e,!0),(r.length||n.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==h.nil&&i.assign(e,!1)),i.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:i,def:s,it:r}=this;return(0,h.or)(function(){if(i.length){if(!(t instanceof h.Name))throw new Error("ajv implementation error");const e=Array.isArray(i)?i:[i];return h._`${(0,o.checkDataTypes)(e,t,r.opts.strictNumbers,o.DataType.Wrong)}`}return h.nil}(),function(){if(s.validateSchema){const i=e.scopeValue("validate$data",{ref:s.validateSchema});return h._`!${i}(${t})`}return h.nil}())}subschema(e,t){const i=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(i,this.it,e),(0,c.extendSubschemaMode)(i,e);const r={...this.it,...i,items:void 0,props:void 0};return function(e,t){v(e)&&(C(e),y(e))?function(e,t){const{schema:i,gen:s,opts:r}=e;r.$comment&&i.$comment&&S(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const n=s.const("_errs",d.default.errors);b(e,n),s.var(t,h._`${n} === ${d.default.errors}`)}(e,t):(0,s.boolOrEmptySchema)(e,t)}(r,t),r}mergeEvaluated(e,t){const{it:i,gen:s}=this;i.opts.unevaluated&&(!0!==i.props&&void 0!==e.props&&(i.props=p.mergeEvaluated.props(s,e.props,i.props,t)),!0!==i.items&&void 0!==e.items&&(i.items=p.mergeEvaluated.items(s,e.items,i.items,t)))}mergeValidEvaluated(e,t){const{it:i,gen:s}=this;if(i.opts.unevaluated&&(!0!==i.props||!0!==i.items))return s.if(t,()=>this.mergeEvaluated(e,h.Name)),!0}}function T(e,t,i,s){const r=new A(e,i,t);"code"in i?i.code(r,s):r.$data&&i.validate?(0,l.funcKeywordCode)(r,i):"macro"in i?(0,l.macroKeywordCode)(r,i):(i.compile||i.validate)&&(0,l.funcKeywordCode)(r,i)}t.KeywordCxt=A;const D=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(e,{dataLevel:t,dataNames:i,dataPathArr:s}){let r,n;if(""===e)return d.default.rootData;if("/"===e[0]){if(!D.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,n=d.default.rootData}else{const o=I.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(r=o[2],"#"===r){if(a>=t)throw new Error(l("property/index",a));return s[t-a]}if(a>t)throw new Error(l("data",a));if(n=i[t-a],!r)return n}let o=n;const a=r.split("/");for(const e of a)e&&(n=h._`${n}${(0,h.getProperty)((0,p.unescapeJsonPointer)(e))}`,o=h._`${o} && ${n}`);return o;function l(e,i){return`Cannot access ${e} ${i} levels up, current level is ${t}`}}t.getData=R},29820(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const s=i(38994),r=i(86660),n=i(24954),o=i(28425);function a(e){const{gen:t,data:i,it:r}=e;t.if(r.parentData,()=>t.assign(i,s._`${r.parentData}[${r.parentDataProperty}]`))}function l(e,t,i){if(void 0===i)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof i?{ref:i}:{ref:i,code:(0,s.stringify)(i)})}t.macroKeywordCode=function(e,t){const{gen:i,keyword:r,schema:n,parentSchema:o,it:a}=e,c=t.macro.call(a.self,n,o,a),h=l(i,r,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const d=i.name("valid");e.subschema({schema:c,schemaPath:s.nil,errSchemaPath:`${a.errSchemaPath}/${r}`,topSchemaRef:h,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var i;const{gen:c,keyword:h,schema:d,parentSchema:u,$data:p,it:g}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(g,t);const m=!p&&t.compile?t.compile.call(g.self,d,u,g):t.validate,f=l(c,h,m),y=c.let("valid");function v(i=(t.async?s._`await `:s.nil)){const o=g.opts.passContext?r.default.this:r.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(y,s._`${i}${(0,n.callValidateCode)(e,f,o,a)}`,t.modifying)}function C(e){var i;c.if((0,s.not)(null!==(i=t.valid)&&void 0!==i?i:y),e)}e.block$data(y,function(){if(!1===t.errors)v(),t.modifying&&a(e),C(()=>e.error());else{const i=t.async?function(){const e=c.let("ruleErrs",null);return c.try(()=>v(s._`await `),t=>c.assign(y,!1).if(s._`${t} instanceof ${g.ValidationError}`,()=>c.assign(e,s._`${t}.errors`),()=>c.throw(t))),e}():function(){const e=s._`${f}.errors`;return c.assign(e,null),v(s.nil),e}();t.modifying&&a(e),C(()=>function(e,t){const{gen:i}=e;i.if(s._`Array.isArray(${t})`,()=>{i.assign(r.default.vErrors,s._`${r.default.vErrors} === null ? ${t} : ${r.default.vErrors}.concat(${t})`).assign(r.default.errors,s._`${r.default.vErrors}.length`),(0,o.extendErrors)(e)},()=>e.error())}(e,i))}}),e.ok(null!==(i=t.valid)&&void 0!==i?i:y)},t.validSchemaType=function(e,t,i=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||i&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:i,errSchemaPath:s},r,n){if(Array.isArray(r.keyword)?!r.keyword.includes(n):r.keyword!==n)throw new Error("ajv implementation error");const o=r.dependencies;if(null==o?void 0:o.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${n}: ${o.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[n])){const e=`keyword "${n}" value is invalid at path "${s}": `+i.errorsText(r.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);i.logger.error(e)}}},3826(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const s=i(38994),r=i(67218);t.getSubschema=function(e,{keyword:t,schemaProp:i,schema:n,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===i?{schema:n,schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[i],schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}${(0,s.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,r.escapeFragment)(i)}`}}if(void 0!==n){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:i,dataPropType:n,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==i)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==i){const{errorPath:o,dataPathArr:a,opts:l}=t;h(c.let("data",s._`${t.data}${(0,s.getProperty)(i)}`,!0)),e.errorPath=s.str`${o}${(0,r.getErrorPath)(i,n,l.jsPropertySyntax)}`,e.parentDataProperty=s._`${i}`,e.dataPathArr=[...a,e.parentDataProperty]}function h(i){e.data=i,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,i]}void 0!==o&&(h(o instanceof s.Name?o:c.let("data",o,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:i,compositeRule:s,createErrors:r,allErrors:n}){void 0!==s&&(e.compositeRule=s),void 0!==r&&(e.createErrors=r),void 0!==n&&(e.allErrors=n),e.jtdDiscriminator=t,e.jtdMetadata=i}},51967(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var s=i(36023);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return s.KeywordCxt}});var r=i(38994);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=i(74383),o=i(4220),a=i(6247),l=i(91688),c=i(38994),h=i(89008),d=i(26419),u=i(67218),p=i(10114),g=i(18951),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const f=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},C={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(e){var t,i,s,r,n,o,a,l,c,h,d,u,p,f,y,v,C,b,S,w,x,E,M,A,T;const D=e.strict,I=null===(t=e.code)||void 0===t?void 0:t.optimize,R=!0===I||void 0===I?1:I||0,P=null!==(s=null===(i=e.code)||void 0===i?void 0:i.regExp)&&void 0!==s?s:m,k=null!==(r=e.uriResolver)&&void 0!==r?r:g.default;return{strictSchema:null===(o=null!==(n=e.strictSchema)&&void 0!==n?n:D)||void 0===o||o,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:D)||void 0===l||l,strictTypes:null!==(h=null!==(c=e.strictTypes)&&void 0!==c?c:D)&&void 0!==h?h:"log",strictTuples:null!==(u=null!==(d=e.strictTuples)&&void 0!==d?d:D)&&void 0!==u?u:"log",strictRequired:null!==(f=null!==(p=e.strictRequired)&&void 0!==p?p:D)&&void 0!==f&&f,code:e.code?{...e.code,optimize:R,regExp:P}:{optimize:R,regExp:P},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(C=e.meta)||void 0===C||C,messages:null===(b=e.messages)||void 0===b||b,inlineRefs:null===(S=e.inlineRefs)||void 0===S||S,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(M=e.validateFormats)||void 0===M||M,unicodeRegExp:null===(A=e.unicodeRegExp)||void 0===A||A,int32range:null===(T=e.int32range)||void 0===T||T,uriResolver:k}}class S{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:i}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:t,lines:i}),this.logger=function(e){if(!1===e)return D;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),w.call(this,v,e,"NOT SUPPORTED"),w.call(this,C,e,"DEPRECATED","warn"),this._metaOpts=T.call(this),e.formats&&M.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:i}=this.opts;let s=p;"id"===i&&(s={...p},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[i],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let i;if("string"==typeof e){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);const s=i(t);return"$async"in i||(this.errors=i.errors),s}compile(e,t){const i=this._addSchema(e,t);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:i}=this.opts;return s.call(this,e,t);async function s(e,t){await r.call(this,e.$schema);const i=this._addSchema(e,t);return i.validate||n.call(this,i)}async function r(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const i=await c.call(this,e);this.refs[e]||await r.call(this,i.$schema),this.refs[e]||this.addSchema(i,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=i(e))}finally{delete this._loading[e]}}}addSchema(e,t,i,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,i,s);return this}let r;if("object"==typeof e){const{schemaId:t}=this.opts;if(r=e[t],void 0!==r&&"string"!=typeof r)throw new Error(`schema ${t} must be string`)}return t=(0,h.normalizeId)(t||r),this._checkUnique(t),this.schemas[t]=this._addSchema(e,i,t,s,!0),this}addMetaSchema(e,t,i=this.opts.validateSchema){return this.addSchema(e,t,!0,i),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let i;if(i=e.$schema,void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const s=this.validate(i,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){const{schemaId:i}=this.opts,s=new l.SchemaEnv({schema:{},schemaId:i});if(t=l.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let i=e[this.opts.schemaId];return i&&(i=(0,h.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let i;if("string"==typeof e)i=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=i);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(i=(t=e).keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(R.call(this,i,t),!t)return(0,u.eachItem)(i,e=>P.call(this,e)),this;L.call(this,t);const s={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(i,0===s.type.length?e=>P.call(this,e,s):e=>s.type.forEach(t=>P.call(this,e,s,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const i of t.rules){const t=i.rules.findIndex(t=>t.keyword===e);t>=0&&i.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:i="data"}={}){return e&&0!==e.length?e.map(e=>`${i}${e.instancePath} ${e.message}`).reduce((e,i)=>e+t+i):"No errors"}$dataMetaSchema(e,t){const i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let r=e;for(const e of t)r=r[e];for(const e in i){const t=i[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,n=r[e];s&&n&&(r[e]=_(n))}}return e}_removeAllSchemas(e,t){for(const i in e){const s=e[i];t&&!t.test(i)||("string"==typeof s?delete e[i]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[i]))}}_addSchema(e,t,i,s=this.opts.validateSchema,r=this.opts.addUsedSchema){let n;const{schemaId:o}=this.opts;if("object"==typeof e)n=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;i=(0,h.normalizeId)(n||i);const c=h.getSchemaRefs.call(this,e,i);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:i,localRefs:c}),this._cache.set(a.schema,a),r&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=a),s&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,i,s="error"){for(const r in e){const n=r;n in t&&this.logger[s](`${i}: option ${r}. ${e[n]}`)}}function x(e){return e=(0,h.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function M(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function A(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const i=e[t];i.keyword||(i.keyword=t),this.addKeyword(i)}}}function T(){const e={...this.opts};for(const t of f)delete e[t];return e}S.ValidationError=n.default,S.MissingRefError=o.default,t.default=S;const D={log(){},warn(){},error(){}},I=/^[a-z_$][a-z0-9_$:-]*$/i;function R(e,t){const{RULES:i}=this;if((0,u.eachItem)(e,e=>{if(i.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!I.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function P(e,t,i){var s;const r=null==t?void 0:t.post;if(i&&r)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:n}=this;let o=r?n.post:n.rules.find(({type:e})=>e===i);if(o||(o={type:i,rules:[]},n.rules.push(o)),n.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?k.call(this,o,a,t.before):o.rules.push(a),n.all[e]=a,null===(s=t.implements)||void 0===s||s.forEach(e=>this.addKeyword(e))}function k(e,t,i){const s=e.rules.findIndex(e=>e.keyword===i);s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${i} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=_(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _(e){return{anyOf:[e,N]}}},6013(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(67371);s.code='require("ajv/dist/runtime/equal").default',t.default=s},25532(e,t){"use strict";function i(e){const t=e.length;let i,s=0,r=0;for(;r<t;)s++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),56320==(64512&i)&&r++);return s}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,i.code='require("ajv/dist/runtime/ucs2length").default'},18951(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(58041);s.code='require("ajv/dist/runtime/uri").default',t.default=s},74383(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=i},30714(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const s=i(38994),r=i(67218),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>s.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>s._`{limit: ${e}}`},code(e){const{parentSchema:t,it:i}=e,{items:s}=t;Array.isArray(s)?o(e,s):(0,r.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:i,schema:n,data:o,keyword:a,it:l}=e;l.items=!0;const c=i.const("len",s._`${o}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(s._`${c} <= ${t.length}`);else if("object"==typeof n&&!(0,r.alwaysValidSchema)(l,n)){const n=i.var("valid",s._`${c} <= ${t.length}`);i.if((0,s.not)(n),()=>function(n){i.forRange("i",t.length,c,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:r.Type.Num},n),l.allErrors||i.if((0,s.not)(n),()=>i.break())})}(n)),e.ok(n)}}t.validateAdditionalItems=o,t.default=n},88401(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(24954),r=i(38994),n=i(86660),o=i(67218),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>r._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:i,parentSchema:a,data:l,errsCount:c,it:h}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:d,opts:u}=h;if(h.props=!0,"all"!==u.removeAdditional&&(0,o.alwaysValidSchema)(h,i))return;const p=(0,s.allSchemaProperties)(a.properties),g=(0,s.allSchemaProperties)(a.patternProperties);function m(e){t.code(r._`delete ${l}[${e}]`)}function f(s){if("all"===u.removeAdditional||u.removeAdditional&&!1===i)m(s);else{if(!1===i)return e.setParams({additionalProperty:s}),e.error(),void(d||t.break());if("object"==typeof i&&!(0,o.alwaysValidSchema)(h,i)){const i=t.name("valid");"failing"===u.removeAdditional?(y(s,i,!1),t.if((0,r.not)(i),()=>{e.reset(),m(s)})):(y(s,i),d||t.if((0,r.not)(i),()=>t.break()))}}}function y(t,i,s){const r={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===s&&Object.assign(r,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(r,i)}t.forIn("key",l,i=>{p.length||g.length?t.if(function(i){let n;if(p.length>8){const e=(0,o.schemaRefOrVal)(h,a.properties,"properties");n=(0,s.isOwnProperty)(t,e,i)}else n=p.length?(0,r.or)(...p.map(e=>r._`${i} === ${e}`)):r.nil;return g.length&&(n=(0,r.or)(n,...g.map(t=>r._`${(0,s.usePattern)(e,t)}.test(${i})`))),(0,r.not)(n)}(i),()=>f(i)):f(i)}),e.ok(r._`${c} === ${n.default.errors}`)}};t.default=a},12003(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(67218),r={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:i,it:r}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");const n=t.name("valid");i.forEach((t,i)=>{if((0,s.alwaysValidSchema)(r,t))return;const o=e.subschema({keyword:"allOf",schemaProp:i},n);e.ok(n),e.mergeEvaluated(o)})}};t.default=r},21070(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i(24954).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=s},32692(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?s.str`must contain at least ${e} valid item(s)`:s.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?s._`{minContains: ${e}}`:s._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:i,parentSchema:n,data:o,it:a}=e;let l,c;const{minContains:h,maxContains:d}=n;a.opts.next?(l=void 0===h?1:h,c=d):l=1;const u=t.const("len",s._`${o}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,r.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,r.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,r.alwaysValidSchema)(a,i)){let t=s._`${u} >= ${l}`;return void 0!==c&&(t=s._`${t} && ${u} <= ${c}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function g(){const e=t.name("_valid"),i=t.let("count",0);m(e,()=>t.if(e,()=>function(e){t.code(s._`${e}++`),void 0===c?t.if(s._`${e} >= ${l}`,()=>t.assign(p,!0).break()):(t.if(s._`${e} > ${c}`,()=>t.assign(p,!1).break()),1===l?t.assign(p,!0):t.if(s._`${e} >= ${l}`,()=>t.assign(p,!0)))}(i)))}function m(i,s){t.forRange("i",0,u,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:r.Type.Num,compositeRule:!0},i),s()})}void 0===c&&1===l?m(p,()=>t.if(p,()=>t.break())):0===l?(t.let(p,!0),void 0!==c&&t.if(s._`${o}.length > 0`,g)):(t.let(p,!1),g()),e.result(p,()=>e.reset())}};t.default=n},15860(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const s=i(38994),r=i(67218),n=i(24954);t.error={message:({params:{property:e,depsCount:t,deps:i}})=>{const r=1===t?"property":"properties";return s.str`must have ${r} ${i} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:i,missingProperty:r}})=>s._`{property: ${e},
    missingProperty: ${r},
    depsCount: ${t},
    deps: ${i}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,i]=function({schema:e}){const t={},i={};for(const s in e)"__proto__"!==s&&((Array.isArray(e[s])?t:i)[s]=e[s]);return[t,i]}(e);a(e,t),l(e,i)}};function a(e,t=e.schema){const{gen:i,data:r,it:o}=e;if(0===Object.keys(t).length)return;const a=i.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const h=(0,n.propertyInData)(i,r,l,o.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),o.allErrors?i.if(h,()=>{for(const t of c)(0,n.checkReportMissingProp)(e,t)}):(i.if(s._`${h} && (${(0,n.checkMissingProp)(e,c,a)})`),(0,n.reportMissingProp)(e,a),i.else())}}function l(e,t=e.schema){const{gen:i,data:s,keyword:o,it:a}=e,l=i.name("valid");for(const c in t)(0,r.alwaysValidSchema)(a,t[c])||(i.if((0,n.propertyInData)(i,s,c,a.opts.ownProperties),()=>{const t=e.subschema({keyword:o,schemaProp:c},l);e.mergeValidEvaluated(t,l)},()=>i.var(l,!0)),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=o},8102(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>s.str`must match "${e.ifClause}" schema`,params:({params:e})=>s._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:i,it:n}=e;void 0===i.then&&void 0===i.else&&(0,r.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const a=o(n,"then"),l=o(n,"else");if(!a&&!l)return;const c=t.let("valid",!0),h=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(t)}(),e.reset(),a&&l){const i=t.let("ifClause");e.setParams({ifClause:i}),t.if(h,d("then",i),d("else",i))}else a?t.if(h,d("then")):t.if((0,s.not)(h),d("else"));function d(i,r){return()=>{const n=e.subschema({keyword:i},h);t.assign(c,h),e.mergeValidEvaluated(n,c),r?t.assign(r,s._`${i}`):e.setParams({ifClause:i})}}e.pass(c,()=>e.error(!0))}};function o(e,t){const i=e.schema[t];return void 0!==i&&!(0,r.alwaysValidSchema)(e,i)}t.default=n},88313(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(30714),r=i(51997),n=i(23665),o=i(5153),a=i(32692),l=i(15860),c=i(80374),h=i(88401),d=i(23252),u=i(46398),p=i(84948),g=i(21070),m=i(5368),f=i(12003),y=i(8102),v=i(71871);t.default=function(e=!1){const t=[p.default,g.default,m.default,f.default,y.default,v.default,c.default,h.default,l.default,d.default,u.default];return e?t.push(r.default,o.default):t.push(s.default,n.default),t.push(a.default),t}},23665(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const s=i(38994),r=i(67218),n=i(24954),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:i}=e;if(Array.isArray(t))return a(e,"additionalItems",t);i.items=!0,(0,r.alwaysValidSchema)(i,t)||e.ok((0,n.validateArray)(e))}};function a(e,t,i=e.schema){const{gen:n,parentSchema:o,data:a,keyword:l,it:c}=e;!function(e){const{opts:s,errSchemaPath:n}=c,o=i.length,a=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(s.strictTuples&&!a){const e=`"${l}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${n}"`;(0,r.checkStrictMode)(c,e,s.strictTuples)}}(o),c.opts.unevaluated&&i.length&&!0!==c.items&&(c.items=r.mergeEvaluated.items(n,i.length,c.items));const h=n.name("valid"),d=n.const("len",s._`${a}.length`);i.forEach((t,i)=>{(0,r.alwaysValidSchema)(c,t)||(n.if(s._`${d} > ${i}`,()=>e.subschema({keyword:l,schemaProp:i,dataProp:i},h)),e.ok(h))})}t.validateTuple=a,t.default=o},5153(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n=i(24954),o=i(30714),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>s.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>s._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:i,it:s}=e,{prefixItems:a}=i;s.items=!0,(0,r.alwaysValidSchema)(s,t)||(a?(0,o.validateAdditionalItems)(e,a):e.ok((0,n.validateArray)(e)))}};t.default=a},84948(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(67218),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:i,it:r}=e;if((0,s.alwaysValidSchema)(r,i))return void e.fail();const n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=r},5368(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>s._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:i,parentSchema:n,it:o}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;const a=i,l=t.let("valid",!1),c=t.let("passing",null),h=t.name("_valid");e.setParams({passing:c}),t.block(function(){a.forEach((i,n)=>{let a;(0,r.alwaysValidSchema)(o,i)?t.var(h,!0):a=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},h),n>0&&t.if(s._`${h} && ${l}`).assign(l,!1).assign(c,s._`[${c}, ${n}]`).else(),t.if(h,()=>{t.assign(l,!0),t.assign(c,n),a&&e.mergeEvaluated(a,s.Name)})})}),e.result(l,()=>e.reset(),()=>e.error(!0))}};t.default=n},46398(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(24954),r=i(38994),n=i(67218),o=i(67218),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:i,data:a,parentSchema:l,it:c}=e,{opts:h}=c,d=(0,s.allSchemaProperties)(i),u=d.filter(e=>(0,n.alwaysValidSchema)(c,i[e]));if(0===d.length||u.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;const p=h.strictSchema&&!h.allowMatchingProperties&&l.properties,g=t.name("valid");!0===c.props||c.props instanceof r.Name||(c.props=(0,o.evaluatedPropsToName)(t,c.props));const{props:m}=c;function f(e){for(const t in p)new RegExp(e).test(t)&&(0,n.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(i){t.forIn("key",a,n=>{t.if(r._`${(0,s.usePattern)(e,i)}.test(${n})`,()=>{const s=u.includes(i);s||e.subschema({keyword:"patternProperties",schemaProp:i,dataProp:n,dataPropType:o.Type.Str},g),c.opts.unevaluated&&!0!==m?t.assign(r._`${m}[${n}]`,!0):s||c.allErrors||t.if((0,r.not)(g),()=>t.break())})})}!function(){for(const e of d)p&&f(e),c.allErrors?y(e):(t.var(g,!0),y(e),t.if(g))}()}};t.default=a},51997(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(23665),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,s.validateTuple)(e,"items")};t.default=r},23252(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(36023),r=i(24954),n=i(67218),o=i(88401),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:i,parentSchema:a,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&o.default.code(new s.KeywordCxt(c,o.default,"additionalProperties"));const h=(0,r.allSchemaProperties)(i);for(const e of h)c.definedProperties.add(e);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=n.mergeEvaluated.props(t,(0,n.toHash)(h),c.props));const d=h.filter(e=>!(0,n.alwaysValidSchema)(c,i[e]));if(0===d.length)return;const u=t.name("valid");for(const i of d)p(i)?g(i):(t.if((0,r.propertyInData)(t,l,i,c.opts.ownProperties)),g(i),c.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(i),e.ok(u);function p(e){return c.opts.useDefaults&&!c.compositeRule&&void 0!==i[e].default}function g(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},u)}}};t.default=a},80374(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>s._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:i,data:n,it:o}=e;if((0,r.alwaysValidSchema)(o,i))return;const a=t.name("valid");t.forIn("key",n,i=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},a),t.if((0,s.not)(a),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(a)}};t.default=n},71871(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(67218),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:i}){void 0===t.if&&(0,s.checkStrictMode)(i,`"${e}" without "if" is ignored`)}};t.default=r},24954(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const s=i(38994),r=i(67218),n=i(86660),o=i(67218);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:s._`Object.prototype.hasOwnProperty`})}function l(e,t,i){return s._`${a(e)}.call(${t}, ${i})`}function c(e,t,i,r){const n=s._`${t}${(0,s.getProperty)(i)} === undefined`;return r?(0,s.or)(n,(0,s.not)(l(e,t,i))):n}function h(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:i,data:r,it:n}=e;i.if(c(i,r,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:s._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:i}},r,n){return(0,s.or)(...r.map(r=>(0,s.and)(c(e,t,r,i.ownProperties),s._`${n} = ${r}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=l,t.propertyInData=function(e,t,i,r){const n=s._`${t}${(0,s.getProperty)(i)} !== undefined`;return r?s._`${n} && ${l(e,t,i)}`:n},t.noPropertyInData=c,t.allSchemaProperties=h,t.schemaProperties=function(e,t){return h(t).filter(i=>!(0,r.alwaysValidSchema)(e,t[i]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:i,topSchemaRef:r,schemaPath:o,errorPath:a},it:l},c,h,d){const u=d?s._`${e}, ${t}, ${r}${o}`:t,p=[[n.default.instancePath,(0,s.strConcat)(n.default.instancePath,a)],[n.default.parentData,l.parentData],[n.default.parentDataProperty,l.parentDataProperty],[n.default.rootData,n.default.rootData]];l.opts.dynamicRef&&p.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const g=s._`${u}, ${i.object(...p)}`;return h!==s.nil?s._`${c}.call(${h}, ${g})`:s._`${c}(${g})`};const d=s._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},i){const r=t.unicodeRegExp?"u":"",{regExp:n}=t.code,a=n(i,r);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:s._`${"new RegExp"===n.code?d:(0,o.useFunc)(e,n)}(${i}, ${r})`})},t.validateArray=function(e){const{gen:t,data:i,keyword:n,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(a,!0),l(()=>t.break()),a;function l(o){const l=t.const("len",s._`${i}.length`);t.forRange("i",0,l,i=>{e.subschema({keyword:n,dataProp:i,dataPropType:r.Type.Num},a),t.if((0,s.not)(a),o)})}},t.validateUnion=function(e){const{gen:t,schema:i,keyword:n,it:o}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");if(i.some(e=>(0,r.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block(()=>i.forEach((i,r)=>{const o=e.subschema({keyword:n,schemaProp:r,compositeRule:!0},l);t.assign(a,s._`${a} || ${l}`),e.mergeValidEvaluated(o,l)||t.if((0,s.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},33330(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=i},20500(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(33330),r=i(30930),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",s.default,r.default];t.default=n},30930(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const s=i(4220),r=i(24954),n=i(38994),o=i(86660),a=i(91688),l=i(67218),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:i,it:r}=e,{baseId:o,schemaEnv:l,validateName:c,opts:u,self:p}=r,{root:g}=l;if(("#"===i||"#/"===i)&&o===g.baseId)return function(){if(l===g)return d(e,c,l,l.$async);const i=t.scopeValue("root",{ref:g});return d(e,n._`${i}.validate`,g,g.$async)}();const m=a.resolveRef.call(p,g,o,i);if(void 0===m)throw new s.default(r.opts.uriResolver,o,i);return m instanceof a.SchemaEnv?function(t){const i=h(e,t);d(e,i,t,t.$async)}(m):function(s){const r=t.scopeValue("schema",!0===u.code.source?{ref:s,code:(0,n.stringify)(s)}:{ref:s}),o=t.name("valid"),a=e.subschema({schema:s,dataTypes:[],schemaPath:n.nil,topSchemaRef:r,errSchemaPath:i},o);e.mergeEvaluated(a),e.ok(o)}(m)}};function h(e,t){const{gen:i}=e;return t.validate?i.scopeValue("validate",{ref:t.validate}):n._`${i.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,i,s){const{gen:a,it:c}=e,{allErrors:h,schemaEnv:d,opts:u}=c,p=u.passContext?o.default.this:n.nil;function g(e){const t=n._`${e}.errors`;a.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),a.assign(o.default.errors,n._`${o.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;const s=null===(t=null==i?void 0:i.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(s&&!s.dynamicProps)void 0!==s.props&&(c.props=l.mergeEvaluated.props(a,s.props,c.props));else{const t=a.var("props",n._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,n.Name)}if(!0!==c.items)if(s&&!s.dynamicItems)void 0!==s.items&&(c.items=l.mergeEvaluated.items(a,s.items,c.items));else{const t=a.var("items",n._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,n.Name)}}s?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const i=a.let("valid");a.try(()=>{a.code(n._`await ${(0,r.callValidateCode)(e,t,p)}`),m(t),h||a.assign(i,!0)},e=>{a.if(n._`!(${e} instanceof ${c.ValidationError})`,()=>a.throw(e)),g(e),h||a.assign(i,!1)}),e.ok(i)}():e.result((0,r.callValidateCode)(e,t,p),()=>m(t),()=>g(t))}t.getValidate=h,t.callRef=d,t.default=c},29376(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(15141),n=i(91688),o=i(4220),a=i(67218),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===r.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:i}})=>s._`{error: ${e}, tag: ${i}, tagValue: ${t}}`},code(e){const{gen:t,data:i,schema:l,parentSchema:c,it:h}=e,{oneOf:d}=c;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=l.propertyName;if("string"!=typeof u)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),g=t.const("tag",s._`${i}${(0,s.getProperty)(u)}`);function m(i){const r=t.name("valid"),n=e.subschema({keyword:"oneOf",schemaProp:i},r);return e.mergeEvaluated(n,s.Name),r}t.if(s._`typeof ${g} == "string"`,()=>function(){const i=function(){var e;const t={},i=r(c);let s=!0;for(let t=0;t<d.length;t++){let c=d[t];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,h.self.RULES)){const e=c.$ref;if(c=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,e),c instanceof n.SchemaEnv&&(c=c.schema),void 0===c)throw new o.default(h.opts.uriResolver,h.baseId,e)}const p=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[u];if("object"!=typeof p)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);s=s&&(i||r(c)),l(p,t)}if(!s)throw new Error(`discriminator: "${u}" must be required`);return t;function r({required:e}){return Array.isArray(e)&&e.includes(u)}function l(e,t){if(e.const)p(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`);for(const i of e.enum)p(i,t)}}function p(e,i){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${u}" values must be unique strings`);t[e]=i}}();t.if(!1);for(const e in i)t.elseIf(s._`${g} === ${e}`),t.assign(p,m(i[e]));t.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:g,tagName:u}),t.endIf()}(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:g,tagName:u})),e.ok(p)}};t.default=l},15141(e,t){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(i||(t.DiscrError=i={}))},83959(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(20500),r=i(30659),n=i(88313),o=i(38563),a=i(44618),l=[s.default,r.default,(0,n.default)(),o.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},40424(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match format "${e}"`,params:({schemaCode:e})=>s._`{format: ${e}}`},code(e,t){const{gen:i,data:r,$data:n,schema:o,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:h,schemaEnv:d,self:u}=l;c.validateFormats&&(n?function(){const n=i.scopeValue("formats",{ref:u.formats,code:c.code.formats}),o=i.const("fDef",s._`${n}[${a}]`),l=i.let("fType"),h=i.let("format");i.if(s._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>i.assign(l,s._`${o}.type || "string"`).assign(h,s._`${o}.validate`),()=>i.assign(l,s._`"string"`).assign(h,o)),e.fail$data((0,s.or)(!1===c.strictSchema?s.nil:s._`${a} && !${h}`,function(){const e=d.$async?s._`(${o}.async ? await ${h}(${r}) : ${h}(${r}))`:s._`${h}(${r})`,i=s._`(typeof ${h} == "function" ? ${e} : ${h}.test(${r}))`;return s._`${h} && ${h} !== true && ${l} === ${t} && !${i}`}()))}():function(){const n=u.formats[o];if(!n)return void function(){if(!1!==c.strictSchema)throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${h}"`}u.logger.warn(e())}();if(!0===n)return;const[a,l,p]=function(e){const t=e instanceof RegExp?(0,s.regexpCode)(e):c.code.formats?s._`${c.code.formats}${(0,s.getProperty)(o)}`:void 0,r=i.scopeValue("formats",{key:o,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,r]:[e.type||"string",e.validate,s._`${r}.validate`]}(n);a===t&&e.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!d.$async)throw new Error("async format in sync schema");return s._`await ${p}(${r})`}return"function"==typeof l?s._`${p}(${r})`:s._`${p}.test(${r})`}())}())}};t.default=r},38563(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=[i(40424).default];t.default=s},44618(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},17080(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n=i(6013),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>s._`{allowedValue: ${e}}`},code(e){const{gen:t,data:i,$data:o,schemaCode:a,schema:l}=e;o||l&&"object"==typeof l?e.fail$data(s._`!${(0,r.useFunc)(t,n.default)}(${i}, ${a})`):e.fail(s._`${l} !== ${i}`)}};t.default=o},42977(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n=i(6013),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>s._`{allowedValues: ${e}}`},code(e){const{gen:t,data:i,$data:o,schema:a,schemaCode:l,it:c}=e;if(!o&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum;let d;const u=()=>null!=d?d:d=(0,r.useFunc)(t,n.default);let p;if(h||o)p=t.let("valid"),e.block$data(p,function(){t.assign(p,!1),t.forOf("v",l,e=>t.if(s._`${u()}(${i}, ${e})`,()=>t.assign(p,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);p=(0,s.or)(...a.map((t,r)=>function(e,t){const r=a[t];return"object"==typeof r&&null!==r?s._`${u()}(${i}, ${e}[${t}])`:s._`${i} === ${r}`}(e,r)))}e.pass(p)}};t.default=o},30659(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(68997),r=i(89190),n=i(94280),o=i(78805),a=i(12189),l=i(33138),c=i(48870),h=i(11858),d=i(17080),u=i(42977),p=[s.default,r.default,n.default,o.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,u.default];t.default=p},48870(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const i="maxItems"===e?"more":"fewer";return s.str`must NOT have ${i} than ${t} items`},params:({schemaCode:e})=>s._`{limit: ${e}}`},code(e){const{keyword:t,data:i,schemaCode:r}=e,n="maxItems"===t?s.operators.GT:s.operators.LT;e.fail$data(s._`${i}.length ${n} ${r}`)}};t.default=r},94280(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=i(67218),n=i(25532),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const i="maxLength"===e?"more":"fewer";return s.str`must NOT have ${i} than ${t} characters`},params:({schemaCode:e})=>s._`{limit: ${e}}`},code(e){const{keyword:t,data:i,schemaCode:o,it:a}=e,l="maxLength"===t?s.operators.GT:s.operators.LT,c=!1===a.opts.unicode?s._`${i}.length`:s._`${(0,r.useFunc)(e.gen,n.default)}(${i})`;e.fail$data(s._`${c} ${l} ${o}`)}};t.default=o},68997(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r=s.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:({keyword:e,schemaCode:t})=>s.str`must be ${n[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>s._`{comparison: ${n[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:i,schemaCode:r}=e;e.fail$data(s._`${i} ${n[t].fail} ${r} || isNaN(${i})`)}};t.default=a},12189(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const i="maxProperties"===e?"more":"fewer";return s.str`must NOT have ${i} than ${t} properties`},params:({schemaCode:e})=>s._`{limit: ${e}}`},code(e){const{keyword:t,data:i,schemaCode:r}=e,n="maxProperties"===t?s.operators.GT:s.operators.LT;e.fail$data(s._`Object.keys(${i}).length ${n} ${r}`)}};t.default=r},89190(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(38994),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>s.str`must be multiple of ${e}`,params:({schemaCode:e})=>s._`{multipleOf: ${e}}`},code(e){const{gen:t,data:i,schemaCode:r,it:n}=e,o=n.opts.multipleOfPrecision,a=t.let("res"),l=o?s._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:s._`${a} !== parseInt(${a})`;e.fail$data(s._`(${r} === 0 || (${a} = ${i}/${r}, ${l}))`)}};t.default=r},78805(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(24954),r=i(67218),n=i(38994),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match pattern "${e}"`,params:({schemaCode:e})=>n._`{pattern: ${e}}`},code(e){const{gen:t,data:i,$data:o,schema:a,schemaCode:l,it:c}=e,h=c.opts.unicodeRegExp?"u":"";if(o){const{regExp:s}=c.opts.code,o="new RegExp"===s.code?n._`new RegExp`:(0,r.useFunc)(t,s),a=t.let("valid");t.try(()=>t.assign(a,n._`${o}(${l}, ${h}).test(${i})`),()=>t.assign(a,!1)),e.fail$data(n._`!${a}`)}else{const t=(0,s.usePattern)(e,a);e.fail$data(n._`!${t}.test(${i})`)}}};t.default=o},33138(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(24954),r=i(38994),n=i(67218),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>r.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>r._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:i,schemaCode:o,data:a,$data:l,it:c}=e,{opts:h}=c;if(!l&&0===i.length)return;const d=i.length>=h.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(r.nil,u);else for(const t of i)(0,s.checkReportMissingProp)(e,t)}():function(){const n=t.let("missing");if(d||l){const i=t.let("valid",!0);e.block$data(i,()=>function(i,n){e.setParams({missingProperty:i}),t.forOf(i,o,()=>{t.assign(n,(0,s.propertyInData)(t,a,i,h.ownProperties)),t.if((0,r.not)(n),()=>{e.error(),t.break()})},r.nil)}(n,i)),e.ok(i)}else t.if((0,s.checkMissingProp)(e,i,n)),(0,s.reportMissingProp)(e,n),t.else()}(),h.strictRequired){const t=e.parentSchema.properties,{definedProperties:s}=e.it;for(const e of i)if(void 0===(null==t?void 0:t[e])&&!s.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,n.checkStrictMode)(c,t,c.opts.strictRequired)}}function u(){t.forOf("prop",o,i=>{e.setParams({missingProperty:i}),t.if((0,s.noPropertyInData)(t,a,i,h.ownProperties),()=>e.error())})}}};t.default=o},11858(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(26419),r=i(38994),n=i(67218),o=i(6013),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>r.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>r._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:i,$data:a,schema:l,parentSchema:c,schemaCode:h,it:d}=e;if(!a&&!l)return;const u=t.let("valid"),p=c.items?(0,s.getSchemaTypes)(c.items):[];function g(n,o){const a=t.name("item"),l=(0,s.checkDataTypes)(p,a,d.opts.strictNumbers,s.DataType.Wrong),c=t.const("indices",r._`{}`);t.for(r._`;${n}--;`,()=>{t.let(a,r._`${i}[${n}]`),t.if(l,r._`continue`),p.length>1&&t.if(r._`typeof ${a} == "string"`,r._`${a} += "_"`),t.if(r._`typeof ${c}[${a}] == "number"`,()=>{t.assign(o,r._`${c}[${a}]`),e.error(),t.assign(u,!1).break()}).code(r._`${c}[${a}] = ${n}`)})}function m(s,a){const l=(0,n.useFunc)(t,o.default),c=t.name("outer");t.label(c).for(r._`;${s}--;`,()=>t.for(r._`${a} = ${s}; ${a}--;`,()=>t.if(r._`${l}(${i}[${s}], ${i}[${a}])`,()=>{e.error(),t.assign(u,!1).break(c)})))}e.block$data(u,function(){const s=t.let("i",r._`${i}.length`),n=t.let("j");e.setParams({i:s,j:n}),t.assign(u,!0),t.if(r._`${s} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?g:m)(s,n))},r._`${h} === false`),e.ok(u)}};t.default=a},14538(e,t){!function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=Array(t);i<t;i++)s[i]=e[i];return s}function i(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function s(e){return function(){var t=this,s=arguments;return new Promise(function(r,n){var o=e.apply(t,s);function a(e){i(o,r,n,a,l,"next",e)}function l(e){i(o,r,n,a,l,"throw",e)}a(void 0)})}}function r(e,t,i){return t=l(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,i||[],l(e).constructor):t.apply(e,i))}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,i){return Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e,t){if("function"!=typeof t&&null!==t)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&&f(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function u(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function p(e,t){if(null==e)return{};var i,s,r=function(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)i=n[s],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function g(){var e,t,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",r=i.toStringTag||"@@toStringTag";function n(i,s,r,n){var l=s&&s.prototype instanceof a?s:a,c=Object.create(l.prototype);return m(c,"_invoke",function(i,s,r){var n,a,l,c=0,h=r||[],d=!1,u={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,i){return n=t,a=0,l=e,u.n=i,o}};function p(i,s){for(a=i,l=s,t=0;!d&&c&&!r&&t<h.length;t++){var r,n=h[t],p=u.p,g=n[2];i>3?(r=g===s)&&(l=n[(a=n[4])?5:(a=3,3)],n[4]=n[5]=e):n[0]<=p&&((r=i<2&&p<n[1])?(a=0,u.v=s,u.n=n[1]):p<g&&(r=i<3||n[0]>s||s>g)&&(n[4]=i,n[5]=s,u.n=g,a=0))}if(r||i>1)return o;throw d=!0,s}return function(r,h,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===h&&p(h,g),a=h,l=g;(t=a<2?e:l)||!d;){n||(a?a<3?(a>1&&(u.n=-1),p(a,l)):u.n=l:u.v=l);try{if(c=2,n){if(a||(r="next"),t=n[r]){if(!(t=t.call(n,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=n.return)&&t.call(n),a<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),a=1);n=e}else if((t=(d=u.n<0)?l:i.call(s,u))!==o)break}catch(t){n=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(i,r,n),!0),c}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var h=[][s]?t(t([][s]())):(m(t={},s,function(){return this}),t),d=c.prototype=a.prototype=Object.create(h);function u(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,m(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,m(d,"constructor",c),m(c,"constructor",l),l.displayName="GeneratorFunction",m(c,r,"GeneratorFunction"),m(d),m(d,r,"Generator"),m(d,s,function(){return this}),m(d,"toString",function(){return"[object Generator]"}),(g=function(){return{w:n,m:u}})()}function m(e,t,i,s){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}m=function(e,t,i,s){function n(t,i){m(e,t,function(e){return this._invoke(t,i,e)})}t?r?r(e,t,{value:i,enumerable:!s,configurable:!s,writable:!s}):e[t]=i:(n("next",0),n("throw",1),n("return",2))},m(e,t,i,s)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function y(e,i){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var s,r,n,o,a=[],l=!0,c=!1;try{if(n=(i=i.call(e)).next,0===t);else for(;!(l=(s=n.call(i)).done)&&(a.push(s.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(e,i)||function(e,i){if(e){if("string"==typeof e)return t(e,i);var s={}.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?t(e,i):void 0}}(e,i)||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 v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}var C={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_FOCUSED:"Q_SEARCH_FOCUSED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN",Q_PANEL_ENTERED_FULLSCREEN:"Q_PANEL_ENTERED_FULLSCREEN",Q_PANEL_EXITED_FULLSCREEN:"Q_PANEL_EXITED_FULLSCREEN",PAGE_NAVIGATION:"PAGE_NAVIGATION",PARAMETERS_LOADED:"PARAMETERS_LOADED"},b={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},S={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},w={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},x={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE",PRELOAD_THEMES:"PRELOAD_THEMES",CREATE_SHARED_VIEW:"CREATE_SHARED_VIEW"},E={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},M={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_EXECUTIVE_SUMMARY_PANE:"TOGGLE_EXECUTIVE_SUMMARY_PANE",OPEN_BUILD_VISUAL_PANE:"OPEN_BUILD_VISUAL_PANE",OPEN_DATA_QNA_PANE:"OPEN_DATA_QNA_PANE",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE",TOGGLE_THRESHOLD_ALERTS_PANE:"TOGGLE_THRESHOLD_ALERTS_PANE",TOGGLE_SCHEDULING_PANE:"TOGGLE_SCHEDULING_PANE",TOGGLE_RECENT_SNAPSHOTS_PANE:"TOGGLE_RECENT_SNAPSHOTS_PANE",IMPORT_OBJECTS:"IMPORT_OBJECTS",OPEN_BUILD_STORY_PANE:"OPEN_BUILD_STORY_PANE",SEND_PROMPT:"SEND_PROMPT"},A=Object.freeze({__proto__:null,ErrorChangeEventName:S,GetterMessageEventName:E,InfoChangeEventName:b,InfoMessageEventName:C,InvokerMessageEventName:M,SetterMessageEventName:x,WarnChangeEventName:w}),T=u(u(u({},b),S),w),D=u(u(u(u({},C),x),E),M),I={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},R=Object.freeze({__proto__:null,ChangeEventLevel:I,ChangeEventName:T,MessageEventName:D}),P=Object.freeze({__proto__:null}),k=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),N=Object.freeze({__proto__:null}),_={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH",GENERATIVEQNA:"QSEARCH",QUICKCHAT:"QUICKCHAT"},O=Object.freeze({__proto__:null,ExperienceType:_}),F=Object.freeze({__proto__:null}),G={NULL:null,OTHER_BUCKET:null},B={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},V=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:B,SPECIAL_DATAPOINT_VALUE_TYPES:G}),H=Object.freeze({__proto__:null}),U=Object.freeze({__proto__:null}),z=Object.freeze({__proto__:null}),W={FULL:"FULL",SEARCH_BAR:"SEARCH_BAR"},j=Object.freeze({__proto__:null,GenerativeQnAPanelType:W}),K=Object.freeze({__proto__:null}),$=Object.freeze({__proto__:null}),Y=o(function e(t,i,s){n(this,e),this.eventName=t,this.message=i,this.data=s}),q=function(e){function t(e,i,s,o){var a;return n(this,t),(a=r(this,t,[e,s,o])).eventLevel=i,a}return c(t,e),o(t)}(Y),X=function(e){function t(e,i,s){var o;return n(this,t),(o=r(this,t,[e,i,s])).eventName=e,o}return c(t,e),o(t)}(Y),Z=function(e){function t(e,i,s,o){var a;return n(this,t),(a=r(this,t,[e,s,o])).eventTarget=i,a}return c(t,e),o(t)}(X),Q=function(e){function t(e,i,s,o,a,l,c){var h;return n(this,t),(h=r(this,t,[e,i,l,c])).timestamp=o,h.version=a,h.eventId=s,h}return c(t,e),o(t)}(Z),J=o(function e(){n(this,e)}),ee=o(function e(){n(this,e),a(this,"success",!0)}),te=o(function e(t){n(this,e),a(this,"success",!1),this.errorCode=t.errorCode,this.error=t.error,this.message=t.message}),ie=o(function e(t){n(this,e),a(this,"success",!0),this.message=t});let se;const re=new Uint8Array(16);function ne(){if(!se&&(se="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!se))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return se(re)}const oe=[];for(let e=0;e<256;++e)oe.push((e+256).toString(16).slice(1));var ae={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function le(e,t,i){if(ae.randomUUID&&!e)return ae.randomUUID();const s=(e=e||{}).random||(e.rng||ne)();return s[6]=15&s[6]|64,s[8]=63&s[8]|128,function(e,t=0){return oe[e[t+0]]+oe[e[t+1]]+oe[e[t+2]]+oe[e[t+3]]+"-"+oe[e[t+4]]+oe[e[t+5]]+"-"+oe[e[t+6]]+oe[e[t+7]]+"-"+oe[e[t+8]]+oe[e[t+9]]+"-"+oe[e[t+10]]+oe[e[t+11]]+oe[e[t+12]]+oe[e[t+13]]+oe[e[t+14]]+oe[e[t+15]]}(s)}var ce=o(function e(t,i,r,o){var l=this;n(this,e),a(this,"send",function(){var e=s(g().m(function e(t){var i;return g().w(function(e){for(;;)switch(e.n){case 0:if(l.experienceFrame&&l.internalExperience){e.n=1;break}throw new Error("Experience has not been initialized");case 1:return i=new Z(t.eventName,l.internalExperience,t.message,t.data),e.a(2,l.experienceFrame.send(i))}},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"addEventListener",function(e,t){return l.experienceFrame.addInternalEventListener(e,t)}),a(this,"setLogProvider",function(e){return l.logger=e,l}),a(this,"getInternalExperienceInfo",function(t){var i,s,r=-1;do{r++,i=u(u({},t),{},{contextId:l.controlOptions.contextId,discriminator:r}),s=e.getExperienceIdentifier(i)}while(l.experienceIdentifiers.has(s));return l.experienceIdentifiers.add(s),{experienceIdentifier:s,internalExperience:i}}),a(this,"transformContentOptions",function(e,t){return l.warnUnrecognizedContentOptions(Object.keys(t)),e}),a(this,"warnUnrecognizedContentOptions",function(e){var t,i,s;e.length>0&&(null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.UNRECOGNIZED_CONTENT_OPTIONS,I.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:e}),{frame:null}),null===(s=l.logger)||void 0===s||s.warn("Experience content options contain unrecognized properties"))}),a(this,"validateFrameOptions",function(){if(!l.frameOptions.url){var e,t,i="Url is required for the experience";throw null===(e=(t=l.frameOptions).onChange)||void 0===e||e.call(t,new q(T.NO_URL,I.ERROR,i),{frame:null}),new Error(i)}}),this.frameOptions=t,this.contentOptions=i,this.controlOptions=r,this.experienceIdentifiers=o,this.validateFrameOptions()});a(ce,"getExperienceIdentifier",function(e){if(e.experienceType===_.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===_.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([_.CONSOLE,_.CONTROL,_.CONTEXT,_.QSEARCH,_.GENERATIVEQNA,_.QUICKCHAT].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")});const he=2147483647,de={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ue=Math.floor,pe=String.fromCharCode;function ge(e){throw new RangeError(de[e])}const me=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},fe=function(e,t,i){let s=0;for(e=i?ue(e/700):e>>1,e+=ue(e/t);e>455;s+=36)e=ue(e/35);return ue(s+36*e/(e+38))},ye=function(e){const t=[];e=function(e){const t=[];let i=0;const s=e.length;for(;i<s;){const r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<s){const s=e.charCodeAt(i++);56320==(64512&s)?t.push(((1023&r)<<10)+(1023&s)+65536):(t.push(r),i--)}else t.push(r)}return t}(e);const i=e.length;let s=128,r=0,n=72;for(const i of e)i<128&&t.push(pe(i));const o=t.length;let a=o;for(o&&t.push("-");a<i;){let i=he;for(const t of e)t>=s&&t<i&&(i=t);const l=a+1;i-s>ue((he-r)/l)&&ge("overflow"),r+=(i-s)*l,s=i;for(const i of e)if(i<s&&++r>he&&ge("overflow"),i===s){let e=r;for(let i=36;;i+=36){const s=i<=n?1:i>=n+26?26:i-n;if(e<s)break;const r=e-s,o=36-s;t.push(pe(me(s+r%o,0))),e=ue(r/o)}t.push(pe(me(e,0))),n=fe(r,l,a===o),r=0,++a}++r,++s}return t.join("")};var ve=o(function e(t){var i=this;n(this,e),a(this,"classNames",[e.IFRAME_CLASS_NAME]),a(this,"getIframe",function(){return i.iframe}),a(this,"createIframePlaceholder",function(t){if(i.iframePlaceholder=document.createElement("div"),i.iframePlaceholder.id="".concat(i.iframeName,"-placeholder"),i.iframePlaceholder.style.width=i.width,i.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",i.iframePlaceholder.style.display="flex",i.iframePlaceholder.style.justifyContent="center",i.iframePlaceholder.style.alignItems="center",i.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),i.height.endsWith("px")&&(i.iframePlaceholder.style.height=i.height),t&&"boolean"!=typeof t)i.iframePlaceholder.appendChild(t);else{var s=i.createLoaderSVG();i.iframePlaceholder.appendChild(s)}i.container.appendChild(i.iframePlaceholder)}),a(this,"createIframe",function(){var e,t,s=document.createElement("iframe");s.className=i.classNames.join(" ").trim(),s.id=i.iframeName,s.name=i.iframeName,s.width=i.width,s.height=i.height,i.loading&&(s.loading=i.loading),s.style.border="0px",s.style.padding="0px",i.iframePlaceholder&&(s.style.opacity="0",s.style.position="absolute"),"0px"===i.width&&"0px"===i.height&&(s.style.position="absolute");var r=[];return null!==(e=i.framePermissions)&&void 0!==e&&e.clipboardRead&&r.push("clipboard-read ".concat(new URL(i.src).origin)),null!==(t=i.framePermissions)&&void 0!==t&&t.clipboardWrite&&r.push("clipboard-write ".concat(new URL(i.src).origin)),r.length&&(s.allow=r.join("; ")),i.container.appendChild(s),i.payload?i.postRequest=i.createPostRequest({src:i.src,target:s.name,container:i.container,payload:i.payload}):s.src=i.src,s}),a(this,"onLoadLocal",function(e){var t,s;i.iframePlaceholder&&(i.iframePlaceholder.remove(),i.iframe.style.position="",i.iframe.style.opacity="1",i.iframe.style.transition="opacity .5s ease-in-out"),null===(t=i.onLoad)||void 0===t||t.call(i,e),null===(s=i.postRequest)||void 0===s||s.remove()}),a(this,"createPostRequest",function(e){var t=e.src,i=e.container,s=e.target,r=e.payload;if(!t)throw new Error("No source has been provided.");var n=document.createElement("form");return n.style.visibility="hidden",n.method="POST",n.action=t,n.target=s,n.name="".concat(s,"-form"),Object.keys(r).forEach(function(e){var t=document.createElement("input");t.type="hidden",t.name=e,t.value=r[e],n.appendChild(t)}),i.appendChild(n),null==n||n.submit(),{remove:function(){n.remove()}}}),a(this,"createSvgElement",function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(t).forEach(function(e){var t=y(e,2),i=t[0],s=t[1];return r.setAttribute(i,s)}),Object.entries(i).forEach(function(e){var t=y(e,2),i=t[0],s=t[1];return r.style.setProperty(i,s)}),s.forEach(function(e){return r.appendChild(e)}),r}),a(this,"createLoaderSVG",function(){var e=[1,2,3].map(function(e){var t=i.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return i.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[t])});return i.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)});var s=t.id,r=t.src,o=t.width,l=void 0===o?"100%":o,c=t.height,h=void 0===c?"100%":c,d=t.container,u=t.onLoad,p=t.loading,g=t.withIframePlaceholder,m=t.payload,f=t.className,v=t.framePermissions;this.width=l,this.height=h,this.onLoad=u,this.iframeName=s,this.framePermissions=v,this.loading=p,f&&this.classNames.push(f),this.container=d,this.payload=m,this.src=r,g&&this.createIframePlaceholder(g),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)});a(ve,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var Ce="2.11.2",be=o(function e(t,i,r,o,l,c,h){var d=this;n(this,e),a(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),a(this,"iframe",null),a(this,"send",function(){var e=s(g().m(function e(t){var i,s,r;return g().w(function(e){for(;;)switch(e.n){case 0:if(!d.controlOptions.sendToControlFrame){e.n=1;break}return e.a(2,d.controlOptions.sendToControlFrame(t));case 1:if(d.iframe){e.n=2;break}throw new Error("Cannot send ".concat(t.eventName,": No experience frame found"));case 2:if(s=le(),r=new Q(t.eventName,t.eventTarget,s,Date.now(),Ce,t.message,t.data),null===(i=d.iframe)||void 0===i||null===(i=i.contentWindow)||void 0===i||i.postMessage(r,d.url),t.eventName!==D.ACKNOWLEDGE){e.n=3;break}return e.a(2,Promise.resolve(new ee));case 3:return e.a(2,new Promise(function(e,i){var r=function(t){var i,n,o=t.data;(null==o?void 0:o.eventId)===s&&(window.removeEventListener("message",r),!0===(null===(i=o.message)||void 0===i?void 0:i.success)?e(new ee):!1===(null===(n=o.message)||void 0===n?void 0:n.success)?e(new te(o.message)):e(new ie(o.message)))};window.addEventListener("message",r),setTimeout(function(){window.removeEventListener("message",r),i("".concat(t.eventName," timed out"))},d.MESSAGE_RESPONSE_TIMEOUT)}))}},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"buildParameterString",function(e){return e&&"object"===v(e)?Object.entries(e).map(function(e){var t=y(e,2),i=t[0],s=t[1],r=Array.isArray(s)?s:[s],n=encodeURIComponent(i);return r.map(encodeURIComponent).map(function(e){return"p.".concat(n,"=").concat(e)}).join("&")}).join("&"):""}),a(this,"buildQueryString",function(e){var t=Object.entries(e).reduce(function(e,t){var i=y(t,2),s=i[0],r=i[1];return null!=r?u(u({},e),{},a({},s,"".concat(r))):e},{punyCodeEmbedOrigin:ye("".concat(window.location.origin,"/")),sdkVersion:Ce});return new URLSearchParams(t).toString()}),a(this,"createExperienceIframe",function(){d.onChange(new q(T.FRAME_STARTED,I.INFO,"Creating the frame",{experience:d.internalExperience}));try{d.setTimeoutInstance(),d.iframe=new ve({id:d.experienceId,src:d.url,width:d.frameOptions.width,height:d.frameOptions.height,container:d.container,onLoad:d.onLoadHandler,withIframePlaceholder:d.frameOptions.withIframePlaceholder,className:d.frameOptions.className,framePermissions:d.frameOptions.framePermissions}).getIframe()}catch(e){throw d.onChange(new q(T.FRAME_NOT_CREATED,I.ERROR,"Failed to create the frame",{experience:d.internalExperience})),e}d.onChange(new q(T.FRAME_MOUNTED,I.INFO,"The frame mounted",{experience:d.internalExperience,frame:d.iframe}))}),a(this,"addInternalEventListener",function(e,t){var i=function(i,s){i.eventName===e&&t(i,s)};return d.controlOptions.eventManager.addEventListener(d.experienceId,i,!0),{remove:function(){return d.controlOptions.eventManager.removeEventListener(d.experienceId,i)}}}),a(this,"validateBaseUrl",function(e){if(!e)throw d.onChange(new q(T.NO_URL,I.ERROR,"Url is required for the experience",{experience:d.internalExperience})),new Error("Url is required for the experience");try{new URL(e)}catch(e){throw d.onChange(new q(T.INVALID_URL,I.ERROR,"Invalid experience url",{experience:d.internalExperience})),new Error("Invalid experience url")}return e}),a(this,"setTimeoutInstance",function(){d.timeoutInstance=setTimeout(function(){throw d.onChange(new q(T.FRAME_NOT_CREATED,I.ERROR,"Creating the frame timed out",{experience:d.internalExperience})),new Error("Creating the frame timed out")},d.controlOptions.timeout)}),a(this,"onLoadHandler",s(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:d.timeoutInstance&&clearTimeout(d.timeoutInstance),d.onChange(new q(T.FRAME_LOADED,I.INFO,"The experience iframe loaded",{experience:d.internalExperience}));case 1:return e.a(2)}},e)}))),a(this,"getContainer",function(e){if(!e){var t="Container is required for the experience";throw d.onChange(new q(T.NO_CONTAINER,I.ERROR,t,{experience:d.internalExperience})),new Error(t)}var i=null;if("string"==typeof e)try{i=document.querySelector(e)}catch(e){throw e instanceof Error&&d.onChange(new q(T.INVALID_CONTAINER,I.ERROR,e.message,{experience:d.internalExperience})),e}else"object"===v(e)&&e.nodeName&&(i=e);if(!i){var s="Invalid container '".concat(e,"' for the experience");throw d.onChange(new q(T.INVALID_CONTAINER,I.ERROR,s,{experience:d.internalExperience})),new Error(s)}return i}),a(this,"decorateOnChange",function(e){return function(t){if(e){var i={frame:d.iframe};e(t,i)}}}),a(this,"decorateOnMessage",function(e,t){return function(i){t&&d.iframe&&t(i,{frame:d.iframe}),e&&e(i,{frame:d.iframe})}}),a(this,"initializeMutationObserver",function(){var e=new MutationObserver(function(t){t.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===d.iframe||e===d.container})})&&(d.controlOptions.eventManager.cleanUpCallbacksForExperience(d.experienceId),e.disconnect(),d.iframe=null,d.onChange(new q(T.FRAME_REMOVED,I.INFO,"Frame removed from the DOM",{experience:d.internalExperience})))});e.observe(document.body,{childList:!0,subtree:!0})}),this.frameOptions=t,this.contentOptions=r,this.onChange=this.decorateOnChange(t.onChange),this.onMessage=this.decorateOnMessage(r.onMessage,h),this.container=this.getContainer(t.container),this.internalExperience=l,this.controlOptions=i,this.transformedContentOptions=o,this.experienceId=c,this.url=this.validateBaseUrl(t.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()}),Se=["parameters"],we=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.transformedContentOptions,i=t.parameters,s=p(t,Se),r=d.internalExperience,n=r.contextId,o=r.discriminator;return[e,[d.buildQueryString(u(u({},s),{},{contextId:n,discriminator:o})),d.buildParameterString(i)].join("#")].join(e.includes("?")?"&":"?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),xe=["scaleToContainer","fitToIframeWidth","locale","parameters","themeOptions","onMessage"],Ee=function(e){function t(e,i,o,l){var c;n(this,t),a(c=r(this,t,[e,i,o,l]),"setParameters",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_PARAMETERS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"reset",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.RESET)))},e)}))),a(c,"addFilterGroups",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"updateFilterGroups",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.UPDATE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"removeFilterGroups",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"getFilterGroups",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_FILTER_GROUPS_FOR_VISUAL));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve filter groups for the visual");case 2:return e.a(2,t.message)}},e)}))),a(c,"getActions",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_VISUAL_ACTIONS));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve the actions");case 2:return e.a(2,t.message)}},e)}))),a(c,"addActions",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_VISUAL_ACTIONS,{Actions:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setActions",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_VISUAL_ACTIONS,{Actions:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"removeActions",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_VISUAL_ACTIONS,{Actions:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setTheme",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME,{ThemeArn:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setThemeOverride",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME_OVERRIDE,{ThemeOverride:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setPreloadThemes",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.PRELOAD_THEMES,{PreloadThemes:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"extractExperienceFromUrl",function(e){var t,i,s=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(s.length<5)throw null===(t=(i=c.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid visual experience url",{url:e}),{frame:c.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:_.VISUAL,dashboardId:s[1],sheetId:s[2],visualId:s[3]}}),a(c,"interceptMessage",function(e,t){var i,s,r,n,o;"SIZE_CHANGED"===e.eventName&&c.frameOptions.resizeHeightOnSizeChangedEvent&&!c.contentOptions.scaleToContainer&&(null==t||null===(r=t.frame)||void 0===r||null===(n=r.setAttribute)||void 0===n||n.call(r,"height","".concat(null===(o=e.message)||void 0===o?void 0:o.height,"px"))),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(i=c.contentOptions)&&void 0!==i&&null!==(i=i.themeOptions)&&void 0!==i&&i.themeOverride&&c.setThemeOverride(c.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(s=c.contentOptions)&&void 0!==s&&null!==(s=s.themeOptions)&&void 0!==s&&s.preloadThemes&&c.setPreloadThemes(c.contentOptions.themeOptions.preloadThemes)}),a(c,"transformVisualContentOptions",function(e){var t=e.scaleToContainer,i=e.fitToIframeWidth,s=e.locale,r=e.parameters,n=e.themeOptions;e.onMessage;var o=p(e,xe),l=c.transformContentOptions({scaleToContainer:null!=t&&t,fitToIframeWidth:null==i||i,locale:s},o);return Array.isArray(r)&&(l.parameters=r.reduce(function(e,t){return u(u({},e),{},a({},t.Name,t.Values))},{})),null!=n&&n.themeArn&&(l.themeArn=n.themeArn),l}),c.experience=c.extractExperienceFromUrl(e.url);var h=c.getInternalExperienceInfo(c.experience),d=h.experienceIdentifier,m=h.internalExperience;return c.internalExperience=m,c.experienceId=d,c.experienceFrame=new we(e,o,i,c.transformVisualContentOptions(i),m,d,c.interceptMessage),c}return c(t,e),o(t)}(ce),Me=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.internalExperience,i=t.contextId,s=t.discriminator;return[e,d.buildQueryString(u(u({},d.transformedContentOptions),{},{contextId:i,discriminator:s}))].join(e.includes("?")?"&":"?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),Ae=["locale","toolbarOptions","onMessage"],Te=function(e){function t(e,i,o,l){var c;n(this,t),a(c=r(this,t,[e,i,o,l]),"createSharedView",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:if("DASHBOARD"===c.currentPage||"DASHBOARD_SHEET"===c.currentPage||"DASHBOARD_VIEW"===c.currentPage){e.n=1;break}throw new Error("Cannot call createSharedView from this page");case 1:return e.n=2,c.send(new X(D.CREATE_SHARED_VIEW));case 2:if(null!=(t=e.v)&&t.message){e.n=3;break}throw new Error("Failed to create shared view");case 3:return e.a(2,t)}},e)}))),a(c,"toggleExecutiveSummaryPane",s(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:if("DASHBOARD"===c.currentPage){e.n=1;break}throw new Error("Cannot call toggleExecutiveSummaryPane from this page");case 1:return e.a(2,c.send(new X(D.TOGGLE_EXECUTIVE_SUMMARY_PANE)))}},e)}))),a(c,"openDataQnAPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.OPEN_DATA_QNA_PANE)))},e)}))),a(c,"openBuildVisualPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.OPEN_BUILD_VISUAL_PANE)))},e)}))),a(c,"buildStoryFromDashboard",s(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:if("DASHBOARD"===c.currentPage){e.n=1;break}throw new Error('Cannot call buildStoryFromDashboard from "'.concat(c.currentPage,'" page'));case 1:return e.a(2,c.send(new X(D.OPEN_BUILD_STORY_PANE)))}},e)}))),a(c,"interceptMessage",function(e,t){var i;e.eventName===D.PAGE_NAVIGATION&&(c.currentPage=null==e||null===(i=e.message)||void 0===i?void 0:i.pageType)}),a(c,"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+(\/views\/[\w-]+)?|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(t=(i=c.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid console experience url",{url:e}),{frame:c.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:_.CONSOLE}}),a(c,"transformConsoleContentOptions",function(e){var t=e.locale,i=e.toolbarOptions;e.onMessage;var s=p(e,Ae),r=c.transformContentOptions({locale:t},s);return!0===(null==i?void 0:i.executiveSummary)&&(r.showExecutiveSummaryIcon=!0),!0===(null==i?void 0:i.dataQnA)&&(r.showDataQnAIcon=!0),!0===(null==i?void 0:i.buildVisual)&&(r.showBuildVisualIcon=!0),!0===(null==i?void 0:i.buildStory)&&(r.showBuildStoryIcon=!0),r}),c.experience=c.extractExperienceFromUrl(e.url);var h=c.getInternalExperienceInfo(c.experience),d=h.experienceIdentifier,u=h.internalExperience;c.internalExperience=u,c.experienceId=d,i.locale,i.onMessage;var m=c.transformConsoleContentOptions(i);return c.experienceFrame=new Me(e,o,i,m,u,d,c.interceptMessage),c.currentPage="START",c}return c(t,e),o(t)}(ce),De=["parameters"],Ie=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.transformedContentOptions,i=t.parameters,s=p(t,De),r=d.internalExperience,n=r.contextId,o=r.discriminator,a=d.contentOptions.viewId;if(a){var l=new URL(e);l.pathname=l.pathname.concat("/views/"+a),e=l.href}return[e,[d.buildQueryString(u(u({},s),{},{contextId:n,discriminator:o})),d.buildParameterString(i)].join("#")].join(e.includes("?")?"&":"?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),Re=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Pe=function(e){function t(e,i,o,l){var c;n(this,t),a(c=r(this,t,[e,i,o,l]),"initiatePrint",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.INITIATE_PRINT)))},e)}))),a(c,"undo",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.UNDO)))},e)}))),a(c,"redo",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REDO)))},e)}))),a(c,"toggleExecutiveSummaryPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_EXECUTIVE_SUMMARY_PANE)))},e)}))),a(c,"toggleBookmarksPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_BOOKMARKS_PANE)))},e)}))),a(c,"toggleThresholdAlertsPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_THRESHOLD_ALERTS_PANE)))},e)}))),a(c,"toggleSchedulingPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_SCHEDULING_PANE)))},e)}))),a(c,"toggleRecentSnapshotsPane",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_RECENT_SNAPSHOTS_PANE)))},e)}))),a(c,"getParameters",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_PARAMETERS));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve the parameters");case 2:return e.a(2,t.message)}},e)}))),a(c,"getSheets",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_SHEETS));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve the sheets");case 2:return e.a(2,t.message)}},e)}))),a(c,"addFilterGroups",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"updateFilterGroups",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.UPDATE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"removeFilterGroups",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"getFilterGroupsForSheet",function(){var e=s(g().m(function e(t){var i;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:t}));case 1:if(i=e.v,Array.isArray(null==i?void 0:i.message)){e.n=2;break}throw new Error("Failed to retrieve filter groups for the sheet");case 2:return e.a(2,i.message)}},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"getFilterGroupsForVisual",function(){var e=s(g().m(function e(t,i){var s;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:t,VisualId:i}));case 1:if(s=e.v,Array.isArray(null==s?void 0:s.message)){e.n=2;break}throw new Error("Failed to retrieve filter groups for the visual");case 2:return e.a(2,s.message)}},e)}));return function(t,i){return e.apply(this,arguments)}}()),a(c,"getVisualActions",function(){var e=s(g().m(function e(t,i){var s;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_VISUAL_ACTIONS,{SheetId:t,VisualId:i}));case 1:if(s=e.v,Array.isArray(null==s?void 0:s.message)){e.n=2;break}throw new Error("Failed to retrieve the visual actions");case 2:return e.a(2,s.message)}},e)}));return function(t,i){return e.apply(this,arguments)}}()),a(c,"addVisualActions",function(){var e=s(g().m(function e(t,i,s){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_VISUAL_ACTIONS,{SheetId:t,VisualId:i,Actions:s})))},e)}));return function(t,i,s){return e.apply(this,arguments)}}()),a(c,"setVisualActions",function(){var e=s(g().m(function e(t,i,s){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_VISUAL_ACTIONS,{SheetId:t,VisualId:i,Actions:s})))},e)}));return function(t,i,s){return e.apply(this,arguments)}}()),a(c,"getSelectedSheetId",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_SELECTED_SHEET_ID));case 1:if(null!=(t=e.v)&&t.message){e.n=2;break}throw new Error("Failed to retrieve the selected sheet id");case 2:return e.a(2,t.message)}},e)}))),a(c,"setSelectedSheetId",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_SELECTED_SHEET_ID,{SheetId:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setTheme",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME,{ThemeArn:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"navigateToDashboard",function(){var e=s(g().m(function e(t,i){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.NAVIGATE_TO_DASHBOARD,{DashboardId:t,Parameters:null==i?void 0:i.parameters})))},e)}));return function(t,i){return e.apply(this,arguments)}}()),a(c,"removeVisualActions",function(){var e=s(g().m(function e(t,i,s){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_VISUAL_ACTIONS,{SheetId:t,VisualId:i,Actions:s})))},e)}));return function(t,i,s){return e.apply(this,arguments)}}()),a(c,"getSheetVisuals",function(){var e=s(g().m(function e(t){var i;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_SHEET_VISUALS,{SheetId:t}));case 1:if(i=e.v,Array.isArray(null==i?void 0:i.message)){e.n=2;break}throw new Error("Failed to retrieve the sheet visuals");case 2:return e.a(2,i.message)}},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setParameters",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_PARAMETERS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"reset",s(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.RESET)))},e)}))),a(c,"setThemeOverride",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME_OVERRIDE,{ThemeOverride:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setPreloadThemes",function(){var e=s(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.PRELOAD_THEMES,{PreloadThemes:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"createSharedView",s(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.CREATE_SHARED_VIEW));case 1:if(null!=(t=e.v)&&t.message){e.n=2;break}throw new Error("Failed to create shared view");case 2:return e.a(2,t)}},e)}))),a(c,"extractExperienceFromUrl",function(e){var t,i,s=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(s.length<3)throw null===(t=(i=c.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:_.DASHBOARD,dashboardId:s[1]}}),a(c,"interceptMessage",function(e,t){var i,s,r,n,o;"SIZE_CHANGED"===e.eventName&&c.frameOptions.resizeHeightOnSizeChangedEvent&&(null==t||null===(r=t.frame)||void 0===r||null===(n=r.setAttribute)||void 0===n||n.call(r,"height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"))),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(i=c.contentOptions)&&void 0!==i&&null!==(i=i.themeOptions)&&void 0!==i&&i.themeOverride&&c.setThemeOverride(c.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(s=c.contentOptions)&&void 0!==s&&null!==(s=s.themeOptions)&&void 0!==s&&s.preloadThemes&&c.setPreloadThemes(c.contentOptions.themeOptions.preloadThemes)}),a(c,"transformDashboardContentOptions",function(e){var t,i,s=e.parameters,r=e.locale,n=e.attributionOptions,o=e.sheetOptions,l=e.toolbarOptions,h=e.themeOptions;e.onMessage;var d=p(e,Re),g=c.transformContentOptions({locale:r,fitSheetToWidth:null===(t=null==o?void 0:o.fitSheetToWidth)||void 0===t||t},d);return Array.isArray(s)&&(g.parameters=s.reduce(function(e,t){return u(u({},e),{},a({},t.Name,t.Values))},{})),!0!==(null==n?void 0:n.overlayContent)&&(g.footerPaddingEnabled=!0),(null!=l&&l.export||null!=l&&null!==(i=l.export)&&void 0!==i&&i.print)&&(g.printEnabled=!0),!0!==(null==l?void 0:l.undoRedo)&&(g.undoRedoDisabled=!0),!0!==(null==l?void 0:l.reset)&&(g.resetDisabled=!0),!0===(null==l?void 0:l.bookmarks)&&(g.showBookmarksIcon=!0),!0===(null==l?void 0:l.thresholdAlerts)&&(g.showThresholdAlertsIcon=!0),!0===(null==l?void 0:l.scheduling)&&(g.showSchedulingIcon=!0),!0===(null==l?void 0:l.executiveSummary)&&(g.showExecutiveSummaryIcon=!0),!0===(null==l?void 0:l.recentSnapshots)&&(g.showRecentSnapshotsIcon=!0),null!=o&&o.initialSheetId&&(g.sheetId=o.initialSheetId),"boolean"==typeof(null==o?void 0:o.singleSheet)&&(g.sheetTabsDisabled=o.singleSheet),null!=o&&o.emitSizeChangedEventOnSheetChange&&(g.resizeOnSheetChange=!0),null!=h&&h.themeArn&&(g.themeArn=h.themeArn),g}),c.experience=c.extractExperienceFromUrl(e.url);var h=c.getInternalExperienceInfo(c.experience),d=h.experienceIdentifier,m=h.internalExperience;return c.internalExperience=m,c.experienceId=d,c.experienceFrame=new Ie(e,o,i,c.transformDashboardContentOptions(i),m,d,c.interceptMessage),c}return c(t,e),o(t)}(ce),ke=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.internalExperience,i=t.contextId,s=t.discriminator;return[e,d.buildQueryString(u(u({},d.transformedContentOptions),{},{contextId:i,discriminator:s}))].join(e.includes("?")?"&":"?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),Le=function(e){function t(){var e;n(this,t);for(var i=arguments.length,o=new Array(i),l=0;l<i;l++)o[l]=arguments[l];return a(e=r(this,t,[].concat(o)),"close",function(){return e.send(new X(D.CLOSE_Q_SEARCH))}),a(e,"setQuestion",function(t){return e.send(new X(D.SET_Q_SEARCH_QUESTION,{question:t}))}),a(e,"trackOutsideClicks",function(){var t=function(){var t=s(g().m(function t(i){var s,r;return g().w(function(t){for(;;)switch(t.p=t.n){case 0:if(null!==(s=e.experienceFrame.iframe)&&void 0!==s&&s.contains(i.target)){t.n=5;break}return t.p=1,t.n=2,e.close();case 2:t.n=5;break;case 3:if(t.p=3,r=t.v,e.experienceFrame.iframe){t.n=4;break}return t.a(2);case 4:throw r;case 5:return t.a(2)}},t,null,[[1,3]])}));return function(e){return t.apply(this,arguments)}}();window.addEventListener("click",t),e.controlOptions.eventManager.addEventListenerForCleanup(e.experienceId,function(){return window.removeEventListener("click",t)})}),a(e,"enterFullScreen",function(i){var s,r;!e.frameStyles&&null!=i&&i.frame&&(e.frameStyles={position:null===(s=i.frame)||void 0===s?void 0:s.style.position,top:null===(r=i.frame)||void 0===r?void 0:r.style.top,left:i.frame.style.left,zIndex:i.frame.style.zIndex,width:i.frame.style.width,height:i.frame.style.height},i.frame.style.position="fixed",i.frame.style.top="0px",i.frame.style.left="0px",i.frame.style.zIndex=t.MAX_Z_INDEX,i.frame.style.width="100vw",i.frame.style.height="100vh")}),a(e,"exitFullScreen",function(t){e.frameStyles&&null!=t&&t.frame&&(t.frame.style.position=e.frameStyles.position,t.frame.style.top=e.frameStyles.top,t.frame.style.left=e.frameStyles.left,t.frame.style.zIndex=e.frameStyles.zIndex,t.frame.style.width=e.frameStyles.width,t.frame.style.height=e.frameStyles.height,e.frameStyles=void 0)}),e}return c(t,e),o(t)}(ce);a(Le,"MAX_Z_INDEX","2147483647");var Ne=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],_e=function(e){function t(e,i,s,o){var l;n(this,t),a(l=r(this,t,[e,i,s,o]),"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid q-search experience URL",{url:e}),{frame:l.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:_.QSEARCH}}),a(l,"interceptMessage",function(e,t){switch(e.eventName){case D.Q_SEARCH_OPENED:case D.Q_SEARCH_CLOSED:var i,s;"object"===v(e.message)&&(null==t||null===(i=t.frame)||void 0===i||i.style.setProperty("height","".concat(null==e||null===(s=e.message)||void 0===s?void 0:s.height,"px")));break;case D.CONTENT_LOADED:l.trackOutsideClicks();break;case D.Q_SEARCH_ENTERED_FULLSCREEN:l.enterFullScreen(t);break;case D.Q_SEARCH_EXITED_FULLSCREEN:l.exitFullScreen(t)}}),a(l,"transformQSearchContentOptions",function(e){var t=e.hideIcon,i=e.hideTopicName,s=e.theme,r=e.allowTopicSelection;e.onMessage;var n=p(e,Ne),o=l.transformContentOptions({allowTopicSelection:r},n);return void 0!==t&&(o.qBarIconDisabled=t),void 0!==i&&(o.qBarTopicNameDisabled=i),void 0!==s&&(o.themeId=s),o}),l.experience=l.extractExperienceFromUrl(e.url);var c=l.getInternalExperienceInfo(l.experience),h=c.experienceIdentifier,d=c.internalExperience;return l.internalExperience=d,l.experienceId=h,l.experienceFrame=new ke(e,s,i,l.transformQSearchContentOptions(i),d,h,l.interceptMessage),l}return c(t,e),o(t)}(Le),Oe=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.internalExperience,i=t.contextId,s=t.discriminator;return[e,d.buildQueryString(u(u({},d.transformedContentOptions),{},{contextId:i,discriminator:s}))].join(e.includes("?")?"&":"?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),Fe=["onMessage","showTopicName","showPinboard","showSearchBar","showInterpretedAs","showFeedback","showGeneratedNarrative","showDidYouMean","showComplementaryVisuals","showQBusinessInsights","showSeeWhy","allowTopicSelection","allowFullscreen","allowReturn","searchPlaceholderText","panelOptions","themeOptions","initialQuestionId","initialAnswerId"],Ge=["panelType","title","showQIcon"],Be=["panelType","focusedHeight","expandedHeight"],Ve=function(e){function t(e,i,s,o){var l;n(this,t),a(l=r(this,t,[e,i,s,o]),"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid generative-qna experience URL",{url:e}),{frame:l.experienceFrame.iframe}),new Error("Invalid generative-qna experience URL");return{experienceType:_.GENERATIVEQNA}}),a(l,"interceptMessage",function(e,t){switch(e.eventName){case D.Q_SEARCH_OPENED:case D.Q_SEARCH_CLOSED:case D.Q_SEARCH_FOCUSED:var i,s;"object"===v(e.message)&&(null==t||null===(i=t.frame)||void 0===i||i.style.setProperty("height","".concat(null==e||null===(s=e.message)||void 0===s?void 0:s.height)));break;case D.CONTENT_LOADED:var r;(null===(r=l.contentOptions)||void 0===r||null===(r=r.panelOptions)||void 0===r?void 0:r.panelType)===W.SEARCH_BAR&&l.trackOutsideClicks();break;case D.Q_PANEL_ENTERED_FULLSCREEN:l.enterFullScreen(t);break;case D.Q_PANEL_EXITED_FULLSCREEN:l.exitFullScreen(t)}}),a(l,"transformGenerativeQnAContentOptions",function(e){var t=[],i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Object.keys(e).forEach(function(e){t.push(i+e)})};e.onMessage;var s=e.showTopicName,r=e.showPinboard,n=e.showSearchBar,o=e.showInterpretedAs,a=e.showFeedback,c=e.showGeneratedNarrative,h=e.showDidYouMean,d=e.showComplementaryVisuals,u=e.showQBusinessInsights,g=e.showSeeWhy,m=e.allowTopicSelection,f=e.allowFullscreen,y=e.allowReturn,v=e.searchPlaceholderText,C=e.panelOptions,b=e.themeOptions,S=e.initialQuestionId,w=e.initialAnswerId;i(p(e,Fe));var x={qShowTopicName:s,qShowPinboard:r,qShowSearchBar:n,qShowInterpretedAs:o,qShowFeedback:a,qShowGeneratedNarrative:c,qShowDidYouMean:h,qShowComplementaryVisuals:d,qShowQBusinessInsights:u,qShowSeeWhy:g,qAllowTopicSelection:m,qAllowFullscreen:f,qAllowReturn:y,questionId:S,answerId:w};if("string"==typeof v&&(l.checkMaxLength(v,"searchPlaceholderText"),x.qSearchPlaceholderText=encodeURIComponent(v)),C){var E=C.panelType;if(x.qPanelType=E,E===W.FULL){C.panelType;var M=C.title,A=C.showQIcon,T=p(C,Ge);"string"==typeof M&&(l.checkMaxLength(M,"panelOptions.title"),x.qPanelTitle=encodeURIComponent(M)),x.qShowPanelIcon=A,i(T,"panelOptions.")}else{if(E!==W.SEARCH_BAR)throw new Error("panelOptions.panelType should be one of following: [FULL, SEARCH_BAR]");C.panelType;var D=C.focusedHeight,I=C.expandedHeight,R=p(C,Be);x.qPanelFocusedHeight=D,x.qPanelExpandedHeight=I,i(R,"panelOptions.")}}return null!=b&&b.themeArn&&(x.themeArn=b.themeArn),l.warnUnrecognizedContentOptions(t),x}),a(l,"checkMaxLength",function(e,i){var s=t.TEXT_PROPERTY_MAX_LENGTH;if(e.length>s)throw new Error("".concat(i," should be less than ").concat(s," characters"))}),l.experience=l.extractExperienceFromUrl(e.url);var c=l.getInternalExperienceInfo(l.experience),h=c.experienceIdentifier,d=c.internalExperience;return l.internalExperience=d,l.experienceId=h,l.experienceFrame=new Oe(e,s,i,l.transformGenerativeQnAContentOptions(i),d,h,l.interceptMessage),l}return c(t,e),o(t)}(Le);a(Ve,"TEXT_PROPERTY_MAX_LENGTH",200);var He=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.internalExperience,i=t.contextId,s=t.discriminator;return[e,d.buildQueryString(u(u({},d.transformedContentOptions),{},{contextId:i,discriminator:s}))].join("?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),Ue=o(function e(t,i,s,r){var o=this;n(this,e),a(this,"experience",{experienceType:_.CONTROL}),a(this,"send",function(e){return o.controlExperienceFrame.send(e)}),a(this,"controlFrameMessageListener",function(e){if(o.isMessageEvent(e.data)){var t=e.data;try{if(t.eventTarget){var i=ce.getExperienceIdentifier(t.eventTarget);o.eventManager.invokeEventListener(i,t)}o.sendAcknowledgment(t)}catch(e){var s,r;null===(s=o.onChange)||void 0===s||s.call(o,new q(T.UNRECOGNIZED_EVENT_TARGET,I.WARN,"Message with unrecognized event target received",{eventTarget:t.eventTarget}),{frame:o.controlExperienceFrame.iframe}),null===(r=o.logger)||void 0===r||r.warn("Message with unrecognized event target received")}}}),a(this,"sendAcknowledgment",function(e){var t,i,s=new Z(D.ACKNOWLEDGE,o.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(t=(i=window).requestIdleCallback)||void 0===t?void 0:t.call(i,function(){return o.send(s)}))||o.send(s)}),a(this,"getControlExperienceId",function(){return[o.internalExperience.contextId,o.internalExperience.experienceType,o.internalExperience.discriminator].filter(Boolean).join("-")}),a(this,"getControlExperienceBaseUrl",function(){var e=o.urlInfo,t=e.host,i=e.sessionId,s="".concat(t,"/embed/").concat(i,"/embedControl");return new URL(s).href}),a(this,"isMessageEvent",function(e){return!!e&&!!e.eventTarget&&!!e.eventName}),this.container=t,this.eventManager=i.eventManager,this.urlInfo=i.urlInfo,this.onChange=s,this.logger=r,this.internalExperience=u(u({},this.experience),{},{contextId:i.contextId,discriminator:0});var l=this.getControlExperienceId();this.controlExperienceFrame=new He({url:this.getControlExperienceBaseUrl(),container:this.container,width:"0px",height:"0px",onChange:this.onChange},{eventManager:this.eventManager,contextId:this.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:this.urlInfo},{},{},this.internalExperience,l),window.addEventListener("message",this.controlFrameMessageListener),this.eventManager.addEventListenerForCleanup(l,function(){return window.removeEventListener("message",o.controlFrameMessageListener)})});a(Ue,"FRAME_TIMEOUT",6e4);var ze=o(function e(){var t=this;n(this,e),a(this,"addEventListener",function(e,i,s){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof i)throw new Error("Invalid type provided for event listener");var r=t.eventListeners.get(e);return s&&t.addEventListenerForCleanup(e,function(){return t.removeEventListener(e,i)}),r?(r.push(i),t):(t.eventListeners.set(e,[i]),t)}),a(this,"invokeEventListener",function(e,i){var s=t.eventListeners.get(e);if(!s)throw new Error("Unable to find experience specific event listeners: ".concat(e));return s.forEach(function(e){e(i)}),t}),a(this,"removeEventListener",function(e,i){var s=t.eventListeners.get(e);if(!s)throw new Error("Unable to find experience specific event listeners: ".concat(e));var r=s.filter(function(e){return e!==i});return t.eventListeners.set(e,r),t}),a(this,"addEventListenerForCleanup",function(e,i){var s,r=null!==(s=t.cleanUpCallbacks.get(e))&&void 0!==s?s:[];r.push(i),t.cleanUpCallbacks.set(e,r)}),a(this,"cleanUpCallbacksForExperience",function(e){var i=t.cleanUpCallbacks.get(e);i&&(i.forEach(function(e){return e()}),t.cleanUpCallbacks.delete(e),t.eventListeners.set(e,[]))}),this.eventListeners=new Map,this.cleanUpCallbacks=new Map}),We=o(function e(){n(this,e),a(this,"log",console.log),a(this,"warn",console.warn),a(this,"error",console.error),a(this,"debug",console.debug),a(this,"info",console.info)}),je=function(e){function t(e,i,s,o,l,c,h){var d;return n(this,t),a(d=r(this,t,[e,i,s,o,l,c,h]),"buildExperienceUrl",function(e){var t=d.internalExperience,i=t.contextId,s=t.discriminator;return[e,d.buildQueryString(u({contextId:i,discriminator:s},d.transformedContentOptions))].join(e.includes("?")?"&":"?")}),d.url=d.buildExperienceUrl(e.url),d.createExperienceIframe(),d}return c(t,e),o(t)}(be),Ke=["fixedAgentArn","agentOptions","promptOptions","footerOptions","onMessage"],$e=["fixedAgentId"],Ye=["allowFileAttachments","showAgentKnowledgeBoundary","initialPrompt","showWebSearch"],qe=["showBrandAttribution","showUsagePolicy"],Xe=function(e){function t(e,i,s,o){var l;n(this,t);var c=u({framePermissions:u({clipboardRead:!0,clipboardWrite:!0},e.framePermissions)},e);a(l=r(this,t,[c,i,s,o]),"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/quick\/chat(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid quick chat experience url",{url:e}),{frame:null}),new Error("Invalid quick chat experience url");return{experienceType:_.QUICKCHAT}}),a(l,"interceptMessage",function(e,t){var i;e.eventName===D.EXPERIENCE_INITIALIZED&&null!==(i=l.contentOptions.promptOptions)&&void 0!==i&&i.initialPrompt&&l.sendPrompt(l.contentOptions.promptOptions.initialPrompt)}),a(l,"sendPrompt",function(e){return l.send(new X(D.SEND_PROMPT,{prompt:e}))}),a(l,"transformQuickChatContentOptions",function(e){var t=[],i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Object.keys(e).forEach(function(e){t.push(i+e)})},s=e.fixedAgentArn,r=e.agentOptions,n=void 0===r?{}:r,o=e.promptOptions,a=void 0===o?{}:o,c=e.footerOptions,h=void 0===c?{}:c;e.onMessage,i(p(e,Ke));var d=n.fixedAgentId;i(p(n,$e),"agentOptions.");var u=a.allowFileAttachments,g=a.showAgentKnowledgeBoundary;a.initialPrompt;var m=a.showWebSearch;i(p(a,Ye),"promptOptions.");var f=h.showBrandAttribution,y=h.showUsagePolicy;return i(p(h,qe),"footerOptions."),l.warnUnrecognizedContentOptions(t),{allowFileAttachments:u,showAgentKnowledgeBoundary:g,showBrandAttribution:f,showUsagePolicy:y,showWebSearch:m,fixedAgentId:l.validateFixedAgentId(s,d)}}),a(l,"validateFixedAgentId",function(e,t){if(e&&t)throw new Error("Both fixedAgentArn and agentOptions.fixedAgentId cannot be specified. Use agentOptions.fixedAgentId.");if(t)return t;if(e){var i;null===(i=l.logger)||void 0===i||i.warn("The fixedAgentArn option is deprecated. Use agentOptions.fixedAgentId instead.");var s=e.split("/")[1];if(!s)throw new Error("Invalid fixedAgentArn.");return s}}),l.experience=l.extractExperienceFromUrl(c.url);var h=l.getInternalExperienceInfo(l.experience),d=h.experienceIdentifier,g=h.internalExperience;return l.internalExperience=g,l.experienceId=d,l.experienceFrame=new je(c,s,i,l.transformQuickChatContentOptions(i),g,d,l.interceptMessage),l}return c(t,e),o(t)}(ce),Ze=o(function e(t){var i=this;n(this,e),a(this,"embedVisual",function(){var e=s(g().m(function e(t){var s,r,n=arguments;return g().w(function(e){for(;;)if(0===e.n)return s=n.length>1&&void 0!==n[1]?n[1]:{},i.validateFrameOptions(t,"embedVisual"),r=i.buildControlOptions(t),e.a(2,new Ee(t,s,r,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedDashboard",function(){var e=s(g().m(function e(t){var s,r,n=arguments;return g().w(function(e){for(;;)if(0===e.n)return s=n.length>1&&void 0!==n[1]?n[1]:{},i.validateFrameOptions(t,"embedDashboard"),r=i.buildControlOptions(t),e.a(2,new Pe(t,s,r,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedConsole",function(){var e=s(g().m(function e(t){var s,r,n=arguments;return g().w(function(e){for(;;)if(0===e.n)return s=n.length>1&&void 0!==n[1]?n[1]:{},i.validateFrameOptions(t,"embedConsole"),r=i.buildControlOptions(t),e.a(2,new Te(t,s,r,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedQSearchBar",function(){var e=s(g().m(function e(t){var s,r,n=arguments;return g().w(function(e){for(;;)if(0===e.n)return s=n.length>1&&void 0!==n[1]?n[1]:{},i.validateFrameOptions(t,"embedQSearchBar"),r=i.buildControlOptions(t),e.a(2,new _e(t,s,r,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedGenerativeQnA",function(){var e=s(g().m(function e(t){var s,r,n=arguments;return g().w(function(e){for(;;)if(0===e.n)return s=n.length>1&&void 0!==n[1]?n[1]:{},i.validateFrameOptions(t,"embedGenerativeQnA"),r=i.buildControlOptions(t),e.a(2,new Ve(t,s,r,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedQuickChat",function(){var e=s(g().m(function e(t){var s,r,n=arguments;return g().w(function(e){for(;;)if(0===e.n)return s=n.length>1&&void 0!==n[1]?n[1]:{},i.validateFrameOptions(t,"embedQuickChat"),r=i.buildControlOptions(t),e.a(2,new Xe(t,s,r,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"validateFrameOptions",function(e,t){if(!e){var s="".concat(t," is called without frameOptions");throw i.onChange(new q(T.NO_FRAME_OPTIONS,I.ERROR,"".concat(t," is called without frameOptions"),{methodName:t}),{frame:null}),new Error(s)}if("object"!==v(e)||Array.isArray(e)){var r="".concat(t," is called with non-object frameOptions");throw i.onChange(new q(T.INVALID_FRAME_OPTIONS,I.ERROR,r,{methodName:t,frameOptionsType:Array.isArray(e)?"array":v(e)}),{frame:null}),new Error(r)}var n=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className","framePermissions"],o=Object.keys(e).filter(function(e){return!n.includes(e)});if(o.length>0){var a,l,c="".concat(t," is called with unrecognized properties");null===(a=e.onChange)||void 0===a||a.call(e,new q(T.UNRECOGNIZED_FRAME_OPTIONS,I.WARN,c,{unrecognizedFrameOptions:o}),{frame:null}),null===(l=i.logger)||void 0===l||l.warn(c)}}),a(this,"buildControlOptions",function(e){if(!i.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var t=i.getControlUrlInfo(e.url),s=new Ue(i.getBodyElement(),{eventManager:i.eventManager,urlInfo:t,contextId:i.contextId},i.onChange,i.logger);i.controlOptions={eventManager:i.eventManager,sendToControlFrame:s.send,contextId:i.contextId,timeout:Ue.FRAME_TIMEOUT,urlInfo:t}}return i.controlOptions}),a(this,"onChange",function(e,t){i.contextOnChange&&i.contextOnChange(e,t)}),a(this,"getControlUrlInfo",function(e){var t=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==t?void 0:t.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:t[3],host:t[1],urlSearchParams:new URLSearchParams(t[4])}}),a(this,"getBodyElement",function(){var e,t=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!t){var s="could not locate <body> element in the page";throw i.onChange(new q(T.NO_BODY,I.ERROR,s),{frame:null}),new Error(s)}return t}),this.contextId=le(),this.experienceIdentifiers=new Set,this.eventManager=new ze,this.contextOnChange=t.onChange,this.logger=new We}),Qe=function(){var e=s(g().m(function e(){var t,i=arguments;return g().w(function(e){for(;;)if(0===e.n)return t=i.length>0&&void 0!==i[0]?i[0]:{},e.a(2,new Ze(t))},e)}));return function(){return e.apply(this,arguments)}}(),Je=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},N),A),R),P),k),L),O),F),V),U),H),z),j),K),$);e.BaseExperience=ce,e.BaseExperienceFrame=be,e.CALCULATED_METRIC_COLUMN_TYPE=B,e.ChangeEvent=q,e.ChangeEventLevel=I,e.ChangeEventName=T,e.ConsoleExperience=Te,e.ConsoleExperienceFrame=Me,e.ControlExperience=Ue,e.ControlExperienceFrame=He,e.DashboardExperience=Pe,e.DashboardExperienceFrame=Ie,e.DataResponse=ie,e.DefaultLogger=We,e.EmbeddingContext=Ze,e.EmbeddingEvent=Y,e.EmbeddingMessageEvent=X,e.ErrorChangeEventName=S,e.ErrorResponse=te,e.EventManager=ze,e.ExperienceType=_,e.GenerativeQnAExperience=Ve,e.GenerativeQnAExperienceFrame=Oe,e.GenerativeQnAPanelType=W,e.GetterMessageEventName=E,e.Iframe=ve,e.InfoChangeEventName=b,e.InfoMessageEventName=C,e.InternalQBaseExperience=Le,e.InvokerMessageEventName=M,e.MessageEventName=D,e.PostMessageEvent=Q,e.QSE=Je,e.QSearchExperience=_e,e.QSearchExperienceFrame=ke,e.QuickChatExperience=Xe,e.QuickChatExperienceFrame=je,e.ResponseMessage=J,e.SDK_VERSION=Ce,e.SPECIAL_DATAPOINT_VALUE_TYPES=G,e.SetterMessageEventName=x,e.SuccessResponse=ee,e.TargetedMessageEvent=Z,e.VisualExperience=Ee,e.VisualExperienceFrame=we,e.WarnChangeEventName=w,e.createEmbeddingContext=Qe}(t)},96411(e,t,i){"use strict";i.d(t,{G:()=>y});var s=i(3224),r=i(17303),n=i(74140),o=i(38383),a=i.n(o),l=i(74831);function c(e){return e.query.definitions.find(e=>"OperationDefinition"===e.kind)}var h=i(74579),d=i.n(h);const u={shouldHandleOperation:void 0,uri:void 0,setTransaction:!0,setFingerprint:!0,attachBreadcrumbs:{includeQuery:!1,includeVariables:!1,includeFetchResult:!1,includeError:!1,includeCache:!1,includeContext:!1,transform:void 0}};var p=i(6613),g=i(74765);function m(e){return JSON.stringify(e,null,2)}function f(e,t,i){const s=i.attachBreadcrumbs&&"function"==typeof i.attachBreadcrumbs.transform?i.attachBreadcrumbs.transform(t,e):t;s.data=function(e){const t={};for(const[i,s]of Object.entries(e))t[i]="object"==typeof s?m(s):s;return t}(s.data),(0,g.Z)(s)}class y extends s.C{options;constructor(e={}){super(),this.options=function(e){return d()(u,e)}(e)}request(e,t){const{options:i}=this;if(!(i.shouldHandleOperation?.(e)??1))return t(e);i.setTransaction&&function(e){const t=c(e).name;t&&(0,p.o5)().setTransactionName(t.value)}(e),i.setFingerprint&&function(e){const t=c(e).name;t&&(0,p.o5)().setFingerprint(["{{ default }}",t.value])}(e);const{attachBreadcrumbs:s}=i;if(!s)return t(e);const o=function(e,t){const i=t.attachBreadcrumbs,s=c(e),r={},n=t.uri;n&&(r.url=n);const o=s.name?.value;o&&(r.operationName=o),i.includeQuery&&(r.query=s.loc?.source?.body??(0,l.y)(s)),i.includeVariables&&(r.variables=e.variables),i.includeCache&&(r.cache=e.getContext().cache?.data?.data??void 0);const h=i.includeContext;return h&&(r.context=function(e,t){const i={};return t.forEach(t=>{i[t]=a().get(e,t)}),i}(e.getContext(),h)),{type:"http",category:`graphql.${s.operation}`,data:r}}(e,i);return new n.c(n=>{const a=t(e).subscribe({next:e=>{o.level=function(e){return e.errors&&e.errors.length>0?"error":"info"}(e),s.includeFetchResult&&(o.data.fetchResult=e),s.includeError&&e.errors&&e.errors.length>0&&(o.data.error=new r.K4({graphQLErrors:e.errors})),n.next(e)},complete:()=>{f(e,o,i),n.complete()},error:t=>{let r;if(o.level="error",function(e){return"object"==typeof e&&null!==e&&"response"in e&&"result"in e&&"statusCode"in e}(t)){const{result:e,response:i,...n}=t;r=n,s.includeFetchResult&&(o.data.fetchResult=e)}else r=t;s.includeError&&(o.data.error=r),f(e,o,i),n.error(t)}});return()=>{a.unsubscribe()}})}}},78071(e,t,i){var s=t;s.bignum=i(5630),s.define=i(92300).define,s.base=i(73160),s.constants=i(36622),s.decoders=i(81300),s.encoders=i(36028)},92300(e,t,i){var s=i(78071),r=i(91193);function n(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new n(e,t)},n.prototype._createNamed=function(e){var t;try{t=i(92785).runInThisContext("(function "+this.name+"(entity) {\n  this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return r(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},n.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(s.decoders[e])),this.decoders[e]},n.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},n.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(s.encoders[e])),this.encoders[e]},n.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},86216(e,t,i){var s=i(91193),r=i(73160).Reporter,n=i(77511).Buffer;function o(e,t){r.call(this,t),n.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof a||(e=new a(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=n.byteLength(e);else{if(!n.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}s(o,r),t.t=o,o.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},o.prototype.restore=function(e){var t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var i=new o(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.d=a,a.prototype.join=function(e,t){return e||(e=new n(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(i){i.join(e,t),t+=i.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):n.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},73160(e,t,i){var s=t;s.Reporter=i(18031).a,s.DecoderBuffer=i(86216).t,s.EncoderBuffer=i(86216).d,s.Node=i(13558)},13558(e,t,i){var s=i(73160).Reporter,r=i(73160).EncoderBuffer,n=i(73160).DecoderBuffer,o=i(35578),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function c(e,t){var i={};this._baseState=i,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}e.exports=c;var h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var e=this._baseState,t={};h.forEach(function(i){t[i]=e[i]});var i=new this.constructor(t.parent);return i._baseState=t,i},c.prototype._wrap=function(){var e=this._baseState;l.forEach(function(t){this[t]=function(){var i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)},c.prototype._init=function(e){var t=this._baseState;o(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),o.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var t=this._baseState,i=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==i.length&&(o(null===t.children),t.children=i,i.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(o(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(i){i==(0|i)&&(i|=0);var s=e[i];t[s]=i}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){c.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),a.forEach(function(e){c.prototype[e]=function(){var t=this._baseState,i=Array.prototype.slice.call(arguments);return o(null===t.tag),t.tag=e,this._useArgs(i),this}}),c.prototype.use=function(e){o(e);var t=this._baseState;return o(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){var t=this._baseState;return o(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){var t=this._baseState;return o(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){var t=this._baseState;return o(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},c.prototype.contains=function(e){var t=this._baseState;return o(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){var i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));var s,r=i.default,o=!0,a=null;if(null!==i.key&&(a=e.enterKey(i.key)),i.optional){var l=null;if(null!==i.explicit?l=i.explicit:null!==i.implicit?l=i.implicit:null!==i.tag&&(l=i.tag),null!==l||i.any){if(o=this._peekTag(e,l,i.any),e.isError(o))return o}else{var c=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(c)}}if(i.obj&&o&&(s=e.enterObject()),o){if(null!==i.explicit){var h=this._decodeTag(e,i.explicit);if(e.isError(h))return h;e=h}var d=e.offset;if(null===i.use&&null===i.choice){i.any&&(c=e.save());var u=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(u))return u;i.any?r=e.raw(c):e=u}if(t&&t.track&&null!==i.tag&&t.track(e.path(),d,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(r=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(r))return r;if(i.any||null!==i.choice||null===i.children||i.children.forEach(function(i){i._decode(e,t)}),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){var p=new n(r);r=this._getUse(i.contains,e._reporterState.obj)._decode(p,t)}}return i.obj&&o&&(r=e.leaveObject(s)),null===i.key||null===r&&!0!==o?null!==a&&e.exitKey(a):e.leaveKey(a,i.key,r),r},c.prototype._decodeGeneric=function(e,t,i){var s=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,s.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&s.args?this._decodeObjid(t,s.args[0],s.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,s.args&&s.args[0],i):null!==s.use?this._getUse(s.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){var i=this._baseState;return i.useDecoder=this._use(e,t),o(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},c.prototype._decodeChoice=function(e,t){var i=this._baseState,s=null,r=!1;return Object.keys(i.choice).some(function(n){var o=e.save(),a=i.choice[n];try{var l=a._decode(e,t);if(e.isError(l))return!1;s={type:n,value:l},r=!0}catch(t){return e.restore(o),!1}return!0},this),r?s:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},c.prototype._encode=function(e,t,i){var s=this._baseState;if(null===s.default||s.default!==e){var r=this._encodeValue(e,t,i);if(void 0!==r&&!this._skipDefault(r,t,i))return r}},c.prototype._encodeValue=function(e,t,i){var r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new s);var n=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}var o=null,a=!1;if(r.any)n=this._createEncoderBuffer(e);else if(r.choice)n=this._encodeChoice(e,t);else if(r.contains)o=this._getUse(r.contains,i)._encode(e,t),a=!0;else if(r.children)o=r.children.map(function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");var s=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var r=i._encode(e[i._baseState.key],t,e);return t.leaveKey(s),r},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(i){var s=this._baseState;return this._getUse(s.args[0],e)._encode(i,t)},l))}else null!==r.use?n=this._getUse(r.use,i)._encode(e,t):(o=this._encodePrimitive(r.tag,e),a=!0);if(!r.any&&null===r.choice){var c=null!==r.implicit?r.implicit:r.tag,h=null===r.implicit?"universal":"context";null===c?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(n=this._encodeComposite(c,a,h,o))}return null!==r.explicit&&(n=this._encodeComposite(r.explicit,!1,"context",n)),n},c.prototype._encodeChoice=function(e,t){var i=this._baseState,s=i.choice[e.type];return s||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),s._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){var i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},18031(e,t,i){var s=i(91193);function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function n(e,t){this.path=e,this.rethrow(t)}t.a=r,r.prototype.isError=function(e){return e instanceof n},r.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,i){var s=this._reporterState;this.exitKey(e),null!==s.obj&&(s.obj[t]=i)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){var t=this._reporterState,i=t.obj;return t.obj=e,i},r.prototype.error=function(e){var t,i=this._reporterState,s=e instanceof n;if(t=s?e:new n(i.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!i.options.partial)throw t;return s||i.errors.push(t),t},r.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},s(n,Error),n.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,n),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},4029(e,t,i){var s=i(36622);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=s._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=s._reverse(t.tag)},36622(e,t,i){var s=t;s._reverse=function(e){var t={};return Object.keys(e).forEach(function(i){(0|i)==i&&(i|=0);var s=e[i];t[s]=i}),t},s.der=i(4029)},87779(e,t,i){var s=i(91193),r=i(78071),n=r.base,o=r.bignum,a=r.constants.der;function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){n.Node.call(this,"der",e)}function h(e,t){var i=e.readUInt8(t);if(e.isError(i))return i;var s=a.tagClass[i>>6],r=!(32&i);if(31&~i)i&=31;else{var n=i;for(i=0;!(128&~n);){if(n=e.readUInt8(t),e.isError(n))return n;i<<=7,i|=127&n}}return{cls:s,primitive:r,tag:i,tagStr:a.tag[i]}}function d(e,t,i){var s=e.readUInt8(i);if(e.isError(s))return s;if(!t&&128===s)return null;if(!(128&s))return s;var r=127&s;if(r>4)return e.error("length octect is too long");s=0;for(var n=0;n<r;n++){s<<=8;var o=e.readUInt8(i);if(e.isError(o))return o;s|=o}return s}e.exports=l,l.prototype.decode=function(e,t){return e instanceof n.DecoderBuffer||(e=new n.DecoderBuffer(e,t)),this.tree._decode(e,t)},s(c,n.Node),c.prototype._peekTag=function(e,t,i){if(e.isEmpty())return!1;var s=e.save(),r=h(e,'Failed to peek tag: "'+t+'"');return e.isError(r)?r:(e.restore(s),r.tag===t||r.tagStr===t||r.tagStr+"of"===t||i)},c.prototype._decodeTag=function(e,t,i){var s=h(e,'Failed to decode tag of "'+t+'"');if(e.isError(s))return s;var r=d(e,s.primitive,'Failed to get length of "'+t+'"');if(e.isError(r))return r;if(!i&&s.tag!==t&&s.tagStr!==t&&s.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(s.primitive||null!==r)return e.skip(r,'Failed to match body of: "'+t+'"');var n=e.save(),o=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(o)?o:(r=e.offset-n.offset,e.restore(n),e.skip(r,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){var i=h(e,t);if(e.isError(i))return i;var s,r=d(e,i.primitive,t);if(e.isError(r))return r;if(s=i.primitive||null!==r?e.skip(r):this._skipUntilEnd(e,t),e.isError(s))return s;if("end"===i.tagStr)break}},c.prototype._decodeList=function(e,t,i,s){for(var r=[];!e.isEmpty();){var n=this._peekTag(e,"end");if(e.isError(n))return n;var o=i.decode(e,"der",s);if(e.isError(o)&&n)break;r.push(o)}return r},c.prototype._decodeStr=function(e,t){if("bitstr"===t){var i=e.readUInt8();return e.isError(i)?i:{unused:i,data:e.raw()}}if("bmpstr"===t){var s=e.raw();if(s.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var r="",n=0;n<s.length/2;n++)r+=String.fromCharCode(s.readUInt16BE(2*n));return r}if("numstr"===t){var o=e.raw().toString("ascii");return this._isNumstr(o)?o:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var a=e.raw().toString("ascii");return this._isPrintstr(a)?a:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,i){for(var s,r=[],n=0;!e.isEmpty();){var o=e.readUInt8();n<<=7,n|=127&o,128&o||(r.push(n),n=0)}128&o&&r.push(n);var a=r[0]/40|0,l=r[0]%40;if(s=i?r:[a,l].concat(r.slice(1)),t){var c=t[s.join(" ")];void 0===c&&(c=t[s.join(".")]),void 0!==c&&(s=c)}return s},c.prototype._decodeTime=function(e,t){var i=e.raw().toString();if("gentime"===t)var s=0|i.slice(0,4),r=0|i.slice(4,6),n=0|i.slice(6,8),o=0|i.slice(8,10),a=0|i.slice(10,12),l=0|i.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");s=0|i.slice(0,2),r=0|i.slice(2,4),n=0|i.slice(4,6),o=0|i.slice(6,8),a=0|i.slice(8,10),l=0|i.slice(10,12),s=s<70?2e3+s:1900+s}return Date.UTC(s,r-1,n,o,a,l,0)},c.prototype._decodeNull=function(e){return null},c.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){var i=e.raw(),s=new o(i);return t&&(s=t[s.toString(10)]||s),s},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},81300(e,t,i){var s=t;s.der=i(87779),s.pem=i(71222)},71222(e,t,i){var s=i(91193),r=i(77511).Buffer,n=i(87779);function o(e){n.call(this,e),this.enc="pem"}s(o,n),e.exports=o,o.prototype.decode=function(e,t){for(var i=e.toString().split(/[\r\n]+/g),s=t.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,l=-1,c=0;c<i.length;c++){var h=i[c].match(o);if(null!==h&&h[2]===s){if(-1!==a){if("END"!==h[1])break;l=c;break}if("BEGIN"!==h[1])break;a=c}}if(-1===a||-1===l)throw new Error("PEM section not found for: "+s);var d=i.slice(a+1,l).join("");d.replace(/[^a-z0-9\+\/=]+/gi,"");var u=new r(d,"base64");return n.prototype.decode.call(this,u,t)}},99291(e,t,i){var s=i(91193),r=i(77511).Buffer,n=i(78071),o=n.base,a=n.constants.der;function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.Node.call(this,"der",e)}function h(e){return e<10?"0"+e:e}e.exports=l,l.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},s(c,o.Node),c.prototype._encodeComposite=function(e,t,i,s){var n,o=function(e,t,i,s){var r;if("seqof"===e?e="seq":"setof"===e&&(e="set"),a.tagByName.hasOwnProperty(e))r=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return s.error("Unknown tag: "+e);r=e}return r>=31?s.error("Multi-octet tag encoding unsupported"):(t||(r|=32),r|=a.tagClassByName[i||"universal"]<<6)}(e,t,i,this.reporter);if(s.length<128)return(n=new r(2))[0]=o,n[1]=s.length,this._createEncoderBuffer([n,s]);for(var l=1,c=s.length;c>=256;c>>=8)l++;(n=new r(2+l))[0]=o,n[1]=128|l,c=1+l;for(var h=s.length;h>0;c--,h>>=8)n[c]=255&h;return this._createEncoderBuffer([n,s])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var i=new r(2*e.length),s=0;s<e.length;s++)i.writeUInt16BE(e.charCodeAt(s),2*s);return this._createEncoderBuffer(i)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,i){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var s=0;s<e.length;s++)e[s]|=0}else if(Array.isArray(e))for(e=e.slice(),s=0;s<e.length;s++)e[s]|=0;if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var n=0;for(s=0;s<e.length;s++){var o=e[s];for(n++;o>=128;o>>=7)n++}var a=new r(n),l=a.length-1;for(s=e.length-1;s>=0;s--)for(o=e[s],a[l--]=127&o;(o>>=7)>0;)a[l--]=128|127&o;return this._createEncoderBuffer(a)},c.prototype._encodeTime=function(e,t){var i,s=new Date(e);return"gentime"===t?i=[h(s.getFullYear()),h(s.getUTCMonth()+1),h(s.getUTCDate()),h(s.getUTCHours()),h(s.getUTCMinutes()),h(s.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[h(s.getFullYear()%100),h(s.getUTCMonth()+1),h(s.getUTCDate()),h(s.getUTCHours()),h(s.getUTCMinutes()),h(s.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new r(i)}if(r.isBuffer(e)){var s=e.length;0===e.length&&s++;var n=new r(s);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);s=1;for(var o=e;o>=256;o>>=8)s++;for(o=(n=new Array(s)).length-1;o>=0;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new r(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){var s,r=this._baseState;if(null===r.default)return!1;var n=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,i).join()),n.length!==r.defaultBuffer.length)return!1;for(s=0;s<n.length;s++)if(n[s]!==r.defaultBuffer[s])return!1;return!0}},36028(e,t,i){var s=t;s.der=i(99291),s.pem=i(59678)},59678(e,t,i){var s=i(91193),r=i(99291);function n(e){r.call(this,e),this.enc="pem"}s(n,r),e.exports=n,n.prototype.encode=function(e,t){for(var i=r.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"],n=0;n<i.length;n+=64)s.push(i.slice(n,n+64));return s.push("-----END "+t.label+"-----"),s.join("\n")}},28213(e,t){"use strict";t.A=function(e,t){if(e&&t){var i=Array.isArray(t)?t:t.split(",");if(0===i.length)return!0;var s=e.name||"",r=(e.type||"").toLowerCase(),n=r.replace(/\/.*$/,"");return i.some(function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?s.toLowerCase().endsWith(t):t.endsWith("/*")?n===t.replace(/\/.*$/,""):r===t})}return!0}},6184(e,t){"use strict";function i(e){var t=void 0;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?t=Reflect.ownKeys(e.prototype):(t=Object.getOwnPropertyNames(e.prototype),"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e.prototype)))),t.forEach(function(t){if("constructor"!==t){var i=Object.getOwnPropertyDescriptor(e.prototype,t);"function"==typeof i.value&&Object.defineProperty(e.prototype,t,s(e,t,i))}}),e}function s(e,t,i){var s=i.value;if("function"!=typeof s)throw new Error("@autobind decorator can only be applied to methods not: "+typeof s);var r=!1;return{configurable:!0,get:function(){if(r||this===e.prototype||this.hasOwnProperty(t))return s;var i=s.bind(this);return r=!0,Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),r=!1,i}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return 1===t.length?i.apply(void 0,t):s.apply(void 0,t)},e.exports=t.default},47187(e,t,i){"use strict";var s,r=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var l,c=i(16266),h=i(2693),d=i(57845),u=i(71481),p=i(21511),g=i(40501);t.USER_AGENT_HEADER="x-amz-user-agent",t.USER_AGENT="aws-amplify/"+g.version+(p.userAgent&&" ")+p.userAgent,function(e){e.NONE="NONE",e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.OPENID_CONNECT="OPENID_CONNECT",e.AWS_LAMBDA="AWS_LAMBDA"}(l=t.AUTH_TYPE||(t.AUTH_TYPE={}));var m=function(e){function i(i){var s=e.call(this)||this;return s.link=t.authLink(i),s}return r(i,e),i.prototype.request=function(e,t){return this.link.request(e,t)},i}(c.ApolloLink);t.AuthLink=m;var f=function(e,i,s){var r=void 0===e?{header:"",value:""}:e,l=r.header,c=r.value;return o(void 0,void 0,void 0,function(){var e,r,o,h,d;return a(this,function(a){switch(a.label){case 0:return e=i.getContext(),r=n(n({},e.headers),((h={})[t.USER_AGENT_HEADER]=t.USER_AGENT,h)),l&&c?"function"!=typeof c?[3,2]:[4,c.call(void 0)]:[3,5];case 1:return o=a.sent(),[3,4];case 2:return[4,c];case 3:o=a.sent(),a.label=4;case 4:r=n(((d={})[l]=o,d),r),a.label=5;case 5:return i.setContext(n(n({},e),{headers:r})),[2,s(i)]}})})};t.authLink=function(e){var i=e.url,s=e.region,r=e.auth,h=(void 0===r?{}:r).type,p=e.auth;return new c.ApolloLink(function(e,r){return new c.Observable(function(c){var g,m;switch(h){case l.NONE:m=f(void 0,e,r);break;case l.AWS_IAM:var v=p.credentials;m=function(e,i,s){var r=e.credentials,l=e.region,c=e.url;return o(void 0,void 0,void 0,function(){var e,o,h,p,g,m,f,v,C,b,S,w,x;return a(this,function(a){switch(a.label){case 0:return e="appsync",o=i.getContext(),(h="function"==typeof r?r.call():r||{})&&"function"==typeof h.getPromise?[4,h.getPromise()]:[3,2];case 1:a.sent(),a.label=2;case 2:return[4,h];case 3:return p=a.sent(),g=p.accessKeyId,m=p.secretAccessKey,f=p.sessionToken,v=u.parse(c),C=v.host,b=v.path,S=n(n({},y(i,{})),{service:e,region:l,url:c,host:C,path:b}),w=d.Signer.sign(S,{access_key:g,secret_key:m,session_token:f}).headers,i.setContext(n(n({},o),{headers:n(n(n({},o.headers),w),(x={},x[t.USER_AGENT_HEADER]=t.USER_AGENT,x))})),[2,s(i)]}})})}({credentials:void 0===v?{}:v,region:s,url:i},e,r);break;case l.API_KEY:var C=p.apiKey;m=f({header:"X-Api-Key",value:void 0===C?"":C},e,r);break;case l.AMAZON_COGNITO_USER_POOLS:case l.OPENID_CONNECT:var b=p.jwtToken;m=f({header:"Authorization",value:void 0===b?"":b},e,r);break;case l.AWS_LAMBDA:var S=p.token;m=f({header:"Authorization",value:void 0===S?"":S},e,r);break;default:throw new Error("Invalid AUTH_TYPE: "+p.type)}return m.then(function(e){g=e.subscribe({next:c.next.bind(c),error:c.error.bind(c),complete:c.complete.bind(c)})}),function(){g&&g.unsubscribe()}})})};var y=function(e,t){var i=e.operationName,s=e.variables,r=e.query,o={operationName:i,variables:v(s),query:h.print(r)};return n(n({body:JSON.stringify(o),method:"POST"},t),{headers:n({accept:"*/*","content-type":"application/json; charset=UTF-8"},t.headers)})},v=function(e){return Object.keys(e).filter(function(e){return!e.startsWith("@@")}).reduce(function(t,i){return t[i]=e[i],t},{})}},2662(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(47187);t.AuthLink=s.AuthLink,t.AUTH_TYPE=s.AUTH_TYPE,t.USER_AGENT_HEADER=s.USER_AGENT_HEADER,t.USER_AGENT=s.USER_AGENT,t.createAuthLink=function(e){var t=e.url,i=e.region,r=e.auth;return new s.AuthLink({url:t,region:i,auth:r})};var r=i(57845);t.Signer=r.Signer},21511(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userAgent=""},57845(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i(24799))},24799(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),globalThis.Buffer=globalThis.Buffer||i(77511).Buffer;var s=i(71481),r=i(18558).Sha256,n=i(93065).n,o=function(e,t,i){void 0===i&&(i="");var s=new r(e);s.update(t);var o=s.digestSync();return"hex"===i?n(o):o},a=function(e){var t=e||"",i=new r;return i.update(t),n(i.digestSync())},l=function(e){return Object.keys(e).map(function(e){return e.toLowerCase()}).sort().join(";")},c=function(e,t,i){void 0===i&&(i=null),e.headers=e.headers||{};var r=(new Date).toISOString().replace(/[:-]|\.\d{3}/g,""),n=r.substr(0,8),c="AWS4-HMAC-SHA256",h=s.parse(e.url);e.headers.host=h.host,e.headers["x-amz-date"]=r,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var d=function(e){var t,i=s.parse(e.url);return[e.method||"/",i.path,i.query,(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map(function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}}).sort(function(e,t){return e.key<t.key?-1:1}).map(function(e){return e.key+":"+e.value}).join("\n")+"\n":""),l(e.headers),a(e.body)].join("\n")}(e);i=i||function(e){var t=(s.parse(e.url).host.match(/([^.]+)\.(?:([^.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}}(e);var u=function(e,t,i){return[e,t,i,"aws4_request"].join("/")}(n,i.region,i.service),p=function(e,t,i,s){return[e,i,s,a(t)].join("\n")}(c,d,r,u),g=function(e,t,i){void 0===e&&(e="");var s=o("AWS4"+e,t),r=o(s,i.region),n=o(r,i.service);return o(n,"aws4_request")}(t.secret_key,n,i),m=function(e,t){return o(e,t,"hex")}(g,p),f=function(e,t,i,s,r){return void 0===t&&(t=""),[e+" Credential="+t+"/"+i,"SignedHeaders="+s,"Signature="+r].join(", ")}(c,t.access_key,u,l(e.headers),m);return e.headers.Authorization=f,e},h=function(){function e(){}return e.sign=c,e}();t.Signer=h,t.default=h},77583(e,t,i){"use strict";var s=this&&this.__rest||function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0});var r=i(16491);t.CONTROL_EVENTS_KEY=r.CONTROL_EVENTS_KEY;var n=i(16266),o=i(42007),a=i(89444),l=i(62178),c=i(44635);t.createSubscriptionHandshakeLink=function(e,t){var i,h;if("string"==typeof e)i=t||o.createHttpLink({uri:e}),h=n.ApolloLink.from([new l.NonTerminatingLink("controlMessages",{link:new n.ApolloLink(function(e,t){return new n.Observable(function(t){var i,n=e.variables,o=r.CONTROL_EVENTS_KEY,a=n[o],l=s(n,["symbol"==typeof o?o:o+""]);return void 0!==a&&(e.variables=l),t.next(((i={})[r.CONTROL_EVENTS_KEY]=a,i)),function(){}})})}),new l.NonTerminatingLink("subsInfo",{link:i}),new r.SubscriptionHandshakeLink("subsInfo")]);else{var d=e.url;i=t||o.createHttpLink({uri:d}),h=new c.AppSyncRealTimeSubscriptionHandshakeLink(e)}return n.ApolloLink.split(function(e){var t=e.query,i=a.getMainDefinition(t),s=i.kind,r=i.operation;return"OperationDefinition"===s&&"subscription"===r},h,i)}},62178(e,t,i){"use strict";var s,r=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(16266),c=i(36712),h=function(e){function t(t,i){var s=i.link,r=e.call(this)||this;return r.contextKey=t,r.link=s,r}return r(t,e),t.prototype.request=function(e,t){var i=this;return c.setContext(function(t,s){return o(i,void 0,void 0,function(){var t,i,r=this;return a(this,function(o){switch(o.label){case 0:return[4,new Promise(function(t,i){r.link.request(e).subscribe({next:t,error:i})})];case 1:return t=o.sent(),[2,n(n({},s),(i={},i[this.contextKey]=t,i))]}})})}).request(e,t)},t}(l.ApolloLink);t.NonTerminatingLink=h},44635(e,t,i){"use strict";var s,r=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(16266),c=i(35497),h=i(2662),d=i(61001),u=i(71481),p=i(32486),g=i(74037),m=i(18639),f=c.rootLogger.extend("subscriptions");t.CONTROL_EVENTS_KEY="@@controlEvents";var y=[400,401,403],v={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},C=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com\/graphql$/i,b=function(e){function i(t){var i=t.url,s=t.region,r=t.auth,n=t.keepAliveTimeoutMs,o=e.call(this)||this;if(o.socketStatus=g.SOCKET_STATUS.CLOSED,o.keepAliveTimeout=void 0,o.subscriptionObserverMap=new Map,o.promiseArray=[],o.url=i,o.region=s,o.auth=r,o.keepAliveTimeout=n,o.keepAliveTimeout<6e4)throw new Error("keepAliveTimeoutMs must be greater than or equal to 60000 ("+o.keepAliveTimeout+" used).");return o}return r(i,e),i.prototype.isCustomDomain=function(e){return null===e.match(C)},i.prototype.request=function(e){var i,s=this,r=e.query,c=e.variables,u=e.getContext(),m=u.controlMessages,f=t.CONTROL_EVENTS_KEY,y=(void 0===m?(i={},i[t.CONTROL_EVENTS_KEY]=void 0,i):m)[f],v=u.headers;return new l.Observable(function(e){if(s.url){var t=p.v4(),i=s.auth.type===h.AUTH_TYPE.AMAZON_COGNITO_USER_POOLS||s.auth.type===h.AUTH_TYPE.OPENID_CONNECT?s.auth.jwtToken:null;i=s.auth.type===h.AUTH_TYPE.AWS_LAMBDA?s.auth.token:i;var l={appSyncGraphqlEndpoint:s.url,authenticationType:s.auth.type,query:d.print(r),region:s.region,graphql_headers:function(){return v},variables:c,apiKey:s.auth.type===h.AUTH_TYPE.API_KEY?s.auth.apiKey:"",credentials:s.auth.type===h.AUTH_TYPE.AWS_IAM?s.auth.credentials:null,token:i};return s._startSubscriptionWithAWSAppSyncRealTime({options:l,observer:e,subscriptionId:t}),function(){return o(s,void 0,void 0,function(){return a(this,function(e){try{if(this._verifySubscriptionAlreadyStarted(t),this.subscriptionObserverMap.get(t).subscriptionState!==g.SUBSCRIPTION_STATUS.CONNECTED)throw new Error("Subscription has failed, starting to remove subscription.");this._sendUnsubscriptionMessage(t)}catch(e){return this._removeSubscriptionObserver(t),[2]}return[2]})})}}e.error({errors:[n({},new d.GraphQLError("Subscribe only available for AWS AppSync endpoint"))]}),e.complete()}).filter(function(e){var t=e.extensions,i=(void 0===t?{}:t).controlMsgType;return!0===y||!(void 0!==(void 0===i?void 0:i))})},i.prototype._verifySubscriptionAlreadyStarted=function(e){return o(this,void 0,void 0,function(){var t=this;return a(this,function(i){return this.subscriptionObserverMap.get(e).subscriptionState===g.SUBSCRIPTION_STATUS.PENDING?[2,new Promise(function(i,s){var r=t.subscriptionObserverMap.get(e),n=r.observer,o=r.subscriptionState,a=r.variables,l=r.query;t.subscriptionObserverMap.set(e,{observer:n,subscriptionState:o,variables:a,query:l,subscriptionReadyCallback:i,subscriptionFailedCallback:s})})]:[2]})})},i.prototype._sendUnsubscriptionMessage=function(e){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===g.SOCKET_STATUS.READY){var t={id:e,type:g.MESSAGE_TYPES.GQL_STOP},i=JSON.stringify(t);this.awsRealTimeSocket.send(i),this._removeSubscriptionObserver(e)}}catch(e){f({err:e})}},i.prototype._removeSubscriptionObserver=function(e){this.subscriptionObserverMap.delete(e),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},i.prototype._closeSocketIfRequired=function(){this.subscriptionObserverMap.size>0||(this.awsRealTimeSocket?this.awsRealTimeSocket.bufferedAmount>0?setTimeout(this._closeSocketIfRequired.bind(this),1e3):(f("closing WebSocket..."),clearTimeout(this.keepAliveTimeoutId),this.awsRealTimeSocket.close(1e3),this.awsRealTimeSocket=null,this.socketStatus=g.SOCKET_STATUS.CLOSED):this.socketStatus=g.SOCKET_STATUS.CLOSED)},i.prototype._startSubscriptionWithAWSAppSyncRealTime=function(e){var t=e.options,i=e.observer,s=e.subscriptionId;return o(this,void 0,void 0,function(){var e,r,o,l,c,u,p,m,f,y,v,C,b,S,w,x,E,M,A,T,D,I,R,P,k,L=this;return a(this,function(a){switch(a.label){case 0:return e=t.appSyncGraphqlEndpoint,r=t.authenticationType,o=t.query,l=t.variables,c=t.apiKey,u=t.region,p=t.graphql_headers,m=void 0===p?function(){return{}}:p,f=t.credentials,y=t.token,v=g.SUBSCRIPTION_STATUS.PENDING,C={query:o,variables:l},this.subscriptionObserverMap.set(s,{observer:i,query:o,variables:l,subscriptionState:v,startAckTimeoutId:null}),b=JSON.stringify(C),w=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:c,appSyncGraphqlEndpoint:e,authenticationType:r,payload:b,canonicalUri:"",region:u,credentials:f,token:y,graphql_headers:m})];case 1:S=n.apply(void 0,[n.apply(void 0,w.concat([a.sent()])),(k={},k[h.USER_AGENT_HEADER]=h.USER_AGENT,k)]),x={id:s,payload:{data:b,extensions:{authorization:n({},S)}},type:g.MESSAGE_TYPES.GQL_START},E=JSON.stringify(x),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this._initializeWebSocketConnection({apiKey:c,appSyncGraphqlEndpoint:e,authenticationType:r,region:u,credentials:f,token:y})];case 3:return a.sent(),[3,5];case 4:return M=a.sent(),A=M.message,T=void 0===A?"":A,i.error({errors:[n({},new d.GraphQLError("Connection failed: "+T))]}),i.complete(),"function"==typeof(D=(this.subscriptionObserverMap.get(s)||{}).subscriptionFailedCallback)&&D(),[2];case 5:return I=this.subscriptionObserverMap.get(s)||{},R=I.subscriptionFailedCallback,P=I.subscriptionReadyCallback,this.subscriptionObserverMap.set(s,{observer:i,subscriptionState:v,variables:l,query:o,subscriptionReadyCallback:P,subscriptionFailedCallback:R,startAckTimeoutId:setTimeout(function(){L._timeoutStartSubscriptionAck.call(L,s)},15e3)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(E),[2]}})})},i.prototype._initializeWebSocketConnection=function(e){var t=this,i=e.appSyncGraphqlEndpoint,s=e.authenticationType,r=e.apiKey,n=e.region,l=e.credentials,c=e.token;if(this.socketStatus!==g.SOCKET_STATUS.READY)return new Promise(function(e,h){return o(t,void 0,void 0,function(){var t,o,d,u,p,m,y,v,C;return a(this,function(a){switch(a.label){case 0:if(this.promiseArray.push({res:e,rej:h}),this.socketStatus!==g.SOCKET_STATUS.CLOSED)return[3,5];a.label=1;case 1:return a.trys.push([1,4,,5]),this.socketStatus=g.SOCKET_STATUS.CONNECTING,t="{}",u=(d=JSON).stringify,[4,this._awsRealTimeHeaderBasedAuth({authenticationType:s,payload:t,canonicalUri:"/connect",apiKey:r,appSyncGraphqlEndpoint:i,region:n,credentials:l,token:c,graphql_headers:function(){}})];case 2:return o=u.apply(d,[a.sent()]),p=Buffer.from(o).toString("base64"),m=Buffer.from(t).toString("base64"),y=i,y=(y=this.isCustomDomain(y)?y.concat("/realtime"):y.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta")).replace("https://","wss://").replace("http://","ws://"),v=y+"?header="+p+"&payload="+m,[4,this._initializeRetryableHandshake({awsRealTimeUrl:v})];case 3:return a.sent(),this.promiseArray.forEach(function(e){var t=e.res;f("Notifying connection successful"),t()}),this.socketStatus=g.SOCKET_STATUS.READY,this.promiseArray=[],[3,5];case 4:return C=a.sent(),this.promiseArray.forEach(function(e){return(0,e.rej)(C)}),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=null,this.socketStatus=g.SOCKET_STATUS.CLOSED,[3,5];case 5:return[2]}})})})},i.prototype._awsRealTimeHeaderBasedAuth=function(e){var t=e.authenticationType,i=e.payload,s=e.canonicalUri,r=e.appSyncGraphqlEndpoint,n=e.apiKey,l=e.region,c=e.credentials,h=e.token,d=e.graphql_headers;return o(this,void 0,void 0,function(){var e,o,p;return a(this,function(a){switch(a.label){case 0:return e={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeAuthorizationHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeAuthorizationHeader.bind(this),AWS_LAMBDA:this._awsRealTimeAuthorizationHeader.bind(this)},"function"!=typeof(o=e[t])?(f("Authentication type "+t+" not supported"),[2,{}]):(p=u.parse(r).host,[4,o({payload:i,canonicalUri:s,appSyncGraphqlEndpoint:r,apiKey:n,region:l,host:p,credentials:c,token:h,graphql_headers:d})]);case 1:return[2,a.sent()]}})})},i.prototype._awsRealTimeAuthorizationHeader=function(e){var t=e.host,i=e.token,s=e.graphql_headers;return o(this,void 0,void 0,function(){var e,r,o;return a(this,function(a){switch(a.label){case 0:return e={},"function"!=typeof i?[3,2]:[4,i.call(void 0)];case 1:return r=a.sent(),[3,4];case 2:return[4,i];case 3:r=a.sent(),a.label=4;case 4:return o=[(e.Authorization=r,e.host=t,e)],[4,s()];case 5:return[2,n.apply(void 0,o.concat([a.sent()]))]}})})},i.prototype._awsRealTimeApiKeyHeader=function(e){var t=e.apiKey,i=e.host,s=e.graphql_headers;return o(this,void 0,void 0,function(){var e,r,o;return a(this,function(a){switch(a.label){case 0:return e=new Date,r=e.toISOString().replace(/[:\-]|\.\d{3}/g,""),o=[{host:i,"x-amz-date":r,"x-api-key":t}],[4,s()];case 1:return[2,n.apply(void 0,o.concat([a.sent()]))]}})})},i.prototype._awsRealTimeIAMHeader=function(e){var t=e.payload,i=e.canonicalUri,s=e.appSyncGraphqlEndpoint,r=e.region,l=e.credentials;return o(this,void 0,void 0,function(){var e,o,c,d,u,p,g,m;return a(this,function(a){switch(a.label){case 0:return e={region:r,service:"appsync"},(o="function"==typeof l?l.call():l||{})&&"function"==typeof o.getPromise?[4,o.getPromise()]:[3,2];case 1:a.sent(),a.label=2;case 2:if(!o)throw new Error("No credentials");return[4,o];case 3:return c=a.sent(),d=c.accessKeyId,u=c.secretAccessKey,p=c.sessionToken,g={access_key:d,secret_key:u,session_token:p},m={url:""+s+i,body:t,method:"POST",headers:n({},v)},[2,h.Signer.sign(m,g,e).headers]}})})},i.prototype._initializeRetryableHandshake=function(e){var t=e.awsRealTimeUrl;return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return f("Initializaling retryable Handshake"),[4,m.jitteredExponentialRetry(this._initializeHandshake.bind(this),[{awsRealTimeUrl:t}])];case 1:return e.sent(),[2]}})})},i.prototype._initializeHandshake=function(e){var t=e.awsRealTimeUrl;return o(this,void 0,void 0,function(){var e,s,r,n=this;return a(this,function(o){switch(o.label){case 0:f("Initializing handshake "+t),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,new Promise(function(e,s){var r=i.createWebSocket(t,"graphql-ws");r.onerror=function(){f("WebSocket connection error")},r.onclose=function(){s(new Error("Connection handshake error"))},r.onopen=function(){return n.awsRealTimeSocket=r,e()}})];case 2:return o.sent(),[4,new Promise(function(e,t){var i=!1;n.awsRealTimeSocket.onerror=function(e){f("WebSocket closed "+JSON.stringify(e))},n.awsRealTimeSocket.onclose=function(e){f("WebSocket closed "+e.reason),t(new Error(JSON.stringify(e)))},n.awsRealTimeSocket.onmessage=function(s){var r;f("subscription message from AWS AppSyncRealTime: "+s.data+" ");var o=JSON.parse(s.data),a=o.type,l=o.payload,c=(void 0===l?{}:l).connectionTimeoutMs,h=void 0===c?3e5:c;if(a===g.MESSAGE_TYPES.GQL_CONNECTION_ACK)return i=!0,n.keepAliveTimeout=null!==(r=n.keepAliveTimeout)&&void 0!==r?r:h,n.awsRealTimeSocket.onmessage=n._handleIncomingSubscriptionMessage.bind(n),n.awsRealTimeSocket.onerror=function(e){f(e),n._errorDisconnect(g.CONTROL_MSG.CONNECTION_CLOSED)},n.awsRealTimeSocket.onclose=function(e){f("WebSocket closed "+e.reason),n._errorDisconnect(g.CONTROL_MSG.CONNECTION_CLOSED)},void e("Cool, connected to AWS AppSyncRealTime");if(a===g.MESSAGE_TYPES.GQL_CONNECTION_ERROR){var d=o.payload,u=(void 0===d?{}:d).errors,p=(void 0===u?[]:u)[0],m=void 0===p?{}:p,y=m.errorType,v=void 0===y?"":y,C=m.errorCode;t({errorType:v,errorCode:void 0===C?0:C})}};var s={type:g.MESSAGE_TYPES.GQL_CONNECTION_INIT};n.awsRealTimeSocket.send(JSON.stringify(s)),setTimeout(function(){i||t(new Error("Connection timeout: ack from AWSRealTime was not received on 15000 ms"))}.bind(n),15e3)})];case 3:return o.sent(),[3,5];case 4:throw e=o.sent(),s=e.errorType,r=e.errorCode,y.indexOf(r)>=0?new m.NonRetryableError(s):s?new Error(s):e;case 5:return[2]}})})},i.prototype._handleIncomingSubscriptionMessage=function(e){f("subscription message from AWS AppSync RealTime: "+e.data);var t=JSON.parse(e.data),i=t.id,s=void 0===i?"":i,r=t.payload,o=t.type,a=this.subscriptionObserverMap.get(s)||{},l=a.observer,c=void 0===l?null:l,h=a.query,u=void 0===h?"":h,p=a.variables,m=void 0===p?{}:p,y=a.startAckTimeoutId,v=void 0===y?0:y,C=a.subscriptionReadyCallback,b=void 0===C?null:C,S=a.subscriptionFailedCallback,w=void 0===S?null:S;if(f({id:s,observer:c,query:u,variables:m}),o===g.MESSAGE_TYPES.GQL_DATA&&r&&r.data)c?c.next(r):f("observer not found for id: "+s);else if(o!==g.MESSAGE_TYPES.GQL_START_ACK){if(o===g.MESSAGE_TYPES.GQL_CONNECTION_KEEP_ALIVE)return clearTimeout(this.keepAliveTimeoutId),void(this.keepAliveTimeoutId=setTimeout(this._errorDisconnect.bind(this,g.CONTROL_MSG.TIMEOUT_DISCONNECT),this.keepAliveTimeout));o===g.MESSAGE_TYPES.GQL_ERROR&&(x=g.SUBSCRIPTION_STATUS.FAILED,this.subscriptionObserverMap.set(s,{observer:c,query:u,variables:m,startAckTimeoutId:v,subscriptionReadyCallback:b,subscriptionFailedCallback:w,subscriptionState:x}),clearTimeout(v),c?(c.error({errors:[n({},new d.GraphQLError("Connection failed: "+JSON.stringify(r)))]}),c.complete()):f("observer not found for id: "+s),"function"==typeof w&&w())}else{f("subscription ready for "+JSON.stringify({query:u,variables:m})),"function"==typeof b&&b(),clearTimeout(v),c?c.next({data:r,extensions:{controlMsgType:"CONNECTED"}}):f("observer not found for id: "+s);var x=g.SUBSCRIPTION_STATUS.CONNECTED;this.subscriptionObserverMap.set(s,{observer:c,query:u,variables:m,startAckTimeoutId:null,subscriptionState:x,subscriptionReadyCallback:b,subscriptionFailedCallback:w})}},i.prototype._errorDisconnect=function(e){f("Disconnect error: "+e),this.subscriptionObserverMap.forEach(function(t){var i=t.observer;i&&!i.closed&&i.error({errors:[n({},new d.GraphQLError(e))]})}),this.subscriptionObserverMap.clear(),this.awsRealTimeSocket&&this.awsRealTimeSocket.close(),this.socketStatus=g.SOCKET_STATUS.CLOSED},i.prototype._timeoutStartSubscriptionAck=function(e){var t=this.subscriptionObserverMap.get(e)||{},i=t.observer,s=t.query,r=t.variables;i&&(this.subscriptionObserverMap.set(e,{observer:i,query:s,variables:r,subscriptionState:g.SUBSCRIPTION_STATUS.FAILED}),i&&!i.closed&&(i.error({errors:[n({},new d.GraphQLError("Subscription timeout "+JSON.stringify({query:s,variables:r})))]}),i.complete()),f("timeoutStartSubscription",JSON.stringify({query:s,variables:r})))},i.createWebSocket=function(e,t){return new WebSocket(e,t)},i}(l.ApolloLink);t.AppSyncRealTimeSubscriptionHandshakeLink=b},16491(e,t,i){"use strict";var s,r=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},l=this&&this.__rest||function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0});var c=i(16266),h=i(35497),d=i(35529),u=i(89444),p=h.rootLogger.extend("subscriptions"),g=p.extend("mqtt");t.CONTROL_EVENTS_KEY="@@controlEvents";var m=function(e){function i(t){var i=e.call(this)||this;return i.topicObservers=new Map,i.clientObservers=new Map,i.onMessage=function(e,t,s){var r=JSON.parse(t),o=i.topicObservers.get(e),a=s.reduce(function(e,t){return e[t]=e[t]||null,e},r.data||{});p("Message received",{data:a,topic:e,observers:o}),o.forEach(function(e){try{e.next(n(n({},r),{data:a}))}catch(e){p(e)}})},i.subsInfoContextKey=t,i}return r(i,e),i.prototype.request=function(e){var i,s=this,r=e.getContext(),o=r[this.subsInfoContextKey],a=r.controlMessages,h=t.CONTROL_EVENTS_KEY,d=(void 0===a?(i={},i[t.CONTROL_EVENTS_KEY]=void 0,i):a)[h],u=o.extensions,p=(void 0===u?{subscription:{newSubscriptions:{},mqttConnections:[]}}:u).subscription,g=p.newSubscriptions,m=p.mqttConnections,f=o.errors,y=void 0===f?[]:f;if(y&&y.length)return new c.Observable(function(e){return e.error(new c.ApolloError({errorMessage:"Error during subscription handshake",extraInfo:{errors:y},graphQLErrors:y})),function(){}});var v=Object.keys(g).map(function(e){return g[e].topic}),C=new Set(v.filter(function(e){return s.topicObservers.has(e)})),b=new Set(v.filter(function(e){return!C.has(e)}));return new c.Observable(function(t){C.forEach(function(e){s.topicObservers.get(e).add(t);var i=Array.from(s.topicObservers.get(e)).find(function(){return!0}),r=Array.from(s.clientObservers).find(function(e){return e[1].observers.has(i)})[0];s.clientObservers.get(r).observers.add(t)});var i=m.filter(function(e){return e.topics.some(function(e){return b.has(e)})}).map(function(e){var t=e.topics,i=l(e,["topics"]);return n(n({},i),{topics:t.filter(function(e){return b.has(e)})})});return s.connectNewClients(i,t,e),function(){var e=Array.from(s.clientObservers).filter(function(e){return e[1].observers.has(t)});e.forEach(function(e){var i=e[0];return s.clientObservers.get(i).observers.delete(t)}),s.clientObservers.forEach(function(e){var t=e.observers,i=e.client;0===t.size&&(i.isConnected()&&i.disconnect(),s.clientObservers.delete(i.clientId))}),s.clientObservers=new Map(Array.from(s.clientObservers).filter(function(e){return e[1].observers.size>0})),s.topicObservers.forEach(function(e){return e.delete(t)}),s.topicObservers=new Map(Array.from(s.topicObservers).filter(function(e){return e[1].size>0}))}}).filter(function(e){var t=e.extensions,i=(void 0===t?{}:t).controlMsgType;return!0===d||!(void 0!==(void 0===i?void 0:i))})},i.prototype.connectNewClients=function(e,t,i){return o(this,void 0,void 0,function(){var s,r,n,o,l=this;return a(this,function(a){return s=i.query,r=u.getMainDefinition(s).selectionSet.selections.map(function(e){return e.name.value}),n=Promise.all(e.map(function(e){return l.connectNewClient(e,t,r)})),o=r.reduce(function(e,t){return e[t]=e[t]||null,e},{}),t.next({data:o,extensions:{controlMsgType:"CONNECTED",controlMsgInfo:{connectionInfo:e}}}),[2,n]})})},i.prototype.connectNewClient=function(e,t,i){return o(this,void 0,void 0,function(){var s,r,o,c,h=this;return a(this,function(a){switch(a.label){case 0:return s=e.client,r=e.url,o=e.topics,(c=new d.Client(r,s)).trace=g.bind(null,s),c.onConnectionLost=function(e){var t=e.errorCode,i=l(e,["errorCode"]);0!==t&&o.forEach(function(e){h.topicObservers.has(e)&&h.topicObservers.get(e).forEach(function(e){return e.error(n(n({},i),{permanent:!0}))})}),o.forEach(function(e){return h.topicObservers.delete(e)})},c.onMessageArrived=function(e){var t=e.destinationName,s=e.payloadString;return h.onMessage(t,s,i)},[4,new Promise(function(e,t){c.connect({useSSL:0===r.indexOf("wss://"),mqttVersion:3,onSuccess:function(){return e(c)},onFailure:t})})];case 1:return a.sent(),[4,this.subscribeToTopics(c,o,t)];case 2:return a.sent(),[2,c]}})})},i.prototype.subscribeToTopics=function(e,t,i){var s=this;return Promise.all(t.map(function(t){return s.subscribeToTopic(e,t,i)}))},i.prototype.subscribeToTopic=function(e,t,i){var s=this;return new Promise(function(r,n){e.subscribe(t,{onSuccess:function(){s.topicObservers.has(t)||s.topicObservers.set(t,new Set),s.clientObservers.has(e.clientId)||s.clientObservers.set(e.clientId,{client:e,observers:new Set}),s.topicObservers.get(t).add(i),s.clientObservers.get(e.clientId).observers.add(i),r(t)},onFailure:n})})},i}(c.ApolloLink);t.SubscriptionHandshakeLink=m},74037(e,t){"use strict";var i,s,r,n;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.SUBSCRIPTION_STATUS||(t.SUBSCRIPTION_STATUS={}))[n.PENDING=0]="PENDING",n[n.CONNECTED=1]="CONNECTED",n[n.FAILED=2]="FAILED",(r=t.SOCKET_STATUS||(t.SOCKET_STATUS={}))[r.CLOSED=0]="CLOSED",r[r.READY=1]="READY",r[r.CONNECTING=2]="CONNECTING",(s=t.MESSAGE_TYPES||(t.MESSAGE_TYPES={})).GQL_CONNECTION_INIT="connection_init",s.GQL_CONNECTION_ERROR="connection_error",s.GQL_CONNECTION_ACK="connection_ack",s.GQL_START="start",s.GQL_START_ACK="start_ack",s.GQL_DATA="data",s.GQL_CONNECTION_KEEP_ALIVE="ka",s.GQL_STOP="stop",s.GQL_COMPLETE="complete",s.GQL_ERROR="error",(i=t.CONTROL_MSG||(t.CONTROL_MSG={})).CONNECTION_CLOSED="Connection closed",i.TIMEOUT_DISCONNECT="Timeout disconnect",i.SUBSCRIPTION_ACK="Subscription ack"},35497(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(77321);t.rootLogger=s.default},77321(e,t,i){"use strict";var s=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=Array(e),r=0;for(t=0;t<i;t++)for(var n=arguments[t],o=0,a=n.length;o<a;o++,r++)s[r]=n[o];return s};Object.defineProperty(t,"__esModule",{value:!0});var r=i(89028),n=r.default("aws-appsync"),o=function(e){void 0===e&&(e="");var t=e?s(this.namespace.split(":"),[e]).join(":"):this.namespace,i=r.default(t);return i.extend=o.bind(i),i};n.extend=o.bind(n),t.default=n},18639(e,t,i){"use strict";var s,r=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),n=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(35497).rootLogger.extend("retry"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.nonRetryable=!0,i}return r(t,e),t}(Error);function c(e,t,i,s){return void 0===s&&(s=1),n(this,void 0,void 0,function(){var r,n;return o(this,function(o){switch(o.label){case 0:a("Attempt #"+s+" for this vars: "+JSON.stringify(t)),o.label=1;case 1:return o.trys.push([1,3,,8]),[4,e.apply(void 0,t)];case 2:return o.sent(),[3,8];case 3:if(r=o.sent(),a("error "+r),(l=r)&&l.nonRetryable)throw a("non retryable error"),r;return n=i(s,t,r),a("retryIn ",n),!1===n?[3,6]:[4,new Promise(function(e){return setTimeout(e,n)})];case 4:return o.sent(),[4,c(e,t,i,s+1)];case 5:return[2,o.sent()];case 6:throw r;case 7:return[3,8];case 8:return[2]}var l})})}t.NonRetryableError=l,t.retry=c,t.jitteredExponentialRetry=function(e,t,i){return void 0===i&&(i=5e3),c(e,t,function(e){return function(t){var i=100*Math.pow(2,t)+100*Math.random();return!(i>e)&&i}}(i))}},35529(e){var t;t=function(){var e=function(t){var i,s=t.localStorage||(i={},{setItem:function(e,t){i[e]=t},getItem:function(e){return i[e]},removeItem:function(e){delete i[e]}}),r=function(e,t){for(var i in e)if(e.hasOwnProperty(i)){if(!t.hasOwnProperty(i)){var s="Unknown property, "+i+". Valid properties are:";for(var r in t)t.hasOwnProperty(r)&&(s=s+" "+r);throw new Error(s)}if(typeof e[i]!==t[i])throw new Error(l(o.INVALID_TYPE,[typeof e[i],i]))}},n=function(e,t){return function(){return e.apply(t,arguments)}},o={OK:{code:0,text:"AMQJSC0000I OK."},CONNECT_TIMEOUT:{code:1,text:"AMQJSC0001E Connect timed out."},SUBSCRIBE_TIMEOUT:{code:2,text:"AMQJS0002E Subscribe timed out."},UNSUBSCRIBE_TIMEOUT:{code:3,text:"AMQJS0003E Unsubscribe timed out."},PING_TIMEOUT:{code:4,text:"AMQJS0004E Ping timed out."},INTERNAL_ERROR:{code:5,text:"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}"},CONNACK_RETURNCODE:{code:6,text:"AMQJS0006E Bad Connack return code:{0} {1}."},SOCKET_ERROR:{code:7,text:"AMQJS0007E Socket error:{0}."},SOCKET_CLOSE:{code:8,text:"AMQJS0008I Socket closed."},MALFORMED_UTF:{code:9,text:"AMQJS0009E Malformed UTF data:{0} {1} {2}."},UNSUPPORTED:{code:10,text:"AMQJS0010E {0} is not supported by this browser."},INVALID_STATE:{code:11,text:"AMQJS0011E Invalid state {0}."},INVALID_TYPE:{code:12,text:"AMQJS0012E Invalid type {0} for {1}."},INVALID_ARGUMENT:{code:13,text:"AMQJS0013E Invalid argument {0} for {1}."},UNSUPPORTED_OPERATION:{code:14,text:"AMQJS0014E Unsupported operation."},INVALID_STORED_DATA:{code:15,text:"AMQJS0015E Invalid data in local storage key={0} value={1}."},INVALID_MQTT_MESSAGE_TYPE:{code:16,text:"AMQJS0016E Invalid MQTT message type {0}."},MALFORMED_UNICODE:{code:17,text:"AMQJS0017E Malformed Unicode string:{0} {1}."},BUFFER_FULL:{code:18,text:"AMQJS0018E Message buffer is full, maximum buffer size: {0}."}},a={0:"Connection Accepted",1:"Connection Refused: unacceptable protocol version",2:"Connection Refused: identifier rejected",3:"Connection Refused: server unavailable",4:"Connection Refused: bad user name or password",5:"Connection Refused: not authorized"},l=function(e,t){var i=e.text;if(t)for(var s,r,n=0;n<t.length;n++)if(s="{"+n+"}",(r=i.indexOf(s))>0){var o=i.substring(0,r),a=i.substring(r+s.length);i=o+t[n]+a}return i},c=[0,6,77,81,73,115,100,112,3],h=[0,4,77,81,84,84,4],d=function(e,t){for(var i in this.type=e,t)t.hasOwnProperty(i)&&(this[i]=t[i])};function u(t,i){var s,r=i,n=t[i],o=n>>4,a=n&=15;i+=1;var l=0,c=1;do{if(i==t.length)return[null,r];l+=(127&(s=t[i++]))*c,c*=128}while(128&s);var h=i+l;if(h>t.length)return[null,r];var u=new d(o);switch(o){case 2:1&t[i++]&&(u.sessionPresent=!0),u.returnCode=t[i++];break;case 3:var p=a>>1&3,g=m(t,i),f=v(t,i+=2,g);i+=g,p>0&&(u.messageIdentifier=m(t,i),i+=2);var y=new e.Message(t.subarray(i,h));1&~a||(y.retained=!0),8&~a||(y.duplicate=!0),y.qos=p,y.destinationName=f,u.payloadMessage=y;break;case 4:case 5:case 6:case 7:case 11:u.messageIdentifier=m(t,i);break;case 9:u.messageIdentifier=m(t,i),i+=2,u.returnCode=t.subarray(i,h)}return[u,h]}function p(e,t,i){return t[i++]=e>>8,t[i++]=e%256,i}function g(e,t,i,s){return y(e,i,s=p(t,i,s)),s+t}function m(e,t){return 256*e[t]+e[t+1]}function f(e){for(var t=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s>2047?(55296<=s&&s<=56319&&(i++,t++),t+=3):s>127?t+=2:t++}return t}function y(e,t,i){for(var s=i,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(55296<=n&&n<=56319){var a=e.charCodeAt(++r);if(isNaN(a))throw new Error(l(o.MALFORMED_UNICODE,[n,a]));n=a-56320+(n-55296<<10)+65536}n<=127?t[s++]=n:n<=2047?(t[s++]=n>>6&31|192,t[s++]=63&n|128):n<=65535?(t[s++]=n>>12&15|224,t[s++]=n>>6&63|128,t[s++]=63&n|128):(t[s++]=n>>18&7|240,t[s++]=n>>12&63|128,t[s++]=n>>6&63|128,t[s++]=63&n|128)}return t}function v(e,t,i){for(var s,r="",n=t;n<t+i;){var a=e[n++];if(a<128)s=a;else{var c=e[n++]-128;if(c<0)throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),""]));if(a<224)s=64*(a-192)+c;else{var h=e[n++]-128;if(h<0)throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),h.toString(16)]));if(a<240)s=4096*(a-224)+64*c+h;else{var d=e[n++]-128;if(d<0)throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),h.toString(16),d.toString(16)]));if(!(a<248))throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),h.toString(16),d.toString(16)]));s=262144*(a-240)+4096*c+64*h+d}}}s>65535&&(s-=65536,r+=String.fromCharCode(55296+(s>>10)),s=56320+(1023&s)),r+=String.fromCharCode(s)}return r}d.prototype.encode=function(){var e,t=(15&this.type)<<4,i=0,s=[],r=0;switch(void 0!==this.messageIdentifier&&(i+=2),this.type){case 1:switch(this.mqttVersion){case 3:i+=c.length+3;break;case 4:i+=h.length+3}i+=f(this.clientId)+2,void 0!==this.willMessage&&(i+=f(this.willMessage.destinationName)+2,(e=this.willMessage.payloadBytes)instanceof Uint8Array||(e=new Uint8Array(o)),i+=e.byteLength+2),void 0!==this.userName&&(i+=f(this.userName)+2),void 0!==this.password&&(i+=f(this.password)+2);break;case 8:t|=2;for(var n=0;n<this.topics.length;n++)s[n]=f(this.topics[n]),i+=s[n]+2;i+=this.requestedQos.length;break;case 10:for(t|=2,n=0;n<this.topics.length;n++)s[n]=f(this.topics[n]),i+=s[n]+2;break;case 6:t|=2;break;case 3:this.payloadMessage.duplicate&&(t|=8),t=t|=this.payloadMessage.qos<<1,this.payloadMessage.retained&&(t|=1),i+=(r=f(this.payloadMessage.destinationName))+2;var o=this.payloadMessage.payloadBytes;i+=o.byteLength,o instanceof ArrayBuffer?o=new Uint8Array(o):o instanceof Uint8Array||(o=new Uint8Array(o.buffer))}var a=function(e){var t=new Array(1),i=0;do{var s=e%128;(e>>=7)>0&&(s|=128),t[i++]=s}while(e>0&&i<4);return t}(i),l=a.length+1,d=new ArrayBuffer(i+l),u=new Uint8Array(d);if(u[0]=t,u.set(a,1),3==this.type)l=g(this.payloadMessage.destinationName,r,u,l);else if(1==this.type){switch(this.mqttVersion){case 3:u.set(c,l),l+=c.length;break;case 4:u.set(h,l),l+=h.length}var m=0;this.cleanSession&&(m=2),void 0!==this.willMessage&&(m|=4,m|=this.willMessage.qos<<3,this.willMessage.retained&&(m|=32)),void 0!==this.userName&&(m|=128),void 0!==this.password&&(m|=64),u[l++]=m,l=p(this.keepAliveInterval,u,l)}switch(void 0!==this.messageIdentifier&&(l=p(this.messageIdentifier,u,l)),this.type){case 1:l=g(this.clientId,f(this.clientId),u,l),void 0!==this.willMessage&&(l=g(this.willMessage.destinationName,f(this.willMessage.destinationName),u,l),l=p(e.byteLength,u,l),u.set(e,l),l+=e.byteLength),void 0!==this.userName&&(l=g(this.userName,f(this.userName),u,l)),void 0!==this.password&&(l=g(this.password,f(this.password),u,l));break;case 3:u.set(o,l);break;case 8:for(n=0;n<this.topics.length;n++)l=g(this.topics[n],s[n],u,l),u[l++]=this.requestedQos[n];break;case 10:for(n=0;n<this.topics.length;n++)l=g(this.topics[n],s[n],u,l)}return d};var C=function(e,t){this._client=e,this._keepAliveInterval=1e3*t,this.isReset=!1;var i=new d(12).encode(),s=function(e){return function(){return r.apply(e)}},r=function(){this.isReset?(this.isReset=!1,this._client._trace("Pinger.doPing","send PINGREQ"),this._client.socket.send(i),this.timeout=setTimeout(s(this),this._keepAliveInterval)):(this._client._trace("Pinger.doPing","Timed out"),this._client._disconnected(o.PING_TIMEOUT.code,l(o.PING_TIMEOUT)))};this.reset=function(){this.isReset=!0,clearTimeout(this.timeout),this._keepAliveInterval>0&&(this.timeout=setTimeout(s(this),this._keepAliveInterval))},this.cancel=function(){clearTimeout(this.timeout)}},b=function(e,t,i,s){t||(t=30),this.timeout=setTimeout(function(e,t,i){return function(){return e.apply(t,i)}}(i,e,s),1e3*t),this.cancel=function(){clearTimeout(this.timeout)}},S=function(e,i,r,n,a){if(!("WebSocket"in t)||null===t.WebSocket)throw new Error(l(o.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in t)||null===t.ArrayBuffer)throw new Error(l(o.UNSUPPORTED,["ArrayBuffer"]));for(var c in this._trace("Paho.Client",e,i,r,n,a),this.host=i,this.port=r,this.path=n,this.uri=e,this.clientId=a,this._wsuri=null,this._localKey=i+":"+r+("/mqtt"!=n?":"+n:"")+":"+a+":",this._msg_queue=[],this._buffered_msg_queue=[],this._sentMessages={},this._receivedMessages={},this._notify_msg_sent={},this._message_identifier=1,this._sequence=0,s)0!==c.indexOf("Sent:"+this._localKey)&&0!==c.indexOf("Received:"+this._localKey)||this.restore(c)};S.prototype.host=null,S.prototype.port=null,S.prototype.path=null,S.prototype.uri=null,S.prototype.clientId=null,S.prototype.socket=null,S.prototype.connected=!1,S.prototype.maxMessageIdentifier=65536,S.prototype.connectOptions=null,S.prototype.hostIndex=null,S.prototype.onConnected=null,S.prototype.onConnectionLost=null,S.prototype.onMessageDelivered=null,S.prototype.onMessageArrived=null,S.prototype.traceFunction=null,S.prototype._msg_queue=null,S.prototype._buffered_msg_queue=null,S.prototype._connectTimeout=null,S.prototype.sendPinger=null,S.prototype.receivePinger=null,S.prototype._reconnectInterval=1,S.prototype._reconnecting=!1,S.prototype._reconnectTimeout=null,S.prototype.disconnectedPublishing=!1,S.prototype.disconnectedBufferSize=5e3,S.prototype.receiveBuffer=null,S.prototype._traceBuffer=null,S.prototype._MAX_TRACE_ENTRIES=100,S.prototype.connect=function(e){var t=this._traceMask(e,"password");if(this._trace("Client.connect",t,this.socket,this.connected),this.connected)throw new Error(l(o.INVALID_STATE,["already connected"]));if(this.socket)throw new Error(l(o.INVALID_STATE,["already connected"]));this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),this.connectOptions=e,this._reconnectInterval=1,this._reconnecting=!1,e.uris?(this.hostIndex=0,this._doConnect(e.uris[0])):this._doConnect(this.uri)},S.prototype.subscribe=function(e,t){if(this._trace("Client.subscribe",e,t),!this.connected)throw new Error(l(o.INVALID_STATE,["not connected"]));var i=new d(8);i.topics=[e],void 0!==t.qos?i.requestedQos=[t.qos]:i.requestedQos=[0],t.onSuccess&&(i.onSuccess=function(e){t.onSuccess({invocationContext:t.invocationContext,grantedQos:e})}),t.onFailure&&(i.onFailure=function(e){t.onFailure({invocationContext:t.invocationContext,errorCode:e,errorMessage:l(e)})}),t.timeout&&(i.timeOut=new b(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:o.SUBSCRIBE_TIMEOUT.code,errorMessage:l(o.SUBSCRIBE_TIMEOUT)}])),this._requires_ack(i),this._schedule_message(i)},S.prototype.unsubscribe=function(e,t){if(this._trace("Client.unsubscribe",e,t),!this.connected)throw new Error(l(o.INVALID_STATE,["not connected"]));var i=new d(10);i.topics=[e],t.onSuccess&&(i.callback=function(){t.onSuccess({invocationContext:t.invocationContext})}),t.timeout&&(i.timeOut=new b(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:o.UNSUBSCRIBE_TIMEOUT.code,errorMessage:l(o.UNSUBSCRIBE_TIMEOUT)}])),this._requires_ack(i),this._schedule_message(i)},S.prototype.send=function(e){this._trace("Client.send",e);var t=new d(3);if(t.payloadMessage=e,this.connected)e.qos>0?this._requires_ack(t):this.onMessageDelivered&&(this._notify_msg_sent[t]=this.onMessageDelivered(t.payloadMessage)),this._schedule_message(t);else{if(!this._reconnecting||!this.disconnectedPublishing)throw new Error(l(o.INVALID_STATE,["not connected"]));if(Object.keys(this._sentMessages).length+this._buffered_msg_queue.length>this.disconnectedBufferSize)throw new Error(l(o.BUFFER_FULL,[this.disconnectedBufferSize]));e.qos>0?this._requires_ack(t):(t.sequence=++this._sequence,this._buffered_msg_queue.unshift(t))}},S.prototype.disconnect=function(){if(this._trace("Client.disconnect"),this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),!this.socket)throw new Error(l(o.INVALID_STATE,["not connecting or connected"]));var e=new d(14);this._notify_msg_sent[e]=n(this._disconnected,this),this._schedule_message(e)},S.prototype.getTraceLog=function(){if(null!==this._traceBuffer){for(var e in this._trace("Client.getTraceLog",new Date),this._trace("Client.getTraceLog in flight messages",this._sentMessages.length),this._sentMessages)this._trace("_sentMessages ",e,this._sentMessages[e]);for(var e in this._receivedMessages)this._trace("_receivedMessages ",e,this._receivedMessages[e]);return this._traceBuffer}},S.prototype.startTrace=function(){null===this._traceBuffer&&(this._traceBuffer=[]),this._trace("Client.startTrace",new Date,"@VERSION@-@BUILDLEVEL@")},S.prototype.stopTrace=function(){delete this._traceBuffer},S.prototype._doConnect=function(e){if(this.connectOptions.useSSL){var t=e.split(":");t[0]="wss",e=t.join(":")}this._wsuri=e,this.connected=!1,this.connectOptions.mqttVersion<4?this.socket=new WebSocket(e,["mqttv3.1"]):this.socket=new WebSocket(e,["mqtt"]),this.socket.binaryType="arraybuffer",this.socket.onopen=n(this._on_socket_open,this),this.socket.onmessage=n(this._on_socket_message,this),this.socket.onerror=n(this._on_socket_error,this),this.socket.onclose=n(this._on_socket_close,this),this.sendPinger=new C(this,this.connectOptions.keepAliveInterval),this.receivePinger=new C(this,this.connectOptions.keepAliveInterval),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._connectTimeout=new b(this,this.connectOptions.timeout,this._disconnected,[o.CONNECT_TIMEOUT.code,l(o.CONNECT_TIMEOUT)])},S.prototype._schedule_message=function(e){this._msg_queue.unshift(e),this.connected&&this._process_queue()},S.prototype.store=function(e,t){var i={type:t.type,messageIdentifier:t.messageIdentifier,version:1};if(3!==t.type)throw Error(l(o.INVALID_STORED_DATA,[e+this._localKey+t.messageIdentifier,i]));t.pubRecReceived&&(i.pubRecReceived=!0),i.payloadMessage={};for(var r="",n=t.payloadMessage.payloadBytes,a=0;a<n.length;a++)n[a]<=15?r=r+"0"+n[a].toString(16):r+=n[a].toString(16);i.payloadMessage.payloadHex=r,i.payloadMessage.qos=t.payloadMessage.qos,i.payloadMessage.destinationName=t.payloadMessage.destinationName,t.payloadMessage.duplicate&&(i.payloadMessage.duplicate=!0),t.payloadMessage.retained&&(i.payloadMessage.retained=!0),0===e.indexOf("Sent:")&&(void 0===t.sequence&&(t.sequence=++this._sequence),i.sequence=t.sequence),s.setItem(e+this._localKey+t.messageIdentifier,JSON.stringify(i))},S.prototype.restore=function(t){var i=s.getItem(t),r=JSON.parse(i),n=new d(r.type,r);if(3!==r.type)throw Error(l(o.INVALID_STORED_DATA,[t,i]));for(var a=r.payloadMessage.payloadHex,c=new ArrayBuffer(a.length/2),h=new Uint8Array(c),u=0;a.length>=2;){var p=parseInt(a.substring(0,2),16);a=a.substring(2,a.length),h[u++]=p}var g=new e.Message(h);g.qos=r.payloadMessage.qos,g.destinationName=r.payloadMessage.destinationName,r.payloadMessage.duplicate&&(g.duplicate=!0),r.payloadMessage.retained&&(g.retained=!0),n.payloadMessage=g,0===t.indexOf("Sent:"+this._localKey)?(n.payloadMessage.duplicate=!0,this._sentMessages[n.messageIdentifier]=n):0===t.indexOf("Received:"+this._localKey)&&(this._receivedMessages[n.messageIdentifier]=n)},S.prototype._process_queue=function(){for(var e=null;e=this._msg_queue.pop();)this._socket_send(e),this._notify_msg_sent[e]&&(this._notify_msg_sent[e](),delete this._notify_msg_sent[e])},S.prototype._requires_ack=function(e){var t=Object.keys(this._sentMessages).length;if(t>this.maxMessageIdentifier)throw Error("Too many messages:"+t);for(;void 0!==this._sentMessages[this._message_identifier];)this._message_identifier++;e.messageIdentifier=this._message_identifier,this._sentMessages[e.messageIdentifier]=e,3===e.type&&this.store("Sent:",e),this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)},S.prototype._on_socket_open=function(){var e=new d(1,this.connectOptions);e.clientId=this.clientId,this._socket_send(e)},S.prototype._on_socket_message=function(e){this._trace("Client._on_socket_message",e.data);for(var t=this._deframeMessages(e.data),i=0;i<t.length;i+=1)this._handleMessage(t[i])},S.prototype._deframeMessages=function(e){var t=new Uint8Array(e),i=[];if(this.receiveBuffer){var s=new Uint8Array(this.receiveBuffer.length+t.length);s.set(this.receiveBuffer),s.set(t,this.receiveBuffer.length),t=s,delete this.receiveBuffer}try{for(var r=0;r<t.length;){var n=u(t,r),a=n[0];if(r=n[1],null===a)break;i.push(a)}r<t.length&&(this.receiveBuffer=t.subarray(r))}catch(e){var c="undefined"==e.hasOwnProperty("stack")?e.stack.toString():"No Error Stack Available";return void this._disconnected(o.INTERNAL_ERROR.code,l(o.INTERNAL_ERROR,[e.message,c]))}return i},S.prototype._handleMessage=function(e){this._trace("Client._handleMessage",e);try{switch(e.type){case 2:if(this._connectTimeout.cancel(),this._reconnectTimeout&&this._reconnectTimeout.cancel(),this.connectOptions.cleanSession){for(var t in this._sentMessages){var i=this._sentMessages[t];s.removeItem("Sent:"+this._localKey+i.messageIdentifier)}for(var t in this._sentMessages={},this._receivedMessages){var r=this._receivedMessages[t];s.removeItem("Received:"+this._localKey+r.messageIdentifier)}this._receivedMessages={}}if(0!==e.returnCode){this._disconnected(o.CONNACK_RETURNCODE.code,l(o.CONNACK_RETURNCODE,[e.returnCode,a[e.returnCode]]));break}this.connected=!0,this.connectOptions.uris&&(this.hostIndex=this.connectOptions.uris.length);var n=[];for(var c in this._sentMessages)this._sentMessages.hasOwnProperty(c)&&n.push(this._sentMessages[c]);if(this._buffered_msg_queue.length>0)for(var h=null;h=this._buffered_msg_queue.pop();)n.push(h),this.onMessageDelivered&&(this._notify_msg_sent[h]=this.onMessageDelivered(h.payloadMessage));n=n.sort(function(e,t){return e.sequence-t.sequence});for(var u=0,p=n.length;u<p;u++)if(3==(i=n[u]).type&&i.pubRecReceived){var g=new d(6,{messageIdentifier:i.messageIdentifier});this._schedule_message(g)}else this._schedule_message(i);this.connectOptions.onSuccess&&this.connectOptions.onSuccess({invocationContext:this.connectOptions.invocationContext});var m=!1;this._reconnecting&&(m=!0,this._reconnectInterval=1,this._reconnecting=!1),this._connected(m,this._wsuri),this._process_queue();break;case 3:this._receivePublish(e);break;case 4:(i=this._sentMessages[e.messageIdentifier])&&(delete this._sentMessages[e.messageIdentifier],s.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(i.payloadMessage));break;case 5:(i=this._sentMessages[e.messageIdentifier])&&(i.pubRecReceived=!0,g=new d(6,{messageIdentifier:e.messageIdentifier}),this.store("Sent:",i),this._schedule_message(g));break;case 6:r=this._receivedMessages[e.messageIdentifier],s.removeItem("Received:"+this._localKey+e.messageIdentifier),r&&(this._receiveMessage(r),delete this._receivedMessages[e.messageIdentifier]);var f=new d(7,{messageIdentifier:e.messageIdentifier});this._schedule_message(f);break;case 7:i=this._sentMessages[e.messageIdentifier],delete this._sentMessages[e.messageIdentifier],s.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(i.payloadMessage);break;case 9:(i=this._sentMessages[e.messageIdentifier])&&(i.timeOut&&i.timeOut.cancel(),128===e.returnCode[0]?i.onFailure&&i.onFailure(e.returnCode):i.onSuccess&&i.onSuccess(e.returnCode),delete this._sentMessages[e.messageIdentifier]);break;case 11:(i=this._sentMessages[e.messageIdentifier])&&(i.timeOut&&i.timeOut.cancel(),i.callback&&i.callback(),delete this._sentMessages[e.messageIdentifier]);break;case 13:this.sendPinger.reset();break;default:this._disconnected(o.INVALID_MQTT_MESSAGE_TYPE.code,l(o.INVALID_MQTT_MESSAGE_TYPE,[e.type]))}}catch(e){var y="undefined"==e.hasOwnProperty("stack")?e.stack.toString():"No Error Stack Available";return void this._disconnected(o.INTERNAL_ERROR.code,l(o.INTERNAL_ERROR,[e.message,y]))}},S.prototype._on_socket_error=function(e){this._reconnecting||this._disconnected(o.SOCKET_ERROR.code,l(o.SOCKET_ERROR,[e.data]))},S.prototype._on_socket_close=function(){this._reconnecting||this._disconnected(o.SOCKET_CLOSE.code,l(o.SOCKET_CLOSE))},S.prototype._socket_send=function(e){if(1==e.type){var t=this._traceMask(e,"password");this._trace("Client._socket_send",t)}else this._trace("Client._socket_send",e);this.socket.send(e.encode()),this.sendPinger.reset()},S.prototype._receivePublish=function(e){switch(e.payloadMessage.qos){case"undefined":case 0:this._receiveMessage(e);break;case 1:var t=new d(4,{messageIdentifier:e.messageIdentifier});this._schedule_message(t),this._receiveMessage(e);break;case 2:this._receivedMessages[e.messageIdentifier]=e,this.store("Received:",e);var i=new d(5,{messageIdentifier:e.messageIdentifier});this._schedule_message(i);break;default:throw Error("Invaild qos="+e.payloadMessage.qos)}},S.prototype._receiveMessage=function(e){this.onMessageArrived&&this.onMessageArrived(e.payloadMessage)},S.prototype._connected=function(e,t){this.onConnected&&this.onConnected(e,t)},S.prototype._reconnect=function(){this._trace("Client._reconnect"),this.connected||(this._reconnecting=!0,this.sendPinger.cancel(),this.receivePinger.cancel(),this._reconnectInterval<128&&(this._reconnectInterval=2*this._reconnectInterval),this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri))},S.prototype._disconnected=function(e,t){if(this._trace("Client._disconnected",e,t),void 0!==e&&this._reconnecting)this._reconnectTimeout=new b(this,this._reconnectInterval,this._reconnect);else if(this.sendPinger.cancel(),this.receivePinger.cancel(),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._msg_queue=[],this._buffered_msg_queue=[],this._notify_msg_sent={},this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,1===this.socket.readyState&&this.socket.close(),delete this.socket),this.connectOptions.uris&&this.hostIndex<this.connectOptions.uris.length-1)this.hostIndex++,this._doConnect(this.connectOptions.uris[this.hostIndex]);else if(void 0===e&&(e=o.OK.code,t=l(o.OK)),this.connected){if(this.connected=!1,this.onConnectionLost&&this.onConnectionLost({errorCode:e,errorMessage:t,reconnect:this.connectOptions.reconnect,uri:this._wsuri}),e!==o.OK.code&&this.connectOptions.reconnect)return this._reconnectInterval=1,void this._reconnect()}else 4===this.connectOptions.mqttVersion&&!1===this.connectOptions.mqttVersionExplicit?(this._trace("Failed to connect V4, dropping back to V3"),this.connectOptions.mqttVersion=3,this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri)):this.connectOptions.onFailure&&this.connectOptions.onFailure({invocationContext:this.connectOptions.invocationContext,errorCode:e,errorMessage:t})},S.prototype._trace=function(){if(this.traceFunction){var e=Array.prototype.slice.call(arguments);for(var t in e)void 0!==e[t]&&e.splice(t,1,JSON.stringify(e[t]));var i=e.join("");this.traceFunction({severity:"Debug",message:i})}if(null!==this._traceBuffer){t=0;for(var s=arguments.length;t<s;t++)this._traceBuffer.length==this._MAX_TRACE_ENTRIES&&this._traceBuffer.shift(),0===t||void 0===arguments[t]?this._traceBuffer.push(arguments[t]):this._traceBuffer.push("  "+JSON.stringify(arguments[t]))}},S.prototype._traceMask=function(e,t){var i={};for(var s in e)e.hasOwnProperty(s)&&(i[s]=s==t?"******":e[s]);return i};var w=function(e){var t,i;if(!("string"==typeof e||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)))throw l(o.INVALID_ARGUMENT,[e,"newPayload"]);t=e;var s=0,r=!1,n=!1;Object.defineProperties(this,{payloadString:{enumerable:!0,get:function(){return"string"==typeof t?t:v(t,0,t.length)}},payloadBytes:{enumerable:!0,get:function(){if("string"==typeof t){var e=new ArrayBuffer(f(t)),i=new Uint8Array(e);return y(t,i,0),i}return t}},destinationName:{enumerable:!0,get:function(){return i},set:function(e){if("string"!=typeof e)throw new Error(l(o.INVALID_ARGUMENT,[e,"newDestinationName"]));i=e}},qos:{enumerable:!0,get:function(){return s},set:function(e){if(0!==e&&1!==e&&2!==e)throw new Error("Invalid argument:"+e);s=e}},retained:{enumerable:!0,get:function(){return r},set:function(e){if("boolean"!=typeof e)throw new Error(l(o.INVALID_ARGUMENT,[e,"newRetained"]));r=e}},topic:{enumerable:!0,get:function(){return i},set:function(e){i=e}},duplicate:{enumerable:!0,get:function(){return n},set:function(e){n=e}}})};return{Client:function(e,t,i,s){var n;if("string"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"host"]));if(2==arguments.length){s=t;var a=(n=e).match(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/);if(!a)throw new Error(l(o.INVALID_ARGUMENT,[e,"host"]));e=a[4]||a[2],t=parseInt(a[7]),i=a[8]}else{if(3==arguments.length&&(s=i,i="/mqtt"),"number"!=typeof t||t<0)throw new Error(l(o.INVALID_TYPE,[typeof t,"port"]));if("string"!=typeof i)throw new Error(l(o.INVALID_TYPE,[typeof i,"path"]));var c=-1!==e.indexOf(":")&&"["!==e.slice(0,1)&&"]"!==e.slice(-1);n="ws://"+(c?"["+e+"]":e)+":"+t+i}for(var h=0,d=0;d<s.length;d++){var u=s.charCodeAt(d);55296<=u&&u<=56319&&d++,h++}if("string"!=typeof s||h>65535)throw new Error(l(o.INVALID_ARGUMENT,[s,"clientId"]));var p=new S(n,e,t,i,s);Object.defineProperties(this,{host:{get:function(){return e},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},port:{get:function(){return t},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},path:{get:function(){return i},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},uri:{get:function(){return n},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},clientId:{get:function(){return p.clientId},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},onConnected:{get:function(){return p.onConnected},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onConnected"]));p.onConnected=e}},disconnectedPublishing:{get:function(){return p.disconnectedPublishing},set:function(e){p.disconnectedPublishing=e}},disconnectedBufferSize:{get:function(){return p.disconnectedBufferSize},set:function(e){p.disconnectedBufferSize=e}},onConnectionLost:{get:function(){return p.onConnectionLost},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onConnectionLost"]));p.onConnectionLost=e}},onMessageDelivered:{get:function(){return p.onMessageDelivered},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onMessageDelivered"]));p.onMessageDelivered=e}},onMessageArrived:{get:function(){return p.onMessageArrived},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onMessageArrived"]));p.onMessageArrived=e}},trace:{get:function(){return p.traceFunction},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onTrace"]));p.traceFunction=e}}}),this.connect=function(e){if(r(e=e||{},{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"}),void 0===e.keepAliveInterval&&(e.keepAliveInterval=60),e.mqttVersion>4||e.mqttVersion<3)throw new Error(l(o.INVALID_ARGUMENT,[e.mqttVersion,"connectOptions.mqttVersion"]));if(void 0===e.mqttVersion?(e.mqttVersionExplicit=!1,e.mqttVersion=4):e.mqttVersionExplicit=!0,void 0!==e.password&&void 0===e.userName)throw new Error(l(o.INVALID_ARGUMENT,[e.password,"connectOptions.password"]));if(e.willMessage){if(!(e.willMessage instanceof w))throw new Error(l(o.INVALID_TYPE,[e.willMessage,"connectOptions.willMessage"]));if(e.willMessage.stringPayload=null,void 0===e.willMessage.destinationName)throw new Error(l(o.INVALID_TYPE,[typeof e.willMessage.destinationName,"connectOptions.willMessage.destinationName"]))}if(void 0===e.cleanSession&&(e.cleanSession=!0),e.hosts){if(!(e.hosts instanceof Array))throw new Error(l(o.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));if(e.hosts.length<1)throw new Error(l(o.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));for(var t=!1,s=0;s<e.hosts.length;s++){if("string"!=typeof e.hosts[s])throw new Error(l(o.INVALID_TYPE,[typeof e.hosts[s],"connectOptions.hosts["+s+"]"]));if(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/.test(e.hosts[s])){if(0===s)t=!0;else if(!t)throw new Error(l(o.INVALID_ARGUMENT,[e.hosts[s],"connectOptions.hosts["+s+"]"]))}else if(t)throw new Error(l(o.INVALID_ARGUMENT,[e.hosts[s],"connectOptions.hosts["+s+"]"]))}if(t)e.uris=e.hosts;else{if(!e.ports)throw new Error(l(o.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(!(e.ports instanceof Array))throw new Error(l(o.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(e.hosts.length!==e.ports.length)throw new Error(l(o.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));for(e.uris=[],s=0;s<e.hosts.length;s++){if("number"!=typeof e.ports[s]||e.ports[s]<0)throw new Error(l(o.INVALID_TYPE,[typeof e.ports[s],"connectOptions.ports["+s+"]"]));var a=e.hosts[s],c=e.ports[s],h=-1!==a.indexOf(":");n="ws://"+(h?"["+a+"]":a)+":"+c+i,e.uris.push(n)}}}p.connect(e)},this.subscribe=function(e,t){if("string"!=typeof e)throw new Error("Invalid argument:"+e);if(r(t=t||{},{qos:"number",invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("subscribeOptions.timeout specified with no onFailure callback.");if(void 0!==t.qos&&0!==t.qos&&1!==t.qos&&2!==t.qos)throw new Error(l(o.INVALID_ARGUMENT,[t.qos,"subscribeOptions.qos"]));p.subscribe(e,t)},this.unsubscribe=function(e,t){if("string"!=typeof e)throw new Error("Invalid argument:"+e);if(r(t=t||{},{invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("unsubscribeOptions.timeout specified with no onFailure callback.");p.unsubscribe(e,t)},this.send=function(e,t,i,s){var r;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof w)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(r=e).destinationName)throw new Error(l(o.INVALID_ARGUMENT,[r.destinationName,"Message.destinationName"]));p.send(r)}else(r=new w(t)).destinationName=e,arguments.length>=3&&(r.qos=i),arguments.length>=4&&(r.retained=s),p.send(r)},this.publish=function(e,t,i,s){var r;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof w)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(r=e).destinationName)throw new Error(l(o.INVALID_ARGUMENT,[r.destinationName,"Message.destinationName"]));p.send(r)}else(r=new w(t)).destinationName=e,arguments.length>=3&&(r.qos=i),arguments.length>=4&&(r.retained=s),p.send(r)},this.disconnect=function(){p.disconnect()},this.getTraceLog=function(){return p.getTraceLog()},this.startTrace=function(){p.startTrace()},this.stopTrace=function(){p.stopTrace()},this.isConnected=function(){return p.connected}},Message:w}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});return e},e.exports=t()},5611(e,t,i){e.exports={default:i(85877),__esModule:!0}},80238(e,t,i){e.exports={default:i(13112),__esModule:!0}},65191(e,t,i){e.exports={default:i(30481),__esModule:!0}},38841(e,t,i){e.exports={default:i(18307),__esModule:!0}},12581(e,t,i){e.exports={default:i(55111),__esModule:!0}},20144(e,t,i){e.exports={default:i(27773),__esModule:!0}},75697(e,t,i){e.exports={default:i(63315),__esModule:!0}},17380(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},31354(e,t,i){"use strict";t.__esModule=!0;var s,r=(s=i(65191))&&s.__esModule?s:{default:s};t.default=function(){function e(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),(0,r.default)(e,s.key,s)}}return function(t,i,s){return i&&e(t.prototype,i),s&&e(t,s),t}}()},84011(e,t,i){"use strict";t.__esModule=!0;var s,r=(s=i(5611))&&s.__esModule?s:{default:s};t.default=r.default||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}},87724(e,t,i){"use strict";t.__esModule=!0;var s=o(i(12581)),r=o(i(80238)),n=o(i(38829));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,n.default)(t)));e.prototype=(0,r.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.default?(0,s.default)(e,t):e.__proto__=t)}},77857(e,t,i){"use strict";t.__esModule=!0;var s,r=(s=i(38829))&&s.__esModule?s:{default:s};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,r.default)(t))&&"function"!=typeof t?e:t}},38829(e,t,i){"use strict";t.__esModule=!0;var s=o(i(75697)),r=o(i(20144)),n="function"==typeof r.default&&"symbol"==typeof s.default?function(e){return typeof e}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":typeof e};function o(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof r.default&&"symbol"===n(s.default)?function(e){return void 0===e?"undefined":n(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":n(e)}},92178(e){"use strict";e.exports=function(e){if(e)throw e}},84933(e,t){"use strict";t.byteLength=function(e){var t=a(e),i=t[0],s=t[1];return 3*(i+s)/4-s},t.toByteArray=function(e){var t,i,n=a(e),o=n[0],l=n[1],c=new r(function(e,t,i){return 3*(t+i)/4-i}(0,o,l)),h=0,d=l>0?o-4:o;for(i=0;i<d;i+=4)t=s[e.charCodeAt(i)]<<18|s[e.charCodeAt(i+1)]<<12|s[e.charCodeAt(i+2)]<<6|s[e.charCodeAt(i+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===l&&(t=s[e.charCodeAt(i)]<<2|s[e.charCodeAt(i+1)]>>4,c[h++]=255&t),1===l&&(t=s[e.charCodeAt(i)]<<10|s[e.charCodeAt(i+1)]<<4|s[e.charCodeAt(i+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,s=e.length,r=s%3,n=[],o=16383,a=0,l=s-r;a<l;a+=o)n.push(c(e,a,a+o>l?l:a+o));return 1===r?(t=e[s-1],n.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[s-2]<<8)+e[s-1],n.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),n.join("")};for(var i=[],s=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)i[o]=n[o],s[n.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function l(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}function c(e,t,i){for(var s,r=[],n=t;n<i;n+=3)s=(e[n]<<16&16711680)+(e[n+1]<<8&65280)+(255&e[n+2]),r.push(l(s));return r.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},5630(e,t,i){!function(e,t){"use strict";function s(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function n(e,t,i){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(46216).Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function l(e,t,i){var s=a(e,i);return i-1>=t&&(s|=a(e,i-1)<<4),s}function c(e,t,i,s){for(var r=0,n=Math.min(e.length,i),o=t;o<n;o++){var a=e.charCodeAt(o)-48;r*=s,r+=a>=49?a-49+10:a>=17?a-17+10:a}return r}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),s(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r<e.length&&(16===t?this._parseHex(e,r,i):(this._parseBase(e,t,r),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(s(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(s("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=e.length-1,n=0;r>=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<e.length;r+=3)o=e[r]|e[r+1]<<8|e[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},n.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var s=0;s<this.length;s++)this.words[s]=0;var r,n=0,o=0;if("be"===i)for(s=e.length-1;s>=t;s-=2)r=l(e,t,s)<<n,this.words[o]|=67108863&r,n>=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;else for(s=(e.length-t)%2==0?t+1:t;s<e.length;s+=2)r=l(e,t,s)<<n,this.words[o]|=67108863&r,n>=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;this.strip()},n.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=t)s++;s--,r=r/t|0;for(var n=e.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,h=i;h<a;h+=s)l=c(e,h,h+s,t),this.imuln(r),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var d=1;for(l=c(e,h,e.length,t),h=0;h<o;h++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,i){i.negative=t.negative^e.negative;var s=e.length+t.length|0;i.length=s,s=s-1|0;var r=0|e.words[0],n=0|t.words[0],o=r*n,a=67108863&o,l=o/67108864|0;i.words[0]=a;for(var c=1;c<s;c++){for(var h=l>>>26,d=67108863&l,u=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=u;p++){var g=c-p|0;h+=(o=(r=0|e.words[g])*(n=0|t.words[p])+d)/67108864|0,d=67108863&o}i.words[c]=0|d,l=0|h}return 0!==l?i.words[c]=0|l:i.length--,i.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],l=(16777215&(a<<r|n)).toString(16);n=a>>>24-r&16777215,(r+=2)>=26&&(r-=26,o--),i=0!==n||o!==this.length-1?h[6-l.length]+l+i:l+i}for(0!==n&&(i=n.toString(16)+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],p=u[e];i="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modn(p).toString(e);i=(g=g.idivn(p)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return s(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var r=this.byteLength(),n=i||Math.max(1,r);s(r<=n,"byte array longer than desired length"),s(n>0,"Requested array length <= 0"),this.strip();var o,a,l="le"===t,c=new e(n),h=this.clone();if(l){for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),c[a]=o;for(;a<n;a++)c[a]=0}else{for(a=0;a<n-r;a++)c[a]=0;for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),c[n-a-1]=o}return c},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 8191&t||(i+=13,t>>>=13),127&t||(i+=7,t>>>=7),15&t||(i+=4,t>>>=4),3&t||(i+=2,t>>>=2),1&t||i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return s(0===(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return s(0===(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var s=0;s<i.length;s++)this.words[s]=t.words[s]^i.words[s];if(this!==t)for(;s<t.length;s++)this.words[s]=t.words[s];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return s(0===(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){s("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){s("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},n.prototype.iadd=function(e){var t,i,s;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,s=e):(i=e,s=this);for(var r=0,n=0;n<s.length;n++)t=(0|i.words[n])+(0|s.words[n])+r,this.words[n]=67108863&t,r=t>>>26;for(;0!==r&&n<i.length;n++)t=(0|i.words[n])+r,this.words[n]=67108863&t,r=t>>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;n<i.length;n++)this.words[n]=i.words[n];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,s,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=e):(i=e,s=this);for(var n=0,o=0;o<s.length;o++)n=(t=(0|i.words[o])-(0|s.words[o])+n)>>26,this.words[o]=67108863&t;for(;0!==n&&o<i.length;o++)n=(t=(0|i.words[o])+n)>>26,this.words[o]=67108863&t;if(0===n&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,i){var s,r,n,o=e.words,a=t.words,l=i.words,c=0,h=0|o[0],d=8191&h,u=h>>>13,p=0|o[1],g=8191&p,m=p>>>13,f=0|o[2],y=8191&f,v=f>>>13,C=0|o[3],b=8191&C,S=C>>>13,w=0|o[4],x=8191&w,E=w>>>13,M=0|o[5],A=8191&M,T=M>>>13,D=0|o[6],I=8191&D,R=D>>>13,P=0|o[7],k=8191&P,L=P>>>13,N=0|o[8],_=8191&N,O=N>>>13,F=0|o[9],G=8191&F,B=F>>>13,V=0|a[0],H=8191&V,U=V>>>13,z=0|a[1],W=8191&z,j=z>>>13,K=0|a[2],$=8191&K,Y=K>>>13,q=0|a[3],X=8191&q,Z=q>>>13,Q=0|a[4],J=8191&Q,ee=Q>>>13,te=0|a[5],ie=8191&te,se=te>>>13,re=0|a[6],ne=8191&re,oe=re>>>13,ae=0|a[7],le=8191&ae,ce=ae>>>13,he=0|a[8],de=8191&he,ue=he>>>13,pe=0|a[9],ge=8191&pe,me=pe>>>13;i.negative=e.negative^t.negative,i.length=19;var fe=(c+(s=Math.imul(d,H))|0)+((8191&(r=(r=Math.imul(d,U))+Math.imul(u,H)|0))<<13)|0;c=((n=Math.imul(u,U))+(r>>>13)|0)+(fe>>>26)|0,fe&=67108863,s=Math.imul(g,H),r=(r=Math.imul(g,U))+Math.imul(m,H)|0,n=Math.imul(m,U);var ye=(c+(s=s+Math.imul(d,W)|0)|0)+((8191&(r=(r=r+Math.imul(d,j)|0)+Math.imul(u,W)|0))<<13)|0;c=((n=n+Math.imul(u,j)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,s=Math.imul(y,H),r=(r=Math.imul(y,U))+Math.imul(v,H)|0,n=Math.imul(v,U),s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,j)|0)+Math.imul(m,W)|0,n=n+Math.imul(m,j)|0;var ve=(c+(s=s+Math.imul(d,$)|0)|0)+((8191&(r=(r=r+Math.imul(d,Y)|0)+Math.imul(u,$)|0))<<13)|0;c=((n=n+Math.imul(u,Y)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,s=Math.imul(b,H),r=(r=Math.imul(b,U))+Math.imul(S,H)|0,n=Math.imul(S,U),s=s+Math.imul(y,W)|0,r=(r=r+Math.imul(y,j)|0)+Math.imul(v,W)|0,n=n+Math.imul(v,j)|0,s=s+Math.imul(g,$)|0,r=(r=r+Math.imul(g,Y)|0)+Math.imul(m,$)|0,n=n+Math.imul(m,Y)|0;var Ce=(c+(s=s+Math.imul(d,X)|0)|0)+((8191&(r=(r=r+Math.imul(d,Z)|0)+Math.imul(u,X)|0))<<13)|0;c=((n=n+Math.imul(u,Z)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,s=Math.imul(x,H),r=(r=Math.imul(x,U))+Math.imul(E,H)|0,n=Math.imul(E,U),s=s+Math.imul(b,W)|0,r=(r=r+Math.imul(b,j)|0)+Math.imul(S,W)|0,n=n+Math.imul(S,j)|0,s=s+Math.imul(y,$)|0,r=(r=r+Math.imul(y,Y)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,Y)|0,s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(m,X)|0,n=n+Math.imul(m,Z)|0;var be=(c+(s=s+Math.imul(d,J)|0)|0)+((8191&(r=(r=r+Math.imul(d,ee)|0)+Math.imul(u,J)|0))<<13)|0;c=((n=n+Math.imul(u,ee)|0)+(r>>>13)|0)+(be>>>26)|0,be&=67108863,s=Math.imul(A,H),r=(r=Math.imul(A,U))+Math.imul(T,H)|0,n=Math.imul(T,U),s=s+Math.imul(x,W)|0,r=(r=r+Math.imul(x,j)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,j)|0,s=s+Math.imul(b,$)|0,r=(r=r+Math.imul(b,Y)|0)+Math.imul(S,$)|0,n=n+Math.imul(S,Y)|0,s=s+Math.imul(y,X)|0,r=(r=r+Math.imul(y,Z)|0)+Math.imul(v,X)|0,n=n+Math.imul(v,Z)|0,s=s+Math.imul(g,J)|0,r=(r=r+Math.imul(g,ee)|0)+Math.imul(m,J)|0,n=n+Math.imul(m,ee)|0;var Se=(c+(s=s+Math.imul(d,ie)|0)|0)+((8191&(r=(r=r+Math.imul(d,se)|0)+Math.imul(u,ie)|0))<<13)|0;c=((n=n+Math.imul(u,se)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,s=Math.imul(I,H),r=(r=Math.imul(I,U))+Math.imul(R,H)|0,n=Math.imul(R,U),s=s+Math.imul(A,W)|0,r=(r=r+Math.imul(A,j)|0)+Math.imul(T,W)|0,n=n+Math.imul(T,j)|0,s=s+Math.imul(x,$)|0,r=(r=r+Math.imul(x,Y)|0)+Math.imul(E,$)|0,n=n+Math.imul(E,Y)|0,s=s+Math.imul(b,X)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(S,X)|0,n=n+Math.imul(S,Z)|0,s=s+Math.imul(y,J)|0,r=(r=r+Math.imul(y,ee)|0)+Math.imul(v,J)|0,n=n+Math.imul(v,ee)|0,s=s+Math.imul(g,ie)|0,r=(r=r+Math.imul(g,se)|0)+Math.imul(m,ie)|0,n=n+Math.imul(m,se)|0;var we=(c+(s=s+Math.imul(d,ne)|0)|0)+((8191&(r=(r=r+Math.imul(d,oe)|0)+Math.imul(u,ne)|0))<<13)|0;c=((n=n+Math.imul(u,oe)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,s=Math.imul(k,H),r=(r=Math.imul(k,U))+Math.imul(L,H)|0,n=Math.imul(L,U),s=s+Math.imul(I,W)|0,r=(r=r+Math.imul(I,j)|0)+Math.imul(R,W)|0,n=n+Math.imul(R,j)|0,s=s+Math.imul(A,$)|0,r=(r=r+Math.imul(A,Y)|0)+Math.imul(T,$)|0,n=n+Math.imul(T,Y)|0,s=s+Math.imul(x,X)|0,r=(r=r+Math.imul(x,Z)|0)+Math.imul(E,X)|0,n=n+Math.imul(E,Z)|0,s=s+Math.imul(b,J)|0,r=(r=r+Math.imul(b,ee)|0)+Math.imul(S,J)|0,n=n+Math.imul(S,ee)|0,s=s+Math.imul(y,ie)|0,r=(r=r+Math.imul(y,se)|0)+Math.imul(v,ie)|0,n=n+Math.imul(v,se)|0,s=s+Math.imul(g,ne)|0,r=(r=r+Math.imul(g,oe)|0)+Math.imul(m,ne)|0,n=n+Math.imul(m,oe)|0;var xe=(c+(s=s+Math.imul(d,le)|0)|0)+((8191&(r=(r=r+Math.imul(d,ce)|0)+Math.imul(u,le)|0))<<13)|0;c=((n=n+Math.imul(u,ce)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,s=Math.imul(_,H),r=(r=Math.imul(_,U))+Math.imul(O,H)|0,n=Math.imul(O,U),s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,j)|0)+Math.imul(L,W)|0,n=n+Math.imul(L,j)|0,s=s+Math.imul(I,$)|0,r=(r=r+Math.imul(I,Y)|0)+Math.imul(R,$)|0,n=n+Math.imul(R,Y)|0,s=s+Math.imul(A,X)|0,r=(r=r+Math.imul(A,Z)|0)+Math.imul(T,X)|0,n=n+Math.imul(T,Z)|0,s=s+Math.imul(x,J)|0,r=(r=r+Math.imul(x,ee)|0)+Math.imul(E,J)|0,n=n+Math.imul(E,ee)|0,s=s+Math.imul(b,ie)|0,r=(r=r+Math.imul(b,se)|0)+Math.imul(S,ie)|0,n=n+Math.imul(S,se)|0,s=s+Math.imul(y,ne)|0,r=(r=r+Math.imul(y,oe)|0)+Math.imul(v,ne)|0,n=n+Math.imul(v,oe)|0,s=s+Math.imul(g,le)|0,r=(r=r+Math.imul(g,ce)|0)+Math.imul(m,le)|0,n=n+Math.imul(m,ce)|0;var Ee=(c+(s=s+Math.imul(d,de)|0)|0)+((8191&(r=(r=r+Math.imul(d,ue)|0)+Math.imul(u,de)|0))<<13)|0;c=((n=n+Math.imul(u,ue)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,s=Math.imul(G,H),r=(r=Math.imul(G,U))+Math.imul(B,H)|0,n=Math.imul(B,U),s=s+Math.imul(_,W)|0,r=(r=r+Math.imul(_,j)|0)+Math.imul(O,W)|0,n=n+Math.imul(O,j)|0,s=s+Math.imul(k,$)|0,r=(r=r+Math.imul(k,Y)|0)+Math.imul(L,$)|0,n=n+Math.imul(L,Y)|0,s=s+Math.imul(I,X)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Z)|0,s=s+Math.imul(A,J)|0,r=(r=r+Math.imul(A,ee)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,ee)|0,s=s+Math.imul(x,ie)|0,r=(r=r+Math.imul(x,se)|0)+Math.imul(E,ie)|0,n=n+Math.imul(E,se)|0,s=s+Math.imul(b,ne)|0,r=(r=r+Math.imul(b,oe)|0)+Math.imul(S,ne)|0,n=n+Math.imul(S,oe)|0,s=s+Math.imul(y,le)|0,r=(r=r+Math.imul(y,ce)|0)+Math.imul(v,le)|0,n=n+Math.imul(v,ce)|0,s=s+Math.imul(g,de)|0,r=(r=r+Math.imul(g,ue)|0)+Math.imul(m,de)|0,n=n+Math.imul(m,ue)|0;var Me=(c+(s=s+Math.imul(d,ge)|0)|0)+((8191&(r=(r=r+Math.imul(d,me)|0)+Math.imul(u,ge)|0))<<13)|0;c=((n=n+Math.imul(u,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,s=Math.imul(G,W),r=(r=Math.imul(G,j))+Math.imul(B,W)|0,n=Math.imul(B,j),s=s+Math.imul(_,$)|0,r=(r=r+Math.imul(_,Y)|0)+Math.imul(O,$)|0,n=n+Math.imul(O,Y)|0,s=s+Math.imul(k,X)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,Z)|0,s=s+Math.imul(I,J)|0,r=(r=r+Math.imul(I,ee)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,ee)|0,s=s+Math.imul(A,ie)|0,r=(r=r+Math.imul(A,se)|0)+Math.imul(T,ie)|0,n=n+Math.imul(T,se)|0,s=s+Math.imul(x,ne)|0,r=(r=r+Math.imul(x,oe)|0)+Math.imul(E,ne)|0,n=n+Math.imul(E,oe)|0,s=s+Math.imul(b,le)|0,r=(r=r+Math.imul(b,ce)|0)+Math.imul(S,le)|0,n=n+Math.imul(S,ce)|0,s=s+Math.imul(y,de)|0,r=(r=r+Math.imul(y,ue)|0)+Math.imul(v,de)|0,n=n+Math.imul(v,ue)|0;var Ae=(c+(s=s+Math.imul(g,ge)|0)|0)+((8191&(r=(r=r+Math.imul(g,me)|0)+Math.imul(m,ge)|0))<<13)|0;c=((n=n+Math.imul(m,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,s=Math.imul(G,$),r=(r=Math.imul(G,Y))+Math.imul(B,$)|0,n=Math.imul(B,Y),s=s+Math.imul(_,X)|0,r=(r=r+Math.imul(_,Z)|0)+Math.imul(O,X)|0,n=n+Math.imul(O,Z)|0,s=s+Math.imul(k,J)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(L,J)|0,n=n+Math.imul(L,ee)|0,s=s+Math.imul(I,ie)|0,r=(r=r+Math.imul(I,se)|0)+Math.imul(R,ie)|0,n=n+Math.imul(R,se)|0,s=s+Math.imul(A,ne)|0,r=(r=r+Math.imul(A,oe)|0)+Math.imul(T,ne)|0,n=n+Math.imul(T,oe)|0,s=s+Math.imul(x,le)|0,r=(r=r+Math.imul(x,ce)|0)+Math.imul(E,le)|0,n=n+Math.imul(E,ce)|0,s=s+Math.imul(b,de)|0,r=(r=r+Math.imul(b,ue)|0)+Math.imul(S,de)|0,n=n+Math.imul(S,ue)|0;var Te=(c+(s=s+Math.imul(y,ge)|0)|0)+((8191&(r=(r=r+Math.imul(y,me)|0)+Math.imul(v,ge)|0))<<13)|0;c=((n=n+Math.imul(v,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,s=Math.imul(G,X),r=(r=Math.imul(G,Z))+Math.imul(B,X)|0,n=Math.imul(B,Z),s=s+Math.imul(_,J)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(O,J)|0,n=n+Math.imul(O,ee)|0,s=s+Math.imul(k,ie)|0,r=(r=r+Math.imul(k,se)|0)+Math.imul(L,ie)|0,n=n+Math.imul(L,se)|0,s=s+Math.imul(I,ne)|0,r=(r=r+Math.imul(I,oe)|0)+Math.imul(R,ne)|0,n=n+Math.imul(R,oe)|0,s=s+Math.imul(A,le)|0,r=(r=r+Math.imul(A,ce)|0)+Math.imul(T,le)|0,n=n+Math.imul(T,ce)|0,s=s+Math.imul(x,de)|0,r=(r=r+Math.imul(x,ue)|0)+Math.imul(E,de)|0,n=n+Math.imul(E,ue)|0;var De=(c+(s=s+Math.imul(b,ge)|0)|0)+((8191&(r=(r=r+Math.imul(b,me)|0)+Math.imul(S,ge)|0))<<13)|0;c=((n=n+Math.imul(S,me)|0)+(r>>>13)|0)+(De>>>26)|0,De&=67108863,s=Math.imul(G,J),r=(r=Math.imul(G,ee))+Math.imul(B,J)|0,n=Math.imul(B,ee),s=s+Math.imul(_,ie)|0,r=(r=r+Math.imul(_,se)|0)+Math.imul(O,ie)|0,n=n+Math.imul(O,se)|0,s=s+Math.imul(k,ne)|0,r=(r=r+Math.imul(k,oe)|0)+Math.imul(L,ne)|0,n=n+Math.imul(L,oe)|0,s=s+Math.imul(I,le)|0,r=(r=r+Math.imul(I,ce)|0)+Math.imul(R,le)|0,n=n+Math.imul(R,ce)|0,s=s+Math.imul(A,de)|0,r=(r=r+Math.imul(A,ue)|0)+Math.imul(T,de)|0,n=n+Math.imul(T,ue)|0;var Ie=(c+(s=s+Math.imul(x,ge)|0)|0)+((8191&(r=(r=r+Math.imul(x,me)|0)+Math.imul(E,ge)|0))<<13)|0;c=((n=n+Math.imul(E,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,s=Math.imul(G,ie),r=(r=Math.imul(G,se))+Math.imul(B,ie)|0,n=Math.imul(B,se),s=s+Math.imul(_,ne)|0,r=(r=r+Math.imul(_,oe)|0)+Math.imul(O,ne)|0,n=n+Math.imul(O,oe)|0,s=s+Math.imul(k,le)|0,r=(r=r+Math.imul(k,ce)|0)+Math.imul(L,le)|0,n=n+Math.imul(L,ce)|0,s=s+Math.imul(I,de)|0,r=(r=r+Math.imul(I,ue)|0)+Math.imul(R,de)|0,n=n+Math.imul(R,ue)|0;var Re=(c+(s=s+Math.imul(A,ge)|0)|0)+((8191&(r=(r=r+Math.imul(A,me)|0)+Math.imul(T,ge)|0))<<13)|0;c=((n=n+Math.imul(T,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863,s=Math.imul(G,ne),r=(r=Math.imul(G,oe))+Math.imul(B,ne)|0,n=Math.imul(B,oe),s=s+Math.imul(_,le)|0,r=(r=r+Math.imul(_,ce)|0)+Math.imul(O,le)|0,n=n+Math.imul(O,ce)|0,s=s+Math.imul(k,de)|0,r=(r=r+Math.imul(k,ue)|0)+Math.imul(L,de)|0,n=n+Math.imul(L,ue)|0;var Pe=(c+(s=s+Math.imul(I,ge)|0)|0)+((8191&(r=(r=r+Math.imul(I,me)|0)+Math.imul(R,ge)|0))<<13)|0;c=((n=n+Math.imul(R,me)|0)+(r>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,s=Math.imul(G,le),r=(r=Math.imul(G,ce))+Math.imul(B,le)|0,n=Math.imul(B,ce),s=s+Math.imul(_,de)|0,r=(r=r+Math.imul(_,ue)|0)+Math.imul(O,de)|0,n=n+Math.imul(O,ue)|0;var ke=(c+(s=s+Math.imul(k,ge)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(L,ge)|0))<<13)|0;c=((n=n+Math.imul(L,me)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,s=Math.imul(G,de),r=(r=Math.imul(G,ue))+Math.imul(B,de)|0,n=Math.imul(B,ue);var Le=(c+(s=s+Math.imul(_,ge)|0)|0)+((8191&(r=(r=r+Math.imul(_,me)|0)+Math.imul(O,ge)|0))<<13)|0;c=((n=n+Math.imul(O,me)|0)+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ne=(c+(s=Math.imul(G,ge))|0)+((8191&(r=(r=Math.imul(G,me))+Math.imul(B,ge)|0))<<13)|0;return c=((n=Math.imul(B,me))+(r>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,l[0]=fe,l[1]=ye,l[2]=ve,l[3]=Ce,l[4]=be,l[5]=Se,l[6]=we,l[7]=xe,l[8]=Ee,l[9]=Me,l[10]=Ae,l[11]=Te,l[12]=De,l[13]=Ie,l[14]=Re,l[15]=Pe,l[16]=ke,l[17]=Le,l[18]=Ne,0!==c&&(l[19]=c,i.length++),i};function m(e,t,i){return(new f).mulp(e,t,i)}function f(e,t){this.x=e,this.y=t}Math.imul||(g=p),n.prototype.mulTo=function(e,t){var i,s=this.length+e.length;return i=10===this.length&&10===e.length?g(this,e,t):s<63?p(this,e,t):s<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var s=0,r=0,n=0;n<i.length-1;n++){var o=r;r=0;for(var a=67108863&s,l=Math.min(n,t.length-1),c=Math.max(0,n-e.length+1);c<=l;c++){var h=n-c,d=(0|e.words[h])*(0|t.words[c]),u=67108863&d;a=67108863&(u=u+a|0),r+=(o=(o=o+(d/67108864|0)|0)+(u>>>26)|0)>>>26,o&=67108863}i.words[n]=a,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.strip()}(this,e,t):m(this,e,t),i},f.prototype.makeRBT=function(e){for(var t=new Array(e),i=n.prototype._countBits(e)-1,s=0;s<e;s++)t[s]=this.revBin(s,i,e);return t},f.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var s=0,r=0;r<t;r++)s|=(1&e)<<t-r-1,e>>=1;return s},f.prototype.permute=function(e,t,i,s,r,n){for(var o=0;o<n;o++)s[o]=t[e[o]],r[o]=i[e[o]]},f.prototype.transform=function(e,t,i,s,r,n){this.permute(n,e,t,i,s,r);for(var o=1;o<r;o<<=1)for(var a=o<<1,l=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<r;h+=a)for(var d=l,u=c,p=0;p<o;p++){var g=i[h+p],m=s[h+p],f=i[h+p+o],y=s[h+p+o],v=d*f-u*y;y=d*y+u*f,f=v,i[h+p]=g+f,s[h+p]=m+y,i[h+p+o]=g-f,s[h+p+o]=m-y,p!==a&&(v=l*d-c*u,u=l*u+c*d,d=v)}},f.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),s=1&i,r=0;for(i=i/2|0;i;i>>>=1)r++;return 1<<r+1+s},f.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var s=0;s<i/2;s++){var r=e[s];e[s]=e[i-s-1],e[i-s-1]=r,r=t[s],t[s]=-t[i-s-1],t[i-s-1]=-r}},f.prototype.normalize13b=function(e,t){for(var i=0,s=0;s<t/2;s++){var r=8192*Math.round(e[2*s+1]/t)+Math.round(e[2*s]/t)+i;e[s]=67108863&r,i=r<67108864?0:r/67108864|0}return e},f.prototype.convert13b=function(e,t,i,r){for(var n=0,o=0;o<t;o++)n+=0|e[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*t;o<r;++o)i[o]=0;s(0===n),s(!(-8192&n))},f.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},f.prototype.mulp=function(e,t,i){var s=2*this.guessLen13b(e.length,t.length),r=this.makeRBT(s),n=this.stub(s),o=new Array(s),a=new Array(s),l=new Array(s),c=new Array(s),h=new Array(s),d=new Array(s),u=i.words;u.length=s,this.convert13b(e.words,e.length,o,s),this.convert13b(t.words,t.length,c,s),this.transform(o,n,a,l,s,r),this.transform(c,n,h,d,s,r);for(var p=0;p<s;p++){var g=a[p]*h[p]-l[p]*d[p];l[p]=a[p]*d[p]+l[p]*h[p],a[p]=g}return this.conjugate(a,l,s),this.transform(a,l,u,n,s,r),this.conjugate(u,n,s),this.normalize13b(u,s),i.negative=e.negative^t.negative,i.length=e.length+t.length,i.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),m(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){s("number"==typeof e),s(e<67108864);for(var t=0,i=0;i<this.length;i++){var r=(0|this.words[i])*e,n=(67108863&r)+(67108863&t);t>>=26,t+=r/67108864|0,t+=n>>>26,this.words[i]=67108863&n}return 0!==t&&(this.words[i]=t,this.length++),this.length=0===e?1:this.length,this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var s=i/26|0,r=i%26;t[i]=(e.words[s]&1<<r)>>>r}return t}(e);if(0===t.length)return new n(1);for(var i=this,s=0;s<t.length&&0===t[s];s++,i=i.sqr());if(++s<t.length)for(var r=i.sqr();s<t.length;s++,r=r.sqr())0!==t[s]&&(i=i.mul(r));return i},n.prototype.iushln=function(e){s("number"==typeof e&&e>=0);var t,i=e%26,r=(e-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&n,l=(0|this.words[t])-a<<i;this.words[t]=l|o,o=a>>>26-i}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t<r;t++)this.words[t]=0;this.length+=r}return this.strip()},n.prototype.ishln=function(e){return s(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var r;s("number"==typeof e&&e>=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),a=67108863^67108863>>>n<<n,l=i;if(r-=o,r=Math.max(0,r),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=r);c--){var d=0|this.words[c];this.words[c]=h<<26-n|d>>>n,h=d&a}return l&&0!==h&&(l.words[l.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return s(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){s("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<<t;return!(this.length<=i||!(this.words[i]&r))},n.prototype.imaskn=function(e){s("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(s(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>t<<t;this.words[this.length-1]&=r}return 0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return s("number"==typeof e),s(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(s("number"==typeof e),s(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var r,n,o=e.length+i;this._expand(o);var a=0;for(r=0;r<e.length;r++){n=(0|this.words[r+i])+a;var l=(0|e.words[r])*t;a=((n-=67108863&l)>>26)-(l/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(s(-1===a),a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var i=(this.length,e.length),s=this.clone(),r=e,o=0|r.words[r.length-1];0!=(i=26-this._countBits(o))&&(r=r.ushln(i),s.iushln(i),o=0|r.words[r.length-1]);var a,l=s.length-r.length;if("mod"!==t){(a=new n(null)).length=l+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=s.clone()._ishlnsubmul(r,1,l);0===h.negative&&(s=h,a&&(a.words[l]=1));for(var d=l-1;d>=0;d--){var u=67108864*(0|s.words[r.length+d])+(0|s.words[r.length+d-1]);for(u=Math.min(u/o|0,67108863),s._ishlnsubmul(r,u,d);0!==s.negative;)u--,s.negative=0,s._ishlnsubmul(r,1,d),s.isZero()||(s.negative^=1);a&&(a.words[d]=u)}return a&&a.strip(),s.strip(),"div"!==t&&0!==i&&s.iushrn(i),{div:a||null,mod:s}},n.prototype.divmod=function(e,t,i){return s(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(r=a.div.neg()),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(e)),{div:r,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(r=a.div.neg()),{div:r,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,o,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,s=e.ushrn(1),r=e.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){s(e<=67108863);for(var t=(1<<26)%e,i=0,r=this.length-1;r>=0;r--)i=(t*i+(0|this.words[r]))%e;return i},n.prototype.idivn=function(e){s(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*t;this.words[i]=r/e|0,t=r%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){s(0===e.negative),s(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new n(1),o=new n(0),a=new n(0),l=new n(1),c=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),d=t.clone();!t.isZero();){for(var u=0,p=1;0===(t.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(h),o.isub(d)),r.iushrn(1),o.iushrn(1);for(var g=0,m=1;0===(i.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(i.iushrn(g);g-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(h),l.isub(d)),a.iushrn(1),l.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(a),o.isub(l)):(i.isub(t),a.isub(r),l.isub(o))}return{a,b:l,gcd:i.iushln(c)}},n.prototype._invmp=function(e){s(0===e.negative),s(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,o=new n(1),a=new n(0),l=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var d=0,u=1;0===(i.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(i.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a)):(i.isub(t),a.isub(o))}return(r=0===t.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(e),r},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var s=0;t.isEven()&&i.isEven();s++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var n=t;t=i,i=n}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(s)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){s("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),s(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:r<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var s=0|this.words[i],r=0|e.words[i];if(s!==r){s<r?t=-1:s>r&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new x(e)},n.prototype.toRed=function(e){return s(!this.red,"Already a number in reduction context"),s(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return s(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return s(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function C(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else s(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var s=t<this.n?-1:i.ucmp(this.p);return 0===s?(i.words[0]=0,i.length=1):s>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(C,v),C.prototype.split=function(e,t){for(var i=4194303,s=Math.min(e.length,9),r=0;r<s;r++)t.words[r]=e.words[r];if(t.length=s,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=n&i,r=10;r<e.length;r++){var o=0|e.words[r];e.words[r-10]=(o&i)<<4|n>>>22,n=o}n>>>=22,e.words[r-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},C.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var s=0|e.words[i];t+=977*s,e.words[i]=67108863&t,t=64*s+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(b,v),r(S,v),r(w,v),w.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var s=19*(0|e.words[i])+t,r=67108863&s;s>>>=26,e.words[i]=r,t=s}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new C;else if("p224"===e)t=new b;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},x.prototype._verify1=function(e){s(0===e.negative,"red works only with positives"),s(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){s(0===(e.negative|t.negative),"red works only with positives"),s(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(s(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);s(!r.isZero());var a=new n(1).toRed(this),l=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,c).cmp(l);)h.redIAdd(l);for(var d=this.pow(h,r),u=this.pow(e,r.addn(1).iushrn(1)),p=this.pow(e,r),g=o;0!==p.cmp(a);){for(var m=p,f=0;0!==m.cmp(a);f++)m=m.redSqr();s(f<g);var y=this.pow(d,new n(1).iushln(g-f-1));u=u.redMul(y),d=y.redSqr(),p=p.redMul(d),g=f}return u},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new n(1).toRed(this),i[1]=e;for(var s=2;s<i.length;s++)i[s]=this.mul(i[s-1],e);var r=i[0],o=0,a=0,l=t.bitLength()%26;for(0===l&&(l=26),s=t.length-1;s>=0;s--){for(var c=t.words[s],h=l-1;h>=0;h--){var d=c>>h&1;r!==i[0]&&(r=this.sqr(r)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===s&&0===h)&&(r=this.mul(r,i[o]),a=0,o=0)):a=0}l=26}return r},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new E(e)},r(E,x),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var i=e.mul(t),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=i.nmd(e),this)},39286(e,t,i){!function(e,t){"use strict";function s(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function n(e,t,i){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(3308).Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void s(!1,"Invalid character in "+e)}function l(e,t,i){var s=a(e,i);return i-1>=t&&(s|=a(e,i-1)<<4),s}function c(e,t,i,r){for(var n=0,o=0,a=Math.min(e.length,i),l=t;l<a;l++){var c=e.charCodeAt(l)-48;n*=r,o=c>=49?c-49+10:c>=17?c-17+10:c,s(c>=0&&o<r,"Invalid character"),n+=o}return n}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),s(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r<e.length&&(16===t?this._parseHex(e,r,i):(this._parseBase(e,t,r),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(s(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(s("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=e.length-1,n=0;r>=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<e.length;r+=3)o=e[r]|e[r+1]<<8|e[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this._strip()},n.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var s=0;s<this.length;s++)this.words[s]=0;var r,n=0,o=0;if("be"===i)for(s=e.length-1;s>=t;s-=2)r=l(e,t,s)<<n,this.words[o]|=67108863&r,n>=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;else for(s=(e.length-t)%2==0?t+1:t;s<e.length;s+=2)r=l(e,t,s)<<n,this.words[o]|=67108863&r,n>=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;this._strip()},n.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=t)s++;s--,r=r/t|0;for(var n=e.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,h=i;h<a;h+=s)l=c(e,h,h+s,t),this.imuln(r),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var d=1;for(l=c(e,h,e.length,t),h=0;h<o;h++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype._move=function(e){h(e,this)},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){n.prototype.inspect=d}else n.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,i){i.negative=t.negative^e.negative;var s=e.length+t.length|0;i.length=s,s=s-1|0;var r=0|e.words[0],n=0|t.words[0],o=r*n,a=67108863&o,l=o/67108864|0;i.words[0]=a;for(var c=1;c<s;c++){for(var h=l>>>26,d=67108863&l,u=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=u;p++){var g=c-p|0;h+=(o=(r=0|e.words[g])*(n=0|t.words[p])+d)/67108864|0,d=67108863&o}i.words[c]=0|d,l=0|h}return 0!==l?i.words[c]=0|l:i.length--,i._strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],l=(16777215&(a<<r|n)).toString(16);n=a>>>24-r&16777215,(r+=2)>=26&&(r-=26,o--),i=0!==n||o!==this.length-1?u[6-l.length]+l+i:l+i}for(0!==n&&(i=n.toString(16)+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],h=g[e];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(h).toString(e);i=(d=d.idivn(h)).isZero()?m+i:u[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){this._strip();var r=this.byteLength(),n=i||Math.max(1,r);s(r<=n,"byte array longer than desired length"),s(n>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,n);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,r),o},n.prototype._toArrayLikeLE=function(e,t){for(var i=0,s=0,r=0,n=0;r<this.length;r++){var o=this.words[r]<<n|s;e[i++]=255&o,i<e.length&&(e[i++]=o>>8&255),i<e.length&&(e[i++]=o>>16&255),6===n?(i<e.length&&(e[i++]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i<e.length)for(e[i++]=s;i<e.length;)e[i++]=0},n.prototype._toArrayLikeBE=function(e,t){for(var i=e.length-1,s=0,r=0,n=0;r<this.length;r++){var o=this.words[r]<<n|s;e[i--]=255&o,i>=0&&(e[i--]=o>>8&255),i>=0&&(e[i--]=o>>16&255),6===n?(i>=0&&(e[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(e[i--]=s;i>=0;)e[i--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 8191&t||(i+=13,t>>>=13),127&t||(i+=7,t>>>=7),15&t||(i+=4,t>>>=4),3&t||(i+=2,t>>>=2),1&t||i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},n.prototype.ior=function(e){return s(0===(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this._strip()},n.prototype.iand=function(e){return s(0===(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var s=0;s<i.length;s++)this.words[s]=t.words[s]^i.words[s];if(this!==t)for(;s<t.length;s++)this.words[s]=t.words[s];return this.length=t.length,this._strip()},n.prototype.ixor=function(e){return s(0===(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){s("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){s("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<r:this.words[i]&~(1<<r),this._strip()},n.prototype.iadd=function(e){var t,i,s;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,s=e):(i=e,s=this);for(var r=0,n=0;n<s.length;n++)t=(0|i.words[n])+(0|s.words[n])+r,this.words[n]=67108863&t,r=t>>>26;for(;0!==r&&n<i.length;n++)t=(0|i.words[n])+r,this.words[n]=67108863&t,r=t>>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;n<i.length;n++)this.words[n]=i.words[n];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,s,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=e):(i=e,s=this);for(var n=0,o=0;o<s.length;o++)n=(t=(0|i.words[o])-(0|s.words[o])+n)>>26,this.words[o]=67108863&t;for(;0!==n&&o<i.length;o++)n=(t=(0|i.words[o])+n)>>26,this.words[o]=67108863&t;if(0===n&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,i){var s,r,n,o=e.words,a=t.words,l=i.words,c=0,h=0|o[0],d=8191&h,u=h>>>13,p=0|o[1],g=8191&p,m=p>>>13,f=0|o[2],y=8191&f,v=f>>>13,C=0|o[3],b=8191&C,S=C>>>13,w=0|o[4],x=8191&w,E=w>>>13,M=0|o[5],A=8191&M,T=M>>>13,D=0|o[6],I=8191&D,R=D>>>13,P=0|o[7],k=8191&P,L=P>>>13,N=0|o[8],_=8191&N,O=N>>>13,F=0|o[9],G=8191&F,B=F>>>13,V=0|a[0],H=8191&V,U=V>>>13,z=0|a[1],W=8191&z,j=z>>>13,K=0|a[2],$=8191&K,Y=K>>>13,q=0|a[3],X=8191&q,Z=q>>>13,Q=0|a[4],J=8191&Q,ee=Q>>>13,te=0|a[5],ie=8191&te,se=te>>>13,re=0|a[6],ne=8191&re,oe=re>>>13,ae=0|a[7],le=8191&ae,ce=ae>>>13,he=0|a[8],de=8191&he,ue=he>>>13,pe=0|a[9],ge=8191&pe,me=pe>>>13;i.negative=e.negative^t.negative,i.length=19;var fe=(c+(s=Math.imul(d,H))|0)+((8191&(r=(r=Math.imul(d,U))+Math.imul(u,H)|0))<<13)|0;c=((n=Math.imul(u,U))+(r>>>13)|0)+(fe>>>26)|0,fe&=67108863,s=Math.imul(g,H),r=(r=Math.imul(g,U))+Math.imul(m,H)|0,n=Math.imul(m,U);var ye=(c+(s=s+Math.imul(d,W)|0)|0)+((8191&(r=(r=r+Math.imul(d,j)|0)+Math.imul(u,W)|0))<<13)|0;c=((n=n+Math.imul(u,j)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,s=Math.imul(y,H),r=(r=Math.imul(y,U))+Math.imul(v,H)|0,n=Math.imul(v,U),s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,j)|0)+Math.imul(m,W)|0,n=n+Math.imul(m,j)|0;var ve=(c+(s=s+Math.imul(d,$)|0)|0)+((8191&(r=(r=r+Math.imul(d,Y)|0)+Math.imul(u,$)|0))<<13)|0;c=((n=n+Math.imul(u,Y)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,s=Math.imul(b,H),r=(r=Math.imul(b,U))+Math.imul(S,H)|0,n=Math.imul(S,U),s=s+Math.imul(y,W)|0,r=(r=r+Math.imul(y,j)|0)+Math.imul(v,W)|0,n=n+Math.imul(v,j)|0,s=s+Math.imul(g,$)|0,r=(r=r+Math.imul(g,Y)|0)+Math.imul(m,$)|0,n=n+Math.imul(m,Y)|0;var Ce=(c+(s=s+Math.imul(d,X)|0)|0)+((8191&(r=(r=r+Math.imul(d,Z)|0)+Math.imul(u,X)|0))<<13)|0;c=((n=n+Math.imul(u,Z)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,s=Math.imul(x,H),r=(r=Math.imul(x,U))+Math.imul(E,H)|0,n=Math.imul(E,U),s=s+Math.imul(b,W)|0,r=(r=r+Math.imul(b,j)|0)+Math.imul(S,W)|0,n=n+Math.imul(S,j)|0,s=s+Math.imul(y,$)|0,r=(r=r+Math.imul(y,Y)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,Y)|0,s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(m,X)|0,n=n+Math.imul(m,Z)|0;var be=(c+(s=s+Math.imul(d,J)|0)|0)+((8191&(r=(r=r+Math.imul(d,ee)|0)+Math.imul(u,J)|0))<<13)|0;c=((n=n+Math.imul(u,ee)|0)+(r>>>13)|0)+(be>>>26)|0,be&=67108863,s=Math.imul(A,H),r=(r=Math.imul(A,U))+Math.imul(T,H)|0,n=Math.imul(T,U),s=s+Math.imul(x,W)|0,r=(r=r+Math.imul(x,j)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,j)|0,s=s+Math.imul(b,$)|0,r=(r=r+Math.imul(b,Y)|0)+Math.imul(S,$)|0,n=n+Math.imul(S,Y)|0,s=s+Math.imul(y,X)|0,r=(r=r+Math.imul(y,Z)|0)+Math.imul(v,X)|0,n=n+Math.imul(v,Z)|0,s=s+Math.imul(g,J)|0,r=(r=r+Math.imul(g,ee)|0)+Math.imul(m,J)|0,n=n+Math.imul(m,ee)|0;var Se=(c+(s=s+Math.imul(d,ie)|0)|0)+((8191&(r=(r=r+Math.imul(d,se)|0)+Math.imul(u,ie)|0))<<13)|0;c=((n=n+Math.imul(u,se)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,s=Math.imul(I,H),r=(r=Math.imul(I,U))+Math.imul(R,H)|0,n=Math.imul(R,U),s=s+Math.imul(A,W)|0,r=(r=r+Math.imul(A,j)|0)+Math.imul(T,W)|0,n=n+Math.imul(T,j)|0,s=s+Math.imul(x,$)|0,r=(r=r+Math.imul(x,Y)|0)+Math.imul(E,$)|0,n=n+Math.imul(E,Y)|0,s=s+Math.imul(b,X)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(S,X)|0,n=n+Math.imul(S,Z)|0,s=s+Math.imul(y,J)|0,r=(r=r+Math.imul(y,ee)|0)+Math.imul(v,J)|0,n=n+Math.imul(v,ee)|0,s=s+Math.imul(g,ie)|0,r=(r=r+Math.imul(g,se)|0)+Math.imul(m,ie)|0,n=n+Math.imul(m,se)|0;var we=(c+(s=s+Math.imul(d,ne)|0)|0)+((8191&(r=(r=r+Math.imul(d,oe)|0)+Math.imul(u,ne)|0))<<13)|0;c=((n=n+Math.imul(u,oe)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,s=Math.imul(k,H),r=(r=Math.imul(k,U))+Math.imul(L,H)|0,n=Math.imul(L,U),s=s+Math.imul(I,W)|0,r=(r=r+Math.imul(I,j)|0)+Math.imul(R,W)|0,n=n+Math.imul(R,j)|0,s=s+Math.imul(A,$)|0,r=(r=r+Math.imul(A,Y)|0)+Math.imul(T,$)|0,n=n+Math.imul(T,Y)|0,s=s+Math.imul(x,X)|0,r=(r=r+Math.imul(x,Z)|0)+Math.imul(E,X)|0,n=n+Math.imul(E,Z)|0,s=s+Math.imul(b,J)|0,r=(r=r+Math.imul(b,ee)|0)+Math.imul(S,J)|0,n=n+Math.imul(S,ee)|0,s=s+Math.imul(y,ie)|0,r=(r=r+Math.imul(y,se)|0)+Math.imul(v,ie)|0,n=n+Math.imul(v,se)|0,s=s+Math.imul(g,ne)|0,r=(r=r+Math.imul(g,oe)|0)+Math.imul(m,ne)|0,n=n+Math.imul(m,oe)|0;var xe=(c+(s=s+Math.imul(d,le)|0)|0)+((8191&(r=(r=r+Math.imul(d,ce)|0)+Math.imul(u,le)|0))<<13)|0;c=((n=n+Math.imul(u,ce)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,s=Math.imul(_,H),r=(r=Math.imul(_,U))+Math.imul(O,H)|0,n=Math.imul(O,U),s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,j)|0)+Math.imul(L,W)|0,n=n+Math.imul(L,j)|0,s=s+Math.imul(I,$)|0,r=(r=r+Math.imul(I,Y)|0)+Math.imul(R,$)|0,n=n+Math.imul(R,Y)|0,s=s+Math.imul(A,X)|0,r=(r=r+Math.imul(A,Z)|0)+Math.imul(T,X)|0,n=n+Math.imul(T,Z)|0,s=s+Math.imul(x,J)|0,r=(r=r+Math.imul(x,ee)|0)+Math.imul(E,J)|0,n=n+Math.imul(E,ee)|0,s=s+Math.imul(b,ie)|0,r=(r=r+Math.imul(b,se)|0)+Math.imul(S,ie)|0,n=n+Math.imul(S,se)|0,s=s+Math.imul(y,ne)|0,r=(r=r+Math.imul(y,oe)|0)+Math.imul(v,ne)|0,n=n+Math.imul(v,oe)|0,s=s+Math.imul(g,le)|0,r=(r=r+Math.imul(g,ce)|0)+Math.imul(m,le)|0,n=n+Math.imul(m,ce)|0;var Ee=(c+(s=s+Math.imul(d,de)|0)|0)+((8191&(r=(r=r+Math.imul(d,ue)|0)+Math.imul(u,de)|0))<<13)|0;c=((n=n+Math.imul(u,ue)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,s=Math.imul(G,H),r=(r=Math.imul(G,U))+Math.imul(B,H)|0,n=Math.imul(B,U),s=s+Math.imul(_,W)|0,r=(r=r+Math.imul(_,j)|0)+Math.imul(O,W)|0,n=n+Math.imul(O,j)|0,s=s+Math.imul(k,$)|0,r=(r=r+Math.imul(k,Y)|0)+Math.imul(L,$)|0,n=n+Math.imul(L,Y)|0,s=s+Math.imul(I,X)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Z)|0,s=s+Math.imul(A,J)|0,r=(r=r+Math.imul(A,ee)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,ee)|0,s=s+Math.imul(x,ie)|0,r=(r=r+Math.imul(x,se)|0)+Math.imul(E,ie)|0,n=n+Math.imul(E,se)|0,s=s+Math.imul(b,ne)|0,r=(r=r+Math.imul(b,oe)|0)+Math.imul(S,ne)|0,n=n+Math.imul(S,oe)|0,s=s+Math.imul(y,le)|0,r=(r=r+Math.imul(y,ce)|0)+Math.imul(v,le)|0,n=n+Math.imul(v,ce)|0,s=s+Math.imul(g,de)|0,r=(r=r+Math.imul(g,ue)|0)+Math.imul(m,de)|0,n=n+Math.imul(m,ue)|0;var Me=(c+(s=s+Math.imul(d,ge)|0)|0)+((8191&(r=(r=r+Math.imul(d,me)|0)+Math.imul(u,ge)|0))<<13)|0;c=((n=n+Math.imul(u,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,s=Math.imul(G,W),r=(r=Math.imul(G,j))+Math.imul(B,W)|0,n=Math.imul(B,j),s=s+Math.imul(_,$)|0,r=(r=r+Math.imul(_,Y)|0)+Math.imul(O,$)|0,n=n+Math.imul(O,Y)|0,s=s+Math.imul(k,X)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,Z)|0,s=s+Math.imul(I,J)|0,r=(r=r+Math.imul(I,ee)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,ee)|0,s=s+Math.imul(A,ie)|0,r=(r=r+Math.imul(A,se)|0)+Math.imul(T,ie)|0,n=n+Math.imul(T,se)|0,s=s+Math.imul(x,ne)|0,r=(r=r+Math.imul(x,oe)|0)+Math.imul(E,ne)|0,n=n+Math.imul(E,oe)|0,s=s+Math.imul(b,le)|0,r=(r=r+Math.imul(b,ce)|0)+Math.imul(S,le)|0,n=n+Math.imul(S,ce)|0,s=s+Math.imul(y,de)|0,r=(r=r+Math.imul(y,ue)|0)+Math.imul(v,de)|0,n=n+Math.imul(v,ue)|0;var Ae=(c+(s=s+Math.imul(g,ge)|0)|0)+((8191&(r=(r=r+Math.imul(g,me)|0)+Math.imul(m,ge)|0))<<13)|0;c=((n=n+Math.imul(m,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,s=Math.imul(G,$),r=(r=Math.imul(G,Y))+Math.imul(B,$)|0,n=Math.imul(B,Y),s=s+Math.imul(_,X)|0,r=(r=r+Math.imul(_,Z)|0)+Math.imul(O,X)|0,n=n+Math.imul(O,Z)|0,s=s+Math.imul(k,J)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(L,J)|0,n=n+Math.imul(L,ee)|0,s=s+Math.imul(I,ie)|0,r=(r=r+Math.imul(I,se)|0)+Math.imul(R,ie)|0,n=n+Math.imul(R,se)|0,s=s+Math.imul(A,ne)|0,r=(r=r+Math.imul(A,oe)|0)+Math.imul(T,ne)|0,n=n+Math.imul(T,oe)|0,s=s+Math.imul(x,le)|0,r=(r=r+Math.imul(x,ce)|0)+Math.imul(E,le)|0,n=n+Math.imul(E,ce)|0,s=s+Math.imul(b,de)|0,r=(r=r+Math.imul(b,ue)|0)+Math.imul(S,de)|0,n=n+Math.imul(S,ue)|0;var Te=(c+(s=s+Math.imul(y,ge)|0)|0)+((8191&(r=(r=r+Math.imul(y,me)|0)+Math.imul(v,ge)|0))<<13)|0;c=((n=n+Math.imul(v,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,s=Math.imul(G,X),r=(r=Math.imul(G,Z))+Math.imul(B,X)|0,n=Math.imul(B,Z),s=s+Math.imul(_,J)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(O,J)|0,n=n+Math.imul(O,ee)|0,s=s+Math.imul(k,ie)|0,r=(r=r+Math.imul(k,se)|0)+Math.imul(L,ie)|0,n=n+Math.imul(L,se)|0,s=s+Math.imul(I,ne)|0,r=(r=r+Math.imul(I,oe)|0)+Math.imul(R,ne)|0,n=n+Math.imul(R,oe)|0,s=s+Math.imul(A,le)|0,r=(r=r+Math.imul(A,ce)|0)+Math.imul(T,le)|0,n=n+Math.imul(T,ce)|0,s=s+Math.imul(x,de)|0,r=(r=r+Math.imul(x,ue)|0)+Math.imul(E,de)|0,n=n+Math.imul(E,ue)|0;var De=(c+(s=s+Math.imul(b,ge)|0)|0)+((8191&(r=(r=r+Math.imul(b,me)|0)+Math.imul(S,ge)|0))<<13)|0;c=((n=n+Math.imul(S,me)|0)+(r>>>13)|0)+(De>>>26)|0,De&=67108863,s=Math.imul(G,J),r=(r=Math.imul(G,ee))+Math.imul(B,J)|0,n=Math.imul(B,ee),s=s+Math.imul(_,ie)|0,r=(r=r+Math.imul(_,se)|0)+Math.imul(O,ie)|0,n=n+Math.imul(O,se)|0,s=s+Math.imul(k,ne)|0,r=(r=r+Math.imul(k,oe)|0)+Math.imul(L,ne)|0,n=n+Math.imul(L,oe)|0,s=s+Math.imul(I,le)|0,r=(r=r+Math.imul(I,ce)|0)+Math.imul(R,le)|0,n=n+Math.imul(R,ce)|0,s=s+Math.imul(A,de)|0,r=(r=r+Math.imul(A,ue)|0)+Math.imul(T,de)|0,n=n+Math.imul(T,ue)|0;var Ie=(c+(s=s+Math.imul(x,ge)|0)|0)+((8191&(r=(r=r+Math.imul(x,me)|0)+Math.imul(E,ge)|0))<<13)|0;c=((n=n+Math.imul(E,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,s=Math.imul(G,ie),r=(r=Math.imul(G,se))+Math.imul(B,ie)|0,n=Math.imul(B,se),s=s+Math.imul(_,ne)|0,r=(r=r+Math.imul(_,oe)|0)+Math.imul(O,ne)|0,n=n+Math.imul(O,oe)|0,s=s+Math.imul(k,le)|0,r=(r=r+Math.imul(k,ce)|0)+Math.imul(L,le)|0,n=n+Math.imul(L,ce)|0,s=s+Math.imul(I,de)|0,r=(r=r+Math.imul(I,ue)|0)+Math.imul(R,de)|0,n=n+Math.imul(R,ue)|0;var Re=(c+(s=s+Math.imul(A,ge)|0)|0)+((8191&(r=(r=r+Math.imul(A,me)|0)+Math.imul(T,ge)|0))<<13)|0;c=((n=n+Math.imul(T,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863,s=Math.imul(G,ne),r=(r=Math.imul(G,oe))+Math.imul(B,ne)|0,n=Math.imul(B,oe),s=s+Math.imul(_,le)|0,r=(r=r+Math.imul(_,ce)|0)+Math.imul(O,le)|0,n=n+Math.imul(O,ce)|0,s=s+Math.imul(k,de)|0,r=(r=r+Math.imul(k,ue)|0)+Math.imul(L,de)|0,n=n+Math.imul(L,ue)|0;var Pe=(c+(s=s+Math.imul(I,ge)|0)|0)+((8191&(r=(r=r+Math.imul(I,me)|0)+Math.imul(R,ge)|0))<<13)|0;c=((n=n+Math.imul(R,me)|0)+(r>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,s=Math.imul(G,le),r=(r=Math.imul(G,ce))+Math.imul(B,le)|0,n=Math.imul(B,ce),s=s+Math.imul(_,de)|0,r=(r=r+Math.imul(_,ue)|0)+Math.imul(O,de)|0,n=n+Math.imul(O,ue)|0;var ke=(c+(s=s+Math.imul(k,ge)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(L,ge)|0))<<13)|0;c=((n=n+Math.imul(L,me)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,s=Math.imul(G,de),r=(r=Math.imul(G,ue))+Math.imul(B,de)|0,n=Math.imul(B,ue);var Le=(c+(s=s+Math.imul(_,ge)|0)|0)+((8191&(r=(r=r+Math.imul(_,me)|0)+Math.imul(O,ge)|0))<<13)|0;c=((n=n+Math.imul(O,me)|0)+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ne=(c+(s=Math.imul(G,ge))|0)+((8191&(r=(r=Math.imul(G,me))+Math.imul(B,ge)|0))<<13)|0;return c=((n=Math.imul(B,me))+(r>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,l[0]=fe,l[1]=ye,l[2]=ve,l[3]=Ce,l[4]=be,l[5]=Se,l[6]=we,l[7]=xe,l[8]=Ee,l[9]=Me,l[10]=Ae,l[11]=Te,l[12]=De,l[13]=Ie,l[14]=Re,l[15]=Pe,l[16]=ke,l[17]=Le,l[18]=Ne,0!==c&&(l[19]=c,i.length++),i};function y(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var s=0,r=0,n=0;n<i.length-1;n++){var o=r;r=0;for(var a=67108863&s,l=Math.min(n,t.length-1),c=Math.max(0,n-e.length+1);c<=l;c++){var h=n-c,d=(0|e.words[h])*(0|t.words[c]),u=67108863&d;a=67108863&(u=u+a|0),r+=(o=(o=o+(d/67108864|0)|0)+(u>>>26)|0)>>>26,o&=67108863}i.words[n]=a,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i._strip()}function v(e,t,i){return y(e,t,i)}function C(e,t){this.x=e,this.y=t}Math.imul||(f=m),n.prototype.mulTo=function(e,t){var i=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):i<63?m(this,e,t):i<1024?y(this,e,t):v(this,e,t)},C.prototype.makeRBT=function(e){for(var t=new Array(e),i=n.prototype._countBits(e)-1,s=0;s<e;s++)t[s]=this.revBin(s,i,e);return t},C.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var s=0,r=0;r<t;r++)s|=(1&e)<<t-r-1,e>>=1;return s},C.prototype.permute=function(e,t,i,s,r,n){for(var o=0;o<n;o++)s[o]=t[e[o]],r[o]=i[e[o]]},C.prototype.transform=function(e,t,i,s,r,n){this.permute(n,e,t,i,s,r);for(var o=1;o<r;o<<=1)for(var a=o<<1,l=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<r;h+=a)for(var d=l,u=c,p=0;p<o;p++){var g=i[h+p],m=s[h+p],f=i[h+p+o],y=s[h+p+o],v=d*f-u*y;y=d*y+u*f,f=v,i[h+p]=g+f,s[h+p]=m+y,i[h+p+o]=g-f,s[h+p+o]=m-y,p!==a&&(v=l*d-c*u,u=l*u+c*d,d=v)}},C.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),s=1&i,r=0;for(i=i/2|0;i;i>>>=1)r++;return 1<<r+1+s},C.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var s=0;s<i/2;s++){var r=e[s];e[s]=e[i-s-1],e[i-s-1]=r,r=t[s],t[s]=-t[i-s-1],t[i-s-1]=-r}},C.prototype.normalize13b=function(e,t){for(var i=0,s=0;s<t/2;s++){var r=8192*Math.round(e[2*s+1]/t)+Math.round(e[2*s]/t)+i;e[s]=67108863&r,i=r<67108864?0:r/67108864|0}return e},C.prototype.convert13b=function(e,t,i,r){for(var n=0,o=0;o<t;o++)n+=0|e[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*t;o<r;++o)i[o]=0;s(0===n),s(!(-8192&n))},C.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},C.prototype.mulp=function(e,t,i){var s=2*this.guessLen13b(e.length,t.length),r=this.makeRBT(s),n=this.stub(s),o=new Array(s),a=new Array(s),l=new Array(s),c=new Array(s),h=new Array(s),d=new Array(s),u=i.words;u.length=s,this.convert13b(e.words,e.length,o,s),this.convert13b(t.words,t.length,c,s),this.transform(o,n,a,l,s,r),this.transform(c,n,h,d,s,r);for(var p=0;p<s;p++){var g=a[p]*h[p]-l[p]*d[p];l[p]=a[p]*d[p]+l[p]*h[p],a[p]=g}return this.conjugate(a,l,s),this.transform(a,l,u,n,s,r),this.conjugate(u,n,s),this.normalize13b(u,s),i.negative=e.negative^t.negative,i.length=e.length+t.length,i._strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),v(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),s("number"==typeof e),s(e<67108864);for(var i=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,o=(67108863&n)+(67108863&i);i>>=26,i+=n/67108864|0,i+=o>>>26,this.words[r]=67108863&o}return 0!==i&&(this.words[r]=i,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var s=i/26|0,r=i%26;t[i]=e.words[s]>>>r&1}return t}(e);if(0===t.length)return new n(1);for(var i=this,s=0;s<t.length&&0===t[s];s++,i=i.sqr());if(++s<t.length)for(var r=i.sqr();s<t.length;s++,r=r.sqr())0!==t[s]&&(i=i.mul(r));return i},n.prototype.iushln=function(e){s("number"==typeof e&&e>=0);var t,i=e%26,r=(e-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&n,l=(0|this.words[t])-a<<i;this.words[t]=l|o,o=a>>>26-i}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t<r;t++)this.words[t]=0;this.length+=r}return this._strip()},n.prototype.ishln=function(e){return s(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var r;s("number"==typeof e&&e>=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),a=67108863^67108863>>>n<<n,l=i;if(r-=o,r=Math.max(0,r),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=r);c--){var d=0|this.words[c];this.words[c]=h<<26-n|d>>>n,h=d&a}return l&&0!==h&&(l.words[l.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return s(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){s("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<<t;return!(this.length<=i||!(this.words[i]&r))},n.prototype.imaskn=function(e){s("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(s(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>t<<t;this.words[this.length-1]&=r}return 0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return s("number"==typeof e),s(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(s("number"==typeof e),s(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var r,n,o=e.length+i;this._expand(o);var a=0;for(r=0;r<e.length;r++){n=(0|this.words[r+i])+a;var l=(0|e.words[r])*t;a=((n-=67108863&l)>>26)-(l/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this._strip();for(s(-1===a),a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var i=(this.length,e.length),s=this.clone(),r=e,o=0|r.words[r.length-1];0!=(i=26-this._countBits(o))&&(r=r.ushln(i),s.iushln(i),o=0|r.words[r.length-1]);var a,l=s.length-r.length;if("mod"!==t){(a=new n(null)).length=l+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=s.clone()._ishlnsubmul(r,1,l);0===h.negative&&(s=h,a&&(a.words[l]=1));for(var d=l-1;d>=0;d--){var u=67108864*(0|s.words[r.length+d])+(0|s.words[r.length+d-1]);for(u=Math.min(u/o|0,67108863),s._ishlnsubmul(r,u,d);0!==s.negative;)u--,s.negative=0,s._ishlnsubmul(r,1,d),s.isZero()||(s.negative^=1);a&&(a.words[d]=u)}return a&&a._strip(),s._strip(),"div"!==t&&0!==i&&s.iushrn(i),{div:a||null,mod:s}},n.prototype.divmod=function(e,t,i){return s(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(r=a.div.neg()),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(e)),{div:r,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(r=a.div.neg()),{div:r,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var r,o,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,s=e.ushrn(1),r=e.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),s(e<=67108863);for(var i=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(i*r+(0|this.words[n]))%e;return t?-r:r},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),s(e<=67108863);for(var i=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*i;this.words[r]=n/e|0,i=n%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){s(0===e.negative),s(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new n(1),o=new n(0),a=new n(0),l=new n(1),c=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),d=t.clone();!t.isZero();){for(var u=0,p=1;0===(t.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(h),o.isub(d)),r.iushrn(1),o.iushrn(1);for(var g=0,m=1;0===(i.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(i.iushrn(g);g-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(h),l.isub(d)),a.iushrn(1),l.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(a),o.isub(l)):(i.isub(t),a.isub(r),l.isub(o))}return{a,b:l,gcd:i.iushln(c)}},n.prototype._invmp=function(e){s(0===e.negative),s(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,o=new n(1),a=new n(0),l=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var d=0,u=1;0===(i.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(i.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a)):(i.isub(t),a.isub(o))}return(r=0===t.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(e),r},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var s=0;t.isEven()&&i.isEven();s++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var n=t;t=i,i=n}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(s)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){s("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),s(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:r<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var s=0|this.words[i],r=0|e.words[i];if(s!==r){s<r?t=-1:s>r&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new A(e)},n.prototype.toRed=function(e){return s(!this.red,"Already a number in reduction context"),s(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return s(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return s(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else s(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var s=t<this.n?-1:i.ucmp(this.p);return 0===s?(i.words[0]=0,i.length=1):s>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)},r(w,S),w.prototype.split=function(e,t){for(var i=4194303,s=Math.min(e.length,9),r=0;r<s;r++)t.words[r]=e.words[r];if(t.length=s,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=n&i,r=10;r<e.length;r++){var o=0|e.words[r];e.words[r-10]=(o&i)<<4|n>>>22,n=o}n>>>=22,e.words[r-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var s=0|e.words[i];t+=977*s,e.words[i]=67108863&t,t=64*s+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(x,S),r(E,S),r(M,S),M.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var s=19*(0|e.words[i])+t,r=67108863&s;s>>>=26,e.words[i]=r,t=s}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},A.prototype._verify1=function(e){s(0===e.negative,"red works only with positives"),s(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){s(0===(e.negative|t.negative),"red works only with positives"),s(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(s(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);s(!r.isZero());var a=new n(1).toRed(this),l=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,c).cmp(l);)h.redIAdd(l);for(var d=this.pow(h,r),u=this.pow(e,r.addn(1).iushrn(1)),p=this.pow(e,r),g=o;0!==p.cmp(a);){for(var m=p,f=0;0!==m.cmp(a);f++)m=m.redSqr();s(f<g);var y=this.pow(d,new n(1).iushln(g-f-1));u=u.redMul(y),d=y.redSqr(),p=p.redMul(d),g=f}return u},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new n(1).toRed(this),i[1]=e;for(var s=2;s<i.length;s++)i[s]=this.mul(i[s-1],e);var r=i[0],o=0,a=0,l=t.bitLength()%26;for(0===l&&(l=26),s=t.length-1;s>=0;s--){for(var c=t.words[s],h=l-1;h>=0;h--){var d=c>>h&1;r!==i[0]&&(r=this.sqr(r)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===s&&0===h)&&(r=this.mul(r,i[o]),a=0,o=0)):a=0}l=26}return r},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new T(e)},r(T,A),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var i=e.mul(t),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=i.nmd(e),this)},36621(e){e.exports=function(e){var t={};function i(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(s,r,function(t){return e[t]}.bind(null,r));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=90)}({17:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s=i(18),r=function(){function e(){}return e.getFirstMatch=function(e,t){var i=t.match(e);return i&&i.length>0&&i[1]||""},e.getSecondMatch=function(e,t){var i=t.match(e);return i&&i.length>1&&i[2]||""},e.matchAndReturnConst=function(e,t,i){if(e.test(t))return i},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});t.push(0);var i=t[0],s=t[1];if(10===i)switch(s){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(i){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,i,s){void 0===s&&(s=!1);var r=e.getVersionPrecision(t),n=e.getVersionPrecision(i),o=Math.max(r,n),a=0,l=e.map([t,i],function(t){var i=o-e.getVersionPrecision(t),s=t+new Array(i+1).join(".0");return e.map(s.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});for(s&&(a=o-Math.min(r,n)),o-=1;o>=a;){if(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===a)return 0;o-=1}else if(l[0][o]<l[1][o])return-1}},e.map=function(e,t){var i,s=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i+=1)s.push(t(e[i]));return s},e.find=function(e,t){var i,s;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,s=e.length;i<s;i+=1){var r=e[i];if(t(r,i))return r}},e.assign=function(e){for(var t,i,s=e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(n));var a=function(){var e=n[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach(function(t){s[t]=e[t]})};for(t=0,i=n.length;t<i;t+=1)a();return e},e.getBrowserAlias=function(e){return s.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return s.BROWSER_MAP[e]||""},e}();t.default=r,e.exports=t.default},18:function(e,t,i){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s,r=(s=i(91))&&s.__esModule?s:{default:s},n=i(18);function o(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}var a=function(){function e(){}var t,i;return e.getParser=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=null),"string"!=typeof e)throw new Error("UserAgent should be a string");return new r.default(e,t,i)},e.parse=function(e,t){return void 0===t&&(t=null),new r.default(e,t).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return n.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return n.ENGINE_MAP}},{key:"OS_MAP",get:function(){return n.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return n.PLATFORMS_MAP}}],null&&o(t.prototype,null),i&&o(t,i),e}();t.default=a,e.exports=t.default},91:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s=l(i(92)),r=l(i(93)),n=l(i(94)),o=l(i(95)),a=l(i(17));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=null),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e;var s=!1;"boolean"==typeof t?(s=t,this._hints=i):this._hints=null!=t&&"object"==typeof t?t:null,this.parsedResult={},!0!==s&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some(function(e){return e.brand&&e.brand.toLowerCase()===t})},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),i=this._hints.brands.find(function(e){return e.brand&&e.brand.toLowerCase()===t});return i?i.version:void 0}},t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(s.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA(),this)),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(n.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,i={},s=0,r={},n=0;if(Object.keys(e).forEach(function(t){var o=e[t];"string"==typeof o?(r[t]=o,n+=1):"object"==typeof o&&(i[t]=o,s+=1)}),s>0){var o=Object.keys(i),l=a.default.find(o,function(e){return t.isOS(e)});if(l){var c=this.satisfies(i[l]);if(void 0!==c)return c}var h=a.default.find(o,function(e){return t.isPlatform(e)});if(h){var d=this.satisfies(i[h]);if(void 0!==d)return d}}if(n>0){var u=Object.keys(r),p=a.default.find(u,function(e){return t.isBrowser(e,!0)});if(void 0!==p)return this.compareVersion(r[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var i=this.getBrowserName().toLowerCase(),s=e.toLowerCase(),r=a.default.getBrowserTypeByAlias(s);return t&&r&&(s=r.toLowerCase()),s===i},t.compareVersion=function(e){var t=[0],i=e,s=!1,r=this.getBrowserVersion();if("string"==typeof r)return">"===e[0]||"<"===e[0]?(i=e.substr(1),"="===e[1]?(s=!0,i=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?i=e.substr(1):"~"===e[0]&&(s=!0,i=e.substr(1)),t.indexOf(a.default.compareVersions(r,i,s))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}();t.default=c,e.exports=t.default},92:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s,r=(s=i(17))&&s.__esModule?s:{default:s},n=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},i=r.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},i=r.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},i=r.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},i=r.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},i=r.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},i=r.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},i=r.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},i=r.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},i=r.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},i=r.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},i=r.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},i=r.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},i=r.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},i=r.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/linespider/i],describe:function(e){var t={name:"Linespider"},i=r.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},i=r.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},i=r.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},i=r.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},i=r.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},i=r.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:"SlackBot"},i=r.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},i=r.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},i=r.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},i=r.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},i=r.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},i=r.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},i=r.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},i=r.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},i=r.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},i=r.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},i=r.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},i=r.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},i=r.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},i=r.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},i=r.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return i&&(t.version=i),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},i=r.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},i=r.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},i=r.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},i=r.default.getFirstMatch(n,e)||r.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},i=r.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},i=r.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},i=r.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},i=r.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},i=r.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},i=r.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},i=r.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),s=r.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),n=r.default.getFirstMatch(/se ([\d.]+)x/i,e),o=i||s||n;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},i=r.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){return!!e.hasBrand("DuckDuckGo")||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var i={name:"DuckDuckGo"};if(t){var s=t.getBrandVersion("DuckDuckGo");if(s)return i.version=s,i}var n=r.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return n&&(i.version=n),i}},{test:function(e){return e.hasBrand("Brave")},describe:function(e,t){var i={name:"Brave"};if(t){var s=t.getBrandVersion("Brave");if(s)return i.version=s,i}return i}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},i=r.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},i=r.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},i=r.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t={name:"Android Browser"},i=r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},i=r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},i=r.default.getFirstMatch(n,e);return i&&(t.version=i),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:r.default.getFirstMatch(t,e),version:r.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s,r=(s=i(17))&&s.__esModule?s:{default:s},n=i(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=r.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:n.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=r.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:n.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=r.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),i=r.default.getWindowsVersionName(t);return{name:n.OS_MAP.Windows,version:t,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:n.OS_MAP.iOS},i=r.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return i&&(t.version=i),t}},{test:[/macintosh/i],describe:function(e){var t=r.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),i=r.default.getMacOSVersionName(t),s={name:n.OS_MAP.MacOS,version:t};return i&&(s.versionName=i),s}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=r.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:n.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=r.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:n.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t=r.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),i=r.default.getAndroidVersionName(t),s={name:n.OS_MAP.Android,version:t};return i&&(s.versionName=i),s}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=r.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),i={name:n.OS_MAP.WebOS};return t&&t.length&&(i.version=t),i}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=r.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||r.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||r.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:n.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=r.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:n.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=r.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:n.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:n.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:n.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=r.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:n.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s,r=(s=i(17))&&s.__esModule?s:{default:s},n=i(18),o=[{test:[/googlebot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:n.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=r.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",i={type:n.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(i.model=t),i}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),i=e.test(/like (ipod|iphone)/i);return t&&!i},describe:function(e){var t=r.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:n.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=r.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),i={type:n.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(i.model=t),i}},{test:[/[^-]mobi/i],describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:n.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:n.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:n.PLATFORMS_MAP.tv}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var s,r=(s=i(17))&&s.__esModule?s:{default:s},n=i(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:n.ENGINE_MAP.Blink};var t=r.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:n.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:n.ENGINE_MAP.Trident},i=r.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:n.ENGINE_MAP.Presto},i=r.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=e.test(/gecko/i),i=e.test(/like gecko/i);return t&&!i},describe:function(e){var t={name:n.ENGINE_MAP.Gecko},i=r.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:n.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:n.ENGINE_MAP.WebKit},i=r.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}}];t.default=o,e.exports=t.default}})},65442(e,t,i){var s;function r(e){this.rand=e}if(e.exports=function(e){return s||(s=new r(null)),s.generate(e)},e.exports.Rand=r,r.prototype.generate=function(e){return this._rand(e)},r.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?r.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?r.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(r.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var n=i(44507);if("function"!=typeof n.randomBytes)throw new Error("Not supported");r.prototype._rand=function(e){return n.randomBytes(e)}}catch(e){}},87088(e,t,i){var s=i(56608).Buffer;function r(e){s.isBuffer(e)||(e=s.from(e));for(var t=e.length/4|0,i=new Array(t),r=0;r<t;r++)i[r]=e.readUInt32BE(4*r);return i}function n(e){for(;0<e.length;e++)e[0]=0}function o(e,t,i,s,r){for(var n,o,a,l,c=i[0],h=i[1],d=i[2],u=i[3],p=e[0]^t[0],g=e[1]^t[1],m=e[2]^t[2],f=e[3]^t[3],y=4,v=1;v<r;v++)n=c[p>>>24]^h[g>>>16&255]^d[m>>>8&255]^u[255&f]^t[y++],o=c[g>>>24]^h[m>>>16&255]^d[f>>>8&255]^u[255&p]^t[y++],a=c[m>>>24]^h[f>>>16&255]^d[p>>>8&255]^u[255&g]^t[y++],l=c[f>>>24]^h[p>>>16&255]^d[g>>>8&255]^u[255&m]^t[y++],p=n,g=o,m=a,f=l;return n=(s[p>>>24]<<24|s[g>>>16&255]<<16|s[m>>>8&255]<<8|s[255&f])^t[y++],o=(s[g>>>24]<<24|s[m>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^t[y++],a=(s[m>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&g])^t[y++],l=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[g>>>8&255]<<8|s[255&m])^t[y++],[n>>>=0,o>>>=0,a>>>=0,l>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var i=[],s=[],r=[[],[],[],[]],n=[[],[],[],[]],o=0,a=0,l=0;l<256;++l){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,i[o]=c,s[c]=o;var h=e[o],d=e[h],u=e[d],p=257*e[c]^16843008*c;r[0][o]=p<<24|p>>>8,r[1][o]=p<<16|p>>>16,r[2][o]=p<<8|p>>>24,r[3][o]=p,p=16843009*u^65537*d^257*h^16843008*o,n[0][c]=p<<24|p>>>8,n[1][c]=p<<16|p>>>16,n[2][c]=p<<8|p>>>24,n[3][c]=p,0===o?o=a=1:(o=h^e[e[e[u^h]]],a^=e[e[a]])}return{SBOX:i,INV_SBOX:s,SUB_MIX:r,INV_SUB_MIX:n}}();function c(e){this._key=r(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,i=t+6,s=4*(i+1),r=[],n=0;n<t;n++)r[n]=e[n];for(n=t;n<s;n++){var o=r[n-1];n%t===0?(o=o<<8|o>>>24,o=l.SBOX[o>>>24]<<24|l.SBOX[o>>>16&255]<<16|l.SBOX[o>>>8&255]<<8|l.SBOX[255&o],o^=a[n/t|0]<<24):t>6&&n%t===4&&(o=l.SBOX[o>>>24]<<24|l.SBOX[o>>>16&255]<<16|l.SBOX[o>>>8&255]<<8|l.SBOX[255&o]),r[n]=r[n-t]^o}for(var c=[],h=0;h<s;h++){var d=s-h,u=r[d-(h%4?0:4)];c[h]=h<4||d<=4?u:l.INV_SUB_MIX[0][l.SBOX[u>>>24]]^l.INV_SUB_MIX[1][l.SBOX[u>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[u>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&u]]}this._nRounds=i,this._keySchedule=r,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return o(e=r(e),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),i=s.allocUnsafe(16);return i.writeUInt32BE(t[0],0),i.writeUInt32BE(t[1],4),i.writeUInt32BE(t[2],8),i.writeUInt32BE(t[3],12),i},c.prototype.decryptBlock=function(e){var t=(e=r(e))[1];e[1]=e[3],e[3]=t;var i=o(e,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),n=s.allocUnsafe(16);return n.writeUInt32BE(i[0],0),n.writeUInt32BE(i[3],4),n.writeUInt32BE(i[2],8),n.writeUInt32BE(i[1],12),n},c.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},e.exports.AES=c},55801(e,t,i){var s=i(87088),r=i(56608).Buffer,n=i(36334),o=i(91193),a=i(60050),l=i(10460),c=i(56696);function h(e,t,i,o){n.call(this);var l=r.alloc(4,0);this._cipher=new s.AES(t);var h=this._cipher.encryptBlock(l);this._ghash=new a(h),i=function(e,t,i){if(12===t.length)return e._finID=r.concat([t,r.from([0,0,0,1])]),r.concat([t,r.from([0,0,0,2])]);var s=new a(i),n=t.length,o=n%16;s.update(t),o&&(o=16-o,s.update(r.alloc(o,0))),s.update(r.alloc(8,0));var l=8*n,h=r.alloc(8);h.writeUIntBE(l,0,8),s.update(h),e._finID=s.state;var d=r.from(e._finID);return c(d),d}(this,i,h),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(h,n),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=r.alloc(t,0),this._ghash.update(t))}this._called=!0;var i=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(i),this._len+=e.length,i},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=l(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var i=0;e.length!==t.length&&i++;for(var s=Math.min(e.length,t.length),r=0;r<s;++r)i+=e[r]^t[r];return i}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!r.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},h.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=h},15007(e,t,i){var s=i(85173),r=i(98733),n=i(3349);t.createCipher=t.Cipher=s.createCipher,t.createCipheriv=t.Cipheriv=s.createCipheriv,t.createDecipher=t.Decipher=r.createDecipher,t.createDecipheriv=t.Decipheriv=r.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(n)}},98733(e,t,i){var s=i(55801),r=i(56608).Buffer,n=i(76200),o=i(58116),a=i(36334),l=i(87088),c=i(51804);function h(e,t,i){a.call(this),this._cache=new d,this._last=void 0,this._cipher=new l.AES(t),this._prev=r.from(i),this._mode=e,this._autopadding=!0}function d(){this.cache=r.allocUnsafe(0)}function u(e,t,i){var a=n[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=r.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);if("string"==typeof t&&(t=r.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===a.type?new o(a.module,t,i,!0):"auth"===a.type?new s(a.module,t,i,!0):new h(a.module,t,i)}i(91193)(h,a),h.prototype._update=function(e){var t,i;this._cache.add(e);for(var s=[];t=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,t),s.push(i);return r.concat(s)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var i=-1;++i<t;)if(e[i+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=r.concat([this.cache,e])},d.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var i=n[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var s=c(t,!1,i.key,i.iv);return u(e,s.key,s.iv)},t.createDecipheriv=u},85173(e,t,i){var s=i(76200),r=i(55801),n=i(56608).Buffer,o=i(58116),a=i(36334),l=i(87088),c=i(51804);function h(e,t,i){a.call(this),this._cache=new u,this._cipher=new l.AES(t),this._prev=n.from(i),this._mode=e,this._autopadding=!0}i(91193)(h,a),h.prototype._update=function(e){var t,i;this._cache.add(e);for(var s=[];t=this._cache.get();)i=this._mode.encrypt(this,t),s.push(i);return n.concat(s)};var d=n.alloc(16,16);function u(){this.cache=n.allocUnsafe(0)}function p(e,t,i){var a=s[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=n.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof i&&(i=n.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===a.type?new o(a.module,t,i):"auth"===a.type?new r(a.module,t,i):new h(a.module,t,i)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=n.concat([this.cache,e])},u.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},u.prototype.flush=function(){for(var e=16-this.cache.length,t=n.allocUnsafe(e),i=-1;++i<e;)t.writeUInt8(e,i);return n.concat([this.cache,t])},t.createCipheriv=p,t.createCipher=function(e,t){var i=s[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var r=c(t,!1,i.key,i.iv);return p(e,r.key,r.iv)}},60050(e,t,i){var s=i(56608).Buffer,r=s.alloc(16,0);function n(e){var t=s.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=s.alloc(16,0),this.cache=s.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},o.prototype._multiply=function(){for(var e,t,i,s=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],r=[0,0,0,0],o=-1;++o<128;){for(!!(this.state[~~(o/8)]&1<<7-o%8)&&(r[0]^=s[0],r[1]^=s[1],r[2]^=s[2],r[3]^=s[3]),i=!!(1&s[3]),t=3;t>0;t--)s[t]=s[t]>>>1|(1&s[t-1])<<31;s[0]=s[0]>>>1,i&&(s[0]=s[0]^225<<24)}this.state=n(r)},o.prototype.update=function(e){var t;for(this.cache=s.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(s.concat([this.cache,r],16)),this.ghash(n([0,e,0,t])),this.state},e.exports=o},56696(e){e.exports=function(e){for(var t,i=e.length;i--;){if(255!==(t=e.readUInt8(i))){t++,e.writeUInt8(t,i);break}e.writeUInt8(0,i)}}},98268(e,t,i){var s=i(10460);t.encrypt=function(e,t){var i=s(t,e._prev);return e._prev=e._cipher.encryptBlock(i),e._prev},t.decrypt=function(e,t){var i=e._prev;e._prev=t;var r=e._cipher.decryptBlock(t);return s(r,i)}},56149(e,t,i){var s=i(56608).Buffer,r=i(10460);function n(e,t,i){var n=t.length,o=r(t,e._cache);return e._cache=e._cache.slice(n),e._prev=s.concat([e._prev,i?t:o]),o}t.encrypt=function(e,t,i){for(var r,o=s.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=s.allocUnsafe(0)),!(e._cache.length<=t.length)){o=s.concat([o,n(e,t,i)]);break}r=e._cache.length,o=s.concat([o,n(e,t.slice(0,r),i)]),t=t.slice(r)}return o}},68394(e,t,i){var s=i(56608).Buffer;function r(e,t,i){for(var s,r,o=-1,a=0;++o<8;)s=t&1<<7-o?128:0,a+=(128&(r=e._cipher.encryptBlock(e._prev)[0]^s))>>o%8,e._prev=n(e._prev,i?s:r);return a}function n(e,t){var i=e.length,r=-1,n=s.allocUnsafe(e.length);for(e=s.concat([e,s.from([t])]);++r<i;)n[r]=e[r]<<1|e[r+1]>>7;return n}t.encrypt=function(e,t,i){for(var n=t.length,o=s.allocUnsafe(n),a=-1;++a<n;)o[a]=r(e,t[a],i);return o}},20193(e,t,i){var s=i(56608).Buffer;function r(e,t,i){var r=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=s.concat([e._prev.slice(1),s.from([i?t:r])]),r}t.encrypt=function(e,t,i){for(var n=t.length,o=s.allocUnsafe(n),a=-1;++a<n;)o[a]=r(e,t[a],i);return o}},5527(e,t,i){var s=i(10460),r=i(56608).Buffer,n=i(56696);function o(e){var t=e._cipher.encryptBlockRaw(e._prev);return n(e._prev),t}t.encrypt=function(e,t){var i=Math.ceil(t.length/16),n=e._cache.length;e._cache=r.concat([e._cache,r.allocUnsafe(16*i)]);for(var a=0;a<i;a++){var l=o(e),c=n+16*a;e._cache.writeUInt32BE(l[0],c+0),e._cache.writeUInt32BE(l[1],c+4),e._cache.writeUInt32BE(l[2],c+8),e._cache.writeUInt32BE(l[3],c+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),s(t,h)}},60882(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},76200(e,t,i){var s={ECB:i(60882),CBC:i(98268),CFB:i(56149),CFB8:i(20193),CFB1:i(68394),OFB:i(37481),CTR:i(5527),GCM:i(5527)},r=i(3349);for(var n in r)r[n].module=s[r[n].mode];e.exports=r},37481(e,t,i){var s=i(10460);function r(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=Buffer.concat([e._cache,r(e)]);var i=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),s(t,i)}},58116(e,t,i){var s=i(87088),r=i(56608).Buffer,n=i(36334);function o(e,t,i,o){n.call(this),this._cipher=new s.AES(t),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=o,this._mode=e}i(91193)(o,n),o.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},e.exports=o},18350(e,t,i){var s=i(34487),r=i(15007),n=i(76200),o=i(13811),a=i(51804);function l(e,t,i){if(e=e.toLowerCase(),n[e])return r.createCipheriv(e,t,i);if(o[e])return new s({key:t,iv:i,mode:e});throw new TypeError("invalid suite type")}function c(e,t,i){if(e=e.toLowerCase(),n[e])return r.createDecipheriv(e,t,i);if(o[e])return new s({key:t,iv:i,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var i,s;if(e=e.toLowerCase(),n[e])i=n[e].key,s=n[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");i=8*o[e].key,s=o[e].iv}var r=a(t,!1,i,s);return l(e,r.key,r.iv)},t.createCipheriv=t.Cipheriv=l,t.createDecipher=t.Decipher=function(e,t){var i,s;if(e=e.toLowerCase(),n[e])i=n[e].key,s=n[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");i=8*o[e].key,s=o[e].iv}var r=a(t,!1,i,s);return c(e,r.key,r.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(o).concat(r.getCiphers())}},34487(e,t,i){var s=i(36334),r=i(88754),n=i(91193),o=i(56608).Buffer,a={"des-ede3-cbc":r.CBC.instantiate(r.EDE),"des-ede3":r.EDE,"des-ede-cbc":r.CBC.instantiate(r.EDE),"des-ede":r.EDE,"des-cbc":r.CBC.instantiate(r.DES),"des-ecb":r.DES};function l(e){s.call(this);var t,i=e.mode.toLowerCase(),r=a[i];t=e.decrypt?"decrypt":"encrypt";var n=e.key;o.isBuffer(n)||(n=o.from(n)),"des-ede"!==i&&"des-ede-cbc"!==i||(n=o.concat([n,n.slice(0,8)]));var l=e.iv;o.isBuffer(l)||(l=o.from(l)),this._des=r.create({key:n,iv:l,type:t})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=l,n(l,s),l.prototype._update=function(e){return o.from(this._des.update(e))},l.prototype._final=function(){return o.from(this._des.final())}},13811(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},38538(e,t,i){"use strict";var s=i(39286),r=i(82869),n=i(56608).Buffer;function o(e){var t,i=e.modulus.byteLength();do{t=new s(r(i))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,t){var i=function(e){var t=o(e);return{blinder:t.toRed(s.mont(e.modulus)).redPow(new s(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),r=t.modulus.byteLength(),a=new s(e).mul(i.blinder).umod(t.modulus),l=a.toRed(s.mont(t.prime1)),c=a.toRed(s.mont(t.prime2)),h=t.coefficient,d=t.prime1,u=t.prime2,p=l.redPow(t.exponent1).fromRed(),g=c.redPow(t.exponent2).fromRed(),m=p.isub(g).imul(h).umod(d).imul(u);return g.iadd(m).imul(i.unblinder).umod(t.modulus).toArrayLike(n,"be",r)}a.getr=o,e.exports=a},92761(e,t,i){"use strict";e.exports=i(8049)},80206(e,t,i){"use strict";var s=i(56608).Buffer,r=i(18955),n=i(9464),o=i(91193),a=i(76853),l=i(24757),c=i(8049);function h(e){n.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){n.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){return new h(e)}function p(e){return new d(e)}Object.keys(c).forEach(function(e){c[e].id=s.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),o(h,n.Writable),h.prototype._write=function(e,t,i){this._hash.update(e),i()},h.prototype.update=function(e,t){return this._hash.update("string"==typeof e?s.from(e,t):e),this},h.prototype.sign=function(e,t){this.end();var i=this._hash.digest(),s=a(i,e,this._hashType,this._signType,this._tag);return t?s.toString(t):s},o(d,n.Writable),d.prototype._write=function(e,t,i){this._hash.update(e),i()},d.prototype.update=function(e,t){return this._hash.update("string"==typeof e?s.from(e,t):e),this},d.prototype.verify=function(e,t,i){var r="string"==typeof t?s.from(t,i):t;this.end();var n=this._hash.digest();return l(r,n,e,this._signType,this._tag)},e.exports={Sign:u,Verify:p,createSign:u,createVerify:p}},76853(e,t,i){"use strict";var s=i(56608).Buffer,r=i(33053),n=i(38538),o=i(23071).ec,a=i(39286),l=i(21973),c=i(32279);function h(e,t,i,n){if((e=s.from(e.toArray())).length<t.byteLength()){var o=s.alloc(t.byteLength()-e.length);e=s.concat([o,e])}var a=i.length,l=function(e,t){e=(e=d(e,t)).mod(t);var i=s.from(e.toArray());if(i.length<t.byteLength()){var r=s.alloc(t.byteLength()-i.length);i=s.concat([r,i])}return i}(i,t),c=s.alloc(a);c.fill(1);var h=s.alloc(a);return h=r(n,h).update(c).update(s.from([0])).update(e).update(l).digest(),c=r(n,h).update(c).digest(),{k:h=r(n,h).update(c).update(s.from([1])).update(e).update(l).digest(),v:c=r(n,h).update(c).digest()}}function d(e,t){var i=new a(e),s=(e.length<<3)-t.bitLength();return s>0&&i.ishrn(s),i}function u(e,t,i){var n,o;do{for(n=s.alloc(0);8*n.length<e.bitLength();)t.v=r(i,t.k).update(t.v).digest(),n=s.concat([n,t.v]);o=d(n,e),t.k=r(i,t.k).update(t.v).update(s.from([0])).digest(),t.v=r(i,t.k).update(t.v).digest()}while(-1!==o.cmp(e));return o}function p(e,t,i,s){return e.toRed(a.mont(i)).redPow(t).fromRed().mod(s)}e.exports=function(e,t,i,r,g){var m=l(t);if(m.curve){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");return function(e,t){var i=c[t.curve.join(".")];if(!i)throw new Error("unknown curve "+t.curve.join("."));var r=new o(i).keyFromPrivate(t.privateKey).sign(e);return s.from(r.toDER())}(e,m)}if("dsa"===m.type){if("dsa"!==r)throw new Error("wrong private key type");return function(e,t,i){for(var r,n=t.params.priv_key,o=t.params.p,l=t.params.q,c=t.params.g,g=new a(0),m=d(e,l).mod(l),f=!1,y=h(n,l,e,i);!1===f;)g=p(c,r=u(l,y,i),o,l),0===(f=r.invm(l).imul(m.add(n.mul(g))).mod(l)).cmpn(0)&&(f=!1,g=new a(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var i=[48,e.length+t.length+4,2,e.length];return i=i.concat(e,[2,t.length],t),s.from(i)}(g,f)}(e,m,i)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");if(void 0!==t.padding&&1!==t.padding)throw new Error("illegal or unsupported padding mode");e=s.concat([g,e]);for(var f=m.modulus.byteLength(),y=[0,1];e.length+y.length+1<f;)y.push(255);y.push(0);for(var v=-1;++v<e.length;)y.push(e[v]);return n(y,m)},e.exports.getKey=h,e.exports.makeKey=u},24757(e,t,i){"use strict";var s=i(56608).Buffer,r=i(39286),n=i(23071).ec,o=i(21973),a=i(32279);function l(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=0)throw new Error("invalid sig")}e.exports=function(e,t,i,c,h){var d=o(i);if("ec"===d.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,i){var s=a[i.data.algorithm.curve.join(".")];if(!s)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var r=new n(s),o=i.data.subjectPrivateKey.data;return r.verify(t,e,o)}(e,t,d)}if("dsa"===d.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,i){var s=i.data.p,n=i.data.q,a=i.data.g,c=i.data.pub_key,h=o.signature.decode(e,"der"),d=h.s,u=h.r;l(d,n),l(u,n);var p=r.mont(s),g=d.invm(n);return 0===a.toRed(p).redPow(new r(t).mul(g).mod(n)).fromRed().mul(c.toRed(p).redPow(u.mul(g).mod(n)).fromRed()).mod(s).mod(n).cmp(u)}(e,t,d)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=s.concat([h,t]);for(var u=d.modulus.byteLength(),p=[1],g=0;t.length+p.length+2<u;)p.push(255),g+=1;p.push(0);for(var m=-1;++m<t.length;)p.push(t[m]);p=s.from(p);var f=r.mont(d.modulus);e=(e=new r(e).toRed(f)).redPow(new r(d.publicExponent)),e=s.from(e.fromRed().toArray());var y=g<8?1:0;for(u=Math.min(e.length,p.length),e.length!==p.length&&(y=1),m=-1;++m<u;)y|=e[m]^p[m];return 0===y}},10460(e){e.exports=function(e,t){for(var i=Math.min(e.length,t.length),s=new Buffer(i),r=0;r<i;++r)s[r]=e[r]^t[r];return s}},51999(e,t,i){"use strict";var s=i(84933),r=i(63328),n=i(85101);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,i)}function c(e,t,i,s){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,s){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(s||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===s?new Uint8Array(t):void 0===s?new Uint8Array(t,i):new Uint8Array(t,i,s),l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=u(e,t),e}(e,t,i,s):"string"==typeof t?function(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var s=0|g(t,i),r=(e=a(e,s)).write(t,i);return r!==s&&(e=e.slice(0,r)),e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|p(t.length);return 0===(e=a(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(s=t.length)!=s?a(e,0):u(e,t);if("Buffer"===t.type&&n(t.data))return u(e,t.data)}var s;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(h(t),e=a(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function u(e,t){var i=t.length<0?0:0|p(t.length);e=a(e,i);for(var s=0;s<i;s+=1)e[s]=255&t[s];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return U(e).length;default:if(s)return H(e).length;t=(""+t).toLowerCase(),s=!0}}function m(e,t,i){var s=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,i);case"utf8":case"utf-8":return A(this,t,i);case"ascii":return D(this,t,i);case"latin1":case"binary":return I(this,t,i);case"base64":return M(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function f(e,t,i){var s=e[t];e[t]=e[i],e[i]=s}function y(e,t,i,s,r){if(0===e.length)return-1;if("string"==typeof i?(s=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=l.from(t,s)),l.isBuffer(t))return 0===t.length?-1:v(e,t,i,s,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):v(e,[t],i,s,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,i,s,r){var n,o=1,a=e.length,l=t.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(n=i;n<a;n++)if(c(e,n)===c(t,-1===h?0:n-h)){if(-1===h&&(h=n),n-h+1===l)return h*o}else-1!==h&&(n-=n-h),h=-1}else for(i+l>a&&(i=a-l),n=i;n>=0;n--){for(var d=!0,u=0;u<l;u++)if(c(e,n+u)!==c(t,u)){d=!1;break}if(d)return n}return-1}function C(e,t,i,s){i=Number(i)||0;var r=e.length-i;s?(s=Number(s))>r&&(s=r):s=r;var n=t.length;if(n%2!=0)throw new TypeError("Invalid hex string");s>n/2&&(s=n/2);for(var o=0;o<s;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[i+o]=a}return o}function b(e,t,i,s){return z(H(t,e.length-i),e,i,s)}function S(e,t,i,s){return z(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,s)}function w(e,t,i,s){return S(e,t,i,s)}function x(e,t,i,s){return z(U(t),e,i,s)}function E(e,t,i,s){return z(function(e,t){for(var i,s,r,n=[],o=0;o<e.length&&!((t-=2)<0);++o)s=(i=e.charCodeAt(o))>>8,r=i%256,n.push(r),n.push(s);return n}(t,e.length-i),e,i,s)}function M(e,t,i){return 0===t&&i===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(t,i))}function A(e,t,i){i=Math.min(e.length,i);for(var s=[],r=t;r<i;){var n,o,a,l,c=e[r],h=null,d=c>239?4:c>223?3:c>191?2:1;if(r+d<=i)switch(d){case 1:c<128&&(h=c);break;case 2:128==(192&(n=e[r+1]))&&(l=(31&c)<<6|63&n)>127&&(h=l);break;case 3:n=e[r+1],o=e[r+2],128==(192&n)&&128==(192&o)&&(l=(15&c)<<12|(63&n)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[r+1],o=e[r+2],a=e[r+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,d=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|1023&h),s.push(h),r+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var i="",s=0;s<t;)i+=String.fromCharCode.apply(String,e.slice(s,s+=T));return i}(s)}t.hp=l,t.IS=50,l.TYPED_ARRAY_SUPPORT=void 0!==globalThis.TYPED_ARRAY_SUPPORT?globalThis.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,s){return h(t),t<=0?a(e,t):void 0!==i?"string"==typeof s?a(e,t).fill(i,s):a(e,t).fill(i):a(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,s=t.length,r=0,n=Math.min(i,s);r<n;++r)if(e[r]!==t[r]){i=e[r],s=t[r];break}return i<s?-1:s<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!n(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var s=l.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(s,r),r+=o.length}return s},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.IS;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,s,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===s&&(s=0),void 0===r&&(r=this.length),t<0||i>e.length||s<0||r>this.length)throw new RangeError("out of range index");if(s>=r&&t>=i)return 0;if(s>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var n=(r>>>=0)-(s>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(n,o),c=this.slice(s,r),h=e.slice(t,i),d=0;d<a;++d)if(c[d]!==h[d]){n=c[d],o=h[d];break}return n<o?-1:o<n?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},l.prototype.write=function(e,t,i,s){if(void 0===t)s="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)s=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===s&&(s="utf8")):(s=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var n=!1;;)switch(s){case"hex":return C(this,e,t,i);case"utf8":case"utf-8":return b(this,e,t,i);case"ascii":return S(this,e,t,i);case"latin1":case"binary":return w(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,i);default:if(n)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),n=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function D(e,t,i){var s="";i=Math.min(e.length,i);for(var r=t;r<i;++r)s+=String.fromCharCode(127&e[r]);return s}function I(e,t,i){var s="";i=Math.min(e.length,i);for(var r=t;r<i;++r)s+=String.fromCharCode(e[r]);return s}function R(e,t,i){var s=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>s)&&(i=s);for(var r="",n=t;n<i;++n)r+=V(e[n]);return r}function P(e,t,i){for(var s=e.slice(t,i),r="",n=0;n<s.length;n+=2)r+=String.fromCharCode(s[n]+256*s[n+1]);return r}function k(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,i,s,r,n){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<n)throw new RangeError('"value" argument is out of bounds');if(i+s>e.length)throw new RangeError("Index out of range")}function N(e,t,i,s){t<0&&(t=65535+t+1);for(var r=0,n=Math.min(e.length-i,2);r<n;++r)e[i+r]=(t&255<<8*(s?r:1-r))>>>8*(s?r:1-r)}function _(e,t,i,s){t<0&&(t=4294967295+t+1);for(var r=0,n=Math.min(e.length-i,4);r<n;++r)e[i+r]=t>>>8*(s?r:3-r)&255}function O(e,t,i,s,r,n){if(i+s>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function F(e,t,i,s,n){return n||O(e,0,i,4),r.write(e,t,i,s,23,4),i+4}function G(e,t,i,s,n){return n||O(e,0,i,8),r.write(e,t,i,s,52,8),i+8}l.prototype.slice=function(e,t){var i,s=this.length;if((e=~~e)<0?(e+=s)<0&&(e=0):e>s&&(e=s),(t=void 0===t?s:~~t)<0?(t+=s)<0&&(t=0):t>s&&(t=s),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var r=t-e;i=new l(r,void 0);for(var n=0;n<r;++n)i[n]=this[n+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||k(e,t,this.length);for(var s=this[e],r=1,n=0;++n<t&&(r*=256);)s+=this[e+n]*r;return s},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||k(e,t,this.length);for(var s=this[e+--t],r=1;t>0&&(r*=256);)s+=this[e+--t]*r;return s},l.prototype.readUInt8=function(e,t){return t||k(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||k(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||k(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||k(e,t,this.length);for(var s=this[e],r=1,n=0;++n<t&&(r*=256);)s+=this[e+n]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||k(e,t,this.length);for(var s=t,r=1,n=this[e+--s];s>0&&(r*=256);)n+=this[e+--s]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readInt8=function(e,t){return t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||k(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||k(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||k(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||k(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||k(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||k(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,s){e=+e,t|=0,i|=0,s||L(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,n=0;for(this[t]=255&e;++n<i&&(r*=256);)this[t+n]=e/r&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,s){e=+e,t|=0,i|=0,s||L(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,n=1;for(this[t+r]=255&e;--r>=0&&(n*=256);)this[t+r]=e/n&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,s){if(e=+e,t|=0,!s){var r=Math.pow(2,8*i-1);L(this,e,t,i,r-1,-r)}var n=0,o=1,a=0;for(this[t]=255&e;++n<i&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},l.prototype.writeIntBE=function(e,t,i,s){if(e=+e,t|=0,!s){var r=Math.pow(2,8*i-1);L(this,e,t,i,r-1,-r)}var n=i-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return F(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return F(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return G(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return G(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,s){if(i||(i=0),s||0===s||(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<i&&(s=i),s===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-i&&(s=e.length-t+i);var r,n=s-i;if(this===e&&i<t&&t<s)for(r=n-1;r>=0;--r)e[r+t]=this[r+i];else if(n<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<n;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+n),t);return n},l.prototype.fill=function(e,t,i,s){if("string"==typeof e){if("string"==typeof t?(s=t,t=0,i=this.length):"string"==typeof i&&(s=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!l.isEncoding(s))throw new TypeError("Unknown encoding: "+s)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var n;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(n=t;n<i;++n)this[n]=e;else{var o=l.isBuffer(e)?e:H(new l(e,s).toString()),a=o.length;for(n=0;n<i-t;++n)this[n+t]=o[n%a]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function V(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var i;t=t||1/0;for(var s=e.length,r=null,n=[],o=0;o<s;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===s){(t-=3)>-1&&n.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&n.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return n}function U(e){return s.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,i,s){for(var r=0;r<s&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}},77511(e,t,i){"use strict";var s=i(84933),r=i(63328),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;var o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,i)}function c(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|m(e,t),s=a(i),r=s.write(e,t);return r!==i&&(s=s.slice(0,r)),s}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return p(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return p(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return l.from(s,t,i);var r=function(e){if(l.isBuffer(e)){var t=0|g(e.length),i=a(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?a(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),a(e<0?0:0|g(e))}function u(e){for(var t=e.length<0?0:0|g(e.length),i=a(t),s=0;s<t;s+=1)i[s]=255&e[s];return i}function p(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var s;return s=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),Object.setPrototypeOf(s,l.prototype),s}function g(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,s=arguments.length>2&&!0===arguments[2];if(!s&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return V(e).length;default:if(r)return s?-1:B(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,i){var s=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,i);case"utf8":case"utf-8":return T(this,t,i);case"ascii":return I(this,t,i);case"latin1":case"binary":return R(this,t,i);case"base64":return A(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function y(e,t,i){var s=e[t];e[t]=e[i],e[i]=s}function v(e,t,i,s,r){if(0===e.length)return-1;if("string"==typeof i?(s=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),z(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=l.from(t,s)),l.isBuffer(t))return 0===t.length?-1:C(e,t,i,s,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):C(e,[t],i,s,r);throw new TypeError("val must be string, number or Buffer")}function C(e,t,i,s,r){var n,o=1,a=e.length,l=t.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(n=i;n<a;n++)if(c(e,n)===c(t,-1===h?0:n-h)){if(-1===h&&(h=n),n-h+1===l)return h*o}else-1!==h&&(n-=n-h),h=-1}else for(i+l>a&&(i=a-l),n=i;n>=0;n--){for(var d=!0,u=0;u<l;u++)if(c(e,n+u)!==c(t,u)){d=!1;break}if(d)return n}return-1}function b(e,t,i,s){i=Number(i)||0;var r=e.length-i;s?(s=Number(s))>r&&(s=r):s=r;var n=t.length;s>n/2&&(s=n/2);for(var o=0;o<s;++o){var a=parseInt(t.substr(2*o,2),16);if(z(a))return o;e[i+o]=a}return o}function S(e,t,i,s){return H(B(t,e.length-i),e,i,s)}function w(e,t,i,s){return H(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,s)}function x(e,t,i,s){return w(e,t,i,s)}function E(e,t,i,s){return H(V(t),e,i,s)}function M(e,t,i,s){return H(function(e,t){for(var i,s,r,n=[],o=0;o<e.length&&!((t-=2)<0);++o)s=(i=e.charCodeAt(o))>>8,r=i%256,n.push(r),n.push(s);return n}(t,e.length-i),e,i,s)}function A(e,t,i){return 0===t&&i===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(t,i))}function T(e,t,i){i=Math.min(e.length,i);for(var s=[],r=t;r<i;){var n,o,a,l,c=e[r],h=null,d=c>239?4:c>223?3:c>191?2:1;if(r+d<=i)switch(d){case 1:c<128&&(h=c);break;case 2:128==(192&(n=e[r+1]))&&(l=(31&c)<<6|63&n)>127&&(h=l);break;case 3:n=e[r+1],o=e[r+2],128==(192&n)&&128==(192&o)&&(l=(15&c)<<12|(63&n)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[r+1],o=e[r+2],a=e[r+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,d=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|1023&h),s.push(h),r+=d}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);for(var i="",s=0;s<t;)i+=String.fromCharCode.apply(String,e.slice(s,s+=D));return i}(s)}t.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,i){return c(e,t,i)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,i){return function(e,t,i){return h(e),e<=0?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)}(e,t,i)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(U(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,s=t.length,r=0,n=Math.min(i,s);r<n;++r)if(e[r]!==t[r]){i=e[r],s=t[r];break}return i<s?-1:s<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var s=l.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var n=e[i];if(U(n,Uint8Array)&&(n=l.from(n)),!l.isBuffer(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(s,r),r+=n.length}return s},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):f.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(e,t,i,s,r){if(U(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===s&&(s=0),void 0===r&&(r=this.length),t<0||i>e.length||s<0||r>this.length)throw new RangeError("out of range index");if(s>=r&&t>=i)return 0;if(s>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var n=(r>>>=0)-(s>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(n,o),c=this.slice(s,r),h=e.slice(t,i),d=0;d<a;++d)if(c[d]!==h[d]){n=c[d],o=h[d];break}return n<o?-1:o<n?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return v(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return v(this,e,t,i,!1)},l.prototype.write=function(e,t,i,s){if(void 0===t)s="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)s=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===s&&(s="utf8")):(s=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var n=!1;;)switch(s){case"hex":return b(this,e,t,i);case"utf8":case"utf-8":return S(this,e,t,i);case"ascii":return w(this,e,t,i);case"latin1":case"binary":return x(this,e,t,i);case"base64":return E(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,i);default:if(n)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),n=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,i){var s="";i=Math.min(e.length,i);for(var r=t;r<i;++r)s+=String.fromCharCode(127&e[r]);return s}function R(e,t,i){var s="";i=Math.min(e.length,i);for(var r=t;r<i;++r)s+=String.fromCharCode(e[r]);return s}function P(e,t,i){var s=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>s)&&(i=s);for(var r="",n=t;n<i;++n)r+=W[e[n]];return r}function k(e,t,i){for(var s=e.slice(t,i),r="",n=0;n<s.length;n+=2)r+=String.fromCharCode(s[n]+256*s[n+1]);return r}function L(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,i,s,r,n){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<n)throw new RangeError('"value" argument is out of bounds');if(i+s>e.length)throw new RangeError("Index out of range")}function _(e,t,i,s,r,n){if(i+s>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function O(e,t,i,s,n){return t=+t,i>>>=0,n||_(e,0,i,4),r.write(e,t,i,s,23,4),i+4}function F(e,t,i,s,n){return t=+t,i>>>=0,n||_(e,0,i,8),r.write(e,t,i,s,52,8),i+8}l.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var s=this.subarray(e,t);return Object.setPrototypeOf(s,l.prototype),s},l.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||L(e,t,this.length);for(var s=this[e],r=1,n=0;++n<t&&(r*=256);)s+=this[e+n]*r;return s},l.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||L(e,t,this.length);for(var s=this[e+--t],r=1;t>0&&(r*=256);)s+=this[e+--t]*r;return s},l.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||L(e,t,this.length);for(var s=this[e],r=1,n=0;++n<t&&(r*=256);)s+=this[e+n]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},l.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||L(e,t,this.length);for(var s=t,r=1,n=this[e+--s];s>0&&(r*=256);)n+=this[e+--s]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,s){e=+e,t>>>=0,i>>>=0,s||N(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,n=0;for(this[t]=255&e;++n<i&&(r*=256);)this[t+n]=e/r&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,s){e=+e,t>>>=0,i>>>=0,s||N(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,n=1;for(this[t+r]=255&e;--r>=0&&(n*=256);)this[t+r]=e/n&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,i,s){if(e=+e,t>>>=0,!s){var r=Math.pow(2,8*i-1);N(this,e,t,i,r-1,-r)}var n=0,o=1,a=0;for(this[t]=255&e;++n<i&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},l.prototype.writeIntBE=function(e,t,i,s){if(e=+e,t>>>=0,!s){var r=Math.pow(2,8*i-1);N(this,e,t,i,r-1,-r)}var n=i-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,i){return O(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return O(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return F(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return F(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,s){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),s||0===s||(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<i&&(s=i),s===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-i&&(s=e.length-t+i);var r=s-i;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,i,s);else if(this===e&&i<t&&t<s)for(var n=r-1;n>=0;--n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,s),t);return r},l.prototype.fill=function(e,t,i,s){if("string"==typeof e){if("string"==typeof t?(s=t,t=0,i=this.length):"string"==typeof i&&(s=i,i=this.length),void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!l.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(1===e.length){var r=e.charCodeAt(0);("utf8"===s&&r<128||"latin1"===s)&&(e=r)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var n;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(n=t;n<i;++n)this[n]=e;else{var o=l.isBuffer(e)?e:l.from(e,s),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<i-t;++n)this[n+t]=o[n%a]}return this};var G=/[^+/0-9A-Za-z-_]/g;function B(e,t){var i;t=t||1/0;for(var s=e.length,r=null,n=[],o=0;o<s;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===s){(t-=3)>-1&&n.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&n.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return n}function V(e){return s.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,i,s){for(var r=0;r<s&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var W=function(){for(var e="0123456789abcdef",t=new Array(256),i=0;i<16;++i)for(var s=16*i,r=0;r<16;++r)t[s+r]=e[i]+e[r];return t}()},97785(e,t,i){"use strict";var s=i(79524),r=i(64811),n=i(46255),o=i(12728);e.exports=o||s.call(n,r)},96440(e,t,i){"use strict";var s=i(79524),r=i(64811),n=i(97785);e.exports=function(){return n(s,r,arguments)}},64811(e){"use strict";e.exports=Function.prototype.apply},46255(e){"use strict";e.exports=Function.prototype.call},92427(e,t,i){"use strict";var s=i(79524),r=i(71102),n=i(46255),o=i(97785);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new r("a function is required");return o(s,n,e)}},12728(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},17695(e,t,i){"use strict";var s=i(7755),r=i(39886),n=i(92427),o=i(96440);e.exports=function(e){var t=n(arguments),i=e.length-(arguments.length-1);return s(t,1+(i>0?i:0),!0)},r?r(e.exports,"apply",{value:o}):e.exports.apply=o},98801(e,t,i){"use strict";var s=i(49336),r=i(92427),n=r([s("%String.prototype.indexOf%")]);e.exports=function(e,t){var i=s(e,!!t);return"function"==typeof i&&n(e,".prototype.")>-1?r([i]):i}},36334(e,t,i){"use strict";var s=i(56608).Buffer,r=i(66096).Transform,n=i(64323).I,o=i(91193),a=i(26919);function l(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}o(l,r),l.prototype.update=function(e,t,i){var s=a(e,t),r=this._update(s);return this.hashMode?this:(i&&(r=this._toString(r,i)),r)},l.prototype.setAutoPadding=function(){},l.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},l.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},l.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},l.prototype._transform=function(e,t,i){var s;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){s=e}finally{i(s)}},l.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},l.prototype._finalOrDigest=function(e){var t=this.__final()||s.alloc(0);return e&&(t=this._toString(t,e,!0)),t},l.prototype._toString=function(e,t,i){if(this._decoder||(this._decoder=new n(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var s=this._decoder.write(e);return i&&(s+=this._decoder.end()),s},e.exports=l},44477(e){function t(){return new DOMException("The request is not allowed","NotAllowedError")}e.exports=async function(e){try{await async function(e){if(!navigator.clipboard)throw t();return navigator.clipboard.writeText(e)}(e)}catch(i){try{await async function(e){const i=document.createElement("span");i.textContent=e,i.style.whiteSpace="pre",i.style.webkitUserSelect="auto",i.style.userSelect="all",document.body.appendChild(i);const s=window.getSelection(),r=window.document.createRange();s.removeAllRanges(),r.selectNode(i),s.addRange(r);let n=!1;try{n=window.document.execCommand("copy")}finally{s.removeAllRanges(),window.document.body.removeChild(i)}if(!n)throw t()}(e)}catch(e){throw e||i||t()}}}},35284(e,t,i){"use strict";function s(e){var t,i,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(i=s(e[t]))&&(r&&(r+=" "),r+=i);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}i.d(t,{A:()=>r});const r=function(){for(var e,t,i=0,r="";i<arguments.length;)(e=arguments[i++])&&(t=s(e))&&(r&&(r+=" "),r+=t);return r}},89901(e){function t(e){var i,s,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(i=0;i<n;i++)e[i]&&(s=t(e[i]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function i(){for(var e,i,s=0,r="",n=arguments.length;s<n;s++)(e=arguments[s])&&(i=t(e))&&(r&&(r+=" "),r+=i);return r}e.exports=i,e.exports.clsx=i},50703(e){"use strict";e.exports=function(e){return String(e).replace(/\s+/g," ")}},99448(e,t){"use strict";t.q=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var s={},r=t||{},o=e.split(";"),a=r.decode||i,l=0;l<o.length;l++){var c=o[l],h=c.indexOf("=");if(!(h<0)){var d=c.substring(0,h).trim();if(null==s[d]){var u=c.substring(h+1,c.length).trim();'"'===u[0]&&(u=u.slice(1,-1)),s[d]=n(u,a)}}}return s},t.l=function(e,t,i){var n=i||{},o=n.encode||s;if("function"!=typeof o)throw new TypeError("option encode is invalid");if(!r.test(e))throw new TypeError("argument name is invalid");var a=o(t);if(a&&!r.test(a))throw new TypeError("argument val is invalid");var l=e+"="+a;if(null!=n.maxAge){var c=n.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(c)}if(n.domain){if(!r.test(n.domain))throw new TypeError("option domain is invalid");l+="; Domain="+n.domain}if(n.path){if(!r.test(n.path))throw new TypeError("option path is invalid");l+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");l+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l};var i=decodeURIComponent,s=encodeURIComponent,r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function n(e,t){try{return t(e)}catch(t){return e}}},85877(e,t,i){i(2903),e.exports=i(96595).Object.assign},13112(e,t,i){i(81026);var s=i(96595).Object;e.exports=function(e,t){return s.create(e,t)}},30481(e,t,i){i(92611);var s=i(96595).Object;e.exports=function(e,t,i){return s.defineProperty(e,t,i)}},18307(e,t,i){i(95029),e.exports=i(96595).Object.getPrototypeOf},55111(e,t,i){i(74537),e.exports=i(96595).Object.setPrototypeOf},27773(e,t,i){i(63977),i(83149),i(78993),i(50237),e.exports=i(96595).Symbol},63315(e,t,i){i(91210),i(75505),e.exports=i(36063).f("iterator")},30322(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},51453(e){e.exports=function(){}},44655(e,t,i){var s=i(17482);e.exports=function(e){if(!s(e))throw TypeError(e+" is not an object!");return e}},2473(e,t,i){var s=i(51552),r=i(14326),n=i(23138);e.exports=function(e){return function(t,i,o){var a,l=s(t),c=r(l.length),h=n(o,c);if(e&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===i)return e||h||0;return!e&&-1}}},6486(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},96595(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},64015(e,t,i){var s=i(30322);e.exports=function(e,t,i){if(s(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,s){return e.call(t,i,s)};case 3:return function(i,s,r){return e.call(t,i,s,r)}}return function(){return e.apply(t,arguments)}}},77095(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},27828(e,t,i){e.exports=!i(58599)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},35299(e,t,i){var s=i(17482),r=i(79747).document,n=s(r)&&s(r.createElement);e.exports=function(e){return n?r.createElement(e):{}}},46527(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},94618(e,t,i){var s=i(46936),r=i(62951),n=i(60092);e.exports=function(e){var t=s(e),i=r.f;if(i)for(var o,a=i(e),l=n.f,c=0;a.length>c;)l.call(e,o=a[c++])&&t.push(o);return t}},9102(e,t,i){var s=i(79747),r=i(96595),n=i(64015),o=i(48324),a=i(21998),l="prototype",c=function(e,t,i){var h,d,u,p=e&c.F,g=e&c.G,m=e&c.S,f=e&c.P,y=e&c.B,v=e&c.W,C=g?r:r[t]||(r[t]={}),b=C[l],S=g?s:m?s[t]:(s[t]||{})[l];for(h in g&&(i=t),i)(d=!p&&S&&void 0!==S[h])&&a(C,h)||(u=d?S[h]:i[h],C[h]=g&&"function"!=typeof S[h]?i[h]:y&&d?n(u,s):v&&S[h]==u?function(e){var t=function(t,i,s){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,i)}return new e(t,i,s)}return e.apply(this,arguments)};return t[l]=e[l],t}(u):f&&"function"==typeof u?n(Function.call,u):u,f&&((C.virtual||(C.virtual={}))[h]=u,e&c.R&&b&&!b[h]&&o(b,h,u)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},58599(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},79747(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},21998(e){var t={}.hasOwnProperty;e.exports=function(e,i){return t.call(e,i)}},48324(e,t,i){var s=i(10788),r=i(25995);e.exports=i(27828)?function(e,t,i){return s.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},31349(e,t,i){var s=i(79747).document;e.exports=s&&s.documentElement},27941(e,t,i){e.exports=!i(27828)&&!i(58599)(function(){return 7!=Object.defineProperty(i(35299)("div"),"a",{get:function(){return 7}}).a})},6234(e,t,i){var s=i(6486);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==s(e)?e.split(""):Object(e)}},39984(e,t,i){var s=i(6486);e.exports=Array.isArray||function(e){return"Array"==s(e)}},17482(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},36099(e,t,i){"use strict";var s=i(69840),r=i(25995),n=i(26343),o={};i(48324)(o,i(78161)("iterator"),function(){return this}),e.exports=function(e,t,i){e.prototype=s(o,{next:r(1,i)}),n(e,t+" Iterator")}},14520(e,t,i){"use strict";var s=i(75549),r=i(9102),n=i(10058),o=i(48324),a=i(71813),l=i(36099),c=i(26343),h=i(23218),d=i(78161)("iterator"),u=!([].keys&&"next"in[].keys()),p="keys",g="values",m=function(){return this};e.exports=function(e,t,i,f,y,v,C){l(i,t,f);var b,S,w,x=function(e){if(!u&&e in T)return T[e];switch(e){case p:case g:return function(){return new i(this,e)}}return function(){return new i(this,e)}},E=t+" Iterator",M=y==g,A=!1,T=e.prototype,D=T[d]||T["@@iterator"]||y&&T[y],I=D||x(y),R=y?M?x("entries"):I:void 0,P="Array"==t&&T.entries||D;if(P&&(w=h(P.call(new e)))!==Object.prototype&&w.next&&(c(w,E,!0),s||"function"==typeof w[d]||o(w,d,m)),M&&D&&D.name!==g&&(A=!0,I=function(){return D.call(this)}),s&&!C||!u&&!A&&T[d]||o(T,d,I),a[t]=I,a[E]=m,y)if(b={values:M?I:x(g),keys:v?I:x(p),entries:R},C)for(S in b)S in T||n(T,S,b[S]);else r(r.P+r.F*(u||A),t,b);return b}},17093(e){e.exports=function(e,t){return{value:t,done:!!e}}},71813(e){e.exports={}},75549(e){e.exports=!0},26853(e,t,i){var s=i(14472)("meta"),r=i(17482),n=i(21998),o=i(10788).f,a=0,l=Object.isExtensible||function(){return!0},c=!i(58599)(function(){return l(Object.preventExtensions({}))}),h=function(e){o(e,s,{value:{i:"O"+ ++a,w:{}}})},d=e.exports={KEY:s,NEED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!n(e,s)){if(!l(e))return"F";if(!t)return"E";h(e)}return e[s].i},getWeak:function(e,t){if(!n(e,s)){if(!l(e))return!0;if(!t)return!1;h(e)}return e[s].w},onFreeze:function(e){return c&&d.NEED&&l(e)&&!n(e,s)&&h(e),e}}},33677(e,t,i){"use strict";var s=i(27828),r=i(46936),n=i(62951),o=i(60092),a=i(70749),l=i(6234),c=Object.assign;e.exports=!c||i(58599)(function(){var e={},t={},i=Symbol(),s="abcdefghijklmnopqrst";return e[i]=7,s.split("").forEach(function(e){t[e]=e}),7!=c({},e)[i]||Object.keys(c({},t)).join("")!=s})?function(e,t){for(var i=a(e),c=arguments.length,h=1,d=n.f,u=o.f;c>h;)for(var p,g=l(arguments[h++]),m=d?r(g).concat(d(g)):r(g),f=m.length,y=0;f>y;)p=m[y++],s&&!u.call(g,p)||(i[p]=g[p]);return i}:c},69840(e,t,i){var s=i(44655),r=i(50251),n=i(46527),o=i(81119)("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=i(35299)("iframe"),s=n.length;for(t.style.display="none",i(31349).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;s--;)delete c[l][n[s]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(a[l]=s(e),i=new a,a[l]=null,i[o]=e):i=c(),void 0===t?i:r(i,t)}},10788(e,t,i){var s=i(44655),r=i(27941),n=i(15873),o=Object.defineProperty;t.f=i(27828)?Object.defineProperty:function(e,t,i){if(s(e),t=n(t,!0),s(i),r)try{return o(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},50251(e,t,i){var s=i(10788),r=i(44655),n=i(46936);e.exports=i(27828)?Object.defineProperties:function(e,t){r(e);for(var i,o=n(t),a=o.length,l=0;a>l;)s.f(e,i=o[l++],t[i]);return e}},73686(e,t,i){var s=i(60092),r=i(25995),n=i(51552),o=i(15873),a=i(21998),l=i(27941),c=Object.getOwnPropertyDescriptor;t.f=i(27828)?c:function(e,t){if(e=n(e),t=o(t,!0),l)try{return c(e,t)}catch(e){}if(a(e,t))return r(!s.f.call(e,t),e[t])}},90662(e,t,i){var s=i(51552),r=i(4788).f,n={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==n.call(e)?function(e){try{return r(e)}catch(e){return o.slice()}}(e):r(s(e))}},4788(e,t,i){var s=i(18556),r=i(46527).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return s(e,r)}},62951(e,t){t.f=Object.getOwnPropertySymbols},23218(e,t,i){var s=i(21998),r=i(70749),n=i(81119)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),s(e,n)?e[n]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},18556(e,t,i){var s=i(21998),r=i(51552),n=i(2473)(!1),o=i(81119)("IE_PROTO");e.exports=function(e,t){var i,a=r(e),l=0,c=[];for(i in a)i!=o&&s(a,i)&&c.push(i);for(;t.length>l;)s(a,i=t[l++])&&(~n(c,i)||c.push(i));return c}},46936(e,t,i){var s=i(18556),r=i(46527);e.exports=Object.keys||function(e){return s(e,r)}},60092(e,t){t.f={}.propertyIsEnumerable},72234(e,t,i){var s=i(9102),r=i(96595),n=i(58599);e.exports=function(e,t){var i=(r.Object||{})[e]||Object[e],o={};o[e]=t(i),s(s.S+s.F*n(function(){i(1)}),"Object",o)}},25995(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},10058(e,t,i){e.exports=i(48324)},9721(e,t,i){var s=i(17482),r=i(44655),n=function(e,t){if(r(e),!s(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,s){try{(s=i(64015)(Function.call,i(73686).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return n(e,i),t?e.__proto__=i:s(e,i),e}}({},!1):void 0),check:n}},26343(e,t,i){var s=i(10788).f,r=i(21998),n=i(78161)("toStringTag");e.exports=function(e,t,i){e&&!r(e=i?e:e.prototype,n)&&s(e,n,{configurable:!0,value:t})}},81119(e,t,i){var s=i(27641)("keys"),r=i(14472);e.exports=function(e){return s[e]||(s[e]=r(e))}},27641(e,t,i){var s=i(96595),r=i(79747),n="__core-js_shared__",o=r[n]||(r[n]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:s.version,mode:i(75549)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},62447(e,t,i){var s=i(29358),r=i(77095);e.exports=function(e){return function(t,i){var n,o,a=String(r(t)),l=s(i),c=a.length;return l<0||l>=c?e?"":void 0:(n=a.charCodeAt(l))<55296||n>56319||l+1===c||(o=a.charCodeAt(l+1))<56320||o>57343?e?a.charAt(l):n:e?a.slice(l,l+2):o-56320+(n-55296<<10)+65536}}},23138(e,t,i){var s=i(29358),r=Math.max,n=Math.min;e.exports=function(e,t){return(e=s(e))<0?r(e+t,0):n(e,t)}},29358(e){var t=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:t)(e)}},51552(e,t,i){var s=i(6234),r=i(77095);e.exports=function(e){return s(r(e))}},14326(e,t,i){var s=i(29358),r=Math.min;e.exports=function(e){return e>0?r(s(e),9007199254740991):0}},70749(e,t,i){var s=i(77095);e.exports=function(e){return Object(s(e))}},15873(e,t,i){var s=i(17482);e.exports=function(e,t){if(!s(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!s(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!s(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!s(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},14472(e){var t=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+i).toString(36))}},99225(e,t,i){var s=i(79747),r=i(96595),n=i(75549),o=i(36063),a=i(10788).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=n?{}:s.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:o.f(e)})}},36063(e,t,i){t.f=i(78161)},78161(e,t,i){var s=i(27641)("wks"),r=i(14472),n=i(79747).Symbol,o="function"==typeof n;(e.exports=function(e){return s[e]||(s[e]=o&&n[e]||(o?n:r)("Symbol."+e))}).store=s},27698(e,t,i){"use strict";var s=i(51453),r=i(17093),n=i(71813),o=i(51552);e.exports=i(14520)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])},"values"),n.Arguments=n.Array,s("keys"),s("values"),s("entries")},2903(e,t,i){var s=i(9102);s(s.S+s.F,"Object",{assign:i(33677)})},81026(e,t,i){var s=i(9102);s(s.S,"Object",{create:i(69840)})},92611(e,t,i){var s=i(9102);s(s.S+s.F*!i(27828),"Object",{defineProperty:i(10788).f})},95029(e,t,i){var s=i(70749),r=i(23218);i(72234)("getPrototypeOf",function(){return function(e){return r(s(e))}})},74537(e,t,i){var s=i(9102);s(s.S,"Object",{setPrototypeOf:i(9721).set})},83149(){},91210(e,t,i){"use strict";var s=i(62447)(!0);i(14520)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,i=this._i;return i>=t.length?{value:void 0,done:!0}:(e=s(t,i),this._i+=e.length,{value:e,done:!1})})},63977(e,t,i){"use strict";var s=i(79747),r=i(21998),n=i(27828),o=i(9102),a=i(10058),l=i(26853).KEY,c=i(58599),h=i(27641),d=i(26343),u=i(14472),p=i(78161),g=i(36063),m=i(99225),f=i(94618),y=i(39984),v=i(44655),C=i(17482),b=i(70749),S=i(51552),w=i(15873),x=i(25995),E=i(69840),M=i(90662),A=i(73686),T=i(62951),D=i(10788),I=i(46936),R=A.f,P=D.f,k=M.f,L=s.Symbol,N=s.JSON,_=N&&N.stringify,O="prototype",F=p("_hidden"),G=p("toPrimitive"),B={}.propertyIsEnumerable,V=h("symbol-registry"),H=h("symbols"),U=h("op-symbols"),z=Object[O],W="function"==typeof L&&!!T.f,j=s.QObject,K=!j||!j[O]||!j[O].findChild,$=n&&c(function(){return 7!=E(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(e,t,i){var s=R(z,t);s&&delete z[t],P(e,t,i),s&&e!==z&&P(z,t,s)}:P,Y=function(e){var t=H[e]=E(L[O]);return t._k=e,t},q=W&&"symbol"==typeof L.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof L},X=function(e,t,i){return e===z&&X(U,t,i),v(e),t=w(t,!0),v(i),r(H,t)?(i.enumerable?(r(e,F)&&e[F][t]&&(e[F][t]=!1),i=E(i,{enumerable:x(0,!1)})):(r(e,F)||P(e,F,x(1,{})),e[F][t]=!0),$(e,t,i)):P(e,t,i)},Z=function(e,t){v(e);for(var i,s=f(t=S(t)),r=0,n=s.length;n>r;)X(e,i=s[r++],t[i]);return e},Q=function(e){var t=B.call(this,e=w(e,!0));return!(this===z&&r(H,e)&&!r(U,e))&&(!(t||!r(this,e)||!r(H,e)||r(this,F)&&this[F][e])||t)},J=function(e,t){if(e=S(e),t=w(t,!0),e!==z||!r(H,t)||r(U,t)){var i=R(e,t);return!i||!r(H,t)||r(e,F)&&e[F][t]||(i.enumerable=!0),i}},ee=function(e){for(var t,i=k(S(e)),s=[],n=0;i.length>n;)r(H,t=i[n++])||t==F||t==l||s.push(t);return s},te=function(e){for(var t,i=e===z,s=k(i?U:S(e)),n=[],o=0;s.length>o;)!r(H,t=s[o++])||i&&!r(z,t)||n.push(H[t]);return n};W||(L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var e=u(arguments.length>0?arguments[0]:void 0),t=function(i){this===z&&t.call(U,i),r(this,F)&&r(this[F],e)&&(this[F][e]=!1),$(this,e,x(1,i))};return n&&K&&$(z,e,{configurable:!0,set:t}),Y(e)},a(L[O],"toString",function(){return this._k}),A.f=J,D.f=X,i(4788).f=M.f=ee,i(60092).f=Q,T.f=te,n&&!i(75549)&&a(z,"propertyIsEnumerable",Q,!0),g.f=function(e){return Y(p(e))}),o(o.G+o.W+o.F*!W,{Symbol:L});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),se=0;ie.length>se;)p(ie[se++]);for(var re=I(p.store),ne=0;re.length>ne;)m(re[ne++]);o(o.S+o.F*!W,"Symbol",{for:function(e){return r(V,e+="")?V[e]:V[e]=L(e)},keyFor:function(e){if(!q(e))throw TypeError(e+" is not a symbol!");for(var t in V)if(V[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),o(o.S+o.F*!W,"Object",{create:function(e,t){return void 0===t?E(e):Z(E(e),t)},defineProperty:X,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:ee,getOwnPropertySymbols:te});var oe=c(function(){T.f(1)});o(o.S+o.F*oe,"Object",{getOwnPropertySymbols:function(e){return T.f(b(e))}}),N&&o(o.S+o.F*(!W||c(function(){var e=L();return"[null]"!=_([e])||"{}"!=_({a:e})||"{}"!=_(Object(e))})),"JSON",{stringify:function(e){for(var t,i,s=[e],r=1;arguments.length>r;)s.push(arguments[r++]);if(i=t=s[1],(C(t)||void 0!==e)&&!q(e))return y(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!q(t))return t}),s[1]=t,_.apply(N,s)}}),L[O][G]||i(48324)(L[O],G,L[O].valueOf),d(L,"Symbol"),d(Math,"Math",!0),d(s.JSON,"JSON",!0)},78993(e,t,i){i(99225)("asyncIterator")},50237(e,t,i){i(99225)("observable")},75505(e,t,i){i(27698);for(var s=i(79747),r=i(48324),n=i(71813),o=i(78161)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var c=a[l],h=s[c],d=h&&h.prototype;d&&!d[o]&&r(d,o,c),n[c]=n.Array}},41166(e,t,i){function s(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===s(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===s(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===s(e)},t.isError=function(e){return"[object Error]"===s(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=i(77511).Buffer.isBuffer},29520(e,t,i){var s=i(23071),r=i(5630);e.exports=function(e){return new o(e)};var n={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function o(e){this.curveType=n[e],this.curveType||(this.curveType={name:e}),this.curve=new s.ec(this.curveType.name),this.keys=void 0}function a(e,t,i){Array.isArray(e)||(e=e.toArray());var s=new Buffer(e);if(i&&s.length<i){var r=new Buffer(i-s.length);r.fill(0),s=Buffer.concat([r,s])}return t?s.toString(t):s}n.p224=n.secp224r1,n.p256=n.secp256r1=n.prime256v1,n.p192=n.secp192r1=n.prime192v1,n.p384=n.secp384r1,n.p521=n.secp521r1,o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,i){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),a(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),i,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var i=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(i[i.length-1]%2?i[0]=7:i[0]=6),a(i,e)},o.prototype.getPrivateKey=function(e){return a(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t));var i=new r(e);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this}},18955(e,t,i){"use strict";var s=i(91193),r=i(75035),n=i(47795),o=i(99041),a=i(36334);function l(e){a.call(this,"digest"),this._hash=e}s(l,a),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new r:"rmd160"===e||"ripemd160"===e?new n:new l(o(e))}},46159(e,t,i){var s=i(75035);e.exports=function(e){return(new s).update(e).digest()}},33053(e,t,i){"use strict";var s=i(91193),r=i(78289),n=i(36334),o=i(56608).Buffer,a=i(46159),l=i(47795),c=i(99041),h=o.alloc(128);function d(e,t){n.call(this,"digest"),"string"==typeof t&&(t=o.from(t));var i="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>i?t=("rmd160"===e?new l:c(e)).update(t).digest():t.length<i&&(t=o.concat([t,h],i));for(var s=this._ipad=o.allocUnsafe(i),r=this._opad=o.allocUnsafe(i),a=0;a<i;a++)s[a]=54^t[a],r[a]=92^t[a];this._hash="rmd160"===e?new l:c(e),this._hash.update(s)}s(d,n),d.prototype._update=function(e){this._hash.update(e)},d.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new l:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new d("rmd160",t):"md5"===e?new r(a,t):new d(e,t)}},78289(e,t,i){"use strict";var s=i(91193),r=i(56608).Buffer,n=i(36334),o=r.alloc(128),a=64;function l(e,t){n.call(this,"digest"),"string"==typeof t&&(t=r.from(t)),this._alg=e,this._key=t,t.length>a?t=e(t):t.length<a&&(t=r.concat([t,o],a));for(var i=this._ipad=r.allocUnsafe(a),s=this._opad=r.allocUnsafe(a),l=0;l<a;l++)i[l]=54^t[l],s[l]=92^t[l];this._hash=[i]}s(l,n),l.prototype._update=function(e){this._hash.push(e)},l.prototype._final=function(){var e=this._alg(r.concat(this._hash));return this._alg(r.concat([this._opad,e]))},e.exports=l},24215(e,t,i){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=i(82869),t.createHash=t.Hash=i(18955),t.createHmac=t.Hmac=i(33053);var s=i(92761),r=Object.keys(s),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);t.getHashes=function(){return n};var o=i(46375);t.pbkdf2=o.pbkdf2,t.pbkdf2Sync=o.pbkdf2Sync;var a=i(18350);t.Cipher=a.Cipher,t.createCipher=a.createCipher,t.Cipheriv=a.Cipheriv,t.createCipheriv=a.createCipheriv,t.Decipher=a.Decipher,t.createDecipher=a.createDecipher,t.Decipheriv=a.Decipheriv,t.createDecipheriv=a.createDecipheriv,t.getCiphers=a.getCiphers,t.listCiphers=a.listCiphers;var l=i(35835);t.DiffieHellmanGroup=l.DiffieHellmanGroup,t.createDiffieHellmanGroup=l.createDiffieHellmanGroup,t.getDiffieHellman=l.getDiffieHellman,t.createDiffieHellman=l.createDiffieHellman,t.DiffieHellman=l.DiffieHellman;var c=i(80206);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=i(29520);var h=i(32211);t.publicEncrypt=h.publicEncrypt,t.privateEncrypt=h.privateEncrypt,t.publicDecrypt=h.publicDecrypt,t.privateDecrypt=h.privateDecrypt;var d=i(44925);t.randomFill=d.randomFill,t.randomFillSync=d.randomFillSync,t.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify")},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},60095(e,t,i){var s;e.exports=(s=s||function(e){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),"undefined"!=typeof self&&self.crypto&&(t=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t)try{t=i(57167)}catch(e){}var s=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),n={},o=n.lib={},a=o.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=o.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,i=e.words,s=this.sigBytes,r=e.sigBytes;if(this.clamp(),s%4)for(var n=0;n<r;n++){var o=i[n>>>2]>>>24-n%4*8&255;t[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var a=0;a<r;a+=4)t[s+a>>>2]=i[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(s());return new l.init(t,e)}}),c=n.enc={},h=c.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,s=[],r=0;r<i;r++){var n=t[r>>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,i=[],s=0;s<t;s+=2)i[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new l.init(i,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,s=[],r=0;r<i;r++){var n=t[r>>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}return s.join("")},parse:function(e){for(var t=e.length,i=[],s=0;s<t;s++)i[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new l.init(i,t)}},u=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,s=this._data,r=s.words,n=s.sigBytes,o=this.blockSize,a=n/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,h=e.min(4*c,n);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(r,d);i=r.splice(0,c),s.sigBytes-=h}return new l.init(i,h)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(o.Hasher=p.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new g.HMAC.init(e,i).finalize(t)}}}),n.algo={});return n}(Math),s)},81716(e,t,i){var s,r,n;e.exports=(s=i(60095),n=(r=s).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,s=this._map;e.clamp();for(var r=[],n=0;n<i;n+=3)for(var o=(t[n>>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,a=0;a<4&&n+.75*a<i;a++)r.push(s.charAt(o>>>6*(3-a)&63));var l=s.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(e){var t=e.length,i=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var r=0;r<i.length;r++)s[i.charCodeAt(r)]=r}var o=i.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return function(e,t,i){for(var s=[],r=0,o=0;o<t;o++)if(o%4){var a=i[e.charCodeAt(o-1)]<<o%4*2|i[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return n.create(s,r)}(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},s.enc.Base64)},31939(e,t,i){var s;e.exports=(s=i(60095),i(9331),i(55979),s.HmacSHA256)},55979(e,t,i){var s,r,n;e.exports=(r=(s=i(60095)).lib.Base,n=s.enc.Utf8,void(s.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var i=e.blockSize,s=4*i;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),o=this._iKey=t.clone(),a=r.words,l=o.words,c=0;c<i;c++)a[c]^=1549556828,l[c]^=909522486;r.sigBytes=o.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})))},74842(e,t,i){var s;e.exports=(s=i(60095),function(){if("function"==typeof ArrayBuffer){var e=s.lib.WordArray,t=e.init,i=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var i=e.byteLength,s=[],r=0;r<i;r++)s[r>>>2]|=e[r]<<24-r%4*8;t.call(this,s,i)}else t.apply(this,arguments)};i.prototype=e}}(),s.lib.WordArray)},9331(e,t,i){var s;e.exports=(s=i(60095),function(e){var t=s,i=t.lib,r=i.WordArray,n=i.Hasher,o=t.algo,a=[],l=[];!function(){function t(t){for(var i=e.sqrt(t),s=2;s<=i;s++)if(!(t%s))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var s=2,r=0;r<64;)t(s)&&(r<8&&(a[r]=i(e.pow(s,.5))),l[r]=i(e.pow(s,1/3)),r++),s++}();var c=[],h=o.SHA256=n.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,s=i[0],r=i[1],n=i[2],o=i[3],a=i[4],h=i[5],d=i[6],u=i[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var g=c[p-15],m=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,f=c[p-2],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=m+c[p-7]+y+c[p-16]}var v=s&r^s&n^r&n,C=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=u+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&h^~a&d)+l[p]+c[p];u=d,d=h,h=a,a=o+b|0,o=n,n=r,r=s,s=b+(C+v)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+h|0,i[6]=i[6]+d|0,i[7]=i[7]+u|0},_doFinalize:function(){var t=this._data,i=t.words,s=8*this._nDataBytes,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(h),t.HmacSHA256=n._createHmacHelper(h)}(Math),s.SHA256)},83160(e,t,i){"use strict";i.d(t,{cO:()=>ie,mR:()=>v,u8:()=>X});var s=i(42346),r=i(72432),n="",o="",a="",l="",c=s.A&&"ontouchstart"in document.documentElement;if(s.A){var h={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},d=document.createElement("p").style;for(var u in h)if(u+"Transform"in d){n=u,o=h[u];break}"Webkit"===n&&"msHyphens"in d&&(n="ms",o=h.ms,l="edge"),"Webkit"===n&&"-apple-trailing-word"in d&&(a="apple")}var p=n,g=o,m=a,f=l,y=c;function v(e){return"-"===e[1]||"ms"===p?e:"@"+g+"keyframes"+e.substr(10)}var C={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===p?"-webkit-"+e:g+e)}},b={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===p?g+"print-"+e:e)}},S=/[-\s]+(.)?/g;function w(e,t){return t?t.toUpperCase():""}function x(e){return e.replace(S,w)}function E(e){return x("-"+e)}var M,A={noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===p){var i="mask-image";if(x(i)in t)return e;if(p+E(i)in t)return g+e}return e}},T={noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==m||y?e:g+e)}},D={noPrefill:["transform"],supportedProperty:function(e,t,i){return"transform"===e&&(i.transform?e:g+e)}},I={noPrefill:["transition"],supportedProperty:function(e,t,i){return"transition"===e&&(i.transition?e:g+e)}},R={noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===p||"ms"===p&&"edge"!==f?g+e:e)}},P={noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===p||"ms"===p||"apple"===m?g+e:e)}},k={supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===p?"WebkitColumn"+E(e)in t&&g+"column-"+e:"Moz"===p&&"page"+E(e)in t&&"page-"+e)}},L={supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===p)return e;var i=e.replace("-inline","");return p+E(i)in t&&g+i}},N={supportedProperty:function(e,t){return x(e)in t&&e}},_={supportedProperty:function(e,t){var i=E(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:p+i in t?g+e:"Webkit"!==p&&"Webkit"+i in t&&"-webkit-"+e}},O={supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===p?""+g+e:e)}},F={supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===p?g+"scroll-chaining":e)}},G={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},B={supportedProperty:function(e,t){var i=G[e];return!!i&&p+E(i)in t&&g+i}},V={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},H=Object.keys(V),U=function(e){return g+e},z={supportedProperty:function(e,t,i){var s=i.multiple;if(H.indexOf(e)>-1){var r=V[e];if(!Array.isArray(r))return p+E(r)in t&&g+r;if(!s)return!1;for(var n=0;n<r.length;n++)if(!(p+E(r[0])in t))return!1;return r.map(U)}return!1}},W=[C,b,A,T,D,I,R,P,k,L,N,_,O,F,B,z],j=W.filter(function(e){return e.supportedProperty}).map(function(e){return e.supportedProperty}),K=W.filter(function(e){return e.noPrefill}).reduce(function(e,t){return e.push.apply(e,(0,r.A)(t.noPrefill)),e},[]),$={};if(s.A){M=document.createElement("p");var Y=window.getComputedStyle(document.documentElement,"");for(var q in Y)isNaN(q)||($[Y[q]]=Y[q]);K.forEach(function(e){return delete $[e]})}function X(e,t){if(void 0===t&&(t={}),!M)return e;if(null!=$[e])return $[e];"transition"!==e&&"transform"!==e||(t[e]=e in M.style);for(var i=0;i<j.length&&($[e]=j[i](e,M.style,t),!$[e]);i++);try{M.style[e]=""}catch(e){return!1}return $[e]}var Z,Q={},J={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},ee=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function te(e,t,i){return"var"===t?"var":"all"===t?"all":"all"===i?", all":(t?X(t):", "+X(i))||t||i}function ie(e,t){var i=t;if(!Z||"content"===e)return t;if("string"!=typeof i||!isNaN(parseInt(i,10)))return i;var s=e+i;if(null!=Q[s])return Q[s];try{Z.style[e]=i}catch(e){return Q[s]=!1,!1}if(J[e])i=i.replace(ee,te);else if(""===Z.style[e]&&("-ms-flex"===(i=g+i)&&(Z.style[e]="-ms-flexbox"),Z.style[e]=i,""===Z.style[e]))return Q[s]=!1,!1;return Z.style[e]="",Q[s]=i,Q[s]}s.A&&(Z=document.createElement("p"))},18814(e){e.exports=function(){"use strict";var e=6e4,t=36e5,i="millisecond",s="second",r="minute",n="hour",o="day",a="week",l="month",c="quarter",h="year",d="date",u="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},f=function(e,t,i){var s=String(e);return!s||s.length>=t?e:""+Array(t+1-s.length).join(i)+e},y={s:f,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),s=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+f(s,2,"0")+":"+f(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var s=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(s,l),n=i-r<0,o=t.clone().add(s+(n?-1:1),l);return+(-(s+(i-r)/(n?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:h,w:a,d:o,D:d,h:n,m:r,s,ms:i,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",C={};C[v]=m;var b="$isDayjsObject",S=function(e){return e instanceof M||!(!e||!e[b])},w=function e(t,i,s){var r;if(!t)return v;if("string"==typeof t){var n=t.toLowerCase();C[n]&&(r=n),i&&(C[n]=i,r=n);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var a=t.name;C[a]=t,r=a}return!s&&r&&(v=r),r||!s&&v},x=function(e,t){if(S(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new M(i)},E=y;E.l=w,E.i=S,E.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var M=function(){function m(e){this.$L=w(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var f=m.prototype;return f.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var s=t.match(p);if(s){var r=s[2]-1||0,n=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],r,s[3]||1,s[4]||0,s[5]||0,s[6]||0,n)):new Date(s[1],r,s[3]||1,s[4]||0,s[5]||0,s[6]||0,n)}}return new Date(t)}(e),this.init()},f.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},f.$utils=function(){return E},f.isValid=function(){return!(this.$d.toString()===u)},f.isSame=function(e,t){var i=x(e);return this.startOf(t)<=i&&i<=this.endOf(t)},f.isAfter=function(e,t){return x(e)<this.startOf(t)},f.isBefore=function(e,t){return this.endOf(t)<x(e)},f.$g=function(e,t,i){return E.u(e)?this[t]:this.set(i,e)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(e,t){var i=this,c=!!E.u(t)||t,u=E.p(e),p=function(e,t){var s=E.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return c?s:s.endOf(o)},g=function(e,t){return E.w(i.toDate()[e].apply(i.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},m=this.$W,f=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(u){case h:return c?p(1,0):p(31,11);case l:return c?p(1,f):p(0,f+1);case a:var C=this.$locale().weekStart||0,b=(m<C?m+7:m)-C;return p(c?y-b:y+(6-b),f);case o:case d:return g(v+"Hours",0);case n:return g(v+"Minutes",1);case r:return g(v+"Seconds",2);case s:return g(v+"Milliseconds",3);default:return this.clone()}},f.endOf=function(e){return this.startOf(e,!1)},f.$set=function(e,t){var a,c=E.p(e),u="set"+(this.$u?"UTC":""),p=(a={},a[o]=u+"Date",a[d]=u+"Date",a[l]=u+"Month",a[h]=u+"FullYear",a[n]=u+"Hours",a[r]=u+"Minutes",a[s]=u+"Seconds",a[i]=u+"Milliseconds",a)[c],g=c===o?this.$D+(t-this.$W):t;if(c===l||c===h){var m=this.clone().set(d,1);m.$d[p](g),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else p&&this.$d[p](g);return this.init(),this},f.set=function(e,t){return this.clone().$set(e,t)},f.get=function(e){return this[E.p(e)]()},f.add=function(i,c){var d,u=this;i=Number(i);var p=E.p(c),g=function(e){var t=x(u);return E.w(t.date(t.date()+Math.round(e*i)),u)};if(p===l)return this.set(l,this.$M+i);if(p===h)return this.set(h,this.$y+i);if(p===o)return g(1);if(p===a)return g(7);var m=(d={},d[r]=e,d[n]=t,d[s]=1e3,d)[p]||1,f=this.$d.getTime()+i*m;return E.w(f,this)},f.subtract=function(e,t){return this.add(-1*e,t)},f.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||u;var s=e||"YYYY-MM-DDTHH:mm:ssZ",r=E.z(this),n=this.$H,o=this.$m,a=this.$M,l=i.weekdays,c=i.months,h=i.meridiem,d=function(e,i,r,n){return e&&(e[i]||e(t,s))||r[i].slice(0,n)},p=function(e){return E.s(n%12||12,e,"0")},m=h||function(e,t,i){var s=e<12?"AM":"PM";return i?s.toLowerCase():s};return s.replace(g,function(e,s){return s||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return a+1;case"MM":return E.s(a+1,2,"0");case"MMM":return d(i.monthsShort,a,c,3);case"MMMM":return d(c,a);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,l,2);case"ddd":return d(i.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(n);case"HH":return E.s(n,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return m(n,o,!0);case"A":return m(n,o,!1);case"m":return String(o);case"mm":return E.s(o,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(i,d,u){var p,g=this,m=E.p(d),f=x(i),y=(f.utcOffset()-this.utcOffset())*e,v=this-f,C=function(){return E.m(g,f)};switch(m){case h:p=C()/12;break;case l:p=C();break;case c:p=C()/3;break;case a:p=(v-y)/6048e5;break;case o:p=(v-y)/864e5;break;case n:p=v/t;break;case r:p=v/e;break;case s:p=v/1e3;break;default:p=v}return u?p:E.a(p)},f.daysInMonth=function(){return this.endOf(l).$D},f.$locale=function(){return C[this.$L]},f.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),s=w(e,t,!0);return s&&(i.$L=s),i},f.clone=function(){return E.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},m}(),A=M.prototype;return x.prototype=A,[["$ms",i],["$s",s],["$m",r],["$H",n],["$W",o],["$M",l],["$y",h],["$D",d]].forEach(function(e){A[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),x.extend=function(e,t){return e.$i||(e(t,M,x),e.$i=!0),x},x.locale=w,x.isDayjs=S,x.unix=function(e){return x(1e3*e)},x.en=C[v],x.Ls=C,x.p={},x}()},73524(e){e.exports=function(){"use strict";return function(e,t){var i=t.prototype,s=i.format;i.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return s.bind(this)(e);var r=this.$utils(),n=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return i.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return i.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}});return s.bind(this)(n)}}}()},38588(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,r=/\d\d?/,n=/\d*[^-_:/,()\s\d]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,s=o.meridiem;if(s){for(var r=1;r<=24;r+=1)if(e.indexOf(s(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},u={A:[n,function(e){this.afternoon=d(e,!1)}],a:[n,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[s,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,l("seconds")],ss:[r,l("seconds")],m:[r,l("minutes")],mm:[r,l("minutes")],H:[r,l("hours")],h:[r,l("hours")],HH:[r,l("hours")],hh:[r,l("hours")],D:[r,l("day")],DD:[s,l("day")],Do:[n,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var s=1;s<=31;s+=1)t(s).replace(/\[|\]/g,"")===e&&(this.day=s)}],w:[r,l("week")],ww:[s,l("week")],M:[r,l("month")],MM:[s,l("month")],MMM:[n,function(e){var t=h("months"),i=(h("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[n,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[s,function(e){this.year=a(e)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function p(i){var s,r;s=i,r=o&&o.formats;for(var n=(i=s.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,s){var n=s&&s.toUpperCase();return i||r[s]||e[s]||r[n].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),a=n.length,l=0;l<a;l+=1){var c=n[l],h=u[c],d=h&&h[0],p=h&&h[1];n[l]=p?{regex:d,parser:p}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,s=0;i<a;i+=1){var r=n[i];if("string"==typeof r)s+=r.length;else{var o=r.regex,l=r.parser,c=e.slice(s),h=o.exec(c)[0];l.call(t,h),e=e.replace(h,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var s=t.prototype,r=s.parse;s.parse=function(e){var t=e.date,s=e.utc,n=e.args;this.$u=s;var a=n[1];if("string"==typeof a){var l=!0===n[2],c=!0===n[3],h=l||c,d=n[2];c&&(d=n[2]),o=this.$locale(),!l&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,s){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=p(t)(e),n=r.year,o=r.month,a=r.day,l=r.hours,c=r.minutes,h=r.seconds,d=r.milliseconds,u=r.zone,g=r.week,m=new Date,f=a||(n||o?1:m.getDate()),y=n||m.getFullYear(),v=0;n&&!o||(v=o>0?o-1:m.getMonth());var C,b=l||0,S=c||0,w=h||0,x=d||0;return u?new Date(Date.UTC(y,v,f,b,S,w,x+60*u.offset*1e3)):i?new Date(Date.UTC(y,v,f,b,S,w,x)):(C=new Date(y,v,f,b,S,w,x),g&&(C=s(C).week(g).toDate()),C)}catch(e){return new Date("")}}(t,a,s,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),h&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var u=a.length,g=1;g<=u;g+=1){n[1]=a[g-1];var m=i.apply(this,n);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}g===u&&(this.$d=new Date(""))}else r.call(this,e)}}}()},47045(e){e.exports=function(){"use strict";return function(e,t,i){t.prototype.isBetween=function(e,t,s,r){var n=i(e),o=i(t),a="("===(r=r||"()")[0],l=")"===r[1];return(a?this.isAfter(n,s):!this.isBefore(n,s))&&(l?this.isBefore(o,s):!this.isAfter(o,s))||(a?this.isBefore(n,s):!this.isAfter(n,s))&&(l?this.isAfter(o,s):!this.isBefore(o,s))}}}()},85451(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,i,s){var r=i.prototype,n=r.format;s.en.formats=e,r.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var i=this.$locale().formats,s=function(t,i){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,s,r){var n=r&&r.toUpperCase();return s||i[r]||e[r]||i[n].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})}(t,void 0===i?{}:i);return n.call(this,s)}}}()},6105(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(i,s,r){var n,o=function(e,i,s){void 0===s&&(s={});var r=new Date(e),n=function(e,i){void 0===i&&(i={});var s=i.timeZoneName||"short",r=e+"|"+s,n=t[r];return n||(n=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),t[r]=n),n}(i,s);return n.formatToParts(r)},a=function(t,i){for(var s=o(t,i),n=[],a=0;a<s.length;a+=1){var l=s[a],c=l.type,h=l.value,d=e[c];d>=0&&(n[d]=parseInt(h,10))}var u=n[3],p=24===u?0:u,g=n[0]+"-"+n[1]+"-"+n[2]+" "+p+":"+n[4]+":"+n[5]+":000",m=+t;return(r.utc(g).valueOf()-(m-=m%1e3))/6e4},l=s.prototype;l.tz=function(e,t){void 0===e&&(e=n);var i,s=this.utcOffset(),o=this.toDate(),a=o.toLocaleString("en-US",{timeZone:e}),l=Math.round((o-new Date(a))/1e3/60),c=15*-Math.round(o.getTimezoneOffset()/15)-l;if(Number(c)){if(i=r(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var h=i.utcOffset();i=i.add(s-h,"minute")}}else i=this.utcOffset(0,t);return i.$x.$timezone=e,i},l.offsetName=function(e){var t=this.$x.$timezone||r.tz.guess(),i=o(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return i&&i.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var i=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(i,e,t).tz(this.$x.$timezone,!0)},r.tz=function(e,t,i){var s=i&&t,o=i||t||n,l=a(+r(),o);if("string"!=typeof e)return r(e).tz(o);var c=function(e,t,i){var s=e-60*t*1e3,r=a(s,i);if(t===r)return[s,t];var n=a(s-=60*(r-t)*1e3,i);return r===n?[s,r]:[e-60*Math.min(r,n)*1e3,Math.max(r,n)]}(r.utc(e,s).valueOf(),l,o),h=c[0],d=c[1],u=r(h).utcOffset(d);return u.$x.$timezone=o,u},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(e){n=e}}}()},61699(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,r,n){var o=r.prototype;n.utc=function(e){return new r({date:e,utc:!0,args:arguments})},o.utc=function(t){var i=n(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),e):i},o.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=o.utcOffset;o.utcOffset=function(s,r){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?c.call(this):this.$offset;if("string"==typeof s&&(s=function(e){void 0===e&&(e="");var s=e.match(t);if(!s)return null;var r=(""+s[0]).match(i)||["-",0,0],n=r[0],o=60*+r[1]+ +r[2];return 0===o?0:"+"===n?o:-o}(s),null===s))return this;var o=Math.abs(s)<=16?60*s:s;if(0===o)return this.utc(r);var a=this.clone();if(r)return a.$offset=o,a.$u=!1,a;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(a=this.local().add(o+l,e)).$offset=o,a.$x.$localOffset=l,a};var h=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var u=o.diff;o.diff=function(e,t,i){if(e&&this.$u===e.$u)return u.call(this,e,t,i);var s=this.local(),r=n(e).local();return u.call(s,r,t,i)}}}()},64881(e){e.exports=function(){"use strict";var e="week",t="year";return function(i,s,r){var n=s.prototype;n.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var s=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var n=r(this).startOf(t).add(1,t).date(s),o=r(this).endOf(e);if(n.isBefore(o))return 1}var a=r(this).startOf(t).date(s).startOf(e).subtract(1,"millisecond"),l=this.diff(a,e,!0);return l<0?r(this).startOf("week").week():Math.ceil(l)},n.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}()},89028(e,t,i){var s=i(85409);function r(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==s&&"env"in s&&(e={NODE_ENV:"production",REACT_APP_LEARN_THUMBNAIL_UPLOAD:"https://vbmmdf81nl.execute-api.eu-west-2.amazonaws.com/live/learnthumbnailupload",REACT_APP_COGNITO_DOMAIN:"rio.auth.eu-west-2.amazoncognito.com",REACT_APP_RESOLVE_EXTERNAL_USER_URL:"https://zp73c6vc5l.execute-api.eu-west-2.amazonaws.com/current/resolve-external-user",REACT_APP_IDENTITY_POOL_ID:"eu-west-2:2fee832d-d0ba-420c-a056-0ed865cde419",REACT_APP_STRIPE_PUBLIC_KEY:"pk_live_51HLD9AEF3FA3cLa5DWIX6QpW41AHM0f5DALJjUtBoRhvP52iJrBkyGW9HajZ6MHF0M6weW7Nals5CkSZdULWyYyT00Pg5PgL0l",REACT_APP_PROFILE_BUCKET:"https://platform-profilepictures-live.s3.eu-west-2.amazonaws.com",REACT_APP_BANNER_CONTENT:"/VIDEO/LearnBanner.mp4",REACT_APP_AG_GRID_LICENSE_KEY:"Using_this_{AG_Grid}_Enterprise_key_{AG-063287}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{RIO_ESG_LTD}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{Rio}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{Rio}_need_to_be_licensed___{Rio}_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{30_September_2025}____[v3]_[01]_MTc1OTE4NjgwMDAwMA==8e1b4570338f7c27ca6155479e1e2c14",REACT_APP_DS_URL:"https://rio.ai",REACT_APP_LOCATION_PICTURE_BUCKET:"https://platform-location-pictures-live.s3.eu-west-2.amazonaws.com",REACT_APP_GOOGLE_ANALYTIC_KEY:"UA-74511216-3",REACT_APP_AG_CHARTS_LICENSE_KEY:"Using_this_{AG_Charts}_Enterprise_key_{AG-100671}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Rio_AI_Ltd}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{Rio}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{Rio}_need_to_be_licensed___{Rio}_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Charts}_Enterprise_versions_released_before_{28_March_2027}____[v3]_[02]_MTgwNjE5MjAwMDAwMA==388e7d5fd16c7af6f350e7707024b637",REACT_APP_IMPACT_LOCATIONS_MAP_ID:"b3c1bd97c9d0fbf8",REACT_APP_DOCUMENT_UPLOAD:"https://1iyju5wg22.execute-api.eu-west-1.amazonaws.com/dev/documentupload",REACT_APP_INTELLIGENCE_API_STAGE:"live",REACT_APP_CONSULTATIONS_URL:"https://inference-engine.esg-r.io/api",REACT_APP_ENVIRONMENT_NAME:"Live",REACT_APP_USER_POOL_ID:"eu-west-2_CXMj8XQn0",REACT_APP_USER_POOL_WEB_CLIENT_ID:"2a8c10u5721464di89s75deqbr",REACT_APP_ANALYST_AGENT_ENDPOINT:"https://bedrock-agentcore.eu-west-2.amazonaws.com/runtimes/arn%3Aaws%3Abedrock-agentcore%3Aeu-west-2%3A523523762637%3Aruntime%2Fdata_analysis_agent_prod-FHjO5N5Zv7/invocations?qualifier=DEFAULT",REACT_APP_SENTRY_ENV:"LIVE",REACT_APP_BASE_URL:"https://sustainability.rio.ai",REACT_APP_DROMO_LICENSE_KEY:"a1fc32a8-fb02-4546-ad17-74254111f991",REACT_APP_HUBSPOT_TRACKER:"3847934",REACT_APP_GOOGLE_MAP_API_KEY:"AIzaSyD0bNhOInxPo2plOg1oxsYHeOsIXdefauE",REACT_APP_AZURE_SSO_APP_ID:"f7c97800-e70d-43a3-800e-64b6ba778a31",REACT_APP_AWS_REGION:"eu-west-2",REACT_APP_PINPOINT_REGION:"us-east-1",REACT_APP_GRAPHQL_URI:"https://kmkdrdo3dzcvnkzqzfnmfuwt4m.appsync-api.eu-west-2.amazonaws.com/graphql",REACT_APP_PINPOINT_APP_CLIENT_ID:"1b81e38efb7546329dd7eb32e0088b29"}.DEBUG),e}(t=e.exports=i(41111)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var i=this.useColors;if(e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+t.humanize(this.diff),i){var s="color: "+this.color;e.splice(1,0,s,"color: inherit");var r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,s)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=r,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(r())},41111(e,t,i){var s;function r(e){function i(){if(i.enabled){var e=i,r=+new Date,n=r-(s||r);e.diff=n,e.prev=s,e.curr=r,s=r;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(i,s){if("%%"===i)return i;l++;var r=t.formatters[s];if("function"==typeof r){var n=o[l];i=r.call(e,n),o.splice(l,1),l--}return i}),t.formatArgs.call(e,o),(i.log||t.log||console.log.bind(console)).apply(e,o)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var i,s=0;for(i in e)s=(s<<5)-s+e.charCodeAt(i),s|=0;return t.colors[Math.abs(s)%t.colors.length]}(e),"function"==typeof t.init&&t.init(i),i}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var i=("string"==typeof e?e:"").split(/[\s,]+/),s=i.length,r=0;r<s;r++)i[r]&&("-"===(e=i[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var i,s;for(i=0,s=t.skips.length;i<s;i++)if(t.skips[i].test(e))return!1;for(i=0,s=t.names.length;i<s;i++)if(t.names[i].test(e))return!0;return!1},t.humanize=i(36644),t.names=[],t.skips=[],t.formatters={}},2858(e){"use strict";var t="%[a-f0-9]{2}",i=new RegExp("("+t+")|([^%]+?)","gi"),s=new RegExp("("+t+")+","gi");function r(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var i=e.slice(0,t),s=e.slice(t);return Array.prototype.concat.call([],r(i),r(s))}function n(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(i)||[],s=1;s<t.length;s++)t=(e=r(t,s).join("")).match(i)||[];return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},i=s.exec(e);i;){try{t[i[0]]=decodeURIComponent(i[0])}catch(e){var r=n(i[0]);r!==i[0]&&(t[i[0]]=r)}i=s.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),a=0;a<o.length;a++){var l=o[a];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},90357(e,t,i){var s,r;r=function(e){var t=["N","E","A","D"];function i(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function s(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function r(e,t,i){r.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:i,enumerable:!0})}function n(e,t){n.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function o(e,t){o.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function a(e,t,i){a.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:i,enumerable:!0})}function l(e,t,i){var s=e.slice((i||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,s),e}function c(e){var t=typeof e;return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function h(e){var t=0;if(0===e.length)return t;for(var i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t&=t;return t}function d(e){var t=0,i=c(e);if("array"===i)return e.forEach(function(e){t+=d(e)}),t+h("[type: array, hash: "+t+"]");if("object"===i){for(var s in e)if(e.hasOwnProperty(s)){var r="[ type: object, key: "+s+", value hash: "+d(e[s])+"]";t+=h(r)}return t}return t+h("[ type: "+i+" ; value: "+e+"]")}function u(e,t,i,s,l,h,p,g){i=i||[],p=p||[];var m=(l=l||[]).slice(0);if(null!=h){if(s){if("function"==typeof s&&s(m,h))return;if("object"==typeof s){if(s.prefilter&&s.prefilter(m,h))return;if(s.normalize){var f=s.normalize(m,h,e,t);f&&(e=f[0],t=f[1])}}}m.push(h)}"regexp"===c(e)&&"regexp"===c(t)&&(e=e.toString(),t=t.toString());var y,v,C,b,S=typeof e,w=typeof t,x="undefined"!==S||p&&p.length>0&&p[p.length-1].lhs&&Object.getOwnPropertyDescriptor(p[p.length-1].lhs,h),E="undefined"!==w||p&&p.length>0&&p[p.length-1].rhs&&Object.getOwnPropertyDescriptor(p[p.length-1].rhs,h);if(!x&&E)i.push(new n(m,t));else if(!E&&x)i.push(new o(m,e));else if(c(e)!==c(t))i.push(new r(m,e,t));else if("date"===c(e)&&e-t!==0)i.push(new r(m,e,t));else if("object"===S&&null!==e&&null!==t){for(y=p.length-1;y>-1;--y)if(p[y].lhs===e){b=!0;break}if(b)e!==t&&i.push(new r(m,e,t));else{if(p.push({lhs:e,rhs:t}),Array.isArray(e)){for(g&&(e.sort(function(e,t){return d(e)-d(t)}),t.sort(function(e,t){return d(e)-d(t)})),y=t.length-1,v=e.length-1;y>v;)i.push(new a(m,y,new n(void 0,t[y--])));for(;v>y;)i.push(new a(m,v,new o(void 0,e[v--])));for(;y>=0;--y)u(e[y],t[y],i,s,m,y,p,g)}else{var M=Object.keys(e),A=Object.keys(t);for(y=0;y<M.length;++y)C=M[y],(b=A.indexOf(C))>=0?(u(e[C],t[C],i,s,m,C,p,g),A[b]=null):u(e[C],void 0,i,s,m,C,p,g);for(y=0;y<A.length;++y)(C=A[y])&&u(void 0,t[C],i,s,m,C,p,g)}p.length=p.length-1}}else e!==t&&("number"===S&&isNaN(e)&&isNaN(t)||i.push(new r(m,e,t)))}function p(e,t,i,s,r){var n=[];if(u(e,t,n,s,null,null,null,r),i)for(var o=0;o<n.length;++o)i(n[o]);return n}function g(e,t,i,s){var r=p(e,t,s?function(e){e&&s.push(e)}:void 0,i);return s||(r.length?r:void 0)}function m(e,t,i){if(i.path&&i.path.length){var s,r=e[t],n=i.path.length-1;for(s=0;s<n;s++)r=r[i.path[s]];switch(i.kind){case"A":m(r[i.path[s]],i.index,i.item);break;case"D":delete r[i.path[s]];break;case"E":case"N":r[i.path[s]]=i.rhs}}else switch(i.kind){case"A":m(e[t],i.index,i.item);break;case"D":e=l(e,t);break;case"E":case"N":e[t]=i.rhs}return e}function f(e,i,s){if(void 0===s&&i&&~t.indexOf(i.kind)&&(s=i),e&&s&&s.kind){for(var r=e,n=-1,o=s.path?s.path.length-1:0;++n<o;)void 0===r[s.path[n]]&&(r[s.path[n]]=void 0!==s.path[n+1]&&"number"==typeof s.path[n+1]?[]:{}),r=r[s.path[n]];switch(s.kind){case"A":s.path&&void 0===r[s.path[n]]&&(r[s.path[n]]=[]),m(s.path?r[s.path[n]]:r,s.index,s.item);break;case"D":delete r[s.path[n]];break;case"E":case"N":r[s.path[n]]=s.rhs}}}function y(e,t,i){if(i.path&&i.path.length){var s,r=e[t],n=i.path.length-1;for(s=0;s<n;s++)r=r[i.path[s]];switch(i.kind){case"A":y(r[i.path[s]],i.index,i.item);break;case"D":case"E":r[i.path[s]]=i.lhs;break;case"N":delete r[i.path[s]]}}else switch(i.kind){case"A":y(e[t],i.index,i.item);break;case"D":case"E":e[t]=i.lhs;break;case"N":e=l(e,t)}return e}return i(r,s),i(n,s),i(o,s),i(a,s),Object.defineProperties(g,{diff:{value:g,enumerable:!0},orderIndependentDiff:{value:function(e,t,i,s){var r=p(e,t,s?function(e){e&&s.push(e)}:void 0,i,!0);return s||(r.length?r:void 0)},enumerable:!0},observableDiff:{value:p,enumerable:!0},orderIndependentObservableDiff:{value:function(e,t,i,s,r,n,o){return u(e,t,i,s,r,n,o,!0)},enumerable:!0},orderIndepHash:{value:d,enumerable:!0},applyDiff:{value:function(e,t,i){e&&t&&p(e,t,function(s){i&&!i(e,t,s)||f(e,t,s)})},enumerable:!0},applyChange:{value:f,enumerable:!0},revertChange:{value:function(e,t,i){if(e&&t&&i&&i.kind){var s,r,n=e;for(r=i.path.length-1,s=0;s<r;s++)void 0===n[i.path[s]]&&(n[i.path[s]]={}),n=n[i.path[s]];switch(i.kind){case"A":y(n[i.path[s]],i.index,i.item);break;case"D":case"E":n[i.path[s]]=i.lhs;break;case"N":delete n[i.path[s]]}}},enumerable:!0},isConflict:{value:function(){return"undefined"!=typeof $conflict},enumerable:!0}}),g.DeepDiff=g,e&&(e.DeepDiff=g),g}(this),void 0===(s=function(){return r}.call(t,i,t,e))||(e.exports=s)},66538(e,t,i){"use strict";i.d(t,{A:()=>l});var s=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function o(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function a(e,t,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||s;var r=Array.isArray(t);return r===Array.isArray(e)?r?i.arrayMerge(e,t,i):function(e,t,i){var s={};return i.isMergeableObject(e)&&Object.keys(e).forEach(function(t){s[t]=n(e[t],i)}),Object.keys(t).forEach(function(r){i.isMergeableObject(t[r])&&e[r]?s[r]=a(e[r],t[r],i):s[r]=n(t[r],i)}),s}(e,t,i):n(t,i)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,i){return a(e,i,t)},{})};const l=a},74579(e){"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function r(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function n(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c=Array.isArray(i);return c===Array.isArray(e)?c?l.arrayMerge(e,i,l):function(e,t,i){var r={};return i.isMergeableObject(e)&&n(e).forEach(function(t){r[t]=s(e[t],i)}),n(t).forEach(function(n){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(o(e,n)&&i.isMergeableObject(t[n])?r[n]=function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a}(n,i)(e[n],t[n],i):r[n]=s(t[n],i))}),r}(e,i,l):s(i,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,i){return a(e,i,t)},{})};var l=a;e.exports=l},20022(e,t,i){"use strict";var s=i(39886),r=i(63429),n=i(71102),o=i(25667);e.exports=function(e,t,i){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new n("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new n("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,h=arguments.length>6&&arguments[6],d=!!o&&o(e,t);if(s)s(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===a&&d?d.enumerable:!a,value:i,writable:null===l&&d?d.writable:!l});else{if(!h&&(a||l||c))throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=i}}},88754(e,t,i){"use strict";t.utils=i(26012),t.Cipher=i(96242),t.DES=i(7325),t.CBC=i(39015),t.EDE=i(62597)},39015(e,t,i){"use strict";var s=i(35578),r=i(91193),n={};function o(e){s.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}r(t,e);for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s];t.prototype[o]=n[o]}return t.create=function(e){return new t(e)},t},n._cbcInit=function(){var e=new o(this.options.iv);this._cbcState=e},n._update=function(e,t,i,s){var r=this._cbcState,n=this.constructor.super_.prototype,o=r.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=e[t+a];for(n._update.call(this,o,0,i,s),a=0;a<this.blockSize;a++)o[a]=i[s+a]}else{for(n._update.call(this,e,t,i,s),a=0;a<this.blockSize;a++)i[s+a]^=o[a];for(a=0;a<this.blockSize;a++)o[a]=e[t+a]}}},96242(e,t,i){"use strict";var s=i(35578);function r(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=r,r.prototype._init=function(){},r.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},r.prototype._buffer=function(e,t){for(var i=Math.min(this.buffer.length-this.bufferOff,e.length-t),s=0;s<i;s++)this.buffer[this.bufferOff+s]=e[t+s];return this.bufferOff+=i,i},r.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},r.prototype._updateEncrypt=function(e){var t=0,i=0,s=(this.bufferOff+e.length)/this.blockSize|0,r=new Array(s*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(r,i)));for(var n=e.length-(e.length-t)%this.blockSize;t<n;t+=this.blockSize)this._update(e,t,r,i),i+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return r},r.prototype._updateDecrypt=function(e){for(var t=0,i=0,s=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,r=new Array(s*this.blockSize);s>0;s--)t+=this._buffer(e,t),i+=this._flushBuffer(r,i);return t+=this._buffer(e,t),r},r.prototype.final=function(e){var t,i;return e&&(t=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(i):i},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},r.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},r.prototype._unpad=function(e){return e},r.prototype._finalDecrypt=function(){s.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},7325(e,t,i){"use strict";var s=i(35578),r=i(91193),n=i(26012),o=i(96242);function a(){this.tmp=new Array(2),this.keys=null}function l(e){o.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}r(l,o),e.exports=l,l.create=function(e){return new l(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];l.prototype.deriveKeys=function(e,t){e.keys=new Array(32),s.equal(t.length,this.blockSize,"Invalid key length");var i=n.readUInt32BE(t,0),r=n.readUInt32BE(t,4);n.pc1(i,r,e.tmp,0),i=e.tmp[0],r=e.tmp[1];for(var o=0;o<e.keys.length;o+=2){var a=c[o>>>1];i=n.r28shl(i,a),r=n.r28shl(r,a),n.pc2(i,r,e.keys,o)}},l.prototype._update=function(e,t,i,s){var r=this._desState,o=n.readUInt32BE(e,t),a=n.readUInt32BE(e,t+4);n.ip(o,a,r.tmp,0),o=r.tmp[0],a=r.tmp[1],"encrypt"===this.type?this._encrypt(r,o,a,r.tmp,0):this._decrypt(r,o,a,r.tmp,0),o=r.tmp[0],a=r.tmp[1],n.writeUInt32BE(i,o,s),n.writeUInt32BE(i,a,s+4)},l.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var i=e.length-t,s=t;s<e.length;s++)e[s]=i;return!0},l.prototype._unpad=function(e){if(!1===this.padding)return e;for(var t=e[e.length-1],i=e.length-t;i<e.length;i++)s.equal(e[i],t);return e.slice(0,e.length-t)},l.prototype._encrypt=function(e,t,i,s,r){for(var o=t,a=i,l=0;l<e.keys.length;l+=2){var c=e.keys[l],h=e.keys[l+1];n.expand(a,e.tmp,0),c^=e.tmp[0],h^=e.tmp[1];var d=n.substitute(c,h),u=a;a=(o^n.permute(d))>>>0,o=u}n.rip(a,o,s,r)},l.prototype._decrypt=function(e,t,i,s,r){for(var o=i,a=t,l=e.keys.length-2;l>=0;l-=2){var c=e.keys[l],h=e.keys[l+1];n.expand(o,e.tmp,0),c^=e.tmp[0],h^=e.tmp[1];var d=n.substitute(c,h),u=o;o=(a^n.permute(d))>>>0,a=u}n.rip(o,a,s,r)}},62597(e,t,i){"use strict";var s=i(35578),r=i(91193),n=i(96242),o=i(7325);function a(e,t){s.equal(t.length,24,"Invalid key length");var i=t.slice(0,8),r=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:r}),o.create({type:"encrypt",key:n})]:[o.create({type:"decrypt",key:n}),o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:i})]}function l(e){n.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}r(l,n),e.exports=l,l.create=function(e){return new l(e)},l.prototype._update=function(e,t,i,s){var r=this._edeState;r.ciphers[0]._update(e,t,i,s),r.ciphers[1]._update(i,s,i,s),r.ciphers[2]._update(i,s,i,s)},l.prototype._pad=o.prototype._pad,l.prototype._unpad=o.prototype._unpad},26012(e,t){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,i){e[0+i]=t>>>24,e[1+i]=t>>>16&255,e[2+i]=t>>>8&255,e[3+i]=255&t},t.ip=function(e,t,i,s){for(var r=0,n=0,o=6;o>=0;o-=2){for(var a=0;a<=24;a+=8)r<<=1,r|=t>>>a+o&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>>a+o&1}for(o=6;o>=0;o-=2){for(a=1;a<=25;a+=8)n<<=1,n|=t>>>a+o&1;for(a=1;a<=25;a+=8)n<<=1,n|=e>>>a+o&1}i[s+0]=r>>>0,i[s+1]=n>>>0},t.rip=function(e,t,i,s){for(var r=0,n=0,o=0;o<4;o++)for(var a=24;a>=0;a-=8)r<<=1,r|=t>>>a+o&1,r<<=1,r|=e>>>a+o&1;for(o=4;o<8;o++)for(a=24;a>=0;a-=8)n<<=1,n|=t>>>a+o&1,n<<=1,n|=e>>>a+o&1;i[s+0]=r>>>0,i[s+1]=n>>>0},t.pc1=function(e,t,i,s){for(var r=0,n=0,o=7;o>=5;o--){for(var a=0;a<=24;a+=8)r<<=1,r|=t>>a+o&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>a+o&1}for(a=0;a<=24;a+=8)r<<=1,r|=t>>a+o&1;for(o=1;o<=3;o++){for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+o&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+o&1}for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+o&1;i[s+0]=r>>>0,i[s+1]=n>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,s,r){for(var n=0,o=0,a=i.length>>>1,l=0;l<a;l++)n<<=1,n|=e>>>i[l]&1;for(l=a;l<i.length;l++)o<<=1,o|=t>>>i[l]&1;s[r+0]=n>>>0,s[r+1]=o>>>0},t.expand=function(e,t,i){var s=0,r=0;s=(1&e)<<5|e>>>27;for(var n=23;n>=15;n-=4)s<<=6,s|=e>>>n&63;for(n=11;n>=3;n-=4)r|=e>>>n&63,r<<=6;r|=(31&e)<<1|e>>>31,t[i+0]=s>>>0,t[i+1]=r>>>0};var s=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var i=0,r=0;r<4;r++)i<<=4,i|=s[64*r+(e>>>18-6*r&63)];for(r=0;r<4;r++)i<<=4,i|=s[256+64*r+(t>>>18-6*r&63)];return i>>>0};var r=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,i=0;i<r.length;i++)t<<=1,t|=e>>>r[i]&1;return t>>>0},t.padSplit=function(e,t,i){for(var s=e.toString(2);s.length<t;)s="0"+s;for(var r=[],n=0;n<t;n+=i)r.push(s.slice(n,n+i));return r.join(" ")}},35835(e,t,i){var s=i(25122),r=i(37821),n=i(29242),o={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new Buffer(r[e].prime,"hex"),i=new Buffer(r[e].gen,"hex");return new n(t,i)},t.createDiffieHellman=t.DiffieHellman=function e(t,i,r,a){return Buffer.isBuffer(i)||void 0===o[i]?e(t,"binary",i,r):(i=i||"binary",a=a||"binary",r=r||new Buffer([2]),Buffer.isBuffer(r)||(r=new Buffer(r,a)),"number"==typeof t?new n(s(t,r),r,!0):(Buffer.isBuffer(t)||(t=new Buffer(t,i)),new n(t,r,!0)))}},29242(e,t,i){var s=i(5630),r=new(i(74442)),n=new s(24),o=new s(11),a=new s(10),l=new s(3),c=new s(7),h=i(25122),d=i(82869);function u(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._pub=new s(e),this}function p(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._priv=new s(e),this}e.exports=m;var g={};function m(e,t,i){this.setGenerator(t),this.__prime=new s(e),this._prime=s.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=u,this.setPrivateKey=p):this._primeCode=8}function f(e,t){var i=new Buffer(e.toArray());return t?i.toString(t):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var i=t.toString("hex"),s=[i,e.toString(16)].join("_");if(s in g)return g[s];var d,u=0;if(e.isEven()||!h.simpleSieve||!h.fermatTest(e)||!r.test(e))return u+=1,u+="02"===i||"05"===i?8:4,g[s]=u,u;switch(r.test(e.shrn(1))||(u+=2),i){case"02":e.mod(n).cmp(o)&&(u+=8);break;case"05":(d=e.mod(a)).cmp(l)&&d.cmp(c)&&(u+=8);break;default:u+=4}return g[s]=u,u}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new s(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(e){var t=(e=(e=new s(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new Buffer(t.toArray()),r=this.getPrime();if(i.length<r.length){var n=new Buffer(r.length-i.length);n.fill(0),i=Buffer.concat([n,i])}return i},m.prototype.getPublicKey=function(e){return f(this._pub,e)},m.prototype.getPrivateKey=function(e){return f(this._priv,e)},m.prototype.getPrime=function(e){return f(this.__prime,e)},m.prototype.getGenerator=function(e){return f(this._gen,e)},m.prototype.setGenerator=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.__gen=e,this._gen=new s(e),this}},25122(e,t,i){var s=i(82869);e.exports=v,v.simpleSieve=f,v.fermatTest=y;var r=i(5630),n=new r(24),o=new(i(74442)),a=new r(1),l=new r(2),c=new r(5),h=(new r(16),new r(8),new r(10)),d=new r(3),u=(new r(7),new r(11)),p=new r(4),g=(new r(12),null);function m(){if(null!==g)return g;var e=[];e[0]=2;for(var t=1,i=3;i<1048576;i+=2){for(var s=Math.ceil(Math.sqrt(i)),r=0;r<t&&e[r]<=s&&i%e[r]!==0;r++);t!==r&&e[r]<=s||(e[t++]=i)}return g=e,e}function f(e){for(var t=m(),i=0;i<t.length;i++)if(0===e.modn(t[i]))return 0===e.cmpn(t[i]);return!0}function y(e){var t=r.mont(e);return 0===l.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function v(e,t){if(e<16)return new r(2===t||5===t?[140,123]:[140,39]);var i,g;for(t=new r(t);;){for(i=new r(s(Math.ceil(e/8)));i.bitLength()>e;)i.ishrn(1);if(i.isEven()&&i.iadd(a),i.testn(1)||i.iadd(l),t.cmp(l)){if(!t.cmp(c))for(;i.mod(h).cmp(d);)i.iadd(p)}else for(;i.mod(n).cmp(u);)i.iadd(p);if(f(g=i.shrn(1))&&f(i)&&y(g)&&y(i)&&o.test(g)&&o.test(i))return i}}},24310(e,t,i){"use strict";function s(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}i.d(t,{A:()=>s})},48532(e,t,i){"use strict";function s(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function r(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=s(e.className,t):e.setAttribute("class",s(e.className&&e.className.baseVal||"",t))}i.d(t,{A:()=>r})},38383(e,t,i){"use strict";const s=i(72856),r=new Set(["__proto__","prototype","constructor"]);function n(e){const t=e.split("."),i=[];for(let e=0;e<t.length;e++){let s=t[e];for(;"\\"===s[s.length-1]&&void 0!==t[e+1];)s=s.slice(0,-1)+".",s+=t[++e];i.push(s)}return i.some(e=>r.has(e))?[]:i}e.exports={get(e,t,i){if(!s(e)||"string"!=typeof t)return void 0===i?e:i;const r=n(t);if(0!==r.length){for(let t=0;t<r.length;t++)if(null==(e=e[r[t]])){if(t!==r.length-1)return i;break}return void 0===e?i:e}},set(e,t,i){if(!s(e)||"string"!=typeof t)return e;const r=e,o=n(t);for(let t=0;t<o.length;t++){const r=o[t];s(e[r])||(e[r]={}),t===o.length-1&&(e[r]=i),e=e[r]}return r},delete(e,t){if(!s(e)||"string"!=typeof t)return!1;const i=n(t);for(let t=0;t<i.length;t++){const r=i[t];if(t===i.length-1)return delete e[r],!0;if(e=e[r],!s(e))return!1}},has(e,t){if(!s(e)||"string"!=typeof t)return!1;const i=n(t);if(0===i.length)return!1;for(let t=0;t<i.length;t++){if(!s(e))return!1;if(!(i[t]in e))return!1;e=e[i[t]]}return!0}}},86858(e,t,i){"use strict";function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){r(e,t,i[t])})}return e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(84433),o=i(41671),a=i(40643),l=i(31527),c=i(58267),h=i(59539),d=i(12634),u=i(17595),p=i(99251),g=i(83886),m=u("draft_tree_data_support"),f=m?l:a,y=p.List,v=p.Repeat,C={insertAtomicBlock:function(e,t,i){var r=e.getCurrentContent(),a=e.getSelection(),l=c.removeRange(r,a,"backward"),u=l.getSelectionAfter(),p=c.splitBlock(l,u),g=p.getSelectionAfter(),C=c.setBlockType(p,g,"atomic"),b=o.create({entity:t}),S={key:d(),type:"atomic",text:i,characterList:y(v(b,i.length))},w={key:d(),type:"unstyled"};m&&(S=s({},S,{nextSibling:w.key}),w=s({},w,{prevSibling:S.key}));var x=[new f(S),new f(w)],E=n.createFromArray(x),M=c.replaceWithFragment(C,g,E),A=M.merge({selectionBefore:a,selectionAfter:M.getSelectionAfter().set("hasFocus",!0)});return h.push(e,A,"insert-fragment")},moveAtomicBlock:function(e,t,i,s){var r,n=e.getCurrentContent(),o=e.getSelection();if("before"===s||"after"===s){var a=n.getBlockForKey("before"===s?i.getStartKey():i.getEndKey());r=g(n,t,a,s)}else{var l=c.removeRange(n,i,"backward"),d=l.getSelectionAfter(),u=l.getBlockForKey(d.getFocusKey());if(0===d.getStartOffset())r=g(l,t,u,"before");else if(d.getEndOffset()===u.getLength())r=g(l,t,u,"after");else{var p=c.splitBlock(l,d),m=p.getSelectionAfter(),f=p.getBlockForKey(m.getFocusKey());r=g(p,t,f,"before")}}var y=r.merge({selectionBefore:o,selectionAfter:r.getSelectionAfter().set("hasFocus",!0)});return h.push(e,y,"move-block")}};e.exports=C},84433(e,t,i){"use strict";var s=i(99251).OrderedMap,r={createFromArray:function(e){return s(e.map(function(e){return[e.getKey(),e]}))}};e.exports=r},52568(e,t,i){"use strict";function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var r=i(14910),n=i(68768),o=i(99251),a=o.List,l=o.Repeat,c=o.Record,h=function(){return!0},d=c({start:null,end:null}),u=c({start:null,end:null,decoratorKey:null,leaves:null}),p={generate:function(e,t,i){var s=t.getLength();if(!s)return a.of(new u({start:0,end:0,decoratorKey:null,leaves:a.of(new d({start:0,end:0}))}));var n=[],o=i?i.getDecorations(t,e):a(l(null,s)),c=t.getCharacterList();return r(o,g,h,function(e,t){var i,s,l,p;n.push(new u({start:e,end:t,decoratorKey:o.get(e),leaves:(i=c.slice(e,t).toList(),s=e,l=[],p=i.map(function(e){return e.getStyle()}).toList(),r(p,g,h,function(e,t){l.push(new d({start:e+s,end:t+s}))}),a(l))}))}),a(n)},fromJS:function(e){var t=e.leaves,i=function(e,t){if(null==e)return{};var i,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)i=n[s],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,["leaves"]);return new u(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),r.forEach(function(t){s(e,t,i[t])})}return e}({},i,{leaves:null!=t?a(Array.isArray(t)?t:n(t)).map(function(e){return d(e)}):null}))}};function g(e,t){return e===t}e.exports=p},41671(e,t,i){"use strict";var s=i(99251),r=s.Map,n=s.OrderedSet,o=s.Record,a=n(),l={style:a,entity:null},c=function(e){var t,i;function s(){return e.apply(this,arguments)||this}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var o=s.prototype;return o.getStyle=function(){return this.get("style")},o.getEntity=function(){return this.get("entity")},o.hasStyle=function(e){return this.getStyle().includes(e)},s.applyStyle=function(e,t){var i=e.set("style",e.getStyle().add(t));return s.create(i)},s.removeStyle=function(e,t){var i=e.set("style",e.getStyle().remove(t));return s.create(i)},s.applyEntity=function(e,t){var i=e.getEntity()===t?e:e.set("entity",t);return s.create(i)},s.create=function(e){if(!e)return h;var t=r({style:a,entity:null}).merge(e),i=d.get(t);if(i)return i;var n=new s(t);return d=d.set(t,n),n},s.fromJS=function(e){var t=e.style,i=e.entity;return new s({style:Array.isArray(t)?n(t):t,entity:Array.isArray(i)?n(i):i})},s}(o(l)),h=new c,d=r([[r(l),h]]);c.EMPTY=h,e.exports=c},9294(e,t,i){"use strict";var s=i(99251).List,r=function(){function e(e){var t,i;i=void 0,(t="_decorators")in this?Object.defineProperty(this,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):this[t]=i,this._decorators=e.slice()}var t=e.prototype;return t.getDecorations=function(e,t){var i=Array(e.getText().length).fill(null);return this._decorators.forEach(function(s,r){var n=0;(0,s.strategy)(e,function(e,t){(function(e,t,i){for(var s=t;s<i;s++)if(null!=e[s])return!1;return!0})(i,e,t)&&(function(e,t,i,s){for(var r=t;r<i;r++)e[r]=s}(i,e,t,r+"."+n),n++)},t)}),s(i)},t.getComponentForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].component},t.getPropsForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].props},e}();e.exports=r},40643(e,t,i){"use strict";var s=i(41671),r=i(14910),n=i(99251),o=n.List,a=n.Map,l=n.OrderedSet,c=n.Record,h=n.Repeat,d=l(),u=function(e){var t,i;function n(t){return e.call(this,function(e){if(!e)return e;var t=e.characterList,i=e.text;return i&&!t&&(e.characterList=o(h(s.EMPTY,i.length))),e}(t))||this}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var a=n.prototype;return a.getKey=function(){return this.get("key")},a.getType=function(){return this.get("type")},a.getText=function(){return this.get("text")},a.getCharacterList=function(){return this.get("characterList")},a.getLength=function(){return this.getText().length},a.getDepth=function(){return this.get("depth")},a.getData=function(){return this.get("data")},a.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():d},a.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},a.findStyleRanges=function(e,t){r(this.getCharacterList(),p,e,t)},a.findEntityRanges=function(e,t){r(this.getCharacterList(),g,e,t)},n}(c({key:"",type:"unstyled",text:"",characterList:o(),depth:0,data:a()}));function p(e,t){return e.getStyle()===t.getStyle()}function g(e,t){return e.getEntity()===t.getEntity()}e.exports=u},31527(e,t,i){"use strict";var s=i(41671),r=i(14910),n=i(99251),o=n.List,a=n.Map,l=n.OrderedSet,c=n.Record,h=n.Repeat,d=l(),u={parent:null,characterList:o(),data:a(),depth:0,key:"",text:"",type:"unstyled",children:o(),prevSibling:null,nextSibling:null},p=function(e,t){return e.getStyle()===t.getStyle()},g=function(e,t){return e.getEntity()===t.getEntity()},m=function(e){var t,i;function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.call(this,function(e){if(!e)return e;var t=e.characterList,i=e.text;return i&&!t&&(e.characterList=o(h(s.EMPTY,i.length))),e}(t))||this}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var a=n.prototype;return a.getKey=function(){return this.get("key")},a.getType=function(){return this.get("type")},a.getText=function(){return this.get("text")},a.getCharacterList=function(){return this.get("characterList")},a.getLength=function(){return this.getText().length},a.getDepth=function(){return this.get("depth")},a.getData=function(){return this.get("data")},a.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():d},a.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},a.getChildKeys=function(){return this.get("children")},a.getParentKey=function(){return this.get("parent")},a.getPrevSiblingKey=function(){return this.get("prevSibling")},a.getNextSiblingKey=function(){return this.get("nextSibling")},a.findStyleRanges=function(e,t){r(this.getCharacterList(),p,e,t)},a.findEntityRanges=function(e,t){r(this.getCharacterList(),g,e,t)},n}(c(u));e.exports=m},23315(e,t,i){"use strict";function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){r(e,t,i[t])})}return e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(84433),o=i(41671),a=i(40643),l=i(31527),c=i(70873),h=i(27442),d=i(12634),u=i(68768),p=i(17595),g=i(99251),m=i(10160),f=g.List,y=g.Record,v=g.Repeat,C=g.Map,b=g.OrderedMap,S=y({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),w=p("draft_tree_data_support")?l:a,x=function(e){var t,i;function r(){return e.apply(this,arguments)||this}i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var a=r.prototype;return a.getEntityMap=function(){return c},a.getBlockMap=function(){return this.get("blockMap")},a.getSelectionBefore=function(){return this.get("selectionBefore")},a.getSelectionAfter=function(){return this.get("selectionAfter")},a.getBlockForKey=function(e){return this.getBlockMap().get(e)},a.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},a.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},a.getBlockAfter=function(e){return this.getBlockMap().skipUntil(function(t,i){return i===e}).skip(1).first()},a.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil(function(t,i){return i===e}).skip(1).first()},a.getBlocksAsArray=function(){return this.getBlockMap().toArray()},a.getFirstBlock=function(){return this.getBlockMap().first()},a.getLastBlock=function(){return this.getBlockMap().last()},a.getPlainText=function(e){return this.getBlockMap().map(function(e){return e?e.getText():""}).join(e||"\n")},a.getLastCreatedEntityKey=function(){return c.__getLastCreatedEntityKey()},a.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},a.createEntity=function(e,t,i){return c.__create(e,t,i),this},a.mergeEntityData=function(e,t){return c.__mergeData(e,t),this},a.replaceEntityData=function(e,t){return c.__replaceData(e,t),this},a.addEntity=function(e){return c.__add(e),this},a.getEntity=function(e){return c.__get(e)},a.getAllEntities=function(){return c.__getAll()},a.loadWithEntities=function(e){return c.__loadWithEntities(e)},r.createFromBlockArray=function(e,t){var i=Array.isArray(e)?e:e.contentBlocks,s=n.createFromArray(i),o=s.isEmpty()?new h:h.createEmpty(s.first().getKey());return new r({blockMap:s,entityMap:t||c,selectionBefore:o,selectionAfter:o})},r.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,i=e.split(t).map(function(e){return e=m(e),new w({key:d(),text:e,type:"unstyled",characterList:f(v(o.EMPTY,e.length))})});return r.createFromBlockArray(i)},r.fromJS=function(e){return new r(s({},e,{blockMap:b(e.blockMap).map(r.createContentBlockFromJS),selectionBefore:new h(e.selectionBefore),selectionAfter:new h(e.selectionAfter)}))},r.createContentBlockFromJS=function(e){var t=e.characterList;return new w(s({},e,{data:C(e.data),characterList:null!=t?f((Array.isArray(t)?t:u(t)).map(function(e){return o.fromJS(e)})):void 0}))},r}(S);e.exports=x},61773(e,t,i){"use strict";var s=i(41671),r=i(99251).Map,n={add:function(e,t,i){return o(e,t,i,!0)},remove:function(e,t,i){return o(e,t,i,!1)}};function o(e,t,i,n){var o=e.getBlockMap(),a=t.getStartKey(),l=t.getStartOffset(),c=t.getEndKey(),h=t.getEndOffset(),d=o.skipUntil(function(e,t){return t===a}).takeUntil(function(e,t){return t===c}).concat(r([[c,o.get(c)]])).map(function(e,t){var r,o;a===c?(r=l,o=h):(r=t===a?l:0,o=t===c?h:e.getLength());for(var d,u=e.getCharacterList();r<o;)d=u.get(r),u=u.set(r,n?s.applyStyle(d,i):s.removeStyle(d,i)),r++;return e.set("characterList",u)});return e.merge({blockMap:o.merge(d),selectionBefore:t,selectionAfter:t})}e.exports=n},94199(e,t,i){"use strict";function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var r=i(63390),n=i(65461),o=i(82826),a=i(99251),l=i(40041),c=i(25813),h=a.Map,d={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},u=r.isBrowser("IE <= 11"),p=function(){function e(e){var t=this;s(this,"observer",void 0),s(this,"container",void 0),s(this,"mutations",void 0),s(this,"onCharData",void 0),this.container=e,this.mutations=h();var i=o(e);i.MutationObserver&&!u?this.observer=new i.MutationObserver(function(e){return t.registerMutations(e)}):this.onCharData=function(e){e.target instanceof Node||l(!1),t.registerMutation({type:"characterData",target:e.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,d):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var t=this.mutations;return this.mutations=h(),t},t.registerMutations=function(e){for(var t=0;t<e.length;t++)this.registerMutation(e[t])},t.getMutationTextContent=function(e){var t=e.type,i=e.target,s=e.removedNodes;if("characterData"===t){if(""!==i.textContent)return u?i.textContent.replace("\n",""):i.textContent}else if("childList"===t){if(s&&s.length)return"";if(""!==i.textContent)return i.textContent}return null},t.registerMutation=function(e){var t=this.getMutationTextContent(e);if(null!=t){var i=c(n(e.target));this.mutations=this.mutations.set(i,t)}},e}();e.exports=p},47904(e,t,i){"use strict";var s=i(22155),r=i(22978),n=(0,i(99251).Map)({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:s.createElement("ul",{className:r("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:s.createElement("ol",{className:r("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:s.createElement("pre",{className:r("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=n},55175(e){"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},53506(e,t,i){"use strict";var s=i(86858),r=i(84433),n=i(41671),o=i(9294),a=i(40643),l=i(23315),c=i(47904),h=i(55175),d=i(13162),u=i(92063),p=i(70873),g=i(58267),m=i(72066),f=i(59539),y=i(8117),v=i(79198),C=i(75969),b=i(27442),S=i(93613),w=i(12503),x=i(12634),E=i(93564),M=i(50531),A={Editor:d,EditorBlock:u,EditorState:f,CompositeDecorator:o,Entity:p,EntityInstance:m,BlockMapBuilder:r,CharacterMetadata:n,ContentBlock:a,ContentState:l,RawDraftContentState:v,SelectionState:b,AtomicBlockUtils:s,KeyBindingUtil:y,Modifier:g,RichUtils:C,DefaultDraftBlockRenderMap:c,DefaultDraftInlineStyle:h,convertFromHTML:i(86739),convertFromRaw:w,convertToRaw:S,genKey:x,getDefaultKeyBinding:E,getVisibleSelectionRect:M};e.exports=A},13162(e,t,i){"use strict";var s=i(46084);function r(){return r=s||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){a(e,t,i[t])})}return e}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var c=i(47904),h=i(55175),d=i(60913),u=i(74804),p=i(38001),g=i(51163),m=i(94951),f=i(12803),y=i(7618),v=i(59539),C=i(22155),b=i(72528),S=i(98556),w=i(63390),x=i(22978),E=i(12634),M=i(93564),A=i(93987),T=i(17595),D=i(40041),I=i(44110),R=i(25813),P=w.isBrowser("IE"),k=!P,L={edit:g,composite:d,drag:p,cut:null,render:null},N=!1,_=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var i=t.prototype;return i.render=function(){return null},i.componentDidMount=function(){this._update()},i.componentDidUpdate=function(){this._update()},i._update=function(){var e=this.props.editor;e._latestEditorState=this.props.editorState,e._blockSelectEvents=!0},t}(C.Component),O=function(e){function t(t){var i;return a(o(i=e.call(this,t)||this),"_blockSelectEvents",void 0),a(o(i),"_clipboard",void 0),a(o(i),"_handler",void 0),a(o(i),"_dragCount",void 0),a(o(i),"_internalDrag",void 0),a(o(i),"_editorKey",void 0),a(o(i),"_placeholderAccessibilityID",void 0),a(o(i),"_latestEditorState",void 0),a(o(i),"_latestCommittedEditorState",void 0),a(o(i),"_pendingStateFromBeforeInput",void 0),a(o(i),"_onBeforeInput",void 0),a(o(i),"_onBlur",void 0),a(o(i),"_onCharacterData",void 0),a(o(i),"_onCompositionEnd",void 0),a(o(i),"_onCompositionStart",void 0),a(o(i),"_onCopy",void 0),a(o(i),"_onCut",void 0),a(o(i),"_onDragEnd",void 0),a(o(i),"_onDragOver",void 0),a(o(i),"_onDragStart",void 0),a(o(i),"_onDrop",void 0),a(o(i),"_onInput",void 0),a(o(i),"_onFocus",void 0),a(o(i),"_onKeyDown",void 0),a(o(i),"_onKeyPress",void 0),a(o(i),"_onKeyUp",void 0),a(o(i),"_onMouseDown",void 0),a(o(i),"_onMouseUp",void 0),a(o(i),"_onPaste",void 0),a(o(i),"_onSelect",void 0),a(o(i),"editor",void 0),a(o(i),"editorContainer",void 0),a(o(i),"focus",void 0),a(o(i),"blur",void 0),a(o(i),"setMode",void 0),a(o(i),"exitCurrentMode",void 0),a(o(i),"restoreEditorDOM",void 0),a(o(i),"setClipboard",void 0),a(o(i),"getClipboard",void 0),a(o(i),"getEditorKey",void 0),a(o(i),"update",void 0),a(o(i),"onDragEnter",void 0),a(o(i),"onDragLeave",void 0),a(o(i),"_handleEditorContainerRef",function(e){i.editorContainer=e,i.editor=null!==e?e.firstChild:null}),a(o(i),"focus",function(e){var t=i.props.editorState,s=t.getSelection().getHasFocus(),r=i.editor;if(r){var n=S.getScrollParent(r),o=e||A(n),a=o.x,l=o.y;I(r)||D(!1),r.focus(),n===window?window.scrollTo(a,l):b.setTop(n,l),s||i.update(v.forceSelection(t,t.getSelection()))}}),a(o(i),"blur",function(){var e=i.editor;e&&(I(e)||D(!1),e.blur())}),a(o(i),"setMode",function(e){var t=i.props,s=t.onPaste,r=t.onCut,o=t.onCopy,a=n({},L.edit);s&&(a.onPaste=s),r&&(a.onCut=r),o&&(a.onCopy=o);var l=n({},L,{edit:a});i._handler=l[e]}),a(o(i),"exitCurrentMode",function(){i.setMode("edit")}),a(o(i),"restoreEditorDOM",function(e){i.setState({contentsKey:i.state.contentsKey+1},function(){i.focus(e)})}),a(o(i),"setClipboard",function(e){i._clipboard=e}),a(o(i),"getClipboard",function(){return i._clipboard}),a(o(i),"update",function(e){i._latestEditorState=e,i.props.onChange(e)}),a(o(i),"onDragEnter",function(){i._dragCount++}),a(o(i),"onDragLeave",function(){i._dragCount--,0===i._dragCount&&i.exitCurrentMode()}),i._blockSelectEvents=!1,i._clipboard=null,i._handler=null,i._dragCount=0,i._editorKey=t.editorKey||E(),i._placeholderAccessibilityID="placeholder-"+i._editorKey,i._latestEditorState=t.editorState,i._latestCommittedEditorState=t.editorState,i._onBeforeInput=i._buildHandler("onBeforeInput"),i._onBlur=i._buildHandler("onBlur"),i._onCharacterData=i._buildHandler("onCharacterData"),i._onCompositionEnd=i._buildHandler("onCompositionEnd"),i._onCompositionStart=i._buildHandler("onCompositionStart"),i._onCopy=i._buildHandler("onCopy"),i._onCut=i._buildHandler("onCut"),i._onDragEnd=i._buildHandler("onDragEnd"),i._onDragOver=i._buildHandler("onDragOver"),i._onDragStart=i._buildHandler("onDragStart"),i._onDrop=i._buildHandler("onDrop"),i._onInput=i._buildHandler("onInput"),i._onFocus=i._buildHandler("onFocus"),i._onKeyDown=i._buildHandler("onKeyDown"),i._onKeyPress=i._buildHandler("onKeyPress"),i._onKeyUp=i._buildHandler("onKeyUp"),i._onMouseDown=i._buildHandler("onMouseDown"),i._onMouseUp=i._buildHandler("onMouseUp"),i._onPaste=i._buildHandler("onPaste"),i._onSelect=i._buildHandler("onSelect"),i.getEditorKey=function(){return i._editorKey},i.state={contentsKey:0},i}l(t,e);var i=t.prototype;return i._buildHandler=function(e){var t=this;return function(i){if(!t.props.readOnly){var s=t._handler&&t._handler[e];s&&(m?m(function(){return s(t,i)}):s(t,i))}}},i._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},i._renderPlaceholder=function(){if(this._showPlaceholder()){var e={text:R(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return C.createElement(f,e)}return null},i._renderARIADescribedBy=function(){var e=this.props.ariaDescribedBy||"",t=this._showPlaceholder()?this._placeholderAccessibilityID:"";return e.replace("{{editor_id_placeholder}}",t)||void 0},i.render=function(){var e=this.props,t=e.blockRenderMap,i=e.blockRendererFn,s=e.blockStyleFn,o=e.customStyleFn,a=e.customStyleMap,l=e.editorState,c=e.preventScroll,d=e.readOnly,p=e.textAlignment,g=e.textDirectionality,m=x({"DraftEditor/root":!0,"DraftEditor/alignLeft":"left"===p,"DraftEditor/alignRight":"right"===p,"DraftEditor/alignCenter":"center"===p}),f=this.props.role||"textbox",y="combobox"===f?!!this.props.ariaExpanded:null,v={blockRenderMap:t,blockRendererFn:i,blockStyleFn:s,customStyleMap:n({},h,a),customStyleFn:o,editorKey:this._editorKey,editorState:l,preventScroll:c,textDirectionality:g};return C.createElement("div",{className:m},this._renderPlaceholder(),C.createElement("div",{className:x("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},C.createElement("div",{"aria-activedescendant":d?null:this.props.ariaActiveDescendantID,"aria-autocomplete":d?null:this.props.ariaAutoComplete,"aria-controls":d?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":d?null:y,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":d?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:x({notranslate:!d,"public/DraftEditor/content":!0}),contentEditable:!d,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:d?null:f,spellCheck:k&&this.props.spellCheck,style:{outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},C.createElement(_,{editor:this,editorState:l}),C.createElement(u,r({},v,{key:"contents"+this.state.contentsKey})))))},i.componentDidMount=function(){this._blockSelectEvents=!1,!N&&T("draft_ods_enabled")&&(N=!0,y.initODS()),this.setMode("edit"),P&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):globalThis.execCommand("AutoUrlDetect",!1,!1))},i.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},t}(C.Component);a(O,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:c,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:M,readOnly:!1,spellCheck:!1,stripPastedStyles:!1}),e.exports=O},92063(e,t,i){"use strict";var s=i(46084);function r(){return r=s||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}var n=i(49162),o=i(13878),a=i(22155),l=i(72528),c=i(98556),h=i(46616),d=i(76675),u=i(22978),p=i(5026),g=i(93987),m=i(68982),f=i(40041),y=i(44110),v=i(25813),C=function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t},b=function(e){var t,i;function s(){for(var t,i,s,r,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=void 0,(s="_node")in(i=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(o))||this))?Object.defineProperty(i,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[s]=r,t}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var b=s.prototype;return b.shouldComponentUpdate=function(e){return this.props.block!==e.block||this.props.tree!==e.tree||this.props.direction!==e.direction||C(e.selection,e.block.getKey())&&e.forceSelection},b.componentDidMount=function(){if(!this.props.preventScroll){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var i=this._node;if(null!=i){var s,r=c.getScrollParent(i),n=g(r);if(r===window){var o=p(i);(s=o.y+o.height-m().height)>0&&window.scrollTo(n.x,n.y+s+10)}else y(i)||f(!1),(s=i.offsetHeight+i.offsetTop-(r.offsetTop+r.offsetHeight+n.y))>0&&l.setTop(r,l.getTop(r)+s+10)}}}},b._renderChildren=function(){var e=this,t=this.props.block,i=t.getKey(),s=t.getText(),l=this.props.tree.size-1,c=C(this.props.selection,i);return this.props.tree.map(function(u,p){var g=u.get("leaves");if(0===g.size)return null;var m=g.size-1,f=g.map(function(r,h){var d=o.encode(i,p,h),u=r.get("start"),g=r.get("end");return a.createElement(n,{key:d,offsetKey:d,block:t,start:u,selection:c?e.props.selection:null,forceSelection:e.props.forceSelection,text:s.slice(u,g),styleSet:t.getInlineStyleAt(u),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:p===l&&h===m})}).toArray(),y=u.get("decoratorKey");if(null==y)return f;if(!e.props.decorator)return f;var C=v(e.props.decorator),b=C.getComponentForKey(y);if(!b)return f;var S=C.getPropsForKey(y),w=o.encode(i,p,0),x=g.first().get("start"),E=g.last().get("end"),M=s.slice(x,E),A=t.getEntityAt(u.get("start")),T=d.getHTMLDirIfDifferent(h.getDirection(M),e.props.direction),D={contentState:e.props.contentState,decoratedText:M,dir:T,start:x,end:E,blockKey:i,entityKey:A,offsetKey:w};return a.createElement(b,r({},S,D,{key:w}),f)}).toArray()},b.render=function(){var e=this,t=this.props,i=t.direction,s=t.offsetKey,r=u({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===i,"public/DraftStyleDefault/rtl":"RTL"===i});return a.createElement("div",{"data-offset-key":s,className:r,ref:function(t){return e._node=t}},this._renderChildren())},s}(a.Component);e.exports=b},35063(e,t,i){"use strict";var s=i(46084);function r(){return r=s||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){o(e,t,i[t])})}return e}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a=i(92694),l=i(13878),c=i(22155),h=i(72528),d=i(98556),u=i(5026),p=i(93987),g=i(68982),m=i(99251),f=i(40041),y=i(44110),v=(m.List,function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t}),C=function(e,t){var i=t.get(e.getType())||t.get("unstyled"),s=i.wrapper;return{Element:i.element||t.get("unstyled").element,wrapperTemplate:s}},b=function(e,t){var i=t(e);return i?{CustomComponent:i.component,customProps:i.props,customEditable:i.editable}:{}},S=function(e,t,i,s,r,o){var a={"data-block":!0,"data-editor":t,"data-offset-key":i,key:e.getKey(),ref:o},l=s(e);return l&&(a.className=l),void 0!==r.customEditable&&(a=n({},a,{contentEditable:r.customEditable,suppressContentEditableWarning:!0})),a},w=function(e){var t,i;function s(){for(var t,i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];return o(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(s))||this),"wrapperRef",c.createRef()),t}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var m=s.prototype;return m.shouldComponentUpdate=function(e){var t=this.props,i=t.block,s=t.direction,r=t.tree,n=!i.getChildKeys().isEmpty(),o=i!==e.block||r!==e.tree||s!==e.direction||v(e.selection,e.block.getKey())&&e.forceSelection;return n||o},m.componentDidMount=function(){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var i=this.wrapperRef.current;if(i){var s,r=d.getScrollParent(i),n=p(r);if(r===window){var o=u(i);(s=o.y+o.height-g().height)>0&&window.scrollTo(n.x,n.y+s+10)}else{y(i)||f(!1);var a=i;(s=a.offsetHeight+a.offsetTop-(r.offsetHeight+n.y))>0&&h.setTop(r,h.getTop(r)+s+10)}}}},m.render=function(){var e=this,t=this.props,i=t.block,o=t.blockRenderMap,h=t.blockRendererFn,d=t.blockStyleFn,u=t.contentState,p=t.decorator,g=t.editorKey,m=t.editorState,f=t.customStyleFn,y=t.customStyleMap,w=t.direction,x=t.forceSelection,E=t.selection,M=t.tree,A=null;i.children.size&&(A=i.children.reduce(function(t,i){var r=l.encode(i,0,0),a=u.getBlockForKey(i),p=b(a,h),f=p.CustomComponent||s,y=C(a,o),v=y.Element,w=y.wrapperTemplate,x=S(a,g,r,d,p,null),E=n({},e.props,{tree:m.getBlockTree(i),blockProps:p.customProps,offsetKey:r,block:a});return t.push(c.createElement(v,x,c.createElement(f,E))),!w||function(e,t){var i=e.getNextSiblingKey();return!!i&&t.getBlockForKey(i).getType()===e.getType()}(a,u)||function(e,t,i){var s=[],r=!0,n=!1,o=void 0;try{for(var a,h=i.reverse()[Symbol.iterator]();!(r=(a=h.next()).done);r=!0){var d=a.value;if(d.type!==t)break;s.push(d)}}catch(e){n=!0,o=e}finally{try{r||null==h.return||h.return()}finally{if(n)throw o}}i.splice(i.indexOf(s[0]),s.length+1);var u=s.reverse(),p=u[0].key;i.push(c.cloneElement(e,{key:"".concat(p,"-wrap"),"data-offset-key":l.encode(p,0,0)},u))}(w,v,t),t},[]));var T=i.getKey(),D=l.encode(T,0,0),I=b(i,h),R=I.CustomComponent,P=null!=R?c.createElement(R,r({},this.props,{tree:m.getBlockTree(T),blockProps:I.customProps,offsetKey:D,block:i})):c.createElement(a,{block:i,children:A,contentState:u,customStyleFn:f,customStyleMap:y,decorator:p,direction:w,forceSelection:x,hasSelection:v(E,T),selection:E,tree:M});if(i.getParentKey())return P;var k=C(i,o).Element,L=S(i,g,D,d,I,this.wrapperRef);return c.createElement(k,L,P)},s}(c.Component);e.exports=w},60913(e,t,i){"use strict";var s=i(94199),r=i(58267),n=i(13878),o=i(59539),a=i(4617),l=i(63390),c=i(10292),h=i(71093),d=i(15801),u=i(60836),p=i(25813),g=l.isBrowser("IE"),m=!1,f=!1,y=null,v={onCompositionStart:function(e){f=!0,function(e){y||(y=new s(h(e))).start()}(e)},onCompositionEnd:function(e){m=!1,f=!1,setTimeout(function(){m||v.resolveComposition(e)},20)},onSelect:c,onKeyDown:function(e,t){if(!f)return v.resolveComposition(e),void e._onKeyDown(t);t.which!==a.RIGHT&&t.which!==a.LEFT||t.preventDefault()},onKeyPress:function(e,t){t.which===a.RETURN&&t.preventDefault()},resolveComposition:function(e){if(!f){var t=p(y).stopAndFlushMutations();y=null,m=!0;var i=o.set(e._latestEditorState,{inCompositionMode:!1});if(e.exitCurrentMode(),t.size){var s=i.getCurrentContent();t.forEach(function(e,t){var a=n.decode(t),l=a.blockKey,c=a.decoratorKey,h=a.leafKey,d=i.getBlockTree(l).getIn([c,"leaves",h]),p=d.start,g=d.end,m=i.getSelection().merge({anchorKey:l,focusKey:l,anchorOffset:p,focusOffset:g,isBackward:!1}),f=u(s,m),y=s.getBlockForKey(l).getInlineStyleAt(p);s=r.replaceText(s,m,e,y,f),i=o.set(i,{currentContent:s})});var a=d(i,h(e)).selectionState;e.restoreEditorDOM();var l=g?o.forceSelection(i,a):o.acceptSelection(i,a);e.update(o.push(l,s,"insert-characters"))}else e.update(i)}}};e.exports=v},47672(e,t,i){"use strict";var s=i(46084);function r(){return r=s||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){o(e,t,i[t])})}return e}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a=i(92063),l=i(13878),c=i(22155),h=i(22978),d=i(66145),u=i(25813),p=function(e,t,i,s){return h({"public/DraftStyleDefault/unorderedListItem":"unordered-list-item"===e,"public/DraftStyleDefault/orderedListItem":"ordered-list-item"===e,"public/DraftStyleDefault/reset":i,"public/DraftStyleDefault/depth0":0===t,"public/DraftStyleDefault/depth1":1===t,"public/DraftStyleDefault/depth2":2===t,"public/DraftStyleDefault/depth3":3===t,"public/DraftStyleDefault/depth4":t>=4,"public/DraftStyleDefault/listLTR":"LTR"===s,"public/DraftStyleDefault/listRTL":"RTL"===s})},g=function(e){var t,i;function s(){return e.apply(this,arguments)||this}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var o=s.prototype;return o.shouldComponentUpdate=function(e){var t=this.props.editorState,i=e.editorState;if(t.getDirectionMap()!==i.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==i.getSelection().getHasFocus())return!0;var s=i.getNativelyRenderedContent(),r=t.isInCompositionMode(),n=i.isInCompositionMode();if(t===i||null!==s&&i.getCurrentContent()===s||r&&n)return!1;var o=t.getCurrentContent(),a=i.getCurrentContent(),l=t.getDecorator(),c=i.getDecorator();return r!==n||o!==a||l!==c||i.mustForceSelection()},o.render=function(){for(var e=this.props,t=e.blockRenderMap,i=e.blockRendererFn,s=e.blockStyleFn,o=e.customStyleMap,h=e.customStyleFn,g=e.editorState,m=e.editorKey,f=e.preventScroll,y=e.textDirectionality,v=g.getCurrentContent(),C=g.getSelection(),b=g.mustForceSelection(),S=g.getDecorator(),w=u(g.getDirectionMap()),x=v.getBlocksAsArray(),E=[],M=null,A=null,T=0;T<x.length;T++){var D=x[T],I=D.getKey(),R=D.getType(),P=i(D),k=void 0,L=void 0,N=void 0;P&&(k=P.component,L=P.props,N=P.editable);var _=y||w.get(I),O=l.encode(I,0,0),F={contentState:v,block:D,blockProps:L,blockStyleFn:s,customStyleMap:o,customStyleFn:h,decorator:S,direction:_,forceSelection:b,offsetKey:O,preventScroll:f,selection:C,tree:g.getBlockTree(I)},G=t.get(R)||t.get("unstyled"),B=G.wrapper,V=G.element||t.get("unstyled").element,H=D.getDepth(),U="";s&&(U=s(D)),"li"===V&&(U=d(U,p(R,H,A!==B||null===M||H>M,_)));var z=k||a,W={className:U,"data-block":!0,"data-editor":m,"data-offset-key":O,key:I};void 0!==N&&(W=n({},W,{contentEditable:N,suppressContentEditableWarning:!0}));var j=c.createElement(V,W,c.createElement(z,r({},F,{key:I})));E.push({block:j,wrapperTemplate:B,key:I,offsetKey:O}),M=B?D.getDepth():null,A=B}for(var K=[],$=0;$<E.length;){var Y=E[$];if(Y.wrapperTemplate){var q=[];do{q.push(E[$].block),$++}while($<E.length&&E[$].wrapperTemplate===Y.wrapperTemplate);var X=c.cloneElement(Y.wrapperTemplate,{key:Y.key+"-wrap","data-offset-key":Y.offsetKey},q);K.push(X)}else K.push(Y.block),$++}return c.createElement("div",{"data-contents":"true"},K)},s}(c.Component);e.exports=g},74804(e,t,i){"use strict";var s=i(17595)("draft_tree_data_support");e.exports=i(s?88074:47672)},88074(e,t,i){"use strict";var s=i(46084);function r(){return r=s||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}var n=i(35063),o=i(13878),a=i(22155),l=i(25813),c=function(e){var t,i;function s(){return e.apply(this,arguments)||this}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var c=s.prototype;return c.shouldComponentUpdate=function(e){var t=this.props.editorState,i=e.editorState;if(t.getDirectionMap()!==i.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==i.getSelection().getHasFocus())return!0;var s=i.getNativelyRenderedContent(),r=t.isInCompositionMode(),n=i.isInCompositionMode();if(t===i||null!==s&&i.getCurrentContent()===s||r&&n)return!1;var o=t.getCurrentContent(),a=i.getCurrentContent(),l=t.getDecorator(),c=i.getDecorator();return r!==n||o!==a||l!==c||i.mustForceSelection()},c.render=function(){for(var e=this.props,t=e.blockRenderMap,i=e.blockRendererFn,s=e.blockStyleFn,c=e.customStyleMap,h=e.customStyleFn,d=e.editorState,u=e.editorKey,p=e.textDirectionality,g=d.getCurrentContent(),m=d.getSelection(),f=d.mustForceSelection(),y=d.getDecorator(),v=l(d.getDirectionMap()),C=[],b=g.getBlocksAsArray()[0];b;){var S=b.getKey(),w={blockRenderMap:t,blockRendererFn:i,blockStyleFn:s,contentState:g,customStyleFn:h,customStyleMap:c,decorator:y,editorKey:u,editorState:d,forceSelection:f,selection:m,block:b,direction:p||v.get(S),tree:d.getBlockTree(S)},x=(t.get(b.getType())||t.get("unstyled")).wrapper;C.push({block:a.createElement(n,r({key:S},w)),wrapperTemplate:x,key:S,offsetKey:o.encode(S,0,0)});var E=b.getNextSiblingKey();b=E?g.getBlockForKey(E):null}for(var M=[],A=0;A<C.length;){var T=C[A];if(T.wrapperTemplate){var D=[];do{D.push(C[A].block),A++}while(A<C.length&&C[A].wrapperTemplate===T.wrapperTemplate);var I=a.cloneElement(T.wrapperTemplate,{key:T.key+"-wrap","data-offset-key":T.offsetKey},D);M.push(I)}else M.push(T.block),A++}return a.createElement("div",{"data-contents":"true"},M)},s}(a.Component);e.exports=c},859(e,t,i){"use strict";var s=i(46084);function r(){return r=s||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}var n=i(13878),o=i(22155),a=i(46616),l=i(76675),c=function(e){var t,i;function s(){return e.apply(this,arguments)||this}return i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,s.prototype.render=function(){var e=this.props,t=e.block,i=e.children,s=e.contentState,c=e.decorator,h=e.decoratorKey,d=e.direction,u=e.leafSet,p=e.text,g=t.getKey(),m=u.get("leaves"),f=c.getComponentForKey(h),y=c.getPropsForKey(h),v=n.encode(g,parseInt(h,10),0),C=p.slice(m.first().get("start"),m.last().get("end")),b=l.getHTMLDirIfDifferent(a.getDirection(C),d);return o.createElement(f,r({},y,{contentState:s,decoratedText:C,dir:b,key:v,entityKey:t.getEntityAt(u.get("start")),offsetKey:v}),i)},s}(o.Component);e.exports=c},38001(e,t,i){"use strict";var s=i(81354),r=i(58267),n=i(59539),o=i(65461),a=i(82097),l=i(27786),c=i(69397),h=i(82826),d=i(46415),u=i(25813),p={onDragEnd:function(e){e.exitCurrentMode(),g(e)},onDrop:function(e,t){var i=new s(t.nativeEvent.dataTransfer),h=e._latestEditorState,p=function(e,t){var i=null,s=null,r=a(e.currentTarget);if("function"==typeof r.caretRangeFromPoint){var n=r.caretRangeFromPoint(e.x,e.y);i=n.startContainer,s=n.startOffset}else{if(!e.rangeParent)return null;i=e.rangeParent,s=e.rangeOffset}i=u(i),s=u(s);var l=u(o(i));return c(t,l,s,l,s)}(t.nativeEvent,h);if(t.preventDefault(),e._dragCount=0,e.exitCurrentMode(),null!=p){var f=i.getFiles();if(f.length>0){if(e.props.handleDroppedFiles&&d(e.props.handleDroppedFiles(p,f)))return;l(f,function(t){t&&e.update(m(h,p,t))})}else{var y=e._internalDrag?"internal":"external";e.props.handleDrop&&d(e.props.handleDrop(p,i,y))||(e._internalDrag?e.update(function(e,t){var i=r.moveText(e.getCurrentContent(),e.getSelection(),t);return n.push(e,i,"insert-fragment")}(h,p)):e.update(m(h,p,i.getText()))),g(e)}}}};function g(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var i=new MouseEvent("mouseup",{view:h(t),bubbles:!0,cancelable:!0});t.dispatchEvent(i)}}function m(e,t,i){var s=r.insertText(e.getCurrentContent(),t,i,e.getCurrentInlineStyle());return n.push(e,s,"insert-fragment")}e.exports=p},51163(e,t,i){"use strict";var s=i(63390),r=i(45995),n=i(23717),o=i(46438),a=i(78073),l=i(43046),c=i(76100),h=i(92244),d=i(38514),u=i(29830),p=i(41345),g=i(35346),m=i(10292),f=s.isBrowser("Chrome"),y=s.isBrowser("Firefox"),v=f||y?m:function(e){},C={onBeforeInput:r,onBlur:n,onCompositionStart:o,onCopy:a,onCut:l,onDragOver:c,onDragStart:h,onFocus:d,onInput:u,onKeyDown:p,onPaste:g,onSelect:m,onMouseUp:v,onKeyUp:v};e.exports=C},94951(e,t,i){"use strict";var s=i(70316).unstable_flushControlled;e.exports=s},49162(e,t,i){"use strict";var s=i(46084),r=i(5413),n=i(22155),o=i(40041),a=i(4734),l=i(90933).setDraftEditorSelection,c=function(e){var t,i;function c(){for(var t,i,s,r,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=void 0,(s="leaf")in(i=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(o))||this))?Object.defineProperty(i,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[s]=r,t}i=e,(t=c).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var h=c.prototype;return h._setSelection=function(){var e=this.props.selection;if(null!=e&&e.getHasFocus()){var t=this.props,i=t.block,s=t.start,r=t.text,n=i.getKey(),c=s+r.length;if(e.hasEdgeWithin(n,s,c)){var h=this.leaf;h||o(!1);var d,u=h.firstChild;u||o(!1),u.nodeType===Node.TEXT_NODE?d=u:a(u)?d=h:(d=u.firstChild)||o(!1),l(e,d,n,s,c)}}},h.shouldComponentUpdate=function(e){var t=this.leaf;return t||o(!1),t.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},h.componentDidUpdate=function(){this._setSelection()},h.componentDidMount=function(){this._setSelection()},h.render=function(){var e=this,t=this.props.block,i=this.props.text;i.endsWith("\n")&&this.props.isLast&&(i+="\n");var o=this.props,a=o.customStyleMap,l=o.customStyleFn,c=o.offsetKey,h=o.styleSet,d=h.reduce(function(e,t){var i={},r=a[t];return void 0!==r&&e.textDecoration!==r.textDecoration&&(i.textDecoration=[e.textDecoration,r.textDecoration].join(" ").trim()),s(e,r,i)},{});if(l){var u=l(h,t);d=s(d,u)}return n.createElement("span",{"data-offset-key":c,ref:function(t){return e.leaf=t},style:d},n.createElement(r,null,i))},c}(n.Component);e.exports=c},92694(e,t,i){"use strict";var s=i(859),r=i(49162),n=i(13878),o=i(99251),a=i(22155),l=i(22978),c=(o.List,function(e){var t,i;function o(){return e.apply(this,arguments)||this}return i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,o.prototype.render=function(){var e=this.props,t=e.block,i=e.contentState,o=e.customStyleFn,c=e.customStyleMap,h=e.decorator,d=e.direction,u=e.forceSelection,p=e.hasSelection,g=e.selection,m=e.tree,f=t.getKey(),y=t.getText(),v=m.size-1,C=this.props.children||m.map(function(e,l){var m=e.get("decoratorKey"),C=e.get("leaves"),b=C.size-1,S=C.map(function(e,i){var s=n.encode(f,l,i),h=e.get("start"),d=e.get("end");return a.createElement(r,{key:s,offsetKey:s,block:t,start:h,selection:p?g:null,forceSelection:u,text:y.slice(h,d),styleSet:t.getInlineStyleAt(h),customStyleMap:c,customStyleFn:o,isLast:m===v&&i===b})}).toArray();return m&&h?a.createElement(s,{block:t,children:S,contentState:i,decorator:h,decoratorKey:m,direction:d,leafSet:e,text:y,key:l}):S}).toArray();return a.createElement("div",{"data-offset-key":n.encode(f,0,0),className:l({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===d,"public/DraftStyleDefault/rtl":"RTL"===d})},C)},o}(a.Component));e.exports=c},12803(e,t,i){"use strict";var s=i(22155),r=i(22978),n=function(e){var t,i;function n(){return e.apply(this,arguments)||this}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var o=n.prototype;return o.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},o.render=function(){var e=this.props.editorState.getSelection().getHasFocus(),t=r({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":e});return s.createElement("div",{className:t},s.createElement("div",{className:r("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:{whiteSpace:"pre-wrap"}},this.props.text))},n}(s.Component);e.exports=n},5413(e,t,i){"use strict";function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(22155),o=i(63390),a=i(40041),l=i(66305),c=o.isBrowser("IE <= 11"),h=function(e){var t,i;function o(t){var i;return r(s(i=e.call(this,t)||this),"_forceFlag",void 0),r(s(i),"_node",void 0),i._forceFlag=!1,i}i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var h=o.prototype;return h.shouldComponentUpdate=function(e){var t=this._node,i=""===e.children;l(t)||a(!1);var s=t;return i?!function(e){return c?"\n"===e.textContent:"BR"===e.tagName}(s):s.textContent!==e.children},h.componentDidMount=function(){this._forceFlag=!this._forceFlag},h.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},h.render=function(){var e,t=this;return""===this.props.children?this._forceFlag?(e=function(e){return t._node=e},c?n.createElement("span",{key:"A","data-text":"true",ref:e},"\n"):n.createElement("br",{key:"A","data-text":"true",ref:e})):function(e){return c?n.createElement("span",{key:"B","data-text":"true",ref:e},"\n"):n.createElement("br",{key:"B","data-text":"true",ref:e})}(function(e){return t._node=e}):n.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true",ref:function(e){return t._node=e}},this.props.children)},o}(n.Component);e.exports=h},7618(e){"use strict";e.exports={initODS:function(){},handleExtensionCausedError:function(){}}},70873(e,t,i){"use strict";function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var r=i(72066),n=i(99251),o=i(40041),a=i(10254),l=(0,n.Map)(),c=a();function h(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var d={getLastCreatedEntityKey:function(){return h("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),d.__getLastCreatedEntityKey()},create:function(e,t,i){return h("DraftEntity.create","contentState.createEntity"),d.__create(e,t,i)},add:function(e){return h("DraftEntity.add","contentState.addEntity"),d.__add(e)},get:function(e){return h("DraftEntity.get","contentState.getEntity"),d.__get(e)},__getAll:function(){return l},__loadWithEntities:function(e){l=e,c=a()},mergeData:function(e,t){return h("DraftEntity.mergeData","contentState.mergeEntityData"),d.__mergeData(e,t)},replaceData:function(e,t){return h("DraftEntity.replaceData","contentState.replaceEntityData"),d.__replaceData(e,t)},__getLastCreatedEntityKey:function(){return c},__create:function(e,t,i){return d.__add(new r({type:e,mutability:t,data:i||{}}))},__add:function(e){return c=a(),l=l.set(c,e),c},__get:function(e){var t=l.get(e);return t||o(!1),t},__mergeData:function(e,t){var i=d.__get(e),r=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),r.forEach(function(t){s(e,t,i[t])})}return e}({},i.getData(),t),n=i.set("data",r);return l=l.set(e,n),n},__replaceData:function(e,t){var i=d.__get(e).set("data",t);return l=l.set(e,i),i}};e.exports=d},72066(e,t,i){"use strict";var s=function(e){var t,i;function s(){return e.apply(this,arguments)||this}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var r=s.prototype;return r.getType=function(){return this.get("type")},r.getMutability=function(){return this.get("mutability")},r.getData=function(){return this.get("data")},s}((0,i(99251).Record)({type:"TOKEN",mutability:"IMMUTABLE",data:Object}));e.exports=s},451(e){"use strict";e.exports={getRemovalRange:function(e,t,i,s,r){var n=i.split(" ");n=n.map(function(e,t){if("forward"===r){if(t>0)return" "+e}else if(t<n.length-1)return e+" ";return e});for(var o,a=s,l=null,c=null,h=0;h<n.length;h++){if(e<(o=a+n[h].length)&&a<t)null!==l||(l=a),c=o;else if(null!==l)break;a=o}var d=s+i.length,u=l===s,p=c===d;return(!u&&p||u&&!p)&&("forward"===r?c!==d&&c++:l!==s&&l--),{start:l,end:c}}}},35693(e){"use strict";e.exports={logBlockedSelectionEvent:function(){return null},logSelectionStateFailure:function(){return null}}},58267(e,t,i){"use strict";var s=i(41671),r=i(61773),n=i(40377),o=i(64047),a=i(54095),l=i(99251),c=i(72368),h=i(32983),d=i(40041),u=i(79981),p=i(91825),g=i(5646),m=i(2661),f=l.OrderedSet,y={replaceText:function(e,t,i,r,n){var o=p(e,t),a=g(o,t),l=s.create({style:r||f(),entity:n||null});return h(a,a.getSelectionAfter(),i,l)},insertText:function(e,t,i,s,r){return t.isCollapsed()||d(!1),y.replaceText(e,t,i,s,r)},moveText:function(e,t,i){var s=a(e,t),r=y.removeRange(e,t,"backward");return y.replaceWithFragment(r,i,s)},replaceWithFragment:function(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",r=p(e,t),n=g(r,t);return c(n,n.getSelectionAfter(),i,s)},removeRange:function(e,t,i){var s,r,n,a;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),s=t.getAnchorKey(),r=t.getFocusKey(),n=e.getBlockForKey(s),a=e.getBlockForKey(r);var l=t.getStartOffset(),c=t.getEndOffset(),h=n.getEntityAt(l),d=a.getEntityAt(c-1);if(s===r&&h&&h===d){var u=o(e.getEntityMap(),n,a,t,i);return g(e,u)}var m=p(e,t);return g(m,t)},splitBlock:function(e,t){var i=p(e,t),s=g(i,t);return m(s,s.getSelectionAfter())},applyInlineStyle:function(e,t,i){return r.add(e,t,i)},removeInlineStyle:function(e,t,i){return r.remove(e,t,i)},setBlockType:function(e,t,i){return u(e,t,function(e){return e.merge({type:i,depth:0})})},setBlockData:function(e,t,i){return u(e,t,function(e){return e.merge({data:i})})},mergeBlockData:function(e,t,i){return u(e,t,function(e){return e.merge({data:e.getData().merge(i)})})},applyEntity:function(e,t,i){var s=p(e,t);return n(s,t,i)}};e.exports=y},13878(e){"use strict";var t="-",i={encode:function(e,i,s){return e+t+i+t+s},decode:function(e){var i=e.split(t).reverse(),s=i[0],r=i[1];return{blockKey:i.slice(2).reverse().join(t),decoratorKey:parseInt(r,10),leafKey:parseInt(s,10)}}};e.exports=i},42471(e,t,i){"use strict";function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var r=i(40643),n=i(31527),o=i(86739),a=i(12634),l=i(38413),c=i(17595),h=i(99251),d=i(10160),u=h.List,p=h.Repeat,g=c("draft_tree_data_support"),m=g?n:r,f={processHTML:function(e,t){return o(e,l,t)},processText:function(e,t,i){return e.reduce(function(e,r,n){r=d(r);var o=a(),l={key:o,type:i,text:r,characterList:u(p(t,r.length))};if(g&&0!==n){var c=n-1;l=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),r.forEach(function(t){s(e,t,i[t])})}return e}({},l,{prevSibling:(e[c]=e[c].merge({nextSibling:o})).getKey()})}return e.push(new m(l)),e},[])}};e.exports=f},76425(e,t,i){"use strict";var s="['‘’]",r="\\s|(?![_])"+i(59544).getPunctuation(),n=new RegExp("^(?:"+r+")*(?:"+s+"|(?!"+r+").)*(?:(?!"+r+").)"),o=new RegExp("(?:(?!"+r+").)(?:"+s+"|(?!"+r+").)*(?:"+r+")*$");function a(e,t){var i=t?o.exec(e):n.exec(e);return i?i[0]:e}var l={getBackward:function(e){return a(e,!0)},getForward:function(e){return a(e,!1)}};e.exports=l},93184(e){"use strict";var t={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=t},85063(e,t,i){"use strict";function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){r(e,t,i[t])})}return e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(12634),o=i(40041),a=function(e){if(!e||!e.type)return!1;var t=e.type;return"unordered-list-item"===t||"ordered-list-item"===t},l={fromRawTreeStateToRawState:function(e){var t=e.blocks,i=[];return Array.isArray(t)||o(!1),Array.isArray(t)&&t.length?(function(e,t){for(var i=[].concat(e).reverse();i.length;){var s=i.pop();t(s);var r=s.children;Array.isArray(r)||o(!1),i=i.concat([].concat(r.reverse()))}}(t,function(e){var t=s({},e);a(e)&&(t.depth=t.depth||0,function(e){Array.isArray(e.children)&&(e.children=e.children.map(function(t){return t.type===e.type?s({},t,{depth:(e.depth||0)+1}):t}))}(e),null!=e.children&&e.children.length>0)||(delete t.children,i.push(t))}),e.blocks=i,s({},e,{blocks:i})):e},fromRawStateToRawTreeState:function(e){var t=[],i=[];return e.blocks.forEach(function(e){var r=a(e),o=e.depth||0,l=s({},e,{children:[]});if(r){var c=i[0];if(null==c&&0===o)t.push(l);else if(null==c||c.depth<o-1){var h={key:n(),text:"",depth:o-1,type:e.type,children:[],entityRanges:[],inlineStyleRanges:[]};i.unshift(h),1===o?t.push(h):null!=c&&c.children.push(h),h.children.push(l)}else if(c.depth===o-1)c.children.push(l);else{for(;null!=c&&c.depth>=o;)i.shift(),c=i[0];o>0?c.children.push(l):t.push(l)}}else t.push(l)}),s({},e,{blocks:t})}};e.exports=l},59415(e,t,i){"use strict";i(92697),e.exports={isValidBlock:function(e,t){var i=e.getKey(),s=e.getParentKey();if(null!=s&&!t.get(s).getChildKeys().includes(i))return!1;if(!e.getChildKeys().map(function(e){return t.get(e)}).every(function(e){return e.getParentKey()===i}))return!1;var r=e.getPrevSiblingKey();if(null!=r&&t.get(r).getNextSiblingKey()!==i)return!1;var n=e.getNextSiblingKey();return(null==n||t.get(n).getPrevSiblingKey()===i)&&!(null!==n&&null!==r&&r===n||""!=e.text&&e.getChildKeys().size>0)},isConnectedTree:function(e){var t=e.toArray().filter(function(e){return null==e.getParentKey()&&null==e.getPrevSiblingKey()});if(1!==t.length)return!1;for(var i=0,s=t.shift().getKey(),r=[];null!=s;){var n=e.get(s),o=n.getChildKeys(),a=n.getNextSiblingKey();if(o.size>0){null!=a&&r.unshift(a);var l=o.map(function(t){return e.get(t)}).find(function(e){return null==e.getPrevSiblingKey()});if(null==l)return!1;s=l.getKey()}else s=null!=n.getNextSiblingKey()?n.getNextSiblingKey():r.shift();i++}return i===e.size},isValidTree:function(e){var t=this;return!!e.toArray().every(function(i){return t.isValidBlock(i,e)})&&this.isConnectedTree(e)}}},76539(e,t,i){"use strict";var s,r=i(75361),n=i(99251),o=i(25813),a=n.OrderedMap,l={getDirectionMap:function(e,t){s?s.reset():s=new r;var i=e.getBlockMap(),l=i.valueSeq().map(function(e){return o(s).getDirection(e.getText())}),c=a(i.keySeq().zip(l));return null!=t&&n.is(t,c)?t:c}};e.exports=l},59539(e,t,i){"use strict";function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){r(e,t,i[t])})}return e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(52568),o=i(23315),a=i(76539),l=i(27442),c=i(99251),h=c.OrderedSet,d=c.Record,u=c.Stack,p=c.OrderedMap,g=c.List,m=d({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:u(),selection:null,treeMap:null,undoStack:u()}),f=function(){t.createEmpty=function(e){return this.createWithText("",e)},t.createWithText=function(e,i){return t.createWithContent(o.createFromText(e),i)},t.createWithContent=function(e,i){if(0===e.getBlockMap().count())return t.createEmpty(i);var s=e.getBlockMap().first().getKey();return t.create({currentContent:e,undoStack:u(),redoStack:u(),decorator:i||null,selection:l.createEmpty(s)})},t.create=function(e){var i=e.currentContent,r=s({},e,{treeMap:v(i,e.decorator),directionMap:a.getDirectionMap(i)});return new t(new m(r))},t.fromJS=function(e){return new t(new m(s({},e,{directionMap:null!=e.directionMap?p(e.directionMap):e.directionMap,inlineStyleOverride:null!=e.inlineStyleOverride?h(e.inlineStyleOverride):e.inlineStyleOverride,nativelyRenderedContent:null!=e.nativelyRenderedContent?o.fromJS(e.nativelyRenderedContent):e.nativelyRenderedContent,redoStack:null!=e.redoStack?u(e.redoStack.map(function(e){return o.fromJS(e)})):e.redoStack,selection:null!=e.selection?new l(e.selection):e.selection,treeMap:null!=e.treeMap?p(e.treeMap).map(function(e){return g(e).map(function(e){return n.fromJS(e)})}):e.treeMap,undoStack:null!=e.undoStack?u(e.undoStack.map(function(e){return o.fromJS(e)})):e.undoStack,currentContent:o.fromJS(e.currentContent)})))},t.set=function(e,i){return new t(e.getImmutable().withMutations(function(t){var s=t.get("decorator"),r=s;null===i.decorator?r=null:i.decorator&&(r=i.decorator);var o=i.currentContent||e.getCurrentContent();if(r!==s){var a,l=t.get("treeMap");return a=r&&s?function(e,t,i,s,r){return i.merge(t.toSeq().filter(function(t){return s.getDecorations(t,e)!==r.getDecorations(t,e)}).map(function(t){return n.generate(e,t,s)}))}(o,o.getBlockMap(),l,r,s):v(o,r),void t.merge({decorator:r,treeMap:a,nativelyRenderedContent:null})}o!==e.getCurrentContent()&&t.set("treeMap",function(e,t,i,s){var r=e.getCurrentContent().set("entityMap",i),o=r.getBlockMap();return e.getImmutable().get("treeMap").merge(t.toSeq().filter(function(e,t){return e!==o.get(t)}).map(function(e){return n.generate(r,e,s)}))}(e,o.getBlockMap(),o.getEntityMap(),r)),t.merge(i)}))};var e=t.prototype;function t(e){r(this,"_immutable",void 0),this._immutable=e}return e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},t.setInlineStyleOverride=function(e,i){return t.set(e,{inlineStyleOverride:i})},e.getCurrentInlineStyle=function(){var e=this.getInlineStyleOverride();if(null!=e)return e;var t=this.getCurrentContent(),i=this.getSelection();return i.isCollapsed()?function(e,t){var i=t.getStartKey(),s=t.getStartOffset(),r=e.getBlockForKey(i);return s>0?r.getInlineStyleAt(s-1):r.getLength()?r.getInlineStyleAt(0):C(e,i)}(t,i):function(e,t){var i=t.getStartKey(),s=t.getStartOffset(),r=e.getBlockForKey(i);return s<r.getLength()?r.getInlineStyleAt(s):s>0?r.getInlineStyleAt(s-1):C(e,i)}(t,i)},e.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(e,t){return y(e,t,!1)},t.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set("hasFocus",!0)),y(e,t,!0)},t.moveSelectionToEnd=function(e){var i=e.getCurrentContent().getLastBlock(),s=i.getKey(),r=i.getLength();return t.acceptSelection(e,new l({anchorKey:s,anchorOffset:r,focusKey:s,focusOffset:r,isBackward:!1}))},t.moveFocusToEnd=function(e){var i=t.moveSelectionToEnd(e);return t.forceSelection(i,i.getSelection())},t.push=function(e,i,s){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.getCurrentContent()===i)return e;var n=a.getDirectionMap(i,e.getDirectionMap());if(!e.getAllowUndo())return t.set(e,{currentContent:i,directionMap:n,lastChangeType:s,selection:i.getSelectionAfter(),forceSelection:r,inlineStyleOverride:null});var o=e.getSelection(),l=e.getCurrentContent(),c=e.getUndoStack(),h=i;o!==l.getSelectionAfter()||function(e,t){return t!==e.getLastChangeType()||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}(e,s)?(c=c.push(l),h=h.set("selectionBefore",o)):"insert-characters"!==s&&"backspace-character"!==s&&"delete-character"!==s||(h=h.set("selectionBefore",l.getSelectionBefore()));var d=e.getInlineStyleOverride();-1===["adjust-depth","change-block-type","split-block"].indexOf(s)&&(d=null);var p={currentContent:h,directionMap:n,undoStack:c,redoStack:u(),lastChangeType:s,selection:i.getSelectionAfter(),forceSelection:r,inlineStyleOverride:d};return t.set(e,p)},t.undo=function(e){if(!e.getAllowUndo())return e;var i=e.getUndoStack(),s=i.peek();if(!s)return e;var r=e.getCurrentContent(),n=a.getDirectionMap(s,e.getDirectionMap());return t.set(e,{currentContent:s,directionMap:n,undoStack:i.shift(),redoStack:e.getRedoStack().push(r),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:r.getSelectionBefore()})},t.redo=function(e){if(!e.getAllowUndo())return e;var i=e.getRedoStack(),s=i.peek();if(!s)return e;var r=e.getCurrentContent(),n=a.getDirectionMap(s,e.getDirectionMap());return t.set(e,{currentContent:s,directionMap:n,undoStack:e.getUndoStack().push(r),redoStack:i.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:s.getSelectionAfter()})},e.getImmutable=function(){return this._immutable},t}();function y(e,t,i){return f.set(e,{selection:t,forceSelection:i,nativelyRenderedContent:null,inlineStyleOverride:null})}function v(e,t){return e.getBlockMap().map(function(i){return n.generate(e,i,t)}).toOrderedMap()}function C(e,t){var i=e.getBlockMap().reverse().skipUntil(function(e,i){return i===t}).skip(1).skipUntil(function(e,t){return e.getLength()}).first();return i?i.getInlineStyleAt(i.getLength()-1):h()}e.exports=f},8117(e,t,i){"use strict";var s=i(63390),r=i(97253),n=s.isPlatform("Mac OS X"),o={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return n&&e.altKey},usesMacOSHeuristics:function(){return n},hasCommandModifier:function(e){return n?!!e.metaKey&&!e.altKey:o.isCtrlKeyCommand(e)},isSoftNewlineEvent:r};e.exports=o},79198(){},75969(e,t,i){"use strict";var s=i(58267),r=i(59539),n=i(10563),o=i(25813),a={currentBlockContainsLink:function(e){var t=e.getSelection(),i=e.getCurrentContent(),s=i.getEntityMap();return i.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some(function(e){var t=e.getEntity();return!!t&&"LINK"===s.__get(t).getType()})},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t,i){switch(t){case"bold":return a.toggleInlineStyle(e,"BOLD");case"italic":return a.toggleInlineStyle(e,"ITALIC");case"underline":return a.toggleInlineStyle(e,"UNDERLINE");case"code":return a.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return a.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return a.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=s.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),i=r.push(e,t,"insert-characters");return r.forceSelection(i,t.getSelectionAfter())},onBackspace:function(e){var t=e.getSelection();if(!t.isCollapsed()||t.getAnchorOffset()||t.getFocusOffset())return null;var i=e.getCurrentContent(),s=t.getStartKey(),n=i.getBlockBefore(s);if(n&&"atomic"===n.getType()){var o=i.getBlockMap().delete(n.getKey()),l=i.merge({blockMap:o,selectionAfter:t});if(l!==i)return r.push(e,l,"remove-range")}var c=a.tryToRemoveBlockStyle(e);return c?r.push(e,c,"change-block-type"):null},onDelete:function(e){var t=e.getSelection();if(!t.isCollapsed())return null;var i=e.getCurrentContent(),n=t.getStartKey(),o=i.getBlockForKey(n).getLength();if(t.getStartOffset()<o)return null;var a=i.getBlockAfter(n);if(!a||"atomic"!==a.getType())return null;var l=t.merge({focusKey:a.getKey(),focusOffset:a.getLength()}),c=s.removeRange(i,l,"forward");return c!==i?r.push(e,c,"remove-range"):null},onTab:function(e,t,i){var s=t.getSelection(),o=s.getAnchorKey();if(o!==s.getFocusKey())return t;var a=t.getCurrentContent(),l=a.getBlockForKey(o),c=l.getType();if("unordered-list-item"!==c&&"ordered-list-item"!==c)return t;e.preventDefault();var h=l.getDepth();if(!e.shiftKey&&h===i)return t;var d=n(a,s,e.shiftKey?-1:1,i);return r.push(t,d,"adjust-depth")},toggleBlockType:function(e,t){var i=e.getSelection(),n=i.getStartKey(),a=i.getEndKey(),l=e.getCurrentContent(),c=i;if(n!==a&&0===i.getEndOffset()){var h=o(l.getBlockBefore(a));a=h.getKey(),c=c.merge({anchorKey:n,anchorOffset:i.getStartOffset(),focusKey:a,focusOffset:h.getLength(),isBackward:!1})}if(l.getBlockMap().skipWhile(function(e,t){return t!==n}).reverse().skipWhile(function(e,t){return t!==a}).some(function(e){return"atomic"===e.getType()}))return e;var d=l.getBlockForKey(n).getType()===t?"unstyled":t;return r.push(e,s.setBlockType(l,c,d),"change-block-type")},toggleCode:function(e){var t=e.getSelection(),i=t.getAnchorKey(),s=t.getFocusKey();return t.isCollapsed()||i!==s?a.toggleBlockType(e,"code-block"):a.toggleInlineStyle(e,"CODE")},toggleInlineStyle:function(e,t){var i=e.getSelection(),n=e.getCurrentInlineStyle();if(i.isCollapsed())return r.setInlineStyleOverride(e,n.has(t)?n.remove(t):n.add(t));var o,a=e.getCurrentContent();return o=n.has(t)?s.removeInlineStyle(a,i,t):s.applyInlineStyle(a,i,t),r.push(e,o,"change-inline-style")},toggleLink:function(e,t,i){var n=s.applyEntity(e.getCurrentContent(),t,i);return r.push(e,n,"apply-entity")},tryToRemoveBlockStyle:function(e){var t=e.getSelection(),i=t.getAnchorOffset();if(t.isCollapsed()&&0===i){var r=t.getAnchorKey(),n=e.getCurrentContent(),o=n.getBlockForKey(r).getType(),a=n.getBlockBefore(r);if("code-block"===o&&a&&"code-block"===a.getType()&&0!==a.getLength())return null;if("unstyled"!==o)return s.setBlockType(n,t,"unstyled")}return null}};e.exports=a},56109(e,t,i){"use strict";var s=i(58267),r=i(59539),n=i(54095),o=i(25813),a=null,l={cut:function(e){var t=e.getCurrentContent(),i=e.getSelection(),l=null;if(i.isCollapsed()){var c=i.getAnchorKey(),h=t.getBlockForKey(c).getLength();if(h===i.getAnchorOffset()){var d=t.getKeyAfter(c);if(null==d)return e;l=i.set("focusKey",d).set("focusOffset",0)}else l=i.set("focusOffset",h)}else l=i;l=o(l),a=n(t,l);var u=s.removeRange(t,l,"forward");return u===t?e:r.push(e,u,"remove-range")},paste:function(e){if(!a)return e;var t=s.replaceWithFragment(e.getCurrentContent(),e.getSelection(),a);return r.push(e,t,"insert-fragment")}};e.exports=l},27442(e,t,i){"use strict";var s=function(e){var t,i;function s(){return e.apply(this,arguments)||this}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var r=s.prototype;return r.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},r.getAnchorKey=function(){return this.get("anchorKey")},r.getAnchorOffset=function(){return this.get("anchorOffset")},r.getFocusKey=function(){return this.get("focusKey")},r.getFocusOffset=function(){return this.get("focusOffset")},r.getIsBackward=function(){return this.get("isBackward")},r.getHasFocus=function(){return this.get("hasFocus")},r.hasEdgeWithin=function(e,t,i){var s=this.getAnchorKey(),r=this.getFocusKey();if(s===r&&s===e){var n=this.getStartOffset(),o=this.getEndOffset();return t<=n&&n<=i||t<=o&&o<=i}if(e!==s&&e!==r)return!1;var a=e===s?this.getAnchorOffset():this.getFocusOffset();return t<=a&&i>=a},r.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},r.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},r.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},r.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},r.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},s.createEmpty=function(e){return new s({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},s}((0,i(99251).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}));e.exports=s},10563(e){"use strict";e.exports=function(e,t,i,s){var r=t.getStartKey(),n=t.getEndKey(),o=e.getBlockMap(),a=o.toSeq().skipUntil(function(e,t){return t===r}).takeUntil(function(e,t){return t===n}).concat([[n,o.get(n)]]).map(function(e){var t=e.getDepth()+i;return t=Math.max(0,Math.min(t,s)),e.set("depth",t)});return o=o.merge(a),e.merge({blockMap:o,selectionBefore:t,selectionAfter:t})}},43253(e,t,i){"use strict";var s=i(41671);e.exports=function(e,t,i,r){for(var n=t,o=e.getCharacterList();n<i;)o=o.set(n,s.applyEntity(o.get(n),r)),n++;return e.set("characterList",o)}},40377(e,t,i){"use strict";var s=i(43253),r=i(99251);e.exports=function(e,t,i){var n=e.getBlockMap(),o=t.getStartKey(),a=t.getStartOffset(),l=t.getEndKey(),c=t.getEndOffset(),h=n.skipUntil(function(e,t){return t===o}).takeUntil(function(e,t){return t===l}).toOrderedMap().merge(r.OrderedMap([[l,n.get(l)]])).map(function(e,t){var r=t===o?a:0,n=t===l?c:e.getLength();return s(e,r,n,i)});return e.merge({blockMap:n.merge(h),selectionBefore:t,selectionAfter:t})}},93613(e,t,i){"use strict";function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var r=i(40643),n=i(31527),o=i(93184),a=i(30370),l=i(3399),c=i(40041),h=function(e,t){return{key:e.getKey(),text:e.getText(),type:e.getType(),depth:e.getDepth(),inlineStyleRanges:l(e),entityRanges:a(e,t),data:e.getData().toObject()}};e.exports=function(e){var t={entityMap:{},blocks:[]};return t=function(e,t){var i=t.entityMap,a=[],l={},d={},u=0;return e.getBlockMap().forEach(function(e){e.findEntityRanges(function(e){return null!==e.getEntity()},function(t){var s=e.getEntityAt(t),r=o.stringify(s);d[r]||(d[r]=s,i[r]="".concat(u),u++)}),function(e,t,i,o){if(e instanceof r)i.push(h(e,t));else{e instanceof n||c(!1);var a=e.getParentKey(),l=o[e.getKey()]=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),r.forEach(function(t){s(e,t,i[t])})}return e}({},h(e,t),{children:[]});a?o[a].children.push(l):i.push(l)}}(e,i,a,l)}),{blocks:a,entityMap:i}}(e,t),t=function(e,t){var i=t.blocks,s=t.entityMap,r={};return Object.keys(s).forEach(function(t,i){var s=e.getEntity(o.unstringify(t));r[i]={type:s.getType(),mutability:s.getMutability(),data:s.getData()}}),{blocks:i,entityMap:r}}(e,t),t}},86739(e,t,i){"use strict";var s;function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){n(e,t,i[t])})}return e}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var o=i(41671),a=i(40643),l=i(31527),c=i(47904),h=i(70873),d=i(10499),u=i(22978),p=i(12634),g=i(38413),m=i(17595),f=i(99251),y=f.List,v=f.Map,C=f.OrderedSet,b=i(34189),S=i(4734),w=i(44110),x=i(80119),E=m("draft_tree_data_support"),M=new RegExp("\r","g"),A=new RegExp("\n","g"),T=new RegExp("^\n","g"),D=new RegExp("&nbsp;","g"),I=new RegExp("&#13;?","g"),R=new RegExp("&#8203;?","g"),P=["bold","bolder","500","600","700","800","900"],k=["light","lighter","normal","100","200","300","400"],L=["className","href","rel","target","title"],N=["alt","className","height","src","width"],_=(n(s={},u("public/DraftStyleDefault/depth0"),0),n(s,u("public/DraftStyleDefault/depth1"),1),n(s,u("public/DraftStyleDefault/depth2"),2),n(s,u("public/DraftStyleDefault/depth3"),3),n(s,u("public/DraftStyleDefault/depth4"),4),s),O=v({b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE",mark:"HIGHLIGHT"}),F=function(e){return w(e)&&e.style.fontFamily.includes("monospace")?"CODE":null},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(_).some(function(i){e.classList.contains(i)&&(t=_[i])}),t},B=function(e){if(!b(e))return!1;var t=e;if(!t.href||"http:"!==t.protocol&&"https:"!==t.protocol&&"mailto:"!==t.protocol&&"tel:"!==t.protocol)return!1;try{return new d(t.href),!0}catch(e){return!1}},V=function(e){if(!x(e))return!1;var t=e;return!(!t.attributes.getNamedItem("src")||!t.attributes.getNamedItem("src").value)},H=function(e,t){if(!w(e))return t;var i=e,s=i.style.fontWeight,r=i.style.fontStyle,n=i.style.textDecoration;return t.withMutations(function(e){P.indexOf(s)>=0?e.add("BOLD"):k.indexOf(s)>=0&&e.remove("BOLD"),"italic"===r?e.add("ITALIC"):"normal"===r&&e.remove("ITALIC"),"underline"===n&&e.add("UNDERLINE"),"line-through"===n&&e.add("STRIKETHROUGH"),"none"===n&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))})},U=function(e){return"ul"===e||"ol"===e},z=function(){function e(e,t){n(this,"characterList",y()),n(this,"currentBlockType","unstyled"),n(this,"currentDepth",0),n(this,"currentEntity",null),n(this,"currentText",""),n(this,"wrapper",null),n(this,"blockConfigs",[]),n(this,"contentBlocks",[]),n(this,"entityMap",h),n(this,"blockTypeMap",void 0),n(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=e,this.disambiguate=t}var t=e.prototype;return t.clear=function(){this.characterList=y(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=h,this.wrapper=null,this.contentBlocks=[]},t.addDOMNode=function(e){var t;return this.contentBlocks=[],this.currentDepth=0,(t=this.blockConfigs).push.apply(t,this._toBlockConfigs([e],C())),this._trimCurrentText(),""!==this.currentText&&this.blockConfigs.push(this._makeBlockConfig()),this},t.getContentBlocks=function(){return 0===this.contentBlocks.length&&(E?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},t._makeBlockConfig=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r({key:e.key||p(),type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:y(),prevSibling:null,nextSibling:null,childConfigs:[]},e);return this.characterList=y(),this.currentBlockType="unstyled",this.currentText="",t},t._toBlockConfigs=function(e,t){for(var i=[],s=0;s<e.length;s++){var r=e[s],n=r.nodeName.toLowerCase();if("body"===n||U(n)){this._trimCurrentText(),""!==this.currentText&&i.push(this._makeBlockConfig());var o=this.currentDepth,a=this.wrapper;U(n)&&(this.wrapper=n,U(a)&&this.currentDepth++),i.push.apply(i,this._toBlockConfigs(Array.from(r.childNodes),t)),this.currentDepth=o,this.wrapper=a}else{var l=this.blockTypeMap.get(n);if(void 0===l)if("#text"!==n)if("br"!==n)if(V(r))this._addImgNode(r,t);else if(B(r))this._addAnchorNode(r,i,t);else{var c=t;O.has(n)&&(c=c.add(O.get(n))),c=H(r,c);var h=F(r);null!=h&&(c=c.add(h)),i.push.apply(i,this._toBlockConfigs(Array.from(r.childNodes),c))}else this._addBreakNode(r,t);else this._addTextNode(r,t);else{this._trimCurrentText(),""!==this.currentText&&i.push(this._makeBlockConfig());var d=this.currentDepth,u=this.wrapper;if(this.wrapper="pre"===n?"pre":this.wrapper,"string"!=typeof l&&(l=this.disambiguate(n,this.wrapper)||l[0]||"unstyled"),!E&&w(r)&&("unordered-list-item"===l||"ordered-list-item"===l)){var g=r;this.currentDepth=G(g,this.currentDepth)}var m=p(),f=this._toBlockConfigs(Array.from(r.childNodes),t);this._trimCurrentText(),i.push(this._makeBlockConfig({key:m,childConfigs:f,type:l})),this.currentDepth=d,this.wrapper=u}}}return i},t._appendText=function(e,t){var i;this.currentText+=e;var s=o.create({style:t,entity:this.currentEntity});this.characterList=(i=this.characterList).push.apply(i,Array(e.length).fill(s))},t._trimCurrentText=function(){var e=this.currentText.length,t=e-this.currentText.trimLeft().length,i=this.currentText.trimRight().length,s=this.characterList.findEntry(function(e){return null!==e.getEntity()});(t=void 0!==s?Math.min(t,s[0]):t)>(i=void 0!==(s=this.characterList.reverse().findEntry(function(e){return null!==e.getEntity()}))?Math.max(i,e-s[0]):i)?(this.currentText="",this.characterList=y()):(this.currentText=this.currentText.slice(t,i),this.characterList=this.characterList.slice(t,i))},t._addTextNode=function(e,t){var i=e.textContent;""===i.trim()&&"pre"!==this.wrapper&&(i=" "),"pre"!==this.wrapper&&(i=(i=i.replace(T,"")).replace(A," ")),this._appendText(i,t)},t._addBreakNode=function(e,t){S(e)&&this._appendText("\n",t)},t._addImgNode=function(e,t){if(x(e)){var i=e,s={};N.forEach(function(e){var t=i.getAttribute(e);t&&(s[e]=t)}),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",s),m("draftjs_fix_paste_for_img")?"presentation"!==i.getAttribute("role")&&this._appendText("📷",t):this._appendText("📷",t),this.currentEntity=null}},t._addAnchorNode=function(e,t,i){if(b(e)){var s=e,r={};L.forEach(function(e){var t=s.getAttribute(e);t&&(r[e]=t)}),r.url=new d(s.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",r||{}),t.push.apply(t,this._toBlockConfigs(Array.from(e.childNodes),i)),this.currentEntity=null}},t._toContentBlocks=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=e.length-1,s=0;s<=i;s++){var n=e[s];n.parent=t,n.prevSibling=s>0?e[s-1].key:null,n.nextSibling=s<i?e[s+1].key:null,n.children=y(n.childConfigs.map(function(e){return e.key})),this.contentBlocks.push(new l(r({},n))),this._toContentBlocks(n.childConfigs,n.key)}},t._hoistContainersInBlockConfigs=function(e){var t=this;return y(e).flatMap(function(e){return"unstyled"!==e.type||""!==e.text?[e]:t._hoistContainersInBlockConfigs(e.childConfigs)})},t._toFlatContentBlocks=function(e){var t=this;this._hoistContainersInBlockConfigs(e).forEach(function(e){var i=t._extractTextFromBlockConfigs(e.childConfigs),s=i.text,n=i.characterList;t.contentBlocks.push(new a(r({},e,{text:e.text+s,characterList:e.characterList.concat(n)})))})},t._extractTextFromBlockConfigs=function(e){for(var t=e.length-1,i="",s=y(),r=0;r<=t;r++){var n=e[r];i+=n.text,s=s.concat(n.characterList),""!==i&&"unstyled"!==n.type&&(i+="\n",s=s.push(s.last()));var o=this._extractTextFromBlockConfigs(n.childConfigs);i+=o.text,s=s.concat(o.characterList)}return{text:i,characterList:s}},e}();e.exports=function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:g)(e=e.trim().replace(M,"").replace(D," ").replace(I,"").replace(R,""));if(!i)return null;var s=function(e){var t={};return e.mapKeys(function(e,i){var s=[i.element];void 0!==i.aliasedElements&&s.push.apply(s,i.aliasedElements),s.forEach(function(i){void 0===t[i]?t[i]=e:"string"==typeof t[i]?t[i]=[t[i],e]:t[i].push(e)})}),v(t)}(t);return new z(s,function(e,t){return"li"===e?"ol"===t?"ordered-list-item":"unordered-list-item":null}).addDOMNode(i).getContentBlocks()}},12503(e,t,i){"use strict";function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),s.forEach(function(t){r(e,t,i[t])})}return e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(40643),o=i(31527),a=i(23315),l=i(70873),c=i(85063),h=(i(59415),i(27442)),d=i(59974),u=i(87838),p=i(55107),g=i(12634),m=i(17595),f=i(99251),y=i(40041),v=m("draft_tree_data_support"),C=f.List,b=f.Map,S=f.OrderedMap,w=function(e,t){var i=e.key,s=e.type,r=e.data;return{text:e.text,depth:e.depth||0,type:s||"unstyled",key:i||g(),data:b(r),characterList:x(e,t)}},x=function(e,t){var i=e.text,r=e.entityRanges,n=e.inlineStyleRanges,o=r||[];return d(p(i,n||[]),u(i,o.filter(function(e){return t.hasOwnProperty(e.key)}).map(function(e){return s({},e,{key:t[e.key]})})))},E=function(e){return s({},e,{key:e.key||g()})},M=function(e,t,i){var r=t.map(function(e){return s({},e,{parentRef:i})});return e.concat(r.reverse())};e.exports=function(e){Array.isArray(e.blocks)||y(!1);var t=function(e){var t=e.entityMap,i={};return Object.keys(t).forEach(function(e){var s=t[e],r=s.type,n=s.mutability,o=s.data;i[e]=l.__create(r,n,o||{})}),i}(e),i=function(e,t){var i=e.blocks.find(function(e){return Array.isArray(e.children)&&e.children.length>0}),r=v&&!i?c.fromRawStateToRawTreeState(e).blocks:e.blocks;if(!v)return function(e,t){return S(e.map(function(e){var i=new n(w(e,t));return[i.getKey(),i]}))}(i?c.fromRawTreeStateToRawState(e).blocks:r,t);var a=function(e,t){return e.map(E).reduce(function(i,r,n){Array.isArray(r.children)||y(!1);var a=r.children.map(E),l=new o(s({},w(r,t),{prevSibling:0===n?null:e[n-1].key,nextSibling:n===e.length-1?null:e[n+1].key,children:C(a.map(function(e){return e.key}))}));i=i.set(l.getKey(),l);for(var c=M([],a,l);c.length>0;){var h=c.pop(),d=h.parentRef,u=d.getChildKeys(),p=u.indexOf(h.key),g=Array.isArray(h.children);if(!g){g||y(!1);break}var m=h.children.map(E),f=new o(s({},w(h,t),{parent:d.getKey(),children:C(m.map(function(e){return e.key})),prevSibling:0===p?null:u.get(p-1),nextSibling:p===u.size-1?null:u.get(p+1)}));i=i.set(f.getKey(),f),c=M(c,m,f)}return i},S())}(r,t);return a}(e,t),r=i.isEmpty()?new h:h.createEmpty(i.first().getKey());return new a({blockMap:i,entityMap:t,selectionBefore:r,selectionAfter:r})}},59974(e,t,i){"use strict";var s=i(41671),r=i(99251).List;e.exports=function(e,t){var i=e.map(function(e,i){var r=t[i];return s.create({style:e,entity:r})});return r(i)}},87838(e,t,i){"use strict";var s=i(13145).substr;e.exports=function(e,t){var i=Array(e.length).fill(null);return t&&t.forEach(function(t){for(var r=s(e,0,t.offset).length,n=r+s(e,t.offset,t.length).length,o=r;o<n;o++)i[o]=t.key}),i}},55107(e,t,i){"use strict";var s=i(13145),r=i(99251).OrderedSet,n=s.substr,o=r();e.exports=function(e,t){var i=Array(e.length).fill(o);return t&&t.forEach(function(t){for(var s=n(e,0,t.offset).length,r=s+n(e,t.offset,t.length).length;s<r;)i[s]=i[s].add(t.style),s++}),i}},25070(e){"use strict";e.exports={notEmptyKey:function(e){return null!=e&&""!=e}}},45995(e,t,i){"use strict";var s=i(58267),r=i(59539),n=i(63390),o=i(60836),a=i(46415),l=i(65044),c=i(25813),h=i(95136),d=n.isBrowser("Firefox");function u(e,t,i,n,o){var a=s.replaceText(e.getCurrentContent(),e.getSelection(),t,i,n);return r.push(e,a,"insert-characters",o)}e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var i=e._latestEditorState,s=t.data;if(s)if(e.props.handleBeforeInput&&a(e.props.handleBeforeInput(s,i,t.timeStamp)))t.preventDefault();else{var n=i.getSelection(),p=n.getStartOffset(),g=n.getAnchorKey();if(!n.isCollapsed())return t.preventDefault(),void e.update(u(i,s,i.getCurrentInlineStyle(),o(i.getCurrentContent(),i.getSelection()),!0));var m,f=u(i,s,i.getCurrentInlineStyle(),o(i.getCurrentContent(),i.getSelection()),!1),y=!1;if(y||(y=l(e._latestCommittedEditorState)),!y){var v=i.getBlockTree(g),C=f.getBlockTree(g);y=v.size!==C.size||v.zip(C).some(function(e){var t=e[0],i=e[1],r=t.get("start"),n=r+(r>=p?s.length:0),o=t.get("end"),a=o+(o>=p?s.length:0),l=i.get("start"),c=i.get("end"),h=i.get("decoratorKey");return t.get("decoratorKey")!==h||t.get("leaves").size!==i.get("leaves").size||n!==l||a!==c||null!=h&&c-l!==o-r})}if(y||(m=s,y=d&&("'"==m||"/"==m)),y||(y=c(f.getDirectionMap()).get(g)!==c(i.getDirectionMap()).get(g)),y)return t.preventDefault(),f=r.set(f,{forceSelection:!0}),void e.update(f);f=r.set(f,{nativelyRenderedContent:f.getCurrentContent()}),e._pendingStateFromBeforeInput=f,h(function(){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)})}}},23717(e,t,i){"use strict";var s=i(59539),r=i(68820),n=i(53967);e.exports=function(e,t){var i=t.currentTarget.ownerDocument;if(!Boolean(e.props.preserveSelectionOnBlur)&&n(i)===i.body){var o=i.defaultView.getSelection(),a=e.editor;1===o.rangeCount&&r(a,o.anchorNode)&&r(a,o.focusNode)&&o.removeAllRanges()}var l=e._latestEditorState,c=l.getSelection();if(c.getHasFocus()){var h=c.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(s.acceptSelection(l,h))}}},46438(e,t,i){"use strict";var s=i(59539);e.exports=function(e,t){e.setMode("composite"),e.update(s.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}},78073(e,t,i){"use strict";var s=i(13355);e.exports=function(e,t){e._latestEditorState.getSelection().isCollapsed()?t.preventDefault():e.setClipboard(s(e._latestEditorState))}},43046(e,t,i){"use strict";var s=i(58267),r=i(59539),n=i(98556),o=i(13355),a=i(93987),l=i(76871);e.exports=function(e,t){var i,c=e._latestEditorState,h=c.getSelection(),d=t.target;if(h.isCollapsed())t.preventDefault();else{if(l(d)){var u=d;i=a(n.getScrollParent(u))}var p=o(c);e.setClipboard(p),e.setMode("cut"),setTimeout(function(){e.restoreEditorDOM(i),e.exitCurrentMode(),e.update(function(e){var t=s.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return r.push(e,t,"remove-range")}(c))},0)}}},76100(e){"use strict";e.exports=function(e,t){e.setMode("drag"),t.preventDefault()}},92244(e){"use strict";e.exports=function(e){e._internalDrag=!0,e.setMode("drag")}},38514(e,t,i){"use strict";var s=i(59539),r=i(63390);e.exports=function(e,t){var i=e._latestEditorState,n=i.getSelection();if(!n.getHasFocus()){var o=n.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),r.isBrowser("Chrome < 60.0.3081.0")?e.update(s.forceSelection(i,o)):e.update(s.acceptSelection(i,o))}}},29830(e,t,i){"use strict";var s=i(58267),r=i(13878),n=i(59539),o=i(63390),a=i(25070).notEmptyKey,l=i(65461),c=i(97402),h=i(25813),d=o.isEngine("Gecko");e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var i=e.editor.ownerDocument.defaultView.getSelection(),o=i.anchorNode,u=i.isCollapsed,p=(null==o?void 0:o.nodeType)!==Node.TEXT_NODE&&(null==o?void 0:o.nodeType)!==Node.ELEMENT_NODE;if(null!=o&&!p){if(o.nodeType===Node.TEXT_NODE&&(null!==o.previousSibling||null!==o.nextSibling)){var g=o.parentNode;if(null==g)return;o.nodeValue=g.textContent;for(var m=g.firstChild;null!=m;m=m.nextSibling)m!==o&&g.removeChild(m)}var f=o.textContent,y=e._latestEditorState,v=h(l(o)),C=r.decode(v),b=C.blockKey,S=C.decoratorKey,w=C.leafKey,x=y.getBlockTree(b).getIn([S,"leaves",w]),E=x.start,M=x.end,A=y.getCurrentContent(),T=A.getBlockForKey(b),D=T.getText().slice(E,M);if(f.endsWith("\n\n")&&(f=f.slice(0,-1)),f!==D){var I,R,P,k,L=y.getSelection(),N=L.merge({anchorOffset:E,focusOffset:M,isBackward:!1}),_=T.getEntityAt(E),O=a(_)?A.getEntity(_):null,F="MUTABLE"===(null!=O?O.getMutability():null),G=F?"spellcheck-change":"apply-entity",B=s.replaceText(A,N,f,T.getInlineStyleAt(E),F?T.getEntityAt(E):null);if(d)I=i.anchorOffset,R=i.focusOffset,k=(P=E+Math.min(I,R))+Math.abs(I-R),I=P,R=k;else{var V=f.length-D.length;P=L.getStartOffset(),k=L.getEndOffset(),I=u?k+V:P,R=k+V}var H=B.merge({selectionBefore:A.getSelectionAfter(),selectionAfter:L.merge({anchorOffset:I,focusOffset:R})});e.update(n.push(y,H,G))}else{var U=t.nativeEvent.inputType;if(U){var z=function(e,t){return"deleteContentBackward"===e?c(t):t}(U,y);if(z!==y)return e.restoreEditorDOM(),void e.update(z)}}}}},41345(e,t,i){"use strict";var s=i(58267),r=i(59539),n=i(8117),o=i(4617),a=i(56109),l=i(63390),c=i(46415),h=i(50976),d=i(44126),u=i(27130),p=i(79774),g=i(11644),m=i(63467),f=i(97402),y=i(12750),v=i(2194),C=i(38707),b=n.isOptionKeyCommand,S=l.isBrowser("Chrome");e.exports=function(e,t){var i=t.which,n=e._latestEditorState;function l(i){var s=e.props[i];return!!s&&(s(t),!0)}switch(i){case o.RETURN:if(t.preventDefault(),e.props.handleReturn&&c(e.props.handleReturn(t,n)))return;break;case o.ESC:if(t.preventDefault(),l("onEscape"))return;break;case o.TAB:if(l("onTab"))return;break;case o.UP:if(l("onUpArrow"))return;break;case o.RIGHT:if(l("onRightArrow"))return;break;case o.DOWN:if(l("onDownArrow"))return;break;case o.LEFT:if(l("onLeftArrow"))return;break;case o.SPACE:S&&b(t)&&t.preventDefault()}var w=e.props.keyBindingFn(t);if(null!=w&&""!==w)if("undo"!==w){if(t.preventDefault(),!e.props.handleKeyCommand||!c(e.props.handleKeyCommand(w,n,t.timeStamp))){var x=function(e,t,i){switch(e){case"redo":return r.redo(t);case"delete":return y(t);case"delete-word":return u(t);case"backspace":return f(t);case"backspace-word":return d(t);case"backspace-to-start-of-line":return h(t,i);case"split-block":return p(t);case"transpose-characters":return v(t);case"move-selection-to-start-of-block":return m(t);case"move-selection-to-end-of-block":return g(t);case"secondary-cut":return a.cut(t);case"secondary-paste":return a.paste(t);default:return t}}(w,n,t);x!==n&&e.update(x)}}else C(t,n,e.update);else if(i===o.SPACE&&S&&b(t)){var E=s.replaceText(n.getCurrentContent(),n.getSelection()," ");e.update(r.push(n,E,"insert-characters"))}}},35346(e,t,i){"use strict";var s=i(84433),r=i(41671),n=i(81354),o=i(58267),a=i(42471),l=i(59539),c=i(75969),h=i(60836),d=i(27786),u=i(46415),p=i(55585);function g(e,t,i){var s=o.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return l.push(e,s.set("entityMap",i),"insert-fragment")}e.exports=function(e,t){t.preventDefault();var i=new n(t.clipboardData);if(!i.isRichText()){var m=i.getFiles(),f=i.getText();if(m.length>0){if(e.props.handlePastedFiles&&u(e.props.handlePastedFiles(m)))return;return void d(m,function(t){if(t=t||f){var i=e._latestEditorState,n=p(t),d=r.create({style:i.getCurrentInlineStyle(),entity:h(i.getCurrentContent(),i.getSelection())}),u=c.getCurrentBlockType(i),g=a.processText(n,d,u),m=s.createFromArray(g),y=o.replaceWithFragment(i.getCurrentContent(),i.getSelection(),m);e.update(l.push(i,y,"insert-fragment"))}})}}var y=[],v=i.getText(),C=i.getHTML(),b=e._latestEditorState;if(e.props.formatPastedText){var S=e.props.formatPastedText(v,C);v=S.text,C=S.html}if(!e.props.handlePastedText||!u(e.props.handlePastedText(v,C,b))){if(v&&(y=p(v)),!e.props.stripPastedStyles){var w,x=e.getClipboard();if(!e.props.formatPastedText&&i.isRichText()&&x){if(-1!==(null===(w=C)||void 0===w?void 0:w.indexOf(e.getEditorKey()))||1===y.length&&1===x.size&&x.first().getText()===v)return void e.update(g(e._latestEditorState,x))}else if(x&&i.types.includes("com.apple.webarchive")&&!i.types.includes("text/html")&&function(e,t){return e.length===t.size&&t.valueSeq().every(function(t,i){return t.getText()===e[i]})}(y,x))return void e.update(g(e._latestEditorState,x));if(C){var E=a.processHTML(C,e.props.blockRenderMap);if(E){var M=E.contentBlocks,A=E.entityMap;if(M){var T=s.createFromArray(M);return void e.update(g(e._latestEditorState,T,A))}}}e.setClipboard(null)}if(y.length){var D=r.create({style:b.getCurrentInlineStyle(),entity:h(b.getCurrentContent(),b.getSelection())}),I=c.getCurrentBlockType(b),R=a.processText(y,D,I),P=s.createFromArray(R);e.update(g(e._latestEditorState,P))}}}},10292(e,t,i){"use strict";var s=i(35693),r=i(59539),n=i(71093),o=i(15801);e.exports=function(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var t=e.props.editorState.getSelection();s.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:(new Error).stack}),selectionState:JSON.stringify(t.toJS())})}}else{var i=e.props.editorState,a=o(i,n(e)),l=a.selectionState;l!==i.getSelection()&&(i=a.needsRecovery?r.forceSelection(i,l):r.acceptSelection(i,l),e.update(i))}}},30370(e,t,i){"use strict";var s=i(93184),r=i(13145).strlen;e.exports=function(e,t){var i=[];return e.findEntityRanges(function(e){return!!e.getEntity()},function(n,o){var a=e.getText(),l=e.getEntityAt(n);i.push({offset:r(a.slice(0,n)),length:r(a.slice(n,o)),key:Number(t[s.stringify(l)])})}),i}},3399(e,t,i){"use strict";var s=i(13145),r=i(14910),n=function(e,t){return e===t},o=function(e){return!!e},a=[];e.exports=function(e){var t=e.getCharacterList().map(function(e){return e.getStyle()}).toList(),i=t.flatten().toSet().map(function(i){return function(e,t,i){var a=[],l=t.map(function(e){return e.has(i)}).toList();return r(l,n,o,function(t,r){var n=e.getText();a.push({offset:s.strlen(n.slice(0,t)),length:s.strlen(n.slice(t,r)),style:i})}),a}(e,t,i)});return Array.prototype.concat.apply(a,i.toJS())}},31950(e,t,i){"use strict";var s=i(13145),r=i(82097),n=i(45072),o=i(40041);function a(e,t){for(var i=1/0,s=1/0,r=-1/0,n=-1/0,o=0;o<e.length;o++){var a=e[o];0!==a.width&&1!==a.width&&(i=Math.min(i,a.top),s=Math.min(s,a.bottom),r=Math.max(r,a.top),n=Math.max(n,a.bottom))}return r<=s&&r-i<t&&n-s<t}function l(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}e.exports=function(e){e.collapsed||o(!1);var t=(e=e.cloneRange()).startContainer;1!==t.nodeType&&(t=t.parentNode);var i=function(e){var t=getComputedStyle(e),i=r(e),s=i.createElement("div");s.style.fontFamily=t.fontFamily,s.style.fontSize=t.fontSize,s.style.fontStyle=t.fontStyle,s.style.fontWeight=t.fontWeight,s.style.lineHeight=t.lineHeight,s.style.position="absolute",s.textContent="M";var n=i.body;n||o(!1),n.appendChild(s);var a=s.getBoundingClientRect();return n.removeChild(s),a.height}(t),c=e.endContainer,h=e.endOffset;for(e.setStart(e.startContainer,0);a(n(e),i)&&(c=e.startContainer,h=e.startOffset,c.parentNode||o(!1),e.setStartBefore(c),1!==c.nodeType||"inline"===getComputedStyle(c).display););for(var d=c,u=h-1;;){for(var p=d.nodeValue,g=u;g>=0;g--)if(!(null!=p&&g>0&&s.isSurrogatePair(p,g-1))){if(e.setStart(d,g),!a(n(e),i))break;c=d,h=g}if(-1===g||0===d.childNodes.length)break;u=l(d=d.childNodes[g])}return e.setStart(c,h),e}},65461(e,t,i){"use strict";var s=i(82097),r=i(39762);e.exports=function(e){for(var t=e;t&&t!==s(e).documentElement;){var i=r(t);if(null!=i)return i;t=t.parentNode}return null}},14910(e){"use strict";e.exports=function(e,t,i,s){if(e.size){var r=0;e.reduce(function(e,n,o){return t(e,n)||(i(e)&&s(r,o),r=o),n}),i(e.last())&&s(r,e.count())}}},12634(e){"use strict";var t={},i=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||t.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*i).toString(32);return t[e]=!0,e}},64047(e,t,i){"use strict";var s=i(451),r=i(23474),n=i(40041);function o(e,t,i,o,a,l,c){var h=i.getStartOffset(),d=i.getEndOffset(),u=e.__get(a).getMutability(),p=c?h:d;if("MUTABLE"===u)return i;var g=r(t,a).filter(function(e){return p<=e.end&&p>=e.start});1!=g.length&&n(!1);var m=g[0];if("IMMUTABLE"===u)return i.merge({anchorOffset:m.start,focusOffset:m.end,isBackward:!1});l||(c?d=m.end:h=m.start);var f=s.getRemovalRange(h,d,t.getText().slice(m.start,m.end),m.start,o);return i.merge({anchorOffset:f.start,focusOffset:f.end,isBackward:!1})}e.exports=function(e,t,i,s,r){var n=s.getStartOffset(),a=s.getEndOffset(),l=t.getEntityAt(n),c=i.getEntityAt(a-1);if(!l&&!c)return s;var h=s;if(l&&l===c)h=o(e,t,h,r,l,!0,!0);else if(l&&c){var d=o(e,t,h,r,l,!1,!0),u=o(e,i,h,r,c,!1,!1);h=h.merge({anchorOffset:d.getAnchorOffset(),focusOffset:u.getFocusOffset(),isBackward:!1})}else if(l){var p=o(e,t,h,r,l,!1,!0);h=h.merge({anchorOffset:p.getStartOffset(),isBackward:!1})}else if(c){var g=o(e,i,h,r,c,!1,!1);h=h.merge({focusOffset:g.getEndOffset(),isBackward:!1})}return h}},71093(e,t,i){"use strict";var s=i(40041),r=i(44110);e.exports=function(e){var t=e.editorContainer;return t||s(!1),r(t.firstChild)||s(!1),t.firstChild}},54095(e,t,i){"use strict";var s=i(30287),r=i(91825);e.exports=function(e,t){var i=t.getStartKey(),n=t.getStartOffset(),o=t.getEndKey(),a=t.getEndOffset(),l=r(e,t).getBlockMap(),c=l.keySeq(),h=c.indexOf(i),d=c.indexOf(o)+1;return s(l.slice(h,d).map(function(e,t){var s=e.getText(),r=e.getCharacterList();return i===o?e.merge({text:s.slice(n,a),characterList:r.slice(n,a)}):t===i?e.merge({text:s.slice(n),characterList:r.slice(n)}):t===o?e.merge({text:s.slice(0,a),characterList:r.slice(0,a)}):e}))}},82097(e){"use strict";e.exports=function(e){return e&&e.ownerDocument?e.ownerDocument:document}},93564(e,t,i){"use strict";var s=i(8117),r=i(4617),n=i(63390),o=n.isPlatform("Mac OS X"),a=o&&n.isBrowser("Firefox < 29"),l=s.hasCommandModifier,c=s.isCtrlKeyCommand;function h(e){return o&&e.altKey||c(e)}e.exports=function(e){switch(e.keyCode){case 66:return l(e)?"bold":null;case 68:return c(e)?"delete":null;case 72:return c(e)?"backspace":null;case 73:return l(e)?"italic":null;case 74:return l(e)?"code":null;case 75:return o&&c(e)?"secondary-cut":null;case 77:case 79:return c(e)?"split-block":null;case 84:return o&&c(e)?"transpose-characters":null;case 85:return l(e)?"underline":null;case 87:return o&&c(e)?"backspace-word":null;case 89:return c(e)?o?"secondary-paste":"redo":null;case 90:return function(e){return l(e)?e.shiftKey?"redo":"undo":null}(e)||null;case r.RETURN:return"split-block";case r.DELETE:return function(e){return!o&&e.shiftKey?null:h(e)?"delete-word":"delete"}(e);case r.BACKSPACE:return function(e){return l(e)&&o?"backspace-to-start-of-line":h(e)?"backspace-word":"backspace"}(e);case r.LEFT:return a&&l(e)?"move-selection-to-start-of-block":null;case r.RIGHT:return a&&l(e)?"move-selection-to-end-of-block":null;default:return null}}},15801(e,t,i){"use strict";var s=i(89668);e.exports=function(e,t){var i=t.ownerDocument.defaultView.getSelection(),r=i.anchorNode,n=i.anchorOffset,o=i.focusNode,a=i.focusOffset;return 0===i.rangeCount||null==r||null==o?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:s(e,t,r,n,o,a)}},89668(e,t,i){"use strict";var s=i(65461),r=i(39762),n=i(69397),o=i(40041),a=i(66305),l=i(25813);function c(e,t,i){var n=t,c=s(n);if(null!=c||e&&(e===n||e.firstChild===n)||o(!1),e===n&&(n=n.firstChild,a(n)||o(!1),"true"!==n.getAttribute("data-contents")&&o(!1),i>0&&(i=n.childNodes.length)),0===i){var d=null;if(null!=c)d=c;else{var u=function(e){for(;e.firstChild&&(a(e.firstChild)&&"true"===e.firstChild.getAttribute("data-blocks")||r(e.firstChild));)e=e.firstChild;return e}(n);d=l(r(u))}return{key:d,offset:0}}var p=n.childNodes[i-1],g=null,m=null;if(r(p)){var f=function(e){for(;e.lastChild&&(a(e.lastChild)&&"true"===e.lastChild.getAttribute("data-blocks")||r(e.lastChild));)e=e.lastChild;return e}(p);g=l(r(f)),m=h(f)}else g=l(c),m=h(p);return{key:g,offset:m}}function h(e){var t=e.textContent;return"\n"===t?0:t.length}e.exports=function(e,t,i,r,o,a){var h=i.nodeType===Node.TEXT_NODE,d=o.nodeType===Node.TEXT_NODE;if(h&&d)return{selectionState:n(e,l(s(i)),r,l(s(o)),a),needsRecovery:!1};var u=null,p=null,g=!0;return h?(u={key:l(s(i)),offset:r},p=c(t,o,a)):d?(p={key:l(s(o)),offset:a},u=c(t,i,r)):(u=c(t,i,r),p=c(t,o,a),i===o&&r===a&&(g=!!i.firstChild&&"BR"!==i.firstChild.nodeName)),{selectionState:n(e,u.key,u.offset,p.key,p.offset),needsRecovery:g}}},60836(e,t,i){"use strict";var s=i(25070).notEmptyKey;function r(e,t){return s(t)&&"MUTABLE"===e.__get(t).getMutability()?t:null}e.exports=function(e,t){var i;if(t.isCollapsed()){var s=t.getAnchorKey(),n=t.getAnchorOffset();return n>0?(i=e.getBlockForKey(s).getEntityAt(n-1))!==e.getBlockForKey(s).getEntityAt(n)?null:r(e.getEntityMap(),i):null}var o=t.getStartKey(),a=t.getStartOffset(),l=e.getBlockForKey(o);return i=a===l.getLength()?null:l.getEntityAt(a),r(e.getEntityMap(),i)}},13355(e,t,i){"use strict";var s=i(54095);e.exports=function(e){var t=e.getSelection();return t.isCollapsed()?null:s(e.getCurrentContent(),t)}},26167(e,t,i){"use strict";var s=i(31527);e.exports=function(e,t){if(!(e instanceof s))return null;var i=e.getNextSiblingKey();if(i)return i;var r=e.getParentKey();if(!r)return null;for(var n=t.get(r);n&&!n.getNextSiblingKey();){var o=n.getParentKey();n=o?t.get(o):null}return n?n.getNextSiblingKey():null}},68768(e){"use strict";e.exports=function(e){return Object.keys(e).map(function(t){return e[t]})}},66017(e,t,i){"use strict";var s=i(45072);e.exports=function(e){var t=s(e),i=0,r=0,n=0,o=0;if(t.length){if(t.length>1&&0===t[0].width){var a=t[1];i=a.top,r=a.right,n=a.bottom,o=a.left}else{var l=t[0];i=l.top,r=l.right,n=l.bottom,o=l.left}for(var c=1;c<t.length;c++){var h=t[c];0!==h.height&&0!==h.width&&(i=Math.min(i,h.top),r=Math.max(r,h.right),n=Math.max(n,h.bottom),o=Math.min(o,h.left))}}return{top:i,right:r,bottom:n,left:o,width:r-o,height:n-i}}},45072(e,t,i){"use strict";var s=i(63390),r=i(40041),n=s.isBrowser("Chrome")?function(e){for(var t=e.cloneRange(),i=[],s=e.endContainer;null!=s;s=s.parentNode){var n=s===e.commonAncestorContainer;n?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var o,a=Array.from(t.getClientRects());if(i.push(a),n)return i.reverse(),(o=[]).concat.apply(o,i);t.setEndBefore(s)}r(!1)}:function(e){return Array.from(e.getClientRects())};e.exports=n},23474(e,t,i){"use strict";var s=i(40041);e.exports=function(e,t){var i=[];return e.findEntityRanges(function(e){return e.getEntity()===t},function(e,t){i.push({start:e,end:t})}),i.length||s(!1),i}},38413(e,t,i){"use strict";var s=i(63390),r=i(40041),n=s.isBrowser("IE <= 9");e.exports=function(e){var t,i=null;return!n&&document.implementation&&document.implementation.createHTMLDocument&&((t=document.implementation.createHTMLDocument("foo")).documentElement||r(!1),t.documentElement.innerHTML=e,i=t.getElementsByTagName("body")[0]),i}},39762(e,t,i){"use strict";var s=i(66305);e.exports=function e(t){if(s(t)){var i=t,r=i.getAttribute("data-offset-key");if(r)return r;for(var n=0;n<i.childNodes.length;n++){var o=e(i.childNodes[n]);if(o)return o}}return null}},27786(e,t,i){"use strict";var s=i(40041),r=/\.textClipping$/,n={"text/plain":!0,"text/html":!0,"text/rtf":!0};e.exports=function(e,t){var i=0,o=[];e.forEach(function(a){!function(e,t){if(!globalThis.FileReader||e.type&&!(e.type in n))t("");else{if(""===e.type){var i="";return r.test(e.name)&&(i=e.name.replace(r,"")),void t(i)}var o=new FileReader;o.onload=function(){var e=o.result;"string"!=typeof e&&s(!1),t(e)},o.onerror=function(){t("")},o.readAsText(e)}}(a,function(s){i++,s&&o.push(s.slice(0,5e3)),i==e.length&&t(o.join("\r"))})})}},69397(e,t,i){"use strict";var s=i(13878),r=i(25813);e.exports=function(e,t,i,n,o){var a=r(e.getSelection());if(!t||!n)return a;var l=s.decode(t),c=l.blockKey,h=e.getBlockTree(c),d=h&&h.getIn([l.decoratorKey,"leaves",l.leafKey]),u=s.decode(n),p=u.blockKey,g=e.getBlockTree(p),m=g&&g.getIn([u.decoratorKey,"leaves",u.leafKey]);if(!d||!m)return a;var f=d.get("start"),y=m.get("start"),v=d?f+i:null,C=m?y+o:null;if(a.getAnchorKey()===c&&a.getAnchorOffset()===v&&a.getFocusKey()===p&&a.getFocusOffset()===C)return a;var b=!1;if(c===p){var S=d.get("end"),w=m.get("end");b=y===f&&w===S?o<i:y<f}else b=e.getCurrentContent().getBlockMap().keySeq().skipUntil(function(e){return e===c||e===p}).first()===p;return a.merge({anchorKey:c,anchorOffset:v,focusKey:p,focusOffset:C,isBackward:b})}},50531(e,t,i){"use strict";var s=i(66017);e.exports=function(e){var t=e.getSelection();if(!t.rangeCount)return null;var i=t.getRangeAt(0),r=s(i),n=r.top,o=r.right,a=r.bottom,l=r.left;return 0===n&&0===o&&0===a&&0===l?null:r}},82826(e){"use strict";e.exports=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}},17595(e){"use strict";e.exports=function(e){return!("undefined"==typeof window||!window.__DRAFT_GKX||!window.__DRAFT_GKX[e])}},72368(e,t,i){"use strict";var s=i(84433),r=i(31527),n=i(99251),o=i(86374),a=i(40041),l=i(30287),c=n.List;e.exports=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA";t.isCollapsed()||a(!1);var h=e.getBlockMap(),d=l(i),u=t.getStartKey(),p=t.getStartOffset(),g=h.get(u);return g instanceof r&&(g.getChildKeys().isEmpty()||a(!1)),1===d.size?function(e,t,i,s,r,n){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"REPLACE_WITH_NEW_DATA",l=i.get(r),c=l.getText(),h=l.getCharacterList(),d=r,u=n+s.getText().length,p=null;switch(a){case"MERGE_OLD_DATA_TO_NEW_DATA":p=s.getData().merge(l.getData());break;case"REPLACE_WITH_NEW_DATA":p=s.getData()}var g=l.getType();c&&"unstyled"===g&&(g=s.getType());var m=l.merge({text:c.slice(0,n)+s.getText()+c.slice(n),characterList:o(h,s.getCharacterList(),n),type:g,data:p});return e.merge({blockMap:i.set(r,m),selectionBefore:t,selectionAfter:t.merge({anchorKey:d,anchorOffset:u,focusKey:d,focusOffset:u,isBackward:!1})})}(e,t,h,d.first(),u,p,n):function(e,t,i,n,o,a){var l=i.first()instanceof r,h=[],d=n.size,u=i.get(o),p=n.first(),g=n.last(),m=g.getLength(),f=g.getKey(),y=l&&(!u.getChildKeys().isEmpty()||!p.getChildKeys().isEmpty());i.forEach(function(e,t){t===o?(y?h.push(e):h.push(function(e,t,i){var s=e.getText(),r=e.getCharacterList(),n=s.slice(0,t),o=r.slice(0,t),a=i.first();return e.merge({text:n+a.getText(),characterList:o.concat(a.getCharacterList()),type:n?e.getType():a.getType(),data:a.getData()})}(e,a,n)),n.slice(y?0:1,d-1).forEach(function(e){return h.push(e)}),h.push(function(e,t,i){var s=e.getText(),r=e.getCharacterList(),n=s.length,o=s.slice(t,n),a=r.slice(t,n),l=i.last();return l.merge({text:l.getText()+o,characterList:l.getCharacterList().concat(a),data:l.getData()})}(e,a,n))):h.push(e)});var v=s.createFromArray(h);return l&&(v=function(e,t,i,s){return e.withMutations(function(t){var r=i.getKey(),n=s.getKey(),o=i.getNextSiblingKey(),a=i.getParentKey(),l=function(e,t){var i=e.getKey(),s=e,r=[];for(t.get(i)&&r.push(i);s&&s.getNextSiblingKey();){var n=s.getNextSiblingKey();if(!n)break;r.push(n),s=t.get(n)}return r}(s,e),h=l[l.length-1];if(t.get(n)?(t.setIn([r,"nextSibling"],n),t.setIn([n,"prevSibling"],r)):(t.setIn([r,"nextSibling"],s.getNextSiblingKey()),t.setIn([s.getNextSiblingKey(),"prevSibling"],r)),t.setIn([h,"nextSibling"],o),o&&t.setIn([o,"prevSibling"],h),l.forEach(function(e){return t.setIn([e,"parent"],a)}),a){var d=e.get(a).getChildKeys(),u=d.indexOf(r)+1,p=d.toArray();p.splice.apply(p,[u,0].concat(l)),t.setIn([a,"children"],c(p))}})}(v,0,u,p)),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:f,anchorOffset:m,focusKey:f,focusOffset:m,isBackward:!1})})}(e,t,h,d,u,p)}},86374(e){"use strict";e.exports=function(e,t,i){var s=e;if(i===s.count())t.forEach(function(e){s=s.push(e)});else if(0===i)t.reverse().forEach(function(e){s=s.unshift(e)});else{var r=s.slice(0,i),n=s.slice(i);s=r.concat(t,n).toList()}return s}},32983(e,t,i){"use strict";var s=i(99251),r=i(86374),n=i(40041),o=s.Repeat;e.exports=function(e,t,i,s){t.isCollapsed()||n(!1);var a=null;if(null!=i&&(a=i.length),null==a||0===a)return e;var l=e.getBlockMap(),c=t.getStartKey(),h=t.getStartOffset(),d=l.get(c),u=d.getText(),p=d.merge({text:u.slice(0,h)+i+u.slice(h,d.getLength()),characterList:r(d.getCharacterList(),o(s,a).toList(),h)}),g=h+a;return e.merge({blockMap:l.set(c,p),selectionAfter:t.merge({anchorOffset:g,focusOffset:g})})}},66305(e){"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&e.nodeType===Node.ELEMENT_NODE}},46415(e){"use strict";e.exports=function(e){return"handled"===e||!0===e}},34189(e,t,i){"use strict";var s=i(66305);e.exports=function(e){return!(!e||!e.ownerDocument)&&s(e)&&"A"===e.nodeName}},4734(e,t,i){"use strict";var s=i(66305);e.exports=function(e){return!(!e||!e.ownerDocument)&&s(e)&&"BR"===e.nodeName}},44110(e){"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&(e.ownerDocument.defaultView?e instanceof e.ownerDocument.defaultView.HTMLElement:e instanceof HTMLElement)}},80119(e,t,i){"use strict";var s=i(66305);e.exports=function(e){return!(!e||!e.ownerDocument)&&s(e)&&"IMG"===e.nodeName}},76871(e){"use strict";e.exports=function(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}},65044(e){"use strict";e.exports=function(e){var t=e.getSelection(),i=t.getAnchorKey(),s=e.getBlockTree(i),r=t.getStartOffset(),n=!1;return s.some(function(e){return r===e.get("start")?(n=!0,!0):r<e.get("end")&&e.get("leaves").some(function(e){var t=e.get("start");return r===t&&(n=!0,!0)})}),n}},97253(e,t,i){"use strict";var s=i(4617);e.exports=function(e){return e.which===s.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}},50976(e,t,i){"use strict";var s=i(59539),r=i(31950),n=i(89668),o=i(95625),a=i(16335);e.exports=function(e,t){var i=a(e,function(e){var i=e.getSelection();if(i.isCollapsed()&&0===i.getAnchorOffset())return o(e,1);var s=t.currentTarget.ownerDocument.defaultView.getSelection().getRangeAt(0);return s=r(s),n(e,null,s.endContainer,s.endOffset,s.startContainer,s.startOffset).selectionState},"backward");return i===e.getCurrentContent()?e:s.push(e,i,"remove-range")}},44126(e,t,i){"use strict";var s=i(76425),r=i(59539),n=i(95625),o=i(16335);e.exports=function(e){var t=o(e,function(e){var t=e.getSelection(),i=t.getStartOffset();if(0===i)return n(e,1);var r=t.getStartKey(),o=e.getCurrentContent().getBlockForKey(r).getText().slice(0,i),a=s.getBackward(o);return n(e,a.length||1)},"backward");return t===e.getCurrentContent()?e:r.push(e,t,"remove-range")}},27130(e,t,i){"use strict";var s=i(76425),r=i(59539),n=i(30919),o=i(16335);e.exports=function(e){var t=o(e,function(e){var t=e.getSelection(),i=t.getStartOffset(),r=t.getStartKey(),o=e.getCurrentContent().getBlockForKey(r).getText().slice(i),a=s.getForward(o);return n(e,a.length||1)},"forward");return t===e.getCurrentContent()?e:r.push(e,t,"remove-range")}},79774(e,t,i){"use strict";var s=i(58267),r=i(59539);e.exports=function(e){var t=s.splitBlock(e.getCurrentContent(),e.getSelection());return r.push(e,t,"split-block")}},11644(e,t,i){"use strict";var s=i(59539);e.exports=function(e){var t=e.getSelection(),i=t.getEndKey(),r=e.getCurrentContent().getBlockForKey(i).getLength();return s.set(e,{selection:t.merge({anchorKey:i,anchorOffset:r,focusKey:i,focusOffset:r,isBackward:!1}),forceSelection:!0})}},63467(e,t,i){"use strict";var s=i(59539);e.exports=function(e){var t=e.getSelection(),i=t.getStartKey();return s.set(e,{selection:t.merge({anchorKey:i,anchorOffset:0,focusKey:i,focusOffset:0,isBackward:!1}),forceSelection:!0})}},97402(e,t,i){"use strict";var s=i(59539),r=i(13145),n=i(95625),o=i(16335);e.exports=function(e){var t=o(e,function(e){var t=e.getSelection(),i=e.getCurrentContent(),s=t.getAnchorKey(),o=t.getAnchorOffset(),a=i.getBlockForKey(s).getText()[o-1];return n(e,a?r.getUTF16Length(a,0):1)},"backward");if(t===e.getCurrentContent())return e;var i=e.getSelection();return s.push(e,t.set("selectionBefore",i),i.isCollapsed()?"backspace-character":"remove-range")}},12750(e,t,i){"use strict";var s=i(59539),r=i(13145),n=i(30919),o=i(16335);e.exports=function(e){var t=o(e,function(e){var t=e.getSelection(),i=e.getCurrentContent(),s=t.getAnchorKey(),o=t.getAnchorOffset(),a=i.getBlockForKey(s).getText()[o];return n(e,a?r.getUTF16Length(a,0):1)},"forward");if(t===e.getCurrentContent())return e;var i=e.getSelection();return s.push(e,t.set("selectionBefore",i),i.isCollapsed()?"delete-character":"remove-range")}},2194(e,t,i){"use strict";var s=i(58267),r=i(59539),n=i(54095);e.exports=function(e){var t=e.getSelection();if(!t.isCollapsed())return e;var i=t.getAnchorOffset();if(0===i)return e;var o,a,l=t.getAnchorKey(),c=e.getCurrentContent(),h=c.getBlockForKey(l).getLength();if(h<=1)return e;i===h?(o=t.set("anchorOffset",i-1),a=t):a=(o=t.set("focusOffset",i+1)).set("anchorOffset",i+1);var d=n(c,o),u=s.removeRange(c,o,"backward"),p=u.getSelectionAfter(),g=p.getAnchorOffset()-1,m=p.merge({anchorOffset:g,focusOffset:g}),f=s.replaceWithFragment(u,m,d),y=r.push(e,f,"insert-fragment");return r.acceptSelection(y,a)}},38707(e,t,i){"use strict";var s=i(59539);e.exports=function(e,t,i){var r=s.undo(t);if("spellcheck-change"!==t.getLastChangeType())e.preventDefault(),t.getNativelyRenderedContent()?(i(s.set(t,{nativelyRenderedContent:null})),setTimeout(function(){i(r)},0)):i(r);else{var n=r.getCurrentContent();i(s.set(r,{nativelyRenderedContent:n}))}}},79981(e,t,i){"use strict";var s=i(99251).Map;e.exports=function(e,t,i){var r=t.getStartKey(),n=t.getEndKey(),o=e.getBlockMap(),a=o.toSeq().skipUntil(function(e,t){return t===r}).takeUntil(function(e,t){return t===n}).concat(s([[n,o.get(n)]])).map(i);return e.merge({blockMap:o.merge(a),selectionBefore:t,selectionAfter:t})}},83886(e,t,i){"use strict";var s=i(31527),r=i(26167),n=i(99251),o=i(40041),a=n.OrderedMap,l=n.List,c=function(e,t,i){if(e){var s=t.get(e);s&&t.set(e,i(s))}},h=function(e,t,i,s,r){if(!r)return e;var n="after"===s,o=t.getKey(),a=i.getKey(),h=t.getParentKey(),d=t.getNextSiblingKey(),u=t.getPrevSiblingKey(),p=i.getParentKey(),g=n?i.getNextSiblingKey():a,m=n?a:i.getPrevSiblingKey();return e.withMutations(function(e){c(h,e,function(e){var t=e.getChildKeys();return e.merge({children:t.delete(t.indexOf(o))})}),c(u,e,function(e){return e.merge({nextSibling:d})}),c(d,e,function(e){return e.merge({prevSibling:u})}),c(g,e,function(e){return e.merge({prevSibling:o})}),c(m,e,function(e){return e.merge({nextSibling:o})}),c(p,e,function(e){var t=e.getChildKeys(),i=t.indexOf(a),s=n?i+1:0!==i?i-1:0,r=t.toArray();return r.splice(s,0,o),e.merge({children:l(r)})}),c(o,e,function(e){return e.merge({nextSibling:g,prevSibling:m,parent:p})})})};e.exports=function(e,t,i,n){"replace"===n&&o(!1);var l=i.getKey(),c=t.getKey();c===l&&o(!1);var d=e.getBlockMap(),u=t instanceof s,p=[t],g=d.delete(c);u&&(p=[],g=d.withMutations(function(e){var i=t.getNextSiblingKey(),s=r(t,e);e.toSeq().skipUntil(function(e){return e.getKey()===c}).takeWhile(function(e){var t=e.getKey(),r=t===c,n=i&&t!==i,o=!i&&e.getParentKey()&&(!s||t!==s);return!!(r||n||o)}).forEach(function(t){p.push(t),e.delete(t.getKey())})}));var m=g.toSeq().takeUntil(function(e){return e===i}),f=g.toSeq().skipUntil(function(e){return e===i}).skip(1),y=p.map(function(e){return[e.getKey(),e]}),v=a();if("before"===n){var C=e.getBlockBefore(l);C&&C.getKey()===t.getKey()&&o(!1),v=m.concat([].concat(y,[[l,i]]),f).toOrderedMap()}else if("after"===n){var b=e.getBlockAfter(l);b&&b.getKey()===c&&o(!1),v=m.concat([[l,i]].concat(y),f).toOrderedMap()}return e.merge({blockMap:h(v,t,i,n,u),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:c,focusKey:c})})}},95625(e,t,i){"use strict";i(92697),e.exports=function(e,t){var i=e.getSelection(),s=e.getCurrentContent(),r=i.getStartKey(),n=i.getStartOffset(),o=r,a=0;if(t>n){var l=s.getKeyBefore(r);null==l?o=r:(o=l,a=s.getBlockForKey(l).getText().length)}else a=n-t;return i.merge({focusKey:o,focusOffset:a,isBackward:!0})}},30919(e,t,i){"use strict";i(92697),e.exports=function(e,t){var i,s=e.getSelection(),r=s.getStartKey(),n=s.getStartOffset(),o=e.getCurrentContent(),a=r;return t>o.getBlockForKey(r).getText().length-n?(a=o.getKeyAfter(r),i=0):i=n+t,s.merge({focusKey:a,focusOffset:i})}},30287(e,t,i){"use strict";var s=i(31527),r=i(12634),n=i(99251).OrderedMap;e.exports=function(e){return e.first()instanceof s?function(e){var t,i={};return n(e.withMutations(function(e){e.forEach(function(s,n){var o=s.getKey(),a=s.getNextSiblingKey(),l=s.getPrevSiblingKey(),c=s.getChildKeys(),h=s.getParentKey(),d=r();if(i[o]=d,a&&(e.get(a)?e.setIn([a,"prevSibling"],d):e.setIn([o,"nextSibling"],null)),l&&(e.get(l)?e.setIn([l,"nextSibling"],d):e.setIn([o,"prevSibling"],null)),h&&e.get(h)){var u=e.get(h).getChildKeys();e.setIn([h,"children"],u.set(u.indexOf(s.getKey()),d))}else e.setIn([o,"parent"],null),t&&(e.setIn([t.getKey(),"nextSibling"],d),e.setIn([o,"prevSibling"],i[t.getKey()])),t=e.get(o);c.forEach(function(t){e.get(t)?e.setIn([t,"parent"],d):e.setIn([o,"children"],s.getChildKeys().filter(function(e){return e!==t}))})})}).toArray().map(function(e){return[i[e.getKey()],e.set("key",i[e.getKey()])]}))}(e):function(e){return n(e.toArray().map(function(e){var t=r();return[t,e.set("key",t)]}))}(e)}},91825(e,t,i){"use strict";var s=i(41671),r=i(14910),n=i(40041);function o(e,t,i){var o=t.getCharacterList(),a=i>0?o.get(i-1):void 0,l=i<o.count()?o.get(i):void 0,c=a?a.getEntity():void 0,h=l?l.getEntity():void 0;if(h&&h===c&&"MUTABLE"!==e.__get(h).getMutability()){for(var d,u=function(e,t,i){var s;return r(e,function(e,t){return e.getEntity()===t.getEntity()},function(e){return e.getEntity()===t},function(e,t){e<=i&&t>=i&&(s={start:e,end:t})}),"object"!=typeof s&&n(!1),s}(o,h,i),p=u.start,g=u.end;p<g;)d=o.get(p),o=o.set(p,s.applyEntity(d,null)),p++;return t.set("characterList",o)}return t}e.exports=function(e,t){var i=e.getBlockMap(),s=e.getEntityMap(),r={},n=t.getStartKey(),a=t.getStartOffset(),l=i.get(n),c=o(s,l,a);c!==l&&(r[n]=c);var h=t.getEndKey(),d=t.getEndOffset(),u=i.get(h);n===h&&(u=c);var p=o(s,u,d);return p!==u&&(r[h]=p),Object.keys(r).length?e.merge({blockMap:i.merge(r),selectionAfter:t}):e.set("selectionAfter",t)}},5646(e,t,i){"use strict";var s=i(31527),r=i(26167),n=i(99251),o=(n.List,n.Map),a=function(e,t,i){if(e){var s=t.get(e);s&&t.set(e,i(s))}},l=function(e,t){var i=[];if(!e)return i;for(var s=t.get(e);s&&s.getParentKey();){var r=s.getParentKey();r&&i.push(r),s=r?t.get(r):null}return i},c=function(e,t,i){if(!e)return null;for(var s=i.get(e.getKey()).getNextSiblingKey();s&&!t.get(s);)s=i.get(s).getNextSiblingKey()||null;return s},h=function(e,t,i){if(!e)return null;for(var s=i.get(e.getKey()).getPrevSiblingKey();s&&!t.get(s);)s=i.get(s).getPrevSiblingKey()||null;return s};e.exports=function(e,t){if(t.isCollapsed())return e;var i,n=e.getBlockMap(),d=t.getStartKey(),u=t.getStartOffset(),p=t.getEndKey(),g=t.getEndOffset(),m=n.get(d),f=n.get(p),y=m instanceof s,v=[];if(y){var C=f.getChildKeys(),b=l(p,n);f.getNextSiblingKey()&&(v=v.concat(b)),C.isEmpty()||(v=v.concat(b.concat([p]))),v=v.concat(l(r(f,n),n))}i=m===f?function(e,t,i){if(0===t)for(;t<i;)e=e.shift(),t++;else if(i===e.count())for(;i>t;)e=e.pop(),i--;else{var s=e.slice(0,t),r=e.slice(i);e=s.concat(r).toList()}return e}(m.getCharacterList(),u,g):m.getCharacterList().slice(0,u).concat(f.getCharacterList().slice(g));var S=m.merge({text:m.getText().slice(0,u)+f.getText().slice(g),characterList:i}),w=y&&0===u&&0===g&&f.getParentKey()===d&&null==f.getPrevSiblingKey()?o([[d,null]]):n.toSeq().skipUntil(function(e,t){return t===d}).takeUntil(function(e,t){return t===p}).filter(function(e,t){return-1===v.indexOf(t)}).concat(o([[p,null]])).map(function(e,t){return t===d?S:null}),x=n.merge(w).filter(function(e){return!!e});return y&&m!==f&&(x=function(e,t,i,s){return e.withMutations(function(n){if(a(t.getKey(),n,function(e){return e.merge({nextSibling:c(e,n,s),prevSibling:h(e,n,s)})}),a(i.getKey(),n,function(e){return e.merge({nextSibling:c(e,n,s),prevSibling:h(e,n,s)})}),l(t.getKey(),s).forEach(function(e){return a(e,n,function(e){return e.merge({children:e.getChildKeys().filter(function(e){return n.get(e)}),nextSibling:c(e,n,s),prevSibling:h(e,n,s)})})}),a(t.getNextSiblingKey(),n,function(e){return e.merge({prevSibling:t.getPrevSiblingKey()})}),a(t.getPrevSiblingKey(),n,function(e){return e.merge({nextSibling:c(e,n,s)})}),a(i.getNextSiblingKey(),n,function(e){return e.merge({prevSibling:h(e,n,s)})}),a(i.getPrevSiblingKey(),n,function(e){return e.merge({nextSibling:i.getNextSiblingKey()})}),l(i.getKey(),s).forEach(function(e){a(e,n,function(e){return e.merge({children:e.getChildKeys().filter(function(e){return n.get(e)}),nextSibling:c(e,n,s),prevSibling:h(e,n,s)})})}),function(e,t){var i=[];if(!e)return i;for(var s=r(e,t);s&&t.get(s);){var n=t.get(s);i.push(s),s=n.getParentKey()?r(n,t):null}return i}(i,s).forEach(function(e){return a(e,n,function(e){return e.merge({nextSibling:c(e,n,s),prevSibling:h(e,n,s)})})}),null==e.get(t.getKey())&&null!=e.get(i.getKey())&&i.getParentKey()===t.getKey()&&null==i.getPrevSiblingKey()){var o=t.getPrevSiblingKey();a(i.getKey(),n,function(e){return e.merge({prevSibling:o})}),a(o,n,function(e){return e.merge({nextSibling:i.getKey()})});var d=o?e.get(o):null,u=d?d.getParentKey():null;if(t.getChildKeys().forEach(function(e){a(e,n,function(e){return e.merge({parent:u})})}),null!=u){var p=e.get(u);a(u,n,function(e){return e.merge({children:p.getChildKeys().concat(t.getChildKeys())})})}a(t.getChildKeys().find(function(t){return null===e.get(t).getNextSiblingKey()}),n,function(e){return e.merge({nextSibling:t.getNextSiblingKey()})})}})}(x,m,f,n)),e.merge({blockMap:x,selectionBefore:t,selectionAfter:t.merge({anchorKey:d,anchorOffset:u,focusKey:d,focusOffset:u,isBackward:!1})})}},16335(e,t,i){"use strict";var s=i(58267),r=i(17595)("draft_tree_data_support");e.exports=function(e,t,i){var n=e.getSelection(),o=e.getCurrentContent(),a=n,l=n.getAnchorKey(),c=n.getFocusKey(),h=o.getBlockForKey(l);if(r&&"forward"===i&&l!==c)return o;if(n.isCollapsed()){if("forward"===i){if(e.isSelectionAtEndOfContent())return o;if(r&&n.getAnchorOffset()===o.getBlockForKey(l).getLength()){var d=o.getBlockForKey(h.nextSibling);if(!d||0===d.getLength())return o}}else if(e.isSelectionAtStartOfContent())return o;if((a=t(e))===n)return o}return s.removeRange(o,a,i)}},10160(e){"use strict";var t=new RegExp("\r","g");e.exports=function(e){return e.replace(t,"")}},90933(e,t,i){"use strict";var s=i(7618),r=i(35693),n=i(63390),o=i(68820),a=i(53967),l=i(82097),c=i(40041),h=i(66305),d=n.isBrowser("IE");function u(e,t){if(!e)return"[empty]";var i=p(e,t);return i.nodeType===Node.TEXT_NODE?i.textContent:(h(i)||c(!1),i.outerHTML)}function p(e,t){var i=void 0!==t?t(e):[];if(e.nodeType===Node.TEXT_NODE){var s=e.textContent.length;return l(e).createTextNode("[text "+s+(i.length?" | "+i.join(", "):"")+"]")}var r=e.cloneNode();1===r.nodeType&&i.length&&r.setAttribute("data-labels",i.join(", "));for(var n=e.childNodes,o=0;o<n.length;o++)r.appendChild(p(n[o],t));return r}function g(e,t){for(var i=e,s=i;i;){if(h(i)&&s.hasAttribute("contenteditable"))return u(i,t);s=i=i.parentNode}return"Could not find contentEditable parent of node"}function m(e){return null===e.nodeValue?e.childNodes.length:e.nodeValue.length}function f(e,t,i,s){var n=a();if(e.extend&&null!=t&&o(n,t)){i>m(t)&&r.logSelectionStateFailure({anonymizedDom:g(t),extraParams:JSON.stringify({offset:i}),selectionState:JSON.stringify(s.toJS())});var l=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,i)}catch(o){throw r.logSelectionStateFailure({anonymizedDom:g(t,function(t){var i=[];return t===n&&i.push("active element"),t===e.anchorNode&&i.push("selection anchor node"),t===e.focusNode&&i.push("selection focus node"),i}),extraParams:JSON.stringify({activeElementName:n?n.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:l,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:o?""+o:null,offset:i},null,2),selectionState:JSON.stringify(s.toJS(),null,2)}),o}}else if(t&&e.rangeCount>0){var c=e.getRangeAt(0);c.setEnd(t,i),e.addRange(c.cloneRange())}}function y(e,t,i,n){var o=l(t).createRange();if(i>m(t)&&(r.logSelectionStateFailure({anonymizedDom:g(t),extraParams:JSON.stringify({offset:i}),selectionState:JSON.stringify(n.toJS())}),s.handleExtensionCausedError()),o.setStart(t,i),d)try{e.addRange(o)}catch(e){}else e.addRange(o)}e.exports={setDraftEditorSelection:function(e,t,i,s,r){var n=l(t);if(o(n.documentElement,t)){var a=n.defaultView.getSelection(),c=e.getAnchorKey(),h=e.getAnchorOffset(),d=e.getFocusKey(),u=e.getFocusOffset(),p=e.getIsBackward();if(!a.extend&&p){var g=c,m=h;c=d,h=u,d=g,u=m,p=!1}var v=c===i&&s<=h&&r>=h,C=d===i&&s<=u&&r>=u;if(v&&C)return a.removeAllRanges(),y(a,t,h-s,e),void f(a,t,u-s,e);if(p){if(C&&(a.removeAllRanges(),y(a,t,u-s,e)),v){var b=a.focusNode,S=a.focusOffset;a.removeAllRanges(),y(a,t,h-s,e),f(a,b,S,e)}}else v&&(a.removeAllRanges(),y(a,t,h-s,e)),C&&f(a,t,u-s,e)}},addFocusToSelection:f}},2661(e,t,i){"use strict";var s=i(31527),r=i(12634),n=i(99251),o=i(40041),a=i(79981),l=n.List,c=n.Map,h=function(e,t,i){if(e){var s=t.get(e);s&&t.set(e,i(s))}};e.exports=function(e,t){t.isCollapsed()||o(!1);var i=t.getAnchorKey(),n=e.getBlockMap(),d=n.get(i),u=d.getText();if(!u){var p=d.getType();if("unordered-list-item"===p||"ordered-list-item"===p)return a(e,t,function(e){return e.merge({type:"unstyled",depth:0})})}var g=t.getAnchorOffset(),m=d.getCharacterList(),f=r(),y=d instanceof s,v=d.merge({text:u.slice(0,g),characterList:m.slice(0,g)}),C=v.merge({key:f,text:u.slice(g),characterList:m.slice(g),data:c()}),b=n.toSeq().takeUntil(function(e){return e===d}),S=n.toSeq().skipUntil(function(e){return e===d}).rest(),w=b.concat([[i,v],[f,C]],S).toOrderedMap();return y&&(d.getChildKeys().isEmpty()||o(!1),w=function(e,t,i){return e.withMutations(function(e){var s=t.getKey(),r=i.getKey();h(t.getParentKey(),e,function(e){var t=e.getChildKeys(),i=t.indexOf(s)+1,n=t.toArray();return n.splice(i,0,r),e.merge({children:l(n)})}),h(t.getNextSiblingKey(),e,function(e){return e.merge({prevSibling:r})}),h(s,e,function(e){return e.merge({nextSibling:r})}),h(r,e,function(e){return e.merge({prevSibling:s})})})}(w,v,C)),e.merge({blockMap:w,selectionBefore:t,selectionAfter:t.merge({anchorKey:f,anchorOffset:0,focusKey:f,focusOffset:0,isBackward:!1})})}},55585(e){"use strict";var t=/\r\n?|\n/g;e.exports=function(e){return e.split(t)}},10254(e){"use strict";e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}},53692(e){e.exports=function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.apply(this,arguments)};function t(e,t,i,s){return new(i||(i=Promise))(function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})}function i(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}var s,r,n,o,a,l;!function(e){e.INIT_IFRAME="INIT_IFRAME"}(s||(s={})),function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(r||(r={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(n||(n={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(o||(o={})),function(e){e.DataCloneError="DataCloneError"}(a||(a={})),function(e){e.Message="message"}(l||(l={}));const c={"http:":"80","https:":"443"},h=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,d=["file:","data:"],u=({name:e,message:t,stack:i})=>({name:e,message:t,stack:i});let p=0;var g=()=>++p,m=(e,t,i,s,a)=>{const{localName:c,local:h,remote:d,originForSending:u,originForReceiving:p}=t;let m=!1;a(`${c}: Connecting call sender`);return i.reduce((e,t)=>(e[t]=(e=>(...t)=>{let i;a(`${c}: Sending ${e}() call`);try{d.closed&&(i=!0)}catch(e){i=!0}if(i&&s(),m){const t=new Error(`Unable to send ${e}() call due to destroyed connection`);throw t.code=o.ConnectionDestroyed,t}return new Promise((i,s)=>{const o=g(),m=t=>{if(t.source!==d||t.data.penpal!==r.Reply||t.data.id!==o)return;if(t.origin!==p)return void a(`${c} received message from origin ${t.origin} which did not match expected origin ${p}`);const u=t.data;a(`${c}: Received ${e}() reply`),h.removeEventListener(l.Message,m);let g=u.returnValue;u.returnValueIsError&&(g=(e=>{const t=new Error;return Object.keys(e).forEach(i=>t[i]=e[i]),t})(g)),(u.resolution===n.Fulfilled?i:s)(g)};h.addEventListener(l.Message,m);const f={penpal:r.Call,id:o,methodName:e,args:t};d.postMessage(f,u)})})(t),e),e),()=>{m=!0}},f=(e,t,i,s,o)=>{const{destroy:c,onDestroy:h}=s;let d,p;const g={};return s=>{if(s.origin!==t)return void o(`Parent: Handshake - Received ACK message from origin ${s.origin} which did not match expected origin ${t}`);o("Parent: Handshake - Received ACK");const f={localName:"Parent",local:window,remote:s.source,originForSending:i,originForReceiving:t};d&&d(),d=((e,t,i)=>{const{localName:s,local:o,remote:c,originForSending:h,originForReceiving:d}=e;let p=!1;const g=e=>{if(e.source!==c||e.data.penpal!==r.Call)return;if(e.origin!==d)return void i(`${s} received message from origin ${e.origin} which did not match expected origin ${d}`);const o=e.data,{methodName:l,args:g,id:m}=o;i(`${s}: Received ${l}() call`);const f=e=>t=>{if(i(`${s}: Sending ${l}() reply`),p)return void i(`${s}: Unable to send ${l}() reply due to destroyed connection`);const o={penpal:r.Reply,id:m,resolution:e,returnValue:t};e===n.Rejected&&t instanceof Error&&(o.returnValue=u(t),o.returnValueIsError=!0);try{c.postMessage(o,h)}catch(e){if(e.name===a.DataCloneError){const t={penpal:r.Reply,id:m,resolution:n.Rejected,returnValue:u(e),returnValueIsError:!0};c.postMessage(t,h)}throw e}};new Promise(e=>e(t[l].apply(t,g))).then(f(n.Fulfilled),f(n.Rejected))};return o.addEventListener(l.Message,g),()=>{p=!0,o.removeEventListener(l.Message,g)}})(f,e,o),h(d),p&&p.forEach(e=>{delete g[e]}),p=s.data.methodNames;const y=m(g,f,p,c,o);return h(y),g}},y=e=>{let{iframe:t,methods:i={},childOrigin:s,timeout:n,debug:a=!1}=e;const u=(e=>(...t)=>{e&&console.log("[Penpal]",...t)})(a),p=(()=>{const e=[];let t=!1;return{destroy(i){t=!0,e.forEach(e=>{e(i)})},onDestroy(i){t?i():e.push(i)}}})(),{onDestroy:g,destroy:m}=p;s||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=o.NoIframeSrc,e}})(t),s=(e=>{if(e&&d.find(t=>e.startsWith(t)))return"null";const t=document.location,i=h.exec(e);let s,r,n;return i?(s=i[1]?i[1]:t.protocol,r=i[2],n=i[4]):(s=t.protocol,r=t.hostname,n=t.port),`${s}//${r}${n&&n!==c[s]?`:${n}`:""}`})(t.src));const y="null"===s?"*":s,v=((e,t,i,s)=>n=>{if(n.origin!==i)return void e(`Parent: Handshake - Received SYN message from origin ${n.origin} which did not match expected origin ${i}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const o={penpal:r.SynAck,methodNames:Object.keys(t)};n.source.postMessage(o,s)})(u,i,s,y),C=f(i,s,y,p,u),b=new Promise((e,i)=>{const s=((e,t)=>{let i;return void 0!==e&&(i=window.setTimeout(()=>{const i=new Error(`Connection timed out after ${e}ms`);i.code=o.ConnectionTimeout,t(i)},e)),()=>{clearTimeout(i)}})(n,m),a=i=>{if(i.source===t.contentWindow&&i.data)if(i.data.penpal!==r.Syn){if(i.data.penpal===r.Ack){const t=C(i);return void(t&&(s(),e(t)))}}else v(i)};window.addEventListener(l.Message,a),u("Parent: Awaiting handshake"),((e,t)=>{const{destroy:i,onDestroy:s}=t,r=setInterval(()=>{e.isConnected||(clearInterval(r),i())},6e4);s(()=>{clearInterval(r)})})(t,p),g(e=>{window.removeEventListener(l.Message,a),e||((e=new Error("Connection destroyed")).code=o.ConnectionDestroyed),i(e)})});return{promise:b,destroy(){m()}}},v=function(e,t){return console.error("[Dromo-External-Error] There was an error running your ".concat(t,"."),e)},C=function(e){return setTimeout(function(){console.warn("[Dromo Error] Slow ".concat(e," detected (>10s). Long running hooks can degrade user experience and importer performance."))},1e4)},b=function(e){clearTimeout(e)},S=function(s,r,n){return t(void 0,void 0,void 0,function(){var o,a,l;return i(this,function(c){switch(c.label){case 0:return o=new Map,a=r.map(function(t){return e({},t)}),[4,s.reduce(function(e,s){return t(void 0,void 0,void 0,function(){return i(this,function(r){switch(r.label){case 0:return[4,e.then(function(){return t(void 0,void 0,void 0,function(){var e,t,r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=C("column hook"),[4,s.callback(a)];case 1:return t=i.sent(),b(e),t.forEach(function(e){if(void 0!==e.value||void 0!==e.info){var t={};void 0!==e.value&&(t.value=e.value,a[e.index].value=e.value),void 0!==e.info&&(t.info=e.info),o.set(e.index,t)}}),[3,3];case 2:return r=i.sent(),n(r,"column hooks"),[3,3];case 3:return[2]}})})})];case 1:return r.sent(),[2]}})})},Promise.resolve())];case 1:return c.sent(),l=[],o.forEach(function(t,i){return l.push(e(e({},t),{index:i}))}),[2,l]}})})},w=function(e){return void 0===e.value&&void 0===e.info&&void 0===e.selectOptions&&void 0===e.manyToOne},x=function(e,s,r,n,o){return t(void 0,void 0,void 0,function(){var a,l,c,h,d,u,p,g,m,f,y,v,S;return i(this,function(x){switch(x.label){case 0:a=new Map,l=new Map(e.map(function(e){return[e.index,e]})),c=function(e,t){for(var i,s=l.get(e),r=function(t,r){if(w(r))return"continue";var n=s.row[t],o=Array.isArray(n.manyToOne),l="manyToOne"in r&&Array.isArray(r.manyToOne);if(o&&!l)throw new Error("".concat(t," should have manyToOne defined as an array."));if(o&&l&&n.manyToOne.length!==r.manyToOne.length)throw new Error("".concat(t," should be array of length ").concat(n.manyToOne.length));var c=a.get(e)||{},h=null!==(i=c[t])&&void 0!==i?i:{},d=[];l?(h.manyToOne=[],r.manyToOne.forEach(function(e,t){if(!w(e)){var i={};h.manyToOne.push(i),d.push({fieldOutput:e,rowDataField:n.manyToOne[t],cellChange:i})}})):d.push({fieldOutput:r,rowDataField:n,cellChange:h}),d.forEach(function(e){var t=e.fieldOutput,i=e.rowDataField,s=e.cellChange;void 0!==t.value&&(s.value=t.value,i.value=t.value),void 0!==t.info&&(s.info=t.info,i.info=t.info),void 0!==t.selectOptions&&(s.selectOptions=t.selectOptions,i.selectOptions=t.selectOptions)}),c[t]=h,a.set(e,c)},n=0,o=Object.entries(null!=t?t:{});n<o.length;n++){var c=o[n];r(c[0],c[1])}},h=0,d=n,x.label=1;case 1:if(!(h<d.length))return[3,6];u=d[h],x.label=2;case 2:return x.trys.push([2,4,,5]),p=C("bulk row hook"),[4,u(e,s)];case 3:for(g=x.sent(),b(p),m=0,f=g;m<f.length;m++)y=f[m],c(y.index,y.row);return[3,5];case 4:return v=x.sent(),o(v,"bulk row hooks"),[3,5];case 5:return h++,[3,1];case 6:return[4,Promise.all(e.map(function(e){return t(void 0,void 0,void 0,function(){var t,n,a,l,h,d;return i(this,function(i){switch(i.label){case 0:t=0,n=r,i.label=1;case 1:if(!(t<n.length))return[3,6];a=n[t],i.label=2;case 2:return i.trys.push([2,4,,5]),l=C("row hook"),[4,a(e,s)];case 3:return h=i.sent(),b(l),c(e.index,h.row),[3,5];case 4:return d=i.sent(),o(d,"row hooks"),[3,5];case 5:return t++,[3,1];case 6:return[2]}})})}))];case 7:return x.sent(),S=[],a.forEach(function(e,t){S.push({index:t,row:e})}),[2,S]}})})},E=function(e,s,r){return t(void 0,void 0,void 0,function(){return i(this,function(n){return[2,Promise.all(e.map(function(e){return t(void 0,void 0,void 0,function(){return i(this,function(n){return s.forEach(function(s){return t(void 0,void 0,void 0,function(){var t,n;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=C("row delete hook"),[4,s(e)];case 1:return i.sent(),b(t),[3,3];case 2:return n=i.sent(),r(n,"row delete hooks"),[3,3];case 3:return[2]}})})}),[2]})})}))]})})},M=function(e,s,r,n,o){return t(void 0,void 0,void 0,function(){return i(this,function(a){switch(a.label){case 0:return[4,Promise.all(r.map(function(r){return t(void 0,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:if(e!==r.type)return[2,Promise.resolve()];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.callback(n,s)];case 2:return[2,i.sent()];case 3:return t=i.sent(),o(t,"step hook ".concat(e)),[2,Promise.resolve()];case 4:return[2]}})})}))];case 1:return a.sent(),[2]}})})},A=function(e,s,r,n,o){return t(void 0,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,r(e,s,n)];case 1:return[2,i.sent()];case 2:return t=i.sent(),o(t,"before finish callback"),[3,3];case 3:return[2]}})})},T=function(e,s,r,n){return t(void 0,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,n(e,s)];case 1:return[2,i.sent()];case 2:return t=i.sent(),r(t,"custom file parser callback"),[3,3];case 3:return[2]}})})},D="dromo-container",I=function(t){var i=e({},t);return i.validators&&(i.validators=i.validators.map(function(t){return("regex_match"===t.validate||"regex_exclude"===t.validate)&&t.regex instanceof RegExp?e(e({},t),{regex:t.regex.source,regexOptions:{ignoreCase:t.regex.flags.includes("i"),dotAll:t.regex.flags.includes("s"),multiline:t.regex.flags.includes("m"),unicode:t.regex.flags.includes("u")}}):t})),i};return function(){function s(s,r,n,o){var a=this;this.embedInline=!1,this.columnHooks=[],this.bulkRowHooks=[],this.rowHooks=[],this.stepHooks=[],this.rowDeleteHooks=[],this.fileParsers=[],this.initChild=function(){return t(a,void 0,void 0,function(){var t,s,r,n,o;return i(this,function(i){switch(i.label){case 0:return this.connection?[4,this.connection.promise]:(console.error("shim cannot connect with Dromo service."),alert("There was en error opening the importer. Please contact support if this issue persists."),[2]);case 1:return t=i.sent(),s=Array.from(document.getElementsByTagName("script")).some(function(e){return"https://unpkg.com/dromo-uploader-js/dist/DromoUploader.js"===e.src||"https://cdn.jsdelivr.net/npm/dromo-uploader-js@latest/dist/DromoUploader.js"===e.src}),[4,t.setNumRegisteredRowHooks(this.totalNumRowHooks())];case 2:return i.sent(),[4,t.setNumRegisteredColHooks(this.columnHooks.length)];case 3:return i.sent(),[4,t.setNumRegisteredRowDeleteHooks(this.rowDeleteHooks.length)];case 4:return i.sent(),[4,t.setCustomParserFileExtensions(this.fileParsers.flatMap(function(e){return e.extensions.map(function(e){return e.toLowerCase()})}))];case 5:return i.sent(),[4,t.setEmbedInline(this.embedInline)];case 6:return i.sent(),this.fields&&this.settings&&this.user?(r=e({},this.settings),s||(r.version=null!==(n=r.version)&&void 0!==n?n:"v2"),r.browserExcelParsing=null===(o=r.browserExcelParsing)||void 0===o||o,[4,t.init(this.licenseKey,this.fields,r,this.user,this.appHost)]):[3,8];case 7:return i.sent(),[3,11];case 8:return this.schemaId?[4,t.initFromSavedSchema(this.licenseKey,this.schemaId,this.appHost,{user:this.user,developmentMode:this.developmentMode,headerRowOverride:this.headerRowOverride})]:[3,10];case 9:return i.sent(),[3,11];case 10:console.error("Invalid Dromo configuration"),i.label=11;case 11:return[2]}})})},this.initIFrame=function(){var e,t,i,s,r;if(window.DROMO_WIDGET_OVERRIDE)r=window.DROMO_WIDGET_OVERRIDE;else if(null===(e=a.settings)||void 0===e?void 0:e.alternateDomain){var n=new URL(a.settings.alternateDomain);r=n.protocol+"//widget."+n.host}else r="v1"===(null===(t=a.settings)||void 0===t?void 0:t.version)?"https://widget-v1.dromo.io/":"https://widget.dromo.io/";if(!document.getElementById(a.iframeId)){var o=document.createElement("iframe"),l=null!==(s=null===(i=a.settings)||void 0===i?void 0:i.importIdentifier)&&void 0!==s?s:a.schemaId;o.title=l?"Dromo Importer: ".concat(l):"Dromo Importer",o.src=r,o.id=a.iframeId,o.style.height="100%",o.style.width="100%",o.style.border="0",o.crossorigin="anonymous",a.iframe=o}},this.createConnection=function(){var e=a,s=a.iframe;s?a.connection=y({iframe:s,methods:{handleColumnHooks:function(s,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=e.columnHooks.filter(function(e){return e.fieldName===s}),[4,S(t,r,v)];case 1:return[2,i.sent()]}})})},handleRowHooks:function(s,r){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,x(s,r,e.rowHooks.map(function(e){return e.callback}),e.bulkRowHooks,v)];case 1:return[2,t.sent()]}})})},handleStepHook:function(s,r){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,M(s,r,e.stepHooks,e,v)];case 1:return[2,t.sent()]}})})},handleParseFileCallback:function(s,r){return t(this,void 0,void 0,function(){var t,n;return i(this,function(i){switch(i.label){case 0:return t=r.split(".").pop(),n=e.fileParsers.find(function(e){return-1!==e.extensions.map(function(e){return e.toLowerCase()}).indexOf(t.toLowerCase())}),[4,T(s,r,v,n.parseFile)];case 1:return[2,i.sent()]}})})},handleRowDeleteHooks:function(s){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,E(s,e.rowDeleteHooks,v)];case 1:return t.sent(),[2]}})})},handleBeforeFinishCallback:function(s,r){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e.beforeFinishCallback?[4,A(s,r,e.beforeFinishCallback,e,v)]:[3,2];case 1:return[2,t.sent()];case 2:return[2]}})})},handleResults:function(s,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:if(!e.resultsCallback)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.resultsCallback(s,r)];case 2:return i.sent(),[3,4];case 3:return t=i.sent(),console.error("[Dromo-External-Error] There was an error in your onResult callback.",t),[3,4];case 4:return e.close(),[2]}})})},handleCloseModal:function(){e.close()},handleCancel:function(){if(e.cancelCallback)try{e.cancelCallback()}catch(e){console.error("[Dromo-External-Error] There was an error in your cancel callback.",e)}e.close()}}}):console.error("shim cannot connect to Dromo.")},this.mountIFrame=function(){if(!document.getElementById(a.iframeId)){var e=document.createElement("div");e.id=a.wrapperId,e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.style.visibility="hidden",e.style.width="0px",e.style.height="0px",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.right="0px",e.style.bottom="0px",e.appendChild(a.iframe),document.body.appendChild(e),a.wrapper=e}},this.addIFrameToWrapper=function(){a.wrapper&&a.iframe&&(a.iframe.style.visibility="hidden",a.wrapper.appendChild(a.iframe))},this.showIframe=function(){a.iframe&&(a.iframe.style.visibility="visible")},this.showWrapper=function(){a.wrapper&&(a.wrapper.style.visibility="visible",a.wrapper.style.width="100%",a.wrapper.style.height="100%",document.body.style.overflow="hidden")},this.registerColumnHook=function(e,t){a.columnHooks.push({fieldName:e,callback:t}),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredColHooks(a.columnHooks.length)})},this.totalNumRowHooks=function(){return a.rowHooks.length+a.bulkRowHooks.length},this.registerBulkRowHook=function(e){a.bulkRowHooks.push(e),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredRowHooks(a.totalNumRowHooks())})},this.registerRowHook=function(e){a.rowHooks.push({callback:e}),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredRowHooks(a.totalNumRowHooks())})},this.registerStepHook=function(e,t){a.stepHooks.push({type:e,callback:t})},this.registerRowDeleteHook=function(e){a.rowDeleteHooks.push(e),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredRowDeleteHooks(a.rowDeleteHooks.length)})},this.beforeFinish=function(e){a.beforeFinishCallback=e},this.registerFileParser=function(e){a.fileParsers.push(e),a.connection&&a.connection.promise.then(function(e){e.setCustomParserFileExtensions(a.fileParsers.flatMap(function(e){return e.extensions.map(function(e){return e.toLowerCase()})}))})},this.registerAllHooks=function(e){if(e.columnHooks)for(var t=0,i=e.columnHooks;t<i.length;t++){var s=i[t],r=s.fieldName,n=s.callback;a.registerColumnHook(r,n)}if(e.rowHooks)for(var o=0,l=e.rowHooks;o<l.length;o++){var c=l[o];a.registerRowHook(c)}if(e.bulkRowHooks)for(var h=0,d=e.bulkRowHooks;h<d.length;h++){var u=d[h];a.registerBulkRowHook(u)}if(e.rowDeleteHooks)for(var p=0,g=e.rowDeleteHooks;p<g.length;p++){var m=g[p];a.registerRowDeleteHook(m)}if(e.stepHooks)for(var f=0,y=e.stepHooks;f<y.length;f++){var v=y[f],C=v.type;n=v.callback,a.registerStepHook(C,n)}if(e.beforeFinishCallback&&a.beforeFinish(e.beforeFinishCallback),e.fileParsers)for(var b=0,S=e.fileParsers;b<S.length;b++){var w=S[b];a.registerFileParser(w)}},this.onResults=function(e){a.resultsCallback=e},this.onCancel=function(e){a.cancelCallback=e},this.setUser=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.user=e,this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setUser(this.user)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},this.addField=function(e,s){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().addField(I(e),s)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.removeField=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().removeField(e)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.updateInfoMessages=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().updateInfoMessages(e)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.setHeaderRowOverride=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.headerRowOverride=e,this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setHeaderRowOverride(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},this.setConfirmationMessage=function(e,s){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setConfirmationMessage(e,s)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.open=function(){return t(a,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return this.wrapper||(this.initIFrame(),this.createConnection(),this.mountIFrame()),[4,this.initChild()];case 1:return e.sent(),this.showWrapper(),[2]}})})},this.initInline=function(e){return t(a,void 0,void 0,function(){var t,s;return i(this,function(i){switch(i.label){case 0:this.embedInline=!0,i.label=1;case 1:if(i.trys.push([1,3,,4]),e instanceof HTMLElement&&(this.wrapper=e,this.wrapperId=e.id,""!==this.wrapperId&&void 0!==this.wrapperId||(this.wrapperId=Math.random().toString(36).substring(7)+"-"+D)),"string"==typeof e){if(null===(t=document.getElementById(e)))throw new Error("WRAPPER_NOT_FOUND");this.wrapper=t,this.wrapperId=e}return this.iframe||(this.initIFrame(),this.createConnection(),this.addIFrameToWrapper()),[4,this.initChild()];case 2:return i.sent(),this.showIframe(),[3,4];case 3:throw"WRAPPER_NOT_FOUND"===(s=i.sent()).message&&console.error("[Dromo-Error] Could not find wrapper using provided ID."),s;case 4:return[2]}})})},this.addRows=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().addRows(e)];case 2:return[2,t.sent()];case 3:return console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),[2,[]]}})})},this.removeRows=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().removeRows(e)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.close=function(){a.wrapper&&(a.wrapper.style.visibility="hidden",a.wrapper.style.width="0px",a.wrapper.style.height="0px",document.body.style.overflow="inherit")},this.setDevelopmentMode=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.developmentMode=e,this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setDevelopmentMode(this.developmentMode)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},this.rehydrate=function(e,s){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.wrapper||(this.initIFrame(),this.createConnection(),this.mountIFrame()),[4,this.initChild()];case 1:return t.sent(),[4,this.connection.promise];case 2:return[4,t.sent().rehydrate(e,s)];case 3:return t.sent(),this.showWrapper(),[2]}})})},this.iframeId=Math.random().toString(36).substring(7)+"-dromo-iframe-element",this.wrapperId=Math.random().toString(36).substring(7)+"-"+D,this.appHost=document.location.hostname,void 0!==n&&void 0!==o?(this.licenseKey=s,this.fields=r.map(I),this.settings=n,this.user=o,this.checkCloneable({licenseKey:this.licenseKey,fields:this.fields,settings:this.settings,user:this.user})):(this.licenseKey=s,this.schemaId=r,this.checkCloneable({licenseKey:this.licenseKey,schemaId:this.schemaId}))}var r;return s.prototype.checkCloneable=function(e){if("function"==typeof structuredClone){var t=Object.entries(e).filter(function(e){e[0];var t=e[1];try{return structuredClone(t),!1}catch(e){return!0}}).map(function(e){return e[0]});if(t.length>0){var i=t.join(", ");throw new Error("[Dromo-External-Error] The Dromo importer received non-cloneable parameters: ".concat(i,". See https://dromo.dev/err/clone"))}}},r=s,s.rehydrateHeadless=function(e){var n=e.licenseKey,o=e.headlessImportId,a=e.fields,l=e.settings,c=e.hooks,h=e.rehydrateState;return t(void 0,void 0,void 0,function(){var e;return i(r,function(t){switch(t.label){case 0:return(e=new s(n,a,l,{id:"headless-review"})).registerAllHooks(c),[4,e.rehydrate(h,o)];case 1:return t.sent(),e.open(),[2,e]}})})},s}()}()},73964(e,t,i){"use strict";i.d(t,{A:()=>o});var s=i(22155),r=i(53692),n=i.n(r);const o=function(e){var t,i;function r(t){var i;return(i=e.call(this,t)||this).inlineRef=null,i.init=function(){if("fields"in i.props&&"settings"in i.props)i.dromo=new(n())(i.props.licenseKey,i.props.fields,i.props.settings,i.props.user);else if("schemaId"in i.props||"schemaName"in i.props){var e="schemaId"in i.props?i.props.schemaId:i.props.schemaName;i.dromo=new(n())(i.props.licenseKey,e),"developmentMode"in i.props&&i.dromo.setDevelopmentMode(i.props.developmentMode),"user"in i.props&&i.dromo.setUser(i.props.user),"headerRowOverride"in i.props&&i.dromo.setHeaderRowOverride(i.props.headerRowOverride)}i.props.rowHooks&&i.props.rowHooks.forEach(function(e){return i.dromo.registerRowHook(e)}),i.props.bulkRowHooks&&i.props.bulkRowHooks.forEach(function(e){return i.dromo.registerBulkRowHook(e)}),i.props.columnHooks&&i.props.columnHooks.forEach(function(e){i.dromo.registerColumnHook(e.fieldName,e.callback)}),i.props.rowDeleteHooks&&i.props.rowDeleteHooks.forEach(function(e){return i.dromo.registerRowDeleteHook(e)}),i.props.beforeFinish&&i.dromo.beforeFinish(i.props.beforeFinish),i.props.onResults&&i.dromo.onResults(i.props.onResults),i.props.onCancel&&i.dromo.onCancel(i.props.onCancel),i.props.stepHooks&&i.props.stepHooks.forEach(function(e){i.dromo.registerStepHook(e.type,e.callback)}),i.props.fileParsers&&i.props.fileParsers.forEach(function(e){i.dromo.registerFileParser(e)})},i.open=function(){i.init(),i.dromo.open()},i.initInline=function(){i.inlineRef&&(i.init(),i.dromo.initInline(i.inlineRef.current))},t.inline&&(i.inlineRef=(0,s.createRef)()),i}i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var o=r.prototype;return o.componentDidMount=function(){this.props.inline&&this.inlineRef?this.initInline():this.props.open&&this.open()},o.componentDidUpdate=function(e){this.props.inline?this.initInline():(!e.open&&this.props.open&&this.open(),e.open&&!this.props.open&&this.dromo.close())},o.componentWillUnmount=function(){this.props.open&&!this.props.inline&&this.dromo.close()},o.render=function(){return this.props.inline?(0,s.createElement)("div",{ref:this.inlineRef,className:this.props.className,style:this.props.style}):void 0===this.props.children?(0,s.createElement)(s.Fragment,null):(0,s.createElement)("button",{style:this.props.style,className:this.props.className,onClick:this.open},this.props.children)},r}(s.Component)},57678(e,t,i){"use strict";var s,r=i(92427),n=i(25667);try{s=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!s&&n&&n(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?r([o.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},23071(e,t,i){"use strict";var s=t;s.version=i(23718).rE,s.utils=i(9185),s.rand=i(65442),s.curve=i(95228),s.curves=i(25366),s.ec=i(72961),s.eddsa=i(87808)},94499(e,t,i){"use strict";var s=i(5630),r=i(9185),n=r.getNAF,o=r.getJSF,a=r.assert;function l(e,t){this.type=e,this.p=new s(t.p,16),this.red=t.prime?s.red(t.prime):s.mont(this.p),this.zero=new s(0).toRed(this.red),this.one=new s(1).toRed(this.red),this.two=new s(2).toRed(this.red),this.n=t.n&&new s(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=l,l.prototype.point=function(){throw new Error("Not implemented")},l.prototype.validate=function(){throw new Error("Not implemented")},l.prototype._fixedNafMul=function(e,t){a(e.precomputed);var i=e._getDoubles(),s=n(t,1,this._bitLength),r=(1<<i.step+1)-(i.step%2==0?2:1);r/=3;var o,l,c=[];for(o=0;o<s.length;o+=i.step){l=0;for(var h=o+i.step-1;h>=o;h--)l=(l<<1)+s[h];c.push(l)}for(var d=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=r;p>0;p--){for(o=0;o<c.length;o++)(l=c[o])===p?u=u.mixedAdd(i.points[o]):l===-p&&(u=u.mixedAdd(i.points[o].neg()));d=d.add(u)}return d.toP()},l.prototype._wnafMul=function(e,t){var i=4,s=e._getNAFPoints(i);i=s.wnd;for(var r=s.points,o=n(t,i,this._bitLength),l=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var h=0;c>=0&&0===o[c];c--)h++;if(c>=0&&h++,l=l.dblp(h),c<0)break;var d=o[c];a(0!==d),l="affine"===e.type?d>0?l.mixedAdd(r[d-1>>1]):l.mixedAdd(r[-d-1>>1].neg()):d>0?l.add(r[d-1>>1]):l.add(r[-d-1>>1].neg())}return"affine"===e.type?l.toP():l},l.prototype._wnafMulAdd=function(e,t,i,s,r){var a,l,c,h=this._wnafT1,d=this._wnafT2,u=this._wnafT3,p=0;for(a=0;a<s;a++){var g=(c=t[a])._getNAFPoints(e);h[a]=g.wnd,d[a]=g.points}for(a=s-1;a>=1;a-=2){var m=a-1,f=a;if(1===h[m]&&1===h[f]){var y=[t[m],null,null,t[f]];0===t[m].y.cmp(t[f].y)?(y[1]=t[m].add(t[f]),y[2]=t[m].toJ().mixedAdd(t[f].neg())):0===t[m].y.cmp(t[f].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[f]),y[2]=t[m].add(t[f].neg())):(y[1]=t[m].toJ().mixedAdd(t[f]),y[2]=t[m].toJ().mixedAdd(t[f].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],C=o(i[m],i[f]);for(p=Math.max(C[0].length,p),u[m]=new Array(p),u[f]=new Array(p),l=0;l<p;l++){var b=0|C[0][l],S=0|C[1][l];u[m][l]=v[3*(b+1)+(S+1)],u[f][l]=0,d[m]=y}}else u[m]=n(i[m],h[m],this._bitLength),u[f]=n(i[f],h[f],this._bitLength),p=Math.max(u[m].length,p),p=Math.max(u[f].length,p)}var w=this.jpoint(null,null,null),x=this._wnafT4;for(a=p;a>=0;a--){for(var E=0;a>=0;){var M=!0;for(l=0;l<s;l++)x[l]=0|u[l][a],0!==x[l]&&(M=!1);if(!M)break;E++,a--}if(a>=0&&E++,w=w.dblp(E),a<0)break;for(l=0;l<s;l++){var A=x[l];0!==A&&(A>0?c=d[l][A-1>>1]:A<0&&(c=d[l][-A-1>>1].neg()),w="affine"===c.type?w.mixedAdd(c):w.add(c))}}for(a=0;a<s;a++)d[a]=null;return r?w:w.toP()},l.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},l.prototype.decodePoint=function(e,t){e=r.toArray(e,t);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return r.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],s=this,r=0;r<t;r+=e){for(var n=0;n<e;n++)s=s.dbl();i.push(s)}return{step:e,points:i}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,s=1===i?null:this.dbl(),r=1;r<i;r++)t[r]=t[r-1].add(s);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t}},83544(e,t,i){"use strict";var s=i(9185),r=i(5630),n=i(91193),o=i(94499),a=s.assert;function l(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new r(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new r(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new r(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,i,s,n){o.BasePoint.call(this,e,"projective"),null===t&&null===i&&null===s?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new r(t,16),this.y=new r(i,16),this.z=s?new r(s,16):this.curve.one,this.t=n&&new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}n(l,o),e.exports=l,l.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},l.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},l.prototype.jpoint=function(e,t,i,s){return this.point(e,t,i,s)},l.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),s=this.c2.redSub(this.a.redMul(i)),n=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=s.redMul(n.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var l=a.fromRed().isOdd();return(t&&!l||!t&&l)&&(a=a.redNeg()),this.point(e,a)},l.prototype.pointFromY=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),s=i.redSub(this.c2),n=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=s.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},l.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),s=t.redMul(this.a).redAdd(i),r=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===s.cmp(r)},n(c,o.BasePoint),l.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},l.prototype.point=function(e,t,i,s){return new c(this,e,t,i,s)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var s=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),n=s.redAdd(t),o=n.redSub(i),a=s.redSub(t),l=r.redMul(o),c=n.redMul(a),h=r.redMul(a),d=o.redMul(n);return this.curve.point(l,c,d,h)},c.prototype._projDbl=function(){var e,t,i,s,r,n,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),l=this.y.redSqr();if(this.curve.twisted){var c=(s=this.curve._mulA(a)).redAdd(l);this.zOne?(e=o.redSub(a).redSub(l).redMul(c.redSub(this.curve.two)),t=c.redMul(s.redSub(l)),i=c.redSqr().redSub(c).redSub(c)):(r=this.z.redSqr(),n=c.redSub(r).redISub(r),e=o.redSub(a).redISub(l).redMul(n),t=c.redMul(s.redSub(l)),i=c.redMul(n))}else s=a.redAdd(l),r=this.curve._mulC(this.z).redSqr(),n=s.redSub(r).redSub(r),e=this.curve._mulC(o.redISub(s)).redMul(n),t=this.curve._mulC(s).redMul(a.redISub(l)),i=s.redMul(n);return this.curve.point(e,t,i)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),s=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),n=i.redSub(t),o=r.redSub(s),a=r.redAdd(s),l=i.redAdd(t),c=n.redMul(o),h=a.redMul(l),d=n.redMul(l),u=o.redMul(a);return this.curve.point(c,h,u,d)},c.prototype._projAdd=function(e){var t,i,s=this.z.redMul(e.z),r=s.redSqr(),n=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(n).redMul(o),l=r.redSub(a),c=r.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(o),d=s.redMul(l).redMul(h);return this.curve.twisted?(t=s.redMul(c).redMul(o.redSub(this.curve._mulA(n))),i=l.redMul(c)):(t=s.redMul(c).redMul(o.redSub(n)),i=this.curve._mulC(l).redMul(c)),this.curve.point(d,t,i)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},c.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),s=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(s),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},95228(e,t,i){"use strict";var s=t;s.base=i(94499),s.short=i(53970),s.mont=i(50536),s.edwards=i(83544)},50536(e,t,i){"use strict";var s=i(5630),r=i(91193),n=i(94499),o=i(9185);function a(e){n.call(this,"mont",e),this.a=new s(e.a,16).toRed(this.red),this.b=new s(e.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(e,t,i){n.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(t,16),this.z=new s(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(a,n),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),s=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===s.redSqrt().redSqr().cmp(s)},r(l,n.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new l(this,e,t)},a.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(e,t){return new l(e,t[0],t[1]||e.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},l.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),s=e.redMul(t),r=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(s,r)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),s=this.x.redSub(this.z),r=e.x.redAdd(e.z),n=e.x.redSub(e.z).redMul(i),o=r.redMul(s),a=t.z.redMul(n.redAdd(o).redSqr()),l=t.x.redMul(n.redISub(o).redSqr());return this.curve.point(a,l)},l.prototype.mul=function(e){for(var t=e.clone(),i=this,s=this.curve.point(null,null),r=[];0!==t.cmpn(0);t.iushrn(1))r.push(t.andln(1));for(var n=r.length-1;n>=0;n--)0===r[n]?(i=i.diffAdd(s,this),s=s.dbl()):(s=i.diffAdd(s,this),i=i.dbl());return s},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},53970(e,t,i){"use strict";var s=i(9185),r=i(5630),n=i(91193),o=i(94499),a=s.assert;function l(e){o.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,i,s){o.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(i,16),s&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,i,s){o.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(i,16),this.z=new r(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(l,o),e.exports=l,l.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new r(e.beta,16).toRed(this.red);else{var s=this._getEndoRoots(this.p);t=(t=s[0].cmp(s[1])<0?s[0]:s[1]).toRed(this.red)}if(e.lambda)i=new r(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?i=n[0]:(i=n[1],a(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map(function(e){return{a:new r(e.a,16),b:new r(e.b,16)}}):this._getEndoBasis(i)}}},l.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),i=new r(2).toRed(t).redInvm(),s=i.redNeg(),n=new r(3).toRed(t).redNeg().redSqrt().redMul(i);return[s.redAdd(n).fromRed(),s.redSub(n).fromRed()]},l.prototype._getEndoBasis=function(e){for(var t,i,s,n,o,a,l,c,h,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=e,p=this.n.clone(),g=new r(1),m=new r(0),f=new r(0),y=new r(1),v=0;0!==u.cmpn(0);){var C=p.div(u);c=p.sub(C.mul(u)),h=f.sub(C.mul(g));var b=y.sub(C.mul(m));if(!s&&c.cmp(d)<0)t=l.neg(),i=g,s=c.neg(),n=h;else if(s&&2===++v)break;l=c,p=u,u=c,f=g,g=h,y=m,m=b}o=c.neg(),a=h;var S=s.sqr().add(n.sqr());return o.sqr().add(a.sqr()).cmp(S)>=0&&(o=t,a=i),s.negative&&(s=s.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:s,b:n},{a:o,b:a}]},l.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],s=t[1],r=s.b.mul(e).divRound(this.n),n=i.b.neg().mul(e).divRound(this.n),o=r.mul(i.a),a=n.mul(s.a),l=r.mul(i.b),c=n.mul(s.b);return{k1:e.sub(o).sub(a),k2:l.add(c).neg()}},l.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var n=s.fromRed().isOdd();return(t&&!n||!t&&n)&&(s=s.redNeg()),this.point(e,s)},l.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,s=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)},l.prototype._endoWnafMulAdd=function(e,t,i){for(var s=this._endoWnafT1,r=this._endoWnafT2,n=0;n<e.length;n++){var o=this._endoSplit(t[n]),a=e[n],l=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),l=l.neg(!0)),s[2*n]=a,s[2*n+1]=l,r[2*n]=o.k1,r[2*n+1]=o.k2}for(var c=this._wnafMulAdd(1,s,r,2*n,i),h=0;h<2*n;h++)s[h]=null,r[h]=null;return c},n(c,o.BasePoint),l.prototype.point=function(e,t,i){return new c(this,e,t,i)},l.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,s=function(e){return i.point(e.x.redMul(i.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(s)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(s)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,i){"string"==typeof t&&(t=JSON.parse(t));var s=e.point(t[0],t[1],i);if(!t[2])return s;function r(t){return e.point(t[0],t[1],i)}var n=t[2];return s.precomputed={beta:null,doubles:n.doubles&&{step:n.doubles.step,points:[s].concat(n.doubles.points.map(r))},naf:n.naf&&{wnd:n.naf.wnd,points:[s].concat(n.naf.points.map(r))}},s},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),s=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),s=e.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new r(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,i){var s=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(s,r):this.curve._wnafMulAdd(1,s,r,2)},c.prototype.jmulAdd=function(e,t,i){var s=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(s,r,!0):this.curve._wnafMulAdd(1,s,r,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,s=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(s)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(s)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(h,o.BasePoint),l.prototype.jpoint=function(e,t,i){return new h(this,e,t,i)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),s=this.y.redMul(t).redMul(e);return this.curve.point(i,s)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(t),r=e.x.redMul(i),n=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(i.redMul(this.z)),a=s.redSub(r),l=n.redSub(o);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),h=c.redMul(a),d=s.redMul(c),u=l.redSqr().redIAdd(h).redISub(d).redISub(d),p=l.redMul(d.redISub(u)).redISub(n.redMul(h)),g=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(u,p,g)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,s=e.x.redMul(t),r=this.y,n=e.y.redMul(t).redMul(this.z),o=i.redSub(s),a=r.redSub(n);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),c=l.redMul(o),h=i.redMul(l),d=a.redSqr().redIAdd(c).redISub(h).redISub(h),u=a.redMul(h.redISub(d)).redISub(r.redMul(c)),p=this.z.redMul(o);return this.curve.jpoint(d,u,p)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var s=this.curve.a,r=this.curve.tinv,n=this.x,o=this.y,a=this.z,l=a.redSqr().redSqr(),c=o.redAdd(o);for(t=0;t<e;t++){var h=n.redSqr(),d=c.redSqr(),u=d.redSqr(),p=h.redAdd(h).redIAdd(h).redIAdd(s.redMul(l)),g=n.redMul(d),m=p.redSqr().redISub(g.redAdd(g)),f=g.redISub(m),y=p.redMul(f);y=y.redIAdd(y).redISub(u);var v=c.redMul(a);t+1<e&&(l=l.redMul(u)),n=m,a=v,c=y}return this.curve.jpoint(n,c.redMul(r),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var s=this.x.redSqr(),r=this.y.redSqr(),n=r.redSqr(),o=this.x.redAdd(r).redSqr().redISub(s).redISub(n);o=o.redIAdd(o);var a=s.redAdd(s).redIAdd(s),l=a.redSqr().redISub(o).redISub(o),c=n.redIAdd(n);c=(c=c.redIAdd(c)).redIAdd(c),e=l,t=a.redMul(o.redISub(l)).redISub(c),i=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),d=this.y.redSqr(),u=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(h).redISub(u);p=p.redIAdd(p);var g=h.redAdd(h).redIAdd(h),m=g.redSqr(),f=u.redIAdd(u);f=(f=f.redIAdd(f)).redIAdd(f),e=m.redISub(p).redISub(p),t=g.redMul(p.redISub(e)).redISub(f),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(e,t,i)},h.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var s=this.x.redSqr(),r=this.y.redSqr(),n=r.redSqr(),o=this.x.redAdd(r).redSqr().redISub(s).redISub(n);o=o.redIAdd(o);var a=s.redAdd(s).redIAdd(s).redIAdd(this.curve.a),l=a.redSqr().redISub(o).redISub(o);e=l;var c=n.redIAdd(n);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(o.redISub(l)).redISub(c),i=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),d=this.y.redSqr(),u=this.x.redMul(d),p=this.x.redSub(h).redMul(this.x.redAdd(h));p=p.redAdd(p).redIAdd(p);var g=u.redIAdd(u),m=(g=g.redIAdd(g)).redAdd(g);e=p.redSqr().redISub(m),i=this.y.redAdd(this.z).redSqr().redISub(d).redISub(h);var f=d.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f),t=p.redMul(g.redISub(e)).redISub(f)}return this.curve.jpoint(e,t,i)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,s=this.z,r=s.redSqr().redSqr(),n=t.redSqr(),o=i.redSqr(),a=n.redAdd(n).redIAdd(n).redIAdd(e.redMul(r)),l=t.redAdd(t),c=(l=l.redIAdd(l)).redMul(o),h=a.redSqr().redISub(c.redAdd(c)),d=c.redISub(h),u=o.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var p=a.redMul(d).redISub(u),g=i.redAdd(i).redMul(s);return this.curve.jpoint(h,p,g)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),s=t.redSqr(),r=e.redAdd(e).redIAdd(e),n=r.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(s),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(n)).redSqr(),l=s.redIAdd(s);l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var c=r.redIAdd(o).redSqr().redISub(n).redISub(a).redISub(l),h=t.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.x.redMul(a).redISub(h);d=(d=d.redIAdd(d)).redIAdd(d);var u=this.y.redMul(c.redMul(l.redISub(c)).redISub(o.redMul(a)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var p=this.z.redAdd(o).redSqr().redISub(i).redISub(a);return this.curve.jpoint(d,u,p)},h.prototype.mul=function(e,t){return e=new r(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(0!==this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0))return!1;var s=t.redMul(this.z),r=i.redMul(e.z);return 0===this.y.redMul(r).redISub(e.y.redMul(s)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(i))return!0;for(var s=e.clone(),r=this.curve.redN.redMul(t);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},25366(e,t,i){"use strict";var s,r=t,n=i(61631),o=i(95228),a=i(9185).assert;function l(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new l(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=l,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{s=i(67153)}catch(e){s=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})},72961(e,t,i){"use strict";var s=i(5630),r=i(52519),n=i(9185),o=i(25366),a=i(65442),l=n.assert,c=i(5666),h=i(44375);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(l(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new c(this,e)},d.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new s(2));;){var o=new s(t.generate(i));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},d.prototype._truncateToN=function(e,t,i){var r;if(s.isBN(e)||"number"==typeof e)r=(e=new s(e,16)).byteLength();else if("object"==typeof e)r=e.length,e=new s(e,16);else{var n=e.toString();r=n.length+1>>>1,e=new s(n,16)}"number"!=typeof i&&(i=8*r);var o=i-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,i,n){if("object"==typeof i&&(n=i,i=null),n||(n={}),"string"!=typeof e&&"number"!=typeof e&&!s.isBN(e)){l("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),l(e.length>>>0===e.length);for(var o=0;o<e.length;o++)l((255&e[o])===e[o])}t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,n.msgBitLength),l(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),c=t.getPrivate().toArray("be",a),d=e.toArray("be",a);l(new s(d).eq(e),"Can not sign message");for(var u=new r({hash:this.hash,entropy:c,nonce:d,pers:n.pers,persEnc:n.persEnc||"utf8"}),p=this.n.sub(new s(1)),g=0;;g++){var m=n.k?n.k(g):new s(u.generate(this.n.byteLength()));if(!((m=this._truncateToN(m,!0)).cmpn(1)<=0||m.cmp(p)>=0)){var f=this.g.mul(m);if(!f.isInfinity()){var y=f.getX(),v=y.umod(this.n);if(0!==v.cmpn(0)){var C=m.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(C=C.umod(this.n)).cmpn(0)){var b=(f.getY().isOdd()?1:0)|(0!==y.cmp(v)?2:0);return n.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),b^=1),new h({r:v,s:C,recoveryParam:b})}}}}}},d.prototype.verify=function(e,t,i,s,r){r||(r={}),e=this._truncateToN(e,!1,r.msgBitLength),i=this.keyFromPublic(i,s);var n=(t=new h(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,l=o.invm(this.n),c=l.mul(e).umod(this.n),d=l.mul(n).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,i.getPublic(),d)).isInfinity()&&a.eqXToP(n):!(a=this.g.mulAdd(c,i.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(n)},d.prototype.recoverPubKey=function(e,t,i,r){l((3&i)===i,"The recovery param is more than two bits"),t=new h(t,r);var n=this.n,o=new s(e),a=t.r,c=t.s,d=1&i,u=i>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var p=t.r.invm(n),g=n.sub(o).mul(p).umod(n),m=c.mul(p).umod(n);return this.g.mulAdd(g,a,m)},d.prototype.getKeyRecoveryParam=function(e,t,i,s){if(null!==(t=new h(t,s)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var n;try{n=this.recoverPubKey(e,t,r)}catch(e){continue}if(n.eq(i))return r}throw new Error("Unable to find valid recovery factor")}},5666(e,t,i){"use strict";var s=i(5630),r=i(9185).assert;function n(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=n,n.fromPublic=function(e,t,i){return t instanceof n?t:new n(e,{pub:t,pubEnc:i})},n.fromPrivate=function(e,t,i){return t instanceof n?t:new n(e,{priv:t,privEnc:i})},n.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},n.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(e,t){this.priv=new s(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},n.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},n.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},n.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},44375(e,t,i){"use strict";var s=i(5630),r=i(9185),n=r.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(n(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function l(e,t){var i=e[t.place++];if(!(128&i))return i;var s=15&i;if(0===s||s>4)return!1;if(0===e[t.place])return!1;for(var r=0,n=0,o=t.place;n<s;n++,o++)r<<=8,r|=e[o],r>>>=0;return!(r<=127)&&(t.place=o,r)}function c(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t<i;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var i=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=r.toArray(e,t);var i=new a;if(48!==e[i.place++])return!1;var n=l(e,i);if(!1===n)return!1;if(n+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var o=l(e,i);if(!1===o)return!1;if(128&e[i.place])return!1;var c=e.slice(i.place,o+i.place);if(i.place+=o,2!==e[i.place++])return!1;var h=l(e,i);if(!1===h)return!1;if(e.length!==h+i.place)return!1;if(128&e[i.place])return!1;var d=e.slice(i.place,h+i.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new s(c),this.s=new s(d),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=c(t),i=c(i);!(i[0]||128&i[1]);)i=i.slice(1);var s=[2];h(s,t.length),(s=s.concat(t)).push(2),h(s,i.length);var n=s.concat(i),o=[48];return h(o,n.length),o=o.concat(n),r.encode(o,e)}},87808(e,t,i){"use strict";var s=i(61631),r=i(25366),n=i(9185),o=n.assert,a=n.parseBytes,l=i(36419),c=i(95406);function h(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=r[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=s.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var i=this.keyFromSecret(t),s=this.hashInt(i.messagePrefix(),e),r=this.g.mul(s),n=this.encodePoint(r),o=this.hashInt(n,i.pubBytes(),e).mul(i.priv()),l=s.add(o).umod(this.curve.n);return this.makeSignature({R:r,S:l,Rencoded:n})},h.prototype.verify=function(e,t,i){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var s=this.keyFromPublic(i),r=this.hashInt(t.Rencoded(),s.pubBytes(),e),n=this.g.mul(t.S());return t.R().add(s.pub().mul(r)).eq(n)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return n.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return l.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return l.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=n.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),s=!!(128&e[t]),r=n.intFromLE(i);return this.curve.pointFromY(r,s)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return n.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},36419(e,t,i){"use strict";var s=i(9185),r=s.assert,n=s.parseBytes,o=s.cachedProperty;function a(e,t){this.eddsa=e,this._secret=n(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=n(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(a,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,s=t.slice(0,e.encodingLength);return s[0]&=248,s[i]&=127,s[i]|=64,s}),o(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(e){return r(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return r(this._secret,"KeyPair is public only"),s.encode(this.secret(),e)},a.prototype.getPublic=function(e){return s.encode(this.pubBytes(),e)},e.exports=a},95406(e,t,i){"use strict";var s=i(5630),r=i(9185),n=r.assert,o=r.cachedProperty,a=r.parseBytes;function l(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(n(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),n(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof s&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(l,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(l,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(l,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(l,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return r.encode(this.toBytes(),"hex").toUpperCase()},e.exports=l},67153(e){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},9185(e,t,i){"use strict";var s=t,r=i(5630),n=i(35578),o=i(94209);s.assert=n,s.toArray=o.toArray,s.zero2=o.zero2,s.toHex=o.toHex,s.encode=o.encode,s.getNAF=function(e,t,i){var s,r=new Array(Math.max(e.bitLength(),i)+1);for(s=0;s<r.length;s+=1)r[s]=0;var n=1<<t+1,o=e.clone();for(s=0;s<r.length;s++){var a,l=o.andln(n-1);o.isOdd()?(a=l>(n>>1)-1?(n>>1)-l:l,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},s.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var s,r=0,n=0;e.cmpn(-r)>0||t.cmpn(-n)>0;){var o,a,l=e.andln(3)+r&3,c=t.andln(3)+n&3;3===l&&(l=-1),3===c&&(c=-1),o=1&l?3!=(s=e.andln(7)+r&7)&&5!==s||2!==c?l:-l:0,i[0].push(o),a=1&c?3!=(s=t.andln(7)+n&7)&&5!==s||2!==l?c:-c:0,i[1].push(a),2*r===o+1&&(r=1-r),2*n===a+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return i},s.cachedProperty=function(e,t,i){var s="_"+t;e.prototype[t]=function(){return void 0!==this[s]?this[s]:this[s]=i.call(this)}},s.parseBytes=function(e){return"string"==typeof e?s.toArray(e,"hex"):e},s.intFromLE=function(e){return new r(e,"hex","le")}},15120(e){function t(e){if(e)return function(e){for(var i in t.prototype)e[i]=t.prototype[i];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},t.prototype.once=function(e,t){var i=this;function s(){i.off(e,s),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},s.fn=t,this.on(e,s),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,s=this._callbacks[e];if(!s)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r=0;r<s.length;r++)if((i=s[r])===t||i.fn===t){s.splice(r,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i)for(var s=0,r=(i=i.slice(0)).length;s<r;++s)i[s].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},15726(e,t,i){var s=i(69866),r=i(24758).each;function n(e,t){this.query=e,this.isUnconditional=t,this.handlers=[],this.mql=window.matchMedia(e);var i=this;this.listener=function(e){i.mql=e.currentTarget||e,i.assess()},this.mql.addListener(this.listener)}n.prototype={constuctor:n,addHandler:function(e){var t=new s(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(e){var t=this.handlers;r(t,function(i,s){if(i.equals(e))return i.destroy(),!t.splice(s,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){r(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";r(this.handlers,function(t){t[e]()})}},e.exports=n},68456(e,t,i){var s=i(15726),r=i(24758),n=r.each,o=r.isFunction,a=r.isArray;function l(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}l.prototype={constructor:l,register:function(e,t,i){var r=this.queries,l=i&&this.browserIsIncapable;return r[e]||(r[e]=new s(e,l)),o(t)&&(t={match:t}),a(t)||(t=[t]),n(t,function(t){o(t)&&(t={match:t}),r[e].addHandler(t)}),this},unregister:function(e,t){var i=this.queries[e];return i&&(t?i.removeHandler(t):(i.clear(),delete this.queries[e])),this}},e.exports=l},69866(e){function t(e){this.options=e,!e.deferSetup&&this.setup()}t.prototype={constructor:t,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=t},24758(e){e.exports={isFunction:function(e){return"function"==typeof e},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},each:function(e,t){for(var i=0,s=e.length;i<s&&!1!==t(e[i],i);i++);}}},78708(e,t,i){var s=i(68456);e.exports=new s},39886(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},38004(e){"use strict";e.exports=EvalError},41488(e){"use strict";e.exports=Error},96469(e){"use strict";e.exports=RangeError},12557(e){"use strict";e.exports=ReferenceError},63429(e){"use strict";e.exports=SyntaxError},71102(e){"use strict";e.exports=TypeError},85966(e){"use strict";e.exports=URIError},25153(e){"use strict";e.exports=Object},80381(e){"use strict";var t,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function n(){n.init.call(this)}e.exports=n,e.exports.once=function(e,t){return new Promise(function(i,s){function r(i){e.removeListener(t,n),s(i)}function n(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}m(e,t,n,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,r)})},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function c(e,t,i,s){var r,n,o,c;if(a(i),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),n=e._events),o=n[t]),void 0===o)o=n[t]=i,++e._eventsCount;else if("function"==typeof o?o=n[t]=s?[i,o]:[o,i]:s?o.unshift(i):o.push(i),(r=l(e))>0&&o.length>r&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,i){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=h.bind(s);return r.listener=i,s.wrapFn=r,r}function u(e,t,i){var s=e._events;if(void 0===s)return[];var r=s[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):g(r,r.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function g(e,t){for(var i=new Array(t),s=0;s<t;++s)i[s]=e[s];return i}function m(e,t,i,s){if("function"==typeof e.on)s.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function r(n){s.once&&e.removeEventListener(t,r),i(n)})}}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),n.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return l(this)},n.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r="error"===e,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)s(l,this,t);else{var c=l.length,h=g(l,c);for(i=0;i<c;++i)s(h[i],this,t)}return!0},n.prototype.addListener=function(e,t){return c(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return c(this,e,t,!0)},n.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},n.prototype.removeListener=function(e,t){var i,s,r,n,o;if(a(t),void 0===(s=this._events))return this;if(void 0===(i=s[e]))return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,n=i.length-1;n>=0;n--)if(i[n]===t||i[n].listener===t){o=i[n].listener,r=n;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,r),1===i.length&&(s[e]=i[0]),void 0!==s.removeListener&&this.emit("removeListener",e,o||t)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(e){var t,i,s;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var r,n=Object.keys(i);for(s=0;s<n.length;++s)"removeListener"!==(r=n[s])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this},n.prototype.listeners=function(e){return u(this,e,!0)},n.prototype.rawListeners=function(e){return u(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},n.prototype.listenerCount=p,n.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},51804(e,t,i){var s=i(56608).Buffer,r=i(75035);e.exports=function(e,t,i,n){if(s.isBuffer(e)||(e=s.from(e,"binary")),t&&(s.isBuffer(t)||(t=s.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=i/8,a=s.alloc(o),l=s.alloc(n||0),c=s.alloc(0);o>0||n>0;){var h=new r;h.update(c),h.update(e),t&&h.update(t),c=h.digest();var d=0;if(o>0){var u=a.length-o;d=Math.min(o,c.length),c.copy(a,u,0,d),o-=d}if(d<c.length&&n>0){var p=l.length-n,g=Math.min(n,c.length-d);c.copy(l,p,d,d+g),n-=g}}return c.fill(0),{key:a,iv:l}}},767(e,t,i){"use strict";i.r(t)},82022(e,t,i){"use strict";i.r(t)},47114(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},44898(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},24737(e,t,i){var s=i(41930).default;function r(t,i){if("function"==typeof WeakMap)var n=new WeakMap,o=new WeakMap;return(e.exports=r=function(e,t){if(!t&&e&&e.__esModule)return e;var i,r,a={__proto__:null,default:e};if(null===e||"object"!=s(e)&&"function"!=typeof e)return a;if(i=t?o:n){if(i.has(e))return i.get(e);i.set(e,a)}for(var l in e)"default"!==l&&{}.hasOwnProperty.call(e,l)&&((r=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,l))&&(r.get||r.set)?i(a,l,r):a[l]=e[l]);return a},e.exports.__esModule=!0,e.exports.default=e.exports)(t,i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},49613(e){e.exports=function(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i},e.exports.__esModule=!0,e.exports.default=e.exports},41930(e){function t(i){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},57506(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeRootContext=void 0,t.useCompositeRootContext=function(e=!1){const t=s.useContext(n);if(void 0===t&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}const n=t.CompositeRootContext=s.createContext(void 0)},53079(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectionContext=void 0,t.useDirection=function(e=!0){const t=s.useContext(n);if(void 0===t&&!e)throw new Error("Base UI: DirectionContext is missing.");return t?.direction??"ltr"};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}const n=t.DirectionContext=s.createContext(void 0)},80725(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(19571);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))})},19571(e,t){"use strict";function i(e,t){return r(e)?e(t):e??{}}function s(e,t){return t?e?Object.entries(t).reduce((t,[i,s])=>{var r,o,a,l;return function(e,t){const i=e.charCodeAt(2);return"o"===e[0]&&"n"===e[1]&&i>=65&&i<=90&&"function"==typeof t}(i,s)?t[i]=(r=e[i],o=s,e=>{if(function(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}(e)){const t=e;n(t);const i=o(t);return t.baseUIHandlerPrevented||r?.(t),i}const t=o(e);return r?.(e),t}):t[i]="style"===i?function(e,t){if(t||e)return{...e,...t}}(e.style,s):"className"===i?(a=e.className,(l=s)?a?l+" "+a:l:a):s,t},{...e}):t:e||{}}function r(e){return"function"==typeof e}function n(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}Object.defineProperty(t,"__esModule",{value:!0}),t.makeEventPreventable=n,t.mergeProps=function(...e){if(0===e.length)return{};if(1===e.length)return i(e[0],{});let t=i(e[0],{});for(let i=1;i<e.length;i+=1){const n=e[i];n&&(t=r(n)?n(t):s(t,n))}return t??{}}},85607(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverArrow=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(14434)),o=i(4706),a=i(72204),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverArrow=r.forwardRef(function(e,t){const{className:i,render:s,...c}=e,{open:h}=(0,o.usePopoverRootContext)(),{arrowRef:d,side:u,align:p,arrowUncentered:g,arrowStyles:m}=(0,n.usePopoverPositionerContext)(),f=r.useMemo(()=>({open:h,side:u,align:p,uncentered:g}),[h,u,p,g]);return(0,l.useRenderElement)("div",e,{state:f,ref:[t,d],props:[{style:m,"aria-hidden":!0},c],customStyleHookMapping:a.popupStateMapping})()})},30509(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverBackdrop=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(72204),a=i(60687),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}const h={...o.popupStateMapping,...a.transitionStatusMapping};t.PopoverBackdrop=r.forwardRef(function(e,t){const{className:i,render:s,...o}=e,{open:a,mounted:c,transitionStatus:d,openReason:u}=(0,n.usePopoverRootContext)(),p=r.useMemo(()=>({open:a,transitionStatus:d}),[a,d]);return(0,l.useRenderElement)("div",e,{state:p,ref:t,props:[{role:"presentation",hidden:!c,style:{pointerEvents:"hover"===u?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o],customStyleHookMapping:h})()})},89101(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverClose=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=a(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(13214);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(a=function(e){return e?i:t})(e)}t.PopoverClose=r.forwardRef(function(e,t){const{render:i,className:s,...r}=e,{setOpen:a}=(0,n.usePopoverRootContext)();return(0,o.useRenderElement)("button",e,{ref:t,props:[{onClick(){a(!1,void 0,void 0)}},r]})()})},36253(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverDescription=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(26111),a=i(322),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverDescription=r.forwardRef(function(e,t){const{render:i,className:s,...r}=e,{setDescriptionId:c}=(0,n.usePopoverRootContext)(),h=(0,a.useBaseUiId)(r.id);return(0,o.useEnhancedEffect)(()=>(c(h),()=>{c(void 0)}),[c,h]),(0,l.useRenderElement)("p",e,{ref:t,props:[{id:h},r]})()})},17051(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Popover=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(41507));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}t.Popover=s},41507(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Arrow",{enumerable:!0,get:function(){return l.PopoverArrow}}),Object.defineProperty(t,"Backdrop",{enumerable:!0,get:function(){return c.PopoverBackdrop}}),Object.defineProperty(t,"Close",{enumerable:!0,get:function(){return u.PopoverClose}}),Object.defineProperty(t,"Description",{enumerable:!0,get:function(){return d.PopoverDescription}}),Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return a.PopoverPopup}}),Object.defineProperty(t,"Portal",{enumerable:!0,get:function(){return n.PopoverPortal}}),Object.defineProperty(t,"Positioner",{enumerable:!0,get:function(){return o.PopoverPositioner}}),Object.defineProperty(t,"Root",{enumerable:!0,get:function(){return s.PopoverRoot}}),Object.defineProperty(t,"Title",{enumerable:!0,get:function(){return h.PopoverTitle}}),Object.defineProperty(t,"Trigger",{enumerable:!0,get:function(){return r.PopoverTrigger}});var s=i(1881),r=i(4905),n=i(12309),o=i(53049),a=i(97069),l=i(85607),c=i(30509),h=i(63317),d=i(36253),u=i(89101)},97069(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPopup=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=g(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(6358)),o=i(4706),a=i(14434),l=i(66476),c=i(72204),h=(i(10389),i(60687)),d=i(65635),u=i(13214),p=i(65723);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(g=function(e){return e?i:t})(e)}const m={...c.popupStateMapping,...h.transitionStatusMapping};t.PopoverPopup=r.forwardRef(function(e,t){const{className:i,render:s,initialFocus:c,finalFocus:h,...g}=e,{open:f,instantType:y,transitionStatus:v,getPopupProps:C,titleId:b,descriptionId:S,popupRef:w,mounted:x,openReason:E,onOpenChangeComplete:M,modal:A}=(0,o.usePopoverRootContext)(),T=(0,a.usePopoverPositionerContext)();(0,d.useOpenChangeComplete)({open:f,ref:w,onComplete(){f&&M?.(!0)}});const{props:D,resolvedInitialFocus:I}=(0,l.usePopoverPopup)({titleId:b,descriptionId:S,initialFocus:c}),R=r.useMemo(()=>({open:f,side:T.side,align:T.align,instant:y,transitionStatus:v}),[f,T.side,T.align,y,v]),P=(0,u.useRenderElement)("div",e,{state:R,ref:[t,w],props:[D,C,{style:"starting"===v?{transition:"none"}:{}},g],customStyleHookMapping:m});return(0,p.jsx)(n.FloatingFocusManager,{context:T.context,modal:"trap-focus"===A,disabled:!x||"hover"===E,initialFocus:I,returnFocus:h,children:P()})})},66476(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopoverPopup=function(e){const{titleId:t,descriptionId:i,initialFocus:n}=e,{popupRef:o,openMethod:a}=(0,r.usePopoverRootContext)(),l=s.useMemo(()=>({"aria-labelledby":t,"aria-describedby":i}),[t,i]),c=s.useCallback(e=>"touch"===e?o:0,[o]),h=s.useMemo(()=>null==n?c(a??""):"function"==typeof n?n(a??""):n,[c,n,a]);return s.useMemo(()=>({props:l,resolvedInitialFocus:h}),[l,h])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=n(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(4706);function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(n=function(e){return e?i:t})(e)}},12309(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPortal=function(e){const{children:t,keepMounted:i=!1,container:s}=e,{mounted:l}=(0,n.usePopoverRootContext)();return l||i?(0,a.jsx)(o.PopoverPortalContext.Provider,{value:i,children:(0,a.jsx)(r.FloatingPortal,{root:s,children:t})}):null},function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=l(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}s.default=e,i&&i.set(e,s)}(i(22155)),s(i(5821));var r=i(6358),n=i(4706),o=(i(10389),i(53486)),a=i(65723);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(l=function(e){return e?i:t})(e)}},53486(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPortalContext=void 0,t.usePopoverPortalContext=function(){const e=s.useContext(n);if(void 0===e)throw new Error("Base UI: <Popover.Portal> is missing.");return e};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}const n=t.PopoverPortalContext=s.createContext(void 0)},53049(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPositioner=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=g(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(35938),a=i(14434),l=i(72204),c=(i(10389),i(53486)),h=i(52454),d=i(42468),u=i(13214),p=i(65723);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(g=function(e){return e?i:t})(e)}t.PopoverPositioner=r.forwardRef(function(e,t){const{render:i,className:s,anchor:g,positionMethod:m="absolute",side:f="bottom",align:y="center",sideOffset:v=0,alignOffset:C=0,collisionBoundary:b="clipping-ancestors",collisionPadding:S=5,arrowPadding:w=5,sticky:x=!1,trackAnchor:E=!0,...M}=e,{floatingRootContext:A,open:T,mounted:D,setPositionerElement:I,modal:R,openReason:P,openMethod:k}=(0,n.usePopoverRootContext)(),L=(0,c.usePopoverPortalContext)(),N=(0,o.usePopoverPositioner)({anchor:g,floatingRootContext:A,positionMethod:m,mounted:D,open:T,side:f,sideOffset:v,align:y,alignOffset:C,arrowPadding:w,collisionBoundary:b,collisionPadding:S,sticky:x,trackAnchor:E,keepMounted:L}),_=r.useMemo(()=>({open:T,side:N.side,align:N.align,anchorHidden:N.anchorHidden}),[T,N.side,N.align,N.anchorHidden]),O=(0,u.useRenderElement)("div",e,{state:_,props:[N.props,M],ref:[t,I],customStyleHookMapping:l.popupStateMapping});return(0,p.jsxs)(a.PopoverPositionerContext.Provider,{value:N,children:[D&&!0===R&&"hover"!==P&&"touch"!==k&&(0,p.jsx)(d.InternalBackdrop,{inert:(0,h.inertValue)(!T)}),O()]})})},14434(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPositionerContext=void 0,t.usePopoverPositionerContext=function(){const e=s.useContext(n);if(void 0===e)throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");return e};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}const n=t.PopoverPositionerContext=s.createContext(void 0)},35938(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopoverPositioner=function(e){const{open:t,mounted:i}=(0,n.usePopoverRootContext)(),o=(0,r.useAnchorPositioning)(e),a=s.useMemo(()=>{const e={};return t||(e.pointerEvents="none"),{role:"presentation",hidden:!i,style:{...o.positionerStyles,...e}}},[t,i,o.positionerStyles]);return s.useMemo(()=>({props:a,...o}),[a,o])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=o(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var a=r?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(s,n,a):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(54540),n=i(4706);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(o=function(e){return e?i:t})(e)}},1881(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverRoot=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(33890),a=i(81324),l=i(65723);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverRoot=function(e){const{defaultOpen:t=!1,onOpenChange:i,open:s,openOnHover:c=!1,delay:h,closeDelay:d=0,actionsRef:u,onOpenChangeComplete:p,modal:g=!1}=e,m=h??a.OPEN_DELAY,f=(0,o.usePopoverRoot)({...e,defaultOpen:t,onOpenChange:i,open:s,openOnHover:c,onOpenChangeComplete:p,delay:m,closeDelay:d,actionsRef:u,modal:g}),y=r.useMemo(()=>({...f,openOnHover:c,delay:m,closeDelay:d,modal:g}),[f,c,m,d,g]);return(0,l.jsx)(n.PopoverRootContext.Provider,{value:y,children:e.children})}},4706(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverRootContext=void 0,t.usePopoverRootContext=function(){const e=s.useContext(n);if(void 0===e)throw new Error("Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.");return e};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}const n=t.PopoverRootContext=s.createContext(void 0)},33890(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopoverRoot=function(e){const{open:t,onOpenChange:i,defaultOpen:f=!1,delay:y,closeDelay:v,openOnHover:C=!1,onOpenChangeComplete:b,modal:S}=e,w=y??c.OPEN_DELAY,x=v??0,[E,M]=s.useState(),[A,T]=s.useState(),[D,I]=s.useState(),[R,P]=s.useState(null),[k,L]=s.useState(null),[N,_]=s.useState(null),[O,F]=s.useState(!0),G=s.useRef(null),B=s.useRef(-1),[V,H]=(0,o.useControlled)({controlled:t,default:f,name:"Popover",state:"open"}),U=(0,a.useEventCallback)(i),{mounted:z,setMounted:W,transitionStatus:j}=(0,l.useTransitionStatus)(V);(0,m.useScrollLock)({enabled:V&&!0===S&&"hover"!==N,mounted:z,open:V,referenceElement:k});const K=(0,a.useEventCallback)((e,t,i)=>{U(e,t,i),H(e),e&&_(i??null)}),$=(0,a.useEventCallback)(()=>{W(!1),F(!0),_(null),b?.(!1)});(0,p.useOpenChangeComplete)({enabled:!e.actionsRef,open:V,ref:G,onComplete(){V||$()}}),s.useImperativeHandle(e.actionsRef,()=>({unmount:$}),[$]);const Y=(0,a.useEventCallback)(()=>{clearTimeout(B.current)});s.useEffect(()=>{V||Y()},[Y,V]),s.useEffect(()=>Y,[Y]);const q=(0,n.useFloatingRootContext)({elements:{reference:R,floating:k},open:V,onOpenChange(e,t,i){const s="hover"===i||"safe-polygon"===i,n="click"===i&&0===t.detail,o=!e&&("escape-key"===i||null==i);function a(){K(e,t,(0,u.translateOpenChangeReason)(i))}s?(F(!0),Y(),B.current=window.setTimeout(()=>{F(!1)},g.PATIENT_CLICK_THRESHOLD),r.flushSync(a)):a(),M(n||o?n?"click":"dismiss":void 0)}}),{openMethod:X,triggerProps:Z}=(0,d.useOpenInteractionType)(V),Q=w,J=(0,n.useHover)(q,{enabled:C&&("touch"!==X||"click"!==N),mouseOnly:!0,move:!1,handleClose:(0,n.safePolygon)({blockPointerEvents:!0}),restMs:Q,delay:{close:x}}),ee=(0,n.useClick)(q,{stickIfOpen:O}),te=(0,n.useDismiss)(q),ie=(0,n.useRole)(q),{getReferenceProps:se,getFloatingProps:re}=(0,n.useInteractions)([J,ee,te,ie]),ne=s.useCallback((e={})=>se((0,h.mergeProps)(Z,e)),[se,Z]);return s.useMemo(()=>({open:V,setOpen:K,mounted:z,setMounted:W,transitionStatus:j,setTriggerElement:P,positionerElement:k,setPositionerElement:L,popupRef:G,titleId:A,setTitleId:T,descriptionId:D,setDescriptionId:I,getTriggerProps:ne,getPopupProps:re,floatingRootContext:q,instantType:E,openMethod:X,openReason:N,onOpenChangeComplete:b}),[V,K,z,W,j,k,A,D,ne,re,q,E,X,N,b])};var s=y(i(22155)),r=y(i(70316)),n=i(6358),o=i(46830),a=i(37041),l=i(30973),c=i(81324),h=i(80725),d=i(30626),u=i(861),p=i(65635),g=i(71202),m=i(22130);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(f=function(e){return e?i:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=f(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}},63317(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverTitle=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(13214),a=i(26111),l=i(322);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverTitle=r.forwardRef(function(e,t){const{render:i,className:s,...r}=e,{setTitleId:c}=(0,n.usePopoverRootContext)(),h=(0,l.useBaseUiId)(r.id);return(0,a.useEnhancedEffect)(()=>(c(h),()=>{c(void 0)}),[c,h]),(0,o.useRenderElement)("h2",e,{ref:t,props:[{id:h},r]})()})},4905(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverTrigger=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(4706)),o=i(1623),a=i(72204),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverTrigger=r.forwardRef(function(e,t){const{render:i,className:s,disabled:c=!1,...h}=e,{open:d,setTriggerElement:u,getTriggerProps:p,openReason:g}=(0,n.usePopoverRootContext)(),m=r.useMemo(()=>({disabled:c,open:d}),[c,d]),{getButtonProps:f,buttonRef:y}=(0,o.useButton)({disabled:c,buttonRef:t}),v=r.useMemo(()=>({open:e=>e&&"click"===g?a.pressableTriggerOpenStateMapping.open(e):a.triggerOpenStateMapping.open(e)}),[g]);return(0,l.useRenderElement)("button",e,{state:m,ref:[y,u],props:[p,h,f],customStyleHookMapping:v})()})},81324(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OPEN_DELAY=void 0,t.OPEN_DELAY=300},1623(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useButton=function(e={}){const{buttonRef:t,disabled:i=!1,focusableWhenDisabled:h,tabIndex:d,type:u="button",elementName:p}=e,g=s.useRef(null),{rootElementName:m,updateRootElementName:f}=(0,l.useRootElementName)({rootElementName:p}),y=void 0!==(0,c.useCompositeRootContext)(!0),v=(0,a.useEventCallback)(()=>{const e=g.current;return"BUTTON"===m||"INPUT"===m&&["button","submit","reset"].includes(e?.type)}),C=(0,a.useEventCallback)(()=>{const e=g.current;return Boolean("A"===m&&e?.href)}),b=(0,r.useForkRef)(f,t,g),S=s.useMemo(()=>{const e={};return void 0===d||y||(e.tabIndex=d),"BUTTON"===m||"INPUT"===m?h||y?e["aria-disabled"]=i:y||(e.disabled=i):""!==m&&("A"!==m?(e.role="button",y||(e.tabIndex=d??0)):d&&!y&&(e.tabIndex=d),i&&(e["aria-disabled"]=i,y||(e.tabIndex=h?d??0:-1))),e},[i,m,h,y,d]);return(0,o.useEnhancedEffect)(()=>{const e=g.current;e instanceof HTMLButtonElement&&y&&i&&void 0===S.disabled&&e.disabled&&(e.disabled=!1)},[i,S.disabled,y]),{getButtonProps:s.useCallback((e={})=>{const{onClick:t,onMouseDown:s,onKeyUp:r,onKeyDown:o,onPointerDown:a,...l}=e;return(0,n.mergeProps)({type:"BUTTON"===m||"INPUT"===m?u:void 0,onClick(e){i?e.preventDefault():t?.(e)},onMouseDown(e){i||s?.(e)},onKeyDown(e){(i&&h&&"Tab"!==e.key||e.target===e.currentTarget&&!v()&&" "===e.key)&&e.preventDefault(),i||((0,n.makeEventPreventable)(e),o?.(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||v()||C()||"Enter"!==e.key||i||(t?.(e),e.preventDefault())},onKeyUp(e){i||((0,n.makeEventPreventable)(e),r?.(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||v()||i||" "!==e.key||t?.(e)},onPointerDown(e){i?e.preventDefault():a?.(e)},ref:b},S,l)},[S,i,m,h,v,C,b,u]),buttonRef:b}};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=h(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(74467),n=i(80725),o=i(56371),a=i(37041),l=i(46489),c=i(57506);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(h=function(e){return e?i:t})(e)}},42468(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.InternalBackdrop=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=o(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var a=r?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(s,n,a):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),n=(s(i(5821)),i(65723));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(o=function(e){return e?i:t})(e)}t.InternalBackdrop=r.forwardRef(function(e,t){return(0,n.jsx)("div",{ref:t,role:"presentation","data-floating-ui-inert":!0,...e,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none"}})})},71202(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPEAHEAD_RESET_MS=t.PATIENT_CLICK_THRESHOLD=void 0,t.TYPEAHEAD_RESET_MS=500,t.PATIENT_CLICK_THRESHOLD=500},71922(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNavigatorData=r,t.isFirefox=function(){return/firefox/i.test((0,s.getUserAgent)())},t.isIOS=function(){const e=r();return"MacIntel"===e.platform&&e.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(e.platform)},t.isWebKit=function(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter:none")};var s=i(57735);function r(){if("undefined"==typeof navigator)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints}}},38454(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateRenderProp=function(e,t,i){return"function"==typeof e?e(t,i):s.cloneElement(e,{...(0,r.mergeProps)(t,e.props),ref:t.ref})};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=n(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(80725);function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(n=function(e){return e?i:t})(e)}},95361(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getReactElementRef=function(e){return parseInt(s.version,10)>=19?e?.props?.ref||null:e?.ref||null};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},87935(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStyleHookProps=function(e,t){let i={};return Object.entries(e).forEach(([e,s])=>{if(t?.hasOwnProperty(e)){const r=t[e](s);return void(null!=r&&(i={...i,...r}))}!0===s?i[`data-${e.toLowerCase()}`]="":s&&(i[`data-${e.toLowerCase()}`]=s.toString())}),i}},26111(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(95361);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))});var r=i(46830);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))});var n=i(56371);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))});var o=i(74467);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var a=i(50901);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))});var l=i(22130);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))});var c=i(30973);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))});var h=i(21932);Object.keys(h).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===h[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}}))})},52454(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inertValue=function(e){return(0,s.isReactVersionAtLeast)(19)?e:e?"true":void 0};var s=i(49958)},68736(e,t){"use strict";function i(e){return e&&e.ownerDocument||document}Object.defineProperty(t,"__esModule",{value:!0}),t.ownerDocument=i,t.ownerWindow=function(e){return i(e).defaultView||window}},72204(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.triggerOpenStateMapping=t.pressableTriggerOpenStateMapping=t.popupStateMapping=t.CommonTriggerDataAttributes=t.CommonPopupDataAttributes=void 0;var s=i(60687);let r=t.CommonPopupDataAttributes=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=s.TransitionStatusDataAttributes.startingStyle]="startingStyle",e[e.endingStyle=s.TransitionStatusDataAttributes.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),n=t.CommonTriggerDataAttributes=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const o={[n.popupOpen]:""},a={[n.popupOpen]:"",[n.pressed]:""},l={[r.open]:""},c={[r.closed]:""},h={[r.anchorHidden]:""};t.triggerOpenStateMapping={open:e=>e?o:null},t.pressableTriggerOpenStateMapping={open:e=>e?a:null},t.popupStateMapping={open:e=>e?l:c,anchorHidden:e=>e?h:null}},10389(e,t,i){"use strict";var s=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLElementType=function(e,t,i,s,r){return null},t.exactProp=function(e){return e},t.refType=void 0;var r=s(i(5821));t.refType=r.default.oneOfType([r.default.func,r.default.object])},49958(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isReactVersionAtLeast=function(e){return n>=e};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}const n=parseInt(s.version,10)},74184(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveClassName=function(e,t){return"function"==typeof e?e(t):e}},60687(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transitionStatusMapping=t.TransitionStatusDataAttributes=void 0;let i=t.TransitionStatusDataAttributes=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const s={[i.startingStyle]:""},r={[i.endingStyle]:""};t.transitionStatusMapping={transitionStatus:e=>"starting"===e?s:"ending"===e?r:null}},861(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateOpenChangeReason=function(e){if(e)return{click:"click",hover:"hover",focus:"focus","focus-out":"focus-out","escape-key":"escape-key","outside-press":"outside-press","reference-press":"trigger-press","safe-polygon":"hover","ancestor-scroll":void 0,"list-navigation":void 0}[e]}},54540(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useAnchorPositioning=function(e){const{anchor:t,positionMethod:i="absolute",side:c="bottom",sideOffset:u=0,align:p="center",alignOffset:g=0,collisionBoundary:m,collisionPadding:f=5,sticky:y=!1,arrowPadding:v=5,keepMounted:C=!1,floatingRootContext:b,mounted:S,trackAnchor:w=!0,nodeId:x}=e,E="rtl"===(0,a.useDirection)(),M={top:"top",right:"right",bottom:"bottom",left:"left","inline-end":E?"left":"right","inline-start":E?"right":"left"}[c],A="center"===p?M:`${M}-${p}`,T={boundary:"clipping-ancestors"===m?"clippingAncestors":m,padding:f},D=s.useRef(null),I=(0,l.useLatestRef)(u),R=(0,l.useLatestRef)(g),P="function"!=typeof u?u:0,k="function"!=typeof g?g:0,L=[(0,r.offset)(({rects:e,placement:t})=>{const i={side:h(c,(0,n.getSide)(t),E),align:(0,n.getAlignment)(t)||"center",anchor:{width:e.reference.width,height:e.reference.height},positioner:{width:e.floating.width,height:e.floating.height}},s="function"==typeof I.current?I.current(i):I.current,r="function"==typeof R.current?R.current(i):R.current;return{mainAxis:s,crossAxis:r,alignmentAxis:r}},[P,k,E,c])],N=(0,r.flip)(T),_=(0,r.shift)({...T,crossAxis:y,limiter:y?void 0:(0,r.limitShift)(()=>{if(!D.current)return{};const{height:e}=D.current.getBoundingClientRect();return{offset:e/2+("number"==typeof f?f:0)}})});"center"!==p?L.push(N,_):L.push(_,N),L.push((0,r.size)({...T,apply({elements:{floating:e},rects:{reference:t},availableWidth:i,availableHeight:s}){Object.entries({"--available-width":`${i}px`,"--available-height":`${s}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,i])=>{e.style.setProperty(t,i)})}}),(0,r.arrow)(()=>({element:D.current||document.createElement("div"),padding:v}),[v]),(0,r.hide)(),{name:"transformOrigin",fn({elements:e,middlewareData:t,placement:i}){const s=(0,n.getSide)(i),r=D.current,o=t.arrow?.x??0,a=t.arrow?.y??0,l=o+(r?.clientWidth??0)/2,c=a+(r?.clientHeight??0)/2,h={top:`${l}px calc(100% + ${u}px)`,bottom:`${l}px ${-u}px`,left:`calc(100% + ${u}px) ${c}px`,right:`${-u}px ${c}px`}[s];return e.floating.style.setProperty("--transform-origin",h),{}}});let O=b;!S&&b&&(O={...b,elements:{reference:null,floating:null,domReference:null}});const F=s.useMemo(()=>({elementResize:w&&"undefined"!=typeof ResizeObserver,layoutShift:w&&"undefined"!=typeof IntersectionObserver}),[w]),{refs:G,elements:B,floatingStyles:V,middlewareData:H,update:U,placement:z,context:W,isPositioned:j}=(0,r.useFloating)({rootContext:O,placement:A,middleware:L,strategy:i,whileElementsMounted:C?void 0:(...e)=>(0,r.autoUpdate)(...e,F),nodeId:x}),K=s.useRef(null);(0,o.useEnhancedEffect)(()=>{if(!S)return;const e="function"==typeof t?t():t;if(e){const t=d(e)?e.current:e;G.setPositionReference(t),K.current=t}},[S,G,t]),s.useEffect(()=>{S&&"function"!=typeof t&&d(t)&&t.current!==K.current&&(G.setPositionReference(t.current),K.current=t.current)},[S,G,t]),s.useEffect(()=>{if(C&&S&&B.domReference&&B.floating)return(0,r.autoUpdate)(B.domReference,B.floating,U,F)},[C,S,B,U,F]);const $=(0,n.getSide)(z),Y=h(c,$,E),q=(0,n.getAlignment)(z)||"center",X=Boolean(H.hide?.referenceHidden),Z=s.useMemo(()=>({position:"absolute",top:H.arrow?.y,left:H.arrow?.x}),[H.arrow]),Q=0!==H.arrow?.centerOffset;return s.useMemo(()=>({positionerStyles:V,arrowStyles:Z,arrowRef:D,arrowUncentered:Q,side:Y,align:q,anchorHidden:X,refs:G,context:W,isPositioned:j}),[V,Z,D,Q,Y,q,X,G,W,j])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(6358),n=i(31924),o=i(56371),a=i(53079),l=i(12618);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}function h(e,t,i){const s="inline-start"===e||"inline-end"===e;return{top:"top",right:s?i?"inline-start":"inline-end":"right",bottom:"bottom",left:s?i?"inline-end":"inline-start":"left"}[t]}function d(e){return null!=e&&"current"in e}},6029(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useAnimationsFinished=function(e,t=!1){const i=s.useRef(-1),o=s.useRef(-1),a=(0,n.useEventCallback)(()=>{cancelAnimationFrame(i.current),clearTimeout(o.current)});return s.useEffect(()=>a,[a]),(0,n.useEventCallback)((s,n=null)=>{a();const l=e.current;l&&("function"!=typeof l.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED?s():i.current=requestAnimationFrame(()=>{function e(){l&&Promise.allSettled(l.getAnimations().map(e=>e.finished)).then(()=>{null!=n&&n.aborted||r.flushSync(s)})}t?o.current=window.setTimeout(e):e()}))})};var s=a(i(22155)),r=a(i(70316)),n=i(37041);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(o=function(e){return e?i:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=o(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var a=r?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(s,n,a):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}},322(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useBaseUiId=function(e){return(0,s.useId)(e,"base-ui")};var s=i(50901)},46830(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useControlled=function({controlled:e,default:t,name:i,state:r="value"}){const{current:n}=s.useRef(void 0!==e),[o,a]=s.useState(t);return[n?e:o,s.useCallback(e=>{n||a(e)},[])]};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},24842(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhancedClickHandler=function(e){const t=s.useRef(""),i=s.useCallback(e=>{e.defaultPrevented||(t.current=e.pointerType)},[]);return{onClick:s.useCallback(i=>{0!==i.detail?("pointerType"in i&&e(i,i.pointerType),e(i,t.current),t.current=""):e(i,"keyboard")},[e]),onPointerDown:i}};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},56371(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhancedEffect=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}t.useEnhancedEffect="undefined"!=typeof window?s.useLayoutEffect:s.useEffect},37041(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEventCallback=function(e){const t=s.useRef(e);return(0,r.useEnhancedEffect)(()=>{t.current=e}),s.useCallback((...e)=>t.current?.(...e),[])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=n(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(56371);function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(n=function(e){return e?i:t})(e)}},74467(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useForkRef=function(...e){const t=s.useRef(void 0),i=s.useCallback(t=>{const i=e.map(e=>{if(null==e)return null;if("function"==typeof e){const i=e,s=i(t);return"function"==typeof s?s:()=>{i(null)}}return e.current=t,()=>{e.current=null}});return()=>{i.forEach(e=>e?.())}},e);return s.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=i(e))},e)};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},50901(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useId=function(e,t){if(void 0!==o){const i=o();return e??(t?`${t}-${i}`:i)}return function(e,t="mui"){const[i,r]=s.useState(e),o=e||i;return s.useEffect(()=>{null==i&&(n+=1,r(`${t}-${n}`))},[i,t]),o}(e,t)};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}let n=0;const o={...s}.useId},12618(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useLatestRef=function(e){const t=s.useRef(e);return(0,r.useEnhancedEffect)(()=>{t.current=e}),t};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=n(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(56371);function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(n=function(e){return e?i:t})(e)}},65635(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOpenChangeComplete=function(e){const{enabled:t=!0,open:i,ref:a,onComplete:l}=e,c=(0,o.useLatestRef)(i),h=(0,n.useEventCallback)(l),d=(0,r.useAnimationsFinished)(a,i);s.useEffect(()=>{t&&d(()=>{i===c.current&&h()})},[t,i,h,d,c])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=a(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(6029),n=i(37041),o=i(12618);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(a=function(e){return e?i:t})(e)}},30626(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOpenInteractionType=function(e){const[t,i]=s.useState(null);e||null===t||i(null);const n=s.useCallback((t,s)=>{e||i(s)},[e,i]),{onClick:o,onPointerDown:a}=(0,r.useEnhancedClickHandler)(n);return s.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:a}}),[t,o,a])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=n(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(24842);function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(n=function(e){return e?i:t})(e)}},13214(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRenderElement=function(e,t,i={}){const{className:h,render:u}=t,{propGetter:p=e=>e,state:g=d,ref:m,props:f,customStyleHookMapping:y,styleHooks:v=!0}=i,C=u||("string"==typeof e?(w=e,function(e){return"button"===w?(0,c.jsx)("button",{type:"button",...e}):"img"===w?(0,c.jsx)("img",{alt:"",...e}):(0,c.jsx)(w,{...e})}):e),b=(0,n.resolveClassName)(h,g),S=p({...s.useMemo(()=>v?(0,r.getStyleHookProps)(g,y):d,[g,y,v]),...Array.isArray(f)?(0,l.mergeProps)(...f):f});var w;let x=[];void 0!==m&&(x=Array.isArray(m)?m:[m]);const E={...S,ref:(0,a.useRenderPropForkRef)(C,S.ref,...x)};return void 0!==b&&(E.className=b),()=>(0,o.evaluateRenderProp)(C,E,g)};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=h(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(87935),n=i(74184),o=i(38454),a=i(58064),l=i(80725),c=i(65723);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(h=function(e){return e?i:t})(e)}const d={}},58064(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRenderPropForkRef=function(e,...t){let i;return i="function"!=typeof e?(0,r.isReactVersionAtLeast)(19)?e.props.ref:e.ref:null,(0,s.useForkRef)(i,...t)};var s=i(74467),r=i(49958)},46489(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRootElementName=function(e){const{rootElementName:t=""}=e,[i,r]=s.useState(t.toUpperCase());return{rootElementName:i,updateRootElementName:s.useCallback(e=>{r(e?.tagName??"")},[])}};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}i(56371),i(6543)},22130(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPreventScrollCount=function(){return u},t.useScrollLock=function(e){const{enabled:t=!0,mounted:i,open:l,referenceElement:g}=e,m=s.useMemo(()=>t&&((0,n.isIOS)()||!("undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("height","1dvh"))||(0,n.isFirefox)()&&!function(e){if("undefined"==typeof document)return!1;const t=(0,o.ownerDocument)(e);return(0,o.ownerWindow)(t).innerWidth-t.documentElement.clientWidth>0}(g)),[t,g]);(0,a.useEnhancedEffect)(()=>{if(i&&!l&&(0,n.isWebKit)()){const e=(0,o.ownerDocument)(g),t=e.body.style.userSelect,i=e.body.style.webkitUserSelect;return e.body.style.userSelect="none",e.body.style.webkitUserSelect="none",()=>{e.body.style.userSelect=t,e.body.style.webkitUserSelect=i}}},[i,l,g]),(0,r.usePreventScroll)({isDisabled:!m}),(0,a.useEnhancedEffect)(()=>{if(t&&!m)return u+=1,1===u&&(p=function(e){const t=(0,o.ownerDocument)(e),i=t.documentElement,s=t.body,r=(0,o.ownerWindow)(i);let a=0,l=0,u=-1;if((0,n.isWebKit)()&&1!==(r.visualViewport?.scale??1))return()=>{};function p(){const e=r.getComputedStyle(i),t=r.getComputedStyle(s);a=i.scrollTop,l=i.scrollLeft,c={overflowY:i.style.overflowY,overflowX:i.style.overflowX},d=i.style.scrollBehavior,h={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const n=e.scrollbarGutter?.includes("stable"),o=i.scrollHeight>i.clientHeight,u=i.scrollWidth>i.clientWidth,p="scroll"===e.overflowY||"scroll"===t.overflowY,g="scroll"===e.overflowX||"scroll"===t.overflowX,m=Math.max(0,r.innerWidth-i.clientWidth),f=Math.max(0,r.innerHeight-i.clientHeight);Object.assign(i.style,{overflowY:n||!o&&!p?"hidden":"scroll",overflowX:n||!u&&!g?"hidden":"scroll"});const y=parseFloat(t.marginTop)+parseFloat(t.marginBottom),v=parseFloat(t.marginLeft)+parseFloat(t.marginRight);Object.assign(s.style,{position:"relative",height:y||f?`calc(100dvh - ${y+f}px)`:"100dvh",width:v||m?`calc(100vw - ${v+m}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=l,i.setAttribute("data-base-ui-scroll-locked",""),i.style.scrollBehavior="unset"}function g(){Object.assign(i.style,c),Object.assign(s.style,h),i.scrollTop=a,i.scrollLeft=l,i.removeAttribute("data-base-ui-scroll-locked"),i.style.scrollBehavior=d}function m(){g(),cancelAnimationFrame(u),u=requestAnimationFrame(p)}return p(),r.addEventListener("resize",m),()=>{cancelAnimationFrame(u),g(),r.removeEventListener("resize",m)}}(g)),()=>{u-=1,0===u&&p()}},[t,m,g])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=l(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(s,n,o):s[n]=e[n]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(34446),n=i(71922),o=i(68736),a=i(56371);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(l=function(e){return e?i:t})(e)}let c={},h={},d="",u=0,p=()=>{}},30973(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useTransitionStatus=function(e){const[t,i]=s.useState(e?"idle":void 0),[n,o]=s.useState(e);return e&&!n&&(o(!0),i("starting")),!e&&n&&"ending"!==t&&i("ending"),e||n||"ending"!==t||i(void 0),(0,r.useEnhancedEffect)(()=>{if(!e)return;e&&n&&"idle"!==t&&i("starting");const s=requestAnimationFrame(()=>{i("idle")});return()=>{cancelAnimationFrame(s)}},[e,n,i,t]),s.useMemo(()=>({mounted:n,setMounted:o,transitionStatus:t}),[n,t])};var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=n(t);if(i&&i.has(e))return i.get(e);var s={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(s,o,a):s[o]=e[o]}return s.default=e,i&&i.set(e,s),s}(i(22155)),r=i(56371);function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(n=function(e){return e?i:t})(e)}},21932(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visuallyHidden=void 0,t.visuallyHidden={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1}},6543(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.warn=function(...e){}},64379(e,t,i){"use strict";var s=i(7274),r=globalThis;e.exports=function(){for(var e=[],t=0;t<s.length;t++)"function"==typeof r[s[t]]&&(e[e.length]=s[t]);return e}},30395(e,t){var i;!function(){"use strict";var s={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,n(i)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)s.call(e,i)&&e[i]&&(t=o(t,i));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)}()},30622(e,t,i){"use strict";i.d(t,{k:()=>f});var s=i(65959),r=i(81987),n=i(74140),o=i(19360),a=i(48555),l=i(47812),c=i(45902),h=i(78027),d=i(27231),u=i(47372),p=i(131),g=i(13062),m=i(30301),f=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=(0,r.LV)(a.ct,{max:o.v["cache.fragmentQueryDocuments"]||1e3,cache:h.l})}return e.prototype.lookupFragment=function(e){return null},e.prototype.batch=function(e){var t,i=this,s="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(function(){return t=e.update(i)},s),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){var i=this;return void 0===t&&(t=!!e.optimistic),!1!==globalThis.__DEV__&&(0,m.cc)(e,"canonizeResults","cache.readQuery"),(0,m.lz)("canonizeResults",function(){return i.read((0,s.__assign)((0,s.__assign)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))})},e.prototype.watchFragment=function(e){var t=this,i=e.fragment,r=e.fragmentName,o=e.from,a=e.optimistic,h=void 0===a||a,d=(0,s.__rest)(e,["fragment","fragmentName","from","optimistic"]),m=this.getFragmentDoc(i,r),f=void 0===o||"string"==typeof o?o:this.identify(o),y=!!e[Symbol.for("apollo.dataMasking")];if(!1!==globalThis.__DEV__){var v=r||(0,l.E4)(i).name.value;f||!1!==globalThis.__DEV__&&p.V1.warn(1,v)}var C,b=(0,s.__assign)((0,s.__assign)({},d),{returnPartialData:!0,id:f,query:m,optimistic:h});return new n.c(function(n){return t.watch((0,s.__assign)((0,s.__assign)({},b),{immediate:!0,callback:function(o){var a=y?(0,g.z)(o.result,i,t,r):o.result;if(!C||!(0,u.a)(m,{data:C.result},{data:a},e.variables)){var l={data:a,complete:!!o.complete};o.missing&&(l.missing=(0,c.IM)(o.missing.map(function(e){return e.missing}))),C=(0,s.__assign)((0,s.__assign)({},o),{result:a}),n.next(l)}}}))})},e.prototype.readFragment=function(e,t){var i=this;return void 0===t&&(t=!!e.optimistic),!1!==globalThis.__DEV__&&(0,m.cc)(e,"canonizeResults","cache.readFragment"),(0,m.lz)("canonizeResults",function(){return i.read((0,s.__assign)((0,s.__assign)({},e),{query:i.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))})},e.prototype.writeQuery=function(e){var t=e.id,i=e.data,r=(0,s.__rest)(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:i}))},e.prototype.writeFragment=function(e){var t=e.id,i=e.data,r=e.fragment,n=e.fragmentName,o=(0,s.__rest)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,n),dataId:t,result:i}))},e.prototype.updateQuery=function(e,t){return!1!==globalThis.__DEV__&&(0,m.cc)(e,"canonizeResults","cache.updateQuery"),this.batch({update:function(i){var r=(0,m.lz)("canonizeResults",function(){return i.readQuery(e)}),n=t(r);return null==n?r:(i.writeQuery((0,s.__assign)((0,s.__assign)({},e),{data:n})),n)}})},e.prototype.updateFragment=function(e,t){return!1!==globalThis.__DEV__&&(0,m.cc)(e,"canonizeResults","cache.updateFragment"),this.batch({update:function(i){var r=(0,m.lz)("canonizeResults",function(){return i.readFragment(e)}),n=t(r);return null==n?r:(i.writeFragment((0,s.__assign)((0,s.__assign)({},e),{data:n})),n)}})},e}();!1!==globalThis.__DEV__&&(f.prototype.getMemoryInternals=d.tQ)},79193(e,t,i){"use strict";i.d(t,{Z:()=>r});var s=i(65959),r=function(e){function t(i,s,r,n){var o,a=e.call(this,i)||this;if(a.message=i,a.path=s,a.query=r,a.variables=n,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=((o={})[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=t.prototype,a}return(0,s.__extends)(t,e),t}(Error)},47422(e,t,i){"use strict";i.d(t,{$3:()=>d,I6:()=>m,T9:()=>b,Ui:()=>y,Xx:()=>f,d1:()=>S,gk:()=>v,iJ:()=>C,lq:()=>x,mv:()=>w,or:()=>p});var s=i(14270),r=i(48555),n=i(47812),o=i(99310),a=i(45902),l=i(79e3),c=i(1164),h=i(58173),d=Object.prototype.hasOwnProperty;function u(e){return null==e}function p(e,t){var i=e.__typename,s=e.id,r=e._id;if("string"==typeof i&&(t&&(t.keyObject=u(s)?u(r)?void 0:{_id:r}:{id:s}),u(s)&&!u(r)&&(s=r),!u(s)))return"".concat(i,":").concat("number"==typeof s||"string"==typeof s?s:JSON.stringify(s))}var g={dataIdFromObject:p,addTypename:!0,resultCaching:!0,canonizeResults:!1};function m(e){return(0,h.o)(g,e)}function f(e){var t=e.canonizeResults;return void 0===t?g.canonizeResults:t}function y(e,t){return(0,o.A_)(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var v=/^[_a-z][_0-9a-z]*/i;function C(e){var t=e.match(v);return t?t[0]:e}function b(e,t,i){return!!(0,c.U)(t)&&((0,l.c)(t)?t.every(function(t){return b(e,t,i)}):e.selections.every(function(e){if((0,o.dt)(e)&&(0,s.MS)(e,i)){var r=(0,o.ue)(e);return d.call(t,r)&&(!e.selectionSet||b(e.selectionSet,t[r],i))}return!0}))}function S(e){return(0,c.U)(e)&&!(0,o.A_)(e)&&!(0,l.c)(e)}function w(){return new a.ZI}function x(e,t){var i=(0,r.JG)((0,n.zK)(e));return{fragmentMap:i,lookupFragment:function(e){var s=i[e];return!s&&t&&(s=t.lookup(e)),s||null}}}},70415(e,t,i){"use strict";i.d(t,{D:()=>be});var s=i(65959),r=i(131),n=i(81987),o=i(45063),a=i(30622),l=i(79193),c=i(78917),h=i(83906),d=i(19360),u=i(26497),p=i(33137),g=i(99310),m=i(49270),f=i(97703),y=i(58173),v=i(47812),C=i(45902),b=i(14270),S=i(48555),w=i(12209),x=i(1164),E=i(69796),M=i(47422),A=Object.create(null),T=function(){return A},D=Object.create(null),I=function(){function e(e,t){var i=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,w.G)((0,g.A_)(e)?i.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return(0,g.A_)(e)?i.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return(0,g.WU)(e);if((0,g.A_)(e))return e;var s=i.policies.identify(e)[0];if(s){var r=(0,g.WU)(s);return t&&i.merge(s,e),r}}}return e.prototype.toObject=function(){return(0,s.__assign)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),M.$3.call(this.data,e)){var i=this.data[e];if(i&&M.$3.call(i,t))return i[t]}return"__typename"===t&&M.$3.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof L?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),M.$3.call(this.data,e)?this.data[e]:this instanceof L?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var i,s=this;(0,g.A_)(e)&&(e=e.__ref),(0,g.A_)(t)&&(t=t.__ref);var n="string"==typeof e?this.lookup(i=e):e,o="string"==typeof t?this.lookup(i=t):t;if(o){(0,r.V1)("string"==typeof i,2);var a=new C.ZI(_).merge(n,o);if(this.data[i]=a,a!==n&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);n||(l.__exists=1),Object.keys(o).forEach(function(e){if(!n||n[e]!==a[e]){l[e]=1;var t=(0,M.iJ)(e);t===e||s.policies.hasKeyArgs(a.__typename,t)||(l[t]=1),void 0!==a[e]||s instanceof L||delete a[e]}}),!l.__typename||n&&n.__typename||this.policies.rootTypenamesById[i]!==a.__typename||delete l.__typename,Object.keys(l).forEach(function(e){return s.group.dirty(i,e)})}}},e.prototype.modify=function(e,t){var i=this,n=this.lookup(e);if(n){var o=Object.create(null),a=!1,l=!0,c={DELETE:A,INVALIDATE:D,isReference:g.A_,toReference:this.toReference,canRead:this.canRead,readField:function(t,s){return i.policies.readField("string"==typeof t?{fieldName:t,from:s||(0,g.WU)(e)}:t,{store:i})}};if(Object.keys(n).forEach(function(h){var d=(0,M.iJ)(h),u=n[h];if(void 0!==u){var p="function"==typeof t?t:t[h]||t[d];if(p){var m=p===T?A:p((0,w.G)(u),(0,s.__assign)((0,s.__assign)({},c),{fieldName:d,storeFieldName:h,storage:i.getStorage(e,h)}));if(m===D)i.group.dirty(e,h);else if(m===A&&(m=void 0),m!==u&&(o[h]=m,a=!0,u=m,!1!==globalThis.__DEV__)){var f=function(e){if(void 0===i.lookup(e.__ref))return!1!==globalThis.__DEV__&&r.V1.warn(3,e),!0};if((0,g.A_)(m))f(m);else if(Array.isArray(m))for(var y=!1,v=void 0,C=0,b=m;C<b.length;C++){var S=b[C];if((0,g.A_)(S)){if(y=!0,f(S))break}else"object"==typeof S&&S&&i.policies.identify(S)[0]&&(v=S);if(y&&void 0!==v){!1!==globalThis.__DEV__&&r.V1.warn(4,v);break}}}}void 0!==u&&(l=!1)}}),a)return this.merge(e,o),l&&(this instanceof L?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,i){var s,r=this.lookup(e);if(r){var n=this.getFieldValue(r,"__typename"),o=t&&i?this.policies.getStoreFieldName({typename:n,fieldName:t,args:i}):t;return this.modify(e,o?((s={})[o]=T,s):T)}return!1},e.prototype.evict=function(e,t){var i=!1;return e.id&&(M.$3.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof L&&this!==t&&(i=this.parent.evict(e,t)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),i=[];return this.getRootIdSet().forEach(function(t){M.$3.call(e.policies.rootTypenamesById,t)||i.push(t)}),i.length&&(t.__META={extraRootIds:i.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(i){e&&M.$3.call(e,i)||t.delete(i)}),e){var i=e.__META,r=(0,s.__rest)(e,["__META"]);Object.keys(r).forEach(function(e){t.merge(e,r[e])}),i&&i.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof L?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),i=this.toObject();t.forEach(function(s){M.$3.call(i,s)&&(Object.keys(e.findChildRefIds(s)).forEach(t.add,t),delete i[s])});var s=Object.keys(i);if(s.length){for(var r=this;r instanceof L;)r=r.parent;s.forEach(function(e){return r.delete(e)})}return s},e.prototype.findChildRefIds=function(e){if(!M.$3.call(this.refs,e)){var t=this.refs[e]=Object.create(null),i=this.data[e];if(!i)return t;var s=new Set([i]);s.forEach(function(e){(0,g.A_)(e)&&(t[e.__ref]=!0),(0,x.U)(e)&&Object.keys(e).forEach(function(t){var i=e[t];(0,x.U)(i)&&s.add(i)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),R=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?(0,n.yN)():null,this.keyMaker=new E.b(f.et)},e.prototype.depend=function(e,t){if(this.d){this.d(P(e,t));var i=(0,M.iJ)(t);i!==t&&this.d(P(e,i)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(P(e,t),"__exists"===t?"forget":"setDirty")},e}();function P(e,t){return t+"#"+e}function k(e,t){O(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var i=t.policies,s=t.resultCaching,r=void 0===s||s,n=t.seed,o=e.call(this,i,new R(r))||this;return o.stump=new N(o),o.storageTrie=new E.b(f.et),n&&o.replace(n),o}return(0,s.__extends)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(I||(I={}));var L=function(e){function t(t,i,s,r){var n=e.call(this,i.policies,r)||this;return n.id=t,n.parent=i,n.replay=s,n.group=r,s(n),n}return(0,s.__extends)(t,e),t.prototype.addLayer=function(e,i){return new t(e,this,i,this.group)},t.prototype.removeLayer=function(e){var t=this,i=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var s=t.data[e],r=i.lookup(e);r?s?s!==r&&Object.keys(s).forEach(function(i){(0,o.L)(s[i],r[i])||t.group.dirty(e,i)}):(t.group.dirty(e,"__exists"),Object.keys(r).forEach(function(i){t.group.dirty(e,i)})):t.delete(e)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,s.__assign)((0,s.__assign)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var i=this.parent.findChildRefIds(t);return M.$3.call(this.data,t)?(0,s.__assign)((0,s.__assign)({},i),e.prototype.findChildRefIds.call(this,t)):i},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(I),N=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,function(){},new R(t.group.caching,t.group))||this}return(0,s.__extends)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(L);function _(e,t,i){var s=e[i],r=t[i];return(0,o.L)(s,r)?s:r}function O(e){return!!(e instanceof I&&e.group.caching)}var F=i(79e3),G=function(){function e(){this.known=new(f.En?WeakSet:Set),this.pool=new E.b(f.et),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return(0,x.U)(e)&&this.known.has(e)},e.prototype.pass=function(e){if((0,x.U)(e)){var t=function(e){return(0,x.U)(e)?(0,F.c)(e)?e.slice(0):(0,s.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if((0,x.U)(e)){var i=this.passes.get(e);if(i)return i;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var s=e.map(this.admit,this);return(a=this.pool.lookupArray(s)).array||(this.known.add(a.array=s),!1!==globalThis.__DEV__&&Object.freeze(s)),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var r=Object.getPrototypeOf(e),n=[r],o=this.sortedKeys(e);n.push(o.json);var a,l=n.length;if(o.sorted.forEach(function(i){n.push(t.admit(e[i]))}),!(a=this.pool.lookupArray(n)).object){var c=a.object=Object.create(r);this.known.add(c),o.sorted.forEach(function(e,t){c[e]=n[l+t]}),!1!==globalThis.__DEV__&&Object.freeze(c)}return a.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),i=this.pool.lookupArray(t);if(!i.keys){t.sort();var s=JSON.stringify(t);(i.keys=this.keysByJSON.get(s))||this.keysByJSON.set(s,i.keys={sorted:t,json:s})}return i.keys},e}();function B(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var V=function(){function e(e){var t=this;this.knownResults=new(f.et?WeakMap:Map),this.config=(0,y.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:(0,M.Xx)(e)}),this.canon=e.canon||new G,this.executeSelectionSet=(0,n.LV)(function(e){var i,r=e.context.canonizeResults,n=B(e);n[3]=!r;var o=(i=t.executeSelectionSet).peek.apply(i,n);return o?r?(0,s.__assign)((0,s.__assign)({},o),{result:t.canon.admit(o.result)}):o:(k(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:B,makeCacheKey:function(e,t,i,s){if(O(i.store))return i.store.makeCacheKey(e,(0,g.A_)(t)?t.__ref:t,i.varString,s)}}),this.executeSubSelectedArray=(0,n.LV)(function(e){return k(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,i=e.array,s=e.context;if(O(s.store))return s.store.makeCacheKey(t,i,s.varString)}})}return e.prototype.resetCanon=function(){this.canon=new G},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,i=e.query,r=e.rootId,n=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,c=void 0===a||a,h=e.canonizeResults,d=void 0===h?this.config.canonizeResults:h,p=this.config.cache.policies;o=(0,s.__assign)((0,s.__assign)({},(0,v.wY)((0,v.AT)(i))),o);var m,f=(0,g.WU)(n),y=this.executeSelectionSet({selectionSet:(0,v.Vn)(i).selectionSet,objectOrReference:f,enclosingRef:f,context:(0,s.__assign)({store:t,query:i,policies:p,variables:o,varString:(0,u.M)(o),canonizeResults:d},(0,M.lq)(i,this.config.fragments))});if(y.missing&&(m=[new l.Z(H(y.missing),y.missing,i,o)],!c))throw m[0];return{result:y.result,complete:!m,missing:m}},e.prototype.isFresh=function(e,t,i,s){if(O(s.store)&&this.knownResults.get(e)===i){var r=this.executeSelectionSet.peek(i,t,s,this.canon.isKnown(e));if(r&&e===r.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,i=e.selectionSet,s=e.objectOrReference,n=e.enclosingRef,o=e.context;if((0,g.A_)(s)&&!o.policies.rootTypenamesById[s.__ref]&&!o.store.has(s.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(s.__ref," object")};var a,l=o.variables,c=o.policies,d=o.store.getFieldValue(s,"__typename"),u=[],p=new C.ZI;function f(e,t){var i;return e.missing&&(a=p.merge(a,((i={})[t]=e.missing,i))),e.result}this.config.addTypename&&"string"==typeof d&&!c.rootIdsByTypename[d]&&u.push({__typename:d});var y=new Set(i.selections);y.forEach(function(e){var i,v;if((0,b.MS)(e,l))if((0,g.dt)(e)){var C=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:s},o),w=(0,g.ue)(e);void 0===C?h.XY.added(e)||(a=p.merge(a,((i={})[w]="Can't find field '".concat(e.name.value,"' on ").concat((0,g.A_)(s)?s.__ref+" object":"object "+JSON.stringify(s,null,2)),i))):(0,F.c)(C)?C.length>0&&(C=f(t.executeSubSelectedArray({field:e,array:C,enclosingRef:n,context:o}),w)):e.selectionSet?null!=C&&(C=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:C,enclosingRef:(0,g.A_)(C)?C:n,context:o}),w)):o.canonizeResults&&(C=t.canon.pass(C)),void 0!==C&&u.push(((v={})[w]=C,v))}else{var x=(0,S.HQ)(e,o.lookupFragment);if(!x&&e.kind===m.b.FRAGMENT_SPREAD)throw(0,r.vA)(10,e.name.value);x&&c.fragmentMatches(x,d)&&x.selectionSet.selections.forEach(y.add,y)}});var v={result:(0,C.IM)(u),missing:a},x=o.canonizeResults?this.canon.admit(v):(0,w.G)(v);return x.result&&this.knownResults.set(x.result,i),x},e.prototype.execSubSelectedArrayImpl=function(e){var t,i=this,s=e.field,n=e.array,o=e.enclosingRef,a=e.context,l=new C.ZI;function c(e,i){var s;return e.missing&&(t=l.merge(t,((s={})[i]=e.missing,s))),e.result}return s.selectionSet&&(n=n.filter(a.store.canRead)),n=n.map(function(e,t){return null===e?null:(0,F.c)(e)?c(i.executeSubSelectedArray({field:s,array:e,enclosingRef:o,context:a}),t):s.selectionSet?c(i.executeSelectionSet({selectionSet:s.selectionSet,objectOrReference:e,enclosingRef:(0,g.A_)(e)?e:o,context:a}),t):(!1!==globalThis.__DEV__&&function(e,t,i){if(!t.selectionSet){var s=new Set([i]);s.forEach(function(i){(0,x.U)(i)&&((0,r.V1)(!(0,g.A_)(i),11,(0,M.Ui)(e,i),t.name.value),Object.values(i).forEach(s.add,s))})}}(a.store,s,e),e)}),{result:a.canonizeResults?this.canon.admit(n):n,missing:t}},e}();function H(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(e){return e}}var U=i(37563),z=i(48670),W=i(67566),j=Object.create(null);function K(e){var t=JSON.stringify(e);return j[t]||(j[t]=Object.create(null))}function $(e){var t=K(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,i){var s=function(e,t){return i.readField(t,e)},n=i.keyObject=q(e,function(e){var n=Q(i.storeObject,e,s);return void 0===n&&t!==i.storeObject&&M.$3.call(t,e[0])&&(n=Q(t,e,Z)),(0,r.V1)(void 0!==n,5,e.join("."),t),n});return"".concat(i.typename,":").concat(JSON.stringify(n))})}function Y(e){var t=K(e);return t.keyArgsFn||(t.keyArgsFn=function(t,i){var s=i.field,r=i.variables,n=i.fieldName,o=q(e,function(e){var i=e[0],n=i.charAt(0);if("@"!==n)if("$"!==n){if(t)return Q(t,e)}else{var o=i.slice(1);if(r&&M.$3.call(r,o)){var a=e.slice(0);return a[0]=o,Q(r,a)}}else if(s&&(0,F.E)(s.directives)){var l=i.slice(1),c=s.directives.find(function(e){return e.name.value===l}),h=c&&(0,g.MB)(c,r);return h&&Q(h,e.slice(1))}}),a=JSON.stringify(o);return(t||"{}"!==a)&&(n+=":"+a),n})}function q(e,t){var i=new C.ZI;return X(e).reduce(function(e,s){var r,n=t(s);if(void 0!==n){for(var o=s.length-1;o>=0;--o)(r={})[s[o]]=n,n=r;e=i.merge(e,n)}return e},Object.create(null))}function X(e){var t=K(e);if(!t.paths){var i=t.paths=[],s=[];e.forEach(function(t,r){(0,F.c)(t)?(X(t).forEach(function(e){return i.push(s.concat(e))}),s.length=0):(s.push(t),(0,F.c)(e[r+1])||(i.push(s.slice(0)),s.length=0))})}return t.paths}function Z(e,t){return e[t]}function Q(e,t,i){return i=i||Z,J(t.reduce(function e(t,s){return(0,F.c)(t)?t.map(function(t){return e(t,s)}):t&&i(t,s)},e))}function J(e){return(0,x.U)(e)?(0,F.c)(e)?e.map(J):q(Object.keys(e).sort(),function(t){return Q(e,t)}):e}var ee=i(71637);function te(e){return void 0!==e.args?e.args:e.field?(0,g.MB)(e.field,e.variables):null}var ie=function(){},se=function(e,t){return t.fieldName},re=function(e,t,i){return(0,i.mergeObjects)(e,t)},ne=function(e,t){return t},oe=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,s.__assign)({dataIdFromObject:M.or},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var i,r=this,n=t&&(t.typename||(null===(i=t.storeObject)||void 0===i?void 0:i.__typename))||e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var o,a=t&&t.storeObject||e,l=(0,s.__assign)((0,s.__assign)({},t),{typename:n,storeObject:a,readField:t&&t.readField||function(){var e=le(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),c=n&&this.getTypePolicy(n),h=c&&c.keyFn||this.config.dataIdFromObject;return ee.yV.withValue(!0,function(){for(;h;){var t=h((0,s.__assign)((0,s.__assign)({},e),a),l);if(!(0,F.c)(t)){o=t;break}h=$(t)}}),o=o?String(o):void 0,l.keyObject?[o,l.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(i){var r=e[i],n=r.queryType,o=r.mutationType,a=r.subscriptionType,l=(0,s.__rest)(r,["queryType","mutationType","subscriptionType"]);n&&t.setRootTypename("Query",i),o&&t.setRootTypename("Mutation",i),a&&t.setRootTypename("Subscription",i),M.$3.call(t.toBeAdded,i)?t.toBeAdded[i].push(l):t.toBeAdded[i]=[l]})},e.prototype.updateTypePolicy=function(e,t,i){var s=this.getTypePolicy(e),r=t.keyFields,n=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?re:!1===t?ne:e.merge}o(s,t.merge),s.keyFn=!1===r?ie:(0,F.c)(r)?$(r):"function"==typeof r?r:s.keyFn,n&&Object.keys(n).forEach(function(t){var s=i[t];s&&(null==s?void 0:s.typename)===e||(s=i[t]={typename:e});var r=n[t];if("function"==typeof r)s.read=r;else{var a=r.keyArgs,l=r.read,c=r.merge;s.keyFn=!1===a?se:(0,F.c)(a)?Y(a):"function"==typeof a?a:s.keyFn,"function"==typeof l&&(s.read=l),o(s,c)}s.read&&s.merge&&(s.keyFn=s.keyFn||se)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var i="ROOT_"+e.toUpperCase(),s=this.rootTypenamesById[i];t!==s&&((0,r.V1)(!s||s===e,6,e),s&&delete this.rootIdsByTypename[s],this.rootIdsByTypename[t]=i,this.rootTypenamesById[i]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(i){t.getSupertypeSet(i,!0),e[i].forEach(function(e){t.getSupertypeSet(e,!0).add(i);var s=e.match(M.gk);s&&s[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!M.$3.call(this.typePolicies,e)){var i=this.typePolicies[e]=Object.create(null);i.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(i,s){if(i.test(e)){var n=t.supertypeMap.get(s);n&&n.forEach(function(e){return r.add(e)})}})),r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),n=r.fields,o=(0,s.__rest)(r,["fields"]);Object.assign(i,o),Object.assign(i.fields,n)})}var n=this.toBeAdded[e];return n&&n.length&&n.splice(0).forEach(function(i){t.updateTypePolicy(e,i,t.typePolicies[e].fields)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t){if(e)return this.getTypePolicy(e).fields[t]},e.prototype.getSupertypeSet=function(e,t){var i=this.supertypeMap.get(e);return!i&&t&&this.supertypeMap.set(e,i=new Set),i},e.prototype.fragmentMatches=function(e,t,i,s){var n=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),l=[a],c=function(e){var t=n.getSupertypeSet(e,!1);t&&t.size&&l.indexOf(t)<0&&l.push(t)},h=!(!i||!this.fuzzySubtypes.size),d=!1,u=0;u<l.length;++u){var p=l[u];if(p.has(o))return a.has(o)||(d&&!1!==globalThis.__DEV__&&r.V1.warn(7,t,o),a.add(o)),!0;p.forEach(c),h&&u===l.length-1&&(0,M.T9)(e.selectionSet,i,s)&&(h=!1,d=!0,this.fuzzySubtypes.forEach(function(e,i){var s=t.match(e);s&&s[0]===t&&c(i)}))}return!1},e.prototype.hasKeyArgs=function(e,t){var i=this.getFieldPolicy(e,t);return!(!i||!i.keyFn)},e.prototype.getStoreFieldName=function(e){var t,i=e.typename,s=e.fieldName,r=this.getFieldPolicy(i,s),n=r&&r.keyFn;if(n&&i)for(var o={typename:i,fieldName:s,field:e.field||null,variables:e.variables},a=te(e);n;){var l=n(a,o);if(!(0,F.c)(l)){t=l||s;break}n=Y(l)}return void 0===t&&(t=e.field?(0,g.Ii)(e.field,e.variables):(0,g.o5)(s,te(e))),!1===t?s:s===(0,M.iJ)(t)?t:s+":"+t},e.prototype.readField=function(e,t){var i=e.from;if(i&&(e.field||e.fieldName)){if(void 0===e.typename){var s=t.store.getFieldValue(i,"__typename");s&&(e.typename=s)}var r=this.getStoreFieldName(e),n=(0,M.iJ)(r),o=t.store.getFieldValue(i,r),a=this.getFieldPolicy(e.typename,n),l=a&&a.read;if(l){var c=ae(this,i,e,t,t.store.getStorage((0,g.A_)(i)?i.__ref:i,r));return W.bl.withValue(this.cache,l,[o,c])}return o}},e.prototype.getReadFunction=function(e,t){var i=this.getFieldPolicy(e,t);return i&&i.read},e.prototype.getMergeFunction=function(e,t,i){var s=this.getFieldPolicy(e,t),r=s&&s.merge;return!r&&i&&(r=(s=this.getTypePolicy(i))&&s.merge),r},e.prototype.runMergeFunction=function(e,t,i,s,r){var n=i.field,o=i.typename,a=i.merge;return a===re?ce(s.store)(e,t):a===ne?t:(s.overwrite&&(e=void 0),a(e,t,ae(this,void 0,{typename:o,fieldName:n.name.value,field:n,variables:s.variables},s,r||Object.create(null))))},e}();function ae(e,t,i,s,r){var n=e.getStoreFieldName(i),o=(0,M.iJ)(n),a=i.variables||s.variables,l=s.store,c=l.toReference,h=l.canRead;return{args:te(i),field:i.field||null,fieldName:o,storeFieldName:n,variables:a,isReference:g.A_,toReference:c,storage:r,cache:e.cache,canRead:h,readField:function(){return e.readField(le(arguments,t,a),s)},mergeObjects:ce(s.store)}}function le(e,t,i){var n,o=e[0],a=e[1],l=e.length;return"string"==typeof o?n={fieldName:o,from:l>1?a:t}:(n=(0,s.__assign)({},o),M.$3.call(n,"from")||(n.from=t)),!1!==globalThis.__DEV__&&void 0===n.from&&!1!==globalThis.__DEV__&&r.V1.warn(8,(0,z.p)(Array.from(e))),void 0===n.variables&&(n.variables=i),n}function ce(e){return function(t,i){if((0,F.c)(t)||(0,F.c)(i))throw(0,r.vA)(9);if((0,x.U)(t)&&(0,x.U)(i)){var n=e.getFieldValue(t,"__typename"),o=e.getFieldValue(i,"__typename");if(n&&o&&n!==o)return i;if((0,g.A_)(t)&&(0,M.d1)(i))return e.merge(t.__ref,i),t;if((0,M.d1)(t)&&(0,g.A_)(i))return e.merge(t,i.__ref),i;if((0,M.d1)(t)&&(0,M.d1)(i))return(0,s.__assign)((0,s.__assign)({},t),i)}return i}}function he(e,t,i){var r="".concat(t).concat(i),n=e.flavors.get(r);return n||e.flavors.set(r,n=e.clientOnly===t&&e.deferred===i?e:(0,s.__assign)((0,s.__assign)({},e),{clientOnly:t,deferred:i})),n}var de=function(){function e(e,t,i){this.cache=e,this.reader=t,this.fragments=i}return e.prototype.writeToStore=function(e,t){var i=this,n=t.query,a=t.result,l=t.dataId,c=t.variables,h=t.overwrite,d=(0,v.Vu)(n),p=(0,M.mv)();c=(0,s.__assign)((0,s.__assign)({},(0,v.wY)(d)),c);var m=(0,s.__assign)((0,s.__assign)({store:e,written:Object.create(null),merge:function(e,t){return p.merge(e,t)},variables:c,varString:(0,u.M)(c)},(0,M.lq)(n,this.fragments)),{overwrite:!!h,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:l,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:m});if(!(0,g.A_)(f))throw(0,r.vA)(12,a);return m.incomingById.forEach(function(t,n){var a=t.storeObject,l=t.mergeTree,c=t.fieldNodeSet,h=(0,g.WU)(n);if(l&&l.map.size){var d=i.applyMerges(l,h,a,m);if((0,g.A_)(d))return;a=d}if(!1!==globalThis.__DEV__&&!m.overwrite){var u=Object.create(null);c.forEach(function(e){e.selectionSet&&(u[e.name.value]=!0)}),Object.keys(a).forEach(function(e){(function(e){return!0===u[(0,M.iJ)(e)]})(e)&&!function(e){var t=l&&l.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,i,n){var a=function(e){var t=n.getFieldValue(e,i);return"object"==typeof t&&t},l=a(e);if(l){var c=a(t);if(c&&!(0,g.A_)(l)&&!(0,o.L)(l,c)&&!Object.keys(l).every(function(e){return void 0!==n.getFieldValue(c,e)})){var h=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),d=(0,M.iJ)(i),u="".concat(h,".").concat(d);if(!ye.has(u)){ye.add(u);var p=[];(0,F.c)(l)||(0,F.c)(c)||[l,c].forEach(function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||p.includes(t)||p.push(t)}),!1!==globalThis.__DEV__&&r.V1.warn(15,d,h,p.length?"either ensure all objects of type "+p.join(" and ")+" have an ID or a custom merge function, or ":"",u,(0,s.__assign)({},l),(0,s.__assign)({},c))}}}}(h,a,e,m.store)})}e.merge(n,a)}),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,i=e.dataId,n=e.result,o=e.selectionSet,a=e.context,l=e.mergeTree,c=this.cache.policies,d=Object.create(null),u=i&&c.rootTypenamesById[i]||(0,g.D$)(n,o,a.fragmentMap)||i&&a.store.get(i,"__typename");"string"==typeof u&&(d.__typename=u);var p=function(){var e=le(arguments,d,a.variables);if((0,g.A_)(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var i=c.readField((0,s.__assign)((0,s.__assign)({},e),{from:t.storeObject}),a);if(void 0!==i)return i}}return c.readField(e,a)},m=new Set;this.flattenFields(o,n,a,u).forEach(function(e,i){var s,o=(0,g.ue)(i),a=n[o];if(m.add(i),void 0!==a){var f=c.getStoreFieldName({typename:u,fieldName:i.name.value,field:i,variables:e.variables}),y=pe(l,f),v=t.processFieldValue(a,i,i.selectionSet?he(e,!1,!1):e,y),C=void 0;i.selectionSet&&((0,g.A_)(v)||(0,M.d1)(v))&&(C=p("__typename",v));var b=c.getMergeFunction(u,i.name.value,C);b?y.info={field:i,typename:u,merge:b}:fe(l,f),d=e.merge(d,((s={})[f]=v,s))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||h.XY.added(i)||c.getReadFunction(u,i.name.value)||!1!==globalThis.__DEV__&&r.V1.error(13,(0,g.ue)(i),n)});try{var f=c.identify(n,{typename:u,selectionSet:o,fragmentMap:a.fragmentMap,storeObject:d,readField:p}),y=f[0],v=f[1];i=i||y,v&&(d=a.merge(d,v))}catch(e){if(!i)throw e}if("string"==typeof i){var C=(0,g.WU)(i),b=a.written[i]||(a.written[i]=[]);if(b.indexOf(o)>=0)return C;if(b.push(o),this.reader&&this.reader.isFresh(n,C,o,a))return C;var S=a.incomingById.get(i);return S?(S.storeObject=a.merge(S.storeObject,d),S.mergeTree=ge(S.mergeTree,l),m.forEach(function(e){return S.fieldNodeSet.add(e)})):a.incomingById.set(i,{storeObject:d,mergeTree:me(l)?void 0:l,fieldNodeSet:m}),C}return d},e.prototype.processFieldValue=function(e,t,i,s){var r=this;return t.selectionSet&&null!==e?(0,F.c)(e)?e.map(function(e,n){var o=r.processFieldValue(e,t,i,pe(s,n));return fe(s,n),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:s}):!1!==globalThis.__DEV__?(0,U.m)(e):e},e.prototype.flattenFields=function(e,t,i,s){void 0===s&&(s=(0,g.D$)(t,e,i.fragmentMap));var n=new Map,o=this.cache.policies,a=new E.b(!1);return function e(l,c){var h=a.lookup(l,c.clientOnly,c.deferred);h.visited||(h.visited=!0,l.selections.forEach(function(a){if((0,b.MS)(a,i.variables)){var l=c.clientOnly,h=c.deferred;if(l&&h||!(0,F.E)(a.directives)||a.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(l=!0),"defer"===t){var s=(0,g.MB)(e,i.variables);s&&!1===s.if||(h=!0)}}),(0,g.dt)(a)){var d=n.get(a);d&&(l=l&&d.clientOnly,h=h&&d.deferred),n.set(a,he(i,l,h))}else{var u=(0,S.HQ)(a,i.lookupFragment);if(!u&&a.kind===m.b.FRAGMENT_SPREAD)throw(0,r.vA)(14,a.name.value);u&&o.fragmentMatches(u,s,t,i.variables)&&e(u.selectionSet,he(i,l,h))}}}))}(e,i),n},e.prototype.applyMerges=function(e,t,i,n,o){var a,l=this;if(e.map.size&&!(0,g.A_)(i)){var c,h=(0,F.c)(i)||!(0,g.A_)(t)&&!(0,M.d1)(t)?void 0:t,d=i;h&&!o&&(o=[(0,g.A_)(h)?h.__ref:h]);var u=function(e,t){return(0,F.c)(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var i=u(h,t),s=u(d,t);if(void 0!==s){o&&o.push(t);var a=l.applyMerges(e,i,s,n,o);a!==s&&(c=c||new Map).set(t,a),o&&(0,r.V1)(o.pop()===t)}}),c&&(i=(0,F.c)(d)?d.slice(0):(0,s.__assign)({},d),c.forEach(function(e,t){i[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,n,o&&(a=n.store).getStorage.apply(a,o)):i},e}(),ue=[];function pe(e,t){var i=e.map;return i.has(t)||i.set(t,ue.pop()||{map:new Map}),i.get(t)}function ge(e,t){if(e===t||!t||me(t))return e;if(!e||me(e))return t;var i=e.info&&t.info?(0,s.__assign)((0,s.__assign)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,n={info:i,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,i){n.map.set(i,ge(e,t.map.get(i))),o.delete(i)}),o.forEach(function(i){n.map.set(i,ge(t.map.get(i),e.map.get(i)))})}return n}function me(e){return!e||!(e.info||e.map.size)}function fe(e,t){var i=e.map,s=i.get(t);s&&me(s)&&(ue.push(s),i.delete(t))}var ye=new Set,ve=i(27231),Ce=i(30301),be=function(e){function t(t){void 0===t&&(t={});var i=e.call(this)||this;return i.watches=new Set,i.addTypenameTransform=new c.c(h.XY),i.assumeImmutableResults=!0,i.makeVar=W.UT,i.txCount=0,!1!==globalThis.__DEV__&&((0,Ce.cc)(t,"addTypename","InMemoryCache","Please remove the `addTypename` option when initializing `InMemoryCache`."),(0,Ce.cc)(t,"canonizeResults","InMemoryCache","Please remove the `canonizeResults` option when initializing `InMemoryCache`.")),i.config=(0,M.I6)(t),i.addTypename=!!i.config.addTypename,i.policies=new oe({cache:i,dataIdFromObject:i.config.dataIdFromObject,possibleTypes:i.config.possibleTypes,typePolicies:i.config.typePolicies}),i.init(),i}return(0,s.__extends)(t,e),t.prototype.init=function(){var e=this.data=new I.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,i=this.storeReader,s=this.config.fragments;this.addTypenameTransform.resetCache(),null==s||s.resetCaches(),this.storeWriter=new de(this,this.storeReader=new V({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:(0,M.Xx)(this.config),canon:e?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=(0,n.LV)(function(e,i){return t.broadcastWatch(e,i)},{max:this.config.resultCacheMaxSize||d.v["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var i=e.optimistic?t.optimisticData:t.data;if(O(i)){var s=e.optimistic,r=e.id,n=e.variables;return i.makeCacheKey(e.query,e.callback,(0,u.M)({optimistic:s,id:r,variables:n}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){!1!==globalThis.__DEV__&&(0,Ce.cc)(e,"canonizeResults","cache.read");var t=e.returnPartialData,i=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,s.__assign)((0,s.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(e){if(e instanceof l.Z)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(M.$3.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return!1!==globalThis.__DEV__&&(0,Ce.cc)(e,"canonizeResults","cache.diff"),this.storeReader.diffQueryAgainstStore((0,s.__assign)((0,s.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||(0,W.MS)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&(0,W.WR)(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){!1!==globalThis.__DEV__&&(0,Ce.cc)(e||{},"resetResultIdentities","cache.gc","First ensure all usages of `canonizeResults` are removed, then remove this option."),u.M.reset(),p.y.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if((0,g.A_)(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&r.V1.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(M.$3.call(e,"id"))return!1;e=(0,s.__assign)((0,s.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),u.M.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),(0,W.WR)(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,i=this,r=e.update,n=e.optimistic,o=void 0===n||n,a=e.removeOptimistic,l=e.onWatchUpdated,c=function(e){var s=i,n=s.data,o=s.optimisticData;++i.txCount,e&&(i.data=i.optimisticData=e);try{return t=r(i)}finally{--i.txCount,i.data=n,i.optimisticData=o}},h=new Set;return l&&!this.txCount&&this.broadcastWatches((0,s.__assign)((0,s.__assign)({},e),{onWatchUpdated:function(e){return h.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,c):!1===o?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches((0,s.__assign)((0,s.__assign)({},e),{onWatchUpdated:function(e,t){var i=l.call(this,e,t);return!1!==i&&h.delete(e),i}})),h.size&&h.forEach(function(e){return i.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.fragmentMatches=function(e,t){return this.policies.fragmentMatches(e,t)},t.prototype.lookupFragment=function(e){var t;return(null===(t=this.config.fragments)||void 0===t?void 0:t.lookup(e))||null},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(i){return t.maybeBroadcastWatch(i,e)})},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var i=this,s=e.lastDiff,r=(0,Ce.lz)("canonizeResults",function(){return i.diff(e)});t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,s))||s&&(0,o.L)(s.result,r.result)||e.callback(e.lastDiff=r,s)},t}(a.k);!1!==globalThis.__DEV__&&(be.prototype.getMemoryInternals=ve.cM)},67566(e,t,i){"use strict";i.d(t,{MS:()=>l,UT:()=>c,WR:()=>a,bl:()=>r});var s=i(81987),r=new s.DX,n=new WeakMap;function o(e){var t=n.get(e);return t||n.set(e,t={vars:new Set,dep:(0,s.yN)()}),t}function a(e){o(e).vars.forEach(function(t){return t.forgetCache(e)})}function l(e){o(e).vars.forEach(function(t){return t.attachCache(e)})}function c(e){var t=new Set,i=new Set,s=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){o(e).dep.dirty(s),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)});var l=Array.from(i);i.clear(),l.forEach(function(t){return t(e)})}}else{var c=r.getValue();c&&(n(c),o(c).dep(s))}return e};s.onNextChange=function(e){return i.add(e),function(){i.delete(e)}};var n=s.attachCache=function(e){return t.add(e),o(e).vars.add(s),s};return s.forgetCache=function(e){return t.delete(e)},s}},50953(e,t,i){"use strict";i.d(t,{R:()=>Q});var s=i(65959),r=i(131),n=i(3224),o=i(34109),a=i(29527),l=i(39781),c=i(45063),h=i(94537),d=i(14270),u=i(83906),p=i(48555),g=i(26497),m=i(78917),f=i(34471),y=i(28931),v=i(79e3),C=i(47812),b=i(99310),S=i(1164),w=i(66566),x=i(74140),E=i(84382),M=i(17303),A=i(78440),T=i(49995),D=i(45902),I=i(97703),R=i(30301),P=new(I.et?WeakMap:Map);function k(e,t){var i=e[t];"function"==typeof i&&(e[t]=function(){return P.set(e,(P.get(e)+1)%1e15),i.apply(this,arguments)})}var L=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var i=this.cache=e.cache;P.has(i)||(P.set(i,0),k(i,"evict"),k(i,"modify"),k(i,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||T.pT.loading;return this.variables&&this.networkStatus!==T.pT.loading&&!(0,c.L)(this.variables,e.variables)&&(t=T.pT.setVariables),(0,c.L)(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this,t=this.getDiffOptions();if(this.lastDiff&&(0,c.L)(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var i=this.observableQuery;if(i&&"no-cache"===i.options.fetchPolicy)return{complete:!1};var s=(0,R.lz)("canonizeResults",function(){return e.cache.diff(t)});return this.updateLastDiff(s,t),s},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,i=this,s=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(0,R.lz)("getLastError",function(){var e;return null===(e=i.observableQuery)||void 0===e?void 0:e.getLastError()})||(this.updateLastDiff(e),(0,c.L)(s&&s.result,e&&e.result)||null===(t=this.observableQuery)||void 0===t||t.scheduleNotify())},e.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},e.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,null===(e=this.observableQuery)||void 0===e||e.resetNotifications(),this.cancel();var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){var e;null===(e=this.cancelWatch)||void 0===e||e.call(this),this.cancelWatch=void 0},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var i=this.observableQuery;if(!i||"no-cache"!==i.options.fetchPolicy){var r=(0,s.__assign)((0,s.__assign)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,c.L)(r,this.lastWatch)||(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var i=this.lastWrite;return!(i&&i.dmCount===P.get(this.cache)&&(0,c.L)(t,i.variables)&&(0,c.L)(e.data,i.result.data))},e.prototype.markResult=function(e,t,i,s){var r,n=this,o=new D.ZI,a=(0,v.E)(e.errors)?e.errors.slice(0):[];if(null===(r=this.observableQuery)||void 0===r||r.resetNotifications(),"incremental"in e&&(0,v.E)(e.incremental)){var l=(0,h.bd)(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var d=this.getDiff();e.data=o.merge(d.result,e.data)}this.graphQLErrors=a,"no-cache"===i.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(i.variables)):0!==s&&(N(e,i.errorPolicy)?this.cache.performTransaction(function(r){if(n.shouldWrite(e,i.variables))r.writeQuery({query:t,data:e.data,variables:i.variables,overwrite:1===s}),n.lastWrite={result:e,variables:i.variables,dmCount:P.get(n.cache)};else if(n.lastDiff&&n.lastDiff.diff.complete)return void(e.data=n.lastDiff.diff.result);var o=n.getDiffOptions(i.variables),a=(0,R.lz)("canonizeResults",function(){return r.diff(o)});!n.stopped&&(0,c.L)(n.variables,i.variables)&&n.updateWatch(i.variables),n.updateLastDiff(a,o),a.complete&&(e.data=a.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=T.pT.ready},e.prototype.markError=function(e){var t;return this.networkStatus=T.pT.error,this.lastWrite=void 0,null===(t=this.observableQuery)||void 0===t||t.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function N(e,t){void 0===t&&(t="none");var i="ignore"===t||"all"===t,s=!(0,y.t)(e);return!s&&i&&e.data&&(s=!0),s}var _=i(33137),O=i(69796),F=i(75859),G=i(19360),B=i(94959),V=i(71637),H=i(13062),U=Object.prototype.hasOwnProperty,z=Object.create(null),W=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new F.A(G.v["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new O.b(!1),this.noCacheWarningsByQueryId=new Set;var i=new m.c(function(e){return t.cache.transformDocument(e)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var s=e.documentTransform;this.documentTransform=s?i.concat(s).concat(i):i,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,i){e.stopQueryNoBroadcast(i)}),this.cancelPendingFetches((0,r.vA)(35))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return(0,s.__awaiter)(this,arguments,void 0,function(e){var t,i,n,o,a,l,c,h=e.mutation,d=e.variables,u=e.optimisticResponse,p=e.updateQueries,g=e.refetchQueries,m=void 0===g?[]:g,v=e.awaitRefetchQueries,C=void 0!==v&&v,b=e.update,S=e.onQueryUpdated,w=e.fetchPolicy,x=void 0===w?(null===(l=this.defaultOptions.mutate)||void 0===l?void 0:l.fetchPolicy)||"network-only":w,E=e.errorPolicy,A=void 0===E?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":E,T=e.keepRootFields,D=e.context;return(0,s.__generator)(this,function(e){switch(e.label){case 0:return(0,r.V1)(h,36),(0,r.V1)("network-only"===x||"no-cache"===x,37),t=this.generateMutationId(),h=this.cache.transformForLink(this.transform(h)),i=this.getDocumentInfo(h).hasClientExports,d=this.getVariables(h,d),i?[4,this.localState.addExportedVariables(h,d,D)]:[3,2];case 1:d=e.sent(),e.label=2;case 2:return n=this.mutationStore&&(this.mutationStore[t]={mutation:h,variables:d,loading:!0,error:null}),o=u&&this.markMutationOptimistic(u,{mutationId:t,document:h,variables:d,fetchPolicy:x,errorPolicy:A,context:D,updateQueries:p,update:b,keepRootFields:T}),this.broadcastQueries(),a=this,[2,new Promise(function(e,i){return(0,f.x)(a.getObservableFromLink(h,(0,s.__assign)((0,s.__assign)({},D),{optimisticResponse:o?u:void 0}),d,{},!1),function(e){if((0,y.t)(e)&&"none"===A)throw new M.K4({graphQLErrors:(0,y.M)(e)});n&&(n.loading=!1,n.error=null);var i=(0,s.__assign)({},e);return"function"==typeof m&&(m=m(i)),"ignore"===A&&(0,y.t)(i)&&delete i.errors,a.markMutationResult({mutationId:t,result:i,document:h,variables:d,fetchPolicy:x,errorPolicy:A,context:D,update:b,updateQueries:p,awaitRefetchQueries:C,refetchQueries:m,removeOptimistic:o?t:void 0,onQueryUpdated:S,keepRootFields:T})}).subscribe({next:function(i){a.broadcastQueries(),"hasNext"in i&&!1!==i.hasNext||e((0,s.__assign)((0,s.__assign)({},i),{data:a.maskOperation({document:h,data:i.data,fetchPolicy:x,id:t})}))},error:function(e){n&&(n.loading=!1,n.error=e),o&&a.cache.removeOptimistic(t),a.broadcastQueries(),i(e instanceof M.K4?e:new M.K4({networkError:e}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var i=this;void 0===t&&(t=this.cache);var r=e.result,n=[],o="no-cache"===e.fetchPolicy;if(!o&&N(r,e.errorPolicy)){if((0,h.ST)(r)||n.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),(0,h.ST)(r)&&(0,v.E)(r.incremental)){var a=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=(0,h.bd)(a.result,r)),void 0!==l&&(r.data=l,n.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(e,s){var o=e.observableQuery,a=o&&o.queryName;if(a&&U.call(c,a)){var l=c[a],h=i.queries.get(s),d=h.document,u=h.variables,p=t.diff({query:d,variables:u,returnPartialData:!0,optimistic:!1}),g=p.result;if(p.complete&&g){var m=l(g,{mutationResult:r,queryName:d&&(0,C.n4)(d)||void 0,queryVariables:u});m&&n.push({result:m,dataId:"ROOT_QUERY",query:d,variables:u})}}})}if(n.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var d=[];if(this.refetchQueries({updateCache:function(t){o||n.forEach(function(e){return t.write(e)});var a=e.update,l=!(0,h.YX)(r)||(0,h.ST)(r)&&!r.hasNext;if(a){if(!o){var c=t.diff({id:"ROOT_MUTATION",query:i.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});c.complete&&("incremental"in(r=(0,s.__assign)((0,s.__assign)({},r),{data:c.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}l&&a(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||!l||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var i=t.fieldName,s=t.DELETE;return"__typename"===i?e:s}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return d.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(d).then(function(){return r})}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var i=this,n="function"==typeof e?e(t.variables,{IGNORE:z}):e;return n!==z&&(this.cache.recordOptimisticTransaction(function(e){try{i.markMutationResult((0,s.__assign)((0,s.__assign)({},t),{result:{data:n}}),e)}catch(e){!1!==globalThis.__DEV__&&r.V1.error(e)}},t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,i){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),t,i).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,i){e[i]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var i={hasClientExports:(0,d.f2)(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:(0,d.d8)(["nonreactive"],e),nonReactiveQuery:(0,u.x3)(e),clientQuery:this.localState.clientQuery(e),serverQuery:(0,u.iz)([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:(0,C.wY)((0,C.Vu)(e)),asQuery:(0,s.__assign)((0,s.__assign)({},e),{definitions:e.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,s.__assign)((0,s.__assign)({},e),{operation:"query"}):e})})};t.set(e,i)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,s.__assign)((0,s.__assign)({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=(0,s.__assign)((0,s.__assign)({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var i=new L(this),r=new A.U({queryManager:this,queryInfo:i,options:e});return r.lastQuery=t,A.U.inactiveOnCreation.getValue()||this.queries.set(r.queryId,i),i.init({document:t,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var i=this;void 0===t&&(t=this.generateQueryId()),(0,r.V1)(e.query,38),(0,r.V1)("Document"===e.query.kind,39),(0,r.V1)(!e.returnPartialData,40),(0,r.V1)(!e.pollInterval,41);var n=this.transform(e.query);return this.fetchQuery(t,(0,s.__assign)((0,s.__assign)({},e),{query:n})).then(function(r){return r&&(0,s.__assign)((0,s.__assign)({},r),{data:i.maskOperation({document:n,data:r.data,fetchPolicy:e.fetchPolicy,id:t})})}).finally(function(){return i.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches((0,r.vA)(42)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=T.pT.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var i=new Map,n=new Map,o=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(e){if("string"==typeof e)n.set(e,e),o.set(e,!1);else if((0,b.Kc)(e)){var i=(0,_.y)(t.transform(e));n.set(i,(0,C.n4)(e)),o.set(i,!1)}else(0,S.U)(e)&&e.query&&a.add(e)}),this.queries.forEach(function(t,s){var r=t.observableQuery,n=t.document;if(r){if("all"===e)return void i.set(s,r);var a=r.queryName;if("standby"===r.options.fetchPolicy||"active"===e&&!r.hasObservers())return;("active"===e||a&&o.has(a)||n&&o.has((0,_.y)(n)))&&(i.set(s,r),a&&o.set(a,!0),n&&o.set((0,_.y)(n),!0))}}),a.size&&a.forEach(function(e){var n=(0,w.v)("legacyOneTimeQuery"),o=t.getOrCreateQuery(n).init({document:e.query,variables:e.variables}),a=new A.U({queryManager:t,queryInfo:o,options:(0,s.__assign)((0,s.__assign)({},e),{fetchPolicy:"network-only"})});(0,r.V1)(a.queryId===n),o.setObservableQuery(a),i.set(n,a)}),!1!==globalThis.__DEV__&&o.size&&o.forEach(function(e,t){if(!e){var i=n.get(t);i?!1!==globalThis.__DEV__&&r.V1.warn(43,i):!1!==globalThis.__DEV__&&r.V1.warn(44)}}),i},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var i=[];return this.getObservableQueries(e?"all":"active").forEach(function(s,r){var n=s.options.fetchPolicy;(0,R.lz)("resetLastResults",function(){return s.resetLastResults()}),(e||"standby"!==n&&"cache-only"!==n)&&i.push(s.refetch()),(t.queries.get(r)||s.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(i)},e.prototype.startGraphQLSubscription=function(e){var t=this,i=e.query,s=e.variables,r=e.fetchPolicy,n=e.errorPolicy,o=void 0===n?"none":n,a=e.context,l=void 0===a?{}:a,c=e.extensions,h=void 0===c?{}:c;i=this.transform(i),s=this.getVariables(i,s);var d=function(e){return t.getObservableFromLink(i,l,e,h).map(function(s){"no-cache"!==r&&(N(s,o)&&t.cache.write({query:i,result:s.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var n=(0,y.t)(s),a=(0,M.uR)(s);if(n||a){var l={};if(n&&(l.graphQLErrors=s.errors),a&&(l.protocolErrors=s.extensions[M.K$]),"none"===o||a)throw new M.K4(l)}return"ignore"===o&&delete s.errors,s})};if(this.getDocumentInfo(i).hasClientExports){var u=this.localState.addExportedVariables(i,s,l).then(d);return new x.c(function(e){var t=null;return u.then(function(i){return t=i.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return d(s)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){var t;this.fetchCancelFns.delete(e),this.queries.has(e)&&(null===(t=this.queries.get(e))||void 0===t||t.stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var t;return null===(t=e.observableQuery)||void 0===t?void 0:t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,i,r,n){var a,l,c=this;void 0===n&&(n=null!==(a=null==t?void 0:t.queryDeduplication)&&void 0!==a?a:this.queryDeduplication);var h=this.getDocumentInfo(e),d=h.serverQuery,u=h.clientQuery;if(d){var p=this.inFlightLinkObservables,m=this.link,y={query:d,variables:i,operationName:(0,C.n4)(d)||void 0,context:this.prepareContext((0,s.__assign)((0,s.__assign)({},t),{forceFetch:!n})),extensions:r};if(t=y.context,n){var v=(0,_.y)(d),b=(0,g.M)(i),S=p.lookup(v,b);if(!(l=S.observable)){var w=new E.E([(0,o.g)(m,y)]);l=S.observable=w,w.beforeNext(function e(t,i){"next"===t&&"hasNext"in i&&i.hasNext?w.beforeNext(e):p.remove(v,b)})}}else l=new E.E([(0,o.g)(m,y)])}else l=new E.E([x.c.of({data:{}})]),t=this.prepareContext(t);return u&&(l=(0,f.x)(l,function(e){return c.localState.runResolvers({document:u,remoteResult:e,context:t,variables:i})})),l},e.prototype.getResultsFromLink=function(e,t,i){var s=e.lastRequestId=this.generateRequestId(),r=this.cache.transformForLink(i.query);return(0,f.x)(this.getObservableFromLink(r,i.context,i.variables),function(n){var o=(0,y.M)(n),a=o.length>0,l=i.errorPolicy;if(s>=e.lastRequestId){if(a&&"none"===l)throw e.markError(new M.K4({graphQLErrors:o}));e.markResult(n,r,i,t),e.markReady()}var c={data:n.data,loading:!1,networkStatus:T.pT.ready};return a&&"none"===l&&(c.data=void 0),a&&"ignore"!==l&&(c.errors=o,c.networkStatus=T.pT.error),c},function(t){var i=(0,M.Mn)(t)?t:new M.K4({networkError:t});throw s>=e.lastRequestId&&e.markError(i),i})},e.prototype.fetchConcastWithInfo=function(e,t,i,s){var r=this;void 0===i&&(i=T.pT.loading),void 0===s&&(s=t.query);var n,o,a=this.getVariables(s,t.variables),l=this.defaultOptions.watchQuery,c=t.fetchPolicy,h=void 0===c?l&&l.fetchPolicy||"cache-first":c,d=t.errorPolicy,u=void 0===d?l&&l.errorPolicy||"none":d,p=t.returnPartialData,g=void 0!==p&&p,m=t.notifyOnNetworkStatusChange,f=void 0!==m&&m,y=t.context,v=void 0===y?{}:y,C=Object.assign({},t,{query:s,variables:a,fetchPolicy:h,errorPolicy:u,returnPartialData:g,notifyOnNetworkStatusChange:f,context:v}),b=function(s){C.variables=s;var n=r.fetchQueryByPolicy(e,C,i);return"standby"!==C.fetchPolicy&&n.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",t),n},S=function(){return r.fetchCancelFns.delete(e.queryId)};if(this.fetchCancelFns.set(e.queryId,function(e){S(),setTimeout(function(){return n.cancel(e)})}),this.getDocumentInfo(C.query).hasClientExports)n=new E.E(this.localState.addExportedVariables(C.query,C.variables,C.context).then(b).then(function(e){return e.sources})),o=!0;else{var w=b(C.variables);o=w.fromLink,n=new E.E(w.sources)}return n.promise.then(S,S),{concast:n,fromLink:o}},e.prototype.refetchQueries=function(e){var t=this,i=e.updateCache,s=e.include,r=e.optimistic,n=void 0!==r&&r,o=e.removeOptimistic,a=void 0===o?n?(0,w.v)("refetchQueries"):void 0:o,l=e.onQueryUpdated,c=new Map;s&&this.getObservableQueries(s).forEach(function(e,i){c.set(i,{oq:e,lastDiff:(t.queries.get(i)||e.queryInfo).getDiff()})});var h=new Map;return i&&this.cache.batch({update:i,optimistic:n&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,i){var s=e.watcher instanceof L&&e.watcher.observableQuery;if(s){if(l){c.delete(s.queryId);var r=l(s,t,i);return!0===r&&(r=s.refetch()),!1!==r&&h.set(s,r),r}null!==l&&c.set(s.queryId,{oq:s,lastDiff:i,diff:t})}}}),c.size&&c.forEach(function(e,i){var s,r=e.oq,n=e.lastDiff,o=e.diff;l&&(o||(o=(0,R.lz)("canonizeResults",function(){return t.cache.diff(r.queryInfo.getDiffOptions())})),s=l(r,o,n)),l&&!0!==s||(s=r.refetch()),!1!==s&&h.set(r,s),i.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(i)}),a&&this.cache.removeOptimistic(a),h},e.prototype.maskOperation=function(e){var t,i,s,n=e.document,o=e.data;if(!1!==globalThis.__DEV__){var a=e.fetchPolicy,l=e.id,c=null===(t=(0,C.Vu)(n))||void 0===t?void 0:t.operation,h=(null!==(i=null==c?void 0:c[0])&&void 0!==i?i:"o")+l;!this.dataMasking||"no-cache"!==a||(0,p.s6)(n)||this.noCacheWarningsByQueryId.has(h)||(this.noCacheWarningsByQueryId.add(h),!1!==globalThis.__DEV__&&r.V1.warn(45,null!==(s=(0,C.n4)(n))&&void 0!==s?s:"Unnamed ".concat(null!=c?c:"operation")))}return this.dataMasking?function(e,t,i){var s;if(!i.fragmentMatches)return!1!==globalThis.__DEV__&&(0,V.Ki)(),e;var n=(0,C.Vu)(t);return(0,r.V1)(n,63),null==e?e:(0,B.S)(e,n.selectionSet,{operationType:n.operation,operationName:null===(s=n.name)||void 0===s?void 0:s.value,fragmentMap:(0,p.JG)((0,C.zK)(t)),cache:i,mutableTargets:new V.jq,knownChanged:new V.xm})}(o,n,this.cache):o},e.prototype.maskFragment=function(e){var t=e.data,i=e.fragment,s=e.fragmentName;return this.dataMasking?(0,H.z)(t,i,this.cache,s):t},e.prototype.fetchQueryByPolicy=function(e,t,i){var r=this,n=t.query,o=t.variables,a=t.fetchPolicy,l=t.refetchWritePolicy,h=t.errorPolicy,d=t.returnPartialData,u=t.context,p=t.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:n,variables:o,networkStatus:i});var m=function(){return e.getDiff()},f=function(t,i){void 0===i&&(i=e.networkStatus||T.pT.loading);var a=t.result;!1===globalThis.__DEV__||d||(0,c.L)(a,{})||(0,A.y)(t.missing);var l=function(e){return x.c.of((0,s.__assign)({data:e,loading:(0,T.bi)(i),networkStatus:i},t.complete?null:{partial:!0}))};return a&&r.getDocumentInfo(n).hasForcedResolvers?r.localState.runResolvers({document:n,remoteResult:{data:a},context:u,variables:o,onlyRunForcedResolvers:!0}).then(function(e){return l(e.data||void 0)}):"none"===h&&i===T.pT.refetch&&Array.isArray(t.missing)?l(void 0):l(a)},y="no-cache"===a?0:i===T.pT.refetch&&"merge"!==l?1:2,v=function(){return r.getResultsFromLink(e,y,{query:n,variables:o,context:u,fetchPolicy:a,errorPolicy:h})},C=p&&"number"==typeof g&&g!==i&&(0,T.bi)(i);switch(a){default:case"cache-first":return(b=m()).complete?{fromLink:!1,sources:[f(b,e.markReady())]}:d||C?{fromLink:!0,sources:[f(b),v()]}:{fromLink:!0,sources:[v()]};case"cache-and-network":var b;return(b=m()).complete||d||C?{fromLink:!0,sources:[f(b),v()]}:{fromLink:!0,sources:[v()]};case"cache-only":return{fromLink:!1,sources:[f(m(),e.markReady())]};case"network-only":return C?{fromLink:!0,sources:[f(m()),v()]}:{fromLink:!0,sources:[v()]};case"no-cache":return C?{fromLink:!0,sources:[f(e.getDiff()),v()]}:{fromLink:!0,sources:[v()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new L(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,s.__assign)((0,s.__assign)((0,s.__assign)({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),j=i(85517),K=i(96891),$=i(67566),Y=function(){function e(e){var t=e.cache,i=e.client,s=e.resolvers,r=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,i&&(this.client=i),s&&this.addResolvers(s),r&&this.setFragmentMatcher(r)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=(0,D.D9)(t.resolvers,e)}):this.resolvers=(0,D.D9)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return(0,s.__awaiter)(this,arguments,void 0,function(e){var t=e.document,i=e.remoteResult,r=e.context,n=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return(0,s.__generator)(this,function(e){return t?[2,this.resolveDocument(t,i.data,r,n,this.fragmentMatcher,a).then(function(e){return(0,s.__assign)((0,s.__assign)({},i),{data:e.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,d.d8)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return(0,u.er)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,s.__assign)((0,s.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return(0,s.__awaiter)(this,arguments,void 0,function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i={}),(0,s.__generator)(this,function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(i),t).then(function(e){return(0,s.__assign)((0,s.__assign)({},t),e.exportedVariables)})]:[2,(0,s.__assign)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,j.YR)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return j.sP}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,u.zc)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return(0,s.__awaiter)(this,arguments,void 0,function(e,t,i,r,n,o){var a,l,c,h,d,u,g,m,f,y;return void 0===i&&(i={}),void 0===r&&(r={}),void 0===n&&(n=function(){return!0}),void 0===o&&(o=!1),(0,s.__generator)(this,function(v){return a=(0,C.Vn)(e),l=(0,C.zK)(e),c=(0,p.JG)(l),h=this.collectSelectionsToResolve(a,c),d=a.operation,u=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",m=(g=this).cache,f=g.client,y={fragmentMap:c,context:(0,s.__assign)((0,s.__assign)({},i),{cache:m,client:f}),variables:r,fragmentMatcher:n,defaultOperationType:u,exportedVariables:{},selectionsToResolve:h,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,!1,t,y).then(function(e){return{result:e,exportedVariables:y.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,i,n){return(0,s.__awaiter)(this,void 0,void 0,function(){var o,a,l,c,h,u=this;return(0,s.__generator)(this,function(p){return o=n.fragmentMap,a=n.context,l=n.variables,c=[i],h=function(e){return(0,s.__awaiter)(u,void 0,void 0,function(){var h,u;return(0,s.__generator)(this,function(s){return(t||n.selectionsToResolve.has(e))&&(0,d.MS)(e,l)?(0,b.dt)(e)?[2,this.resolveField(e,t,i,n).then(function(t){var i;void 0!==t&&c.push(((i={})[(0,b.ue)(e)]=t,i))})]:((0,b.kd)(e)?h=e:(h=o[e.name.value],(0,r.V1)(h,21,e.name.value)),h&&h.typeCondition&&(u=h.typeCondition.name.value,n.fragmentMatcher(i,u,a))?[2,this.resolveSelectionSet(h.selectionSet,t,i,n).then(function(e){c.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(h)).then(function(){return(0,D.IM)(c)})]})})},e.prototype.resolveField=function(e,t,i,r){return(0,s.__awaiter)(this,void 0,void 0,function(){var n,o,a,l,c,h,d,u,p,g=this;return(0,s.__generator)(this,function(s){return i?(n=r.variables,o=e.name.value,a=(0,b.ue)(e),l=o!==a,c=i[a]||i[o],h=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(d=i.__typename||r.defaultOperationType,(u=this.resolvers&&this.resolvers[d])&&(p=u[l?o:a])&&(h=Promise.resolve($.bl.withValue(this.cache,p,[i,(0,b.MB)(e,n),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,h.then(function(i){var s,n;if(void 0===i&&(i=c),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=i)})}),!e.selectionSet)return i;if(null==i)return i;var o=null!==(n=null===(s=e.directives)||void 0===s?void 0:s.some(function(e){return"client"===e.name.value}))&&void 0!==n&&n;return Array.isArray(i)?g.resolveSubSelectedArray(e,t||o,i,r):e.selectionSet?g.resolveSelectionSet(e.selectionSet,t||o,i,r):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,i,s){var r=this;return Promise.all(i.map(function(i){return null===i?null:Array.isArray(i)?r.resolveSubSelectedArray(e,t,i,s):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,i,s):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var i=function(e){return!Array.isArray(e)},s=this.selectionsToResolveCache;return function e(n){if(!s.has(n)){var o=new Set;s.set(n,o),(0,j.YR)(n,{Directive:function(e,t,s,r,n){"client"===e.name.value&&n.forEach(function(e){i(e)&&(0,K.VK)(e)&&o.add(e)})},FragmentSpread:function(s,n,a,l,c){var h=t[s.name.value];(0,r.V1)(h,22,s.name.value);var d=e(h);d.size>0&&(c.forEach(function(e){i(e)&&(0,K.VK)(e)&&o.add(e)}),o.add(s),d.forEach(function(e){o.add(e)}))}})}return s.get(n)}(e)},e}(),q=i(97460),X=i(27231),Z=!1,Q=function(){function e(e){var t,i,o,c=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw(0,r.vA)(16);var h=e.uri,d=e.credentials,u=e.headers,p=e.cache,g=e.documentTransform,m=e.ssrMode,f=void 0!==m&&m,y=e.ssrForceFetchDelay,v=void 0===y?0:y,C=e.connectToDevTools,b=e.queryDeduplication,S=void 0===b||b,w=e.defaultOptions,x=e.defaultContext,E=e.assumeImmutableResults,M=void 0===E?p.assumeImmutableResults:E,A=e.resolvers,T=e.typeDefs,D=e.fragmentMatcher,I=e.clientAwareness,P=e.name,k=e.version,L=e.devtools,N=e.dataMasking;!1!==globalThis.__DEV__&&((0,R.cc)(e,"connectToDevTools","ApolloClient","Please use `devtools.enabled` instead."),(0,R.cc)(e,"uri","ApolloClient","Please initialize an instance of `HttpLink` with `uri` instead."),(0,R.cc)(e,"credentials","ApolloClient","Please initialize an instance of `HttpLink` with `credentials` instead."),(0,R.cc)(e,"headers","ApolloClient","Please initialize an instance of `HttpLink` with `headers` instead."),(0,R.cc)(e,"name","ApolloClient","Please use the `clientAwareness.name` option instead."),(0,R.cc)(e,"version","ApolloClient","Please use the `clientAwareness.version` option instead."),(0,R.cc)(e,"typeDefs","ApolloClient"),e.link||!1!==globalThis.__DEV__&&r.V1.warn(17));var _=e.link;_||(_=h?new l.P({uri:h,credentials:d,headers:u}):n.C.empty()),this.link=_,this.cache=p,this.disableNetworkFetches=f||v>0,this.queryDeduplication=S,this.defaultOptions=w||Object.create(null),this.typeDefs=T,this.devtoolsConfig=(0,s.__assign)((0,s.__assign)({},L),{enabled:null!==(t=null==L?void 0:L.enabled)&&void 0!==t?t:C}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),v&&setTimeout(function(){return c.disableNetworkFetches=!1},v),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=a.r,this.localState=new Y({cache:p,client:this,resolvers:A,fragmentMatcher:D}),this.queryManager=new W({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:x,documentTransform:g,queryDeduplication:S,ssrMode:f,dataMasking:!!N,clientAwareness:{name:null!==(i=null==I?void 0:I.name)&&void 0!==i?i:P,version:null!==(o=null==I?void 0:I.version)&&void 0!==o?o:k},localState:this.localState,assumeImmutableResults:M,onBroadcast:this.devtoolsConfig.enabled?function(){c.devToolsHookCb&&c.devToolsHookCb({action:{},state:{queries:c.queryManager.getQueryStore(),mutations:c.queryManager.mutationStore||{}},dataWithOptimisticResults:c.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return Object.defineProperty(e.prototype,"prioritizeCacheValues",{get:function(){return this.disableNetworkFetches},set:function(e){this.disableNetworkFetches=e},enumerable:!1,configurable:!0}),e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,Z||!1===globalThis.__DEV__||(Z=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,i=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?i="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(i="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),i&&!1!==globalThis.__DEV__&&r.V1.log("Download the Apollo DevTools for a better development experience: %s",i)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,q.l)(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,s.__assign)((0,s.__assign)({},e),{fetchPolicy:"cache-first"})),!1!==globalThis.__DEV__&&((0,R.cc)(e,"canonizeResults","client.watchQuery"),(0,R.cc)(e,"partialRefetch","client.watchQuery")),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,q.l)(this.defaultOptions.query,e)),(0,r.V1)("cache-and-network"!==e.fetchPolicy,18),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,s.__assign)((0,s.__assign)({},e),{fetchPolicy:"cache-first"})),!1!==globalThis.__DEV__&&((0,R.cc)(e,"canonizeResults","client.query"),(0,R.cc)(e,"notifyOnNetworkStatusChange","client.query","This option does not affect `client.query` and can be safely removed."),"standby"===e.fetchPolicy&&!1!==globalThis.__DEV__&&r.V1.warn(19)),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,q.l)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){var t=this,i=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(r){return(0,s.__assign)((0,s.__assign)({},r),{data:t.queryManager.maskOperation({document:e.query,data:r.data,fetchPolicy:e.fetchPolicy,id:i})})})},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){var t;return this.cache.watchFragment((0,s.__assign)((0,s.__assign)({},e),((t={})[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,t)))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,o.g)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),i=[],s=[];t.forEach(function(e,t){i.push(t),s.push(e)});var n=Promise.all(s);return n.queries=i,n.results=s,n.catch(function(e){!1!==globalThis.__DEV__&&r.V1.debug(20,e)}),n},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(Q.prototype.getMemoryInternals=X.ep)},78440(e,t,i){"use strict";i.d(t,{U:()=>b,y:()=>w});var s=i(65959),r=i(131),n=i(45063),o=i(49995),a=i(74140),l=i(47812),c=i(90767),h=i(37563),d=i(20658),u=i(24783),p=i(58173),g=i(17303),m=i(47372),f=i(81987),y=i(30301),v=Object.assign,C=Object.hasOwnProperty,b=function(e){function t(i){var r=i.queryManager,n=i.queryInfo,o=i.options,a=this,c=t.inactiveOnCreation.getValue();(a=e.call(this,function(e){a._getOrCreateQuery();try{var t=e._subscription._observer;t&&!t.error&&(t.error=S)}catch(e){}var i=!a.observers.size;a.observers.add(e);var s=a.last;return s&&s.error?e.error&&e.error(s.error):s&&s.result&&e.next&&e.next(a.maskResult(s.result)),i&&a.reobserve().catch(function(){}),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}})||this).observers=new Set,a.subscriptions=new Set,a.dirty=!1,a._getOrCreateQuery=function(){return c&&(r.queries.set(a.queryId,n),c=!1),a.queryManager.getOrCreateQuery(a.queryId)},a.queryInfo=n,a.queryManager=r,a.waitForOwnResult=x(o.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a),a.maskResult=a.maskResult.bind(a);var h=r.defaultOptions.watchQuery,d=(void 0===h?{}:h).fetchPolicy,u=void 0===d?"cache-first":d,p=o.fetchPolicy,g=void 0===p?u:p,m=o.initialFetchPolicy,f=void 0===m?"standby"===g?u:g:m;a.options=(0,s.__assign)((0,s.__assign)({},o),{initialFetchPolicy:f,fetchPolicy:g}),a.queryId=n.queryId||r.generateQueryId();var y=(0,l.Vu)(a.query);return a.queryName=y&&y.name&&y.name.value,a}return(0,s.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return!1!==globalThis.__DEV__&&(0,y.S2)("observableQuery.result",function(){!1!==globalThis.__DEV__&&r.V1.warn(23)}),new Promise(function(t,i){var s={next:function(i){t(i),e.observers.delete(s),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){r.unsubscribe()},0)},error:i},r=e.subscribe(s)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentFullResult=function(e){var t=this;void 0===e&&(e=!0);var i=(0,y.lz)("getLastResult",function(){return t.getLastResult(!0)}),r=this.queryInfo.networkStatus||i&&i.networkStatus||o.pT.ready,a=(0,s.__assign)((0,s.__assign)({},i),{loading:(0,o.bi)(r),networkStatus:r}),l=this.options.fetchPolicy,c=void 0===l?"cache-first":l;if(x(c)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var h=this.queryInfo.getDiff();(h.complete||this.options.returnPartialData)&&(a.data=h.result),(0,n.L)(a.data,{})&&(a.data=void 0),h.complete?(delete a.partial,!h.complete||a.networkStatus!==o.pT.loading||"cache-first"!==c&&"cache-only"!==c||(a.networkStatus=o.pT.ready,a.loading=!1)):a.partial=!0,a.networkStatus===o.pT.ready&&(a.error||a.errors)&&(a.networkStatus=o.pT.error),!1===globalThis.__DEV__||h.complete||this.options.partialRefetch||a.loading||a.data||a.error||w(h.missing)}return e&&this.updateLastResult(a),a},t.prototype.getCurrentResult=function(e){return void 0===e&&(e=!0),this.maskResult(this.getCurrentFullResult(e))},t.prototype.isDifferentFromLastResult=function(e,t){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),s=this.queryManager.dataMasking,r=s?i.nonReactiveQuery:this.query;return(s||i.hasNonreactiveDirective?!(0,m.a)(r,this.last.result,e,this.variables):!(0,n.L)(this.last.result,e))||t&&!(0,n.L)(this.last.variables,t)},t.prototype.getLast=function(e,t){var i=this.last;if(i&&i[e]&&(!t||(0,n.L)(i.variables,this.variables)))return i[e]},t.prototype.getLastResult=function(e){return!1!==globalThis.__DEV__&&(0,y.S2)("getLastResult",function(){!1!==globalThis.__DEV__&&r.V1.warn(24)}),this.getLast("result",e)},t.prototype.getLastError=function(e){return!1!==globalThis.__DEV__&&(0,y.S2)("getLastError",function(){!1!==globalThis.__DEV__&&r.V1.warn(25)}),this.getLast("error",e)},t.prototype.resetLastResults=function(){!1!==globalThis.__DEV__&&(0,y.S2)("resetLastResults",function(){!1!==globalThis.__DEV__&&r.V1.warn(26)}),delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&r.V1.warn(27),this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,i={pollInterval:0},a=this.options.fetchPolicy;if(i.fetchPolicy="no-cache"===a?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&C.call(e,"variables")){var c=(0,l.AT)(this.query),h=c.variableDefinitions;h&&h.some(function(e){return"variables"===e.variable.name.value})||!1!==globalThis.__DEV__&&r.V1.warn(28,e,(null===(t=c.name)||void 0===t?void 0:t.value)||c)}return e&&!(0,n.L)(this.options.variables,e)&&(i.variables=this.options.variables=(0,s.__assign)((0,s.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(i,o.pT.refetch)},t.prototype.fetchMore=function(e){var t=this,i=(0,s.__assign)((0,s.__assign)({},e.query?e:(0,s.__assign)((0,s.__assign)((0,s.__assign)((0,s.__assign)({},this.options),{query:this.options.query}),e),{variables:(0,s.__assign)((0,s.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var n=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):i.query;var a=this.queryInfo,l=a.networkStatus;a.networkStatus=o.pT.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,h=null==e?void 0:e.updateQuery,d="no-cache"!==this.options.fetchPolicy;return d||(0,r.V1)(h,29),this.queryManager.fetchQuery(n,i,o.pT.fetchMore).then(function(r){if(t.queryManager.removeQuery(n),a.networkStatus===o.pT.fetchMore&&(a.networkStatus=l),d)t.queryManager.cache.batch({update:function(s){var n=e.updateQuery;n?s.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},function(e){return n(e,{fetchMoreResult:r.data,variables:i.variables})}):s.writeQuery({query:i.query,variables:i.variables,data:r.data})},onWatchUpdated:function(e){c.add(e.query)}});else{var u=t.getLast("result"),p=h(u.data,{fetchMoreResult:r.data,variables:i.variables});t.reportResult((0,s.__assign)((0,s.__assign)({},u),{networkStatus:l,loading:(0,o.bi)(l),data:p}),t.variables)}return t.maskResult(r)}).finally(function(){d&&!c.has(t.query)&&t.reobserveCacheFirst()})},t.prototype.subscribeToMore=function(e){var t=this,i=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(i){var r=e.updateQuery;r&&t.updateQuery(function(e,t){return r(e,(0,s.__assign)({subscriptionData:i},t))})},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&r.V1.error(30,t)}});return this.subscriptions.add(i),function(){t.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(e){return!1!==globalThis.__DEV__&&((0,y.cc)(e,"canonizeResults","setOptions"),(0,y.S2)("setOptions",function(){!1!==globalThis.__DEV__&&r.V1.warn(31)})),this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=(0,p.o)(this.options,e||{});v(this.options,t)},t.prototype.setVariables=function(e){var t=this;return(0,n.L)(this.variables,e)?this.observers.size?(0,y.lz)("observableQuery.result",function(){return t.result()}):Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},o.pT.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,i=t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),s=i.result,r=i.complete,n=e(s,{variables:this.variables,complete:!!r,previousData:s});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var i=t.fetchPolicy,s=void 0===i?"cache-first":i,r=t.initialFetchPolicy,n=void 0===r?s:r;"standby"===s||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(s,{reason:e,options:t,observable:this,initialFetchPolicy:n}):t.fetchPolicy="variables-changed"===e?n:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,i){var s=this._getOrCreateQuery();return s.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(s,e,t,i)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,i=this.options.pollInterval;if(i&&this.hasObservers()){if(!t||t.interval!==i){(0,r.V1)(i,32),(t||(this.pollingInfo={})).interval=i;var s=function(){var t,i;e.pollingInfo&&((0,o.bi)(e.queryInfo.networkStatus)||(null===(i=(t=e.options).skipPollAttempt)||void 0===i?void 0:i.call(t))?n():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},o.pT.poll).then(n,n))},n=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(s,t.interval))};n()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){var i=this;void 0===t&&(t=this.variables);var r=(0,y.lz)("getLastError",function(){return i.getLastError()});return r&&this.last&&!(0,n.L)(t,this.last.variables)&&(r=void 0),this.last=(0,s.__assign)({result:this.queryManager.assumeImmutableResults?e:(0,h.m)(e),variables:t},r?{error:r}:null)},t.prototype.reobserveAsConcast=function(e,t){var i=this;this.isTornDown=!1;var r=t===o.pT.refetch||t===o.pT.fetchMore||t===o.pT.poll,a=this.options.variables,l=this.options.fetchPolicy,c=(0,p.o)(this.options,e||{}),h=r?c:v(this.options,c),d=this.transformDocument(h.query);this.lastQuery=d,r||(this.updatePolling(),!e||!e.variables||(0,n.L)(e.variables,a)||"standby"===h.fetchPolicy||h.fetchPolicy!==l&&"function"!=typeof h.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",h),void 0===t&&(t=o.pT.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=x(h.fetchPolicy));var u=function(){i.concast===y&&(i.waitForOwnResult=!1)},m=h.variables&&(0,s.__assign)({},h.variables),f=this.fetch(h,t,d),y=f.concast,C=f.fromLink,b={next:function(e){(0,n.L)(i.variables,m)&&(u(),i.reportResult(e,m))},error:function(e){(0,n.L)(i.variables,m)&&((0,g.Mn)(e)||(e=new g.K4({networkError:e})),u(),i.reportError(e,m))}};return r||!C&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=b),y.addObserver(b),y},t.prototype.reobserve=function(e,t){return(0,c.X)(this.reobserveAsConcast(e,t).promise.then(this.maskResult))},t.prototype.resubscribeAfterError=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var s=this.last;(0,y.lz)("resetLastResults",function(){return e.resetLastResults()});var r=this.subscribe.apply(this,t);return this.last=s,r},t.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var i=this,s=(0,y.lz)("getLastError",function(){return i.getLastError()}),r=this.isDifferentFromLastResult(e,t);(s||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(s||r)&&(0,d.w)(this.observers,"next",this.maskResult(e))},t.prototype.reportError=function(e,t){var i=this,r=(0,s.__assign)((0,s.__assign)({},(0,y.lz)("getLastResult",function(){return i.getLastResult()})),{error:e,errors:e.graphQLErrors,networkStatus:o.pT.error,loading:!1});this.updateLastResult(r,t),(0,d.w)(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t.prototype.maskResult=function(e){return e&&"data"in e?(0,s.__assign)((0,s.__assign)({},e),{data:this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):e},t.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},t.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},t.prototype.scheduleNotify=function(){var e=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return e.notify()},0)))},t.prototype.notify=function(){this.cancelNotifyTimeout(),this.dirty&&("cache-only"!=this.options.fetchPolicy&&"cache-and-network"!=this.options.fetchPolicy&&(0,o.bi)(this.queryInfo.networkStatus)||(this.queryInfo.getDiff().fromOptimisticTransaction?this.observe():this.reobserveCacheFirst())),this.dirty=!1},t.prototype.reobserveCacheFirst=function(){var e=this.options,t=e.fetchPolicy,i=e.nextFetchPolicy;return"cache-and-network"===t||"network-only"===t?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,s){return this.nextFetchPolicy=i,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,s):t}}):this.reobserve()},t.inactiveOnCreation=new f.DX,t}(a.c);function S(e){!1!==globalThis.__DEV__&&r.V1.error(33,e.message,e.stack)}function w(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&r.V1.debug(34,e)}function x(e){return"network-only"===e||"no-cache"===e||"standby"===e}(0,u.r)(b)},47372(e,t,i){"use strict";i.d(t,{a:()=>c});var s=i(65959),r=i(45063),n=i(14270),o=i(48555),a=i(47812),l=i(99310);function c(e,t,i,n){var l=t.data,c=(0,s.__rest)(t,["data"]),d=i.data,u=(0,s.__rest)(i,["data"]);return(0,r.A)(c,u)&&h((0,a.Vn)(e).selectionSet,l,d,{fragmentMap:(0,o.JG)((0,a.zK)(e)),variables:n})}function h(e,t,i,s){if(t===i)return!0;var a=new Set;return e.selections.every(function(e){if(a.has(e))return!0;if(a.add(e),!(0,n.MS)(e,s.variables))return!0;if(d(e))return!0;if((0,l.dt)(e)){var c=(0,l.ue)(e),u=t&&t[c],p=i&&i[c],g=e.selectionSet;if(!g)return(0,r.A)(u,p);var m=Array.isArray(u),f=Array.isArray(p);if(m!==f)return!1;if(m&&f){var y=u.length;if(p.length!==y)return!1;for(var v=0;v<y;++v)if(!h(g,u[v],p[v],s))return!1;return!0}return h(g,u,p,s)}var C=(0,o.HQ)(e,s.fragmentMap);return C?!!d(C)||h(C.selectionSet,t,i,s):void 0})}function d(e){return!!e.directives&&e.directives.some(u)}function u(e){return"nonreactive"===e.name.value}},16266(e,t,i){"use strict";i.r(t),i.d(t,{ApolloCache:()=>c.k,ApolloClient:()=>r.R,ApolloError:()=>l.K4,ApolloLink:()=>m.C,Cache:()=>s,DocumentTransform:()=>T.c,HttpLink:()=>S.HttpLink,InMemoryCache:()=>h.D,MissingFieldError:()=>d.Z,NetworkStatus:()=>a.pT,Observable:()=>x.c,ObservableQuery:()=>o.U,checkFetcher:()=>S.checkFetcher,concat:()=>C,createHttpLink:()=>S.createHttpLink,createSignalIfSupported:()=>S.createSignalIfSupported,defaultDataIdFromObject:()=>u.or,defaultPrinter:()=>S.defaultPrinter,disableExperimentalFragmentVariables:()=>R.qj,disableFragmentWarnings:()=>R.gi,empty:()=>f,enableExperimentalFragmentVariables:()=>R.VC,execute:()=>b.g,fallbackHttpConfig:()=>S.fallbackHttpConfig,from:()=>y,fromError:()=>M.N,fromPromise:()=>E,gql:()=>R.J1,isApolloError:()=>l.Mn,isNetworkRequestSettled:()=>a.D2,isReference:()=>D.A_,makeReference:()=>D.WU,makeVar:()=>p.UT,mergeOptions:()=>n.l,parseAndCheckHttpResponse:()=>S.parseAndCheckHttpResponse,resetCaches:()=>R.Nh,rewriteURIForGET:()=>S.rewriteURIForGET,selectHttpOptionsAndBody:()=>S.selectHttpOptionsAndBody,selectHttpOptionsAndBodyInternal:()=>S.selectHttpOptionsAndBodyInternal,selectURI:()=>S.selectURI,serializeFetchParameter:()=>S.serializeFetchParameter,setLogVerbosity:()=>I.Q9,split:()=>v,throwServerError:()=>A.A,toPromise:()=>w});var s,r=i(50953),n=i(97460),o=i(78440),a=i(49995),l=i(17303);s||(s={});var c=i(30622),h=i(70415),d=i(79193),u=i(47422),p=i(67566),g=i(131),m=i(3224),f=m.C.empty,y=m.C.from,v=m.C.split,C=m.C.concat,b=i(34109),S=i(42007);function w(e){var t=!1;return new Promise(function(i,s){e.subscribe({next:function(e){t?!1!==globalThis.__DEV__&&g.V1.warn(57):(t=!0,i(e))},error:s})})}var x=i(74140);function E(e){return new x.c(function(t){e.then(function(e){t.next(e),t.complete()}).catch(t.error.bind(t))})}var M=i(47752),A=i(49703),T=i(78917),D=i(99310),I=i(92981),R=i(27477);(0,I.Q9)(!1!==globalThis.__DEV__?"log":"silent")},49995(e,t,i){"use strict";var s;function r(e){return!!e&&e<7}function n(e){return 7===e||8===e}i.d(t,{D2:()=>n,bi:()=>r,pT:()=>s}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(s||(s={}))},17303(e,t,i){"use strict";i.d(t,{K$:()=>n,K4:()=>l,Mn:()=>a,uR:()=>o});var s=i(65959),r=(i(131),i(1164)),n=Symbol();function o(e){return!!e.extensions&&Array.isArray(e.extensions[n])}function a(e){return e.hasOwnProperty("graphQLErrors")}var l=function(e){function t(i){var n,o,a=i.graphQLErrors,l=i.protocolErrors,c=i.clientErrors,h=i.networkError,d=i.errorMessage,u=i.extraInfo,p=e.call(this,d)||this;return p.name="ApolloError",p.graphQLErrors=a||[],p.protocolErrors=l||[],p.clientErrors=c||[],p.networkError=h||null,p.message=d||(n=p,o=(0,s.__spreadArray)((0,s.__spreadArray)((0,s.__spreadArray)([],n.graphQLErrors,!0),n.clientErrors,!0),n.protocolErrors,!0),n.networkError&&o.push(n.networkError),o.map(function(e){return(0,r.U)(e)&&e.message||"Error message not found."}).join("\n")),p.extraInfo=u,p.cause=(0,s.__spreadArray)((0,s.__spreadArray)((0,s.__spreadArray)([h],a||[],!0),l||[],!0),c||[],!0).find(function(e){return!!e})||null,p.__proto__=t.prototype,p}return(0,s.__extends)(t,e),t}(Error)},36712(e,t,i){"use strict";i.r(t),i.d(t,{setContext:()=>o});var s=i(65959),r=i(3224),n=i(74140);function o(e){return new r.C(function(t,i){var r=(0,s.__rest)(t,[]);return new n.c(function(s){var n,o=!1;return Promise.resolve(r).then(function(i){return e(i,t.getContext())}).then(t.setContext).then(function(){o||(n=i(t).subscribe({next:s.next.bind(s),error:s.error.bind(s),complete:s.complete.bind(s)}))}).catch(s.error.bind(s)),function(){o=!0,n&&n.unsubscribe()}})})}},3224(e,t,i){"use strict";i.d(t,{C:()=>d});var s=i(131),r=i(74140),n=i(65959),o=i(47812),a=i(30301);function l(e,t){return t?t(e):r.c.of()}function c(e){return"function"==typeof e?new d(e):e}function h(e){return e.request.length<=1}var d=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return r.c.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(c).reduce(function(e,t){return e.concat(t)})},e.split=function(t,i,s){var n,o=c(i),a=c(s||new e(l));return n=h(o)&&h(a)?new e(function(e){return t(e)?o.request(e)||r.c.of():a.request(e)||r.c.of()}):new e(function(e,i){return t(e)?o.request(e,i)||r.c.of():a.request(e,i)||r.c.of()}),Object.assign(n,{left:o,right:a})},e.execute=function(e,t){return e.request(function(e,t){var i=(0,n.__assign)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){i="function"==typeof e?(0,n.__assign)((0,n.__assign)({},i),e(i)):(0,n.__assign)((0,n.__assign)({},i),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return(0,n.__assign)({},i)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?(0,o.n4)(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];if(t.indexOf(n)<0)throw(0,s.vA)(58,n)}return e}(t))))||r.c.of()},e.concat=function(t,i){var n=c(t);if(h(n))return!1!==globalThis.__DEV__&&s.V1.warn(47,n),n;var o,a=c(i);return o=h(a)?new e(function(e){return n.request(e,function(e){return a.request(e)||r.c.of()})||r.c.of()}):new e(function(e,t){return n.request(e,function(e){return a.request(e,t)||r.c.of()})||r.c.of()}),Object.assign(o,{left:n,right:a})},e.prototype.split=function(t,i,s){return this.concat(e.split(t,i,s||new e(l)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw(0,s.vA)(48)},e.prototype.onError=function(e,t){if(!1!==globalThis.__DEV__&&(0,a.S2)("onError",function(){!1!==globalThis.__DEV__&&s.V1.warn(49)}),t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&s.V1.warn(50),this.onError=e,this},e}()},34109(e,t,i){"use strict";i.d(t,{g:()=>s});var s=i(3224).C.execute},81381(e,t,i){"use strict";i.d(t,{S:()=>a});var s=i(65959),r=i(17303),n=i(74140),o=i(3224);function a(e){return new o.C(function(t,i){return new n.c(function(s){var n,o,a;try{n=i(t).subscribe({next:function(n){n.errors?a=e({graphQLErrors:n.errors,response:n,operation:t,forward:i}):(0,r.uR)(n)&&(a=e({protocolErrors:n.extensions[r.K$],response:n,operation:t,forward:i})),a?o=a.subscribe({next:s.next.bind(s),error:s.error.bind(s),complete:s.complete.bind(s)}):s.next(n)},error:function(r){(a=e({operation:t,networkError:r,graphQLErrors:r&&r.result&&r.result.errors||void 0,forward:i}))?o=a.subscribe({next:s.next.bind(s),error:s.error.bind(s),complete:s.complete.bind(s)}):s.error(r)},complete:function(){a||s.complete.bind(s)()}})}catch(r){e({networkError:r,operation:t,forward:i}),s.error(r)}return function(){n&&n.unsubscribe(),o&&n.unsubscribe()}})})}!function(e){function t(t){var i=e.call(this)||this;return i.link=a(t),i}(0,s.__extends)(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(o.C)},39781(e,t,i){"use strict";i.d(t,{P:()=>o});var s=i(65959),r=i(3224),n=i(48674),o=function(e){function t(t){void 0===t&&(t={});var i=e.call(this,(0,n.$)(t).request)||this;return i.options=t,i}return(0,s.__extends)(t,e),t}(r.C)},75938(e,t,i){"use strict";i.d(t,{S:()=>r});var s=i(131),r=function(e){if(!e&&"undefined"==typeof fetch)throw(0,s.vA)(51)}},48674(e,t,i){"use strict";i.d(t,{$:()=>C});var s=i(65959),r=i(131),n=i(3224),o=i(14270),a=i(74140),l=i(87708),c=i(61555),h=i(80243),d=i(75938),u=i(55662),p=i(76662),g=i(47752),m=i(85517),f=i(83906),y=i(47812),v=(0,r.no)(function(){return fetch}),C=function(e){void 0===e&&(e={});var t=e.uri,i=void 0===t?"/graphql":t,C=e.fetch,b=e.print,S=void 0===b?u.i1:b,w=e.includeExtensions,x=e.preserveHeaderCase,E=e.useGETForQueries,M=e.includeUnusedVariables,A=void 0!==M&&M,T=(0,s.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&(0,d.S)(C||v);var D={http:{includeExtensions:w,preserveHeaderCase:x},options:T.fetchOptions,credentials:T.credentials,headers:T.headers};return new n.C(function(e){var t=(0,c.z)(e,i),n=e.getContext(),d={};if(n.clientAwareness){var b=n.clientAwareness,w=b.name,x=b.version;w&&(d["apollographql-client-name"]=w),x&&(d["apollographql-client-version"]=x)}var M=(0,s.__assign)((0,s.__assign)({},d),n.headers),T={http:n.http,options:n.fetchOptions,credentials:n.credentials,headers:M};if((0,o.d8)(["client"],e.query)){!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&r.V1.warn(52);var I=(0,f.er)(e.query);if(!I)return(0,g.N)(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=I}var R,P,k,L,N,_=(0,u.HY)(e,S,u.R4,D,T),O=_.options,F=_.body;F.variables&&!A&&(F.variables=(R=F.variables,P=e.query,k=(0,s.__assign)({},R),L=new Set(Object.keys(R)),(0,m.YR)(P,{Variable:function(e,t,i){i&&"VariableDefinition"!==i.kind&&L.delete(e.name.value)}}),L.forEach(function(e){delete k[e]}),k)),O.signal||"undefined"==typeof AbortController||(N=new AbortController,O.signal=N.signal);var G,B="OperationDefinition"===(G=(0,y.Vn)(e.query)).kind&&"subscription"===G.operation,V=(0,o.d8)(["defer"],e.query);if(E&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(O.method="GET"),V||B){O.headers=O.headers||{};var H="multipart/mixed;";B&&V&&!1!==globalThis.__DEV__&&r.V1.warn(53),B?H+="boundary=graphql;subscriptionSpec=1.0,application/json":V&&(H+="deferSpec=20220824,application/json"),O.headers.accept=H}if("GET"===O.method){var U=(0,p.E)(t,F),z=U.newURI,W=U.parseError;if(W)return(0,g.N)(W);t=z}else try{O.body=(0,l.Y)(F,"Payload")}catch(W){return(0,g.N)(W)}return new a.c(function(i){var s=C||(0,r.no)(function(){return fetch})||v,n=i.next.bind(i);return s(t,O).then(function(t){var i;e.setContext({response:t});var s=null===(i=t.headers)||void 0===i?void 0:i.get("content-type");return null!==s&&/^multipart\/mixed/i.test(s)?(0,h.tD)(t,n):(0,h.OQ)(e)(t).then(n)}).then(function(){N=void 0,i.complete()}).catch(function(e){N=void 0,(0,h.H4)(e,i)}),function(){N&&N.abort()}})})}},42007(e,t,i){"use strict";i.r(t),i.d(t,{HttpLink:()=>h.P,checkFetcher:()=>o.S,createHttpLink:()=>c.$,createSignalIfSupported:()=>a,defaultPrinter:()=>n.i1,fallbackHttpConfig:()=>n.R4,parseAndCheckHttpResponse:()=>s.OQ,rewriteURIForGET:()=>d.E,selectHttpOptionsAndBody:()=>n.Wz,selectHttpOptionsAndBodyInternal:()=>n.HY,selectURI:()=>l.z,serializeFetchParameter:()=>r.Y}),i(131);var s=i(80243),r=i(87708),n=i(55662),o=i(75938),a=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}},l=i(61555),c=i(48674),h=i(39781),d=i(76662)},80243(e,t,i){"use strict";i.d(t,{H4:()=>g,OQ:()=>m,tD:()=>d});var s=i(65959),r=i(97703);function n(e){var t={next:function(){return e.read()}};return r.uJ&&(t[Symbol.asyncIterator]=function(){return this}),t}function o(e){var t,i,s,o=e;if(e.body&&(o=e.body),s=o,r.uJ&&s[Symbol.asyncIterator])return i=o[Symbol.asyncIterator](),(t={next:function(){return i.next()}})[Symbol.asyncIterator]=function(){return this},t;if(function(e){return!!e.getReader}(o))return n(o.getReader());if(function(e){return!!e.stream}(o))return n(o.stream().getReader());if(function(e){return!!e.arrayBuffer}(o))return function(e){var t=!1,i={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(t,i){e.then(function(e){t({value:e,done:!1})}).catch(i)}))}};return r.uJ&&(i[Symbol.asyncIterator]=function(){return this}),i}(o.arrayBuffer());if(function(e){return!!e.pipe}(o))return function(e){var t=null,i=null,s=!1,n=[],o=[];function a(e){if(!i){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}n.push(e)}}function l(e){i=e,o.slice().forEach(function(t){t[1](e)}),!t||t()}function c(){s=!0,o.slice().forEach(function(e){e[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",l),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",a),e.on("error",l),e.on("end",c),e.on("finish",c),e.on("close",c);var h={next:function(){return new Promise(function(e,t){return i?t(i):n.length?e({value:n.shift(),done:!1}):s?e({value:void 0,done:!0}):void o.push([e,t])})}};return r.uJ&&(h[Symbol.asyncIterator]=function(){return this}),h}(o);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var a=i(49703),l=i(17303),c=i(94537),h=Object.prototype.hasOwnProperty;function d(e,t){return(0,s.__awaiter)(this,void 0,void 0,function(){var i,r,n,a,h,d,g,m,f,y,v,C,b,S,w,x,E,M,A,T,D,I,R,P;return(0,s.__generator)(this,function(k){switch(k.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");i=new TextDecoder("utf-8"),r=null===(P=e.headers)||void 0===P?void 0:P.get("content-type"),n="boundary=",a=(null==r?void 0:r.includes(n))?null==r?void 0:r.substring((null==r?void 0:r.indexOf(n))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",h="\r\n--".concat(a),d="",g=o(e),m=!0,k.label=1;case 1:return m?[4,g.next()]:[3,3];case 2:for(f=k.sent(),y=f.value,v=f.done,C="string"==typeof y?y:i.decode(y),b=d.length-h.length+1,m=!v,S=(d+=C).indexOf(h,b);S>-1;){if(w=void 0,I=[d.slice(0,S),d.slice(S+h.length)],d=I[1],x=(w=I[0]).indexOf("\r\n\r\n"),E=u(w.slice(0,x)),(M=E["content-type"])&&-1===M.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(A=w.slice(x))if(T=p(e,A),Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T||"payload"in T)if((0,c.Nw)(T)){if(D={},"payload"in T){if(1===Object.keys(T).length&&null===T.payload)return[2];D=(0,s.__assign)({},T.payload)}"errors"in T&&(D=(0,s.__assign)((0,s.__assign)({},D),{extensions:(0,s.__assign)((0,s.__assign)({},"extensions"in D?D.extensions:null),(R={},R[l.K$]=T.errors,R))})),t(D)}else t(T);else if(1===Object.keys(T).length&&"hasNext"in T&&!T.hasNext)return[2];S=d.indexOf(h)}return[3,1];case 3:return[2]}})})}function u(e){var t={};return e.split("\n").forEach(function(e){var i=e.indexOf(":");if(i>-1){var s=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();t[s]=r}}),t}function p(e,t){e.status>=300&&(0,a.A)(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(s){var i=s;throw i.name="ServerParseError",i.response=e,i.statusCode=e.status,i.bodyText=t,i}}function g(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function m(e){return function(t){return t.text().then(function(e){return p(t,e)}).then(function(i){return Array.isArray(i)||h.call(i,"data")||h.call(i,"errors")||(0,a.A)(t,i,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName,"'.")),i})}}},76662(e,t,i){"use strict";i.d(t,{E:()=>r});var s=i(87708);function r(e,t){var i=[],r=function(e,t){i.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var n=void 0;try{n=(0,s.Y)(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",n)}if(t.extensions){var o=void 0;try{o=(0,s.Y)(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",l=e,c=e.indexOf("#");-1!==c&&(a=e.substr(c),l=e.substr(0,c));var h=-1===l.indexOf("?")?"?":"&";return{newURI:l+h+i.join("&")+a}}},55662(e,t,i){"use strict";i.d(t,{HY:()=>l,R4:()=>n,Wz:()=>a,i1:()=>o});var s=i(65959),r=i(33137),n={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},o=function(e,t){return t(e)};function a(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];return i.unshift(t),l.apply(void 0,(0,s.__spreadArray)([e,o],i,!1))}function l(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var o={},a={};i.forEach(function(e){o=(0,s.__assign)((0,s.__assign)((0,s.__assign)({},o),e.options),{headers:(0,s.__assign)((0,s.__assign)({},o.headers),e.headers)}),e.credentials&&(o.credentials=e.credentials),a=(0,s.__assign)((0,s.__assign)({},a),e.http)}),o.headers&&(o.headers=function(e,t){if(!t){var i={};return Object.keys(Object(e)).forEach(function(t){i[t.toLowerCase()]=e[t]}),i}var s={};Object.keys(Object(e)).forEach(function(t){s[t.toLowerCase()]={originalName:t,value:e[t]}});var r={};return Object.keys(s).forEach(function(e){r[s[e].originalName]=s[e].value}),r}(o.headers,a.preserveHeaderCase));var l=e.operationName,c=e.extensions,h=e.variables,d=e.query,u={operationName:l,variables:h};return a.includeExtensions&&(u.extensions=c),a.includeQuery&&(u.query=t(d,r.y)),{options:o,body:u}}},61555(e,t,i){"use strict";i.d(t,{z:()=>s});var s=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}},87708(e,t,i){"use strict";i.d(t,{Y:()=>r});var s=i(131),r=function(e,t){var i;try{i=JSON.stringify(e)}catch(e){var r=(0,s.vA)(54,t,e.message);throw r.parseError=e,r}return i}},47752(e,t,i){"use strict";i.d(t,{N:()=>r});var s=i(74140);function r(e){return new s.c(function(t){t.error(e)})}},49703(e,t,i){"use strict";i.d(t,{A:()=>s});var s=function(e,t,i){var s=new Error(i);throw s.name="ServerError",s.response=e,s.statusCode=e.status,s.result=t,s}},94959(e,t,i){"use strict";i.d(t,{S:()=>c});var s=i(49270),r=i(14270),n=i(99310),o=i(12209),a=i(71637),l=i(131);function c(e,t,i){return a.yV.withValue(!0,function(){var s=h(e,t,i,!1);return Object.isFrozen(e)&&(0,o.G)(s),s})}function h(e,t,i,o,a){var c,u=i.knownChanged,p=function(e,t){if(t.has(e))return t.get(e);var i=Array.isArray(e)?[]:Object.create(null);return t.set(e,i),i}(e,i.mutableTargets);if(Array.isArray(e)){for(var g=0,m=Array.from(e.entries());g<m.length;g++){var f=m[g],y=f[0],v=f[1];if(null!==v){var C=h(v,t,i,o,!1!==globalThis.__DEV__?"".concat(a||"","[").concat(y,"]"):void 0);u.has(C)&&u.add(p),p[y]=C}else p[y]=null}return u.has(p)?p:e}for(var b=0,S=t.selections;b<S.length;b++){var w=S[b],x=void 0;if(o&&u.add(p),w.kind===s.b.FIELD){var E=(0,n.ue)(w),M=w.selectionSet;if(void 0===(x=p[E]||e[E]))continue;M&&null!==x&&(C=h(e[E],M,i,o,!1!==globalThis.__DEV__?"".concat(a||"",".").concat(E):void 0),u.has(C)&&(x=C)),!1===globalThis.__DEV__&&(p[E]=x),!1!==globalThis.__DEV__&&(o&&"__typename"!==E&&!(null===(c=Object.getOwnPropertyDescriptor(p,E))||void 0===c?void 0:c.value)?Object.defineProperty(p,E,d(E,x,a||"",i.operationName,i.operationType)):(delete p[E],p[E]=x))}if(w.kind!==s.b.INLINE_FRAGMENT||w.typeCondition&&!i.cache.fragmentMatches(w,e.__typename)||(x=h(e,w.selectionSet,i,o,a)),w.kind===s.b.FRAGMENT_SPREAD){var A=w.name.value,T=i.fragmentMap[A]||(i.fragmentMap[A]=i.cache.lookupFragment(A));(0,l.V1)(T,59,A);var D=(0,r.s7)(w);"mask"!==D&&(x=h(e,T.selectionSet,i,"migrate"===D,a))}u.has(x)&&u.add(p)}return"__typename"in e&&!("__typename"in p)&&(p.__typename=e.__typename),Object.keys(p).length!==Object.keys(e).length&&u.add(p),u.has(p)?p:e}function d(e,t,i,s,r){var n=function(){return a.yV.getValue()||(!1!==globalThis.__DEV__&&l.V1.warn(60,s?"".concat(r," '").concat(s,"'"):"anonymous ".concat(r),"".concat(i,".").concat(e).replace(/^\./,"")),n=function(){return t}),t};return{get:function(){return n()},set:function(e){n=function(){return e}},enumerable:!0,configurable:!0}}},13062(e,t,i){"use strict";i.d(t,{z:()=>h});var s=i(49270),r=i(71637),n=i(131),o=i(45063),a=i(94959),l=i(48555),c=i(47812);function h(e,t,i,h){if(!i.fragmentMatches)return!1!==globalThis.__DEV__&&(0,r.Ki)(),e;var d=t.definitions.filter(function(e){return e.kind===s.b.FRAGMENT_DEFINITION});void 0===h&&((0,n.V1)(1===d.length,61,d.length),h=d[0].name.value);var u=d.find(function(e){return e.name.value===h});return(0,n.V1)(!!u,62,h),null==e||(0,o.A)(e,{})?e:(0,a.S)(e,u.selectionSet,{operationType:"fragment",operationName:u.name.value,fragmentMap:(0,l.JG)((0,c.zK)(t)),cache:i,mutableTargets:new r.jq,knownChanged:new r.xm})}},71637(e,t,i){"use strict";i.d(t,{Ki:()=>h,jq:()=>o,xm:()=>a,yV:()=>l});var s=i(81987),r=i(131),n=i(97703),o=n.et?WeakMap:Map,a=n.En?WeakSet:Set,l=new s.DX,c=!1;function h(){c||(c=!0,!1!==globalThis.__DEV__&&r.V1.warn(64))}},76013(e,t,i){"use strict";i.d(t,{s:()=>a});var s=i(5821),r=i(38640),n=i(66003),o=i(131);function a(e){(0,n.k)("<Mutation />",function(){!1!==globalThis.__DEV__&&o.V1.warn(65)});var t=(0,r.n)(e.mutation,e),i=t[0],s=t[1];return e.children?e.children(i,s):null}a.propTypes={mutation:s.object.isRequired,variables:s.object,optimisticResponse:s.oneOfType([s.object,s.func]),refetchQueries:s.oneOfType([s.arrayOf(s.oneOfType([s.string,s.object])),s.func]),awaitRefetchQueries:s.bool,update:s.func,children:s.func.isRequired,onCompleted:s.func,onError:s.func,fetchPolicy:s.string}},95115(e,t,i){"use strict";i.d(t,{X:()=>l});var s=i(65959),r=i(5821),n=i(10344),o=i(131),a=i(66003);function l(e){(0,a.k)("<Query />",function(){!1!==globalThis.__DEV__&&o.V1.warn(66)});var t=e.children,i=e.query,r=(0,s.__rest)(e,["children","query"]),l=(0,n.IT)(i,r);return l?t(l):null}l.propTypes={client:r.object,children:r.func.isRequired,fetchPolicy:r.string,notifyOnNetworkStatusChange:r.bool,onCompleted:r.func,onError:r.func,pollInterval:r.number,query:r.object.isRequired,variables:r.object,ssr:r.bool,partialRefetch:r.bool,returnPartialData:r.bool}},69177(e,t,i){"use strict";var s;i.d(t,{l:()=>l});var r=i(63780),n=i(97703),o=i(131),a=n.ol?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function l(){(0,o.V1)("createContext"in(s||(s=i.t(r,2))),69);var e=r.createContext[a];return e||(Object.defineProperty(r.createContext,a,{value:e=r.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},40833(e,t,i){"use strict";i.d(t,{X:()=>a});var s=i(65959),r=i(131),n=i(63780),o=i(69177),a=function(e){var t=e.client,i=e.children,a=(0,o.l)(),l=n.useContext(a),c=n.useMemo(function(){return(0,s.__assign)((0,s.__assign)({},l),{client:t||l.client})},[l,t]);return(0,r.V1)(c.client,71),n.createElement(a.Provider,{value:c},i)}},17084(e,t,i){"use strict";i.d(t,{U:()=>S});var s=i(28367),r=i(65959),n=i(63780),o=i(4674),a=i(95115),l=i(131),c=function(){return{}},h=function(){return!1};function d(e){return e.displayName||e.name||"Component"}function u(e,t){for(var i={},s=0,r=e.variables;s<r.length;s++){var n=r[s],o=n.variable,a=n.type;if(o.name&&o.name.value){var l=o.name.value,c=t[l];void 0===c?"NonNullType"!==a.kind&&(i[l]=void 0):i[l]=c}}return i}var p=function(e){function t(t){var i=e.call(this,t)||this;return i.withRef=!1,i.setWrappedInstance=i.setWrappedInstance.bind(i),i}return(0,r.__extends)(t,e),t.prototype.getWrappedInstance=function(){return(0,l.V1)(this.withRef,73),this.wrappedInstance},t.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},t}(n.Component),g=i(92981),m=i(30301),f=i(76013),y=i(5821),v=i(72634),C=i(66003);function b(e){(0,C.k)("<Subscription />",function(){!1!==globalThis.__DEV__&&l.V1.warn(67)});var t=(0,v.R)(e.subscription,e);return e.children&&t?e.children(t):null}function S(e,t){switch(void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,m.S2)("graphql",function(){!1!==globalThis.__DEV__&&l.V1.warn(72)}),(0,m.lz)("parser",function(){return(0,s.K3)(e).type})){case s.KG.Mutation:return(0,m.lz)("withMutation",function(){return function(e,t){void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,m.S2)("withMutation",function(){!1!==globalThis.__DEV__&&l.V1.warn(74)});var i=(0,m.lz)("parser",s.K3,[e]),a=t.options,h=void 0===a?c:a,g=t.alias,y=void 0===g?"Apollo":g,v=h;return"function"!=typeof v&&(v=function(){return h}),function(s){var a="".concat(y,"(").concat(d(s),")"),l=function(o){function l(){return null!==o&&o.apply(this,arguments)||this}return(0,r.__extends)(l,o),l.prototype.render=function(){var o=this.props,a=v(o);return t.withRef&&(this.withRef=!0,o=Object.assign({},o,{ref:this.setWrappedInstance})),!a.variables&&i.variables.length>0&&(a.variables=u(i,o)),n.createElement(f.s,(0,r.__assign)({ignoreResults:!0},a,{mutation:e}),function(e,i){var a,l,c=i.data,h=(0,r.__rest)(i,["data"]),d=Object.assign(h,c||{}),u=t.name||"mutate",p=t.name?"".concat(u,"Result"):"result",g=((a={})[u]=e,a[p]=d,a);if(t.props){var m=((l={})[u]=e,l[p]=d,l.ownProps=o,l);g=t.props(m)}return n.createElement(s,(0,r.__assign)({},o,g))})},l.displayName=a,l.WrappedComponent=s,l}(p);return o(l,s,{})}}(e,t)});case s.KG.Subscription:return(0,m.lz)("withSubscription",function(){return function(e,t){void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,m.S2)("withSubscription",function(){!1!==globalThis.__DEV__&&l.V1.warn(76)});var i=(0,m.lz)("parser",s.K3,[e]),a=t.options,g=void 0===a?c:a,f=t.skip,y=void 0===f?h:f,v=t.alias,C=void 0===v?"Apollo":v,S=t.shouldResubscribe,w=g;"function"!=typeof w&&(w=function(){return g});var x,E=y;return"function"!=typeof E&&(E=function(){return y}),function(s){var a="".concat(C,"(").concat(d(s),")"),l=function(o){function l(e){var t=o.call(this,e)||this;return t.state={resubscribe:!1},t}return(0,r.__extends)(l,o),l.prototype.updateResubscribe=function(e){this.setState({resubscribe:e})},l.prototype.componentDidUpdate=function(e){var t=!(!S||!S(e,this.props));this.state.resubscribe!==t&&this.updateResubscribe(t)},l.prototype.render=function(){var o=this,l=this.props,c=E(l),h=c?Object.create(null):w(l);return!c&&!h.variables&&i.variables.length>0&&(h.variables=u(i,l)),n.createElement(b,(0,r.__assign)({},h,{displayName:a,skip:c,subscription:e,shouldResubscribe:this.state.resubscribe}),function(e){var i,a,h=e.data,d=(0,r.__rest)(e,["data"]);if(t.withRef&&(o.withRef=!0,l=Object.assign({},l,{ref:o.setWrappedInstance})),c)return n.createElement(s,(0,r.__assign)({},l,{}));var u=Object.assign(d,h||{}),p=t.name||"data",g=((i={})[p]=u,i);if(t.props){var m=((a={})[p]=u,a.ownProps=l,a);g=x=t.props(m,x)}return n.createElement(s,(0,r.__assign)({},l,g))})},l.displayName=a,l.WrappedComponent=s,l}(p);return o(l,s,{})}}(e,t)});case s.KG.Query:default:return(0,m.lz)("withQuery",function(){return function(e,t){void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,m.S2)("withQuery",function(){!1!==globalThis.__DEV__&&g.Ay.warn(75)});var i=(0,m.lz)("parser",s.K3,[e]),l=t.options,f=void 0===l?c:l,y=t.skip,v=void 0===y?h:y,C=t.alias,b=void 0===C?"Apollo":C,S=f;"function"!=typeof S&&(S=function(){return f});var w,x=v;return"function"!=typeof x&&(x=function(){return v}),function(s){var l="".concat(b,"(").concat(d(s),")"),c=function(o){function c(){return null!==o&&o.apply(this,arguments)||this}return(0,r.__extends)(c,o),c.prototype.render=function(){var o=this,c=this.props,h=x(c),d=h?Object.create(null):(0,r.__assign)({},S(c));return!h&&!d.variables&&i.variables.length>0&&(d.variables=u(i,c)),n.createElement(a.X,(0,r.__assign)({},d,{displayName:l,skip:h,query:e}),function(e){e.client;var i,a,l=e.data,d=(0,r.__rest)(e,["client","data"]);if(t.withRef&&(o.withRef=!0,c=Object.assign({},c,{ref:o.setWrappedInstance})),h)return n.createElement(s,(0,r.__assign)({},c,{}));var u=Object.assign(d,l||{}),p=t.name||"data",g=((i={})[p]=u,i);if(t.props){var m=((a={})[p]=u,a.ownProps=c,a);g=w=t.props(m,w)}return n.createElement(s,(0,r.__assign)({},c,g))})},c.displayName=l,c.WrappedComponent=s,c}(p);return o(c,s,{})}}(e,t)})}}b.propTypes={subscription:y.object.isRequired,variables:y.object,children:y.func,onSubscriptionData:y.func,onData:y.func,onSubscriptionComplete:y.func,onComplete:y.func,shouldResubscribe:y.oneOfType([y.func,y.bool])}},2374(e,t,i){"use strict";i.d(t,{W:()=>c});var s=i(65959),r=i(131),n=i(63780),o=i(4674),a=i(69177),l=function(e){var t=(0,a.l)();return n.createElement(t.Consumer,null,function(t){return(0,r.V1)(t&&t.client,68),e.children(t.client)})};function c(e,t){void 0===t&&(t={});var i="withApollo(".concat(function(e){return e.displayName||e.name||"Component"}(e),")"),a=function(o){function a(e){var t=o.call(this,e)||this;return t.setWrappedInstance=t.setWrappedInstance.bind(t),t}return(0,s.__extends)(a,o),a.prototype.getWrappedInstance=function(){return(0,r.V1)(t.withRef,77),this.wrappedInstance},a.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},a.prototype.render=function(){var i=this;return n.createElement(l,null,function(r){var o=Object.assign({},i.props,{client:r,ref:t.withRef?i.setWrappedInstance:void 0});return n.createElement(e,(0,s.__assign)({},o))})},a.displayName=i,a.WrappedComponent=e,a}(n.Component);return o(a,e,{})}},99449(e,t,i){"use strict";i.d(t,{E:()=>r});var s=i(63780),r=i(97703).Sw?s.useLayoutEffect:s.useEffect},66003(e,t,i){"use strict";i.d(t,{k:()=>n});var s=i(63780),r=i(30301);function n(e,t){var i=s.useRef(!1);!1!==globalThis.__DEV__&&(i.current||(0,r.S2)(e,t),i.current=!0)}},25302(e,t,i){"use strict";i.d(t,{h:()=>n});var s=i(63780),r=i(131);function n(e,t,i,n){void 0===n&&(n="Please remove this option.");var o=s.useRef(!1);t in e&&!o.current&&(!1!==globalThis.__DEV__&&r.V1.warn(78,i,t,n),o.current=!0)}},62659(e,t,i){"use strict";i.d(t,{m:()=>o});var s=i(131),r=i(63780),n=i(69177);function o(e){var t=r.useContext((0,n.l)()),i=e||t.client;return(0,s.V1)(!!i,79),i}},13542(e,t,i){"use strict";i.d(t,{_:()=>f});var s,r=i(65959),n=i(63780),o=i(97460),a=i(10344),l=i(99449),c=i(25302),h=i(27119),d=i(30301);function u(){}var p=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"],g=["initialFetchPolicy","onCompleted","onError","defaultOptions","partialRefetch","canonizeResults"],m=["query","ssr","client","fetchPolicy","nextFetchPolicy","refetchWritePolicy","errorPolicy","pollInterval","notifyOnNetworkStatusChange","returnPartialData","skipPollAttempt"];function f(e,t){var i;if(!1!==globalThis.__DEV__){var f=t||{};(0,c.h)(f,"canonizeResults","useLazyQuery"),(0,c.h)(f,"variables","useLazyQuery","Pass all `variables` to the returned `execute` function instead."),(0,c.h)(f,"context","useLazyQuery","Pass `context` to the returned `execute` function instead."),(0,c.h)(f,"onCompleted","useLazyQuery","If your `onCompleted` callback sets local state, switch to use derived state using `data` returned from the hook instead. Use `useEffect` to perform side-effects as a result of updates to `data`."),(0,c.h)(f,"onError","useLazyQuery","If your `onError` callback sets local state, switch to use derived state using `data`, `error` or `errors` returned from the hook instead. Use `useEffect` if you need to perform side-effects as a result of updates to `data`, `error` or `errors`."),(0,c.h)(f,"defaultOptions","useLazyQuery","Pass the options directly to the hook instead."),(0,c.h)(f,"initialFetchPolicy","useLazyQuery","Use the `fetchPolicy` option instead."),(0,c.h)(f,"partialRefetch","useLazyQuery")}var y=n.useRef(void 0),v=n.useRef(void 0),C=n.useRef(void 0),b=(0,o.l)(t,y.current||{}),S=null!==(i=null==b?void 0:b.query)&&void 0!==i?i:e;v.current=t,C.current=S;var w=(0,r.__assign)((0,r.__assign)({},b),{skip:!y.current}),x=(0,a.SX)(S,w),E=x.obsQueryFields,M=x.result,A=x.client,T=x.resultData,D=x.observable,I=x.onQueryExecuted,R=D.options.initialFetchPolicy||(0,a.kk)(w.defaultOptions,A.defaultOptions),P=n.useReducer(function(e){return e+1},0)[1],k=n.useMemo(function(){for(var e={},t=function(t){var i=E[t];e[t]=function(){return!1!==globalThis.__DEV__&&"reobserve"===t&&!1!==globalThis.__DEV__&&h.V1.warn(80),y.current||(y.current=Object.create(null),P()),i.apply(this,arguments)}},i=0,s=p;i<s.length;i++)t(s[i]);return e},[P,E]),L=!!y.current,N=n.useMemo(function(){return(0,r.__assign)((0,r.__assign)((0,r.__assign)({},M),k),{called:L})},[M,k,L]),_=(s||(s=n.createContext(null)),n.useCallback(function(){var e=console.error;try{return console.error=u,n.useContext(s),!0}catch(e){return!1}finally{console.error=e}},[])),O=n.useRef(new Set),F=n.useCallback(function(e){if(!1!==globalThis.__DEV__){_()&&!1!==globalThis.__DEV__&&h.V1.warn(81);for(var t=0,i=g;t<i.length;t++){var s=i[t];O.current.has(s)||((0,d.cc)(e||{},s,"useLazyQuery.execute"),O.current.add(s))}for(var n=0,l=m;n<l.length;n++){var c=l[n];O.current.has(c)||((0,d.cc)(e||{},c,"useLazyQuery.execute","Please pass the option to the `useLazyQuery` hook instead."),O.current.add(c))}}y.current=e?(0,r.__assign)((0,r.__assign)({},e),{fetchPolicy:e.fetchPolicy||R}):{fetchPolicy:R};var u=(0,o.l)(v.current,(0,r.__assign)({query:C.current},y.current)),p=function(e,t,i,s,r,n){var o=r.query||s,l=(0,a.Er)(i,o,r,!1)(t),c=t.reobserveAsConcast((0,a.t_)(t,i,r,l));return n(l),new Promise(function(s){var r;c.subscribe({next:function(e){r=e},error:function(){s((0,a.$X)(t.getCurrentResult(),e.previousData,t,i))},complete:function(){s((0,a.$X)(t.maskResult(r),e.previousData,t,i))}})})}(T,D,A,S,(0,r.__assign)((0,r.__assign)({},u),{skip:!1}),I).then(function(e){return Object.assign(e,k)});return p.catch(function(){}),p},[_,A,S,k,R,D,T,I]),G=n.useRef(F);(0,l.E)(function(){G.current=F});var B=n.useCallback(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return G.current.apply(G,e)},[]);return[B,N]}},38640(e,t,i){"use strict";i.d(t,{n:()=>u});var s=i(65959),r=i(63780),n=i(97460),o=i(45063),a=i(28367),l=i(17303),c=i(62659),h=i(99449),d=i(25302);function u(e,t){!1!==globalThis.__DEV__&&(0,d.h)(t||{},"ignoreResults","useMutation","If you don't want to synchronize component state with the mutation, please use the `useApolloClient` hook to get the client instance and call `client.mutate` directly.");var i=(0,c.m)(null==t?void 0:t.client);(0,a.D$)(e,a.KG.Mutation);var u=r.useState({called:!1,loading:!1,client:i}),p=u[0],g=u[1],m=r.useRef({result:p,mutationId:0,isMounted:!0,client:i,mutation:e,options:t});(0,h.E)(function(){Object.assign(m.current,{client:i,options:t,mutation:e})});var f=r.useCallback(function(e){void 0===e&&(e={});var t=m.current,i=t.options,r=t.mutation,a=(0,s.__assign)((0,s.__assign)({},i),{mutation:r}),c=e.client||m.current.client;m.current.result.loading||a.ignoreResults||!m.current.isMounted||g(m.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var h=++m.current.mutationId,d=(0,n.l)(a,e);return c.mutate(d).then(function(t){var i,s,r=t.data,n=t.errors,a=n&&n.length>0?new l.K4({graphQLErrors:n}):void 0,u=e.onError||(null===(i=m.current.options)||void 0===i?void 0:i.onError);if(a&&u&&u(a,d),h===m.current.mutationId&&!d.ignoreResults){var p={called:!0,loading:!1,data:r,error:a,client:c};m.current.isMounted&&!(0,o.L)(m.current.result,p)&&g(m.current.result=p)}var f=e.onCompleted||(null===(s=m.current.options)||void 0===s?void 0:s.onCompleted);return a||null==f||f(t.data,d),t},function(t){var i;if(h===m.current.mutationId&&m.current.isMounted){var s={loading:!1,error:t,data:void 0,called:!0,client:c};(0,o.L)(m.current.result,s)||g(m.current.result=s)}var r=e.onError||(null===(i=m.current.options)||void 0===i?void 0:i.onError);if(r)return r(t,d),{data:void 0,errors:t};throw t})},[]),y=r.useCallback(function(){if(m.current.isMounted){var e={called:!1,loading:!1,client:m.current.client};Object.assign(m.current,{mutationId:0,result:e}),g(e)}},[]);return r.useEffect(function(){var e=m.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[f,(0,s.__assign)({reset:y},p)]}},10344(e,t,i){"use strict";i.d(t,{Er:()=>T,kk:()=>P,t_:()=>D,jy:()=>k,$X:()=>L,IT:()=>E,SX:()=>A});var s=i(65959),r=i(131),n=i(63780),o=i(8590),a=i(45063),l=i(97460),c=i(69177),h=i(17303),d=i(78440),u=i(49995),p=i(28367),g=i(62659),m=i(58173),f=i(79e3),y=i(12209),v=Symbol.for("apollo.hook.wrappers"),C=i(25302),b=i(30301),S=Object.prototype.hasOwnProperty;function w(){}var x=Symbol();function E(e,t){return void 0===t&&(t=Object.create(null)),(i=M,(n=(r=(s=(0,g.m)(t&&t.client).queryManager)&&s[v])&&r.useQuery)?n(i):i)(e,t);var i,s,r,n}function M(e,t){!1!==globalThis.__DEV__&&((0,C.h)(t,"canonizeResults","useQuery"),(0,C.h)(t,"partialRefetch","useQuery"),(0,C.h)(t,"defaultOptions","useQuery","Pass the options directly to the hook instead."),(0,C.h)(t,"onCompleted","useQuery","If your `onCompleted` callback sets local state, switch to use derived state using `data` returned from the hook instead. Use `useEffect` to perform side-effects as a result of updates to `data`."),(0,C.h)(t,"onError","useQuery","If your `onError` callback sets local state, switch to use derived state using `data`, `error` or `errors` returned from the hook instead. Use `useEffect` if you need to perform side-effects as a result of updates to `data`, `error` or `errors`."));var i=A(e,t),r=i.result,o=i.obsQueryFields;return n.useMemo(function(){return(0,s.__assign)((0,s.__assign)({},r),o)},[r,o])}function A(e,t){var i=(0,g.m)(t.client),l=n.useContext((0,c.l)()).renderPromises,h=!!l,m=i.disableNetworkFetches,f=!1!==t.ssr&&!t.skip,y=t.partialRefetch,v=T(i,e,t,h),C=function(e,t,i,r,o){function a(s){var n;return(0,p.D$)(t,p.KG.Query),{client:e,query:t,observable:r&&r.getSSRObservable(o())||d.U.inactiveOnCreation.withValue(!r,function(){return(0,b.lz)("canonizeResults",function(){return e.watchQuery(D(void 0,e,i,o()))})}),resultData:{previousData:null===(n=null==s?void 0:s.resultData.current)||void 0===n?void 0:n.data}}}var l=n.useState(a),c=l[0],h=l[1];function u(e){var t,i;Object.assign(c.observable,((t={})[x]=e,t));var r=c.resultData;h((0,s.__assign)((0,s.__assign)({},c),{query:e.query,resultData:Object.assign(r,{previousData:(null===(i=r.current)||void 0===i?void 0:i.data)||r.previousData,current:void 0})}))}if(e!==c.client||t!==c.query){var g=a(c);return h(g),[g,u]}return[c,u]}(i,e,t,l,v),E=C[0],M=E.observable,A=E.resultData,P=C[1],k=v(M);!function(e,t,i,s,r){var n;t[x]&&!(0,a.L)(t[x],r)&&(t.reobserve(D(t,i,s,r)),e.previousData=(null===(n=e.current)||void 0===n?void 0:n.data)||e.previousData,e.current=void 0),t[x]=r}(A,M,i,t,k);var O=n.useMemo(function(){return function(e){return{refetch:e.refetch.bind(e),reobserve:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&r.V1.warn(84),e.reobserve.apply(e,t)},fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}(M)},[M]);!function(e,t,i){t&&i&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}(M,l,f);var F=function(e,t,i,s,r,l,c,h,d){var p=n.useRef(d);n.useEffect(function(){p.current=d});var g=!h&&!l||!1!==s.ssr||s.skip?s.skip||"standby"===r.fetchPolicy?_:void 0:N,m=e.previousData,f=n.useMemo(function(){return g&&L(g,m,t,i)},[i,t,g,m]);return(0,o.r)(n.useCallback(function(s){if(h)return function(){};var r=function(){var r=e.current,n=t.getCurrentResult();r&&r.loading===n.loading&&r.networkStatus===n.networkStatus&&(0,a.L)(r.data,n.data)||I(n,e,t,i,c,s,p.current)},n=function(l){if(o.current.unsubscribe(),o.current=t.resubscribeAfterError(r,n),!S.call(l,"graphQLErrors"))throw l;var h=e.current;(!h||h&&h.loading||!(0,a.L)(l,h.error))&&I({data:h&&h.data,error:l,loading:!1,networkStatus:u.pT.error},e,t,i,c,s,p.current)},o={current:t.subscribe(r,n)};return function(){setTimeout(function(){return o.current.unsubscribe()})}},[l,h,t,e,c,i]),function(){return f||R(e,t,p.current,c,i)},function(){return f||R(e,t,p.current,c,i)})}(A,M,i,t,k,m,y,h,{onCompleted:t.onCompleted||w,onError:t.onError||w});return{result:F,obsQueryFields:O,observable:M,resultData:A,client:i,onQueryExecuted:P}}function T(e,t,i,r){void 0===i&&(i={});var n=i.skip,o=(i.ssr,i.onCompleted,i.onError,i.defaultOptions),a=(0,s.__rest)(i,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(i){var s=Object.assign(a,{query:t});return!r||"network-only"!==s.fetchPolicy&&"cache-and-network"!==s.fetchPolicy||(s.fetchPolicy="cache-first"),s.variables||(s.variables={}),n?(s.initialFetchPolicy=s.initialFetchPolicy||s.fetchPolicy||P(o,e.defaultOptions),s.fetchPolicy="standby"):s.fetchPolicy||(s.fetchPolicy=(null==i?void 0:i.options.initialFetchPolicy)||P(o,e.defaultOptions)),s}}function D(e,t,i,s){var r=[],n=t.defaultOptions.watchQuery;return n&&r.push(n),i.defaultOptions&&r.push(i.defaultOptions),r.push((0,m.o)(e&&e.options,s)),r.reduce(l.l)}function I(e,t,i,n,o,a,l){var c=t.current;c&&c.data&&(t.previousData=c.data),!e.error&&(0,f.E)(e.errors)&&(e.error=new h.K4({graphQLErrors:e.errors})),t.current=L(function(e,t,i){return!e.partial||!i||e.loading||e.data&&0!==Object.keys(e.data).length||"cache-only"===t.options.fetchPolicy?e:(t.refetch(),(0,s.__assign)((0,s.__assign)({},e),{loading:!0,networkStatus:u.pT.refetch}))}(e,i,o),t.previousData,i,n),a(),function(e,t,i){if(!e.loading){var s=k(e);Promise.resolve().then(function(){s?i.onError(s):e.data&&t!==e.networkStatus&&e.networkStatus===u.pT.ready&&i.onCompleted(e.data)}).catch(function(e){!1!==globalThis.__DEV__&&r.V1.warn(e)})}}(e,null==c?void 0:c.networkStatus,l)}function R(e,t,i,s,r){return e.current||I(t.getCurrentResult(),e,t,r,s,function(){},i),e.current}function P(e,t){var i;return(null==e?void 0:e.fetchPolicy)||(null===(i=null==t?void 0:t.watchQuery)||void 0===i?void 0:i.fetchPolicy)||"cache-first"}function k(e){return(0,f.E)(e.errors)?new h.K4({graphQLErrors:e.errors}):e.error}function L(e,t,i,r){var n=e.data,o=(e.partial,(0,s.__rest)(e,["data","partial"]));return(0,s.__assign)((0,s.__assign)({data:n},o),{client:r,observable:i,variables:i.variables,called:e!==N&&e!==_,previousData:t})}var N=(0,y.G)({loading:!0,data:void 0,error:void 0,networkStatus:u.pT.loading}),_=(0,y.G)({loading:!1,data:void 0,error:void 0,networkStatus:u.pT.ready})},72634(e,t,i){"use strict";i.d(t,{R:()=>g});var s=i(65959),r=i(131),n=i(63780),o=i(45063),a=i(28367),l=i(17303),c=i(74140),h=i(62659),d=i(8590),u=i(10344),p=i(99449);function g(e,t){void 0===t&&(t=Object.create(null));var i=n.useRef(!1),g=(0,h.m)(t.client);(0,a.D$)(e,a.KG.Subscription),i.current||(i.current=!0,t.onSubscriptionData&&!1!==globalThis.__DEV__&&r.V1.warn(t.onData?85:86),t.onSubscriptionComplete&&!1!==globalThis.__DEV__&&r.V1.warn(t.onComplete?87:88));var m,f,y,v=t.skip,C=t.fetchPolicy,b=t.errorPolicy,S=t.shouldResubscribe,w=t.context,x=t.extensions,E=t.ignoreResults,M=(m=function(){return t.variables},f=[t.variables],(y=n.useRef(void 0)).current&&(0,o.L)(y.current.deps,f)||(y.current={value:m(),deps:f}),y.current.value),A=function(){return function(e,t,i,r,n,o,a){var l={query:t,variables:i,fetchPolicy:r,errorPolicy:n,context:o,extensions:a},h=(0,s.__assign)((0,s.__assign)({},l),{client:e,result:{loading:!0,data:void 0,error:void 0,variables:i},setResult:function(e){h.result=e}}),d=null;return Object.assign(new c.c(function(t){d||(d=e.subscribe(l));var i=d.subscribe(t);return function(){return i.unsubscribe()}}),{__:h})}(g,e,M,C,b,w,x)},T=n.useState(t.skip?null:A),D=T[0],I=T[1],R=n.useRef(A);(0,p.E)(function(){R.current=A}),v?D&&I(D=null):D&&(g===D.__.client&&e===D.__.query&&C===D.__.fetchPolicy&&b===D.__.errorPolicy&&(0,o.L)(M,D.__.variables)||!1===("function"==typeof S?!!S(t):S))||I(D=A());var P=n.useRef(t);n.useEffect(function(){P.current=t});var k=!v&&!E,L=n.useMemo(function(){return{loading:k,error:void 0,data:void 0,variables:M}},[k,M]),N=n.useRef(E);(0,p.E)(function(){N.current=E});var _=(0,d.r)(n.useCallback(function(e){if(!D)return function(){};var t=!1,i=D.__.variables,s=D.__.client,r=D.subscribe({next:function(r){var n,o;if(!t){var a={loading:!1,data:r.data,error:(0,u.jy)(r),variables:i};D.__.setResult(a),N.current||e(),a.error?null===(o=(n=P.current).onError)||void 0===o||o.call(n,a.error):P.current.onData?P.current.onData({client:s,data:a}):P.current.onSubscriptionData&&P.current.onSubscriptionData({client:s,subscriptionData:a})}},error:function(s){var r,n;s=s instanceof l.K4?s:new l.K4({protocolErrors:[s]}),t||(D.__.setResult({loading:!1,data:void 0,error:s,variables:i}),N.current||e(),null===(n=(r=P.current).onError)||void 0===n||n.call(r,s))},complete:function(){t||(P.current.onComplete?P.current.onComplete():P.current.onSubscriptionComplete&&P.current.onSubscriptionComplete())}});return function(){t=!0,setTimeout(function(){r.unsubscribe()})}},[D]),function(){return!D||v||E?L:D.__.result},function(){return L}),O=n.useCallback(function(){(0,r.V1)(!P.current.skip,89),I(R.current())},[P,R]);return n.useMemo(function(){return(0,s.__assign)((0,s.__assign)({},_),{restart:O})},[_,O])}},8590(e,t,i){"use strict";var s;i.d(t,{r:()=>l});var r=i(131),n=i(63780),o=i(97703),a=!1,l=(s||(s=i.t(n,2))).useSyncExternalStore||function(e,t,i){var s=t();!1===globalThis.__DEV__||a||s===t()||(a=!0,!1!==globalThis.__DEV__&&r.V1.error(92));var l=n.useState({inst:{value:s,getSnapshot:t}}),h=l[0].inst,d=l[1];return o.JR?n.useLayoutEffect(function(){Object.assign(h,{value:s,getSnapshot:t}),c(h)&&d({inst:h})},[e,s,t]):Object.assign(h,{value:s,getSnapshot:t}),n.useEffect(function(){return c(h)&&d({inst:h}),e(function(){c(h)&&d({inst:h})})},[e]),s};function c(e){var t=e.value,i=e.getSnapshot;try{return t!==i()}catch(e){return!0}}},28367(e,t,i){"use strict";i.d(t,{D$:()=>u,K3:()=>d,KG:()=>s});var s,r,n=i(131),o=i(75859),a=i(19360),l=i(27231),c=i(30301);function h(e){var t;switch(e){case s.Query:t="Query";break;case s.Mutation:t="Mutation";break;case s.Subscription:t="Subscription"}return t}function d(e){(0,c.S2)("parser",function(){!1!==globalThis.__DEV__&&n.V1.warn(94)}),r||(r=new o.A(a.v.parser||1e3));var t,i,l=r.get(e);if(l)return l;(0,n.V1)(!!e&&!!e.kind,95,e);for(var h=[],d=[],u=[],p=[],g=0,m=e.definitions;g<m.length;g++){var f=m[g];if("FragmentDefinition"!==f.kind){if("OperationDefinition"===f.kind)switch(f.operation){case"query":d.push(f);break;case"mutation":u.push(f);break;case"subscription":p.push(f)}}else h.push(f)}(0,n.V1)(!h.length||d.length||u.length||p.length,96),(0,n.V1)(d.length+u.length+p.length<=1,97,e,d.length,p.length,u.length),i=d.length?s.Query:s.Mutation,d.length||u.length||(i=s.Subscription);var y=d.length?d:u.length?u:p;(0,n.V1)(1===y.length,98,e,y.length);var v=y[0];t=v.variableDefinitions||[];var C={name:v.name&&"Name"===v.name.kind?v.name.value:"data",type:i,variables:t};return r.set(e,C),C}function u(e,t){var i=(0,c.lz)("parser",d,[e]),s=h(t),r=h(i.type);(0,n.V1)(i.type===t,99,s,s,r)}!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(s||(s={})),d.resetCache=function(){r=void 0},!1!==globalThis.__DEV__&&(0,l.D_)("parser",function(){return r?r.size:0})},75859(e,t,i){"use strict";i.d(t,{A:()=>a,V:()=>l});var s=i(23336),r=i(78027),n=new WeakSet;function o(e){e.size<=(e.max||-1)||n.has(e)||(n.add(e),setTimeout(function(){e.clean(),n.delete(e)},100))}var a=function(e,t){var i=new r.l(e,t);return i.set=function(e,t){var i=r.l.prototype.set.call(this,e,t);return o(this),i},i},l=function(e,t){var i=new s.C(e,t);return i.set=function(e,t){var i=s.C.prototype.set.call(this,e,t);return o(this),i},i}},27231(e,t,i){"use strict";i.d(t,{D_:()=>o,cM:()=>l,ep:()=>a,tQ:()=>c});var s=i(65959),r=i(19360),n={};function o(e,t){n[e]=t}var a=!1!==globalThis.__DEV__?function(){var e,t,i,o,a;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map(function(e){var t=e[0],i=e[1];return[t,r.v[t]||i]})),sizes:(0,s.__assign)({print:null===(e=n.print)||void 0===e?void 0:e.call(n),parser:null===(t=n.parser)||void 0===t?void 0:t.call(n),canonicalStringify:null===(i=n.canonicalStringify)||void 0===i?void 0:i.call(n),links:m(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:p(this.queryManager.documentTransform)}},null===(a=(o=this.cache).getMemoryInternals)||void 0===a?void 0:a.call(o))}}:void 0,l=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return(0,s.__assign)((0,s.__assign)({},h.apply(this)),{addTypenameDocumentTransform:p(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:d(this.storeReader.executeSelectionSet),executeSubSelectedArray:d(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:d(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:d(null==e?void 0:e.findFragmentSpreads),lookup:d(null==e?void 0:e.lookup),transform:d(null==e?void 0:e.transform)}})}:void 0,c=!1!==globalThis.__DEV__?h:void 0;function h(){return{cache:{fragmentQueryDocuments:d(this.getFragmentDoc)}}}function d(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function u(e){return null!=e}function p(e){return g(e).map(function(e){return{cache:e}})}function g(e){return e?(0,s.__spreadArray)((0,s.__spreadArray)([d(null==e?void 0:e.performWork)],g(null==e?void 0:e.left),!0),g(null==e?void 0:e.right),!0).filter(u):[]}function m(e){var t;return e?(0,s.__spreadArray)((0,s.__spreadArray)([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],m(null==e?void 0:e.left),!0),m(null==e?void 0:e.right),!0).filter(u):[]}},19360(e,t,i){"use strict";i.d(t,{v:()=>o});var s=i(65959),r=i(131),n=Symbol.for("apollo.cacheSize"),o=(0,s.__assign)({},r.Sf[n])},79e3(e,t,i){"use strict";i.d(t,{E:()=>r,c:()=>s});var s=Array.isArray;function r(e){return Array.isArray(e)&&e.length>0}},97703(e,t,i){"use strict";i.d(t,{En:()=>o,JR:()=>d,Sw:()=>c,et:()=>n,ol:()=>a,uJ:()=>l});var s=i(131),r="ReactNative"==(0,s.no)(function(){return navigator.product}),n="function"==typeof WeakMap&&!(r&&!globalThis.HermesInternal),o="function"==typeof WeakSet,a="function"==typeof Symbol&&"function"==typeof Symbol.for,l=a&&Symbol.asyncIterator,c="function"==typeof(0,s.no)(function(){return window.document.createElement}),h=(0,s.no)(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,d=(c||r)&&!h},26497(e,t,i){"use strict";i.d(t,{M:()=>a});var s,r=i(75859),n=i(19360),o=i(27231),a=Object.assign(function(e){return JSON.stringify(e,l)},{reset:function(){s=new r.V(n.v.canonicalStringify||1e3)}});function l(e,t){if(t&&"object"==typeof t){var i=Object.getPrototypeOf(t);if(i===Object.prototype||null===i){var r=Object.keys(t);if(r.every(c))return t;var n=JSON.stringify(r),o=s.get(n);if(!o){r.sort();var a=JSON.stringify(r);o=s.get(a)||r,s.set(n,o),s.set(a,o)}var l=Object.create(i);return o.forEach(function(e){l[e]=t[e]}),l}}return t}function c(e,t,i){return 0===t||i[t-1]<=e}!1!==globalThis.__DEV__&&(0,o.D_)("canonicalStringify",function(){return s.size}),a.reset()},37563(e,t,i){"use strict";i.d(t,{m:()=>r});var s=Object.prototype.toString;function r(e){return n(e)}function n(e,t){switch(s.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var i=e.slice(0);return t.set(e,i),i.forEach(function(e,s){i[s]=n(e,t)}),i;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach(function(i){r[i]=n(e[i],t)}),r;default:return e}}},58173(e,t,i){"use strict";function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Object.create(null);return e.forEach(function(e){e&&Object.keys(e).forEach(function(t){var s=e[t];void 0!==s&&(i[t]=s)})}),i}i.d(t,{o:()=>s})},28931(e,t,i){"use strict";i.d(t,{M:()=>o,t:()=>n});var s=i(79e3),r=i(94537);function n(e){var t=o(e);return(0,s.E)(t)}function o(e){var t=(0,s.E)(e.errors)?e.errors.slice(0):[];return(0,r.ST)(e)&&(0,s.E)(e.incremental)&&e.incremental.forEach(function(e){e.errors&&t.push.apply(t,e.errors)}),t}},94537(e,t,i){"use strict";i.d(t,{EQ:()=>a,Nw:()=>c,ST:()=>o,YX:()=>l,bd:()=>h});var s=i(1164),r=i(79e3),n=i(45902);function o(e){return"incremental"in e}function a(e){return"hasNext"in e&&"data"in e}function l(e){return o(e)||a(e)}function c(e){return(0,s.U)(e)&&"payload"in e}function h(e,t){var i=e,s=new n.ZI;return o(t)&&(0,r.E)(t.incremental)&&t.incremental.forEach(function(e){for(var t=e.data,r=e.path,n=r.length-1;n>=0;--n){var o=r[n],a=isNaN(+o)?{}:[];a[o]=t,t=a}i=s.merge(i,t)}),i}},66566(e,t,i){"use strict";i.d(t,{v:()=>r});var s=new Map;function r(e){var t=s.get(e)||1;return s.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}},12209(e,t,i){"use strict";i.d(t,{G:()=>r});var s=i(1164);function r(e){return!1!==globalThis.__DEV__&&(t=e,(i=new Set([t])).forEach(function(e){(0,s.U)(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach(function(t){(0,s.U)(e[t])&&i.add(e[t])})})),e;var t,i}},45902(e,t,i){"use strict";i.d(t,{D9:()=>o,IM:()=>a,ZI:()=>c});var s=i(65959),r=i(1164),n=Object.prototype.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(e)}function a(e){var t=e[0]||{},i=e.length;if(i>1)for(var s=new c,r=1;r<i;++r)t=s.merge(t,e[r]);return t}var l=function(e,t,i){return this.merge(e[i],t[i])},c=function(){function e(e){void 0===e&&(e=l),this.reconciler=e,this.isObject=r.U,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var i=this,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];return(0,r.U)(t)&&(0,r.U)(e)?(Object.keys(t).forEach(function(r){if(n.call(e,r)){var a=e[r];if(t[r]!==a){var l=i.reconciler.apply(i,(0,s.__spreadArray)([e,t,r],o,!1));l!==a&&((e=i.shallowCopyForMerge(e))[r]=l)}}else(e=i.shallowCopyForMerge(e))[r]=t[r]}),e):t},e.prototype.shallowCopyForMerge=function(e){return(0,r.U)(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):(0,s.__assign)({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}()},97460(e,t,i){"use strict";i.d(t,{l:()=>n});var s=i(65959),r=i(58173);function n(e,t){return(0,r.o)(e,t,t.variables&&{variables:(0,r.o)((0,s.__assign)((0,s.__assign)({},e&&e.variables),t.variables))})}},1164(e,t,i){"use strict";function s(e){return null!==e&&"object"==typeof e}function r(e){return null!==e&&"object"==typeof e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}i.d(t,{Q:()=>r,U:()=>s})},48670(e,t,i){"use strict";i.d(t,{p:()=>r});var s=i(66566);function r(e,t){void 0===t&&(t=0);var i=(0,s.v)("stringifyForDisplay");return JSON.stringify(e,function(e,t){return void 0===t?i:t},t).split(JSON.stringify(i)).join("<undefined>")}},30301(e,t,i){"use strict";i.d(t,{S2:()=>d,cc:()=>h,lz:()=>c});var s=i(65959),r=i(81987),n=i(131),o=Symbol.for("apollo.deprecations"),a=n.Sf,l=new r.DX;function c(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return l.withValue.apply(l,(0,s.__spreadArray)([Array.isArray(e)?e:[e]],t,!1))}function h(e,t,i,s){void 0===s&&(s="Please remove this option."),d(t,function(){t in e&&!1!==globalThis.__DEV__&&n.V1.warn(104,i,t,s)})}function d(e,t){(function(e){return a[o]||(l.getValue()||[]).includes(e)})(e)||t()}},18084(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(86483);const r=(0,s.n)(function(){return globalThis})||(0,s.n)(function(){return window})||(0,s.n)(function(){return self})||(0,s.n)(function(){return globalThis})||(0,s.n)(function(){return s.n.constructor("return this")()})},131(e,t,i){"use strict";i.d(t,{IJ:()=>o,Sf:()=>n.A,V1:()=>s.V1,no:()=>r.n,vA:()=>s.vA});var s=i(27119),r=i(86483),n=i(18084),o=!1!==globalThis.__DEV__},27119(e,t,i){"use strict";i.d(t,{V1:()=>l,vA:()=>c});var s=i(92981),r=i(29527),n=i(18084),o=i(48670);function a(e){return function(t){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if("number"==typeof t){var r=t;(t=u(r))||(t=p(r,i),i=[])}e.apply(void 0,[t].concat(i))}}var l=Object.assign(function(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];e||(0,s.V1)(e,u(t,i)||p(t,i))},{debug:a(s.V1.debug),log:a(s.V1.log),warn:a(s.V1.warn),error:a(s.V1.error)});function c(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return new s.zU(u(e,t)||p(e,t))}var h=Symbol.for("ApolloErrorMessageHandler_"+r.r);function d(e){if("string"==typeof e)return e;try{return(0,o.p)(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function u(e,t){if(void 0===t&&(t=[]),e)return n.A[h]&&n.A[h](e,t.map(d))}function p(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:r.r,message:e,args:t.map(d)})))}},86483(e,t,i){"use strict";function s(e){try{return e()}catch(e){}}i.d(t,{n:()=>s})},78917(e,t,i){"use strict";i.d(t,{c:()=>d});var s=i(69796),r=i(97703),n=i(47812),o=i(131),a=i(78027),l=i(81987),c=i(19360);function h(e){return e}var d=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=r.En?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(h,{cache:!1})},e.split=function(t,i,s){return void 0===s&&(s=e.identity()),Object.assign(new e(function(e){return(t(e)?i:s).transformDocument(e)},{cache:!1}),{left:i,right:s})},e.prototype.resetCache=function(){var t=this;if(this.cached){var i=new s.b(r.et);this.performWork=(0,l.LV)(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var s=t.getCacheKey(e);if(s)return(0,o.V1)(Array.isArray(s),105),i.lookupArray(s)},max:c.v["documentTransform.cache"],cache:a.l})}},e.prototype.performWork=function(e){return(0,n.sw)(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var i=this;return Object.assign(new e(function(e){return t.transformDocument(i.transformDocument(e))},{cache:!1}),{left:this,right:t})},e}()},14270(e,t,i){"use strict";i.d(t,{I5:()=>c,MS:()=>o,d8:()=>h,f2:()=>d,hE:()=>l,s7:()=>p,sx:()=>a,tY:()=>u});var s=i(131),r=i(49270),n=i(85517);function o(e,t){var i=e.directives;return!i||!i.length||u(i).every(function(e){var i=e.directive,r=e.ifArgument,n=!1;return"Variable"===r.value.kind?(n=t&&t[r.value.name.value],(0,s.V1)(void 0!==n,106,i.name.value)):n=r.value.value,"skip"===i.name.value?!n:n})}function a(e){var t=[];return(0,n.YR)(e,{Directive:function(e){t.push(e.name.value)}}),t}var l=function(e,t){return h(e,t,!1)},c=function(e,t){return h(e,t,!0)};function h(e,t,i){var s=new Set(e),r=s.size;return(0,n.YR)(t,{Directive:function(e){if(s.delete(e.name.value)&&(!i||!s.size))return n.sP}}),i?!s.size:s.size<r}function d(e){return e&&h(["client","export"],e,!0)}function u(e){var t=[];return e&&e.length&&e.forEach(function(e){if("skip"===(i=e.name.value)||"include"===i){var i,r=e.arguments,n=e.name.value;(0,s.V1)(r&&1===r.length,107,n);var o=r[0];(0,s.V1)(o.name&&"if"===o.name.value,108,n);var a=o.value;(0,s.V1)(a&&("Variable"===a.kind||"BooleanValue"===a.kind),109,n),t.push({directive:e,ifArgument:o})}}),t}function p(e){var t,i,n=null===(t=e.directives)||void 0===t?void 0:t.find(function(e){return"unmask"===e.name.value});if(!n)return"mask";var o=null===(i=n.arguments)||void 0===i?void 0:i.find(function(e){return"mode"===e.name.value});return!1!==globalThis.__DEV__&&o&&(o.value.kind===r.b.VARIABLE?!1!==globalThis.__DEV__&&s.V1.warn(110):o.value.kind!==r.b.STRING?!1!==globalThis.__DEV__&&s.V1.warn(111):"migrate"!==o.value.value&&!1!==globalThis.__DEV__&&s.V1.warn(112,o.value.value)),o&&"value"in o.value&&"migrate"===o.value.value?"migrate":"unmask"}},48555(e,t,i){"use strict";i.d(t,{HQ:()=>l,JG:()=>a,ct:()=>o,s6:()=>c});var s=i(65959),r=i(131),n=i(85517);function o(e,t){var i=t,n=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw(0,r.vA)(113,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&n.push(e)}),void 0===i&&((0,r.V1)(1===n.length,114,n.length),i=n[0].name.value),(0,s.__assign)((0,s.__assign)({},e),{definitions:(0,s.__spreadArray)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:i}}]}}],e.definitions,!0)})}function a(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function l(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var i=e.name.value;if("function"==typeof t)return t(i);var s=t&&t[i];return(0,r.V1)(s,115,i),s||null;default:return null}}function c(e){var t=!0;return(0,n.YR)(e,{FragmentSpread:function(e){if(!(t=!!e.directives&&e.directives.some(function(e){return"unmask"===e.name.value})))return n.sP}}),t}},47812(e,t,i){"use strict";i.d(t,{AT:()=>c,E4:()=>h,Vn:()=>d,Vu:()=>o,n4:()=>a,sw:()=>n,wY:()=>u,zK:()=>l});var s=i(131),r=i(99310);function n(e){(0,s.V1)(e&&"Document"===e.kind,116);var t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw(0,s.vA)(117,e.kind);return e});return(0,s.V1)(t.length<=1,118,t.length),e}function o(e){return n(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function a(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&!!e.name}).map(function(e){return e.name.value})[0]||null}function l(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function c(e){var t=o(e);return(0,s.V1)(t&&"query"===t.operation,119),t}function h(e){(0,s.V1)("Document"===e.kind,120),(0,s.V1)(e.definitions.length<=1,121);var t=e.definitions[0];return(0,s.V1)("FragmentDefinition"===t.kind,122),t}function d(e){var t;n(e);for(var i=0,r=e.definitions;i<r.length;i++){var o=r[i];if("OperationDefinition"===o.kind){var a=o.operation;if("query"===a||"mutation"===a||"subscription"===a)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw(0,s.vA)(123)}function u(e){var t=Object.create(null),i=e&&e.variableDefinitions;return i&&i.length&&i.forEach(function(e){e.defaultValue&&(0,r.J)(t,e.variable.name,e.defaultValue)}),t}},33137(e,t,i){"use strict";i.d(t,{y:()=>l});var s,r=i(74831),n=i(75859),o=i(19360),a=i(27231),l=Object.assign(function(e){var t=s.get(e);return t||(t=(0,r.y)(e),s.set(e,t)),t},{reset:function(){s=new n.A(o.v.print||2e3)}});l.reset(),!1!==globalThis.__DEV__&&(0,a.D_)("print",function(){return s?s.size:0})},99310(e,t,i){"use strict";i.d(t,{A_:()=>l,D$:()=>y,Ii:()=>d,J:()=>h,Kc:()=>c,MB:()=>m,WU:()=>a,dt:()=>v,kd:()=>C,o5:()=>g,ue:()=>f});var s=i(131),r=i(1164),n=i(48555),o=i(26497);function a(e){return{__ref:String(e)}}function l(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function c(e){return(0,r.U)(e)&&"Document"===e.kind&&Array.isArray(e.definitions)}function h(e,t,i,r){if(function(e){return"IntValue"===e.kind}(i)||function(e){return"FloatValue"===e.kind}(i))e[t.value]=Number(i.value);else if(function(e){return"BooleanValue"===e.kind}(i)||function(e){return"StringValue"===e.kind}(i))e[t.value]=i.value;else if(function(e){return"ObjectValue"===e.kind}(i)){var n={};i.fields.map(function(e){return h(n,e.name,e.value,r)}),e[t.value]=n}else if(function(e){return"Variable"===e.kind}(i)){var o=(r||{})[i.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(i))e[t.value]=i.values.map(function(e){var i={};return h(i,t,e,r),i[t.value]});else if(function(e){return"EnumValue"===e.kind}(i))e[t.value]=i.value;else{if(!function(e){return"NullValue"===e.kind}(i))throw(0,s.vA)(124,t.value,i.kind);e[t.value]=null}}function d(e,t){var i=null;e.directives&&(i={},e.directives.forEach(function(e){i[e.name.value]={},e.arguments&&e.arguments.forEach(function(s){var r=s.name,n=s.value;return h(i[e.name.value],r,n,t)})}));var s=null;return e.arguments&&e.arguments.length&&(s={},e.arguments.forEach(function(e){var i=e.name,r=e.value;return h(s,i,r,t)})),g(e.name.value,s,i)}var u=["connection","include","skip","client","rest","export","nonreactive"],p=o.M,g=Object.assign(function(e,t,i){if(t&&i&&i.connection&&i.connection.key){if(i.connection.filter&&i.connection.filter.length>0){var s=i.connection.filter?i.connection.filter:[];s.sort();var r={};return s.forEach(function(e){r[e]=t[e]}),"".concat(i.connection.key,"(").concat(p(r),")")}return i.connection.key}var n=e;if(t){var o=p(t);n+="(".concat(o,")")}return i&&Object.keys(i).forEach(function(e){-1===u.indexOf(e)&&(i[e]&&Object.keys(i[e]).length?n+="@".concat(e,"(").concat(p(i[e]),")"):n+="@".concat(e))}),n},{setStringify:function(e){var t=p;return p=e,t}});function m(e,t){if(e.arguments&&e.arguments.length){var i={};return e.arguments.forEach(function(e){var s=e.name,r=e.value;return h(i,s,r,t)}),i}return null}function f(e){return e.alias?e.alias.value:e.name.value}function y(e,t,i){for(var s,r=0,o=t.selections;r<o.length;r++)if(v(c=o[r])){if("__typename"===c.name.value)return e[f(c)]}else s?s.push(c):s=[c];if("string"==typeof e.__typename)return e.__typename;if(s)for(var a=0,l=s;a<l.length;a++){var c=l[a],h=y(e,(0,n.HQ)(c,i).selectionSet,i);if("string"==typeof h)return h}}function v(e){return"Field"===e.kind}function C(e){return"InlineFragment"===e.kind}},83906(e,t,i){"use strict";i.d(t,{TC:()=>b,XY:()=>f,er:()=>w,hX:()=>v,it:()=>C,iz:()=>m,x3:()=>x,zc:()=>S});var s=i(65959),r=i(131),n=i(49270),o=i(85517),a=i(47812),l=i(99310),c=i(48555),h=i(79e3),d={kind:n.b.FIELD,name:{kind:n.b.NAME,value:"__typename"}};function u(e,t){return!e||e.selectionSet.selections.every(function(e){return e.kind===n.b.FRAGMENT_SPREAD&&u(t[e.name.value],t)})}function p(e){return u((0,a.Vu)(e)||(0,a.E4)(e),(0,c.JG)((0,a.zK)(e)))?null:e}function g(e){var t=new Map;return function(i){void 0===i&&(i=e);var s=t.get(i);return s||t.set(i,s={variables:new Set,fragmentSpreads:new Set}),s}}function m(e,t){(0,a.sw)(t);for(var i=g(""),l=g(""),c=function(e){for(var t=0,s=void 0;t<e.length&&(s=e[t]);++t)if(!(0,h.c)(s)){if(s.kind===n.b.OPERATION_DEFINITION)return i(s.name&&s.name.value);if(s.kind===n.b.FRAGMENT_DEFINITION)return l(s.name.value)}return!1!==globalThis.__DEV__&&r.V1.error(125),null},d=0,u=t.definitions.length-1;u>=0;--u)t.definitions[u].kind===n.b.OPERATION_DEFINITION&&++d;var m,f,y,v=(m=e,f=new Map,y=new Map,m.forEach(function(e){e&&(e.name?f.set(e.name,e):e.test&&y.set(e.test,e))}),function(e){var t=f.get(e.name.value);return!t&&y.size&&y.forEach(function(i,s){s(e)&&(t=i)}),t}),C=function(e){return(0,h.E)(e)&&e.map(v).some(function(e){return e&&e.remove})},b=new Map,S=!1,w={enter:function(e){if(C(e.directives))return S=!0,null}},x=(0,o.YR)(t,{Field:w,InlineFragment:w,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,i,s,r){var n=c(r);n&&n.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,i,s,r){if(C(e.directives))return S=!0,null;var n=c(r);n&&n.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,i,s){b.set(JSON.stringify(s),e)},leave:function(e,t,i,s){return e===b.get(JSON.stringify(s))?e:d>0&&e.selectionSet.selections.every(function(e){return e.kind===n.b.FIELD&&"__typename"===e.name.value})?(l(e.name.value).removed=!0,S=!0,null):void 0}},Directive:{leave:function(e){if(v(e))return S=!0,null}}});if(!S)return t;var E=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){E(l(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})})),e},M=new Set;x.definitions.forEach(function(e){e.kind===n.b.OPERATION_DEFINITION?E(i(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){M.add(e)}):e.kind!==n.b.FRAGMENT_DEFINITION||0!==d||l(e.name.value).removed||M.add(e.name.value)}),M.forEach(function(e){E(l(e)).fragmentSpreads.forEach(function(e){M.add(e)})});var A={enter:function(e){if(t=e.name.value,!M.has(t)||l(t).removed)return null;var t}};return p((0,o.YR)(x,{FragmentSpread:A,FragmentDefinition:A,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=E(i(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return(0,s.__assign)((0,s.__assign)({},e),{variableDefinitions:e.variableDefinitions.filter(function(e){return t.has(e.variable.name.value)})})}}}}))}var f=Object.assign(function(e){return(0,o.YR)(e,{SelectionSet:{enter:function(e,t,i){if(!i||i.kind!==n.b.OPERATION_DEFINITION){var r=e.selections;if(r&&!r.some(function(e){return(0,l.dt)(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var o=i;if(!((0,l.dt)(o)&&o.directives&&o.directives.some(function(e){return"export"===e.name.value})))return(0,s.__assign)((0,s.__assign)({},e),{selections:(0,s.__spreadArray)((0,s.__spreadArray)([],r,!0),[d],!1)})}}}}})},{added:function(e){return e===d}}),y={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some(function(e){return"key"===e.name.value})||!1!==globalThis.__DEV__&&r.V1.warn(126)),t}};function v(e){return m([y],(0,a.sw)(e))}function C(e,t){var i=function(e){return function(t){return e.some(function(e){return t.value&&t.value.kind===n.b.VARIABLE&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return p((0,o.YR)(t,{OperationDefinition:{enter:function(t){return(0,s.__assign)((0,s.__assign)({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})}):[]})}},Field:{enter:function(t){if(e.some(function(e){return e.remove})){var s=0;if(t.arguments&&t.arguments.forEach(function(e){i(e)&&(s+=1)}),1===s)return null}}},Argument:{enter:function(e){if(i(e))return null}}}))}function b(e,t){function i(t){if(e.some(function(e){return e.name===t.name.value}))return null}return p((0,o.YR)(t,{FragmentSpread:{enter:i},FragmentDefinition:{enter:i}}))}function S(e){return"query"===(0,a.Vn)(e).operation?e:(0,o.YR)(e,{OperationDefinition:{enter:function(e){return(0,s.__assign)((0,s.__assign)({},e),{operation:"query"})}}})}function w(e){return(0,a.sw)(e),m([{test:function(e){return"client"===e.name.value},remove:!0}],e)}function x(e){return(0,a.sw)(e),(0,o.YR)(e,{FragmentSpread:function(e){var t;if(!(null===(t=e.directives)||void 0===t?void 0:t.some(function(e){return"unmask"===e.name.value})))return(0,s.__assign)((0,s.__assign)({},e),{directives:(0,s.__spreadArray)((0,s.__spreadArray)([],e.directives||[],!0),[{kind:n.b.DIRECTIVE,name:{kind:n.b.NAME,value:"nonreactive"}}],!1)})}})}},89444(e,t,i){"use strict";i.r(t),i.d(t,{AutoCleanedStrongCache:()=>$.V,AutoCleanedWeakCache:()=>$.A,Concast:()=>k.E,DEV:()=>s.IJ,DeepMerger:()=>f.ZI,DocumentTransform:()=>n.c,Observable:()=>w.c,addNonReactiveToNamedFragments:()=>h.x3,addTypenameToDocument:()=>h.XY,argumentsObjectFromField:()=>c.MB,asyncMap:()=>P.x,buildQueryFromSelectionSet:()=>h.zc,cacheSizes:()=>Y.v,canUseAsyncIteratorSymbol:()=>F.uJ,canUseDOM:()=>F.Sw,canUseLayoutEffect:()=>F.JR,canUseSymbol:()=>F.ol,canUseWeakMap:()=>F.et,canUseWeakSet:()=>F.En,canonicalStringify:()=>z.M,checkDocument:()=>a.sw,cloneDeep:()=>D.m,compact:()=>G.o,concatPagination:()=>y,createFragmentMap:()=>o.JG,createFulfilledPromise:()=>x,createRejectedPromise:()=>E,fixObservableSubclass:()=>L.r,getDefaultValues:()=>a.wY,getDirectiveNames:()=>r.sx,getFragmentDefinition:()=>a.E4,getFragmentDefinitions:()=>a.zK,getFragmentFromSelection:()=>o.HQ,getFragmentMaskMode:()=>r.s7,getFragmentQueryDocument:()=>o.ct,getGraphQLErrorsFromResult:()=>O.M,getInclusionDirectives:()=>r.tY,getMainDefinition:()=>a.Vn,getOperationDefinition:()=>a.Vu,getOperationName:()=>a.n4,getQueryDefinition:()=>a.AT,getStoreKeyName:()=>c.o5,getTypenameFromResult:()=>c.D$,graphQLResultHasError:()=>O.t,hasAllDirectives:()=>r.I5,hasAnyDirectives:()=>r.hE,hasClientExports:()=>r.f2,hasDirectives:()=>r.d8,isApolloPayloadResult:()=>U.Nw,isArray:()=>N.c,isDocumentNode:()=>c.Kc,isExecutionPatchIncrementalResult:()=>U.ST,isExecutionPatchInitialResult:()=>U.EQ,isExecutionPatchResult:()=>U.YX,isField:()=>c.dt,isFullyUnmaskedOperation:()=>o.s6,isInlineFragment:()=>c.kd,isMutationOperation:()=>u,isNonEmptyArray:()=>N.E,isNonNullObject:()=>_.U,isPlainObject:()=>_.Q,isQueryOperation:()=>p,isReference:()=>c.A_,isStatefulPromise:()=>M,isSubscriptionOperation:()=>g,iterateObserversSafely:()=>R.w,makeReference:()=>c.WU,makeUniqueId:()=>B.v,maybe:()=>s.no,maybeDeepFreeze:()=>I.G,mergeDeep:()=>f.D9,mergeDeepArray:()=>f.IM,mergeIncrementalData:()=>U.bd,mergeOptions:()=>H.l,offsetLimitPagination:()=>v,omitDeep:()=>W,preventUnhandledRejection:()=>T.X,print:()=>l.y,relayStylePagination:()=>C,removeArgumentsFromDocument:()=>h.it,removeClientSetsFromDocument:()=>h.er,removeConnectionDirectiveFromDocument:()=>h.hX,removeDirectivesFromDocument:()=>h.iz,removeFragmentSpreadFromDocument:()=>h.TC,resultKeyNameFromField:()=>c.ue,shouldInclude:()=>r.MS,storeKeyNameFromField:()=>c.Ii,stringifyForDisplay:()=>V.p,stripTypename:()=>K,valueToObjectRepresentation:()=>c.J,wrapPromiseWithState:()=>A});var s=i(131),r=i(14270),n=i(78917),o=i(48555),a=i(47812),l=i(33137),c=i(99310),h=i(83906);function d(e,t){var i;return(null===(i=(0,a.Vu)(e))||void 0===i?void 0:i.operation)===t}function u(e){return d(e,"mutation")}function p(e){return d(e,"query")}function g(e){return d(e,"subscription")}var m=i(65959),f=i(45902);function y(e){return void 0===e&&(e=!1),{keyArgs:e,merge:function(e,t){return e?(0,m.__spreadArray)((0,m.__spreadArray)([],e,!0),t,!0):t}}}function v(e){return void 0===e&&(e=!1),{keyArgs:e,merge:function(e,t,i){var s=i.args,r=e?e.slice(0):[];if(t)if(s)for(var n=s.offset,o=void 0===n?0:n,a=0;a<t.length;++a)r[o+a]=t[a];else r.push.apply(r,t);return r}}}function C(e){return void 0===e&&(e=!1),{keyArgs:e,read:function(e,t){var i=t.canRead,s=t.readField;if(!e)return e;var r=[],n="",o="";e.edges.forEach(function(e){i(s("node",e))&&(r.push(e),e.cursor&&(n=n||e.cursor||"",o=e.cursor||o))}),r.length>1&&n===o&&(n="");var a=e.pageInfo||{},l=a.startCursor,c=a.endCursor;return(0,m.__assign)((0,m.__assign)({},b(e)),{edges:r,pageInfo:(0,m.__assign)((0,m.__assign)({},e.pageInfo),{startCursor:l||n,endCursor:c||o})})},merge:function(e,t,i){var s=i.args,r=i.isReference,n=i.readField;if(e||(e={edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}),!t)return e;var o=t.edges?t.edges.map(function(e){return r(e=(0,m.__assign)({},e))&&(e.cursor=n("cursor",e)),e}):[];if(t.pageInfo){var a=t.pageInfo,l=a.startCursor,c=a.endCursor,h=o[0],d=o[o.length-1];h&&l&&(h.cursor=l),d&&c&&(d.cursor=c);var u=h&&h.cursor;u&&!l&&(t=(0,f.D9)(t,{pageInfo:{startCursor:u}}));var p=d&&d.cursor;p&&!c&&(t=(0,f.D9)(t,{pageInfo:{endCursor:p}}))}var g=e.edges,y=[];if(s&&s.after)(v=g.findIndex(function(e){return e.cursor===s.after}))>=0&&(g=g.slice(0,v+1));else if(s&&s.before){var v;y=(v=g.findIndex(function(e){return e.cursor===s.before}))<0?g:g.slice(v),g=[]}else t.edges&&(g=[]);var C=(0,m.__spreadArray)((0,m.__spreadArray)((0,m.__spreadArray)([],g,!0),o,!0),y,!0),S=(0,m.__assign)((0,m.__assign)({},t.pageInfo),e.pageInfo);if(t.pageInfo){var w=t.pageInfo,x=w.hasPreviousPage,E=w.hasNextPage,M=(l=w.startCursor,c=w.endCursor,(0,m.__rest)(w,["hasPreviousPage","hasNextPage","startCursor","endCursor"]));Object.assign(S,M),g.length||(void 0!==x&&(S.hasPreviousPage=x),void 0!==l&&(S.startCursor=l)),y.length||(void 0!==E&&(S.hasNextPage=E),void 0!==c&&(S.endCursor=c))}return(0,m.__assign)((0,m.__assign)((0,m.__assign)({},b(e)),b(t)),{edges:C,pageInfo:S})}}}var b=function(e){return(0,m.__rest)(e,S)},S=["edges","pageInfo"],w=i(74140);function x(e){var t=Promise.resolve(e);return t.status="fulfilled",t.value=e,t}function E(e){var t=Promise.reject(e);return t.catch(function(){}),t.status="rejected",t.reason=e,t}function M(e){return"status"in e}function A(e){if(M(e))return e;var t=e;return t.status="pending",t.then(function(e){if("pending"===t.status){var i=t;i.status="fulfilled",i.value=e}},function(e){if("pending"===t.status){var i=t;i.status="rejected",i.reason=e}}),e}var T=i(90767),D=i(37563),I=i(12209),R=i(20658),P=i(34471),k=i(84382),L=i(24783),N=i(79e3),_=i(1164),O=i(28931),F=i(97703),G=i(58173),B=i(66566),V=i(48670),H=i(97460),U=i(94537),z=i(26497);function W(e,t){return j(e,t)}function j(e,t,i){if(void 0===i&&(i=new Map),i.has(e))return i.get(e);var s=!1;if(Array.isArray(e)){var r=[];if(i.set(e,r),e.forEach(function(e,n){var o=j(e,t,i);s||(s=o!==e),r[n]=o}),s)return r}else if((0,_.Q)(e)){var n=Object.create(Object.getPrototypeOf(e));if(i.set(e,n),Object.keys(e).forEach(function(r){if(r!==t){var o=j(e[r],t,i);s||(s=o!==e[r]),n[r]=o}else s=!0}),s)return n}return e}function K(e){return W(e,"__typename")}var $=i(75859),Y=i(19360)},84382(e,t,i){"use strict";i.d(t,{E:()=>l});var s=i(65959),r=i(74140),n=i(20658),o=i(24783);function a(e){return e&&"function"==typeof e.then}var l=function(e){function t(t){var i=e.call(this,function(e){return i.addObserver(e),function(){return i.removeObserver(e)}})||this;return i.observers=new Set,i.promise=new Promise(function(e,t){i.resolve=e,i.reject=t}),i.handlers={next:function(e){null!==i.sub&&(i.latest=["next",e],i.notify("next",e),(0,n.w)(i.observers,"next",e))},error:function(e){var t=i.sub;null!==t&&(t&&setTimeout(function(){return t.unsubscribe()}),i.sub=null,i.latest=["error",e],i.reject(e),i.notify("error",e),(0,n.w)(i.observers,"error",e))},complete:function(){var e=i,t=e.sub,s=e.sources;if(null!==t){var r=(void 0===s?[]:s).shift();r?a(r)?r.then(function(e){return i.sub=e.subscribe(i.handlers)},i.handlers.error):i.sub=r.subscribe(i.handlers):(t&&setTimeout(function(){return t.unsubscribe()}),i.sub=null,i.latest&&"next"===i.latest[0]?i.resolve(i.latest[1]):i.resolve(),i.notify("complete"),(0,n.w)(i.observers,"complete"))}}},i.nextResultListeners=new Set,i.cancel=function(e){i.reject(e),i.sources=[],i.handlers.error(e)},i.promise.catch(function(e){}),"function"==typeof t&&(t=[new r.c(t)]),a(t)?t.then(function(e){return i.start(e)},i.handlers.error):i.start(t),i}return(0,s.__extends)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],i=e[t];i&&i.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(i){return i(e,t)}))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add(function(i,s){t||(t=!0,e(i,s))})},t}(r.c);(0,o.r)(l)},34471(e,t,i){"use strict";i.d(t,{x:()=>r});var s=i(74140);function r(e,t,i){return new s.c(function(s){var r={then:function(e){return new Promise(function(t){return t(e())})}};function n(e,t){return function(i){if(e){var n=function(){return s.closed?0:e(i)};r=r.then(n,n).then(function(e){return s.next(e)},function(e){return s.error(e)})}else s[t](i)}}var o={next:n(t,"next"),error:n(i,"error"),complete:function(){r.then(function(){return s.complete()})}},a=e.subscribe(o);return function(){return a.unsubscribe()}})}},20658(e,t,i){"use strict";function s(e,t,i){var s=[];e.forEach(function(e){return e[t]&&s.push(e)}),s.forEach(function(e){return e[t](i)})}i.d(t,{w:()=>s})},24783(e,t,i){"use strict";i.d(t,{r:()=>n});var s=i(74140),r=i(97703);function n(e){function t(t){Object.defineProperty(e,t,{value:s.c})}return r.ol&&Symbol.species&&t(Symbol.species),t("@@species"),e}},90767(e,t,i){"use strict";function s(e){return e.catch(function(){}),e}i.d(t,{X:()=>s})},29527(e,t,i){"use strict";i.d(t,{r:()=>s});var s="3.14.0"},45688(e,t,i){"use strict";i.d(t,{vq:()=>mn});var s=i(95177),r=i(14927);const n="AAD",o="OIDC",a="none";var l=i(90865);const c="client_info_decoding_error",h="client_info_empty_error",d="token_parsing_error",u="null_or_empty_token",p="endpoints_resolution_error",g="network_error",m="openid_config_error",f="hash_not_deserialized",y="invalid_state",v="state_mismatch",C="state_not_found",b="nonce_mismatch",S="auth_time_not_found",w="max_age_transpired",x="multiple_matching_tokens",E="multiple_matching_accounts",M="multiple_matching_appMetadata",A="request_cannot_be_made",T="cannot_remove_empty_scope",D="cannot_append_scopeset",I="empty_input_scopeset",R="device_code_polling_cancelled",P="device_code_expired",k="device_code_unknown_error",L="no_account_in_silent_request",N="invalid_cache_record",_="invalid_cache_environment",O="no_account_found",F="no_crypto_object",G="unexpected_credential_type",B="invalid_assertion",V="invalid_client_credential",H="token_refresh_required",U="user_timeout_reached",z="token_claims_cnf_required_for_signedjwt",W="authorization_code_missing_from_server_response",j="binding_key_not_removed",K="end_session_endpoint_not_supported",$="key_id_missing",Y="no_network_connectivity",q="user_canceled",X="missing_tenant_id_error",Z="method_not_implemented",Q="nested_app_auth_bridge_disabled",J={[c]:"The client info could not be parsed/decoded correctly",[h]:"The client info was empty",[d]:"Token cannot be parsed",[u]:"The token is null or empty",[p]:"Endpoints cannot be resolved",[g]:"Network request failed",[m]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[f]:"The hash parameters could not be deserialized",[y]:"State was not the expected format",[v]:"State mismatch error",[C]:"State not found",[b]:"Nonce mismatch error",[S]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[w]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[x]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[E]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[M]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[A]:"Token request cannot be made without authorization code or refresh token.",[T]:"Cannot remove null or empty scope from ScopeSet",[D]:"Cannot append ScopeSet",[I]:"Empty input ScopeSet cannot be processed",[R]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[P]:"Device code is expired.",[k]:"Device code stopped polling for unknown reasons.",[L]:"Please pass an account object, silent flow is not supported without account information",[N]:"Cache record object was null or undefined.",[_]:"Invalid environment when attempting to create cache entry",[O]:"No account found in cache for given key.",[F]:"No crypto object detected.",[G]:"Unexpected credential type.",[B]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[V]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[H]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[U]:"User defined timeout for device code polling reached",[z]:"Cannot generate a POP jwt if the token_claims are not populated",[W]:"Server response does not contain an authorization code to proceed",[j]:"Could not remove the credential's binding key from storage.",[K]:"The provided authority does not support logout",[$]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[Y]:"No network connectivity. Check your internet connection.",[q]:"User cancelled the flow.",[X]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Z]:"This method has not been implemented",[Q]:"The nested app auth bridge is disabled"};class ee extends l.lR{constructor(e,t){super(e,t?`${J[e]}: ${t}`:J[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,ee.prototype)}}function te(e,t){return new ee(e,t)}const ie={createNewGuid:()=>{throw te(Z)},base64Decode:()=>{throw te(Z)},base64Encode:()=>{throw te(Z)},base64UrlEncode:()=>{throw te(Z)},encodeKid:()=>{throw te(Z)},async getPublicKeyThumbprint(){throw te(Z)},async removeTokenBindingKey(){throw te(Z)},async clearKeystore(){throw te(Z)},async signJwt(){throw te(Z)},async hashString(){throw te(Z)}},se="@azure/msal-common",re="14.15.0";function ne(e,t){const i=function(e){if(!e)throw te(u);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw te(d);return t[2]}(e);try{const e=t(i);return JSON.parse(e)}catch(e){throw te(d)}}function oe(e,t){if(0===t||Date.now()-3e5>e+t)throw te(w)}function ae(){return Math.round((new Date).getTime()/1e3)}function le(e,t){const i=Number(e)||0;return ae()+t>i}function ce(e){return[ye(e),ve(e),Ce(e),be(e),Se(e)].join(r.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function he(e,t,i,s,n){return{credentialType:r.aG.ID_TOKEN,homeAccountId:e,environment:t,clientId:s,secret:i,realm:n}}function de(e,t,i,s,n,o,a,l,c,h,d,u,p,g,m){const f={homeAccountId:e,credentialType:r.aG.ACCESS_TOKEN,secret:i,cachedAt:ae().toString(),expiresOn:a.toString(),extendedExpiresOn:l.toString(),environment:t,clientId:s,realm:n,target:o,tokenType:d||r.IO.BEARER};if(u&&(f.userAssertionHash=u),h&&(f.refreshOn=h.toString()),g&&(f.requestedClaims=g,f.requestedClaimsHash=m),f.tokenType?.toLowerCase()!==r.IO.BEARER.toLowerCase())switch(f.credentialType=r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME,f.tokenType){case r.IO.POP:const e=ne(i,c);if(!e?.cnf?.kid)throw te(z);f.keyId=e.cnf.kid;break;case r.IO.SSH:f.keyId=p}return f}function ue(e,t,i,s,n,o,a){const l={credentialType:r.aG.REFRESH_TOKEN,homeAccountId:e,environment:t,clientId:s,secret:i};return o&&(l.userAssertionHash=o),n&&(l.familyId=n),a&&(l.expiresOn=a.toString()),l}function pe(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function ge(e){return!!e&&pe(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===r.aG.ACCESS_TOKEN||e.credentialType===r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME)}function me(e){return!!e&&pe(e)&&e.hasOwnProperty("realm")&&e.credentialType===r.aG.ID_TOKEN}function fe(e){return!!e&&pe(e)&&e.credentialType===r.aG.REFRESH_TOKEN}function ye(e){return[e.homeAccountId,e.environment].join(r.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function ve(e){const t=e.credentialType===r.aG.REFRESH_TOKEN&&e.familyId||e.clientId;return[e.credentialType,t,e.realm||""].join(r.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function Ce(e){return(e.target||"").toLowerCase()}function be(e){return(e.requestedClaimsHash||"").toLowerCase()}function Se(e){return e.tokenType&&e.tokenType.toLowerCase()!==r.IO.BEARER.toLowerCase()?e.tokenType.toLowerCase():""}function we(){return ae()+r.u0.REFRESH_TIME_SECONDS}function xe(e,t,i){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=i,e.jwks_uri=t.jwks_uri}function Ee(e,t,i){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=i}function Me(e){return e.expiresAt<=ae()}const Ae="redirect_uri_empty",Te="claims_request_parsing_error",De="authority_uri_insecure",Ie="url_parse_error",Re="empty_url_error",Pe="empty_input_scopes_error",ke="invalid_prompt_value",Le="invalid_claims",Ne="token_request_empty",_e="logout_request_empty",Oe="invalid_code_challenge_method",Fe="pkce_params_missing",Ge="invalid_cloud_discovery_metadata",Be="invalid_authority_metadata",Ve="untrusted_authority",He="missing_ssh_jwk",Ue="missing_ssh_kid",ze="missing_nonce_authentication_header",We="invalid_authentication_header",je="cannot_set_OIDCOptions",Ke="cannot_allow_native_broker",$e="authority_mismatch",Ye={[Ae]:"A redirect URI is required for all calls, and none has been set.",[Te]:"Could not parse the given claims request object.",[De]:"Authority URIs must use https.  Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Ie]:"URL could not be parsed into appropriate segments.",[Re]:"URL was empty or null.",[Pe]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[ke]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[Le]:"Given claims parameter must be a stringified JSON object.",[Ne]:"Token request was empty and not found in cache.",[_e]:"The logout request was null or undefined.",[Oe]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Fe]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Ge]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Be]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Ve]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[He]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Ue]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[ze]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[We]:"Invalid authentication header provided",[je]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[Ke]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[$e]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class qe extends l.lR{constructor(e){super(e,Ye[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,qe.prototype)}}function Xe(e){return new qe(e)}class Ze{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},i=e.split("&"),s=e=>decodeURIComponent(e.replace(/\+/g," "));return i.forEach(e=>{if(e.trim()){const[i,r]=e.split(/=(.+)/g,2);i&&r&&(t[s(i)]=s(r))}}),t}static trimArrayEntries(e){return e.map(e=>e.trim())}static removeEmptyStringsFromArray(e){return e.filter(e=>!!e)}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}class Qe{constructor(e){const t=e?Ze.trimArrayEntries([...e]):[],i=t?Ze.removeEmptyStringsFromArray(t):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(e=>this.scopes.add(e))}static fromString(e){const t=(e||r.YM.EMPTY_STRING).split(" ");return new Qe(t)}static createSearchScopes(e){const t=new Qe(e);return t.containsOnlyOIDCScopes()?t.removeScope(r.YM.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw Xe(Pe)}containsScope(e){const t=this.printScopesLowerCase().split(" "),i=new Qe(t);return!!e&&i.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&this.scopes.size>=e.scopes.size&&e.asArray().every(e=>this.containsScope(e))}containsOnlyOIDCScopes(){let e=0;return r._A.forEach(t=>{this.containsScope(t)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(e=>this.appendScope(e))}catch(e){throw te(D)}}removeScope(e){if(!e)throw te(T);this.scopes.delete(e.trim())}removeOIDCScopes(){r._A.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw te(I);const t=new Set;return e.scopes.forEach(e=>t.add(e.toLowerCase())),this.scopes.forEach(e=>t.add(e.toLowerCase())),t}intersectingScopeSets(e){if(!e)throw te(I);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),i=e.getScopeCount(),s=this.getScopeCount();return t.size<s+i}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(t=>e.push(t)),e}printScopes(){return this.scopes?this.asArray().join(" "):r.YM.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}function Je(e,t){if(!e)throw te(h);try{const i=t(e);return JSON.parse(i)}catch(e){throw te(c)}}function et(e){if(!e)throw te(c);const t=e.split(r.LR.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?r.YM.EMPTY_STRING:t[1]}}function tt(e,t){return!!e&&!!t&&e===t.split(".")[1]}function it(e,t,i,s){if(s){const{oid:t,sub:i,tid:r,name:n,tfp:o,acr:a}=s,l=r||o||a||"";return{tenantId:l,localAccountId:t||i||"",name:n,isHomeTenant:tt(l,e)}}return{tenantId:i,localAccountId:t,isHomeTenant:tt(i,e)}}function st(e,t,i,s){let r=e;if(t){const{isHomeTenant:i,...s}=t;r={...e,...s}}if(i){const{isHomeTenant:t,...n}=it(e.homeAccountId,e.localAccountId,e.tenantId,i);return r={...r,...n,idTokenClaims:i,idToken:s},r}return r}function rt(e){return e&&(e.tid||e.tfp||e.acr)||null}class nt{generateAccountId(){return[this.homeAccountId,this.environment].join(r.LR.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return nt.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(r.LR.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,i){const s=new nt;let o;1===t.authorityType?s.authorityType=r.Qd.ADFS_ACCOUNT_TYPE:t.protocolMode===n?s.authorityType=r.Qd.MSSTS_ACCOUNT_TYPE:s.authorityType=r.Qd.GENERIC_ACCOUNT_TYPE,e.clientInfo&&i&&(o=Je(e.clientInfo,i)),s.clientInfo=e.clientInfo,s.homeAccountId=e.homeAccountId,s.nativeAccountId=e.nativeAccountId;const a=e.environment||t&&t.getPreferredCache();if(!a)throw te(_);s.environment=a,s.realm=o?.utid||rt(e.idTokenClaims)||"",s.localAccountId=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";const l=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,c=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(s.username=l||c||"",s.name=e.idTokenClaims?.name||"",s.cloudGraphHostName=e.cloudGraphHostName,s.msGraphHost=e.msGraphHost,e.tenantProfiles)s.tenantProfiles=e.tenantProfiles;else{const t=it(e.homeAccountId,s.localAccountId,s.realm,e.idTokenClaims);s.tenantProfiles=[t]}return s}static createFromAccountInfo(e,t,i){const s=new nt;return s.authorityType=e.authorityType||r.Qd.GENERIC_ACCOUNT_TYPE,s.homeAccountId=e.homeAccountId,s.localAccountId=e.localAccountId,s.nativeAccountId=e.nativeAccountId,s.realm=e.tenantId,s.environment=e.environment,s.username=e.username,s.name=e.name,s.cloudGraphHostName=t,s.msGraphHost=i,s.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),s}static generateHomeAccountId(e,t,i,s,r){if(1!==t&&2!==t){if(e)try{const t=Je(e,s.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}i.warning("No client info in response")}return r?.sub||""}static isAccountEntity(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType")}static accountInfoIsEqual(e,t,i){if(!e||!t)return!1;let s=!0;if(i){const i=e.idTokenClaims||{},r=t.idTokenClaims||{};s=i.iat===r.iat&&i.nonce===r.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&s}}function ot(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}function at(e){if(!e||e.indexOf("=")<0)return null;try{const t=ot(e),i=Object.fromEntries(new URLSearchParams(t));if(i.code||i.error||i.error_description||i.state)return i}catch(e){throw te(f)}return null}class lt{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Xe(Re);e.includes("#")||(this._urlString=lt.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Ze.endsWith(t,"?")?t=t.slice(0,-1):Ze.endsWith(t,"?/")&&(t=t.slice(0,-2)),Ze.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw Xe(Ie)}if(!e.HostNameAndPort||!e.PathSegments)throw Xe(Ie);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw Xe(De)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return lt.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),i=t.PathSegments;return!e||0===i.length||i[0]!==r.v2.COMMON&&i[0]!==r.v2.ORGANIZATIONS||(i[0]=e),lt.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Xe(Ie);const i={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let s=i.AbsolutePath.split("/");return s=s.filter(e=>e&&e.length>0),i.PathSegments=s,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(t);if(!i)throw Xe(Ie);return i[2]}static getAbsoluteUrl(e,t){if(e[0]===r.YM.FORWARD_SLASH){const i=new lt(t).getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new lt(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!at(e)}}const ct={"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},ht={tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},dt=new Set;function ut(e,t,i,s){if(s?.trace(`getAliasesFromMetadata called with source: ${i}`),e&&t){const r=pt(t,e);if(r)return s?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${i}, returning aliases`),r.aliases;s?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${i}`)}return null}function pt(e,t){for(let i=0;i<e.length;i++){const s=e[i];if(s.aliases.includes(t))return s}return null}ht.metadata.forEach(e=>{e.aliases.forEach(e=>{dt.add(e)})});const gt="cache_quota_exceeded",mt="cache_error_unknown",ft={[gt]:"Exceeded cache storage capacity.",[mt]:"Unexpected error occurred when using cache storage."};class yt extends Error{constructor(e,t){const i=t||(ft[e]?ft[e]:ft[mt]);super(`${e}: ${i}`),Object.setPrototypeOf(this,yt.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=i}}class vt{constructor(e,t,i,s){this.clientId=e,this.cryptoImpl=t,this.commonLogger=i.clone(se,re),this.staticAuthorityOptions=s}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.sort(e=>e.idTokenClaims?-1:1)[0]:1===t.length?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap(e=>this.getTenantProfilesFromAccountEntity(e,t?.tenantId,t))}getTenantedAccountInfoByFilter(e,t,i,s){let r,n=null;if(s&&!this.tenantProfileMatchesFilter(i,s))return null;const o=this.getIdToken(e,t,i.tenantId);return o&&(r=ne(o.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(r,s))?null:(n=st(e,i,r,o?.secret),n)}getTenantProfilesFromAccountEntity(e,t,i){const s=e.getAccountInfo();let r=s.tenantProfiles||new Map;const n=this.getTokenKeys();if(t){const e=r.get(t);if(!e)return[];r=new Map([[t,e]])}const o=[];return r.forEach(e=>{const t=this.getTenantedAccountInfoByFilter(s,n,e,i);t&&o.push(t)}),o}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId)||t.name&&e.name!==t.name||void 0!==t.isHomeTenant&&e.isHomeTenant!==t.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,i){if(!e)throw te(N);try{e.account&&this.setAccount(e.account),e.idToken&&!1!==t?.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken&&!1!==t?.accessToken&&await this.saveAccessToken(e.accessToken),e.refreshToken&&!1!==t?.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(e){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),e instanceof Error?(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`,i),"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?(this.commonLogger?.error("CacheManager.saveCacheRecord: exceeded storage quota",i),new yt(gt)):new yt(e.name,e.message)):(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`,i),new yt(mt))}}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),s=Qe.fromString(e.target),r=[];i.accessToken.forEach(e=>{if(!this.accessTokenKeyMatchesFilter(e,t,!1))return;const i=this.getAccessTokenCredential(e);i&&this.credentialMatchesFilter(i,t)&&Qe.fromString(i.target).intersectingScopeSets(s)&&r.push(this.removeAccessToken(e))}),await Promise.all(r),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),i=[];return t.forEach(t=>{if(!this.isAccountKey(t,e.homeAccountId))return;const s=this.getAccount(t,this.commonLogger);if(!s)return;if(e.homeAccountId&&!this.matchHomeAccountId(s,e.homeAccountId))return;if(e.username&&!this.matchUsername(s.username,e.username))return;if(e.environment&&!this.matchEnvironment(s,e.environment))return;if(e.realm&&!this.matchRealm(s,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(s,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(s,e.authorityType))return;const r={localAccountId:e?.localAccountId,name:e?.name},n=s.tenantProfiles?.filter(e=>this.tenantProfileMatchesFilter(e,r));n&&0===n.length||i.push(s)}),i}isAccountKey(e,t,i){return!(e.split(r.LR.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(r.LR.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(-1===t.indexOf(r.aG.ID_TOKEN.toLowerCase())&&-1===t.indexOf(r.aG.ACCESS_TOKEN.toLowerCase())&&-1===t.indexOf(r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===t.indexOf(r.aG.REFRESH_TOKEN.toLowerCase()))return!1;if(t.indexOf(r.aG.REFRESH_TOKEN.toLowerCase())>-1){const e=`${r.aG.REFRESH_TOKEN}${r.LR.CACHE_KEY_SEPARATOR}${this.clientId}${r.LR.CACHE_KEY_SEPARATOR}`,i=`${r.aG.REFRESH_TOKEN}${r.LR.CACHE_KEY_SEPARATOR}${r.hB}${r.LR.CACHE_KEY_SEPARATOR}`;if(-1===t.indexOf(e.toLowerCase())&&-1===t.indexOf(i.toLowerCase()))return!1}else if(-1===t.indexOf(this.clientId.toLowerCase()))return!1;return!0}credentialMatchesFilter(e,t){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment))return!1;if(t.realm&&!this.matchRealm(e,t.realm))return!1;if(t.credentialType&&!this.matchCredentialType(e,t.credentialType))return!1;if(t.familyId&&!this.matchFamilyId(e,t.familyId))return!1;if(t.target&&!this.matchTarget(e,t.target))return!1;if((t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash)return!1;if(e.credentialType===r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(t.tokenType&&!this.matchTokenType(e,t.tokenType))return!1;if(t.tokenType===r.IO.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId))return!1}return!0}getAppMetadataFilteredBy(e){const t=this.getKeys(),i={};return t.forEach(t=>{if(!this.isAppMetadata(t))return;const s=this.getAppMetadata(t);s&&(e.environment&&!this.matchEnvironment(s,e.environment)||e.clientId&&!this.matchClientId(s,e.clientId)||(i[t]=s))}),i}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let i=null;return t.forEach(t=>{if(!this.isAuthorityMetadata(t)||-1===t.indexOf(this.clientId))return;const s=this.getAuthorityMetadata(t);s&&-1!==s.aliases.indexOf(e)&&(i=s)}),i}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach(e=>{t.push(this.removeAccount(e))}),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),i=e.generateAccountId(),s=[];t.idToken.forEach(e=>{0===e.indexOf(i)&&this.removeIdToken(e)}),t.accessToken.forEach(e=>{0===e.indexOf(i)&&s.push(this.removeAccessToken(e))}),t.refreshToken.forEach(e=>{0===e.indexOf(i)&&this.removeRefreshToken(e)}),await Promise.all(s)}updateOutdatedCachedAccount(e,t,i){if(t&&t.isSingleTenant()){this.commonLogger?.verbose("updateOutdatedCachedAccount: Found a single-tenant (outdated) account entity in the cache, migrating to multi-tenant account entity");const s=this.getAccountKeys().filter(e=>e.startsWith(t.homeAccountId)),r=[];s.forEach(e=>{const t=this.getCachedAccountEntity(e);t&&r.push(t)});const n=r.find(e=>tt(e.realm,e.homeAccountId))||r[0];n.tenantProfiles=r.map(e=>({tenantId:e.realm,localAccountId:e.localAccountId,name:e.name,isHomeTenant:tt(e.realm,e.homeAccountId)}));const o=vt.toObject(new nt,{...n}),a=o.generateAccountKey();return s.forEach(t=>{t!==a&&this.removeOutdatedAccount(e)}),this.setAccount(o),i?.verbose("Updated an outdated account entity in the cache"),o}return t}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===r.IO.POP){const e=t.keyId;if(e)try{await this.cryptoImpl.removeTokenBindingKey(e)}catch(e){throw te(j)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(e=>{this.isAppMetadata(e)&&this.removeItem(e)}),!0}readAccountFromCache(e){const t=nt.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,i,s,n){this.commonLogger.trace("CacheManager - getIdToken called");const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:r.aG.ID_TOKEN,clientId:this.clientId,realm:i},a=this.getIdTokensByFilter(o,t),l=a.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(l>1){let t=a;if(!i){const i=new Map;a.forEach((t,s)=>{t.realm===e.tenantId&&i.set(s,t)});const s=i.size;if(s<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(1===s)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),i.values().next().value;t=i}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),t.forEach((e,t)=>{this.removeIdToken(t)}),s&&n&&s.addFields({multiMatchedID:a.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,t){const i=t&&t.idToken||this.getTokenKeys().idToken,s=new Map;return i.forEach(t=>{if(!this.idTokenKeyMatchesFilter(t,{clientId:this.clientId,...e}))return;const i=this.getIdTokenCredential(t);i&&this.credentialMatchesFilter(i,e)&&s.set(t,i)}),s}idTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.clientId&&-1===i.indexOf(t.clientId.toLowerCase())||t.homeAccountId&&-1===i.indexOf(t.homeAccountId.toLowerCase()))}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,i,s,n,o){this.commonLogger.trace("CacheManager - getAccessToken called");const a=Qe.createSearchScopes(t.scopes),l=t.authenticationScheme||r.IO.BEARER,c=l&&l.toLowerCase()!==r.IO.BEARER.toLowerCase()?r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME:r.aG.ACCESS_TOKEN,h={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:c,clientId:this.clientId,realm:s||e.tenantId,target:a,tokenType:l,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},d=i&&i.accessToken||this.getTokenKeys().accessToken,u=[];d.forEach(e=>{if(this.accessTokenKeyMatchesFilter(e,h,!0)){const t=this.getAccessTokenCredential(e);t&&this.credentialMatchesFilter(t,h)&&u.push(t)}});const p=u.length;return p<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):p>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),u.forEach(e=>{this.removeAccessToken(ce(e))}),n&&o&&n.addFields({multiMatchedAT:u.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),u[0])}accessTokenKeyMatchesFilter(e,t,i){const s=e.toLowerCase();if(t.clientId&&-1===s.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===s.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===s.indexOf(t.realm.toLowerCase()))return!1;if(t.requestedClaimsHash&&-1===s.indexOf(t.requestedClaimsHash.toLowerCase()))return!1;if(t.target){const e=t.target.asArray();for(let t=0;t<e.length;t++){if(i&&!s.includes(e[t].toLowerCase()))return!1;if(!i&&s.includes(e[t].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),i=[];return t.accessToken.forEach(t=>{if(!this.accessTokenKeyMatchesFilter(t,e,!0))return;const s=this.getAccessTokenCredential(t);s&&this.credentialMatchesFilter(s,e)&&i.push(s)}),i}getRefreshToken(e,t,i,s,n){this.commonLogger.trace("CacheManager - getRefreshToken called");const o=t?r.hB:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:r.aG.REFRESH_TOKEN,clientId:this.clientId,familyId:o},l=i&&i.refreshToken||this.getTokenKeys().refreshToken,c=[];l.forEach(e=>{if(this.refreshTokenKeyMatchesFilter(e,a)){const t=this.getRefreshTokenCredential(e);t&&this.credentialMatchesFilter(t,a)&&c.push(t)}});const h=c.length;return h<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(h>1&&s&&n&&s.addFields({multiMatchedRT:h},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),c[0])}refreshTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.familyId&&-1===i.indexOf(t.familyId.toLowerCase())||!t.familyId&&t.clientId&&-1===i.indexOf(t.clientId.toLowerCase())||t.homeAccountId&&-1===i.indexOf(t.homeAccountId.toLowerCase()))}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(t),s=Object.keys(i).map(e=>i[e]),r=s.length;if(r<1)return null;if(r>1)throw te(M);return s[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!(!t||t.familyId!==r.hB)}matchHomeAccountId(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)}matchLocalAccountIdFromTokenClaims(e,t){return t===(e.oid||e.sub)}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){return!(t.toLowerCase()!==e.name?.toLowerCase())}matchUsername(e,t){return!(!e||"string"!=typeof e||t?.toLowerCase()!==e.toLowerCase())}matchUserAssertionHash(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const i=function(e,t){let i;const s=e.canonicalAuthority;if(s){const n=new lt(s).getUrlComponents().HostNameAndPort;i=ut(n,e.cloudDiscoveryMetadata?.metadata,r.E_.CONFIG,t)||ut(n,ht.metadata,r.E_.HARDCODED_VALUES,t)||e.knownAuthorities}return i||[]}(this.staticAuthorityOptions,this.commonLogger);if(i.includes(t)&&i.includes(e.environment))return!0}const i=this.getAuthorityMetadataByAlias(t);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!(!e.clientId||t!==e.clientId)}matchFamilyId(e,t){return!(!e.familyId||t!==e.familyId)}matchRealm(e,t){return!(e.realm?.toLowerCase()!==t.toLowerCase())}matchNativeAccountId(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||e.preferred_username===t||e.upn===t}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!(!e.authorityType||t.toLowerCase()!==e.authorityType.toLowerCase())}matchTarget(e,t){return!(e.credentialType!==r.aG.ACCESS_TOKEN&&e.credentialType!==r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)&&Qe.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!(!e.tokenType||e.tokenType!==t)}matchKeyId(e,t){return!(!e.keyId||e.keyId!==t)}isAppMetadata(e){return-1!==e.indexOf(r.GU)}isAuthorityMetadata(e){return-1!==e.indexOf(r.u0.CACHE_KEY)}generateAuthorityMetadataCacheKey(e){return`${r.u0.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const i in t)e[i]=t[i];return e}}class Ct extends vt{setAccount(){throw te(Z)}getAccount(){throw te(Z)}getCachedAccountEntity(){throw te(Z)}setIdTokenCredential(){throw te(Z)}getIdTokenCredential(){throw te(Z)}setAccessTokenCredential(){throw te(Z)}getAccessTokenCredential(){throw te(Z)}setRefreshTokenCredential(){throw te(Z)}getRefreshTokenCredential(){throw te(Z)}setAppMetadata(){throw te(Z)}getAppMetadata(){throw te(Z)}setServerTelemetry(){throw te(Z)}getServerTelemetry(){throw te(Z)}setAuthorityMetadata(){throw te(Z)}getAuthorityMetadata(){throw te(Z)}getAuthorityMetadataKeys(){throw te(Z)}setThrottlingCache(){throw te(Z)}getThrottlingCache(){throw te(Z)}removeItem(){throw te(Z)}getKeys(){throw te(Z)}getAccountKeys(){throw te(Z)}getTokenKeys(){throw te(Z)}async clear(){throw te(Z)}updateCredentialCacheKey(){throw te(Z)}removeOutdatedAccount(){throw te(Z)}}const bt={tokenRenewalOffsetSeconds:r.F0,preventCorsPreflight:!1},St={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:s.$.Info,correlationId:r.YM.EMPTY_STRING},wt={claimsBasedCachingEnabled:!1},xt={async sendGetRequestAsync(){throw te(Z)},async sendPostRequestAsync(){throw te(Z)}},Et={sku:r.YM.SKU,version:re,cpu:r.YM.EMPTY_STRING,os:r.YM.EMPTY_STRING},Mt={clientSecret:r.YM.EMPTY_STRING,clientAssertion:void 0},At={azureCloudInstance:a,tenant:`${r.YM.DEFAULT_COMMON_TENANT}`},Tt={application:{appName:"",appVersion:""}};function Dt(e){return e.authOptions.authority.options.protocolMode===o}const It={sendGetRequestAsync:()=>Promise.reject(te(Z)),sendPostRequestAsync:()=>Promise.reject(te(Z))},Rt="acquireTokenByCode",Pt="acquireTokenByRefreshToken",kt="acquireTokenSilent",Lt="acquireTokenSilentAsync",Nt="acquireTokenPopup",_t="acquireTokenRedirect",Ot="cryptoOptsGetPublicKeyThumbprint",Ft="cryptoOptsSignJwt",Gt="silentCacheClientAcquireToken",Bt="silentIframeClientAcquireToken",Vt="silentRefreshClientAcquireToken",Ht="ssoSilent",Ut="standardInteractionClientGetDiscoveredAuthority",zt="fetchAccountIdWithNativeBroker",Wt="nativeInteractionClientAcquireToken",jt="refreshTokenClientExecutePostToTokenEndpoint",Kt="authorizationCodeClientExecutePostToTokenEndpoint",$t="refreshTokenClientExecuteTokenRequest",Yt="refreshTokenClientAcquireToken",qt="refreshTokenClientAcquireTokenWithCachedRefreshToken",Xt="refreshTokenClientAcquireTokenByRefreshToken",Zt="refreshTokenClientCreateTokenRequestBody",Qt="acquireTokenFromCache",Jt="silentFlowClientAcquireCachedToken",ei="silentFlowClientGenerateResultFromCacheRecord",ti="acquireTokenBySilentIframe",ii="initializeBaseRequest",si="initializeSilentRequest",ri="initializeClientApplication",ni="silentIframeClientTokenHelper",oi="silentHandlerInitiateAuthRequest",ai="silentHandlerMonitorIframeForHash",li="silentHandlerLoadFrame",ci="silentHandlerLoadFrameSync",hi="standardInteractionClientCreateAuthCodeClient",di="standardInteractionClientGetClientConfiguration",ui="standardInteractionClientInitializeAuthorizationRequest",pi="standardInteractionClientInitializeAuthorizationCodeRequest",gi="getAuthCodeUrl",mi="handleCodeResponseFromServer",fi="handleCodeResponse",yi="updateTokenEndpointAuthority",vi="authClientAcquireToken",Ci="authClientExecuteTokenRequest",bi="authClientCreateTokenRequestBody",Si="authClientCreateQueryString",wi="popTokenGenerateCnf",xi="popTokenGenerateKid",Ei="handleServerTokenResponse",Mi="deserializeResponse",Ai="authorityFactoryCreateDiscoveredInstance",Ti="authorityResolveEndpointsAsync",Di="authorityGetCloudDiscoveryMetadataFromNetwork",Ii="authorityUpdateCloudDiscoveryMetadata",Ri="authorityGetEndpointMetadataFromNetwork",Pi="authorityUpdateEndpointMetadata",ki="authorityUpdateMetadataWithRegionalInformation",Li="regionDiscoveryDetectRegion",Ni="regionDiscoveryGetRegionFromIMDS",_i="regionDiscoveryGetCurrentVersion",Oi="acquireTokenByCodeAsync",Fi="handleRedirectPromise",Gi="handleNativeRedirectPromise",Bi="nativeMessageHandlerHandshake",Vi="removeHiddenIframe",Hi="clearTokensAndKeysWithClaims",Ui="cacheManagerGetRefreshToken",zi="generatePkceCodes",Wi="generateCodeVerifier",ji="generateCodeChallengeFromVerifier",Ki="sha256Digest",$i="getRandomValues",Yi=(new Map([[Rt,"ATByCode"],[Pt,"ATByRT"],[kt,"ATS"],[Lt,"ATSAsync"],[Nt,"ATPopup"],[_t,"ATRedirect"],[Ot,"CryptoGetPKThumb"],[Ft,"CryptoSignJwt"],[Gt,"SltCacheClientAT"],[Bt,"SltIframeClientAT"],[Vt,"SltRClientAT"],[Ht,"SsoSlt"],[Ut,"StdIntClientGetDiscAuth"],[zt,"FetchAccIdWithNtvBroker"],[Wt,"NtvIntClientAT"],["baseClientCreateTokenRequestHeaders","BaseClientCreateTReqHead"],[jt,"RTClientExecPost"],[Kt,"AuthCodeClientExecPost"],["brokerHandshake","BrokerHandshake"],["acquireTokenByRefreshTokenInBroker","ATByRTInBroker"],["acquireTokenByBroker","ATByBroker"],[$t,"RTClientExecTReq"],[Yt,"RTClientAT"],[qt,"RTClientATWithCachedRT"],[Xt,"RTClientATByRT"],[Zt,"RTClientCreateTReqBody"],[Qt,"ATFromCache"],[Jt,"SltFlowClientATCached"],[ei,"SltFlowClientGenResFromCache"],[ti,"ATBySltIframe"],[ii,"InitBaseReq"],[si,"InitSltReq"],[ri,"InitClientApplication"],[ni,"SIClientTHelper"],[oi,"SHandlerInitAuthReq"],[ai,"SltHandlerMonitorIframeForHash"],[li,"SHandlerLoadFrame"],[ci,"SHandlerLoadFrameSync"],[hi,"StdIntClientCreateAuthCodeClient"],[di,"StdIntClientGetClientConf"],[ui,"StdIntClientInitAuthReq"],[pi,"StdIntClientInitAuthCodeReq"],[gi,"GetAuthCodeUrl"],[mi,"HandleCodeResFromServer"],[fi,"HandleCodeResp"],[yi,"UpdTEndpointAuth"],[vi,"AuthClientAT"],[Ci,"AuthClientExecTReq"],[bi,"AuthClientCreateTReqBody"],[Si,"AuthClientCreateQueryStr"],[wi,"PopTGenCnf"],[xi,"PopTGenKid"],[Ei,"HandleServerTRes"],[Mi,"DeserializeRes"],[Ai,"AuthFactCreateDiscInst"],[Ti,"AuthResolveEndpointsAsync"],["authorityResolveEndpointsFromLocalSources","AuthResolveEndpointsFromLocal"],[Di,"AuthGetCDMetaFromNet"],[Ii,"AuthUpdCDMeta"],[Ri,"AuthUpdCDMetaFromNet"],[Pi,"AuthUpdEndpointMeta"],[ki,"AuthUpdMetaWithRegInfo"],[Li,"RegDiscDetectReg"],[Ni,"RegDiscGetRegFromIMDS"],[_i,"RegDiscGetCurrentVer"],[Oi,"ATByCodeAsync"],["getEndpointMetadataFromNetwork","GetEndpointMetaFromNet"],["getCloudDiscoveryMetadataFromNetworkMeasurement","GetCDMetaFromNet"],[Fi,"HandleRedirectPromise"],[Gi,"HandleNtvRedirectPromise"],["updateCloudDiscoveryMetadataMeasurement","UpdateCDMeta"],["usernamePasswordClientAcquireToken","UserPassClientAT"],[Bi,"NtvMsgHandlerHandshake"],["nativeGenerateAuthResult","NtvGenAuthRes"],[Vi,"RemoveHiddenIframe"],[Hi,"ClearTAndKeysWithClaims"],[Ui,"CacheManagerGetRT"],[zi,"GenPkceCodes"],[Wi,"GenCodeVerifier"],[ji,"GenCodeChallengeFromVerifier"],[Ki,"Sha256Digest"],[$i,"GetRandomValues"]]),1);new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT"]);class qi{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class Xi{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Yi,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new qi}}startPerformanceMeasurement(){return new qi}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}var Zi=i(58090);class Qi{navigateInternal(e,t){return Qi.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Qi.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(e=>{setTimeout(()=>{e(!0)},t.timeout)})}}var Ji=i(75970),es=i(2919);class ts{async sendGetRequestAsync(e,t){let i;try{i=await fetch(e,{method:Zi.CC.GET,headers:this.getFetchHeaders(t)})}catch(e){throw window.navigator.onLine?(0,Ji.bD)(es.Zw):(0,Ji.bD)(es.l7)}try{return{headers:this.getHeaderDict(i.headers),body:await i.json(),status:i.status}}catch(e){throw(0,Ji.bD)(es.db)}}async sendPostRequestAsync(e,t){const i=t&&t.body||r.YM.EMPTY_STRING;let s;try{s=await fetch(e,{method:Zi.CC.POST,headers:this.getFetchHeaders(t),body:i})}catch(e){throw window.navigator.onLine?(0,Ji.bD)(es.zv):(0,Ji.bD)(es.l7)}try{return{headers:this.getHeaderDict(s.headers),body:await s.json(),status:s.status}}catch(e){throw(0,Ji.bD)(es.db)}}getFetchHeaders(e){const t=new Headers;if(!e||!e.headers)return t;const i=e.headers;return Object.keys(i).forEach(e=>{t.append(e,i[e])}),t}getHeaderDict(e){const t={};return e.forEach((e,i)=>{t[i]=e}),t}}const is="3.26.1";class ss{static loggerCallback(e,t){switch(e){case s.$.Error:return void console.error(t);case s.$.Info:return void console.info(t);case s.$.Verbose:return void console.debug(t);case s.$.Warning:return void console.warn(t);default:return void console.log(t)}}constructor(e){let t;this.browserEnvironment="undefined"!=typeof window,this.config=function({auth:e,cache:t,system:i,telemetry:l},c){const h={clientId:r.YM.EMPTY_STRING,authority:`${r.YM.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:r.YM.EMPTY_STRING,authorityMetadata:r.YM.EMPTY_STRING,redirectUri:r.YM.EMPTY_STRING,postLogoutRedirectUri:r.YM.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:n,OIDCOptions:{serverResponseType:r.zL.FRAGMENT,defaultScopes:[r.YM.OPENID_SCOPE,r.YM.PROFILE_SCOPE,r.YM.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:a,tenant:r.YM.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},d={cacheLocation:Zi.Al.SessionStorage,temporaryCacheLocation:Zi.Al.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!(!t||t.cacheLocation!==Zi.Al.LocalStorage),claimsBasedCachingEnabled:!1},u={loggerCallback:()=>{},logLevel:s.$.Info,piiLoggingEnabled:!1},p={...{...bt,loggerOptions:u,networkClient:c?new ts:It,navigationClient:new Qi,loadFrameTimeout:0,windowHashTimeout:i?.loadFrameTimeout||6e4,iframeHashTimeout:i?.loadFrameTimeout||1e4,navigateFrameWait:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:i?.nativeBrokerHandshakeTimeout||2e3,pollIntervalMilliseconds:Zi.Q1.DEFAULT_POLL_INTERVAL_MS},...i,loggerOptions:i?.loggerOptions||u},g={application:{appName:r.YM.EMPTY_STRING,appVersion:r.YM.EMPTY_STRING},client:new Xi};if(e?.protocolMode!==o&&e?.OIDCOptions&&new s.V(p.loggerOptions).warning(JSON.stringify(Xe(je))),e?.protocolMode&&e.protocolMode!==n&&p?.allowNativeBroker)throw Xe(Ke);return{auth:{...h,...e,OIDCOptions:{...h.OIDCOptions,...e?.OIDCOptions}},cache:{...d,...t},system:p,telemetry:{...g,...l}}}(e,this.browserEnvironment);try{t=window[Zi.Al.SessionStorage]}catch(e){}const i=t?.getItem(Zi.L$),l=t?.getItem(Zi.P3)?.toLowerCase(),c="true"===l||"false"!==l&&void 0,h={...this.config.system.loggerOptions},d=i&&Object.keys(s.$).includes(i)?s.$[i]:void 0;d&&(h.loggerCallback=ss.loggerCallback,h.logLevel=d),void 0!==c&&(h.piiLoggingEnabled=c),this.logger=new s.V(h,"@azure/msal-browser",is),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}class rs extends ss{getModuleName(){return rs.MODULE_NAME}getId(){return rs.ID}async initialize(){return this.available="undefined"!=typeof window,this.available}}rs.MODULE_NAME="",rs.ID="StandardOperatingContext";const ns="missing_kid_error",os="missing_alg_error",as={[ns]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[os]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class ls extends l.lR{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,ls.prototype)}}function cs(e){return new ls(e,as[e])}class hs{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw cs(ns);if(!e.alg)throw cs(os);const t=new hs({typ:e.typ||r.Lz.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}function ds(e){return encodeURIComponent(ps(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function us(e){return gs(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ps(e){return gs((new TextEncoder).encode(e))}function gs(e){const t=Array.from(e,e=>String.fromCodePoint(e)).join("");return btoa(t)}function ms(e){return(new TextDecoder).decode(function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw(0,Ji.bD)(es._t)}const i=atob(t);return Uint8Array.from(i,e=>e.codePointAt(0)||0)}(e))}const fs="SHA-256",ys=new Uint8Array([1,0,1]),vs="0123456789abcdef",Cs=new Uint32Array(1),bs={name:"RSASSA-PKCS1-v1_5",hash:fs,modulusLength:2048,publicExponent:ys};async function Ss(e,t,i){t?.addQueueMeasurement(Ki,i);const s=(new TextEncoder).encode(e);return window.crypto.subtle.digest(fs,s)}function ws(e){return window.crypto.getRandomValues(e)}function xs(){return window.crypto.getRandomValues(Cs),Cs[0]}function Es(){const e=Date.now(),t=1024*xs()+(1023&xs()),i=new Uint8Array(16),s=Math.trunc(t/2**30),r=t&2**30-1,n=xs();i[0]=e/2**40,i[1]=e/2**32,i[2]=e/2**24,i[3]=e/65536,i[4]=e/256,i[5]=e,i[6]=112|s>>>8,i[7]=s,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n;let o="";for(let e=0;e<i.length;e++)o+=vs.charAt(i[e]>>>4),o+=vs.charAt(15&i[e]),3!==e&&5!==e&&7!==e&&9!==e||(o+="-");return o}async function Ms(e){return window.crypto.subtle.exportKey(Zi.jb,e)}async function As(e){const t=await Ss(e);return us(new Uint8Array(t))}class Ts{constructor(){this.dbName=Zi.$u,this.version=Zi.G8,this.tableName=Zi.WJ,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const i=window.indexedDB.open(this.dbName,this.version);i.addEventListener("upgradeneeded",e=>{e.target.result.createObjectStore(this.tableName)}),i.addEventListener("success",t=>{const i=t;this.db=i.target.result,this.dbOpen=!0,e()}),i.addEventListener("error",()=>t((0,Ji.bD)(es.MG)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i((0,Ji.bD)(es.rn));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",e=>{const i=e;this.closeConnection(),t(i.target.result)}),s.addEventListener("error",e=>{this.closeConnection(),i(e)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((i,s)=>{if(!this.db)return s((0,Ji.bD)(es.rn));const r=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);r.addEventListener("success",()=>{this.closeConnection(),i()}),r.addEventListener("error",e=>{this.closeConnection(),s(e)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i((0,Ji.bD)(es.rn));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",e=>{this.closeConnection(),i(e)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t((0,Ji.bD)(es.rn));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",t=>{const i=t;this.closeConnection(),e(i.target.result)}),i.addEventListener("error",e=>{this.closeConnection(),t(e)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i((0,Ji.bD)(es.rn));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",e=>{const i=e;this.closeConnection(),t(1===i.target.result)}),s.addEventListener("error",e=>{this.closeConnection(),i(e)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const i=window.indexedDB.deleteDatabase(Zi.$u),s=setTimeout(()=>t(!1),200);i.addEventListener("success",()=>(clearTimeout(s),e(!0))),i.addEventListener("blocked",()=>(clearTimeout(s),e(!0))),i.addEventListener("error",()=>(clearTimeout(s),t(!1)))})}}class Ds{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,i)=>{e.push(i)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}class Is{constructor(e){this.inMemoryCache=new Ds,this.indexedDBCache=new Ts,this.logger=e}handleDatabaseAccessError(e){if(!(e instanceof Ji.jT&&e.errorCode===es.MG))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(e){this.handleDatabaseAccessError(e)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(e){this.handleDatabaseAccessError(e)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(e){this.handleDatabaseAccessError(e)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(0===e.length)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(e){this.handleDatabaseAccessError(e)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(e){this.handleDatabaseAccessError(e)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}class Rs{constructor(e,t){this.logger=e,function(e){if(!("crypto"in window))throw e.error("BrowserCrypto: crypto interface is unavailable"),(0,Ji.bD)(es.rc);e.verbose("BrowserCrypto: modern crypto interface available")}(e),this.cache=new Is(this.logger),this.performanceClient=t}createNewGuid(){return Es()}base64Encode(e){return ps(e)}base64Decode(e){return ms(e)}base64UrlEncode(e){return ds(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const t=this.performanceClient?.startMeasurement(Ot,e.correlationId),i=await async function(e,t){return window.crypto.subtle.generateKey(bs,e,t)}(Rs.EXTRACTABLE,Rs.POP_KEY_USAGES),s=await Ms(i.publicKey),r=Ps({e:s.e,kty:s.kty,n:s.n}),n=await this.hashString(r),o=await Ms(i.privateKey),a=await async function(e){return window.crypto.subtle.importKey(Zi.jb,e,bs,!1,["sign"])}(o);return await this.cache.setItem(n,{privateKey:a,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),n}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,i,s){const r=this.performanceClient?.startMeasurement(Ft,s),n=await this.cache.getItem(t);if(!n)throw(0,Ji.bD)(es.e0);const o=await Ms(n.publicKey),a=Ps(o),l=ds(JSON.stringify({kid:t})),c=ds(hs.getShrHeaderString({...i?.header,alg:o.alg,kid:l}));e.cnf={jwk:JSON.parse(a)};const h=`${c}.${ds(JSON.stringify(e))}`,d=(new TextEncoder).encode(h),u=await async function(e,t){return window.crypto.subtle.sign(bs,e,t)}(n.privateKey,d),p=`${h}.${us(new Uint8Array(u))}`;return r&&r.end({success:!0}),p}async hashString(e){return As(e)}}function Ps(e){return JSON.stringify(e,Object.keys(e).sort())}Rs.POP_KEY_USAGES=["sign","verify"],Rs.EXTRACTABLE=!0;const ks=(e,t,i,s,r)=>(...n)=>{i.trace(`Executing function ${t}`);const o=s?.startMeasurement(t,r);if(r){const e=t+"CallCount";s?.incrementFields({[e]:1},r)}try{const s=e(...n);return o?.end({success:!0}),i.trace(`Returning result from ${t}`),s}catch(e){i.trace(`Error occurred in ${t}`);try{i.trace(JSON.stringify(e))}catch(e){i.trace("Unable to print error message.")}throw o?.end({success:!1},e),e}},Ls=(e,t,i,s,r)=>(...n)=>{i.trace(`Executing function ${t}`);const o=s?.startMeasurement(t,r);if(r){const e=t+"CallCount";s?.incrementFields({[e]:1},r)}return s?.setPreQueueTime(t,r),e(...n).then(e=>(i.trace(`Returning result from ${t}`),o?.end({success:!0}),e)).catch(e=>{i.trace(`Error occurred in ${t}`);try{i.trace(JSON.stringify(e))}catch(e){i.trace("Unable to print error message.")}throw o?.end({success:!1},e),e})};class Ns{constructor(e,t,i,s){this.networkInterface=e,this.logger=t,this.performanceClient=i,this.correlationId=s}async detectRegion(e,t){this.performanceClient?.addQueueMeasurement(Li,this.correlationId);let i=e;if(i)t.region_source=r.jZ.ENVIRONMENT_VARIABLE;else{const e=Ns.IMDS_OPTIONS;try{const s=await Ls(this.getRegionFromIMDS.bind(this),Ni,this.logger,this.performanceClient,this.correlationId)(r.YM.IMDS_VERSION,e);if(s.status===r.Kk.httpSuccess&&(i=s.body,t.region_source=r.jZ.IMDS),s.status===r.Kk.httpBadRequest){const s=await Ls(this.getCurrentVersion.bind(this),_i,this.logger,this.performanceClient,this.correlationId)(e);if(!s)return t.region_source=r.jZ.FAILED_AUTO_DETECTION,null;const n=await Ls(this.getRegionFromIMDS.bind(this),Ni,this.logger,this.performanceClient,this.correlationId)(s,e);n.status===r.Kk.httpSuccess&&(i=n.body,t.region_source=r.jZ.IMDS)}}catch(e){return t.region_source=r.jZ.FAILED_AUTO_DETECTION,null}}return i||(t.region_source=r.jZ.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,t){return this.performanceClient?.addQueueMeasurement(Ni,this.correlationId),this.networkInterface.sendGetRequestAsync(`${r.YM.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,r.YM.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(_i,this.correlationId);try{const t=await this.networkInterface.sendGetRequestAsync(`${r.YM.IMDS_ENDPOINT}?format=json`,e);return t.status===r.Kk.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?t.body["newest-versions"][0]:null}catch(e){return null}}}Ns.IMDS_OPTIONS={headers:{Metadata:"true"}};class _s{constructor(e,t,i,s,r,n,o,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=i,this.authorityOptions=s,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=r,this.performanceClient=o,this.correlationId=n,this.managedIdentity=a||!1,this.regionDiscovery=new Ns(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(r.YM.CIAM_AUTH_URL))return 3;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case r.YM.ADFS:return 1;case r.YM.DSTS:return 2}return 0}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new lt(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw te(p)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw te(p)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw te(p)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw te(K);return this.replacePath(this.metadata.end_session_endpoint)}throw te(p)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw te(p)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw te(p)}canReplaceTenant(e){return 1===e.PathSegments.length&&!_s.reservedTenantDomains.has(e.PathSegments[0])&&0===this.getAuthorityType(e)&&this.protocolMode===n}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const i=new lt(this.metadata.canonical_authority).getUrlComponents(),s=i.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((e,r)=>{let n=s[r];if(0===r&&this.canReplaceTenant(i)){const e=new lt(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];n!==e&&(this.logger.verbose(`Replacing tenant domain name ${n} with id ${e}`),n=e)}e!==n&&(t=t.replace(`/${n}/`,`/${e}/`))}),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||1===this.authorityType||this.protocolMode!==n&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(Ti,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await Ls(this.updateCloudDiscoveryMetadata.bind(this),Ii,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const i=await Ls(this.updateEndpointMetadata.bind(this),Pi,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:i}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:i},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:we(),jwks_uri:""}),e}updateCachedMetadata(e,t,i){t!==r.E_.CACHE&&i?.source!==r.E_.CACHE&&(e.expiresAt=we(),e.canonical_authority=this.canonicalAuthority);const s=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(s,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(Pi,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t)return t.source===r.E_.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata&&(xe(e,await Ls(this.updateMetadataWithRegionalInformation.bind(this),ki,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority),t.source;let i=await Ls(this.getEndpointMetadataFromNetwork.bind(this),Ri,this.logger,this.performanceClient,this.correlationId)();if(i)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(i=await Ls(this.updateMetadataWithRegionalInformation.bind(this),ki,this.logger,this.performanceClient,this.correlationId)(i)),xe(e,i,!0),r.E_.NETWORK;throw te(m,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),xe(e,t,!1),{source:r.E_.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const t=this.getEndpointMetadataFromHardcodedValues();if(t)return xe(e,t,!1),{source:r.E_.HARDCODED_VALUES,metadata:t};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const i=Me(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:r.E_.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new lt(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw Xe(Be)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Ri,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const i=await this.networkInterface.sendGetRequestAsync(t,e),s=function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}(i.body);return s?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(e){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in ct?ct[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(ki,this.correlationId);const t=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(t){if(t!==r.YM.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=r._2.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,_s.replaceWithRegionalInformation(e,t);const i=await Ls(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Li,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(i)return this.regionDiscoveryMetadata.region_outcome=r._2.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=i,_s.replaceWithRegionalInformation(e,i);this.regionDiscoveryMetadata.region_outcome=r._2.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(Ii,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const i=await Ls(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Di,this.logger,this.performanceClient,this.correlationId)();if(i)return Ee(e,i,!0),r.E_.NETWORK;throw Xe(Ve)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata  from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||r.YM.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||r.YM.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||r.YM.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Ee(e,t,!1),r.E_.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const t=(i=this.hostnameAndPort,pt(ht.metadata,i));if(t)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Ee(e,t,!1),r.E_.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}var i;const s=Me(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!s?(this.logger.verbose("Found cloud discovery metadata in the cache."),r.E_.CACHE):(s&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(3===this.authorityType)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),_s.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=pt(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),e)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),e;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Xe(Ge)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),_s.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Di,this.correlationId);const e=`${r.YM.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let i=null;try{const s=await this.networkInterface.sendGetRequestAsync(e,t);let n,o;if(function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(s.body))n=s.body,o=n.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${n.tenant_discovery_endpoint}`);else{if(!function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(s.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${s.status}`),n=s.body,n.error===r.YM.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${n.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${n.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),o=[]}this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=pt(o,this.hostnameAndPort)}catch(e){if(e instanceof l.lR)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\nError: ${e.errorCode}\nError Description: ${e.errorMessage}`);else{const t=e;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: ${t.name}\nError Description: ${t.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=_s.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(e=>e&&lt.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let i;if(t&&t.azureCloudInstance!==a){const e=t.tenant?t.tenant:r.YM.DEFAULT_COMMON_TENANT;i=`${t.azureCloudInstance}/${e}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return r.YM.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw te(p)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return dt.has(e)}static isPublicCloudAuthority(e){return r.YM.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,i){const s=new lt(e);s.validateAsUri();const n=s.getUrlComponents();let o=`${t}.${n.HostNameAndPort}`;this.isPublicCloudAuthority(n.HostNameAndPort)&&(o=`${t}.${r.YM.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=lt.constructAuthorityUriFromObject({...s.getUrlComponents(),HostNameAndPort:o}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,t){const i={...e};return i.authorization_endpoint=_s.buildRegionalAuthorityString(i.authorization_endpoint,t),i.token_endpoint=_s.buildRegionalAuthorityString(i.token_endpoint,t),i.end_session_endpoint&&(i.end_session_endpoint=_s.buildRegionalAuthorityString(i.end_session_endpoint,t)),i}static transformCIAMAuthority(e){let t=e;const i=new lt(e).getUrlComponents();return 0===i.PathSegments.length&&i.HostNameAndPort.endsWith(r.YM.CIAM_AUTH_URL)&&(t=`${t}${i.HostNameAndPort.split(".")[0]}${r.YM.AAD_TENANT_DOMAIN_SUFFIX}`),t}}function Os(e){return e.endsWith(r.YM.FORWARD_SLASH)?e:`${e}${r.YM.FORWARD_SLASH}`}_s.reservedTenantDomains=new Set(["{tenant}","{tenantid}",r.v2.COMMON,r.v2.CONSUMERS,r.v2.ORGANIZATIONS]);const Fs="no_tokens_found",Gs="native_account_unavailable",Bs="refresh_token_expired",Vs="bad_token",Hs=["interaction_required","consent_required","login_required",Vs],Us=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],zs={[Fs]:"No refresh token found in the cache. Please sign-in.",[Gs]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Bs]:"Refresh token has expired.",[Vs]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class Ws extends l.lR{constructor(e,t,i,s,n,o,a,l){super(e,t,i),Object.setPrototypeOf(this,Ws.prototype),this.timestamp=s||r.YM.EMPTY_STRING,this.traceId=n||r.YM.EMPTY_STRING,this.correlationId=o||r.YM.EMPTY_STRING,this.claims=a||r.YM.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=l}}function js(e,t,i){const s=!!e&&Hs.indexOf(e)>-1,r=!!i&&Us.indexOf(i)>-1,n=!!t&&Hs.some(e=>t.indexOf(e)>-1);return s||n||r}function Ks(e){return new Ws(e,zs[e])}class $s{static setRequestState(e,t,i){const s=$s.generateLibraryState(e,i);return t?`${s}${r.YM.RESOURCE_DELIM}${t}`:s}static generateLibraryState(e,t){if(!e)throw te(F);const i={id:e.createNewGuid()};t&&(i.meta=t);const s=JSON.stringify(i);return e.base64Encode(s)}static parseRequestState(e,t){if(!e)throw te(F);if(!t)throw te(y);try{const i=t.split(r.YM.RESOURCE_DELIM),s=i[0],n=i.length>1?i.slice(1).join(r.YM.RESOURCE_DELIM):r.YM.EMPTY_STRING,o=e.base64Decode(s),a=JSON.parse(o);return{userRequestState:n||r.YM.EMPTY_STRING,libraryState:a}}catch(e){throw te(y)}}}const Ys="home_account_id",qs="UPN";var Xs=i(24680),Zs=i(85362);class Qs{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==Zi.Al.LocalStorage&&e!==Zi.Al.SessionStorage||!window[e])throw(0,Xs.jz)(Zs.xz)}getItem(e){return this.windowStorage.getItem(e)}setItem(e,t){this.windowStorage.setItem(e,t)}removeItem(e){this.windowStorage.removeItem(e)}getKeys(){return Object.keys(this.windowStorage)}containsKey(e){return this.windowStorage.hasOwnProperty(e)}}function Js(e,t){if(!t)return null;try{return $s.parseRequestState(e,t).libraryState.meta}catch(e){throw te(y)}}class er extends vt{constructor(e,t,i,s,r,n){super(e,i,s,r),this.COOKIE_LIFE_MULTIPLIER=864e5,this.cacheConfig=t,this.logger=s,this.internalStorage=new Ds,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation,this.cacheConfig.cacheLocation),t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=n}setupBrowserStorage(e){switch(e){case Zi.Al.LocalStorage:case Zi.Al.SessionStorage:try{return new Qs(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=Zi.Al.MemoryStorage,new Ds}setupTemporaryCacheStorage(e,t){switch(t){case Zi.Al.LocalStorage:case Zi.Al.SessionStorage:try{return new Qs(e||Zi.Al.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case Zi.Al.MemoryStorage:default:return this.internalStorage}}migrateCacheEntries(){const e=`${r.YM.CACHE_PREFIX}.${r.Gd.ID_TOKEN}`,t=`${r.YM.CACHE_PREFIX}.${r.Gd.CLIENT_INFO}`,i=`${r.YM.CACHE_PREFIX}.${r.Gd.ERROR}`,s=`${r.YM.CACHE_PREFIX}.${r.Gd.ERROR_DESC}`,n=[this.browserStorage.getItem(e),this.browserStorage.getItem(t),this.browserStorage.getItem(i),this.browserStorage.getItem(s)];[r.Gd.ID_TOKEN,r.Gd.CLIENT_INFO,r.Gd.ERROR,r.Gd.ERROR_DESC].forEach((e,t)=>{const i=n[t];i&&this.setTemporaryCache(e,i,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Zi.dh.ACCOUNT_KEYS),t=this.getItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`);e&&t?this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration."):this.browserStorage.getKeys().forEach(e=>{if(this.isCredentialKey(e)){const t=this.getItem(e);if(t){const i=this.validateAndParseJson(t);if(i&&i.hasOwnProperty("credentialType"))switch(i.credentialType){case r.aG.ID_TOKEN:if(me(i)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${e} found, saving key to token key map`);const t=i,s=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(s,r.aG.ID_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${e}`);break;case r.aG.ACCESS_TOKEN:case r.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(ge(i)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${e} found, saving key to token key map`);const t=i,s=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(s,r.aG.ACCESS_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${e}`);break;case r.aG.REFRESH_TOKEN:if(fe(i)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${e} found, saving key to token key map`);const t=i,s=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(s,r.aG.REFRESH_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${e}`)}}}if(this.isAccountKey(e)){const t=this.getItem(e);if(t){const i=this.validateAndParseJson(t);i&&nt.isAccountEntity(i)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${e} found, saving key to account key map`),this.addAccountKeyToMap(e))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const i=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,i,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const i=this.validateAndParseJson(t);return i&&nt.isAccountEntity(i)?vt.toObject(new nt,i):(this.removeAccountKeyFromMap(e),null)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Zi.dh.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();-1===t.indexOf(e)?(t.push(e),this.setItem(Zi.dh.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),i=t.indexOf(e);i>-1?(t.splice(i,1),this.setItem(Zi.dh.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,r.aG.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,r.aG.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,r.aG.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const i=this.getTokenKeys();switch(t){case r.aG.ID_TOKEN:-1===i.idToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(e));break;case r.aG.ACCESS_TOKEN:-1===i.accessToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(e));break;case r.aG.REFRESH_TOKEN:-1===i.refreshToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),i.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),te(G)}this.setItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const i=this.getTokenKeys();switch(t){case r.aG.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const s=i.idToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),i.idToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case r.aG.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const n=i.accessToken.indexOf(e);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case r.aG.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const o=i.refreshToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),te(G)}this.setItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,r.aG.ID_TOKEN),null;const i=this.validateAndParseJson(t);return i&&me(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,r.aG.ID_TOKEN),null)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ce(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,r.aG.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,r.aG.ACCESS_TOKEN),null;const i=this.validateAndParseJson(t);return i&&ge(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,r.aG.ACCESS_TOKEN),null)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ce(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,r.aG.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,r.aG.REFRESH_TOKEN),null;const i=this.validateAndParseJson(t);return i&&fe(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,r.aG.REFRESH_TOKEN),null)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ce(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,r.aG.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&((s=i)&&0===e.indexOf(r.GU)&&s.hasOwnProperty("clientId")&&s.hasOwnProperty("environment"))?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),i):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null);var s}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=function({environment:e,clientId:t}){return[r.GU,e,t].join(r.LR.CACHE_KEY_SEPARATOR).toLowerCase()}(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&function(e,t){const i=0===e.indexOf(r.gT.CACHE_KEY);let s=!0;return t&&(s=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),i&&s}(e,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),i):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&function(e,t){return!!t&&0===e.indexOf(r.u0.CACHE_KEY)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),i):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(e=>this.isAuthorityMetadata(e))}setWrapperMetadata(e,t){this.internalStorage.setItem(Zi.H3.WRAPPER_SKU,e),this.internalStorage.setItem(Zi.H3.WRAPPER_VER,t)}getWrapperMetadata(){return[this.internalStorage.getItem(Zi.H3.WRAPPER_SKU)||r.YM.EMPTY_STRING,this.internalStorage.getItem(Zi.H3.WRAPPER_VER)||r.YM.EMPTY_STRING]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(r.Gd.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const e=this.generateCacheKey(r.Gd.ACTIVE_ACCOUNT),t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const i=this.getAccountInfoFilteredBy({localAccountId:t});return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(i),i):null}const i=this.validateAndParseJson(t);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId,tenantId:i.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(r.Gd.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(r.Gd.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const s={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(s)),this.browserStorage.setItem(i,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(i)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&function(e,t){let i=!1;e&&(i=0===e.indexOf(r.Xw.THROTTLING_PREFIX));let s=!0;return t&&(s=t.hasOwnProperty("throttleTime")),i&&s}(e,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),i):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const i=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const e=this.getItemCookie(i);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),e}const s=this.temporaryCacheStorage.getItem(i);if(!s){if(this.cacheConfig.cacheLocation===Zi.Al.LocalStorage){const e=this.browserStorage.getItem(i);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),s}setTemporaryCache(e,t,i){const s=i?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(s,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(s,t))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{-1===e.indexOf(r.YM.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{-1===e.indexOf(r.YM.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(Hi,t);const i=this.getTokenKeys(),s=[];i.accessToken.forEach(e=>{const t=this.getAccessTokenCredential(e);t?.requestedClaimsHash&&e.includes(t.requestedClaimsHash.toLowerCase())&&s.push(this.removeAccessToken(e))}),await Promise.all(s),s.length>0&&this.logger.warning(`${s.length} access tokens with claims in the cache keys have been removed from the cache.`)}setItemCookie(e,t,i){let s=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;i&&(s+=`expires=${this.getCookieExpirationTime(i)};`),this.cacheConfig.secureCookies&&(s+="Secure;"),document.cookie=s}getItemCookie(e){const t=`${encodeURIComponent(e)}=`,i=document.cookie.split(";");for(let e=0;e<i.length;e++){let s=i[e];for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return r.YM.EMPTY_STRING}clearMsalCookies(){const e=`${r.YM.CACHE_PREFIX}.${this.clientId}`;document.cookie.split(";").forEach(t=>{for(;" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(e)){const e=t.split("=")[0];this.clearItemCookie(e)}})}clearItemCookie(e){this.setItemCookie(e,r.YM.EMPTY_STRING,-1)}getCookieExpirationTime(e){const t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Ze.startsWith(e,r.YM.CACHE_PREFIX)||Ze.startsWith(e,r.Gd.ADAL_ID_TOKEN)?e:`${r.YM.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=$s.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zi._p.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=$s.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zi._p.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=$s.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zi._p.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),i=this.getTemporaryCache(t);if(!i)return null;const s=this.generateAuthorityKey(i);return this.getTemporaryCache(s)}updateCacheEntries(e,t,i,s,r){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const n=this.generateStateKey(e);this.setTemporaryCache(n,e,!1);const o=this.generateNonceKey(e);this.setTemporaryCache(o,t,!1);const a=this.generateAuthorityKey(e);if(this.setTemporaryCache(a,i,!1),r){const e={credential:r.homeAccountId,type:Ys};this.setTemporaryCache(Zi._p.CCS_CREDENTIAL,JSON.stringify(e),!0)}else if(s){const e={credential:s,type:qs};this.setTemporaryCache(Zi._p.CCS_CREDENTIAL,JSON.stringify(e),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{-1!==t.indexOf(e)&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Zi._p.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),i=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i||r.YM.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(-1===t.indexOf(Zi._p.REQUEST_STATE))return;const i=this.temporaryCacheStorage.getItem(t);if(!i)return;const s=Js(this.cryptoImpl,i);s&&s.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=ps(JSON.stringify(e));this.setTemporaryCache(Zi._p.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Zi._p.REQUEST_PARAMS,!0);if(!t)throw(0,Ji.bD)(es.y6);let i;try{i=JSON.parse(ms(t))}catch(e){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${e}`),(0,Ji.bD)(es.ot)}if(this.removeTemporaryItem(this.generateCacheKey(Zi._p.REQUEST_PARAMS)),!i.authority){const t=this.generateAuthorityKey(e),s=this.getTemporaryCache(t);if(!s)throw(0,Ji.bD)(es.Ne);i.authority=s}return i}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Zi._p.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;return this.validateAndParseJson(e)||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${r.YM.CACHE_PREFIX}.${Zi._p.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${r.YM.CACHE_PREFIX}.${Zi._p.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw(0,Ji.bD)(es.b);this.setTemporaryCache(t,this.clientId,!1)}else e||this.getInteractionInProgress()!==this.clientId||this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(r.Gd.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(r.Gd.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(r.Gd.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(r.Gd.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const i=t||e;if(i){const e=ne(i,ms);if(e.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.preferred_username;if(e.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const i=ce(t);if(e!==i){const s=this.getItem(e);if(s)return this.browserStorage.removeItem(e),this.setItem(i,s),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),i;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){const i=he(e.account?.homeAccountId,e.account?.environment,e.idToken,this.clientId,e.tenantId);let s;t.claims&&(s=await this.cryptoImpl.hashString(t.claims));const r={idToken:i,accessToken:de(e.account?.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,ms,void 0,e.tokenType,void 0,t.sshKid,t.claims,s)};return this.saveCacheRecord(r)}async saveCacheRecord(e,t,i){try{await super.saveCacheRecord(e,t,i)}catch(e){if(e instanceof yt&&this.performanceClient&&i)try{const e=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:e.refreshToken.length,cacheIdCount:e.idToken.length,cacheAtCount:e.accessToken.length},i)}catch(e){}throw e}}}function tr(){return window.parent!==window}function ir(){return window.location.href.split("?")[0].split("#")[0]}function sr(){if("undefined"==typeof window)throw(0,Ji.bD)(es.tI)}function rr(e){if(!e)throw(0,Ji.bD)(es.IR)}function nr(e){sr(),function(){if(lt.hashContainsKnownProperties(window.location.hash)&&tr())throw(0,Ji.bD)(es.tZ)}(),function(){if("undefined"!=typeof window&&window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(`${Zi.Q1.POPUP_NAME_PREFIX}.`))throw(0,Ji.bD)(es.aH)}(),rr(e)}function or(e,t){if(nr(e),function(e){if(tr()&&!e)throw(0,Ji.bD)(es.OT)}(t.system.allowRedirectInIframe),t.cache.cacheLocation===Zi.Al.MemoryStorage&&!t.cache.storeAuthStateInCookie)throw(0,Xs.jz)(Zs.jE)}function ar(e){const t=document.createElement("link");t.rel="preconnect",t.href=new URL(e).origin,t.crossOrigin="anonymous",document.head.appendChild(t),window.setTimeout(()=>{try{document.head.removeChild(t)}catch{}},1e4)}var lr=i(99268);class cr{constructor(e){this.eventCallbacks=new Map,this.logger=e||new s.V({})}addEventCallback(e,t,i){if("undefined"!=typeof window){const s=i||Es();return this.eventCallbacks.has(s)?(this.logger.error(`Event callback with id: ${s} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(s,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${s}`),s)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,i,s){if("undefined"!=typeof window){const r={eventType:e,interactionType:t||null,payload:i||null,error:s||null,timestamp:Date.now()};this.eventCallbacks.forEach(([t,i],s)=>{(0===i.length||i.includes(e))&&(this.logger.verbose(`Emitting event to callback ${s}: ${e}`),t.apply(null,[r]))})}}}class hr extends l.lR{constructor(e,t,i,s,r){super(e,t,i),this.name="ServerError",this.errorNo=s,this.status=r,Object.setPrototypeOf(this,hr.prototype)}}class dr{static generateThrottlingStorageKey(e){return`${r.Xw.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){const i=dr.generateThrottlingStorageKey(t),s=e.getThrottlingCache(i);if(s){if(s.throttleTime<Date.now())return void e.removeItem(i);throw new hr(s.errorCodes?.join(" ")||r.YM.EMPTY_STRING,s.errorMessage,s.subError)}}static postProcess(e,t,i){if(dr.checkResponseStatus(i)||dr.checkResponseForRetryAfter(i)){const s={throttleTime:dr.calculateThrottleTime(parseInt(i.headers[r.OK.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(dr.generateThrottlingStorageKey(t),s)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&e.headers.hasOwnProperty(r.OK.RETRY_AFTER)&&(e.status<200||e.status>=300)}static calculateThrottleTime(e){const t=e<=0?0:e,i=Date.now()/1e3;return Math.floor(1e3*Math.min(i+(t||r.Xw.DEFAULT_THROTTLE_TIME_SECONDS),i+r.Xw.DEFAULT_MAX_THROTTLE_TIME_SECONDS))}static removeThrottle(e,t,i,s){const r={clientId:t,authority:i.authority,scopes:i.scopes,homeAccountIdentifier:s,claims:i.claims,authenticationScheme:i.authenticationScheme,resourceRequestMethod:i.resourceRequestMethod,resourceRequestUri:i.resourceRequestUri,shrClaims:i.shrClaims,sshKid:i.sshKid},n=this.generateThrottlingStorageKey(r);e.removeItem(n)}}class ur{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,i){let s;dr.preProcess(this.cacheManager,e);try{s=await this.networkClient.sendPostRequestAsync(t,i)}catch(e){throw e instanceof l.lR?e:te(g)}return dr.postProcess(this.cacheManager,e,s),s}}const pr="client_id",gr="response_type",mr="token_type",fr="req_cnf",yr="return_spa_code",vr="x-client-xtra-sku";class Cr{static validateRedirectUri(e){if(!e)throw Xe(Ae)}static validatePrompt(e){const t=[];for(const e in r._M)t.push(r._M[e]);if(t.indexOf(e)<0)throw Xe(ke)}static validateClaims(e){try{JSON.parse(e)}catch(e){throw Xe(Le)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw Xe(Fe);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([r.iF.PLAIN,r.iF.S256].indexOf(e)<0)throw Xe(Oe)}}class br{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(gr,encodeURIComponent(r.YM.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(gr,encodeURIComponent(`${r.YM.TOKEN_RESPONSE_TYPE} ${r.YM.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set("response_mode",encodeURIComponent(e||r.p.QUERY))}addNativeBroker(){this.parameters.set("nativebroker",encodeURIComponent("1"))}addScopes(e,t=!0,i=r.aZ){!t||i.includes("openid")||e.includes("openid")||i.push("openid");const s=t?[...e||[],...i]:e||[],n=new Qe(s);this.parameters.set("scope",encodeURIComponent(n.printScopes()))}addClientId(e){this.parameters.set(pr,encodeURIComponent(e))}addRedirectUri(e){Cr.validateRedirectUri(e),this.parameters.set("redirect_uri",encodeURIComponent(e))}addPostLogoutRedirectUri(e){Cr.validateRedirectUri(e),this.parameters.set("post_logout_redirect_uri",encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set("id_token_hint",encodeURIComponent(e))}addDomainHint(e){this.parameters.set("domain_hint",encodeURIComponent(e))}addLoginHint(e){this.parameters.set("login_hint",encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(r.OK.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(r.OK.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set("sid",encodeURIComponent(e))}addClaims(e,t){const i=this.addClientCapabilitiesToClaims(e,t);Cr.validateClaims(i),this.parameters.set("claims",encodeURIComponent(i))}addCorrelationId(e){this.parameters.set("client-request-id",encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set("x-client-SKU",e.sku),this.parameters.set("x-client-VER",e.version),e.os&&this.parameters.set("x-client-OS",e.os),e.cpu&&this.parameters.set("x-client-CPU",e.cpu)}addApplicationTelemetry(e){e?.appName&&this.parameters.set("x-app-name",e.appName),e?.appVersion&&this.parameters.set("x-app-ver",e.appVersion)}addPrompt(e){Cr.validatePrompt(e),this.parameters.set("prompt",encodeURIComponent(e))}addState(e){e&&this.parameters.set("state",encodeURIComponent(e))}addNonce(e){this.parameters.set("nonce",encodeURIComponent(e))}addCodeChallengeParams(e,t){if(Cr.validateCodeChallengeParams(e,t),!e||!t)throw Xe(Fe);this.parameters.set("code_challenge",encodeURIComponent(e)),this.parameters.set("code_challenge_method",encodeURIComponent(t))}addAuthorizationCode(e){this.parameters.set("code",encodeURIComponent(e))}addDeviceCode(e){this.parameters.set("device_code",encodeURIComponent(e))}addRefreshToken(e){this.parameters.set("refresh_token",encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set("code_verifier",encodeURIComponent(e))}addClientSecret(e){this.parameters.set("client_secret",encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set("client_assertion",encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set("client_assertion_type",encodeURIComponent(e))}addOboAssertion(e){this.parameters.set("assertion",encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set("requested_token_use",encodeURIComponent(e))}addGrantType(e){this.parameters.set("grant_type",encodeURIComponent(e))}addClientInfo(){this.parameters.set(r.JR,"1")}addExtraQueryParameters(e){Object.entries(e).forEach(([e,t])=>{!this.parameters.has(e)&&t&&this.parameters.set(e,t)})}addClientCapabilitiesToClaims(e,t){let i;if(e)try{i=JSON.parse(e)}catch(e){throw Xe(Le)}else i={};return t&&t.length>0&&(i.hasOwnProperty(r.Fq.ACCESS_TOKEN)||(i[r.Fq.ACCESS_TOKEN]={}),i[r.Fq.ACCESS_TOKEN][r.Fq.XMS_CC]={values:t}),JSON.stringify(i)}addUsername(e){this.parameters.set(r.Tq.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(r.Tq.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(mr,r.IO.POP),this.parameters.set(fr,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(mr,r.IO.SSH),this.parameters.set(fr,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set("x-client-current-telemetry",e.generateCurrentRequestHeaderValue()),this.parameters.set("x-client-last-telemetry",e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set("x-ms-lib-capability",r.Xw.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set("logout_hint",encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach((t,i)=>{e.push(`${i}=${t}`)}),e.join("&")}}async function Sr(e,t,i,s,r,n,o){o?.addQueueMeasurement(Ai,n);const a=_s.transformCIAMAuthority(Os(e)),l=new _s(a,t,i,s,r,n,o);try{return await Ls(l.resolveEndpointsAsync.bind(l),Ti,r,o,n)(),l}catch(e){throw te(p)}}class wr{constructor(e,t){this.config=function({authOptions:e,systemOptions:t,loggerOptions:i,cacheOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:a,clientCredentials:l,libraryInfo:c,telemetry:h,serverTelemetryManager:d,persistencePlugin:u,serializableCache:p}){const g={...St,...i};return{authOptions:(m=e,{clientCapabilities:[],azureCloudOptions:At,skipAuthorityMetadataCache:!1,instanceAware:!1,...m}),systemOptions:{...bt,...t},loggerOptions:g,cacheOptions:{...wt,...r},storageInterface:n||new Ct(e.clientId,ie,new s.V(g)),networkInterface:o||xt,cryptoInterface:a||ie,clientCredentials:l||Mt,libraryInfo:{...Et,...c},telemetry:{...Tt,...h},serverTelemetryManager:d||null,persistencePlugin:u||null,serializableCache:p||null};var m}(e),this.logger=new s.V(this.config.loggerOptions,se,re),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new ur(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[r.OK.CONTENT_TYPE]=r.YM.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Ys:try{const i=et(e.credential);t[r.OK.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case qs:t[r.OK.CCS_HEADER]=`UPN: ${e.credential}`}return t}async executePostToTokenEndpoint(e,t,i,s,n,o){o&&this.performanceClient?.addQueueMeasurement(o,n);const a=await this.networkManager.sendPostRequest(s,e,{body:t,headers:i});return this.performanceClient?.addFields({refreshTokenSize:a.body.refresh_token?.length||0,httpVerToken:a.headers?.[r.OK.X_MS_HTTP_VERSION]||""},n),this.config.serverTelemetryManager&&a.status<500&&429!==a.status&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async updateAuthority(e,t){this.performanceClient?.addQueueMeasurement(yi,t);const i=`https://${e}/${this.authority.tenant}/`,s=await Sr(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=s}createTokenQueryParameters(e){const t=new br;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}}class xr{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){this.performanceClient?.addQueueMeasurement(wi,e.correlationId);const i=await Ls(this.generateKid.bind(this),wi,t,this.performanceClient,e.correlationId)(e),s=this.cryptoUtils.base64UrlEncode(JSON.stringify(i));return{kid:i.kid,reqCnfString:s}}async generateKid(e){return this.performanceClient?.addQueueMeasurement(xi,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:"sw"}}async signPopToken(e,t,i){return this.signPayload(e,t,i)}async signPayload(e,t,i,s){const{resourceRequestMethod:r,resourceRequestUri:n,shrClaims:o,shrNonce:a,shrOptions:l}=i,c=n?new lt(n):void 0,h=c?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:ae(),m:r?.toUpperCase(),u:h?.HostNameAndPort,nonce:a||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:o||void 0,...s},t,l,i.correlationId)}}class Er{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}class Mr{constructor(e,t,i,s,r,n,o){this.clientId=e,this.cacheStorage=t,this.cryptoObj=i,this.logger=s,this.serializableCache=r,this.persistencePlugin=n,this.performanceClient=o}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?te(C,"Cached State"):te(C,"Server State");let i,s;try{i=decodeURIComponent(e.state)}catch(t){throw te(y,e.state)}try{s=decodeURIComponent(t)}catch(t){throw te(y,e.state)}if(i!==s)throw te(v);if(e.error||e.error_description||e.suberror){const t=function(e){const t=e.error_uri?.lastIndexOf("code=");return t&&t>=0?e.error_uri?.substring(t+5):void 0}(e);if(js(e.error,e.error_description,e.suberror))throw new Ws(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new hr(e.error||"",e.error_description,e.suberror,t)}}validateTokenResponse(e,t){if(e.error||e.error_description||e.suberror){const i=`Error(s): ${e.error_codes||r.YM.NOT_AVAILABLE} - Timestamp: ${e.timestamp||r.YM.NOT_AVAILABLE} - Description: ${e.error_description||r.YM.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||r.YM.NOT_AVAILABLE} - Trace ID: ${e.trace_id||r.YM.NOT_AVAILABLE}`,s=e.error_codes?.length?e.error_codes[0]:void 0,n=new hr(e.error,i,e.suberror,s,e.status);if(t&&e.status&&e.status>=r.t3.SERVER_ERROR_RANGE_START&&e.status<=r.t3.SERVER_ERROR_RANGE_END)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\n${n}`);if(t&&e.status&&e.status>=r.t3.CLIENT_ERROR_RANGE_START&&e.status<=r.t3.CLIENT_ERROR_RANGE_END)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\n${n}`);if(js(e.error,e.error_description,e.suberror))throw new Ws(e.error,e.error_description,e.suberror,e.timestamp||r.YM.EMPTY_STRING,e.trace_id||r.YM.EMPTY_STRING,e.correlation_id||r.YM.EMPTY_STRING,e.claims||r.YM.EMPTY_STRING,s);throw n}}async handleServerTokenResponse(e,t,i,s,n,o,a,l,c){let h,d;if(this.performanceClient?.addQueueMeasurement(Ei,e.correlation_id),e.id_token){if(h=ne(e.id_token||r.YM.EMPTY_STRING,this.cryptoObj.base64Decode),n&&n.nonce&&h.nonce!==n.nonce)throw te(b);if(s.maxAge||0===s.maxAge){const e=h.auth_time;if(!e)throw te(S);oe(e,s.maxAge)}}this.homeAccountIdentifier=nt.generateHomeAccountId(e.client_info||r.YM.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,h),n&&n.state&&(d=$s.parseRequestState(this.cryptoObj,n.state)),e.key_id=e.key_id||s.sshKid||void 0;const u=this.generateCacheRecord(e,t,i,s,h,o,n);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new Er(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),a&&!l&&u.account){const e=u.account.generateAccountKey();if(!this.cacheStorage.getAccount(e,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Mr.generateAuthenticationResult(this.cryptoObj,t,u,!1,s,h,d,void 0,c)}await this.cacheStorage.saveCacheRecord(u,s.storeInCache,s.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return Mr.generateAuthenticationResult(this.cryptoObj,t,u,!1,s,h,d,e,c)}generateCacheRecord(e,t,i,s,r,n,o){const a=t.getPreferredCache();if(!a)throw te(_);const l=rt(r);let c,h;e.id_token&&r&&(c=he(this.homeAccountIdentifier,a,e.id_token,this.clientId,l||""),h=Ar(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,r,e.client_info,a,l,o,void 0,this.logger));let d=null;if(e.access_token){const r=e.scope?Qe.fromString(e.scope):new Qe(s.scopes||[]),o=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,c=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,h=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,u=i+o,p=u+c,g=h&&h>0?i+h:void 0;d=de(this.homeAccountIdentifier,a,e.access_token,this.clientId,l||t.tenant||"",r.printScopes(),u,p,this.cryptoObj.base64Decode,g,e.token_type,n,e.key_id,s.claims,s.requestedClaimsHash)}let u=null;if(e.refresh_token){let t;e.refresh_token_expires_in&&(t=i+("string"==typeof e.refresh_token_expires_in?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in)),u=ue(this.homeAccountIdentifier,a,e.refresh_token,this.clientId,e.foci,n,t)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:a,familyId:e.foci}),{account:h,idToken:c,accessToken:d,refreshToken:u,appMetadata:p}}static async generateAuthenticationResult(e,t,i,s,n,o,a,l,c){let h,d,u=r.YM.EMPTY_STRING,p=[],g=null,m=r.YM.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType!==r.IO.POP||n.popKid)u=i.accessToken.secret;else{const t=new xr(e),{secret:s,keyId:r}=i.accessToken;if(!r)throw te($);u=await t.signPopToken(s,r,n)}p=Qe.fromString(i.accessToken.target).asArray(),g=new Date(1e3*Number(i.accessToken.expiresOn)),h=new Date(1e3*Number(i.accessToken.extendedExpiresOn)),i.accessToken.refreshOn&&(d=new Date(1e3*Number(i.accessToken.refreshOn)))}i.appMetadata&&(m=i.appMetadata.familyId===r.hB?r.hB:"");const f=o?.oid||o?.sub||"",y=o?.tid||"";l?.spa_accountid&&i.account&&(i.account.nativeAccountId=l?.spa_accountid);const v=i.account?st(i.account.getAccountInfo(),void 0,o,i.idToken?.secret):null;return{authority:t.canonicalAuthority,uniqueId:f,tenantId:y,scopes:p,account:v,idToken:i?.idToken?.secret||"",idTokenClaims:o||{},accessToken:u,fromCache:s,expiresOn:g,extExpiresOn:h,refreshOn:d,correlationId:n.correlationId,requestId:c||r.YM.EMPTY_STRING,familyId:m,tokenType:i.accessToken?.tokenType||r.YM.EMPTY_STRING,state:a?a.userRequestState:r.YM.EMPTY_STRING,cloudGraphHostName:i.account?.cloudGraphHostName||r.YM.EMPTY_STRING,msGraphHost:i.account?.msGraphHost||r.YM.EMPTY_STRING,code:l?.spa_code,fromNativeBroker:!1}}}function Ar(e,t,i,s,r,n,o,a,l,c,h){h?.verbose("setCachedAccount called");const d=e.getAccountKeys().find(e=>e.startsWith(i));let u=null;d&&(u=e.getAccount(d,h));const p=u||nt.createAccount({homeAccountId:i,idTokenClaims:r,clientInfo:n,environment:o,cloudGraphHostName:l?.cloud_graph_host_name,msGraphHost:l?.msgraph_host,nativeAccountId:c},t,s),g=p.tenantProfiles||[],m=a||p.realm;if(m&&!g.find(e=>e.tenantId===m)){const e=it(i,p.localAccountId,m,r);g.push(e)}return p.tenantProfiles=g,p}async function Tr(e,t,i){return"string"==typeof e?e:e({clientId:t,tokenEndpoint:i})}class Dr extends wr{constructor(e,t){super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async getAuthCodeUrl(e){this.performanceClient?.addQueueMeasurement(gi,e.correlationId);const t=await Ls(this.createAuthCodeUrlQueryString.bind(this),Si,this.logger,this.performanceClient,e.correlationId)(e);return lt.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){if(this.performanceClient?.addQueueMeasurement(vi,e.correlationId),!e.code)throw te(A);const i=ae(),s=await Ls(this.executeTokenRequest.bind(this),Ci,this.logger,this.performanceClient,e.correlationId)(this.authority,e),n=s.headers?.[r.OK.X_MS_REQUEST_ID],o=new Mr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return o.validateTokenResponse(s.body),Ls(o.handleServerTokenResponse.bind(o),Ei,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,i,e,t,void 0,void 0,void 0,n)}handleFragmentResponse(e,t){if(new Mr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw te(W);return e}getLogoutUri(e){if(!e)throw Xe(_e);const t=this.createLogoutUrlQueryString(e);return lt.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(Ci,t.correlationId);const i=this.createTokenQueryParameters(t),s=lt.appendQueryString(e.tokenEndpoint,i),n=await Ls(this.createTokenRequestBody.bind(this),bi,this.logger,this.performanceClient,t.correlationId)(t);let o;if(t.clientInfo)try{const e=Je(t.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${e.uid}${r.LR.CLIENT_INFO_SEPARATOR}${e.utid}`,type:Ys}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}const a=this.createTokenRequestHeaders(o||t.ccsCredential),l={clientId:t.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Ls(this.executePostToTokenEndpoint.bind(this),Kt,this.logger,this.performanceClient,t.correlationId)(s,n,a,l,t.correlationId,Kt)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(bi,e.correlationId);const t=new br;if(t.addClientId(e.tokenBodyParameters?.[pr]||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Cr.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Dt(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const i=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Tr(i.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(i.assertionType)}if(t.addGrantType(r.$x.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===r.IO.POP){const i=new xr(this.cryptoUtils,this.performanceClient);let s;s=e.popKid?this.cryptoUtils.encodeKid(e.popKid):(await Ls(i.generateCnf.bind(i),wi,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(s)}else if(e.authenticationScheme===r.IO.SSH){if(!e.sshJwk)throw Xe(He);t.addSshJwk(e.sshJwk)}const i=e.correlationId||this.config.cryptoInterface.createNewGuid();let s;if(t.addCorrelationId(i),(!Ze.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=Je(e.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${t.uid}${r.LR.CLIENT_INFO_SEPARATOR}${t.utid}`,type:Ys}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else s=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&s)switch(s.type){case Ys:try{const e=et(s.credential);t.addCcsOid(e)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case qs:t.addCcsUpn(s.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[yr]||t.addExtraQueryParameters({[yr]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){this.performanceClient?.addQueueMeasurement(Si,e.correlationId);const t=new br;t.addClientId(e.extraQueryParameters?.[pr]||this.config.authOptions.clientId);const i=[...e.scopes||[],...e.extraScopesToConsent||[]];t.addScopes(i,!0,this.oidcDefaultScopes),t.addRedirectUri(e.redirectUri);const s=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(s),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),Dt(this.config)||t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==r._M.SELECT_ACCOUNT)if(e.sid&&e.prompt===r._M.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){const i=this.extractAccountSid(e.account);let s=this.extractLoginHint(e.account);if(s&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),s=null),s){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(s);try{const i=et(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(i&&e.prompt===r._M.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(i);try{const i=et(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{const i=et(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.addExtraQueryParams(e,t),e.nativeBroker&&(t.addNativeBroker(),e.authenticationScheme===r.IO.POP)){const i=new xr(this.cryptoUtils);let s;s=e.popKid?this.cryptoUtils.encodeKid(e.popKid):(await Ls(i.generateCnf.bind(i),wi,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(s)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new br;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){return e.idTokenClaims?.sid||null}extractLoginHint(e){return e.idTokenClaims?.login_hint||null}}class Ir{constructor(e,t){this.cacheOutcome=r.Rv.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||r.YM.EMPTY_STRING,this.wrapperVer=e.wrapperVer||r.YM.EMPTY_STRING,this.telemetryCacheKey=r.gT.CACHE_KEY+r.LR.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${r.gT.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],i=this.getNativeBrokerErrorCode();i?.length&&t.push(`broker_error=${i}`);const s=t.join(r.gT.VALUE_SEPARATOR),n=[e,this.getRegionDiscoveryFields()].join(r.gT.VALUE_SEPARATOR);return[r.gT.SCHEMA_VERSION,n,s].join(r.gT.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Ir.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*t).join(r.gT.VALUE_SEPARATOR),s=e.errors.slice(0,t).join(r.gT.VALUE_SEPARATOR),n=e.errors.length,o=[n,t<n?r.gT.OVERFLOW_TRUE:r.gT.OVERFLOW_FALSE].join(r.gT.VALUE_SEPARATOR);return[r.gT.SCHEMA_VERSION,e.cacheHits,i,s,o].join(r.gT.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=r.gT.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof l.lR?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(r.gT.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||{failedRequests:[],errors:[],cacheHits:0}}clearTelemetryCache(){const e=this.getLastRequests(),t=Ir.maxErrorsToSend(e);if(t===e.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{const i={failedRequests:e.failedRequests.slice(2*t),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}}static maxErrorsToSend(e){let t,i=0,s=0;const n=e.errors.length;for(t=0;t<n;t++){const n=e.failedRequests[2*t]||r.YM.EMPTY_STRING,o=e.failedRequests[2*t+1]||r.YM.EMPTY_STRING,a=e.errors[t]||r.YM.EMPTY_STRING;if(s+=n.toString().length+o.toString().length+a.length+3,!(s<r.gT.MAX_LAST_HEADER_BYTES))break;i+=1}return i}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||r.YM.EMPTY_STRING),e.push(this.regionSource||r.YM.EMPTY_STRING),e.push(this.regionOutcome||r.YM.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return function(e){const{skus:t,libraryName:i,libraryVersion:s,extensionName:r,extensionVersion:n}=e,o=new Map([[0,[i,s]],[2,[r,n]]]);let a=[];if(t?.length){if(a=t.split(","),a.length<4)return t}else a=Array.from({length:4},()=>"|");return o.forEach((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:i,skuName:s,skuVersion:r}=e;i>=t.length||(t[i]=[s,r].join("|"))}({skuArr:a,index:t,skuName:e[0],skuVersion:e[1]})}),a.join(",")}(e)}}class Rr{constructor(e,t,i,s,r,n,o,a,l){this.config=e,this.browserStorage=t,this.browserCrypto=i,this.networkClient=this.config.system.networkClient,this.eventHandler=r,this.navigationClient=n,this.nativeMessageHandler=a,this.correlationId=l||Es(),this.logger=s.clone(Zi.Q1.MSAL_SKU,is,this.correlationId),this.performanceClient=o}async clearCacheOnLogout(e){if(e){nt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(nt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch(e){this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch(e){this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri||ir();return lt.getAbsoluteUrl(t,ir())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const i={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ir(i,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,i=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(Ut,this.correlationId);const s={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},r=e.requestAuthority||this.config.auth.authority,n=i?.length?"true"===i:this.config.auth.instanceAware,o=t&&n?this.config.auth.authority.replace(lt.getDomainFromUrl(r),t.environment):r,a=_s.generateAuthority(o,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await Ls(Sr,Ai,this.logger,this.performanceClient,this.correlationId)(a,this.config.system.networkClient,this.browserStorage,s,this.logger,this.correlationId,this.performanceClient);if(t&&!l.isAlias(t.environment))throw Xe($e);return l}}async function Pr(e,t,i){e.addQueueMeasurement(zi,i);const s=ks(kr,Wi,t,e,i)(e,t,i);return{verifier:s,challenge:await Ls(Lr,ji,t,e,i)(s,e,t,i)}}function kr(e,t,i){try{const s=new Uint8Array(32);return ks(ws,$i,t,e,i)(s),us(s)}catch(e){throw(0,Ji.bD)(es.p5)}}async function Lr(e,t,i,s){t.addQueueMeasurement(ji,s);try{const r=await Ls(Ss,Ki,i,t,s)(e,t,s);return us(new Uint8Array(r))}catch(e){throw(0,Ji.bD)(es.p5)}}async function Nr(e,t,i,s){i.addQueueMeasurement(ii,e.correlationId);const n=e.authority||t.auth.authority,o=[...e&&e.scopes||[]],a={...e,correlationId:e.correlationId,authority:n,scopes:o};if(a.authenticationScheme){if(a.authenticationScheme===r.IO.SSH){if(!e.sshJwk)throw Xe(He);if(!e.sshKid)throw Xe(Ue)}s.verbose(`Authentication Scheme set to "${a.authenticationScheme}" as configured in Auth request`)}else a.authenticationScheme=r.IO.BEARER,s.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return t.cache.claimsBasedCachingEnabled&&e.claims&&!Ze.isEmptyObj(e.claims)&&(a.requestedClaimsHash=await As(e.claims)),a}async function _r(e,t,i,s,r){s.addQueueMeasurement(si,e.correlationId);const n=await Ls(Nr,ii,r,s,e.correlationId)(e,i,s,r);return{...e,...n,account:t,forceRefresh:e.forceRefresh||!1}}class Or extends Rr{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(pi,this.correlationId);const t=await Ls(Pr,zi,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),i={...e,redirectUri:e.redirectUri,code:r.YM.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=r.YM.S256_CODE_CHALLENGE_METHOD,i}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e?.correlationId);const t={correlationId:this.correlationId||Es(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const i=this.getLogoutHintFromIdTokenClaims(e.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=lt.getAbsoluteUrl(e.postLogoutRedirectUri,ir())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=lt.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ir())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=lt.getAbsoluteUrl(ir(),ir())),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(hi,this.correlationId);const t=await Ls(this.getClientConfiguration.bind(this),di,this.logger,this.performanceClient,this.correlationId)(e);return new Dr(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:i,requestAzureCloudOptions:s,requestExtraQueryParameters:n,account:o}=e;this.performanceClient.addQueueMeasurement(di,this.correlationId);const a=await Ls(this.getDiscoveredAuthority.bind(this),Ut,this.logger,this.performanceClient,this.correlationId)({requestAuthority:i,requestAzureCloudOptions:s,requestExtraQueryParameters:n,account:o}),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Zi.Q1.MSAL_SKU,version:is,cpu:r.YM.EMPTY_STRING,os:r.YM.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(ui,this.correlationId);const i=this.getRedirectUri(e.redirectUri),s={interactionType:t},n=$s.setRequestState(this.browserCrypto,e&&e.state||r.YM.EMPTY_STRING,s),o={...await Ls(Nr,ii,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:i,state:n,nonce:e.nonce||Es(),responseMode:this.config.auth.OIDCOptions.serverResponseType},a=e.account||this.browserStorage.getActiveAccount();if(a&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${a.homeAccountId}`,this.correlationId),o.account=a),!o.loginHint&&!a){const e=this.browserStorage.getLegacyLoginHint();e&&(o.loginHint=e)}return o}}var Fr=i(5841);const Gr="user_switch",Br={[Gr]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Vr extends l.lR{constructor(e,t,i){super(e,t),Object.setPrototypeOf(this,Vr.prototype),this.name="NativeAuthError",this.ext=i}}function Hr(e){return!(!e.ext||!e.ext.status||"PERSISTENT_ERROR"!==e.ext.status&&"DISABLED"!==e.ext.status)||!(!e.ext||!e.ext.error||-2147186943!==e.ext.error)||"ContentError"===e.errorCode}function Ur(e,t,i){if(i&&i.status)switch(i.status){case"ACCOUNT_UNAVAILABLE":return Ks(Gs);case"USER_INTERACTION_REQUIRED":return new Ws(e,t);case"USER_CANCEL":return(0,Ji.bD)(es.fN);case"NO_NETWORK":return(0,Ji.bD)(es.l7)}return new Vr(e,Br[e]||t,i)}class zr extends wr{constructor(e,t){super(e,t)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(Yt,e.correlationId);const t=ae(),i=await Ls(this.executeTokenRequest.bind(this),$t,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=i.headers?.[r.OK.X_MS_REQUEST_ID],n=new Mr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return n.validateTokenResponse(i.body),Ls(n.handleServerTokenResponse.bind(n),Ei,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e){if(!e)throw Xe(Ne);if(this.performanceClient?.addQueueMeasurement(Xt,e.correlationId),!e.account)throw te(L);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Ls(this.acquireTokenWithCachedRefreshToken.bind(this),qt,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(t){const i=t instanceof Ws&&t.errorCode===Fs,s=t instanceof hr&&t.errorCode===r.I.INVALID_GRANT_ERROR&&t.subError===r.I.CLIENT_MISMATCH_ERROR;if(i||s)return Ls(this.acquireTokenWithCachedRefreshToken.bind(this),qt,this.logger,this.performanceClient,e.correlationId)(e,!1);throw t}return Ls(this.acquireTokenWithCachedRefreshToken.bind(this),qt,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){this.performanceClient?.addQueueMeasurement(qt,e.correlationId);const i=ks(this.cacheManager.getRefreshToken.bind(this.cacheManager),Ui,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!i)throw Ks(Fs);if(i.expiresOn&&le(i.expiresOn,e.refreshTokenExpirationOffsetSeconds||300))throw Ks(Bs);const s={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||r.IO.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Ys}};try{return await Ls(this.acquireToken.bind(this),Yt,this.logger,this.performanceClient,e.correlationId)(s)}catch(e){if(e instanceof Ws&&e.subError===Vs){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const e=ce(i);this.cacheManager.removeRefreshToken(e)}throw e}}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement($t,e.correlationId);const i=this.createTokenQueryParameters(e),s=lt.appendQueryString(t.tokenEndpoint,i),r=await Ls(this.createTokenRequestBody.bind(this),Zt,this.logger,this.performanceClient,e.correlationId)(e),n=this.createTokenRequestHeaders(e.ccsCredential),o={clientId:e.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Ls(this.executePostToTokenEndpoint.bind(this),jt,this.logger,this.performanceClient,e.correlationId)(s,r,n,o,e.correlationId,jt)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(Zt,e.correlationId);const t=e.correlationId,i=new br;if(i.addClientId(e.tokenBodyParameters?.[pr]||this.config.authOptions.clientId),e.redirectUri&&i.addRedirectUri(e.redirectUri),i.addScopes(e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),i.addGrantType(r.$x.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!Dt(this.config)&&i.addServerTelemetry(this.serverTelemetryManager),i.addCorrelationId(t),i.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&i.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const t=this.config.clientCredentials.clientAssertion;i.addClientAssertion(await Tr(t.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),i.addClientAssertionType(t.assertionType)}if(e.authenticationScheme===r.IO.POP){const t=new xr(this.cryptoUtils,this.performanceClient);let s;s=e.popKid?this.cryptoUtils.encodeKid(e.popKid):(await Ls(t.generateCnf.bind(t),wi,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,i.addPopToken(s)}else if(e.authenticationScheme===r.IO.SSH){if(!e.sshJwk)throw Xe(He);i.addSshJwk(e.sshJwk)}if((!Ze.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Ys:try{const t=et(e.ccsCredential.credential);i.addCcsOid(t)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case qs:i.addCcsUpn(e.ccsCredential.credential)}return e.tokenBodyParameters&&i.addExtraQueryParameters(e.tokenBodyParameters),i.createQueryString()}}class Wr extends wr{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,i]=await this.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...r.aZ]});return i===r.Rv.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new zr(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),t}catch(t){if(t instanceof ee&&t.errorCode===H)return new zr(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw t}}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(Jt,e.correlationId);let t=r.Rv.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Ze.isEmptyObj(e.claims))throw this.setCacheOutcome(r.Rv.FORCE_REFRESH_OR_CLAIMS,e.correlationId),te(H);if(!e.account)throw te(L);const i=e.account.tenantId||function(e){const t=new lt(e).getUrlComponents(),i=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(i){case r.v2.COMMON:case r.v2.ORGANIZATIONS:case r.v2.CONSUMERS:return;default:return i}}(e.authority),s=this.cacheManager.getTokenKeys(),n=this.cacheManager.getAccessToken(e.account,e,s,i,this.performanceClient,e.correlationId);if(!n)throw this.setCacheOutcome(r.Rv.NO_CACHED_ACCESS_TOKEN,e.correlationId),te(H);if(o=n.cachedAt,Number(o)>ae()||le(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(r.Rv.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),te(H);var o;n.refreshOn&&le(n.refreshOn,0)&&(t=r.Rv.PROACTIVELY_REFRESHED);const a=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.readAccountFromCache(e.account),accessToken:n,idToken:this.cacheManager.getIdToken(e.account,s,i,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(a)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Ls(this.generateResultFromCacheRecord.bind(this),ei,this.logger,this.performanceClient,e.correlationId)(l,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==r.Rv.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){let i;if(this.performanceClient?.addQueueMeasurement(ei,t.correlationId),e.idToken&&(i=ne(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=i?.auth_time;if(!e)throw te(S);oe(e,t.maxAge)}return Mr.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,i)}}class jr extends Or{async acquireToken(e){this.performanceClient.addQueueMeasurement(Gt,e.correlationId);const t=this.initializeServerTelemetryManager(Zi.sA.acquireTokenSilent_silentFlow),i=await Ls(this.getClientConfiguration.bind(this),di,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),s=new Wr(i,this.performanceClient);this.logger.verbose("Silent auth client created");try{const t=(await Ls(s.acquireCachedToken.bind(s),Jt,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),t}catch(e){throw e instanceof Ji.jT&&e.errorCode===es.e0&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),e}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t?.account)}}const Kr="brk_redirect_uri";class $r extends Rr{constructor(e,t,i,s,r,n,o,a,l,c,h,d){super(e,t,i,s,r,n,a,l,d),this.apiId=o,this.accountId=c,this.nativeMessageHandler=l,this.nativeStorageManager=h,this.silentCacheClient=new jr(e,this.nativeStorageManager,i,s,r,n,a,l,d),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const u=this.nativeMessageHandler.getExtensionId()===Zi.JD.PREFERRED_EXTENSION_ID?"chrome":this.nativeMessageHandler.getExtensionId()?.length?"unknown":void 0;this.skus=Ir.makeExtraSkuString({libraryName:Zi.Q1.MSAL_SKU,libraryVersion:is,extensionName:u,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[vr]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(Wt,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(Wt,e.correlationId),i=ae();try{const s=await this.initializeNativeRequest(e);try{const e=await this.acquireTokensFromCache(this.accountId,s);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),e}catch(e){this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...r}=s,n={method:Zi.Ct.GetToken,request:r},o=await this.nativeMessageHandler.sendMessage(n),a=this.validateNativeResponse(o);return await this.handleNativeResponse(a,s,i).then(e=>(t.end({success:!0,isNativeBroker:!0,requestId:e.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),e)).catch(e=>{throw t.end({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e})}catch(e){throw e instanceof Vr&&this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),e}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Qe.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),te(O);const i=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!i)throw te(O);try{const e=this.createSilentCacheRequest(t,i),s=await this.silentCacheClient.acquireToken(e),r={...i,idTokenClaims:s?.idTokenClaims,idToken:s?.idToken};return{...s,account:r}}catch(e){throw e}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...i}=e;delete i.onRedirectNavigate;const s=await this.initializeNativeRequest(i),r={method:Zi.Ct.GetToken,request:s};try{const e=await this.nativeMessageHandler.sendMessage(r);this.validateNativeResponse(e)}catch(e){if(e instanceof Vr&&(this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),Hr(e)))throw e}this.browserStorage.setTemporaryCache(Zi._p.NATIVE_REQUEST,JSON.stringify(s),!0);const n={apiId:Zi.sA.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(o,n)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const i=this.browserStorage.getCachedNativeRequest();if(!i)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&e?.addFields({errorCode:"no_cached_request"},t),null;const{prompt:s,...r}=i;s&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Zi._p.NATIVE_REQUEST));const n={method:Zi.Ct.GetToken,request:r},o=ae();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const e=await this.nativeMessageHandler.sendMessage(n);this.validateNativeResponse(e);const t=this.handleNativeResponse(e,r,o);this.browserStorage.setInteractionInProgress(!1);const i=await t;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),i}catch(e){throw this.browserStorage.setInteractionInProgress(!1),e}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,i){this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const s=ne(e.id_token,ms),r=this.createHomeAccountIdentifier(e,s),n=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId})?.homeAccountId;if(r!==n&&e.account.id!==t.accountId)throw Ur(Gr);const o=await this.getDiscoveredAuthority({requestAuthority:t.authority}),a=Ar(this.browserStorage,o,r,ms,s,e.client_info,void 0,s.tid,void 0,e.account.id,this.logger),l=await this.generateAuthenticationResult(e,t,s,a,o.canonicalAuthority,i);return this.cacheAccount(a),this.cacheNativeTokens(e,t,r,s,e.access_token,l.tenantId,i),l}createHomeAccountIdentifier(e,t){return nt.generateHomeAccountId(e.client_info||r.YM.EMPTY_STRING,0,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Qe.fromString(e.scope):Qe.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===r.IO.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const i=new xr(this.browserCrypto),s={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw te($);return i.signPopToken(e.access_token,t.keyId,s)}return e.access_token}async generateAuthenticationResult(e,t,i,s,n,o){const a=this.addTelemetryFromNativeResponse(e),l=e.scope?Qe.fromString(e.scope):Qe.fromString(t.scope),c=e.account.properties||{},h=c.UID||i.oid||i.sub||r.YM.EMPTY_STRING,d=c.TenantId||i.tid||r.YM.EMPTY_STRING,u=st(s.getAccountInfo(),void 0,i,e.id_token);u.nativeAccountId!==e.account.id&&(u.nativeAccountId=e.account.id);const p=await this.generatePopAccessToken(e,t),g=t.tokenType===r.IO.POP?r.IO.POP:r.IO.BEARER;return{authority:n,uniqueId:h,tenantId:d,scopes:l.asArray(),account:u,idToken:e.id_token,idTokenClaims:i,accessToken:p,fromCache:!!a&&this.isResponseFromCache(a),expiresOn:new Date(1e3*Number(o+e.expires_in)),tokenType:g,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(e=>{this.logger.error(`Error occurred while removing account context from browser storage. ${e}`)})}cacheNativeTokens(e,t,i,s,n,o,a){const l=he(i,t.authority,e.id_token||"",t.clientId,s.tid||""),c=a+(t.tokenType===r.IO.POP?r.YM.SHR_NONCE_VALIDITY:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),h=this.generateScopes(e,t),d={idToken:l,accessToken:de(i,t.authority,n,t.clientId,s.tid||o,h.printScopes(),c,0,ms,void 0,t.tokenType,void 0,t.keyId)};this.nativeStorageManager.saveCacheRecord(d,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw(0,l.pz)(Fr.W,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const i=new lt(t);i.validateAsUri();const{scopes:s,...n}=e,o=new Qe(s||[]);o.appendScopes(r.aZ);const a={...n,accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:o.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:(()=>{switch(this.apiId){case Zi.sA.ssoSilent:case Zi.sA.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),r._M.NONE}if(e.prompt)switch(e.prompt){case r._M.NONE:case r._M.CONSENT:case r._M.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),(0,Ji.bD)(es.nF)}else this.logger.trace("initializeNativeRequest: prompt was not provided")})(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(a.signPopToken&&e.popKid)throw(0,Ji.bD)(es.bT);if(this.handleExtraBrokerParams(a),a.extraParameters=a.extraParameters||{},a.extraParameters.telemetry=Zi.JD.MATS_TELEMETRY,e.authenticationScheme===r.IO.POP){const t={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},i=new xr(this.browserCrypto);let s;if(a.keyId)s=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:a.keyId})),a.signPopToken=!1;else{const r=await Ls(i.generateCnf.bind(i),wi,this.logger,this.performanceClient,e.correlationId)(t,this.logger);s=r.reqCnfString,a.keyId=r.kid,a.signPopToken=!0}a.reqCnf=s}return this.addRequestSKUs(a),a}handleExtraBrokerParams(e){if(e.extraParameters&&e.extraParameters.hasOwnProperty("brk_client_id")&&e.extraParameters.hasOwnProperty(Kr)&&e.extraParameters.hasOwnProperty(pr)){const t=e.extraParameters[pr],i=e.redirectUri,s=e.extraParameters[Kr];e.extraParameters={child_client_id:t,child_redirect_uri:i},e.redirectUri=s}}}class Yr{constructor(e,t,i,s){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=s,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=i,this.handshakeEvent=i.startMeasurement(Bi)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:Zi.JD.CHANNEL_ID,extensionId:this.extensionId,responseId:Es(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((e,i)=>{this.resolvers.set(t.responseId,{resolve:e,reject:i})})}static async createProvider(e,t,i){e.trace("NativeMessageHandler - createProvider called.");try{const s=new Yr(e,t,i,Zi.JD.PREFERRED_EXTENSION_ID);return await s.sendHandshakeRequest(),s}catch(s){const r=new Yr(e,t,i);return await r.sendHandshakeRequest(),r}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Zi.JD.CHANNEL_ID,extensionId:this.extensionId,responseId:Es(),body:{method:Zi.Ct.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=e=>{this.onChannelMessage(e)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,i)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:i}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),i((0,Ji.bD)(es.y3)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(t.channel&&t.channel===Zi.JD.CHANNEL_ID&&(!t.extensionId||t.extensionId===this.extensionId)&&t.body.method===Zi.Ct.HandshakeRequest){const e=this.handshakeResolvers.get(t.responseId);if(!e)return void this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),e.reject((0,Ji.bD)(es.cq))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,i=this.resolvers.get(t.responseId),s=this.handshakeResolvers.get(t.responseId);try{const e=t.body.method;if(e===Zi.Ct.Response){if(!i)return;const e=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(e)}`),"Success"!==e.status)i.reject(Ur(e.code,e.description,e.ext));else{if(!e.result)throw(0,l.pz)(Fr.W,"Event does not contain result.");e.result.code&&e.result.description?i.reject(Ur(e.result.code,e.result.description,e.result.ext)):i.resolve(e.result)}this.resolvers.delete(t.responseId)}else if(e===Zi.Ct.HandshakeResponse){if(!s)return void this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),s.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(t){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${t}`),this.logger.errorPii(`Unable to parse ${e}`),i?i.reject(t):s&&s.reject(t)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,i,s){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!i)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(s)switch(s){case r.IO.BEARER:case r.IO.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}class qr{constructor(e,t,i,s,r){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=s,this.performanceClient=r}async handleCodeResponse(e,t){let i;this.performanceClient.addQueueMeasurement(fi,t.correlationId);try{i=this.authModule.handleFragmentResponse(e,t.state)}catch(e){throw e instanceof hr&&e.subError===es.fN?(0,Ji.bD)(es.fN):e}return Ls(this.handleCodeResponseFromServer.bind(this),mi,this.logger,this.performanceClient,t.correlationId)(i,t)}async handleCodeResponseFromServer(e,t,i=!0){if(this.performanceClient.addQueueMeasurement(mi,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Ls(this.authModule.updateAuthority.bind(this.authModule),yi,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),i&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const e=this.createCcsCredentials(t);e&&(this.authCodeRequest.ccsCredential=e)}return await Ls(this.authModule.acquireToken.bind(this.authModule),vi,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Ys}:e.loginHint?{credential:e.loginHint,type:qs}:null}}function Xr(e,t,i){const s=at(e);if(!s)throw ot(e)?(i.error(`A ${t} is present in the iframe but it does not contain known properties. It's likely that the ${t} has been replaced by code running on the redirectUri page.`),i.errorPii(`The ${t} detected is: ${e}`),(0,Ji.bD)(es.Lm)):(i.error(`The request has returned to the redirectUri but a ${t} is not present. It's likely that the ${t} has been removed or the page has been redirected by code running on the redirectUri page.`),(0,Ji.bD)(es.wv));return s}class Zr extends Or{constructor(e,t,i,s,r,n,o,a,l,c){super(e,t,i,s,r,n,o,l,c),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=a}acquireToken(e){try{const t={popupName:this.generatePopupName(e.scopes||r.aZ,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),t.popup=this.openSizedPopup("about:blank",t),this.acquireTokenPopupAsync(e,t))}catch(e){return Promise.reject(e)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),i={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},s=e&&e.authority,r=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,i,s,r)):(this.logger.verbose("asyncPopup set to false, opening popup"),i.popup=this.openSizedPopup("about:blank",i),this.logoutPopupAsync(t,i,s,r))}catch(e){return Promise.reject(e)}}async acquireTokenPopupAsync(e,t){this.logger.verbose("acquireTokenPopupAsync called");const i=this.initializeServerTelemetryManager(Zi.sA.acquireTokenPopup),s=await Ls(this.initializeAuthorizationRequest.bind(this),ui,this.logger,this.performanceClient,this.correlationId)(e,Zi.X8.Popup);ar(s.authority);try{const r=await Ls(this.initializeAuthorizationCodeRequest.bind(this),pi,this.logger,this.performanceClient,this.correlationId)(s),n=await Ls(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),o=Yr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let a;o&&(a=this.performanceClient.startMeasurement(zt,e.correlationId));const l=await n.getAuthCodeUrl({...s,nativeBroker:o}),c=new qr(n,this.browserStorage,r,this.logger,this.performanceClient),h=this.initiateAuthRequest(l,t);this.eventHandler.emitEvent(lr.B.POPUP_OPENED,Zi.X8.Popup,{popupWindow:h},null);const d=await this.monitorPopupForHash(h,t.popupWindowParent),u=ks(Xr,Mi,this.logger,this.performanceClient,this.correlationId)(d,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(dr.removeThrottle(this.browserStorage,this.config.auth.clientId,r),u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),a&&a.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw(0,Ji.bD)(es.XC);const e=new $r(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,u.accountId,this.nativeStorage,s.correlationId),{userRequestState:t}=$s.parseRequestState(this.browserCrypto,s.state);return await e.acquireToken({...s,state:t,prompt:void 0})}return await c.handleCodeResponse(u,s)}catch(e){throw t.popup?.close(),e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),e}}async logoutPopupAsync(e,t,i,s){this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(lr.B.LOGOUT_START,Zi.X8.Popup,e);const r=this.initializeServerTelemetryManager(Zi.sA.logoutPopup);try{await this.clearCacheOnLogout(e.account);const n=await Ls(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:i,account:e.account||void 0});try{n.authority.endSessionEndpoint}catch{if(e.account?.homeAccountId&&e.postLogoutRedirectUri&&n.authority.protocolMode===o){if(this.browserStorage.removeAccount(e.account?.homeAccountId),this.eventHandler.emitEvent(lr.B.LOGOUT_SUCCESS,Zi.X8.Popup,e),s){const e={apiId:Zi.sA.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=lt.getAbsoluteUrl(s,ir());await this.navigationClient.navigateInternal(t,e)}return void t.popup?.close()}}const a=n.getLogoutUri(e);this.eventHandler.emitEvent(lr.B.LOGOUT_SUCCESS,Zi.X8.Popup,e);const l=this.openPopup(a,t);if(this.eventHandler.emitEvent(lr.B.POPUP_OPENED,Zi.X8.Popup,{popupWindow:l},null),await this.monitorPopupForHash(l,t.popupWindowParent).catch(()=>{}),s){const e={apiId:Zi.sA.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=lt.getAbsoluteUrl(s,ir());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${t}`),await this.navigationClient.navigateInternal(t,e)}else this.logger.verbose("No main window navigation requested")}catch(e){throw t.popup?.close(),e instanceof l.lR&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(lr.B.LOGOUT_FAILURE,Zi.X8.Popup,null,e),this.eventHandler.emitEvent(lr.B.LOGOUT_END,Zi.X8.Popup),e}this.eventHandler.emitEvent(lr.B.LOGOUT_END,Zi.X8.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),(0,Ji.bD)(es.B2)}monitorPopupForHash(e,t){return new Promise((t,i)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed)return this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(s),void i((0,Ji.bD)(es.fN));let n="";try{n=e.location.href}catch(e){}if(!n||"about:blank"===n)return;clearInterval(s);let o="";const a=this.config.auth.OIDCOptions.serverResponseType;e&&(o=a===r.zL.QUERY?e.location.search:e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),t(o)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let i;if(t.popup?(i=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),i.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii(`Opening popup window to: ${e}`),i=this.openSizedPopup(e,t)),!i)throw(0,Ji.bD)(es.MP);return i.focus&&i.focus(),this.currentWindow=i,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),i}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),(0,Ji.bD)(es.hs)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:i,popupWindowParent:s}){const r=s.screenLeft?s.screenLeft:s.screenX,n=s.screenTop?s.screenTop:s.screenY,o=s.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=s.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=i.popupSize?.width,c=i.popupSize?.height,h=i.popupPosition?.top,d=i.popupPosition?.left;return(!l||l<0||l>o)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Zi.Q1.POPUP_WIDTH),(!c||c<0||c>a)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=Zi.Q1.POPUP_HEIGHT),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),h=Math.max(0,a/2-Zi.Q1.POPUP_HEIGHT/2+n)),(!d||d<0||d>o)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),d=Math.max(0,o/2-Zi.Q1.POPUP_WIDTH/2+r)),s.open(e,t,`width=${l}, height=${c}, top=${h}, left=${d}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(Zi.X8.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Zi.Q1.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Zi.Q1.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}class Qr{constructor(e,t,i,s,r){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=s,this.performanceClient=r}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Zi._p.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Zi._p.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const i={apiId:Zi.sA.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};return"function"==typeof t.onRedirectNavigate?(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1!==t.onRedirectNavigate(e)?(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),void await t.navigationClient.navigateExternal(e,i)):void this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation")):(this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),void await t.navigationClient.navigateExternal(e,i))}throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),(0,Ji.bD)(es.B2)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const i=this.browserStorage.generateStateKey(t),s=this.browserStorage.getTemporaryCache(i);if(!s)throw te(C,"Cached State");let r;try{r=this.authModule.handleFragmentResponse(e,s)}catch(e){throw e instanceof hr&&e.subError===es.fN?(0,Ji.bD)(es.fN):e}const n=this.browserStorage.generateNonceKey(s),o=this.browserStorage.getTemporaryCache(n);if(this.authCodeRequest.code=r.code,r.cloud_instance_host_name&&await Ls(this.authModule.updateAuthority.bind(this.authModule),yi,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(r.cloud_instance_host_name,this.authCodeRequest.correlationId),r.nonce=o||void 0,r.state=s,r.client_info)this.authCodeRequest.clientInfo=r.client_info;else{const e=this.checkCcsCredentials();e&&(this.authCodeRequest.ccsCredential=e)}const a=await this.authModule.acquireToken(this.authCodeRequest,r);return this.browserStorage.cleanRequestByState(t),a}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Zi._p.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}class Jr extends Or{constructor(e,t,i,s,r,n,o,a,l,c){super(e,t,i,s,r,n,o,l,c),this.nativeStorage=a}async acquireToken(e){const t=await Ls(this.initializeAuthorizationRequest.bind(this),ui,this.logger,this.performanceClient,this.correlationId)(e,Zi.X8.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const i=this.initializeServerTelemetryManager(Zi.sA.acquireTokenRedirect),s=e=>{e.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(lr.B.RESTORE_FROM_BFCACHE,Zi.X8.Redirect))};try{const r=await Ls(this.initializeAuthorizationCodeRequest.bind(this),pi,this.logger,this.performanceClient,this.correlationId)(t),n=await Ls(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),o=new Qr(n,this.browserStorage,r,this.logger,this.performanceClient),a=await n.getAuthCodeUrl({...t,nativeBroker:Yr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),l=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${l}`),window.addEventListener("pageshow",s),await o.initiateAuthRequest(a,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),window.removeEventListener("pageshow",s),this.browserStorage.cleanRequestByState(t.state),e}}async handleRedirectPromise(e="",t){const i=this.initializeServerTelemetryManager(Zi.sA.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[s,n]=this.getRedirectResponse(e||"");if(!s)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Zi.X8.Redirect),"back_forward"!==function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("navigation"),t=e.length?e[0]:void 0;return t?.type}()?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const o=this.browserStorage.getTemporaryCache(Zi._p.ORIGIN_URI,!0)||r.YM.EMPTY_STRING;if(lt.removeHashFromUrl(o)===lt.removeHashFromUrl(window.location.href)&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),o.indexOf("#")>-1&&function(e){const t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""}(o),await this.handleResponse(s,i);if(!this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(s,i);if(!tr()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Zi._p.URL_HASH,n,!0);const e={apiId:Zi.sA.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let t=!0;if(o&&"null"!==o)this.logger.verbose(`Navigating to loginRequestUrl: ${o}`),t=await this.navigationClient.navigateInternal(o,e);else{const i=function(){const e=new lt(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}();this.browserStorage.setTemporaryCache(Zi._p.ORIGIN_URI,i,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),t=await this.navigationClient.navigateInternal(i,e)}if(!t)return await this.handleResponse(s,i)}return null}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),this.browserStorage.cleanRequestByInteractionType(Zi.X8.Redirect),e}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(t=this.config.auth.OIDCOptions.serverResponseType===r.zL.QUERY?window.location.search:window.location.hash);let i=at(t);if(i){try{!function(e,t,i){if(!e.state)throw(0,Ji.bD)(es.c$);const s=Js(t,e.state);if(!s)throw(0,Ji.bD)(es.fA);if(s.interactionType!==i)throw(0,Ji.bD)(es.oe)}(i,this.browserCrypto,Zi.X8.Redirect)}catch(e){return e instanceof l.lR&&this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`),[null,""]}return(s=window).location.hash="","function"==typeof s.history.replaceState&&s.history.replaceState(null,"",`${s.location.origin}${s.location.pathname}${s.location.search}`),this.logger.verbose("Hash contains known properties, returning response hash"),[i,t]}var s;const n=this.browserStorage.getTemporaryCache(Zi._p.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Zi._p.URL_HASH)),n&&(i=at(n),i)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[i,n]):[null,""]}async handleResponse(e,t){const i=e.state;if(!i)throw(0,Ji.bD)(es.c$);const s=this.browserStorage.getCachedRequest(i);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw(0,Ji.bD)(es.XC);const t=new $r(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,s.correlationId),{userRequestState:r}=$s.parseRequestState(this.browserCrypto,i);return t.acquireToken({...s,state:r,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(i)})}const r=this.browserStorage.getCachedAuthority(i);if(!r)throw(0,Ji.bD)(es.Ne);const n=await Ls(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:r});return dr.removeThrottle(this.browserStorage,this.config.auth.clientId,s),new Qr(n,this.browserStorage,s,this.logger,this.performanceClient).handleCodeResponse(e,i)}async logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),i=this.initializeServerTelemetryManager(Zi.sA.logout);try{this.eventHandler.emitEvent(lr.B.LOGOUT_START,Zi.X8.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:Zi.sA.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=await Ls(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:e&&e.authority,requestExtraQueryParameters:e?.extraQueryParameters,account:e&&e.account||void 0});if(r.authority.protocolMode===o)try{r.authority.endSessionEndpoint}catch{if(t.account?.homeAccountId)return this.browserStorage.removeAccount(t.account?.homeAccountId),void this.eventHandler.emitEvent(lr.B.LOGOUT_SUCCESS,Zi.X8.Redirect,t)}const n=r.getLogoutUri(t);if(this.eventHandler.emitEvent(lr.B.LOGOUT_SUCCESS,Zi.X8.Redirect,t),!e||"function"!=typeof e.onRedirectNavigate)return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(n,s);if(!1!==e.onRedirectNavigate(n))return this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(n,s);this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation")}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),this.eventHandler.emitEvent(lr.B.LOGOUT_FAILURE,Zi.X8.Redirect,null,e),this.eventHandler.emitEvent(lr.B.LOGOUT_END,Zi.X8.Redirect),e}this.eventHandler.emitEvent(lr.B.LOGOUT_END,Zi.X8.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return lt.getAbsoluteUrl(t,ir())}}async function en(e,t,i,s,r){if(t.addQueueMeasurement(oi,s),!e)throw i.info("Navigate url is empty"),(0,Ji.bD)(es.B2);return r?Ls(sn,li,i,t,s)(e,r,t,s):ks(rn,ci,i,t,s)(e)}async function tn(e,t,i,s,n,o,a){return s.addQueueMeasurement(ai,o),new Promise((s,o)=>{t<1e4&&n.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${t}ms) than the default (10000ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(c),o((0,Ji.bD)(es.Uf))},t),c=window.setInterval(()=>{let t="";const i=e.contentWindow;try{t=i?i.location.href:""}catch(e){}if(!t||"about:blank"===t)return;let n="";i&&(n=a===r.zL.QUERY?i.location.search:i.location.hash),window.clearTimeout(l),window.clearInterval(c),s(n)},i)}).finally(()=>{ks(on,Vi,n,s,o)(e)})}function sn(e,t,i,s){return i.addQueueMeasurement(li,s),new Promise((i,s)=>{const r=nn();window.setTimeout(()=>{r?(r.src=e,i(r)):s("Unable to load iframe")},t)})}function rn(e){const t=nn();return t.src=e,t}function nn(){const e=document.createElement("iframe");return e.className="msalSilentIframe",e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(e),e}function on(e){document.body===e.parentNode&&document.body.removeChild(e)}class an extends Or{constructor(e,t,i,s,r,n,o,a,l,c,h){super(e,t,i,s,r,n,a,c,h),this.apiId=o,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(Bt,e.correlationId),e.loginHint||e.sid||e.account&&e.account.username||this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==r._M.NONE&&t.prompt!==r._M.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${r._M.NONE}`),t.prompt=r._M.NONE):t.prompt=r._M.NONE;const i=await Ls(this.initializeAuthorizationRequest.bind(this),ui,this.logger,this.performanceClient,e.correlationId)(t,Zi.X8.Silent);ar(i.authority);const s=this.initializeServerTelemetryManager(this.apiId);let n;try{return n=await Ls(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:s,requestAuthority:i.authority,requestAzureCloudOptions:i.azureCloudOptions,requestExtraQueryParameters:i.extraQueryParameters,account:i.account}),await Ls(this.silentTokenHelper.bind(this),ni,this.logger,this.performanceClient,e.correlationId)(n,i)}catch(i){if(i instanceof l.lR&&(i.setCorrelationId(this.correlationId),s.cacheFailedRequest(i)),!(n&&i instanceof l.lR&&i.errorCode===Zi.Q1.INVALID_GRANT_ERROR))throw i;this.performanceClient.addFields({retryError:i.errorCode},this.correlationId);const r=await Ls(this.initializeAuthorizationRequest.bind(this),ui,this.logger,this.performanceClient,e.correlationId)(t,Zi.X8.Silent);return await Ls(this.silentTokenHelper.bind(this),ni,this.logger,this.performanceClient,this.correlationId)(n,r)}}logout(){return Promise.reject((0,Ji.bD)(es.v7))}async silentTokenHelper(e,t){const i=t.correlationId;this.performanceClient.addQueueMeasurement(ni,i);const s=await Ls(this.initializeAuthorizationCodeRequest.bind(this),pi,this.logger,this.performanceClient,i)(t),n=await Ls(e.getAuthCodeUrl.bind(e),gi,this.logger,this.performanceClient,i)({...t,nativeBroker:Yr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),o=new qr(e,this.browserStorage,s,this.logger,this.performanceClient),a=await Ls(en,oi,this.logger,this.performanceClient,i)(n,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),l=this.config.auth.OIDCOptions.serverResponseType,c=await Ls(tn,ai,this.logger,this.performanceClient,i)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i,l),h=ks(Xr,Mi,this.logger,this.performanceClient,this.correlationId)(c,l,this.logger);if(h.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw(0,Ji.bD)(es.XC);const e=new $r(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,h.accountId,this.browserStorage,i),{userRequestState:s}=$s.parseRequestState(this.browserCrypto,t.state);return Ls(e.acquireToken.bind(e),Wt,this.logger,this.performanceClient,i)({...t,state:s,prompt:t.prompt||r._M.NONE})}return Ls(o.handleCodeResponse.bind(o),fi,this.logger,this.performanceClient,i)(h,t)}}class ln extends Or{async acquireToken(e){this.performanceClient.addQueueMeasurement(Vt,e.correlationId);const t=await Ls(Nr,ii,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),i={...e,...t};e.redirectUri&&(i.redirectUri=this.getRedirectUri(e.redirectUri));const s=this.initializeServerTelemetryManager(Zi.sA.acquireTokenSilent_silentFlow),r=await this.createRefreshTokenClient({serverTelemetryManager:s,authorityUrl:i.authority,azureCloudOptions:i.azureCloudOptions,account:i.account});return Ls(r.acquireTokenByRefreshToken.bind(r),Xt,this.logger,this.performanceClient,e.correlationId)(i).catch(e=>{throw e.setCorrelationId(this.correlationId),s.cacheFailedRequest(e),e})}logout(){return Promise.reject((0,Ji.bD)(es.v7))}async createRefreshTokenClient(e){const t=await Ls(this.getClientConfiguration.bind(this),di,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new zr(t,this.performanceClient)}}class cn{constructor(e,t,i,s){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=i,this.cryptoObj=s}loadExternalTokens(e,t,i){if(!this.isBrowserEnvironment)throw(0,Ji.bD)(es.tI);const s=t.id_token?ne(t.id_token,ms):void 0,r={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},n=e.authority?new _s(_s.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,r,this.logger,e.correlationId||Es()):void 0,o=this.loadAccount(e,i.clientInfo||t.client_info||"",s,n),a=this.loadIdToken(t,o.homeAccountId,o.environment,o.realm),l=this.loadAccessToken(e,t,o.homeAccountId,o.environment,o.realm,i),c=this.loadRefreshToken(t,o.homeAccountId,o.environment);return this.generateAuthenticationResult(e,{account:o,idToken:a,accessToken:l,refreshToken:c},s,n)}loadAccount(e,t,i,s){if(this.logger.verbose("TokenCache - loading account"),e.account){const t=nt.createFromAccountInfo(e.account);return this.storage.setAccount(t),t}if(!s||!t&&!i)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),(0,Ji.bD)(es.s9);const r=nt.generateHomeAccountId(t,s.authorityType,this.logger,this.cryptoObj,i),n=i?.tid,o=Ar(this.storage,s,r,ms,i,t,s.hostnameAndPort,n,void 0,void 0,this.logger);return this.storage.setAccount(o),o}loadIdToken(e,t,i,s){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const r=he(t,i,e.id_token,this.config.auth.clientId,s);return this.storage.setIdTokenCredential(r),r}loadAccessToken(e,t,i,s,r,n){if(!t.access_token)return this.logger.verbose("TokenCache - no access token found in response"),null;if(!t.expires_in)return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;if(!(t.scope||e.scopes&&e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null;this.logger.verbose("TokenCache - loading access token");const o=t.scope?Qe.fromString(t.scope):new Qe(e.scopes),a=n.expiresOn||t.expires_in+(new Date).getTime()/1e3,l=n.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+(new Date).getTime()/1e3,c=de(i,s,t.access_token,this.config.auth.clientId,r,o.printScopes(),a,l,ms);return this.storage.setAccessTokenCredential(c),c}loadRefreshToken(e,t,i){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const s=ue(t,i,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(s),s}generateAuthenticationResult(e,t,i,s){let r,n="",o=[],a=null;t?.accessToken&&(n=t.accessToken.secret,o=Qe.fromString(t.accessToken.target).asArray(),a=new Date(1e3*Number(t.accessToken.expiresOn)),r=new Date(1e3*Number(t.accessToken.extendedExpiresOn)));const l=t.account;return{authority:s?s.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:o,account:l.getAccountInfo(),idToken:t.idToken?.secret||"",idTokenClaims:i||{},accessToken:n,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:r,familyId:t.refreshToken?.familyId||"",tokenType:t?.accessToken?.tokenType||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}class hn extends Dr{constructor(e){super(e),this.includeRedirectUri=!1}}class dn extends Or{constructor(e,t,i,s,r,n,o,a,l,c){super(e,t,i,s,r,n,a,l,c),this.apiId=o}async acquireToken(e){if(!e.code)throw(0,Ji.bD)(es.R3);const t=await Ls(this.initializeAuthorizationRequest.bind(this),ui,this.logger,this.performanceClient,e.correlationId)(e,Zi.X8.Silent),i=this.initializeServerTelemetryManager(this.apiId);try{const s={...t,code:e.code},r=await Ls(this.getClientConfiguration.bind(this),di,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:i,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),n=new hn(r);this.logger.verbose("Auth code client created");const o=new qr(n,this.browserStorage,s,this.logger,this.performanceClient);return await Ls(o.handleCodeResponseFromServer.bind(o),mi,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),e}}logout(){return Promise.reject((0,Ji.bD)(es.v7))}}function un(e){const t=e?.idTokenClaims;return t?.tfp||t?.acr?"B2C":t?.tid?"9188040d-6c67-4c5b-b112-36a304b66dad"===t?.tid?"MSA":"AAD":void 0}function pn(e,t){try{nr(e)}catch(e){throw t.end({success:!1},e),e}}class gn{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Rs(this.logger,this.performanceClient):ie,this.eventHandler=new cr(this.logger),this.browserStorage=this.isBrowserEnvironment?new er(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,function(e){const t=e.cloudDiscoveryMetadata;let i;if(t)try{i=JSON.parse(t)}catch(e){throw Xe(Ge)}return{canonicalAuthority:e.authority?Os(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:i}}(this.config.auth),this.performanceClient):((e,t)=>{const i={cacheLocation:Zi.Al.MemoryStorage,temporaryCacheLocation:Zi.Al.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new er(e,i,ie,t)})(this.config.auth.clientId,this.logger);const t={cacheLocation:Zi.Al.MemoryStorage,temporaryCacheLocation:Zi.Al.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new er(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new cn(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const i=new gn(e);return await i.initialize(t),i}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized)return void this.logger.info("initialize has already been called, exiting early.");if(!this.isBrowserEnvironment)return this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,void this.eventHandler.emitEvent(lr.B.INITIALIZE_END);const t=e?.correlationId||this.getRequestCorrelationId(),i=this.config.system.allowNativeBroker,s=this.performanceClient.startMeasurement(ri,t);if(this.eventHandler.emitEvent(lr.B.INITIALIZE_START),i)try{this.nativeExtensionProvider=await Yr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(e){this.logger.verbose(e)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Ls(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),Hi,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(lr.B.INITIALIZE_END),s.end({allowNativeBroker:i,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),rr(this.initialized),this.isBrowserEnvironment){const t=e||"";let i=this.redirectResponse.get(t);return void 0===i?(i=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,i),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),i}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),s=i&&Yr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,r=s?i?.correlationId:this.browserStorage.getTemporaryCache(Zi._p.CORRELATION_ID,!0)||"",n=this.performanceClient.startMeasurement(_t,r);let o;if(this.eventHandler.emitEvent(lr.B.HANDLE_REDIRECT_START,Zi.X8.Redirect),s&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const e=new $r(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId);o=Ls(e.handleRedirectPromise.bind(e),Gi,this.logger,this.performanceClient,n.event.correlationId)(this.performanceClient,n.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const t=this.createRedirectClient(r);o=Ls(t.handleRedirectPromise.bind(t),Fi,this.logger,this.performanceClient,n.event.correlationId)(e,n)}return o.then(e=>(e?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(lr.B.LOGIN_SUCCESS,Zi.X8.Redirect,e),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_SUCCESS,Zi.X8.Redirect,e),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),n.end({success:!0,accountType:un(e.account)})):n.event.errorCode?n.end({success:!1}):n.discard(),this.eventHandler.emitEvent(lr.B.HANDLE_REDIRECT_END,Zi.X8.Redirect),e)).catch(e=>{const i=e;throw t.length>0?this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Redirect,null,i):this.eventHandler.emitEvent(lr.B.LOGIN_FAILURE,Zi.X8.Redirect,null,i),this.eventHandler.emitEvent(lr.B.HANDLE_REDIRECT_END,Zi.X8.Redirect),n.end({success:!1},i),e})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const i=this.performanceClient.startMeasurement("acquireTokenPreRedirect",t);i.add({accountType:un(e.account),scenarioId:e.scenarioId});const s=e.onRedirectNavigate;if(s)e.onRedirectNavigate=e=>{const t="function"==typeof s?s(e):void 0;return!1!==t?i.end({success:!0}):i.discard(),t};else{const e=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=t=>{const s="function"==typeof e?e(t):void 0;return!1!==s?i.end({success:!0}):i.discard(),s}}const r=this.getAllAccounts().length>0;try{let s;return or(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),r?this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_START,Zi.X8.Redirect,e):this.eventHandler.emitEvent(lr.B.LOGIN_START,Zi.X8.Redirect,e),s=this.nativeExtensionProvider&&this.canUseNative(e)?new $r(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,i).catch(i=>{if(i instanceof Vr&&Hr(i))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(i instanceof Ws)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),i}):this.createRedirectClient(t).acquireToken(e),await s}catch(e){throw i.end({success:!1},e),r?this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Redirect,null,e):this.eventHandler.emitEvent(lr.B.LOGIN_FAILURE,Zi.X8.Redirect,null,e),e}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Nt,t);i.add({scenarioId:e.scenarioId,accountType:un(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),pn(this.initialized,i),this.browserStorage.setInteractionInProgress(!0)}catch(e){return Promise.reject(e)}const s=this.getAllAccounts();let r;return s.length>0?this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_START,Zi.X8.Popup,e):this.eventHandler.emitEvent(lr.B.LOGIN_START,Zi.X8.Popup,e),r=this.canUseNative(e)?this.acquireTokenNative({...e,correlationId:t},Zi.sA.acquireTokenPopup).then(e=>(this.browserStorage.setInteractionInProgress(!1),i.end({success:!0,isNativeBroker:!0,requestId:e.requestId,accountType:un(e.account)}),e)).catch(i=>{if(i instanceof Vr&&Hr(i))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(i instanceof Ws)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),i}):this.createPopupClient(t).acquireToken(e),r.then(e=>(s.length<this.getAllAccounts().length?this.eventHandler.emitEvent(lr.B.LOGIN_SUCCESS,Zi.X8.Popup,e):this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_SUCCESS,Zi.X8.Popup,e),i.end({success:!0,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:un(e.account)}),e)).catch(e=>(s.length>0?this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Popup,null,e):this.eventHandler.emitEvent(lr.B.LOGIN_FAILURE,Zi.X8.Popup,null,e),i.end({success:!1},e),Promise.reject(e)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){const t=this.getRequestCorrelationId(e),i={...e,prompt:e.prompt,correlationId:t};let s;return this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Ht,t),this.ssoSilentMeasurement?.add({scenarioId:e.scenarioId,accountType:un(e.account)}),pn(this.initialized,this.ssoSilentMeasurement),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(lr.B.SSO_SILENT_START,Zi.X8.Silent,i),s=this.canUseNative(i)?this.acquireTokenNative(i,Zi.sA.ssoSilent).catch(e=>{if(e instanceof Vr&&Hr(e))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(i.correlationId).acquireToken(i);throw e}):this.createSilentIframeClient(i.correlationId).acquireToken(i),s.then(e=>(this.eventHandler.emitEvent(lr.B.SSO_SILENT_SUCCESS,Zi.X8.Silent,e),this.ssoSilentMeasurement?.end({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:un(e.account)}),e)).catch(e=>{throw this.eventHandler.emitEvent(lr.B.SSO_SILENT_FAILURE,Zi.X8.Silent,null,e),this.ssoSilentMeasurement?.end({success:!1},e),e}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const i=this.performanceClient.startMeasurement(Rt,t);pn(this.initialized,i),this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_BY_CODE_START,Zi.X8.Silent,e),i.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw(0,Ji.bD)(es.$c);if(e.code){const s=e.code;let r=this.hybridAuthCodeResponses.get(s);return r?(this.logger.verbose("Existing acquireTokenByCode request found",t),i.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),r=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(e=>(this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Zi.X8.Silent,e),this.hybridAuthCodeResponses.delete(s),i.end({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:un(e.account)}),e)).catch(e=>{throw this.hybridAuthCodeResponses.delete(s),this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_BY_CODE_FAILURE,Zi.X8.Silent,null,e),i.end({success:!1},e),e}),this.hybridAuthCodeResponses.set(s,r)),await r}if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId)){const s=await this.acquireTokenNative({...e,correlationId:t},Zi.sA.acquireTokenByCode,e.nativeAccountId).catch(e=>{throw e instanceof Vr&&Hr(e)&&(this.nativeExtensionProvider=void 0),e});return i.end({accountType:un(s.account),success:!0}),s}throw(0,Ji.bD)(es.gU)}throw(0,Ji.bD)(es.xp)}catch(e){throw this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_BY_CODE_FAILURE,Zi.X8.Silent,null,e),i.end({success:!1},e),e}}async acquireTokenByCodeAsync(e){this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(Oi,e.correlationId),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const t=this.createSilentAuthCodeClient(e.correlationId);return await t.acquireToken(e).then(e=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e)).catch(e=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},e),e}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(Qt,e.correlationId),t){case Zi.nN.Default:case Zi.nN.AccessToken:case Zi.nN.AccessTokenAndRefreshToken:const t=this.createSilentCacheClient(e.correlationId);return Ls(t.acquireToken.bind(t),Gt,this.logger,this.performanceClient,e.correlationId)(e);default:throw te(H)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(Pt,e.correlationId),t){case Zi.nN.Default:case Zi.nN.AccessTokenAndRefreshToken:case Zi.nN.RefreshToken:case Zi.nN.RefreshTokenAndNetwork:const t=this.createSilentRefreshClient(e.correlationId);return Ls(t.acquireToken.bind(t),Vt,this.logger,this.performanceClient,e.correlationId)(e);default:throw te(H)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(ti,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Ls(t.acquireToken.bind(t),Bt,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return or(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return nr(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}}async clearCache(e){if(!this.isBrowserEnvironment)return void this.logger.info("in non-browser environment, returning early.");const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return function(e,t,i,s){return e.verbose("getAllAccounts called"),i?t.getAllAccounts(s):[]}(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return function(e,t,i){if(t.trace("getAccount called"),0===Object.keys(e).length)return t.warning("getAccount: No accountFilter provided"),null;const s=i.getAccountInfoFilteredBy(e);return s?(t.verbose("getAccount: Account matching provided filter found, returning"),s):(t.verbose("getAccount: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByUsername(e){return function(e,t,i){if(t.trace("getAccountByUsername called"),!e)return t.warning("getAccountByUsername: No username provided"),null;const s=i.getAccountInfoFilteredBy({username:e});return s?(t.verbose("getAccountByUsername: Account matching username found, returning"),t.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${e}`),s):(t.verbose("getAccountByUsername: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return function(e,t,i){if(t.trace("getAccountByHomeId called"),!e)return t.warning("getAccountByHomeId: No homeAccountId provided"),null;const s=i.getAccountInfoFilteredBy({homeAccountId:e});return s?(t.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),t.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${e}`),s):(t.verbose("getAccountByHomeId: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return function(e,t,i){if(t.trace("getAccountByLocalId called"),!e)return t.warning("getAccountByLocalId: No localAccountId provided"),null;const s=i.getAccountInfoFilteredBy({localAccountId:e});return s?(t.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),t.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${e}`),s):(t.verbose("getAccountByLocalId: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}setActiveAccount(e){!function(e,t){t.setActiveAccount(e)}(e,this.browserStorage)}getActiveAccount(){return this.browserStorage.getActiveAccount()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const i=nt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(i),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,i){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw(0,Ji.bD)(es.XC);return new $r(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,i||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Yr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case r._M.NONE:case r._M.CONSENT:case r._M.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!(!t&&!this.getNativeAccountId(e)&&(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),1))}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new Zr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new Jr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new an(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new jr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new ln(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new dn(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return sr(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){try{e.key?.includes(r.Gd.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(lr.B.ACTIVE_ACCOUNT_CHANGED);const t=e.newValue||e.oldValue;if(!t)return;const i=JSON.parse(t);if("object"!=typeof i||!nt.isAccountEntity(i))return;const s=vt.toObject(new nt,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(lr.B.ACCOUNT_ADDED,void 0,s)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(lr.B.ACCOUNT_REMOVED,void 0,s))}catch(e){return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?Es():r.YM.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Zi.uq})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Zi.uq})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(kt,t);i.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),pn(this.initialized,i),this.logger.verbose("acquireTokenSilent called",t);const s=e.account||this.getActiveAccount();if(!s)throw(0,Ji.bD)(es.rR);i.add({accountType:un(s)});const n={clientId:this.config.auth.clientId,authority:e.authority||r.YM.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:s.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},o=JSON.stringify(n),a=this.activeSilentTokenRequests.get(o);if(void 0===a){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const r=Ls(this.acquireTokenSilentAsync.bind(this),Lt,this.logger,this.performanceClient,t)({...e,correlationId:t},s).then(t=>(this.activeSilentTokenRequests.delete(o),i.end({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),t)).catch(e=>{throw this.activeSilentTokenRequests.delete(o),i.end({success:!1},e),e});return this.activeSilentTokenRequests.set(o,r),{...await r,state:e.state}}return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),i.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,t){const i=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(Lt,e.correlationId),this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_START,Zi.X8.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",i);const s=await Ls(_r,si,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),r=e.cacheLookupPolicy||Zi.nN.Default;return this.acquireTokenSilentNoIframe(s,r).catch(async e=>{const t=function(e,t){const i=!(e instanceof Ws&&e.subError!==Vs),s=e.errorCode===Zi.Q1.INVALID_GRANT_ERROR||e.errorCode===H,r=i&&s||e.errorCode===Fs||e.errorCode===Bs,n=Zi.JE.includes(t);return r&&n}(e,r);if(t){if(this.activeIframeRequest){if(r!==Zi.nN.Skip){const[t,i]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${i}`,s.correlationId);const n=this.performanceClient.startMeasurement("awaitConcurrentIframe",s.correlationId);n.add({awaitIframeCorrelationId:i});const o=await t;if(n.end({success:o}),o)return this.logger.verbose(`Parallel iframe request with correlationId: ${i} succeeded. Retrying cache and/or RT redemption`,s.correlationId),this.acquireTokenSilentNoIframe(s,r);throw this.logger.info(`Iframe request with correlationId: ${i} failed. Interaction is required.`),e}return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",s.correlationId),Ls(this.acquireTokenBySilentIframe.bind(this),ti,this.logger,this.performanceClient,s.correlationId)(s)}{let e;return this.activeIframeRequest=[new Promise(t=>{e=t}),s.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",s.correlationId),Ls(this.acquireTokenBySilentIframe.bind(this),ti,this.logger,this.performanceClient,s.correlationId)(s).then(t=>(e(!0),t)).catch(t=>{throw e(!1),t}).finally(()=>{this.activeIframeRequest=void 0})}}throw e}).then(t=>(this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_SUCCESS,Zi.X8.Silent,t),e.correlationId&&this.performanceClient.addFields({fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,requestId:t.requestId},e.correlationId),t)).catch(e=>{throw this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Silent,null,e),e}).finally(()=>{document.removeEventListener("visibilitychange",i)})}async acquireTokenSilentNoIframe(e,t){return Yr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,Zi.sA.acquireTokenSilent_silentFlow).catch(async e=>{if(e instanceof Vr&&Hr(e))throw this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,te(H);throw e})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Ls(this.acquireTokenFromCache.bind(this),Qt,this.logger,this.performanceClient,e.correlationId)(e,t).catch(i=>{if(t===Zi.nN.AccessToken)throw i;return this.eventHandler.emitEvent(lr.B.ACQUIRE_TOKEN_NETWORK_START,Zi.X8.Silent,e),Ls(this.acquireTokenByRefreshToken.bind(this),Pt,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}class mn{static async createPublicClientApplication(e){const t=await async function(e){const t=new rs(e);return await t.initialize(),gn.createController(t,void 0)}(e);return new mn(e,t)}constructor(e,t){this.controller=t||new gn(new rs(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}},75970(e,t,i){"use strict";i.d(t,{bD:()=>l,jT:()=>a});var s=i(90865),r=i(2919);const n="For more visit: aka.ms/msaljs/browser-errors",o={[r.p5]:"The PKCE code challenge and verifier could not be generated.",[r.rc]:"The crypto object or function is not available.",[r.B2]:"Navigation URI is empty. Please check stack trace for more info.",[r.wv]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${n}`,[r.c$]:"Hash does not contain state. Please verify that the request originated from msal.",[r.Lm]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash.  ${n}`,[r.fA]:"Unable to parse state. Please verify that the request originated from msal.",[r.oe]:"Hash contains state but the interaction type does not match the caller.",[r.b]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.   ${n}`,[r.hs]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[r.MP]:"window.open returned null or undefined window object.",[r.fN]:"User cancelled the flow.",[r.OM]:`Token acquisition in popup failed due to timeout.  ${n}`,[r.Uf]:`Token acquisition in iframe failed due to timeout.  ${n}`,[r.OT]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[r.tZ]:`Request was blocked inside an iframe because MSAL detected an authentication response.  ${n}`,[r.aH]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[r.lg]:"The iframe being monitored was closed prematurely.",[r.v7]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[r.rR]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[r.hZ]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[r.y6]:"No token request found in cache.",[r.ot]:"The cached token request could not be parsed.",[r.Ne]:"No cached authority found.",[r.LW]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[r.Mm]:"Invalid cache type",[r.tI]:"Login and token requests are not supported in non-browser environments.",[r.rn]:"Database is not open!",[r.l7]:"No network connectivity. Check your internet connection.",[r.zv]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[r.Zw]:"Network request failed. Please check the network trace to determine root cause.",[r.db]:"Failed to parse network response. Check network trace.",[r.s9]:"Error loading token to cache.",[r.e0]:"Cryptographic Key or Keypair not found in browser storage.",[r.R3]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[r.xp]:"An authorization code or nativeAccountId must be provided to this flow.",[r.$c]:"Request cannot contain both spa code and native account id.",[r.MG]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[r.gU]:`Unable to acquire token from native platform.  ${n}`,[r.y3]:"Timed out while attempting to establish connection to browser extension",[r.cq]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[r.XC]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize().  ${n}`,[r.IR]:`You must call and await the initialize function before attempting to call any other MSAL API.  ${n}`,[r.nF]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[r._t]:"Invalid base64 encoded string.",[r.bT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true."};r.p5,r.p5,r.rc,r.rc,r.B2,r.B2,r.wv,r.wv,r.c$,r.c$,r.Lm,r.Lm,r.fA,r.fA,r.oe,r.oe,r.b,r.b,r.hs,r.hs,r.MP,r.MP,r.fN,r.fN,r.OM,r.OM,r.Uf,r.Uf,r.OT,r.OT,r.tZ,r.tZ,r.aH,r.aH,r.lg,r.lg,r.v7,r.v7,r.rR,r.rR,r.hZ,r.hZ,r.y6,r.y6,r.ot,r.ot,r.Ne,r.Ne,r.LW,r.LW,r.Mm,r.Mm,r.tI,r.tI,r.rn,r.rn,r.l7,r.l7,r.zv,r.zv,r.Zw,r.Zw,r.db,r.db,r.s9,r.s9,r.e0,r.e0,r.R3,r.R3,r.xp,r.xp,r.$c,r.$c,r.MG,r.MG,r.gU,r.gU,r.y3,r.y3,r.cq,r.cq,r.XC,r.XC,r.IR,r.IR,r.nF,r.nF,r._t,r._t,r.bT,r.bT;class a extends s.lR{constructor(e){super(e,o[e]),Object.setPrototypeOf(this,a.prototype),this.name="BrowserAuthError"}}function l(e){return new a(e)}},2919(e,t,i){"use strict";i.d(t,{$c:()=>B,B2:()=>n,IR:()=>j,LW:()=>T,Lm:()=>l,MG:()=>V,MP:()=>p,Mm:()=>D,Ne:()=>A,OM:()=>m,OT:()=>y,R3:()=>F,Uf:()=>f,XC:()=>W,Zw:()=>L,_t:()=>$,aH:()=>C,b:()=>d,bT:()=>Y,c$:()=>a,cq:()=>z,db:()=>N,e0:()=>O,fA:()=>c,fN:()=>g,gU:()=>H,hZ:()=>x,hs:()=>u,l7:()=>P,lg:()=>b,nF:()=>K,oe:()=>h,ot:()=>M,p5:()=>s,rR:()=>w,rc:()=>r,rn:()=>R,s9:()=>_,tI:()=>I,tZ:()=>v,v7:()=>S,wv:()=>o,xp:()=>G,y3:()=>U,y6:()=>E,zv:()=>k});const s="pkce_not_created",r="crypto_nonexistent",n="empty_navigate_uri",o="hash_empty_error",a="no_state_in_hash",l="hash_does_not_contain_known_properties",c="unable_to_parse_state",h="state_interaction_type_mismatch",d="interaction_in_progress",u="popup_window_error",p="empty_window_error",g="user_cancelled",m="monitor_popup_timeout",f="monitor_window_timeout",y="redirect_in_iframe",v="block_iframe_reload",C="block_nested_popups",b="iframe_closed_prematurely",S="silent_logout_unsupported",w="no_account_error",x="silent_prompt_value_error",E="no_token_request_cache_error",M="unable_to_parse_token_request_cache_error",A="no_cached_authority_error",T="auth_request_not_set_error",D="invalid_cache_type",I="non_browser_environment",R="database_not_open",P="no_network_connectivity",k="post_request_failed",L="get_request_failed",N="failed_to_parse_response",_="unable_to_load_token",O="crypto_key_not_found",F="auth_code_required",G="auth_code_or_nativeAccountId_required",B="spa_code_and_nativeAccountId_present",V="database_unavailable",H="unable_to_acquire_token_from_native_platform",U="native_handshake_timeout",z="native_extension_not_installed",W="native_connection_not_established",j="uninitialized_public_client_application",K="native_prompt_not_supported",$="invalid_base64_string",Y="invalid_pop_token_request"},24680(e,t,i){"use strict";i.d(t,{jz:()=>a});var s=i(90865),r=i(85362);const n={[r.xz]:"Given storage configuration option was not supported.",[r.dg]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[r.jE]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};r.xz,r.xz,r.dg,r.dg,r.jE,r.jE;class o extends s.lR{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,o.prototype)}}function a(e){return new o(e,n[e])}},85362(e,t,i){"use strict";i.d(t,{dg:()=>r,jE:()=>n,xz:()=>s});const s="storage_not_supported",r="stubbed_public_client_application_called",n="in_mem_redirect_unavailable"},99268(e,t,i){"use strict";i.d(t,{B:()=>s});const s={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"}},58090(e,t,i){"use strict";i.d(t,{$u:()=>v,Al:()=>a,CC:()=>l,Ct:()=>o,G8:()=>C,H3:()=>d,JD:()=>n,JE:()=>w,L$:()=>x,P3:()=>E,Q1:()=>r,T$:()=>g,WJ:()=>b,X8:()=>p,_p:()=>c,dh:()=>h,f7:()=>y,jb:()=>f,nN:()=>S,sA:()=>u,uq:()=>m});var s=i(14927);const r={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},n={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},o={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},a={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},l={GET:"GET",POST:"POST"},c={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},h={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},d={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},u={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var p;!function(e){e.Redirect="redirect",e.Popup="popup",e.Silent="silent",e.None="none"}(p||(p={}));const g={Startup:"startup",Login:"login",Logout:"logout",AcquireToken:"acquireToken",SsoSilent:"ssoSilent",HandleRedirect:"handleRedirect",None:"none"},m={scopes:s.aZ},f="jwk",y={React:"@azure/msal-react",Angular:"@azure/msal-angular"},v="msal.db",C=1,b=`${v}.keys`,S={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},w=[S.Default,S.Skip,S.RefreshTokenAndNetwork],x="msal.browser.log.level",E="msal.browser.log.pii"},90865(e,t,i){"use strict";i.d(t,{lR:()=>o,pz:()=>a});var s=i(14927),r=i(5841);const n={[r.W]:"Unexpected error in authentication.",[r.z]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};r.W,r.W,r.z,r.z;class o extends Error{constructor(e,t,i){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,o.prototype),this.errorCode=e||s.YM.EMPTY_STRING,this.errorMessage=t||s.YM.EMPTY_STRING,this.subError=i||s.YM.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function a(e,t){return new o(e,t?`${n[e]} ${t}`:n[e])}},5841(e,t,i){"use strict";i.d(t,{W:()=>s,z:()=>r});const s="unexpected_error",r="post_request_failed"},95177(e,t,i){"use strict";i.d(t,{$:()=>s,V:()=>n});var s,r=i(14927);!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(s||(s={}));class n{constructor(e,t,i){this.level=s.Info;const o=e||n.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||(()=>{}),this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level="number"==typeof o.logLevel?o.logLevel:s.Info,this.correlationId=o.correlationId||r.YM.EMPTY_STRING,this.packageName=t||r.YM.EMPTY_STRING,this.packageVersion=i||r.YM.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:s.Info}}clone(e,t,i){return new n({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const i=`[${(new Date).toUTCString()}] : [${t.correlationId||this.correlationId||""}] : ${this.packageName}@${this.packageVersion} : ${s[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,i,t.containsPii||!1)}executeCallback(e,t,i){this.localCallback&&this.localCallback(e,t,i)}error(e,t){this.logMessage(e,{logLevel:s.Error,containsPii:!1,correlationId:t||r.YM.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:s.Error,containsPii:!0,correlationId:t||r.YM.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:s.Warning,containsPii:!1,correlationId:t||r.YM.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:s.Warning,containsPii:!0,correlationId:t||r.YM.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:s.Info,containsPii:!1,correlationId:t||r.YM.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:s.Info,containsPii:!0,correlationId:t||r.YM.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:s.Verbose,containsPii:!1,correlationId:t||r.YM.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:s.Verbose,containsPii:!0,correlationId:t||r.YM.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:s.Trace,containsPii:!1,correlationId:t||r.YM.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:s.Trace,containsPii:!0,correlationId:t||r.YM.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}},14927(e,t,i){"use strict";i.d(t,{$x:()=>m,E_:()=>x,F0:()=>N,Fq:()=>h,GU:()=>C,Gd:()=>l,I:()=>T,IO:()=>M,JR:()=>b,Kk:()=>I,LR:()=>y,Lz:()=>L,OK:()=>a,Qd:()=>f,Rv:()=>k,Tq:()=>D,Xw:()=>A,YM:()=>s,_2:()=>P,_A:()=>o,_M:()=>d,aG:()=>v,aZ:()=>n,gT:()=>E,hB:()=>S,iF:()=>u,jZ:()=>R,p:()=>g,t3:()=>r,u0:()=>w,v2:()=>c,zL:()=>p});const s={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},r={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},n=[s.OPENID_SCOPE,s.PROFILE_SCOPE,s.OFFLINE_ACCESS_SCOPE],o=[...n,s.EMAIL_SCOPE],a={CONTENT_TYPE:"Content-Type",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},l={ID_TOKEN:"idtoken",CLIENT_INFO:"client.info",ADAL_ID_TOKEN:"adal.idtoken",ERROR:"error",ERROR_DESC:"error.description",ACTIVE_ACCOUNT:"active-account",ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},c={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},h={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},d={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},u={PLAIN:"plain",S256:"S256"},p={QUERY:"query",FRAGMENT:"fragment"},g={...p,FORM_POST:"form_post"},m={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},f={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},y={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},v={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},C="appmetadata",b="client_info",S="1",w={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:86400},x={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},E={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},M={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},A={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},T={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},D={username:"username",password:"password"},I={httpSuccess:200,httpBadRequest:400},R={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},P={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},k={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},L={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},N=300},55534(e,t,i){"use strict";i.d(t,{r7:()=>v,dk:()=>C});var s=i(22155),r=i(24680),n=i(85362);const o={initialize:()=>Promise.reject((0,r.jz)(n.dg)),acquireTokenPopup:()=>Promise.reject((0,r.jz)(n.dg)),acquireTokenRedirect:()=>Promise.reject((0,r.jz)(n.dg)),acquireTokenSilent:()=>Promise.reject((0,r.jz)(n.dg)),acquireTokenByCode:()=>Promise.reject((0,r.jz)(n.dg)),getAllAccounts:()=>[],getAccount:()=>null,getAccountByHomeId:()=>null,getAccountByUsername:()=>null,getAccountByLocalId:()=>null,handleRedirectPromise:()=>Promise.reject((0,r.jz)(n.dg)),loginPopup:()=>Promise.reject((0,r.jz)(n.dg)),loginRedirect:()=>Promise.reject((0,r.jz)(n.dg)),logout:()=>Promise.reject((0,r.jz)(n.dg)),logoutRedirect:()=>Promise.reject((0,r.jz)(n.dg)),logoutPopup:()=>Promise.reject((0,r.jz)(n.dg)),ssoSilent:()=>Promise.reject((0,r.jz)(n.dg)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,enableAccountStorageEvents:()=>{},disableAccountStorageEvents:()=>{},getTokenCache:()=>{throw(0,r.jz)(n.dg)},getLogger:()=>{throw(0,r.jz)(n.dg)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw(0,r.jz)(n.dg)},hydrateCache:()=>Promise.reject((0,r.jz)(n.dg)),clearCache:()=>Promise.reject((0,r.jz)(n.dg))};var a=i(58090),l=i(95177);const c={instance:o,inProgress:a.T$.None,accounts:[],logger:new l.V({})},h=s.createContext(c);h.Consumer;var d=i(99268);class u{static getInteractionStatusFromEvent(e,t){switch(e.eventType){case d.B.LOGIN_START:return a.T$.Login;case d.B.SSO_SILENT_START:return a.T$.SsoSilent;case d.B.ACQUIRE_TOKEN_START:if(e.interactionType===a.X8.Redirect||e.interactionType===a.X8.Popup)return a.T$.AcquireToken;break;case d.B.HANDLE_REDIRECT_START:return a.T$.HandleRedirect;case d.B.LOGOUT_START:return a.T$.Logout;case d.B.SSO_SILENT_SUCCESS:case d.B.SSO_SILENT_FAILURE:if(t&&t!==a.T$.SsoSilent)break;return a.T$.None;case d.B.LOGOUT_END:if(t&&t!==a.T$.Logout)break;return a.T$.None;case d.B.HANDLE_REDIRECT_END:if(t&&t!==a.T$.HandleRedirect)break;return a.T$.None;case d.B.LOGIN_SUCCESS:case d.B.LOGIN_FAILURE:case d.B.ACQUIRE_TOKEN_SUCCESS:case d.B.ACQUIRE_TOKEN_FAILURE:case d.B.RESTORE_FROM_BFCACHE:if(e.interactionType===a.X8.Redirect||e.interactionType===a.X8.Popup){if(t&&t!==a.T$.Login&&t!==a.T$.AcquireToken)break;return a.T$.None}}return null}}function p(e,t){if(e.length!==t.length)return!1;const i=[...t];return e.every(e=>{const t=i.shift();return!(!e||!t)&&e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username})}const g="2.1.1",m="UNBLOCK_INPROGRESS",f="EVENT",y=(e,t)=>{const{type:i,payload:s}=t;let r=e.inProgress;switch(i){case m:e.inProgress===a.T$.Startup&&(r=a.T$.None,s.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case f:const t=s.message,n=u.getInteractionStatusFromEvent(t,e.inProgress);n&&(s.logger.info(`MsalProvider - ${t.eventType} results in setting inProgress from ${e.inProgress} to ${n}`),r=n);break;default:throw new Error(`Unknown action type: ${i}`)}const n=s.instance.getAllAccounts();return r===e.inProgress||p(n,e.accounts)?r!==e.inProgress?{...e,inProgress:r}:p(n,e.accounts)?e:{...e,accounts:n}:{...e,inProgress:r,accounts:n}};function v({instance:e,children:t}){(0,s.useEffect)(()=>{e.initializeWrapperLibrary(a.f7.React,g)},[e]);const i=(0,s.useMemo)(()=>e.getLogger().clone("@azure/msal-react",g),[e]),[r,n]=(0,s.useReducer)(y,void 0,()=>({inProgress:a.T$.Startup,accounts:e.getAllAccounts()}));(0,s.useEffect)(()=>{const t=e.addEventCallback(t=>{n({payload:{instance:e,logger:i,message:t},type:f})});return i.verbose(`MsalProvider - Registered event callback with id: ${t}`),e.initialize().then(()=>{e.handleRedirectPromise().catch(()=>{}).finally(()=>{n({payload:{instance:e,logger:i},type:m})})}).catch(()=>{}),()=>{t&&(i.verbose(`MsalProvider - Removing event callback ${t}`),e.removeEventCallback(t))}},[e,i]);const o={instance:e,inProgress:r.inProgress,accounts:r.accounts,logger:i};return s.createElement(h.Provider,{value:o},t)}const C=()=>(0,s.useContext)(h);i(90865).lR},20301(e,t,i){"use strict";function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=Array(t);i<t;i++)s[i]=e[i];return s}i.d(t,{A:()=>s})},96701(e,t,i){"use strict";function s(e){if(Array.isArray(e))return e}i.d(t,{A:()=>s})},13925(e,t,i){"use strict";function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i.d(t,{A:()=>s})},77401(e,t,i){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,{A:()=>s})},48209(e,t,i){"use strict";i.d(t,{A:()=>n});var s=i(61444);function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,s.A)(r.key),r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}},42750(e,t,i){"use strict";function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(r=function(){return!!e})()}i.d(t,{A:()=>a});var n=i(97408),o=i(13925);function a(e){var t=r();return function(){var i,r=s(e);if(t){var a=s(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"==(0,n.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.A)(e)}(this,i)}}},80663(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(61444);function r(e,t,i){return(t=(0,s.A)(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}},69932(e,t,i){"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},s.apply(null,arguments)}i.d(t,{A:()=>s})},92041(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(60074);function r(e,t){if("function"!=typeof t&&null!==t)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&&(0,s.A)(e,t)}},20415(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(60074);function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,s.A)(e,t)}},88753(e,t,i){"use strict";function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}i.d(t,{A:()=>s})},55222(e,t,i){"use strict";function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}i.d(t,{A:()=>s})},83479(e,t,i){"use strict";i.d(t,{A:()=>n});var s=i(80663);function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach(function(t){(0,s.A)(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}},90009(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(12975);function r(e,t){if(null==e)return{};var i,r,n=(0,s.A)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)i=o[r],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}},12975(e,t,i){"use strict";function s(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}i.d(t,{A:()=>s})},60074(e,t,i){"use strict";function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}i.d(t,{A:()=>s})},89324(e,t,i){"use strict";i.d(t,{A:()=>o});var s=i(96701),r=i(89876),n=i(55222);function o(e,t){return(0,s.A)(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var s,r,n,o,a=[],l=!0,c=!1;try{if(n=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(s=n.call(i)).done)&&(a.push(s.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(e,t)||(0,r.A)(e,t)||(0,n.A)()}},14364(e,t,i){"use strict";function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}i.d(t,{A:()=>s})},54523(e,t,i){"use strict";i.d(t,{A:()=>a});var s=i(96701),r=i(88753),n=i(89876),o=i(55222);function a(e){return(0,s.A)(e)||(0,r.A)(e)||(0,n.A)(e)||(0,o.A)()}},72432(e,t,i){"use strict";i.d(t,{A:()=>o});var s=i(20301),r=i(88753),n=i(89876);function o(e){return function(e){if(Array.isArray(e))return(0,s.A)(e)}(e)||(0,r.A)(e)||(0,n.A)(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.")}()}},61444(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(97408);function r(e){var t=function(e){if("object"!=(0,s.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=(0,s.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,s.A)(t)?t:t+""}},97408(e,t,i){"use strict";function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}i.d(t,{A:()=>s})},89876(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(20301);function r(e,t){if(e){if("string"==typeof e)return(0,s.A)(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?(0,s.A)(e,t):void 0}}},45401(e,t,i){"use strict";i.d(t,{Ku:()=>Ty,LW:()=>ES,Mo:()=>CS,On:()=>Dy,a9:()=>TS,n1:()=>DS,uB:()=>iw,ui:()=>fS,xv:()=>$i});var s=i(26203),r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=(e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})},a=(e,t,i,s)=>{for(var o,a=s>1?void 0:s?n(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s?o(t,i,a):o(a))||a);return s&&a&&r(t,i,a),a},l=class{constructor(){this.destroyFns=[]}destroy(){for(const e of this.destroyFns)e()}},c=new class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...e){for(const t of e){this.registerDependencies(t);const e=this.modules.find(e=>!(t.type!==e.type||"optionsKey"in t&&"optionsKey"in e&&t.optionsKey!==e.optionsKey||t.identifier!==e.identifier));if(e){if("enterprise"===t.packageType&&"community"===e.packageType){const i=this.modules.indexOf(e);this.modules.splice(i,1,t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}else this.modules.push(t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}hasEnterpriseModules(){return this.modules.some(e=>"enterprise"===e.packageType)}*byType(...e){const t=new Set,i=this.modules.filter(t=>e.includes(t.type)),s=e=>{const t=this.dependencies.get(e);return t?.flatMap(s).concat(t)??[]},r=[];for(const n of i){const i="optionsKey"in n?n.optionsKey:n.contextKey;if(!t.has(i)){for(const n of s(i)){if(t.has(n))continue;const i=this.modulesByOptionKey.get(n);i?e.includes(i.type)&&(yield i,t.add(n)):r.push(n)}yield n,t.add(i)}}if(r.length>0)throw new Error(`Could not resolve module dependencies: ${r}`)}registerDependencies(e){if(null==e.dependencies||0===e.dependencies.length)return;const t="optionsKey"in e?e.optionsKey:e.contextKey;this.dependencies.set(t,e.dependencies)}},h={containsPoint:function(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height},equals:function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},isEmpty:function(e){return null==e||0===e.height||0===e.width||isNaN(e.height)||isNaN(e.width)},normalize:function(e){let{x:t,y:i,width:s,height:r}=e;return(null==s||s>0)&&(null==r||r>0)?e:(null!=t&&null!=s&&s<0&&(s=-s,t-=s),null!=i&&null!=r&&r<0&&(r=-r,i-=r),{x:t,y:i,width:s,height:r})}},d=Symbol("interpolate"),u=e=>null!=e[d];function p(e,t,i,s=1/0){const r={nearest:void 0,distanceSquared:s};for(const s of i){const i=s.distanceSquared(e,t);if(0===i)return{nearest:s,distanceSquared:0};i<r.distanceSquared&&(r.nearest=s,r.distanceSquared=i)}return r}function g(e,t,i,s=1/0){const{x:r=e,y:n=t}=i.transformPoint?.(e,t)??{},o={nearest:void 0,distanceSquared:s};for(const e of i.children){const{nearest:t,distanceSquared:i}=e.nearestSquared(r,n,o.distanceSquared);if(0===i)return{nearest:t,distanceSquared:i};i<o.distanceSquared&&(o.nearest=t,o.distanceSquared=i)}return o}var m=class e{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}static fromDOMRect({x:t,y:i,width:s,height:r}){return new e(t,i,s,r)}static merge(t){let i=1/0,s=1/0,r=-1/0,n=-1/0;for(const e of t)e.x<i&&(i=e.x),e.y<s&&(s=e.y),e.x+e.width>r&&(r=e.x+e.width),e.y+e.height>n&&(n=e.y+e.height);return new e(i,s,r-i,n-s)}static nearestBox(e,t,i){return p(e,t,i)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON:()=>({})}}clone(){const{x:t,y:i,width:s,height:r}=this;return new e(t,i,s,r)}equals(e){return h.equals(this,e)}containsPoint(e,t){return h.containsPoint(this,e,t)}intersection(t){if(!this.collidesBBox(t))return;const i=(0,s.qE)(t.x,this.x,t.x+t.width),r=(0,s.qE)(t.y,this.y,t.y+t.height),n=(0,s.qE)(t.x,this.x+this.width,t.x+t.width),o=(0,s.qE)(t.y,this.y+this.height,t.y+t.height);return new e(i,r,n-i,o-r)}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const i=e-(0,s.qE)(this.x,e,this.x+this.width),r=t-(0,s.qE)(this.y,t,this.y+this.height);return i*i+r*r}shrink(e,t){if("number"==typeof e)this.applyMargin(e,t);else for(const t of Object.keys(e)){const i=e[t];"number"==typeof i&&this.applyMargin(i,t)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,t){if("number"==typeof e)this.applyMargin(-e,t);else for(const t of Object.keys(e)){const i=e[t];"number"==typeof i&&this.applyMargin(-i,t)}return this}applyMargin(e,t){switch(t){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=2*e;break;case"horizontal":this.x+=e,this.width-=2*e;break;case void 0:this.x+=e,this.y+=e,this.width-=2*e,this.height-=2*e}}translate(e,t){return this.x+=e,this.y+=t,this}[d](t,i){return new e(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};m.zero=Object.freeze(new m(0,0,0,0)),m.NaN=Object.freeze(new m(NaN,NaN,NaN,NaN));var f=m,y=Date.now(),v={create:(...e)=>Object.assign((...t)=>{v.check(...e)&&("function"==typeof t[0]&&(t=(0,s.$r)(t[0]())),(()=>{const e=Date.now()-y;if(e>2e3){const t=(Math.floor(e/100)/10).toFixed(1);s.Vy.log(`**** ${t}s since last log message ****`)}y=Date.now()})(),s.Vy.log(...t))},{check:()=>v.check(...e),group:(t,i)=>v.check(...e)?s.Vy.logGroup(t,i):i()}),check:(...e)=>(0===e.length&&e.push(!0),(0,s.$r)((0,s.zk)("agChartsDebug")).some(t=>e.includes(t))),inDevelopmentMode(e){if(v.check("dev"))return e()}};function C({context:e,pixelRatio:t,width:i,height:s}){e.save(),e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t)),e.restore()}function b(e){if(v.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(0===s)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(0!==s)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function S(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var w=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:r=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[n,o]=S(t,i,s);this.canvas=new OffscreenCanvas(n,o),this.context=this.canvas.getContext("2d",{willReadFrequently:r}),this.context.setTransform(s,0,0,s,0,0),b(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:r}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[r,n]=S(e,t,i);s.width=r,s.height=n}r.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){C(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},x=Symbol("BREAK"),E="__decorator_config",M="__decorator_accessors";function A(e,t){if(null==Object.getOwnPropertyDescriptor(e,E)&&Object.defineProperty(e,E,{value:{}}),null==Object.getOwnPropertyDescriptor(e,M)){const t=Object.getPrototypeOf(e)?.[M],i=t?.slice()??[];Object.defineProperty(e,M,{value:i})}const i=e[E],s=t.toString();if(null!=i[s])return i[s];i[s]={setters:[],getters:[],observers:[]};const r=Object.getOwnPropertyDescriptor(e,t);let n=r?.get,o=r?.set;if(null==n||null==o){const i=e[M];let s=i.indexOf(t);-1===s&&(s=i.push(t)-1),n??(n=function(){let e=this.__accessors;return null==e&&(e=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:e})),e[s]}),o??(o=function(e){let t=this.__accessors;null==t&&(t=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:t})),t[s]=e})}return Object.defineProperty(e,t,{set:function(e){const{setters:r,observers:a}=i[s];let l;r.some(e=>e.length>2)&&(l=n.call(this));for(const i of r)if((e=i(this,t,e,l))===x)return;o.call(this,e);for(const t of a)t(this,e,l)},get:function(){let e=n.call(this);for(const r of i[s].getters)if(e=r(this,t,e),e===x)return;return e},enumerable:!0,configurable:!1}),i[s]}function T(e,t,i){return(s,r)=>{const n=A(s,r);n.setters.push(e),t&&n.getters.unshift(t),i&&Object.assign(n,i)}}function D(e){return(t,i)=>{A(t,i).observers.push(e)}}function I(e){return void 0!==e&&E in e}function R(e){const t=new Set;for(;I(e);)t.add(e?.[E]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(e=>Object.keys(e))}function P(e){return R(e).reduce((t,i)=>(t[i]=e[i]??null,t),{})}function k(e,t){return Array.isArray(e)?!!Array.isArray(t)&&e.length===t.length&&e.every((e,i)=>k(e,t[i])):(0,s.Qd)(e)?!!(0,s.Qd)(t)&&L(e,t,k):e===t}function L(e,t,i){if(Object.is(e,t))return!0;for(const i of Object.keys(t))if(!(i in e))return!1;for(const s of Object.keys(e)){if(!(s in t))return!1;if(!i(e[s],t[s]))return!1}return!0}function N(...e){const t={};for(const i of e){if(!(0,s.Gv)(i))continue;const e=I(i)?R(i):Object.keys(i);for(const r of e)(0,s.Qd)(t[r])&&(0,s.Qd)(i[r])?t[r]=N(t[r],i[r]):t[r]??(t[r]=i[r])}return t}function _(...e){const t={};for(const i of e){if(!(0,s.Gv)(i))continue;const e=I(i)?R(i):Object.keys(i);for(const r of e)(0,s.Qd)(t[r])&&(0,s.Qd)(i[r])?t[r]=_(t[r],i[r]):r in t||(t[r]??(t[r]=i[r]))}return t}function O(e,...t){return t&&(0,s.cy)(e)?e.map(e=>N(e,...t)):e}function F(e,t){const i={};for(const[r,n]of(0,s.jO)(e))i[r]=t(n,r,e);return i}function G(e,t){const i={...e};for(const e of t)delete i[e];return i}function B(e,t){return((0,s.cy)(t)?t:t.split(".")).reduce((e,t)=>e[t],e)}var V=new Set(["__proto__","constructor","prototype"]);function H(e,t,i){const r=(0,s.cy)(t)?t.slice():t.split("."),n=r.pop();if(r.some(e=>V.has(e)))return;const o=r.reduce((e,t)=>e[t],e);return o[n]=i,o[n]}function U(e,t,i){if(void 0===i)return t;for(const s of e){const e=i[s];void 0!==e&&(t[s]=e)}return t}function z(e){return null!=e&&"object"==typeof e&&(0,s.Qd)(e)?(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const i=e[t];null===i||"object"!=typeof i&&"function"!=typeof i||Object.isFrozen(i)||z(i)}),e):e}function W(e,t){return(0,s.Qd)(e)&&t in e}function j(e,t){return W(e,t)&&"string"==typeof e[t]}var K=(e,t)=>e===t;function $(e){return function(t,i){const s=`__${i}`;t[i]||function(e,t,i,s){const{changeCb:r,convertor:n,checkDirtyOnAssignment:o=!1}=s??{},a={changeCb:r,checkDirtyOnAssignment:o,convertor:n},l=function(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(i){const s=t.call(this,i);return!0===i?._dirty&&this.markDirty(e),s}:t}(i,function(e,t){const{changeCb:i}=t;return i?function(t){const s=e.call(this,t);return s!==X&&i.call(this,this),s}:e}(function(e,t){const{convertor:i}=t;return i?function(t){e.call(this,i(t))}:e}(function(e,t){const{equals:i=K}=t;return function(t){const s=this[e];return i(t,s)?X:(this[e]=t,this.onChangeDetection(e),t)}}(i,a),a),a),a);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}(t,i,s,e)}}function Y(e){return $(e)}function q(e){return(e??{}).equals=s.r1,$(e)}var X=Symbol("no-change"),Z=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(Z||{}),Q=class e{constructor(t){this.serialNumber=e._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,s.sX)(this),this.pointerEvents=0,this.scene=void 0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,(t?.debugDirty??e._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,t,i){const r=e?.toSVG();if(null==r||!r.elements.length&&!r.defs?.length)return;const n=(0,s.FJ)("svg");if(n.setAttribute("width",String(t)),n.setAttribute("height",String(i)),n.setAttribute("viewBox",`0 0 ${t} ${i}`),r.defs?.length){const e=(0,s.FJ)("defs");e.append(...r.defs),n.append(e)}return n.append(...r.elements),n.outerHTML}static*extractBBoxes(e,t){for(const i of e)if(!t||i.visible&&!i.transitionOut){const e=i.getBBox();e&&(yield e)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}get dirty(){return this._dirty}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(null!=e)return e}preRender(e,t=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=t,this.childNodeCounts.thisComplexity=t;for(const t of this.children()){const i=t.preRender(e);this.childNodeCounts.groups+=i.groups,this.childNodeCounts.nonGroups+=i.nonGroups,this.childNodeCounts.complexity+=i.complexity}return this.childNodeCounts}render(e){const{stats:t}=e;if(this._dirty=!1,this.debugDirtyProperties(),e.debugNodeSearch){const t=this.name??this.id;e.debugNodeSearch.some(e=>"string"==typeof e?e===t:e.test(t))&&(e.debugNodes[this.name??this.id]=this)}t&&(t.nodesRendered++,t.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e,this._debug=e?.layersManager?.debug;for(const t of this.children())t.setScene(e)}sortChildren(e){if(this.dirtyZIndex=!1,!this.childNodes)return;const t=[...this.childNodes].sort(e);this.childNodes.clear();for(const e of t)this.childNodes.add(e)}*traverseUp(e){let t=this;for(e&&(yield t);t=t.parentNode;)yield t}*children(){if(this.childNodes)for(const e of this.childNodes)yield e}*descendants(){for(const e of this.children())yield e,yield*e.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(e){this.childNodes??(this.childNodes=new Set);for(const t of(0,s.Rp)(e))t.parentNode?.removeChild(t),this.childNodes.add(t),t.parentNode=this,t.setScene(this.scene);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);delete e.parentNode,e.setScene(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(e,t){if(t)for(const i of t)this[i]=e[i];else Object.assign(this,e);return this}containsPoint(e,t){return!1}pickNode(e,t){if(this.visible&&1!==this.pointerEvents&&this.containsPoint(e,t))if(null!=this.childNodes&&0!==this.childNodes.size){const i=[...this.children()];for(let s=i.length-1;s>=0;s--){const r=i[s].pickNode(e,t);if(r)return r}}else if(!this.isContainerNode)return this}pickNodes(e,t,i=[]){if(!this.visible||1===this.pointerEvents||!this.containsPoint(e,t))return i;this.isContainerNode||i.push(this);for(const s of this.children())s.pickNodes(e,t,i);return i}invalidateCachedBBox(){null!=this.cachedBBox&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return null==this.cachedBBox&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirty(e){const{_dirty:t}=this;null!=e&&this._debugDirtyProperties&&this.markDebugProperties(e),null==this.cachedBBox&&t||(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const e of this.children())e.markClean()}}markDebugProperties(e){const t=this._debugDirtyProperties?.get(e)??[],i=(new Error).stack?.split("\n").filter(e=>!("Error"===e||e.includes(".markDebugProperties")||e.includes(".markDirty")||e.includes("Object.assign ")||e.includes(`${this.constructor.name}.`)))??"unknown";t.push(i[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,t)}debugDirtyProperties(){null!=this._debugDirtyProperties&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((e,t)=>{e.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${t} (${e.length}x)`),e.forEach(e=>console.log(e)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:e}=this;e&&(e.dirtyZIndex=!0)}toSVG(){}};Q._nextSerialNumber=0,Q._debugEnabled=!1,a([$()],Q.prototype,"visible",2),a([Y({equals:k,changeCb:e=>e.onZIndexChange()})],Q.prototype,"zIndex",2);var J=Q,ee=2*Math.PI,te=Math.PI/2;function ie(e){return e%=ee,(e+=ee)%ee}function se(e){return e%=ee,(e+=ee)!==ee&&(e%=ee),e}function re(e){return(e%=ee)<-Math.PI?e+=ee:e>=Math.PI&&(e-=ee),e}function ne(e,t,i){const s=ie(e),r=ie(t),n=ie(i);return r<n?r<=s&&s<=n:!(r>n)||r<=s||s<=n}function oe(e){return e/180*Math.PI}function ae(e){return e/Math.PI*180}function le(e,t){return e=ie(e),(t=ie(t))-e+(e>t?ee:0)}function ce(e){const t=ie(e);return t<=te?t/te:t<=Math.PI?(Math.PI-t)/te:t<=1.5*Math.PI?(t-Math.PI)/te:(ee-t)/te}function he(e,t,i){const s=ce(i);return e*s+t*Math.abs(1-s)}function de(e){return e?ie(oe(e)):0}var ue=(e,t,i)=>e*(1-i)+t*i,pe=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},ge=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},me=class e{constructor(e,t,i,r=1){this.r=(0,s.qE)(0,e||0,1),this.g=(0,s.qE)(0,t||0,1),this.b=(0,s.qE)(0,i||0,1),this.a=(0,s.qE)(0,r||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!e.parseHex(t):t.indexOf("rgb")>=0?!!e.stringToRgba(t):e.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return e.fromHexString(t);const i=e.nameToHex.get(t.toLowerCase());if(i)return e.fromHexString(i);if(t.indexOf("rgb")>=0)return e.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(e){let t;switch((e=e.replace(/ /g,"").slice(1)).length){case 6:case 8:t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(`${e[i]}${e[i+1]}`,16));break;case 3:case 4:t=e.split("").map(e=>parseInt(e,16)).map(e=>e+16*e)}if(t?.length>=3&&t.every(e=>e>=0))return 3===t.length&&t.push(255),t}static fromHexString(t){const i=e.parseHex(t);if(i){const[t,s,r,n]=i;return new e(t/255,s/255,r/255,n/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(e){let t=-1,i=-1;for(let s=0;s<e.length;s++){const r=e[s];if(-1===t&&"("===r)t=s;else if(")"===r){i=s;break}}if(-1===t||-1===i)return;const r=e.substring(t+1,i).split(","),n=[];for(let e=0;e<r.length;e++){const t=r[e];let i=parseFloat(t);if(!Number.isFinite(i))return;t.indexOf("%")>=0?(i=(0,s.qE)(0,i,100),i/=100):3===e?i=(0,s.qE)(0,i,1):(i=(0,s.qE)(0,i,255),i/=255),n.push(i)}return n}static fromRgbaString(t){const i=e.stringToRgba(t);if(i){if(3===i.length)return new e(i[0],i[1],i[2]);if(4===i.length)return new e(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(4===t.length)return new e(t[0],t[1],t[2],t[3]);if(3===t.length)return new e(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,r=1){const n=e.HSBtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static fromHSL(t,i,s,r=1){const n=e.HSLtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static fromOKLCH(t,i,s,r=1){const n=e.OKLCHtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static padHex(e){return 1===e.length?"0"+e:e}toHexString(){let t="#"+e.padHex(Math.round(255*this.r).toString(16))+e.padHex(Math.round(255*this.g).toString(16))+e.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(t+=e.padHex(Math.round(255*this.a).toString(16))),t}toRgbaString(e=3){const t=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,e);return 1!==this.a?(t.push(Math.round(this.a*i)/i),`rgba(${t.join(", ")})`):`rgb(${t.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return e.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,t,i){const s=pe(e),r=pe(t),n=pe(i),o=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*n),l=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*n),c=.2104542553*o+.793617785*a-.0040720468*l,h=1.9779984951*o-2.428592205*a+.4505937099*l,d=.0259040371*o+.7827717662*a-.808675766*l,u=180*Math.atan2(d,h)/Math.PI;return[c,Math.hypot(h,d),u>=0?u:u+360]}static OKLCHtoRGB(e,t,i){const s=e,r=t*Math.cos(i*Math.PI/180),n=t*Math.sin(i*Math.PI/180),o=(s+.3963377774*r+.2158037573*n)**3,a=(s-.1055613458*r-.0638541728*n)**3,l=(s-.0894841775*r-1.291485548*n)**3,c=-1.2684380046*o+2.6097574011*a-.3413193965*l,h=-.0041960863*o-.7034186147*a+1.707614701*l;return[ge(4.0767416621*o-3.3077115913*a+.2309699292*l),ge(c),ge(h)]}static RGBtoHSL(e,t,i){const s=Math.min(e,t,i),r=Math.max(e,t,i),n=(r+s)/2;let o,a;if(r===s)o=0,a=0;else{const l=r-s;a=n>.5?l/(2-r-s):l/(r+s),o=r===e?(t-i)/l+(t<i?6:0):r===t?(i-e)/l+2:(e-t)/l+4,o*=60}return[o,a,n]}static HSLtoRGB(e,t,i){if(0===t)return[i,i,i];const s=i<.5?i*(1+t):i+t-i*t,r=2*i-s;function n(e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+6*(s-r)*e:e<.5?s:e<2/3?r+(s-r)*(2/3-e)*6:r}return[n((e=(e%360+360)%360)/360+1/3),n(e/360),n(e/360-1/3)]}static RGBtoHSB(e,t,i){const s=Math.min(e,t,i),r=Math.max(e,t,i);let n=0;if(s!==r){const o=r-s,a=(r-e)/o,l=(r-t)/o,c=(r-i)/o;n=e===r?c-l:t===r?2+a-c:4+l-a,n/=6,n<0&&(n+=1)}return[360*n,0===r?0:(r-s)/r,r]}static HSBtoRGB(e,t,i){e=(e%360+360)%360/360;let s=0,r=0,n=0;if(0===t)s=r=n=i;else{const o=6*(e-Math.floor(e)),a=o-Math.floor(o),l=i*(1-t),c=i*(1-t*a),h=i*(1-t*(1-a));switch(0|o){case 0:s=i,r=h,n=l;break;case 1:s=c,r=i,n=l;break;case 2:s=l,r=i,n=h;break;case 3:s=l,r=c,n=i;break;case 4:s=h,r=l,n=i;break;case 5:s=i,r=l,n=c}}return[s,r,n]}static mix(t,i,s){return new e(ue(t.r,i.r,s),ue(t.g,i.g,s),ue(t.b,i.b,s),ue(t.a,i.a,s))}static lighten(t,i){const r=e.RGBtoOKLCH(t.r,t.g,t.b);return e.fromOKLCH((0,s.qE)(0,r[0]+i,1),r[1],r[2])}static darken(t,i){const r=e.RGBtoOKLCH(t.r,t.g,t.b);return e.fromOKLCH((0,s.qE)(0,r[0]-i,1),r[1],r[2])}static interpolate(t,i){const s=1/(t.length-1),r=t.map(t=>e.RGBtoOKLCH(t.r,t.g,t.b));return Array.from({length:i},(n,o)=>{const a=o/(i-1),l=t.length<=2?0:Math.min(Math.floor(a*(t.length-1)),t.length-2),c=(a-l*s)/s,h=r[l],d=r[l+1];return e.fromOKLCH(ue(h[0],d[0],c),ue(h[1],d[1],c),ue(h[2],d[2],c))})}};me.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var fe=me,ye=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}tickFormatter(e){}datumFormatter(e){}get bandwidth(){}get step(){}get inset(){}},ve=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(e){this[i]!==e&&(this[i]=e,this.invalid=!0)},enumerable:!0,configurable:!1})},Ce=e=>{const t=fe.fromString(e),[i,s,r]=fe.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:r,a:t.a}},be=1e-6,Se=e=>e.c<be||e.l<be||e.l>1-be,we=class extends ye{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Ce)}update(){const{domain:e,range:t}=this;e.length<2&&(s.Vy.warnOnce("`colorDomain` should have at least 2 values."),0===e.length?e.push(0,1):1===e.length&&e.push(e[0]+1));for(let t=1;t<e.length;t++)if(e[t-1]>=e[t]){s.Vy.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((e,t)=>e-t);break}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(Ce)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:r}=this,n=t[0],o=t.at(-1),a=i[0],l=i[i.length-1];if(e<=n)return a;if(e>=o)return l;let c,h;if(2===t.length){const t=(e-n)/(o-n),s=1/(i.length-1);c=i.length<=2?0:Math.min(Math.floor(t*(i.length-1)),i.length-2),h=(t-c*s)/s}else{for(c=0;c<t.length-2&&!(e<t[c+1]);c++);const i=t[c];h=(e-i)/(t[c+1]-i)}return((e,t,i)=>{let r;if(i=(0,s.qE)(0,i,1),Se(e))r=t.h;else if(Se(t))r=e.h;else{const s=e.h;let n=t.h;const o=t.h-e.h;o>180?n-=360:o<-180&&(n+=360),r=s*(1-i)+n*i}const n=e.c*(1-i)+t.c*i,o=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return fe.fromOKLCH(o,n,r,a)})(r[c],r[c+1],h).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&s.Vy.warnOnce("Expected update to not invalidate scale"))}};a([ve],we.prototype,"domain",2),a([ve],we.prototype,"range",2);var xe=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(isNaN(s.x)||isNaN(s.y))return;if(null!=this._cache&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:r,colorSpace:n}=this;if(0===r.length)return;if(1===r.length)return r[0].color;let o=this.createCanvasGradient(e,s,i);if(null==o)return;const a="oklch"===n;let l=r[0];o.addColorStop(l.stop,l.color);for(let e=1;e<r.length;e+=1){const t=r[e];if(a){const e=new we;e.domain=[l.stop,t.stop],e.range=[l.color,t.color];for(let i=l.stop+.05;i<t.stop;i+=.05)o.addColorStop(i,e.convert(i))}o.addColorStop(t.stop,t.color),l=t}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:e,bbox:s,gradient:o},o}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:e,color:t})=>{const r=(0,s.FJ)("stop");r.setAttribute("offset",`${e}`),r.setAttribute("stop-color",`${t}`),i.appendChild(r)}),i}},Ee=class extends xe{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:s}=this,r=de(s+-90),n=i?.centerX??t.x+.5*t.width,o=i?.centerY??t.y+.5*t.height;return e.createConicGradient(r,n,o)}createSvgGradient(e){return(0,s.FJ)("linearGradient")}},Me=class extends xe{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:t}=this,i=de(t+90),s=Math.cos(i),r=Math.sin(i),n=e.width,o=e.height,a=e.x+.5*n,l=e.y+.5*o,c=Math.sqrt(o*o+n*n)/2,h=Math.atan2(o,n);let d;d=i<Math.PI/2?i:i<Math.PI?Math.PI-i:i<1.5*Math.PI?i-Math.PI:2*Math.PI-i;const u=c*Math.abs(Math.cos(d-h));return{x0:a+s*u,y0:l+r*u,x1:a-s*u,y1:l-r*u}}createCanvasGradient(e,t){const{x0:i,y0:s,x1:r,y1:n}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(s)||isNaN(r)||isNaN(n)))return e.createLinearGradient(i,s,r,n)}createSvgGradient(e){const{x0:t,y0:i,x1:r,y1:n}=this.getGradientPoints(e),o=(0,s.FJ)("linearGradient");return o.setAttribute("x1",String(t)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(r)),o.setAttribute("y2",String(n)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},Ae=class extends xe{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+.5*t.width,r=i?.centerY??t.y+.5*t.height,n=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(.5*t.width,.5*t.height)/Math.SQRT2;return e.createRadialGradient(s,r,n,s,r,o)}createSvgGradient(e){const t=e.x+.5*e.width,i=e.y+.5*e.height,r=(0,s.FJ)("radialGradient");return r.setAttribute("cx",String(t)),r.setAttribute("cy",String(i)),r.setAttribute("r",String(Math.hypot(.5*e.width,.5*e.height)/Math.SQRT2)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},Te=function(e,t){A(e,t).optional=!0},De=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if("object"!=typeof e)return s.Vy.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const t of R(this))if(i.has(t)){const r=e[t],n=this;if(Re(n[t]))if(n[t]instanceof Ie){const e=n[t].reset(r);null!=e?n[t]=e:s.Vy.warn(`unable to set [${t}] - expecting a properties array`)}else n[t].set(r);else(0,s.Qd)(r)?n[t]=_(r,n[t]??{}):n[t]=r;i.delete(t)}this.handleUnknownProperties(i,e);for(const e of i)s.Vy.warn(`unable to set [${e}] in ${t} - property is unknown`);return this}toJson(){return R(this).reduce((e,t)=>{const i=this[t];return e[t]=Re(i)?i.toJson():i,e},{})}},Ie=class e extends Array{constructor(e,...t){super(t.length);const i=(s=e,Boolean(s?.prototype?.constructor?.name)?t=>(new e).set(t):e);var s;Object.defineProperty(this,"itemFactory",{value:i,enumerable:!1,configurable:!1}),this.set(t)}set(e){if((0,s.cy)(e)){this.length=e.length;for(let t=0;t<e.length;t++)this[t]=this.itemFactory(e[t])}return this}reset(t){if(Array.isArray(t))return new e(this.itemFactory,...t)}toJson(){return this.map(e=>e?.toJson?.()??e)}};function Re(e){return e instanceof De||e instanceof Ie}var Pe=class extends De{constructor(){super(...arguments),this.color="black"}};function ke(e){return e.flatMap((t,i)=>{const{stop:s}=t,r=e.at(i+1)?.color;return null!=r?[t,{stop:s,color:r}]:[t]})}function Le(e,t,i,r="continuous"){const n=e.map(e=>"string"==typeof e?{color:e}:e);if(0===n.length)return function(e,t){const i="discrete"===t?1:0,s=e.map((e,t,{length:s})=>({stop:(t+i)/(s-1+i),color:e}));return"discrete"===t?ke(s):s}(t,r);if(!function(e){let t;for(const i of e)if(null!=i?.stop){if(null!=t&&i.stop<t)return!1;t=i.stop}return!0}(n))return s.Vy.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),a=Math.max(...i),l="discrete"===r,c=new Float64Array(n.length);let h=0,d=-1;for(let e=0;e<n.length;e+=1){const t=n[e];if(e>=d){d=n.length-1;for(let t=e+1;t<n.length;t+=1)if(null!=n[t]?.stop){d=t;break}}let i=t?.stop;if(null==i){const t=n[h]?.stop,s=n[d]?.stop,r=t??o,c=l&&null==t?1:0;i=r+((s??a)-r)*(e-h+c)/(d-h+c)}else h=e;c[e]=Math.max(0,Math.min(1,(i-o)/(a-o)))}let u,p=n.find(e=>null!=e.color)?.color;const g=n.map((e,i)=>{let s=e?.color;const r=c[i];return null!=s?p=s:null!=p?s=p:(null==u&&(u=new we,u.domain=[0,1],u.range=t),s=u.convert(r)),{stop:r,color:s}});return"discrete"===r?ke(g):g}a([Te],Pe.prototype,"stop",2),a([Te],Pe.prototype,"color",2);var Ne=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,r){if(!t)return null;const[n,o]=this.getSize(t.width,t.height,i,r);return n<1||o<1?(s.Vy.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:r}=this;let n=e,o=t,a=1;const l=i/s,c=e/t;return"stretch"===r||0===e||0===t?(n=i,o=s):"contain"===r?a=c>l?i/e:s/t:"cover"===r&&(a=c>l?s/t:i/e),[Math.max(1,n*a),Math.max(1,o*a)]}setImageTransform(e,t){if("string"==typeof e)return;const{url:i,rotation:s,width:r,height:n}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const a=de(s),l=Math.cos(a),c=Math.sin(a),[h,d]=this.getSize(o.width,o.height,r??t.width,n??t.height),u=h/o.width,p=d/o.height,g=t.x+t.width/2,m=t.y+t.height/2,f=(l*h-c*d)/2,y=(c*h+l*d)/2;e?.setTransform(new DOMMatrix([l*u,c*p,-c*u,l*p,g-f,m-y]))}createPattern(e,t,i,s){const r=this.width??t,n=this.height??i,o=this._cache;if(null!=o&&o.ctx===e&&o.width===r&&o.height===n)return o.pattern;const a=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(e,a,r,n);return null==l?this.backgroundFill:(this._cache={ctx:e,pattern:l,width:r,height:n},l)}toSvg(e,t){const{url:i,rotation:r,backgroundFill:n,backgroundFillOpacity:o}=this,{x:a,y:l,width:c,height:h}=e,d=(0,s.FJ)("pattern");d.setAttribute("viewBox",`0 0 ${c} ${h}`),d.setAttribute("x",String(a)),d.setAttribute("y",String(l)),d.setAttribute("width",String(c)),d.setAttribute("height",String(h)),d.setAttribute("patternUnits","userSpaceOnUse");const u=(0,s.FJ)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(c)),u.setAttribute("height",String(h)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(o)),d.appendChild(u);const p=(0,s.FJ)("image");return p.setAttribute("href",i),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(c)),p.setAttribute("height",String(h)),p.setAttribute("preserveAspectRatio","none"),p.setAttribute("transform",`scale(${1/t}) rotate(${r}, ${c/2}, ${h/2})`),d.appendChild(p),d}},_e=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,Oe=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,Fe=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,Ge=/^[01]/,Be={z:[],h:[Oe],v:[Oe],m:[Oe,Oe],l:[Oe,Oe],t:[Oe,Oe],s:[Oe,Oe,Oe,Oe],q:[Oe,Oe,Oe,Oe],c:[Oe,Oe,Oe,Oe,Oe,Oe],a:[Oe,Oe,Oe,Ge,Ge,Oe,Oe]};function Ve(e,t,i){const r=Be[e.toLocaleLowerCase()],n={command:e,params:[]};for(const o of r){const r=t.slice(i),a=o.exec(r);if(null==a)return 1===n.params.length?[i,n]:void s.Vy.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);{n.params.push(parseFloat(a[0])),i+=a[0].length;const e=Fe.exec(r.slice(a[0].length));null!=e&&(i+=e[0].length)}}return[i,n]}function He(e,t,i,s){const r=e-i,n=t-s;return r*r+n*n}function Ue(e,t,i,s,r,n,o){if(i===r&&s===n)return Math.min(o,He(e,t,i,s));const a=r-i,l=n-s,c=Math.max(0,Math.min(1,((e-i)*a+(t-s)*l)/(a*a+l*l))),h=i+c*a,d=s+c*l;return Math.min(o,He(e,t,h,d))}function ze(e,t,i,s,r,n,o,a,l){if(a&&([o,n]=[n,o]),!ne(Math.atan2(t-s,e-i),n,o)){const o=i+Math.cos(n)*r,a=s+Math.sin(n)*r,c=i+Math.cos(n)*r,h=s+Math.sin(n)*r;return Math.min(l,He(e,t,o,a),He(e,t,c,h))}const c=r-Math.sqrt(He(e,t,i,s));return Math.min(l,c*c)}function We(e,t,i,s,r,n,o,a){const l=(i-e)*(a-n)-(s-t)*(o-r);if(0===l)return 0;const c=((o-r)*(t-n)-(e-r)*(a-n))/l,h=((i-e)*(t-n)-(s-t)*(e-r))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function je(e,t,i,s,r,n,o,a,l,c,h,d){let u=0;const p=c-d,g=h-l,m=l*(d-c)-c*(h-l),f=Ke(e,i,r,o),y=Ke(t,s,n,a),v=function(e,t,i,s){if(0===e)return function(e,t,i){if(0===e)return function(e,t){const i=-t/e;return 0!==e&&i>=0&&i<=1?[i]:[]}(t,i);const s=t*t-4*e*i,r=[];if(0===s){const i=-t/(2*e);i>=0&&i<=1&&r.push(i)}else if(s>0){const i=Math.sqrt(s),n=(-t-i)/(2*e),o=(-t+i)/(2*e);n>=0&&n<=1&&r.push(n),o>=0&&o<=1&&r.push(o)}return r}(t,i,s);const r=t/e,n=i/e,o=(3*n-r*r)/9,a=(9*r*n-s/e*27-2*r*r*r)/54,l=o*o*o+a*a,c=1/3,h=[];if(l>=0){const e=Math.sqrt(l),t=Math.sign(a+e)*Math.pow(Math.abs(a+e),c),i=Math.sign(a-e)*Math.pow(Math.abs(a-e),c),s=Math.abs(Math.sqrt(3)*(t-i)/2),n=-c*r+(t+i);if(n>=0&&n<=1&&h.push(n),0===s){const e=-c*r-(t+i)/2;e>=0&&e<=1&&h.push(e)}}else{const e=Math.acos(a/Math.sqrt(-o*o*o)),t=c*r,i=2*Math.sqrt(-o),s=i*Math.cos(c*e)-t,n=i*Math.cos(c*(e+2*Math.PI))-t,l=i*Math.cos(c*(e+4*Math.PI))-t;s>=0&&s<=1&&h.push(s),n>=0&&n<=1&&h.push(n),l>=0&&l<=1&&h.push(l)}return h}(p*f[0]+g*y[0],p*f[1]+g*y[1],p*f[2]+g*y[2],p*f[3]+g*y[3]+m);for(const e of v){const t=e*e,i=e*t,s=f[0]*i+f[1]*t+f[2]*e+f[3],r=y[0]*i+y[1]*t+y[2]*e+y[3];let n;n=l===h?(r-c)/(d-c):(s-l)/(h-l),n>=0&&n<=1&&u++}return u}function Ke(e,t,i,s){return[3*t-e-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function $e(e,t,i,s,r,n,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;n&&([r,s]=[s,r]);const h=(c-a)/(l-o),d=a-h*o,u=Math.pow(h,2)+1,p=2*(h*(d-t)-e),g=Math.pow(e,2)+Math.pow(d-t,2)-Math.pow(i,2),m=Math.pow(p,2)-4*u*g;if(m<0)return 0;const f=(-p+Math.sqrt(m))/2/u,y=(-p-Math.sqrt(m))/2/u;let v=0;return[f,y].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const n=i-e,a=h*i+d-t;ne(Math.atan2(a,n),s,r)&&v++}),v}function Ye(e,t,i,s,r){return(1-r)**3*e+3*(1-r)**2*r*t+3*(1-r)*r**2*i+r**3*s}function qe(e,t,i,s,r){if(r<=Math.min(e,s))return e<s?0:1;if(r>=Math.max(e,s))return e<s?1:0;let n=0,o=1,a=NaN;for(let l=0;l<12;l+=1)a=(n+o)/2,Ye(e,t,i,s,a)<r?n=a:o=a;return a}function Xe(e,t,i,s,r,n,o,a,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*s,d=(1-l)*i+l*r,u=(1-l)*s+l*n,p=(1-l)*r+l*o,g=(1-l)*n+l*a,m=(1-l)*c+l*d,f=(1-l)*h+l*u,y=(1-l)*d+l*p,v=(1-l)*u+l*g,C=(1-l)*m+l*y,b=(1-l)*f+l*v;return[[{x:e,y:t},{x:c,y:h},{x:m,y:f},{x:C,y:b}],[{x:C,y:b},{x:y,y:v},{x:p,y:g},{x:o,y:a}]]}function Ze(e,t,i,s){const r=3*t-e-3*i+s,n=2*(e-2*t+i),o=-e+t;if(0===r){if(0!==n){const e=-o/n;if(e>0&&e<1)return[e]}return[]}const a=n*n-4*r*o;if(a>=0){const e=Math.sqrt(a);return[(-n+e)/(2*r),(-n-e)/(2*r)].filter(e=>e>0&&e<1)}return[]}function Qe(e,t,i,s,r,n,o,a){return[...Ze(e,i,r,o),...Ze(t,s,n,a)]}var Je=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return 0===this.commands.length}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}appendSvg(e){let t,i,s=0,r=0,n=0,o=0;for(const{command:a,params:l}of e){t??(t=l[0]),i??(i=l[1]);const e=a===a.toLowerCase(),c=e?t:0,h=e?i:0;switch(a.toLowerCase()){case"m":this.moveTo(c+l[0],h+l[1]),t=c+l[0],i=h+l[1],s=t,r=i;break;case"c":this.cubicCurveTo(c+l[0],h+l[1],c+l[2],h+l[3],c+l[4],h+l[5]),n=c+l[2],o=h+l[3],t=c+l[4],i=h+l[5];break;case"s":this.cubicCurveTo(t+t-n,i+i-o,c+l[0],h+l[1],c+l[2],h+l[3]),n=c+l[0],o=h+l[1],t=c+l[2],i=h+l[3];break;case"q":this.cubicCurveTo((c+2*l[0])/3,(h+2*l[1])/3,(2*l[0]+l[2])/3,(2*l[1]+l[3])/3,l[2],l[3]),n=l[0],o=l[1],t=l[2],i=l[3];break;case"t":this.cubicCurveTo((t+2*(t+t-n))/3,(i+2*(i+i-o))/3,(2*(t+t-n)+l[0])/3,(2*(i+i-o)+l[1])/3,l[0],l[1]),n=t+t-n,o=i+i-o,t=l[0],i=l[1];break;case"a":this.ellipse(t,i,l[0],l[1],l[2]*Math.PI/180,l[3],l[4],c+l[5],h+l[6]),t=c+l[5],i=h+l[6];break;case"h":this.lineTo(c+l[0],i),t=c+l[0];break;case"l":this.lineTo(c+l[0],h+l[1]),t=c+l[0],i=h+l[1];break;case"v":this.lineTo(t,h+l[0]),i=h+l[0];break;case"z":this.closePath(),t=s,i=r;break;default:throw new Error(`Could not translate command '${a}' with '${l.join(" ")}'`)}}}ellipse(e,t,i,s,r,n,o,a,l){i=Math.abs(i),s=Math.abs(s);const c=(e-a)/2,h=(t-l)/2,d=Math.sin(r),u=Math.cos(r),p=u*c+d*h,g=-d*c+u*h,m=p/i,f=g/s;let y=m*m+f*f,v=(e+a)/2,C=(t+l)/2,b=0,S=0;y>=1?(y=Math.sqrt(y),i*=y,s*=y):(y=Math.sqrt(1/y-1),n===o&&(y=-y),b=y*i*f,S=-y*s*m,v+=u*b-d*S,C+=d*b+u*S);const w=Math.atan2((g-S)/s,(p-b)/i),x=w+(Math.atan2((-g-S)/s,(-p-b)/i)-w),E=!!(1-o);this.ellipticalArc(v,C,i,s,r,w,x,E)}ellipticalArc(e,t,i,s,r,n,o,a){a&&([n,o]=[o,n]);const l=[],c=.5522847498307935,h=Math.sin(n),d=Math.cos(n),u=Math.sin(r),p=Math.cos(r);let g=p*d*i-u*h*s,m=u*d*i+p*h*s,f=-p*h*i-u*d*s,y=-u*h*i+p*d*s;l.push(g+e,m+t),o=ie(o-=n);const v=Math.PI/2,C=Math.floor(o/v),b=o%v;for(let i=0;i<C;i++)l.push(g+f*c+e,m+y*c+t,g*c+f+e,m*c+y+t,f+e,y+t),[g,f]=[f,-g],[m,y]=[y,-m];if(b>0){const i=Math.sin(b),s=Math.cos(b),r=Math.tan(b/4)*(4/3),n=s+r*i,o=i-r*s;l.push(g+f*r+e,m+y*r+t,g*n+f*o+e,m*n+y*o+t,g*s+f*i+e,m*s+y*i+t)}if(a)for(let e=0,t=l.length-2;e<t;e+=2,t-=2)[l[e],l[t]]=[l[t],l[e]],[l[e+1],l[t+1]]=[l[t+1],l[e+1]];for(let e=2;e<l.length;e+=6){const[t,i,s,r,n,o]=l.slice(e,e+6);this.cubicCurveTo(t,i,s,r,n,o)}}roundRect(e,t,i,s,r){r=Math.min(r,i/2,s/2),this.moveTo(e,t+r),this.arc(e+r,t+r,r,Math.PI,1.5*Math.PI),this.lineTo(e+r,t),this.lineTo(e+i-r,t),this.arc(e+i-r,t+r,r,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+r),this.lineTo(e+i,t+s-r),this.arc(e+i-r,t+s-r,r,0,Math.PI/2),this.lineTo(e+i-r,t+s),this.lineTo(e+r,t+s),this.arc(e+ +r,t+s-r,r,Math.PI/2,Math.PI),this.lineTo(e,t+s-r),this.closePath()}arc(e,t,i,s,r,n){this.openedPath=!0,this.path2d.arc(e,t,i,s,r,n),this.commands.push(2),this.params.push(e,t,i,s,r,n?1:0)}cubicCurveTo(e,t,i,s,r,n){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,r,n),this.commands.push(3),this.params.push(e,t,i,s,r,n)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,s=this.params,r=i.length,n=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,d=0;for(let u=0,p=0;u<r;u++)switch(i[u]){case 0:d+=We(a,l,c,h,n,o,e,t),c=s[p++],a=c,h=s[p++],l=h;break;case 1:d+=We(c,h,s[p++],s[p++],n,o,e,t),c=s[p-2],h=s[p-1];break;case 3:d+=je(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],n,o,e,t),c=s[p-2],h=s[p-1];break;case 2:{const i=s[p++],r=s[p++],l=s[p++],u=s[p++],g=s[p++];d+=$e(i,r,l,u,g,Boolean(s[p++]),n,o,e,t),isNaN(a)||(d+=We(c,h,i+Math.cos(u)*l,r+Math.sin(u)*l,n,o,e,t)),c=i+Math.cos(g)*l,h=r+Math.sin(g)*l;break}case 4:d+=We(a,l,c,h,n,o,e,t)}return d%2==1}distanceSquared(e,t){let i=1/0;const r=this.commands,n=this.params,o=r.length;let a=NaN,l=NaN,c=0,h=0;for(let d=0,u=0;d<o;d++)switch(r[d]){case 0:c=a=n[u++],h=l=n[u++];break;case 1:i=Ue(e,t,c,h,n[u++],n[u++],i);break;case 3:s.Vy.error("Command.Curve distanceSquare not implemented");break;case 2:{const s=n[u++],r=n[u++],o=n[u++],a=n[u++],l=n[u++],d=s+Math.cos(a)*o,p=r+Math.sin(a)*o,g=Boolean(n[u++]);i=Ue(e,t,c,h,d,p,i),i=ze(e,t,s,r,o,a,l,g,i),c=s+Math.cos(l)*o,h=r+Math.sin(l)*o;break}case 4:i=Ue(e,t,c,h,a,l,i)}return i}toSVG(e=(e,t)=>({x:e,y:t})){const t=[],{commands:i,params:s}=this,r=(i,...s)=>{t.push(i);for(let i=0;i<s.length;i+=2){const{x:r,y:n}=e(s[i],s[i+1]);t.push(r,n)}};let n=0;for(const e of i)switch(e){case 0:r("M",s[n++],s[n++]);break;case 1:r("L",s[n++],s[n++]);break;case 3:r("C",s[n++],s[n++],s[n++],s[n++],s[n++],s[n++]);break;case 2:{const e=s[n++],i=s[n++],o=s[n++],a=s[n++],l=s[n++],c=s[n++];let h=c?a-l:l-a;h<0&&(h+=2*Math.ceil(-h/(2*Math.PI))*Math.PI),c&&(h=-h);const d=Math.max(Math.ceil(Math.abs(h)/(Math.PI/2)),1),u=h/d,p=4/3*Math.tan(u/4);r(0===t.length?"M":"L",e+Math.cos(a)*o,i+Math.sin(a)*o);for(let t=0;t<d;t+=1){const s=a+u*(t+0),n=a+u*(t+1),l=o*Math.sin(s),c=o*Math.cos(s),h=o*Math.sin(n),d=o*Math.cos(n);r("C",e+c-p*l,i+l+p*c,e+d+p*h,i+h-p*d,e+d,i+h)}break}case 4:t.push("Z")}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,r,n]=[1/0,1/0,-1/0,-1/0],[o,a]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(e,t,l)=>{i=Math.min(t,i),s=Math.min(e,s),r=Math.max(e,r),n=Math.max(t,n),l&&([o,a]=[e,t])},d=(e,t,i,s,r)=>{const n=e+i*Math.cos(s),o=t+i*Math.sin(s);h(n,o,r)};let u=0;for(const i of e)switch(i){case 0:h(t[u++],t[u++],!0),[l,c]=[o,a];break;case 1:h(t[u++],t[u++],!0);break;case 3:{const e=t[u++],i=t[u++],s=t[u++],r=t[u++],n=t[u++],l=t[u++];Qe(o,a,e,i,s,r,n,l).forEach(t=>{const c=Ye(o,e,s,n,t),d=Ye(a,i,r,l,t);h(c,d)}),h(n,l,!0);break}case 2:{const e=t[u++],i=t[u++],s=t[u++],r=ie(t[u++]),n=ie(t[u++]),o=t[u++];d(e,i,s,r);const a=[0,Math.PI/2,Math.PI,3*Math.PI/2],[l,c]=o?[n,r]:[r,n];for(const t of a)(l<c&&l<=t&&t<=c||l>c&&(l<=t||t<=c))&&d(e,i,s,t);d(e,i,s,n,!0);break}case 4:[o,a]=[l,c]}return new f(s,i,r-s,n-i)}};function et(e,t,i){const s=Math.round(t*e)/e;return null==i?s:0===i?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-s}function tt(e,t){return Math.floor(t*e)/e}function it(e,t,i){const{width:s,height:r,padding:n,strokeWidth:o}=t,a=s/2,l=r/2,c=Math.max(1,s-n-o/2),h=Math.max(1,r-n-o/2);let d=!1;for(const[t,s]of i){const i=a+(t-.5)*c,r=l+(s-.5)*h;d?e.lineTo(i,r):e.moveTo(i,r),d=!0}e.closePath()}var st={circles(e,{width:t,strokeWidth:i,padding:s}){const r=t/2,n=Math.max(1,r-s-i/2);e.arc(r,r,n,0,2*Math.PI)},squares(e,{width:t,height:i,pixelRatio:s,padding:r,strokeWidth:n}){const o=r+n/2;e.moveTo(et(s,o),et(s,o)),e.lineTo(et(s,t-o),et(s,o)),e.lineTo(et(s,t-o),et(s,i-o)),e.lineTo(et(s,o),et(s,i-o)),e.closePath()},triangles(e,t){it(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){it(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:s}){const r=Math.max(1,(t-s)/2),n=r/2,o=Math.PI/2;for(let s=0;s<10;s++){const a=s%2==0?r:n,l=s*Math.PI/5-o,c=t/2+Math.cos(l)*a,h=i/2+Math.sin(l)*a;e.lineTo(c,h)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const r=Math.max(1,t/4-s/2),n=t/2,o=i/2+r/2;e.arc(n-r,o-r,r,oe(130),oe(330)),e.arc(n+r,o-r,r,oe(220),oe(50)),e.lineTo(n,o+r),e.closePath()},crosses(e,t){it(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:r}){const n=et(s,t/2)-r%2/2;e.moveTo(n,0),e.lineTo(n,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:r}){const n=et(s,i/2)-r%2/2;e.moveTo(0,n),e.lineTo(t,n)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const r=Math.atan2(i,t),n=s*Math.cos(r),o=s*Math.sin(r);e.moveTo(-n,o),e.lineTo(n,-o),e.moveTo(-n,i+o),e.lineTo(t+n,-o),e.moveTo(t-n,i+o),e.lineTo(t+n,i-o)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const r=Math.atan2(i,t),n=s*Math.cos(r),o=s*Math.sin(r);e.moveTo(t-n,-o),e.lineTo(t+n,o),e.moveTo(-n,-o),e.lineTo(t+n,i+o),e.moveTo(-n,i-o),e.lineTo(n,i+o)}},rt=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:r,padding:n,strokeWidth:o,path:a}=this,l=new Je,c=function(e){if(!e)return;const t=[];let i,r=0;for(;r<e.length;){const n=_e.exec(e.slice(r));let o;if(null==n){if(!i)return void s.Vy.warnOnce(`Invalid SVG path, error at index ${r}: Missing command.`);o=i}else o=n[1],r+=n[0].length;const a=Ve(o,e,r);if(!a)return;r=a[0],i=o,t.push(a[1])}return t}(a);return c?l.appendSvg(c):st[t](l,{width:i,height:r,pixelRatio:e,strokeWidth:o,padding:n}),l}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:r}=this;s&&(t.strokeStyle=i,t.lineWidth=s,t.globalAlpha=r,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:s}=this;"none"!==i&&(t.fillStyle=i,t.globalAlpha=s,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:r,scale:n,backgroundFill:o,backgroundFillOpacity:a}=this;if(i*n<1||r*n<1)return s.Vy.warnOnce("Pattern fill is too small to render, ignoring."),null;const l=new w({width:i,height:r,pixelRatio:t*n}),c=l.context;"none"!==o&&(c.fillStyle=o,c.globalAlpha=a,c.fillRect(0,0,i,r));const h=this.getPath(t).getPath2D();this.renderFill(h,c),this.renderStroke(h,c);const d=e.createPattern(l.canvas,"repeat");return this.setPatternTransform(d,t),l.destroy(),d}setPatternTransform(e,t,i=0,s=0){const r=de(this.rotation),n=1/t,o=Math.cos(r)*n,a=Math.sin(r)*n;e?.setTransform(new DOMMatrix([o,a,-a,o,i,s]))}createPattern(e,t){if(null!=this._cache&&this._cache.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);return null!=i?(this._cache={ctx:e,pattern:i,pixelRatio:t},i):void 0}toSvg(){const{width:e,height:t,fill:i,fillOpacity:r,backgroundFill:n,backgroundFillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,rotation:h,scale:d}=this,u=(0,s.FJ)("pattern");u.setAttribute("viewBox",`0 0 ${e} ${t}`),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const p=(0,s.FJ)("rect");p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(e)),p.setAttribute("height",String(t)),p.setAttribute("fill",n),p.setAttribute("fill-opacity",String(o)),u.appendChild(p);const g=(0,s.FJ)("path");return g.setAttribute("fill",i),g.setAttribute("fill-opacity",String(r)),g.setAttribute("stroke-opacity",String(c)),g.setAttribute("stroke",a),g.setAttribute("stroke-width",String(l)),g.setAttribute("transform",`rotate(${h}) scale(${d})`),g.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(g),u}};function nt(e){return(0,s.Gv)(e)&&"gradient"==e.type}function ot(e){return(0,s.cy)(e)&&e.every(e=>"string"==typeof e)}function at(e){return null!==e&&(0,s.Gv)(e)&&"pattern"==e.type}function lt(e){return null!==e&&(0,s.Gv)(e)&&"image"==e.type}function ct(e){return nt(e)||at(e)}var ht=class e extends J{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=e.defaultStyles.fill,this.stroke=e.defaultStyles.stroke,this.strokeWidth=e.defaultStyles.strokeWidth,this.lineDash=e.defaultStyles.lineDash,this.lineDashOffset=e.defaultStyles.lineDashOffset,this.lineCap=e.defaultStyles.lineCap,this.lineJoin=e.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=e.defaultStyles.opacity,this.fillShadow=e.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){if(nt(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:s,rotation:r=0,reverse:n=!1}=e;if(null==s)return;let o=Le(s,["black"],[0,1]);switch(n&&(o=o.map(e=>({color:e.color,stop:1-e.stop})).reverse()),i){case"linear":return new Me(t,o,r);case"radial":return new Ae(t,o);case"conic":return new Ee(t,o,r)}}getPattern(e){if(at(e))return this.createPattern(e)}createPattern(e){return new rt(e)}getImage(e){if(lt(e))return this.createImage(e)}createImage(e){return new Ne(this.imageLoader,e)}onFillChange(){"object"==typeof this.fill&&k(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,t){return et(this.layerManager?.canvas?.pixelRatio??1,e,t)}preRender(e,t){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(e,t)}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){const{fill:i,fillImage:s}=this;if(i&&"none"!==i){const{globalAlpha:i}=e;s&&(e.globalAlpha=s.backgroundFillOpacity,e.fillStyle=s.backgroundFill,this.executeFill(e,t),e.globalAlpha=i),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=i}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e){const{fill:t,fillGradient:i,fillPattern:s,fillImage:r,fillOpacity:n,opacity:o}=this;if(e.globalAlpha*=o*n,i){const{fillBBox:t=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:s}=this;e.fillStyle=i.createGradient(e,t,s)??"black"}else if(s){const{x:t,y:i}=this.getBBox(),r=this.layerManager?.canvas?.pixelRatio??1,n=s.createPattern(e,r);s.setPatternTransform(n,r,t,i),n?e.fillStyle=n:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(r){const t=this.getBBox(),i=r.createPattern(e,t.width,t.height,this);r.setImageTransform(i,t),e.fillStyle=i??"transparent"}else e.fillStyle="string"==typeof t?t:"black"}applyStrokeAndAlpha(e){const{stroke:t,strokeOpacity:i,strokeGradient:s,opacity:r}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??("string"==typeof t?t:void 0)??"black",e.globalAlpha*=r*i}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t){const{stroke:i,strokeWidth:s,lineDash:r,lineDashOffset:n,lineCap:o,lineJoin:a,miterLimit:l}=this;if(i&&s){const{globalAlpha:i}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,r&&e.setLineDash(r),n&&(e.lineDashOffset=n),o&&(e.lineCap=o),a&&(e.lineJoin=a),null!=l&&(e.miterLimit=l),this.executeStroke(e,t),e.globalAlpha=i}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return null==this.cachedDefaultGradientFillBBox&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:r}=this;if("string"==typeof i)e.setAttribute("fill",i);else if(nt(i)&&this.fillGradient){t??(t=[]);const i=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),r=(0,s.lk)();i.setAttribute("id",r),t.push(i),e.setAttribute("fill",`url(#${r})`)}else if(at(i)&&this.fillPattern){t??(t=[]);const i=this.fillPattern.toSvg(),r=(0,s.lk)();i.setAttribute("id",r),t.push(i),e.setAttribute("fill",`url(#${r})`)}else if(lt(i)&&this.fillImage){t??(t=[]);const i=this.layerManager?.canvas?.pixelRatio??1,r=this.fillImage.toSvg(this.getBBox(),i),n=(0,s.lk)();r.setAttribute("id",n),t.push(r),e.setAttribute("fill",`url(#${n})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(r)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:r,lineDashOffset:n}=this;if(null!=t&&(e.setAttribute("stroke","string"==typeof t?t:"none"),e.setAttribute("stroke-opacity",String(i)),e.setAttribute("stroke-width",String(s))),!0===r?.some(e=>0!==e)){const t=r.length%2==1?[...r,...r]:r;e.setAttribute("stroke-dasharray",t.join(" ")),e.setAttribute("stroke-dashoffset",String(n))}}};ht.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},a([$()],ht.prototype,"fillOpacity",2),a([$()],ht.prototype,"strokeOpacity",2),a([Y({equals:k,changeCb:e=>e.onFillChange()})],ht.prototype,"fill",2),a([Y({equals:k,changeCb:e=>e.onStrokeChange()})],ht.prototype,"stroke",2),a([$()],ht.prototype,"strokeWidth",2),a([q()],ht.prototype,"lineDash",2),a([$()],ht.prototype,"lineDashOffset",2),a([$()],ht.prototype,"lineCap",2),a([$()],ht.prototype,"lineJoin",2),a([$()],ht.prototype,"miterLimit",2),a([$({convertor:e=>(0,s.qE)(0,e,1)})],ht.prototype,"opacity",2),a([Y({equals:K,checkDirtyOnAssignment:!0})],ht.prototype,"fillShadow",2),a([Y({equals:h.equals,changeCb:e=>e.onFillChange()})],ht.prototype,"fillBBox",2),a([Y({equals:k,changeCb:e=>e.onFillChange()})],ht.prototype,"fillParams",2);var dt=ht,ut=[1,0,0,1,0,0],pt=class e{get e(){return[...this.elements]}constructor(e=ut){this.elements=[...e]}setElements(e){const t=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this}get identity(){const e=this.elements;return(0,s.YX)(e[0],1)&&(0,s.YX)(e[1],0)&&(0,s.YX)(e[2],0)&&(0,s.YX)(e[3],1)&&(0,s.YX)(e[4],0)&&(0,s.YX)(e[5],0)}AxB(e,t,i){const s=e[0]*t[0]+e[2]*t[1],r=e[1]*t[0]+e[3]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],a=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];(i=i??e)[0]=s,i[1]=r,i[2]=n,i[3]=o,i[4]=a,i[5]=l}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(t){const i=new Array(6);return t instanceof e?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new e(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],r=t[2],n=t[3];const o=t[4],a=t[5],l=1/(i*n-s*r);return i*=l,s*=l,r*=l,n*=l,new e([n,-s,-r,i,r*a-n*o,s*o-i*a])}invertSelf(){const e=this.elements;let t=e[0],i=e[1],s=e[2],r=e[3];const n=e[4],o=e[5],a=1/(t*r-i*s);return t*=a,i*=a,s*=a,r*=a,e[0]=r,e[1]=-i,e[2]=-s,e[3]=t,e[4]=s*o-r*n,e[5]=i*n-t*o,this}transformPoint(e,t){const i=this.elements;return{x:e*i[0]+t*i[2]+i[4],y:e*i[1]+t*i[3]+i[5]}}transformBBox(e,t){const i=this.elements,s=i[0],r=i[1],n=i[2],o=i[3],a=.5*e.width,l=.5*e.height,c=e.x+a,h=e.y+l,d=Math.abs(a*s)+Math.abs(l*n),u=Math.abs(a*r)+Math.abs(l*o);return t??(t=new f(0,0,0,0)),t.x=c*s+h*n+i[4]-d,t.y=c*r+h*o+i[5]-u,t.width=d+d,t.height=u+u,t}toContext(e){if(this.identity)return;const t=this.elements;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}static updateTransformMatrix(e,t,i,s,r,n,o){const a=t,l=i;let c,h;1===a&&1===l?(c=0,h=0):(c=o?.scalingCenterX??0,h=o?.scalingCenterY??0);const d=s,u=Math.cos(d),p=Math.sin(d);let g,m;0===d?(g=0,m=0):(g=o?.rotationCenterX??0,m=o?.rotationCenterY??0);const f=r,y=n,v=c*(1-a)-g,C=h*(1-l)-m;return e.setElements([u*a,p*a,-p*l,u*l,u*v-p*C+g+f,p*v+u*C+m+y]),e}};function gt(e){return ft(e.constructor)}var mt=Symbol("isMatrixTransform");function ft(e){return!0===e[mt]}function yt(e){var t;const i=e;if(ft(e))return e;const r=Symbol("matrix_combined_transform");class n extends i{constructor(){super(...arguments),this[t]=new pt,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}onChangeDetection(e){super.onChangeDetection(e),this.markDirtyTransform()}updateMatrix(e){}computeTransformMatrix(){this._dirtyTransform&&(this[r].setElements(ut),this.updateMatrix(this[r]),this._dirtyTransform=!1)}toParent(e){return this.computeTransformMatrix(),this[r].identity?e.clone():this[r].transformBBox(e)}toParentPoint(e,t){return this.computeTransformMatrix(),this[r].identity?{x:e,y:t}:this[r].transformPoint(e,t)}fromParent(e){return this.computeTransformMatrix(),this[r].identity?e.clone():this[r].inverse().transformBBox(e)}fromParentPoint(e,t){return this.computeTransformMatrix(),this[r].identity?{x:e,y:t}:this[r].inverse().transformPoint(e,t)}computeBBox(){const e=super.computeBBox();return e?this.toParent(e):e}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(e,t){return({x:e,y:t}=this.fromParentPoint(e,t)),super.pickNode(e,t)}pickNodes(e,t,i){return({x:e,y:t}=this.fromParentPoint(e,t)),super.pickNodes(e,t,i)}render(e){this.computeTransformMatrix();const{ctx:t}=e,i=this[r];let s=!1;i.identity||(t.save(),s=!0,i.toContext(t)),super.render(e),s&&t.restore()}toSVG(){this.computeTransformMatrix();const e=super.toSVG(),t=this[r];if(t.identity||null==e)return e;const i=(0,s.FJ)("g");i.append(...e.elements);const[n,o,a,l,c,h]=t.e;return i.setAttribute("transform",`matrix(${n} ${o} ${a} ${l} ${c} ${h})`),{elements:[i],defs:e.defs}}}return t=r,n[mt]=!0,n}function vt(e){var t;const i=e,s=Symbol("matrix_rotation");class r extends(yt(i)){constructor(){super(...arguments),this[t]=new pt,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(e){super.updateMatrix(e);const{rotation:t,rotationCenterX:i,rotationCenterY:r}=this;0!==t&&(pt.updateTransformMatrix(this[s],1,1,t,0,0,{rotationCenterX:i,rotationCenterY:r}),e.multiplySelf(this[s]))}}return t=s,a([$()],r.prototype,"rotationCenterX",2),a([$()],r.prototype,"rotationCenterY",2),a([$()],r.prototype,"rotation",2),r}function Ct(e){var t;const i=e,s=Symbol("matrix_scale");class r extends(yt(i)){constructor(){super(...arguments),this[t]=new pt,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(e){super.updateMatrix(e);const{scalingX:t,scalingY:i,scalingCenterX:r,scalingCenterY:n}=this;1===t&&1===i||(pt.updateTransformMatrix(this[s],t,i,0,0,0,{scalingCenterX:r,scalingCenterY:n}),e.multiplySelf(this[s]))}}return t=s,a([$()],r.prototype,"scalingX",2),a([$()],r.prototype,"scalingY",2),a([$()],r.prototype,"scalingCenterX",2),a([$()],r.prototype,"scalingCenterY",2),r}function bt(e){var t;const i=e,s=Symbol("matrix_translation");class r extends(yt(i)){constructor(){super(...arguments),this[t]=new pt,this.translationX=0,this.translationY=0}updateMatrix(e){super.updateMatrix(e);const{translationX:t,translationY:i}=this;0===t&&0===i||(pt.updateTransformMatrix(this[s],1,1,0,t,i),e.multiplySelf(this[s]))}}return t=s,a([$()],r.prototype,"translationX",2),a([$()],r.prototype,"translationY",2),r}var St,wt=class{static fromCanvas(e,t){const i=[];for(const t of e.traverseUp())gt(t)&&i.unshift(t);for(const e of i)t=e.fromParent(t);return gt(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){null==t?t=e.getBBox():gt(e)&&(t=e.toParent(t));for(const i of e.traverseUp())gt(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const t of e.traverseUp())gt(t)&&s.unshift(t);for(const e of s)({x:t,y:i}=e.fromParentPoint(t,i));return gt(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){gt(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())gt(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},xt=(e,t)=>Math.sign(e-t);function Et(e,t){if("number"==typeof e&&"number"==typeof t)return xt(e,t);const i="number"==typeof e?[e]:e,s="number"==typeof t?[t]:t,r=Math.min(i.length,s.length);for(let e=0;e<r;e+=1){const t=xt(i[e],s[e]);if(0!==t)return t}return xt(i.length,s.length)}var Mt=class e extends J{constructor(e){super(e),this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=!0===e?.renderToOffscreenCanvas}static is(t){return t instanceof e}static computeChildrenBBox(e,t=!0){return f.merge(J.extractBBoxes(e,t))}static compareChildren(e,t){return Et(e.zIndex,t.zIndex)||e.serialNumber-t.serialNumber}containsPoint(e,t){return!0}computeBBox(){return e.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const t=this.computeBBox();if(!t.isFinite())return;let i=0;for(const e of this.descendants())e instanceof dt&&(i=Math.max(i,e.strokeWidth));const s=Math.max(1,i/2*4),{x:r,y:n}=wt.toCanvasPoint(this,0,0),o=tt(e,r+t.x-s)-r,a=tt(e,n+t.y-s)-n,l=Math.ceil(t.x+t.width-o+s),c=Math.ceil(t.y+t.height-a+s);return new f(o,a,l,c)}prepareSharedCanvas(e,t,i){return null==St||St.pixelRatio!==i?St=new w({width:e,height:t,pixelRatio:i}):St.resize(e,t,i),St}isDirty(e){const{width:t,height:i,devicePixelRatio:s}=e,{dirty:r,dirtyZIndex:n,layer:o}=this,a=null!=o&&(this._lastWidth!==t||this._lastHeight!==i),l=this._lastDevicePixelRatio!==s;if(this._lastWidth=t,this._lastHeight=i,this._lastDevicePixelRatio=s,r||n||a||l)return!0;for(const e of this.children())if(e.dirty)return!0;return!1}preRender(e){const t=super.preRender(e,0);return t.groups+=1,t.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&t.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):null!=this.layer&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),t}render(t){const{layer:i,renderToOffscreenCanvas:s}=this,r={...t};if(!s)return this.renderInContext(r),void super.render(r);const{ctx:n,stats:o,devicePixelRatio:a}=t;let{image:l}=this;if(this.isDirty(t)){l?.bitmap.close(),l=void 0;const t=i?void 0:this.computeSafeClippingBBox(a),s=(e,...t)=>{const i=e.context;r.ctx=i,e.clear(),i.save(),i.setTransform(...t),i.globalAlpha=1,this.renderInContext(r),i.restore(),i.verifyDepthZero?.()};if(i)s(i,n.getTransform());else if(t){const{x:e,y:i,width:r,height:n}=t,o=this.prepareSharedCanvas(r,n,a);s(o,a,0,0,a,-e*a,-i*a),l={bitmap:o.transferToImageBitmap(),x:e,y:i,width:r,height:n}}else this.dirtyZIndex&&this.sortChildren(e.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(r),o&&o.layersSkipped++;const{globalAlpha:c}=n;if(n.globalAlpha=c*this.opacity,i)n.save(),n.resetTransform(),i.drawImage(n),n.restore();else if(l){const{bitmap:e,x:t,y:i,width:s,height:r}=l;n.drawImage(e,0,0,s*a,r*a,t,i,s,r)}n.globalAlpha=c,super.render(r)}skipRender(e){const{stats:t}=e;for(const e of this.children())e.markClean(),t&&(t.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,t.opsSkipped+=this.childNodeCounts.complexity)}applyClip(e,t){const{x:i,y:s,width:r,height:n}=t;e.beginPath(),e.rect(i,s,r,n),e.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&this.sortChildren(e.compareChildren),i.save(),i.globalAlpha*=this.opacity,null!=this.clipRect&&(this.applyClip(i,this.clipRect),t.clipBBox=wt.toCanvas(this,this.clipRect));for(const e of this.children())e.visible?(i.save(),e.render(t),i.restore()):(e.markClean(),s&&(s.nodesSkipped+=e.childNodeCounts.nonGroups+e.childNodeCounts.groups,s.opsSkipped+=e.childNodeCounts.complexity));i.restore()}setClipRect(e){this.clipRect=e?wt.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}setScene(e){this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0),super.setScene(e)}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],t=[];for(const i of this.children()){const s=i.toSVG();null!=s&&(t.push(...s.elements),null!=s.defs&&e.push(...s.defs))}return{elements:t,defs:e}}};Mt.className="Group",a([$({convertor:e=>(0,s.qE)(0,e,1)})],Mt.prototype,"opacity",2);var At=Mt,Tt=class extends(Ct(At)){},Dt=class extends(vt(At)){},It=class extends(bt(At)){},Rt=class extends(vt(bt(At))){};function Pt(e,t){e&&(null==(t=h.normalize(t)).width?e.style.removeProperty("width"):e.style.width=`${t.width}px`,null==t.height?e.style.removeProperty("height"):e.style.height=`${t.height}px`,null==t.x?e.style.removeProperty("left"):e.style.left=`${t.x}px`,null==t.y?e.style.removeProperty("top"):e.style.top=`${t.y}px`)}function kt(e){const t=parseFloat(e.style.width)||e.offsetWidth,i=parseFloat(e.style.height)||e.offsetHeight;return{x:parseFloat(e.style.left)||e.offsetLeft,y:parseFloat(e.style.top)||e.offsetTop,width:t,height:i}}function Lt(e){if(e.focus({preventScroll:!0}),null==e.lastChild?.textContent)return;const t=(0,s.YE)().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=(0,s.zk)().getSelection();i?.removeAllRanges(),i?.addRange(t)}function Nt(){const e=(0,s.zk)("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function _t(e){return`ag-charts-icon ag-charts-icon-${e}`}var Ot="class-instance";function Ft(e,t,i){if((0,s.cy)(t)){if(!(0,s.cy)(e)||e.length!==t.length||t.some((t,s)=>null!=Ft(e[s],t,i)))return t}else{if((0,s.Qd)(t)){if(!(0,s.Qd)(e))return t;const r={},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const s of n)if(e[s]!==t[s])if(i?.has(s))r[s]=t[s];else if(typeof e[s]==typeof t[s]){const n=Ft(e[s],t[s],i);null!==n&&(r[s]=n)}else r[s]=t[s];return Object.keys(r).length?r:null}if(e!==t)return t}return null}function Gt(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Bt(e,t){return(0,s.cy)(e)?function(e,t){const i=[],r=t?.seen;for(const n of e)"object"==typeof n&&r?.includes(n)?s.Vy.warn("cycle detected in array",n):(r?.push(n),i.push(Bt(n,t)),r?.pop());return i}(e,t):(0,s.Qd)(e)?function(e,t){const i={};for(const s of Object.keys(e))t?.assign?.has(s)?i[s]=e[s]:t?.shallow?.has(s)?i[s]=Vt(e[s]):i[s]=Bt(e[s],t);return i}(e,t):e instanceof Map?new Map(Bt(Array.from(e))):Vt(e)}function Vt(e){return(0,s.cy)(e)?e.slice(0):(0,s.Qd)(e)?{...e}:(0,s.$P)(e)?new Date(e):(0,s.gd)(e)?new RegExp(e.source,e.flags):e}function Ht(e,t,i,r,n,o){if((0,s.cy)(e)){o=t(e,r,n,o);let s=0;for(const a of e)o=Ht(a,t,i,r?.[s],n,o),s++}else if((0,s.Qd)(e)){o=t(e,r,n,o);for(const s of Object.keys(e))i?.has(s)||(o=Ht(e[s],t,i,r?.[s],n,o))}return o}function Ut(e,t,i={}){const{path:r,matcherPath:n=r?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(null==e)throw new Error(`AG Charts - target is uninitialised: ${r??"<root>"}`);if(null==t)return e;if(Re(e))return e.set(t);const a=e,l=zt(e);for(const c of Object.keys(t)){if(V.has(c))continue;const h=`${n?n+".":""}${c}`;if(o.includes(h))continue;const d=t[c],u=`${r?r+".":""}${c}`,p=a.constructor,g=a[c];try{const t=zt(g),r=zt(d);if(l===Ot&&!(c in e)&&"context"!==c){if(void 0===d)continue;s.Vy.warn(`unable to set [${u}] in ${p?.name} - property is unknown`);continue}if(null!=t&&null!=r&&r!==t&&(t!==Ot||"object"!==r)){s.Vy.warn(`unable to set [${u}] in ${p?.name} - can't apply type of [${r}], allowed types are: [${t}]`);continue}if(Re(g))a[c].set(d);else if("object"===r&&"context"!==c){if(null==g){s.Vy.warn(`unable to set [${u}] in ${p?.name} - property is unknown`);continue}Ut(g,d,{...i,path:u,matcherPath:h})}else a[c]=d}catch(e){s.Vy.warn(`unable to set [${u}] in [${p?.name}]; nested error is: ${e.message}`)}}return e}function zt(e){return null==e?null:(0,s.uE)(e)||(0,s.$P)(e)?"primitive":(0,s.cy)(e)?"array":(0,s.Gv)(e)?(0,s.Qd)(e)?"object":Ot:(0,s.Tn)(e)?"function":"primitive"}function Wt(e,t,i,s){return Kt(e,t,s??e,{matches:new Map},i)}var jt=Symbol("operation-resolved-undefined");function Kt(e,t,i,r,n,o=[],a={}){if((0,s.cy)(e)){$t(e,t,i,r,o,a);let s=0;for(const l of e)Kt(l,t,i,r,n,[...o,`${s}`],a),s++}else if((0,s.Qd)(e)){$t(e,t,i,r,o,a);for(const s of Object.keys(e)){if(n?.has(s))continue;const l=e[s];qt(l)?e[s]=Yt(l,t,i,r,[...o,s],a):Kt(l,t,i,r,n,[...o,s],a)}}return a}function $t(e,t,i,r,n,o){if((0,s.cy)(e))for(let s=0;s<e.length;s++)e[s]=Yt(e[s],t,i,r,[...n,`${s}`],o),e[s]===jt&&(e[s]=void 0);else{let s=!1;for(const a of Object.keys(e))e[a]=Yt(e[a],t,i,r,[...n,a],o),s||(s=Zt(a,ti)),e[a]===jt&&delete e[a];if(s&&Object.keys(e).length>1)for(const t of Object.keys(e))Zt(t,ti)&&delete e[t]}}function Yt(e,t,i,s,r,n){const o=qt(e);if(!o)return e;n[r.join(".")]=e;const a=Xt(o.operation,o.values,t,i,r,s);return void 0===a?jt:a}function qt(e){if(!(0,s.Qd)(e))return;const[t]=Object.keys(e);return Zt(t,ti)?{operation:t,values:e[t]}:void 0}function Xt(e,t,i,r,n,o){return o.referencedParams??(o.referencedParams=new Set),(0,s.cy)(t)&&!["$find","$map"].includes(e)&&(t=t.map(e=>{const t=qt(e);return t?Xt(t.operation,t.values,i,r,n,o):e})),(0,ti[e])(t,n,i,r,o)}function Zt(e,t){return(0,s.Kg)(e)&&((0,s.Gv)(t)||(0,s.cy)(t))&&e in t}function Qt(e){return(0,s.Et)(e)&&e>=0&&e<=1}function Jt(e){return(0,s.Gv)(e)&&"gradient"==e.type}function ei(e,t){const i=t.split("/");let s=[...e];t.startsWith("/")&&(s=[],i.shift());let r=!1;for(const t of i){if(".."===t)s.pop(),r||s.pop();else if("."===t)s.pop();else if("$index"===t){const t=e.findLast(e=>!isNaN(Number(e)));null!=t&&s.push(t)}else if("$prevIndex"===t){const t=e.findLast(e=>!isNaN(Number(e)));null!=t&&s.push(""+(Number(t)-1))}else 0!==t.length&&s.push(t);r=".."===t}return s}var ti={...{$ref:function e(t,i,r,n,o){if(!Zt(t,r))return void s.Vy.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${i.join(".")}], expecting one of [${Object.keys(r).join(", ")}].`);const a=qt(r[t]);return"$ref"!==a?.operation?r[t]:o.referencedParams?.has(a.values)?void s.Vy.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${i.join(".")}], circular reference detected with [${[...o.referencedParams].join(", ")}].`):(o.referencedParams?.add(a.values),e(a.values,i,r,n,o))},$path:function(e,t,i,r){let n,o=!1,a=!1,l=r;if((0,s.cy)(e))o=!0,n=e[1],a=3===e.length,l=a?e[2]:l,e=e[0];else if(!(0,s.Kg)(e))return void s.Vy.warnOnce(`\`$path\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a string.`);const c=ei(a?[]:t,e);let h=l;for(const i of c){if(!Zt(i,h))return o?n:void s.Vy.warnOnce(`\`$path\` json operation failed on [${String(e)}] at [${t.join(".")}] resolved to [${c.join(".")}], could not find path in object.`);h=h[i]}return Object.isFrozen(h)?Bt(h):h},$palette:function(e,t,i,r){if(!(0,s.Kg)(e))return;const n=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(e)){const i=t.findLastIndex(e=>!isNaN(Number(e)));let o=Number(t[i]);if(isNaN(o))return;const a=t.slice(0,i),l=["map-shape-background","map-line-background"];switch(o-=B(r,a).slice(0,o).filter(e=>l.includes(e.type)).length,e){case"fill":return(0,s.XK)(n.fills,1,o)[0];case"fillFallback":return(0,s.XK)(n.fillsFallback,1,o)[0];case"stroke":return(0,s.XK)(n.strokes,1,o)[0];case"gradient":return(0,s.XK)(n.sequentialColors,1,o)[0];case"range2":return(0,s.XK)(n.fills,2,o)}return}return"gradients"===e?n.sequentialColors:B(n,e)}},$if:([e,t,i])=>e?t:i,$eq:([e,t])=>e===t,$not:([e])=>!e,$or:e=>(0,s.cy)(e)&&e.some(Boolean),$and:e=>(0,s.cy)(e)&&e.every(Boolean),$switch:()=>{},$isOperation:function(e,t,i,r){const n=(0,s.Kg)(e)?ei(t,e):t;return null!=qt(0===n.length?r:B(r,n))},$isEven:function([e],t){if("number"==typeof e)return e%2==0;s.Vy.warnOnce(`\`$isEven\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)},$mul:function([e,t],i){if("number"==typeof e&&"number"==typeof t)return e*t;s.Vy.warnOnce(`\`$mul\` json operation failed on [${String(e)}] and [${String(t)}] at [${i.join(".")}], expecting two numbers.`)},$round:function([e],t){if("number"==typeof e)return Math.round(e);s.Vy.warnOnce(`\`$round\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)},$map:function([e,t],i,r,n,o){const a=qt(t);if(a&&(t=Xt(a.operation,a.values,r,n,i,o)),!(0,s.cy)(t))return[];const l=qt(e);return l?(o.matches.set(i.join("."),t),t.map(()=>({[l.operation]:l.values}))):[]},$find:function([e,t],i,r,n,o){const a=qt(t);if(a&&(t=Xt(a.operation,a.values,r,n,i,o)),!(0,s.cy)(t))return;const l=qt(e);return l?t.find(e=>Xt(l.operation,l.values,r,e,[],o)):e?t[0]:void 0},$merge:function(e){if((0,s.cy)(e)){for(const t of e)if(!(0,s.Qd)(t))return;return N(...e)}},$omit:function([e,t]){if((0,s.cy)(e)&&(0,s.Qd)(t))return G(t,e)},$value:function(e,t,i,s,r){if("$1"!==e&&"$index"!==e)return e;const n=t.findLastIndex(e=>!isNaN(Number(e)));if(-1===n)return e;const o=Number(t[n]);if("$index"===e)return o;const a=t.slice(0,n).join(".");return r.matches.get(a)?.at(o)},$rem:function([e],t,i){const r="fontSize";if(Zt(r,i)&&"number"==typeof i[r]&&"number"==typeof e)return Math.round(e*i[r]);s.Vy.warnOnce(`\`$rem\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)},$mix:function([e,t,i],r){const n=`\`$mix\` json operation failed on [${String(e)}, ${String(t)}, ${String(i)}] at [${r.join(".")}], expecting`,o=`${n} two colors and a number between 0 and 1.`;if("string"!=typeof t||!Qt(i))return void s.Vy.warnOnce(o);if("string"==typeof e)try{return fe.mix(fe.fromString(e),fe.fromString(t),i).toString()}catch{return void s.Vy.warnOnce(o)}if(!Jt(e))return void s.Vy.warnOnce(o);let a=e.colorStops;try{a=a?.map(e=>{let s;return"string"==typeof e.color&&(s=fe.mix(fe.fromString(e.color),fe.fromString(t),i).toString()),{...e,color:s}})}catch{return void s.Vy.warnOnce(`${n} a gradient, a color and a number between 0 and 1.`)}return{...e,colorStops:a}},$foregroundBackgroundMix:function([e],t,i){const r="foregroundColor",n="backgroundColor";if(Zt(r,i)&&Zt(n,i)&&"string"==typeof i[r]&&"string"==typeof i[n]&&Qt(e))return fe.mix(fe.fromString(i[r]),fe.fromString(i[n]),e).toString();s.Vy.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(e)}}}] at [${t.join(".")}], expecting a number between 0 and 1.`)},$foregroundBackgroundAccentMix:function([e,t],i,r){const n="foregroundColor",o="backgroundColor",a="accentColor";if(Zt(n,r)&&Zt(o,r)&&Zt(a,r)&&"string"==typeof r[n]&&"string"==typeof r[o]&&"string"==typeof r[a]&&Qt(e)&&Qt(t))return fe.mix(fe.mix(fe.fromString(r[n]),fe.fromString(r[o]),e),fe.fromString(r[a]),t).toString();s.Vy.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(e)}, ${String(t)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)},$interpolate:function([e,t]){if((0,s.cy)(e)&&(0,s.Et)(t))return fe.interpolate(e.map(e=>fe.fromString(e)),t).map(e=>e.toString())},$isGradient:([e])=>Jt(e),$isPattern:([e])=>{return null!==(t=e)&&(0,s.Gv)(t)&&"pattern"==t.type;var t},$isImage:([e])=>{return null!==(t=e)&&(0,s.Gv)(t)&&"image"==t.type;var t}},ii=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(e=>s.Vy.errorOnce(e))})}async acquireImmediately(e){return!!this.available&&(await this.acquire(e),!0)}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(e){s.Vy.error("mutex callback error",e),t?.()}[e,t]=this.acquireQueue.shift()??[]}this.available=!0}},si=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if("function"!=typeof t)throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);null!=i&&(i.delete(t),0===i.size&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){this.eventListeners.get(e.type)?.forEach(t=>t(e))}},ri=class extends De{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}};function ni(e,t){const i=(0,s.cy)(e)?e:e.split(".");if(1===i.length){const[e]=i;return T((t,i,s)=>t[e]=s,t=>t[e],t)}return T((e,t,s)=>H(e,i,s),e=>B(e,i),t)}function oi(e){return T((t,i,s)=>t[e]=s)}function ai(e,t){return T((i,s,r)=>i[e][t??s]=r)}function li(e){const{newValue:t,oldValue:i,changeValue:s}=e;return T((e,r,n,o)=>(n!==o&&(void 0!==o&&i?.call(e,o),void 0!==n&&t?.call(e,n),s?.call(e,n,o)),n))}function ci(e){return D(e)}function hi(e,t){let i,s,r=0,n=!1;const o=()=>n,a=()=>{n=!1,s?.(),s=void 0,i=void 0,r>0&&e(l)},l=()=>{const e=r;r=0,n=!0;const i=t({count:e});i?i.then(a,a):a()};return{schedule(t){0!==r||o()||e(l,t),r++},async await(){if(o())for(null==i&&(i=new Promise(e=>{s=e}));o();)await i}}}a([Te],ri.prototype,"top",2),a([Te],ri.prototype,"right",2),a([Te],ri.prototype,"bottom",2),a([Te],ri.prototype,"left",2);var di=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function ui(e,t,i){const{offsetX:s,offsetY:r,clientX:n,clientY:o}=t,{currentX:a,currentY:l}=mi.calcCurrentXY(i,t);return{type:e,offsetX:s,offsetY:r,clientX:n,clientY:o,currentX:a,currentY:l,sourceEvent:t}}function pi(e,t,i){return{type:e,sourceEvent:t}}var gi={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>ui("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>ui("click",e,t),dblclick:(e,t)=>ui("dblclick",e,t),mouseenter:(e,t)=>ui("mouseenter",e,t),mousemove:(e,t)=>ui("mousemove",e,t),mouseleave:(e,t)=>ui("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:s,clientY:r}=e,n=0===e.deltaMode?.01:1;return{type:"wheel",offsetX:t,offsetY:i,clientX:s,clientY:r,deltaX:e.deltaX*n,deltaY:e.deltaY*n,sourceEvent:e}},touchstart:(e,t)=>pi("touchstart",e),touchmove:(e,t)=>pi("touchmove",e),touchend:(e,t)=>pi("touchend",e),touchcancel:(e,t)=>pi("touchcancel",e)},mi=class{static alloc(e,t,i){return gi[e](t,i)}static isHTMLEvent(e){return di.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},fi=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const i=i=>{const s=mi.alloc(e,i,t.getElement());for(const i of this.widgetListeners?.[e]??[])i(s,t)},s={};e.startsWith("touch")&&(s.passive=!1),this.initSourceHandler(e,i),t.getElement().addEventListener(e,i,s)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const s=this.lazyGetWidgetListeners(e,t),r=s.indexOf(i);r>-1&&s.splice(r,1)}destroy(e){for(const[t,i]of(0,s.jO)(this.sourceListeners??{}))e.getElement().removeEventListener(t,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},yi=class{constructor(e,t,i,r){this.glob=e,this.self=t,this.window=(0,s.zk)(),this.mousegeneral=e=>{e.stopPropagation(),e.stopImmediatePropagation()},this.mousemove=e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(e)},this.mouseup=e=>{0===e.button&&(e.stopPropagation(),e.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(e),this.destroy())};const{window:n,mousegeneral:o,mousemove:a,mouseup:l}=this;n.addEventListener("mousedown",o,{capture:!0}),n.addEventListener("mouseenter",o,{capture:!0}),n.addEventListener("mouseleave",o,{capture:!0}),n.addEventListener("mouseout",o,{capture:!0}),n.addEventListener("mouseover",o,{capture:!0}),n.addEventListener("mousemove",a,{capture:!0}),n.addEventListener("mouseup",l,{capture:!0}),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(r)}destroy(){const{window:e,mousegeneral:t,mousemove:i,mouseup:s}=this;e.removeEventListener("mousedown",t,{capture:!0}),e.removeEventListener("mouseenter",t,{capture:!0}),e.removeEventListener("mouseleave",t,{capture:!0}),e.removeEventListener("mouseout",t,{capture:!0}),e.removeEventListener("mouseover",t,{capture:!0}),e.removeEventListener("mousemove",i,{capture:!0}),e.removeEventListener("mouseup",s,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}},vi=!1,Ci=class{constructor(e,t,i,r,n){this.glob=e,this.self=t,this.initialTouch=r,this.target=n,this.longTapInterrupted=!1,this.longtap=()=>{const{target:e,initialTouch:t}=this;if(!this.longTapInterrupted){e.dispatchEvent(new TouchEvent("touchcancel",{touches:[t],bubbles:!0})),vi=!0;const i=e=>{e.preventDefault()},r=t=>{vi=!1,t.preventDefault(),e.removeEventListener("touchmove",i),e.removeEventListener("touchend",r),e.removeEventListener("touchcancel",r)};e.addEventListener("touchmove",i,{passive:!1}),e.addEventListener("touchend",r,{passive:!1}),e.addEventListener("touchcancel",r,{passive:!1});const{clientX:n,clientY:o}=t,a=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:(0,s.zk)(),clientX:n,clientY:o,pointerType:"touch"});e.dispatchEvent(a)}},this.touchmove=e=>{const{glob:t,self:i,initialTouch:s}=this,r=this.findInitialFinger(e.targetTouches);null!=r&&(this.longTapInterrupted=this.longTapInterrupted||function(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}(s,r)>100,i.dragTouchEnabled&&null!=r&&t.globalTouchDragCallbacks?.touchmove(e,r))},this.touchend=e=>{this.longTapInterrupted=!0;const t=this.findInitialFinger(e.changedTouches,e.touches);null!=t&&this.glob.globalTouchDragCallbacks?.touchend(e,t),this.destroy()},this.longtapTimer=setTimeout(this.longtap,500);const{touchmove:o,touchend:a}=this;n.addEventListener("touchmove",o,{passive:!1}),n.addEventListener("touchstart",a,{passive:!1}),n.addEventListener("touchend",a,{passive:!1}),n.addEventListener("touchcancel",a,{passive:!1}),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:e,touchmove:t,touchend:i}=this;clearTimeout(e),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",t),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.map(e=>Array.from(e)).flat();return Array.from(t).find(e=>e.identifier===this.initialTouch.identifier)}};function bi(e,t,i,s){const{currentX:r,currentY:n}=mi.calcCurrentXY(e.getElement(),s),o=s.pageX-i.pageX,a=s.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+a,clientX:s.clientX,clientY:s.clientY,currentX:r,currentY:n,originDeltaX:o,originDeltaY:a,sourceEvent:s}}function Si(e,{pageX:t,pageY:i}){const{x:s,y:r}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-r}}function wi(e,t,i,s,r){const{currentX:n,currentY:o}=mi.calcCurrentXY(e.getElement(),r),a=r.pageX-i.pageX,l=r.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+a,offsetY:i.offsetY+l,clientX:r.clientX,clientY:r.clientY,currentX:n,currentY:o,originDeltaX:a,originDeltaY:l,sourceEvent:s}}var xi={},Ei=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return void 0===t&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":this.registerDragTrigger(t)}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(null==this.dragTriggerRemover){const t=t=>this.triggerMouseDrag(e,t),i=t=>this.triggerTouchDrag(e,t);e.getElement().addEventListener("mousedown",t),e.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{e.getElement().removeEventListener("mousedown",t),e.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(e,t){0===t.button&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};U(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:t=>{const s=bi(e,"drag-start",i,t);this.dispatch("drag-start",e,s)},mousemove:t=>{const s=bi(e,"drag-move",i,t);this.dispatch("drag-move",e,s)},mouseup:t=>{const s=bi(e,"drag-end",i,t);this.dispatch("drag-end",e,s),this.endDrag(e,s)}};this.mouseDragger=function(e,t,i,s){if(null==e.globalMouseDragCallbacks)return new yi(e,t,i,s)}(xi,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const r=e.getElement(),n=r.getBoundingClientRect();h.containsPoint(n,i,s)||(r.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];1===t.targetTouches.length&&null!=i&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const s={pageX:NaN,pageY:NaN,...Si(e,i)};U(["pageX","pageY"],s,i);const r={touchmove:(t,i)=>{const r=wi(e,"drag-move",s,t,i);this.dispatch("drag-move",e,r)},touchend:(t,i)=>{const r=wi(e,"drag-end",s,t,i);this.dispatch("drag-end",e,r)}},n=e.getElement();this.touchDragger=function(e,t,i,s,r){if(null==e.globalTouchDragCallbacks&&!vi)return new Ci(e,t,i,s,r)}(xi,this,r,i,n);const o=wi(e,"drag-start",s,t,i);this.dispatch("drag-start",e,o)}dispatch(e,t,i){for(const s of this.getListenerSet(e))s(i,t);this.dispatchCallback(e,i)}},Mi=class{constructor(e){this.elem=e}setBounds(e){Pt(this.elemContainer??this.elem,e)}getBounds(){return kt(this.elemContainer??this.elem)}static setElementContainer(e,t){Pt(t,e.getBounds()),(0,s.Hs)(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Ai=class extends Mi{constructor(e){super(e),this.elem=e,this.index=NaN,this.children=[]}set id(e){(0,s.Bq)(this.elem,"id",e)}get id(){return(0,s.D$)(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(e=>{e.parent=void 0,e.destroy()}),this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){(0,s.EM)(this.elem,"display",e?"none":void 0)}isHidden(){return"none"===(0,s.zk)()?.getComputedStyle?.(this.elem).display}setCursor(e){(0,s.EM)(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){(0,s.Bq)(this.elem,"aria-describedby",e)}setAriaHidden(e){(0,s.Bq)(this.elem,"aria-hidden",e)}setAriaLabel(e){(0,s.Bq)(this.elem,"aria-label",e)}setAriaExpanded(e){(0,s.Bq)(this.elem,"aria-expanded",e)}setAriaControls(e){(0,s.Bq)(this.elem,"aria-controls",e)}setAriaHasPopup(e){(0,s.Bq)(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){(0,s.EM)(this.elem,"pointer-events",e)}isDisabled(){return(0,s.D$)(this.elem,"aria-disabled",!1)}hasPopup(){const e=(0,s.D$)(this.elem,"aria-haspopup");return void 0!==e&&"false"!==e}parseFloat(e){return""===e?0:parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){(0,s.Bq)(this.elem,"data-focus-override",e)}setPreventsDefault(e){(0,s.Bq)(this.elem,"data-preventdefault",e)}setTabIndex(e){(0,s.Bq)(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.findIndex(t=>t===e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){this.elem.removeChild(e.getElement())}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(void 0!==e)return this.children.filter(t=>void 0!==t.domIndex&&t.domIndex>e).reduce((e,t)=>!e||t.domIndex<e.domIndex?t:e,void 0)}addListener(e,t){return mi.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new fi),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new Ei(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){mi.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):null!=this.htmlListener&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new Ei(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;null!=i;){const{internalListener:s}=i;if(null!=s){const r={...t,...mi.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,r)}i=i.parent}}static addWindowEvent(e,t){const i=e=>{e.persisted||t()};return(0,s.zk)().addEventListener("pagehide",i),()=>(0,s.zk)().removeEventListener("pagehide",i)}},Ti=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const e=this.store.keys();let t=this.store.size-this.maxCacheSize;for(;t>0;){const i=e.next();i.done||this.store.delete(i.value),t--}}return t}clear(){this.store.clear()}},Di=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t="string"==typeof e.font?e.font:Ri.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=function(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"alphabetic";const r=new Ii(s,t);return this.instanceMap.set(i,r),r}};Di.instanceMap=new Ti(10);var Ii=class{constructor(e,t){this.ctx=e,this.measureMap=new Ti(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font="string"==typeof t.font?t.font:Ri.toFontString(t.font),this.textMeasurer=new Pi(e=>this.cachedCtxMeasureText(e),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},Ri=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:s,lineHeight:r}){let n="";return t&&(n+=`${t} `),i&&(n+=`${i} `),n+=`${e}px`,r&&(n+=`/${r}px`),n+=` ${s}`,n.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return.5;default:return 1}}};Ri.EllipsisChar="…",Ri.defaultLineHeight=1.15,Ri.lineSplitter=/\r?\n/g;var Pi=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}}getMultilineMetrics(e){let t=0,i=0,s=0,r=0,n=0;const o=Ri.getVerticalModifier(this.textBaseline),a=[];let l=0;const c=e.length;for(const o of e){const e=this.measureTextFn(o);e.fontBoundingBoxAscent??(e.fontBoundingBoxAscent=e.emHeightAscent),e.fontBoundingBoxDescent??(e.fontBoundingBoxDescent=e.emHeightDescent),t<e.width&&(t=e.width),r<e.actualBoundingBoxLeft&&(r=e.actualBoundingBoxLeft),0===l?(i+=e.actualBoundingBoxAscent,s+=e.actualBoundingBoxAscent):n+=e.fontBoundingBoxAscent,l===c-1?i+=e.actualBoundingBoxDescent:n+=e.fontBoundingBoxDescent,a.push({text:o,width:e.width,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,lineHeight:e.fontBoundingBoxAscent+e.fontBoundingBoxDescent,offsetTop:e.actualBoundingBoxAscent,offsetLeft:e.actualBoundingBoxLeft}),l++}return i+=n,s+=n*o,{width:t,height:i,offsetTop:s,offsetLeft:r,lineMetrics:a}}textWidth(e,t){if(t){let t=0;for(let i=0;i<e.length;i++)t+=this.textWidth(e.charAt(i));return t}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t="string"==typeof e?e.split(Ri.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},ki=class e extends dt{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=e.defaultStyles.textAlign,this.textBaseline=e.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split("\n").map(e=>e.trim())??[]}static computeBBox(e,t,i,s){const{offsetTop:r,offsetLeft:n,width:o,height:a}=Di.measureLines(e,s),l=s.lineHeight?s.lineHeight*e.length:a;return new f(t-n,i-r,o,l)}computeBBox(){const{x:t,y:i,lines:s,textBaseline:r,textAlign:n,lineHeight:o}=this;return e.computeBBox(s,t,i,{font:this,textBaseline:r,textAlign:n,lineHeight:o})}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(e,t){const i=this.getBBox();return!!i&&i.containsPoint(e,t)}render(e){const{ctx:t,stats:i}=e;if(!this.lines.length||!this.layerManager)return i&&(i.nodesSkipped+=1),super.render(e);const{fill:s,stroke:r,strokeWidth:n}=this,{globalAlpha:o}=t,{pixelRatio:a}=this.layerManager.canvas;if(!(s||null!=r&&n>0))return super.render(e);const l=Ri.toFontString(this);if(t.font!==l&&(t.font=l),t.textAlign=this.textAlign,t.textBaseline=this.textBaseline,s){this.applyFillAndAlpha(t);const{fillShadow:e}=this;e?.enabled&&(t.shadowColor=e.color,t.shadowOffsetX=e.xOffset*a,t.shadowOffsetY=e.yOffset*a,t.shadowBlur=e.blur*a),this.renderLines((e,i,s)=>t.fillText(e,i,s)),t.globalAlpha=o}if(r&&n){this.applyStrokeAndAlpha(t),t.lineWidth=n;const{lineDash:e,lineDashOffset:i,lineCap:s,lineJoin:r}=this;e&&t.setLineDash([...e]),i&&(t.lineDashOffset=i),s&&(t.lineCap=s),r&&(t.lineJoin=r),this.renderLines((e,i,s)=>t.strokeText(e,i,s)),t.globalAlpha=o}super.render(e)}renderLines(e){const{lines:t,x:i,y:s}=this,r=this.lineHeight??Ri.getLineHeight(this.fontSize);let n=(r-r*t.length)*Ri.getVerticalModifier(this.textBaseline);for(const o of t)e(o,i,s+n),n+=r}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}toSVG(){if(!this.visible||!this.text)return;const e=(0,s.FJ)("text");return this.applySvgFillAttributes(e),e.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),e.setAttribute("font-size",String(this.fontSize)),e.setAttribute("font-style",this.fontStyle??""),e.setAttribute("font-weight",String(this.fontWeight??"")),e.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),e.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),e.setAttribute("x",String(this.x)),e.setAttribute("y",String(this.y)),e.textContent=this.text??"",{elements:[e]}}};ki.className="Text",ki.defaultStyles={...dt.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},a([$()],ki.prototype,"x",2),a([$()],ki.prototype,"y",2),a([$({convertor:e=>(0,s.vM)(e)?String(e):e,changeCb:e=>e.onTextChange()})],ki.prototype,"text",2),a([$()],ki.prototype,"fontStyle",2),a([$()],ki.prototype,"fontWeight",2),a([$()],ki.prototype,"fontSize",2),a([$()],ki.prototype,"fontFamily",2),a([$()],ki.prototype,"textAlign",2),a([$()],ki.prototype,"textBaseline",2),a([$()],ki.prototype,"lineHeight",2);var Li=ki,Ni=class extends(vt(Li)){},_i=class extends(vt(bt(Li))){},Oi=class{static wrapText(e,t){return this.wrapLines(e,t).join("\n")}static wrapLines(e,t){const i=this.textWrap(e,t);return"hide"===t.overflow&&i.some(e=>e.endsWith(Ri.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+Ri.EllipsisChar}static truncateLine(e,t,i,s){const r=t.textWidth(Ri.EllipsisChar);let n=0,o=0;for(;o<e.length;o++){const s=t.textWidth(e.charAt(o));if(n+s>i)break;n+=s}if(e.length===o&&(!s||n+r<=i))return s?e+Ri.EllipsisChar:e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+r>i;)e=e.slice(0,-1).trimEnd();return e+Ri.EllipsisChar}static textWrap(e,t){const i=e.split(Ri.lineSplitter),s=Di.getMeasurer(t);if("never"===t.textWrap)return i.map(e=>this.truncateLine(e.trimEnd(),s,t.maxWidth));const r=[],n="hyphenate"===t.textWrap,o=null==t.textWrap||"on-space"===t.textWrap;for(const e of i){let i=e.trimEnd();if(""===i){r.push(i);continue}let a=0,l=0,c=0;for(;a<i.length;){const e=i.charAt(a);if(l+=s.textWidth(e)," "===e&&(c=a),l>t.maxWidth){if(0===a)break;const e=s.textWidth(i.slice(0,a+1));if(e<=t.maxWidth){l=e,a++;continue}if(c){const e=this.getWordAt(i,c+1),n=s.textWidth(e);if(n<=t.maxWidth){r.push(i.slice(0,c).trimEnd()),i=i.slice(c).trimStart(),a=0,l=0,c=0;continue}o&&n>t.maxWidth&&r.push(i.slice(0,c).trimEnd(),this.truncateLine(i.slice(c).trimStart(),s,t.maxWidth,!0))}else o&&r.push(this.truncateLine(i,s,t.maxWidth,!0));if(o){i="";break}const h=n?"-":"";let d=i.slice(0,a).trim();for(;d.length&&s.textWidth(d+h)>t.maxWidth;)d=d.slice(0,-1).trimEnd();if(r.push(d+h),!d.length){i="";break}i=i.slice(d.length).trimStart(),a=-1,l=0,c=0}a++}i&&r.push(i)}return this.avoidOrphans(r,s,t),this.clipLines(r,s,t)}static getWordAt(e,t){const i=e.indexOf(" ",t);return-1===i?e.slice(t):e.slice(t,i)}static clipLines(e,t,i){if(!i.maxHeight)return e;const{height:s,lineMetrics:r}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let s=0,n=0;s<r.length;s++){const{lineHeight:o}=r[s];if(n+=o,n>i.maxHeight){if("hide"===i.overflow)return[];const r=e.slice(0,s||1),n=r.pop();return r.concat(this.truncateLine(n,t,i.maxWidth,!0))}}return e}static avoidOrphans(e,t,i){if(!1===i.avoidOrphans||e.length<2)return;const{length:s}=e,r=e[s-1],n=e[s-2];if(n.length<r.length)return;const o=n.lastIndexOf(" ");if(-1===o||o===n.indexOf(" ")||r.includes(" "))return;const a=n.slice(o+1);t.textWidth(r+a)<=i.maxWidth&&(e[s-2]=n.slice(0,o),e[s-1]=a+" "+r)}},Fi=class extends De{constructor(){super(...arguments),this.id=(0,s.sX)(this),this.node=new Ni({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.layoutManager.addListener("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:r}=this,n=Math.min(this.maxWidth??1/0,e)-2*s,o=this.maxHeight??t-2*s;if(!isFinite(n)&&!isFinite(o))return void(this.node.text=i);const a=Oi.wrapText(i??"",{maxWidth:n,maxHeight:o,font:this,textWrap:r});this.node.text=a,this.truncated=a.includes(Ri.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const s=wt.toCanvas(this.node);if(s){const{id:r}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:r,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",t=>this.handleMouseMove(e,t)),this.proxyText.addListener("mouseleave",t=>this.handleMouseLeave(e,t))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(null!=t&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=wt.toCanvas(this.node),r=t.sourceEvent.offsetX+i,n=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:r,canvasY:n,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Fi.SMALL_PADDING=10,a([Te,ai("node","visible")],Fi.prototype,"enabled",2),a([Te,ai("node")],Fi.prototype,"text",2),a([Te,ai("node")],Fi.prototype,"textAlign",2),a([Te,ai("node")],Fi.prototype,"fontStyle",2),a([Te,ai("node")],Fi.prototype,"fontWeight",2),a([Te,ai("node")],Fi.prototype,"fontSize",2),a([Te,ai("node")],Fi.prototype,"fontFamily",2),a([Te,ai("node","fill")],Fi.prototype,"color",2),a([Te],Fi.prototype,"spacing",2),a([Te],Fi.prototype,"maxWidth",2),a([Te],Fi.prototype,"maxHeight",2),a([Te],Fi.prototype,"wrapping",2),a([Te],Fi.prototype,"padding",2),a([Te],Fi.prototype,"layoutStyle",2);var Gi=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(Gi||{});function Bi(e){switch(e){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var Vi=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Navigator=4]="Navigator",e[e.Overlay=5]="Overlay",e))(Vi||{}),Hi=class{constructor(){this.events=new s.bk,this.elements=new Map}addListener(e,t){return this.events.on(e,t)}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i=new Ui(e,t);for(const e of Object.values(Vi))"number"==typeof e&&this.elements.get(e)?.forEach(e=>e(i));return i}emitLayoutComplete(e,t){const i="layout:complete",{width:s,height:r}=e;this.events.emit(i,{type:i,axes:t.axes??[],chart:{width:s,height:r},clipSeries:t.clipSeries??!1,series:t.series})}},Ui=class{constructor(e,t){this.width=e,this.height=t,this.layoutBox=new f(0,0,e,t)}},zi=class{constructor(){this.title=new Fi,this.subtitle=new Fi,this.footnote=new Fi}positionCaptions(e){const{title:t,subtitle:i,footnote:s}=this,r=e.layoutBox.height/10;if(t.enabled){const{spacing:i}=t;this.positionCaption("top",t,e.layoutBox,r),this.shrinkLayoutByCaption("top",t,e.layoutBox,i)}i.enabled&&(this.positionCaption("top",i,e.layoutBox,r),this.shrinkLayoutByCaption("top",i,e.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,e.layoutBox,r),this.shrinkLayoutByCaption("bottom",s,e.layoutBox,s.spacing))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:r}=e.series;for(const e of[t,i,s])if("overlay"===e.layoutStyle)if("left"===e.textAlign)e.node.x=r.x+e.padding;else if("right"===e.textAlign){const t=e.node.getBBox();e.node.x=r.x+r.width-t.width-e.padding}}computeX(e,t){return"left"===e?t.x:"right"===e?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){const r=Math.max(Ri.getLineHeight(t.fontSize),s);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+("top"===e?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,r)}shrinkLayoutByCaption(e,t,i,s=0){if("block"===t.layoutStyle){const r=t.node.getTextMeasureBBox();i.shrink("top"===e?Math.ceil(r.y-i.y+r.height+s):Math.ceil(i.y+i.height-r.y+s),e)}}};a([Te],zi.prototype,"title",2),a([Te],zi.prototype,"subtitle",2),a([Te],zi.prototype,"footnote",2);var Wi=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],ji=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return null==e&&(e="candlestick"),e}guardMemento(e){return null==e||Wi.includes(e)}restoreMemento(e,t,i){if(null==i)return;const r={chartType:i};this.chartService.publicApi?.updateDelta(r).catch(e=>s.Vy.error("error restoring state",e))}},Ki=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0}setFns(e){this.destroy(),this.destroyFns=e}push(...e){this.destroyFns.push(...e)}},$i="11.3.2",Yi=Symbol("previous-memento-not-found"),qi=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=v.create(!0,"history"),this.destroyFns=new Ki,this.destroyFns.setFns([e.addListener("series-undo",this.undo.bind(this)),e.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const e of t){if(!this.originators.has(e.mementoOriginatorKey))throw new Error(`Originator [${e.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(e.mementoOriginatorKey,e.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const e=this.findPreviousMemento(t);if(e===Yi)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,e)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):Yi}restoreMemento(e,t){this.originators.get(e)?.restoreMemento($i,$i,t)}debugEvent(...e){this.debug(...e,this.history.map((e,t)=>t===this.historyIndex?`** ${e.label} **`:e.label))}},Xi=class e{constructor(e){this.version=e.split("-")[0]}save(...e){const t={version:this.version};for(const i of Object.values(e))t[i.mementoOriginatorKey]=this.encode(i,i.createMemento());return t}restore(e,...t){if("object"==typeof e)if(null!=e)if("version"in e&&"string"==typeof e.version)for(const i of t){const t=this.decode(i,e[i.mementoOriginatorKey]),r=[];if(!i.guardMemento(t,r)){const e=r.length>0?`\n\n${r.join("\n\n")}\n\n`:"";return void s.Vy.warnOnce(`Could not restore [${i.mementoOriginatorKey}] data, value was invalid, ignoring.${e}`,t)}i.restoreMemento(this.version,e.version,t)}else s.Vy.warnOnce("Could not restore data, missing [version] string in object, ignoring.");else s.Vy.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");else s.Vy.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`)}encode(t,i){try{return JSON.parse(JSON.stringify(i,e.encodeTypes))}catch(e){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${e}].`,{cause:e})}}decode(t,i){if(null==i)return i;try{return JSON.parse(JSON.stringify(i),e.decodeTypes)}catch(e){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${e}].`,{cause:e})}}static encodeTypes(e,t){return(0,s.$P)(this[e])?{__type:"date",value:this[e].toISOString()}:t}static decodeTypes(e,t){return(0,s.Gv)(this[e])&&"__type"in this[e]&&"date"===this[e].__type?new Date(this[e].value):t}},Zi=class{constructor(){this.caretaker=new Xi($i),this.state=new Map}setState(e,t){k(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const s=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:s},e)}},Qi=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(t=>t.symbol===e);if(s>=0){i.splice(s,1),0===i.length&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(e){s.Vy.errorOnce(e)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},Ji=class{constructor(){this.listeners=new Qi,this.destroyFns=[],this.destroyed=!1}addListener(e,t){return this.listeners.addListener(e,t)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e()),this.destroyed=!0}},es=class e{constructor(e,t,i){this.element=e,this.topTabGuard=t,this.bottomTabGuard=i,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,e=>this.onTab(e,!1)),this.initTabGuard(this.bottomTabGuard,e=>this.onTab(e,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",e=>this.onBlur(e),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,0===this.guardTabIndex?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const e of this.destroyFns)e();this.destroyFns.length=0}initTabGuard(e,t){const i=()=>t(e);e.addEventListener("focus",i),this.destroyFns.push(()=>e.removeEventListener("focus",i))}setGuardIndices(e){const t=e;(0,s.Bq)(this.topTabGuard,"tabindex",t),(0,s.Bq)(this.bottomTabGuard,"tabindex",t)}onFocus(){this.hasFocus=!0,0!==this.guardTabIndex&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:t,bottomTabGuard:i}=this;this.hasFocus=!1,0!==this.guardTabIndex&&e!==t&&e!==i&&this.setGuardIndices(this.guardTabIndex)}onTab(e,t){if(0!==this.guardTabIndex){let i;0===e.tabIndex?(i=this.findExitTarget(!t),this.setGuardIndices(this.guardTabIndex)):i=this.findEnterTarget(t),i?.focus()}}static queryFocusable(e,t){const i=(0,s.zk)();return Array.from(e.querySelectorAll(t)).filter(e=>{if(e instanceof HTMLElement){const t=i.getComputedStyle(e);return"none"!==t.display&&"none"!==t.visibility}return!1})}findEnterTarget(t){const i=e.queryFocusable(this.element,'[tabindex="0"]');return i[t?i.length-1:0]}findExitTarget(t){const i=e.queryFocusable((0,s.YE)(),"[tabindex]").filter(e=>e.tabIndex>0).sort((e,t)=>e.tabIndex-t.tabIndex),{before:r,after:n}=e.findBeforeAndAfter(i,this.guardTabIndex);return t?r:n}static findBeforeAndAfter(e,t){let i,s,r=0,n=e.length-1;for(;r<=n;){const o=Math.floor((r+n)/2),a=e[o].tabIndex;if(a===t){i=e[o-1]||void 0,s=e[o+1]||void 0;break}a<t?(i=e[o],r=o+1):(s=e[o],n=o-1)}return{before:i,after:s}}};function ts(e,t,i,s,r){t.addEventListener(i,s);const n=()=>t.removeEventListener(i,s,r);return e.push(n),n}function is(e,t,i,s=["Escape"]){ts(e,t,"keydown",e=>{ls(e,...s)&&i(e)})}function ss(e,t,i){const s=ts(e,window,"mousedown",e=>{[0,2].includes(e.button)&&!ns(t,e)&&(i(),s())});return s}function rs(e,t,i){const s=ts(e,window,"touchstart",e=>{Array.from(e.targetTouches).some(e=>!ns(t,e))&&(i(),s())});return s}function ns(e,t){return t.target instanceof Node&&e.contains(t.target)}function os(e,t,i,r){i.forEach(e=>(0,s.Bq)(e,"data-focus-visible-override",r)),ts(e,t,"keydown",()=>{i.forEach(e=>(0,s.Bq)(e,"data-focus-visible-override",!0))},{once:!0})}function as(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function ls(e,...t){return as(e)&&t.some(t=>e.key===t)}function cs(e,t,i,s){i&&ts(e,t,"keydown",e=>{ls(e,s)&&i.focus()})}function hs(e,t,i,s,r,n){cs(e,t,r,n),cs(e,t,i,s),ts(e,t,"keydown",e=>{ls(e,s,n)&&e.preventDefault()})}var ds={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function us(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:r,onFocus:n,onBlur:o}=e,{nextKey:a,prevKey:l}=ds[t],c=e=>{e.target&&"tabIndex"in e.target&&(i.forEach(e=>e.tabIndex=-1),e.target.tabIndex=0)},[h,d]=s?[i.length,i.length]:[0,1/0],u=[];for(let e=0;e<i.length;e++){const t=i[(h+e-1)%d],s=i[e],p=i[(h+e+1)%d];ts(u,s,"focus",c),n&&ts(u,s,"focus",n),o&&ts(u,s,"blur",o),r&&is(u,s,r),hs(u,s,p,a,t,l),s.tabIndex=0===e?0:-1}return u}var ps=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(ss(this.destroyFns,e,()=>this.close(!0))),this.destroyFns.push(rs(this.destroyFns,e,()=>this.close(!0)))}close(e){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,(0,s.Bq)(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function gs(e){const{sourceEvent:t,orientation:i,menu:r,buttons:n,closeCallback:o,overrideFocusVisible:a}=e,{nextKey:l,prevKey:c}=ds[i],h=ys(t);(0,s.Bq)(h,"aria-expanded",!0);const d=new ps(r,h,o),u=()=>d.close(),{destroyFns:p}=d;return r.role="menu",r.ariaOrientation=i,p.push(...us({orientation:i,buttons:n,onEscape:u,wrapAround:!0})),r.tabIndex=-1,is(p,r,u),ts(p,r,"keydown",e=>{e.target!==r||e.key!==l&&e.key!==c||(e.preventDefault(),n[0]?.focus())}),n[0]?.focus({preventScroll:!0}),void 0!==a&&os(p,r,n,a),d}function ms(e,t){return i=>{if("true"===e.ariaDisabled)return i.preventDefault();t(i)}}function fs(e){return"button"in e?0===e.button:as(e)&&("Space"===e.code||"Enter"===e.key)}function ys(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function vs(e){const t=e=>{e.defaultPrevented||(0,s.D$)(e.target,"data-preventdefault",!0)&&ls(e,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&e.preventDefault()};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var Cs=class{constructor(e){this.callback=e,this.devicePixelRatio=(0,s.zk)("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=(0,s.zk)("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=(0,s.zk)("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},bs=class{constructor(){let e;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,t])=>this.observe(e,t)),this.queuedObserveRequests=[],this.observeWindow()},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:t,contentRect:{width:i,height:s}}of e){const e=this.elements.get(t);this.checkSize(e,t,i,s)}})),this.pixelRatioObserver=new Cs(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady="complete"===(0,s.YE)("readyState"),this.documentReady?this.observeWindow():(0,s.zk)()?.addEventListener("load",this.onLoad)}destroy(){(0,s.zk)()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(null!=i.size&&i.size.pixelRatio!==e){const{width:s,height:r}=i.size;i.size={width:s,height:r,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const r=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:r},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady)return void this.queuedObserveRequests.push([e,t]);this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},Ss=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),void 0!==t&&super.set(e,t),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},ws=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],xs=new Set(["canvas-container","canvas","tooltip-container"]),Es=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]),Ms={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON:()=>Ms};function As(e,t){const i=(0,s.n)("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var Ts=class e extends Ji{constructor(e,t,i,r="normal"){super(),this.chart=e,this.styleContainer=i,this.mode=r,this.anchorName=`--${(0,s.sX)(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new bs,this.cursorState=new Ss("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let n=!1;if(this.observer=function(e,t){if("undefined"==typeof IntersectionObserver)return;const i=new IntersectionObserver(i=>{for(const s of i)s.target===e&&t(s.intersectionRatio)},{root:e});return i.observe(e),i}(this.element,e=>{0!==e||n||this.listeners.dispatch("hidden",{type:"hidden"}),n=0===e}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",'.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-icon-size: 16px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-chrome-text-color);background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-chrome-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-chrome-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);color:var(--ag-charts-chrome-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}\n'),this.setContainer(t),this.destroyFns.push(vs(this.element)),"normal"===this.mode){const e=this.rootElements["canvas-center"].element;if(null==e)throw new Error("Error initializing tab guards");const t=As(e,"beforebegin"),i=As(e,"afterend");this.tabGuards=new es(e,t,i)}}initDOM(){if("normal"===this.mode){const e=(0,s.n)("div");return e.innerHTML='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',e.firstChild}const e=(0,s.n)("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const t=(0,s.n)("div");return e.appendChild(t),t.role="presentation",t.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:t}=this,i={};for(const r of ws){const n=`ag-charts-${r}`;let o;if(o="normal"===e?t.classList.contains(n)?t:t.getElementsByClassName(n)[0]:xs.has(r)?t:t.getElementsByClassName(n)[0]??(0,s.n)("div"),null==o)throw new Error(`AG Charts - unable to find DOM element ${n}`);i[r]={element:o,children:new Map,listeners:[]}}return i}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(e=>{e.children.forEach(e=>e.remove()),e.element.remove()}),this.element.remove()}postRenderUpdate(){"minimal"!==this.mode&&null!=this.pendingContainer&&this.pendingContainer!==this.container&&(0===e.batchedUpdateContainer.length&&(0,s.zk)().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),e.batchedUpdateContainer.push(this))}applyBatchedUpdateContainer(){for(const t of e.batchedUpdateContainer)t.destroyed||t.updateContainer();e.batchedUpdateContainer.splice(0)}setSizeOptions(e=300,t=300,i,s){const{style:r}=this.element;r.width=`${i??e}px`,r.height=`${s??t}px`,this.minWidth=i??e,this.minHeight=s??t,this.updateContainerClassName()}updateContainerSize(){const{style:e}=this.rootElements["canvas-center"].element;e.visibility=null==this.containerSize?"hidden":"",this.containerSize?(e.width=`${this.containerSize.width??0}px`,e.height=`${this.containerSize.height??0}px`):(e.width="",e.height=""),this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,"minimal"!==this.mode&&null!=this.container||this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(null!=e&&e!==this.container){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),null!=this.documentRoot)for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);this.container=e,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected="minimal"===this.mode||e.isConnected;for(const[e,t]of this.styles)this.addStyles(e,t);e.appendChild(this.element),this.sizeMonitor.observe(e,e=>{this.containerSize=e,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}}setThemeClass(e){this.element.classList.forEach(t=>{t.startsWith("ag-charts-theme-")&&t!==e&&this.element.classList.remove(t)}),this.element.classList.add(e)}setThemeParameters(e){const t={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},i=["fontSize","chromeFontSize"];for(const[r,n]of(0,s.jO)(e)){let e=`${n}`;i.includes(r)&&(e=`${n}px`),this.element.style.setProperty(`--ag-charts-${t[r]}`,e)}}updateCanvasLabel(e){(0,s.Bq)(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,t){return["focus","blur","keydown","keyup"].includes(t)?this.rootElements["series-area"].element:e}addEventListener(e,t,i){this.getEventElement(this.element,e).addEventListener(e,t,i)}removeEventListener(e,t,i){this.getEventElement(this.element,e).removeEventListener(e,t,i)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const e=(0,s.zk)(),t=new f(0,0,e.innerWidth,e.innerHeight),i=this.getRawOverlayClientRect();return t.intersection(i)?.toDOMRect()??Ms}getRawOverlayClientRect(){let e=this.element;const t=this.element.getRootNode()?.fullscreenElement;for(;null!=e;){let i;if(null!=t&&e===t)i=!0;else{const t=e.computedStyleMap?.(),s=t?.get("overflow-y")?.toString();i="auto"===s||"scroll"===s}if(i)return f.fromDOMRect(e.getBoundingClientRect());e=e.parentElement}if(null!=this.documentRoot)return f.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:i,innerHeight:r}=(0,s.zk)();return new f(0,0,i,r)}getShadowDocumentRoot(e=this.container){const t=e?.ownerDocument?.body??(0,s.YE)("body");for(;null!=e;){if(e===t)return;if(e.parentNode instanceof DocumentFragment)return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:t}=this.rootElements[e],i=[];for(const e of t.values())i.push(f.fromDOMRect(e.getBoundingClientRect()));return f.merge(i)}isManagedChildDOMElement(e,t,i){const{children:s}=this.rootElements[t],r=s?.get(i);return null!=r&&e.contains(r)}contains(e,t){return null==t?this.element.contains(e):this.rootElements[t].element.contains(e)}addStyles(t,i){const r="data-ag-charts";if(this.styles.set(t,i),null==this.container)return;const n=e=>e.getAttribute(r)===t,o=e=>{const t=new Set(["TITLE","META"]);let i,o=!0;for(const s of e.children)if(o&&t.has(s.tagName))i=s;else{if(o=!1,n(s))return;s.hasAttribute(r)&&(i=s)}const a=(0,s.n)("style");return null!=this.chart.styleNonce&&(a.nonce=this.chart.styleNonce),null==i?e.prepend(a):e.insertBefore(a,i.nextSibling),a};let a;this.styleContainer?a=o(this.styleContainer):!1===this.initiallyConnected?a=this.addChild("styles",t):null!=this.documentRoot||e.headStyles.has(t)?null!=this.documentRoot&&(a=this.addChild("styles",t)):(a=o((0,s.YE)("head")),e.headStyles.add(t)),null==a||n(a)||(a.setAttribute(r,t),a.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,t){this.cursorState.set(e,t),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(e,t,i,r){const{element:n,children:o,listeners:a}=this.rootElements[e];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(t))return o.get(t);const{childElementType:l="div"}=Es.get(e)??{};if(i&&i.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=i??(0,s.n)(l);for(const[e,t,i]of a)c.addEventListener(e,t,i);if(o.set(t,c),"style"===l&&null!=this.chart.styleNonce&&(c.nonce=this.chart.styleNonce),r){const e=n.querySelector(r.query);if(null==e)throw new Error(`AG Charts - addChild query failed ${r.query}`);e.insertAdjacentElement(r.where,c)}else n?.appendChild(c);return c}removeChild(e,t){const{children:i}=this.rootElements[e];i&&(i.get(t)?.remove(),i.delete(t))}incrementDataCounter(e){const{dataset:t}=this.element;t[e]??(t[e]="0"),t[e]=String(Number(t[e])+1)}setDataBoolean(e,t){this.element.dataset[e]=String(t)}updateContainerClassName(){const{element:e,containerSize:t,minWidth:i,minHeight:s}=this;e.classList.toggle("ag-charts-wrapper--safe-horizontal",i>=(t?.width??1/0)),e.classList.toggle("ag-charts-wrapper--safe-vertical",s>=(t?.height??1/0))}};Ts.batchedUpdateContainer=[],Ts.headStyles=new Set;var Ds=Ts,Is=class extends Ai{constructor(){super((0,s.n)("div")),this.textElement=(0,s.FJ)("text"),this.textElement.role="presentation",this.svgElement=(0,s.FJ)("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const t=this.textElement,i=t.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},Rs=class extends Ai{constructor(e,t){super(e),(0,s.Bq)(this.elem,"role",t),this.setEnabled(!0)}destructor(){}setEnabled(e){(0,s.Bq)(this.elem,"aria-disabled",!e)}addListener(e,t){return super.addListener(e,(i,s)=>{("click"!==e&&"dblclick"!==e||!this.isDisabled())&&t(i,s)})}},Ps=class extends Rs{constructor(){super((0,s.n)("button"))}},ks=class extends Ai{constructor(){super((0,s.n)("div")),(0,s.Bq)(this.elem,"role","group")}destructor(){}},Ls=class extends Ai{constructor(e,t){super((0,s.n)("div")),this.focusedChildIndex=0,this.onChildFocus=(e,t)=>{const i=this.children[this.focusedChildIndex];this.focusedChildIndex=t.index,i?.setTabIndex(-1),t.setTabIndex(0)},this.onChildKeyDown=(e,t)=>{const i=this.orientation,[s,r]="both"===i?[ds.horizontal,ds.vertical]:[ds[i],void 0];let n=-1;if(as(e.sourceEvent)){const i=e.sourceEvent.key;i===s.nextKey||i===r?.nextKey?n=t.index+1:i!==s.prevKey&&i!==r?.prevKey||(n=t.index-1)}this.children[n]?.focus()},(0,s.Bq)(this.elem,"role",t),this.orientation=e}get orientation(){return(0,s.D$)(this.elem,"aria-orientation")??"both"}set orientation(e){(0,s.Bq)(this.elem,"aria-orientation","both"!==e?e:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(1===this.children.length?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,s=t===e.index;for(let e=0;e<i.length;e++){const s=i[e];s.index===t&&(this.focusedChildIndex=e),s.index=e}if(s){const e=i[t]??i[t-1];e?(this.focusedChildIndex=e.index,e.setTabIndex(0)):this.focusedChildIndex=0}}},Ns=class extends Ls{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=(0,s.n)("div");(0,s.Bq)(i,"role","listitem"),(0,s.EM)(i,"position","absolute"),Ai.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(0===this.children.length)}setHidden(e){0===this.children.length&&(e=!0),super.setHidden(e)}},_s=class extends Ai{constructor(e){super(e)}destructor(){}},Os=new Intl.NumberFormat("en-US",{style:"percent"});function Fs(e,t=2){return"number"==typeof e?Vs(e,t):"string"==typeof e?e:String(e??"")}function Gs(e){return Os.format(e)}var Bs=(new Map).set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Vs(e,t){let i=Bs.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),Bs.set(t,i)),i.format(e)}var Hs=class e extends Ai{constructor(){super((0,s.n)("input")),this._step=e.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(void 0!==this._keyboardStep&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),void 0!==e)){const t=()=>this.getElement().step=e.attributeValue,i=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:t,onKeyUp:i,onBlur:i},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return(0,s.D$)(this.elem,"aria-orientation")??"both"}set orientation(t){(0,s.Bq)(this.elem,"aria-orientation","both"!==t?t:void 0),e.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(e,t){const i=this.getValueRatio(),r=(0,s.qE)(e,i,t);return r!==i&&this.setValueRatio(r),r}setValueRatio(e,t){const{divider:i}=this.step,s=Math.round(1e4*e)/i,{ariaValueText:r=Gs(s/i)}=t??{},n=this.getElement();n.value=`${s}`,n.ariaValueText=r}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(t,i){"both"===i?t.removeListener("keydown",e.onKeyDown):t.addListener("keydown",e.onKeyDown)}static onKeyDown(e,t){let i=[];const{orientation:s}=t;"horizontal"===s?i=["ArrowUp","ArrowDown"]:"vertical"===s&&(i=["ArrowLeft","ArrowRight"]),i.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};Hs.STEP_ONE={attributeValue:"1",divider:1},Hs.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Us=Hs,zs=class extends Ps{constructor(){super(),(0,s.Bq)(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){(0,s.Bq)(this.elem,"aria-checked",e)}},Ws=class extends Ls{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function js(e,t){return t.params?.type===e}function Ks(e){const t={params:e,result:void 0};return t.result=function(e){if("button"===e)return new Ps;if("slider"===e)return new Us;if("toolbar"===e)return new Ws;if("group"===e)return new ks;if("list"===e)return new Ns;if("region"===e)return new _s((0,s.n)("div"));if("text"===e)return new Is;if("listswitch"===e)return new zs;throw Error("AG Charts - error allocating meta")}(t.params.type),t}var $s=class{constructor(e,t){this.localeManager=e,this.domManager=t,this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e())}addLocalisation(e){e(),this.destroyFns.push(this.localeManager.addListener("locale-changed",e))}createProxyContainer(e){const t=Ks(e),{params:i,result:s}=t,r=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,r),r.classList.add(...i.classList,"ag-charts-proxy-container"),r.role=i.type,"ariaOrientation"in i&&(r.ariaOrientation=i.ariaOrientation),js("toolbar",t)&&(t.result.orientation=t.params.orientation),this.addLocalisation(()=>{r.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(e){const t=Ks(e);if(js("button",t)){const{params:e,result:i}=t,s=i.getElement();if(this.initInteract(e,i),"string"==typeof e.textContent)s.textContent=e.textContent;else{const{textContent:t}=e;this.addLocalisation(()=>{s.textContent=this.localeManager.t(t.id,t.params)})}this.setParent(t.params,t.result)}if(js("slider",t)){const{params:e,result:i}=t,s=i.getElement();this.initInteract(e,i),s.type="range",s.role="presentation",s.style.margin="0px",this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(e.ariaLabel.id,e.ariaLabel.params)}),this.setParent(t.params,t.result)}if(js("text",t)){const{params:e,result:i}=t;this.initElement(e,i),this.setParent(t.params,t.result)}if(js("listswitch",t)){const{params:e,result:i}=t;this.initInteract(e,i),i.setTextContent(e.textContent),i.setChecked(e.ariaChecked),i.setAriaDescribedBy(e.ariaDescribedBy),this.setParent(t.params,t.result)}if(js("region",t)){const{params:e,result:i}=t,s=i.getElement();this.initInteract(e,i),s.role="region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return(0,s.EM)(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,r=this.initElement(e,t);void 0!==i&&(r.tabIndex=i),void 0!==s&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i)}}},Ys={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},qs=/\$\{(\w+)}(?:\[(\w+)])?/gi,Xs={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},Zs=class extends Qi{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.dispatch("locale-changed"))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.dispatch("locale-changed"))}t(e,t={}){const{localeText:i=Ys,getLocaleText:r}=this,n=i[e];return r?.({key:e,defaultValue:n,variables:t})??(({defaultValue:e,variables:t})=>e?.replaceAll(qs,(e,i,r)=>{const n=t[i],o=null!=r?Xs[r]:null;return null!=r&&null==o&&s.Vy.warnOnce(`Format style [${r}] is not supported`),null!=o?o.format(n):"number"==typeof n?Xs.number.format(n):n instanceof Date?Xs.datetime.format(n):String(n)}))({key:e,defaultValue:n,variables:t})??e}},Qs=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:r,willReadFrequently:n=!1}=e;this.pixelRatio=e.pixelRatio??(0,s.zk)("devicePixelRatio")??1,this.element=r??(0,s.n)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),b(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:r}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),r.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){C(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.resetTransform()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};a([ci(e=>e.onEnabledChange())],Qs.prototype,"enabled",2);var Js=class extends s.bk{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(null!=i&&t)return void i.nodes.add(t);if(!t)return;const s={image:void 0,nodes:new Set([t])},r=new Image;return this.imageLoadingCount++,r.onload=()=>{s.image=r,s.nodes.forEach(e=>e.markDirty()),s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},r.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},r.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},er=class{constructor(e){this.canvas=e,this.debug=v.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:s})=>s.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:r}=e,n=new w({width:t,height:i,pixelRatio:s});return this.layersMap.set(n,{id:this.nextLayerId++,name:r,canvas:n}),this.debug("Scene.addLayer() - layers",this.layersMap),n}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}};function tr(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function ir(e,t,i,r,n={},o=f.zero){if(!v.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:d=0,opsSkipped:u=0}=r??{},p=performance.now(),{start:g,...m}=t,y=Object.entries(m).map(([e,t])=>cr(e,t)).filter(e=>null!=e).join(" + "),C=Object.entries(n).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(" ; "),b=v.check("scene:stats:verbose"),S=function(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const r of[t,e,i])"number"==typeof r&&s.push(tr(r));return`Heap ${s.join(" / ")}`}(),w=[`${cr("⏱️",g,p)} (${y})`,`${C}`,`Layers: ${b?lr(a,l):e.size}`,b?`Nodes: ${lr(c,h)}`:null,b?`Ops: ${lr(d,u)}`:null,b&&S?S:null].filter(s.Kg),x=new Pi(e=>i.measureText(e)),E=new Map(w.map(e=>[e,x.measureLines(e)])),M=Math.max(...Array.from(E.values(),e=>e.width)),A=function(e,t){let i=0;for(const s of e)i+=t(s);return i}(E.values(),e=>e.height),T=2+o.x;i.save(),i.fillStyle="white",i.fillRect(T,0,M,A),i.fillStyle="black";let D=0;for(const[e,t]of E.entries())D+=t.height,i.fillText(e,T,D);i.restore()}var sr=new Set,rr=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function nr(e){const{...t}=e;for(const e of Object.keys(t))rr.has(e)||"number"!=typeof t[e]&&"string"!=typeof t[e]&&"boolean"!=typeof t[e]&&(sr.add(e),delete t[e]);return t}function or(e,t){if(!v.check(!0,"scene"))return{};let i=0;return{node:"json"===t?nr(e):e,name:e.name??e.id,dirty:e.dirty,...Array.from(e.children(),e=>or(e,t)).reduce((e,t)=>{let{name:s}=t;const{node:{visible:r,opacity:n,zIndex:o,translationX:a,translationY:l,rotation:c,scalingX:h,scalingY:d},node:u}=t;(!r||n<=0)&&(s=`(${s})`),At.is(u)&&u.renderToOffscreenCanvas&&(s=`*${s}*`);const p=Array.isArray(o)?`(${o.join(", ")})`:o,g=[`${(i++).toString().padStart(3,"0")}|`,`${s??"<unknown>"}`,`z: ${p}`,a&&`x: ${a}`,l&&`y: ${l}`,c&&`r: ${c}`,null!=h&&1!==h&&`sx: ${h}`,null!=d&&1!==d&&`sy: ${d}`].filter(e=>!!e).join(" ");let m=g,f=1;for(;null!=e[m]&&f<100;)m=`${g} (${f++})`;return e[m]=t,e},{})}}function ar(e){if(!e.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(e.children(),e=>ar(e)).filter(e=>e.paths.length>0),i=At.is(e)?e.name??e.id:e.id,s=t.length?t.flatMap(e=>e.paths).map(e=>`${i}.${e}`):[i];return{dirtyTree:{name:i,node:e,dirty:e.dirty,...t.map(e=>e.dirtyTree).filter(e=>null!=e.dirty).reduce((e,t)=>(e[t.name??"<unknown>"]=t,e),{})},paths:s}}function lr(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function cr(e,t,i){const s=null!=i?i-t:t;return`${e}: ${Math.round(100*s)/100}ms`}var hr=class extends s.bk{constructor(e){super(),this.debug=v.create(!0,"scene"),this.id=(0,s.sX)(this),this.imageLoader=new Js,this.root=null,this.pendingSize=null,this.isDirty=!1,this.destroyFns=[],this.updateDebugFlags(),this.canvas=new Qs(e),this.layersManager=new er(this.canvas),this.destroyFns.push(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{s.Vy.warnOnce(`Unable to load image ${e}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e||(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this))),this}updateDebugFlags(){v.inDevelopmentMode(()=>J._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){(0,s.Is)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)&&(this.pendingSize=[e,t,i],this.isDirty=!0,!0)}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:r}=e??{},{canvas:n,canvas:{context:o}={},root:a,pendingSize:l,width:c,height:h,pixelRatio:d}=this;if(!o)return;const u=performance.now();let p=!1;if(l&&(p=!0,this.layersManager.resize(...l),this.pendingSize=null),a&&!a.visible)return void(this.isDirty=!1);if(!1===a?.dirty&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{tree:or(a,"console")}),void ir(this.layersManager,t,o,void 0,i,r);const g={ctx:o,width:c,height:h,devicePixelRatio:d,debugNodes:{}};v.check("scene:stats:verbose")&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),function(e){const t=(0,s.$r)((0,s.zk)("agChartsSceneDebug")),i=[];for(const e of t)"layout"===e?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(e);e.debugNodeSearch=i}(g);let m=!1;if((!1!==a?.dirty||p)&&(m=!0,n.clear()),a&&v.check("scene:dirtyTree")){const{dirtyTree:e,paths:t}=ar(a);v.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:e,paths:t})}if(a&&m){if(a.visible&&a.preRender(g),this.debug.check()){const e=or(a,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:e})}if(a.visible)try{o.save(),a.render(g),o.restore()}catch(e){throw this.canvas.reset(),e}}t["✍️"]=performance.now()-u,o.verifyDepthZero?.(),this.isDirty=!1,ir(this.layersManager,t,o,g.stats,i,r),function(e,t){e.save();for(const[i,r]of Object.entries(t)){const t=wt.toCanvas(r);t?(e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(t.x,t.y,t.width,t.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,t.x,t.y,t.width),e.fillText(i,t.x,t.y,t.width)):s.Vy.log(`Scene.render() - no bbox for debugged node [${i}].`)}e.restore()}(o,g.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:or(a,"console"),canvasCleared:m})}toSVG(){const{root:e,width:t,height:i}=this;if(null!=e)return J.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.destroyFns.forEach(e=>e()),Object.assign(this,{canvas:void 0})}};function dr(e,t){return!(!function(e){return"context"in e}(e)||null==t[0]||"object"!=typeof t[0]||(t[0].context=e.context,0))}function ur(e,t,i,s){return dr(e,s)||t&&dr(t,s),i(...s)}hr.className="Scene";var pr=class{constructor(){this.cache=new WeakMap}call(e,t,i,...s){let r,n=this.cache.get(i);try{r=JSON.stringify(s)}catch{return this.invoke(e,t,i,s,n)}return null==n&&(n=new Map,this.cache.set(i,n)),n.has(r)?n.get(r):this.invoke(e,t,i,s,n,r)}invoke(e,t,i,r,n,o){try{const s=ur(e,t,i,r);return n&&null!=o&&n.set(o,s),s}catch(e){return void s.Vy.warnOnce("User callback errored, ignoring",e)}}invalidateCache(){this.cache=new WeakMap}},gr=class extends Ji{constructor(e,t){super(),this.annotationRoot=e,this.fireChartEvent=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return null==e||(0,s.cy)(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(e=>N(e,this.getAnnotationTypeStyles(e.type))),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Bt([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(this.annotationRoot?.removeChild(e),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},mr=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_GRID=1]="AXIS_GRID",e[e.AXIS=2]="AXIS",e[e.ZOOM_SELECTION=3]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=5]="SERIES_LAYER",e[e.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=10]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=12]="STATUS_BAR",e[e.SERIES_LABEL=13]="SERIES_LABEL",e[e.LEGEND=14]="LEGEND",e[e.NAVIGATOR=15]="NAVIGATOR",e[e.FOREGROUND=16]="FOREGROUND",e))(mr||{}),fr=class{constructor(e){this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new At({name:"Axes-Grids",zIndex:1}),this.axisGroup=new At({name:"Axes",zIndex:2}),this.axisLabelGroup=new At({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new At({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new At({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new At({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const e of t){const t=e.createAxisContext();this.axes.has(t.direction)?this.axes.get(t.direction)?.push(t):this.axes.set(t.direction,[t])}}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},yr=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=5]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=7]="SCENE_RENDER",e[e.NONE=8]="NONE",e))(yr||{}),vr=class extends Qi{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=v.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){"function"==typeof e&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return(0,s.nF)(e=>this.fetch(e).catch(e=>s.Vy.error("callback failed",e)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return(0,s.nF)((e,t)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:t})},e,{leading:!0,trailing:!0})}async fetch(e){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;let r;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{r=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(e){this.debug(`DataService - request failed | ${i}`),s.Vy.errorOnce(`DataService - request failed | [${e}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(e=>e===i);-1===n||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(n+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(r)?this.throttledDispatch(i,r):this.dispatch("data-error"))}};a([li({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],vr.prototype,"dispatchThrottle",2),a([li({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],vr.prototype,"requestThrottle",2);var Cr=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){e&&0!==e.size&&(this.loadFonts(e),e.forEach(e=>{this.observeFontStatus(e)}))}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(e=>encodeURIComponent(e)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,r=`@import url('https://fonts.googleapis.com/css2?family=${t.join(s)}${i}&display=swap');\n`;this.domManager.addStyles(`google-font-${t.join("-")}`,r)}observeFontStatus(e){const t=window.document.createElement("div");t.style.setProperty("position","absolute"),t.style.setProperty("top","0"),t.style.setProperty("margin","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("visibility","hidden"),t.style.setProperty("width","auto"),t.style.setProperty("max-width","none"),t.style.setProperty("font-synthesis","none"),t.style.setProperty("font-family",e),t.style.setProperty("font-size","16px"),t.style.setProperty("white-space","nowrap"),t.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,t);const i=new ResizeObserver(e=>{const t=e?.at(0)?.contentBoxSize.at(0)?.inlineSize;null!=t&&t>0&&(Di.clear(),this.updateService.update(4))});i.observe(t),this.observers.push(i)}};function br(e,t){if("string"==typeof e)try{e=fe.fromString(e)}catch{e=fe.fromArray([0,0,0])}if("string"==typeof t)try{t=fe.fromString(t)}catch{t=fe.fromArray([0,0,0])}return i=>fe.mix(e,t,i).toRgbaString()}var Sr={};o(Sr,{easeIn:()=>xr,easeInOut:()=>Mr,easeInOutQuad:()=>Dr,easeInQuad:()=>Ar,easeOut:()=>Er,easeOutQuad:()=>Tr,inverseEaseOut:()=>Ir,linear:()=>wr});var wr=e=>e,xr=e=>1-Math.cos(e*Math.PI/2),Er=e=>Math.sin(e*Math.PI/2),Mr=e=>-(Math.cos(e*Math.PI)-1)/2,Ar=e=>e*e,Tr=e=>1-(1-e)**2,Dr=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,Ir=e=>2*Math.asin(e)/Math.PI,Rr=["initial","remove","update","add","trailing","end","none"],Pr={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},kr=(e=>(e.Loop="loop",e.Reverse="reverse",e))(kr||{});function Lr(e){return e.every(e=>e instanceof J)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function Nr(e,t){return e===t||(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,i)=>Nr(e,t[i])):u(e)&&u(t)?e.equals(t):!(!(0,s.Qd)(e)||!(0,s.Qd)(t))&&L(e,t,Nr))}var _r=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??wr,this.phase=e.phase;const t=e.duration??Pr[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,!0===e.skip&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),!1!==e.collapsable&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return Nr(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(s-t)):0}get delta(){return this.ease((0,s.qE)(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if("object"!=typeof t||u(t))return this.interpolateValue(e,t);const i=[];for(const s of Object.keys(t)){const r=this.interpolateValue(e[s],t[s]);null!=r&&i.push([s,r])}return e=>{const t={};for(const[s,r]of i)t[s]=r(e);return t}}interpolateValue(e,t){if(null!=e&&null!=t){if(u(e))return i=>e[d](t,i);try{switch(typeof e){case"number":return function(e,t){return i=>Number(e)*(1-i)+Number(t)*i}(e,t);case"string":return br(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Or=class{constructor(e){this.maxAnimationTime=e,this.debug=v.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Rr.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(Rr[this.currentPhase])??[]}checkOverlappingId(e){null!=e&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(!e.isComplete)return Rr.indexOf(e.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",e.id),void e.stop()):(this.controllers.set(e.id,e),void this.phases.get(e.phase)?.push(e))}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);null!=i&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=0===e?.01:e;const i=()=>{const e=Rr[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:e,phaseMeta:Pr[e]}};let{phase:s,phaseControllers:r,phaseMeta:n}=i();const o=()=>null==Rr[this.currentPhase],a=()=>{for(({phase:s,phaseControllers:r,phaseMeta:n}=i());!o()&&0===r.length;)this.currentPhase++,({phase:s,phaseControllers:r,phaseMeta:n}=i()),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},r)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${r?.length} of ${l}`);do{const e=t,i=n.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let s=0;for(const n of r)i?n.stop():t=Math.min(n.update(e),t),n.isComplete&&(s++,this.removeAnimation(n));this.animationTimeConsumed+=e-t,this.debug(`AnimationBatch - updated ${r.length} controllers; ${s} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&!0!==Pr[t.phase].skipIfNoEarlierAnimations){e=!1;break}if(!e)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(e=!0){if(!1===this.skipAnimations&&!0===e){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(e){s.Vy.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(e){if(null!=e&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,s]of this.phases)0!==s.length&&(null!=e&&e!==i||(t+=Math.max(...s.map(e=>e.isComplete?0:e.delay+e.duration-(e.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}},Fr=(e=>(e[e.Default=32]="Default",e[e.ZoomDrag=16]="ZoomDrag",e[e.Annotations=8]="Annotations",e[e.ContextMenu=4]="ContextMenu",e[e.Animation=2]="Animation",e[e.AnnotationsSelected=1]="AnnotationsSelected",e[e.Clickable=41]="Clickable",e[e.Focusable=34]="Focusable",e[e.Keyable=43]="Keyable",e[e.ContextMenuable=36]="ContextMenuable",e[e.AnnotationsMoveable=9]="AnnotationsMoveable",e[e.AnnotationsDraggable=57]="AnnotationsDraggable",e[e.ZoomDraggable=50]="ZoomDraggable",e[e.ZoomClickable=34]="ZoomClickable",e[e.ZoomWheelable=59]="ZoomWheelable",e[e.All=63]="All",e))(Fr||{}),Gr=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function Br(e){return null==e||!isNaN(e)&&e>=0&&e<=2}var Vr=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new Or(1.5*this.defaultDuration),this.debug=v.create(!0,"animation"),this.events=new s.bk,this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(e){return void this.failsafeOnError(e)}let{id:i}=e;null==i&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||"none"===e.phase;s&&this.debug("AnimationManager - skipping animation");const{delay:r,duration:n}=e;if(!Br(r))throw new Error(`Animation delay of ${r} is unsupported (${i})`);if(!Br(n))throw new Error(`Animation duration of ${n} is unsupported (${i})`);const o=new _r({...e,id:i,skip:s,autoplay:!!this.isPlaying&&e.autoplay,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:(new Error).stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=(0,s.zk)().requestAnimationFrame(t=>{e(t).catch(e=>s.Vy.error(e))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let e;const t=async i=>{const s=()=>{const t=i-(e??i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:t}),this.interactionManager.pushState(2);try{this.batch.progress(t)}catch(e){this.failsafeOnError(e)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:t})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){s.Vy.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new Or(1.5*this.defaultDuration),!0===e&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},Hr=class extends Ji{seriesEvent(e){this.listeners.dispatch(e,{type:e})}seriesKeyNavZoom(e,t){const i={type:"series-keynav-zoom",delta:e,widgetEvent:t};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(e,t,i,s,r){const n={type:"legend-item-click",legendType:e,series:t,itemId:i,enabled:s,legendItemName:r};this.listeners.dispatch("legend-item-click",n)}legendItemDoubleClick(e,t,i,s,r,n){const o={type:"legend-item-double-click",legendType:e,series:t,itemId:i,enabled:s,legendItemName:n,numVisibleItems:r};this.listeners.dispatch("legend-item-double-click",o)}},Ur=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},zr=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series"]}},Wr=class{constructor(){this.items=new Ur,this.lists=new zr}},jr=class extends Ji{constructor(){super(),this.builtins=new Wr,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1)}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,s){const{widgetEvent:r}=t;if(r.sourceEvent.defaultPrevented)return;const n={type:"context-setup",showOn:e,x:s?.x??t.canvasX,y:s?.y??t.canvasY,context:i,widgetEvent:r};this.listeners.dispatch("context-setup",n),n.type="context-complete",this.listeners.dispatch("context-complete",n)}isVisible(e){return!this.hiddenActions.has(e)}setVisible(e,t){t?this.hiddenActions.delete(e):this.hiddenActions.add(e)}},Kr=class extends Ji{constructor(){super(...arguments),this.highlightStates=new Ss}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:e})}getActiveHighlight(){return this.activeHighlight}isEqual(e,t){return e===t||null!=e&&null!=t&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}};function $r(e,t){if(null==e||0===t.length)return[!1,!1];const i=e.valueOf(),s=t[0],r=t[t.length-1];if("string"==typeof s)return[i===s,i===r];let n=s.valueOf(),o=r.valueOf();return n>o&&([n,o]=[o,n]),[i===n,i===o]}function Yr(e,t,i,s,r){const{xValue:n,yValue:o}=e,[a,l]=$r(o,r),[c,h]=$r(n,s);return{xKey:t,yKey:i,xValue:n,yValue:o,first:c,last:h,min:a,max:l}}function qr(e,[t,i],r){const n=(0,s.S3)(0,e-1,e=>{const i=r(e)?.[1]??NaN;return!Number.isFinite(i)||i>t})??0;let o=(0,s.I5)(0,e-1,e=>{const t=r(e)?.[0]??NaN;return!Number.isFinite(t)||t<i})??e-1;return o=Math.min(o+1,e),[n,o]}function Xr(e,t,i){if(i){const{x:e,y:t,width:s,height:r}=i;return{canvasX:e+s/2,canvasY:t+r/2}}const s=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(s){const{x:t,y:i}=wt.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(t),canvasY:Math.round(i)}}}function Zr(e,t,i,s,r){let n=-1,o=0,a=0,l=!1;for(;o<s&&n<=t-e;){n+=1;const s=i+a;l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),s<e||s>t?l=!0:r(s)&&(o+=1)}return o}var Qr=class{constructor(e,t,i){this.domManager=t,this.tooltip=i,this.stateTracker=new Ss,this.suppressState=new Ss(!1),this.appliedState=null,this.destroyFns=[],this.destroyFns.push(i.setup(e,t),t.addListener("hidden",()=>this.tooltip.hide()))}destroy(){this.destroyFns.forEach(e=>e())}updateTooltip(e,t,i,s){i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:s}),this.applyStates()}removeTooltip(e){this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||null==t?.meta||null==t?.content)return this.appliedState=null,void this.tooltip.hide();const i=this.domManager.getBoundingClientRect(),s="extended"===this.tooltip.bounds?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===t?.content){const e=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,e)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,s){const{canvasX:r,canvasY:n}=e,o=t.properties.tooltip,{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:d,yOffset:u}=o.position,p=Xr(t,i,s);return{canvasX:r,canvasY:n,nodeCanvasX:p?.canvasX??r,nodeCanvasY:p?.canvasY??n,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:d,yOffset:u}}}isEnteringInteractiveTooltip(e){const{tooltip:t}=this,i=e.relatedTarget;return t.interactive&&t.enabled&&t.isVisible()&&t.contains(i)}};function Jr(e,t,i){const{offsetX:s,offsetY:r,clientX:n,clientY:o,currentX:a,currentY:l,sourceEvent:c}=i;return{type:t,device:e,offsetX:s,offsetY:r,clientX:n,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function en(e,t){return e*e+t*t>=9}var tn=class{constructor(e){this.destroyFns=[],this.listeners=new Qi,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(e=>e()),this.listeners.destroy()}addListener(e,t){return this.listeners.addListener(e,t)}dispatch(e){this.listeners.dispatch(e.type,e)}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.dispatch(e)}onDblClick(e){this.dispatch({device:"mouse",...e})}onDragStart(e){this.dragStartEvent=e}onDragMove(e){null!=this.dragStartEvent&&en(e.originDeltaX,e.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(e)}onDragEnd(e){if(this.isDragging)return this.dispatch(e),void(this.isDragging=!1);if("mouse"===e.device){const t=Jr("mouse","click",e);this.dispatch(t)}else if("touchend"===e.sourceEvent.type){if(en(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=Jr("touch","click",e);this.dispatch(t);const i=Date.now();if(void 0!==this.lastClick&&i-this.lastClick.time<=505&&function(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s<900}(this.lastClick,e)){const t=Jr(e.device,"dblclick",e);this.dispatch(t),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},sn=class extends _s{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},rn=class{constructor(e){this.seriesWidget=new sn(e.getParent("series-area")),this.chartWidget=new sn(e.getParent("canvas-proxy")),this.containerWidget=new sn(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new tn(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function nn(e,t){const[i,r]=on(t);return(0,s.qE)(i,e,r)}function on(e){if(0===e.length)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function an(e){const[t,i]=on(e);return i-t}var ln=class e extends ye{constructor(e=[],t=[]){super(),this.domain=e,this.range=t,this.defaultClamp=!1}static is(t){return t instanceof e}normalizeDomains(...e){return hn(...e)}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1,t=1){const{domain:i}=this,s=this.getPixelRange();if(0===i.length)return s;let r=Math.abs(i[1].valueOf()-i[0].valueOf())/e+1;if(0!==t){const e=Math.floor(s);r=Math.min(r,e)}return s/Math.max(1,r)}convert(e,t){const{domain:i}=this;if(!i||i.length<2)return NaN;const s=t?.clamp??this.defaultClamp,r=Number(this.transform(i[0])),n=Number(this.transform(i[1])),o=Number(this.transform(e)),{range:a}=this,[l,c]=a;if(s){const[e,t]=on([r,n]);if(o<e)return l;if(o>t)return c}return r===n?(l+c)/2:o===r?l:o===n?c:l+(o-r)/(n-r)*(c-l)}invert(e,t){const i=this.domain.map(e=>this.transform(e)),[s,r]=i,{range:n}=this,[o,a]=n;let l;return l=o===a?this.toDomain((Number(s)+Number(r))/2):this.toDomain(Number(s)+(e-o)/(a-o)*(Number(r)-Number(s))),this.transformInvert(l)}getPixelRange(){const[e,t]=this.range;return Math.abs(t-e)}};ln.defaultTickCount=5;var cn=ln;function hn(...e){let t,i,s=1/0,r=-1/0;for(const n of e)for(const e of n){const n=e.valueOf();n<s&&(s=n,t=e),n>r&&(r=n,i=e)}return null!=t&&null!=i?{domain:[t,i],animatable:!0}:{domain:[],animatable:!1}}var dn={};o(dn,{TimeInterval:()=>Cn,day:()=>wn,friday:()=>On,hour:()=>In,millisecond:()=>xn,minute:()=>Tn,monday:()=>kn,month:()=>Sn,saturday:()=>Fn,second:()=>Mn,sunday:()=>Pn,thursday:()=>_n,tuesday:()=>Ln,utcDay:()=>Vn,utcHour:()=>Un,utcMinute:()=>Hn,utcMonth:()=>Bn,utcYear:()=>Gn,wednesday:()=>Nn,year:()=>bn});var un=1e3,pn=6e4,gn=36e5,mn=864e5,fn=6048e5,yn=2592e6,vn=31536e6,Cn=class e{constructor(e,t,i,s,r,n=1,o){this.unit=e,this.milliseconds=t,this.hierarchy=i,this._encode=s,this._decode=r,this.step=n,this._rangeCallback=o}static extent(e,t,i){if(e.getTime()>t.getTime()&&([e,t]=[t,e],null!=i&&(i=[1-i[1],1-i[0]])),null!=i){const s=t.getTime()-e.getTime(),r=e.getTime();e=new Date(r+i[0]*s),t=new Date(r+i[1]*s)}return[e,t]}getOffset(e,t){return Math.floor(this._encode(new Date(e)))%t}floor(e){const t=new Date(e),i=this._encode(t);return this._decode(i)}ceil(e){const t=new Date(Number(e)-1),i=this._encode(t);return this._decode(i+1)}rangeIndices(t,i,{extend:s=!1,visibleRange:r=[0,1],limit:n}){[t,i]=e.extent(t,i,r);const o=this._encode(s?this.floor(t):this.ceil(t));let a=this._encode(s?this.ceil(i):this.floor(i));return null!=n&&a-o>n&&(a=o+n),[o,a]}range(e,t,i={}){let s;s=e.getTime()>t.getTime()?this._rangeCallback?.(t,e):this._rangeCallback?.(e,t);const[r,n]=this.rangeIndices(e,t,i),o=[];for(let e=r;e<=n;e++){const t=this._decode(e);o.push(t)}return s?.(),o}previous(e){return this._decode(this._encode(this.ceil(e))-1)}next(e){return this._decode(this._encode(this.floor(e))+1)}rangeCount(e,t,i={}){const[s,r]=this.rangeIndices(e,t,i);return r-s}every(t,i){if(1===t&&null!=i?.snapTo)return this;const{unit:r,milliseconds:n,hierarchy:o,step:a}=this;let l,c=0;const h=t;h!==(t=Math.max(1,Math.round(t)))&&s.Vy.warnOnce(`interval step of [${h}] rounded to [${t}].`);const{snapTo:d="start"}=i??{};if("string"==typeof d){const e=c;l=(i,s)=>{const r="start"===d?i:s;return c=this.getOffset(r,t),()=>c=e}}else"number"==typeof d?c=this.getOffset(new Date(d),t):d instanceof Date&&(c=this.getOffset(d,t));return new e(r,n*t,o,e=>Math.floor((this._encode(e)-c)/t),e=>this._decode(e*t+c),a*t,l)}},bn=new Cn("year",525949.2*60*1e3,void 0,function(e){return e.getFullYear()},function(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}),Sn=new Cn("month",bn.milliseconds/12,bn,function(e){return 12*e.getFullYear()+e.getMonth()},function(e){const t=Math.floor(e/12);return new Date(t,e-12*t,1)}),wn=new Cn("day",864e5,Sn,function(e){const t=e.getTimezoneOffset()*pn;return Math.floor((e.getTime()-t)/mn)},function(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}),xn=new Cn("millisecond",1,wn,function(e){return e.getTime()},function(e){return new Date(e)}),En=(new Date).getTimezoneOffset()*pn,Mn=new Cn("second",1e3,wn,function(e){return Math.floor((e.getTime()-En)/un)},function(e){return new Date(En+e*un)}),An=(new Date).getTimezoneOffset()*pn,Tn=new Cn("minute",6e4,wn,function(e){return Math.floor((e.getTime()-An)/pn)},function(e){return new Date(An+e*pn)}),Dn=(new Date).getTimezoneOffset()*pn,In=new Cn("hour",36e5,wn,function(e){return Math.floor((e.getTime()-Dn)/gn)},function(e){return new Date(Dn+e*gn)});function Rn(e){const t=(7+e-4)%7;return new Cn("day",6048e5,Sn,function(e){const i=e.getTimezoneOffset()*pn;return Math.floor((e.getTime()-i)/fn-t/7)},function(e){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*e+t),i},7)}var Pn=Rn(0),kn=Rn(1),Ln=Rn(2),Nn=Rn(3),_n=Rn(4),On=Rn(5),Fn=Rn(6),Gn=new Cn("year",bn.milliseconds,void 0,function(e){return e.getUTCFullYear()},function(e){const t=new Date;return t.setUTCFullYear(e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t}),Bn=new Cn("month",Sn.milliseconds,Gn,function(e){return 12*e.getUTCFullYear()+e.getUTCMonth()},function(e){const t=Math.floor(e/12),i=e-12*t;return new Date(Date.UTC(t,i,1))}),Vn=new Cn("day",864e5,Bn,function(e){return Math.floor(e.getTime()/mn)},function(e){const t=new Date(0);return t.setUTCDate(t.getUTCDate()+e),t.setUTCHours(0,0,0,0),t}),Hn=new Cn("minute",6e4,Vn,function(e){return Math.floor(e.getTime()/pn)},function(e){return new Date(e*pn)}),Un=new Cn("hour",36e5,Vn,function(e){return Math.floor(e.getTime()/gn)},function(e){return new Date(e*gn)}),zn={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function Wn(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+6e4*i;return Math.floor(s/864e5)}function jn(e,t){const i=(t-new Date(e.getFullYear(),0,1).getDay()+7)%7,s=new Date(e.getFullYear(),0,i+1);return s<=e?Math.floor(Wn(e,s)/7)+1:0}function Kn(e,t=e.getFullYear()){const i=new Date(t,0,1).getDay(),s=new Date(t,0,(4-i+7)%7-3+1);return s<=e?Math.floor(Wn(e,s)/7)+1:Kn(e,t-1)}var $n={a:e=>zn.shortDays[e.getDay()],A:e=>zn.days[e.getDay()],b:e=>zn.shortMonths[e.getMonth()],B:e=>zn.months[e.getMonth()],c:"%x, %X",d:(e,t)=>qn(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>qn(1e3*e.getMilliseconds(),6,t??"0"),H:(e,t)=>qn(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return 0===i?"12":qn(i,2,t??"0")},j:(e,t)=>qn(Wn(e)+1,3,t??"0"),m:(e,t)=>qn(e.getMonth()+1,2,t??"0"),M:(e,t)=>qn(e.getMinutes(),2,t??"0"),L:(e,t)=>qn(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>qn(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>qn(jn(e,0),2,t??"0"),V:(e,t)=>qn(Kn(e),2,t??"0"),w:(e,t)=>qn(e.getDay(),2,t??"0"),W:(e,t)=>qn(jn(e,1),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>qn(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>qn(e.getFullYear(),4,t??"0"),Z:e=>function(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${qn(Math.floor(i/60),2,"0")}${qn(Math.floor(i%60),2,"0")}`}(e),"%":()=>"%"},Yn={_:" ",0:"0","-":""};function qn(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function Xn(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(0!==i){const s=i>0?e.substring(0,i):e;t.push(s)}if(i<0)break;const s=e[i+1],r=Yn[s];null!=r&&i++;const n=e[i+1],o=$n[n];if("function"==typeof o)t.push([o,r]);else if("string"==typeof o){const e=Xn(o);t.push([e,r])}else t.push(`${r??""}${n}`);e=e.substring(i+2)}return e=>{const i="number"==typeof e?new Date(e):e;return t.map(e=>"string"==typeof e?e:e[0](i,e[1])).join("")}}function Zn(e){return e instanceof Date?e.getTime():e}function Qn(e,t,i){const s=Xn(Jn(e,t,i));return e=>s(e)}function Jn(e,t,i=0){let s=1/0;for(let t=1;t<e.length;t++)s=Math.min(s,Math.abs(e[t].valueOf()-e[t-1].valueOf()));const[r,n]=0===t.length?[0,0]:on([t[0].valueOf(),t[t.length-1].valueOf()]),o=new Date(r).getFullYear(),a=new Date(n).getFullYear()-o>0,l=isFinite(s)?function(e,t){return e<un?0:e<pn?1:e<gn?2:e<mn?3:e<fn?4:e<24192e5||e<26784e5&&function(e){let t=new Date(e[0]).getMonth();for(let i=1;i<e.length;i++){const s=new Date(e[i]).getMonth();if(t===s)return!0;t=s}return!1}(t)?5:e<vn?6:7}(s,e):(c=e[0],Mn.floor(c)<c?0:Tn.floor(c)<c?1:In.floor(c)<c?2:wn.floor(c)<c?3:Sn.floor(c)<c?Pn.floor(c)<c?4:5:bn.floor(c)<c?6:7);var c;return function(e,t,i){const s=Zn(i[0]),r=Zn(i.at(-1)),n=Math.abs(r-s),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",pn,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",pn,216e5,3,"%p"]," ",["day",mn,fn,4,"%a"],["month",0===n?0:fn,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",t||7===e?0:vn,1/0,7,"%Y"]].filter(t=>{if("string"==typeof t)return!0;const[i,s,r,o]=t;return o>=e&&s<=n&&n<r}).reduce((e,t)=>("string"==typeof t?e.result.push(t):e.used.has(t[0])||(e.result.push(t),e.used.add(t[0])),e),{result:[],used:new Set}).result,a=o.findIndex(e=>"string"!=typeof e),l=o.findLastIndex(e=>"string"!=typeof e);return o.slice(a,l+1).map(e=>"string"==typeof e?e:e[4]).join("").replaceAll(/\s+/g," ").trim()}(Math.max(l-i,0),a,e)}var eo=class e extends ye{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof e}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=(0,s.qE)(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=(0,s.qE)(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=(0,s.qE)(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&s.Vy.warnOnce("Expected update to not invalidate scale"))}convert(e,t){this.refresh();const i=this.findIndex(e);return null==i||i<0||i>=this.bands.length?NaN:this.ordinalRange(i)}invertNearestIndex(e){this.refresh();const t=this.bands.length;if(0===t)return-1;let i=0,s=t-1,r=1/0,n=0;for(;i<=s;){const t=(s+i)/2|0,o=this.ordinalRange(t),a=Math.abs(o-e);if(0===a)return t;a<r&&(r=a,n=t),o<e?i=t+1:s=t-1}return n}update(){const[e,t]=this.range;let{_paddingInner:i}=this;const{_paddingOuter:s,round:r,bands:n}=this,o=n.length;if(0===o)return;const a=t-e;let l;1===o?(i=0,l=a*(1-2*s)):l=a/Math.max(1,o-i+2*s);const c=r?Math.floor(l):l;let h=e+(a-c*(o-i))/2,d=c*(1-i);r&&(h=Math.round(h),d=Math.round(d)),this._step=c,this._inset=h,this._bandwidth=d,this._rawBandwidth=l*(1-i)}ordinalRange(e){const{_inset:t,_step:i,range:r}=this,n=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return(0,s.qE)(n,t+i*e,o)}};a([ve],eo.prototype,"range",2),a([ve],eo.prototype,"round",2);var to=eo,io=class e extends to{static is(t){return t instanceof e}toDomain(e){return new Date(e)}convert(e,t){const{domain:i,bands:r}=this;if(i.length<=0)return NaN;const n=this.ordinalRange(0),o=this.ordinalRange(r.length-1),a=t?.interpolate??!1,l=i[0].valueOf()>i[i.length-1].valueOf();if(!a){const i=super.convert(e,t);return l?o-(i-n):i}if(0===r.length)return n;const c=e.valueOf();let h;h=l?((0,s.S3)(0,i.length-1,e=>i[e].valueOf()<=c)??i.length)-1:(0,s.I5)(0,i.length-1,e=>i[e].valueOf()<=c)??0,h=Math.min(Math.max(h,0),i.length-2);const d=i[h].valueOf(),u=i[h+1].valueOf();return(h+(c-d)/(u-d))/(i.length-1)*(o-n)+n}invert(e,t=!1){this.refresh();const{domain:i,bands:r}=this,n=i[0].valueOf()>i[i.length-1].valueOf();let o;return o=t?this.invertNearestIndex(e-this.bandwidth/2):(0,s.S3)(0,r.length-1,t=>this.ordinalRange(t)>=e)??0,r[n?r.length-1-o:o]}tickFormatter({domain:e,ticks:t,specifier:i},s){return null!=i?Xn(i):Qn(t,e,s)}},so={bottomCenter:function(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}},center:function(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}},clone:function(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}},collides:function(e,t){const i=ro(e),s=ro(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1},end:function(e){return{x:e.x2,y:e.y2}},from:function(e,t,i,s){if("number"==typeof e)return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return ro({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)},height:function(e){return Math.abs(e.y2-e.y1)},round:function(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}},start:function(e){return{x:e.x1,y:e.y1}},topCenter:function(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}},origin:function(){return{x1:0,y1:0,x2:0,y2:0}},width:function(e){return Math.abs(e.x2-e.x1)}};function ro(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function no(e,t,i,s,r){return t+(r-e)/(i-e)*(s-t)}function oo(e,t,i,s,r){return e+(i-e)/(s-t)*(r-t)}function ao(e,t,i){return[oo(e,i.min,t,i.max,0),oo(e,i.min,t,i.max,1)]}function lo(e,t,i,r,n,o){if(i<=n&&o<=r)return i;const a=n-i,l=o-r,c=Math.abs(a)<Math.abs(l)?a:l;return(0,s.qE)(e,i+c,t)}var co=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],ho=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},uo=e=>(0,s.W$)((t,{options:i})=>!cn.is(e?.scale)&&!io.is(e?.scale)||null==t||null==i.end||t<=i.end,"to be less than end"),po=class extends Ji{constructor(e,t){super(),this.fireChartEvent=e,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Ss(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new ho,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(t.addListener("layout:complete",()=>{const{pendingMemento:e}=this,t=!this.didLayoutAxes;this.didLayoutAxes=!0,e?this.restoreMemento(e.version,e.mementoVersion,e.memento):t&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(null==e)return!0;if(!(0,s.Gv)(e))return!1;for(const t of Object.keys(e))if(!co.includes(t))return!1;const i=this.getPrimaryAxis("x"),r=this.getPrimaryAxis("y"),n={rangeX:{start:(0,s.Uo)((0,s.or)(s.ai,s.p6),uo(i)),end:(0,s.or)(s.ai,s.p6)},rangeY:{start:(0,s.Uo)((0,s.or)(s.ai,s.p6),uo(r)),end:(0,s.or)(s.ai,s.p6)},ratioX:{start:(0,s.Uo)(s.CG,(0,s.Xe)("end")),end:s.CG},ratioY:{start:(0,s.Uo)(s.CG,(0,s.Xe)("end")),end:s.CG},autoScaledAxes:(0,s.jk)((0,s.KC)("y"))},{invalid:o}=(0,s.tf)(e,n);return!(o.length>0&&(t.push(...o.map(String)),1))}restoreMemento(e,t,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes)return void(this.pendingMemento={version:e,mementoVersion:t,memento:i});this.pendingMemento=void 0;const r=this.getDefinedZoom();if(r.x=i?.rangeX?this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?{min:i.ratioX.start??0,max:i.ratioX.end??1}:{min:0,max:1},!this.navigatorModule||this.zoomModule){let e=i?.autoScaledAxes?.includes("y");i?.rangeY?(r.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},e??(e=!1)):i?.ratioY?(r.y={min:i.ratioY.start??0,max:i.ratioY.end??1},e??(e=!1)):(r.y={min:0,max:1},e??(e=!0)),r.autoScaleYAxis=e}if(this.lastRestoredState=r,!0!==s)return void this.updateZoom("zoom-manager",r);const n=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const e of[n,o])e&&this.updateAxisZoom("zoom-manager",e.id,r[e.direction])}updateAxes(e){this.axes=e;const t=new Map(e.map(e=>[e.id,this.axisZoomManagers.get(e.id)]));this.axisZoomManagers.clear();for(const i of e)this.axisZoomManagers.set(i.id,t.get(i.id)??new go(i));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(e=!0){this.independentAxes=e}setAutoScaleYAxis(e,t){this.autoScaleYAxis.enabled=e,this.autoScaleYAxis.padding=t}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(e,t){if(t?.x&&(t.x.min<0||t.x.max>1)&&(s.Vy.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${t.x.min}, max: ${t.x.max} }], expecting a ratio of 0 to 1, ignoring.`),t.x=void 0),t?.y&&(t.y.min<0||t.y.max>1)&&(s.Vy.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${t.y.min}, max: ${t.y.max} }], expecting a ratio of 0 to 1, ignoring.`),t.y=void 0),0===this.axisZoomManagers.size){const i=this.state.stateId();return void("initial"!==i&&i!==e||this.state.set(e,t))}this.state.set(e,t);const i=t?.autoScaleYAxis;null!=i&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(i=>{i.updateZoom(e,t?.[i.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){this.axisZoomManagers.get(t)?.updateZoom(e,i),this.applyChanges(e)}resetZoom(e){this.autoScaleYAxis.manuallyAdjusted=!1;const t=this.getRestoredZoom();this.updateZoom(e,{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1},autoScaleYAxis:t?.autoScaleYAxis??!0})}resetAxisZoom(e,t){const i=this.axisZoomManagers.get(t),s=i?.getDirection();if(null==s)return;const r=this.getRestoredZoom();if("y"===s){const e=r?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!e}for(const t of this.axes)t.direction===s&&this.updateAxisZoom(e,t.id,r?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(e,t){const i=this.axisZoomManagers.get(t)?.getDirection();"y"===i&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(e,t,i){const s=this.getPrimaryAxis(t);s&&this.updateAxisZoom(e,s.id,i)}panToBBox(e,t,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const r=this.getZoom();if(void 0===r||!r.x&&!r.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(i.width)<=Math.abs(t.width)&&Math.abs(i.height)<=Math.abs(t.height)))return s.Vy.warnOnce("cannot pan to target BBox - chart too small?"),!1;const n=function(e,t,i){const{x:r={min:0,max:1},y:n={min:0,max:1}}=t,o=so.from(i),a=so.from(e),l=function(e,t,i){const[s,r]=ao(e.x1,e.x2,t),[n,o]=ao(e.y1,e.y2,i);return{x1:s,x2:r,y1:n,y2:o}}(a,r,n),c=lo(l.x1,l.x2,a.x1,a.x2,o.x1,o.x2),h=lo(l.y1,l.y2,a.y1,a.y2,o.y1,o.y2),d={x:{min:no(a.x1,r.min,a.x2,r.max,c),max:no(a.x1,r.min,a.x2,r.max,c+e.width)},y:{min:no(a.y1,n.min,a.y2,n.max,h),max:no(a.y1,n.min,a.y2,n.max,h+e.height)}},u=d.x.max-d.x.min,p=d.y.max-d.y.min;return d.x.min=(0,s.qE)(0,d.x.min,1-u),d.x.max=d.x.min+u,d.y.min=(0,s.qE)(0,d.y.min,1-p),d.y.max=d.y.min+p,d}(t,r,i);return this.independentAxes?(this.updatePrimaryAxisZoom(e,"x",n.x),this.updatePrimaryAxisZoom(e,"y",n.y)):this.updateZoom(e,n),!0}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,e=>Number(e)-i)}extendWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const r=this.getDomainExtents(s);if(!r)return;const[,n]=r,o=i(n),a=this.rangeToRatio({start:o,end:n},t);a&&this.updateZoom(e,{[t]:a})}updateWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const r=this.getDomainExtents(s);if(!r)return;let[n,o]=r;[n,o]=i(n,o);const a=this.rangeToRatio({start:n,end:o},t);a&&this.updateZoom(e,{[t]:a})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?e??(e=i.getZoom()):"y"===i.getDirection()&&(t??(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){return this.axisZoomManagers.get(e)?.getZoom()??{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}isVisibleItemsCountAtLeast(e,t){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),r=new Set;let n=0;const o=[e.x.min,e.x.max],a=[e.y.min,e.y.max];for(const e of i?.boundSeries??[]){r.add(e.id);const i=t-(n??0);if(n+=e.getVisibleItems(o,a,i),n>=t)return!0}for(const e of s?.boundSeries??[]){if(r.has(e.id))continue;const i=t-(n??0);if(n+=e.getVisibleItems(o,a,i),n>=t)return!0}return 0===r.size}getMementoRanges(){const e=this.getDefinedZoom();let t;return this.autoScaleYAxis.enabled&&(t=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(e.x,"x"),rangeY:this.getRangeDirection(e.y,"y"),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:t}}autoScaleYZoom(e,t=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,r=this.getZoom();if(null==r?.x||!s.enabled||s.manuallyAdjusted)return;const{padding:n}=s;let o;if(o=0===r.x?.min&&1===r.x?.max?{min:0,max:1}:i?this.primaryAxisZoom("y",r.x,{padding:n}):this.combinedAxisZoom("y",r.x,{padding:n}),null!=o){if(i){const e=this.getPrimaryAxis("y"),t=null==e?void 0:this.axisZoomManagers.get(e.id);t?.updateZoom("zoom-manager",o)}else for(const e of this.axisZoomManagers.values())"y"===e.getDirection()&&e.updateZoom("zoom-manager",o);t&&this.applyChanges(e)}}applyChanges(e){if(this.autoScaleYZoom(e,!1),!Array.from(this.axisZoomManagers.values(),e=>e.applyChanges()).includes(!0))return;const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]=i.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:t,callerId:e}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!cn.is(i.scale)&&!io.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[r,n]=s;let o,a;return r<=n?(o=i.scale.invert(0),a=i.scale.invert(r+(n-r)*e.max)):(o=i.scale.invert(r-(r-n)*e.min),a=i.scale.invert(0)),{start:o,end:a}}rangeToRatio(e,t){const i=this.getPrimaryAxis(t);if(!i)return;const r=this.getDomainPixelExtents(i);if(!r)return;const[n,o]=r;let a=null==e.start?n:i.scale.convert?.(e.start),l=null==e.end?o:i.scale.convert?.(e.end);if(!(0,s.Bf)(a)||!(0,s.Bf)(l))return;const[c,h]=[Math.min(n,o),Math.max(n,o)];if(a<c||a>h)return void s.Vy.warnOnce(`Invalid range start [${e.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(o)}], ignoring.`);if(l<c||l>h)return void s.Vy.warnOnce(`Invalid range end [${e.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(o)}], ignoring.`);a=Math.min(h,Math.max(c,a)),l=Math.min(h,Math.max(c,l));const d=o-n;return{min:Math.abs((a-n)/d),max:Math.abs((l-n)/d)}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),s=t.at(-1);if(null!=i&&null!=s)return[i,s]}getDomainPixelExtents(e){const{domain:t}=e.scale,i=e.scale.convert?.(t.at(0)),r=e.scale.convert?.(t.at(-1));if((0,s.Bf)(i)&&(0,s.Bf)(r))return[i,r]}getDefinedZoom(){const e=this.getZoom();return{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1}}}zoomBounds(e,t,i,r){const n=e.scale,o=n.range;n.range=[0,1];const a=t.scale,l=a.range;a.range=[0,1];let c=1,h=!1,d=0,u=!1;for(const e of t.boundSeries){const{connectsToYAxis:t}=e,s=e.getRange("y",[i.min,i.max]);for(const e of s){const i=a.convert(e);Number.isFinite(i)&&(i<c&&(c=i,h=!t||e<0),i>d&&(d=i,u=!t||e>0))}}if((0,s.Bf)(t.min)&&(c=0),(0,s.Bf)(t.max)&&(d=1),n.range=o,a.range=l,c>=d)return;const p=(h?r:0)+(u?r:0),g=Math.min((d-c)*(1+p),1);if(!(g<=0)){if(h&&u){const e=(d+c)/2;c=e-g/2,d=e+g/2}else!h&&u?d=c+g:h&&!u&&(c=d-g);return c<0?(d+=-c,c=0):d>1&&(c-=d-1,d=1),{min:c,max:d}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s="x"===e?"y":"x",r=this.getPrimaryAxis(s),n=this.getPrimaryAxis(e);if(null!=r&&null!=n)return this.zoomBounds(r,n,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s="x"===e?"y":"x",r=new Map;for(const e of this.axes)if(e.direction===s)for(const t of e.boundSeries)r.set(t,e);let n=1,o=0;for(const s of this.axes)if(s.direction===e)for(const e of s.boundSeries){const a=r.get(e);if(null==a)continue;const l=this.zoomBounds(a,s,t,i);if(null==l)return;n=Math.min(n,l.min),o=Math.max(o,l.max)}if(n<1e-6&&(n=0),o>.999999&&(o=1),!(n>o))return{min:n,max:o}}},go=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new Ss({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return Bt(this.state.stateValue())}hasChanges(){const e=this.currentZoom,t=this.state.stateValue();return e.min!==t.min||e.max!==t.max}applyChanges(){const e=this.hasChanges();return this.currentZoom=this.state.stateValue(),e}};function mo(e,t,i,s,r,n){if(0===e.size)return!1;let o=e.x,a=e.y;null!=t&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+r&&(l=i+r);let c=a;a<s?c=s:a>s+n&&(c=s+n);const h=o-l,d=a-c;return Math.sqrt(h*h+d*d)<=.5*e.size}function fo(e,t,i,s,r){const n=e.x+e.width>t&&e.x<t+s,o=e.y+e.height>i&&e.y<i+r;return n&&o}function yo(e,t,i,s,r){return t+s<e.x+e.width&&t>e.x&&i>e.y&&i+r<e.y+e.height}function vo(e){return null!=e&&"object"==typeof e.point&&"object"==typeof e.label}var Co={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function bo(e,t=0){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{point:{x:n,y:o},label:{text:a}}=r;let{width:l,height:c}=r.label;if(l+=t,c+=t,i.some(e=>fo(e,n,o,l,c)))return!0;i.push({index:s,text:a,x:n,y:o,width:l,height:c,datum:r})}return!1}var So=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=f.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},r=new Set(e.map(e=>e.id));for(const e of this.labelData.keys())r.has(e)||this.labelData.delete(e);for(const t of e){const e=t.getLabelData();e.every(vo)&&this.labelData.set(t.id,e)}const n=function(e,t,i=5){const s=new Map,r=[],n=new Map([...e.entries()].map(([e,t])=>[e,t.toSorted((e,t)=>t.point.size-e.point.size)])),o=[...n.values()].flat();for(const[e,a]of n.entries()){const n=[];if(a[0]?.label){for(let e=0,s=a.length;e<s;e++){const s=a[e],{point:l,label:c,anchor:h}=s,{text:d,width:u,height:p}=c,g=.5*l.size;let m=0,f=0;if(g>0&&null!=s.placement){const e=Co[s.placement];m=(.5*u+g+i)*e.x,f=(.5*p+g+i)*e.y}const y=l.x-.5*u+m-((h?.x??.5)-.5)*l.size,v=l.y-.5*p+f-((h?.y??.5)-.5)*l.size;if(t&&!yo(t,y,v,u,p))continue;if(o.some(e=>mo(e.point,e.anchor,y,v,u,p)))continue;if(r.some(e=>fo(e,y,v,u,p)))continue;const C={index:e,text:d,x:y,y:v,width:u,height:p,datum:s};n.push(C),r.push(C)}s.set(e,n)}}return s}(this.labelData,s,5);for(const t of e)t.updatePlacedLabelData?.(n.get(t.id)??[])}},wo=class extends Ji{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return null==e||(0,s.cy)(e)}restoreMemento(e,t,i){i?.forEach(e=>{const{seriesId:t,data:i}=this.getRestoredData(e)??{};t&&i&&this.updateData(t,i)}),this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:s,visible:r}=e;if(t){const e=(this.legendDataMap.get(t)??[]).map(e=>{const s=e.seriesId===t&&(!i||e.itemId===i);return s&&e.isFixed&&this.warnFixed(e.seriesId,e.itemId),!e.isFixed&&s?{...e,enabled:r}:e});return{seriesId:t,data:e}}if(null!=i||null!=s)for(const e of this.getData()){if(null!=i&&e.itemId!==i||null!=s&&e.legendItemName!==s)continue;if(e.isFixed)return void this.warnFixed(e.seriesId,i);const t=(this.legendDataMap.get(e.seriesId)??[]).map(e=>e.itemId===i||e.legendItemName===s?{...e,enabled:r}:e);return{seriesId:e.seriesId,data:t}}}warnFixed(e,t){s.Vy.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:e??this.getData()})}updateData(e,t=[]){this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,s){if(s)return void this.getData().forEach(t=>{const i=(this.legendDataMap.get(t.seriesId)??[]).map(t=>t.legendItemName===s?{...t,enabled:e}:t);this.updateData(t.seriesId,i)});const r=this.getData(t),n=1===r.length,o=r.map(t=>null==i&&n||t.itemId===i?{...t,enabled:e}:t);this.updateData(t,o)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((e,[t,i])=>e.concat(i),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(e=>e.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(e=>e.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},xo=class{constructor(){this.groups={}}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){var r;t&&((r=this.groups)[s]??(r[s]={}),this.groups[s][e]={grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;const r=this.groups[s]?.[e];r&&(r.grouping=t,r.visible=i)}deregisterSeries({internalId:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&0===Object.keys(this.groups[t]).length&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,r=new Set;for(const i of Object.values(this.groups[e]??{}))i.visible&&(s.add(i.grouping.groupIndex),i.grouping.groupIndex===t.groupIndex&&r.add(i.grouping.stackIndex));const n=Array.from(s);return n.sort((e,t)=>e-t),{visibleGroupCount:n.length,visibleSameStackCount:r.size,index:n.indexOf(t.groupIndex)}}},Eo=class{constructor(e){this.updateCallback=e,this.events=new s.bk}addListener(e,t){return this.events.on(e,t)}removeListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},Mo=class{constructor(e,t){this.callbackCache=new pr,this.chartEventManager=new Hr,this.highlightManager=new Kr,this.layoutManager=new Hi,this.localeManager=new Zs,this.seriesStateManager=new xo,this.stateManager=new Zi,this.seriesLabelLayoutManager=new So,this.destroyFns=[],this.contextModules=[];const{scene:i,root:s,syncManager:r,container:n,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:h,chartType:d,domMode:u}=t;this.chartService=e,this.syncManager=r,this.domManager=new Ds(this.chartService,n,h,u),this.widgets=new rn(this.domManager);const p=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new hr({canvasElement:p}),this.scene.setRoot(s),this.destroyFns.push(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new fr(s),this.legendManager=new wo,this.annotationManager=new gr(e.annotationRoot,o),this.chartTypeOriginator=new ji(e),this.interactionManager=new Gr,this.contextMenuRegistry=new jr,this.updateService=new Eo(a),this.proxyInteractionService=new $s(this.localeManager,this.domManager),this.fontManager=new Cr(this.domManager,this.updateService),this.historyManager=new qi(this.chartEventManager),this.animationManager=new Vr(this.interactionManager,l),this.dataService=new vr(this.animationManager),this.tooltipManager=new Qr(this.localeManager,this.domManager,e.tooltip),this.zoomManager=new po(o,this.layoutManager);for(const e of c.byType("context")){if(!e.chartTypes.includes(d))continue;const t=e.moduleFactory(this);this.contextModules.push(t),this[e.contextKey]=t}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.fontManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy()),this.destroyFns.forEach(e=>e())}},Ao=class extends De{constructor(){super(...arguments),this.range="tooltip"}};function To(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function Do(e,t){if(null==e||null==t)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const e=t.get(i);if(null==e)return!1;if(!To(s,e))return!1}return!0}function Io(e,t,i,r){return t===e.data&&(0,s.r1)(i,e.ids)&&function(e,t){const{props:i,...r}=e,{props:n,...o}=t;return k(r,o)&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:r,idsMap:n,scopes:o,data:a,...l}=e[i],{type:c,idsMap:h,scopes:d,data:u,...p}=t[i];if(r!==c)return!1;if(o&&d&&!(0,s.r1)(o,d))return!1;if(a&&u&&a!==u)return!1;if(!k(l,p)||!Do(n,h))return!1}return!0}(i,n)}(r,e.opts)}a([Te],Ao.prototype,"range",2);var Ro=class e{constructor(){this.domain=new Set}static is(t){return t instanceof e}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},Po=class e{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e}static extendDomain(e,t=[1/0,-1/0]){for(const i of e)"number"==typeof i&&(t[0]>i&&(t[0]=i),t[1]<i&&(t[1]=i));return t}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}},ko=class{constructor(e){const t=e.reduce((e,t)=>Math.max(e,t.length),0);let i=1<<32-Math.clz32(t);t===i/2&&(i>>>=1),this.maxLevelSize=i;const s=new Float64Array(2*(2*i-1)).fill(NaN);for(const t of e)for(let e=0;e<t.length;e+=1){const r=Number(t[e]),n=i+e-1,o=0+(2*n|0),a=1+(2*n|0),l=s[o],c=s[a];(!Number.isFinite(l)||r<l)&&(s[o]=r),(!Number.isFinite(c)||r>c)&&(s[a]=r)}for(let e=i/2|0;e>=1;e=e/2|0){const t=e-1|0,i=t+e|0;for(let r=0;r<e;r+=1){const e=t+r,n=i+2*r,o=n+1,a=s[0+(2*n|0)],l=s[0+(2*o|0)];s[0+(2*e|0)]=!Number.isFinite(l)||a<l?a:l;const c=s[1+(2*n|0)],h=s[1+(2*o|0)];s[1+(2*e|0)]=!Number.isFinite(h)||c>h?c:h}}this.buffer=s}computeRangeInto(e,t,i,s,r,n,o){const a=r+n-1;if(a<t||r>=i)return o;if(r>=t&&a<i){const t=e[0+(2*s|0)],i=e[1+(2*s|0)];Number.isFinite(t)&&(o[0]=Math.min(o[0],t)),Number.isFinite(i)&&(o[1]=Math.max(o[1],i))}else n>1&&(s=2*s|0,n=n/2|0,this.computeRangeInto(e,t,i,s+1|0,r,n,o),this.computeRangeInto(e,t,i,s+2|0,r+n,n,o));return o}rangeBetween(e,t){if(e>t)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,r=[1/0,-1/0];return this.computeRangeInto(s,e,t,0,0,i,r),r}get range(){const{buffer:e}=this;return[e[0],e[1]]}},Lo=Symbol("domain-ranges");function No(e){return e.map(e=>(0,s.Gv)(e)?JSON.stringify(e):e).join("-")}function _o(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function Oo(e,t){return t?.get(e.id)??0}function Fo(e){return"scopes"in e&&Array.isArray(e.scopes)}function Go(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function Bo(e,t,i){const s=[];for(const r of e){const e=r.get(t)?.[i];if(null==e)return;s.push(e)}return s}function Vo(e){const t=[];let i,s=0;const r=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;i=r.exec(e);){if(i.index!==s)return;s=i.index+i[0].length;const e=i[1].trim();if(e.startsWith("."))t.push(e.slice(1).trim());else if(e.startsWith("[")){const i=e.slice(1,-1).trim();i.startsWith("'")?t.push(i.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):i.startsWith('"')?t.push(i.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):t.push(i)}else t.push(e)}if(s===e.length)return t}function Ho(e){return t=>{let i=t;for(const t of e)i=i[t];return i}}var Uo=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=v.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(e,t,i,s){for(const r of e)s.has(r)||s.set(r,Go(t.length,!1)),s.get(r)[i]=!0};let s=!0;for(const t of e.props){if("key"===t.type&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===t.type&&s&&(s=!1)}const r=({matchGroupIds:e=[]})=>{for(const t of e)if(this.values.every(e=>e.groupId!==t))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${t}).`)},n=new Set,o=new Set;for(const t of e.props){const e="key"===t.type?n:o;switch(Fo(t)&&t.scopes?.forEach(t=>e.add(t)),t.type){case"key":this.keys.push({...t,index:this.keys.length,missing:new Map});break;case"value":if(null==t.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(t)}`);this.values.push({...t,index:this.values.length,missing:new Map});break;case"aggregate":r(t),this.aggregates.push({...t,index:this.aggregates.length});break;case"group-value-processor":r(t),this.groupProcessors.push({...t,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...t,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...t,index:this.reducers.length});break;case"processor":this.processors.push({...t,index:this.processors.length})}}if(this.opts.groupByKeys||null!=this.opts.groupByFn){const e=new Set(o.values());if(n.forEach(t=>e.delete(t)),e.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...e.values()]}`)}}resolveProcessedDataDefById(e,t){const i=this.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),r=i.keys[s];if(null==r)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return r.get(e.id)}hasColumnById(e,t){return null!=this.scopeCache.get(e.id)?.get(t)}resolveColumnById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),r=i.columns?.[s];if(null==r)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return r}*forEachDatum(e,t,i){const s=t.columnScopes.findIndex(t=>t.has(e.id));for(const e of i.datumIndices[s]??[])yield t.columns[s][e]}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(t=>t.has(e.id)),s={groupIndex:0,columnIndex:i},r=[];for(const e of t.groups){s.group=e;let t=0;for(const n of e.datumIndices[i]??r)s.datumIndex=n,s.valueIndex=t++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(e,t){const i={columnIndex:t.columnScopes.findIndex(t=>t.has(e.id)),datumIndexes:[void 0,void 0,void 0]};for(const s of this.forEachGroupDatum(e,t))i.group=i.nextGroup,i.groupIndex=i.nextGroupIndex,i.nextGroup=s.group,i.nextGroupIndex=s.groupIndex,i.datumIndexes[0]=i.datumIndexes[1],i.datumIndexes[1]=i.datumIndexes[2],i.datumIndexes[2]=s.datumIndex,null!=i.group&&null!=i.datumIndexes[1]&&(yield i);i.group=i.nextGroup,i.groupIndex=i.nextGroupIndex,i.nextGroup=void 0,i.nextGroupIndex=void 0,i.datumIndexes[0]=i.datumIndexes[1],i.datumIndexes[1]=i.datumIndexes[2],i.datumIndexes[2]=void 0,null!=i.group&&null!=i.datumIndexes[1]&&(yield i)}getDomain(e,t,i,s){const r=this.getDomainsByType(i??"value",s);return r?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,s],r){const n=t.map(t=>this.resolveProcessedDataIndexById(e,t)),o=n.join(":"),a=r[Lo];let l=a.get(o);if(null==l){const e=n.map(e=>r.columns[e]);l=new ko(e),a.set(o,l)}return l.rangeBetween(i,s)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:r,groupProcessors:n,reducers:o,processors:a,propertyProcessors:l}=this,c=performance.now();if(t&&0===this.keys.length)return;let h=this.extractData(e);t?h=this.groupData(h):i&&(h=this.groupData(h,i(h))),n.length>0&&"grouped"===h.type&&this.postProcessGroups(h),r.length>0&&"ungrouped"===h.type?this.aggregateUngroupedData(h):r.length>0&&"grouped"===h.type&&this.aggregateGroupedData(h),l.length>0&&this.postProcessProperties(h),o.length>0&&this.reduceData(h),a.length>0&&this.postProcessData(h),this.warnDataMissingProperties(e);const d=performance.now();return h.time=d-c,this.debug.check()&&function(e){const t=(e,t)=>{t.length>0&&(s.Vy.log(`DataModel.processData() - ${e}`),s.Vy.table(t))};s.Vy.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Group Domains",e.domain.groups??[]),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[])}(h),this.processScopeCache(),h}warnDataMissingProperties(e){if(0!==e.size)for(const t of(0,s.nl)(this.keys,this.values))for(const[i,r]of t.missing){if(r<(e.get(i)?.length??1/0))continue;const n=null==i?"":` for ${i}`;s.Vy.warnOnce(`the key '${t.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of(0,s.nl)(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(this.scopeCache.has(t)){if(this.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(s,e)}else this.scopeCache.set(t,new Map([[s,e]]))}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=null==e||0===e.length,s="string"==typeof t?t:t.id,r=this.values.reduce((t,r,n)=>((null==r.scopes||i&&!r.scopes.length||r.scopes.some(t=>e?.includes(t)))&&(r.property===s||r.id===s||(t=>{if(t.idsMap)for(const[i,r]of t.idsMap)if(e?.includes(i)&&r.has(s))return!0;return!1})(r))&&t.push(n),t),[]);if(0===r.length)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return r}extractData(e){const{dataDomain:t,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:r,values:n}=this,{invalidData:o,invalidKeys:a,allKeyMappings:l}=this.extractKeys(r,e,i),{columns:c,columnScopes:h,partialValidDataCount:d,maxDataLength:u}=this.extractValues(o,n,e,a,i),p=e=>{const i=t.get(e),s=i.getDomain();return Po.is(i)&&s[0]>s[1]?[]:s};return{type:"ungrouped",input:{count:u},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:a,invalidData:o,domain:{keys:r.map(p),values:n.map(p)},defs:{allScopesHaveSameDefs:s,keys:r,values:n},partialValidDataCount:d,time:0,[Lo]:new Map}}extractKeys(e,t,i){const s=new Map,r=new Map,n=new Map;let o,a;const l=(e,t)=>{const i=a.get(e);o.set(t,o.get(i)),s.has(i)&&(s.set(t,s.get(i)),r.set(t,r.get(i)))};for(const c of e){const{invalidValue:e,scopes:h}=c;o=new Map,a=new Map,n.set(c,o);for(const n of h??[]){const h=t.get(n)??[];if(a.has(h)){l(h,n);continue}const d=[];let u,p;o.set(n,d),a.set(h,n);for(let t=0;t<h.length;t++){if(null==h[t]||"object"!=typeof h[t])continue;const s=i(c,h[t],t,n);s.valid?d.push(s.value):(d.push(e),u??(u=Go(h.length,!1)),p??(p=Go(h.length,!1)),u[t]=!0,p[t]=!0)}u&&p&&(s.set(n,u),r.set(n,p))}}return{invalidData:r,invalidKeys:s,allKeyMappings:n}}extractValues(e,t,i,r,n){let o=0;const a=[],l=[];let c=0;for(const h of t){const{invalidValue:t}=h;if(new Set(h.scopes.map(e=>i.get(e))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(h)}`);const d=new Set(h.scopes),u=(0,s.$1)(h.scopes),p=i.get(u),g=new Array;for(let i=0;i<p.length;i++){if(null==p[i]||"object"!=typeof p[i])continue;const s=p[i],a=r.get(u)?.[i],l=n(h,s,i,h.scopes);let c=l.value;!a&&l.valid||this.markScopeDatumInvalid(h.scopes,p,i,e),a?c=t:l.valid||(o+=1,c=t),g[i]=c}a.push(g),l.push(d),c=Math.max(c,g.length)}return{columns:a,columnScopes:l,partialValidDataCount:o,maxDataLength:c}}groupData(e,t){var i;const r=new Map,{keys:n,columns:o,columnScopes:a,invalidKeys:l,invalidData:c}=e,h=e.scopes,d=new Set;for(const e of h){const u=o.map((e,t)=>t).filter(t=>!d.has(t)&&a[t].has(e));if(0===u.length)continue;for(const e of u)d.add(e);const p=new Set;for(const e of u)for(const t of a[e])p.add(t);const g=n.map(t=>t.get(e)).filter(e=>null!=e),m=o[(0,s.$1)(u)],f=c?.get(e),y=l?.get(e);for(let s=0;s<m.length;s++){if(!0===y?.[s])continue;const n=g.map(e=>e[s]);if(null==n||0===n.length)throw new Error("AG Charts - no keys found for scope: "+e);const o=t?.(n)??n,a=No(o),l=r.get(a)??{keys:o,datumIndices:[],validScopes:h};if(r.has(a)||r.set(a,l),!0===f?.[s]){l.validScopes===h&&(l.validScopes=new Set(h.values()));for(const e of p)l.validScopes.delete(e)}for(const e of u)(i=l.datumIndices)[e]??(i[e]=[]),l.datumIndices[e].push(s)}}const u=[],p=[];for(const{keys:e,datumIndices:t,validScopes:i}of r.values())u.push(e),p.push({datumIndices:t,keys:e,aggregation:[],validScopes:i});return{...e,type:"grouped",domain:{...e.domain,groups:u},groups:p}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:r,dataSources:n}=e,o=(0,s.$1)(n.keys()),a=n.get(o);e.aggregation=a?.map((e,s)=>{const n=[];for(const[e,a]of this.aggregates.entries()){const l=this.valueGroupIdxLookup(a);let c=a.groupAggregateFunction?.()??[1/0,-1/0];const h=l.map(e=>r[e][s]),d=Bo(i,o,s),u=null!=d?a.aggregateFunction(h,d):void 0;u&&(c=a.groupAggregateFunction?.(u,c)??Po.extendDomain(u,c));const p=a.finalFunction?.(c)??c;n[e]=p,Po.extendDomain(p,t[e])}return n})}aggregateGroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,r]of this.aggregates.entries()){const n=this.valueGroupIdxLookup(r);for(const o of e.groups){o.aggregation??(o.aggregation=[]);const e=o.keys;let a=r.groupAggregateFunction?.()??[1/0,-1/0];const l=Math.max(...n.map(e=>o.datumIndices[e]?.length??0));for(let t=0;t<l;t++){const s=n.map(e=>i[e][o.datumIndices[e]?.[t]]),l=r.aggregateFunction(s,e);l&&(a=r.groupAggregateFunction?.(l,a)??Po.extendDomain(l,a))}const c=r.finalFunction?.(a)??a;o.aggregation[s]=c,Po.extendDomain(c,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this,{columnScopes:i,columns:r,invalidData:n}=e;for(const o of t){const t=this.valueGroupIdxLookup(o),a=o.adjust()();for(const i of e.groups)a(r,t,i);for(const o of t){const t="category"===this.values[o].valueType,a=r[o],l=(0,s.$1)(i[o]),c=n?.get(l),h=t?new Ro:new Po;for(let e=0;e<a.length;e+=1)!0!==c?.[e]&&h.extend(a[e]);e.domain.values[o]=h.getDomain()}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)for(const r of this.valueIdxLookup(s,i))t()(e,r)}reduceData(e){e.reduced??(e.reduced={});const{dataSources:t,keys:i}=e;for(const r of this.reducers){const n=r.reducer();let o=r.initialValue;if("grouped"===e.type)for(const t of e.groups)o=n(o,t.keys);else{const e=(0,s.$1)(t.keys()),r=i.map(t=>t.get(e)).filter(e=>null!=e),a=r.map(()=>{}),l=t.get(e);for(let e=0;e<l.length;e+=1){for(let t=0;t<a.length;t++)a[t]=r[t]?.[e];o=n(o,a)}}e.reduced[r.property]=o}}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property])}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const e of t)if(e.scopes)for(const t of e.scopes)i.add(t);const r=new Map,n=new Map;let o=!0;const a=()=>{for(const n of(0,s.nl)(e,t))"category"===n.valueType?r.set(n,new Ro):(r.set(n,new Po),o&&(o=(n.scopes??[]).length===i.size))};a();const l=this.buildAccessors((0,s.nl)(e,t)),c={value:void 0,missing:!1,valid:!1};return{dataDomain:r,processValue:(e,t,i,o)=>{let h,d;if(l.has(e.property)){try{d=l.get(e.property)(t)}catch{}h=null!=d}else h=e.property in t,d=h?t[e.property]:e.missingValue;if(null!=e.forceValue&&(d=h&&(0,s.cI)(d)?-1*e.forceValue:e.forceValue,h=!0),c.missing=!h,!h&&!("missingValue"in e))if("string"==typeof o){const t=e.missing.get(o)??0;e.missing.set(o,t+1)}else for(const t of o){const i=e.missing.get(t)??0;e.missing.set(t,i+1)}if(r.has(e)||a(),h&&!1===e.validation?.(d,t,i)){if(c.valid=!1,!("invalidValue"in e))return"integrated"!==this.mode&&s.Vy.warnOnce(`invalid value of type [${typeof d}] for [${e.scopes} / ${e.id}] ignored:`,`[${d}]`),c.value=void 0,c;d=e.invalidValue}else c.valid=!0;if(e.processor){let t=n.get(e);null==t&&(t=e.processor(),n.set(e,t)),d=t(d,i)}return r.get(e)?.extend(d),c.value=d,c},initDataDomain:a,scopes:i,allScopesHaveSameDefs:o}}buildAccessors(e){const t=new Map;if(this.suppressFieldDotNotation)return t;for(const i of e){if(!i.property.includes(".")&&!i.property.includes("["))continue;const e=Vo(i.property);if(null==e){s.Vy.warnOnce("Invalid property path [%s]",i.property);continue}const r=Ho(e);t.set(i.property,r)}return t}},zo=class e{constructor(e,t){this.mode=e,this.suppressFieldDotNotation=t,this.debug=v.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,t,i){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,r)=>{this.requested.push({id:e,opts:i,data:t,resolve:s,reject:r})})}execute(e){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const t=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",t);const i=this.mergeRequested(t);this.debug("DataController.execute() - merged",i),this.debug.check()&&((0,s.zk)().processedData=[]);const r=[];for(const{data:n,ids:o,opts:a,resolves:l,rejects:c}of i){const i=e?.find(e=>Io(e,n,o,a));let h,d;if(null==i)try{h=new Uo(a,this.mode,this.suppressFieldDotNotation);const e=new Map(t.map(e=>[e.id,e.data]));d=h.processData(e)}catch(e){c.forEach(t=>t(e));continue}else({dataModel:h,processedData:d}=i);r.push({opts:a,data:n,ids:o,dataModel:h,processedData:d}),this.debug.check()&&(0,s.zk)("processedData").push(d),0===d?.partialValidDataCount?l.forEach(e=>e({dataModel:h,processedData:d})):d?this.splitResult(h,d,o,l):c.forEach(e=>e(new Error("AG Charts - no processed data generated")))}return r}validateRequests(e){const t=[];for(const[i,s]of e.entries())i>0&&s.data.length!==e[0].data.length&&!1===s.opts.groupByData&&!1===s.opts.groupByKeys?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):t.push(s);return t}mergeRequested(t){const i=[];for(const s of t){const t=i.find(e.groupMatch(s));t?t.push(s):i.push([s])}return i.map(e.mergeRequests)}splitResult(e,t,i,s){for(let r=0;r<i.length;r++)(0,s[r])({dataModel:e,processedData:t})}static groupMatch({data:e,opts:t}){function i(e){return e.filter(e=>"key"===e.type).map(e=>e.property).join(";")}const{groupByData:s,groupByKeys:r=!1,groupByFn:n,props:o}=t,a=i(o);return([t])=>(!1===s||t.data===e)&&(t.opts.groupByKeys??!1)===r&&t.opts.groupByFn===n&&i(t.opts.props)===a}static mergeRequests(t){const i=new Set(["key","group-value-processor"]);return t.reduce((t,{id:s,data:r,resolve:n,reject:o,opts:{props:a,...l}})=>{t.ids.push(s),t.rejects.push(o),t.resolves.push(n),t.data??(t.data=r),t.opts??(t.opts={...l,props:[]});for(const n of a){const o={...n,scopes:[s],data:r};e.createIdsMap(s,o);const a=t.opts.props.find(t=>t.type===o.type&&(i.has(t.type)||t.data===o.data)&&e.deepEqual(t,o));a?(a.scopes??(a.scopes=[]),a.scopes.push(...o.scopes??[]),"key"!==a.type&&"value"!==a.type||!o.idsMap?.size||e.mergeIdsMap(o.idsMap,a.idsMap)):t.opts.props.push(o)}return t},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,t){for(const[i,s]of e){const e=t.get(i);if(null==e)t.set(i,new Set(s));else for(const t of s)e.add(t)}}static createIdsMap(e,t){null!=t.id&&(t.idsMap??(t.idsMap=new Map),t.idsMap.has(e)?t.idsMap.get(e).add(t.id):t.idsMap.set(e,new Set([t.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;let s,r;if(Array.isArray(t)){if(r=t.length,r!==i.length)return!1;for(s=r-1;s>=0;s--)if(!e.deepEqual(t[s],i[s]))return!1;return!0}const n=Object.keys(t);if(r=n.length,r!==Object.keys(i).length)return!1;for(s=r-1;s>=0;s--){const r=n[s];if(!(e.skipKeys.has(r)||Object.hasOwn(i,r)&&e.deepEqual(t[r],i[r])))return!1}return!0}return!1}};zo.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Wo=zo,jo=new class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.moduleFactory),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate)}create(e,t){const i=this.axesMap.get(e);if(i)return i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},Ko=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function $o(e){return Ko.find(t=>"series"===t.type&&t.identifier===e)?.chartTypes}function Yo(e){if(!function(e){return"enterprise"===e.packageType}(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=Ko.find(t=>t.type===e.type&&(!("optionsKey"in t)||!("optionsKey"in e)||t.optionsKey===e.optionsKey)&&(!("contextKey"in t)||!("contextKey"in e)||t.contextKey===e.contextKey)&&t.identifier===e.identifier&&e.chartTypes.every(e=>t.chartTypes.includes(e)));return t&&(t.useCount??(t.useCount=0),t.useCount++),null!=t}var qo=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,moduleFactory:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,moduleFactory:i}),this.themeTemplates.set(t,s)}create(e,t){const i=this.legendMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},Xo=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return"cartesian"===this.get(e)}isPolar(e){return"polar"===this.get(e)}isHierarchy(e){return"hierarchy"===this.get(e)}isTopology(e){return"topology"===this.get(e)}isFlowProportion(e){return"flow-proportion"===this.get(e)}isStandalone(e){return"standalone"===this.get(e)}isGauge(e){return"gauge"===this.get(e)}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get flowProportionTypes(){return this.seriesTypes.filter(e=>this.isFlowProportion(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}get gaugeTypes(){return this.seriesTypes.filter(e=>this.isGauge(e))}},Zo=class extends Map{set(e,t){return super.set(e,N(t,this.get(e)))}},Qo=new Xo,Jo=new Xo,ea=new Zo,ta=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,tooltipDefaults:s,defaultAxes:r,themeTemplate:n,solo:o,stackable:a,groupable:l,stackedByDefault:c,hidden:h}){this.setThemeTemplate(e,n),this.seriesMap.set(e,{moduleFactory:i,tooltipDefaults:s,defaultAxes:r,solo:o,stackable:a,groupable:l,stackedByDefault:c}),Qo.set(e,t),h||Jo.set(e,t)}create(e,t){const i=this.seriesMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){const t=this.seriesMap.get(e)?.defaultAxes;return null==t?null:{axes:Bt(t)}}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,N(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}getTooltipDefauls(e){return this.seriesMap.get(e)?.tooltipDefaults}isSolo(e){return this.seriesMap.get(e)?.solo??!1}isGroupable(e){return this.seriesMap.get(e)?.groupable??!1}isStackable(e){return this.seriesMap.get(e)?.stackable??!1}isStackedByDefault(e){return this.seriesMap.get(e)?.stackedByDefault??!1}},ia=class e extends Ji{constructor(e){super(),this.chart=e}subscribe(t=e.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},e.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=e.DEFAULT_GROUP){const i=this.get(t);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(t=e.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=e.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=e.DEFAULT_GROUP){return this.getGroupMembers(t).filter(e=>e!==this.chart)}getGroupSyncMode(t=e.DEFAULT_GROUP){return this.getGroupMembers(t).some(e=>e.series.length>1)?"multi-series":"single-series"}get(t){return e.chartsGroups.get(t)}};ia.chartsGroups=new Map,ia.DEFAULT_GROUP=Symbol("sync-group-default");var sa=ia,ra=class extends De{constructor(){super(...arguments),this.enabled=!1}};a([Te],ra.prototype,"enabled",2),a([Te],ra.prototype,"tabIndex",2);var na={};o(na,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>oa,fromToMotion:()=>aa,staticFromToMotion:()=>la});var oa={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function aa(e,t,i,s,r,n,o){const{fromFn:a,toFn:l,applyFn:c=(e,t)=>e.setProperties(t)}=r,{nodes:h,selections:d}=Lr(s),u=(s,r)=>{let h,d=0,u=0;for(const p of r){const g=s[d]===p,m={last:u>=r.length-1,lastLive:d>=s.length-1,prev:r[u-1],prevFromProps:h,prevLive:s[d-1],next:r[u+1],nextLive:s[d+(g?1:0)]},f=`${e}_${t}_${p.id}`;i.stopByAnimationId(f);let y="unknown";g?n&&o&&(y=ca(p,p.datum,n,o)):y="removed",p.transitionOut="removed"===y;const{phase:v,start:C,finish:b,delay:S,duration:w,...x}=a(p,p.datum,y,m),{phase:E,start:M,finish:A,delay:T,duration:D,...I}=l(p,p.datum,y,m),R=null==b;i.animate({id:f,groupId:e,phase:v??E??"update",duration:w??D,delay:S??T,from:x,to:I,ease:Er,collapsable:R,onPlay:()=>{const e={...C,...M,...x};c(p,e,"start")},onUpdate(e){c(p,e,"update")},onStop:()=>{const e={...C,...M,...x,...I,...b,...A};c(p,e,"end")}}),g&&d++,u++,h=x}};let p=0;for(const s of d){const r=s.nodes();u(r.filter(e=>!s.isGarbage(e)),r),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:Er,onStop(){s.cleanup()}}),p++}u(h,h)}function la(e,t,i,s,r,n,o){const{nodes:a,selections:l}=Lr(s),{start:c,finish:h,phase:d}=o;i.animate({id:`${e}_${t}`,groupId:e,phase:d??"update",from:r,to:n,ease:Er,onPlay:()=>{if(c){for(const e of a)e.setProperties(c);for(const e of l)for(const t of e.nodes())t.setProperties(c)}},onUpdate(e){for(const t of a)t.setProperties(e);for(const t of l)for(const i of t.nodes())i.setProperties(e)},onStop:()=>{for(const e of a)e.setProperties({...n,...h});for(const e of l){for(const t of e.nodes())t.setProperties({...n,...h});e.cleanup()}}})}function ca(e,t,i,s){const r=i(e,t);return s.added.has(r)?"added":s.removed.has(r)?"removed":null==e.previousDatum&&null!=e.datum?"added":null!=e.previousDatum&&null==e.datum?"removed":"updated"}var ha={};function da(e,t){const{nodes:i,selections:s}=Lr(e);for(const e of s){for(const i of e.nodes()){const e=t(i,i.datum);i.setProperties(e)}e.cleanup()}for(const e of i){const i=t(e,e.datum);e.setProperties(i)}}o(ha,{resetMotion:()=>da});var ua=class e{constructor(e,t,i=!0){this.parentNode=e,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=v.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(J,t)?()=>new t:t}static select(t,i,s=!0){return new e(t,i,s)}static selectAll(e,t){const i=[],s=e=>{t(e)&&i.push(e);for(const t of e.children())s(t)};return s(e),i}static selectByClass(t,...i){return e.selectAll(t,e=>i.some(t=>e instanceof t))}static selectByTag(t,i){return e.selectAll(t,e=>e.tag===i)}createNode(e,t,i){const s=this.nodeFactory(e);return s.datum=e,t?.(s),null==i?this._nodes.push(s):this._nodes.splice(i,0,s),this.parentNode.appendChild(s),s}update(e,t,i){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),i){const s=new Map(e.map((e,t)=>[i(e),[e,t]]));for(const[e,t]of this._nodesMap.entries())if(s.has(t)){const[i]=s.get(t);e.datum=i,this.garbageBin.delete(e),s.delete(t)}else this.garbageBin.add(e);for(const[e,[i,r]]of s.entries())this._nodesMap.set(this.createNode(i,t,r),e)}else{const i=Math.max(e.length,this.data.length);for(let s=0;s<i;s++)s>=e.length?this.garbageBin.add(this._nodes[s]):s>=this._nodes.length?this.createNode(e[s],t):(this._nodes[s].datum=e[s],this.garbageBin.delete(this._nodes[s]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(e=>!this.garbageBin.has(e)||(this._nodesMap.delete(e),this.garbageBin.delete(e),e.destroy(),!1))),this}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}each(e){for(const t of this._nodes.entries())e(t[1],t[1].datum,t[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const t=this._nodes[e];yield{node:t,datum:t.datum,index:e}}}select(t){return e.selectAll(this.parentNode,t)}selectByClass(t){return e.selectByClass(this.parentNode,t)}selectByTag(t){return e.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}},pa=class extends dt{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new f(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return(this.x1===this.x2||this.y1===this.y2)&&this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t)}distanceSquared(e,t){const{x1:i,y1:s,x2:r,y2:n}=this;return Ue(e,t,i,s,r,n,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:s,y1:r,x2:n,y2:o}=this;if(s===n){const{strokeWidth:e}=this,t=Math.round(s*i)/i+Math.trunc(e*i)%2/(2*i);s=t,n=t}else if(r===o){const{strokeWidth:e}=this,t=Math.round(r*i)/i+Math.trunc(e*i)%2/(2*i);r=t,o=t}t.beginPath(),t.moveTo(s,r),t.lineTo(n,o),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,s.FJ)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};pa.className="Line",pa.defaultStyles={...dt.defaultStyles,fill:void 0,strokeWidth:1},a([$()],pa.prototype,"x1",2),a([$()],pa.prototype,"y1",2),a([$()],pa.prototype,"x2",2),a([$()],pa.prototype,"y2",2);var ga="color: green",ma="color: grey";function fa(){return D(()=>{})}function ya(e,t){const i=R(t);if(0===i.length)return;const s=P(e);for(const e of i)e in s&&(t[e]=s[e])}var va=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},Ca=class e extends va{constructor(e,t,i){super(),this.defaultState=e,this.states=t,this.enterEach=i,this.debug=v.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,ga)}transition(t,i){if(!this.transitionChild(t,i)||this.state===e.child||this.state===e.parent)return;const s=this.state,r=this.states[this.state];let n=r[t];const o=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(n))n=n.find(e=>{if(!e.guard)return!0;const t=e.guard(i);return t||this.debug(`${o} (guarded)`,e.target,ma),t});else if("object"==typeof n&&!(n instanceof e)&&n.guard&&!n.guard(i))return void this.debug(`${o} (guarded)`,n.target,ma);if(!n)return void this.debug(`${o} ${this.state}`,ma);const a=this.getDestinationState(n),l=a===this.state?void 0:r.onExit;this.debug(`${o} ${a}`,ga),this.state=a,"function"==typeof n?n(i):"object"!=typeof n||n instanceof e||n.action?.(i),l?.(),this.enterEach?.(s,a),a!==s&&a!==e.child&&a!==e.parent&&this.states[a].onEnter?.(s,i)}transitionAsync(e,t){setTimeout(()=>{this.transition(e,t)},0)}is(t){return this.state===e.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==e.child||!this.childState||(ya(this,this.childState),this.childState.transition(t,i),!this.childState.is(e.parent)||(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,ga),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1))}getDestinationState(t){let i=this.state;return"string"==typeof t?i=t:t instanceof e?(this.childState=t,this.childState.parent=this,i=e.child):"object"==typeof t&&(t.target instanceof e?(this.childState=t.target,this.childState.parent=this,i=e.child):null!=t.target&&(i=t.target)),i}};Ca.child="__child",Ca.parent="__parent";var ba=Ca,Sa=class extends va{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)ya(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)ya(this,i),i.transitionAsync(e,t)}},wa=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){const t=(0,s.Kg)(e)?e:e.optionsKey;this.moduleMap.get(t)?.moduleInstance.destroy(),this.moduleMap.delete(t)}getModule(e){return this.moduleMap.get((0,s.Kg)(e)?e:e.optionsKey)?.moduleInstance}isEnabled(e){return this.moduleMap.has((0,s.Kg)(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){for(const e of this.moduleMap.keys())this.moduleMap.get(e)?.moduleInstance.destroy();this.moduleMap.clear()}};function xa(e){return"string"==typeof e?dn[e]:e}function Ea(e){return xa(e).unit}function Ma(e){return xa(e).hierarchy}function Aa(e){return xa(e).milliseconds}function Ta(e,t,i,s){return xa(e).range(t,i,s)}function Da(e,t){return xa(e).floor(t)}var Ia=class e extends io{constructor(){super(...arguments),this.type="unit-time",this._domain=[],this._bands=void 0}static is(t){return t instanceof e}set domain(e){e!==this._domain&&(this._domain=e,this._bands=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(e){this._interval!==e&&(this._interval=e,this._bands=void 0)}get bands(){return this._bands??(this._bands=this.calculateBands(this._domain,[0,1])),this._bands}normalizeDomains(...e){return hn(...e)}convert(e,t){const{domain:i,interval:s}=this;if(i.length<2)return NaN;if(null!=s){const t=e.valueOf(),[r,n]=this.calculateBandRange(i,s),o=Math.min(r.valueOf(),n.valueOf()),a=Math.max(r.valueOf(),n.valueOf());if(t<o||t>=a+Aa(s))return NaN}return super.convert(e,t)}calculateBandRange(e,t){return[Da(t,e[0]),Da(t,e[1])]}calculateBands(e,t,i=!1){if(e===this.domain&&0===t[0]&&1===t[1]&&!i&&null!=this._bands)return this._bands;if(e.length<2)return[];const{interval:s}=this;if(null==s)return[];const[r,n]=this.calculateBandRange(e,s);return Ta(s,r,n,{visibleRange:t,extend:i})}ticks({interval:e},t=this.domain,i=[0,1],r=!1){if(t.length<2)return;const n=this.calculateBands(t,i,r),o=this.interval?Aa(this.interval):1/0;if(null==e)return{ticks:n,count:void 0};const a=Math.min(t[0].valueOf(),t[1].valueOf()),l=Math.max(t[0].valueOf(),t[1].valueOf()),c=[];let h,d,u,p,g,m;e instanceof Cn?(h=e.range(t[0],t[1],{extend:!0,visibleRange:i}),d=0,u=h.length-1):(h=n,d=(0,s.I5)(0,n.length-1,e=>n[e].valueOf()<=a)??0,u=(0,s.I5)(0,n.length-1,e=>n[e].valueOf()<=l)??n.length-1);for(let e=d;e<=u;e++){const t=h[e].valueOf(),i=(0,s.I5)(0,n.length-1,e=>n[e].valueOf()<=t),r=null!=i&&i!=p?n[i]:void 0;p=i,null!=r&&t-r.getTime()<=o&&c.push(r)}if(this.interval){const e=this.calculateBandRange([new Date(a),new Date(l)],this.interval);g=e[0].valueOf(),m=e[1].valueOf()}else g=a,m=l;let f=(0,s.S3)(0,c.length-1,e=>c[e].valueOf()>=g)??0,y=(0,s.I5)(0,c.length-1,e=>c[e].valueOf()<=m)??c.length-1;return r&&(f=Math.max(f-1,0),y=Math.min(y+1,c.length-1)),{ticks:c.slice(f,y+1),count:c.length}}findIndex(e){const{bands:t}=this,i=e.valueOf();return(0,s.I5)(0,t.length-1,e=>t[e].valueOf()<=i)}datumFormatter(e){const t=this.tickFormatter(e,1);return e=>{const i=this.findIndex(e);return t(null!=i?this.bands[i]:e)}}};Ia.defaultTickCount=12;var Ra=Ia;function Pa(e,t){return e.valueOf()-t.valueOf()}function ka(e){const t=e.slice().sort(Pa);return null==La(t)?function(e){let t=NaN;const i=[];for(const s of e){const e=s.valueOf();t!==e&&i.push(s),t=e}return i}(t):t}function La(e){if(0===e.length)return 1;const t=Number(e[e.length-1])>Number(e[0])?1:-1;let i=-1/0*t;for(const s of e){const e=s.valueOf();if(Math.sign(e-i)!==t)return;i=e}return t}var Na=(e,t,i)=>({duration:t*i,timeInterval:e,step:i}),_a=[Na(Mn,un,1),Na(Mn,un,5),Na(Mn,un,15),Na(Mn,un,30),Na(Tn,pn,1),Na(Tn,pn,5),Na(Tn,pn,15),Na(Tn,pn,30),Na(In,gn,1),Na(In,gn,3),Na(In,gn,6),Na(In,gn,12),Na(wn,mn,1),Na(wn,mn,2),Na(Pn,fn,1),Na(Pn,fn,2),Na(Pn,fn,3),Na(Sn,yn,1),Na(Sn,yn,2),Na(Sn,yn,3),Na(Sn,yn,4),Na(Sn,yn,6),Na(bn,vn,1)],Oa=[1,2,5,10];function Fa(e,t){return Math.abs(Math.round(e)-e)<t}function Ga(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function Ba(e,t,i,s,r,n){if(e===t)return{ticks:[e],count:1};if(i<2)return{ticks:[e,t],count:2};const o=za(e,t,i,s,r);if(!Number.isFinite(o))return{ticks:[],count:0};let a=e,l=t;if(Fa(a/o,1e-12)||(a=Math.ceil(a/o)*o),Fa(l/o,1e-12)||(l=Math.floor(l/o)*o),null!=n){const i=l-a,s=t-e;n=[(e+s*n[0]-a)/i,(e+s*n[1]-a)/i]}const{ticks:c}=Ka(a,l,o,n);return{ticks:c,count:Ga(e,t,o)}}var Va=Math.floor(2*Pn.milliseconds/Sn.milliseconds*10)/10;function Ha({timeInterval:e,step:t}){return e.milliseconds*t<=(e.hierarchy?.milliseconds??1/0)*Va}function Ua(e,t,i,s,r,{weekStart:n,primaryOnly:o=!1,targetInterval:a}){if(i<=0)return;const l=a??Math.abs(t-e)/Math.max(i,1),c=_a.findLast(e=>(!o||Ha(e))&&l>e.duration),h=_a.find(e=>(!o||Ha(e))&&l<=e.duration);if(null==c){const n=Math.max(za(e,t,i,s,r),1);return xn.every(n)}if(null==h){const n=null==a?za(e/vn,t/vn,i,s,r):1;return bn.every(n)}const{timeInterval:d,step:u}=l-c.duration<h.duration-l?c:h;return d===Pn?n?.every(u)??wn.every(7*u):d.every(u)}function za(e,t,i,r=0,n=1/0){if(e===t)return(0,s.qE)(1,r,n);if(i<1)return NaN;const o=Math.abs(t-e),a=10**Math.floor(Math.log10(o/i));let l=NaN,c=1/0,h=!1;for(const e of Oa){const t=Math.ceil(o/(e*a)),s=t>=r&&t<=n;if(h&&!s)continue;const d=Math.abs(t-i);(c>d||h!==s)&&(h||(h=s),c=d,l=e)}return l*a}function Wa(e){for(let t=e.length-1;t>=0;t-=1)if("0"!==e[t])return t+1;return 0}function ja(e,t){const i=(0,s.sA)(t??",f");(null==i.precision||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(e=>{if(!Number.isFinite(e))return 0;const[t,s]=e.toExponential((i.type?6:12)-1).split(/[.e]/g);return("1"!==t&&"-1"!==t?1:0)+Wa(s)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(e=>{if(!Number.isFinite(e)||0===e)return 0;const t=Math.floor(Math.log10(Math.abs(e))),s=i.type?6:12,r=Wa(e.toExponential(s-1).split(/[.e]/g)[1]);return Math.max(0,r-t)}))));const r=(0,s.OR)(i);return e=>r(Number(e))}function Ka(e,t,i,r){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0};if(e===t)return{ticks:[e],count:1};const n=10**(0,s.o3)(i),o=Math.min(e,t),a=Math.max(e,t);let l,c;if(null==r||0===r[0]&&1===r[1])l=o,c=a;else{const i=t-e,s=e+i*r[0],n=t-i*(1-r[1]);l=Math.min(s,n),c=Math.max(s,n)}l=Math.floor(l*n)/n,c=Math.ceil(c*n)/n;const h=[];for(let e=0;;e+=1){const t=Math.round((o+i*e)*n)/n;if(t>a)break;t>=l&&t<=c&&h.push(t)}return{ticks:h,count:Ga(o,a,i)}}function $a(e,t){return e>=t&&(s.Vy.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}function Ya(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let r=1/0,n=[e,t];for(const o of Oa){const a=o*s,l=Math.floor(e/a)*a,c=Math.ceil(t/a)*a,h=1-i/Math.abs(c-l);r>h&&(r=h,n=[l,c])}return n}function qa(e,t,i,r,n,o){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,e/(n+1)),i??(i=o),r??(r=e),i>r&&(i===o?i=r:r=i);const a=Math.max(1,Math.floor(e/(t*i))),l=Math.min(a,Math.ceil(e/(t*r)));return{minTickCount:l,maxTickCount:a,tickCount:(0,s.qE)(l,Math.floor(n/t),a)}}var Xa=class e extends cn{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof e}toDomain(e){return new Date(e)}convert(e,t){return e instanceof Date||(e=new Date(e)),super.convert(e,t)}invert(e){return new Date(super.invert(e))}niceDomain(e,t=this.domain){if(t.length<2)return[];let[i,s]=t;const r=this.getPixelRange();for(let t=0;t<4;t++){const[t,n]=Ja(i,s,e,r);if(Zn(i)===Zn(t)&&Zn(s)===Zn(n))break;i=t,s=n}return[i,s]}ticks(e,t=this.domain,i=[0,1],s=!1){const{nice:r,interval:n,tickCount:o=cn.defaultTickCount,minTickCount:a,maxTickCount:l}=e;if(t.length<2)return;const c=t.map(Zn),h=c[0],d=c[c.length-1];return null!=n?{ticks:Qa({start:h,stop:d,interval:n,availableRange:this.getPixelRange(),visibleRange:i,extend:s})??Za({start:h,stop:d,tickCount:o,minTickCount:a,maxTickCount:l,visibleRange:i,extend:s}),count:void 0}:r&&2===o?{ticks:t,count:void 0}:r&&1===o?{ticks:t.slice(0,1),count:void 0}:{ticks:Za({start:h,stop:d,tickCount:o,minTickCount:a,maxTickCount:l,visibleRange:i,extend:s}),count:void 0}}_tickFormatter({domain:e,ticks:t,specifier:i},s){return null!=i?Xn(i):Qn(t,e,s)}tickFormatter(e){return this._tickFormatter(e)}datumFormatter(e){return this._tickFormatter(e,1)}};function Za({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:r,visibleRange:n,extend:o}){const a=Ua(e,t,i,s,r,{weekStart:Pn});return a?a.range(new Date(e),new Date(t),{visibleRange:n,extend:o}):[]}function Qa({start:e,stop:t,interval:i,availableRange:s,visibleRange:r,extend:n}){if(!i)return[];if(i instanceof Cn||"string"==typeof i){const o=Ta(i,new Date(e),new Date(t),{visibleRange:r,extend:n});if($a(o.length,s))return;return o}const o=Math.abs(i);if($a(Math.abs(t-e)/o,s))return;const a=_a.findLast(e=>o%e.duration===0);if(a)return a.timeInterval.every(o/(a.duration/a.step)).range(new Date(e),new Date(t),{visibleRange:r,extend:n});let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return h}function Ja(e,t,i,s){const{interval:r}=i,n=Math.min(Zn(e),Zn(t)),o=Math.max(Zn(e),Zn(t));let a;if(r instanceof Cn)a=r;else if("string"==typeof r)a=r;else{let e;"number"==typeof r&&(e=(o-n)/Math.max(r,1),$a(e,s)&&(e=void 0)),e??(e=i.tickCount??cn.defaultTickCount),a=Ua(n,o,e,i.minTickCount,i.maxTickCount,{weekStart:Pn})}if(null==a)return[e,t];const l=Ta(a,new Date(n),new Date(o),{extend:!0});if(null==l||l.length<2)return[e,t];const c=l[0],h=l[l.length-1];return e<=t?[c,h]:[h,c]}var el=class e extends io{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(t){return t instanceof e}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this.isReversed=e.length>0&&e[0]>e[e.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}normalizeDomains(...e){const t=e.filter(e=>e.length>0);if(0===t.length)return{domain:[],animatable:!1};if(1===t.length){let e=t[0];const i=La(e);return-1===i?e=e.slice().reverse():null==i&&(e=ka(e.slice())),{domain:e,animatable:!0}}return{domain:ka(t.flat()),animatable:!0}}ticks({interval:e,maxTickCount:t},i=this.domain,s=[0,1],r=!1){if(!i.length)return;this.refresh();const{isReversed:n}=this;if(null==e)return{ticks:tl(i,t,n,s,r),count:void 0};const o=i[0].valueOf(),a=i[i.length-1].valueOf(),[l,c]=this.range;let h=Qa({start:o,stop:a,interval:e,availableRange:Math.abs(c-l),visibleRange:s,extend:r})??tl(i,t,n,s,r),d=-1;return h=h.filter(e=>{const t=this.findInterval(e.valueOf()),i=t===d;return d=t,!i}),{ticks:h,count:void 0}}getSortedTimestamps(){let{sortedTimestamps:e}=this;return null==e&&(e??(e=this.bands.map(Zn)),this.sortedTimestamps=e),e}getPrecomputedSteps(){const{domain:e}=this;let{precomputedSteps:t}=this;const i=e.length<1e4?e.length:Math.ceil(e.length/16);if(null!=t||i<=1)return t;const s=this.getSortedTimestamps();t=new Int32Array(i);const r=s[0],n=s[s.length-1]-r,o=s.length-1;for(let e=0;e<t.length;e+=1)t[e]=this.findIntervalInRange(r+e/i*n,0,o);this.precomputedSteps=t}findIntervalInRange(e,t,i){const s=this.getSortedTimestamps();for(;t<=i;){const r=(t+i)/2|0;if(s[r]===e)return r;s[r]<e?t=r+1:i=r-1}return t}findInterval(e){const t=this.getPrecomputedSteps();let i,s;if(null==t)i=0,s=this.domain.length-1;else{const r=this.getSortedTimestamps(),n=r[0],o=r[r.length-1],a=Math.min((e-n)/(o-n)*t.length|0,t.length-1|0);i=t[a],s=a<t.length-2?t[a+1]:r.length-1}return this.findIntervalInRange(e,i,s)}datumFormatter(e){return this.tickFormatter(e)}findIndex(e){const t=this.getSortedTimestamps(),i=Number(e);if(!(i<t[0]))return this.findInterval(i)}};function tl(e,t,i,s,r){const n=[],o=Math.ceil(e.length/t),a=Math.floor(o/2);let l=Math.floor(s[0]*e.length),c=Math.ceil(s[1]*e.length);r&&(l>o&&(l-=o),c<e.length-o&&(c+=o));for(let t=l;t<c;t+=1){const s=i?e.length-1-t:t;(o<=0||(s+a)%o===0)&&n.push(e[t])}return n}var il=class extends dt{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.restoreOwnStyles()}computeBBox(){return new f(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;let{x1:i,y1:s,x2:r,y2:n}=this;i=this.align(i),s=this.align(s),r=this.align(r),n=this.align(n);const{fill:o,horizontal:a}=this,{globalAlpha:l}=t;null!=o&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,s),t.lineTo(r,s),t.lineTo(r,n),t.lineTo(i,n),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:d,endLine:u}=this;if((d||u)&&c&&h){const{lineDash:e,lineDashOffset:o,lineCap:c,lineJoin:p}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,e&&t.setLineDash([...e]),o&&(t.lineDashOffset=o),c&&(t.lineCap=c),p&&(t.lineJoin=p),t.beginPath(),d&&(t.moveTo(i,s),a?t.lineTo(i,n):t.lineTo(r,s)),u&&(t.moveTo(r,n),a?t.lineTo(r,s):t.lineTo(i,n)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};function sl(e){return(0,s.Bf)(e)||(0,s.vd)(e)||function(e){return null!=e&&Object.hasOwn(e,"valueOf")&&(0,s.Bf)(e.valueOf())}(e)}function rl(e){return function(e){return null!=e&&Object.hasOwn(e,"toString")&&(0,s.Kg)(e.toString())}(e)&&Object.hasOwn(e,"id")?e.id:e}function nl(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function ol(e,t){if(null==e)return!1;const i=cn.is(t)||io.is(t),r=e=>function(e,t){return null!=e&&(!t||sl(e))}(e,i)&&!isNaN(t.convert(e));if((0,s.cy)(e)){const[t,i]=e;return r(t)&&r(i)}return r(e)}il.className="Range",il.defaultStyles={...dt.defaultStyles,strokeWidth:1},a([$()],il.prototype,"x1",2),a([$()],il.prototype,"y1",2),a([$()],il.prototype,"x2",2),a([$()],il.prototype,"y2",2),a([$()],il.prototype,"startLine",2),a([$()],il.prototype,"endLine",2),a([$()],il.prototype,"horizontal",2);var al={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},ll={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},cl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},hl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},dl=class extends De{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};a([Te],dl.prototype,"enabled",2),a([Te],dl.prototype,"text",2),a([Te],dl.prototype,"fontStyle",2),a([Te],dl.prototype,"fontWeight",2),a([Te],dl.prototype,"fontSize",2),a([Te],dl.prototype,"fontFamily",2),a([Te],dl.prototype,"padding",2),a([Te],dl.prototype,"color",2),a([Te],dl.prototype,"position",2),a([Te],dl.prototype,"rotation",2),a([Te],dl.prototype,"parallel",2);var ul=class extends De{constructor(){super(),this.id=(0,s.sX)(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new dl,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new At({name:this.id}),this.lineGroup=new At({name:this.id}),this.labelGroup=new At({name:this.id}),this.crossLineRange=new il,this.crossLineLabel=new _i,this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(e){const{enabled:t,type:i,data:s,scale:r}=this;if(!(r&&t&&e&&ol(nl(this),r)&&null!=s))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const n="range"===i;n!==this._isRange&&(n?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=n}calculateLayout(e,t){if(this.data=void 0,!e)return;const{type:i,range:s,value:r,scale:n,clippedRange:o,strokeWidth:a=0}=this;if(!n)return;const l=n.bandwidth??0,c=n.step??0,h=(t?-1:1)*(n instanceof to?(c-l)/2:0);let d,u,p,g;if("line"===i){const e=l/2;d=n.convert(r)+e,u=NaN,p=n.convert(r,{clamp:!0})+e,g=NaN}else{if(!s)return;{const[e,t]=s,i=e?.valueOf()===t?.valueOf()&&el.is(n)?l/2+h:0;d=n.convert(e)+i,u=n.convert(t)+l,p=n.convert(e,{clamp:!0})+i-h,g=n.convert(t,{clamp:!0})+l+h}}p=nn(p,o),g=nn(g,o);const m=(d===p||u===g||p!==g)&&Math.abs(g-p)>0;m&&p>g&&([p,g]=[g,p],[d,u]=[u,d]),d-h>=p&&(d-=h),u+h<=g&&(u+=h),this.startLine=a>0&&d>=p&&d<=p+h,this.endLine=a>0&&u>=g-l-h&&u<=g,("range"!==i||m||this.startLine||this.endLine)&&(this.data=[p,g],!1!==this.label.enabled&&this.label.text)}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:s}=this,r=Number.isFinite(i)?i-t:0;let n;switch(e){case"top":case"bottom":n=new f(t,"top"===e?0:-s,r,s);break;case"left":case"right":n=new f("left"===e?0:-s,t,s,r)}this.updateRangeNode(n);const{label:o}=this;!1!==o.enabled&&o.text&&(this.updateLabel(),this.positionLabel(n))}updateRangeNode(e){const{type:t,position:i,crossLineRange:s,startLine:r,endLine:n,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d}=this;s.x1=e.x,s.x2=e.x+e.width,s.y1=e.y,s.y2=e.y+e.height,s.horizontal="top"===i||"bottom"===i,s.startLine=r,s.endLine=n,s.fill="range"===t?o:void 0,s.fillOpacity=a??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=d}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}get anchor(){const e="left"===this.position||"right"===this.position,t="range"===this.type,{position:i=this.defaultLabelPosition}=this.label;return t?(e?cl:hl)[i]:(e?al:ll)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:s}=this;t.rotation=oe(i.rotation??0),t.textBaseline="middle",t.textAlign="center";const r=t.getBBox();if(!r)return;const{width:n,height:o}=r,a=i.padding+n/2,l=i.padding+o/2,c=e.x+e.width*(s.rangeH+1)/2-a*s.labelH,h=e.y+e.height*(s.rangeV+1)/2-l*s.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(!1===e.enabled||!e.text)return;const t=new _i;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=oe(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:r}=i;return{width:s,height:r}}calculatePadding(e){const{label:t,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:r,height:n}=s,o=t.padding+r,a=t.padding+n,l="left"===this.position||"right"===this.position;l&&(-1===i.rangeH&&1===i.labelH?e.left=Math.max(e.left??0,o):1===i.rangeH&&-1===i.labelH&&(e.right=Math.max(e.right??0,o))),l||(-1===i.rangeV&&1===i.labelV?e.top=Math.max(e.top??0,a):1===i.rangeV&&-1===i.labelV&&(e.bottom=Math.max(e.bottom??0,a)))}};ul.className="CrossLine",a([Te],ul.prototype,"enabled",2),a([Te],ul.prototype,"type",2),a([Te],ul.prototype,"range",2),a([Te],ul.prototype,"value",2),a([Te],ul.prototype,"defaultColorRange",2),a([Te],ul.prototype,"fill",2),a([Te],ul.prototype,"fillOpacity",2),a([Te],ul.prototype,"stroke",2),a([Te],ul.prototype,"strokeWidth",2),a([Te],ul.prototype,"strokeOpacity",2),a([Te],ul.prototype,"lineDash",2),a([Te],ul.prototype,"label",2);var pl=class extends De{constructor(){super(...arguments),this.enabled=!0}getFont(){return Ri.toFontString(this)}};function gl(e,t,i,s,r){const n=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI;if(e){if(!t&&!i)return"center";if(s*(n||o?-1:1)==-1)return"end"}else if(s*r===-1)return"end";return"start"}function ml(e,t){if(null!=e)return"string"==typeof e?e:(0,s.Qd)(e)&&null!=t?e[Ea(t)]:void 0}a([Te],pl.prototype,"enabled",2),a([Te],pl.prototype,"color",2),a([Te],pl.prototype,"fontStyle",2),a([Te],pl.prototype,"fontWeight",2),a([Te],pl.prototype,"fontSize",2),a([Te],pl.prototype,"fontFamily",2),a([Te],pl.prototype,"formatter",2);var fl=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};a([Te],fl.prototype,"enabled",2),a([Te],fl.prototype,"width",2),a([Te],fl.prototype,"style",2);var yl=class extends De{};a([Te],yl.prototype,"step",2),a([Te],yl.prototype,"values",2),a([Te],yl.prototype,"minSpacing",2),a([Te],yl.prototype,"maxSpacing",2);var vl=class extends De{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}getFont(){return Ri.toFontString(this)}};a([Te],vl.prototype,"enabled",2),a([Te],vl.prototype,"fontStyle",2),a([Te],vl.prototype,"fontWeight",2),a([Te],vl.prototype,"fontSize",2),a([Te],vl.prototype,"fontFamily",2),a([Te],vl.prototype,"spacing",2),a([Te],vl.prototype,"minSpacing",2),a([Te],vl.prototype,"color",2),a([Te],vl.prototype,"rotation",2),a([Te],vl.prototype,"avoidCollisions",2),a([Te],vl.prototype,"mirrored",2),a([Te],vl.prototype,"parallel",2),a([Te],vl.prototype,"itemStyler",2),a([Te],vl.prototype,"formatter",2),a([Te],vl.prototype,"format",2);var Cl=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};a([Te],Cl.prototype,"enabled",2),a([Te],Cl.prototype,"width",2),a([Te],Cl.prototype,"stroke",2);var bl=class extends De{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};a([Te],bl.prototype,"enabled",2),a([Te],bl.prototype,"width",2),a([Te],bl.prototype,"size",2),a([Te],bl.prototype,"stroke",2);var Sl=class extends De{constructor(){super(...arguments),this.caption=new Fi,this.enabled=!1,this.spacing=Fi.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};a([Te],Sl.prototype,"enabled",2),a([Te],Sl.prototype,"text",2),a([Te],Sl.prototype,"spacing",2),a([Te],Sl.prototype,"fontStyle",2),a([Te],Sl.prototype,"fontWeight",2),a([Te],Sl.prototype,"fontSize",2),a([Te],Sl.prototype,"fontFamily",2),a([Te],Sl.prototype,"color",2),a([Te],Sl.prototype,"wrapping",2),a([Te],Sl.prototype,"formatter",2);var wl=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(wl||{});function xl(e){const[t,i]=on(e.range),s=Math.floor(t),r=Math.ceil(i);return{min:s,max:r,visible:s!==r}}var El=2*Math.PI,Ml=El/2;function Al(e){const{min:t,max:i}=e,s=e=>e<t||e>i,r={fromFn(e,t,i){let{x1:r,x2:n,y1:o,y2:a}=e,l=e.opacity;return("added"===i||s(t.offset))&&(({x1:r,x2:n,y1:o,y2:a}=t),l=0),{x1:r,x2:n,y1:o,y2:a,opacity:l,phase:oa[i]}},toFn(e,t,i){const{x1:s,x2:r,y1:n,y2:o}=t;let a=1;return"removed"===i&&(a=0),{x1:s,x2:r,y1:n,y2:o,opacity:a}},applyFn(e,t){e.setProperties(t),e.visible=!s(e.y)}},n={fromFn(e,t,i){const r=e.previousDatum??t;let{x:n,y:o,rotationCenterX:a,rotationCenterY:l,rotation:c}=r,h=e.opacity;return"removed"===i||s(r.y)?c=t.rotation:("added"===i||s(e.datum.y))&&(({x:n,y:o,rotationCenterX:a,rotationCenterY:l,rotation:c}=t),h=0),{x:n,y:o,rotationCenterX:a,rotationCenterY:l,rotation:c,opacity:h,phase:oa[i]}},toFn(e,t,i){const{x:s,y:r,rotationCenterX:n,rotationCenterY:o}=t;let a=0,l=1;var c,h;return"added"===i?a=t.rotation:"removed"===i?(l=0,a=t.rotation):(c=e.previousDatum?.rotation??t.rotation,h=t.rotation,a=Math.abs(h-c)<Ml?h:c>h?h+El:h-El),{x:s,y:r,rotationCenterX:n,rotationCenterY:o,rotation:a,opacity:l,finish:{rotation:t.rotation}}}};return{tick:r,line:{fromFn(e,t){const{x1:i,x2:s,y1:r,y2:n}=e.previousDatum??t;return{x1:i,x2:s,y1:r,y2:n,phase:oa.updated}},toFn(e,t){const{x1:i,x2:s,y1:r,y2:n}=t;return{x1:i,x2:s,y1:r,y2:n}}},label:n,group:{fromFn(e,t){const{translationX:i,translationY:s}=e;return{translationX:i,translationY:s,phase:oa.updated}},toFn(e,t){const{translationX:i,translationY:s}=t;return{translationX:i,translationY:s}}}}}function Tl(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function Dl(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function Il(){return(e,t)=>{const{x1:i,x2:s,y1:r,y2:n}=t;return{x1:i,x2:s,y1:r,y2:n}}}var Rl={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Pl={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},kl=/%[-_0]?L/,Ll=/%[-_0]?S/,Nl=/%[-_0]?M/,_l=/%[-_0]?[HI]/,Ol=/^%[-_0]?[de]$/,Fl=/^%[-_0]?[Bbm]$/,Gl=/^%[-_0]?[Yy]$/,Bl=class extends(bt(pa)){},Vl=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(Vl||{}),Hl=class e{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id=(0,s.sX)(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new yl,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new At({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Rt({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Rt({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new At({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new It({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new At({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Rt({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new Rt({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new Rt({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLabelGroupSelection=ua.select(this.tickLabelGroup,_i,!1),this._crossLines=[],this.line=new Cl,this.tick=new bl,this.gridLine=new fl,this.label=this.createLabel(),this.defaultTickMinSpacing=e.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new Sl,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._cachedUnzoomedInputDomain=void 0,this._cachedUnzoomedRangeExtent=NaN,this._cachedUnzoomedTickCount=0,this.moduleMap=new wa,this.range=this.scale.range.slice(),this.crossLines.forEach(e=>this.initCrossLine(e))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(e){const{CrossLineConstructor:t}=this.constructor;this._crossLines.forEach(e=>this.detachCrossLine(e)),this._crossLines=e.map(e=>{const i=new t;return i.set(e),i}),this._crossLines.forEach(e=>{this.attachCrossLine(e),this.initCrossLine(e)})}get crossLines(){return this._crossLines}resetAnimation(e){}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineRangeGroup.removeChild(e.rangeGroup),this.crossLineLineGroup.removeChild(e.lineGroup),this.crossLineLabelGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}updateScale(){const{range:e,visibleRange:t,scale:i}=this,s=(e[1]-e[0])/(t[1]-t[0]),r=s*t[0],n=e[0]-r;i.range=[n,n+s],this.crossLines.forEach(t=>{t.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(e){e.gridNode.removeChild(this.gridGroup),e.axisNode.removeChild(this.axisGroup),e.labelNode.removeChild(this.labelGroup),e.crossLineRangeNode.removeChild(this.crossLineRangeGroup),e.crossLineLineNode.removeChild(this.crossLineLineGroup),e.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(e){this.labelGroup.append(e)}inRange(e,t=0){const[i,s]=on(this.range);return e>=i-t&&e<=s+t}getRangeOverflow(e){const{range:t,visibleRange:i}=this,s=(t[1]-t[0])/(i[1]-i[0]),[r,n]=on([t[0]-s*i[0],t[0]-s*i[0]+s]);return e<r?e-r:e>n?e-n:0}defaultDatumFormatter(e,t){return Fs(e,t+1)}defaultLabelFormatter(e,t){return Fs(e,t)}onGridLengthChange(e,t){t^e&&this.onGridVisibilityChange(),this.crossLines.forEach(e=>this.initCrossLine(e))}onGridVisibilityChange(){}createLabel(){return new vl}update(){this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(e,t,i=this.label){const s={color:i.color,spacing:i.spacing,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight};let r;i.itemStyler&&(r=this.callWithContext(i.itemStyler,{...e,...s}));const{color:n,fontFamily:o,fontSize:a,fontStyle:l,fontWeight:c,spacing:h}=N(r,t,s);return{fill:n,fontFamily:o,fontSize:a,fontStyle:l,fontWeight:c,spacing:h}}getTickSize(e=this.tick){return e.enabled?e.size:0}processData(){const{includeInvisibleDomains:e,boundSeries:t,direction:i}=this,s=(e?t:t.filter(e=>e.isEnabled())).map(e=>e.getDomain(i));this.setDomains(...s)}setDomains(...e){let t,i;e.length>0?({domain:t,animatable:i}=this.scale.normalizeDomains(...e)):(t=[],i=!0),this.dataDomain=this.normaliseDataDomain(t),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=i}calculateLayout(e,t){const{scale:i,label:r,visibleRange:n,nice:o}=this;this.chartPadding=t,this.updateScale();const a=an(this.range),l=this.dataDomain.domain;let c,h,d;if(0===n[0]&&1===n[1])c=void 0,h=void 0;else if(this._cachedUnzoomedInputDomain===l&&this._cachedUnzoomedRangeExtent===a)c=this.scale.domain,h=this._cachedUnzoomedTickCount;else{const e=this.calculateTickLayout(l,o?0:2,[0,1]);c=e.niceDomain,h=e.rawTickCount??0}d=o?null==c?0:1:2;const{niceDomain:u,ticks:p,rawTickCount:g=0,tickDomain:m,fractionDigits:f,bbox:y}=this.calculateTickLayout(c??l,d,n,e);h??(h=g);const v=0!==g&&0!==h?{zoomed:g,unzoomed:h}:void 0,C=Ra.is(i)?i.interval:void 0;this.scale.domain=u,this._cachedUnzoomedInputDomain=l,this._cachedUnzoomedRangeExtent=a,this._cachedUnzoomedTickCount=h;const b=ml(null==C?r.format:function(e,t){if(!(0,s.Qd)(e))return e;const i=Ea(t),{millisecond:r,second:n,minute:o,hour:a,day:l,month:c,year:h}=e,d=Pl[i],u=Rl[i];if(d>=Pl.year&&!Gl.test(h)||d>=Pl.month&&!Fl.test(c)||d>=Pl.day&&!Ol.test(l))return u;let p;switch(i){case"year":return h;case"month":return`${c} ${h}`;case"day":return`${c} ${l} ${h}`;case"hour":p=a;break;case"minute":p=o;break;case"second":p=n;break;case"millisecond":p=r;break;default:return u}return d>=Pl.hour&&!_l.test(p)||d>=Pl.minute&&!Nl.test(p)||d>=Pl.second&&!Ll.test(p)||d>=Pl.millisecond&&!kl.test(p)?u:`${p} ${c} ${l} ${h}`}(r.format,C),C);return this.labelFormatter=i.tickFormatter({domain:m,specifier:b,ticks:p,fractionDigits:f})??(e=>this.defaultLabelFormatter(e,f)),this.datumFormatter=i.datumFormatter({domain:m,specifier:b,ticks:p,fractionDigits:f})??(e=>this.defaultDatumFormatter(e,f)),this.scaleFormatterParams={domain:m,ticks:p,fractionDigits:f},this.layout.label={fractionDigits:f,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:v,bbox:y}}updateCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(t=>{t.update(e)})}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:t,crossLineLabelGroup:i,gridGroup:s,translation:r}=this,n=Math.floor(r.x),o=Math.floor(r.y);s.setProperties({translationX:n,translationY:o}),e.setProperties({translationX:n,translationY:o}),t.setProperties({translationX:n,translationY:o}),i.setProperties({translationX:n,translationY:o})}formatTick(e,t,i,s,r,n){const{labelFormatter:o,label:{formatter:a}}=this;let l;if(a){const n=this.getFormatterBoundSeries(),o=r?Ea(r):void 0,c=r?xa(r).step:void 0;l=this.callWithContext(a,{value:e,index:t,domain:i,fractionDigits:s,unit:o,step:c,boundSeries:n})}else n?l=n(e):o&&(l=o(e));return String(l??e)}formatDatum(e){const{label:{formatter:t},datumFormatter:i=this.labelFormatter}=this;let r;if(t){const{domain:i}=this.scale,s=this.getFormatterBoundSeries();r=this.callWithContext(t,{value:e,index:NaN,domain:i,boundSeries:s})}else i?r=this.callWithContext(i,e):(0,s.cy)(e)&&(r=e.filter(Boolean).join(" - "));return String(r??e)}getScaleValueFormatter(e){const{scaleFormatterParams:t}=this;let i;try{null!=e&&null!=t&&(i=this.scale.tickFormatter({...t,specifier:e}))}catch{s.Vy.warnOnce(`the format string ${e} is invalid, ignoring.`)}return i??(i=e=>this.formatDatum(e)),i}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,t,i,s){this.tickLineGroup.setClipRect(new f(e,t,i,s))}clipGrid(e,t,i,s){this.gridGroup.setClipRect(new f(e,t,i,s))}getFormatterBoundSeries(){const{direction:e}=this,t=[];for(const i of this.boundSeries){const s=i.getKeys(e),r=i.getNames(e);for(let e=0;e<s.length;e++)t.push({key:s[e],name:r[e]})}return t}getTitleFormatterParams(e){const{direction:t}=this;return{domain:e,direction:t,boundSeries:this.getFormatterBoundSeries(),defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e],clipped:!1}}getLayoutState(){return{id:this.id,rect:this.getBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:cn.is(e)||io.is(e),getCanvasBounds:()=>wt.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((e,t)=>(t.getKeyProperties(this.direction).forEach(t=>e.add(t)),e),new Set),seriesIds:()=>this.boundSeries.map(e=>e.id),scaleValueFormatter:e=>this.getScaleValueFormatter(e),scaleInvert:t=>e.invert(t,!0),scaleInvertNearest:t=>e.invert(t,!0),attachLabel:e=>this.attachLabel(e),inRange:(e,t)=>this.inRange(e,t),getRangeOverflow:e=>this.getRangeOverflow(e)}}isReversed(){return this.reverse}callWithContext(e,...t){const{callbackCache:i,chartService:s}=this.moduleCtx;return i.call(this,s,e,...t)}};Hl.defaultTickMinSpacing=50,Hl.CrossLineConstructor=ul,a([Te],Hl.prototype,"nice",2),a([Te],Hl.prototype,"reverse",2),a([Te],Hl.prototype,"keys",2),a([Te],Hl.prototype,"interval",2),a([Te],Hl.prototype,"title",2),a([ci((e,t,i)=>e.onGridLengthChange(t,i))],Hl.prototype,"gridLength",2);var Ul=Hl;function zl(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}var Wl=class{constructor(e){this.axis=e}estimateTickCount(e,t,i){const{scale:s,range:r,defaultTickMinSpacing:n}=this.axis,o=Ra.is(s)?Ra.defaultTickCount:cn.defaultTickCount;return qa(an(r),an(e),t,i,o,n)}filterTicks(e,t){const{minSpacing:i,maxSpacing:s}=this.axis.interval,r=null!=i||null!=s?Math.ceil(e.length/t):2,n=e.length%r?-1:0;return e.filter((e,t)=>(t+n)%r===0)}generateTicks({domain:e,primaryTickCount:t,visibleRange:i,niceMode:s,parallelFlipRotation:r,regularFlipRotation:n,labelX:o,sideFlag:a,removeOverflowLabels:l,removeOverflowThreshold:c=0}){const{scale:h,label:d,primaryLabel:u,interval:{minSpacing:p,maxSpacing:g}}=this.axis,{parallel:m,fontFamily:y,fontSize:v,fontStyle:C,fontWeight:b}=d,S=void 0!==t,{defaultRotation:w,configuredRotation:x,parallelFlipFlag:E,regularFlipFlag:M}=function(e,t,i=0,s=0){const r=de(e),n=!r&&s>=0&&s<=Math.PI?-1:1,o=!r&&i>=0&&i<=Math.PI?-1:1;let a=0;return t?a=n*Math.PI/2:-1===o&&(a=Math.PI),{configuredRotation:r,defaultRotation:a,parallelFlipFlag:n,regularFlipFlag:o}}(d.rotation,m,n,r),{maxTickCount:A}=this.estimateTickCount(i,p,g),T=!cn.is(h)&&!io.is(h)||isNaN(A)?10:A;let D=gl(m,x,0,a,M);const I=function(e,t,i,s,r){return e&&!t?i*s===-1?r?"hanging":"top":"bottom":"middle"}(m,x,a,E,null==u),R=Ri.toFontString({fontFamily:y,fontSize:v,fontStyle:C,fontWeight:b}),P=Di.getMeasurer({font:R}),k={fontFamily:y,fontSize:v,fontStyle:C,fontWeight:b,textBaseline:I,textAlign:D},L=d.enabled&&d.avoidCollisions,N=x+w,_=new pt,O=e=>{const t=N+e;pt.updateTransformMatrix(_,1,1,t,0,0)},F=({ticks:e},t)=>(O(t),function(e,t,i,s){const r=[];for(const{tickLabel:n,translationY:o}of e){if(!n)continue;const{x:e,y:a}=i.transformBBox(new f(t,o,0,0)),{width:l,height:c}=s.measureLines(n);r.push({point:{x:e,y:a},label:{text:n,width:l,height:c}})}return r}(e,o,_,P)),G=(t,i)=>{if(!L)return!1;const s=0!==x||0!==i,r=function(e,t){return null!=e?e:t?0:10}(d.minSpacing,s);return bo(((t,i)=>{const{niceDomain:s,ticks:r,rawTicks:n,timeInterval:a}=t;if(null==a)return[];O(i);const l=function(e){if(e.length<2)return 1/0;let t=0,i=e[0].translationY;for(let s=1;s<e.length;s++){const r=e[s].translationY,n=Math.abs(r-i);t=Math.max(t,n),i=r}return t}(r),{width:c,height:p}=function(e,t,i,s,r,n,o){const a={domain:s,ticks:r,fractionDigits:0,specifier:ml(t.format,n)??("string"==typeof t.format?t.format:void 0)},l=e.tickFormatter(a),c=n?Ma(n):void 0,h=ml(i?.format,c),d=h?e.tickFormatter({...a,specifier:h}):l,u=new Date(s[0]),p=new Date(s[s.length-1]),g=c?.range(new Date(s[0]),new Date(s[s.length-1]),{extend:!0});let m=0,f=0;if(null!=l){let e,t;null!=g&&g.length>1?(e=g[0],t=g[1]):(e=u,t=p);const i=Ta(n,e,t,{limit:50});for(const e of i){const t=l(e),{width:i,height:s}=o.measureLines(t);m=Math.max(m,i),f=Math.max(f,s)}}if(null!=d&&null!=g)for(const e of g){const t=d(e),{width:i,height:s}=o.measureLines(t);m=Math.max(m,i),f=Math.max(f,s)}return{width:Math.ceil(m),height:Math.ceil(f)}}(h,d,u,s??e,n,a,P);return function({width:e,height:t,spacing:i},s,r){const n=[];for(const o of[0,i]){const{x:i,y:a}=r.transformBBox(new f(s,o,0,0));n.push({point:{x:i,y:a},label:{text:void 0,width:e,height:t}})}return n}({width:c,height:p,spacing:l},o,_)})(t,i),r)||bo(F(t,i),r)};let B={tickDomain:[],ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0,niceDomain:void 0},V=0,H=0,U=!0,z=!1;for(;!z&&U&&V<=T;){H=0;for(const r of this.getTickStrategies({domain:e,niceMode:s,secondaryAxis:S,index:V}))({tickData:B,index:V,autoRotation:H,terminate:z}=r({index:V,tickData:B,textProps:k,terminate:z,primaryTickCount:t,visibleRange:i,labelsOverlap:()=>G(B,H)}));U=G(B,H)}D=gl(m,x,H,a,M);const W=x+H;if(l&&B.ticks.length>2){const e=F(B,H),t=B.ticks.at(-1),s=e.at(-1);if(null!=t&&null!=s&&t.translationY+s.label.width/2>this.axis.range[1]+c){t.tickLabel=void 0;const e=B.ticks[0];0===e.translationY&&0===i[0]&&1===i[1]&&(e.tickLabel=void 0)}}return{tickData:B,rotation:W,textBaseline:I,textAlign:D}}getTickStrategies({domain:e,niceMode:t,index:i,secondaryAxis:s}){const{scale:r,label:n,interval:o}=this.axis,{minSpacing:a}=o,l=cn.is(r)||io.is(r),c=n.enabled&&n.avoidCollisions,h=!l&&0!==i&&c,d=!0===n.autoRotate&&void 0===n.rotation,u=[];let p;if(p=o.values?3:s?1:h?2:0,u.push(({index:i,tickData:s,primaryTickCount:r,visibleRange:n,terminate:o})=>this.createTickData(e,t,n,r,p,i,s,o)),!l&&null!=a){const i=({index:i,tickData:s,primaryTickCount:r,visibleRange:n,terminate:o})=>this.createTickData(e,t,n,r,2,i,s,o);u.push(i)}if(c&&d){const e=({index:e,tickData:t,labelsOverlap:i,terminate:s})=>({index:e,tickData:t,autoRotation:i()?de(n.autoRotateAngle):0,terminate:s});u.push(e)}return u}ticksEqual(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}createTickData(e,t,i,s,r,n,o,a){const{scale:l,interval:c}=this.axis,{step:h,values:d,minSpacing:u,maxSpacing:p}=c,{maxTickCount:g,minTickCount:m,tickCount:f}=this.estimateTickCount(i,u,p),y=cn.is(l)||io.is(l),v=!y||isNaN(g)?10:g,C=e=>y?Math.max(f-e,m):g,b=o.rawTicks,S=null==h&&null==d&&C(n)>m&&(y||2===r),w={domain:e,niceMode:t,visibleRange:i,primaryTickCount:s,tickGenerationType:r,previousTicks:b,minTickCount:m,maxTickCount:g,tickCount:0};if(w.tickCount=C(n),o=this.getTicks(w),S&&this.ticksEqual(o.rawTicks,b)){let e=n,t=v;for(;e<=t;)n=(e+t)/2|0,w.tickCount=C(n),o=this.getTicks(w),this.ticksEqual(o.rawTicks,b)?e=n+1:t=n-1}return a||(a=null!=h||null!=d),{tickData:o,index:n+=1,autoRotation:0,terminate:a}}getTimeIntervalTicks(e,t,i){const r=Ma(i);if(null==r)return;const{scale:n,reverse:o}=this.axis;if(!Xa.is(n)&&!io.is(n))return;o&&(e=[1-e[1],1-e[0]]);const a=Math.min(n.domain[0].valueOf(),n.domain[n.domain.length-1].valueOf()),l=Math.max(n.domain[0].valueOf(),n.domain[n.domain.length-1].valueOf());let[c,h]=Cn.extent(new Date(a),new Date(l),e);c=r.floor(c),c.valueOf()>=a&&(c=r.previous(c)),h=r.ceil(h),h.valueOf()<=l&&(h=r.next(h));const d=r.range(c,h),u=Aa(i),p=Ra.is(n)&&null!=n.interval&&Aa(n.interval)<u;let g,m=new Set;if(Xa.is(n)||Ra.is(n)){g=[];const e={...t,interval:i},r=!Ra.is(n)||p;for(let t=0;t<d.length-1;t+=1){const i=d[t],o=d[t+1],c=t===d.length-2,h=o.valueOf()-i.valueOf(),p=[Math.max((a-i.valueOf())/h,0),Math.min((l-i.valueOf())/h,1)],f=r?this.timeScaleTicks(e,[i,o],p,!0):n.ticks(e,[i,o],p,!0)?.ticks??[];if((0,s.nm)(f,e=>e.valueOf()<i.valueOf()),c||(0,s.xA)(f,e=>r?e.valueOf()+u>o.valueOf():e.valueOf()>=o.valueOf()),0===f.length)continue;const y=Pa(f[0],i);(r?0===y:y<=u)&&m.add(g.length),g.push(...f)}}else if(el.is(n)){g=n.ticks(t,void 0,e,!0)?.ticks??[];let i=0;for(let e=0;e<g.length;e++){const t=g[e];let s=!1;for(;i<d.length&&Pa(d[i],t)<=0;)s=!0,i++;s&&m.add(e)}}else g=[];return(0===m.size||1===m.size&&m.has(0))&&(m=void 0),{ticks:g,tickCount:void 0,primaryTicksIndices:m,interpolate:p}}timeScaleTicks(e,t,i,s){const{interval:r}=e;if(null==r)return t;const n=t[0].valueOf(),o=t[1].valueOf();if("number"!=typeof r)return xa(r).every(1,{snapTo:t[0]}).range(t[0],t[1],{visibleRange:i,extend:s});const a=[];for(let e=n;e<=o;e+=r){const t=new Date(e);a.push(t)}return a}getTicks({domain:e,niceMode:t,visibleRange:i,tickGenerationType:r,previousTicks:n,tickCount:o,minTickCount:a,maxTickCount:l,primaryTickCount:c}){const{axis:h}=this,{label:d,primaryLabel:u,range:p,scale:g,interval:m}=h,f=zl(),y={nice:0===t,interval:m.step,tickCount:o,minTickCount:a,maxTickCount:l},v={...y,nice:0===t||1===t};let C;1===r&&null!=c&&cn.is(g)&&(C=function(e,t,i,r,n){let[o,a]=on(t.map(Number));const l=Math.floor(i.unzoomed);if(l<=1){const[t,i]=function(e,t){let i=e,s=t,r=0;do{[i,s]=Ya(i,s);const{ticks:e}=Ba(i,s,5);if(e.length%2==1)return[i,s];i-=1,s+=1}while(r++<10);return[e,t]}(o,a),s=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:l}=Ba(t,i,s,void 0,void 0,n),c=[e.toDomain(t),e.toDomain(i)];return r&&c.reverse(),{domain:c,ticks:l}}if(o===a){const e=Math.floor(Math.log10(o)),t=Math.pow(10,e),i=Math.min(t,1),s=l-1;o-=i*Math.floor(s/2),a=o+i*s}let c=o,h=a;c=function(e,t,i){e=Math.floor(e);const s=Math.abs(t-e)/(i-1),r=Math.floor(Math.log10(s)),n=Math.pow(10,r);return Math.floor(e/n)*n}(c,h,l);const d=function(e,t,i){return function(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/i;return s>0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:e}((t-e)/(i-1))}(c,h,l);h=c+(l-1)*d;const u=Math.floor(c/d)*d,p=Math.floor(h/d)*d;u<=o&&p>=a&&(c=u,h=p);const g=[e.toDomain(c),e.toDomain(h)];r&&g.reverse();const m=function(e,t,i){const r=(0,s.o3)(t),n=Math.pow(10,r),o=[];for(let s=0;s<i;s++){const i=e+t*s;o.push(Math.round(i*n)/n)}return o}(c,d*((i.unzoomed-1)/(i.zoomed-1)),Math.floor(i.zoomed));return{domain:g,ticks:m}}(g,e,c,h.reverse,i));const b=0===t?C?.domain??g.niceDomain(y,e):e;let S,w,x,E,M=b,A=!1;const T=g.domain;switch(g.domain=b,r){case 3:if(M=m.values,S=m.values,w=S.length,A=Ra.is(g),cn.is(g)){const[e,t]=on(b.map(Number));S=S.filter(i=>Number(i)>=e&&Number(i)<=t).sort((e,t)=>Number(e)-Number(t))}break;case 1:if(C)S=C.ticks,w=C.ticks.length;else{const e=g.ticks(v,b,i);S=e?.ticks??[],w=e?.count}break;case 2:S=this.filterTicks(n,o),w=void 0;break;default:{if(b.length>0&&null==v.interval&&(Ra.is(g)||null!=u&&(Xa.is(g)||el.is(g)))){const e=b;x=Ua(Math.min(e[0].valueOf(),e[e.length-1].valueOf()),Math.max(e[0].valueOf(),e[e.length-1].valueOf()),o,a,l,{weekStart:null==u?Pn:void 0,primaryOnly:Ra.is(g)})}const e=Ra.is(g)?g.interval:void 0;null!=e&&null!=x&&Aa(e)>Aa(x)&&(x=e);const t=x?this.getTimeIntervalTicks(i,v,x):void 0;if(t)({ticks:S,tickCount:w,primaryTicksIndices:E,interpolate:A}=t);else{const e=Ra.is(g)&&null!=x?{...v,interval:v.interval??x}:v,t=g.ticks(e,b,i);S=t?.ticks??[],w=t?.count}}}const D=S.reduce((e,t)=>Math.max(e,"number"==typeof t?(0,s.o3)(t):0),0),I={domain:M,ticks:S,fractionDigits:D,specifier:ml(d.format,x)??("string"==typeof d.format?d.format:void 0)},R=g.tickFormatter(I),P=ml(u?.format,x?Ma(x):void 0),k=P?g.tickFormatter({...I,specifier:P}):R,L=(g.bandwidth??0)/2,N=[];for(let e=0;e<S.length;e++){const t=S[e],i=g.convert(t,{interpolate:A})+L,s=E?.has(e)??!1;if(p.length>0&&!h.inRange(i,.001))continue;const r=s&&!0===u?.enabled?k:R,n=d.enabled?h.formatTick(t,e,b,D,x,r):"";N.push({tick:t,tickId:f(n),tickLabel:n,translationY:Math.floor(i),primary:s})}return g.domain=T,{tickDomain:M,rawTicks:S,rawTickCount:w,fractionDigits:D,timeInterval:x,ticks:N,niceDomain:b}}},jl=class extends vl{constructor(){super(...arguments),this.autoRotateAngle=335}};a([Te],jl.prototype,"autoRotate",2),a([Te],jl.prototype,"autoRotateAngle",2);var Kl=class e extends Ul{constructor(e,t){let i;super(e,t),this.headingLabelGroup=this.axisGroup.appendChild(new It({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new It({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new pa({zIndex:1})),this.tickLineGroupSelection=ua.select(this.tickLineGroup,pa,!1),this.gridLineGroupSelection=ua.select(this.gridLineGroup,pa,!1),this.tempText=new _i({debugDirty:!1}),this.tempCaption=new Fi,this.tickGenerator=new Wl(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new ba("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:e=>this.animateReadyUpdate(e),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node),this.destroyFns.push(e.layoutManager.addListener("layout:complete",e=>{const t=[e.chart.width,e.chart.height];null==i||(0,s.r1)(t,i)||this.animationState.transition("resize"),i=t}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof e}get primaryLabel(){}get primaryTick(){}get horizontal(){return"top"===this.position||"bottom"===this.position}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}resetAnimation(e){"initial"===e&&this.animationState.transition("reset")}get direction(){return"top"===this.position||"bottom"===this.position?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new jl}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,t){return this.updateDirection(),super.calculateLayout(e,t)}layoutCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(t=>{t.calculateLayout?.(e,this.reverse)})}calculateTickLayout(e,t,i,s){const r=this.label.getSideFlag(),n=this.horizontal?-.5*Math.PI:0,o=ie(n),a=ie(n-Math.PI/2),l=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(2===t&&!1===this.label.enabled&&!1===this.tick.enabled&&!1===this.gridLine.enabled){const{bbox:t,spacing:i}=this.tickBBox(e,[],[]);return this.generatedTicks={ticks:[],tickLines:[],gridLines:[],labels:[],spacing:i},{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:t}}const c=this.horizontal&&cn.is(this.scale),h=this.tickGenerator.generateTicks({domain:e,niceMode:t,visibleRange:i,primaryTickCount:s,parallelFlipRotation:o,regularFlipRotation:a,labelX:l,sideFlag:r,removeOverflowLabels:c,removeOverflowThreshold:this.chartPadding?.right}),{tickData:d}=h,{ticks:u,tickDomain:p,rawTicks:g,rawTickCount:m,fractionDigits:f,timeInterval:y,niceDomain:v=e}=d,C=u.map(e=>this.getTickLabelProps(e,h)),{position:b,horizontal:S,gridPadding:w,gridLength:x}=this,E="bottom"===b||"right"===b?-1:1,M=w,A=E*x-w,{gridLine:T}=this,D=u.map(({tickId:e,translationY:t},i)=>{const[s,r,n,o]=S?[t,M,t,A]:[M,t,A,t],{style:a,width:l}=T,{stroke:c,lineDash:h}=a[i%a.length]??{};return{tickId:e,offset:t,x1:s,y1:r,x2:n,y2:o,stroke:c,strokeWidth:l,lineDash:h}}),{tick:I,primaryTick:R}=this,P=u.map(({primary:e,tickId:t,translationY:i})=>{const s=e&&R?.enabled?R:I,r=-E*this.getTickSize(s),[n,o,a,l]=S?[i,0,i,r]:[0,i,r,i],{stroke:c,width:h}=s;return{tickId:t,offset:i,x1:n,y1:o,x2:a,y2:l,stroke:c,strokeWidth:h,lineDash:void 0}}),{bbox:k,spacing:L}=this.tickBBox(p,u,C);return this.generatedTicks={ticks:u,gridLines:D,tickLines:P,labels:C,spacing:L},{ticks:g,rawTickCount:m,tickDomain:p,niceDomain:v,fractionDigits:f,timeInterval:y,bbox:k}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),e=>e.datum.tickId);super.update(),this.tickLineGroup.visible=this.tick.enabled||(this.primaryTick?.enabled??!1),this.tickLabelGroup.visible=this.label.enabled||(this.primaryTick?.enabled??!1);const{generatedTicks:t}=this;if(this.updateTitle(this.scale.domain,t?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:t}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const i=t.map(e=>e.tickId),r=(0,s.E3)(e,i);this.animationState.transition("update",r)}}const{enabled:i,stroke:r,width:n}=this.line;this.lineNode.setProperties({stroke:r,strokeWidth:i?n:0}),this.updateTickLines(),this.updateGridLines()}getAxisTransform(){return{translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}getAxisLineCoordinates(){const{horizontal:e}=this,[t,i]=on(this.range);return e?{x1:t,x2:i,y1:0,y2:0}:{x1:0,x2:0,y1:t,y2:i}}getTickLineBBox(e){const{position:t,primaryTick:i}=this,s=Math.max(this.getTickSize(),i?.enabled?this.getTickSize(i):0),{translationY:r}=e;switch(t){case"top":return new f(r,-s,r,s);case"bottom":return new f(r,0,r,s);case"left":return new f(-s,r,s,r);case"right":return new f(0,r,s,r)}}lineNodeBBox(){const{position:e,seriesAreaPadding:t}=this,{y1:i,y2:s}=this.getAxisLineCoordinates(),r=s-i;switch(e){case"top":return new f(i,-t,r,t);case"bottom":return new f(i,0,r,t);case"left":return new f(-t,i,t,r);case"right":return new f(0,i,t,r)}}titleBBox(e,t){const{tempCaption:i}=this;return i.node.setProperties(this.titleProps(i,e,t)),i.node.getBBox()}tickBBox(e,t,i){const{tick:r,primaryTick:n,label:o,primaryLabel:a,title:l,position:c,horizontal:h,seriesAreaPadding:d}=this,u=[];if(u.push(this.lineNodeBBox()),r.enabled||n?.enabled)for(const e of t)u.push(this.getTickLineBBox(e));const{tempText:p}=this;if(o.enabled)for(const e of i){if(!e.visible)continue;p.setProperties(e);const t=p.getBBox();t&&u.push(t)}if(a?.enabled&&null!=a.format&&"bottom"===c){const{fontSize:e,format:t}=a,i=((0,s.Qd)(t)?Object.values(t):[t]).reduce((e,t)=>Math.max(e,(0,s.lt)(t)),0),o=this.getTickSize(n??r)+a.spacing+d,l=2,c=i*Ri.getLineHeight(e)+l;u.push(new f(0,o,1,c))}let g=0;if(l.enabled){const t=f.merge(u);g=h?t.height:t.width,u.push(this.titleBBox(e,g))}return{bbox:f.merge(u),spacing:g}}titleProps(e,t,i){const{title:s}=this;if(!s.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping;const r=(s.spacing??0)+i,{range:n}=this,o=(n[0]+n[1])/2;let a,l,c,h;switch(this.position){case"top":a=o,l=-r,c=0,h="bottom";break;case"bottom":a=o,l=r,c=0,h="top";break;case"left":a=-r,l=o,c=-.5*Math.PI,h="bottom";break;case"right":a=r,l=o,c=.5*Math.PI,h="bottom"}const{formatter:d=e=>e.defaultValue}=s,u=this.callWithContext(d,this.getTitleFormatterParams(t));return e.text=u,{visible:!0,text:u,textBaseline:h,x:a,y:l,rotationCenterX:a,rotationCenterY:l,rotation:c}}getTickLabelProps(e,t){const{horizontal:i,primaryLabel:s,primaryTick:r,seriesAreaPadding:n,scale:o}=this,{tickId:a,tickLabel:l="",translationY:c,primary:h}=e,d=h&&s?.enabled?s:this.label,u=h&&r?.enabled?r:this.tick,{rotation:p,textBaseline:g,textAlign:m}=t,{range:f}=o,y=this.label.getSideFlag()*(this.getTickSize(u)+d.spacing+n),v=""!==l,C=i?c:y,b=i?-y:c;return{...this.getLabelStyles({value:l},void 0,d),tickId:a,rotation:p,text:l,textAlign:m,textBaseline:g,visible:v,x:C,y:b,rotationCenterX:C,rotationCenterY:b,range:f}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{tickLines:t,gridLines:i,labels:s}=this.generatedTicks,r=e=>e.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLine.enabled?i:[],void 0,r),this.tickLineGroupSelection.update(t,void 0,r),this.tickLabelGroupSelection.update(s,void 0,r)}updateGridLines(){this.gridLineGroupSelection.each((e,t)=>{e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.lineDash=t.lineDash})}updateTickLines(){this.tickLineGroupSelection.each((e,t)=>{e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.lineDash=t.lineDash})}updateTitle(e,t){const{caption:i}=this.title,s=this.titleProps(i,e,t);i.node.visible=s.visible,i.node.text=s.text,i.node.textBaseline=s.textBaseline,i.node.datum=s}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,t)=>{e.fill=t.fill,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center"})}animateReadyUpdate(e){const{animationManager:t}=this.moduleCtx,i=Al(xl(this));aa(this.id,"axis-group",t,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],i.group),aa(this.id,"line",t,[this.lineNode],i.line),aa(this.id,"line-paths",t,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(e,t)=>t.tickId,e),aa(this.id,"tick-labels",t,[this.tickLabelGroupSelection],i.label,(e,t)=>t.tickId,e),aa(this.id,"title",t,[this.title.caption.node],i.label,(e,t)=>t.tickId,e)}resetSelectionNodes(){da([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],(e,t)=>({translationX:t.translationX,translationY:t.translationY})),da([this.gridLineGroupSelection,this.tickLineGroupSelection],(e,t)=>{const{x1:i,x2:s,y1:r,y2:n}=t;return{x1:i,x2:s,y1:r,y2:n}}),da([this.tickLabelGroupSelection],(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})),da([this.title.caption.node],(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})),da([this.lineNode],(e,t)=>{const{x1:i,x2:s,y1:r,y2:n}=t;return{x1:i,x2:s,y1:r,y2:n}})}};a([Te],Kl.prototype,"thickness",2),a([Te],Kl.prototype,"position",2);var $l=Kl,Yl=["top","right","bottom","left"];function ql(e){return"string"==typeof e&&Yl.includes(e)}var Xl=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function Zl(e){const{series:t}=e;return t?.[0]?.type??"line"}function Ql(e){const t=Zl(e);return Qo.isCartesian(t)||function(e){const t=$o(e)?.find(e=>"cartesian"===e);return"cartesian"===t}(t)}function Jl(e){const t=Zl(e);return Qo.isPolar(t)||function(e){const t=$o(e)?.find(e=>"polar"===e);return"polar"===t}(t)}function ec(e){const t=Zl(e);return Qo.isHierarchy(t)||function(e){const t=$o(e)?.find(e=>"hierarchy"===e);return"hierarchy"===t}(t)}function tc(e){const t=Zl(e);return Qo.isTopology(t)||function(e){const t=$o(e)?.find(e=>"topology"===e);return"topology"===t}(t)}function ic(e){const t=Zl(e);return Qo.isFlowProportion(t)||function(e){const t=$o(e)?.find(e=>"flow-proportion"===e);return"flow-proportion"===t}(t)}function sc(e){const t=Zl(e);return Qo.isStandalone(t)||function(e){const t=$o(e)?.find(e=>"standalone"===e);return"standalone"===t}(t)}function rc(e){const t=Zl(e);return Qo.isGauge(t)||function(e){const t=$o(e)?.find(e=>"gauge"===e);return"gauge"===t}(t)}var nc=class extends wa{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&Re(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())"legend"===e.type&&(yield{legendType:e.identifier,legend:t})}},oc="ag-charts-overlay",ac="ag-charts-dark-overlay",lc=class extends De{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return e.t(this.text??this.defaultMessageId)}getElement(e,t,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const e=this.renderer();if(e instanceof HTMLElement)this.content=e;else{const t=(0,s.n)("div");t.innerHTML=e;const{firstElementChild:i}=t;i instanceof HTMLElement&&1===t.childElementCount?this.content=i:this.content=t}}else{const i=(0,s.n)("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});i.innerText=this.getText(t),this.content=i,e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){i.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};a([Te],lc.prototype,"enabled",2),a([Te],lc.prototype,"text",2),a([Te],lc.prototype,"renderer",2);var cc=class extends De{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new lc("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new lc("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new lc("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new lc("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(void 0!==t.focusBox)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};a([Te],cc.prototype,"darkTheme",2),a([Te],cc.prototype,"loading",2),a([Te],cc.prototype,"noData",2),a([Te],cc.prototype,"noVisibleSeries",2),a([Te],cc.prototype,"unsupportedBrowser",2);var hc=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(hc||{}),dc=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(dc||{});function uc(e,t,i,s){if(nt(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse};if(at(e)){const t=e.pattern??i.pattern;let s=e.strokeWidth;return"backward-slanted-lines"===t||"forward-slanted-lines"===t||"horizontal-lines"===t||"vertical-lines"===t?s??(s=i.strokeWidth):s??(s=0),{type:"pattern",pattern:t,width:e.width??e.height??i.width,height:e.height??e.width??i.height,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:s,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return lt(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function pc(e,t,i,s){return nt(e?.fill)||at(e?.fill)||lt(e?.fill)?{...e,fill:uc(e.fill,t,i,s)}:e}function gc(e,t,i,s){null!=i&&nt(t)&&null!=t.bounds&&"item"!==t.bounds?e.fillBBox=i[t.bounds]:e.fillBBox=void 0,e.fillParams=s}function mc(e,t,i,s,r){const n=i?.fill??t.fill;e.fill=n,gc(e,i?.fill??t.fill,s,r),e.fillOpacity=i?.fillOpacity??t.fillOpacity??1,e.stroke=i?.stroke??t.stroke,e.strokeOpacity=i?.strokeOpacity??t.strokeOpacity??1,e.strokeWidth=i?.strokeWidth??t.strokeWidth??0,e.lineDash=i?.lineDash??t.lineDash,e.lineDashOffset=i?.lineDashOffset??t.lineDashOffset??0}var fc=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(fc||{}),yc=class{constructor(e,t,i,s){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},vc=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},Cc=class extends si{constructor(e){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=yc,this.internalId=(0,s.sX)(this),this.contentGroup=new It({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new It({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new It({name:`${this.internalId}-annotation`}),this.labelGroup=new It({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new wa,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new Qi,this._pickNodeCache=new Ti;const{moduleCtx:t,pickModes:i,directionKeys:r={},directionNames:n={},canHaveAxes:o=!1,usesPlacedLabels:a=!1}=e;this.ctx=t,this.directionKeys=r,this.directionNames=n,this.canHaveAxes=o,this.usesPlacedLabels=a,this.highlightGroup=new It({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new At({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new At({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:r}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:r,seriesGrouping:t}),this.fireEvent(new vc(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){e?.removeChild(this.contentGroup),t.removeChild(this.highlightGroup),t.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(e){return e!==this._declarationOrder&&(this._declarationOrder=e,this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e,!0)}renderToOffscreenCanvas(){return!1}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}addListener(e,t){return this.seriesListeners.addListener(e,t)}dispatch(e,t){this.seriesListeners.dispatch(e,t)}addChartEventListeners(){}updatedDomains(){}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(e,t){const i=this.resolveKeyDirection(e),s=t?.[i],r=[];if(!s)return r;const n=(...e)=>{for(const t of e)Array.isArray(t)?n(...t):"object"==typeof t?n(...Object.values(t)):r.push(t)};return n(...s.map(e=>this.properties[e])),r}getKeys(e){return this.getDirectionValues(e,this.directionKeys)}getKeyProperties(e){return this.directionKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getDirectionValues(e,this.directionNames)}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(t=>t.getDomain(e)).flat();return 0!==i.length?t.concat(i):t}getRange(e,t){return this.getSeriesRange(e,t)}getVisibleItems(e,t,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:t=!0}=this.properties.highlightStyle.series;if(!t||1===e)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return e}}getStrokeWidth(e){const{strokeWidth:t,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===t)return e;switch(this.isItemIdHighlighted()){case 1:return t;case 0:case 2:return e}}isItemIdHighlighted(){const e=this.ctx.highlightManager?.getActiveHighlight()?.series;return null==e?0:e!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:s,pickModeAxis:r,visible:n,contentGroup:o}=this;if(!n||!o.visible)return;if("highlight"===t&&!this.properties.highlight.enabled)return;if("highlight-tooltip"===t&&!this.properties.highlight.enabled)return;let a=1/0;if("tooltip"===t||"highlight-tooltip"===t){const{tooltip:e}=this.properties;a="number"==typeof e.range?e.range:1/0,i||(i="exact"===e.range)}else if("event"===t||"context-menu"===t){const{nodeClickRange:e}=this.properties;a="number"==typeof e?e:1/0,i||(i="exact"===e)}const l=s.filter(e=>!i||0===e),{x:c,y:h}=e,d=JSON.stringify({x:c,y:h,maxDistance:a,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const t of l){let i;switch(t){case 0:{const t=this.pickNodesExactShape(e);i=0===t.length?void 0:{datums:t,distance:0};break}case 1:{const t=this.pickNodeClosestDatum(e),s=0===t?.distance?this.pickNodesExactShape(e):void 0;i=null!=s&&0!==s.length?{datums:s,distance:0}:t?{datums:[t.datum],distance:t.distance}:void 0;break}case 2:{const t=null!=r?this.pickNodeMainAxisFirst(e,"main-category"===r):void 0;i=null!=t?{datums:[t.datum],distance:t.distance}:void 0;break}}if(i&&i.distance<=a)return this._pickNodeCache.set(d,{pickMode:t,datums:i.datums,distance:i.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const e=i.closestDatum();null!=e&&!0!==e.missing&&t.push(e)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=p(e.x,e.y,t),s=i.nearest?.closestDatum();if(null!=s&&!0!==s.missing)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:s,legendItemName:r}=t??{};this.toggleSeriesItem(i,e,s,r)}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendType:r}=e,n="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=null!=n&&n===e.legendItemName;(s.id===this.id||a||null!=o)&&this.toggleSeriesItem(t,r,i,n,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:r,legendType:n}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=null!=o&&o===e.legendItemName;s.id===this.id||l||null!=a?this.toggleSeriesItem(!0,n,i,o,e):t&&1===r?this.toggleSeriesItem(!0,n,void 0,o):this.toggleSeriesItem(!1,n,void 0,o)}toggleSeriesItem(e,t,i,s,r){const n=this.id;(e||"category"!==t)&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:n,itemId:i,legendItemName:r?.legendItemName??s,visible:e};this.fireEvent(o),this.ctx.legendManager.toggleItem(e,n,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(e,t,i=Fs){return e.formatter?this.cachedCallWithContext(e.formatter,{seriesId:this.id,...t})??this.callWithContext(i,t.value):this.callWithContext(i,t.value)}getMarkerStyle(e,t,i,s=!1,r=e.size??0,n){const{itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=e;let h=pc(N({size:r},n,e.getStyle()),a,l,c);return o&&i&&(h=pc(N(this.cachedCallWithContext(o,{seriesId:this.id,...h,...i,highlighted:s,datum:t}),h),a,l,c)),h}updateMarkerStyle(e,t,i,s,r,n,o,a,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(e,i,r,n,s?.size,o),{shape:d,size:u}=h,p=this.visible&&u>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(mc(t,h,void 0,a),l?t.setProperties({visible:p,shape:d,size:u,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):t.setProperties({visible:p,shape:d,size:u}),c||(t.fillOpacity*=.25,t.strokeOpacity*=.125),"function"==typeof e.shape&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const e=t.getBBox();if(void 0!==s&&e.isFinite()){const t=e.computeCenter(),[i,r]=["x","y"].map(e=>(h.strokeWidth??0)+Math.abs(t[e]-s[e]));s.focusSize=Math.max(e.width+i,e.height+r)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=e??{width:NaN,height:NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,r=null!=Ft(this.nodeDataDependencies,s);return r&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),r}pickFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,r=i.get(e);if(null!=r)return r;try{const s=t();return i.set(e,s),s}catch(e){s.Vy.error(String(e))}}cachedCallWithContext(e,...t){return this.ctx.callbackCache.call(this.properties,this.ctx.chartService,e,...t)}callWithContext(e,...t){return ur(this.properties,this.ctx.chartService,e,t)}formatTooltipWithContext(e,t,i){return e.formatTooltip(this.properties,this.ctx.chartService,t,i)}};a([li({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Cc.prototype,"seriesGrouping",2);var bc=class extends dt{constructor(){super(...arguments),this.path=new Je,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(!this.clip||isNaN(this._clipX)||isNaN(this._clipY))this._clipPath=void 0,this.drawPath(t);else{t.save();const e=this.strokeWidth/2;this._clipPath??(this._clipPath=new Je),this._clipPath.clear(),this._clipPath.rect(-e,-e,this._clipX+e,this._clipY+e+e),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t),t.restore()}this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,s.FJ)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};bc.className="Path",a([$()],bc.prototype,"clip",2),a([$()],bc.prototype,"clipX",1),a([$()],bc.prototype,"clipY",1);var Sc=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=(0,s.n)("div"),this.svg=(0,s.FJ)("svg"),this.outerPath=(0,s.FJ)("path"),this.innerPath=(0,s.FJ)("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=(0,s.n)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(e,t,i){if(null!=t)if(e instanceof bc){const i=(i,s)=>{let{x:r,y:n}=wt.toCanvasPoint(e,i,s);return r-=t.x??0,n-=t.y??0,{x:r,y:n}},s=e.svgPathData(i);this.outerPath.setAttribute("d",s),this.innerPath.setAttribute("d",s),this.show(this.svg)}else{let s;if(i){const i=Math.max(e.x-t.x,0),r=Math.max(e.y-t.y,0),n=Math.min(e.x+e.width-t.x,t.width),o=Math.min(e.y+e.height-t.y,t.height);s=new f(i,r,n-i,o-r)}else s=new f(e.x-t.x,e.y-t.y,e.width,e.height);Pt(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t=this.element.parentElement;t?.style.setProperty("opacity",{true:"1",false:"0",undefined:""}[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return null!=t&&"1"===(0,s.zk)().getComputedStyle(t).opacity}},wc=class{constructor(e,t,i){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=e=>((0,s.EM)(e.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",e)),this.onFocus=e=>((0,s.EM)(e.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",e)),(0,s.Bq)(this.label1,"id",(0,s.wW)()),(0,s.Bq)(this.label2,"id",(0,s.wW)()),(0,s.EM)(this.label1,"display","none"),(0,s.EM)(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),(0,s.Bq)(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(e){const t=(0,s.n)("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),"swap"===e&&t(this.activeAnnouncer)}dispatch(e,t){"focus"===e?this.hasFocus=!0:"blur"===e&&(this.hasFocus=!1),this.listeners[e].forEach(e=>e(t))}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],(0,s.Wp)(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),(0,s.Wp)(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},xc={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function Ec(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(!(i.key!==e.key||void 0!==i.shift&&i.shift!==e.shiftKey||void 0!==i.ctrlOrMeta&&i.ctrlOrMeta!==e.ctrlKey&&i.ctrlOrMeta!==e.metaKey))return!0;return!1}function Mc(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");s.Vy.warnOnce(i)}}function Ac(e,t){const i=Mc(),s=t?.default;return T((t,r,n)=>(n!==s&&i(r.toString(),e),n))}function Tc(e,t){const i=Mc();return T((s,r,n)=>(n!==s[e]&&(i(r.toString(),`Use [${e}] instead.`),H(s,e,t?t(n):n)),x),(t,s)=>(i(s.toString(),`Use [${e}] instead.`),B(t,e)))}function Dc(e,t,i,s){let{top:r,right:n,bottom:o,left:a,width:l,height:c}=s;return null!=a?null!=l?n=i.width-a+l:null!=n&&(l=i.width-a-n):null!=n&&null!=l&&(a=i.width-n-l),null!=r?null!=c?o=i.height-r-c:null!=o&&(c=i.height-o-r):null!=o&&null!=c&&(r=i.height-o-c),null==l?null==c?(l=e,c=t):l=Math.ceil(e*c/t):null==c&&(c=Math.ceil(t*l/e)),null==a&&(a=null==n?Math.floor((i.width-l)/2):i.width-n-l),null==r&&(r=null==o?Math.floor((i.height-c)/2):i.height-c-o),{x:a,y:r,width:l,height:c}}var Ic=class extends Qi{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,null!=this.animationFrameHandle&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y))return this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),void(null!=this.animationFrameHandle&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0));this.x1=e,this.y1=t,this.t0=Date.now(),null==this.animationFrameHandle&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),r=s-i;this.t0=s;const n=.001,o=0|Math.ceil(r/1);let{x:a,y:l,vx:c,vy:h}=this;for(let i=0;i<o;i+=1)c+=-(200*(a-e)+12*c)/.1*n,h+=-(200*(l-t)+12*h)/.1*n,a+=c*n,l+=h*n;Math.hypot(a-e,l-t)<.5?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=a,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.dispatch("update",{type:"update",x:this.x,y:this.y})}},Rc=null;function Pc(e){return""===e?"":(Rc??(Rc=(0,s.n)("div")),Rc.textContent=String(e),Rc.innerHTML.replace(/\n/g,"<br>"))}function kc(e,t){const{path:i,size:s}=e,{x:r,y:n}=e;i.clear();let o=!1;for(const[e,a]of t){const t=r+(e-.5)*s,l=n+(a-.5)*s;o?i.lineTo(t,l):i.moveTo(t,l),o=!0}i.closePath()}var Lc={circle({path:e,x:t,y:i,size:s}){const r=s/2;e.arc(t,i,r,0,2*Math.PI),e.closePath()},cross(e){kc(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){kc(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const r=s/4;i+=r/2,e.arc(t-r,i-r,r,oe(130),oe(330)),e.arc(t+r,i-r,r,oe(220),oe(50)),e.lineTo(t,i+r),e.closePath()},pin({path:e,x:t,y:i,size:s}){const r=.5,n=.5;e.moveTo(t+-.34375*s,i+-.15625*s),e.cubicCurveTo(t+-.34375*s,i+-.348509*s,t+-.192259*s,i+-.5*s,t+0*s,i+-.5*s),e.cubicCurveTo(t+(.692259-r)*s,i+-.5*s,t+.34375*s,i+-.348509*s,t+.34375*s,i+-.15625*s),e.cubicCurveTo(t+.34375*s,i+(.493824-n)*s,t+.284625*s,i+(.600181-n)*s,t+(.716461-r)*s,i+(.695393-n)*s),e.cubicCurveTo(t+.199009*s,i+.219769*s,t+(.681271-r)*s,i+.243104*s,t+(.663785-r)*s,i+(.766105-n)*s),e.cubicCurveTo(t+(.611893-r)*s,i+(.834367-n)*s,t+(.562228-r)*s,i+.399699*s,t+(.528896-r)*s,i+(.980648-n)*s),e.cubicCurveTo(t+(.524075-r)*s,i+(.992358-n)*s,t+(.512663-r)*s,i+.5*s,t+0*s,i+.5*s),e.cubicCurveTo(t+(.487337-r)*s,i+.5*s,t+(.475925-r)*s,i+(.992358-n)*s,t+(.471104-r)*s,i+(.980648-n)*s),e.cubicCurveTo(t+(.487337-r)*s,i+.5*s,t+(.475925-r)*s,i+(.992358-n)*s,t+(.471104-r)*s,i+(.980648-n)*s),e.cubicCurveTo(t+(.437772-r)*s,i+.399699*s,t+(.388107-r)*s,i+(.834367-n)*s,t+(.336215-r)*s,i+(.766105-n)*s),e.cubicCurveTo(t+(.318729-r)*s,i+.243104*s,t+-.199009*s,i+.219769*s,t+(.283539-r)*s,i+(.695393-n)*s),e.cubicCurveTo(t+-.284625*s,i+(.600181-n)*s,t+-.34375*s,i+(.493824-n)*s,t+-.34375*s,i+-.15625*s),e.closePath()},plus(e){kc(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:s,pixelRatio:r}){const n=s/2;e.moveTo(et(r,t-n),et(r,i-n)),e.lineTo(et(r,t+n),et(r,i-n)),e.lineTo(et(r,t+n),et(r,i+n)),e.lineTo(et(r,t-n),et(r,i+n)),e.closePath()},star({path:e,x:t,y:i,size:s}){const r=s/2,n=r/2,o=Math.PI/2;for(let s=0;s<10;s++){const a=s%2==0?r:n,l=s*Math.PI/5-o,c=t+Math.cos(l)*a,h=i+Math.sin(l)*a;e.lineTo(c,h)}e.closePath()},triangle(e){kc(e,[[.5,0],[1,.87],[0,.87]])}},Nc=class extends bc{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:e,shape:t,x:i,y:s,size:r}=this,n=this.layerManager?.canvas?.pixelRatio??1,o=_c.anchor(t),a={path:e,x:i-(o.x-.5)*r,y:s-(o.y-.5)*r,size:r,pixelRatio:n};e.clear(),"string"==typeof t?Lc[t](a):"function"==typeof t&&t(a)}computeBBox(){const{x:e,y:t,size:i}=this,s=_c.anchor(this.shape);return new f(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};a([Y({equals:K})],Nc.prototype,"shape",2),a([$()],Nc.prototype,"x",2),a([$()],Nc.prototype,"y",2),a([$({convertor:Math.abs})],Nc.prototype,"size",2);var _c=class extends(vt(Ct(bt(Nc)))){static anchor(e){return"pin"===e?{x:.5,y:1}:"function"==typeof e&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),null!=e?.shape&&(this.shape=e.shape)}};function Oc(e,t,i=t*(5/3)){const s=new At,r=Math.min(e.marker.strokeWidth??1,2),n=Math.min(e.line?.strokeWidth??0,2),o=Math.max(!1===e.marker.enabled?0:t,null==e.line?0:i),a=Math.max(!1===e.marker.enabled?0:t,n);if(null!=e.line){const{stroke:t,strokeOpacity:i,lineDash:r}=e.line,l=new pa;l.x1=0,l.y1=a/2,l.x2=o,l.y2=a/2,l.stroke=t,l.strokeOpacity=i,l.strokeWidth=n,l.lineDash=r,s.append(l)}if(!1!==e.marker.enabled){const{shape:i,fill:n,fillOpacity:l,stroke:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=e.marker,p=new _c;p.shape=i??"square",p.size=t,p.fill=n,p.fillOpacity=l??1,p.stroke=c,p.strokeOpacity=h??1,p.strokeWidth=r,p.lineDash=d,p.lineDashOffset=u??0;const g=_c.anchor(i),m=o/2+(g.x-.5)*t,f=a/2+(g.y-.5)*t,y=t/(t+r);p.x=m,p.y=f,p.scalingCenterX=m,p.scalingCenterY=f,p.scalingX=y,p.scalingY=y,s.append(p)}return At.toSVG(s,o,a)}var Fc="ag-charts-tooltip",Gc="ag-charts-tooltip--dark";function Bc(e){const t=[],i=new Map;for(const s of e)if("structured"===s.type){const{heading:e}=s,r=null!=e?i.get(e):void 0,n={type:"structured",heading:e,items:[s]};null==r?(i.set(e,n),t.push(n)):r.items.push(s)}else t.push(s);return t}function Vc(e){const t=Bc(e),i=[];return t.forEach(e=>{if("raw"===e.type)return"";null!=e.heading&&i.push(e.heading),e.items.forEach(e=>{null!=e.title&&i.push(e.title),e.data?.forEach(e=>{i.push(e.label??e.fallbackLabel,e.value)})})}),i.join("; ")}function Hc(e,t,i){let s="";null==e?s+=`<span class="${Fc}-label">${Pc(t)}</span>`:(s+=`<span class="${Fc}-label">${Pc(e)}</span>`,s+=" ",s+=`<span class="${Fc}-value">${Pc(t)}</span>`);const r=[`${Fc}-row`];return i&&r.push(`${Fc}-row--inline`),s=`<div class="${r.join(" ")}">${s}</div>`,s}function Uc(e,t){if(null==e||1===t.length)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${Fc}-footer">${i}</div>`}function zc(e,t,i,s){const r=1===t.items.length?t.items[0]:void 0;let n,o,a;switch(i){case"compact":n=!0,o=r?.title;break;case"single":n=null!=r&&(null==t.heading||null==r.title)&&1===r.data?.length&&null==r.data[0].label&&null!=r.data[0].value,a=t.heading??r?.title;break;case"shared":n=!1}let l="";if(n&&null!=r?(null!=o&&(l+=Hc(void 0,o,!1)),r.data?.forEach(e=>{l+=Hc(e.label??a,e.value,!1),l+=" "})):(null!=t.heading&&(l+=`<span class="${Fc}-heading">${Pc(t.heading)}</span>`,l+=" "),t.items.forEach(e=>{l+=function(e){let t="";if(e.data?.length&&e.data.every(e=>null==e.value||""===e.value))return t;const i=null==e.title&&1===e.data?.length,s=null==e.symbol?void 0:Oc(e.symbol,12);return null==s||null==e.title&&!e.data?.length||(t+=`<span class="${Fc}-symbol">${s}</span>`),null!=e.title&&(t+=`<span class="${Fc}-title">${Pc(e.title)}</span>`,t+=" "),e.data?.forEach(e=>{t+=Hc(e.label??e.fallbackLabel,e.value,i),t+=" "}),t}(e)})),0===l.length)return;const c="compact"!==i&&null!=s?Uc(e,s):void 0;return c+null&&(l+=c),l=`<div class="${Fc}-content">${l.trimEnd()}</div>`,l}function Wc(e,t,i,s){const r=Bc(t);if(0!==r.length){if(1===r.length&&"structured"===r[0].type)return zc(e,r[0],i,s);{const t=r.map(t=>"structured"===t.type?zc(e,t,i):t.rawHtmlString);return null!=s&&t.push(function(e,t){const i=null==t?void 0:Uc(e,t);return null==i?"":`<div class="${Fc}-content">${i}</div>`}(e,s)??""),t.join("")}}}var jc={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},Kc={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},$c={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Yc={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},qc=class extends De{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}get defaultAnchorTo(){const{type:e,_seriesOverrideType:t}=this,i=e??t??"pointer";return"node"===i||"pointer"===i?i:"chart"}get defaultPlacement(){const{type:e,_seriesOverrideType:t}=this,i=e??t??"pointer";return"node"===i||"pointer"===i?"top":i}};a([Te,Ac("Use `anchorTo` and/or `placement` options instead.")],qc.prototype,"type",2),a([Te],qc.prototype,"_seriesOverrideType",2),a([Te],qc.prototype,"xOffset",2),a([Te],qc.prototype,"yOffset",2),a([Te],qc.prototype,"anchorTo",2),a([Te],qc.prototype,"placement",2);var Xc=class extends De{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new qc,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new Ic,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new bs,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in(0,s.zk)().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",Fc),this.element.setAttribute("popover","manual"),this.element.className=Fc,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,e=>{this._elementSize=e,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",Fc),this.destroyFns.forEach(e=>e()),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(null==e||null==t||null==i)return;const{canvasRect:r,relativeRect:n,meta:o}=i,{x:a,y:l}=this.springAnimation;let c=o.position?.placement??this.position.placement??o.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(c)||(c=[c]);const h=o.position?.anchorTo??this.position.anchorTo??o.position?.defaultAnchorTo??this.position.defaultAnchorTo,d=o.position?.xOffset??0,u=o.position?.yOffset??0,p=n.x,g=n.y,m=n.width-t.width-1+p,f=n.height-t.height+g;let y,v,C=0,b=!1;do{y=c[C],C+=1;const e=this.getTooltipBounds({elementSize:t,placement:y,anchorTo:h,canvasX:a,canvasY:l,yOffset:u,xOffset:d,canvasRect:r});v=Dc(t.width,t.height,n,e),b=!1,1&Yc[y]&&(b||(b=v.x<p||v.x>m)),2&Yc[y]&&(b||(b=v.y<g||v.y>f))}while(C<c.length&&b);const S=(0,s.qE)(p,v.x,m),w=(0,s.qE)(g,v.y,f);b||(b=S!==v.x||w!==v.y);const x="chart"!==h&&!b&&!d&&!u,E=o.showArrow??this.showArrow??x;this.arrowPosition=E?$c[y]:void 0,this.updateClassModifiers(),e.style.translate=`${S}px ${w}px`}show(e,t,i,s,r,n=!1){const{element:o}=this;if(null!=o&&null!=s&&0!==s.length){const e=Wc(this.localeManager,s,this.mode,this.pagination?r:void 0);if(null==e)return void this.toggle(!1);o.innerHTML=e}else if(null==o||""===o.innerHTML)return void this.toggle(!1);const a={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:a,meta:i},i.position?.anchorTo??this.position.anchorTo??i.position?.defaultAnchorTo??this.position.defaultAnchorTo){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,o.style.pointerEvents="auto",o.removeAttribute("aria-hidden"),o.tabIndex=-1):(this.enableInteraction=!1,o.style.pointerEvents="none",o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex")),o.style.setProperty("--top",`${t.top}px`),o.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,n)}hide(){this.toggle(!1)}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():this.springAnimation.reset())}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(t,i)=>e.toggle(`${Fc}--${t}`,i);t("no-interaction",!this.enableInteraction),t("arrow-top",1===this.arrowPosition),t("arrow-right",3===this.arrowPosition),t("arrow-bottom",2===this.arrowPosition),t("arrow-left",0===this.arrowPosition),t("compact","compact"===this.mode),e.toggle(Gc,this.darkTheme);for(const t of this.wrapTypes)e.toggle(`${Fc}--wrap-${t}`,t===this.wrapping)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:s,canvasX:r,canvasY:n,yOffset:o,xOffset:a,canvasRect:l}=e,{width:c,height:h}=t,d={width:c,height:h};if("node"===i||"pointer"===i){const e=jc[s],t=Kc[s];return d.top=n+o+h*(t-1)/2+8*t,d.left=r+a+c*(e-1)/2+8*e,d}switch(s){case"top":return d.top=o,d.left=l.width/2-c/2+a,d;case"right":return d.top=l.height/2-h/2+o,d.left=l.width-c/2+a,d;case"left":return d.top=l.height/2-h/2+o,d.left=a,d;case"bottom":return d.top=l.height-h+o,d.left=l.width/2-c/2+a,d;case"top-left":return d.top=o,d.left=a,d;case"top-right":return d.top=o,d.left=l.width-c+a,d;case"bottom-right":return d.top=l.height-h+o,d.left=l.width-c+a,d;case"bottom-left":return d.top=l.height-h+o,d.left=a,d}return d}};function Zc(e,t){return e.series===t.series&&k(e.datumIndex,t.datumIndex)}a([Te],Xc.prototype,"enabled",2),a([Te],Xc.prototype,"mode",2),a([Te],Xc.prototype,"showArrow",2),a([Te],Xc.prototype,"delay",2),a([Te],Xc.prototype,"range",2),a([Te],Xc.prototype,"wrapping",2),a([Te],Xc.prototype,"position",2),a([Te],Xc.prototype,"pagination",2),a([Te],Xc.prototype,"darkTheme",2),a([Te],Xc.prototype,"bounds",2);var Qc=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(e,t){this.candidates=e;let i=null!=t?e.findIndex(e=>Zc(e,t)):-1;return-1===i&&(i=0),this.active=e[i],{current:this.active,index:i,length:e.length}}next(){const{candidates:e,active:t}=this,i=null==t?-1:e.findIndex(e=>Zc(e,t));if(-1===i)return;let s=i+1;return s>=e.length&&(s=0),this.active=e[s],{current:this.active,index:s,length:this.candidates.length}}},Jc=class extends Ji{constructor(e){super(),this.chart=e,this.id=(0,s.sX)(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=hi((e,t)=>(0,s.zk)().requestAnimationFrame(e),()=>{(this.tooltip.lastHover||this.highlight.pendingHoverEvent)&&(this.chart.getUpdateType()<=5?this.hoverScheduler.schedule():(this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)))}),this.tooltipCandidates=new Qc;const t=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new wc(t,i,"img"),this.swapChain.addListener("blur",e=>this.onBlur(e)),this.swapChain.addListener("focus",()=>this.onFocus()),"normal"===e.ctx.domManager.mode&&(this.focusIndicator=new Sc(this.swapChain),this.focusIndicator.overrideFocusVisible("integrated"!==e.mode&&void 0));const{seriesDragInterpreter:r,seriesWidget:n,containerWidget:o}=e.ctx.widgets;n.setTabIndex(-1),this.destroyFns.push(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus()),n.addListener("mousemove",e=>this.onHover(e)),n.addListener("wheel",e=>this.onWheel(e)),n.addListener("mouseleave",e=>this.onLeave(e)),n.addListener("keydown",e=>this.onKeyDown(e)),n.addListener("contextmenu",(e,t)=>this.onContextMenu(e,t)),r.addListener("drag-move",e=>this.onDragMove(e)),r.addListener("click",e=>this.onClick(e,n)),r.addListener("dblclick",e=>this.onClick(e,n)),o.addListener("contextmenu",(e,t)=>this.onContextMenu(e,t)),o.addListener("click",(e,t)=>this.onClick(e,t)),o.addListener("dblclick",(e,t)=>this.onClick(e,t)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.domManager.addListener("resize",()=>this.clearAll()),e.ctx.highlightManager.addListener("highlight-change",e=>this.changeHighlightDatum(e)),e.ctx.layoutManager.addListener("layout:complete",e=>this.layoutComplete(e)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),e.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}get bbox(){return(this.seriesRect??f.zero).clone()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return"touch"===e.device&&"click"!==e.type&&"hover"!==this.chart.ctx.chartService.touch.dragAction&&("drag"!==this.chart.ctx.chartService.touch.dragAction||!this.isState(9))}dataChanged(){var e;(e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear(),this.clearHighlight()}preSceneRender(){null!=this.highlight.stashedHoverEvent&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),null!=this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&this.handleSeriesFocus(0,0,!0)}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((e,t)=>{let i=e.properties.focusPriority??1/0,s=t.properties.focusPriority??1/0;return i===s&&([i,s]=[e._declarationOrder,t._declarationOrder]),i<s?-1:i>s?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.paddedRect),"normal"===this.chart.ctx.domManager.mode&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:t,currentY:i}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:t,canvasY:i},void 0)}return}let s,r;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(r=wt.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const t=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");t&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=t.matches[0].datum)}const n=s?.series;this.clearAll();const o=e.currentX+t.cssLeft(),a=e.currentY+t.cssTop();n&&s?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:o,canvasY:a},{pickedSeries:n,pickedNode:s},r):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:o,canvasY:a},void 0,r)}onLeave(e){if(!this.isState(41))return;const t=e.sourceEvent.relatedTarget;"ag-charts-text-input__textarea"!==t?.className&&(this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),"keyboard"!==this.hoverDevice&&this.clearAll()))}onWheel(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e))}onHover(e){this.isState(41)&&this.onHoverLikeEvent(e)}onHoverLikeEvent(e){if(!this.isIgnoredTouch(e)&&("touch"!==e.device&&"drag-move"===e.type||(this.tooltip.lastHover=e),"touch"===e.device&&"hover"===this.chart.ctx.chartService.touch.dragAction&&e.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:t,currentY:i}=e,s=this.pickNodes({x:t,y:i},"event")?.matches,r=s?.[0];r?.series.hasEventListener("seriesNodeClick")||r?.series.hasEventListener("seriesNodeDoubleClick")||null!=s&&s.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(e,t){if(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),"touch"===e.device&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e),!this.isState(32))return;if(t==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(e))return this.update(5),void e.sourceEvent.preventDefault();const i={type:"click"===e.type?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(e){this.isState(34)&&(this.hoverDevice="pointer",this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=function(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:r}]of(0,s.jO)(xc))if(Ec(e,r))return{name:t,activatesFocusIndicator:i}}(e.sourceEvent);switch(!1===t?.activatesFocusIndicator&&this.focusIndicator?.overrideFocusVisible("keyboard"===this.previousInputDevice),t?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,e);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,e);case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;void 0!==t&&void 0!==i?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event");if(null==i||0===i.matches.length)return;const s=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:r,datum:n}=s??i.matches[0],o=null==s?i.distance:0;if("click"===e.type){const i=r.fireNodeClickEvent(e.sourceEvent,n)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(null!=i){e.sourceEvent.preventDefault();const{currentX:s,currentY:r}=e,n=s+(this.hoverRect?.x??0),o=r+(this.hoverRect?.y??0);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(i.current,n,o,{index:i.index,length:i.length})}return!0}return"dblclick"===e.type&&(e.preventZoomDblClick=0===o,r.fireNodeDoubleClickEvent(e.sourceEvent,n),!0)}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);null==i?this.handleSeriesFocus(e,t):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(e,t,i=!1){if("hierarchy"===this.chart.chartType||"gauge"===this.chart.chartType)return void this.handleSoloSeriesFocus(e,t,i);const{focus:r}=this,n=r.sortedSeries.filter(e=>e.visible&&e.focusable);if(0===n.length)return;const o=r.datumIndex-t,a=r.seriesIndex-e;r.seriesIndex=(0,s.qE)(0,r.seriesIndex,n.length-1),r.series=n[r.seriesIndex];const l=this.focus.datumIndex,c=this.focus.seriesIndex;this.updatePickedFocus(l,t,o,c,e,a,i)}handleSoloSeriesFocus(e,t,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,r=this.focus.seriesIndex,n=this.focus.datumIndex-t,o=this.focus.seriesIndex-e;this.updatePickedFocus(s,t,n,r,e,o,i)}updatePickedFocus(e,t,i,s,r,n,o){const{focus:a,hoverRect:l,seriesRect:c}=this;if(void 0===a.series||void 0===l)return;const h=a?.series?.pickFocus({datumIndex:e,datumIndexDelta:t,otherIndex:s,otherIndexDelta:r,seriesRect:c});if(!h)return;const{datum:d}=h;if(void 0!==h.otherIndex&&(a.seriesIndex=h.otherIndex),a.datumIndex=h.datumIndex,a.datum=d,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const e=function({bounds:e}){return e instanceof f?e:null!=e?wt.toCanvas(e):f.NaN}(h),{x:t,y:i}=e.computeCenter();if(!l.containsPoint(t,i)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,e))return;const{x1:s,x2:r,y1:n,y2:o}=so.from(e),a=l.containsPoint(s,n),c=l.containsPoint(r,n),d=l.containsPoint(s,o),u=l.containsPoint(r,o);if(!(a||c||d||u)){const t=so.from(l);h.movedBounds=e.clone(),s<t.x1&&r<t.x1?(h.movedBounds.x=t.x1-2,h.movedBounds.width=4):s>t.x2&&r>t.x2&&(h.movedBounds.x=t.x2-2,h.movedBounds.width=4),n<t.y1&&o<t.y1?(h.movedBounds.y=t.y1-2,h.movedBounds.height=4):n>t.y2&&o>t.y2&&(h.movedBounds.y=t.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const u=function(e,t,i){const{x:s,y:r}=function(e,t,i){const s=Xr(e,i.datum,i.movedBounds);if(null!=s)return{x:s.canvasX,y:s.canvasY};const r=i.bounds;if(null!=r){if(r instanceof f){const{x:e,y:i}=r.computeCenter();return{x:t.x+e,y:t.y+i}}return wt.toCanvas(r).computeCenter()}}(e,t,i)??{};if(void 0!==s&&void 0!==r)return{type:"keyboard",canvasX:s,canvasY:r}}(a.series,l,h);if(void 0!==u&&"keyboard"===this.hoverDevice){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const e=this.chart.getTooltipContent(a.series,d.datumIndex,d),s=Qr.makeTooltipMeta(u,a.series,d,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,d),a.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,s,e):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(0===t&&0===r||i!==h.datumIndex||n!==(h.otherIndex??a.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(d,e))}}getDatumAriaText(e,t){const i=null==t?"":Vc(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator?.clear()}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(41))return;const{currentX:i,currentY:s}=t,r=t.currentX+(this.hoverRect?.x??0),n=t.currentY+(this.hoverRect?.y??0);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(r,n))return void this.clearHighlight();const{range:o}=this.chart.highlight,a="tooltip"===o?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},a);if(!l||0===l.matches.length)return void this.chart.ctx.highlightManager.updateHighlight(this.id);const{current:c}=this.tooltipCandidates,h=null==c?void 0:l.matches.find(e=>Zc(e,c)),d=h?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,d),this.hoverDevice="pointer"}handleHoverTooltip(e,t){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:r}=e,n=s+(this.hoverRect?.x??0),o=r+(this.hoverRect?.y??0),a=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,o))return void("pointer"==this.hoverDevice&&this.clearTooltip());if(a&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(a,"canvas-overlay",Fc))return;const l=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip");if(l&&0!==l.matches.length)if(this.hoverDevice="pointer",0===l.distance){const{current:e,index:t,length:s}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(e,n,o,{index:t,length:s})}else this.showTooltip(l.matches[0],n,o);else"pointer"==this.hoverDevice&&this.clearTooltip()}showTooltip({series:e,datum:t,datumIndex:i},s,r,n){const o=this.chart.getTooltipContent(e,i,t);if((e.tooltipEnabled??this.chart.tooltip.enabled)&&null!=o){const i=Qr.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:r},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,i,o,n)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(e){const t=new Set,{series:i,datum:s}=e.currentHighlight??{},{series:r,datum:n}=e.previousHighlight??{};r&&t.add(r),i&&t.add(i),r?.properties.cursor&&n&&this.chart.ctx.domManager.updateCursor(r.id),i?.properties.cursor&&"default"!==i?.properties.cursor&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),null==i||null==r?this.update(5):this.update(5,{seriesToUpdate:t})}pickNodes(e,t,i){const s=[...this.series].reverse();let r;for(const n of s){if(!n.visible||!n.contentGroup.visible)continue;const s=n.pickNodes(e,t,i);if(null==s||0===s.datums.length)continue;const{datums:o,distance:a}=s;if(0!==s.datums.length)if(0===a){0!==r?.distance&&(r={matches:[],distance:0});for(const e of o){const{datumIndex:t}=e;r.matches.push({series:n,datum:e,datumIndex:t})}}else if(null==r||r.distance>a){const[e]=o,{datumIndex:t}=e;r={matches:[{series:n,datum:e,datumIndex:t}],distance:a}}}return r}},eh=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){const{internalId:t,type:i,contentGroup:s,seriesGrouping:r}=e,{groupIndex:n=t}=r??{},o=this.series.get(t);if(null!=o)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);0===this.series.size&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal");let a=this.groups.get(i);null==a&&(a=new Map,this.groups.set(i,a));const l=this.lookupIdx(n);let c=a.get(l);return null==c&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new At({name:`${e.contentGroup.name??i}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e}),c.seriesIds.push(t),c.group.appendChild(s),c.group}changeGroup(e){const{internalId:t,seriesGrouping:i,type:s,contentGroup:r,oldGrouping:n}=e,{groupIndex:o=t}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(t)||(this.series.has(t)&&this.releaseGroup({internalId:t,seriesGrouping:n,type:s,contentGroup:r}),this.requestGroup(e))}releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const r=this.series.get(t)?.layerState;r&&(r.seriesIds=r.seriesIds.filter(e=>e!==t),r.group.removeChild(i)),0===r?.seriesIds.length?(this.seriesRoot.removeChild(r.group),this.groups.get(r.type)?.delete(r.id),this.groups.get(s)?.delete(t)):null!=r&&r.seriesIds.length>0&&(r.group.zIndex=this.getLowestSeriesZIndex(r.seriesIds)),this.series.delete(t)}updateLayerCompositing(){this.groups.forEach(e=>{e.forEach(e=>{const{group:t,seriesIds:i}=e;let s;if(0===i.length)s=!1;else if(i.length>1)s=!0;else{const e=this.series.get(i[0]);s=!0===e?.seriesConfig.renderToOffscreenCanvas()}t.renderToOffscreenCanvas=s,t.zIndex=this.getLowestSeriesZIndex(i)})})}lookupIdx(e){return"normal"===this.mode?e:"string"!=typeof e||(e=Number(e.split("-").at(-1)))?Math.floor(30*(0,s.qE)(0,e/this.expectedSeriesCount,1)):0}destroy(){this.groups.forEach(e=>{e.forEach(e=>{this.seriesRoot.removeChild(e.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){return e.reduce((e,t)=>{const i=this.series.get(t),s=i?.seriesConfig.contentGroup.zIndex;return null==e||null==s?s:Et(e,s)<=0?e:s},void 0)??1}},th=class extends De{constructor(){super(...arguments),this.dragAction="drag"}};a([Te],th.prototype,"dragAction",2);var ih=class{constructor(e,t,i,s,r){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=s,this.animationManager=r,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",e=>this.onUpdateComplete(e)),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(4)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){(e.apiUpdate||this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,s=!0;if(t){const r=this.zoomManager.getAxisZoom(t.id);i=this.getAxisWindow(t,r),s=this.shouldRefresh(e,t,r)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>"time"===e.type)}shouldRefresh(e,t,i){if(e.apiUpdate)return!0;if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(t.id);return!(s&&i.min===s.min&&i.max===s.max||(this.lastAxisZooms.set(t.id,i),0))}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||0===i.length||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]);return{min:new Date(Number(i[0])+s*t.min),max:new Date(Number(i[0])+s*t.max)}}},sh=/^((?!chrome|android).)*safari/i,rh=/Version\/(\d+(\.\d+)?)/,nh=/Chrome/,oh=/Chrome\/(\d+)/,ah=/Edg/,lh=/OPR/,ch=new Set(["map-shape-background","map-line-background"]),hh=class{constructor(e,t,i,s,r,n,o){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutManager=s,this.localeManager=r,this.animationManager=n,this.domManager=o,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(oc),this.destroyFns.push(this.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.destroyFns.forEach(e=>e()),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(e=>e.hasData),r=this.chartLike.series.some(e=>e.visible&&!ch.has(e.type));this.overlays.darkTheme?this.overlayElem.classList.add(ac):this.overlayElem.classList.remove(ac),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const n=t,o=!t&&!i,a=i&&!r,l=this.overlays.unsupportedBrowser.enabled&&function(){const{userAgent:e}=(0,s.zk)("navigator");if(sh.test(e)){const t=rh.exec(e);if(null==t)return!1;const i=parseFloat(t[1]),r=Math.floor(i)>16;return r||s.Vy.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!r}if(nh.test(e)&&!ah.test(e)&&!lh.test(e)){const t=oh.exec(e);if(null==t)return!1;const i=parseInt(t[1],10),r=i>126;return r||s.Vy.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!r}return!1}();n?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),l?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const c=n||o||a||l;(0,s.Bq)(this.overlayElem,"aria-hidden",!c)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText=" "},this.animationManager)}},dh=v.create(!0,"opts"),uh=class extends De{constructor(){super(...arguments),this.padding=new ri(0)}};a([Te],uh.prototype,"clip",2),a([Te],uh.prototype,"padding",2);var ph=class e extends si{constructor(e,t){var i;super(),this.id=(0,s.sX)(this),this.seriesRoot=new It({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new It({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new At({name:"titles",zIndex:13}),this.debug=v.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new s.iN,this.padding=new ri(20),this.seriesArea=new uh,this.keyboard=new ra,this.touch=new th,this.mode="standalone",this.chartCaptions=new zi,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new nc,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new s.iN,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new ii,this.updateRequestors={},this.performUpdateTrigger=hi((e,t=0)=>{0===t?queueMicrotask(e):setTimeout(e,t)},({count:e})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(e)}catch(e){s.Vy.error("update error",e)}}).catch(e=>s.Vy.errorOnce(e))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=e=>{this.fireEvent(e)},this.onSeriesNodeDoubleClick=e=>{this.fireEvent(e)},this.onSeriesVisibilityChange=e=>{this.fireEvent(e)},this.seriesGroupingChanged=e=>{if(!(e instanceof vc))return;const{series:t,seriesGrouping:i,oldGrouping:s}=e;t.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:t.internalId,type:t.type,contentGroup:t.contentGroup,renderToOffscreenCanvas:()=>t.renderToOffscreenCanvas(),seriesGrouping:i,oldGrouping:s})},this.chartOptions=e;const r=t?.scene,n=t?.container??e.processedOptions.container??void 0,o=t?.styleContainer??e.specialOverrides.styleContainer;r&&(this._firstAutoSize=!1,this._lastAutoSize=[r.width,r.height,r.pixelRatio]);const a=new At({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.annotationRoot),a.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Xc,this.seriesLayerManager=new eh(this.seriesRoot),this.mode=e.userOptions.mode??this.mode,this.styleNonce=e.processedOptions.styleNonce;const l=this.ctx=new Mo(this,{chartType:this.getChartType(),scene:r,root:a,container:n,styleContainer:o,domMode:e.optionMetadata.domMode,syncManager:new sa(this),fireEvent:e=>this.fireEvent(e),updateCallback:(e,t)=>this.update(e,t),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new cc,(i=this.overlays.loading).renderer??(i.renderer=()=>function(e,t){const{animationDuration:i}=Pr.add,r=i*t,n=(0,s.n)("div",`${oc}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${r}ms linear 50ms both`}),o=(0,s.n)("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),a=(0,s.n)("p",{marginTop:"1em"});a.innerText=e;const l=(0,s.n)("div",`${oc}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=(0,s.n)("style");return c.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(c,o,a,l),n}(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new ih(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new hh(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Ao,this.container=n;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new Jc(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,e=>{e.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(e)}),l.layoutManager.addListener("layout:complete",e=>this.chartCaptions.positionAbsoluteCaptions(e)),l.dataService.addListener("data-load",e=>{this.data=e.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Ai.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(7)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(e=>e.animationState?.transition("updateData"));const e="initial"!==this.chartAnimationPhase;this.update(4,{forceNodeDataRefresh:!0,skipAnimations:e})})),this.parentResize(l.domManager.containerSize)}static getInstance(t){return e.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,t){this.ctx.scene.download(e,t)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:t,highlight:i,overlays:s,seriesRoot:r,mode:n}=this,o=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(e,t,i)=>this.getTooltipContent(e,t,i),chartType:o,ctx:e,tooltip:t,highlight:i,overlays:s,seriesRoot:r,mode:n}}getModuleContext(){return this.ctx}getTooltipContent(e,t,i){const s=!1!==e.properties.tooltip.enabled?e.getTooltipContent(t,i):void 0,r=null==s?[]:[s];if("shared"!==this.tooltip.mode||1===this.series.length)return r;const n=e.getCategoryValue(t);return null==n?r:this.series.flatMap(t=>{if(t===e)return r;if(!t.isEnabled()||!1===t.properties.tooltip.enabled)return[];const i=t.datumIndexForCategoryValue(n),s=null==i?void 0:t.getTooltipContent(i,void 0);return null==s?[]:[s]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(e){if(this.destroyed)return;const t=e?.keepTransferableResources;let i;return this.performUpdateType=8,this._destroyFns.forEach(e=>e()),this.processors.forEach(e=>e.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),t?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(e=>e.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),i}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(e=>s.Vy.errorOnce(e)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=0,t){if(this.destroyed)return;const{forceNodeDataRefresh:i=!1,skipAnimations:s,seriesToUpdate:r=this.series,newAnimationBatch:n,apiUpdate:o=!1}=t??{};this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled("none"!==this.touch.dragAction),i&&this.series.forEach(e=>e.markNodeDataDirty());for(const e of r)this.seriesToUpdate.add(e);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),n&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.debug.check()){let t=(new Error).stack??"<unknown>";t=t.replace(/\([^)]*/g,""),this.updateRequestors[t]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(t?.backOffMs))}async performUpdate(e){const{performUpdateType:t,extraDebugStats:i,_performUpdateSplits:s,ctx:r}=this,n=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=8,this.seriesToUpdate.clear(),this.runningUpdateType=t,0===this.updateShortcutCount&&t<7&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",yr[t]);let o=performance.now();s.start??(s.start=o);const a=e=>{s[e]??(s[e]=0),s[e]+=performance.now()-o,o=performance.now()};switch(t){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),a("⬇️");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),a("🏭");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),a("⛰️");case 4:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(4))break;await this.processLayout(),a("⌖");case 5:if(this.checkUpdateShortcut(5))break;await this.updateSeries(n),a("🤔"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing();case 6:if(this.checkUpdateShortcut(6))break;r.updateService.dispatchPreSceneRender(),a("↖");case 7:if(this.checkUpdateShortcut(7))break;r.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:s,extraDebugStats:i,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const e of Object.keys(s))delete s[e];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 8:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.updateService.dispatchUpdateComplete(this.apiUpdate),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=8,this.syncStatus="ready"),this._performUpdateNotify.notify();const l=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(l-s.start))/100,count:e,performUpdateType:yr[t]})}updateThemeClassName(){const e="ag-charts-theme-",t=[`${e}default`,`${e}default-dark`];let i=t[0],s=!1,{theme:r}=this.chartOptions.processedOptions;for(;"string"!=typeof r&&null!=r;)r=r.baseTheme;"string"==typeof r&&(i=r.replace("ag-",e),s=r.includes("-dark")),t.includes(i)||(i=s?t[1]:t[0]),this.ctx.domManager.setThemeClass(i)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:t}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?t??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return!!this.destroyed||(this.updateShortcutCount>3?(s.Vy.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e&&(this.updateShortcutCount++,!0))}async checkFirstAutoSize(){null!=this.width&&null!=this.height||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(e,t){null==t&&0===e.length||this.ctx.axisManager.updateAxes(t??[],e)}onSeriesChange(e,t){const i=t?.filter(t=>!e.includes(t))??[];this.destroySeries(i),this.seriesLayerManager?.setSeriesCount(e.length);for(const i of e){if(t?.includes(i))continue;const e=this.seriesLayerManager.requestGroup(i);i.attachSeries(e,this.seriesRoot,this.annotationRoot);const s=this;i.chart={get mode(){return s.mode},get isMiniChart(){return!1},get seriesRect(){return s.seriesRect}},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){e?.forEach(e=>{e.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),e.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),e.removeEventListener("groupingChanged",this.seriesGroupingChanged),e.destroy(),this.seriesLayerManager.releaseGroup(e),e.detachSeries(void 0,this.seriesRoot,this.annotationRoot),e.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)}assignAxesToSeries(){const e=(0,s.$z)(this.axes,e=>e.direction);for(const t of this.series)for(const i of t.directions){const r=e[i];if(!r)return void s.Vy.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const n=t.getKeys(i),o=r.find(e=>!e.keys.length||n.some(t=>e.keys.includes(t)));if(!o)return void s.Vy.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`);t.axes[i]=o}}parentResize(e){if(null==e||null!=this.width&&null!=this.height)return;let{width:t,height:i}=e;const{pixelRatio:s}=e;if(t=Math.floor(t),i=Math.floor(i),0===t&&0===i)return;const[r=0,n=0,o=1]=this._lastAutoSize??[];r===t&&n===i&&o===s||(this._lastAutoSize=[t,i,s],this.resize("SizeMonitor",{}))}resize(e,t){const{scene:i,animationManager:r}=this.ctx,{inWidth:n,inHeight:o,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=t;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,n??this.width,o??this.height);const h=n??this.width??this._lastAutoSize?.[0],d=o??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:d,pixelRatio:u,stack:(new Error).stack}),null!=h&&null!=d&&(0,s.Bf)(h)&&(0,s.Bf)(d)&&i.resize(h,d,u)){r.reset();let e=!0;null!=this.width&&null!=this.height||!this._firstAutoSize||(e=!1,this._firstAutoSize=!1),this.update(4,{forceNodeDataRefresh:!0,skipAnimations:e}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(e=>e.setChartData(this.data));const e=this.modulesManager.mapModules(e=>e.updateData?.(this.data));await Promise.all(e)}async processData(){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new Wo(this.mode,this.suppressFieldDotNotation),t=this.series.map(t=>t.processData(e)),i=this.modulesManager.mapModules(t=>t.processData?.(e));this._cachedData=e.execute(this._cachedData),await Promise.all([...t,...i]),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}updateLegends(e){for(const{legend:t,legendType:i}of this.modulesManager.legends())"category"===i?this.setCategoryLegendData(e):this.setLegendData(i,t)}setCategoryLegendData(e){var t;const{ctx:{legendManager:i,stateManager:r}}=this;e&&this.series.forEach(t=>{const i=e.find(e=>e.seriesId===t.id);t.onLegendInitialState("category",i)});const n=this.series.flatMap(e=>{const t=e.getLegendData("category");return i.updateData(e.id,t),t});if(e)r.setStateAndRestore(i,e);else{if("integrated"!==this.mode){const e={},i=new Map(this.series.map(e=>[e.id,e.type]));for(const{seriesId:r,symbol:{marker:o},label:a}of n.filter(e=>!e.hideInLegend)){if(null==o.fill)continue;const n=i.get(r),l=e[n]??(e[n]={});l[t=a.text]??(l[t]=o.fill),l[a.text]!==o.fill&&s.Vy.warnOnce(`legend item '${a.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}i.update()}}setLegendData(e,t){t.data=this.series.filter(e=>e.properties.showInLegend).flatMap(t=>t.getLegendData(e))}async processLayout(){const e=this.animationRect,{width:t,height:i}=this.ctx.scene,s=this.ctx.layoutManager.createContext(t,i);await this.performLayout(s),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(e){const{seriesRect:t}=this;await Promise.all(e.map(e=>e.update({seriesRect:t}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(e=>e.visible&&e.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e=1e4,t=!1){const i=performance.now();for(;(this._pendingFactoryUpdatesCount>0||8!==this.performUpdateType||8!==this.runningUpdateType||this.ctx.scene.waitingForUpdate())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),8===this.performUpdateType&&8===this.runningUpdateType||await this._performUpdateNotify.await(),performance.now()-i>e){const i=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(t)throw new Error(i);s.Vy.warnOnce(i)}Nt()&&await(0,s.v7)(),this.ctx.scene.waitingForUpdate()&&await(0,s.v7)(50)}}filterMiniChartSeries(e){return e?.filter(e=>!1!==e.showInMiniChart)}applyOptions(e){const t=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(null==t||0===Object.keys(t).length)return;const i=this.firstApply?{}:this.chartOptions.processedOptions,s=e.processedOptions;dh("Chart.applyOptions() - applying delta",t);const r=this.applyModules(s);t.listeners&&this.registerListeners(this,t.listeners),Ut(this,t,{skip:["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"]});let n=!1,o="no-op";null!=t.series&&(o=this.applySeries(this,t.series,i?.series),n=!0),"replaced"===o&&this.resetAnimations(),this.applyAxes(this,s,i,o,[])&&(n=!0),t.data&&(this.data=t.data),t.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,t.legend.listeners),t.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=t.locale?.localeText),this.chartOptions=e;const a=this.modulesManager.getModule("navigator"),l=this.modulesManager.getModule("zoom");a?.enabled||l?.enabled||this.ctx.zoomManager.updateZoom("chart");const c=a?.miniChart,h=s.navigator?.miniChart?.series??s.series;!0===c?.enabled&&null!=h?this.applyMiniChartOptions(c,h,s,i):!1===c?.enabled&&(c.series=[],c.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),n||(n=this.shouldForceNodeDataRefresh(t,o));const d=n||r?0:4;this.maybeResetAnimations(o),this.shouldClearLegendData(s,i,o)&&this.ctx.legendManager.clearData(),this.applyInitialState(s),dh("Chart.applyOptions() - update type",yr[d],{seriesStatus:o,forceNodeDataRefresh:n}),this.update(d,{apiUpdate:!0,forceNodeDataRefresh:n,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:t,chartTypeOriginator:i,historyManager:s,stateManager:r,zoomManager:n}=this.ctx,{initialState:o}=e;if("annotations"in e&&e.annotations?.enabled&&null!=o?.annotations){const e=o.annotations.map(e=>N(e,t.getAnnotationTypeStyles(e.type)));r.setState(t,e)}null!=o?.chartType&&r.setState(i,o.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&null!=o?.zoom&&r.setState(n,o.zoom),null!=o?.legend&&this.updateLegends(o.legend),null!=o&&s.clear()}maybeResetAnimations(e){if("standalone"===this.mode)switch(e){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(e,t){const i=!!e.data||"data-change"===t||"replaced"===t,s=qo.getKeys(),r=Object.values(s).some(t=>null!=e[t]),n=null!=e.title&&null!=e.subtitle;return i||r||n}shouldClearLegendData(e,t,i){const s="replaced"===i||"series-grouping-change"===i||"updated"===i&&(e.series?.length!==t.series?.length||!e.series?.every((e,i)=>e.type===t.series?.[i].type)),r=null!=t.legend&&null==e.legend;return s||r}applyMiniChartOptions(e,t,i,s){const r=s?.navigator?.miniChart?.series??s?.series,n=this.applySeries(e,this.filterMiniChartSeries(t),this.filterMiniChartSeries(r));this.applyAxes(e,i,s,n,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const o=e.series;for(const e of o)e.properties.id=void 0;const a=e.axes,l=a.find(e=>"x"===e.direction);for(const e of a)e.nice=!1,e.gridLine.enabled=!1,e.label.enabled=e===l,e.tick.enabled=!1,e.interactionEnabled=!1;if(null!=l){const e=i.navigator?.miniChart,t=e?.label,s=e?.label?.interval;if(l.line.enabled=!1,l.label.set(G(t,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),l.tick.set(G(s,["enabled","width","size","color","interval","step"])),"grouped-category"===l.type){l.label.enabled=!1,l.label.rotation=0;const{depthOptions:e}=l;if(0===e.length)e.set([{label:{enabled:!0}}]);else for(let t=1;t<e.length;t++)e[t].label.enabled=!1}else"time"!==l.type&&"unit-time"!==l.type&&"ordinal-time"!==l.type||(l.parentLevel.enabled=!1);const r=s?.step;null!=r&&(l.interval.step=r)}}applyModules(e){const{type:t}=this.constructor;let i=!1;for(const s of c.byType("root","legend")){const r=null!=e[s.optionsKey]&&s.chartTypes.includes(t);r!==this.modulesManager.isEnabled(s)&&(r?(this.modulesManager.addModule(s,e=>e.moduleFactory(this.getModuleContext())),"legend"===s.type&&this.modulesManager.getModule(s)?.attachLegend(this.ctx.scene),this[s.optionsKey]=this.modulesManager.getModule(s)):(this.modulesManager.removeModule(s),delete this[s.optionsKey]),i=!0)}return i}initSeriesDeclarationOrder(e){for(let t=0;t<e.length;t++)e[t].setSeriesIndex(t)}applySeries(e,t,i){if(!t)return"no-change";const s=function(e,t,i){const s=(e,t,i)=>{const s=[e];for(const e of Xl)e in t&&null!=t[e]&&s.push(`${e}=${t[e]}`);return i?.seriesGrouping&&s.push(`seriesGrouping.groupId=${i?.seriesGrouping.groupId}`),s.join(";")},r=new Map;let n=0;for(const t of e){const e=s(t.type,t.properties,i?.[n]);r.has(e)||r.set(e,[]),r.get(e)?.push([t,n++])}const o=new Map;n=0;for(const e of t){const t=s(e.type,e,e);o.has(t)||o.set(t,[]),o.get(t)?.push([e,n++])}if(![...r.keys()].some(e=>o.has(e)))return{status:"no-overlap",oldKeys:r.keys(),newKeys:o.keys()};const a=[];for(const[e,t]of o.entries())for(const[s,n]of t){const t=r.get(e);if(null==t||t.length<1){a.push({opts:s,targetIdx:n,idx:n,status:"add"}),r.delete(e);continue}const[o,l]=t.shift(),c=Ft(i?.[l]??{},s??{}),{groupIndex:h,stackIndex:d}=c?.seriesGrouping??{};null!=h||null!=d?a.push({opts:s,series:o,diff:c,targetIdx:n,idx:l,status:"series-grouping"}):c?a.push({opts:s,series:o,diff:c,targetIdx:n,idx:l,status:"update"}):a.push({opts:s,series:o,targetIdx:n,idx:l,status:"no-op"}),0===t.length&&r.delete(e)}for(const e of r.values())for(const[t,i]of e)a.push({series:t,idx:i,targetIdx:-1,status:"remove"});return{status:"overlap",changes:a}}(e.series,t,i);if("no-overlap"===s.status){dh(`Chart.applySeries() - creating new series instances, status: ${s.status}`,s);const i=t.map(e=>this.createSeries(e));return this.initSeriesDeclarationOrder(i),e.series=i,"replaced"}dh("Chart.applySeries() - matchResult",s);const r=[];let n=!1,o=!1,a=!1;const l=s.changes.toSorted((e,t)=>e.targetIdx-t.targetIdx);for(const e of l)switch(o||(o="series-grouping"===e.status),n||(n=null!=e.diff?.data),a||(a="no-op"!==e.status),e.status){case"add":{const t=this.createSeries(e.opts);r.push(t),dh("Chart.applySeries() - created new series",t);break}case"remove":dh(`Chart.applySeries() - removing series at previous idx ${e.idx}`,e.series);break;case"no-op":r.push(e.series),dh(`Chart.applySeries() - no change to series at previous idx ${e.idx}`,e.series);break;default:{const{series:t,diff:i,idx:s}=e;dh(`Chart.applySeries() - applying series diff previous idx ${s}`,i,t),this.applySeriesValues(t,i),t.markNodeDataDirty(),r.push(t)}}return this.initSeriesDeclarationOrder(r),dh("Chart.applySeries() - final series instances",r),e.series=r,o?"series-grouping-change":n?"data-change":a?"updated":"no-op"}applyAxes(e,t,i,s,r=[]){if(!("axes"in t)||!t.axes)return!1;r=["axes[].type",...r];const n=t.axes.map(e=>"time"===e.type&&null!=e.unit?{...e,type:"unit-time"}:e);return"replaced"!==s&&e.axes.length===n.length&&e.axes.every((e,t)=>e.type===n[t].type)&&Ql(i)?(e.axes.forEach((e,t)=>{const s=Ft(i.axes?.[t]??{},n[t]);dh(`Chart.applyAxes() - applying axis diff idx ${t}`,s),Ut(e,s,{path:`axes[${t}]`,skip:r})}),!0):(dh(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),e.axes=this.createAxis(n,r),!0)}createSeries(e){const t=ta.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(t,e),this.applySeriesValues(t,e),t}applySeriesOptionModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();for(const r of c.byType("series-option"))r.optionsKey in t&&r.seriesTypes.includes(e.type)&&s.addModule(r,e=>e.moduleFactory(i))}applySeriesValues(e,t){const i=e.getModuleMap(),{type:s,data:r,listeners:n,seriesGrouping:o,showInMiniChart:a,...l}=t;for(const e of Ko)if("series-option"===e.type&&e.optionsKey in l){const t=i.getModule(e.optionsKey);if(t){const i=l[e.optionsKey];delete l[e.optionsKey],t.properties.set(i)}}null!=l.visible&&(e.visible=l.visible),e.properties.set(l),"data"in t&&e.setOptionsData(r),n&&this.registerListeners(e,n,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in t&&(e.seriesGrouping=null==o?void 0:{...e.seriesGrouping,...o})}createAxis(e,t){const i=[],s=this.getModuleContext();for(let r=0;r<e.length;r++){const n=e[r],o=jo.create(n.type,s);this.applyAxisModules(o,n),Ut(o,n,{path:`axes[${r}]`,skip:t}),i.push(o)}return function(e){const t=[],i=[],s=[...Yl];for(const s of e)s instanceof $l&&(ql(s.position)?i.push(s.position):t.push(s));for(const e of t){let t;do{t=s.pop()}while(t&&i.includes(t));if(null==t)break;e.position=t}}(i),i}applyAxisModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();for(const r of c.byType("axis-option")){const n=null!=t[r.optionsKey];n!==s.isEnabled(r)&&(n?(s.addModule(r,e=>e.moduleFactory(i)),e[r.optionsKey]=s.getModule(r)):(s.removeModule(r),delete e[r.optionsKey]))}}registerListeners(e,t,i){e.clearEventListeners();for(const[r,n]of(0,s.jO)(t))if((0,s.Tn)(n)){const t=i?.[r];null==t?e.addEventListener(r,n):e.addEventListener(t,e=>{if(e?.type===t){const t=new Proxy(e,{get:(e,t,i)=>"type"===t?r:Reflect.get(e,t,i)});n(t)}else n(e)})}}};ph.chartsInstances=new WeakMap,a([li({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),ph.chartsInstances.set(e,this))},oldValue(e){ph.chartsInstances.delete(e)}})],ph.prototype,"container",2),a([li({newValue(e){this.resize("width option",{inWidth:e})}})],ph.prototype,"width",2),a([li({newValue(e){this.resize("height option",{inHeight:e})}})],ph.prototype,"height",2),a([li({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],ph.prototype,"minWidth",2),a([li({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],ph.prototype,"minHeight",2),a([li({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],ph.prototype,"overrideDevicePixelRatio",2),a([Te],ph.prototype,"padding",2),a([Te],ph.prototype,"seriesArea",2),a([Te],ph.prototype,"keyboard",2),a([Te],ph.prototype,"touch",2),a([Te],ph.prototype,"mode",2),a([Te],ph.prototype,"styleNonce",2),a([ni("chartCaptions.title")],ph.prototype,"title",2),a([ni("chartCaptions.subtitle")],ph.prototype,"subtitle",2),a([ni("chartCaptions.footnote")],ph.prototype,"footnote",2),a([Te],ph.prototype,"suppressFieldDotNotation",2),a([Te],ph.prototype,"loadGoogleFonts",2),a([li({changeValue(e,t){this.onAxisChange(e,t)}})],ph.prototype,"axes",2),a([li({changeValue(e,t){this.onSeriesChange(e,t)}})],ph.prototype,"series",2);var gh=ph,mh=v.create(!0,"opts"),fh="AG Charts - Chart was destroyed, cannot perform request.",yh=class{constructor(e,t,i){this.factoryApi=t,this.licenseManager=i,this.chart=e}async update(e){if(!this.chart)throw new Error(fh);return mh.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await(this.chart?.waitForUpdate())})}async updateDelta(e){if(!this.chart)throw new Error(fh);return mh.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await(this.chart?.waitForUpdate())})}getOptions(){if(!this.chart)throw new Error(fh);const e=Bt(this.chart.getOptions());for(const t of Object.keys(e))t.startsWith("_")&&delete e[t];return e}waitForUpdate(){if(!this.chart)throw new Error(fh);return this.chart.waitForUpdate()}async download(e){if(!this.chart)throw new Error(fh);const t=await this.prepareResizedChart(this,this.chart,e);try{t.chart?.download(e?.fileName,e?.fileFormat)}finally{t.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(fh);const t=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return t?.chart?.toSVG()}finally{t?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(fh);const t=await this.prepareResizedChart(this,this.chart,e);try{return t.chart.getCanvasDataURL(e?.fileFormat)}finally{t.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const{chart:t}=this;if(!t)return;const i=this.getEnabledOriginators();i.includes(t.ctx.legendManager)?(await this.setStateOriginators(e,i.filter(e=>e!==t.ctx.zoomManager)),await this.setStateOriginators(e,[t.ctx.zoomManager])):await this.setStateOriginators(e,i)}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,t,i={}){const s=i.width??t.width??t.ctx.scene.canvas.width,r=i.height??t.height??t.ctx.scene.canvas.height,n=e.getState(),o=c.hasEnterpriseModules(),a={...t.chartOptions.processedOverrides,container:document.createElement("div"),width:s,height:r};null!=i.width&&null!=i.height&&(a.overrideDevicePixelRatio=1);const l=t.getOptions();o&&(a.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(a.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...t.chartOptions.specialOverrides},d={...t.chartOptions.optionMetadata},u=this.factoryApi.create(l,a,h,d);await u.setState(n),u.chart?.ctx.zoomManager.updateZoom("chartProxy",t.ctx.zoomManager.getZoom()),u.chart?.ctx.legendManager.clearData(),u.chart?.ctx.legendManager.update(t.ctx.legendManager.getData()),t.series.forEach((e,t)=>{u.chart.series[t].visible=e.visible});const p=[];for(const e of t.modulesManager.legends())p.push(e.legend.pagination?.currentPage??0);for(const e of u.chart.modulesManager.legends()){const t=p.shift()??0;e.legend.pagination&&e.legend.pagination.setPage(t)}return u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:t},ctx:{annotationManager:i,chartTypeOriginator:s,zoomManager:r,legendManager:n}}=this.chart,o=[];return"annotations"in e&&e.annotations?.enabled&&o.push(i),"price-volume"===t.presetType&&o.push(s),(e.navigator?.enabled||e.zoom?.enabled)&&o.push(r),"legend"in this.chart&&o.push(n),o}async setStateOriginators(e,t){this.factoryApi.caretaker.restore(e,...t),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await(this.chart?.waitForUpdate())}};yh.chartInstances=new WeakMap,a([li({oldValue(e){e.destroyed||(e.publicApi=void 0),yh.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,yh.chartInstances.set(e,this))}})],yh.prototype,"chart",2);var vh=yh,Ch=class extends l{constructor(e){super(),this.ctx=e,this.localeText=void 0}};a([ci(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),Te],Ch.prototype,"localeText",2),a([ci(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),Te],Ch.prototype,"getLocaleText",2);var bh={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Ch(e)};function Sh(e,t,i){if(null==i||0===i[0]&&1===i[1])return{ticks:e,count:e.length};const r=(0,s.qE)(0,Math.floor(i[0]*e.length),e.length),n=(0,s.qE)(0,Math.ceil(i[1]*e.length),e.length),o=t?e.length-n:r,a=t?e.length-r:n;return{ticks:e.slice(o,a),count:e.length}}var wh=class e extends to{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}static is(t){return t instanceof e}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index=void 0)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let t;const i=new Set;let s=!0;for(const r of e)i.has(r)||(i.add(r),null==t?t=xh(r):(s&&(s=Eh(r,t)),t=xh([...t,...r])));return t??(t=[]),{domain:t,animatable:s}}toDomain(e){}invert(e,t=!1){this.refresh();const i=t?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,e-i));return t||e===this.ordinalRange(s)?this.domain[s]:void 0}ticks(e,t=this.domain,i){return Sh(t,!1,i)}findIndex(e){let{index:t}=this;if(null==t){const{domain:e}=this;t=new Map;for(let i=0;i<e.length;i++)t.set(Zn(e[i]),i);this.index=t}return t.get(Zn(e))}};function xh(e){let t;const i=new Set;for(const s of e){const r=Zn(s),n=i.size;i.add(r),i.size!==n?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function Eh(e,t){let i=-1;for(const s of e){const e=t.indexOf(s);if(-1===e)i=1/0;else{if(e<=i)return!1;i=e}}return!0}var Mh=class e extends $l{constructor(e,t=new wh){super(e,t),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(t){return t instanceof e}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:t}=this;if(!(0,s.Bf)(e)||!(0,s.Bf)(t)){const i=this.reduceBandScalePadding();e??(e=i.inner),t??(t=i.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=t??0}reduceBandScalePadding(){return this.boundSeries.reduce((e,t)=>{const i=t.getBandScalePadding?.();return i&&(e.inner>i.inner&&(e.inner=i.inner),e.outer<i.outer&&(e.outer=i.outer)),e},{inner:1/0,outer:-1/0})}};Mh.className="CategoryAxis",Mh.type="category",a([Te],Mh.prototype,"groupPaddingInner",2),a([Te],Mh.prototype,"paddingInner",2),a([Te],Mh.prototype,"paddingOuter",2);var Ah=Mh,Th=class e extends wh{static is(t){return t instanceof e}normalizeDomains(...e){const{domain:t}=super.normalizeDomains(...e);return{domain:t,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const t=JSON.stringify(e),i=this._domain.find(e=>JSON.stringify(e)===t);if(null!=i)return super.findIndex(i)}};function Dh(e){if(0===e.length)return null;let t=1/0,i=-1/0;for(const s of e){const e=s instanceof Date?s.getTime():s;"number"==typeof e&&(e<t&&(t=e),e>i&&(i=e))}const s=[t,i];return s.every(isFinite)?s:null}function Ih(e,t,i){let s=!1;return e.length>2&&(e=Dh(e)??[NaN,NaN]),null!=t&&(s||(s=t>e[0]),e=[t,e[1]]),null!=i&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:s}}var Rh=new WeakMap;function Ph(e,t){const i=JSON.stringify(e,null,0);return Rh.has(t)||Rh.set(t,new Map),Rh.get(t)?.has(i)||Rh.get(t)?.set(i,t(e)),Rh.get(t)?.get(i)}function kh(e,t){const i=new Map,s={},r=new WeakMap;return(...n)=>{const o=0===n.length?[s]:((...e)=>e.map(e=>"object"==typeof e||"symbol"==typeof e?e:(i.has(e)||i.set(e,{v:e}),i.get(e))))(...n);let a=r;for(const e of o.slice(0,-1))a.has(e)||a.set(e,new WeakMap),a=a.get(e);const l=o.at(-1);let c=a.get(l);return c?t?.("hit",e,n):(c=e(...n),a.set(l,c),t?.("miss",e,n)),c}}function Lh(e,t=[0,0]){for(const i of e)"number"==typeof i&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function Nh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>Lh(e)}}function _h(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:e=>Lh(e),groupAggregateFunction:(e,t=[0,0])=>(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0,t)}}function Oh(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,t=[0,0])=>(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0,t)}}function Fh(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:e=>Lh(e),groupAggregateFunction:(e,t=[0,0,-1])=>(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0,t[2]++,t),finalFunction:(e=[0,0,0])=>{const t=e[0]+e[1];return t>=0?[0,t/e[2]]:[t/e[2],0]}}}function Gh(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(e,i=[])=>{const s=i[1]-i[0];return t.aggregateFunction(e).map(e=>e/s)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function Bh(e){return()=>{let t=0;return i=>(0,s.Bf)(i)?(t+=e?Math.max(0,i):i,t):i}}function Vh(){return()=>{let e=0;return t=>{if(!(0,s.Bf)(t))return t;const i=e;return e+=t,i}}}function Hh(e){return null!=e&&sl(e)}function Uh(e){return null!=e}function zh(e){switch(e){case"number":case"log":case"ordinal-time":case"unit-time":case"time":case"color":return Hh;default:return Uh}}function Wh(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function jh(e,t,i={}){return{property:e,type:"key",valueType:Wh(t),validation:zh(t),...i}}function Kh(e,t,i={}){return{property:e,type:"value",valueType:Wh(t),validation:zh(t),...i}}function $h(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}var Yh=function(e){return e};function qh(...e){const t=e.filter(e=>null!=e);return 0===t.length?()=>Yh:1===t.length?t[0]:()=>{const e=t.map(e=>e());return(t,i)=>e.reduce((e,t)=>t(e,i),t)}}function Xh(e,t={}){const{min:i=-1/0,max:r=1/0,processor:n,...o}=t;return{type:"value",property:e,valueType:"range",validation:Hh,processor:qh(n,()=>e=>(0,s.Bf)(e)?(0,s.qE)(i,e,r):e),...o}}function Zh(e,t,i={}){const{onlyPositive:s,processor:r,...n}=i;return{...Kh(e,t,n),processor:qh(r,Bh(s))}}function Qh(e,t,i={}){return{...Kh(e,t,i),processor:Vh()}}function Jh(e,t,i,s,r){return[Kh(e,r,s),ud(s.groupId,t,i,s.separateNegative),...null!=s.rangeId?[(n=s.rangeId,o=s.groupId,{id:n,matchGroupIds:[o],type:"aggregate",aggregateFunction:e=>Po.extendDomain(e)})]:[]];var n,o}function ed(e,t,i){return[Kh(e,t,i),gd(i.groupId)]}var td={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s="number"==typeof i[0]?i[0]:Number(i[0]),r=Math.abs(s-e);return e=s,!isNaN(r)&&r>0&&r<t?r:t}}},id={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let e=NaN;return(t=-1/0,i)=>{const s="number"==typeof i[0]?i[0]:Number(i[0]),r=Math.abs(s-e);return e=s,!isNaN(r)&&r>0&&r>t?r:t}}},sd={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>e?.slice().sort((e,t)=>{for(let i=0;i<e.length;i++){const s=e[i]-t[i];if(0!==s)return s}return 0})};function rd({normaliseTo:e}){const t=(t,i)=>{if(0===i)return null;const s=(t??0)*e/i;return s>=0?Math.min(e,s):Math.max(-e,s)};return()=>()=>(e,i,s)=>{const r=function(e,t,i){const s=[0,0];for(const r of t){const t=e[r];for(const e of i.datumIndices[r]??[]){const i=t[e];if(null==i)continue;const r="number"==typeof i?i:Math.max(...i.map(e=>e??0)),n=r<0?0:1;s[n]=0===n?Math.min(s[n],r):Math.max(s[n],r)}}return Math.max(Math.abs(s[0]),s[1])}(e,i,s);for(const n of i)for(const i of s.datumIndices[n]??[]){const s=e[n],o=s[i];s[i]=null!=o?"number"==typeof o?t(o,r):o.map(e=>t(e,r)):void 0}}}function nd(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:Ph({normaliseTo:t},rd)}}function od({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const r=e[1]-e[0],n=(i,s,n)=>{const o=e[0]+(i-s)/n*r;return 0===n?t:o>=e[1]?e[1]:o<e[0]?e[0]:o};return()=>(t,r)=>{let[o,a]=t.domain.values[r];null!=i&&(o=i),null!=s&&(a=s);const l=a-o;t.domain.values[r]=[e[0],e[1]];const c=t.columns[r];for(let e=0;e<c.length;e+=1)c[e]=n(c[e],o,l)}}function ad(e,t,i,s,r){return{type:"property-value-processor",property:e,adjust:Ph({normaliseTo:t,rangeMin:s,rangeMax:r,zeroDomain:i},od)}}function ld(e,t,i,s){let r=3;if("category"===t.valueType)return i.length<e&&(r&=-2),r;let n=s[0]?.valueOf();for(let e=1;0!==r&&e<s.length;e++){const t=s[e]?.valueOf();(!Number.isFinite(t)||n>t)&&(r&=-3),Number.isFinite(t)&&n===t&&(r&=-2),n=t}return r}function cd(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:s}=t.defs,{input:{count:r},domain:{keys:n,values:o},keys:a,columns:l}=t;let c=3;if(0!==r){for(let e=0;0!==c&&e<i.length;e++)for(const t of i[e].scopes)c&=ld(r,i[e],n[e],a[e].get(t));for(let t=0;0!==c&&t<s.length;t++){const i=s[t];e?.includes(i.id)&&(c&=ld(r,i,o[t],l[t]))}}return{uniqueKeys:!!(1&c),orderedKeys:!!(2&c)}}}}function hd({mode:e,separateNegative:t}){return()=>()=>(i,r,n)=>{const o=[0,0];for(const a of r)for(const r of n.datumIndices[a]??[]){const n=i[a],l=n[r],c=(0,s.cI)(l)&&t?0:1;(0,s.Bf)(l)&&("normal"===e&&(o[c]+=l),n[r]=o[c],"trailing"===e&&(o[c]+=l))}}}function dd({mode:e,sum:t}){return()=>{const i=[];let r=!0;return()=>(n,o,a)=>{let l=0;for(const c of o){const o=n[c];for(const n of a.datumIndices[c]??[]){const a=o[n],h=r&&"current"===t?0:i[c];i[c]=a;const d="current"===t?a:h;(0,s.Bf)(a)&&(0,s.Bf)(h)?("normal"===e&&(l+=d),o[n]=l,"trailing"===e&&(l+=d)):o[n]=l}}r=!1}}}function ud(e,t,i,s=!1){let r;return r=t.startsWith("window")?Ph({mode:t.endsWith("-trailing")?"trailing":"normal",sum:i},dd):Ph({mode:t,separateNegative:s},hd),{type:"group-value-processor",matchGroupIds:[e],adjust:r}}function pd(){return()=>(e,t,i)=>{const s=new Float64Array(t.length);let r=0;for(const n of t){const t=e[n];for(const e of i.datumIndices[n]??[]){const i=t[e];s[r]=Number.isFinite(i)?i:NaN,r+=1,t[e]=s.subarray(0,r)}}}}function gd(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:pd}}function md(e){return e.id??e.property}function fd(e,t,i,s,r){for(const{previousIndex:n,nextIndex:o}of i){const i=e[n],a=t[o];if(i[s]!==a[r])return!1}return!0}function yd(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,r){const n=new Map,o=new Map,a=new Map,l=new Map,c=t.keys,h=s.keys,d=t.columns,u=s.columns,p=function(e,t,i){const s=new Map,r=t.defs.values;for(let t=0;t<r.length;t+=1){const i=r[t];if(!1===i.scopes?.includes(e))continue;const n=md(i);if(s.has(n))return;s.set(n,t)}const n=[],o=i.defs.values;for(let t=0;t<o.length;t+=1){const i=o[t];if(!1===i.scopes?.includes(e))continue;const r=md(i),a=s.get(r);if(null==a)return;s.delete(r),n.push({previousIndex:a,nextIndex:t})}if(0===s.size)return n}(e,t,s);if(null==p)return r;const g=Math.max(t.input.count,s.input.count);for(let r=0;r<g;r++){const g=r<t.input.count,m=r<s.input.count,f=g?Bo(c,e,r):void 0,y=null!=f?vd(f):"",v=m?Bo(h,e,r):void 0,C=null!=v?vd(v):"";if(m&&g&&y===C){fd(d,u,p,r,r)||a.set(C,r);continue}const b=l.get(C);null!=b?(!i&&fd(d,u,p,b,r)||(a.set(C,r),n.set(C,r)),l.delete(C)):m&&o.set(C,r);const S=o.get(y);null!=S?(!i&&fd(d,u,p,S,r)||(a.set(y,r),n.set(y,r)),o.delete(y)):g&&(a.delete(y),l.set(y,r))}const m={changed:o.size>0||a.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(n.keys())};return{...r,[e]:m}}}}function vd(e,...t){let i;return i=(0,s.cy)(e)?e.map(e=>rl(e)).join("___"):rl(e),("string"==typeof i||"number"==typeof i||"boolean"==typeof i||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var Cd=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},bd=class e{constructor(e="",t,i){this.label=e,this.parent=t,this.refId=i,this.position=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screen=0,this.depth=t?t.depth+1:0}insertTick(t,i){let s=this;for(let r=0;r<t.length;r++){const n=t[r],o=r!==t.length-1,{children:a}=s,l=a.find(e=>e.label===n);if(l&&o)s=l;else{const t=new e(n,s,i);t.index=a.length,a.push(t),o&&(s=t)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,t)=>t!==this.index)??[]}};function Sd(e,t,i){const s=i/(t.index-e.index);t.change-=s,t.shift+=i,e.change+=s,t.prelim+=i,t.mod+=i}function wd(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function xd(e,t){const i=e.getLeftSibling();if(i){let s=e,r=e,n=i,o=r.getLeftmostSibling(),a=r.mod,l=s.mod,c=n.mod,h=o.mod;for(;n.nextRight()&&r.nextLeft();){n=n.nextRight(),r=r.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=e;const i=n.prelim+c-(r.prelim+a)+1;i>0&&(Sd(wd(n,e,t),e,i),a+=i,l+=i),c+=n.mod,a+=r.mod,h+=o.mod,l+=s.mod}n.nextRight()&&!s.nextRight()?s.mod+=c-l:(r.nextLeft()&&!o.nextLeft()&&(o.mod+=a-h),t=e)}return t}function Ed(e){const{children:t}=e;if(t.length){let[i]=t;for(const e of t)Ed(e),i=xd(e,i);!function({children:e}){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const r=e[s];r.prelim+=t,r.mod+=t,i+=r.change,t+=r.shift+i}}(e);const s=(t[0].prelim+t.at(-1).prelim)/2,r=e.getLeftSibling();r?(e.prelim=r.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const t=e.getLeftSibling();e.prelim=t?t.prelim+1:0}}function Md(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const s of e.children)Md(s,t+e.mod,i)}function Ad(e){const{children:t}=e;let i=0;for(const e of t)Ad(e),e.children.length?i+=e.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[t.length-1].subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function Td(e){const t=new Dd,i=function(e){const t=e.reduce((e,t)=>e<t.length?t.length:e,0),i=new bd;for(let s=0;s<e.length;s++){const r=e[s];for(;r.length<t;)r.push("");i.insertTick(r,s)}return i}(e);return Ed(i),Md(i,-i.prelim,t),Ad(i),t}var Dd=class{constructor(){this.dimensions=new Cd,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:t,right:s}=this.dimensions;s!==t&&(i=e/(s-t))}return t&&(i*=-1),i}},Id=class extends De{constructor(){super(...arguments),this.enabled=!0}};a([Te],Id.prototype,"enabled",2),a([Te],Id.prototype,"avoidCollisions",2),a([Te],Id.prototype,"color",2),a([Te],Id.prototype,"spacing",2),a([Te],Id.prototype,"rotation",2),a([Te],Id.prototype,"fontStyle",2),a([Te],Id.prototype,"fontWeight",2),a([Te],Id.prototype,"fontSize",2),a([Te],Id.prototype,"fontFamily",2);var Rd=class extends De{constructor(){super(...arguments),this.enabled=!0}};a([Te],Rd.prototype,"enabled",2),a([Te],Rd.prototype,"width",2),a([Te],Rd.prototype,"stroke",2);var Pd=class extends De{constructor(){super(...arguments),this.label=new Id,this.tick=new Rd}};a([Te],Pd.prototype,"label",2),a([Te],Pd.prototype,"tick",2);var kd=class extends Ah{constructor(e){super(e,new Th),this.tickScale=new Th,this.depthOptions=new Ie(Pd),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:s,bandwidth:r}=this.scale,n=Math.abs(t[1]-t[0])-i,o=this.tickTreeLayout.scaling(n,t[0]>t[1]),a=s+r/2;let l=0;for(const t of e){const e=t.position*o;l>e&&(l=e),t.screen=e+a}for(const t of e)t.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this,r=this.horizontal?0:-90;for(let n=0;n<e;n++)t.push(i[n]?.label.enabled??s.enabled?{enabled:!0,spacing:i[n]?.label.spacing??s.spacing,rotation:i[n]?.label.rotation??(n?r:s.rotation),avoidCollisions:i[n]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>e.setProperties(t))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:f.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{step:e}=this.scale,{title:t,label:i,range:r,depthOptions:n,horizontal:o}=this,{depth:a,nodes:l}=this.tickTreeLayout,c=Math.ceil(i.fontSize/e),h=o?-i.getSideFlag():i.getSideFlag(),d=[],u=new Map,p=new _i,g=this.getDepthOptionsMap(a),m=h*g[0].spacing,y=(e,t)=>{const l=a-e.depth;if(!g[l]?.enabled||t%c!==0||!(0,s.r4)(e.screen,r))return!1;const h=this.formatTick(e.label,t-1,this.scale.domain),d=this.getLabelStyles({value:h,depth:l},n[l]?.label);return p.setProperties({...d,text:h,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",lineHeight:Ri.getLineHeight(d.fontSize),x:o?e.screen:m,y:o?m:e.screen,rotation:0}),!0},v={};l.forEach((e,t)=>{const i=a-e.depth;if(!y(e,t)||!p.getBBox())return;u.set(t,p.getBBox()),p.rotation=de(g[i]?.rotation);const{width:s,height:r}=p.getBBox(),n=o?r:s;v[i]??(v[i]=0),v[i]<n&&(v[i]=n)});const C=zl(),b=new Map;l.forEach((t,s)=>{if(0===s)return;const r=y(t,s),n=!t.children.length,l=a-t.depth;if(t.parent){const e=n?t.position:t.position-(t.leafCount-1)/2;if(!b.has(e)){const t=this.depthOptions[l]?.tick;let i=v[0];for(let e=0;e<=l;e++)i+=g[e].spacing,0!==e&&(i+=v[e]);b.set(e,{tickSize:i,tickStroke:t?.stroke,tickWidth:!1!==t?.enabled?t?.width:0})}}if(!r)return;const c=de(g[l].rotation),{width:m,height:f}=u.get(s),S=(e=>{if(0===e)return 0;let t=v[0];for(let i=1;i<=e;i++)t+=g[i].spacing,i!==e&&(t+=v[i]);return t})(l);if(p.textAlign="end",p.textBaseline="middle",p.rotation=c,o?(p.x+=m/2,p.y+=(S+he(m/2,f/2,c))*h,p.rotationCenterX=t.screen,p.rotationCenterY=p.y):(p.x+=S*h+he((g[l].spacing*h+m)/2,i.mirrored?m:0,c),p.rotationCenterX=p.x-m/2,p.rotationCenterY=t.screen),g[l].avoidCollisions){const{width:i,height:r}=p.getBBox();if((o?i:r)>(n?e:t.leafCount*e))return void u.delete(s)}const{text:w=""}=p;d.push({text:w,visible:!0,range:this.scale.range,tickId:C(w),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,rotationCenterY:p.rotationCenterY,textAlign:p.textAlign,textBaseline:p.textBaseline,x:p.x,y:p.y}),u.set(s,wt.toCanvas(p))});const{enabled:S,stroke:w,width:x}=this.line;this.lineNode.datum=o?{x1:r[0],x2:r[1],y1:0,y2:0}:{x1:0,x2:0,y1:r[0],y2:r[1]},this.lineNode.setProperties({stroke:w,strokeWidth:S?x:0});const E=[...b.values()];E.push(E[0]);const M=[this.lineNodeBBox(),f.merge(u.values()),new f(0,0,E[0].tickSize*h,0)];let A=0;if(t.enabled){const e=f.merge(M);A=o?e.height:e.width,M.push(this.titleBBox(this.scale.domain,A))}return{bbox:f.merge(M),spacing:A,separatorLayout:E,tickLabelLayout:d}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:s}=this,{separatorLayout:r,spacing:n}=this.computedLayout,{position:o,horizontal:a,gridPadding:l}=this,c="bottom"===o||"right"===o?-1:1,h=l,d=c*s-l,u=e.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).ticks.map((t,i)=>({tickId:vd(t,i),offset:Math.round(e.convert(t))}));this.gridLineGroupSelection.update(i.enabled&&s?u.map(({tickId:e,offset:t},s)=>{const[r,n,o,l]=a?[t,t,h,d]:[h,d,t,t],{style:c,width:u}=i,{stroke:p,lineDash:g}=c[s%c.length]??{};return{tickId:e,offset:t,x1:r,y1:o,x2:n,y2:l,stroke:p,strokeWidth:u,lineDash:g}}):[]),this.tickLineGroupSelection.update(t.enabled?u.map(({tickId:e,offset:i},s)=>{const{tickSize:n=this.getTickSize(),tickStroke:o=t.stroke,tickWidth:l=t.width}=r[s]??{},h=-c*n,[d,u,p,g]=a?[i,i,0,h]:[0,h,i,i];return{tickId:e,offset:i,x1:d,y1:p,x2:u,y2:g,stroke:o,strokeWidth:l,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain,n),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:e,tickLabelLayout:t,spacing:i,bbox:s}=this.computeLayout();return this.computedLayout={separatorLayout:e,tickLabelLayout:t,spacing:i},{bbox:s,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(e=>e.visible).flatMap(t=>t.getDomain(e));this.dataDomain={domain:Dh(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(e=>(0,s.$r)((0,s.Gv)(e)&&"value"in e?e.value:e));this.tickTreeLayout=Td(i);const r=[];for(const e of this.tickTreeLayout.nodes)e.leafCount||null==e.refId||r.push(this.dataDomain.domain[e.refId]);this.scale.domain=(0,s.EG)(this.dataDomain.domain,r),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(e){const t=new Set;return e.filter(e=>{const i=(0,s.cy)(e)?JSON.stringify(e):e;return!t.has(i)&&(t.add(i),!0)})}};kd.className="GroupedCategoryAxis",kd.type="grouped-category",a([Te],kd.prototype,"depthOptions",2);var Ld={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},Nd=(e,t)=>Math.log(t)/Math.log(e);function _d(e,t,i){const s=Math.min(...t),r=Ld[e]??Nd;return s>=0?r(e,i):-r(e,-i)}var Od={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},Fd=(e,t)=>e**t;function Gd(e,t,i){const s=Math.min(...t),r=Od[e]??Fd;return s>=0?r(e,i):-r(e,-i)}var Bd=class e extends cn{constructor(e=[1,10],t=[0,1]){super(e,t),this.type="log",this.defaultClamp=!0,this.base=10,this.log=e=>_d(this.base,this.domain,e),this.pow=e=>Gd(this.base,this.domain,e)}static is(t){return t instanceof e}toDomain(e){return e}transform(e){const[t,i]=on(this.domain);return t>=0!=i>=0?NaN:t>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[t,i]=on(this.domain);return t>=0!=i>=0?NaN:t>=0?Math.exp(e):-Math.exp(-e)}niceDomain(e,t=this.domain){if(t.length<2)return[];const{base:i}=this,[s,r]=t,n=s>r?Math.ceil:Math.floor,o=s>r?Math.floor:Math.ceil;return[Gd(i,t,n(_d(i,t,s))),Gd(i,t,o(_d(i,t,r)))]}ticks({interval:e,tickCount:t=cn.defaultTickCount},i=this.domain,r){if(!i||i.length<2||t<1)return;const n=this.base,[o,a]=i,l=Math.min(o,a),c=Math.max(o,a);let h=this.log(l),d=this.log(c);if(e){const t=e=>e>=l&&e<=c,i=Math.min(Math.abs(e),Math.abs(d-h)),{ticks:s,count:n}=Ka(h,d,i,r),o=s.map(this.pow).filter(t);if(!$a(o.length,this.getPixelRange()))return{ticks:o,count:n}}if(!(0,s.Fq)(n)||d-h>=t){const e=Math.min(d-h,t),{ticks:i,count:s}=Ba(h,d,e,void 0,void 0,r);return{ticks:i.map(this.pow),count:s}}const u=[],p=l>0;h=Math.floor(h)-1,d=Math.round(d)+1;const g=an(this.range)/t;let m=1/0;for(let e=h;e<=d;e++){const t=this.convert(this.pow(e+1));for(let i=1;i<n;i++){const s=p?i:n-i+1,r=this.pow(e)*s,o=this.convert(r),a=Math.abs(m-o),h=Math.abs(o-t);r>=l&&r<=c&&(1===i||a>=g&&h>=g||0===u.length)&&(u.push(r),m=o)}}return Sh(u,p,r)}tickFormatter({specifier:e}){return null!=e?(0,s.OR)(e):String}datumFormatter(e){return this.tickFormatter(e)}},Vd=class e extends cn{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof e}static getTickStep(e,t,i){const{interval:s,tickCount:r=cn.defaultTickCount,minTickCount:n,maxTickCount:o}=i;return s??za(e,t,r,n,o)}toDomain(e){return e}ticks({interval:e,tickCount:t=cn.defaultTickCount,minTickCount:i,maxTickCount:s},r=this.domain,n){if(!r||r.length<2||t<1||!r.every(isFinite))return{ticks:[],count:0};const[o,a]=r;if(e){const t=Math.abs(e);if(!$a((a-o)/t,this.getPixelRange()))return Ka(o,a,t,n)}return Ba(o,a,t,i,s,n)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=cn.defaultTickCount}=t;let[r,n]=i;if(1===s)[r,n]=Ya(r,n);else if(s>1){const s=r>n?Math.ceil:Math.floor,o=r>n?Math.floor:Math.ceil,a=4;for(let l=0;l<a;l++){const a=r,l=n,c=e.getTickStep(r,n,t),[h,d]=i;if(r=s(h/c)*c,n=o(d/c)*c,r===a&&n===l)break}}return[r,n]}tickFormatter({ticks:e,fractionDigits:t,specifier:i}){return null!=i?ja(e,i):e=>Fs(e,t)}datumFormatter({ticks:e,fractionDigits:t,specifier:i}){return null!=i?ja(e,i):e=>Fs(e,t+1)}},Hd=class extends $l{constructor(e,t=new Vd){super(e,t)}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=Ih(e,t,i);return{domain:s,clipped:r}}};Hd.className="NumberAxis",Hd.type="number",a([Te],Hd.prototype,"min",2),a([Te],Hd.prototype,"max",2);var Ud=class extends Hd{normaliseDataDomain(e){const{min:t,max:i}=this,{extent:r,clipped:n}=Ih(e,t,i);return r[0]<0&&r[1]>0||e[0]<0&&e[1]>0?(s.Vy.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):0===r[0]||0===r[1]||0===e[0]||0===e[1]?(s.Vy.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:r,clipped:n}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new Bd)}defaultDatumFormatter(e,t){return String(e)}defaultLabelFormatter(e,t){return String(e)}};Ud.className="LogAxis",Ud.type="log";var zd=class extends De{constructor(){super(...arguments),this.enabled=!1,this.label=new vl,this.tick=new bl}};a([Te],zd.prototype,"enabled",2),a([Te],zd.prototype,"label",2),a([Te],zd.prototype,"tick",2);var Wd=class extends $l{constructor(e){super(e,new Xa),this.parentLevel=new zd,this.min=void 0,this.max=void 0,this.groupPaddingInner=.1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(e){return jd(e,this.min,this.max)}};function jd(e,t,i){let s=!1;return"number"==typeof t&&(t=new Date(t)),"number"==typeof i&&(i=new Date(i)),e.length>2&&(e=Dh(e)?.map(e=>new Date(e))??[]),t instanceof Date&&(s||(s=t>e[0]),e=[t,e[1]]),i instanceof Date&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{domain:e,clipped:s}}Wd.className="TimeAxis",Wd.type="time",a([Te],Wd.prototype,"parentLevel",2),a([Te],Wd.prototype,"min",2),a([Te],Wd.prototype,"max",2),a([Te],Wd.prototype,"groupPaddingInner",2),a([Te],Wd.prototype,"paddingInner",2),a([Te],Wd.prototype,"paddingOuter",2);var Kd=class extends Ah{constructor(e){super(e,new Ra),this.parentLevel=new zd,this.min=void 0,this.max=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}updateScale(){super.updateScale(),this.scale.interval=this.unit}normaliseDataDomain(e){return jd(e,this.min,this.max)}};Kd.className="UnitTimeAxis",Kd.type="unit-time",a([Te],Kd.prototype,"parentLevel",2),a([Te],Kd.prototype,"min",2),a([Te],Kd.prototype,"max",2),a([Te],Kd.prototype,"unit",2);var $d=(e,{x0:t,y0:i,x1:s,y1:r,cx:n,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==r){const l=Math.atan2(i-o,t-n),c=Math.atan2(r-o,s-n);e.arc(n,o,a,l,c)}else e.lineTo(t,i)},Yd=1e-6,qd=(e,t,i,s,r)=>{let n=!1,o=!1,a=s-Math.sqrt(Math.max(r**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(r**2-s**2,0));return a>e?(n=!0,a=e,l=i-Math.sqrt(Math.max(r**2-(s-e)**2))):a<Yd&&(a=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(r**2-(i-t)**2)),h=t):h<Yd&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:n,trailingClipped:o}},Xd=(e,t,i,s,r,n,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=n;const d=Math.max(a+h,l+c),u=Math.max(a+l,h+c);if(d<=0&&u<=0)return void(null==o?e.rect(t,i,s,r):e.rect(o.x,o.y,o.width,o.height));if(null==o&&a===l&&a===c&&a===h)return void e.roundRect(t,i,s,r,a);if(s<0&&(t+=s,s=Math.abs(s)),r<0&&(i+=r,r=Math.abs(r)),s<=0||r<=0)return;if(null==o)o=new f(t,i,s,r);else{const e=Math.max(t,o.x),n=Math.min(t+s,o.x+o.width),a=Math.max(i,o.y),l=Math.min(i+r,o.y+o.height);o=new f(e,a,n-e,l-a)}const p=Math.max(d/r,u/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g,m,y,v,C=!0,b=!0,S=!0,w=!0;if(C){const e=qd(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);e.leadingClipped&&(w=!1),e.trailingClipped&&(b=!1),g={x0:Math.max(o.x+e.leading1,o.x),y0:Math.max(o.y+e.leading0,o.y),x1:Math.max(o.x+e.trailing1,o.x),y1:Math.max(o.y+e.trailing0,o.y),cx:t+a,cy:i+a}}if(b){const e=qd(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);e.leadingClipped&&(C=!1),e.trailingClipped&&(S=!1),m={x0:Math.min(o.x+o.width-e.leading0,o.x+o.width),y0:Math.max(o.y+e.leading1,o.y),x1:Math.min(o.x+o.width-e.trailing0,o.x+o.width),y1:Math.max(o.y+e.trailing1,o.y),cx:t+s-l,cy:i+l}}if(S){const e=qd(o.height,o.width,Math.max(o.x+o.width-(t+s-c),0),Math.max(o.y+o.height-(i+r-c),0),c);e.leadingClipped&&(b=!1),e.trailingClipped&&(w=!1),y={x0:Math.min(o.x+o.width-e.leading1,o.x+o.width),y0:Math.min(o.y+o.height-e.leading0,o.y+o.height),x1:Math.min(o.x+o.width-e.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-e.trailing0,o.y+o.height),cx:t+s-c,cy:i+r-c}}if(w){const e=qd(o.width,o.height,Math.max(o.y+o.height-(i+r-h),0),Math.max(t+h-o.x,0),h);e.leadingClipped&&(S=!1),e.trailingClipped&&(C=!1),v={x0:Math.max(o.x+e.leading0,o.x),y0:Math.min(o.y+o.height-e.leading1,o.y+o.height),x1:Math.max(o.x+e.trailing0,o.x),y1:Math.min(o.y+o.height-e.trailing1,o.y+o.height),cx:t+h,cy:i+r-h}}let x=!1;C&&null!=g&&($d(e,g,a,!x),x||(x=!0)),b&&null!=m&&($d(e,m,l,!x),x||(x=!0)),S&&null!=y&&($d(e,y,c,!x),x||(x=!0)),w&&null!=v&&$d(e,v,h,!x),e.closePath()},Zd=class extends bc{constructor(){super(...arguments),this.borderPath=new Je,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=dt.defaultStyles.strokeWidth,this.effectiveStrokeWidth=dt.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:r,bottomRightCornerRadius:n,bottomLeftCornerRadius:o}=this;let{x:a,y:l,width:c,height:h,strokeWidth:d,clipBBox:u}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let g=1;if(e.clear(!0),t.clear(!0),i&&(c<=p&&(g*=c/p),h<=p&&(g*=h/p),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),u=null!=u?new f(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height)):void 0),d)if(c<p){const e=a+p/2;t.moveTo(e,l),t.lineTo(e,l+h),d=p,this.borderClipPath=void 0}else if(h<p){const e=l+p/2;t.moveTo(a,e),t.lineTo(a+c,e),d=p,this.borderClipPath=void 0}else if(d<c&&d<h){const i=d/2;a+=i,l+=i,c-=d,h-=d;const p=u?.clone().shrink(i),g={topLeft:s>0?s-d:0,topRight:r>0?r-d:0,bottomRight:n>0?n-d:0,bottomLeft:o>0?o-d:0};this.borderClipPath=void 0,c>0&&h>0&&(null==p||p?.width>0&&p?.height>0)&&(Xd(e,a,l,c,h,g,p),Xd(t,a,l,c,h,g,p))}else this.borderClipPath=this.borderClipPath??new Je,this.borderClipPath.clear(!0),this.borderClipPath.rect(a,l,c,h),t.rect(a,l,c,h);else{const t={topLeft:s,topRight:r,bottomRight:n,bottomLeft:o};this.borderClipPath=void 0,Xd(e,a,l,c,h,t,u)}if([s,r,n,o].every(e=>0===e)){const e=this.getBBox();this.hittester=e.containsPoint.bind(e),this.distanceSquared=(e,t)=>this.getBBox().distanceSquared(e,t)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=g}computeBBox(){const{x:e,y:t,width:i,height:s,clipBBox:r}=this;return r?.clone()??new f(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:t}=e,{lineDash:s,lineDashOffset:r,lineCap:n,lineJoin:o,borderPath:a,borderClipPath:l}=this;l&&e.clip(l.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,s&&e.setLineDash(s),r&&(e.lineDashOffset=r),n&&(e.lineCap=n),o&&(e.lineJoin=o),e.stroke(a.getPath2D()),e.globalAlpha=t}}};Zd.className="Rect",a([$()],Zd.prototype,"x",2),a([$()],Zd.prototype,"y",2),a([$()],Zd.prototype,"width",2),a([$()],Zd.prototype,"height",2),a([$()],Zd.prototype,"topLeftCornerRadius",2),a([$()],Zd.prototype,"topRightCornerRadius",2),a([$()],Zd.prototype,"bottomRightCornerRadius",2),a([$()],Zd.prototype,"bottomLeftCornerRadius",2),a([Y({equals:h.equals})],Zd.prototype,"clipBBox",2),a([$()],Zd.prototype,"crisp",2);var Qd=class extends l{constructor(e){super(),this.ctx=e,this.rectNode=new Zd,this.textNode=new Li,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(e.scene.attachNode(this.node),e.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new At({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};a([Te,ai("node","visible")],Qd.prototype,"visible",2),a([Te,ai("rectNode","fill")],Qd.prototype,"fill",2),a([Te],Qd.prototype,"image",2),a([Te,ai("textNode")],Qd.prototype,"text",2);var Jd={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Qd(e)};function eu({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:r=0,itemPaddingX:n=0,forceResult:o=!1}){const a="horizontal"===e,l={max:a?s:i,fn:a?e=>e.width:e=>e.height,padding:a?n:r},c={max:a?i:s,fn:a?e=>e.height:e=>e.width,padding:a?r:n};let h=0;const d=[];for(;h<t.length;){const e=tu(t.slice(h),h,l,c,o);if(!e)return;h+=e.processedBBoxCount,d.push(e.pageIndices)}return function(e,t,i,s,r){let n=0,o=0;return{pages:e.map(e=>{"horizontal"===t&&(e=function(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((e,i)=>{e.forEach((e,s)=>{t[s][i]=e})}),t}(e));let a=0;const l=e.map(e=>{const t=e.map(e=>(a=Math.max(e,a),i[e]));let n=0,o=0;return t.forEach(e=>{n+=e.height+s,o=Math.max(o,e.width+r)}),{indices:e,bboxes:t,columnHeight:Math.ceil(n),columnWidth:Math.ceil(o)}});let c=0,h=0;return l.forEach(e=>{c+=e.columnWidth,h=Math.max(h,e.columnHeight)}),n=Math.max(c,n),o=Math.max(h,o),{columns:l,startIndex:e[0][0],endIndex:a,pageWidth:c,pageHeight:h}}),maxPageWidth:n,maxPageHeight:o}}(d,e,t,r,n)}function tu(e,t,i,s,r){let n=function(e,t){const i=e.length;let s=0;for(let r=0;r<i;r++)if(s+=t.fn(e[r])+t.padding,s>t.max)return i/r<2?Math.ceil(i/2):r;return i}(e,i);if(n<1){if(!r)return;n=1}let o=n;for(;o>=1;){const n=iu(e,t,o,i,s,r);if(null==n&&o<=1)return;if(null!=n){if("number"!=typeof n)return{processedBBoxCount:n.length*n[0].length,pageIndices:n};if(n<=1)return;o=n<o&&n>1?n:o,o--}else o--}}function iu(e,t,i,s,r,n){const o=[];let a=0,l=0,c=[];const h=[];for(let d=0;d<e.length;d++){const u=(d+i)%i;0===u&&(a+=l,l=0,c.length>0&&o.push(c),c=[]);const p=s.fn(e[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,r.fn(e[d])+r.padding);const g=a+l,m=!n||o.length>0;if(g>r.max&&m){c=[];break}if(h.reduce((e,t)=>e+t,0)>s.max&&!n)return h.length<i?h.length:void 0;c.push(d+t)}return c.length>0&&o.push(c),o.length>0?o:void 0}var su=class extends De{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};a([Te],su.prototype,"color",2),a([Te],su.prototype,"fontStyle",2),a([Te],su.prototype,"fontWeight",2),a([Te],su.prototype,"fontSize",2),a([Te],su.prototype,"fontFamily",2);var ru=class extends De{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};a([Te],ru.prototype,"size",2),a([Te],ru.prototype,"fill",2),a([Te],ru.prototype,"fillOpacity",2),a([Te],ru.prototype,"stroke",2),a([Te],ru.prototype,"strokeWidth",2),a([Te],ru.prototype,"strokeOpacity",2);var nu=class extends De{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};a([li({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],nu.prototype,"shape",2),a([Te],nu.prototype,"size",2),a([Te],nu.prototype,"padding",2);var ou=class extends De{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=(0,s.sX)(this),this.marker=new nu(this),this.activeStyle=new ru,this.inactiveStyle=new ru,this.highlightStyle=new ru,this.label=new su,this.group=new It({name:"pagination"}),this.labelNode=new Li,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new _c,this.previousButton=new _c,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){this._orientation=e,"horizontal"===e?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+2*(this.marker.size/2+this.marker.padding)}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:r,inactiveStyle:n,highlightStyle:o,highlightActive:a}=this,l=(e,t)=>t?n:e===a?o:r;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=0===t,s=e===t-1,r=0===e;this.nextButtonDisabled=s||i,this.previousButtonDisabled=r||i}setPage(e){e=(0,s.qE)(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),"next"!==t||this.nextButtonDisabled?"previous"!==t||this.previousButtonDisabled||(this.decrementPage(),this.onPaginationChanged()):(this.incrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(7)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(7)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){return{prev:wt.toCanvas(this.previousButton),next:wt.toCanvas(this.nextButton)}}};ou.className="Pagination",a([Te],ou.prototype,"marker",2),a([Te],ou.prototype,"activeStyle",2),a([Te],ou.prototype,"inactiveStyle",2),a([Te],ou.prototype,"highlightStyle",2),a([Te],ou.prototype,"label",2);var au=class{constructor(e,t){this.dirty=!0,this.destroyFns=new Ki,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=(0,s.n)("p"),this.itemDescription.style.display="none",this.itemDescription.id=(0,s.wW)(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:r}=e,n=t.localeManager,o=i.length;i.each((e,i,a)=>{e.proxyButton?.destroy(),e.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(n,s.getItemLabel(i),a,o),ariaChecked:!!e.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const l=e.proxyButton;l.addListener("click",t=>r.onClick(t.sourceEvent,e.datum,l)),l.addListener("dblclick",t=>r.onDoubleClick(t.sourceEvent,e.datum)),l.addListener("mouseenter",t=>r.onHover(t.sourceEvent,e)),l.addListener("mouseleave",()=>r.onLeave()),l.addListener("contextmenu",t=>r.onContextClick(t,e)),l.addListener("blur",()=>r.onLeave()),l.addListener("focus",t=>r.onHover(t.sourceEvent,e)),l.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const r=wt.toCanvas(t);this.itemList.setBounds(r);const n=Math.max(...e.nodes().map(e=>e.getBBox().height));e.each((e,t)=>{if(e.proxyButton){const t=e.pageIndex===i.currentPage,{x:o,y:a,height:l,width:c}=wt.toCanvas(e),h=(n-l)/2,d={x:o-r.x,y:a-h-r.y,height:n,width:c},u=s&&t;e.proxyButton.setCursor("pointer"),e.proxyButton.setEnabled(u),e.proxyButton.setPointerEvents(u?void 0:"none"),e.proxyButton.setBounds(d)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:t,oldPages:s,newPages:r}=e,n=(s?.length??r.length)>1,o=r.length>1;n!==o&&(o?(this.prevButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",t=>this.onPageButton(e,t,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",t=>this.onPageButton(e,t,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:r}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(r),this.prevButton?.setEnabled(0!==i.currentPage),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,r)=>{const[n,o]=[t[s],e[s]];return n.id!==o.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:t},r,n)=>{const o=t?.getElement();if(null!=o){const t=i.getItemLabel(r);o.textContent=this.getItemAriaText(e,t,n,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function lu(e,t,i,s){const r={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:s,preventDefault:()=>r.defaultPrevented=!0}};return r}var cu=class extends(bt(At)){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new At({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new Li),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new _c({zIndex:1})),this.line=this.symbolsGroup.appendChild(new pa({zIndex:0}));const{label:e,line:t,symbolsGroup:i}=this;t.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),f.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let r=0,n=0;if(e.visible){const{size:t}=e,o=_c.anchor(e.shape);r=(o.x-.5)*t+i/2,n=(o.y-.5)*t,s?(e.x=0,e.y=0,e.translationX=r,e.translationY=n):(e.x=r,e.y=n,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};cu.className="MarkerLabel",a([ai("label")],cu.prototype,"text",2),a([ai("label")],cu.prototype,"fontStyle",2),a([ai("label")],cu.prototype,"fontWeight",2),a([ai("label")],cu.prototype,"fontSize",2),a([ai("label")],cu.prototype,"fontFamily",2),a([ai("label","fill")],cu.prototype,"color",2),a([ci(e=>e.layoutLabel())],cu.prototype,"spacing",2),a([ci(e=>e.layoutLabel())],cu.prototype,"length",2),a([$()],cu.prototype,"isCustomMarker",2);var hu=class extends De{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};a([Te],hu.prototype,"maxLength",2),a([Te],hu.prototype,"color",2),a([Te],hu.prototype,"fontStyle",2),a([Te],hu.prototype,"fontWeight",2),a([Te],hu.prototype,"fontSize",2),a([Te],hu.prototype,"fontFamily",2),a([Te],hu.prototype,"formatter",2);var du=class extends De{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};a([Te],du.prototype,"shape",2),a([Te],du.prototype,"size",2),a([Te],du.prototype,"padding",2),a([Te],du.prototype,"strokeWidth",2),a([Te],du.prototype,"enabled",2);var uu=class extends De{};a([Te],uu.prototype,"strokeWidth",2),a([Te],uu.prototype,"length",2);var pu=class extends De{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new du,this.label=new hu,this.line=new uu}};a([Te],pu.prototype,"maxWidth",2),a([Te],pu.prototype,"paddingX",2),a([Te],pu.prototype,"paddingY",2),a([Te],pu.prototype,"showSeriesStroke",2),a([Te],pu.prototype,"marker",2),a([Te],pu.prototype,"label",2),a([Te],pu.prototype,"line",2);var gu=class extends De{};a([Te],gu.prototype,"legendItemClick",2),a([Te],gu.prototype,"legendItemDoubleClick",2);var mu={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},fu={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:0,rotation:0,scale:1},yu={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},vu=class extends De{constructor(e){super(),this.ctx=e,this.id=(0,s.sX)(this),this.group=new It({name:"legend",zIndex:14}),this.itemSelection=ua.select(this.group,cu),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new pu,this.listeners=new gu,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new ou(t=>e.updateService.update(t),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=e=>this.contextToggleVisibility(e),t["toggle-other-series"].action=e=>this.contextToggleOtherSeries(e),this.destroyFns.push(e.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,e.layoutManager.registerElement(1,e=>this.positionLegend(e)),e.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new au(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){k(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(e=>!e.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(e=>e()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){return this.orientation??"horizontal"}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:r,maxWidth:n,label:{maxLength:o=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,d=[...this.data];this.reverseOrder&&d.reverse(),this.itemSelection.update(d);const u=[],p=Ri.toFontString(r),g=n??.8*e,{markerWidth:m,anyLineEnabled:f}=this.calculateMarkerWidth();if(this.itemSelection.each((e,t)=>{e.fontStyle=a,e.fontWeight=l,e.fontSize=c,e.fontFamily=h;const i=this.updateMarkerLabel(e,t,m,f),s=t.itemId??t.id,r=(this.getItemLabel(t)??"<unknown>").replace(/\r?\n/g," ");e.text=this.truncate(r,o,g,i,p,s),u.push(e.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};const y=this.size,v=this.oldSize;y[0]=e,y[1]=t,y[0]===v[0]&&y[1]===v[1]||(v[0]=y[0],v[1]=y[1]);const{pages:C,maxPageHeight:b,maxPageWidth:S}=this.updatePagination(u,e,t),w=this.pages;this.pages=C,this.maxPageSize=[S-i,b-s];const x=this.pagination.currentPage,E=this.pages[x];return this.pages.length<1||!E?(this.visible=!1,{oldPages:w}):(this.visible=!0,this.updatePositions(x),this.update(),{oldPages:w})}isCustomMarker(e,t){return e&&void 0!==t&&"string"!=typeof t}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0);return{markerEnabled:s,lineEnabled:!(!e.line||!t),isCustomMarker:this.isCustomMarker(s,e.marker.shape)}}calcSymbolsLengths(e,t,i){const{marker:s,line:r}=this.item;let n;const{shape:o}=e.marker;if(this.isCustomMarker(t,o)){const e=new _c;e.shape=o,e.updatePath();const t=e.getBBox();n=Math.max(t.width,t.height)}return{markerLength:t?s.size:0,lineLength:i?r.length??25:0,customMarkerSize:n}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,s)=>{const{symbol:r}=s,{lineEnabled:n,markerEnabled:o}=this.calcSymbolsEnabled(r),{markerLength:a,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(r,o,n);e=Math.max(e,l,c,a),t||(t=n)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,s){const{marker:r,paddingX:n}=this.item,{symbol:o}=t;let a=n;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),h=r.padding;(l||s)&&(a+=h+i);const{marker:d,line:u}=e;return d.visible=l,d.visible&&(d.shape=r.shape??o.marker.shape??"square",d.size=r.size,mc(d,this.getMarkerStyles(o))),u.visible=s,u.visible&&mc(u,this.getLineStyles(o)),e.length=i,e.spacing=h,e.isCustomMarker=c,a}truncate(e,t,i,s,r,n){let o=!1;e.length>t&&(e=e.substring(0,t),o=!0);const a=Di.getMeasurer({font:r}),l=Oi.truncateLine(e,a,i-s,o);return l.endsWith(Ri.EllipsisChar)?this.truncatedItems.add(n):this.truncatedItems.delete(n),l}updatePagination(e,t,i){const r=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=r,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:o,maxPageHeight:a,maxPageWidth:l,paginationBBox:c,paginationVertical:h}=this.calculatePagination(e,t,i),d=o.findIndex(e=>e.endIndex>=n);this.pagination.currentPage=(0,s.qE)(0,d,o.length-1);const{paddingX:u,paddingY:p}=this.item,g=l-u,m=a-p;let f=0,y=-c.y-this.item.marker.size/2;h?y+=m+8:(f+=-c.x+g+8,y+=(m-c.height)/2),this.pagination.translationX=f,this.pagination.translationY=y,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((e,t,i)=>{i>(o[v]?.endIndex??1/0)&&v++,e.pageIndex=v}),{maxPageHeight:a,maxPageWidth:l,pages:o}}calculatePagination(e,t,i){const{paddingX:r,paddingY:n}=this.item,o=this.getOrientation(),a=["left","right"].includes(this.position);let l=this.pagination.getBBox(),c=new f(0,0,0,0),h=[],d=0,u=0,p=0;const g=e=>e.width===l.width&&e.height===l.height,m=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(p++>10){s.Vy.warn("unable to find stable legend layout.");break}l=c;const g=t-(a?0:l.width),f=eu({orientation:o,bboxes:e,maxHeight:i-(a?l.height:0),maxWidth:g,itemPaddingY:n,itemPaddingX:r,forceResult:m});h=f?.pages??[],d=f?.maxPageWidth??0,u=f?.maxPageHeight??0;const y=h.length;if(this.pagination.visible=y>1,this.pagination.totalPages=y,this.pagination.update(),this.pagination.updateMarkers(),c=this.pagination.getBBox(),!this.pagination.visible)break}while(!g(c));return{maxPageWidth:d,maxPageHeight:u,pages:h,paginationBBox:c,paginationVertical:a}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:r,startIndex:n,endIndex:o}=s[e];let a=0,l=0;const c=r.length,h=r[0].indices.length,d="horizontal"===this.getOrientation(),u=r[0].bboxes[0].height+t,p=[];i.each((e,t,i)=>{if(i<n||i>o)return void(e.visible=!1);const s=i-n;let g,m;d?(g=s%c,m=Math.floor(s/c)):(g=Math.floor(s/h),m=s%h),e.visible=!0;const f=r[g];f&&(l=Math.floor(u*m),a=Math.floor(p[m]??0),p[m]=(p[m]??0)+f.columnWidth,e.translationX=a,e.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:r,toggleSeries:n}=this,{startIndex:o,endIndex:a}=r[e];0===o?this.paginationTrackingIndex=0:e===r.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((o+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:n}),this.ctx.updateService.update(7)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){this.ctx.contextMenuRegistry.setVisible("toggle-series-visibility",this.toggleSeries),this.ctx.contextMenuRegistry.setVisible("toggle-other-series",this.toggleSeries)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:r}=e.line??{},n=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??n,lineDash:r}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:r=1,strokeWidth:n,lineDash:o,lineDashOffset:a}=e,l=Math.min(2,n??1);return at(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),lt(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),pc({fill:t,stroke:i,strokeOpacity:s,fillOpacity:r,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},mu,fu,yu)}computePagedBBox(){const e=At.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[t,i]=this.maxPageSize;e.height=Math.max(i,e.height),e.width=Math.max(t,e.width)}return e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(t=>t.datum?.itemId===e.itemId)[0]??{};if(void 0===t||void 0===i)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i)}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum)}onContextClick(e,t){const{sourceEvent:i}=e,s=t.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const r=this.ctx.chartService.series.length>1&&!0!==this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries;this.ctx.contextMenuRegistry.setVisible("toggle-other-series",r);const{offsetX:n,offsetY:o}=i,{x:a,y:l}=wt.toCanvasPoint(t,n,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:a,canvasY:l},{legendItem:s})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:r,highlightManager:n},preventHidingAll:o,toggleSeries:a}=this;if(!t)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:d}=t,u=r.series.find(e=>e.id===c);if(!u)return!1;let p=d;const g=lu("click",h,u.id,e);return s?.(g.apiEvent),g.defaultPrevented||(a&&(p=!d,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,u,h,p,t.legendItemName)),p?n.updateHighlight(this.id,{series:u,itemId:h,datum:void 0,datumIndex:void 0}):n.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:r}=this;if(!t)return!1;const{legendType:n,id:o,itemId:a,seriesId:l}=t,c=s.series.find(e=>e.id===o);if(!c)return!1;const h=lu("dblclick",a,c.id,e);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(r){const e=s.series.flatMap(e=>e.getLegendData("category"));let t=0;const i=new Set;for(const s of e)s.enabled&&(t+=1,null!=s.legendItemName&&i.add(s.legendItemName));i.size>0&&(t=i.size);const r=e.find(e=>e.itemId===a&&e.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(n,c,a,r?.enabled??!1,t,r?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=wt.toCanvas(t).computeCenter():(e.preventDefault(),i=wt.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,s=i?this.ctx.chartService.series.find(e=>e.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const s=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,s,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(e){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,e):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=e,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{layoutBox:t}=e,{x:i,y:s,width:r,height:n}=t,[o,a]=this.calculateLegendDimensions(t),{oldPages:l}=this.calcLayout(o,a),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return n-c.height;default:return r-c.width}};if(this.visible){const e=this.spacing;let o,a;switch(this.position){case"top":case"bottom":o=(r-c.width)/2,a=h(),t.shrink(c.height+e,this.position);break;default:o=h(),a=(n-c.height)/2,t.shrink(c.width+e,this.position)}this.group.translationX=Math.floor(i+o-c.x),this.group.translationY=Math.floor(s+a-c.y)}return l}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:s,pages:r,toggleSeries:n,group:o,listeners:{legendItemClick:a,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=n||null!=l||null!=a;this.domProxy.update({visible:c,interactive:h,ctx:t,itemSelection:i,group:o,pagination:s,oldPages:e,newPages:r,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,s=t/i;let r,n;switch(this.position){case"top":case"bottom":{const e=s<1?Math.min(.5,1/s*.2):.2;r=this.maxWidth?Math.min(this.maxWidth,t):t,n=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*e);break}default:{const e=s>1?Math.min(.5,.25*s):.25;r=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*e),n=this.maxHeight?Math.min(this.maxHeight,i):i}}return[r,n]}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:s}=this.ctx;return i.call(this,s,e,...t)}};vu.className="Legend",a([Te],vu.prototype,"toggleSeries",2),a([Te],vu.prototype,"pagination",2),a([Te],vu.prototype,"item",2),a([Te],vu.prototype,"listeners",2),a([ci((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:r}}=e;!1===i&&!0===t&&r.restoreState(s)}),Te],vu.prototype,"enabled",2),a([Te],vu.prototype,"position",2),a([Te],vu.prototype,"maxWidth",2),a([Te],vu.prototype,"maxHeight",2),a([Te],vu.prototype,"reverseOrder",2),a([Te],vu.prototype,"orientation",2),a([Te],vu.prototype,"preventHidingAll",2),a([Te],vu.prototype,"spacing",2);var Cu={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new vu(e),packageType:"community",removable:"standalone-only"},bu={};o(bu,{CARTESIAN_AXIS_TYPE:()=>Eu,CARTESIAN_POSITION:()=>xu,FONT_SIZE:()=>Su,FONT_SIZE_RATIO:()=>wu,POLAR_AXIS_SHAPE:()=>Au,POLAR_AXIS_TYPE:()=>Mu});var Su=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(Su||{}),wu=(e=>(e[e.SMALLEST=.6666666666666666]="SMALLEST",e[e.SMALLER=.8333333333333334]="SMALLER",e[e.SMALL=1]="SMALL",e[e.MEDIUM=1.0833333333333333]="MEDIUM",e[e.LARGE=1.1666666666666667]="LARGE",e[e.LARGEST=1.4166666666666667]="LARGEST",e))(wu||{}),xu=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(xu||{}),Eu=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(Eu||{}),Mu=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Mu||{}),Au=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Au||{}),Tu={};o(Tu,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Zu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>ep,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>tp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ip,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>sp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Qu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Ju,DEFAULT_CAPTION_ALIGNMENT:()=>ku,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Pu,DEFAULT_FIBONACCI_STROKES:()=>Yu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Xu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>$u,DEFAULT_GRIDLINE_ENABLED:()=>lp,DEFAULT_POLAR_SERIES_STROKE:()=>ju,DEFAULT_SEPARATION_LINES_COLOUR:()=>Iu,DEFAULT_SHADOW_COLOUR:()=>Ru,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Ku,DEFAULT_TEXTBOX_COLOR:()=>op,DEFAULT_TEXTBOX_FILL:()=>rp,DEFAULT_TEXTBOX_STROKE:()=>np,DEFAULT_TEXT_ANNOTATION_COLOR:()=>qu,DEFAULT_TOOLBAR_POSITION:()=>ap,IS_DARK_THEME:()=>Du,PALETTE_ALT_DOWN_FILL:()=>Uu,PALETTE_ALT_DOWN_STROKE:()=>Vu,PALETTE_ALT_NEUTRAL_FILL:()=>zu,PALETTE_ALT_NEUTRAL_STROKE:()=>Wu,PALETTE_ALT_UP_FILL:()=>Hu,PALETTE_ALT_UP_STROKE:()=>Bu,PALETTE_DOWN_FILL:()=>Ou,PALETTE_DOWN_STROKE:()=>Nu,PALETTE_NEUTRAL_FILL:()=>Gu,PALETTE_NEUTRAL_STROKE:()=>Fu,PALETTE_UP_FILL:()=>_u,PALETTE_UP_STROKE:()=>Lu});var Du=Symbol("is-dark-theme"),Iu=Symbol("default-separation-lines-colour"),Ru=Symbol("default-shadow-colour"),Pu=Symbol("default-caption-layout-style"),ku=Symbol("default-caption-alignment"),Lu=Symbol("palette-up-stroke"),Nu=Symbol("palette-down-stroke"),_u=Symbol("palette-up-fill"),Ou=Symbol("palette-down-fill"),Fu=Symbol("palette-neutral-stroke"),Gu=Symbol("palette-neutral-fill"),Bu=Symbol("palette-alt-up-stroke"),Vu=Symbol("palette-alt-down-stroke"),Hu=Symbol("palette-alt-up-fill"),Uu=Symbol("palette-alt-down-fill"),zu=Symbol("palette-gray-fill"),Wu=Symbol("palette-gray-stroke"),ju=Symbol("default-polar-series-stroke"),Ku=Symbol("default-sparkline-crosshair-stroke"),$u=Symbol("default-financial-charts-annotation-stroke"),Yu=Symbol("default-hierarchy-strokes"),qu=Symbol("default-text-annotation-color"),Xu=Symbol("default-financial-charts-annotation-background-fill"),Zu=Symbol("default-annotation-handle-fill"),Qu=Symbol("default-annotation-statistics-fill"),Ju=Symbol("default-annotation-statistics-stroke"),ep=Symbol("default-annotation-statistics-color"),tp=Symbol("default-annotation-statistics-divider-stroke"),ip=Symbol("default-annotation-statistics-fill"),sp=Symbol("default-annotation-statistics-stroke"),rp=Symbol("default-textbox-fill"),np=Symbol("default-textbox-stroke"),op=Symbol("default-textbox-color"),ap=Symbol("default-toolbar-position"),lp=Symbol("default-gridline-enabled"),cp=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],hp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},dp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},up={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},pp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},gp={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:up,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},mp={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function fp(e){return F(e,e=>{const t=fe.fromString(e);return[fe.darken(t,.15).toString(),e,fe.lighten(t,.15).toString()]})}function yp(e,t,i,s,r){const{addPhaseFn:n,updatePhaseFn:o,removePhaseFn:a}=r,l=(s,r,n)=>{i.animate({id:`${e}_${t}_${r.id}_${s}`,groupId:e,from:0,to:1,ease:Er,collapsable:!1,onUpdate(e,t){t&&"removed"!==s||(r.path.clear(!0),n(e,r),r.checkPathDirty())},onStop(){"added"===s&&(r.path.clear(!0),n(1,r),r.checkPathDirty())},phase:oa[s]})};for(const e of s)i.isSkipped()||(l("removed",e,a),l("updated",e,o)),l("added",e,n)}function vp({id:e},t,i,...s){for(const e of s)e.cleanup();la(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Cp({id:e},t,i,...s){la(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function bp(e){return{opacity:1}}var Sp=class extends De{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},wp=class extends Sp{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};a([Te,$()],wp.prototype,"enabled",2),a([Te,$()],wp.prototype,"color",2),a([Te,$()],wp.prototype,"xOffset",2),a([Te,$()],wp.prototype,"yOffset",2),a([Te,$()],wp.prototype,"blur",2);var xp=class extends De{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};a([Te],xp.prototype,"fill",2),a([Te],xp.prototype,"fillOpacity",2),a([Te],xp.prototype,"stroke",2),a([Te],xp.prototype,"strokeWidth",2),a([Te],xp.prototype,"strokeOpacity",2),a([Te],xp.prototype,"lineDash",2),a([Te],xp.prototype,"lineDashOffset",2);var Ep=class extends De{};a([Te],Ep.prototype,"strokeWidth",2),a([Te],Ep.prototype,"dimOpacity",2),a([Te],Ep.prototype,"enabled",2);var Mp=class extends De{constructor(){super(...arguments),this.color="black"}};a([Te],Mp.prototype,"color",2);var Ap=class extends De{constructor(){super(...arguments),this.enabled=!0}};a([Te],Ap.prototype,"enabled",2);var Tp=class extends De{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};a([Te],Tp.prototype,"type",2),a([Te],Tp.prototype,"colorStops",2),a([Te],Tp.prototype,"bounds",2),a([Te],Tp.prototype,"gradient",2),a([Te],Tp.prototype,"rotation",2),a([Te],Tp.prototype,"reverse",2);var Dp=class extends De{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};a([Te],Dp.prototype,"type",2),a([Te],Dp.prototype,"colorStops",2),a([Te],Dp.prototype,"bounds",2),a([Te],Dp.prototype,"gradient",2),a([Te],Dp.prototype,"rotation",2),a([Te],Dp.prototype,"scale",2),a([Te],Dp.prototype,"reverse",2),a([Te],Dp.prototype,"path",2),a([Te],Dp.prototype,"pattern",2),a([Te],Dp.prototype,"width",2),a([Te],Dp.prototype,"height",2),a([Te],Dp.prototype,"padding",2),a([Te],Dp.prototype,"fill",2),a([Te],Dp.prototype,"fillOpacity",2),a([Te],Dp.prototype,"backgroundFill",2),a([Te],Dp.prototype,"backgroundFillOpacity",2),a([Te],Dp.prototype,"stroke",2),a([Te],Dp.prototype,"strokeOpacity",2),a([Te],Dp.prototype,"strokeWidth",2);var Ip=class extends De{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};a([Te],Ip.prototype,"type",2),a([Te],Ip.prototype,"url",2),a([Te],Ip.prototype,"rotation",2),a([Te],Ip.prototype,"scale",2),a([Te],Ip.prototype,"backgroundFill",2),a([Te],Ip.prototype,"backgroundFillOpacity",2),a([Te],Ip.prototype,"repeat",2),a([Te],Ip.prototype,"fit",2);var Rp=class extends De{constructor(){super(...arguments),this.item=new xp,this.series=new Ep,this.text=new Mp}};a([Te],Rp.prototype,"item",2),a([Te],Rp.prototype,"series",2),a([Te],Rp.prototype,"text",2);var Pp=class extends De{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Ap,this.highlightStyle=new Rp}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context"))}};a([Te],Pp.prototype,"id",2),a([Te],Pp.prototype,"visible",2),a([Te],Pp.prototype,"focusPriority",2),a([Te],Pp.prototype,"showInLegend",2),a([Te],Pp.prototype,"cursor",2),a([Te],Pp.prototype,"nodeClickRange",2),a([Te],Pp.prototype,"highlight",2),a([Te],Pp.prototype,"highlightStyle",2);var kp=class extends Sp{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:r,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,stroke:r,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};a([Te,$()],kp.prototype,"enabled",2),a([Te,Y({equals:K})],kp.prototype,"shape",2),a([Te,$()],kp.prototype,"size",2),a([Te,Y({equals:k})],kp.prototype,"fill",2),a([Te],kp.prototype,"fillGradientDefaults",2),a([Te],kp.prototype,"fillPatternDefaults",2),a([Te],kp.prototype,"fillImageDefaults",2),a([Te,$()],kp.prototype,"fillOpacity",2),a([Te,$()],kp.prototype,"stroke",2),a([Te,$()],kp.prototype,"strokeWidth",2),a([Te,$()],kp.prototype,"strokeOpacity",2),a([Te],kp.prototype,"lineDash",2),a([Te],kp.prototype,"lineDashOffset",2),a([Te,Y({equals:K})],kp.prototype,"itemStyler",2);var Lp=class extends De{constructor(){super(...arguments),this.enabled=!1}};a([Te],Lp.prototype,"enabled",2);var Np=class extends De{constructor(){super(...arguments),this.interaction=new Lp,this.position=new qc,this.range=void 0,this.class=void 0}formatTooltip(e,t,i,s){const r=null==this.renderer?void 0:ur(e,t,this.renderer,[s]);return"string"==typeof r?{type:"raw",rawHtmlString:r}:null!=r?{type:"structured",...i,...r}:{type:"structured",...i}}};a([Te],Np.prototype,"enabled",2),a([Te],Np.prototype,"showArrow",2),a([Te],Np.prototype,"renderer",2),a([Te],Np.prototype,"interaction",2),a([Te],Np.prototype,"position",2),a([Te],Np.prototype,"range",2),a([Te],Np.prototype,"class",2);var _p=class{constructor(e,t,i){this.root=new Gp(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(t,i)=>e.distanceSquared(t,i)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},Op=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},Fp=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??f.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(void 0===this.subdivisions?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:r}=this,n=this.maxdepth-1,o=i/2,a=s/2,l=new f(e,t,o,a),c=new f(e+o,t,o,a),h=new f(e,t+a,o,a),d=new f(e+o,t+a,o,a);return new Op(this.child(r,n,l),this.child(r,n,c),this.child(r,n,h),this.child(r,n,d))}},Gp=class e extends Fp{addCondition(e){const{x:t,y:i}=e.hitTester.midPoint;return this.boundary.containsPoint(t,i)}findCondition(e,t,i){const{best:s}=i;return 0!==s.distanceSquared&&this.boundary.distanceSquared(e,t)<s.distanceSquared}findAction(e,t,i){const s=p(e,t,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(t,i,s){return new e(t,i,s)}},Bp=class extends Cc{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}getScaleInformation({xScale:e,yScale:t}){return{isContinuousX:cn.is(e),isContinuousY:cn.is(t),xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:r}=await e.request(this.id,t??[],i);return this.dataModel=s,this.processedData=r,this.dispatch("data-processed",{dataModel:s,processedData:r}),{dataModel:s,processedData:r}}isProcessedDataAnimatable(){const e=this.processedData?.reduced?.animationValidation;if(!e)return!0;const{orderedKeys:t,uniqueKeys:i}=e;return t&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){const t=this.getNodeData();if(void 0===t||0===t.length)return;const i=this.computeFocusDatumIndex(e,t);if(void 0===i)return;const{clipFocusBox:s}=this,r=t[i],n={...e,datumIndex:i},o=this.computeFocusBounds(n);return void 0!==o?{bounds:o,clipFocusBox:s,datum:r,datumIndex:i}:void 0}isDatumEnabled(e,t){const{missing:i=!1,enabled:s=!0,focusable:r=!0}=e[t];return!i&&s&&r}computeFocusDatumIndex(e,t){const i=(e,i)=>{for(;e>=0&&!this.isDatumEnabled(t,e);)e+=i;return-1===e?void 0:e},r=(e,i)=>{for(;e<t.length&&!this.isDatumEnabled(t,e);)e+=i;return e===t.length?void 0:e};let n;const o=(0,s.qE)(0,e.datumIndex,t.length-1);return n=e.datumIndexDelta<0?i(o,e.datumIndexDelta):e.datumIndexDelta>0?r(o,e.datumIndexDelta):r(o,1)??i(o,-1),void 0===n?0===e.datumIndexDelta?void 0:e.datumIndex-e.datumIndexDelta:n}keysOrValues(e){const t=this.dataModel.resolveProcessedDataIndexById(this,e);return this.processedData?.keys[t]?.get(this.id)??this.processedData?.columns[t]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(t&&i&&s)return t.invalidData?.get(this.id)?.[e]?void 0:this.keysOrValues(s)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const r=t.invalidData?.get(this.id),n=this.keysOrValues(s);for(let t=0;t<n.length;t+=1){if(!0===r?.[t])continue;const i=n[t]?.valueOf();if(k(e,i))return t}}},Vp={x:["xKey"],y:["yKey"]},Hp={x:["xName"],y:["yName"]},Up=class extends yc{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},zp=class extends Pp{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};a([Te],zp.prototype,"legendItemName",2),a([Te],zp.prototype,"pickOutsideVisibleMinorAxis",2);var Wp=100,jp=class extends Bp{constructor({pathsPerSeries:e=["path"],hasMarkers:t=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:r=!0,markerSelectionGarbageCollection:n=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:a,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Up,this.dataNodeGroup=this.contentGroup.appendChild(new At({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new At({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new It({name:`${this.id}-series-labels`})),this.labelSelection=ua.select(this.labelGroup,Li),this.highlightSelection=ua.select(this.highlightNode,()=>this.opts.hasMarkers?new _c:this.nodeFactory()),this.highlightLabelSelection=ua.select(this.highlightLabel,Li),this.annotationSelections=new Set,this.debug=v.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,hasMarkers:t,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:a,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:r,markerSelectionGarbageCollection:n},this.paths=e.map(e=>new bc({name:`${this.id}-${e}`})),this.datumSelection=ua.select(this.dataNodeGroup,()=>this.nodeFactory(),r),this.markerSelection=ua.select(this.markerGroup,_c,n),this.animationState=new ba("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:e=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(e):this.animateWaitingUpdateReady(e)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:e=>this.resetAllAnimation(e),reset:"empty"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths,t,i)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths,t,i)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e,t,i){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e,t,i){for(const t of e)this.contentGroup.removeChild(t)}renderToOffscreenCanvas(){const e=this.getNodeData();return null!=e&&e.length>Wp}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e?this.animationState.transition("skip"):"disabled"===e&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:e}){const{visible:t,_contextNodeData:i}=this,s=this.ctx.highlightManager?.getActiveHighlight()?.series,r=s===this,n=this.checkResize(e),o=this.updateHighlightSelection(r);this.updateSelections(t),this.updateNodes(o,r,t);const a=this.getAnimationData(e,i);a&&(n&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(e){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if((e||!i)&&(this.nodeDataRefresh||this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const e=this.isProcessedDataAnimatable();this._contextNodeData&&((t=this._contextNodeData).animationValid??(t.animationValid=e));const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.dispatch("data-update",{dataModel:i,processedData:s})}this.updateSeriesSelections()}}updateSeriesSelections(e){const{datumSelection:t,labelSelection:i,markerSelection:s,paths:r}=this,n=this._contextNodeData;if(!n)return;const{nodeData:o,labelData:a,itemId:l}=n;this.updatePaths({seriesHighlighted:e,itemId:l,contextData:n,paths:r}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s}))}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,r]=on(t?.range??[0,1]),[n,o]=on(i?.range??[0,1]),a=this.getSeriesDomain("x"),l=[t?.scale.convert(a.at(0)),t?.scale.convert(a.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=on(l),[p,g]=on(h);return{axis:new f(s,n,r-s,o-n),series:new f(d,p,u-d,g-p)}}updateNodes(e,t,i){const{highlightSelection:s,highlightLabelSelection:r,opts:{hasMarkers:n,hasHighlightedLabels:o}}=this,a=!this.ctx.animationManager.isSkipped(),l=this.visible&&null!=this._contextNodeData&&i;this.contentGroup.visible=a||l,this.highlightGroup.visible=(a||l)&&t;const c=this.getOpacity();n?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),o&&this.updateLabelNodes({labelSelection:r});const{dataNodeGroup:h,markerGroup:d,datumSelection:u,labelSelection:p,markerSelection:g,paths:m,labelGroup:f}=this,{itemId:y}=this.contextNodeData??{};h.opacity=c,h.visible=a||l,f.visible=l,n&&(d.opacity=c,d.visible=l),f&&(f.opacity=c),this.updatePathNodes({seriesHighlighted:t,itemId:y,paths:m,opacity:c,visible:l,animationEnabled:a}),h.visible&&(this.updateDatumNodes({datumSelection:u,highlightedItems:e,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),n&&this.updateMarkerNodes({markerSelection:g,isHighlight:!1}))}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum&&e.itemId===t.itemId);return 0===i.length?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){const{highlightSelection:t,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const r=this.ctx.highlightManager?.getActiveHighlight(),n=e&&r?.datum?r:void 0;let o,a;if(null!=n){const e=this.isLabelEnabled(),{labelData:t,nodeData:i}=s;a=this.getHighlightData(i,n),o=e?this.getHighlightLabelData(t,n):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:t}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)!0!==e.datum.missing&&(yield e)}getQuadTree(){if(void 0===this.quadtree){const{width:e,height:t}=this.ctx.scene.canvas,i=new f(0,0,e,t);this.quadtree=new _p(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);if(0!==t.length)return t;const{x:i,y:s}=e,{opts:{hasMarkers:r}}=this,{dataNodeGroup:n,markerGroup:o}=this;let a=n.pickNodes(i,s).filter(e=>!0!==e.datum.missing);if(0===a.length&&r&&(a=o?.pickNodes(i,s).filter(e=>!0!==e.datum.missing)),0!==a.length)return a.map(e=>e.datum);for(const t of this.moduleMap.modules()){const{datum:i}=t.pickNodeExact(e)??{};if(null!=i&&!0!==i?.missing)return[i]}return[]}pickNodeClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:r}=this;if(!r)return;const n=s.x,o=s.y,a=t,l=i;let c,h=1/0;for(const e of r.nodeData){const{point:{x:t=NaN,y:i=NaN}={}}=e;if(isNaN(t)||isNaN(i))continue;if(!n?.inRange(t)||!o?.inRange(i))continue;const s=Math.max((a-t)**2+(l-i)**2,0);s<h&&(h=s,c=e)}for(const t of this.moduleMap.modules()){const i=t.pickNodeNearest(e);if(void 0!==i&&i.distanceSquared<h){h=i.distanceSquared,c=i.datum;break}}return c?{datum:c,distance:Math.max(Math.sqrt(h)-(c.point?.size??0)/2,0)}:void 0}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:r,_contextNodeData:n}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!n)return;const a=r.x,l=r.y,c=[a,l].filter(Ah.is).map(e=>e.direction);if(t&&0===c.length)return;const[h="x"]=c,d=[i,s];"x"!==h&&d.reverse();const u=[1/0,1/0];let p;for(const e of n.nodeData){const{x:t=NaN,y:i=NaN}=e.point??e.midPoint??{};if(isNaN(t)||isNaN(i)||!0===e.missing)continue;const s=[a?.inRange(t),l?.inRange(i)];if("x"!==h&&s.reverse(),!s[0]||!o&&!s[1])continue;const r=[t,i];"x"!==h&&r.reverse();let n=!0;for(let e=0;e<r.length;e++){const t=Math.abs(r[e]-d[e]);if(t>u[e]){n=!1;break}t<u[e]&&(u[e]=t,u.fill(1/0,e+1,u.length))}n&&(p=e)}if(p){let t=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const i of this.moduleMap.modules()){const s=i.pickNodeMainAxisFirst(e);if(void 0!==s&&s.distanceSquared<t){p=s.datum,t=s.distanceSquared;break}}return{datum:p,distance:Math.sqrt(t)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(e,t,i){const s=this.keysOrValues(e);return qr(i?.length??s.length,t,e=>{const t=i?.[e]??e;return this.xCoordinateRange(s[t],0,t)})}domainForVisibleRange(e,t,i,s,r,n){const{processedData:o,dataModel:a}=this,[l,c]=s,h=this.keysOrValues(i);if(r){const e=this.visibleRange(i,s,n);return a.getDomainBetweenRange(this,t,e,o)}const d=t.map(e=>this.keysOrValues(e));let u=1/0,p=-1/0;return h.forEach((e,i)=>{const[s,r]=this.xCoordinateRange(e,0,i);if(!(r<l||s>c))for(let e=0;e<t.length;e++){const t=d[e][i];u=Math.min(u,t),p=Math.max(p,t)}}),u>p?[NaN,NaN]:[u,p]}domainForClippedRange(e,t,i,r){const{processedData:n,dataModel:o,axes:a}=this,l=function(e){let t,i;if((e instanceof Hd||e instanceof Wd)&&({min:t,max:i}=e),null!=t||null!=i)return t??(t=-1/0),i??(i=1/0),[t,i]}(a["x"===e?"y":"x"]);if(!l)return t.flatMap(e=>o.getDomain(this,e,"value",n));const c=this.keysOrValues(i);if(r){const e=function(e,t,i){const r=t[0].valueOf(),n=t[1].valueOf(),o=(0,s.S3)(0,e-1,e=>{const t=i(e)?.valueOf();return!Number.isFinite(t)||t>=r});let a=(0,s.I5)(0,e-1,e=>{const t=i(e)?.valueOf();return!Number.isFinite(t)||t<=n});return null==o||null==a?[0,0]:(a=Math.min(a+1,e),[o,a])}(c.length,l,e=>c[e]);return o.getDomainBetweenRange(this,t,e,n)}const h=t.map(e=>this.keysOrValues(e)),d=l[0].valueOf(),u=l[1].valueOf(),p=[];return c.forEach((e,t)=>{const i=e.valueOf();if(i<d||i>u)return;const s=h.map(e=>e[t]);i>=d&&p.push(...s),i<=u&&p.push(...s)}),p}countVisibleItems(e,t,i,r,n){const{dataModel:o,processedData:a}=this;if(!o||!a)return 1/0;const l=this.keysOrValues(e),c=t.map(e=>o.resolveColumnById(this,e,a)),h=this.axes.x,d=this.axes.y,u=this.shouldFlipXY(),p=h.range,g=d.range,m=(e,t,i)=>e[0]+(i-t[0])/(t[1]-t[0])*(e[1]-e[0]),f=m(p,h.visibleRange,i[0]),y=m(p,h.visibleRange,i[1]),v=m(g,d.visibleRange,u?r[0]:r[1]),C=m(g,d.visibleRange,u?r[1]:r[0]),b=Math.round((i[0]+(i[1]-i[0])/2)*l.length);return Zr(0,l.length-1,b,n,e=>{let[t,i]=this.xCoordinateRange(l[e],0,e),[r,n]=this.yCoordinateRange(c.map(t=>t[e]),0,e);return!!((0,s.Bf)(t)&&(0,s.Bf)(i)&&(0,s.Bf)(r)&&(0,s.Bf)(n))&&(u&&([t,i,r,n]=[r,n,t,i]),t>=f&&i<=y&&r>=v&&n<=C)})}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:s}=e,r=i??[];if(t){const e=s;return this.updateMarkerSelection({nodeData:r,markerSelection:e})}return this.updateDatumSelection({nodeData:r,datumSelection:s})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateMarkerSelection(e){return e.markerSelection}updateMarkerNodes(e){}updatePaths(e){e.paths.forEach(e=>e.visible=!1)}updatePathNodes(e){const{paths:t,opacity:i,visible:s}=e;for(const e of t)e.opacity=i,e.visible=s}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(e=>{da([e],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&da([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&da([e.labelSelection],t)}resetMarkerAnimation(e){const{marker:t}=this.opts?.animationResetFns??{};t&&this.opts.hasMarkers&&da([e.markerSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),this.resetMarkerAnimation(e),!1===e.contextData?.animationValid&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&da([e],t)}animateReadyHighlightMarkers(e){const{marker:t}=this.opts?.animationResetFns??{};t&&da([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof Bd){const{range:t,domain:i}=e;return{type:"log",convert:t=>e.convert(t),domain:[i[0],i[1]],range:[t[0],t[1]]}}if(e instanceof cn){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}if(e instanceof to){const{domain:t}=e;return{type:"category",domain:t,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(Gi)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);null!=s&&(e[t]=s)}return e}},Kp=class extends De{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};a([Te],Kp.prototype,"type",2),a([Te],Kp.prototype,"tension",2),a([Te],Kp.prototype,"position",2);var $p=class extends zp{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Kp,this.shadow=new wp,this.marker=new kp,this.label=new pl,this.tooltip=new Np,this.connectMissingData=!1}};function Yp(e){switch(e.type){case"linear":case"step":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function qp(e,t,i){const[s,r]=Yp(e),n=r.x!==s.x?(i.x-t.x)/(r.x-s.x):0,o=r.y!==s.y?(i.y-t.y)/(r.y-s.y):0;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*n,cp1y:i.y-(e.cp2y-s.y)*o,cp2x:i.x-(e.cp1x-s.x)*n,cp2y:i.y-(e.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*n}}}function Xp(e,t,i){const{moveTo:s}=e,[r,n]=function(e){const t=Yp(e);return t[0].x>t[1].x&&t.reverse(),t}(e),{x:o,y:a}=r,{x:l,y:c}=n;if(i<o)return qp(e,r,r);if(t>l)return qp(e,n,n);switch(e.type){case"linear":{const e=a===c?void 0:(c-a)/(l-o);return{type:"linear",moveTo:s,x0:t,y0:null==e?a:e*(t-o)+a,x1:i,y1:null==e?a:e*(i-o)+a}}case"step":if(i<=e.stepX){const r=e.y0;return{type:"step",moveTo:s,x0:t,y0:r,x1:i,y1:r,stepX:i}}if(t>=e.stepX){const r=e.y1;return{type:"step",moveTo:s,x0:t,y0:r,x1:i,y1:r,stepX:t}}{const{y0:r,y1:n,stepX:o}=e;return{type:"step",moveTo:s,x0:t,y0:r,x1:i,y1:n,stepX:o}}case"cubic":{const r=qe(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[n,o]=Xe(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,r);const a=qe(o[0].x,o[1].x,o[2].x,o[3].x,i);return[o,n]=Xe(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y,a),{type:"cubic",moveTo:s,cp0x:o[0].x,cp0y:o[0].y,cp1x:o[1].x,cp1y:o[1].y,cp2x:o[2].x,cp2y:o[2].y,cp3x:o[3].x,cp3y:o[3].y}}}}a([Te],$p.prototype,"xKey",2),a([Te],$p.prototype,"xName",2),a([Te],$p.prototype,"yKey",2),a([Te],$p.prototype,"yName",2),a([Te],$p.prototype,"yFilterKey",2),a([Te],$p.prototype,"normalizedTo",2),a([Te],$p.prototype,"fill",2),a([Te],$p.prototype,"fillGradientDefaults",2),a([Te],$p.prototype,"fillPatternDefaults",2),a([Te],$p.prototype,"fillImageDefaults",2),a([Te],$p.prototype,"fillOpacity",2),a([Te],$p.prototype,"stroke",2),a([Te],$p.prototype,"strokeWidth",2),a([Te],$p.prototype,"strokeOpacity",2),a([Te],$p.prototype,"lineDash",2),a([Te],$p.prototype,"lineDashOffset",2),a([Te],$p.prototype,"interpolation",2),a([Te],$p.prototype,"shadow",2),a([Te],$p.prototype,"marker",2),a([Te],$p.prototype,"label",2),a([Te],$p.prototype,"tooltip",2),a([Te],$p.prototype,"connectMissingData",2);var Zp={start:0,middle:.5,end:1},Qp=.05;function Jp(e,t,i){return(t-e)*i+e}function eg(e,t){return"linear"===e.type?function(e,t){const{x0:i,y0:s,x1:r,y1:n}=e,o=(n-s)/(r-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:o,stepX:t,stepY0:o,stepY1:o,rightCp1x:t,rightCp1y:o,rightCp2x:r,rightCp2y:n}}(e,t):"cubic"===e.type?function(e,t){const{cp0x:i,cp0y:s,cp1x:r,cp1y:n,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=e,h=qe(i,r,o,l,t),[d,u]=Xe(i,s,r,n,o,a,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}(e,t):function(e){const{x0:t,y0:i,x1:s,y1:r,stepX:n}=e;return{leftCp1x:(t+n)/2,leftCp1y:i,leftCp2x:(t+n)/2,leftCp2y:i,stepX:n,stepY0:i,stepY1:r,rightCp1x:(n+s)/2,rightCp1y:r,rightCp2x:(n+s)/2,rightCp2y:r}}(e)}function tg(e,t,i,s,r,n,o){switch(t){case 0:o?e.moveTo(r,n):e.moveTo(i,s);break;case 1:o?e.lineTo(r,n):e.lineTo(i,s)}}function ig(e,t,i,s,r,n){n?e.lineTo(t,i):e.lineTo(s,r)}function sg(e,t,i,s,r,n,o,a,l,c){c?e.cubicCurveTo(n,o,s,r,t,i):e.cubicCurveTo(s,r,n,o,a,l)}function rg(e,t,i,s,r,n,o){o?(e.lineTo(n,r),e.lineTo(n,i),e.lineTo(t,i)):(e.lineTo(n,i),e.lineTo(n,r),e.lineTo(s,r))}function ng(e,t,i,s){const[r,n]=Yp(t);switch(tg(e,i,r.x,r.y,n.x,n.y,s),t.type){case"linear":ig(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":sg(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":rg(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s)}}function og(e,t,i){const[s,r]=Yp(e),[n,o]=Yp(t);return[{x:Jp(s.x,n.x,i),y:Jp(s.y,n.y,i)},{x:Jp(r.x,o.x,i),y:Jp(r.y,o.y,i)}]}function ag(e,t,i,s,r,n){const[{x:o,y:a},{x:l,y:c}]=og(t,i,s);if(tg(e,r,o,a,l,c,n),"cubic"===t.type&&"cubic"===i.type)sg(e,o,a,Jp(t.cp1x,i.cp1x,s),Jp(t.cp1y,i.cp1y,s),Jp(t.cp2x,i.cp2x,s),Jp(t.cp2y,i.cp2y,s),l,c,n);else if("step"===t.type&&"step"===i.type)rg(e,o,a,l,c,Jp(t.stepX,i.stepX,s),n);else if("linear"===t.type&&"linear"===i.type)ig(e,o,a,l,c,n);else{let r;r="step"===t.type?t.stepX:"step"===i.type?i.stepX:(o+l)/2;const h=eg(t,r),d=eg(i,r),u=Jp(h.leftCp1x,d.leftCp1x,s),p=Jp(h.leftCp1y,d.leftCp1y,s),g=Jp(h.leftCp2x,d.leftCp2x,s),m=Jp(h.leftCp2y,d.leftCp2y,s),f=Jp(h.stepX,d.stepX,s),y=Jp(h.stepY0,d.stepY0,s),v=Jp(h.stepY1,d.stepY1,s),C=Jp(h.rightCp1x,d.rightCp1x,s),b=Jp(h.rightCp1y,d.rightCp1y,s),S=Jp(h.rightCp2x,d.rightCp2x,s),w=Jp(h.rightCp2y,d.rightCp2y,s);n?(e.cubicCurveTo(S,w,C,b,f,v),e.lineTo(f,y),e.cubicCurveTo(g,m,u,p,o,a)):(e.cubicCurveTo(u,p,g,m,f,y),e.lineTo(f,v),e.cubicCurveTo(C,b,S,w,l,c))}}var lg=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(lg||{});function cg(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),"continuous"===t.type&&"number"==typeof e)return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if("log"===t.type&&"number"==typeof e)return t.convert(e);if("category"!==t.type)return NaN;let i=t.domain.findIndex(t=>t===e);return-1===i&&(i=t.domain.findIndex(t=>{return s=t,null!=(i=e)&&null!=s&&"object"==typeof i&&"object"==typeof s&&("id"in i&&"id"in s?i.id===s.id:i.toString()===s.toString());var i,s})),i>=0?t.inset+t.step*i:NaN}function hg(e){return rl(e).valueOf()}function dg({data:e},t){return e.map((e,i)=>({xValue0Index:t.indexOf(hg(e.xValue0)),xValue1Index:t.indexOf(hg(e.xValue1)),datumIndex:i}))}function ug(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const s=Yp(e),r=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),n=s[0].x+(t-i.xValue0Index)*r;return Xp(e,n,n+r)}function pg(e,t){const[i,s]=Yp(e),r=cg(0,t.scales.y);return qp(e,{x:i.x,y:r},{x:s.x,y:r})}function gg(e){const[t,i]=Yp(e);return function(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function mg(e,t,i,s,r,n){let o,a;if(r.xValue0Index>=n.xValue1Index){const e=s.findLast(e=>e.xValue1Index<=n.xValue1Index)?.datumIndex,t=null!=e?i.data[e]:void 0;o=t?.xValue1,a=t?.yValue1}else if(r.xValue0Index<=n.xValue0Index){const e=s.find(e=>e.xValue0Index>=n.xValue0Index)?.datumIndex,t=null!=e?i.data[e]:void 0;o=t?.xValue0,a=t?.yValue0}if(null==o||null==a)switch(t){case 0:return pg(e,i);case 1:return gg(e)}const l={x:cg(o,i.scales.x),y:cg(a,i.scales.y)};return qp(e,l,l)}function fg(e,t){if(null==t)return;const i=hg(e.xValue0),s=hg(e.xValue1);return t.find(e=>hg(e.xValue0)===i&&hg(e.xValue1)===s)?.span}function yg(e,t,i,s,r,n,o){const a=e.data[s.datumIndex],l=a.span,c=fg(a,r);if(null!=c)o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l});else{const r=mg(l,t,e,i,s,n);o.added.push({from:r,to:l})}}function vg(e,t,i,s,r,n,o){const a=e.data[s.datumIndex],l=a.span,c=fg(a,r);if(null!=c)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c});else{const r=mg(l,t,e,i,s,n);o.removed.push({from:l,to:r})}}function Cg(e,t,i,s,r){const n=t[r.xValue0Index],o=i.data.find(e=>hg(e.xValue0)===n),a=t[r.xValue1Index],l=i.data.find(e=>hg(e.xValue1)===a);if(null==o||null==l)return;const[{x:c},{x:h}]=Yp(e),d=cg(o.xValue0,i.scales.x),u=cg(o.yValue0,i.scales.y),p=cg(l.xValue1,i.scales.x),g=cg(l.yValue1,i.scales.y);let m=s.data[r.datumIndex].span;return m=qp(m,{x:d,y:u},{x:p,y:g}),m=Xp(m,c,h),m}function bg(e,t,i,s,r,n,o,a,l){const c=r+1,h=o.find(e=>e.xValue0Index<=r&&e.xValue1Index>=c),d=n.find(e=>e.xValue0Index<=r&&e.xValue1Index>=c),u=t.zeroData,p=e.zeroData;if(null==h&&null!=d)return void yg(e,i,n,d,u,a,l);if(null!=h&&null==d)return void vg(t,i,o,h,p,a,l);if(null==h||null==d)return;let g;g=h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?1:0;const m=ug(t.data[h.datumIndex].span,r,h),f=ug(e.data[d.datumIndex].span,r,d);if(1===g){const r=Cg(m,s,t,e,d);null!=r?(l.removed.push({from:m,to:r}),l.moved.push({from:r,to:f}),l.added.push({from:f,to:f})):vg(t,i,o,h,p,a,l)}else if(-1===g){const r=Cg(f,s,e,t,h);null!=r?(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:r}),l.added.push({from:r,to:f})):yg(e,i,n,d,u,a,l)}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:f}),l.added.push({from:f,to:f})}function Sg(e,t,i){const{span:s}=t;switch(i){case 0:return fg(t,e.zeroData)??pg(s,e);case 1:return gg(s)}}function wg(e,t,i){if(!function(e,t){const i=t.scales.x,s=e.scales.x;if("category"!==i?.type||"category"!==s?.type)return!0;let r=-1/0;for(const e of i.domain){const t=cg(e,s);if(Number.isFinite(t)){if(t<r)return!1;r=t}}return!0}(e,t))return;const s=function(e,t){const i=new Map;for(const{xValue0:t,xValue1:s}of e.data){const e=hg(t),r=hg(s);i.set(e,t).set(r,s)}const s=Array.from(i,([e,t])=>({axisValue:e,value:t}));s.sort((t,i)=>cg(t.value,e.scales.x)-cg(i.value,e.scales.x));const r=[];for(const{xValue0:e,xValue1:s}of t.data){const t=hg(e),n=hg(s);i.has(t)||(i.set(t,e),r.push({axisValue:t,value:e})),i.has(n)||(i.set(n,s),r.push({axisValue:n,value:s}))}r.sort((e,i)=>cg(e.value,t.scales.x)-cg(i.value,t.scales.x));const n=s;let o=0;for(const e of r){for(let i=n.length-1;i>o;i-=1)if(cg(e.value,t.scales.x)>cg(n[i].value,t.scales.x)){o=i+1;break}n.splice(o,0,e),o+=1}if(!function(e,t){let i=-1/0;for(const s of e){const e=cg(s.value,t.scales.x);if(Number.isFinite(e)){if(e<i)return!1;i=e}}return!0}(n,t))return;const a=n.map(e=>e.axisValue);return{axisValues:a,oldDataAxisIndices:dg(t,a),newDataAxisIndices:dg(e,a)}}(e,t);return null==s?function(e,t,i){const s=[],r=[];for(const e of t.data){const s=e.span,n=Sg(t,e,i);r.push({from:s,to:n})}for(const t of e.data){const r=t.span,n=Sg(e,t,i);s.push({from:n,to:r})}return{removed:r,moved:[],added:s}}(e,t,i):function(e,t,i,s){const r={removed:[],moved:[],added:[]},{axisValues:n,oldDataAxisIndices:o,newDataAxisIndices:a}=e,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let e=0;e<n.length-1;e+=1)bg(t,i,s,n,e,a,o,l,r);return r}(s,e,t,i)}function xg(e){return"continuous"===e.type||"log"===e.type}function Eg(e){return"category"===e.type}function Mg(e,t){return void 0===e||void 0===t?void 0!==e||void 0!==t:xg(e)&&xg(t)?e.type===t.type&&(0,s.r1)(e.domain,t.domain)&&(0,s.r1)(e.range,t.range):!(!Eg(e)||!Eg(t))&&e.inset===t.inset&&e.step===t.step&&(0,s.r1)(e.domain,t.domain)}function Ag(e){return null!=e&&("category"===e.type?e.domain.every(e=>null!=e):e.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&e.range.every(e=>Number.isFinite(e)))}function Tg(e,t){let i;const s=e.map(e=>e.point);switch(t.type){case"linear":i=function(e){const t=[];let i=0,s=NaN,r=NaN;for(const{x:n,y:o}of e){if(i>0){const e=1===i;t.push({type:"linear",moveTo:e,x0:s,y0:r,x1:n,y1:o})}i+=1,s=n,r=o}return t}(s);break;case"smooth":i=function(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=i.map((e,t)=>{const s=0===t?e:i[t-1],r=t===i.length-1?e:i[t+1],n=0===t||t===i.length-1;if(Math.sign(s.y-e.y)===Math.sign(r.y-e.y))return 0;if(!n){const t=Math.abs(s.y-r.y),i=Math.abs(e.y-s.y)/t,n=Math.abs(e.y-r.y)/t;if(i<=Qp||1-i<=Qp||n<=Qp||1-n<=Qp)return 0}return(r.y-s.y)/(r.x-s.x)});0===s[1]&&(s[0]*=2),0===s[s.length-2]&&(s[s.length-1]*=2);const r=[];for(let e=1;e<i.length;e+=1){const n=i[e-1],o=s[e-1],a=i[e],l=s[e],c=a.x-n.x,h=a.y-n.y;let d=c*t/3,u=c*o*t/3,p=c*t/3,g=c*l*t/3;0===l&&Math.abs(u)>Math.abs(h)&&(d*=Math.abs(h/u),u=Math.sign(u)*Math.abs(h)),0===o&&Math.abs(g)>Math.abs(h)&&(p*=Math.abs(h/g),g=Math.sign(g)*Math.abs(h)),r.push({type:"cubic",moveTo:1===e,cp0x:n.x,cp0y:n.y,cp1x:n.x+d,cp1y:n.y+u,cp2x:a.x-p,cp2y:a.y-g,cp3x:a.x,cp3y:a.y})}return r}(s,t.tension);break;case"step":i=function(e,t){const i=[];let s=0,r=NaN,n=NaN;const o="number"==typeof t?t:Zp[t];for(const{x:t,y:a}of e){if(s>0){const e=1===s,l=r+(t-r)*o;i.push({type:"step",moveTo:e,x0:r,y0:n,x1:t,y1:a,stepX:l})}s+=1,r=t,n=a}return i}(s,t.position)}return i.map((t,i)=>({span:t,xValue0:e[i].xDatum,yValue0:e[i].yDatum,xValue1:e[i+1].xDatum,yValue1:e[i+1].yDatum}))}function Dg(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function Ig({path:e},t){let i;for(const{span:s}of t){const[t,r]=Yp(s);ng(e,s,null!=i&&Dg(i,t)?1:0,!1),i=r}}function Rg(e,t,i){let s;for(const r of i){const[i,n]=og(r.from,r.to,e),o=null!=s&&Dg(s,i)?1:0;ag(t.path,r.from,r.to,e,o,!1),s=n}}function Pg(e,t,i){return{status:e,path:{addPhaseFn:(e,i)=>Rg(e,i,t.added),updatePhaseFn:(e,i)=>Rg(e,i,t.moved),removePhaseFn:(e,i)=>Rg(e,i,t.removed)},pathProperties:kg(e,i)}}function kg(e,t){const i="none"===t?"updated":e,s={fromFn:t=>{let s;return s="removed"===e?{finish:{visible:!1}}:"added"===e?{start:{visible:!0}}:{},{phase:oa[i],...s}},toFn:e=>({phase:oa[i]})};return"fade"===t?{fromFn:t=>({opacity:"added"===e?0:t.opacity,...s.fromFn(t)}),toFn:t=>({opacity:"removed"===e?0:1,...s.toFn(t)})}:s}function Lg(e,t,i){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!Ag(e.scales.x)||!Ag(t.scales.x))return;if(null==e.strokeData||null==t.strokeData)return;let s="updated";t.visible&&!e.visible?s="removed":!t.visible&&e.visible&&(s="added");const r=wg({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);return null!=r?{status:s,stroke:Pg(s,r,"fade"),hasMotion:(i?.changed??!0)||!Mg(e.scales.x,t.scales.x)||!Mg(e.scales.y,t.scales.y)||"updated"!==s}:void 0}function Ng({path:e},{spans:t,phantomSpans:i}){for(let s=0;s<t.length;s+=1){const{span:r}=t[s],n=i[s].span;ng(e,r,0,!1),ng(e,n,1,!0),e.closePath()}}function _g(e,{path:t},i,s){for(let r=0;r<i.length;r+=1){const n=i[r],o=s[r];ag(t,n.from,n.to,e,0,!1),ag(t,o.from,o.to,e,1,!0),t.closePath()}}function Og(e,t,i,s){return{status:e,path:{addPhaseFn:(e,s)=>_g(e,s,t.added,i.added),updatePhaseFn:(e,s)=>_g(e,s,t.moved,i.moved),removePhaseFn:(e,s)=>_g(e,s,t.removed,i.removed)},pathProperties:kg(e,s)}}function Fg(e,t){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!Ag(e.scales.x)||!Ag(t.scales.x))return;let i="updated";t.visible&&!e.visible?i="removed":!t.visible&&e.visible&&(i="added");const s=wg({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(null==s)return;const r=wg({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(null==r)return;const n=wg({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(null==n)return;const o="none";return{status:i,fill:Og(i,s,r,o),stroke:Pg(i,n,o)}}function Gg({id:e},t,i,...s){la(e,"markers",t,s,{opacity:0},{opacity:1},{phase:i?oa[i]:"trailing"}),s.forEach(e=>e.cleanup())}function Bg({id:e},t,...i){la(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(e=>e.cleanup())}function Vg({id:e,nodeDataDependencies:t},i,...r){const n=t.seriesRectWidth;aa(e,"markers",i,r,{fromFn:(e,t)=>{const i=t.midPoint?.x??n;let r=(0,s.qE)(0,Ir(i/n),1);return isNaN(r)&&(r=0),{scalingX:0,scalingY:0,delay:r,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Hg(e){return{opacity:1,scalingX:1,scalingY:1}}function Ug(e,t){return{x:t.point?.x??NaN,y:t.point?.y??NaN,scalingCenterX:t.point?.x??NaN,scalingCenterY:t.point?.y??NaN}}function zg(e,{datumIndex:t}){const i=e.getNodeData();if(void 0===i)return;const s=i[t],{point:r}=s??{};if(null==s||null==r)return;const n=4+(r.focusSize??e.getFormattedMarkerStyle(s).size),o=n/2,a=s.point.x-o,l=s.point.y-o;return wt.toCanvas(e.contentGroup,new f(a,l,n,n))}function Wg({id:e,visible:t,nodeDataDependencies:i},s,...r){const{seriesRectWidth:n,seriesRectHeight:o}=i;la(e,"path_properties",s,r,{clipX:0},{clipX:n},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function jg({id:e},t,i,s="add",...r){la(e,t,i,r,{opacity:0},{opacity:1},{phase:s})}function Kg(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function $g({nodeDataDependencies:e},t){const i=e=>isFinite(e)?e:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var Yg=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:Kg({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:bp,marker:(e,t)=>({opacity:1,scalingX:1,scalingY:1,...Ug(0,t)})},clipFocusBox:!1}),this.properties=new $p,this.connectsToYAxis=!0,this.backgroundGroup=new At({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||null!=this.contextNodeData&&(this.contextNodeData.fillData.spans.length>Wp||this.contextNodeData.strokeData.spans.length>Wp)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){this.backgroundGroup.removeChild(e),this.contentGroup.removeChild(t)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(e){const t=this.isStacked();return!(!super.setSeriesIndex(e)&&this._isStacked===t||(this._isStacked=t,t?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1]),0))}async processData(e){if(null==this.data)return;const{data:t,visible:i,seriesGrouping:{groupIndex:r=this.id,stackCount:n=1}={}}=this,{xKey:o,yKey:a,yFilterKey:l,connectMissingData:c,normalizedTo:h}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,p=this.axes.y?.scale,{xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:p}),f={value:`area-stack-${r}-yValue`,values:`area-stack-${r}-yValues`,stack:`area-stack-${r}-yValue-stack`,marker:`area-stack-${r}-yValues-marker`},y=[];(0,s.vM)(h)&&y.push(nd(Object.values(f),h)),d&&y.push(cd());const v={invalidValue:null};((0,s.vM)(h)||c)&&n>1&&(v.invalidValue=0),i||(v.forceValue=0),await this.requestDataModel(e,t,{props:[jh(o,g,{id:"xValue"}),Kh(a,m,{id:"yValueRaw",...v}),...null!=l?[Kh(l,m,{id:"yFilterRaw"})]:[],...ed(a,m,{id:"yValueStack",...v,groupId:f.stack}),Kh(a,m,{id:"yValue",...v,groupId:f.value}),...Jh(a,"window","current",{id:"yValueEnd",...v,groupId:f.values},m),...Jh(a,"normal","current",{id:"yValueCumulative",...v,groupId:f.marker},m),...y],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),r=i.enabled?.5*i.size*t:0;return[s-r,s+r]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),r=i.enabled?.5*i.size*t:0;return[s-r,s+r]}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i)return[];const r=s.y;if("x"===e){const e=i.resolveProcessedDataDefById(this,"xValue"),s=i.getDomain(this,"xValue","key",t);return"key"===e?.def.type&&"category"===e.def.valueType?s:_o(Dh(s))}const n=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);return _o(r instanceof Ud||r instanceof Wd?n:Number.isFinite(n[1]-n[0])?[n[0]>0?0:n[0],n[1]<0?0:n[1]]:[])}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",t,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValueCumulative"],e,t,i)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:r}=this,n=e.x,o=e.y;if(!(n&&o&&t&&r&&"grouped"===i?.type))return;const{yKey:a,xKey:l,yFilterKey:c,marker:h,label:d,fill:u,stroke:p,connectMissingData:g,interpolation:m}=this.properties,{scale:f}=n,{scale:y}=o,{isContinuousY:v}=this.getScaleInformation({xScale:f,yScale:y}),C=(f.bandwidth??0)/2,b=r.resolveKeysById(this,"xValue",i),S=r.resolveColumnById(this,"yValueEnd",i),w=r.resolveColumnById(this,"yValueRaw",i),x=r.resolveColumnById(this,"yValueCumulative",i),E=null!=c?r.resolveColumnById(this,"yFilterRaw",i):void 0,M=r.resolveColumnById(this,"yValueStack",i),A=(e,t,i)=>{let r;return((0,s.vM)(this.properties.normalizedTo)?v&&sl(i):!isNaN(i))&&(r=t),{x:f.convert(e)+C,y:y.convert(r),size:h.size}},T=[],D=[],{visibleSameStackCount:I}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let R=!1;const{dataSources:P}=i,k=P.get(this.id)??[];for(const{datumIndex:e}of r.forEachGroupDatum(this,i)){const t=b[e];if(null==t)return;const i=k[e],s=w[e],r=x[e],n=S[e],o=Number.isFinite(s),c=A(t,+r,s),g=null!=E?E[e]===s:void 0;if(!1===g&&(R=!0),o&&h&&D.push({series:this,itemId:a,datum:i,datumIndex:e,midPoint:{x:c.x,y:c.y},cumulativeValue:n,yValue:s,xValue:t,yKey:a,xKey:l,point:c,fill:h.fill??u,stroke:h.stroke??p,strokeWidth:h.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:g}),o&&d){const t=this.getLabelText(d,{value:s,datum:i,xKey:l,yKey:a,xName:this.properties.xName,yName:this.properties.yName});T.push({series:this,itemId:a,datum:i,datumIndex:e,x:c.x,y:c.y,labelText:t})}}const L=(e,t)=>({point:{x:f.convert(e)+C,y:y.convert(t)},xDatum:e,yDatum:t}),N=e=>{const t=[];for(const{datumIndexes:[s,n,o]}of r.forEachGroupDatumTuple(this,i)){const i=b[n],r=M[n],a=r[e],l=Number.isFinite(a);if(g&&!l)continue;const c=null!=s?M[s]:void 0,h=null!=o?M[o]:void 0;let d=0,u=0;for(let t=0;t<=e;t+=1){const e=r[t];Number.isFinite(e)&&((null==c||Number.isFinite(c[t]))&&(d+=e),(null==h||Number.isFinite(h[t]))&&(u+=e))}const p=t[t.length-1];if(g||d===u&&l){const e=g?a:Math.max(d,u),s=L(i,e);Array.isArray(p)?p.push(s):null!=p?(p.skip+=1,t.push([s])):t.push([s])}else if(!l&&Array.isArray(p)&&1===p.length)t[t.length-1]={skip:1};else{const e=L(i,d),s=L(i,u);Array.isArray(p)?p.push(e):null!=p&&(p.skip+=1),t.push(l?[s]:{skip:0})}}return(e=>e.flatMap(e=>Array.isArray(e)?Tg(e,m):new Array(e.skip).fill(null)))(t)},_=this.seriesGrouping?.stackIndex??0,O=()=>Tg(Array.from(r.forEachGroupDatum(this,i),({datumIndex:e})=>{const t=b[e],i=M[e][_];if(!g||Number.isFinite(i))return L(t,0)}).filter(e=>null!=e),m),F=N(_),G=F.map(()=>null);for(let e=_-1;e>=-1;e-=1){let t;for(let i=0;i<G.length;i+=1)null==G[i]&&(t??(t=-1!==e?N(e):O()),G[i]=t[i])}const B=F.map((e,t)=>e??G[t]),V=F.filter(e=>null!=e);return{itemId:a,fillData:{itemId:a,spans:B,phantomSpans:G},strokeData:{itemId:a,spans:V},labelData:T,nodeData:D,scales:this.calculateScaling(),visible:this.visible,stackVisible:I>0,crossFiltering:R}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{opacity:t,visible:i,animationEnabled:s}=e,[r,n]=e.paths,o=!0===this.contextNodeData?.crossFiltering,a=this.getStrokeWidth(this.properties.strokeWidth);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity*(o?.25:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i||s}),mc(r,{fill:uc(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),stroke:void 0,fillOpacity:this.properties.fillOpacity*(o?.125:1)},void 0,this.getShapeFillBBox()),r.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:t,visible:i||s}),$g(this,n),$g(this,r)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const t of e)t.path.clear(),t.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),Ng(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),Ig(s,i),s.markDirty("AreaSeries")}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e,s=this.properties.marker.enabled||!0===this.contextNodeData?.crossFiltering;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,marker:n,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:d}=this.properties,u=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=N(i&&d.item,n.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h}),m=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(n,e,t.datum,t.point,Yr(t,s,r,u,p),i,g,m,{selected:t.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{enabled:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o,color:a}=this.properties.label;t.each((e,t)=>{const{x:l,y:c,labelText:h}=t;h&&i&&this.visible?(e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textAlign="center",e.textBaseline="bottom",e.text=h,e.x=l,e.y=c-10,e.fill=a,e.visible=!0):e.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h,marker:d}=n,u=r.x,p=r.y;if(!(i&&s&&u&&p))return;const g=s.dataSources.get(this.id)?.[e],m=i.resolveKeysById(this,"xValue",s)[e],f=i.resolveColumnById(this,"yValueRaw",s)[e],{xDomain:y,yDomain:v}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(null==m)return;const C=d.getStyle(),b={datum:g,xValue:m,yValue:f},S=this.getMarkerStyle(d,g,Yr(b,o,l,y,v),!1,void 0,C);return this.formatTooltipWithContext(h,{heading:u.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(f)}]},{seriesId:t,datum:g,title:c,xKey:o,xName:a,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:r,lineDash:n,marker:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties,h=!o.enabled||void 0===o.fill,d=h?uc(e,a,l,c):uc(o.fill,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults);return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:d,fillOpacity:h?i:o.fillOpacity}),enabled:o.enabled||r<=0},line:{stroke:t,strokeOpacity:s,strokeWidth:r,lineDash:n}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:r,yName:n,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:e,id:t,itemId:r,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:r}),label:{text:o??n??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:r}=e,{animationManager:n}=this.ctx;this.updateAreaPaths(r,s),Wg(this,n,...r),da([t],Ug),Vg(this,n,t),vp(this,"labels",n,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,contextData:r,paths:n,previousContextData:o}=e,[a,l]=n;if(null==a&&null==l)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(n,r)},h=()=>{t.skipCurrentBatch(),c()};if(null==r||null==o)return c(),Gg(this,t,"added",i),jg(this,"fill_path_properties",t,"add",a),jg(this,"stroke_path_properties",t,"add",l),void vp(this,"labels",t,s);if(r.crossFiltering!==o.crossFiltering)return void h();const d=Fg(r,o);void 0!==d?"no-op"!==d.status&&(Gg(this,t,void 0,i),aa(this.id,"fill_path_properties",t,[a],d.fill.pathProperties),yp(this.id,"fill_path_update",t,[a],d.fill.path),aa(this.id,"stroke_path_properties",t,[l],d.stroke.pathProperties),yp(this.id,"stroke_path_update",t,[l],d.stroke.path),vp(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(n,r)})):h()}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new At}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e,s=this.getSeriesDomain("x"),r=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,Yr(e,t,i,s,r),!0)}computeFocusBounds(e){return zg(this,e)}};Yg.className="AreaSeries",Yg.type="area";var qg=(0,s.KC)("millisecond","second","minute","hour","day","month","year"),Xg=(0,s.W$)(s.t$,"a valid number format string"),Zg={enabled:s.zM,text:s.Yj,padding:s.ai,...s.LV},Qg=(0,s.W$)({enabled:s.zM,type:(0,s.mw)((0,s.KC)("line","range")),range:(0,s.Uo)((0,s.W$)((e,{options:t})=>"range"===t.type,"crossLine type to be 'range'"),(0,s.jk)(s.sw),(0,s.O9)(2,2)),value:(0,s.Uo)((0,s.W$)((e,{options:t})=>"line"===t.type,"crossLine type to be 'line'"),s.sw),label:Zg,fill:s.Yj,fillOpacity:s.CG,...s.AF,...s.mL},"cross-line options"),Jg={...Qg,label:{...Zg,position:(0,s.KC)("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:s.ai}},em={enabled:s.zM,rotation:s.ai,avoidCollisions:s.zM,minSpacing:s.Ly,spacing:s.Ly,formatter:s.E2,itemStyler:(0,s.YI)({...s.LV,spacing:s.ai}),...s.LV},tm={autoRotate:s.zM,autoRotateAngle:s.ai,...em},im={format:Xg,...tm},sm={format:(0,s.or)(s.Yj,s.Ik),...tm},rm={enabled:s.zM,width:s.Ly,size:s.Ly,stroke:s.yW},nm={enabled:s.zM,label:sm,tick:rm},om={reverse:s.zM,gridLine:{enabled:s.zM,width:s.Ly,style:(0,s.J$)({stroke:(0,s.or)(s.yW,s.I_),lineDash:(0,s.jk)(s.Ly)},"a grid-line style object array")},interval:{values:(0,s.jk)(s.sw),minSpacing:s.Ly},label:em,line:{enabled:s.zM,width:s.Ly,stroke:s.yW},tick:rm};om.context=(0,s._L)(()=>!0),om.layoutConstraints=(0,s._L)({stacked:(0,s.mw)(s.zM),align:(0,s.mw)((0,s.KC)("start","end")),unit:(0,s.mw)((0,s.KC)("percent","px")),width:(0,s.mw)(s.Ly)});var am={...om,keys:(0,s.jk)(s.Yj),crossLines:(0,s.J$)(Jg,"a cross-line options array"),position:(0,s.KC)("top","right","bottom","left"),thickness:s.Ly,title:{enabled:s.zM,text:s.Yj,spacing:s.Ly,formatter:s.E2,...s.LV}};function lm(e){const t={enabled:s.zM,xOffset:s.ai,yOffset:s.ai,renderer:(0,s.R3)((0,s.or)(s.Yj,(0,s.fd)({text:s.Yj,color:s.yW,backgroundColor:s.yW,opacity:s.CG},"crosshair label renderer result object")))};return e&&(t.format=s.Yj),{enabled:s.zM,snap:s.zM,label:t,...s.AF,...s.mL}}function cm(e,t){return{min:(0,s.Uo)(e,(0,s.Xe)("max")),max:(0,s.Uo)(e,(0,s.MM)("min")),nice:s.zM,interval:{step:t?(0,s.or)(s.MX,qg,(0,s.hR)(Cn)):s.MX,values:(0,s.jk)(e),minSpacing:(0,s.Uo)(s.Ly,(0,s.Xe)("maxSpacing")),maxSpacing:(0,s.Uo)(s.Ly,(0,s.MM)("minSpacing"))}}}am.title._enabledFromTheme=(0,s._L)(s.zM);var hm=(0,s.or)((0,s.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle"),s.E2),dm=(0,s.KC)("never","always","hyphenate","on-space"),um=(0,s.KC)("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),pm=(0,s.KC)("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),gm=(0,s.or)(s.Ly,(0,s.KC)("exact","nearest")),mm=(0,s.KC)("pointer","start","middle","end"),fm={enabled:s.zM,text:s.Yj,textAlign:(0,s.KC)("left","center","right"),wrapping:(0,s.KC)("never","always","hyphenate","on-space"),spacing:s.Ly,maxWidth:s.Ly,maxHeight:s.Ly,...s.LV};fm.padding=(0,s._L)(s.Ly);var ym={enabled:s.zM,text:s.Yj,renderer:(0,s.R3)((0,s.or)(s.Yj,s.Sc))},vm=["defaults","download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series","separator"],Cm={type:(0,s.KC)("action","separator"),showOn:(0,s.KC)("always","series-area","series-node","legend-item"),label:(0,s.mw)(s.Yj),enabled:s.zM,action:s.E2,items:(e,t)=>wm(e,t)};Cm.iconUrl=(0,s._L)(s.Yj);var bm=(0,s.fd)(Cm),Sm=(0,s.W$)((e,t)=>{let i;return"string"==typeof e?vm.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new s.yI(s.By.Invalid,`a context menu item string alias: ["${vm.join('", "')}"]`,e,t.path))):i=bm(e,t),i},`a context menu item object or string alias: [${vm.join(", ")}]`),wm=(0,s.jk)(Sm,"a menu items array",!1),xm=(0,s.J$)({label:(0,s.mw)(s.Yj),action:(0,s.mw)(s.E2)},"a context menu actions array"),Em={label:s.Yj,ariaLabel:s.Yj,tooltip:s.Yj,icon:(0,s.KC)("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},Mm={width:s.Ly,height:s.Ly,minWidth:s.Ly,minHeight:s.Ly,suppressFieldDotNotation:s.zM,title:fm,subtitle:fm,footnote:fm,padding:{top:s.Ly,right:s.Ly,bottom:s.Ly,left:s.Ly},seriesArea:{clip:s.zM,padding:{top:s.Ly,right:s.Ly,bottom:s.Ly,left:s.Ly}},legend:{enabled:s.zM,position:(0,s.KC)("top","right","bottom","left"),orientation:(0,s.KC)("horizontal","vertical"),maxWidth:s.Ly,maxHeight:s.Ly,spacing:s.Ly,preventHidingAll:s.zM,reverseOrder:s.zM,toggleSeries:s.zM,item:{marker:{size:s.Ly,shape:hm,padding:s.Ly,strokeWidth:s.Ly},line:{length:s.Ly,strokeWidth:s.Ly},label:{maxLength:s.Ly,formatter:s.E2,...s.LV},maxWidth:s.Ly,paddingX:s.Ly,paddingY:s.Ly,showSeriesStroke:s.zM},pagination:{marker:{size:s.Ly,shape:hm,padding:s.Ly},activeStyle:{...s.Fu,...s.AF},inactiveStyle:{...s.Fu,...s.AF},highlightStyle:{...s.Fu,...s.AF},label:s.LV},listeners:{legendItemClick:s.E2,legendItemDoubleClick:s.E2}},gradientLegend:{enabled:s.zM,position:(0,s.KC)("top","right","bottom","left"),spacing:s.Ly,reverseOrder:s.zM,gradient:{preferredLength:s.Ly,thickness:s.Ly},scale:{label:{...s.LV,format:Xg,formatter:s.E2},padding:s.Ly,interval:{step:s.ai,values:s.YO,minSpacing:(0,s.Uo)(s.Ly,(0,s.Xe)("maxSpacing")),maxSpacing:(0,s.Uo)(s.Ly,(0,s.MM)("minSpacing"))}}},listeners:{seriesNodeClick:s.E2,seriesNodeDoubleClick:s.E2,seriesVisibilityChange:s.E2,click:s.E2,doubleClick:s.E2,annotations:s.E2,zoom:s.E2},loadGoogleFonts:s.zM,highlight:{range:(0,s.KC)("tooltip","node")},overlays:{loading:ym,noData:ym,noVisibleSeries:ym,unsupportedBrowser:ym},tooltip:{enabled:s.zM,showArrow:s.zM,pagination:s.zM,delay:s.Ly,range:gm,wrapping:dm,mode:(0,s.KC)("single","shared","compact"),position:{type:pm,anchorTo:(0,s.KC)("pointer","node","chart"),placement:(0,s.or)(um,(0,s.jk)(um)),xOffset:s.ai,yOffset:s.ai}},animation:{enabled:s.zM,duration:s.Ly},contextMenu:{enabled:s.zM,items:wm,extraActions:xm,extraSeriesAreaActions:xm,extraNodeActions:xm,extraLegendItemActions:xm},dataSource:{getData:s.E2},keyboard:{enabled:s.zM,tabIndex:s.ai},touch:{dragAction:(0,s.KC)("none","drag","hover")},ranges:{enabled:s.zM,buttons:(0,s.J$)({...Em,value:(0,s.or)(s.ai,(0,s.Uo)((0,s.jk)((0,s.or)(s.ai,s.p6)),(0,s.O9)(2,2)),s.E2)},"range button options array")},locale:{localeText:s.Ik,getLocaleText:(0,s.R3)(s.Yj)},background:{visible:s.zM,fill:s.yW,image:{url:(0,s.mw)(s.Yj),top:s.ai,right:s.ai,bottom:s.ai,left:s.ai,width:s.Ly,height:s.Ly,opacity:s.CG}},styleNonce:s.Yj,sync:{enabled:s.zM,groupId:s.Yj,axes:(0,s.KC)("x","y","xy"),nodeInteraction:s.zM,zoom:s.zM},zoom:{enabled:s.zM,enableAxisDragging:s.zM,enableDoubleClickToReset:s.zM,enablePanning:s.zM,enableScrolling:s.zM,enableSelecting:s.zM,enableTwoFingerZoom:s.zM,keepAspectRatio:s.zM,anchorPointX:mm,anchorPointY:mm,axes:(0,s.KC)("x","y","xy"),deceleration:(0,s.or)((0,s.KC)("off","short","long"),s.CG),minVisibleItems:s.Ly,minVisibleItemsX:s.Ly,minVisibleItemsY:s.Ly,panKey:(0,s.KC)("alt","ctrl","meta","shift"),scrollingStep:s.CG,autoScaling:{enabled:s.zM,padding:s.CG},buttons:{enabled:s.zM,buttons:(0,s.J$)({...Em,value:(0,s.KC)("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:s.Yj},"zoom button options array"),visible:(0,s.KC)("always","zoomed","hover")}}};Mm.dataSource.requestThrottle=(0,s._L)(s.Ly),Mm.dataSource.updateThrottle=(0,s._L)(s.Ly),Mm.dataSource.updateDuringInteraction=(0,s._L)(s.zM),Mm.zoom.enableIndependentAxes=(0,s._L)(s.zM),Mm.statusBar=(0,s._L)(s.sw),Mm.foreground=(0,s._L)({visible:s.zM,text:s.Yj,image:{url:s.Yj,top:s.ai,right:s.ai,bottom:s.ai,left:s.ai,width:s.Ly,height:s.Ly,opacity:s.CG},...s.Fu}),Mm.context=(0,s._L)(()=>!0),Mm.overrideDevicePixelRatio=(0,s._L)(s.ai),Mm.sync.domainMode=(0,s._L)((0,s.KC)("direction","position","key"));var Am={cursor:s.Yj,showInLegend:s.zM,nodeClickRange:gm,listeners:{nodeClick:s.E2,nodeDoubleClick:s.E2},highlightStyle:{item:{...s.Fu,...s.AF},series:{enabled:s.zM,dimOpacity:s.CG,strokeWidth:s.Ly}}},Tm={...Am,id:s.Yj,visible:s.zM,data:s.YO};Tm.context=(0,s._L)(()=>!0),Tm.seriesGrouping=(0,s._L)(s.sw),Tm.highlight=(0,s._L)({enabled:s.zM});var Dm={enabled:s.zM,shape:hm,size:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,shape:hm,size:s.Ly}),...s.Fu,...s.AF,...s.mL},Im={enabled:s.zM,formatter:s.E2,...s.LV},Rm={...Im,lineHeight:s.Ly,minimumFontSize:s.Ly,wrapping:dm,overflowStrategy:(0,s.KC)("ellipsis","hide")},Pm={visible:s.zM,cap:{visible:s.zM,length:s.Ly,lengthRatio:s.CG,...s.AF,...s.mL},...s.AF,...s.mL},km={...Pm,xLowerKey:s.Yj,xUpperKey:s.Yj,yLowerKey:s.Yj,yUpperKey:s.Yj,xLowerName:s.Yj,xUpperName:s.Yj,yLowerName:s.Yj,yUpperName:s.Yj,itemStyler:(0,s.YI)({visible:s.zM,...s.AF,...s.mL,cap:{visible:s.zM,length:s.Ly,lengthRatio:s.CG,...s.AF,...s.mL}})},Lm={enabled:s.zM,showArrow:s.zM,range:gm,renderer:(0,s.R3)((0,s.or)(s.Yj,(0,s.fd)({heading:s.Yj,title:s.Yj,data:(0,s.J$)({label:(0,s.mw)(s.Yj),value:(0,s.mw)(s.Yj)})},"tooltip renderer result object"))),position:{type:pm,anchorTo:(0,s.KC)("node","pointer","chart"),placement:(0,s.or)(um,(0,s.jk)(um)),xOffset:s.ai,yOffset:s.ai},interaction:{enabled:s.zM}};Lm.position._seriesOverrideType=(0,s._L)(pm);var Nm={enabled:s.zM,xOffset:s.ai,yOffset:s.ai,blur:s.Ly,color:s.yW},_m=(0,s.is)({linear:{},smooth:{tension:s.CG},step:{position:(0,s.KC)("start","middle","end")}},"interpolation line options"),Om={showInMiniChart:s.zM,connectMissingData:s.zM,interpolation:_m,label:Im,marker:Dm,tooltip:Lm,shadow:Nm,...Am,...s.Fu,...s.AF,...s.mL},Fm={...Om,...Tm,type:(0,s.mw)((0,s.dY)("area")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai},Gm={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new Yg(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{_seriesOverrideType:"node"}},fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:mp,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Ru,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},Bm={type:"series",name:"area",chartType:"cartesian",options:Fm,create:e=>new Yg(e)};function Vm(e,t){for(const i of t){const t=i.datum;void 0===t?s.Vy.error("undefined datum"):e.addValue(i,t)}}function Hm(e,t){const{x:i,y:s}=t,{nearest:r,distanceSquared:n}=e.getQuadTree().find(i,s);if(void 0!==r)return{datum:r.value,distance:Math.sqrt(n)}}var Um=class extends zp{constructor(){super(...arguments),this.direction="vertical"}};a([Te],Um.prototype,"direction",2);var zm=class extends jp{constructor(){super(...arguments),this.groupScale=new wh,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i="boolean"==typeof t?1:.5,r=(0,s.Bf)(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=Dh(e)??[NaN,NaN];return"boolean"==typeof t?n[t?0:1]-=(t?1:-1)*r:(n[0]-=r,n[1]+=r),_o(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getBandwidth(e,t){return cn.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t,0)??0,r=cn.is(i)?-.5*s:0,n=i.convert(e)+r;return[n,n+s]}yCoordinateRange(e){const t=this.axes[this.getBarDirection()].scale,i=e.map(e=>t.convert(e));if(1===i.length){const e=t.convert(0);return[Math.min(i[0],e),Math.max(i[0],e)]}return[Math.min(...i),Math.max(...i)]}updateGroupScale(e){const t=[],{groupScale:i}=this,s=this.getBandwidth(e),{index:r,visibleGroupCount:n}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let e=0;e<n;e++)t.push(String(e));return i.domain=t,i.range=[0,s??0],e instanceof kd?i.paddingInner=e.groupPaddingInner:e instanceof Ah?(i.paddingInner=e.groupPaddingInner,i.round=0!==i.padding):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:r}}resolveKeyDirection(e){return"x"===this.getBarDirection()?"x"===e?"y":"x":e}initQuadTree(e){Vm(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Hm(this,e)}},Wm=class extends pl{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};a([Te],Wm.prototype,"placement",2),a([Te],Wm.prototype,"padding",2);var jm=class extends Um{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new wp,this.label=new Wm,this.tooltip=new Np,this.sparklineMode=!1,this.fastDataProcessing=!1}};function Km(e,t,i,s){if(null!=t){const[e,i]=t;if(0!==e||1!==i)return!1}if(cn.is(e)){const t=e.calcBandwidth(s)-e.calcBandwidth(i);if(t>0&&t<1)return!1}return!0}a([Te],jm.prototype,"xKey",2),a([Te],jm.prototype,"xName",2),a([Te],jm.prototype,"yKey",2),a([Te],jm.prototype,"yName",2),a([Te],jm.prototype,"yFilterKey",2),a([Te],jm.prototype,"stackGroup",2),a([Te],jm.prototype,"normalizedTo",2),a([Te],jm.prototype,"fill",2),a([Te],jm.prototype,"fillGradientDefaults",2),a([Te],jm.prototype,"fillPatternDefaults",2),a([Te],jm.prototype,"fillImageDefaults",2),a([Te],jm.prototype,"fillOpacity",2),a([Te],jm.prototype,"stroke",2),a([Te],jm.prototype,"strokeWidth",2),a([Te],jm.prototype,"strokeOpacity",2),a([Te],jm.prototype,"lineDash",2),a([Te],jm.prototype,"lineDashOffset",2),a([Te],jm.prototype,"cornerRadius",2),a([Te],jm.prototype,"crisp",2),a([Te],jm.prototype,"itemStyler",2),a([Te],jm.prototype,"shadow",2),a([Te],jm.prototype,"label",2),a([Te],jm.prototype,"tooltip",2),a([Te],jm.prototype,"sparklineMode",2),a([Te],jm.prototype,"fastDataProcessing",2);var $m=e=>(0,s.cI)(e.yValue??0);function Ym(e,t,i){const{startingX:s,startingY:r}=function(e,t){const i=t[e?"y":"x"];let s=1/0,r=0;return i?(e?r=i.scale.convert(cn.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(cn.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:r}):{startingX:s,startingY:r}}(e,t);return{isVertical:e,calculate:(t,i)=>{let n=e?t.x:s,o=e?r:t.y,a=e?t.width:0,l=e?0:t.height;const{opacity:c=1}=t;let h;return i&&(isNaN(n)||isNaN(o))&&(({x:n,y:o}=i),a=e?i.width:0,l=e?0:i.height,e&&!$m(i)?o+=i.height:!e&&$m(i)&&(n+=i.width)),h=null==t.clipBBox?void 0:$m(t)?e?new f(n,o-l,a,l):new f(n-a,o,a,l):new f(n,o,a,l),{x:n,y:o,width:a,height:l,clipBBox:h,opacity:c}},mode:i}}function qm(e,t){return{isVertical:e,calculate:t=>({x:e?t.x:t.x+t.width/2,y:e?t.y+t.height/2:t.y,width:e?t.width:0,height:e?0:t.height,clipBBox:t.clipBBox,opacity:t.opacity??1}),mode:t}}function Xm(e){const t=e=>null==e||isNaN(e.x)||isNaN(e.y);return{toFn:(i,s,r)=>"removed"===r&&null==i.datum&&"fade"===e.mode?{...Zm(i,s),opacity:0}:"removed"===r||t(s)?e.calculate(s,i.previousDatum):{x:s.x,y:s.y,width:s.width,height:s.height,clipBBox:s.clipBBox,opacity:s.opacity??1},fromFn:(i,s,r)=>{let n;"updated"===r&&t(s)?r="removed":"updated"===r&&t(i.previousDatum)&&(r="added"),n="added"===r&&null==i.previousDatum&&"fade"===e.mode?{...Zm(i,s),opacity:0}:"unknown"===r||"added"===r?e.calculate(s,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1};const o=oa[r];return{...n,phase:o}},applyFn:(e,t,i)=>{e.setProperties(t),e.crisp="end"===i&&(e.datum?.crisp??!1)}}}function Zm(e,{x:t,y:i,width:s,height:r,clipBBox:n,opacity:o=1}){return{x:t,y:i,width:s,height:r,clipBBox:n,opacity:o,crisp:e.datum?.crisp??!1}}function Qm(e,t){if(void 0===t)return;const{x:i,y:s,width:r,height:n}=t;return wt.toCanvas(e.contentGroup,new f(i,s,r,n))}function Jm(e,t,i,s,r,n){let o=n?.reduced?.diff?.[e];if(o?.changed)return o;const a=function(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!Mg(i.x,s.x))return!0;if(!Mg(i.y,s.y))return!0;if(!ef(e)||!ef(t))return!1;return!Mg(e.groupScale,t.groupScale)}(s,r);return null==o&&null!=n?.reduced?.diff?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},a?o.updated=new Set(Array.from(t,({datum:e})=>i(e))):o.added=new Set(Array.from(t,({datum:e})=>i(e)))):a&&(o={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:e})=>i(e))),removed:new Set,moved:new Set}),o}function ef(e){return"object"==typeof e&&null!==e&&"groupScale"in e}function tf(e,t,i){if(t.enabled&&i){const{x:s,y:r,text:n,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u}=t;e.setProperties({visible:!0,x:s,y:r,text:n,fill:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:o,textBaseline:a})}else e.visible=!1}var sf={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function rf({isUpward:e,isVertical:t,placement:i,padding:s=0,rect:r}){let n=r.x+r.width/2,o=r.y+r.height/2,a="center",l="middle";if("inside-center"!==i){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:d}=sf[i],u=.5*(h+1);t?(o=(e?r.y+r.height:r.y)+r.height*c*u+s*d*c,l=d===c?"top":"bottom"):(n=(e?r.x:r.x+r.width)+r.width*c*u+s*d*c,a=d===c?"left":"right")}return{x:n,y:o,textAlign:a,textBaseline:l}}var nf=class extends zm{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Zm,label:bp}}),this.properties=new jm,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return null!=this.properties.yFilterKey&&(null==this.seriesGrouping||0===this.seriesGrouping.stackIndex)}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:r,normalizedTo:n,fastDataProcessing:o}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:l}=this,c=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||null!=n,d=!o||c>1||h,u=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:m,xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:p,yScale:g}),v=`bar-stack-${a}-yValues`,C=`${v}-trailing`,b=this.visible?{}:{forceValue:0},S=[jh(t,f,{id:"xValue"}),Kh(i,y,{id:"yValue-raw",invalidValue:null,...b})];this.crossFilteringEnabled()&&S.push(Kh(r,y,{id:"yFilterValue",invalidValue:null,...b})),h&&S.push(...Jh(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:v,separateNegative:!0,...b},y),...Jh(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:C,separateNegative:!0,...b},y)),m&&S.push(td,id),(0,s.Bf)(n)&&S.push(nd([v,C],Math.abs(n))),u&&this.processedData&&S.push(yd(this.id,this.processedData)),!u&&d||S.push(cd());const{dataModel:w,processedData:x}=await this.requestDataModel(e,l,{props:S,groupByKeys:d,groupByData:!d});this.dataAggregationFilters=this.aggregateData(w,x),this.smallestDataInterval=x.reduced?.smallestKeyInterval,this.largestDataInterval=x.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(null==i||null==t)return[];if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue"),s=i.getDomain(this,"xValue","key",t);return"key"===e?.def.type&&"category"===e.def.valueType?s:this.padBandExtent(s)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let r=this.domainForClippedRange(e,[s],"xValue",!0);const n=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t):void 0;return null!=n&&(r=[Math.min(r[0],n[0]),Math.max(r[1],n[1])]),this.getValueAxis()instanceof Ud?_o(r):_o(Number.isFinite(r[1]-r[0])?[Math.min(0,r[0]),Math.max(0,r[1])]:[])}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,r]=this.domainForVisibleRange("y",[i],"xValue",t,!0);return[Math.min(s,0),Math.max(r,0)]}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,groupScale:i,dataAggregationFilters:s}=this,r=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&t&&r&&n))return;const o=t.dataSources?.get(this.id);if(null==o)return;const a=r.scale,l=n.scale,{xKey:c,yKey:h,xName:d,yName:u,legendItemName:p,label:g}=this.properties,m=n.isReversed(),{barWidth:y,groupIndex:v}=this.updateGroupScale(r),C=i.convert(String(v)),b=cn.is(a)?-.5*y:0,S=e.resolveKeysById(this,"xValue",t),w=e.resolveColumnById(this,"yValue-raw",t),x=this.crossFilteringEnabled()?e.resolveColumnById(this,"yFilterValue",t):void 0,E=!this.ctx.animationManager.isSkipped(),M=e=>a.convert(S[e])+C+b,A=this.properties.crisp??Km(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval),T=l.convert(0),D=({datum:e,datumIndex:t,valueIndex:i,xValue:s,yValue:r,cumulativeValue:n,phantom:o,currY:a,prevY:d,x:u,width:p,isPositive:y,yRange:v,labelText:C,opacity:b,crossScale:S=1})=>{const w=y!==m,x=l.convert(a),E=l.convert(d),M=l.convert(v),D="x"===this.getBarDirection(),I=.5*p*(1-S),R={x:D?Math.min(x,E):u+I,y:D?u+I:Math.min(x,E),width:D?Math.abs(E-x):p*S,height:D?p*S:Math.abs(E-x)},P=new f(R.x,R.y,R.width,R.height),k={x:D?Math.min(T,M):u+I,y:D?u+I:Math.min(T,M),width:D?Math.abs(T-M):p*S,height:D?p*S:Math.abs(T-M)},L=this.shouldFlipXY()?R.height:R.width;return{series:this,itemId:o?vd(h,o):h,datum:e,datumIndex:t,valueIndex:i,cumulativeValue:n,phantom:o,xValue:s,yValue:r,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:L,lengthMax:L},x:k.x,y:k.y,width:k.width,height:k.height,midPoint:{x:R.x+R.width/2,y:R.y+R.height/2},opacity:b,topLeftCornerRadius:D!==w,topRightCornerRadius:w,bottomRightCornerRadius:D===w,bottomLeftCornerRadius:!w,clipBBox:P,crisp:A,label:null!=C?{text:C,...rf({isUpward:w,isVertical:!D,placement:g.placement,padding:g.padding,rect:R})}:void 0,missing:null==r,focusable:!o}},I=[],R=[],P=[],k=(e,t,i,s,r,n,a,l)=>{const g=S[e];if(null==g)return;const m=w[e],f=null!=x?Number(x[e]):void 0,y=m>=0&&!Object.is(m,-0);if(!Number.isFinite(n))return;if(null!=f&&!Number.isFinite(f))return;const v=null!=m?this.getLabelText(this.properties.label,{datum:o[e],value:f??m,xKey:c,yKey:h,xName:d,yName:u,legendItemName:p}):void 0,C=null!=f&&f>m,b=D({datum:o[e],datumIndex:e,valueIndex:t,xValue:g,yValue:f??m,cumulativeValue:f??n,phantom:!1,currY:null!=f?r+f:n,prevY:r,x:i,width:s,isPositive:y,yRange:Math.max(r+(f??-1/0),a),labelText:v,opacity:l,crossScale:C?.6:void 0});if(R.push(b),P.push(b),null!=f){const c=D({datum:o[e],datumIndex:e,valueIndex:t,xValue:g,yValue:f,cumulativeValue:f,phantom:!0,currY:n,prevY:r,x:i,width:s,isPositive:y,yRange:a,labelText:void 0,opacity:l,crossScale:void 0});I.push(c)}},[L,N]=a.range,_=N-L,O=s?.find(e=>e.maxRange>_);if("grouped"===t.type){const i=y,s=e.hasColumnById(this,"yValue-start"),r=s?e.resolveColumnById(this,"yValue-start",t):void 0,n=s?e.resolveColumnById(this,"yValue-end",t):void 0,o=s?e.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:a,valueIndex:l,group:{aggregation:c}}of e.forEachGroupDatum(this,t)){const e=M(a),t=w[a],h=t>=0&&!Object.is(t,-0),d=s?Number(r?.[a]):0,u=s?Number(n?.[a]):t;let p=u;s&&(p=c[o][h?1:0]),k(a,l,e,i,d,u,p,1)}}else if(null==O){const e=y;let[i,s]=this.visibleRange("xValue",r.range);t.input.count<1e3&&(i=0,s=t.input.count);for(let t=i;t<s;t+=1){const i=M(t),s=Number(w[t]);k(t,0,i,e,0,s,s,1)}}else{const{indexData:e,indices:t}=O,[i,s]=this.visibleRange("xValue",r.range,t);for(let t=i;t<s;t+=1){const i=4*t,s=e[i+0],r=e[i+1],n=e[i+2],o=e[i+3];if(-1===s)continue;const a=M((s+r)/2|0),l=Math.abs(M(r)-M(s))+y,c=null!=S[o]?Number(w[o]):NaN,h=null!=S[n]?Number(w[n]):NaN;c>0&&k(o,0,a,l,0,c,c,h>=0?h/c:1),h<0&&k(n,1,a,l,0,h,h,c<=0?c/h:1)}}return{itemId:h,nodeData:I.length>0?[...I,...R]:R,labelData:P,scales:this.calculateScaling(),visible:this.visible||E,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new Zd}getHighlightData(e,t){const i=e.find(e=>e.datum===t.datum&&!e.phantom);return null!=i?[i]:void 0}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>this.getDatumId(e))}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:r,fillImageDefaults:n}=t,o=e?t.highlightStyle.item:void 0;return pc({fill:o?.fill??t.fill,fillOpacity:o?.fillOpacity??t.fillOpacity,stroke:o?.stroke??t.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:o?.strokeOpacity??t.strokeOpacity,lineDash:o?.lineDash??t.lineDash??[],lineDashOffset:o?.lineDashOffset??t.lineDashOffset,cornerRadius:i},s,r,n)}getItemStyleOverrides(e,t,i,s,r,n){const{id:o,properties:a}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:d,fillPatternDefaults:u,fillImageDefaults:p}=a;if(null==h)return;const{xDomain:g,yDomain:m}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return pc(this.cachedDatumCallback(vd(e,n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,...Yr(t,l,c,g,m),datum:t,xValue:i,yValue:s,highlighted:n,...r})),d,u,p)}updateDatumNodes(e){const{shadow:t}=this.properties,i="x"===this.getCategoryDirection(),s=this.getItemBaseStyle(e.isHighlight),r=this.getShapeFillBBox();e.datumSelection.each((n,o)=>{const a=this.getItemStyleOverrides(String(o.datumIndex),o.datum,o.xValue,o.yValue,s,e.isHighlight);n.opacity=o.opacity??0,mc(n,s,a,r);const l=a?.cornerRadius??s.cornerRadius;n.topLeftCornerRadius=o.topLeftCornerRadius?l:0,n.topRightCornerRadius=o.topRightCornerRadius?l:0,n.bottomRightCornerRadius=o.bottomRightCornerRadius?l:0,n.bottomLeftCornerRadius=o.bottomLeftCornerRadius?l:0,n.visible=i?(o.clipBBox?.width??o.width)>0:(o.clipBBox?.height??o.height)>0,n.crisp=o.crisp,n.fillShadow=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,e=>{e.pointerEvents=1})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{tf(e,this.properties.label,t.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{xKey:n,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=r,u=this.getCategoryAxis(),p=this.getValueAxis();if(!(i&&s&&u&&p))return;const g=s.dataSources.get(this.id)?.[e],m=i.resolveKeysById(this,"xValue",s)[e],f=i.resolveColumnById(this,"yValue-raw",s)[e];if(null==m)return;const y=this.getItemBaseStyle(!1);return Object.assign(y,this.getItemStyleOverrides(String(e),g,m,f,y,!1)),this.formatTooltipWithContext(d,{heading:u.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:p.formatDatum(f)}]},{seriesId:t,datum:g,title:l,xKey:n,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...y,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:r,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:pc({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:r,strokeWidth:i,lineDash:n,lineDashOffset:o},a,l,c)}}getLegendData(e){const{showInLegend:t}=this.properties;if("category"!==e)return[];const{id:i,ctx:{legendManager:s},visible:r}=this,{yKey:n,yName:o,legendItemName:a}=this.properties;return[{legendType:"category",id:i,itemId:n,seriesId:i,enabled:r&&s.getItemEnabled({seriesId:i,itemId:n}),label:{text:a??o??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!t}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const s=Xm(Ym(this.isVertical(),this.axes,"normal"));aa(this.id,"nodes",this.ctx.animationManager,[e],s),vp(this,"labels",this.ctx.animationManager,t),vp(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:r,previousContextData:n}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=Jm(this.id,t,this.getDatumId.bind(this),e.contextData,n,this.processedData),a=null==n?"fade":"normal",l=Xm(Ym(this.isVertical(),this.axes,a));aa(this.id,"nodes",this.ctx.animationManager,[t],l,(e,t)=>this.getDatumId(t),o),!o?.changed&&Mg(r.groupScale,n?.groupScale)||(vp(this,"labels",this.ctx.animationManager,i),vp(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return vd(e.xValue,e.valueIndex,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return Qm(this,t)}};nf.className="BarSeries",nf.type="bar";var of={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),crisp:s.zM,label:{...Im,placement:(0,s.KC)("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:s.Ly},errorBar:Pm,shadow:Nm,tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL};of.sparklineMode=(0,s._L)(s.zM);var af={...of,...Tm,type:(0,s.mw)((0,s.dY)("bar")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,direction:(0,s.KC)("horizontal","vertical"),grouped:s.zM,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai,legendItemName:s.Yj,errorBar:km};af.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),af.fastDataProcessing=(0,s._L)(s.zM),af.focusPriority=(0,s._L)(s.ai);var lf={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new nf(e),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:cp,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:mp,fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Ru,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},cf={type:"series",name:"bar",chartType:"cartesian",options:af,create:e=>new nf(e)},hf=class extends kp{constructor(){super(...arguments),this.maxSize=30}};a([Te,$()],hf.prototype,"maxSize",2),a([Te,q()],hf.prototype,"domain",2);var df=class extends pl{constructor(){super(...arguments),this.placement="top"}};a([Te],df.prototype,"placement",2);var uf=class extends zp{constructor(){super(...arguments),this.label=new df,this.tooltip=new Np,this.marker=new hf}};a([Te],uf.prototype,"xKey",2),a([Te],uf.prototype,"yKey",2),a([Te],uf.prototype,"sizeKey",2),a([Te],uf.prototype,"labelKey",2),a([Te],uf.prototype,"xFilterKey",2),a([Te],uf.prototype,"yFilterKey",2),a([Te],uf.prototype,"sizeFilterKey",2),a([Te],uf.prototype,"xName",2),a([Te],uf.prototype,"yName",2),a([Te],uf.prototype,"sizeName",2),a([Te],uf.prototype,"labelName",2),a([Te],uf.prototype,"title",2),a([ni("marker.shape")],uf.prototype,"shape",2),a([ni("marker.size")],uf.prototype,"size",2),a([ni("marker.maxSize")],uf.prototype,"maxSize",2),a([ni("marker.domain")],uf.prototype,"domain",2),a([ni("marker.fillGradientDefaults")],uf.prototype,"fillGradientDefaults",2),a([ni("marker.fillPatternDefaults")],uf.prototype,"fillPatternDefaults",2),a([ni("marker.fillImageDefaults")],uf.prototype,"fillImageDefaults",2),a([ni("marker.fill")],uf.prototype,"fill",2),a([ni("marker.fillOpacity")],uf.prototype,"fillOpacity",2),a([ni("marker.stroke")],uf.prototype,"stroke",2),a([ni("marker.strokeWidth")],uf.prototype,"strokeWidth",2),a([ni("marker.strokeOpacity")],uf.prototype,"strokeOpacity",2),a([ni("marker.lineDash")],uf.prototype,"lineDash",2),a([ni("marker.lineDashOffset")],uf.prototype,"lineDashOffset",2),a([ni("marker.itemStyler")],uf.prototype,"itemStyler",2),a([Te],uf.prototype,"label",2),a([Te],uf.prototype,"tooltip",2);var pf=class extends Up{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},gf=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:bp,marker:Hg},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=pf,this.properties=new uf,this.sizeScale=new Vd}get pickModeAxis(){return"main-category"}async processData(e){if(null==this.data||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:r}=this.getScaleInformation({xScale:t,yScale:i}),n=this.sizeScale.type,{xKey:o,yKey:a,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,{dataModel:g,processedData:m}=await this.requestDataModel(e,this.data,{props:[Kh(o,s,{id:"xValue"}),Kh(a,r,{id:"yValue"}),...null!=c?[Kh(c,s,{id:"xFilterValue"})]:[],...null!=h?[Kh(h,r,{id:"yFilterValue"})]:[],...null!=d?[Kh(d,n,{id:"sizeFilterValue"})]:[],Kh(l,n,{id:"sizeValue"}),...u?[Kh(u,"band",{id:"labelValue"})]:[]]}),f=g.resolveProcessedDataIndexById(this,"sizeValue"),y=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=y??m.domain.values[f]??[],this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:r}=this,{size:n,sizeKey:o}=s,a=this.axes.x.scale.convert(e),l=null!=o?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,c=.5*(null!=l?r.convert(l[i]):n)*t;return[a-c,a+c]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:r}=this,{size:n,sizeKey:o}=s,a=this.axes.y.scale.convert(e[0]),l=null!=o?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,c=.5*(null!=l?r.convert(l[i]):n)*t;return[a-c,a+c]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},r=s[e],n=t.resolveProcessedDataDefById(this,r),o=t.getDomain(this,r,"value",i);if("value"===n?.def.type&&"category"===n?.def.valueType)return o;const a=s["x"===e?"y":"x"];return _o(Dh(this.domainForClippedRange(e,[r],a,!1)))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,sizeScale:s,visible:r}=this,{xKey:n,yKey:o,sizeKey:a,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:m,label:f,marker:y}=this.properties,{placement:v}=f,C=_c.anchor(y.shape),b=e.x,S=e.y;if(!(t&&i&&r&&b&&S))return;const w=t.resolveColumnById(this,"xValue",i),x=t.resolveColumnById(this,"yValue",i),E=null!=a?t.resolveColumnById(this,"sizeValue",i):void 0,M=null!=d?t.resolveColumnById(this,"labelValue",i):void 0,A=null!=l?t.resolveColumnById(this,"xFilterValue",i):void 0,T=null!=c?t.resolveColumnById(this,"yFilterValue",i):void 0,D=null!=h?t.resolveColumnById(this,"sizeFilterValue",i):void 0,I=b.scale,R=S.scale,P=(I.bandwidth??0)/2,k=(R.bandwidth??0)/2,L=[];s.range=[y.size,y.maxSize];const N=f.getFont(),_=Di.getMeasurer({font:N});return i.dataSources.get(this.id)?.forEach((e,t)=>{const i=w[t],r=x[t],l=E?.[t],c=I.convert(i)+P,h=R.convert(r)+k;let b;null!=A&&null!=T&&(b=A[t]===i&&T[t]===r,null!=D&&b&&(b=D[t]===l));const S=this.getLabelText(f,{value:null!=M?M[t]:r,datum:e,xKey:n,yKey:o,sizeKey:a,labelKey:d,xName:u,yName:p,sizeName:g,labelName:m}),N=_.measureText(String(S)),O=null!=l?s.convert(l):y.size;L.push({series:this,itemId:o,yKey:o,xKey:n,datum:e,datumIndex:t,xValue:i,yValue:r,sizeValue:l,point:{x:c,y:h,size:O},midPoint:{x:c,y:h},label:{text:S,...N},anchor:C,placement:v,selected:b})}),{itemId:o,nodeData:L,labelData:L,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?t:[];return i.update(s,void 0,e=>vd([e.xValue,e.yValue,e.sizeValue,e.label.text]))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,sizeKey:n,labelKey:o,marker:a}=this.properties,l=N(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize];const c=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(a,e,t.datum,t.point,{xKey:s,yKey:r,sizeKey:n,labelKey:o},i,l,c,{selected:t.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{e.text=i.label.text,e.fill=t.color,e.x=i.point?.x??0,e.y=i.point?.y??0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,title:g,tooltip:m,marker:f}=n,y=r.x,v=r.y;if(!(i&&s&&y&&v))return;const C=s.dataSources.get(this.id)?.[e],b=i.resolveColumnById(this,"xValue",s)[e],S=i.resolveColumnById(this,"yValue",s)[e],w=this.contextNodeData?.nodeData[e];if(null==b||null==w)return;const x=[{label:a,fallbackLabel:o,value:y.formatDatum(b)},{label:c,fallbackLabel:l,value:v.formatDatum(S)}];if(null!=h){const t=i.resolveColumnById(this,"sizeValue",s)[e];x.push({label:d,fallbackLabel:h,value:String(t)})}const E=f.getStyle(),M=this.getMarkerStyle(f,C,{xKey:o,yKey:l,sizeKey:h,labelKey:u,highlighted:!0},!1,void 0,E);return this.formatTooltipWithContext(m,{title:g,symbol:this.legendItemSymbol(),data:x},{seriesId:t,datum:C,title:l,xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:r,title:n}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:n??r??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){Bg(this,this.ctx.animationManager,e),vp(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new At}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:r,marker:n}=this.properties;return this.getMarkerStyle(n,e,{xKey:t,yKey:i,sizeKey:s,labelKey:r},!1,e.point.size)}computeFocusBounds(e){return zg(this,e)}};gf.className="BubbleSeries",gf.type="bubble";var mf={title:s.Yj,domain:(0,s.jk)(s.ai),maxSize:s.Ly,showInMiniChart:s.zM,label:{placement:(0,s.KC)("top","right","bottom","left"),...Im},tooltip:Lm,...Am,...G(Dm,["enabled"])},ff={...mf,...Tm,type:(0,s.mw)((0,s.dY)("bubble")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),sizeKey:(0,s.mw)(s.Yj),labelKey:s.Yj,xName:s.Yj,yName:s.Yj,sizeName:s.Yj,labelName:s.Yj},yf={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new gf(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:mp,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},vf={type:"series",name:"bubble",chartType:"cartesian",options:ff,create:e=>new gf(e)},Cf=class extends zp{constructor(){super(...arguments),this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new wp,this.label=new pl,this.tooltip=new Np}};a([Te],Cf.prototype,"xKey",2),a([Te],Cf.prototype,"yKey",2),a([Te],Cf.prototype,"xName",2),a([Te],Cf.prototype,"yName",2),a([Te],Cf.prototype,"fill",2),a([Te],Cf.prototype,"fillGradientDefaults",2),a([Te],Cf.prototype,"fillPatternDefaults",2),a([Te],Cf.prototype,"fillImageDefaults",2),a([Te],Cf.prototype,"fillOpacity",2),a([Te],Cf.prototype,"stroke",2),a([Te],Cf.prototype,"strokeWidth",2),a([Te],Cf.prototype,"strokeOpacity",2),a([Te],Cf.prototype,"lineDash",2),a([Te],Cf.prototype,"lineDashOffset",2),a([Te],Cf.prototype,"cornerRadius",2),a([Te],Cf.prototype,"areaPlot",2),a([Te],Cf.prototype,"bins",2),a([Te],Cf.prototype,"aggregation",2),a([Te],Cf.prototype,"binCount",2),a([Te],Cf.prototype,"shadow",2),a([Te],Cf.prototype,"label",2),a([Te],Cf.prototype,"tooltip",2);var bf=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Zm,label:bp}}),this.properties=new Cf,this.calculatedBins=[]}deriveBins(e){const t=Ba(e[0],e[1],10).ticks,i=za(e[0],e[1],10),[s]=t;return[[s-i,s],...t.map(e=>[e,e+i])]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],r=t||1,{start:n,binSize:o}=this.calculateNiceStart(i,s,r);return this.getBins(n,s,o,r)}getBins(e,t,i,s){const r=[],n=this.calculatePrecision(i);for(let o=0;o<s;o++){const a=Math.round((e+o*i)*n)/n;let l=Math.round((e+(o+1)*i)*n)/n;o===s-1&&(l=Math.max(l,t)),r[o]=[a,l]}return r}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,r=Math.floor(Math.log10(s)),n=Math.pow(10,r);return{start:Math.floor(e/n)*n,binSize:s}}async processData(e){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:t,yKey:i,areaPlot:r,aggregation:n}=this.properties,o=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:a,xScale:o}),h=[jh(t,l),sd];if(i){let e=Oh("groupAgg");"count"===n||("sum"===n?e=_h("groupAgg"):"mean"===n&&(e=Fh("groupAgg"))),r&&(e=Gh("groupAgg",e)),h.push(Kh(i,c,{invalidValue:void 0}),e)}else{h.push($h("count"));let e=Oh("groupAgg");r&&(e=Gh("groupAgg",e)),h.push(e)}!this.ctx.animationManager.isSkipped()&&this.processedData&&h.push(yd(this.id,this.processedData,!1)),await this.requestDataModel(e,this.data,{props:h,groupByFn:e=>{const t=_o(e.domain.keys[0]);if(0===t.length)return e.domain.groups=[],()=>[];const i=(0,s.Et)(this.properties.binCount)?this.calculateNiceBins(t,this.properties.binCount):this.properties.bins??this.deriveBins(t),r=i.length;return this.calculatedBins=[...i],e=>{let t=e[0];if((0,s.$P)(t)&&(t=t.getTime()),!(0,s.Et)(t))return[];for(let e=0;e<r;e++){const s=i[e];if(t>=s[0]&&t<s[1])return s;if(e===r-1&&t<=s[1])return s}return[]}}}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",t),r=this.calculatedBins?.[0][0],n=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return _o("x"===e?[r,n]:s)}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:r}=this;if(!s||"grouped"!==r?.type)return[NaN,NaN];const n=this.axes.x.scale;let o=-1/0;return r.groups.forEach(({keys:e,aggregation:s})=>{const[[r,a]=[0,0]]=s,[l,c]=e,[h,d]=on([n.convert(l),n.convert(c)]);if(d>=t&&h<=i){const e=r+a;o=Math.max(o,e)}}),0>o?[NaN,NaN]:[0,o]}frequency(e){return e.datumIndices.reduce((e,t)=>e+t.length,0)}createNodeData(){const{id:e,axes:t,processedData:i,dataModel:s}=this,r=t.x,n=t.y;if(!r||!n||!s)return;const{scale:o}=r,{scale:a}=n,{xKey:l,yKey:c,xName:h,yName:d}=this.properties,u=this.properties.label.formatter,p=[],g={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&null!=i&&"grouped"===i.type?(i.groups.forEach((t,r)=>{const{keys:g,aggregation:m}=t,[[f,y]=[0,0]]=m,v=this.frequency(t),C=g,[b,S]=C,w=[...s.forEachDatum(this,i,t)],x=o.convert(b),E=o.convert(S),M=f+y,A=a.convert(0),T=a.convert(M),D=Math.abs(E-x),I=Math.abs(T-A),R=Math.min(x,E),P=Math.min(A,T);let k;0!==M&&(k={x:R+D/2,y:P+I/2,text:this.cachedDatumCallback(vd(r,"label"),()=>u?.({value:M,datum:w,seriesId:e,xKey:l,yKey:c,xName:h,yName:d}))??n.formatDatum(M)});const L={x:R+D/2,y:P+I/2},N=n.isReversed();p.push({series:this,datumIndex:r,datum:w,aggregatedValue:M,frequency:v,domain:C,yKey:c,xKey:l,x:R,y:P,xValue:x,yValue:T,width:D,height:I,midPoint:L,topLeftCornerRadius:!N,topRightCornerRadius:!N,bottomRightCornerRadius:N,bottomLeftCornerRadius:N,label:k,crisp:!0})}),p.sort((e,t)=>e.x-t.x),g):g}nodeFactory(){return new Zd}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,e=>e.domain.join("_"))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return pc({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,s=this.getItemBaseStyle(t),r=this.getShapeFillBBox();e.datumSelection.each((e,t)=>{const{cornerRadius:n}=s,{topLeftCornerRadius:o,topRightCornerRadius:a,bottomRightCornerRadius:l,bottomLeftCornerRadius:c}=t;mc(e,s,void 0,r),e.topLeftCornerRadius=o?n:0,e.topRightCornerRadius=a?n:0,e.bottomRightCornerRadius=l?n:0,e.bottomLeftCornerRadius=c?n:0,e.crisp=t.crisp,e.fillShadow=i,e.visible=t.height>0})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.pointerEvents=1,e.textAlign="center",e.textBaseline="middle"})}updateLabelNodes(e){const{fontStyle:t,fontWeight:i,fontFamily:s,fontSize:r,color:n}=this.properties.label,o=this.isLabelEnabled();e.labelSelection.each((e,a)=>{o&&a?.label?(e.text=a.label.text,e.x=a.label.x,e.y=a.label.y,e.fontStyle=t,e.fontWeight=i,e.fontFamily=s,e.fontSize=r,e.fill=n,e.visible=!0):e.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t&&Vm(e,t.children())}pickNodeClosestDatum(e){return Hm(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:d}=n,u=r.x,p=r.y;if(!i||"grouped"!==s?.type||!u||!p)return;const g=s.groups[e],{aggregation:m,keys:f}=g,[[y,v]=[0,0]]=m,C=this.frequency(g),b=f,[S,w]=b,x=y+v,E={data:[...i.forEachDatum(this,s,g)],aggregatedValue:x,frequency:C,domain:b},M=[{label:l,fallbackLabel:a,value:`${u.formatDatum(S)} - ${u.formatDatum(w)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(C)}];if(null!=c){let e;switch(n.aggregation){case"sum":e=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":e=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":e=o.t("seriesHistogramTooltipCount",{yName:h??c})}M.push({label:e,value:p.formatDatum(x)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:M},{seriesId:t,datum:E,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[S,w],frequency:C,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:r,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:pc({fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:r,strokeWidth:s,lineDash:n,lineDashOffset:o},a,l,c)}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:r,yName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:r,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:r}),label:{text:n??r??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Xm(Ym(!0,this.axes,"normal"));aa(this.id,"datums",this.ctx.animationManager,[e],i),vp(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Xm(Ym(!0,this.axes,"normal")),i=Jm(this.id,e.datumSelection,e=>vd(e.domain),e.contextData,e.previousContextData,this.processedData);aa(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(e,t)=>vd(t.domain),i),i?.changed&&vp(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Qm(this,this.contextNodeData?.nodeData[e])}};bf.className="HistogramSeries",bf.type="histogram";var Sf={showInMiniChart:s.zM,cornerRadius:s.Ly,label:Im,tooltip:Lm,shadow:Nm,...Am,...s.Fu,...s.AF,...s.mL},wf={...Sf,...Tm,type:(0,s.mw)((0,s.dY)("histogram")),xKey:(0,s.mw)(s.Yj),yKey:s.Yj,xName:s.Yj,yName:s.Yj,areaPlot:s.zM,aggregation:(0,s.KC)("count","sum","mean"),bins:(0,s.jk)((0,s.jk)(s.ai)),binCount:s.Ly},xf={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new bf(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:mp,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:Ru,xOffset:3,yOffset:3,blur:5}}}},Ef={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:wf,create:e=>new bf(e)},Mf=class extends zp{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Kp,this.marker=new kp,this.label=new pl,this.tooltip=new Np,this.connectMissingData=!1,this.sparklineMode=!1}};a([Te],Mf.prototype,"xKey",2),a([Te],Mf.prototype,"yKey",2),a([Te],Mf.prototype,"xName",2),a([Te],Mf.prototype,"yName",2),a([Te],Mf.prototype,"yFilterKey",2),a([Te],Mf.prototype,"stackGroup",2),a([Te],Mf.prototype,"normalizedTo",2),a([Te],Mf.prototype,"title",2),a([Te],Mf.prototype,"stroke",2),a([Te],Mf.prototype,"strokeWidth",2),a([Te],Mf.prototype,"strokeOpacity",2),a([Te],Mf.prototype,"lineDash",2),a([Te],Mf.prototype,"lineDashOffset",2),a([Te],Mf.prototype,"interpolation",2),a([Te],Mf.prototype,"marker",2),a([Te],Mf.prototype,"label",2),a([Te],Mf.prototype,"tooltip",2),a([Te],Mf.prototype,"connectMissingData",2),a([Te],Mf.prototype,"sparklineMode",2);var Af=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:Kg({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:bp,marker:(e,t)=>({opacity:1,scalingX:1,scalingY:1,...Ug(0,t)})},clipFocusBox:!1}),this.properties=new Mf,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(e){if(null==this.data)return;const{data:t,visible:i,seriesGrouping:{groupIndex:r=this.id,stackCount:n=0}={}}=this,{xKey:o,yKey:a,yFilterKey:l,connectMissingData:c,normalizedTo:h}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,p=this.axes.y?.scale,{isContinuousX:g,xScaleType:m,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:p}),y=n>=1||null!=h,v={invalidValue:null};c&&y&&(v.invalidValue=0),y&&!i&&(v.forceValue=0);const C=[];if(g&&!y||C.push(jh(o,m,{id:"xKey"})),C.push(Kh(o,m,{id:"xValue"}),Kh(a,f,{id:"yValueRaw",...v,invalidValue:void 0})),null!=l&&C.push(Kh(l,f,{id:"yFilterRaw"})),y){const e=[`line-stack-${r}-yValues`,`line-stack-${r}-yValues-trailing`,`line-stack-${r}-yValues-marker`];C.push(...Jh(a,"window","current",{id:"yValueEnd",...v,groupId:e[0]},f),...Jh(a,"window-trailing","current",{id:"yValueStart",...v,groupId:e[1]},f),...Jh(a,"normal","current",{id:"yValueCumulative",...v,groupId:e[2]},f)),(0,s.vM)(h)&&C.push(nd([e[0],e[1],e[2]],h))}d&&(C.push(cd(g?["xValue"]:void 0)),this.processedData&&C.push(yd(this.id,this.processedData)));const{dataModel:b,processedData:S}=await this.requestDataModel(e,t,{props:C,groupByKeys:y,groupByData:!y});this.dataAggregationFilters=this.aggregateData(b,S),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),r=i.enabled?.5*i.size*t:0;return[s-r,s+r]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),r=i.enabled?.5*i.size*t:0;return[s-r,s+r]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return[];if("x"===e){const e=t.resolveProcessedDataDefById(this,"xValue"),s=t.getDomain(this,"xValue","value",i);return"value"===e?.def.type&&"category"===e.def.valueType?s:_o(Dh(s))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return _o(this.domainForClippedRange("y",[s],"xValue",!0))}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",t,!0)}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,axes:i,dataAggregationFilters:s}=this,r=i.x,n=i.y;if(!(e&&t&&r&&n))return;const{xKey:o,yKey:a,yFilterKey:l,xName:c,yName:h,marker:d,label:u,connectMissingData:p,interpolation:g,legendItemName:m}=this.properties,f=this.dataModel?.hasColumnById(this,"yValueEnd"),y=r.scale,v=n.scale,C=(y.bandwidth??0)/2,b=(v.bandwidth??0)/2,S=d.enabled?d.size:0,w=t.dataSources.get(this.id)??[],x=e.resolveColumnById(this,"xValue",t),E=e.resolveColumnById(this,"yValueRaw",t),M=f?e.resolveColumnById(this,"yValueEnd",t):void 0,A=f?e.resolveColumnById(this,"yValueCumulative",t):E,T=null!=l?e.resolveColumnById(this,"yFilterRaw",t):void 0,D={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},I=[];let R;const P=e=>{const t=w[e],i=x[e],s=E[e],r=M?.[e],n=T?.[e],l=(d=e,y.convert(x[d])+C);var d;const g=(e=>v.convert(A[e])+b)(e);if(!Number.isFinite(l))return;if(null!=s){const d=u.enabled?this.getLabelText(u,{value:s,datum:t,xKey:o,yKey:a,xName:c,yName:h,legendItemName:m}):void 0;I.push({series:this,datum:t,datumIndex:e,yKey:a,xKey:o,point:{x:l,y:g,size:S},midPoint:{x:l,y:g},cumulativeValue:r,yValue:s,xValue:i,capDefaults:D,labelText:d,selected:n})}if(null==R)return;const f=R[R.length-1];if(null!=s){const e={point:{x:l,y:g},xDatum:i,yDatum:s};Array.isArray(f)?f.push(e):null!=f?(f.skip+=1,R.push([e])):R.push([e])}else p||(Array.isArray(f)||null==f?R.push({skip:0}):f.skip+=1)},[k,L]=y.range,N=L-k,_=s?.find(e=>e.maxRange>N),O=_?.indices;let[F,G]=this.visibleRange("xValue",r.range,O);F=Math.max(F-1,0),G=Math.min(G+1,O?.length??x.length),t.input.count<1e3&&(F=0,G=t.input.count),null==O&&(R=[]);for(let e=F;e<G;e+=1)P(O?.[e]??e);const B=R?.flatMap(e=>Array.isArray(e)?Tg(e,g):[]),V=null!=B?{itemId:a,spans:B}:void 0,H=T?.some((e,t)=>e===E[t])??!1;return{itemId:a,nodeData:I,labelData:I,strokeData:V,scales:this.calculateScaling(),visible:this.visible,crossFiltering:H}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],opacity:i,visible:s,animationEnabled:r}=e,n=!0===this.contextNodeData?.crossFiltering;t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(n?.25:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),r||(t.visible=s),$g(this,t)}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,s=e?t.highlightStyle.item:void 0;return pc({size:i.size,shape:i.shape,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}getMarkerItemStyleOverrides(e,t,i,s){const{id:r,properties:n}=this,{xKey:o,yKey:a,marker:l}=n,{itemStyler:c}=l;if(null!=c)return this.cachedDatumCallback(vd(e,s?"highlight":"node"),()=>{const e=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.callWithContext(c,{seriesId:r,...Yr(t,o,a,e,n),datum:t,highlighted:s,...i})})}updateMarkerSelection(e){let{nodeData:t}=e;const{markerSelection:i}=e;return t=this.properties.marker.enabled||!0===this.contextNodeData?.crossFiltering?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,e=>vd(e.xValue))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,stroke:n,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),d=this.getSeriesDomain("y"),u=N(i&&c.item,l.getStyle(),{stroke:n,strokeWidth:o,strokeOpacity:a}),p=this.ctx.animationManager.isSkipped(),g=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(l,e,t.datum,t.point,Yr(t,s,r,h,d),i,u,g,{applyTranslation:p,selected:t.selected})}),i||l.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{enabled:t,fontStyle:i,fontWeight:s,fontSize:r,fontFamily:n,color:o}=this.properties.label;e.labelSelection.each((e,a)=>{t&&a?.labelText?(e.fontStyle=i,e.fontWeight=s,e.fontSize=r,e.fontFamily=n,e.textAlign="center",e.textBaseline="bottom",e.text=a.labelText,e.x=a.point.x,e.y=a.point.y-10,e.fill=o,e.visible=!0):e.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h}=n,d=r.x,u=r.y;if(!(i&&s&&d&&u))return;const p=s.dataSources.get(this.id)?.[e],g=i.resolveColumnById(this,"xValue",s)[e],m=i.resolveColumnById(this,"yValueRaw",s)[e];if(null==g)return;const f=this.getMarkerItemBaseStyle(!1);return Object.assign(f,this.getMarkerItemStyleOverrides(String(e),p,f,!1)),this.formatTooltipWithContext(h,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(m)}]},{seriesId:t,datum:p,title:c,xKey:o,xName:a,yKey:l,yName:c,...f,...this.getModuleTooltipParams()})}legendItemSymbol(){const e="rgba(0, 0, 0, 0)",{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:r,marker:n}=this.properties;return{marker:{...this.getMarkerStyle(n,void 0,void 0,!1,void 0,{fill:n.fill??e,stroke:n.stroke??t??e}),enabled:n.enabled},line:{stroke:t??e,strokeOpacity:i,strokeWidth:s,lineDash:r}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:r,yName:n,title:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:r,legendItemName:a,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:r}),label:{text:a??o??n??r},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}plotNodeDataPoints(e,t){if(0===t.length)return;const i=t[0].point;e.moveTo(i.x,i.y);for(let i=1;i<t.length;i+=1){const{x:s,y:r}=t[i].point;e.lineTo(s,r)}}updateLinePaths(e,t){const i=t.strokeData?.spans,[s]=e;s.path.clear(),null!=i?Ig(s,i):this.plotNodeDataPoints(s.path,t.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s,contextData:r,paths:n}=e,{animationManager:o}=this.ctx;this.updateLinePaths(n,r),Wg(this,o,...n),da([t],Ug),Vg(this,o,t),vp(this,"labels",o,i),vp(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,annotationSelections:r,contextData:n,paths:o,previousContextData:a}=e,[l]=o;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,n)},h=()=>{t.skipCurrentBatch(),c()};if(null==n||null==a)return c(),Gg(this,t,"added",i),jg(this,"path_properties",t,"add",l),vp(this,"labels",t,s),void vp(this,"annotations",t,...r);if(n.crossFiltering!==a.crossFiltering)return void h();const d=Lg(n,a,this.processedData?.reduced?.diff?.[this.id]);void 0!==d?"no-op"!==d.status&&(aa(this.id,"path_properties",t,[l],d.stroke.pathProperties),"added"===d.status?this.updateLinePaths(o,n):"removed"===d.status?this.updateLinePaths(o,a):yp(this.id,"path_update",t,[l],d.stroke.path),d.hasMotion&&(Gg(this,t,void 0,i),vp(this,"labels",t,s),vp(this,"annotations",t,...r))):h()}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new At}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties,s=this.getSeriesDomain("x"),r=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,Yr(e,t,i,s,r),!0)}computeFocusBounds(e){return zg(this,e)}};Af.className="LineSeries",Af.type="line";var Tf={title:s.Yj,showInMiniChart:s.zM,connectMissingData:s.zM,interpolation:_m,label:Im,marker:Dm,tooltip:Lm,errorBar:Pm,...Am,...s.AF,...s.mL};Tf.sparklineMode=(0,s._L)(s.zM);var Df={...Tf,...Tm,type:(0,s.dY)("line"),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai,legendItemName:s.Yj,errorBar:km};Df.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),Df.focusPriority=(0,s._L)(s.ai);var If={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new Af(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:up,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:mp},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Rf={type:"series",name:"line",chartType:"cartesian",options:Df,create:e=>new Af(e)},Pf=class extends pl{constructor(){super(...arguments),this.placement="top"}};a([Te],Pf.prototype,"placement",2);var kf=class extends zp{constructor(){super(...arguments),this.label=new Pf,this.tooltip=new Np,this.marker=new kp}};a([Te],kf.prototype,"xKey",2),a([Te],kf.prototype,"yKey",2),a([Te],kf.prototype,"labelKey",2),a([Te],kf.prototype,"xFilterKey",2),a([Te],kf.prototype,"yFilterKey",2),a([Te],kf.prototype,"xName",2),a([Te],kf.prototype,"yName",2),a([Te],kf.prototype,"labelName",2),a([Te],kf.prototype,"title",2),a([ni("marker.shape")],kf.prototype,"shape",2),a([ni("marker.size")],kf.prototype,"size",2),a([ni("marker.fill")],kf.prototype,"fill",2),a([ni("marker.fillGradientDefaults")],kf.prototype,"fillGradientDefaults",2),a([ni("marker.fillPatternDefaults")],kf.prototype,"fillPatternDefaults",2),a([ni("marker.fillImageDefaults")],kf.prototype,"fillImageDefaults",2),a([ni("marker.fillOpacity")],kf.prototype,"fillOpacity",2),a([ni("marker.stroke")],kf.prototype,"stroke",2),a([ni("marker.strokeWidth")],kf.prototype,"strokeWidth",2),a([ni("marker.strokeOpacity")],kf.prototype,"strokeOpacity",2),a([ni("marker.lineDash")],kf.prototype,"lineDash",2),a([ni("marker.lineDashOffset")],kf.prototype,"lineDashOffset",2),a([ni("marker.itemStyler")],kf.prototype,"itemStyler",2),a([Te],kf.prototype,"label",2),a([Te],kf.prototype,"tooltip",2);var Lf=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Hg,label:bp},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new kf}get pickModeAxis(){return"main-category"}async processData(e){if(null==this.data||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:r}=this.getScaleInformation({xScale:t,yScale:i}),{xKey:n,yKey:o,xFilterKey:a,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(e,this.data,{props:[Kh(n,s,{id:"xValue"}),Kh(o,r,{id:"yValue"}),...null!=a?[Kh(a,s,{id:"xFilterValue"})]:[],...null!=l?[Kh(l,r,{id:"yFilterValue"})]:[],...c?[Kh(c,"band",{id:"labelValue"})]:[]]}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const i=this.axes.x.scale.convert(e),s=.5*this.properties.size*t;return[i-s,i+s]}yCoordinateRange(e,t){const i=this.axes.y.scale.convert(e[0]),s=.5*this.properties.size*t;return[i-s,i+s]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},r=s[e],n=t.resolveProcessedDataDefById(this,r),o=t.getDomain(this,r,"value",i);if("value"===n?.def.type&&"category"===n?.def.valueType)return o;const a=s["x"===e?"y":"x"];return _o(Dh(this.domainForClippedRange(e,[r],a,!1)))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,visible:s}=this,{xKey:r,yKey:n,xFilterKey:o,yFilterKey:a,labelKey:l,xName:c,yName:h,labelName:d,marker:u,label:p}=this.properties,{placement:g}=p,m=_c.anchor(u.shape),f=e.x,y=e.y;if(!(t&&i&&s&&f&&y))return;const v=t.resolveColumnById(this,"xValue",i),C=t.resolveColumnById(this,"yValue",i),b=null!=l?t.resolveColumnById(this,"labelValue",i):void 0,S=null!=o?t.resolveColumnById(this,"xFilterValue",i):void 0,w=null!=a?t.resolveColumnById(this,"yFilterValue",i):void 0,x=f.scale,E=y.scale,M=(x.bandwidth??0)/2,A=(E.bandwidth??0)/2,T=[],D=p.getFont(),I=Di.getMeasurer({font:D});return(i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=v[t],s=C[t],o=x.convert(i)+M,a=E.convert(s)+A,f=null!=S&&null!=w?S[t]===i&&w[t]===s:void 0,y=this.getLabelText(p,{value:null!=b?b?.[t]:s,datum:e,xKey:r,yKey:n,labelKey:l,xName:c,yName:h,labelName:d}),D=I.measureText(y);T.push({series:this,itemId:n,yKey:n,xKey:r,datum:e,datumIndex:t,xValue:i,yValue:s,capDefaults:{lengthRatioMultiplier:u.getDiameter(),lengthMax:1/0},point:{x:o,y:a,size:u.size},midPoint:{x:o,y:a},label:{text:y,...D},anchor:m,placement:g,selected:f})}),{itemId:n,nodeData:T,labelData:T,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,labelKey:n,marker:o,highlightStyle:a}=this.properties,l=N(i&&a.item,o.getStyle()),c=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(o,e,t.datum,t.point,{xKey:s,yKey:r,labelKey:n},i,l,c,{selected:t.selected})}),i||o.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{e.text=i.label.text,e.fill=t.color,e.x=i.point?.x??0,e.y=i.point?.y??0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:d,title:u,tooltip:p,marker:g}=n,m=r.x,f=r.y;if(!(i&&s&&m&&f))return;const y=s.dataSources.get(this.id)?.[e],v=i.resolveColumnById(this,"xValue",s)[e],C=i.resolveColumnById(this,"yValue",s)[e],b=this.contextNodeData?.nodeData[e];if(null==v||null==b)return;const S=this.getMarkerStyle(g,b.datum,{xKey:o,yKey:l,labelKey:h,highlighted:!0});return this.formatTooltipWithContext(p,{symbol:this.legendItemSymbol(),title:u,data:[{label:a,fallbackLabel:o,value:m.formatDatum(v)},{label:c,fallbackLabel:l,value:f.formatDatum(C)}]},{seriesId:t,datum:y,title:c,xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:d,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(e){if("category"!==e)return[];const{yKey:t,yName:i,title:s,showInLegend:r}=this.properties,{id:n,ctx:{legendManager:o},visible:a}=this;return[{legendType:"category",id:n,itemId:t,seriesId:n,enabled:a&&o.getItemEnabled({seriesId:n,itemId:t}),label:{text:s??i??t},symbol:this.legendItemSymbol(),hideInLegend:!r}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s}=e;Bg(this,this.ctx.animationManager,t),vp(this,"labels",this.ctx.animationManager,i),vp(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new At}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{xKey:t,yKey:i,labelKey:s},!0)}computeFocusBounds(e){return zg(this,e)}};Lf.className="ScatterSeries",Lf.type="scatter";var Nf={title:s.Yj,showInMiniChart:s.zM,label:{placement:(0,s.KC)("top","right","bottom","left"),...Im},tooltip:Lm,errorBar:Pm,...Am,...G(Dm,["enabled"])},_f={...Nf,...Tm,type:(0,s.mw)((0,s.dY)("scatter")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),labelKey:s.Yj,xName:s.Yj,yName:s.Yj,labelName:s.Yj,errorBar:km},Of={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new Lf(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:mp,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Ff={type:"series",name:"scatter",chartType:"cartesian",options:_f,create:e=>new Lf(e)},Gf=class e{constructor(e,t,i,s){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:r}=this;return new e(t,i,s,r)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[d](t,i){return new e(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function Bf({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let r=1/0,n=1/0,o=-1/0,a=-1/0;const l=(e,t)=>{r=Math.min(e,r),n=Math.min(t,n),o=Math.max(e,o),a=Math.max(t,a)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),ne(0,e,t)&&l(s,0),ne(.5*Math.PI,e,t)&&l(0,s),ne(Math.PI,e,t)&&l(-s,0),ne(1.5*Math.PI,e,t)&&l(0,-s),new f(r,n,o-r,a-n)}function Vf(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:r,outerRadius:n}=i;if(i.startAngle===i.endAngle||s<Math.min(r,n)||s>Math.max(r,n))return!1;const o=re(i.startAngle),a=re(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function Hf(e,t){const{startAngle:i,endAngle:s,innerRadius:r,outerRadius:n}=t,o={x:n*Math.cos(i),y:n*Math.sin(i)},a={x:n*Math.cos(s),y:n*Math.sin(s)},l=0===r?{x:0,y:0}:{x:r*Math.cos(i),y:r*Math.sin(i)},c=0===r?{x:0,y:0}:{x:r*Math.cos(s),y:r*Math.sin(s)};return We(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||We(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||$e(0,0,n,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function Uf(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},r={x:e.x,y:e.y+e.height},n={x:e.x+e.width,y:e.y+e.height};return Hf({start:i,end:s},t)||Hf({start:r,end:n},t)}function zf(e,t,i,s){if(0===i&&0===s)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let r=0,n=1;for(let o=0;o<8;o+=1){const o=(r+n)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*s)/(e+o*s))-t<0?r=o:n=o}return r}function Wf(e,t){return le(e,t)<1e-6?t:ie(e-t)+t}function jf(e,t,i=0){const s=Math.abs(t-e)>=2*Math.PI?2*Math.PI:ie(t-e);return{startAngle:e=Wf(e,i),endAngle:t=e+s}}function Kf(e,t,i,s,r,n){const o=Math.sin(n),a=Math.cos(n),l=e**2+t**2-i**2;let c,h,d,u;if(a>.5){const i=o/a,s=1+i**2,r=-2*(e+t*i),n=r**2-4*s*l;if(n<0)return;const p=(-r+Math.sqrt(n))/(2*s),g=(-r-Math.sqrt(n))/(2*s);c=p,h=p*i,d=g,u=g*i}else{const i=a/o,s=1+i**2,r=-2*(t+e*i),n=r**2-4*s*l;if(n<0)return;const p=(-r+Math.sqrt(n))/(2*s),g=(-r-Math.sqrt(n))/(2*s);c=p*i,h=p,d=g*i,u=g}const p=d*a+u*o,g=c*a+h*o>0?Wf(Math.atan2(h-t,c-e),s):NaN,m=p>0?Wf(Math.atan2(u-t,d-e),s):NaN;return g>=s&&g<=r?g:m>=s&&m<=r?m:void 0}function $f(e,t,i,s,r,n){const o=Math.hypot(e,t),a=o-(o**2-i**2+n**2)/(2*o),l=Math.atan2(t,e),c=Math.acos(-a/i),h=Wf(l+c,s),d=Wf(l-c,s);return h>=s&&h<=r?h:d>=s&&d<=r?d:void 0}var Yf=class{constructor(e,t,i,s,r){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=r,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){null==e||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){null==e||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},qf=class extends bc{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return Bf(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(null==e)return;const{startAngle:t,endAngle:i}=jf(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:r}=this.normalizedRadii(),n=jf(e.startAngle,e.endAngle,t);return new Gf(Math.max(t,n.startAngle),Math.min(i,n.endAngle),Math.max(s,e.innerRadius),Math.min(r,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,r,n,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=jf(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(a&&h<=0)return;const p=a?this.getAngleOffset(h+e):this.getAngleOffset(d-e),g=o?l+p+t:c-p-t,m=a?h+e:d-e,f=m*Math.cos(g),y=m*Math.sin(g);if(null!=u){const e=1e-6;if(!(o||g>=l-e&&g<=u.endAngle-e))return;if(o&&!(g>=u.startAngle+e&&g<=c-e))return;if(a&&m<u.innerRadius-e)return;if(!a&&m>u.outerRadius+e)return}const v=new Yf(f,y,e,i,s);if(null!=u){let t,c;if(a?(v.clipStart(Kf(f,y,e,i,s,u.endAngle)),v.clipEnd(Kf(f,y,e,i,s,u.startAngle))):(v.clipStart(Kf(f,y,e,i,s,u.startAngle)),v.clipEnd(Kf(f,y,e,i,s,u.endAngle))),o?(t=$f(f,y,e,i,s,u.innerRadius),c=$f(f,y,e,i,s,u.outerRadius)):(t=$f(f,y,e,i,s,u.outerRadius),c=$f(f,y,e,i,s,u.innerRadius)),v.clipStart(t),v.clipEnd(c),null!=t){const{x:e,y:i}=v.pointAt(t),s=Wf(Math.atan2(i,e),l);o?n?.clipStart(s):r.clipEnd(s)}if(null!=c){const{x:e,y:t}=v.pointAt(c),i=Wf(Math.atan2(t,e),l);o?r.clipStart(i):n?.clipEnd(i)}}if(null!=u){const{x:e,y:t}=v.pointAt((v.a0+v.a1)/2);if(!Vf(e,t,u))return}const{x:C,y:b}=v.pointAt(o===a?v.a0:v.a1),S=Wf(Math.atan2(b,C),l),w=a?n:r;return o?w?.clipStart(S):w?.clipEnd(S),v}updatePath(){const{path:e,centerX:t,centerY:i,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:n,endOuterCornerRadius:o,startInnerCornerRadius:a,endInnerCornerRadius:l}=this;const{startAngle:c,endAngle:h}=jf(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:u}=this.normalizedRadii(),p=this.normalizedClipSector(),g=h-c,m=g>=2*Math.PI-1e-6;if(e.clear(),0===d&&0===u||d>u)return;if((p?.startAngle??c)===(p?.endAngle??h))return;if(m&&null==this.clipSector&&0===n&&0===o&&0===a&&0===l)return e.moveTo(t+u*Math.cos(c),i+u*Math.sin(c)),e.arc(t,i,u,c,h),d>s&&(e.moveTo(t+d*Math.cos(h),i+d*Math.sin(h)),e.arc(t,i,d,h,c,!0)),void e.closePath();if(null==this.clipSector&&Math.abs(d-u)<1e-6)return e.arc(t,i,u,c,h,!1),e.arc(t,i,u,h,c,!0),void e.closePath();const f=this.getAngleOffset(d),y=this.getAngleOffset(u);if(g<2*y)return;const v=(p?.innerRadius??d)>s,C=d<s||g<2*f,b=u-d,S=Math.max(n,a,o,l),w=S>0?Math.min(b/S,1):1;n*=w,o*=w,a*=w,l*=w;const x=zf(u,g-2*y,-n,-o);if(n*=x,o*=x,!C&&v){const e=zf(d,g-2*f,a,l);a*=e,l*=e}else a=0,l=0;const E=Math.max(n+a,o+l),M=E>0?Math.min(b/E,1):1;n*=M,o*=M,a*=M,l*=M;let A=0,T=0;const D=n/(u-n),I=o/(u-o);if(D>=0&&D<.999999)A=Math.asin(D);else{A=g/2;const e=u/(1/Math.sin(A)+1);n=Math.min(e,n)}if(I>=0&&I<.999999)T=Math.asin(I);else{T=g/2;const e=u/(1/Math.sin(T)+1);o=Math.min(e,o)}const R=Math.asin(a/(d+a)),P=Math.asin(l/(d+l)),k=p?.outerRadius??u,L=this.getAngleOffset(k),N=new Yf(0,0,k,c+L,h-L),_=p?.innerRadius??d,O=this.getAngleOffset(_),F=v?new Yf(0,0,_,c+O,h-O):void 0;null!=p&&(N.clipStart(p.startAngle),N.clipEnd(p.endAngle),F?.clipStart(p.startAngle),F?.clipEnd(p.endAngle));const G=this.arc(n,A,c-.5*Math.PI,c+A,N,F,!0,!1),B=this.arc(o,T,h-T,h+.5*Math.PI,N,F,!1,!1),V=this.arc(l,P,h+.5*Math.PI,h+Math.PI-P,N,F,!1,!0),H=this.arc(a,R,c+Math.PI+R,c+1.5*Math.PI,N,F,!0,!0);if(C){const s=g<.5*Math.PI?r*(1+Math.cos(g))/Math.sin(g):NaN;let n;n=s>0&&s<u?Math.max(Math.hypot(r,s),d):r,n=Math.max(n,d);const o=c+.5*g;e.moveTo(t+n*Math.cos(o),i+n*Math.sin(o))}else if(!0===H?.isValid()||!0===F?.isValid());else{const s=c+g/2,r=d*Math.cos(s),n=d*Math.sin(s);e.moveTo(t+r,i+n)}if(!0===G?.isValid()){const{cx:s,cy:r,r:n,a0:o,a1:a}=G;e.arc(t+s,i+r,n,o,a)}if(N.isValid()){const{r:s,a0:r,a1:n}=N;e.arc(t,i,s,r,n)}if(!0===B?.isValid()){const{cx:s,cy:r,r:n,a0:o,a1:a}=B;e.arc(t+s,i+r,n,o,a)}if(!C){if(!0===V?.isValid()){const{cx:s,cy:r,r:n,a0:o,a1:a}=V;e.arc(t+s,i+r,n,o,a)}if(!0===F?.isValid()){const{r:s,a0:r,a1:n}=F;e.arc(t,i,s,n,r,!0)}if(!0===H?.isValid()){const{cx:s,cy:r,r:n,a0:o,a1:a}=H;e.arc(t+s,i+r,n,o,a)}}e.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:r,outerRadius:n}=this.clipSector??this;return Vf(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(r,n),outerRadius:Math.max(r,n)})}};qf.className="Sector",a([$()],qf.prototype,"centerX",2),a([$()],qf.prototype,"centerY",2),a([$()],qf.prototype,"innerRadius",2),a([$()],qf.prototype,"outerRadius",2),a([$()],qf.prototype,"startAngle",2),a([$()],qf.prototype,"endAngle",2),a([Y({equals:(e,t)=>e.equals(t)})],qf.prototype,"clipSector",2),a([$()],qf.prototype,"concentricEdgeInset",2),a([$()],qf.prototype,"radialEdgeInset",2),a([$()],qf.prototype,"startOuterCornerRadius",2),a([$()],qf.prototype,"endOuterCornerRadius",2),a([$()],qf.prototype,"startInnerCornerRadius",2),a([$()],qf.prototype,"endInnerCornerRadius",2);var Xf={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Zf={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Qf=class extends Fi{constructor(){super(...arguments),this.showInLegend=!1}};a([Te],Qf.prototype,"showInLegend",2);var Jf=class extends pl{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};a([Te],Jf.prototype,"text",2),a([Te],Jf.prototype,"spacing",2);var ey=class extends De{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};a([Te],ey.prototype,"fill",2),a([Te],ey.prototype,"fillOpacity",2);var ty=class extends pl{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};a([Te],ty.prototype,"offset",2),a([Te],ty.prototype,"minAngle",2),a([Te],ty.prototype,"minSpacing",2),a([Te],ty.prototype,"maxCollisionOffset",2),a([Te],ty.prototype,"avoidCollisions",2);var iy=class extends pl{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};a([Te],iy.prototype,"positionOffset",2),a([Te],iy.prototype,"positionRatio",2);var sy=class extends De{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};a([Te],sy.prototype,"colors",2),a([Te],sy.prototype,"length",2),a([Te],sy.prototype,"strokeWidth",2);var ry=class extends Pp{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Xf),this.strokes=Object.values(Zf),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new Ie(Jf),this.title=new Qf,this.innerCircle=new ey,this.shadow=new wp,this.calloutLabel=new ty,this.sectorLabel=new iy,this.calloutLine=new sy,this.tooltip=new Np}};function ny(e,t,i,s){const r=[i.convert(0),i.convert(1)],n=[s.convert(0),s.convert(1)],o=Math.PI/-2+oe(t),a=e?"initial":"update";return{nodes:{toFn:(e,t,i,{prevLive:s})=>{let{startAngle:n,endAngle:a,innerRadius:l,outerRadius:c}=t;const{stroke:h,fill:d}=t.sectorFormat;if("removed"===i&&s?(n=s.datum?.endAngle,a=s.datum?.endAngle):"removed"!==i||s||(n=o,a=o),"removed"===i){const e=(({radius:e})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*e}))(t);l=e.innerRadius,c=e.outerRadius}return{startAngle:n,endAngle:a,outerRadius:c,innerRadius:l,stroke:h,fill:d}},fromFn:(t,i,s,{prevFromProps:r})=>{let{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d}=t,{fill:u,stroke:p}=i.sectorFormat;if("updated"===s&&null==t.previousDatum&&(s="added"),"unknown"===s||"added"===s&&!r?(l=o,c=o,h=i.innerRadius,d=i.outerRadius):"added"===s&&r&&(l=r.endAngle??o,c=r.endAngle??o,h=r.innerRadius??i.innerRadius,d=r.outerRadius??i.outerRadius),"added"===s&&!e){const e=(({radius:e})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*e}))(i);h=e.innerRadius,d=e.outerRadius}return"updated"===s&&(u=t.fill??u,p=("string"==typeof t.stroke?t.stroke:void 0)??p),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,fill:u,stroke:p,phase:a}}},innerCircle:{fromFn:(e,t)=>({size:e.previousDatum?.radius??e.size??0,phase:a}),toFn:(e,t)=>({size:t.radius??0})}}}function oy(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function ay(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,r=Math.atan2(i,s),n=e.getItemNodes();for(const e of n)if(!0!==e.datum.missing&&ne(r,e.startAngle,e.endAngle)){const t=Math.sqrt(s*s+i*i);let r=0;return t<e.innerRadius?r=e.innerRadius-t:t>e.outerRadius&&(r=t-e.outerRadius),{datum:e.datum,distance:r}}}a([Te],ry.prototype,"angleKey",2),a([Te],ry.prototype,"angleName",2),a([Te],ry.prototype,"angleFilterKey",2),a([Te],ry.prototype,"radiusKey",2),a([Te],ry.prototype,"radiusName",2),a([Te],ry.prototype,"radiusMin",2),a([Te],ry.prototype,"radiusMax",2),a([Te],ry.prototype,"calloutLabelKey",2),a([Te],ry.prototype,"calloutLabelName",2),a([Te],ry.prototype,"sectorLabelKey",2),a([Te],ry.prototype,"sectorLabelName",2),a([Te],ry.prototype,"legendItemKey",2),a([Te],ry.prototype,"defaultColorRange",2),a([Te],ry.prototype,"defaultPatternFills",2),a([Te],ry.prototype,"fills",2),a([Te],ry.prototype,"strokes",2),a([Te],ry.prototype,"fillOpacity",2),a([Te],ry.prototype,"strokeOpacity",2),a([Te],ry.prototype,"lineDash",2),a([Te],ry.prototype,"lineDashOffset",2),a([Te],ry.prototype,"cornerRadius",2),a([Te],ry.prototype,"itemStyler",2),a([Te],ry.prototype,"rotation",2),a([Te],ry.prototype,"outerRadiusOffset",2),a([Te],ry.prototype,"outerRadiusRatio",2),a([Te],ry.prototype,"innerRadiusOffset",2),a([Te],ry.prototype,"innerRadiusRatio",2),a([Te],ry.prototype,"strokeWidth",2),a([Te],ry.prototype,"sectorSpacing",2),a([Te],ry.prototype,"hideZeroValueSectorsInLegend",2),a([Te],ry.prototype,"innerLabels",2),a([Te],ry.prototype,"title",2),a([Te],ry.prototype,"innerCircle",2),a([Te],ry.prototype,"shadow",2),a([Te],ry.prototype,"calloutLabel",2),a([Te],ry.prototype,"sectorLabel",2),a([Te],ry.prototype,"calloutLine",2),a([Te],ry.prototype,"tooltip",2);var ly=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(ly||{}),cy=class extends Bp{constructor({categoryKey:e,useLabelLayer:t=!1,pickModes:i=[1,0],canHaveAxes:s=!1,animationResetFns:r,...n}){super({...n,categoryKey:e,useLabelLayer:t,pickModes:i,directionKeys:{angle:["angleKey"],radius:["radiusKey"]},directionNames:{angle:["angleName"],radius:["radiusName"]},canHaveAxes:s}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new At),this.nodeData=[],this.itemSelection=ua.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=ua.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=ua.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=ua.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=r,this.animationState=new ba("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3],!0)}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}labelFactory(){const e=new Li;return e.pointerEvents=1,e}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager?.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new f(-e,-e,2*e,2*e),axis:new f(-e,-e,2*e,2*e)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&da([this.itemSelection,this.highlightSelection],e),t&&da([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&da([this.highlightSelection],t),i&&da([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(void 0!==t)return this.itemSelection.select(e=>e instanceof bc&&e.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}},hy=class extends yc{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},dy=class extends cy{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:oy,label:bp}}),this.properties=new ry,this.phantomNodeData=void 0,this.backgroundGroup=new It({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Vd,this.radiusScale=new Vd,this.phantomGroup=this.backgroundGroup.appendChild(new At({name:"phantom"})),this.phantomSelection=ua.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new At({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ua(this.calloutLabelGroup,At),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new At({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new _c({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new _c({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new At({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new At({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=ua.select(this.innerLabelsGroup,Li),this.innerCircleSelection=ua.select(this.innerCircleGroup,()=>new _c({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=hy,this.angleScale=new Vd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.backgroundGroup.zIndex=[0,e],!0)}nodeFactory(){return new qf}getSeriesDomain(e){return"angle"===e?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(null==this.data)return;const{visible:t,id:i,ctx:{legendManager:r}}=this,{angleKey:n,angleFilterKey:o,radiusKey:a,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h}=this.properties,d=()=>(e,s)=>t&&r.getItemEnabled({seriesId:i,itemId:s})?e:0,u=!this.ctx.animationManager.isSkipped(),p=[],g=[];h?p.push(jh(h,"band",{id:"legendItemKey"})):l?p.push(jh(l,"band",{id:"calloutLabelKey"})):c&&p.push(jh(c,"band",{id:"sectorLabelKey"}));const m=this.radiusScale.type,f=this.angleScale.type;a&&g.push(Xh(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:d}),Kh(a,m,{id:"radiusRaw",processor:d}),ad("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&g.push(Kh(l,"band",{id:"calloutLabelValue"})),c&&g.push(Kh(c,"band",{id:"sectorLabelValue"})),h&&g.push(Kh(h,"band",{id:"legendItemValue"})),o&&g.push(Zh(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:d}),Kh(o,f,{id:"angleFilterRaw"}),ad("angleFilterValue",[0,1],0,0)),u&&this.processedData&&p.length>0&&g.push(yd(this.id,this.processedData)),g.push(cd()),await this.requestDataModel(e,this.data,{props:[...p,Zh(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:d}),Kh(n,f,{id:"angleRaw"}),ad("angleValue",[0,1],0,0),...g]});for(const e of this.processedData?.defs?.values??[]){const{id:t,missing:i,property:r}=e,n=Oo(this,i);"angleRaw"!==t&&n>0&&s.Vy.warnOnce(`no value was found for the key '${String(r)}' on ${n} data element${n>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){return{angleValues:e.resolveColumnById(this,"angleValue",t),angleRawValues:e.resolveColumnById(this,"angleRaw",t),angleFilterValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterValue",t):void 0,angleFilterRawValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterRaw",t):void 0,radiusValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,radiusRawValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,calloutLabelValues:this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,sectorLabelValues:this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,legendItemValues:this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:r},visible:n}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!i||"ungrouped"!==t?.type)return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:d,radiusValues:u,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:m,legendItemValues:f}=this.getProcessedDataValues(i,t),y=d?.some((e,t)=>e>c[t])??!1;let v=0,C=0;const b=[],S=null!=d?[]:void 0,w=t.dataSources.get(this.id)??[],x=t.invalidData?.get(this.id);return w.forEach((t,i)=>{if(!0===x?.[i])return;const a=y?h[i]:l[i],w=null==d||y?1:Math.sqrt(d[i]/c[i]),E=s.convert(v)+oe(o);v=a,C+=a;const M=s.convert(v)+oe(o),A=Math.abs(M-E),T=E+A/2,D=c[i],I=(u?.[i]??1)*w,R=p?.[i],P=f?.[i],k=this.getLabels(t,T,A,!0,g?.[i],m?.[i],P),L=this.getSectorFormat(t,i,!1),N={itemId:i,series:this,datum:t,datumIndex:i,angleValue:D,midAngle:T,midCos:Math.cos(T),midSin:Math.sin(T),startAngle:E,endAngle:M,radius:I,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(I),0),sectorFormat:L,radiusValue:R,legendItemValue:P,enabled:n&&r.getItemEnabled({seriesId:e,itemId:i}),focusable:!0,...k};b.push(N),null!=S&&S.push({...N,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=0===C,this.zerosumInnerRing.visible=0===C&&null!=a&&1!==a&&a>0,{itemId:e,nodeData:b,labelData:b,phantomNodeData:S}}getLabels(e,t,i,s,r,n,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=oe(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...u,value:r}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:n})}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=re(e)- -.75*Math.PI,r=Math.floor(i/(Math.PI/2));return t[(0,s.GT)(r,t.length)]}getNodeFill(e,t,i){return uc(e,{type:"gradient",bounds:"series",colorStops:t.map(e=>({color:e})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(nt(e)&&"item"!==e.bounds)return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i){const{angleKey:s,radiusKey:r,calloutLabelKey:n,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,itemStyler:u}=this.properties,p=c[t%c.length],{fill:g,fillOpacity:m,stroke:f,strokeWidth:y,strokeOpacity:v,lineDash:C,lineDashOffset:b,cornerRadius:S}=N(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),w=h[t%h.length],x=d[t%d.length],E=g??"black";let M;return u&&(M=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:e,angleKey:s,radiusKey:r,calloutLabelKey:n,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(E,w,x),fillOpacity:m,stroke:f,strokeWidth:y,strokeOpacity:v,lineDash:C,lineDashOffset:b,cornerRadius:S,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(M?.fill??E,w,x),fillOpacity:M?.fillOpacity??m,stroke:M?.stroke??f,strokeWidth:M?.strokeWidth??y,strokeOpacity:M?.strokeOpacity??v,lineDash:M?.lineDash??C,lineDashOffset:M?.lineDashOffset??b,cornerRadius:M?.cornerRadius??S}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=e=>({...e,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(e.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);return 0===e?NaN:-e-(2+(this.properties.title?.spacing??0))-Math.max(0,-e)}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=null!=Ft(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY();t.node.y=isFinite(e)?e:0;const i=t.node.getBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i)}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:r,labelSelection:n,innerLabelsSelection:o}=this,a=this.nodeData.map(e=>({...e,sectorFormat:{...e.sectorFormat}})),l=(e,t)=>{e.update(t,void 0,e=>this.getDatumId(e.datumIndex)),this.ctx.animationManager.isSkipped()&&e.cleanup()};l(e,this.nodeData),l(t,a),l(i,this.phantomNodeData??[]),r.update(this.calloutNodeData,e=>{const t=new pa;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Li;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),n.update(this.nodeData),s.update(a),o.update(this.properties.innerLabels,e=>{e.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),s=1;t=Math.ceil(2*e+s)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{e.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:t})});const s=this.radiusScale.range[0],r=this.radiusScale.range[1],n=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(e,t,i,a)=>{const l=this.getSectorFormat(t.datum,t.itemId,a);t.sectorFormat.fill=l.fill,t.sectorFormat.stroke=l.stroke,o&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(a||o)&&(e.fill=l.fill,e.stroke=l.stroke);const c=this.getFillParams(l.fill,s,r);gc(e,l.fill,n,c),e.strokeWidth=l.strokeWidth,e.fillOpacity=l.fillOpacity,e.strokeOpacity=l.strokeOpacity,e.lineDash=l.lineDash,e.lineDashOffset=l.lineDashOffset,e.cornerRadius=l.cornerRadius,e.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(null!=l.stroke?l.strokeWidth:0))/2,0);e.inset=h,e.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((e,t,i)=>a(e,t,0,!1)),this.highlightSelection.each((e,i,s)=>{a(e,i,0,!0),e.visible=i.itemId===t?.itemId}),this.phantomSelection.each((e,t,i)=>a(e,t,0,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,r=t,n=ot(i)?i??this.properties.strokes:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(t=>{const i=t.closestDatum(),{calloutLabel:s,outerRadius:a,datumIndex:l}=i;if(s?.text&&!s.hidden&&0!==a){t.visible=!0,t.strokeWidth=r,t.stroke=n[l%n.length],t.fill=void 0;const c=i.midCos*a,h=i.midSin*a;let d=i.midCos*(a+e),u=i.midSin*(a+e);if((s.collisionTextAlign??0!==s.collisionOffsetY)&&null!=s.box){const e=s.box;let t=d,i=u;d<e.x?t=e.x:d>e.x+e.width&&(t=e.x+e.width),u<e.y?i=e.y:u>e.y+e.height&&(i=e.y+e.height);const r=t-d,n=i-u,a=Math.sqrt(Math.pow(r,2)+Math.pow(n,2)),l=a-o;l>0&&(d+=r*l/a,u+=n*l/a)}t.x1=c,t.y1=h,t.x2=d,t.y2=u}else t.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,r=s+i.width,n=-this.centerY,o=n+i.height;let a=1;t.x+1<s?a=(t.x+t.width-s)/t.width:t.x+t.width-1>r&&(a=(r-t.x)/t.width);const l=t.y+1<n||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(null==t)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(e=>e.x**2+e.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:r}=t,n=e.convert(0),o=this.calloutNodeData,a=o.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>e.midSin<0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),d=a.filter(e=>e.midSin>=0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),u=e=>{const t=e.calloutLabel;if(null==t)return f.zero.clone();const r=e.outerRadius+i.length+s,n=e.midCos*r,o=e.midSin*r+t.collisionOffsetY,a=t.collisionTextAlign??t.textAlign,l=t.textBaseline;return Li.computeBBox(t.text,n,o,{font:this.properties.calloutLabel,textAlign:a,textBaseline:l})},p=(e,t,i)=>{const s=u(e).grow(r/2),n=u(t).grow(r/2);s.x<n.x+n.width&&s.x+s.width>n.x&&("to-top"===i?s.y<n.y+n.height:s.y+s.height>n.y)&&(t.calloutLabel.collisionOffsetY="to-top"===i?s.y-n.y-n.height:s.y+s.height-n.y)},g=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],s=e[t];p(i,s,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],s=e[t];p(i,s,"to-bottom")}},m=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>u(e)),s=i.map(e=>e.clone().grow(r/2));let l=!1;for(let t=0;t<s.length&&!l;t++){const i=s[t];for(let r=t+1;r<e.length;r++){const e=s[r];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:s}=e;return{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}}),h=i.some(e=>c.some(t=>Uf(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};g(l),g(c),m(h),m(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,color:o}=i,a=new Li;this.calloutLabelSelection.selectByTag(1).forEach(s=>{const l=s.closestDatum(),c=l.calloutLabel,h=t.convert(l.radius),d=Math.max(0,h);if(!c?.text||0===d||c.hidden)return void(s.visible=!1);const u=d+r+n,p=l.midCos*u,g=l.midSin*u+c.collisionOffsetY,m={textAlign:c.collisionTextAlign??c.textAlign,textBaseline:c.textBaseline};a.text=c.text,a.x=p,a.y=g,a.setFont(this.properties.calloutLabel),a.setAlign(m);const f=a.getBBox();let y=c.text,v=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,f,e);y=c.text.length===t?c.text:`${c.text.substring(0,t)}…`,v=!i}s.text=y,s.x=p,s.y=g,s.setFont(this.properties.calloutLabel),s.setAlign(m),s.fill=o,s.visible=v})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Li;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=d.text,c.x=0,c.y=e,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(i=>{const s=i.calloutLabel;if(!s||0===i.outerRadius)return null;const d=i.outerRadius+r+n,u=i.midCos*d,p=i.midSin*d+s.collisionOffsetY;c.text=s.text,c.x=u,c.y=p,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:s.collisionTextAlign??s.textAlign,textBaseline:s.textBaseline});const g=c.getBBox();if(s.box=g,Math.abs(s.collisionOffsetY)>o)s.hidden=!0;else{if(h){const e=-this.centerY,t=new f(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(g.collidesBBox(t))return void(s.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:r}=this.getLabelOverflow(s.text,g,t),n=s.text.length>2&&e<2;if(i||n||r)return void(s.hidden=!0)}s.hidden=!1,l.push(g)}}),0===l.length?null:f.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:r,fontFamily:n,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=(e,c)=>{const{sectorLabel:h,outerRadius:d}=c;let u=!1;if(h&&0!==d){const p=t*(1-a)+d*a+o;e.fill=l,e.fontStyle=s,e.fontWeight=r,e.fontSize=i,e.fontFamily=n,e.text=h.text,e.x=c.midCos*p,e.y=c.midSin*p,e.textAlign="center",e.textBaseline="middle";const g=e.getBBox(),m=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:f,endAngle:y}=c,v={startAngle:f,endAngle:y,innerRadius:t,outerRadius:d};m.every(([e,t])=>Vf(e,t,v))&&(u=!0)}e.visible=u};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a,color:l}=s;i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.getBBox()),t.push(s.spacing)});const i=e=>0===e?0:t[e],s=e=>e===t.length-1?0:t[e],r=e.reduce((e,t,r)=>e+t.height+i(r)+s(r),0),n=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(n/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,n=-r/2;t<e.length;t++){const r=e[t].height+n+i(t);l.push(r),n=r+s(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}pickNodeClosestDatum(e){return ay(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{legendItemKey:n,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=r,m=this.properties.title.text;if(!i||!s)return;const f=s.dataSources.get(this.id)?.[e],{angleRawValues:y,legendItemValues:v,calloutLabelValues:C,sectorLabelValues:b}=this.getProcessedDataValues(i,s),S=y[e],w=v?.[e]??(o===h?void 0:C?.[e])??(l===h?void 0:b?.[e])??d;return this.formatTooltipWithContext(g,{title:m,symbol:this.legendItemSymbol(e),data:[{label:w,fallbackLabel:h,value:Fs(S,3)}]},{seriesId:t,datum:f,title:d,legendItemKey:n,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,...this.getSectorFormat(f,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return nt(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:r,ctx:{legendManager:n}}=this;if(!s||!i||"category"!==e)return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!(c||a&&a!==o||l&&l!==o))return[];const{angleRawValues:d,calloutLabelValues:u,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(s,i),m=this.properties.title?.showInLegend&&this.properties.title.text,f=[],y=this.properties.hideZeroValueSectorsInLegend,v=i.dataSources.get(this.id),C=i.invalidData?.get(this.id);for(let e=0;e<i.input.count;e++){const i=v?.[e],s=d[e];if(!0===C?.[e]||y&&0===s)continue;const b=[];m&&b.push(m);const S=this.getLabels(i,2*Math.PI,2*Math.PI,!1,u?.[e],p?.[e],g?.[e]);c&&void 0!==S.legendItem?b.push(S.legendItem.text):a&&a!==o&&void 0!==S.calloutLabel?.text?b.push(S.calloutLabel?.text):l&&l!==o&&void 0!==S.sectorLabel?.text&&b.push(S.sectorLabel?.text),0!==b.length&&f.push({legendType:"category",id:r,datum:i,itemId:e,seriesId:r,hideToggleOtherSeries:!0,enabled:t&&n.getItemEnabled({seriesId:r,itemId:e}),label:{text:b.join(" - ")},symbol:this.legendItemSymbol(e),legendItemName:null!=c?i[c]:void 0,hideInLegend:!h})}return f}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((e,s)=>i.toggleItem(e,t,s)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=ny(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);aa(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(e,t)=>this.getDatumId(t.datumIndex)),aa(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),vp(this,"callout",t,this.calloutLabelSelection),vp(this,"sector",t,this.labelSelection),vp(this,"highlight",t,this.highlightLabelSelection),vp(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:r,previousRadiusScale:n}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=0===(a?.moved.size??0),c=(s?.defs.keys.length??0)>0;l&&c&&(s?.reduced?.animationValidation?.uniqueKeys??1)||this.ctx.animationManager.skipCurrentBatch();const h=!this.nodeData.some(e=>e.enabled),d=ny(!1,this.properties.rotation,r,n);aa(this.id,"nodes",o,[e,t,i],d.nodes,(e,t)=>this.getDatumId(t.datumIndex),a),aa(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),vp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),vp(this,"sector",this.ctx.animationManager,this.labelSelection),vp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==h&&(this.noVisibleData=h,vp(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:r}=this,{animationManager:n}=this.ctx,o=ny(!1,this.properties.rotation,s,r);aa(this.id,"nodes",n,[e,t,i],o.nodes,(e,t)=>this.getDatumId(t.datumIndex)),aa(this.id,"innerCircle",n,[this.innerCircleSelection],o.innerCircle),Cp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Cp(this,"sector",this.ctx.animationManager,this.labelSelection),Cp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),Cp(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};dy.className="DonutSeries",dy.type="donut";var uy={radiusMin:s.Ly,radiusMax:s.Ly,rotation:s.ai,outerRadiusOffset:s.ai,outerRadiusRatio:s.CG,hideZeroValueSectorsInLegend:s.zM,sectorSpacing:s.Ly,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),title:{enabled:s.zM,text:s.Yj,showInLegend:s.zM,spacing:s.Ly,...s.LV},calloutLabel:{enabled:s.zM,offset:s.ai,minAngle:s.Ly,avoidCollisions:s.zM,formatter:s.E2,...s.LV},sectorLabel:{enabled:s.zM,positionOffset:s.ai,positionRatio:s.CG,formatter:s.E2,...s.LV},calloutLine:{colors:(0,s.jk)(s.yW),length:s.Ly,strokeWidth:s.Ly},fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),tooltip:Lm,shadow:Nm,...Am,...s.mL,...G(s.Fu,["fill"]),...G(s.AF,["stroke"])},py={...uy,...Tm,type:(0,s.mw)((0,s.dY)("pie")),angleKey:(0,s.mw)(s.Yj),radiusKey:s.Yj,calloutLabelKey:s.Yj,sectorLabelKey:s.Yj,legendItemKey:s.Yj,angleName:s.Yj,radiusName:s.Yj,calloutLabelName:s.Yj,sectorLabelName:s.Yj};py.defaultColorRange=(0,s._L)((0,s.jk)((0,s.jk)(s.yW))),py.defaultPatternFills=(0,s._L)((0,s.jk)(s.yW)),py.title._enabledFromTheme=(0,s._L)(s.zM),py.calloutLabel._enabledFromTheme=(0,s._L)(s.zM),py.sectorLabel._enabledFromTheme=(0,s._L)(s.zM);var gy={...uy,innerRadiusOffset:s.ai,innerRadiusRatio:s.CG,innerCircle:{fill:s.Yj,fillOpacity:s.CG},innerLabels:{spacing:s.Ly,...s.LV}},my={...gy,...py,type:(0,s.mw)((0,s.dY)("donut")),innerLabels:(0,s.J$)({text:(0,s.mw)(s.Yj),spacing:s.Ly,...s.LV},"inner label options array")},fy={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new dy(e),tooltipDefaults:{range:"exact"},themeTemplate:{series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:dp,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},shadow:{enabled:!1,color:Ru,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}}},yy={type:"series",name:"donut",chartType:"polar",options:my,create:e=>new dy(e)},vy=class extends Fi{constructor(){super(...arguments),this.showInLegend=!1}};a([Te],vy.prototype,"showInLegend",2);var Cy=class extends pl{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};a([Te],Cy.prototype,"offset",2),a([Te],Cy.prototype,"minAngle",2),a([Te],Cy.prototype,"minSpacing",2),a([Te],Cy.prototype,"maxCollisionOffset",2),a([Te],Cy.prototype,"avoidCollisions",2);var by=class extends pl{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};a([Te],by.prototype,"positionOffset",2),a([Te],by.prototype,"positionRatio",2);var Sy=class extends De{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};a([Te],Sy.prototype,"colors",2),a([Te],Sy.prototype,"length",2),a([Te],Sy.prototype,"strokeWidth",2);var wy=class extends Pp{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Xf),this.strokes=Object.values(Zf),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new vy,this.shadow=new wp,this.calloutLabel=new Cy,this.sectorLabel=new by,this.calloutLine=new Sy,this.tooltip=new Np}};a([Te],wy.prototype,"angleKey",2),a([Te],wy.prototype,"angleName",2),a([Te],wy.prototype,"angleFilterKey",2),a([Te],wy.prototype,"radiusKey",2),a([Te],wy.prototype,"radiusName",2),a([Te],wy.prototype,"radiusMin",2),a([Te],wy.prototype,"radiusMax",2),a([Te],wy.prototype,"calloutLabelKey",2),a([Te],wy.prototype,"calloutLabelName",2),a([Te],wy.prototype,"sectorLabelKey",2),a([Te],wy.prototype,"sectorLabelName",2),a([Te],wy.prototype,"legendItemKey",2),a([Te],wy.prototype,"defaultColorRange",2),a([Te],wy.prototype,"defaultPatternFills",2),a([Te],wy.prototype,"fills",2),a([Te],wy.prototype,"strokes",2),a([Te],wy.prototype,"fillOpacity",2),a([Te],wy.prototype,"strokeOpacity",2),a([Te],wy.prototype,"lineDash",2),a([Te],wy.prototype,"lineDashOffset",2),a([Te],wy.prototype,"cornerRadius",2),a([Te],wy.prototype,"itemStyler",2),a([Te],wy.prototype,"rotation",2),a([Te],wy.prototype,"outerRadiusOffset",2),a([Te],wy.prototype,"outerRadiusRatio",2),a([Te],wy.prototype,"strokeWidth",2),a([Te],wy.prototype,"sectorSpacing",2),a([Te],wy.prototype,"hideZeroValueSectorsInLegend",2),a([Te],wy.prototype,"title",2),a([Te],wy.prototype,"shadow",2),a([Te],wy.prototype,"calloutLabel",2),a([Te],wy.prototype,"sectorLabel",2),a([Te],wy.prototype,"calloutLine",2),a([Te],wy.prototype,"tooltip",2);var xy=class extends yc{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Ey=class extends cy{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:oy,label:bp}}),this.properties=new wy,this.phantomNodeData=void 0,this.backgroundGroup=new It({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new Vd,this.radiusScale=new Vd,this.phantomGroup=this.backgroundGroup.appendChild(new At({name:"phantom"})),this.phantomSelection=ua.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new At({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ua(this.calloutLabelGroup,At),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new At({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new _c({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=xy,this.angleScale=new Vd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.backgroundGroup.zIndex=[0,e],!0)}nodeFactory(){const e=new qf;return e.miterLimit=1e9,e}getSeriesDomain(e){return"angle"===e?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(null==this.data)return;const{visible:t,id:i,ctx:{legendManager:r}}=this,{angleKey:n,angleFilterKey:o,radiusKey:a,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h}=this.properties,d=()=>(e,s)=>t&&r.getItemEnabled({seriesId:i,itemId:s})?e:0,u=!this.ctx.animationManager.isSkipped(),p=[],g=[];h?p.push(jh(h,"band",{id:"legendItemKey"})):l?p.push(jh(l,"band",{id:"calloutLabelKey"})):c&&p.push(jh(c,"band",{id:"sectorLabelKey"}));const m=this.radiusScale.type,f=this.angleScale.type;a&&g.push(Xh(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:d}),Kh(a,m,{id:"radiusRaw",processor:d}),ad("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&g.push(Kh(l,"band",{id:"calloutLabelValue"})),c&&g.push(Kh(c,"band",{id:"sectorLabelValue"})),h&&g.push(Kh(h,"band",{id:"legendItemValue"})),o&&g.push(Zh(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:d}),Kh(o,f,{id:"angleFilterRaw"}),ad("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(yd(this.id,this.processedData)),g.push(cd()),await this.requestDataModel(e,this.data,{props:[...p,Zh(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:d}),Kh(n,f,{id:"angleRaw"}),ad("angleValue",[0,1],0,0),...g]});for(const e of this.processedData?.defs?.values??[]){const{id:t,missing:i,property:r}=e,n=Oo(this,i);"angleRaw"!==t&&n>0&&s.Vy.warnOnce(`no value was found for the key '${String(r)}' on ${n} data element${n>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){return{angleValues:e.resolveColumnById(this,"angleValue",t),angleRawValues:e.resolveColumnById(this,"angleRaw",t),angleFilterValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterValue",t):void 0,angleFilterRawValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterRaw",t):void 0,radiusValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,radiusRawValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,calloutLabelValues:this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,sectorLabelValues:this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,legendItemValues:this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:r},visible:n}=this,{rotation:o}=this.properties;if(!i||"ungrouped"!==t?.type)return;const{angleValues:a,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:d,radiusRawValues:u,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:m}=this.getProcessedDataValues(i,t),f=h?.some((e,t)=>e>l[t])??!1;let y=0,v=0;const C=[],b=null!=h?[]:void 0,S=t.dataSources.get(this.id)??[],w=t.invalidData?.get(this.id);return S.forEach((t,i)=>{if(!0===w?.[i])return;const S=f?c[i]:a[i],x=null==h||f?1:Math.sqrt(h[i]/l[i]),E=s.convert(y)+oe(o);y=S,v+=S;const M=s.convert(y)+oe(o),A=Math.abs(M-E),T=E+A/2,D=l[i],I=(d?.[i]??1)*x,R=u?.[i],P=m?.[i],k=this.getLabels(t,T,A,!0,p?.[i],g?.[i],P),L=this.getSectorFormat(t,i,!1),N={itemId:i,series:this,datum:t,datumIndex:i,angleValue:D,midAngle:T,midCos:Math.cos(T),midSin:Math.sin(T),startAngle:E,endAngle:M,radius:I,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(I),0),sectorFormat:L,radiusValue:R,legendItemValue:P,enabled:n&&r.getItemEnabled({seriesId:e,itemId:i}),...k};C.push(N),null!=b&&b.push({...N,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=0===v,{itemId:e,nodeData:C,labelData:C,phantomNodeData:b}}getLabels(e,t,i,s,r,n,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=oe(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...u,value:r}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:n})}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=re(e)- -.75*Math.PI,r=Math.floor(i/(Math.PI/2));return t[(0,s.GT)(r,t.length)]}getNodeFill(e,t,i){return uc(e,{type:"gradient",bounds:"series",colorStops:t.map(e=>({color:e})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(nt(e)&&"item"!==e.bounds)return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i){const{angleKey:s,radiusKey:r,calloutLabelKey:n,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,itemStyler:u}=this.properties,p=c[t%c.length],{fill:g,fillOpacity:m,stroke:f,strokeWidth:y,strokeOpacity:v,lineDash:C,lineDashOffset:b,cornerRadius:S}=N(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),w=h[t%h.length],x=d[t%d.length],E=g??"black";let M;return u&&(M=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:e,angleKey:s,radiusKey:r,calloutLabelKey:n,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(E,w,x),strokeOpacity:v,stroke:f,strokeWidth:y,fillOpacity:m,lineDash:C,lineDashOffset:b,cornerRadius:S,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(M?.fill??E,w,x),fillOpacity:M?.fillOpacity??m,stroke:M?.stroke??f,strokeWidth:M?.strokeWidth??y,strokeOpacity:M?.strokeOpacity??v,lineDash:M?.lineDash??C,lineDashOffset:M?.lineDashOffset??b,cornerRadius:M?.cornerRadius??S}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[0,this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=e=>({...e,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(e.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);return 0===e?NaN:-e-(2+(this.properties.title?.spacing??0))-Math.max(0,-e)}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=null!=Ft(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY();t.node.y=isFinite(e)?e:0;const i=t.node.getBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:r,labelSelection:n}=this,o=this.nodeData.map(e=>({...e,sectorFormat:{...e.sectorFormat}})),a=(e,t)=>{e.update(t,void 0,e=>this.getDatumId(e.datumIndex)),this.ctx.animationManager.isSkipped()&&e.cleanup()};a(e,this.nodeData),a(t,o),a(i,this.phantomNodeData??[]),r.update(this.calloutNodeData,e=>{const t=new pa;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Li;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),n.update(this.nodeData),s.update(o)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.radiusScale.range[0],r=this.radiusScale.range[1],n=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(e,t,i,a)=>{const l=this.getSectorFormat(t.datum,t.itemId,a);t.sectorFormat.fill=l.fill,t.sectorFormat.stroke=l.stroke,o&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(a||o)&&(e.fill=l.fill,e.stroke=l.stroke);const c=this.getFillParams(l.fill,s,r);gc(e,l.fill,n,c),e.strokeWidth=l.strokeWidth,e.fillOpacity=l.fillOpacity,e.strokeOpacity=l.strokeOpacity,e.lineDash=l.lineDash,e.lineDashOffset=l.lineDashOffset,e.cornerRadius=l.cornerRadius,e.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(null!=l.stroke?l.strokeWidth:0))/2,0);e.inset=h,e.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((e,t,i)=>a(e,t,0,!1)),this.highlightSelection.each((e,i,s)=>{a(e,i,0,!0),e.visible=i.itemId===t?.itemId}),this.phantomSelection.each((e,t,i)=>a(e,t,0,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,r=t,n=ot(i)?i:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(t=>{const i=t.closestDatum(),{calloutLabel:s,outerRadius:a,datumIndex:l}=i;if(s?.text&&!s.hidden&&0!==a){t.visible=!0,t.strokeWidth=r,t.stroke=n[l%n.length],t.fill=void 0;const c=i.midCos*a,h=i.midSin*a;let d=i.midCos*(a+e),u=i.midSin*(a+e);if((s.collisionTextAlign??0!==s.collisionOffsetY)&&null!=s.box){const e=s.box;let t=d,i=u;d<e.x?t=e.x:d>e.x+e.width&&(t=e.x+e.width),u<e.y?i=e.y:u>e.y+e.height&&(i=e.y+e.height);const r=t-d,n=i-u,a=Math.sqrt(Math.pow(r,2)+Math.pow(n,2)),l=a-o;l>0&&(d+=r*l/a,u+=n*l/a)}t.x1=c,t.y1=h,t.x2=d,t.y2=u}else t.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,r=s+i.width,n=-this.centerY,o=n+i.height;let a=1;t.x+1<s?a=(t.x+t.width-s)/t.width:t.x+t.width-1>r&&(a=(r-t.x)/t.width);const l=t.y+1<n||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(null==t)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(e=>e.x**2+e.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:r}=t,n=e.convert(0),o=this.calloutNodeData,a=o.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>e.midSin<0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),d=a.filter(e=>e.midSin>=0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),u=e=>{const t=e.calloutLabel;if(null==t)return f.zero.clone();const r=e.outerRadius+i.length+s,n=e.midCos*r,o=e.midSin*r+t.collisionOffsetY,a=t.collisionTextAlign??t.textAlign,l=t.textBaseline;return Li.computeBBox(t.text,n,o,{font:this.properties.calloutLabel,textAlign:a,textBaseline:l})},p=(e,t,i)=>{const s=u(e).grow(r/2),n=u(t).grow(r/2);s.x<n.x+n.width&&s.x+s.width>n.x&&("to-top"===i?s.y<n.y+n.height:s.y+s.height>n.y)&&(t.calloutLabel.collisionOffsetY="to-top"===i?s.y-n.y-n.height:s.y+s.height-n.y)},g=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],s=e[t];p(i,s,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],s=e[t];p(i,s,"to-bottom")}},m=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>u(e)),s=i.map(e=>e.clone().grow(r/2));let l=!1;for(let t=0;t<s.length&&!l;t++){const i=s[t];for(let r=t+1;r<e.length;r++){const e=s[r];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:s}=e;return{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}}),h=i.some(e=>c.some(t=>Uf(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};g(l),g(c),m(h),m(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,color:o}=i,a=new Li;this.calloutLabelSelection.selectByTag(1).forEach(s=>{const l=s.closestDatum(),c=l.calloutLabel,h=t.convert(l.radius),d=Math.max(0,h);if(!c?.text||0===d||c.hidden)return void(s.visible=!1);const u=d+r+n,p=l.midCos*u,g=l.midSin*u+c.collisionOffsetY,m={textAlign:c.collisionTextAlign??c.textAlign,textBaseline:c.textBaseline};a.text=c.text,a.x=p,a.y=g,a.setFont(this.properties.calloutLabel),a.setAlign(m);const f=a.getBBox();let y=c.text,v=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,f,e);y=c.text.length===t?c.text:`${c.text.substring(0,t)}…`,v=!i}s.text=y,s.x=p,s.y=g,s.setFont(this.properties.calloutLabel),s.setAlign(m),s.fill=o,s.visible=v})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Li;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=d.text,c.x=0,c.y=e,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(i=>{const s=i.calloutLabel;if(!s||0===i.outerRadius)return null;const d=i.outerRadius+r+n,u=i.midCos*d,p=i.midSin*d+s.collisionOffsetY;c.text=s.text,c.x=u,c.y=p,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:s.collisionTextAlign??s.textAlign,textBaseline:s.textBaseline});const g=c.getBBox();if(s.box=g,Math.abs(s.collisionOffsetY)>o)s.hidden=!0;else{if(h){const e=-this.centerY,t=new f(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(g.collidesBBox(t))return void(s.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:r}=this.getLabelOverflow(s.text,g,t),n=s.text.length>2&&e<2;if(i||n||r)return void(s.hidden=!0)}s.hidden=!1,l.push(g)}}),0===l.length?null:f.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:r,fontFamily:n,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=1===this.ctx.legendManager.getData(this.id)?.filter(e=>e.enabled).length,d=(e,d)=>{const{sectorLabel:u,outerRadius:p,startAngle:g,endAngle:m}=d;let f=!1;if(u&&0!==p){const y=t*(1-a)+p*a+o;e.fill=l,e.fontStyle=s,e.fontWeight=r,e.fontSize=i,e.fontFamily=n,e.text=u.text,!c&&h?(e.x=0,e.y=0):(e.x=d.midCos*y,e.y=d.midSin*y),e.textAlign="center",e.textBaseline="middle";const v=e.getBBox(),C=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],b={startAngle:g,endAngle:m,innerRadius:t,outerRadius:p};C.every(([e,t])=>Vf(e,t,b))&&(f=!0)}e.visible=f};this.labelSelection.each(d),this.highlightLabelSelection.each(d)}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius()}pickNodeClosestDatum(e){return ay(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{legendItemKey:n,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=r,m=this.properties.title.text;if(!i||!s)return;const f=s.dataSources.get(this.id)?.[e],{angleRawValues:y,legendItemValues:v,calloutLabelValues:C,sectorLabelValues:b}=this.getProcessedDataValues(i,s),S=y[e],w=v?.[e]??(o===h?void 0:C?.[e])??(l===h?void 0:b?.[e])??d;return this.formatTooltipWithContext(g,{title:m,symbol:this.legendItemSymbol(e),data:[{label:w,fallbackLabel:h,value:Fs(S,3)}]},{seriesId:t,datum:f,title:d,legendItemKey:n,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,...this.getSectorFormat(f,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return nt(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{id:t,visible:i,processedData:s,dataModel:r,ctx:{legendManager:n}}=this;if(!r||!s||"category"!==e)return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!(c||a&&a!==o||l&&l!==o))return[];const{calloutLabelValues:d,sectorLabelValues:u,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(r,s),m=this.properties.title?.showInLegend&&this.properties.title.text,f=[],y=this.properties.hideZeroValueSectorsInLegend,v=s.dataSources.get(this.id),C=s.invalidData?.get(this.id);for(let e=0;e<s.input.count;e++){const s=v?.[e],r=g[e];if(!0===C?.[e]||y&&0===r)continue;const b=[];m&&b.push(m);const S=this.getLabels(s,2*Math.PI,2*Math.PI,!1,d?.[e],u?.[e],p?.[e]);c&&void 0!==S.legendItem?b.push(S.legendItem.text):a&&a!==o&&void 0!==S.calloutLabel?.text?b.push(S.calloutLabel?.text):l&&l!==o&&void 0!==S.sectorLabel?.text&&b.push(S.sectorLabel?.text),0!==b.length&&f.push({legendType:"category",id:t,datum:s,itemId:e,seriesId:t,hideToggleOtherSeries:!0,enabled:i&&n.getItemEnabled({seriesId:t,itemId:e}),label:{text:b.join(" - ")},symbol:this.legendItemSymbol(e),legendItemName:null!=c?s[c]:void 0,hideInLegend:!h})}return f}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((e,s)=>i.toggleItem(e,t,s)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=ny(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);aa(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(e,t)=>this.getDatumId(t.datumIndex)),vp(this,"callout",t,this.calloutLabelSelection),vp(this,"sector",t,this.labelSelection),vp(this,"highlight",t,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:r,previousRadiusScale:n}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=0===(a?.moved.size??0),c=(s?.defs.keys.length??0)>0;l&&c&&(s?.reduced?.animationValidation?.uniqueKeys??1)||this.ctx.animationManager.skipCurrentBatch();const h=ny(!1,this.properties.rotation,r,n);aa(this.id,"nodes",o,[e,t,i],h.nodes,(e,t)=>this.getDatumId(t.datumIndex),a),vp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),vp(this,"sector",this.ctx.animationManager,this.labelSelection),vp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:r}=this,{animationManager:n}=this.ctx,o=ny(!1,this.properties.rotation,s,r);aa(this.id,"nodes",n,[e,t,i],o.nodes,(e,t)=>this.getDatumId(t.datumIndex)),Cp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Cp(this,"sector",this.ctx.animationManager,this.labelSelection),Cp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};Ey.className="PieSeries",Ey.type="pie";var My={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new Ey(e),tooltipDefaults:{range:"exact"},themeTemplate:{series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:dp,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Ru,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}}},Ay={type:"series",name:"pie",chartType:"polar",options:py,create:e=>new Ey(e)};function Ty(){c.register(Jd,Cu,bh,Gm,lf,yf,If,Of,fy,My,xf);for(const e of[Hd,Ah,Wd,kd,Ud,Kd])jo.register(e.type,{moduleFactory:t=>new e(t)})}var Dy=["bar","line","scatter"],Iy=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(Iy||{}),Ry=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(Ry||{}),Py=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(Py||{}),ky=Symbol("IGNORED_PROP");function Ly(e,t){const i={};for(const s of Object.keys(t)){const r=t[s];r!==ky&&Object.hasOwn(e,s)&&(i[s]=r)}return i}function Ny(e){const{enabled:t,mode:i,showArrow:s,range:r,position:n,pagination:o,delay:a,wrapping:l,interaction:c,renderer:h,...d}=e,u=Ly(e,{enabled:t,showArrow:s,range:r,position:n,interaction:c,renderer:h,...d});return{chartTooltipOptions:Ly(e,{enabled:ky,showArrow:ky,range:ky,position:ky,mode:i,pagination:o,delay:a,wrapping:l,...d}),seriesTooltipOptions:u}}function _y(e,t){if(null==t)return e;const{targets:i,...s}=t;return null!=(e=N(e,s)).targets&&null!=i&&(e.targets=O(e.targets,i)),e}var Oy={fills:(0,s.Uo)((0,s.O9)(2),(0,s.jk)((0,s.fd)({color:s.yW,stop:s.ai},"")),s.hz),fillMode:(0,s.KC)("continuous","discrete")},Fy={value:(0,s.mw)(s.ai),text:s.Yj,shape:(0,s.or)((0,s.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),s.E2),placement:(0,s.KC)("before","after","middle"),spacing:s.Ly,size:s.Ly,rotation:s.ai,...s.Fu,...s.AF,...s.mL},Gy={value:(0,s.mw)(s.ai),text:s.Yj,shape:(0,s.or)((0,s.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),s.E2),placement:(0,s.KC)("inside","outside","middle"),spacing:s.Ly,size:s.Ly,rotation:s.ai,label:{...Im,spacing:s.Ly},...s.Fu,...s.AF,...s.mL},By={direction:(0,s.KC)("horizontal","vertical"),cornerMode:(0,s.KC)("container","item"),cornerRadius:s.Ly,thickness:s.Ly,segmentation:{enabled:s.zM,spacing:s.Ly,interval:{values:(0,s.jk)(s.ai),step:s.ai,count:s.ai}},bar:{enabled:s.zM,thickness:s.Ly,thicknessRatio:s.CG,...Oy,...s.Fu,...s.AF,...s.mL},label:{...Rm,text:s.Yj,spacing:s.Ly,avoidCollisions:s.zM,placement:(0,s.KC)("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Lm,...G(Am,["listeners"])},Vy={...By,...G(Tm,["listeners"]),type:(0,s.mw)((0,s.dY)("linear-gauge")),value:(0,s.mw)(s.ai),scale:{min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min")),label:{enabled:s.zM,formatter:s.E2,rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,placement:(0,s.KC)("before","after"),avoidCollisions:s.zM,format:Xg,...s.LV},interval:{values:(0,s.jk)(s.ai),step:s.ai},...Oy,...s.Fu,...s.AF,...s.mL},targets:(0,s.J$)(Fy,"target options array")};Vy.margin=(0,s._L)(s.ai),Vy.defaultColorRange=(0,s._L)((0,s.jk)(s.yW)),Vy.defaultTarget=(0,s._L)({...Fy,value:s.ai,label:{...Im,spacing:s.ai}}),Vy.defaultScale=(0,s._L)(Vy.scale),Vy.scale.defaultFill=(0,s._L)(s.yW);var Hy={outerRadius:s.Ly,innerRadius:s.Ly,outerRadiusRatio:s.CG,innerRadiusRatio:s.CG,startAngle:s.ai,endAngle:s.ai,spacing:s.Ly,cornerMode:(0,s.KC)("container","item"),cornerRadius:s.Ly,scale:{min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min")),label:{enabled:s.zM,formatter:s.E2,rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,avoidCollisions:s.zM,format:Xg,...s.LV},interval:{values:(0,s.jk)(s.ai),step:s.ai},...Oy,...s.Fu,...s.AF,...s.mL},segmentation:{enabled:s.zM,spacing:s.Ly,interval:{values:(0,s.jk)(s.ai),step:s.ai,count:s.ai}},bar:{enabled:s.zM,...Oy,...s.Fu,...s.AF,...s.mL},needle:{enabled:s.zM,spacing:s.Ly,radiusRatio:s.CG,...s.Fu,...s.AF,...s.mL},label:{text:s.Yj,spacing:s.Ly,...Rm},secondaryLabel:{text:s.Yj,...Rm},tooltip:Lm,...Am},Uy={...Hy,...Tm,type:(0,s.mw)((0,s.dY)("radial-gauge")),value:(0,s.mw)(s.ai),targets:(0,s.J$)(Gy,"target options array")};Uy.defaultColorRange=(0,s._L)((0,s.jk)(s.yW)),Uy.defaultTarget=(0,s._L)({...Gy,value:s.ai,label:{...Im,spacing:s.ai}}),Uy.scale.defaultFill=(0,s._L)(s.yW);var zy={stroke:$u},Wy={fill:Zu},jy={color:"white",fill:$u},Ky={color:$u},$y={color:qu,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Yy={...$y,fontSize:{$ref:"fontSize"},color:ep,fill:Qu,stroke:Ju,strokeWidth:1,divider:{stroke:tp,strokeWidth:1,strokeOpacity:.5}},qy={...zy,background:{fill:Xu,fillOpacity:.2},handle:{...Wy},text:{...Ky},statistics:{...Yy}},Xy={line:{...zy,handle:{...Wy},text:{...Ky}},"horizontal-line":{...zy,handle:{...Wy},axisLabel:{...jy},text:{...Ky}},"vertical-line":{...zy,handle:{...Wy},axisLabel:{...jy},text:{...Ky}},"disjoint-channel":{...zy,background:{fill:Xu,fillOpacity:.2},handle:{...Wy},text:{...Ky}},"parallel-channel":{...zy,background:{fill:Xu,fillOpacity:.2},handle:{...Wy},text:{...Ky}},"fibonacci-retracement":{...zy,strokes:Yu,rangeStroke:$u,handle:{...Wy},text:{...Ky,position:"center"},label:{...$y,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...zy,strokes:Yu,rangeStroke:$u,handle:{...Wy},text:{...Ky,position:"center"},label:{...$y,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...zy,...$y,color:{$ref:"textColor"},handle:{...Wy},fill:Xu,fillOpacity:.2},comment:{...$y,color:"white",fontWeight:700,handle:{...Wy},fill:$u},note:{...$y,color:op,fill:$u,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Wy},background:{fill:rp,stroke:np,strokeWidth:1}},text:{...$y,handle:{...Wy}},arrow:{...zy,handle:{...Wy},text:{...Ky}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Wy,stroke:$u}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Wy,stroke:$u}},"date-range":{...qy},"price-range":{...qy},"date-price-range":{...qy},"quick-date-price-range":{up:{...zy,fill:Xu,fillOpacity:.2,handle:{...Wy},statistics:{...Yy,color:"#fff",fill:Xu,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...zy,stroke:sp,fill:ip,fillOpacity:.2,handle:{...Wy,stroke:sp},statistics:{...Yy,color:"#fff",fill:ip,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},Zy=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Qy=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],Jy="range-area";function ev(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function tv(e,t){return t[e]??t.default}var iv={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Ku,lineDash:[0],label:{enabled:!1}}},sv={...iv,nice:!1},rv={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},nv={style:[{stroke:{$ref:"gridLineColor"}}],width:2},ov={number:{gridLine:nv},time:{gridLine:nv},category:{gridLine:nv}},av={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...sv,interval:{values:[0]}},log:{...sv},time:{...sv},category:{...iv}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...rv,position:{...rv.position,anchorTo:"pointer"},range:"nearest"},axes:ov},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:rv},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:rv}}},lv=kh(function(e,t){return"string"==typeof e?{...t,baseTheme:e}:null!=e?{...e,baseTheme:lv(e.baseTheme,t)}:t});function cv(e){if(Array.isArray(e)&&0!==e.length){const t=e[0];if("number"==typeof t)return{data:e.map((e,t)=>({x:t,y:e})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(e=>({x:e[0],y:e[1],datum:e})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:e}}function hv(e){switch(e?.type){case"number":{const{type:t,min:i,max:s,reverse:r}=e;return Ly(e,{type:t,reverse:r,min:i,max:s})}case"time":{const{type:t,min:i,max:s,reverse:r}=e;return Ly(e,{type:t,reverse:r,min:i,max:s})}default:const{paddingInner:t,paddingOuter:i,reverse:s}=e??{};return Ly({...e,type:"category"},{type:"category",reverse:s,paddingInner:t,paddingOuter:i})}}function dv(e,t,i){const s={};return null!=e?.stroke&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),null!=e?.strokeWidth&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),"bar"===i.type&&"horizontal"!==i.direction&&(s.enabled??(s.enabled=!0)),null!=e?.visible&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var uv=kh((e,t,i)=>s=>{const r=s.datum[s.xKey],n=s.datum[s.yKey],o=null!=i?s.datum[i]:s.datum,a=t?.renderer?.({context:e,datum:o,xValue:r,yValue:n});if("string"==typeof a)return a;const l=a?.content??n.toFixed(2);return a?.title?{heading:void 0,title:void 0,data:[{label:a.title,value:l}]}:{heading:void 0,title:l,data:[]}}),pv={chartType:(0,s.KC)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:s.Yj,openKey:s.Yj,highKey:s.Yj,lowKey:s.Yj,closeKey:s.Yj,volumeKey:s.Yj,navigator:s.zM,volume:s.zM,rangeButtons:s.zM,statusBar:s.zM,toolbar:s.zM,zoom:s.zM,sync:s.zM,theme:s.sw,container:s.sw,width:s.sw,height:s.sw,minWidth:s.sw,minHeight:s.sw,listeners:s.sw,initialState:s.sw,title:s.sw,data:s.YO},gv={theme:s.sw,container:s.sw,animation:s.sw,background:s.sw,contextMenu:s.sw,listeners:s.sw,locale:s.sw,width:s.sw,height:s.sw,minWidth:s.sw,minHeight:s.sw,title:s.sw,subtitle:s.sw,footnote:s.sw,padding:s.sw,tooltip:{...Lm,...Mm.tooltip}};gv.overrideDevicePixelRatio=(0,s._L)(s.Ly);var mv=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],fv={visible:s.zM,reverse:s.zM,stroke:s.yW,strokeWidth:s.Ly},yv={context:s.sw,tooltip:s.sw,theme:s.sw,background:s.sw,container:s.sw,width:s.sw,height:s.sw,minWidth:s.sw,minHeight:s.sw,padding:s.sw,listeners:s.sw,locale:s.sw,data:s.sw,styleNonce:s.Yj,axis:(0,s.is)({number:{...fv,min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min"))},category:{...fv,paddingInner:s.CG,paddingOuter:s.CG},time:{...fv,min:(0,s.Uo)((0,s.or)(s.ai,s.p6),(0,s.Xe)("max")),max:(0,s.Uo)((0,s.or)(s.ai,s.p6),(0,s.MM)("min"))}},"axis options","category"),min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min")),crosshair:{enabled:s.zM,snap:s.zM,...s.AF,...s.mL},xKey:s.Yj,yKey:s.Yj},vv={type:"preset",name:"price-volume",enterprise:!0,options:pv,create:function(e,t,i){const{dateKey:r="date",highKey:n="high",openKey:o="open",lowKey:a="low",closeKey:l="close",volumeKey:c="volume",chartType:h="candlestick",navigator:d=!1,volume:u=!0,rangeButtons:p=!0,statusBar:g=!0,toolbar:m=!0,zoom:f=!0,sync:y=!1,theme:v,data:C,...b}=e,S=function(e,t,i,r,n,o){const a={xKey:t,openKey:n,closeKey:o,highKey:i,lowKey:r},l={xKey:t,yKey:o},c={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return function(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}(c,a);case"line":case"step-line":return function(e,t){return[{type:"line",focusPriority:0,...e,...t}]}(c,l);case"hlc":return function(e,t,{xKey:i,highKey:s,closeKey:r,lowKey:n}){return[{type:Jy,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:r,fill:_u,stroke:Lu},{type:Jy,focusPriority:0,...e,xKey:i,yHighKey:r,yLowKey:n,fill:Ou,stroke:Nu},{type:"line",...e,...t}]}(c,l,a);case"high-low":return function(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,fill:Gu,stroke:Fu,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}(c,a);case"candlestick":case"hollow-candlestick":return ev(c,a);default:return s.Vy.warnOnce(`unknown chart type: ${e}; expected one of: ${Zy.join(", ")}`),ev(c,a)}}(h,r,n,a,o,l),w=function(e,t,i,s,r){return s?[{type:"bar",xKey:"date",yKey:r,tooltip:{enabled:!1},itemStyler({datum:s}){const{up:r,down:n}=e().palette;return{fill:s[t]<s[i]?r?.fill:n?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}(i,o,l,u,c),x={navigator:{enabled:d,...u?{miniChart:{enabled:d,series:[{type:"line",xKey:r,yKey:c,stroke:up,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},E={annotations:{enabled:m,optionsToolbar:{enabled:m},snap:!0,toolbar:{enabled:m,buttons:Qy,padding:0},data:C,xKey:r,volumeKey:u?c:void 0}},M=g?{statusBar:{enabled:!0,data:C,highKey:n,openKey:o,lowKey:a,closeKey:l,volumeKey:u?c:void 0}}:null,A={zoom:{enabled:f,autoScaling:{enabled:!0},enableIndependentAxes:!0}},T={ranges:{enabled:p}},D=y?{sync:{enabled:y,nodeInteraction:!0,zoom:!0}}:null,I=u?[{type:"number",position:"left",keys:[c],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:"string"==typeof v?v:"ag-financial",...N("object"==typeof v?v:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:m},annotations:{...Xy},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...tv(h,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...tv(h,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...w,...S],axes:[{type:"number",position:"right",keys:[o,l,n,a],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...I,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:C,...E,...x,...M,...A,...T,...D,...b}}},Cv={type:"preset",name:"gauge-preset",enterprise:!0,options:(0,s.is)({"linear-gauge":{...G(Vy,["type"]),...gv},"radial-gauge":{...G(Uy,["type"]),...gv}},"gauge options"),create:function(e,t){if(e.listeners){const{nodeClick:t,nodeDoubleClick:i,...s}=e.listeners;e={...e,listeners:{seriesNodeClick:t,seriesNodeDoubleClick:i,...s}}}switch(e.type){case"radial-gauge":return function(e){const{animation:t,background:i,container:s,contextMenu:r,footnote:n,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,width:f,type:y,cursor:v,nodeClickRange:C,tooltip:b={},value:S,scale:w={},startAngle:x,endAngle:E,highlightStyle:M,segmentation:A,bar:T,needle:D,targets:I,outerRadius:R,innerRadius:P,outerRadiusRatio:k,innerRadiusRatio:L,cornerRadius:N,cornerMode:_,label:O,secondaryLabel:F,spacing:G,...B}=e,{chartTooltipOptions:V,seriesTooltipOptions:H}=Ny(b),U=Ly(e,{animation:t,background:i,container:s,contextMenu:r,footnote:n,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,tooltip:V,width:f}),z=Ly(e,{needle:null!=D?{enabled:!0,...D}:ky,startAngle:x,endAngle:E,scale:w,type:y,cursor:v,nodeClickRange:C,tooltip:H,value:S,highlightStyle:M,segmentation:A,bar:T,targets:I,outerRadius:R,innerRadius:P,outerRadiusRatio:k,innerRadiusRatio:L,cornerRadius:N,cornerMode:_,label:O,secondaryLabel:F,spacing:G,...B});return"context"in e&&(U.context=e.context),{...U,series:[z]}}(_y(e,t));case"linear-gauge":return function(e){const{animation:t,background:i,container:s,contextMenu:r,footnote:n,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,width:f,type:y,cursor:v,nodeClickRange:C,tooltip:b={},value:S,scale:w={},direction:x="vertical",thickness:E,highlightStyle:M,segmentation:A,bar:T,targets:D,cornerRadius:I,cornerMode:R,label:P,...k}=e,{chartTooltipOptions:L,seriesTooltipOptions:N}=Ny(b),_=Ly(e,{animation:t,background:i,container:s,contextMenu:r,footnote:n,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,tooltip:L,width:f}),O=Ly(e,{scale:w,type:y,cursor:v,nodeClickRange:C,tooltip:N,value:S,direction:x,thickness:E,highlightStyle:M,segmentation:A,bar:T,targets:D,cornerRadius:I,cornerMode:R,label:P,...k});return"context"in e&&(_.context=e.context),{..._,series:[O]}}(_y(e,t));default:return{}}}},bv={type:"preset",name:"sparkline",options:(0,s.is)({area:{...yv,...G(Fm,mv)},bar:{...yv,...G(af,mv)},line:{...yv,...G(Df,mv)}},"sparkline options"),create:function(e){const{background:t,container:i,height:s,listeners:r,locale:n,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,theme:d,data:u,crosshair:p,axis:g,min:m,max:f,tooltip:y,context:v,styleNonce:C,...b}=e,S=Ly(e,{background:t,container:i,height:s,listeners:r,locale:n,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,styleNonce:C,tooltip:ky,context:ky,data:ky,crosshair:ky,axis:ky,min:ky,max:ky,theme:ky}),{data:w,series:[x]=[],datumKey:E}=cv(u),M=b;null!=x&&Object.assign(M,x),M.tooltip={...y,renderer:uv(v,y,E)},S.theme=lv(d,av),S.data=w,S.series=[M];const A="bar"!==M.type||"horizontal"!==M.direction,[T,D]=A?["bottom","left"]:["left","bottom"],I={...hv(g),position:T,...Ly(e,{crosshair:p})},R={type:"number",gridLine:dv(g,!1,e),position:D,...Ly(e,{min:m,max:f})};return S.axes=A?[R,I]:[I,R],S},processData:cv},Sv=["top","right","bottom","left"],wv=class e extends gh{constructor(e,t){super(e,t),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(e,t){super.onAxisChange(e,t),this.syncAxisChanges(e,t),null!=this.ctx&&this.ctx.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:t,annotationRoot:i}=this;t.setClipRect(e),i.setClipRect(e)}async processData(){await super.processData(),"init"===this.syncStatus&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const t=await this.getSyncedDomain(e);null!=t&&e.setDomains(t)}}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{clipSeries:s,seriesRect:r,visible:n}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=n,this.seriesRect=r,this.animationRect=e.layoutBox;const{x:o,y:a}=r;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const e of[t,i])e.translationX=Math.floor(o),e.translationY=Math.floor(a);else{const{translationX:e,translationY:s}=t;la(this.id,"seriesRect",this.ctx.animationManager,[t,i],{translationX:e,translationY:s},{translationX:Math.floor(o),translationY:Math.floor(a)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const l=r.clone().grow(this.seriesArea.padding),c=this.seriesArea.clip||s?l:void 0,{lastUpdateClipRect:h}=this;this.lastUpdateClipRect=c,this.ctx.animationManager.isActive()&&null!=h?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:h,to:l,onUpdate:e=>this.setRootClipRects(e),onComplete:()=>this.setRootClipRects(c)}):this.setRootClipRects(c),this.ctx.layoutManager.emitLayoutComplete(e,{axes:this.axes.map(e=>e.getLayoutState()),series:{visible:n,rect:r,paddedRect:l},clipSeries:s})}updateAxes(e){const{clipSeries:t,seriesRect:i,overflows:s}=this.resolveAxesLayout(e);for(const t of this.axes)t.update(),t.setCrossLinesVisible(!s),this.clipAxis(t,i,e);return{clipSeries:t,seriesRect:i,visible:!s}}resolveAxesLayout(e){let t,i,r=0;do{if(i=t??this.getDefaultState(),t=this.updateAxesPass(new Map(i.axisAreaWidths),e.clone()),r++>10){s.Vy.warn("Max iterations reached. Unable to stabilize axes layout.");break}}while(!this.isLayoutStable(t,i));return this.lastAreaWidths=t.axisAreaWidths,t}updateAxesPass(t,i){const r=new Map,n={};let o=!1,a=!1;for(const e of Sv){const t=this.seriesArea.padding[e],s=this.axes.findLast(t=>t.position===e);s?s.seriesAreaPadding=t:i.shrink(t,e)}const l=(t.get("left")??0)+(t.get("right")??0),c=(t.get("top")??0)+(t.get("bottom")??0),h=this.buildCrossLinePadding(t),d=h.left+h.right,u=h.top+h.bottom;i.width<=l+d||i.height<=c+u?o=!0:i.shrink(h);const p=i.clone().shrink(Object.fromEntries(t));for(const e of this.axes){const{position:t="left",direction:i}=e;this.sizeAxis(e,p,t);const s="y"===i,{primaryTickCount:o,bbox:l}=e.calculateLayout(e.nice?n[i]:void 0,this.padding);n[i]??(n[i]=o),a||(a=e.dataDomain.clipped||e.visibleRange[0]>0||e.visibleRange[1]<1),r.set(e.id,Math.ceil(e.thickness??(s?l?.width:l?.height)??0))}const g=(0,s.$z)(this.axes,e=>e.position??"left"),{width:m,height:f,pixelRatio:y}=this.ctx.scene,v=new Map,C=new Map;for(const[t,i]of(0,s.jO)(g)){let s="left"===t||"right"===t?f%y:m%y,n=0;for(const t of i??[]){C.set(t.id,s);const i=r.get(t.id)??0;n=Math.max(n,s+i),t.layoutConstraints.stacked&&(s+=i+e.AxesPadding)}v.set(t,Math.ceil(n))}for(const[e,t]of(0,s.jO)(g))this.positionAxes({axes:t??[],position:e,axisWidths:r,axisOffsets:C,axisAreaWidths:v,axisBound:i,seriesRect:p});return{clipSeries:a,seriesRect:p,axisAreaWidths:v,overflows:o}}buildCrossLinePadding(e){const t={top:0,right:0,bottom:0,left:0};this.axes.forEach(e=>{const{position:i,label:s}=e;e.crossLines?.forEach(e=>{var r;e instanceof ul&&(e.position=i??"top",(r=e.label).parallel??(r.parallel=s.parallel)),e.calculatePadding?.(t)})});for(const[i,r=0]of(0,s.jO)(t))t[i]=Math.max(r-(e.get(i)??0),0);return t}clampToOutsideSeriesRect(e,t,i,s){const r="x"===i?e.x:e.y,n="x"===i?e.width:e.height;return 1===s?Math.min(t,r+n):Math.max(t,r)}async getSyncedDomain(e){const t=this.modulesManager.getModule("sync");if(t?.enabled)return await t.getSyncedDomain(e)}syncAxisChanges(e,t){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=new Set(t??[]);for(const t of e)s.delete(t);for(const e of s)i.removeAxis(e)}sizeAxis(e,t,i){const s=e instanceof Ah,r="left"===i||"right"===i,{width:n,height:o}=t,a=r?o:n;let l=0,c=a,{min:h,max:d}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:u,unit:p,align:g}=e.layoutConstraints;c="px"===p?l+u:c*u/100,"end"===g&&(l=a-(c-l),c=a),r&&(s?[h,d]=[1-d,1-h]:[l,c]=[c,l]),e.range=[l,c],e.visibleRange=[h,d],e.gridLength=r?n:o}positionAxes(e){const{axes:t,axisBound:i,axisWidths:s,axisOffsets:r,axisAreaWidths:n,seriesRect:o,position:a}=e,l=n.get(a)??0;let c="x",h="y",d=1;"top"!==a&&"bottom"!==a||(c="y",h="x");let u=i[c];"right"!==a&&"bottom"!==a||(d=-1,u+="x"===c?i.width:i.height);for(const e of t){const t=n.get("x"===h?"left":"top")??0,a=s.get(e.id)??0,p=r.get(e.id)??0;e.gridPadding=l-p-a,e.translation[h]=i[h]+t,e.translation[c]=this.clampToOutsideSeriesRect(o,u+d*(p+a),c,d)}}shouldFlipXY(){return this.series.every(e=>e instanceof jp&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:t="left"}of this.axes){const i=this.lastAreaWidths.get(t);null!=i&&e.set(t,i)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,t){if(t.overflows!==e.overflows||t.clipSeries!==e.clipSeries)return!1;for(const i of e.axisAreaWidths.keys())if(!t.axisAreaWidths.has(i))return!1;for(const[i,s]of t.axisAreaWidths.entries()){const t=e.axisAreaWidths.get(i);if((null!=s||null!=t)&&s!==t)return!1}return!0}clipAxis(e,t,i){const s=Math.ceil(e.gridLine?.width??0),r=Math.ceil(e.line?.width??0);let{width:n,height:o}=t;switch(n+="x"===e.direction?s:r,o+="y"===e.direction?s:r,e.clipGrid(t.x,t.y,n,o),e.position){case"left":case"right":e.clipTickLines(i.x,t.y-s,i.width+s,t.height+2*s);break;case"top":case"bottom":e.clipTickLines(t.x-s,i.y,t.width+2*s,i.height+s)}}};wv.className="CartesianChart",wv.type="cartesian",wv.AxesPadding=15;var xv=wv,Ev={mode:(0,s._L)((0,s.KC)("integrated","standalone")),container:s.Sc,theme:s.sw,series:s.YO,annotations:s.sw,navigator:s.sw,initialState:{chartType:s.Yj,annotations:s.sw,legend:(0,s.J$)({visible:s.zM,seriesId:s.Yj,itemId:s.Yj,legendItemName:s.Yj},"legend state array"),zoom:s.sw}},Mv={...Mm,...Ev,axes:s.sw,data:s.YO},Av={...Mm,...Ev,axes:s.sw,data:s.YO},Tv={...Mm,...Ev,data:s.YO,topology:s.eW},Dv={...Mm,...Ev,data:s.YO},Iv={...Mm,...Ev,data:s.YO},Rv={...Mm,...Ev,data:s.YO,nodes:s.YO},Pv={...Mm,...Ev,data:s.YO},kv=new Set(["number","log","time"]),Lv=e=>(0,s.Gv)(e)&&!kv.has(e.type),Nv={type:"chart",name:"cartesian",options:Mv,detect:Ql,create:(e,t)=>new xv(e,t),validate(e,t,i){const r=[];"histogram"===e?.series?.[0]?.type&&e?.axes?.some(Lv)&&(r.push(new s.yI("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=G(e,["axes"]));const n=(0,s.tf)(e,t,i);return n.invalid.push(...r),n}},_v=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},Ov={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:ic,create:_v},Fv={type:"chart",name:"gauge",placeholder:!0,options:{},detect:rc,create:_v},Gv={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:ec,create:_v},Bv={type:"chart",name:"standalone",placeholder:!0,options:{},detect:sc,create:_v},Vv={type:"chart",name:"topology",placeholder:!0,options:{},detect:tc,create:_v},Hv=class extends Ul{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.isAnySeriesActive(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:r}=this.calculateRotations();this.crossLines.forEach(n=>{n.sideFlag=-e,n.direction=i===-Math.PI/2?"angle":"radius",n.parallelFlipRotation=s,n.regularFlipRotation=r,n.calculateLayout?.(t,this.reverse)})}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each((e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation}))}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};a([Te],Hv.prototype,"shape",2),a([Te],Hv.prototype,"innerRadiusRatio",2);var Uv=class extends gh{constructor(e,t){super(e,t),this.padding=new ri(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e;t.shrink(this.seriesArea.padding.toJson());const i=t.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(e=>e.update()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(e,t,i,s){const r=this.axes.find(e=>"angle"===e.direction),n=this.axes.find(e=>"radius"===e.direction);if(!(r instanceof Hv&&n instanceof Hv))return;const o=r.scale,a=n.innerRadiusRatio;r.innerRadiusRatio=a,r.computeRange(),r.gridLength=s,n.gridAngles=o.ticks({nice:r.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(e=>o.convert(e)),n.gridRange=r.range,n.range=[s,s*a],[r,n].forEach(s=>{s.translation.x=e.x+t,s.translation.y=e.y+i,s.calculateLayout()})}async computeCircle(e){const t=this.series.filter(zv),i=this.axes.filter(Wv),r=(i,s,r)=>{this.updateAxes(e,i,s,r),t.forEach(e=>{e.centerX=i,e.centerY=s,e.radius=r});const n=t.filter(e=>"donut"===e.type||"pie"===e.type);if(n.length>1){const e=n.map(e=>{const t=e.getInnerRadius();return{series:e,innerRadius:t}}).sort((e,t)=>e.innerRadius-t.innerRadius);e.at(-1).series.surroundingRadius=void 0;for(let t=0;t<e.length-1;t++)e[t].series.surroundingRadius=e[t+1].innerRadius}},n=e.width/2,o=e.height/2,a=Math.max(0,Math.min(e.width,e.height)/2);let l=a;r(n,o,l);const c=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const r of(0,s.nl)(i,t)){const t=await r.computeLabelsBBox({hideWhenNecessary:c},e);t&&h.push(t)}if(0===h.length)return void r(n,o,a);const d=f.merge(h),u=this.refineCircle(d,l,e);r(u.centerX,u.centerY,u.radius),l=u.radius};await c(),await c(),await c(),await c({hideWhenNecessary:!0}),await c({hideWhenNecessary:!0});for(const r of(0,s.nl)(i,t))await r.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:l,centerX:n,centerY:o}}refineCircle(e,t,i){const s=-t,r=-t,n=t,o=t;let a=Math.max(0,s-e.x),l=Math.max(0,r-e.y),c=Math.max(0,e.x+e.width-n),h=Math.max(0,e.y+e.height-o);a=c=Math.max(a,c),l=h=Math.max(l,h);const d=i.width-a-c,u=i.height-l-h;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,f=Math.min(g,m);if(p<f){p=f;const e=a+c;if(2*p+(l+h)>i.height){const e=i.height-2*p;2*Math.min(l,h)>e?(l=e/2,h=e/2):l>h?l=e-h:h=e-l}if(2*p+e>i.width){const e=i.width-2*p;2*Math.min(a,c)>e?(a=e/2,c=e/2):a>c?a=e-c:c=e-a}}const y=a+2*p+c,v=l+2*p+h;return{centerX:(i.width-y)/2+a+p,centerY:(i.height-v)/2+l+p,radius:p}}};function zv(e){return e instanceof cy}function Wv(e){return e instanceof Hv}Uv.className="PolarChart",Uv.type="polar";var jv={type:"chart",name:"polar",options:Av,detect:Jl,create:(e,t)=>new Uv(e,t),validate(e,t,i){const r=[],n=e?.series?.[0]?.type;"pie"!==n&&"donut"!==n||e?.axes&&(r.push(new s.Bk([],e.axes,i,"axes")),e=G(e,["axes"]));const o=(0,s.tf)(e,t,i);return o.invalid.push(...r),o}},Kv={...am,...cm(s.ai),type:(0,s.mw)((0,s.dY)("number")),label:im,crosshair:lm(!0)},$v={...am,...cm(s.ai),type:(0,s.mw)((0,s.dY)("log")),base:(0,s.Uo)(s.MX,(0,s.W$)(e=>1!==e,"not equal to 1")),label:im,crosshair:lm(!0)},Yv={...am,...cm((0,s.or)(s.ai,s.p6),!0),type:(0,s.mw)((0,s.dY)("time")),label:sm,parentLevel:nm,crosshair:lm(!0)};Yv.paddingInner=s.Ly,Yv.paddingOuter=s.Ly,Yv.groupPaddingInner=s.Ly;var qv={...am,type:(0,s.mw)((0,s.dY)("category")),label:tm,paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,crosshair:lm()},Xv={...am,type:(0,s.mw)((0,s.dY)("grouped-category")),label:tm,crosshair:lm(),paddingInner:s.CG,groupPaddingInner:s.CG,depthOptions:(0,s.J$)({label:{enabled:s.zM,avoidCollisions:s.zM,rotation:s.ai,spacing:s.ai,...s.LV},tick:{enabled:s.zM,stroke:s.yW,width:s.Ly}},"depth options objects array")},Zv={...am,...cm((0,s.or)(s.ai,s.p6),!0),type:(0,s.mw)((0,s.dY)("unit-time")),unit:(0,s.or)((0,s.hR)(Cn),qg),label:sm,parentLevel:nm,paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,crosshair:lm(!0)},Qv=(e,t)=>{const i={};for(const r of new Set([...Object.keys(e),...Object.keys(t)])){const n=e[r],o=t[r];(0,s.Qd)(n)&&(0,s.Qd)(o)?i[r]=Qv(n,o):i[r]=null!=n&&null!=o&&n!==o?(0,s.or)(n,o):n??o}return i},Jv=[Nv,{type:"axis",name:"number",chartType:"cartesian",options:Kv,create:e=>new Hd(e)},{type:"axis",name:"log",chartType:"cartesian",options:$v,create:e=>new Ud(e)},{type:"axis",name:"time",chartType:"cartesian",options:Qv(Yv,Zv),create:e=>new Wd(e)},{type:"axis",name:"category",chartType:"cartesian",options:qv,create:e=>new Ah(e)},{type:"axis",name:"grouped-category",chartType:"cartesian",options:Xv,create:e=>new kd(e)},{type:"axis",name:"unit-time",chartType:"cartesian",options:Zv,create:e=>new Kd(e)},Bm,cf,vf,Ef,Rf,Ff,jv,yy,Ay,Ov,Fv,Gv,Bv,Vv,vv,Cv,bv],eC={isEnterprise:!1};function tC(e,t){let i=[];const r=rc(e),n=Zl(e),o=n?Qo.get(n):"unknown";for(const t of Ko)if("unknown"===o||t.chartTypes.includes(o))if("root"===t.type||"legend"===t.type){const s=e[t.optionsKey];if(null==s)continue;t.optionsInnerKey?s[t.optionsInnerKey]&&(i.push(`${t.optionsKey}.${t.optionsInnerKey}`),delete s[t.optionsInnerKey]):(i.push(t.optionsKey),delete e[t.optionsKey])}else if("axis"===t.type){if(!("axes"in e)||!(0,s.cy)(e.axes)||!e.axes?.some(e=>e.type===t.identifier))continue;i.push(`axis[type=${t.identifier}]`),e.axes=e.axes.filter(e=>e.type!==t.identifier)}else if("axis-option"===t.type){if(!("axes"in e)||!(0,s.cy)(e.axes)||!e.axes?.some(e=>e[t.optionsKey]))continue;i.push(`axis.${t.optionsKey}`),e.axes.forEach(e=>{e[t.optionsKey]&&delete e[t.optionsKey]})}else if("series"===t.type){if(t.community)continue;if(!(0,s.cy)(e.series)||!e.series?.some(e=>e.type===t.identifier))continue;i.push(`series[type=${t.identifier}]`),e.series=e.series.filter(e=>e.type!==t.identifier)}else if("series-option"===t.type){if(!(0,s.cy)(e.series)||!e.series?.some(e=>e[t.optionsKey]))continue;i.push(`series.${t.optionsKey}`),e.series.forEach(e=>{e[t.optionsKey]&&delete e[t.optionsKey]})}if(i.length&&!t){r&&(i=["AgCharts.createGauge"]);let t="ag-charts-enterprise",n="https://www.ag-grid.com/charts/javascript/installation/";"integrated"===e.mode&&(t="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",n="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),s.Vy.warnOnce([`unable to use these enterprise features as '${t}' has not been loaded:`,"",...i,"",`See: ${n}`].join("\n"))}}function iC(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var sC="white",rC={get cartesian(){return{seriesTypes:Qo.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Qo.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Qo.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Qo.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Qo.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Qo.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Qo.gaugeTypes,commonOptions:[]}}},nC={"radial-gauge":!0,"linear-gauge":!0};function oC(e){return!0===nC[e]}var aC={millisecond:"%H:%M:%S.L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e %B",month:"%B",year:"%Y"},lC="%H:%M:%S.%L",cC="%H:%M:%S",hC="%H:%M",dC="%H:%M",uC=Object.values(rC).reduce((e,{commonOptions:t})=>e.concat(t),[]),pC=class e{static getDefaultColors(){return{fills:Xf,fillsFallback:Object.values(Xf),strokes:Zf,sequentialColors:fp(Xf),divergingColors:[Xf.ORANGE,Xf.YELLOW,Xf.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:fe.interpolate([fe.fromHexString(Xf.BLUE),fe.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[Xf.GREEN,Xf.YELLOW,Xf.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Xf.GREEN,stroke:Zf.GREEN},down:{fill:Xf.RED,stroke:Zf.RED},neutral:{fill:Xf.GRAY,stroke:Zf.GRAY},altUp:{fill:Xf.BLUE,stroke:Zf.BLUE},altDown:{fill:Xf.ORANGE,stroke:Zf.ORANGE},altNeutral:{fill:Xf.GRAY,stroke:Zf.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:sC,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}static getAxisDefaults(e,{title:t,time:i}){const s="modern"===i?aC:void 0;return N(e,t&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},"off"!==i&&{label:{format:{millisecond:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},lC,s?.millisecond]},second:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},cC,s?.second]},minute:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},hC,s?.minute]},hour:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},dC,s?.hour]},day:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%e",s?.day]},month:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%b",s?.month]},year:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%Y",s?.year]}}},parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},avoidCollisions:{$path:"../../label/avoidCollisions"},format:{millisecond:{$path:["../../../label/format/millisecond",lC]},second:{$path:["../../../label/format/second",cC]},minute:{$path:["../../../label/format/minute",hC]},hour:{$path:["../../../label/format/hour",dC]},day:{$path:["../../../label/format/day","%e"]},month:{$path:["../../../label/format/month","%b"]},year:{$path:["../../../label/format/year","%Y"]}}},tick:{enabled:{$path:"../../tick/enabled"},size:{$path:"../../tick/size"},width:{$path:"../../tick/width"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Pu,textAlign:ku},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Pu,textAlign:ku},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Pu,textAlign:ku},legend:{position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"right"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:Du,delay:0,pagination:!1},overlays:{darkTheme:Du},listeners:{}}}constructor(e={}){const{overrides:t,palette:i,params:s}=Bt(e),r=this.createChartConfigPerChartType(this.getDefaults()),n={};t&&this.mergeOverrides(r,n,t);const{fills:o,strokes:a,sequentialColors:l,...c}=this.getDefaultColors();this.palette=z(N(i,{fills:Object.values(o),strokes:Object.values(a),sequentialColors:Object.values(l),...c})),this.paletteType=iC(i),this.params=N(s,this.getPublicParameters()),this.config=z(this.templateTheme(r)),this.presets=z(n)}mergeOverrides(e,t,i){for(const{seriesTypes:t,commonOptions:s}of Object.values(rC)){const r={...i.common};for(const e of uC)s.includes(e)||delete r[e];for(const i of t){const t=i;oC(t)||(e[t]=N(r,e[t]))}}Qo.seriesTypes.forEach(s=>{const r=s,n=i[r];oC(r)?t[r]=n:e[r]=N(n,e[r])})}createChartConfigPerChartType(e){for(const[t,{seriesTypes:i}]of(0,s.jO)(rC)){const s=ea.get(t);for(const t of i)e[t]??(e[t]=Bt(s))}return e}getDefaults(){const t=(t,i)=>{const s={},r={axes:{},...qo.getThemeTemplates(),...this.getChartDefaults(),...ea.get(t)};for(const t of i){s[t]=N(ta.getThemeTemplate(t),s[t]??Bt(r));const{axes:i}=s[t];for(const t of jo.keys())i[t]=N(i[t],jo.getThemeTemplate(t),e.axisDefault[t])}return s};return N(t("cartesian",Qo.cartesianTypes),t("polar",Qo.polarTypes),t("hierarchy",Qo.hierarchyTypes),t("topology",Qo.topologyTypes),t("flow-proportion",Qo.flowProportionTypes),t("standalone",Qo.standaloneTypes),t("gauge",Qo.gaugeTypes))}static applyTemplateTheme(e,t,i){if((0,s.cy)(e))for(let t=0;t<e.length;t++){const s=e[t];"symbol"==typeof s&&i?.has(s)&&(e[t]=i.get(s))}else for(const t of Object.keys(e)){const s=e[t];"symbol"==typeof s&&i?.has(s)&&(e[t]=i.get(s))}}templateTheme(t,i=!0){const s=i?Bt(t):t,r=this.getTemplateParameters();return Ht(s,e.applyTemplateTheme,void 0,void 0,r),s}getDefaultColors(){return e.getDefaultColors()}getPublicParameters(){return e.getDefaultPublicParameters()}getTemplateParameters(){const e=new Map;e.set(Du,!1),e.set(Iu,"#d9d9d9"),e.set(Ru,"#00000080"),e.set(Ku,"#aaa"),e.set(Pu,"block"),e.set(ku,"center"),e.set(Yu,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),e.set(ju,sC),e.set($u,Xf.BLUE),e.set(Xu,Xf.BLUE),e.set(qu,Xf.BLUE),e.set(Zu,sC),e.set(Qu,"#fafafa"),e.set(Ju,"#ddd"),e.set(ep,"#000"),e.set(tp,"#181d1f"),e.set(ip,"#e35c5c"),e.set(sp,"#e35c5c"),e.set(rp,"#fafafa"),e.set(np,"#ddd"),e.set(op,"#000"),e.set(ap,"top"),e.set(lp,!1);const t=this.getDefaultColors();return e.set(Lu,this.palette.up?.stroke??t.up.stroke),e.set(_u,this.palette.up?.fill??t.up.fill),e.set(Nu,this.palette.down?.stroke??t.down.stroke),e.set(Ou,this.palette.down?.fill??t.down.fill),e.set(Fu,this.palette.neutral?.stroke??t.neutral.stroke),e.set(Gu,this.palette.neutral?.fill??t.neutral.fill),e.set(Bu,this.palette.altUp?.stroke??t.up.stroke),e.set(Hu,this.palette.altUp?.fill??t.up.fill),e.set(Vu,this.palette.altDown?.stroke??t.down.stroke),e.set(Uu,this.palette.altDown?.fill??t.down.fill),e.set(zu,this.palette.altNeutral?.fill??t.altNeutral.fill),e.set(Wu,this.palette.altNeutral?.stroke??t.altNeutral.stroke),e}};pC.axisDefault={number:pC.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),log:pC.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),category:pC.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:lp},crosshair:{enabled:!1}},{title:!0,time:"off"}),"grouped-category":pC.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:Iu},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:"off"}),time:pC.getAxisDefaults({keys:[],gridLine:{enabled:lp},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"ordinal-time":pC.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:lp},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"unit-time":pC.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:lp},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:"modern"}),"angle-category":pC.getAxisDefaults({label:{spacing:5},gridLine:{enabled:lp},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!1,time:"off"}),"angle-number":pC.getAxisDefaults({label:{spacing:5},gridLine:{enabled:lp}},{title:!1,time:"off"}),"radius-category":pC.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:"off"}),"radius-number":pC.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!0,time:"off"})};var gC=pC,mC="#192232",fC={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},yC={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},vC=class extends gC{getDefaultColors(){return{fills:fC,fillsFallback:Object.values(fC),strokes:yC,sequentialColors:fp(fC),divergingColors:[fC.ORANGE,fC.YELLOW,fC.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[fC.GREEN,fC.YELLOW,fC.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:fC.GREEN,stroke:yC.GREEN},down:{fill:fC.RED,stroke:yC.RED},neutral:{fill:fC.GRAY,stroke:yC.GRAY},altUp:{fill:fC.BLUE,stroke:yC.BLUE},altDown:{fill:fC.ORANGE,stroke:yC.ORANGE},altNeutral:{fill:fC.GRAY,stroke:yC.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:mC,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Du,!0),e.set(ju,mC),e.set(Iu,"#7f8389"),e.set($u,fC.BLUE),e.set(qu,"#fff"),e.set(Xu,fC.BLUE),e.set(Zu,mC),e.set(Qu,"#28313e"),e.set(Ju,"#4b525d"),e.set(ep,"#fff"),e.set(tp,"#fff"),e.set(rp,"#28313e"),e.set(np,"#4b525d"),e.set(op,"#fff"),e}constructor(e){super(e)}},CC={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},bC={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},SC=class extends vC{getDefaultColors(){return{...super.getDefaultColors(),fills:{...CC},fillsFallback:Object.values({...CC}),strokes:{...bC},sequentialColors:fp(CC),divergingColors:[CC.GREEN,CC.BLUE,CC.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:CC.GREEN,stroke:bC.GREEN},down:{fill:CC.RED,stroke:bC.RED},neutral:{fill:CC.BLUE,stroke:bC.BLUE},altUp:{fill:CC.GREEN,stroke:bC.GREEN},altDown:{fill:CC.RED,stroke:bC.RED},altNeutral:{fill:CC.GRAY,stroke:bC.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,CC.BLUE),e.set(Xu,CC.BLUE),e.set(Pu,"overlay"),e.set(ku,"left"),e.set(ap,"bottom"),e.set(lp,!0),e}},wC={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},xC={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},EC=class extends gC{getDefaultColors(){return{...super.getDefaultColors(),fills:{...wC},fillsFallback:Object.values({...wC}),strokes:{...xC},sequentialColors:fp(wC),divergingColors:[wC.GREEN,wC.BLUE,wC.RED],up:{fill:wC.GREEN,stroke:xC.GREEN},down:{fill:wC.RED,stroke:xC.RED},neutral:{fill:wC.BLUE,stroke:xC.BLUE},altUp:{fill:wC.GREEN,stroke:xC.GREEN},altDown:{fill:wC.RED,stroke:xC.RED},altNeutral:{fill:wC.GRAY,stroke:xC.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,wC.BLUE),e.set(Xu,wC.BLUE),e.set(Pu,"overlay"),e.set(ku,"left"),e.set(ap,"bottom"),e.set(lp,!0),e}},MC={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},AC={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},TC=class extends vC{getDefaultColors(){return{...super.getDefaultColors(),fills:MC,fillsFallback:Object.values(MC),strokes:AC,sequentialColors:fp(MC),divergingColors:[MC.ORANGE,MC.YELLOW,MC.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[MC.GREEN,MC.YELLOW,MC.RED],up:{fill:MC.GREEN,stroke:AC.GREEN},down:{fill:MC.RED,stroke:AC.RED},neutral:{fill:MC.GRAY,stroke:AC.GRAY},altUp:{fill:MC.BLUE,stroke:AC.BLUE},altDown:{fill:MC.RED,stroke:AC.RED},altNeutral:{fill:MC.GRAY,stroke:AC.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,MC.BLUE),e.set(Xu,MC.BLUE),e}},DC={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},IC={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},RC=class extends gC{getDefaultColors(){return{...super.getDefaultColors(),fills:DC,fillsFallback:Object.values(DC),strokes:IC,sequentialColors:fp(DC),divergingColors:[DC.ORANGE,DC.YELLOW,DC.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[DC.GREEN,DC.YELLOW,DC.RED],up:{fill:DC.GREEN,stroke:IC.GREEN},down:{fill:DC.RED,stroke:IC.RED},neutral:{fill:DC.GRAY,stroke:IC.GRAY},altUp:{fill:DC.BLUE,stroke:IC.BLUE},altDown:{fill:DC.RED,stroke:IC.RED},altNeutral:{fill:DC.GRAY,stroke:IC.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,DC.BLUE),e.set(Xu,DC.BLUE),e}},PC={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},kC={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},LC=class extends vC{getDefaultColors(){return{fills:PC,fillsFallback:Object.values(PC),strokes:kC,sequentialColors:fp(PC),divergingColors:[PC.BLUE,PC.RED],hierarchyColors:[],secondSequentialColors:[PC.BLUE,PC.PURPLE,PC.MAGENTA,PC.PINK,PC.RED,PC.ORANGE,PC.YELLOW,PC.GREEN],secondDivergingColors:[PC.BLUE,PC.RED],secondHierarchyColors:[],up:{fill:PC.GREEN,stroke:kC.GREEN},down:{fill:PC.RED,stroke:kC.RED},neutral:{fill:PC.GRAY,stroke:kC.GRAY},altUp:{fill:PC.BLUE,stroke:kC.BLUE},altDown:{fill:PC.RED,stroke:kC.RED},altNeutral:{fill:PC.GRAY,stroke:kC.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,PC.BLUE),e.set(Xu,PC.BLUE),e}},NC={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},_C={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},OC=class extends gC{getDefaultColors(){return{...super.getDefaultColors(),fills:NC,fillsFallback:Object.values(NC),strokes:_C,sequentialColors:fp(NC),divergingColors:[NC.BLUE,NC.RED],hierarchyColors:[],secondSequentialColors:[NC.BLUE,NC.PURPLE,NC.MAGENTA,NC.PINK,NC.RED,NC.ORANGE,NC.YELLOW,NC.GREEN],secondDivergingColors:[NC.BLUE,NC.RED],secondHierarchyColors:[],up:{fill:NC.GREEN,stroke:_C.GREEN},down:{fill:NC.RED,stroke:_C.RED},neutral:{fill:NC.GRAY,stroke:_C.GRAY},altUp:{fill:NC.BLUE,stroke:_C.BLUE},altDown:{fill:NC.RED,stroke:_C.RED},altNeutral:{fill:NC.GRAY,stroke:_C.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,NC.BLUE),e.set(Xu,NC.BLUE),e}},FC={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},GC={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},BC=class extends vC{getDefaultColors(){return{...super.getDefaultColors(),fills:{...FC,RED:FC.ORANGE},fillsFallback:Object.values({...FC,RED:FC.ORANGE}),strokes:{...GC,RED:GC.ORANGE},sequentialColors:fp({...FC,RED:FC.ORANGE}),divergingColors:[FC.ORANGE,FC.YELLOW,FC.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[FC.GREEN,FC.YELLOW,FC.ORANGE],up:{fill:FC.GREEN,stroke:GC.GREEN},down:{fill:FC.ORANGE,stroke:GC.ORANGE},neutral:{fill:FC.GRAY,stroke:GC.GRAY},altUp:{fill:FC.BLUE,stroke:GC.BLUE},altDown:{fill:FC.ORANGE,stroke:GC.ORANGE},altNeutral:{fill:FC.GRAY,stroke:GC.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,FC.BLUE),e.set(Xu,FC.BLUE),e}},VC={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},HC={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},UC=class extends gC{getDefaultColors(){return{...super.getDefaultColors(),fills:{...VC,RED:VC.ORANGE},fillsFallback:Object.values({...VC,RED:VC.ORANGE}),strokes:{...HC,RED:HC.ORANGE},sequentialColors:fp({...VC,RED:VC.ORANGE}),divergingColors:[VC.ORANGE,VC.YELLOW,VC.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[VC.GREEN,VC.YELLOW,VC.ORANGE],secondHierarchyColors:[],up:{fill:VC.GREEN,stroke:HC.GREEN},down:{fill:VC.ORANGE,stroke:HC.ORANGE},neutral:{fill:HC.GRAY,stroke:HC.GRAY},altUp:{fill:VC.BLUE,stroke:HC.BLUE},altDown:{fill:VC.ORANGE,stroke:HC.ORANGE},altNeutral:{fill:VC.GRAY,stroke:HC.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,VC.BLUE),e.set(Xu,VC.BLUE),e}},zC={...am,type:(0,s.mw)((0,s.dY)("ordinal-time")),paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,label:sm,parentLevel:nm,interval:cm((0,s.or)(s.ai,s.p6),!0).interval,crosshair:lm(!0)},WC={...om,...cm(s.ai),type:(0,s.mw)((0,s.dY)("angle-number")),crossLines:(0,s.J$)(Qg),startAngle:s.ai,endAngle:s.ai,label:{...em,orientation:(0,s.KC)("fixed","parallel","perpendicular"),format:Xg}},jC={innerRadiusRatio:s.CG},KC={...om,...jC,type:(0,s.mw)((0,s.dY)("angle-category")),shape:(0,s.KC)("polygon","circle"),crossLines:(0,s.J$)(Qg),startAngle:s.ai,endAngle:s.ai,paddingInner:s.CG,groupPaddingInner:s.CG,label:{...em,orientation:(0,s.KC)("fixed","parallel","perpendicular")}},$C={...om,...cm(s.ai),type:(0,s.mw)((0,s.dY)("radius-number")),shape:(0,s.KC)("polygon","circle"),positionAngle:s.ai,innerRadiusRatio:s.CG,crossLines:(0,s.J$)({...Qg,label:{...Zg,positionAngle:s.ai}},"cross-line options"),title:{enabled:s.zM,text:s.Yj,spacing:s.Ly,formatter:s.E2,...s.LV},label:{...em,format:Xg}},YC={...om,type:(0,s.mw)((0,s.dY)("radius-category")),positionAngle:s.ai,innerRadiusRatio:s.CG,paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,label:em,crossLines:(0,s.J$)({...Qg,label:{...Zg,positionAngle:s.ai}},"cross-line options"),title:{enabled:s.zM,text:s.Yj,spacing:s.Ly,formatter:s.E2,...s.LV}},qC={lineStyle:(0,s.KC)("solid","dashed","dotted"),...s.mL},XC={...s.Fu,...s.AF,...s.mL},ZC={visible:s.zM,locked:s.zM,handle:XC,...s.LV},QC={position:(0,s.KC)("top","center","bottom"),alignment:(0,s.KC)("left","center","right"),...s.LV},JC={position:(0,s.KC)("top","inside","bottom"),alignment:(0,s.KC)("left","center","right"),...s.LV},eb={enabled:s.zM,cornerRadius:s.Ly,formatter:s.E2,...s.LV,...s.Fu,...s.AF,...s.mL},tb={visible:s.zM,...qC,...s.AF},ib={divider:s.AF,...s.Fu,...s.AF,...s.LV},sb={handle:XC,statistics:ib,...qC,...s.Fu,...s.AF},rb={visible:s.zM,locked:s.zM,extendStart:s.zM,extendEnd:s.zM,handle:XC,text:QC,...qC,...s.AF},nb={visible:s.zM,locked:s.zM,axisLabel:eb,handle:XC,text:QC,...qC,...s.AF},ob={visible:s.zM,locked:s.zM,extendStart:s.zM,extendEnd:s.zM,handle:XC,text:JC,background:s.Fu,...qC,...s.AF},ab={...ob},lb={...ob,middle:tb},cb={label:s.LV,showFill:s.zM,isMultiColor:s.zM,strokes:(0,s.jk)(s.yW),rangeStroke:s.yW,bands:(0,s.KC)(4,6,10),...rb},hb={...s.Fu,...s.AF,...ZC},db={...s.Fu,...s.AF,...ZC},ub={...s.Fu,...s.AF,...ZC,background:{...s.Fu,...s.AF}},pb={visible:s.zM,locked:s.zM,handle:XC,...s.Fu},gb={visible:s.zM,locked:s.zM,extendStart:s.zM,extendEnd:s.zM,handle:XC,text:QC,background:s.Fu,statistics:ib,...qC,...s.AF},mb={visible:s.zM,up:sb,down:sb},fb={enabled:s.zM,axesButtons:{enabled:s.zM,axes:(0,s.KC)("x","y","xy")},toolbar:{enabled:s.zM,padding:s.Ly,buttons:(0,s.J$)({...Em,value:(0,s.KC)("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:s.zM,buttons:(0,s.jk)((0,s.or)((0,s.fd)({...Em,value:(0,s.mw)((0,s.KC)("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),(0,s.fd)({...Em,value:(0,s.mw)((0,s.KC)("lock")),checkedOverrides:Em})))}};fb.data=(0,s._L)(s.YO),fb.xKey=(0,s._L)(s.Yj),fb.volumeKey=(0,s._L)(s.Yj),fb.snap=(0,s._L)(s.zM);var yb={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly,whisker:{...s.AF,...s.mL},cap:{lengthRatio:s.CG}}),whisker:{...s.AF,...s.mL},cap:{lengthRatio:s.CG},tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL},vb={cornerRadius:s.Ly,wick:{...s.AF,...s.mL},...s.Fu,...s.AF,...s.mL},Cb={item:{up:vb,down:vb},itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly,wick:{...s.AF,...s.mL}}),showInMiniChart:s.zM,tooltip:Lm,...Am},bb={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),label:{spacing:s.Ly,maxWidth:s.Ly,...Im},link:{tension:s.CG,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,tension:s.CG}),...s.Fu,...s.AF,...s.mL},node:{width:s.Ly,spacing:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),...s.Fu,...s.AF,...s.mL},tooltip:Lm,...Am},Sb={direction:(0,s.KC)("horizontal","vertical"),fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),showInMiniChart:s.zM,label:{spacing:s.Ly,placement:(0,s.KC)("before","middle","after"),...Im},stageLabel:{rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,placement:(0,s.KC)("before","after"),avoidCollisions:s.zM,itemStyler:(0,s.YI)({...s.LV,spacing:s.ai}),format:s.Yj,...Im},tooltip:Lm,...Am,...G(s.Fu,["fill"]),...G(s.AF,["stroke"]),...s.mL},wb={direction:(0,s.KC)("horizontal","vertical"),fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),showInMiniChart:s.zM,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),spacingRatio:s.CG,crisp:s.zM,dropOff:{enabled:s.zM,...s.Fu,...s.AF,...s.mL},stageLabel:{rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,placement:(0,s.KC)("before","after"),avoidCollisions:s.zM,itemStyler:(0,s.YI)({...s.LV,spacing:s.ai}),format:s.Yj,...Im},label:Im,tooltip:Lm,shadow:Nm,...Am,...G(s.Fu,["fill"]),...G(s.AF,["stroke"]),...s.mL},xb={title:s.Yj,textAlign:(0,s.KC)("left","center","right"),verticalAlign:(0,s.KC)("top","middle","bottom"),itemPadding:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF}),showInMiniChart:s.zM,label:Rm,tooltip:Lm,...Am,...s.AF},Eb={showInMiniChart:s.zM,itemStyler:(0,s.YI)({...s.AF,...s.mL}),item:{up:{...s.AF,...s.mL},down:{...s.AF,...s.mL}},tooltip:Lm,...Am},Mb={maxStrokeWidth:s.Ly,itemStyler:(0,s.YI)({...s.AF,...s.mL}),sizeDomain:(0,s.jk)(s.Ly),label:Im,tooltip:Lm,...Am,...s.AF,...s.mL,highlightStyle:{...Am.highlightStyle,...s.AF}},Ab={...s.AF,...s.mL},Tb={colorRange:(0,s.jk)(s.yW),maxSize:s.Ly,sizeDomain:(0,s.jk)(s.Ly),label:{placement:(0,s.KC)("top","bottom","left","right"),...Im},tooltip:Lm,...Am,...G(Dm,["enabled"]),highlightStyle:{...Am.highlightStyle,...s.Fu,...s.AF}},Db={colorRange:(0,s.jk)(s.yW),padding:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),label:Rm,tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL,highlightStyle:{...Am.highlightStyle,...s.Fu,...s.AF}},Ib={...Am,...s.Fu,...s.AF,...s.mL},Rb={cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:Im,tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL},Pb={direction:(0,s.KC)("horizontal","vertical"),aspectRatio:s.Ly,spacing:s.Ly,reverse:s.zM,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),label:Im,stageLabel:{spacing:s.Ly,placement:(0,s.KC)("before","after"),...Im},tooltip:Lm,shadow:Nm,...Am,...G(s.Fu,["fill"]),...G(s.AF,["stroke"]),...s.mL},kb={connectMissingData:s.zM,marker:Dm,label:Im,tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL},Lb={connectMissingData:s.zM,marker:Dm,label:Im,tooltip:Lm,...Am,...s.AF,...s.mL},Nb={cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:Im,tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL},_b={cornerRadius:s.Ly,columnWidthRatio:s.CG,maxColumnWidthRatio:s.CG,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:Im,tooltip:Lm,...Am,...s.Fu,...s.AF,...s.mL},Ob={showInMiniChart:s.zM,connectMissingData:s.zM,interpolation:_m,label:{...Im,padding:s.Ly,placement:(0,s.KC)("inside","outside")},marker:Dm,tooltip:Lm,shadow:Nm,...Am,...s.Fu,...s.AF,...s.mL},Fb={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:{...Im,padding:s.Ly,placement:(0,s.KC)("inside","outside")},tooltip:Lm,shadow:Nm,...Am,...s.Fu,...s.AF,...s.mL},Gb={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),label:{...Im,spacing:s.Ly},link:{itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),...s.Fu,...s.AF,...s.mL},node:{width:s.Ly,spacing:s.Ly,alignment:(0,s.KC)("left","center","right","justify"),itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),...s.Fu,...s.AF,...s.mL},tooltip:Lm,...Am},Bb={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),colorRange:(0,s.jk)(s.yW),sectorSpacing:s.Ly,cornerRadius:s.Ly,padding:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF}),label:{spacing:s.Ly,...Rm},secondaryLabel:Rm,tooltip:Lm,...Am,...G(s.Fu,["fill"]),...G(s.AF,["stroke"]),highlightStyle:{label:{color:s.yW},secondaryLabel:{color:s.yW},...s.Fu,...s.AF}},Vb={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),colorRange:(0,s.jk)(s.yW),itemStyler:(0,s.YI)({...s.Fu,...s.AF}),group:{gap:s.Ly,padding:s.Ly,cornerRadius:s.Ly,textAlign:(0,s.KC)("left","center","right"),interactive:s.zM,label:{...Im,spacing:s.Ly},...s.Fu,...s.AF},tile:{gap:s.Ly,padding:s.Ly,cornerRadius:s.Ly,textAlign:(0,s.KC)("left","center","right"),verticalAlign:(0,s.KC)("top","middle","bottom"),label:{...Im,spacing:s.Ly,lineHeight:s.Ly,minimumFontSize:s.Ly,wrapping:(0,s.KC)("never","always","hyphenate","on-space"),overflowStrategy:(0,s.KC)("ellipsis","hide")},secondaryLabel:{...Im,lineHeight:s.Ly,minimumFontSize:s.Ly,wrapping:(0,s.KC)("never","always","hyphenate","on-space"),overflowStrategy:(0,s.KC)("ellipsis","hide")},...s.Fu,...s.AF},tooltip:Lm,...Am,highlightStyle:{group:{label:{color:s.yW},...s.Fu,...s.AF},tile:{label:{color:s.yW},secondaryLabel:{color:s.yW},...s.Fu,...s.AF}}},Hb={name:s.Yj,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:{...Im,padding:s.Ly,placement:(0,s.KC)("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:Lm,shadow:Nm,...s.Fu,...s.AF,...s.mL},Ub={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,item:{positive:Hb,negative:Hb,total:Hb},line:{enabled:s.zM,...s.AF,...s.mL},tooltip:Lm,...Am},zb=(0,s.fd)({__type:(0,s.mw)((0,s.dY)("date")),value:(0,s.or)(s.Yj,s.ai)},"a serializable date object"),Wb={width:s.Ly,height:s.Ly,grip:s.zM,fill:s.yW,stroke:s.yW,strokeWidth:s.Ly,cornerRadius:s.Ly},jb={enabled:s.zM,height:s.Ly,spacing:s.Ly,cornerRadius:s.ai,mask:{fill:s.yW,fillOpacity:s.CG,stroke:s.yW,strokeWidth:s.Ly},minHandle:Wb,maxHandle:Wb,miniChart:{enabled:s.zM,padding:{top:s.Ly,bottom:s.Ly},label:{enabled:s.zM,avoidCollisions:s.zM,spacing:s.Ly,format:Xg,formatter:s.E2,interval:{minSpacing:s.Ly,maxSpacing:s.Ly,values:s.YO,step:s.ai},...s.LV},series:s.sw}},Kb={number:{...G(Kv,["type","crossLines"]),top:G(Kv,["type","crossLines","position"]),right:G(Kv,["type","crossLines","position"]),bottom:G(Kv,["type","crossLines","position"]),left:G(Kv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},log:{...G($v,["type","crossLines"]),top:G($v,["type","crossLines","position"]),right:G($v,["type","crossLines","position"]),bottom:G($v,["type","crossLines","position"]),left:G($v,["type","crossLines","position"]),crossLines:G(Jg,["type"])},category:{...G(qv,["type","crossLines"]),top:G(qv,["type","crossLines","position"]),right:G(qv,["type","crossLines","position"]),bottom:G(qv,["type","crossLines","position"]),left:G(qv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},time:{...G(Yv,["type","crossLines"]),top:G(Yv,["type","crossLines","position"]),right:G(Yv,["type","crossLines","position"]),bottom:G(Yv,["type","crossLines","position"]),left:G(Yv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},"grouped-category":{...G(Xv,["type"]),top:G(Xv,["type","position"]),right:G(Xv,["type","position"]),bottom:G(Xv,["type","position"]),left:G(Xv,["type","position"]),crossLines:G(Jg,["type"])},"unit-time":{...G(Zv,["type","crossLines"]),top:G(Zv,["type","crossLines","position"]),right:G(Zv,["type","crossLines","position"]),bottom:G(Zv,["type","crossLines","position"]),left:G(Zv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},"ordinal-time":{...G(zC,["type","crossLines"]),top:G(zC,["type","crossLines","position"]),right:G(zC,["type","crossLines","position"]),bottom:G(zC,["type","crossLines","position"]),left:G(zC,["type","crossLines","position"]),crossLines:G(Jg,["type"])}},$b={"angle-category":{...G(KC,["type","crossLines"]),crossLines:G(Qg,["type"])},"angle-number":{...G(WC,["type","crossLines"]),crossLines:G(Qg,["type"])},"radius-category":{...G(YC,["type","crossLines"]),crossLines:{...G(Qg,["type"]),label:{...Zg,positionAngle:s.ai}}},"radius-number":{...G($C,["type","crossLines"]),crossLines:{...G(Qg,["type"]),label:{...Zg,positionAngle:s.ai}}}},Yb={visible:s.zM};function qb(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var Xb=qb({common:{...Mm,navigator:jb,axes:{...Kb,...$b},annotations:{...fb,line:rb,"horizontal-line":nb,"vertical-line":nb,"disjoint-channel":ab,"parallel-channel":lb,"fibonacci-retracement":cb,"fibonacci-retracement-trend-based":cb,callout:hb,comment:db,note:ub,text:ZC,arrow:rb,"arrow-up":pb,"arrow-down":pb,"date-range":gb,"price-range":gb,"date-price-range":gb,"quick-date-price-range":mb},chartToolbar:{enabled:s.zM},initialState:{legend:(0,s.J$)({visible:s.zM,seriesId:s.Yj,itemId:s.Yj,legendItemName:s.Yj},"legend state array"),zoom:{rangeX:{start:(0,s.or)(s.ai,zb),end:(0,s.or)(s.ai,zb)},rangeY:{start:(0,s.or)(s.ai,zb),end:(0,s.or)(s.ai,zb)},ratioX:{start:s.CG,end:s.CG},ratioY:{start:s.CG,end:s.CG},autoScaledAxes:(0,s.jk)((0,s.dY)("y"))}}},line:{...Mm,axes:Kb,series:Tf,navigator:jb,...Yb},scatter:{...Mm,axes:Kb,series:Nf,navigator:jb,...Yb},bubble:{...Mm,axes:Kb,series:mf,navigator:jb,...Yb},area:{...Mm,axes:Kb,series:Om,navigator:jb,...Yb},bar:{...Mm,axes:Kb,series:of,navigator:jb,...Yb},"box-plot":{...Mm,axes:Kb,series:yb,navigator:jb,...Yb},candlestick:{...Mm,axes:Kb,series:Cb,navigator:jb,...Yb},"cone-funnel":{...Mm,axes:Kb,series:Sb,navigator:jb,...Yb},funnel:{...Mm,axes:Kb,series:wb,navigator:jb,...Yb},ohlc:{...Mm,axes:Kb,series:Eb,navigator:jb,...Yb},histogram:{...Mm,axes:G(Kb,["category","grouped-category","ordinal-time","unit-time"]),series:Sf,navigator:jb,...Yb},heatmap:{...Mm,axes:Kb,series:xb,navigator:jb,...Yb},waterfall:{...Mm,axes:Kb,series:Ub,navigator:jb,...Yb},"range-bar":{...Mm,axes:Kb,series:Fb,navigator:jb,...Yb},"range-area":{...Mm,axes:Kb,series:Ob,navigator:jb,...Yb},donut:{...Mm,series:gy,navigator:jb,...Yb},pie:{...Mm,series:uy,navigator:jb,...Yb},"radar-line":{...Mm,axes:$b,series:Lb,navigator:jb,...Yb},"radar-area":{...Mm,axes:$b,series:kb,navigator:jb,...Yb},"radial-bar":{...Mm,axes:$b,series:Nb,navigator:jb,...Yb},"radial-column":{...Mm,axes:$b,series:_b,navigator:jb,...Yb},nightingale:{...Mm,axes:$b,series:Rb,navigator:jb,...Yb},sunburst:{...Mm,series:Bb,navigator:jb,...Yb},treemap:{...Mm,series:Vb,navigator:jb,...Yb},"map-shape":{...Mm,series:Db,navigator:jb,...Yb},"map-line":{...Mm,series:Mb,navigator:jb,...Yb},"map-marker":{...Mm,series:Tb,navigator:jb,...Yb},"map-shape-background":{...Mm,series:Ib,navigator:jb,...Yb},"map-line-background":{...Mm,series:Ab,navigator:jb,...Yb},sankey:{...Mm,series:Gb,navigator:jb,...Yb},chord:{...Mm,series:bb,navigator:jb,...Yb},pyramid:{...Mm,series:Pb,navigator:jb,...Yb},"radial-gauge":{...Mm,...Hy,targets:G(Gy,["value"]),tooltip:{...Hy.tooltip,...Mm.tooltip}},"linear-gauge":{...Mm,...By,targets:G(Fy,["value"]),tooltip:{...By.tooltip,...Mm.tooltip}}},function e(t,i){if((0,s.Bm)(i))return t;if((0,s.Tn)(t))return(0,s.or)(t,s.I_,s.Bm);if((0,s.Gv)(t))return(0,s.or)((0,s.fd)(s.ie in t?qb(t,t=>(0,s.Gv)(t)?qb(t,e):t):qb(t,e)),s.I_,s.Bm);throw new Error(`Invalid theme override value: ${String(t)}`)}),Zb={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Qb={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Jb=class extends vC{getDefaultColors(){return{fills:Zb,fillsFallback:Object.values(Zb),strokes:Qb,sequentialColors:fp(Zb),divergingColors:[Zb.ORANGE,Zb.YELLOW,Zb.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[Zb.GREEN,Zb.YELLOW,Zb.RED],secondHierarchyColors:[],up:{fill:Zb.GREEN,stroke:Qb.GREEN},down:{fill:Zb.RED,stroke:Qb.RED},neutral:{fill:Zb.GRAY,stroke:Qb.GRAY},altUp:{fill:Zb.BLUE,stroke:Qb.BLUE},altDown:{fill:Zb.ORANGE,stroke:Qb.ORANGE},altNeutral:{fill:Zb.GRAY,stroke:Qb.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,Zb.BLUE),e.set(Xu,Zb.BLUE),e}},eS={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},tS={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},iS=class extends gC{getDefaultColors(){return{...super.getDefaultColors(),fills:eS,fillsFallback:Object.values(eS),strokes:tS,sequentialColors:fp(eS),divergingColors:[eS.ORANGE,eS.YELLOW,eS.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[eS.GREEN,eS.YELLOW,eS.RED],secondHierarchyColors:[],up:{fill:eS.GREEN,stroke:tS.GREEN},down:{fill:eS.RED,stroke:tS.RED},neutral:{fill:eS.GRAY,stroke:tS.GRAY},altUp:{fill:eS.BLUE,stroke:tS.BLUE},altDown:{fill:eS.ORANGE,stroke:tS.ORANGE},altNeutral:{fill:eS.GRAY,stroke:tS.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set($u,eS.BLUE),e.set(Xu,eS.BLUE),e}},sS=kh(()=>new gC),rS=v.create(!0,"perf"),nS=(e,t,i)=>{rS("[CACHE] ChartTheme",e,t.name,i)},oS={"ag-default-dark":kh(()=>new vC),"ag-sheets-dark":kh(()=>new BC,nS),"ag-polychroma-dark":kh(()=>new LC,nS),"ag-vivid-dark":kh(()=>new Jb,nS),"ag-material-dark":kh(()=>new TC,nS),"ag-financial-dark":kh(()=>new SC,nS),"ag-default":sS,"ag-sheets":kh(()=>new UC,nS),"ag-polychroma":kh(()=>new OC,nS),"ag-vivid":kh(()=>new iS,nS),"ag-material":kh(()=>new RC,nS),"ag-financial":kh(()=>new EC,nS)},aS=kh(function(e){if(e instanceof gC)return e;if(!function(e){const{invalid:t}=(0,s.tf)({theme:e},{theme:(0,s.or)(cS,s.Ik)});for(const e of t)s.Vy.warnOnce(String(e));return 0===t.length}(e))return sS();if(null==e||"string"==typeof e){const t=oS[e??"ag-default"];if(t)return t();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=(0,s.tf)(function(e){if(!(0,s.Gv)(e)||!(0,s.Gv)(e.baseTheme))return e;let t,i,r=e;const n=[];for(;"object"==typeof r;)t??(t=r.palette),i??(i=r.params),r.overrides&&n.push(r.overrides),r=r.baseTheme;return{baseTheme:r,overrides:N(...n),params:i,palette:t}}(e),lS,"theme");for(const e of i)s.Vy.warnOnce(String(e));const r=t?.baseTheme?aS(t.baseTheme):sS();return t?new r.constructor(t):r},nS),lS={baseTheme:(0,s.or)(s.Yj,s.Ik),overrides:Xb,params:{accentColor:s.yW,axisColor:s.yW,backgroundColor:s.yW,borderColor:s.yW,foregroundColor:s.yW,fontFamily:s.jj,fontSize:s.ai,fontWeight:(0,s.or)(s.Yj,s.ai),gridLineColor:s.yW,padding:s.ai,subtleTextColor:s.yW,textColor:s.yW,chromeBackgroundColor:s.yW,chromeFontFamily:s.jj,chromeFontSize:s.ai,chromeFontWeight:(0,s.or)(s.Yj,s.ai),chromeSubtleTextColor:s.yW,chromeTextColor:s.yW,inputBackgroundColor:s.yW,inputTextColor:s.yW,crosshairLabelBackgroundColor:s.yW,crosshairLabelTextColor:s.yW},palette:{fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),up:{fill:(0,s.or)(s.yW,s.MP),stroke:s.yW},down:{fill:(0,s.or)(s.yW,s.MP),stroke:s.yW},neutral:{fill:(0,s.or)(s.yW,s.MP),stroke:s.yW}}},cS=(0,s.KC)("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark"),hS=e=>`'${e}'`,dS=class e{constructor(t,i,s,r,n,o,a=!1){this.themeParameters={},this.optionMetadata=n??{},this.processedOverrides=s??{};let l,c,h,d,u,p,g,m=null;t instanceof e?(m=t,this.specialOverrides=m.specialOverrides,void 0===o&&(o=Ft(m.userOptions,i,e.JSON_DIFF_OPTS)),this.userOptions=Bt(_(o,m.userOptions),{...e.OPTIONS_CLONE_OPTS,seen:[]})):(this.userOptions=Bt(t??i,{...e.OPTIONS_CLONE_OPTS,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...r})),a&&this.removeLeftoverSymbols(this.userOptions),!a&&void 0!==o&&e.isFastPathDelta(o)&&null!=m?(({activeTheme:l,processedOptions:c,defaultAxes:h,fastDelta:d}=this.fastSetup(o,m)),u=m.themeParameters,p=m.annotationThemes):(e.perfDebug("ChartOptions.slowSetup()"),({activeTheme:l,processedOptions:c,defaultAxes:h,themeParameters:u,annotationThemes:p,googleFonts:g}=this.slowSetup(s,o,a))),this.activeTheme=l,this.processedOptions=c,this.defaultAxes=h,this.fastDelta=d??void 0,this.themeParameters=u,this.annotationThemes=p,this.googleFonts=g,v.inDevelopmentMode(()=>z(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return e.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return e.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(t,i){const{activeTheme:r,defaultAxes:n,processedOptions:o}=i,{presetType:a}=this.optionMetadata;if(null!=a&&null!=t?.data){const e=s.sy.getPresetModule(a);if(e?.processData){const{series:i,data:s}=e.processData(t.data);t=N({series:i,data:s},t)}}this.fastSeriesSetup(t,o);const l=N(t,o);return e.debug("ChartOptions.fastSetup() - processed options",l),{activeTheme:r,defaultAxes:n,processedOptions:l,fastDelta:t}}fastSeriesSetup(e,t){e?.series&&(e.series?.every((e,i)=>Gt(e,t.series?.[i]??{}))?delete e.series:e.series=e.series.map((e,i)=>_(e,t.series?.[i]??{})))}slowSetup(t,i,r=!1){let n=Bt(this.userOptions,e.OPTIONS_CLONE_OPTS);i&&(n=N(i,n),r&&this.removeLeftoverSymbols(n));const{presetType:o}=this.optionMetadata;if(null!=o){const t=s.sy.getPresetModule(o);if(t){const{validate:i=s.tf}=t,r=n,o=n.type,a=null!=o?aS(n.theme).presets[o]:void 0,{cleared:l,invalid:c}=i(r,t.options,"");c.forEach(e=>s.Vy.warn(e)),(0,s.eh)(c,"")?n={}:(e.debug(">>> AgCharts.createOrUpdate() - applying preset",l),n=t.create(l,a,()=>this.activeTheme))}}this.soloSeriesIntegrity(n),eC.isEnterprise||tC(n);const a=aS(n.theme);if(null!=o&&a.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=s.sy.detectChartDefinition(n),!this.chartDef.placeholder){const{validate:e=s.tf}=this.chartDef,{cleared:t,invalid:i}=e(n,this.chartDef.options,"");i.forEach(e=>s.Vy.warn(e)),n=t}this.validateAxesOptions(n),this.removeDisabledOptions(n);const l=this.optionsType(n),{annotations:h={},axes:d={},series:u,...p}=this.getSeriesThemeConfig(l,a),[g,m]=this.splitAnnotationsOptions(h),f=Bt(m),y=this.getDefaultAxes(n,u);let v=N(t,n,g,p,y);this.processAxesOptions(v,d),this.processSeriesOptions(v,a),v=Bt(v,e.OPTIONS_CLONE_OPTS),(Ql(v)||sc(v)||function(e){const t=Zl(e);return Jl(e)&&"pie"!==t&&"donut"!==t}(v))&&null==v.legend?.enabled&&(v.legend??(v.legend={}),v.legend.enabled=v.series.length>1),this.enableConfiguredOptions(v,n);let C=this.processFonts(v);const b=a.params;return C=this.processFonts(b,C),b.__palette=Bt(a.palette),b.__palette.type=(0,s.Gv)(n.theme)?iC(n.theme?.palette):"inbuilt",this.resolveThemeOperations(b,b),this.resolveThemeOperations(b,v),this.resolveThemeOperations(b,f),a.templateTheme(v,!1),function(e){const t="mode"in e&&"integrated"===e.mode;for(const i of c.byType("root","legend")){const s=e[i.optionsKey],r=null!=s&&!1===s.enabled,n=!("removable"in i)||!0===i.removable||"standalone-only"===i.removable&&!t;r&&n&&delete e[i.optionsKey]}}(v),eC.isEnterprise||tC(v,!0),this.validateSeriesOptions(v),this.validateAxesOptions(v),this.validatePluginOptions(v),this.processMiniChartSeriesOptions(v),v.loadGoogleFonts||C.clear(),e.debug(()=>["ChartOptions.slowSetup() - processed options",Bt(v)]),{activeTheme:a,processedOptions:v,defaultAxes:y,themeParameters:b,annotationThemes:f,googleFonts:C}}validatePluginOptions(e){for(const t of s.sy.listModulesByType(s.nR.Plugin)){const i=t.name;if(i in e&&(!t.chartType||t.chartType===this.chartDef?.name)){const{cleared:r,invalid:n}=(0,s.tf)(e[i],t.options,t.name);n.forEach(e=>s.Vy.warn(e)),e[i]=r}}}validateSeriesOptions(e){const t=this.chartDef?.name,i=[],r=e.series?.length??0;let n;for(let o=0;o<r;o++){const r=`series[${o}]`,a=e.series[o],l=s.sy.getSeriesModule(a.type??"line");if(null==l){n??(n=(0,s.lp)(Array.from(s.sy.listModulesByType(s.nR.Series)).filter(e=>!t||e.chartType===t).map(e=>e.name),"or",hS)),s.Vy.warn(`Unknown type \`${a.type}\` at \`${r}.type\`; expecting ${n}, ignoring.`);continue}if(t&&l.chartType!==t){s.Vy.warn(`Series type \`${l.name}\` at \`${r}.type\` is not supported by chart type \`${t}\`, ignoring.`);continue}const{validate:c=s.tf}=l,{cleared:h,invalid:d}=c(a,l.options,r);d.forEach(e=>s.Vy.warn(e)),(0,s.eh)(d,r)||i.push(h)}e.series=i}validateAxesOptions(e){if(!("axes"in e)||!e.axes)return;const t=this.chartDef?.name,i=[],r=e.axes.length??0;let n;for(let o=0;o<r;o++){const r=`axes[${o}]`;let a=e.axes[o];"time"===a.type&&null!=a.unit&&(a={...a,type:"unit-time"});const l=s.sy.getAxisModule(a.type);if(null==l){n??(n=(0,s.lp)(Array.from(s.sy.listModulesByType(s.nR.Axis)).filter(e=>e.chartType===t).map(e=>e.name),"or",hS)),s.Vy.warn(`Unknown type \`${a.type}\` at  \`${r}.type\`; expecting one of ${n}, ignoring all axes options.`),delete e.axes;break}if(l.chartType!==t){s.Vy.warn(`Axis type \`${l.name}\` at  \`${r}.type\` is not supported by chart type \`${t}\`, ignoring.`);break}const{validate:c=s.tf}=l,{cleared:h,invalid:d}=c(a,l.options,r);d.forEach(e=>s.Vy.warn(e)),(0,s.eh)(d,r)||i.push(h)}e.axes=i}diffOptions(t){return this===t?{}:null==t?this.processedOptions:this.fastDelta??Ft(t.processedOptions,this.processedOptions,e.JSON_DIFF_OPTS)}getSeriesThemeConfig(e,t){return t?.config[e]??{}}getDefaultAxes(e,t){const i=this.optionsType(e),s=e.series?.find(e=>(e.type??"line")===i)??{},r=ta.cloneDefaultAxes(i);return Wt(r,{},void 0,N(s,t)),r}optionsType(e){return e.series?.[0]?.type??"line"}splitAnnotationsOptions(e){const{axesButtons:t=null,enabled:i=null,optionsToolbar:s=null,toolbar:r=null,...n}=e;return null==t&&null==i&&null==s&&null==r?[{},n]:[{annotations:{axesButtons:t,enabled:i,optionsToolbar:s,toolbar:r}},n]}processAxesOptions(e,t){"axes"in e&&(e.axes=e.axes?.map(e=>{const{crossLines:i,...s}=N(t[e.type]?.[e.position],t[e.type]);e.crossLines&&(e.crossLines=O(e.crossLines,i));const r=s.gridLine?.style;e.gridLine?.style&&r?.length&&(e.gridLine.style=e.gridLine.style.map((e,t)=>null!=e.stroke||null!=e.lineDash?N(e,r.at(t%r.length)):e));const{top:n,right:o,bottom:a,left:l,...c}=N(e,s);return c}))}processSeriesOptions(e,t){const i=this.getTooltipPositionDefaults(e),r=e.series?.map(r=>{r.type??(r.type="line");const{innerLabels:n,...o}=this.getSeriesThemeConfig(r.type,t).series??{},a=s.sy.getSeriesModule(r.type),l=Boolean(a?.options.tooltip),c=Boolean(a?.options.visible),h=l&&this.getTooltipRangeDefaults(e,r.type),d=N(this.getSeriesGroupingOptions(r),r,l&&i,h,o,c&&{visible:!0});return d.innerLabels&&(d.innerLabels=O(d.innerLabels,n)),d});e.series=this.setSeriesGroupingOptions(r??[])}processMiniChartSeriesOptions(e){let t=e.navigator?.miniChart?.series;null!=t&&(t=t.map(e=>(e.type??(e.type="line"),e)),e.navigator.miniChart.series=this.setSeriesGroupingOptions(t))}resolveThemeOperations(t,i){const s=Wt(i,t,new Set(["palette","data","theme"]));e.debug("ChartOptions.resolveTheme()",s)}getSeriesGroupingOptions(e){const t=ta.isGroupable(e.type),i=ta.isStackable(e.type),r=ta.isStackedByDefault(e.type);e.grouped&&!t&&s.Vy.warnOnce(`unsupported grouping of series type "${e.type}".`),!e.stacked&&!e.stackGroup||i||s.Vy.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:n,stacked:o}=e;return o??(o=(r||null!=e.stackGroup)&&!(t&&n)),n??(n=!0),{stacked:i&&o,grouped:t&&n&&!(i&&o)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);e.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},r=i.reduce((e,t)=>{var i;return"default"===t.groupType||(e[i=t.seriesType]??(e[i]=0),e[t.seriesType]+="stack"===t.groupType?1:t.series.length),e},{});return i.flatMap(e=>{var t;switch(s[t=e.seriesType]??(s[t]=0),e.groupType){case"stack":{const t=s[e.seriesType]++;return e.series.map((i,s)=>Object.assign(i,{seriesGrouping:{groupId:e.groupId,groupIndex:t,groupCount:r[e.seriesType],stackIndex:s,stackCount:e.series.length}}))}case"group":return e.series.map(t=>Object.assign(t,{seriesGrouping:{groupId:e.groupId,groupIndex:s[e.seriesType]++,groupCount:r[e.seriesType],stackIndex:0,stackCount:0}}))}return e.series}).map(({stacked:e,grouped:t,...i})=>i)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const t=new Map;return e.reduce((e,i)=>{const s=i.type;if(i.stacked||i.grouped){const r=this.getSeriesGroupId(i);if(!t.has(r)){const n={groupType:i.stacked?"stack":"group",seriesType:s,series:[],groupId:r};t.set(r,n),e.push(n)}t.get(r).series.push(i)}else e.push({groupType:"default",seriesType:s,series:[i],groupId:"__default__"});return e},[])}getTooltipPositionDefaults(e){const t=e.tooltip?.position;if(!(0,s.Qd)(t))return;const{type:i,anchorTo:r,placement:n,xOffset:o,yOffset:a}=t,l={};return(0,s.Kg)(i)&&(0,s.Xl)(Py,i)&&(l.type=i),(0,s.Kg)(r)&&(0,s.Xl)(Iy,r)&&(l.anchorTo=r),(0,s.Kg)(n)&&(0,s.Xl)(Ry,n)&&(l.placement=n),(0,s.Bf)(o)&&(l.xOffset=o),(0,s.Bf)(a)&&(l.yOffset=a),{tooltip:{position:l}}}getTooltipRangeDefaults(e,t){return{tooltip:{range:e.tooltip?.range??ta.getTooltipDefauls(t)?.range}}}soloSeriesIntegrity(e){if(!(0,s.cy)(e.series))return;const t=e.series;if(t&&t.length>1&&t.some(e=>ta.isSolo(e.type))){const i=this.optionsType(e);if(ta.isSolo(i))s.Vy.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),e.series=t.slice(0,1);else{const{solo:i,nonSolo:r}=(0,s.$z)(t,e=>ta.isSolo(e.type)?"solo":"nonSolo"),n=(0,s.Am)(i.map(e=>e.type)).join(", ");s.Vy.warn(`Unable to mix these series types with the lead series type: ${n}`),e.series=r}}}static enableConfiguredJsonOptions(e,t){"object"==typeof t&&"enabled"in t&&!t._enabledFromTheme&&null==e.enabled&&(t.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(e){null!=e._enabledFromTheme&&delete e._enabledFromTheme}enableConfiguredOptions(t,i){Ht(i,e.enableConfiguredJsonOptions,new Set(["data","theme"]),t),Ht(t,e.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static processFontOptions(e,t,i,s=new Set){if("object"==typeof e&&"fontFamily"in e)if(Array.isArray(e.fontFamily)){const t=[];for(const i of e.fontFamily)"object"==typeof i&&"googleFont"in i?(t.push(i.googleFont),s?.add(i.googleFont)):t.push(i);e.fontFamily=t.join(", ")}else"object"==typeof e.fontFamily&&"googleFont"in e.fontFamily&&(e.fontFamily=e.fontFamily.googleFont,s?.add(e.fontFamily));return s}processFonts(t,i=new Set){return Ht(t,e.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(e){"enabled"in e&&!1===e.enabled&&Object.keys(e).forEach(t=>{"enabled"!==t&&delete e[t]})}removeDisabledOptions(t){Ht(t,e.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(e){if(e&&(0,s.Gv)(e))for(const t of Object.keys(e)){const i=e[t];(0,s.Bm)(i)&&delete e[t]}}removeLeftoverSymbols(t){Ht(t,e.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(null==e.window?e.window=(0,s.zk)():(0,s.d1)(e.window),null==e.document?e.document=(0,s.YE)():(0,s._9)(e.document),null==e.window)throw new Error("AG Charts - unable to resolve global window");if(null==e.document)throw new Error("AG Charts - unable to resolve global document");return e}};dS.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},dS.JSON_DIFF_OPTS=new Set(["data"]),dS.perfDebug=v.create(!0,"perf"),dS.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),dS.debug=v.create(!0,"opts");var uS=dS,pS=class e{constructor(e,t,i,s,r,n=1e3){this.name=e,this.buildItem=t,this.releaseItem=i,this.destroyItem=s,this.maxPoolSize=r,this.cleanupTimeMs=n,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,r,n){return this.pools.has(t)||this.pools.set(t,new e(t,i,s,r,n)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return null==i?(i=this.buildItem(t),e.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):e.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(null==t)throw new Error("AG Charts - pool has no free instances");return e.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");e.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),e.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),s=i+.5*this.cleanupTimeMs;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const e of t)this.destroyItem(e);e.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};pS.pools=new Map,pS.debug=v.create(!0,"pool");var gS=pS;s.sy.registerMany(Jv);var mS=v.create(!0,"opts"),fS=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=eC.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return eC.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return vS.getInstance(e)}static create(e,t){return mS.group("AgCharts.create()",()=>{e=v.inDevelopmentMode(()=>z(Bt(e)))??e,this.licenseCheck(e);const i=vS.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&eC.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(e){return mS.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return mS.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return mS.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal"})})}};fS.licenseChecked=!1;var yS=class e{static getInstance(e){const t=gh.getInstance(e);return t?vh.chartInstances.get(t):void 0}static initialiseModules(){e.initialised||(Ty(),function(){for(const e of c.modules){if("enterprise"!==e.packageType||Yo(e)||s.Vy.errorOnce("Unexpected enterprise module registered: "+e.identifier),"root"===e.type&&e.themeTemplate)for(const t of e.chartTypes)ea.set(t,e.themeTemplate);if("series"===e.type){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);ta.register(e.identifier,e)}if("series-option"===e.type&&e.themeTemplate)for(const t of e.seriesTypes)ta.setThemeTemplate(t,e.themeTemplate);if("axis-option"===e.type&&e.themeTemplate)for(const t of e.axisTypes){const i=jo.getThemeTemplate(t),s=N(e.themeTemplate,i);jo.setThemeTemplate(t,s)}"axis"===e.type&&jo.register(e.identifier,e),"legend"===e.type&&qo.register(e.identifier,e)}if(c.hasEnterpriseModules()){const e=Ko.filter(({useCount:e})=>null==e||0===e);e.length>0&&s.Vy.errorOnce("Enterprise modules expected but not registered: ",e)}}(),e.initialised=!0)}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:r,licenseManager:n,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:l=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:c,stripSymbols:h=!1}=t,d=null!=eC.styles?[["ag-charts-enterprise",eC.styles]]:[],{presetType:u}=l;e.initialiseModules(),mS(()=>[">>> AgCharts.createOrUpdate() user options",Bt(r)]);let p=r;fS.optionsMutationFn&&p&&(p=fS.optionsMutationFn(Bt(p),u),mS(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Bt(p)]));const g=this.getPool(l);let m,f=!1,y=i?.chart;null==y&&g?.hasFree()&&(m=g.obtainFree(),y=m.item);const{document:v,window:C,styleContainer:b,...S}=p??{},w=y?.getChartOptions(),x=new uS(w,S,o,{...a,document:v,window:C,styleContainer:b},l,c,h);return null!=y&&s.sy.detectChartDefinition(x.processedOptions)===s.sy.detectChartDefinition(y.chartOptions.processedOptions)||(m?.release(),m=this.getPool(x.optionMetadata)?.obtain(x),m?y=m.item:(f=!0,y=e.createChartInstance(x,y))),d.forEach(([e,t])=>{y.ctx.domManager.addStyles(e,t)}),y.ctx.fontManager.updateFonts(x.googleFonts),null==i?(i=new vh(y,e.callbackApi,n),i.releaseChart=m?.release):(m||f)&&(i.releaseChart?.(),i.chart=y,i.releaseChart=m?.release),mS.check()&&"undefined"!=typeof window&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[y.id]=y),y.queuedUserOptions.push(x.userOptions),y.queuedChartOptions.push(x),y.requestFactoryUpdate(e=>{mS.group(">>>> Chart.applyOptions()",()=>{e.applyOptions(x);const t=e.queuedUserOptions.indexOf(x.userOptions)+1;e.queuedUserOptions.splice(0,t),e.queuedChartOptions.splice(0,t)})}),i}static markRemovedProperties(e,t,i=!1){if("object"!=typeof e)return i;for(const t of Object.keys(e))void 0===e[t]&&(Object.assign(e,{[t]:Symbol("UNSET")}),i||(i=!0));return i}static updateUserDelta(t,i){const s=Ht(i=Bt(i,uS.OPTIONS_CLONE_OPTS),e.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);mS(()=>[">>> AgCharts.updateUserDelta() user delta",Bt(i)]),e.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:s})}static createChartInstance(e,t){const i=t?.destroy({keepTransferableResources:!0});return s.sy.detectChartDefinition(e.processedOptions).create(e,i)}static getPool(e){if(!0===e.pool)return gS.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};yS.caretaker=new Xi($i),yS.initialised=!1,yS.callbackApi={caretaker:yS.caretaker,create:(e,t,i,s)=>yS.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s}),update:(e,t)=>yS.createOrUpdate({userOptions:e,proxy:t}),updateUserDelta:(e,t)=>yS.updateUserDelta(e,t)},yS.detachAndClear=e=>e.detachAndClear(),yS.destroy=e=>e.destroy();var vS=yS,CS={};o(CS,{Arc:()=>bS,BBox:()=>f,Caption:()=>Fi,CategoryScale:()=>wh,Group:()=>At,Line:()=>pa,LinearScale:()=>Vd,Marker:()=>_c,Path:()=>bc,RadialColumnShape:()=>wS,Rect:()=>Zd,Scene:()=>hr,Sector:()=>qf,Shape:()=>dt,TranslatableGroup:()=>It,getRadialColumnWidth:()=>xS,toRadians:()=>oe});var bS=class extends bc{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return(0,s.YX)(ie(this.startAngle),ie(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?e.closePath():2!==this.type||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new f(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(e,t){const i=this.getBBox();return 0!==this.type&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};function SS(e,t,i){const s=Math.sqrt(e**2+t**2),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}bS.className="Arc",a([$()],bS.prototype,"centerX",2),a([$()],bS.prototype,"centerY",2),a([$()],bS.prototype,"radius",2),a([$()],bS.prototype,"startAngle",2),a([$()],bS.prototype,"endAngle",2),a([$()],bS.prototype,"counterClockwise",2),a([$()],bS.prototype,"type",2);var wS=class extends bc{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:i}=this,s=this.getRotation(),r=-i/2,n=i/2,o=-t,a=-e;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let e=0;e<4;e+=1){const{x:t,y:i}=SS(e%2==0?r:n,e<2?o:a,s);l=Math.min(t,l),c=Math.min(i,c),h=Math.max(t,h),d=Math.max(i,d)}return new f(l,c,h-l,d-c)}getRotation(){const{startAngle:e,endAngle:t}=this;return ie(e+le(e,t)/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,r=-e/2,n=e/2,o=-i,a=-t,l=this.getRotation(),c=[[r,a],[r,o],[n,o],[n,a]].map(([e,t])=>SS(e,t,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:r,axisInnerRadius:n,axisOuterRadius:o,isRadiusAxisReversed:a}=this,l=(0,s.YX)(r,n),c=Math.asin(e/2/r),h=this.getRotation(),d=(e,t)=>SS(e,t,h),u=(e,t)=>Math.sqrt(e**2+t**2),p=(e,t)=>t>e?0:Math.sqrt(e**2-t**2),g=(e,t,i)=>i?e<t:e>t,m=l&&!isNaN(c)&&c<Math.PI/6;let f=-e/2,y=e/2;const v=-i,C=-r*(m?Math.cos(c):1),b=g(o,u(r,e/2),!a);if(b){const e=p(o,r);f=-e,y=e}t.clear(!0);const S=d(f,C);t.moveTo(S.x,S.y);const w=(0,s.YX)(r,i),x=g(o,u(i,e/2),!a);if(w&&m)t.arc(0,0,r,ie(-c-Math.PI/2)+h,ie(c-Math.PI/2)+h,!1);else if(x){const r=-p(o,e/2),n=p(o,i);if(!b){const e=d(f,r);t.lineTo(e.x,e.y)}if(t.arc(0,0,o,Math.atan2(r,f)+h,Math.atan2(v,-n)+h,!1),!(0,s.YX)(n,0)){const e=d(n,v);t.lineTo(e.x,e.y)}t.arc(0,0,o,Math.atan2(v,n)+h,Math.atan2(r,y)+h,!1)}else{const e=d(f,v),i=d(y,v);t.lineTo(e.x,e.y),t.lineTo(i.x,i.y)}const E=d(y,C);if(t.lineTo(E.x,E.y),m)t.arc(0,0,r,ie(c-Math.PI/2)+h,ie(-c-Math.PI/2)+h,!0);else{const e=d(f,C);t.lineTo(e.x,e.y)}t.closePath()}};function xS(e,t,i,s,r){const n=le(e,t),o=n*(1-s)/2;if(e+=o,t-=o,n<.001)return 2*i*r;if(n>=2*Math.PI){const i=e+n/2;e=i-Math.PI,t=i+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),d=Math.floor(Math.sqrt((a-c)**2+(l-h)**2)),u=2*i*r;return Math.max(1,Math.min(u,d))}wS.className="RadialColumnShape",a([$()],wS.prototype,"isBeveled",2),a([$()],wS.prototype,"columnWidth",2),a([$()],wS.prototype,"startAngle",2),a([$()],wS.prototype,"endAngle",2),a([$()],wS.prototype,"outerRadius",2),a([$()],wS.prototype,"innerRadius",2),a([$()],wS.prototype,"axisInnerRadius",2),a([$()],wS.prototype,"axisOuterRadius",2),a([$()],wS.prototype,"isRadiusAxisReversed",2);var ES={};o(ES,{ChartTheme:()=>gC,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Zu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>ep,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>tp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ip,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>sp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Qu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Ju,DEFAULT_CAPTION_ALIGNMENT:()=>ku,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Pu,DEFAULT_FIBONACCI_STROKES:()=>Yu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Xu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>$u,DEFAULT_GRIDLINE_ENABLED:()=>lp,DEFAULT_POLAR_SERIES_STROKE:()=>ju,DEFAULT_SEPARATION_LINES_COLOUR:()=>Iu,DEFAULT_SHADOW_COLOUR:()=>Ru,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Ku,DEFAULT_TEXTBOX_COLOR:()=>op,DEFAULT_TEXTBOX_FILL:()=>rp,DEFAULT_TEXTBOX_STROKE:()=>np,DEFAULT_TEXT_ANNOTATION_COLOR:()=>qu,DEFAULT_TOOLBAR_POSITION:()=>ap,IS_DARK_THEME:()=>Du,PALETTE_ALT_DOWN_FILL:()=>Uu,PALETTE_ALT_DOWN_STROKE:()=>Vu,PALETTE_ALT_NEUTRAL_FILL:()=>zu,PALETTE_ALT_NEUTRAL_STROKE:()=>Wu,PALETTE_ALT_UP_FILL:()=>Hu,PALETTE_ALT_UP_STROKE:()=>Bu,PALETTE_DOWN_FILL:()=>Ou,PALETTE_DOWN_STROKE:()=>Nu,PALETTE_NEUTRAL_FILL:()=>Gu,PALETTE_NEUTRAL_STROKE:()=>Fu,PALETTE_UP_FILL:()=>_u,PALETTE_UP_STROKE:()=>Lu,getChartTheme:()=>aS,resolveOperation:()=>AS,themeNames:()=>MS,themeSymbols:()=>Tu,themes:()=>oS});var MS=Object.keys(oS);function AS(e){const t=gC.getDefaultPublicParameters();t.__palette=gC.getDefaultColors();const i={operation:e};return Wt(i,t),i.operation}var TS={};o(TS,{Color:()=>fe,interpolateColor:()=>br});var DS={};o(DS,{AbstractBarSeries:()=>zm,AbstractBarSeriesProperties:()=>Um,ActionOnSet:()=>li,AnchoredPopover:()=>lw,Animation:()=>_r,AnimationManager:()=>Vr,Arc:()=>bS,Axis:()=>Ul,AxisGroupZIndexMap:()=>Vl,AxisInterval:()=>yl,AxisLabel:()=>vl,AxisTick:()=>bl,AxisTickGenerator:()=>Wl,AxisTicks:()=>WS,BBox:()=>f,BBoxValues:()=>h,Background:()=>Qd,BackgroundModule:()=>Jd,BandScale:()=>to,BarSeries:()=>nf,BarSeriesModule:()=>lf,BaseModuleInstance:()=>l,BaseProperties:()=>De,BaseToolbar:()=>gw,ButtonWidget:()=>Ps,CachedTextMeasurer:()=>Ii,CachedTextMeasurerPool:()=>Di,CallbackCache:()=>pr,Caption:()=>Fi,CartesianAxis:()=>$l,CartesianSeries:()=>jp,CartesianSeriesNodeEvent:()=>Up,CartesianSeriesProperties:()=>zp,CategoryAxis:()=>Ah,CategoryScale:()=>wh,ChangeDetectableProperties:()=>Sp,Chart:()=>gh,ChartAxisDirection:()=>Gi,ChartEventManager:()=>Hr,ChartOptions:()=>uS,ChartUpdateType:()=>yr,CollapseMode:()=>lg,Color:()=>fe,ColorScale:()=>we,ConicGradient:()=>Ee,ContextMenuBuiltins:()=>Wr,ContextMenuRegistry:()=>jr,ContinuousScale:()=>cn,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Vp,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Hp,DEFAULT_TOOLTIP_CLASS:()=>Fc,DEFAULT_TOOLTIP_DARK_CLASS:()=>Gc,DIRECTION_SWAP_AXES:()=>cp,DOMManager:()=>Ds,DataController:()=>Wo,DataModel:()=>Uo,DataModelSeries:()=>Bp,DataService:()=>vr,Debug:()=>v,Deprecated:()=>Ac,DeprecatedAndRenamedTo:()=>Tc,DiscreteTimeScale:()=>io,DragInterpreter:()=>tn,DraggablePopover:()=>hw,DropShadow:()=>wp,ExtendedPath2D:()=>Je,FILL_IMAGE_DEFAULTS:()=>mp,FILL_PATTERN_DEFAULTS:()=>gp,FONT_SIZE_RATIO:()=>wu,FillGradientDefaults:()=>Tp,FillImageDefaults:()=>Ip,FillPatternDefaults:()=>Dp,FloatingToolbar:()=>yw,Gradient:()=>xe,Group:()=>At,GroupedCategoryAxis:()=>kd,HdpiCanvas:()=>Qs,HierarchyNode:()=>LS,HierarchySeries:()=>NS,HierarchySeriesProperties:()=>_S,HighlightManager:()=>Kr,HighlightProperties:()=>Ap,HighlightStyle:()=>Rp,Image:()=>tw,InteractionManager:()=>Gr,InteractionState:()=>Fr,InterpolationProperties:()=>Kp,Invalidating:()=>ve,LARGEST_KEY_INTERVAL:()=>id,Label:()=>pl,LayoutElement:()=>Vi,LayoutManager:()=>Hi,LegendMarkerLabel:()=>cu,Line:()=>pa,LineSeries:()=>Af,LineSeriesModule:()=>If,LinearGradient:()=>Me,LinearScale:()=>Vd,Listeners:()=>Qi,LogScale:()=>Bd,LonLatBBox:()=>OS,Marker:()=>_c,Menu:()=>cw,MenuItemWidget:()=>sw,MenuWidget:()=>nw,MercatorScale:()=>US,ModuleRegistry:()=>s.sy,Motion:()=>Sr,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>oa,NativeWidget:()=>_s,NewAreaSeriesModule:()=>Bm,NewBarSeriesModule:()=>cf,NewBubbleSeriesModule:()=>vf,NewHistogramSeriesModule:()=>Ef,NewLineSeriesModule:()=>Rf,NewScatterSeriesModule:()=>Ff,NiceMode:()=>wl,Node:()=>J,NumberAxis:()=>Hd,ObserveChanges:()=>ci,OrdinalTimeScale:()=>el,PHASE_METADATA:()=>Pr,PHASE_ORDER:()=>Rr,PREV_NEXT_KEYS:()=>ds,Padding:()=>ri,ParallelStateMachine:()=>Sa,Path:()=>bc,PointerEvents:()=>Z,PolarAxis:()=>Hv,PolarSeries:()=>cy,PolarZIndexMap:()=>ly,Popover:()=>aw,PropertiesArray:()=>Ie,Property:()=>Te,ProxyInteractionService:()=>$s,ProxyOnWrite:()=>oi,ProxyProperty:()=>ni,ProxyPropertyOnWrite:()=>ai,QUICK_TRANSITION:()=>.2,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Wp,RadialColumnShape:()=>wS,Range:()=>il,Rect:()=>Zd,RepeatType:()=>kr,Rotatable:()=>vt,RotatableGroup:()=>Dt,RotatableText:()=>Ni,SAFE_FILLS_OPERATION:()=>dp,SAFE_FILL_OPERATION:()=>hp,SAFE_RANGE2_OPERATION:()=>pp,SAFE_STROKE_FILL_OPERATION:()=>up,SKIP_JS_BUILTINS:()=>V,SMALLEST_KEY_INTERVAL:()=>td,SORT_DOMAIN_GROUPS:()=>sd,Scalable:()=>Ct,ScalableGroup:()=>Tt,Scene:()=>hr,SceneArrayChangeDetection:()=>q,SceneChangeDetection:()=>$,SceneObjectChangeDetection:()=>Y,Sector:()=>qf,SectorBox:()=>Gf,Selection:()=>ua,Series:()=>Cc,SeriesContentZIndexMap:()=>dc,SeriesGroupingChangedEvent:()=>vc,SeriesItemHighlightStyle:()=>xp,SeriesMarker:()=>kp,SeriesNodeEvent:()=>yc,SeriesNodePickMode:()=>fc,SeriesProperties:()=>Pp,SeriesTooltip:()=>Np,SeriesZIndexMap:()=>hc,Shape:()=>dt,SimpleTextMeasurer:()=>Pi,SliderWidget:()=>Us,StateMachine:()=>ba,StateMachineProperty:()=>fa,StopProperties:()=>Pe,SvgPath:()=>ew,TRIPLE_EQ:()=>K,Text:()=>Li,TextUtils:()=>Ri,TextWrapper:()=>Oi,ThemeConstants:()=>bu,ThemeSymbols:()=>Tu,TimeAxisParentLevel:()=>zd,TimeScale:()=>Xa,Toolbar:()=>mw,ToolbarButtonProperties:()=>dw,ToolbarButtonWidget:()=>uw,ToolbarWidget:()=>Ws,Tooltip:()=>Xc,TooltipManager:()=>Qr,TooltipPosition:()=>qc,Transformable:()=>wt,TransformableGroup:()=>Rt,TransformableText:()=>_i,Translatable:()=>bt,TranslatableGroup:()=>It,TranslatableLine:()=>Bl,UnitTimeScale:()=>Ra,UpdateService:()=>Eo,Vec2:()=>IS,Vec4:()=>so,WIDGET_HTML_EVENTS:()=>di,Widget:()=>Ai,WidgetEventUtil:()=>mi,ZIndexMap:()=>mr,ZoomManager:()=>po,accumulateGroup:()=>ud,accumulateStack:()=>gd,accumulatedValue:()=>Bh,accumulativeValueProperty:()=>Zh,addEscapeEventListener:()=>is,addHitTestersToQuadtree:()=>Vm,addMouseCloseListener:()=>ss,addOverrideFocusVisibleEventListener:()=>os,addTouchCloseListener:()=>rs,adjustLabelPlacement:()=>rf,angleBetween:()=>le,angleCategoryAxisOptionsDefs:()=>KC,angleNumberAxisOptionsDefs:()=>WC,angularPadding:()=>he,animationValidation:()=>cd,annotationCalloutStylesDefs:()=>hb,annotationChannelStyleDefs:()=>ob,annotationChannelTextDefs:()=>JC,annotationCommentStylesDefs:()=>db,annotationCrossLineStyleDefs:()=>nb,annotationDisjointChannelStyleDefs:()=>ab,annotationFibonacciStylesDefs:()=>cb,annotationLineStyleDefs:()=>rb,annotationLineTextDefs:()=>QC,annotationMeasurerStylesDefs:()=>gb,annotationNoteStylesDefs:()=>ub,annotationOptionsDef:()=>fb,annotationParallelChannelStyleDefs:()=>lb,annotationQuickMeasurerStylesDefs:()=>mb,annotationShapeStylesDefs:()=>pb,annotationTextStylesDef:()=>ZC,applyShapeFillBBox:()=>gc,applyShapeStyle:()=>mc,areScalingEqual:()=>Mg,area:()=>Gh,autoSizedLabelOptionsDefs:()=>Rm,boxPlotSeriesThemeableOptionsDef:()=>yb,buildFormatter:()=>Xn,buildResetPathFn:()=>Kg,calculateDataDiff:()=>Jm,calculateDefaultTimeTickFormat:()=>Jn,calculateDerivativeExtrema:()=>Ze,calculateDerivativeExtremaXY:()=>Qe,calculateLabelTranslation:()=>$S,calculatePlacement:()=>Dc,callWithContext:()=>ur,candlestickSeriesThemeableOptionsDef:()=>Cb,cartesianAxisCrosshairOptions:()=>lm,cartesianAxisLabelOptionsDefs:()=>tm,cartesianAxisOptionsDefs:()=>am,cartesianChartOptionsDefs:()=>Mv,cartesianCrossLineOptionsDefs:()=>Jg,cartesianNumericAxisLabel:()=>im,cartesianTimeAxisLabel:()=>sm,cartesianTimeAxisParentLevel:()=>nm,checkCrisp:()=>Km,chordSeriesThemeableOptionsDef:()=>bb,clampArray:()=>nn,clippedRoundRect:()=>Xd,collapsedStartingBarPosition:()=>Ym,commonAxisLabelOptionsDefs:()=>em,commonAxisOptionsDefs:()=>om,commonChartOptionsDefs:()=>Mm,commonCrossLineLabelOptionsDefs:()=>Zg,commonCrossLineOptionsDefs:()=>Qg,commonSeriesOptionsDefs:()=>Tm,commonSeriesThemeableOptionsDefs:()=>Am,compareDates:()=>Pa,computeBarFocusBounds:()=>Qm,computeMarkerFocusBounds:()=>zg,coneFunnelSeriesThemeableOptionsDef:()=>Sb,continuousAxisOptions:()=>cm,countExpandingSearch:()=>Zr,createButton:()=>YS,createCheckbox:()=>qS,createDatumId:()=>vd,createDeprecationWarning:()=>Mc,createIcon:()=>QS,createSelect:()=>XS,createTextArea:()=>ZS,dateToNumber:()=>Zn,datesSortOrder:()=>La,datumKeys:()=>Bo,datumStylerProperties:()=>Yr,deconstructSelectionsOrNodes:()=>Lr,deepClone:()=>Bt,deepFreeze:()=>z,defaultTimeTickFormat:()=>Qn,diff:()=>yd,drawCorner:()=>$d,drawMarkerUnitPolygon:()=>kc,easing:()=>Sr,enterpriseModule:()=>eC,errorBarOptionsDefs:()=>km,errorBarThemeableOptionsDefs:()=>Pm,evaluateBezier:()=>Ye,extent:()=>Dh,extractDecoratedProperties:()=>P,fillsOptionsDef:()=>Oy,findMinMax:()=>on,findQuadtreeMatch:()=>Hm,findRangeExtent:()=>an,fixNumericExtent:()=>_o,flowProportionChartOptionsDefs:()=>Rv,focusCursorAtEnd:()=>Lt,formatNumber:()=>Vs,formatPercent:()=>Gs,formatValue:()=>Fs,fromToMotion:()=>aa,funnelSeriesThemeableOptionsDef:()=>wb,gaugeChartOptionsDefs:()=>Pv,getAngleRatioRadians:()=>ce,getColorStops:()=>Le,getCrossLineValue:()=>nl,getDateTicksForInterval:()=>Qa,getDatumRefPoint:()=>Xr,getElementBBox:()=>kt,getIconClassNames:()=>_t,getLastFocus:()=>ys,getMissCount:()=>Oo,getPath:()=>B,getPathComponents:()=>Vo,getRadialColumnWidth:()=>xS,getSequentialColors:()=>fp,getShapeFill:()=>uc,getShapeStyle:()=>pc,groupAccumulativeValueProperty:()=>Jh,groupAverage:()=>Fh,groupCount:()=>Oh,groupStackValueProperty:()=>ed,groupSum:()=>_h,hasNoModifiers:()=>as,heatmapSeriesThemeableOptionsDef:()=>xb,hierarchyChartOptionsDefs:()=>Iv,initMenuKeyNav:()=>gs,initRovingTabIndex:()=>us,interpolatePoints:()=>Tg,interpolationOptionsDefs:()=>_m,isAgFlowProportionChartOptions:()=>ic,isAgGaugeChartOptions:()=>rc,isAgHierarchyChartOptions:()=>ec,isAgStandaloneChartOptions:()=>sc,isAgTopologyChartOptions:()=>tc,isBetweenAngles:()=>ne,isButtonClickEvent:()=>fs,isChartAxisDirection:()=>Bi,isContinuous:()=>sl,isDecoratedObject:()=>I,isDenseInterval:()=>$a,isGradientFill:()=>nt,isGradientOrPatternFill:()=>ct,isImageFill:()=>lt,isInputPending:()=>Nt,isObjectWithProperty:()=>W,isObjectWithStringProperty:()=>j,isPatternFill:()=>at,isProperties:()=>Re,isScaleValid:()=>Ag,jsonApply:()=>Ut,jsonDiff:()=>Ft,jsonPropertyCompare:()=>Gt,jsonResolveOperations:()=>Wt,jsonWalk:()=>Ht,keyProperty:()=>jh,legendSymbolSvg:()=>Oc,lineDistanceSquared:()=>Ue,linearGaugeSeriesOptionsDef:()=>Vy,linearGaugeSeriesThemeableOptionsDef:()=>By,linearGaugeTargetOptionsDef:()=>Fy,listDecoratedProperties:()=>R,makeAccessibleClickListener:()=>ms,mapLineBackgroundSeriesThemeableOptionsDef:()=>Ab,mapLineSeriesThemeableOptionsDef:()=>Mb,mapMarkerSeriesThemeableOptionsDef:()=>Tb,mapShapeBackgroundSeriesThemeableOptionsDef:()=>Ib,mapShapeSeriesThemeableOptionsDef:()=>Db,mapValues:()=>F,markerFadeInAnimation:()=>Gg,markerOptionsDefs:()=>Dm,markerScaleInAnimation:()=>Bg,markerSwipeScaleInAnimation:()=>Vg,merge:()=>_,mergeArrayDefaults:()=>O,mergeDefaults:()=>N,midpointStartingBarPosition:()=>qm,moduleRegistry:()=>c,motion:()=>Cw,nearestSquared:()=>p,nearestSquaredInContainer:()=>g,nightingaleSeriesThemeableOptionsDef:()=>Rb,normaliseGroupTo:()=>nd,normalisePropertyTo:()=>ad,normalisedExtentWithMetadata:()=>Ih,normalizeAngle180:()=>re,normalizeAngle360:()=>ie,normalizeAngle360FromDegrees:()=>de,normalizeAngle360Inclusive:()=>se,normalizeContinuousDomains:()=>hn,numberFormatValidator:()=>Xg,objectsEqual:()=>k,objectsEqualWith:()=>L,ohlcSeriesThemeableOptionsDef:()=>Eb,ordinalTimeAxisOptionsDefs:()=>zC,pairUpSpans:()=>wg,partialAssign:()=>U,pathFadeInAnimation:()=>jg,pathMotion:()=>yp,pathSwipeInAnimation:()=>Wg,pickByMatchingAngle:()=>ay,plotAreaPathFill:()=>Ng,plotInterpolatedAreaSeriesFillSpans:()=>_g,plotInterpolatedLinePathStroke:()=>Rg,plotLinePathStroke:()=>Ig,polarChartOptionsDefs:()=>Av,prepareAreaFillAnimationFns:()=>Og,prepareAreaPathAnimation:()=>Fg,prepareAxisAnimationContext:()=>xl,prepareAxisAnimationFunctions:()=>Al,prepareBarAnimationFunctions:()=>Xm,prepareLinePathAnimation:()=>Lg,prepareLinePathPropertyAnimation:()=>kg,prepareLinePathStrokeAnimationFns:()=>Pg,preparePieSeriesAnimationFunctions:()=>ny,pyramidSeriesThemeableOptionsDef:()=>Pb,radarAreaSeriesThemeableOptionsDef:()=>kb,radarLineSeriesThemeableOptionsDef:()=>Lb,radialBarSeriesThemeableOptionsDef:()=>Nb,radialColumnSeriesThemeableOptionsDef:()=>_b,radialGaugeSeriesOptionsDef:()=>Uy,radialGaugeSeriesThemeableOptionsDef:()=>Hy,radialGaugeTargetOptionsDef:()=>Gy,radiusCategoryAxisOptionsDefs:()=>YC,radiusNumberAxisOptionsDefs:()=>$C,range:()=>Ka,rangeAreaSeriesThemeableOptionsDef:()=>Ob,rangeBarSeriesThemeableOptionsDef:()=>Fb,rangeValidator:()=>gm,rangedValueProperty:()=>Xh,resetAxisGroupFn:()=>Tl,resetAxisLabelSelectionFn:()=>Dl,resetAxisLineSelectionFn:()=>Il,resetBarSelectionsFn:()=>Zm,resetLabelFn:()=>bp,resetMarkerFn:()=>Hg,resetMarkerPositionFn:()=>Ug,resetMotion:()=>da,resetPieSelectionsFn:()=>oy,rowCountProperty:()=>$h,sankeySeriesThemeableOptionsDef:()=>Gb,scale:()=>cg,sectorBox:()=>Bf,seriesLabelFadeInAnimation:()=>vp,seriesLabelFadeOutAnimation:()=>Cp,seriesLabelOptionsDefs:()=>Im,setElementBBox:()=>Pt,setPath:()=>H,shadowOptionsDefs:()=>Nm,shallowClone:()=>Vt,solveBezier:()=>qe,sortAndUniqueDates:()=>ka,splitBezier:()=>Xe,standaloneChartOptionsDefs:()=>Dv,staticFromToMotion:()=>la,stopPageScrolling:()=>vs,sum:()=>Nh,sumValues:()=>Lh,sunburstSeriesThemeableOptionsDef:()=>Bb,timeIntervalUnit:()=>qg,toDegrees:()=>ae,toRadians:()=>oe,toolbarButtonOptionsDefs:()=>Em,tooltipContentAriaLabel:()=>Vc,tooltipHtml:()=>Wc,tooltipOptionsDefs:()=>Lm,topologyChartOptionsDefs:()=>Tv,trailingAccumulatedValue:()=>Vh,trailingAccumulatedValueProperty:()=>Qh,treemapSeriesThemeableOptionsDef:()=>Vb,updateClipPath:()=>$g,updateLabelNode:()=>tf,validateCrossLineValue:()=>ol,valueProperty:()=>Kh,visibleRangeIndices:()=>qr,waterfallSeriesThemeableOptionsDef:()=>Ub,without:()=>G});var IS={add:function(e,t){return"number"==typeof t?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}},angle:function(e,t){return null==t?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)},apply:function(e,t){return e.x=t.x,e.y=t.y,e},equal:function(e,t){return e.x===t.x&&e.y===t.y},distance:function(e,t){const i=RS(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)},distanceSquared:function(e,t){const i=RS(e,t);return i.x*i.x+i.y*i.y},from:function(e,t){if("number"==typeof e)return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)},gradient:function(e,t,i){const s=t.x-e.x;return(null==i?t.y-e.y:i-t.y-(i-e.y))/s},intercept:function(e,t,i){return(null==i?e.y:i-e.y)-t*e.x},intersectAtX:function(e,t,i=0,s){const r=e===1/0?1/0:e*i+t;return{x:i,y:null==s?r:s-r}},intersectAtY:function(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:null==s?i:s-i}},length:PS,lengthSquared:function(e){return e.x*e.x+e.y*e.y},multiply:function(e,t){return"number"==typeof t?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}},normalized:function(e){const t=PS(e);return{x:e.x/t,y:e.y/t}},origin:function(){return{x:0,y:0}},required:function(e){return{x:e?.x??0,y:e?.y??0}},rotate:function(e,t,i={x:0,y:0}){const s=PS(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}},round:function(e,t=2){return{x:(0,s.GB)(e.x,t),y:(0,s.GB)(e.y,t)}},sub:RS};function RS(e,t){return"number"==typeof t?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function PS(e){return Math.sqrt(e.x*e.x+e.y*e.y)}var kS=class e{constructor(e,t,i,s,r,n,o,a,l){this.series=e,this.datumIndex=t,this.datum=i,this.sizeValue=s,this.colorValue=r,this.sumSize=n,this.depth=o,this.parent=a,this.children=l,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=e.Walk.PreOrder){i===e.Walk.PreOrder&&t(this),this.children.forEach(e=>{e.walk(t,i)}),i===e.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};kS.Walk={PreOrder:0,PostOrder:1};var LS=kS,NS=class extends Cc{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new we,this.animationState=new ba("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:r}=this.properties;let n=0,o=1/0,a=-1/0;const l=(r,l,h)=>{const d=null!=h.depth?h.depth+1:0,u=null!=t?r[t]:void 0,p=null==u||0===u.length;let g=null!=i?r[i]:void 0;g=Number.isFinite(g)?Math.max(g,0):p?1:0;const m=g;n=Math.max(n,d);const f=null!=s?r[s]:void 0;return"number"==typeof f&&(o=Math.min(o,f),a=Math.max(a,f)),c(new e(this,l,r,g,f,m,d,h,[]),u)},c=(e,t)=>{const{datumIndex:i}=e;return t?.forEach((t,s)=>{const r=l(t,i.concat(s),e);e.children.push(r),e.sumSize+=r.sumSize}),e},h=c(new e(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),d=[o,a];this.colorScale.domain=o<a?[o,a]:[0,1],this.colorScale.range=r??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=n,this.colorDomain=d}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:s}=this.properties,{id:r,ctx:{legendManager:n},visible:o}=this;return"gradient"===e&&null!=t&&null!=s?[{legendType:"gradient",enabled:o&&n.getItemEnabled({seriesId:r}),seriesId:r,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if((0,s.r1)(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=(0,s.qE)(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:r}=e;let n=this.removeMeIndexPathForIndex(t);const o=n.reduce((e,t)=>e.children[t],this.rootNode);if(r>0&&o.hasChildren)n=[...n,0];else if(r<0&&n.length>1)n=n.slice(0,-1);else if(0===r&&0!==i){const e=o.parent.children.length-1;n=n.slice(),n[n.length-1]=(0,s.qE)(0,n[n.length-1]+i,e)}const a=n.reduce((e,t)=>e.children[t],this.rootNode),l=this.computeFocusBounds(this.datumSelection.at(t+1));return null!=l?{datum:a,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:a.depth,bounds:l,clipFocusBox:!0}:void 0}getDatumAriaText(e,t){if(e instanceof this.NodeClass)return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t});s.Vy.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`)}getCategoryValue(e){}datumIndexForCategoryValue(e){}},_S=class extends Pp{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Xf),this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.strokes=Object.values(Zf)}};a([Te],_S.prototype,"childrenKey",2),a([Te],_S.prototype,"sizeKey",2),a([Te],_S.prototype,"colorKey",2),a([Te],_S.prototype,"colorName",2),a([Te],_S.prototype,"fills",2),a([Te],_S.prototype,"fillGradientDefaults",2),a([Te],_S.prototype,"fillPatternDefaults",2),a([Te],_S.prototype,"fillImageDefaults",2),a([Te],_S.prototype,"strokes",2),a([Te],_S.prototype,"colorRange",2);var OS=class{constructor(e,t,i,s){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=s}merge(e){this.lon0=Math.min(this.lon0,e.lon0),this.lat0=Math.min(this.lat0,e.lat0),this.lon1=Math.max(this.lon1,e.lon1),this.lat1=Math.max(this.lat1,e.lat1)}},FS=Math.PI/180,GS=e=>e*FS,BS=e=>-Math.log(Math.tan(.25*Math.PI+e*FS*.5)),VS=e=>e/FS,HS=e=>(Math.atan(Math.exp(-e))-.25*Math.PI)/(.5*FS),US=class e extends ye{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.bounds=e.bounds(t)}static bounds(e){const[[t,i],[s,r]]=e,n=GS(t),o=BS(i),a=GS(s),l=BS(r);return new f(Math.min(n,a),Math.min(o,l),Math.abs(a-n),Math.abs(l-o))}static fixedScale(){return new e([[VS(0),HS(0)],[VS(1),HS(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let t=-1/0,i=1/0,s=-1/0,r=1/0;for(const n of e)for(const[e,o]of n)t=Math.min(e,t),i=Math.max(e,i),s=Math.min(o,s),r=Math.max(o,r);return{domain:[[t,s],[i,r]],animatable:!0}}convert([e,t]){const[[i,s],[r,n]]=this.range,o=(r-i)/this.bounds.width,a=(n-s)/this.bounds.height;return[(GS(e)-this.bounds.x)*o+i,(BS(t)-this.bounds.y)*a+s]}invert([e,t]){const[[i,s],[r,n]]=this.range,o=(r-i)/this.bounds.width,a=(n-s)/this.bounds.height;return[VS((e-i)/o+this.bounds.x),HS((t-s)/a+this.bounds.y)]}},zS=class e{constructor(){this.id=(0,s.sX)(this),this.axisGroup=new It({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=ua.select(this.axisGroup,Li),this.interval=new yl,this.label=new vl,this.scale=new Vd,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const e=[],t=this.generateTicks(),{translationX:i,translationY:s}=this;return this.labelSelection.update(t.ticks.map(e=>this.createLabelDatum(e)),void 0,e=>e.tickId),this.labelSelection.each((t,i)=>{t.setProperties(i),i.visible&&e.push(t.getBBox())}),this.axisGroup.setProperties({translationX:i,translationY:s}),e.length>0?f.merge(e):void 0}getLabelParams(e){const{padding:t}=this,{translate:i}=e;switch(this.position){case"top":case"bottom":return{x:i,y:t,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:t,y:i,textAlign:"start",textBaseline:"middle"}}}inRange(e,t=.001){const[i,s]=on(this.scale.range);return e>=i-t&&e<=s+t}createLabelDatum(e){const{x:t,y:i,textBaseline:s,textAlign:r}=this.getLabelParams(e);return{visible:Boolean(e.tickLabel),tickId:e.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:e.tickLabel,textAlign:r,textBaseline:s,x:t,y:i}}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:r,tickCount:n}=qa(an(this.scale.range),1,t,i,e.DefaultTickCount,e.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:n,minTickCount:r,maxTickCount:s});if("bottom"===this.position||"top"===this.position){const e=Di.getMeasurer({font:this.label}),{domain:t}=this.scale,i=t[0]>t[1]?-1:1;let s=-1/0*i;o.ticks=o.ticks.filter(t=>Math.sign(t.translate-s)===i&&(s=t.translate+e.textWidth(t.tickLabel,!0)*i,!0))}return o}getTicksData(e){const t=[],i=e.nice?this.scale.niceDomain(e):this.scale.domain,r=this.scale.ticks(e,i)?.ticks??[],n=r.reduce((e,t)=>Math.max(e,(0,s.o3)(t)),0),o=[],a=zl(),l="string"==typeof this.label.format?this.scale.tickFormatter({domain:i,ticks:r,fractionDigits:n,specifier:this.label.format}):e=>Fs(e,n);for(let e=0;e<r.length;e++){const s=r[e],c=this.scale.convert(s);if(!this.inRange(c))continue;const h=this.label.formatter?.({value:s,index:e,domain:i,fractionDigits:n,boundSeries:o})??l(s),d=a(h);t.push({tick:s,tickId:d,tickLabel:h,translate:c})}return{rawTicks:r,fractionDigits:n,ticks:t}}};zS.DefaultTickCount=5,zS.DefaultMinSpacing=10;var WS=zS,jS={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},KS={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function $S({yDirection:e,padding:t=0,position:i="top",bbox:s}){const r=e?jS:KS,{xTranslationDirection:n,yTranslationDirection:o}=r[i];return{xTranslation:n*(t+s.width/2),yTranslation:o*(t+s.height/2)}}function YS(e,t){const i=(0,s.n)("button",JS("ag-charts-input ag-charts-button",t));return void 0!==e.label?i.append(e.label):(i.append(QS(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),(0,s.Wp)(i,t),i}function qS(e,t){const i=(0,s.n)("input",JS("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",t=>e.onChange(i.checked,t)),i.addEventListener("keydown",e=>{fs(e)&&(e.preventDefault(),i.click())}),(0,s.Wp)(i,t),i}function XS(e,t){const i=(0,s.n)("select",JS("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(e=>{const t=(0,s.n)("option");return t.value=e.value,t.textContent=e.label,t})),(0,s.Bq)(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",t=>e.onChange(i.value,t)),(0,s.Wp)(i,t),i}function ZS(e,t){const i=(0,s.n)("textarea",JS("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",t=>e.onChange(i.value,t)),(0,s.Wp)(i,t),(0,s.Bq)(i,"data-preventdefault",!1),i}function QS(e){const t=(0,s.n)("span",`ag-charts-icon ag-charts-icon-${e}`);return(0,s.Bq)(t,"aria-hidden",!0),t}function JS(e,t){return null==t?e:`${e} ${t.class}`}var ew=class extends bc{constructor(e=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=e}get d(){return this._d}set d(e){if(e!==this._d){this._d=e,this.commands.length=0;for(const[t,i,s]of e.matchAll(/([A-Z])([0-9. ]*)/g)){const e=s.split(/\s+/g).map(Number);this.commands.push([i,e])}this.checkPathDirty()}}updatePath(){const{path:e,x:t,y:i}=this;e.clear();let s=t,r=i;for(const[n,o]of this.commands)switch(n){case"M":e.moveTo(t+o[0],i+o[1]),s=t+o[0];break;case"C":e.cubicCurveTo(t+o[0],i+o[1],t+o[2],i+o[3],t+o[4],i+o[5]),s=t+o[4],r=i+o[5];break;case"H":e.lineTo(t+o[0],r),s=i+o[0];break;case"L":e.lineTo(t+o[0],i+o[1]),s=t+o[0],r=i+o[1];break;case"V":e.lineTo(s,i+o[0]),r=i+o[0];break;case"Z":e.closePath();break;default:throw new Error(`Could not translate command '${n}' with '${o.join(" ")}'`)}e.closePath()}};a([$()],ew.prototype,"x",2),a([$()],ew.prototype,"y",2);var tw=class extends J{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};a([$()],tw.prototype,"x",2),a([$()],tw.prototype,"y",2),a([$()],tw.prototype,"width",2),a([$()],tw.prototype,"height",2),a([$()],tw.prototype,"opacity",2);var iw={};o(iw,{ButtonWidget:()=>Ps,MenuItemWidget:()=>sw,MenuWidget:()=>nw,NativeWidget:()=>_s,SliderWidget:()=>Us,ToolbarWidget:()=>Ws,WIDGET_HTML_EVENTS:()=>di,Widget:()=>Ai,WidgetEventUtil:()=>mi});var sw=class extends Rs{constructor(){super((0,s.n)("div"),"menuitem")}},rw=["Escape","ArrowLeft"],nw=class e extends Ls{constructor(e="vertical"){super(e,"menu"),this.closeSubMenu=e=>this.openSubMenu(e,void 0)}destructor(){this.selfClose("2")}addSeparator(){const e=(0,s.YE)().createElement("div");return(0,s.Bq)(e,"role","separator"),this.elem.appendChild(e),e}onChildAdded(e){super.onChildAdded(e),e.hasPopup()||e.addListener("mouseenter",this.closeSubMenu)}onChildRemoved(e){super.onChildRemoved(e),e.hasPopup()||e.removeListener("mouseenter",this.closeSubMenu)}addSubMenu(){const t=new sw,i=(0,s.wW)(),r=new e(this.orientation),n=e=>{t.isDisabled()||this.openSubMenu(e,r)};return t.setAriaHasPopup("menu"),t.setAriaExpanded(!1),t.setAriaControls(i),t.addListener("click",n),t.addListener("mouseenter",n),t.addListener("keydown",e=>{as(e.sourceEvent)&&"ArrowRight"===e.sourceEvent.code&&n(e)}),r.addListener("close-widget",()=>t.setAriaExpanded(!1)),r.addListener("open-widget",()=>t.setAriaExpanded(!0)),r.id=i,this.addChild(t),{subMenuButton:t,subMenu:r}}openSubMenu(e,t){const{openScope:i}=this;i&&(i.openSubMenu?.selfClose("4"),t?.open(e),i.openSubMenu=t)}open(e,t){const{overrideFocusVisible:i}=t??{};if(null!=this.openScope)return;this.openScope={lastFocus:ys(e.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new Ki};const r=this.children.map(e=>e.getElement());(0,s.Bq)(this.openScope.lastFocus,"aria-expanded",!0),ss(this.openScope.removers,this.elem,this.openScope.abort),rs(this.openScope.removers,this.elem,this.openScope.abort);for(const e of this.children)is(this.openScope.removers,e.getElement(),this.openScope.close,rw);void 0!==i&&os(this.openScope.removers,this.elem,r,i),this.internalListener?.dispatch("open-widget",this,{type:"open-widget"}),this.children[0]?.focus({preventScroll:!0})}selfClose(e){if(void 0===this.openScope)return;const{lastFocus:t,removers:i,openSubMenu:r}=this.openScope;this.openScope=void 0,r?.selfClose("3"),(0,s.Bq)(t,"aria-expanded",!1),"0"===e&&t?.focus({preventScroll:!0}),i.destroy(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},ow="canvas-overlay",aw=class extends l{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,this.element=i?.detached?(0,s.n)("div"):e.domManager.addChild(ow,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>e.domManager.removeChild(ow,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};0!==this.element.children.length&&(this.hideFns.forEach(e=>e()),t?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=(0,s.n)("div","ag-charts-popover");if(null!=t.ariaLabel&&i.setAttribute("aria-label",t.ariaLabel),null!=t.class&&i.classList.add(t.class),i.replaceChildren(...e),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const e=ys(t.sourceEvent);void 0!==e&&(this.lastFocus=e,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),null!=e.x&&t.style.setProperty("left",`${Math.floor(e.x)}px`),null!=e.y&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},lw=class extends aw{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}showWithChildren(e,t){const i=t.anchor??this.anchor,r=t.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(e,t);return i&&this.setAnchor(i,r),(0,s.zk)().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,r=this.getPopoverElement();if(!e||!r)return;const n=t.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:a}=r;let l=(0,s.qE)(0,e.x,n.width-o),c=(0,s.qE)(0,e.y,n.height-a);l!==e.x&&null!=i?.x&&(l=(0,s.qE)(0,i.x-o,n.width-o)),c!==e.y&&null!=i?.y&&(c=(0,s.qE)(0,i.y-a,n.height-a)),this.updatePosition({x:l,y:c})}},cw=class extends lw{show(e){const t=e.items.map(t=>this.createRow(e,t)),i=this.showWithChildren(t,e);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=gs({orientation:"vertical",menu:i,buttons:t,sourceEvent:e.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(e,t){const{menuItemRole:i="menuitem"}=e,r=t.value===e.value,n=(0,s.n)("div","ag-charts-menu__row");if(n.setAttribute("role",i),"menuitemradio"===i&&n.setAttribute("aria-checked",(e.value===t.value).toString()),"string"==typeof t.value&&(n.dataset.popoverId=t.value),n.classList.toggle("ag-charts-menu__row--active",r),null!=t.icon){const e=(0,s.n)("span",`ag-charts-menu__icon ${_t(t.icon)}`);n.appendChild(e)}const o=null!=t.strokeWidth;if(o&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",o),n.style.setProperty("--strokeWidth",o?`${t.strokeWidth}px`:null)),null!=t.label){const e=(0,s.n)("span","ag-charts-menu__label");e.textContent=this.ctx.localeManager.t(t.label),n.appendChild(e)}"altText"in t&&(n.ariaLabel=this.ctx.localeManager.t(t.altText));const a=i=>{fs(i)&&(e.onPress?.(t),i.preventDefault(),i.stopPropagation())};return n.addEventListener("keydown",a),n.addEventListener("click",a),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},hw=class extends aw{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:IS.from(e.clientX,e.clientY),position:IS.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=IS.sub(IS.from(e.clientX,e.clientY),t.client),r=IS.add(t.position,s),n=this.ctx.domManager.getBoundingClientRect(),o={};r.x>=0&&r.x+i.offsetWidth<=n.width&&(o.x=r.x),r.y>=0&&r.y+i.offsetHeight<=n.height&&(o.y=r.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},dw=class extends De{};a([Te],dw.prototype,"icon",2),a([Te],dw.prototype,"label",2),a([Te],dw.prototype,"ariaLabel",2),a([Te],dw.prototype,"tooltip",2);var uw=class extends Ps{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;e.tooltip&&(this.elem.title=t.t(e.tooltip));let i="";null!=e.icon&&(i=`<span class="${_t(e.icon)} ag-charts-toolbar__icon"></span>`),null!=e.label&&(i=`${i}<span class="ag-charts-toolbar__label">${t.t(e.label)}</span>`),this.elem.innerHTML=i}setChecked(e){(0,s.Bq)(this.elem,"aria-checked",e)}},pw="ag-charts-toolbar__button--active",gw=class extends Ws{constructor(e,t="horizontal"){super(t),this.localeManager=e,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new Qi,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal","horizontal"===t),this.toggleClass("ag-charts-toolbar--vertical","vertical"===t)}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[t,i]of e.entries())(this.buttonWidgets.at(t)??this.createButton(t,i)).update(i);for(let i=e.length;i<t.length;i++){const e=this.buttonWidgets.at(i);e?.destroy()}this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(pw,!1)}toggleActiveButtonByIndex(e){if(-1!==e)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(pw,null!=e&&e===t)}toggleButtonEnabledByIndex(e,t){-1!==e&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){-1!==e&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new f(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,r;for(const[n,o]of e.entries())i=!t&&0===n||r!=o.section,s=n===e.length-1||o.section!=e.at(n+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",n>0&&i),r=o.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const r={index:e,...t instanceof De?t.toJson():t},n=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:r,buttonBounds:n})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:e}})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},mw=class extends gw{createButtonWidget(){return new uw(this.localeManager)}},fw=class extends hw{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new f(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const r=e.position??"above",{offsetWidth:n,offsetHeight:o}=s;let a=e.y-o-i,l=e.x-n/2;"below"===r?a=e.y+i:"right"===r?(a=e.y-o/2,l=e.x+t):"above-left"===r&&(l=e.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor((0,s.qE)(0,e.x,i.width-t.width)),e.y=Math.floor((0,s.qE)(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},yw=class extends gw{constructor(e,t){super(e.localeManager),this.hasPrefix=!0,this.popover=new fw(e,t,this.onPopoverMoved.bind(this)),this.dragHandle=new vw(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new f(i.x+t.x-s.width,i.y+t.y,i.width,i.height)}},vw=class extends _s{constructor(e){super((0,s.n)("div","ag-charts-floating-toolbar__drag-handle"));const t=new _s((0,s.n)("span",`${_t("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},Cw={...na,...ha};fS.create.bind(fS),fS.__createSparkline.bind(fS)},26203(e,t,i){"use strict";i.d(t,{$1:()=>Dt,$P:()=>V,$r:()=>ft,$z:()=>vt,AF:()=>nt,Am:()=>yt,Bf:()=>Y,Bk:()=>me,Bm:()=>Z,Bq:()=>Lt,By:()=>ue,CG:()=>He,D$:()=>_t,E2:()=>Te,E3:()=>Ht,EG:()=>St,EM:()=>Ot,Et:()=>$,F4:()=>Vt,FJ:()=>O,Fq:()=>Kt,Fu:()=>dt,GB:()=>$t,GT:()=>Yt,GY:()=>at,Gv:()=>W,Hs:()=>Ft,I5:()=>Gt,I_:()=>Je,Ik:()=>ke,Is:()=>F,J$:()=>Ye,Jp:()=>ht,KC:()=>We,Kg:()=>K,LV:()=>mt,Ly:()=>Be,MM:()=>ze,MP:()=>rt,MX:()=>Ve,O9:()=>_e,OR:()=>ui,Qd:()=>j,R3:()=>qe,Rp:()=>Tt,S3:()=>Bt,Sc:()=>Ne,Tn:()=>z,Uo:()=>we,Vy:()=>n,W$:()=>ye,Wp:()=>Nt,XK:()=>bt,Xe:()=>Ue,Xl:()=>X,YE:()=>P,YI:()=>Xe,YO:()=>Me,YX:()=>Wt,Yj:()=>Le,Zd:()=>lt,_9:()=>L,_L:()=>Ce,ai:()=>Pe,bX:()=>Q,bk:()=>I,cI:()=>jt,cy:()=>B,d1:()=>N,dY:()=>je,eW:()=>ii,eh:()=>Ze,fN:()=>Ge,fd:()=>be,gd:()=>U,hR:()=>Ke,hz:()=>tt,iN:()=>Et,ie:()=>he,is:()=>Se,jO:()=>It,jj:()=>gt,jk:()=>$e,lk:()=>ai,lp:()=>ie,lt:()=>re,mL:()=>ut,mw:()=>ve,n:()=>_,nF:()=>ee,nR:()=>y,nl:()=>At,nm:()=>wt,o3:()=>qt,or:()=>xe,p6:()=>Ie,qE:()=>Ut,r1:()=>Ct,r4:()=>zt,sA:()=>di,sX:()=>ni,sg:()=>J,sw:()=>Re,sy:()=>f,t$:()=>hi,tf:()=>fe,uE:()=>q,v7:()=>Mt,vM:()=>G,vd:()=>H,wW:()=>oi,wi:()=>ot,xA:()=>xt,yI:()=>ge,yW:()=>De,zM:()=>Ae,zk:()=>k});var s=Object.defineProperty,r=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},n={};r(n,{error:()=>c,errorOnce:()=>p,log:()=>a,logGroup:()=>m,reset:()=>g,table:()=>h,warn:()=>l,warnOnce:()=>u});var o=new Set;function a(...e){console.log(...e)}function l(e,...t){console.warn(`AG Charts - ${e}`,...t)}function c(e,...t){"object"==typeof e?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function h(...e){console.table(...e)}function d(e,t,i){let s;s=e instanceof Error?e.message:"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):String(e);const r=`${t}: ${s}`;o.has(r)||(i(e),o.add(r))}function u(e,...t){d(e,"Logger.warn",e=>l(e,...t))}function p(e,...t){d(e,"Logger.error",e=>c(e,...t))}function g(){o.clear()}function m(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var f={};r(f,{detectChartDefinition:()=>E,getAxisModule:()=>M,getPresetModule:()=>A,getSeriesModule:()=>T,hasModule:()=>w,listModulesByType:()=>x,register:()=>C,registerMany:()=>b,reset:()=>S});var y=(e=>(e.Axis="axis",e.Chart="chart",e.Preset="preset",e.Plugin="plugin",e.Series="series",e))(y||{}),v=new Map;function C(e){const t=v.get(e.name);if(t&&(t.enterprise||!e.enterprise))throw new Error(`AG Charts - Module '${e.name}' already registered`);v.set(e.name,e)}function b(e){for(const t of e)C(t)}function S(){v.clear()}function w(e){return v.has(e)}function*x(e){for(const t of v.values())D(e,t)&&(yield t)}function E(e){for(const t of v.values())if(D("chart",t)&&t.detect(e))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function M(e){const t=v.get(e);if(D("axis",t))return t}function A(e){const t=v.get(e);if(D("preset",t))return t}function T(e){const t=v.get(e);if(D("series",t))return t}function D(e,t){return t?.type===e}var I=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),0===i.size&&this.events.delete(e))}emit(e,t){this.events.get(e)?.forEach(e=>e(t))}clear(e){e?this.events.delete(e):this.events.clear()}},R={};function P(e){return e?R.document?.[e]:R.document}function k(e){return e?R.window?.[e]:R.window}function L(e){R.document=e}function N(e){R.window=e}function _(e,t,i){const s=P().createElement(e);if("object"==typeof t&&(i=t,t=void 0),t)for(const e of t.split(" "))s.classList.add(e);return i&&Object.assign(s.style,i),s}function O(e){return P().createElementNS("http://www.w3.org/2000/svg",e)}function F(e,t){const i=P("body"),s=_("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function G(e){return null!=e}function B(e){return Array.isArray(e)}function V(e){return e instanceof Date}function H(e){return V(e)&&!isNaN(Number(e))}function U(e){return e instanceof RegExp}function z(e){return"function"==typeof e}function W(e){return"object"==typeof e&&null!==e&&!B(e)}function j(e){return"object"==typeof e&&null!==e&&"Object"===e.constructor?.name}function K(e){return"string"==typeof e}function $(e){return"number"==typeof e}function Y(e){return Number.isFinite(e)}function q(e){return"undefined"!=typeof window&&e instanceof HTMLElement}function X(e,t){return Object.values(e).includes(t)}function Z(e){return"symbol"==typeof e}function Q(e,t){return e in t}function J(e,t=0,i){const{leading:s=!1,trailing:r=!0,maxWait:n=1/0}=i??{};let o,a;if(n<t)throw new Error("Value of maxWait cannot be lower than waitMs.");return Object.assign(function(...i){if(s&&!a)return a=Date.now(),o=setTimeout(()=>a=null,t),void e(...i);let l=t;if(n!==1/0&&a){const e=Date.now()-a;t>n-e&&(l=n-e)}clearTimeout(o),a??(a=Date.now()),o=setTimeout(()=>{a=null,r&&e(...i)},l)},{cancel(){clearTimeout(o),a=null}})}function ee(e,t,i){const{leading:s=!0,trailing:r=!0}=i??{};let n,o,a=!1;function l(){r&&o?(n=setTimeout(l,t),e(...o)):a=!1,o=null}return Object.assign(function(...i){a?o=i:(a=!0,n=setTimeout(l,t),s?e(...i):o=i)},{cancel(){clearTimeout(n),a=!1,o=null}})}function te(e,t,i=""){try{return e(...t)}catch(e){u("Uncaught exception in user callback"+(i?` \`${i}\``:""),e)}}function ie(e,t="and",i=String,s=1/0){if(0===e.length)return"";if(1===e.length)return i(e[0]);const r=(e=e.map(i)).pop();if(e.length>=s){const i=e.length-(s-1);return`${e.slice(0,s-1).join(", ")}, and ${i} more ${t} ${r}`}return`${e.join(", ")} ${t} ${r}`}function se(e,t=1/0){if("number"==typeof e){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function re(e){let t=1;for(let i=0;i<e.length;i++)10===e.charCodeAt(i)&&t++;return t}function ne(e,t){if(e===t)return 0;const[i,s]=e.length<t.length?[e,t]:[t,e],r=i.length,n=s.length;let o=new Array(r+1).fill(0).map((e,t)=>t),a=new Array(r+1);for(let e=1;e<=n;e++){a[0]=e;for(let t=1;t<=r;t++){const r=s[e-1]===i[t-1]?0:1;a[t]=Math.min(o[t]+1,a[t-1]+1,o[t-1]+r)}[o,a]=[a,o]}return o[r]}"undefined"!=typeof window?R.window=window:"undefined"!=typeof globalThis&&(R.window=globalThis.window),"undefined"!=typeof document?R.document=document:"undefined"!=typeof globalThis&&(R.document=globalThis.document);var oe=Symbol("description"),ae=Symbol("required"),le=Symbol("marked"),ce=Symbol("undocumented"),he=Symbol("union"),de=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(e=>e!==i)));return e},new Map),ue=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(ue||{});function pe(e,t){return Y(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var ge=class{constructor(e,t,i,s,r){this.type=e,this.description=t,this.value=i,this.path=s,this.key=r}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return e||t?`Option \`${t?pe(e,t):e}\``:"Value"}toString(){const{description:e="unknown",type:t,value:i}=this;return"required"===t&&null==i?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${se(i,50)}\`; expecting ${e}, ignoring.`}},me=class extends ge{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${pe(this.path,this.key)}\``}getPostfix(){const e=ie(function(e,t,i=2){const s=[],r=e.toLowerCase(),n=de.get(r);for(const e of t){const t=e.toLowerCase();(n?.has(e)||t.includes(r)||ne(r,t)<=i)&&s.push(e)}return s}(this.key,this.suggestions),"or",e=>`\`${e}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function fe(e,t,i=""){if(!W(e))return{cleared:null,invalid:[new ge("required","an object",e,i)]};const s={},r=[],n=new Set(Object.keys(e)),o=[];if(he in t){const n=Object.keys(t),o=t[he];if(null!=e.type&&n.includes(e.type)||null==e.type&&null!=o){const{type:n=o,...a}=e,l=fe(a,t[n],i);Object.assign(s,{type:n},l.cleared);for(const e of l.invalid)e.setUnionType(n,i);r.push(...l.invalid)}else{const t=ie(n,"or",e=>`'${e}'`);r.push(new ge("required",`a keyword such as ${t}`,e.type,i,"type"))}return{cleared:s,invalid:r}}for(const a of Object.keys(t)){const l=t[a],c=l[ae],h=e[a];if(n.delete(a),void 0===h&&(l[ce]||o.push(a),!c))continue;const d=pe(i,a);if(z(l)){const t=l(h,{options:e,path:d});if("object"==typeof t){if(r.push(...t.invalid),t.valid){s[a]=t.cleared;continue}if(Ze(t.invalid,d))continue}else if(t){s[a]=h;continue}r.push(new ge(c?"required":"invalid",l[oe],h,i,a))}else{const e=fe(h,l,d);null!=e.cleared&&(s[a]=e.cleared),r.push(...e.invalid)}}for(const t of n){const s=e[t];void 0!==s&&r.push(new me(o,s,i,t))}return{cleared:s,invalid:r}}function ye(e,t){return Object.assign(z(e)?(t,i)=>e(t,i):{...e},{[oe]:t})}function ve(e){return Object.assign(z(e)?(t,i)=>e(t,i):be(e),{[ae]:!0,[oe]:e[oe]})}function Ce(e){return Object.assign(z(e)?(t,i)=>e(t,i):be(e),{[ce]:!0,[oe]:e[oe]})}var be=(e,t="an object")=>ye((t,i)=>{const s=fe(t,e,i.path);return{valid:!Ze(s.invalid,i.path),cleared:s.cleared,invalid:s.invalid}},t),Se=(e,t,i)=>({...e,[oe]:t,[he]:i}),we=(...e)=>ye((t,i)=>{const s=[];for(const r of e){const e=r(t,i);if("object"==typeof e){if(s.push(...e.invalid),!e.valid)return{valid:!1,cleared:t,invalid:s};t=e.cleared}else if(!e)return!1}return{valid:!0,cleared:t,invalid:s}},e.map(e=>e[oe]).filter(Boolean).join(" and ")),xe=(...e)=>ye((t,i)=>{for(const s of e){const e=s(t,i);if("object"==typeof e?e.valid:e)return e}return!1},e.map(e=>e[oe]).filter(Boolean).join(" or ")),Ee=e=>Y(e)||H(e),Me=ye(B,"an array"),Ae=ye(function(e){return"boolean"==typeof e},"a boolean"),Te=ye(z,"a function"),De=ye(function(e){return K(e)&&("none"===e||null!=function(e){const t=k("Option"),{style:i}=new t;return i.color=e,i.color||null}(e))},"a color string"),Ie=ye(e=>V(e)||(Y(e)||K(e))&&H(new Date(e)),"a date"),Re=ye(G,"a defined value"),Pe=ye(Y,"a number"),ke=ye(W,"an object"),Le=ye(K,"a string"),Ne=ye(e=>"undefined"==typeof HTMLElement||e instanceof HTMLElement,"an html element"),_e=(e,t=1/0)=>{let i;return i=t===1/0?`an array of at least ${e} items`:e===t?`an array of exactly ${e} items`:0===e?`an array of no more than ${t} items`:`an array of at least ${e} and no more than ${t} items`,ye(i=>B(i)&&i.length>=e&&i.length<=t,i)},Oe=(e,t=1/0)=>{let i;return i=t===1/0?`a string of at least ${e} characters`:e===t?`an string of exactly ${e} characters`:0===e?`an string of no more than ${t} characters`:`an string of at least ${e} and no more than ${t} characters`,ye(i=>K(i)&&i.length>=e&&i.length<=t,i)},Fe=(e,t=!0)=>ye(i=>Y(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),Ge=(e,t)=>ye(i=>Y(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),Be=Fe(0),Ve=Fe(0,!1),He=Ge(0,1),Ue=e=>ye((t,{options:i})=>!Ee(t)||!Ee(i[e])||t<i[e],`the value to be less than \`${e}\``),ze=e=>ye((t,{options:i})=>!Ee(t)||!Ee(i[e])||t>i[e],`the value to be greater than \`${e}\``);function We(...e){return W(e[0])&&(e=Object.values(e[0])),ye(t=>e.includes(t),`a keyword such as ${ie(e,"or",e=>`'${e}'`)}`)}var je=e=>ye(t=>e===t,`the value ${JSON.stringify(e)}`),Ke=(e,t)=>ye(t=>t instanceof e,t??`an instance of ${e.name}`),$e=(e,t,i=!0)=>ye((t,s)=>{if(!B(t))return!1;let r=i;const n=[],o=[],a=e=>r=i?r&&e:r||e;if(0===t.length)return{valid:!0,cleared:n,invalid:o};for(let i=0;i<t.length;i++){const l=t[i],c=e(l,{options:l,path:`${s.path}[${i}]`});"object"==typeof c?(r=a(c.valid),o.push(...c.invalid),null!=c.cleared&&n.push(c.cleared)):(r=a(c),c&&n.push(l))}return{valid:r,cleared:r||!i?n:null,invalid:o}},t??`${e[oe]} array`),Ye=(e,t="an object array")=>ye((t,i)=>{if(!B(t))return!1;const s=[],r=[];for(let n=0;n<t.length;n++){const o=`${i.path}[${n}]`,a=fe(t[n],e,o);Ze(a.invalid,o)||s.push(a.cleared),r.push(...a.invalid)}return{valid:!0,cleared:s,invalid:r}},t),qe=(e,t)=>ye((i,s)=>!!z(i)&&(le in i||{valid:!0,cleared:Object.assign((...r)=>{const n=te(i,r);if(null==n)return;const o=e(n,{options:n,path:""});if("object"==typeof o){if(o.invalid.forEach(Qe(s,t??e[oe])),o.valid)return o.cleared}else{if(o)return n;u(`Callback \`${s.path}\` returned an invalid value \`${se(n,50)}\`; expecting ${t??e[oe]}, ignoring.`)}},{[le]:!0}),invalid:[]}),"a function"),Xe=(e,t="an object")=>ye((i,s)=>!!z(i)&&(le in i||{valid:!0,cleared:Object.assign((...r)=>{const n=te(i,r,s.path);if(null==n)return;const o=fe(n,e);return o.invalid.forEach(Qe(s,t)),o.cleared},{[le]:!0}),invalid:[]}),"a function");function Ze(e,t){return e.some(e=>"required"===e.type&&e.path===t)}function Qe(e,t){return i=>{if(i instanceof me)return u(`Callback \`${e.path}\` returned an unknown property \`${pe(i.path,i.key)}\`${i.getPostfix()}`);const s=se(i.value,50);u(i.key?`Callback \`${e.path}\` returned an invalid property \`${pe(i.path,i.key)}\`: \`${s}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${s}\`; expecting ${t??i.description}, ignoring.`)}}var Je=e=>{if(!W(e))return!1;const t=Object.keys(e);return 1===t.length&&t[0].startsWith("$")},et=be({color:De,stop:He},""),tt=ye(e=>{let t=-1/0;for(const i of e)if(null!=i?.stop){if(i.stop<t)return!1;t=i.stop}return!0},"color stops to be defined in ascending order"),it=we(_e(2),$e(et),tt),st=We("axis","item","series"),rt=be({type:ve(je("gradient")),colorStops:ve(it),rotation:Pe,gradient:Ce(We("linear","radial","conic")),bounds:Ce(st),reverse:Ce(Ae)},"a gradient object with color stops"),nt={stroke:De,strokeWidth:Be,strokeOpacity:He},ot=be({type:ve(je("gradient")),gradient:ve(We("linear","radial","conic")),bounds:ve(st),colorStops:ve(xe(it,we(_e(2),$e(De)))),rotation:ve(Pe),reverse:ve(Ae)}),at=be({type:ve(je("pattern")),pattern:ve(We("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Oe(2),width:ve(Be),height:ve(Be),fill:ve(De),fillOpacity:ve(He),backgroundFill:ve(De),backgroundFillOpacity:ve(He),padding:ve(Be),rotation:ve(Pe),scale:ve(Be),stroke:ve(De),strokeWidth:ve(Be),strokeOpacity:ve(He)}),lt=be({type:ve(je("image")),url:Le,width:Be,height:Be,rotation:ve(Pe),backgroundFill:ve(De),backgroundFillOpacity:He,fit:ve(We("stretch","contain","cover")),repeat:ve(We("repeat","repeat-x","repeat-y","no-repeat"))}),ct=Se({gradient:{colorStops:it,rotation:Pe,gradient:Ce(We("linear","radial","conic")),bounds:Ce(st),reverse:Ce(Ae)},pattern:{pattern:We("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Oe(2),width:Be,height:Be,rotation:Pe,scale:Be,fill:De,fillOpacity:He,backgroundFill:De,backgroundFillOpacity:He,...nt,padding:Ce(Be)},image:{url:ve(Le),backgroundFill:De,backgroundFillOpacity:He,width:Be,height:Be,fit:We("stretch","contain","cover","none"),repeat:We("repeat","repeat-x","repeat-y","no-repeat"),rotation:Pe}},"a color object"),ht=xe(De,be(ct,"a color object")),dt={fill:ht,fillOpacity:He};dt.fillGradientDefaults=Ce(ot),dt.fillPatternDefaults=Ce(at),dt.fillImageDefaults=Ce(lt);var ut={lineDash:$e(Be),lineDashOffset:Pe},pt=be({googleFont:Le},"google font"),gt=xe(Le,Je,pt,$e(xe(Le,pt))),mt={color:De,fontFamily:gt,fontSize:Be,fontStyle:We("normal","italic","oblique"),fontWeight:xe(Be,We("normal","bold","bolder","lighter"))};function ft(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function yt(e){return Array.from(new Set(e))}function vt(e,t){return e.reduce((e,i)=>{const s=t(i);return e[s]??(e[s]=[]),e[s].push(i),e},{})}function Ct(e,t){if(null==e||null==t||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!Ct(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function bt(e,t,i=0){if(0===e.length)return[];const s=[];for(let r=0;r<t;r++)s.push(e.at((r+i)%e.length));return s}function St(e,t){const i=new Map;return t.forEach((e,t)=>{i.set(e,t)}),e.sort((e,t)=>(i.get(e)??1/0)-(i.get(t)??1/0))}function wt(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const s=i;0!==s&&e.splice(0,s)}function xt(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const s=e.length-1-i;0!==s&&e.splice(e.length-s,s)}var Et=class{constructor(){this.queue=[]}await(e=50){return new Promise(t=>{const i=()=>{clearTimeout(s),t(!0)},s=setTimeout(()=>{const e=this.queue.indexOf(i);e<0||(this.queue.splice(e,1),t(!1))},e);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(e=>e())}};function Mt(e=0){return new Promise(t=>{setTimeout(t,e)})}function*At(...e){for(const t of e)yield*t}function Tt(e){return null!=e&&"object"==typeof e&&Symbol.iterator in e?e:[e]}function Dt(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*It(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function Rt(e){return"true"===e}function Pt(e){return e}var kt={role:Pt,"aria-checked":Rt,"aria-controls":Pt,"aria-describedby":Pt,"aria-disabled":Rt,"aria-expanded":Rt,"aria-haspopup":Pt,"aria-hidden":Rt,"aria-label":Pt,"aria-labelledby":Pt,"aria-live":Pt,"aria-orientation":Pt,"aria-selected":Rt,"data-focus-override":Rt,"data-focus-visible-override":Rt,"data-preventdefault":Rt,class:Pt,for:Pt,id:Pt,tabindex:function(e){return Number(e)},title:Pt,placeholder:Pt};function Lt(e,t,i){null==i||""===i||""===i?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function Nt(e,t){if(null!=t)for(const[i,s]of It(t))"class"!==i&&Lt(e,i,s)}function _t(e,t,i){if(!(e instanceof HTMLElement))return;const s=e.getAttribute(t);return null===s?i:kt[t]?.(s)??void 0}function Ot(e,t,i){null!=e&&(null==i?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function Ft(e,t){for(const[i,s]of It(t))Ot(e,i,s)}function Gt(e,t,i){if(e>t)return;let s;for(;t>=e;){const r=Math.floor((t+e)/2);i(r)?(s=r,e=r+1):t=r-1}return s}function Bt(e,t,i){if(e>t)return;let s;for(;t>=e;){const r=Math.floor((t+e)/2);i(r)?(s=r,t=r-1):e=r+1}return s}function Vt(e,t,i){if(e>t)return;let s;for(;t>=e;){const r=Math.floor((t+e)/2),n=i(r);null==n?t=r-1:(s=n,e=r+1)}return s}function Ht(e,t){const i=Math.max(e.length,t.length),s=new Set,r=new Set;for(let n=0;n<i;n++){const i=e[n],o=t[n];i!==o&&(r.has(o)?r.delete(o):o&&s.add(o),s.has(i)?s.delete(i):i&&r.add(i))}return{changed:s.size>0||r.size>0,added:s,removed:r}}function Ut(e,t,i){return Math.min(i,Math.max(e,t))}function zt(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function Wt(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function jt(e){return-1===Math.sign(e)||Object.is(e,-0)}function Kt(e){return e%1==0}function $t(e,t=2){const i=10**t;return Math.round(e*i)/i}function Yt(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function qt(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let e;[t,e]=t.split("e"),null!=e&&(i=Number(e))}const s=t.split(".")[1]?.length??0;return Math.max(s-i,0)}function Xt(e){return Array.isArray(e)&&e.length>=2&&e.every(Y)}function Zt(e){return Array.isArray(e)&&e.length>=2&&e.every(Xt)}function Qt(e){const t=e[0],i=e[e.length-1];return Wt(t[0],i[0],.001)&&Wt(t[1],i[1],.001)}function Jt(e){return Array.isArray(e)&&e.every(Zt)&&e.every(Qt)}function ei(e){if(null===e)return!0;if(!W(e)||null==e.type)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(ei);case"MultiPolygon":return Array.isArray(i)&&i.every(Jt);case"Polygon":return Jt(i);case"MultiLineString":return Array.isArray(i)&&i.every(Zt);case"LineString":case"MultiPoint":return Zt(i);case"Point":return Xt(i);default:return!1}}function ti(e){return W(e)&&"Feature"===e.type&&ei(e.geometry)}var ii=ye(function(e){return W(e)&&"FeatureCollection"===e.type&&Array.isArray(e.features)&&e.features.every(ti)},"a GeoJSON object"),si=new Map,ri=(Symbol("ElementID"),1);function ni(e){const t=e.constructor,i=Object.hasOwn(t,"className")?t.className:t.name;if(!i)throw new Error(`The ${t} is missing the 'className' property.`);const s=(si.get(i)??0)+1;return si.set(i,s),`${i}-${s}`}function oi(){return"ag-charts-"+ri++}function ai(){return crypto.randomUUID?.()??function(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t="";for(let i=0;i<e.length;i++)4!==i&&6!==i&&8!==i&&10!==i||(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}()}var li=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,ci=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function hi(e){if(!K(e))return!1;const t=ci.exec(e);return li.test(t?t[2]:e)}function di(e){let t,i;const s=ci.exec(e);s&&([,t,e,i]=s);const r=li.exec(e);if(!r)throw new Error(`The number formatter is invalid: ${e}`);const[,n,o,a,l,c,h,d,u,p,g]=r;return{fill:n,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:d,precision:parseInt(u),trim:Boolean(p),type:g,prefix:t,suffix:i}}function ui(e){const t="string"==typeof e?di(e):e,{fill:i,align:s,sign:r="-",symbol:n,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=t;let{trim:p}=t;const g=null==u||isNaN(u);let m,f;if(c)if(c in gi&&c in pi)m=g?pi[c]:gi[c];else if(c in gi)m=gi[c];else{if(!(c in pi))throw new Error(`The number formatter type is invalid: ${c}`);m=pi[c]}else m=gi.g,p=!0;return f=g?c?6:12:u,e=>{let t=m(e,f);return p&&(t=t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(t=function(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),r=e.substring(i);for(let e=s.length-3;e>0;e-=3)s.splice(e,0,t);return`${s.join("")}${r}`}(t,l)),t=function(e,t,i=""){if("("===i)return e>=0?t:`(${t})`;return`${e>=0?"+"===i?"+":"":"−"}${t}`}(e,t,r),n&&"#"!==n&&(t=`${n}${t}`),"#"===n&&"x"===c&&(t=`0x${t}`),"s"===c&&(t=`${t}${function(e){return yi[Ci(e)]}(e)}`),"%"!==c&&"p"!==c||(t=`${t}%`),null==a||isNaN(a)||(t=function(e,t,i=" ",s=">"){let r=e;if(">"!==s&&s){if("<"===s)r=r.padEnd(t,i);else if("^"===s){const e=Math.max(0,t-r.length),s=Math.ceil(e/2),n=Math.floor(e/2);r=r.padStart(s+r.length,i),r=r.padEnd(n+r.length,i)}}else r=r.padStart(t,i);return r}(t,a,i??o,s)),t=`${h}${t}${d}`,t}}var pi={b:e=>vi(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>vi(e).toString(8),x:e=>vi(e).toString(16),X:e=>pi.x(e).toUpperCase(),n:e=>pi.d(e),"%":e=>`${vi(100*e).toFixed(0)}`},gi={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>gi.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>gi.f(e,t).toUpperCase(),g:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>gi.g(e,t).toUpperCase(),n:(e,t)=>gi.g(e,t),p:(e,t)=>gi.r(100*e,t),r:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i))-(t-1);if(s<=0)return i.toFixed(-s);const r=10**s;return(Math.round(i/r)*r).toFixed()},s:(e,t)=>{const i=Ci(e);return gi.r(e/10**i,t)},"%":(e,t)=>gi.f(100*e,t)},mi=-24,fi=24,yi={[mi]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[fi]:"Y"};function vi(e){return Math.floor(Math.abs(e))}function Ci(e){return Ut(-24,e?3*Math.floor(Math.log10(Math.abs(e))/3):0,24)}},85255(e,t,i){"use strict";i.d(t,{hF:()=>XL});var s=i(45401),r=i(26203),n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=(e,t,i,s)=>{for(var r,a=s>1?void 0:s?o(t,i):t,l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&n(t,i,a),a},l=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(e,t){let i=e[0],s=e[1],r=e[2],n=e[3];i=this.ff(i,s,r,n,t[0],7,-680876936),n=this.ff(n,i,s,r,t[1],12,-389564586),r=this.ff(r,n,i,s,t[2],17,606105819),s=this.ff(s,r,n,i,t[3],22,-1044525330),i=this.ff(i,s,r,n,t[4],7,-176418897),n=this.ff(n,i,s,r,t[5],12,1200080426),r=this.ff(r,n,i,s,t[6],17,-1473231341),s=this.ff(s,r,n,i,t[7],22,-45705983),i=this.ff(i,s,r,n,t[8],7,1770035416),n=this.ff(n,i,s,r,t[9],12,-1958414417),r=this.ff(r,n,i,s,t[10],17,-42063),s=this.ff(s,r,n,i,t[11],22,-1990404162),i=this.ff(i,s,r,n,t[12],7,1804603682),n=this.ff(n,i,s,r,t[13],12,-40341101),r=this.ff(r,n,i,s,t[14],17,-1502002290),s=this.ff(s,r,n,i,t[15],22,1236535329),i=this.gg(i,s,r,n,t[1],5,-165796510),n=this.gg(n,i,s,r,t[6],9,-1069501632),r=this.gg(r,n,i,s,t[11],14,643717713),s=this.gg(s,r,n,i,t[0],20,-373897302),i=this.gg(i,s,r,n,t[5],5,-701558691),n=this.gg(n,i,s,r,t[10],9,38016083),r=this.gg(r,n,i,s,t[15],14,-660478335),s=this.gg(s,r,n,i,t[4],20,-405537848),i=this.gg(i,s,r,n,t[9],5,568446438),n=this.gg(n,i,s,r,t[14],9,-1019803690),r=this.gg(r,n,i,s,t[3],14,-187363961),s=this.gg(s,r,n,i,t[8],20,1163531501),i=this.gg(i,s,r,n,t[13],5,-1444681467),n=this.gg(n,i,s,r,t[2],9,-51403784),r=this.gg(r,n,i,s,t[7],14,1735328473),s=this.gg(s,r,n,i,t[12],20,-1926607734),i=this.hh(i,s,r,n,t[5],4,-378558),n=this.hh(n,i,s,r,t[8],11,-2022574463),r=this.hh(r,n,i,s,t[11],16,1839030562),s=this.hh(s,r,n,i,t[14],23,-35309556),i=this.hh(i,s,r,n,t[1],4,-1530992060),n=this.hh(n,i,s,r,t[4],11,1272893353),r=this.hh(r,n,i,s,t[7],16,-155497632),s=this.hh(s,r,n,i,t[10],23,-1094730640),i=this.hh(i,s,r,n,t[13],4,681279174),n=this.hh(n,i,s,r,t[0],11,-358537222),r=this.hh(r,n,i,s,t[3],16,-722521979),s=this.hh(s,r,n,i,t[6],23,76029189),i=this.hh(i,s,r,n,t[9],4,-640364487),n=this.hh(n,i,s,r,t[12],11,-421815835),r=this.hh(r,n,i,s,t[15],16,530742520),s=this.hh(s,r,n,i,t[2],23,-995338651),i=this.ii(i,s,r,n,t[0],6,-198630844),n=this.ii(n,i,s,r,t[7],10,1126891415),r=this.ii(r,n,i,s,t[14],15,-1416354905),s=this.ii(s,r,n,i,t[5],21,-57434055),i=this.ii(i,s,r,n,t[12],6,1700485571),n=this.ii(n,i,s,r,t[3],10,-1894986606),r=this.ii(r,n,i,s,t[10],15,-1051523),s=this.ii(s,r,n,i,t[1],21,-2054922799),i=this.ii(i,s,r,n,t[8],6,1873313359),n=this.ii(n,i,s,r,t[15],10,-30611744),r=this.ii(r,n,i,s,t[6],15,-1560198380),s=this.ii(s,r,n,i,t[13],21,1309151649),i=this.ii(i,s,r,n,t[4],6,-145523070),n=this.ii(n,i,s,r,t[11],10,-1120210379),r=this.ii(r,n,i,s,t[2],15,718787259),s=this.ii(s,r,n,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(n,e[3])}cmn(e,t,i,s,r,n){return t=this.add32(this.add32(t,e),this.add32(s,n)),this.add32(t<<r|t>>>32-r,i)}ff(e,t,i,s,r,n,o){return this.cmn(t&i|~t&s,e,t,r,n,o)}gg(e,t,i,s,r,n,o){return this.cmn(t&s|i&~s,e,t,r,n,o)}hh(e,t,i,s,r,n,o){return this.cmn(t^i^s,e,t,r,n,o)}ii(e,t,i,s,r,n,o){return this.cmn(i^(t|~s),e,t,r,n,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)r[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(r[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,r),s=0;s<16;s++)r[s]=0;return r[14]=8*t,this.md5cycle(i,r),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>8*s+4&15]+t[e>>8*s&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}};function c(e){return null==e||0===e.length}var h={"01":"GRID","02":"CHARTS","0102":"BOTH"},d="https://www.ag-grid.com/charts/licensing/",u=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new l,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey,e.gridContext),i=`AG ${"BOTH"===t.currentLicenseType?"Grid and ":""}Charts Enterprise`;let s="";if("BOTH"===t.suppliedLicenseType?s="AG Grid and AG Charts Enterprise":"GRID"===t.suppliedLicenseType?s="AG Grid Enterprise":void 0!==t.suppliedLicenseType&&(s="AG Charts Enterprise"),t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(i);else if(t.expired){const i=e.getChartsReleaseDate(),r=e.formatDate(i);this.outputExpiredKey(t.expiry,r,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,r=i.substring(s),n=i.substring(0,s),[o,a,l]=e.extractBracketedInformation(i);return{md5:r,license:n,version:o,isTrial:a,type:l}}getLicenseDetails(t,i=!1){const s="CHARTS";if(c(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const r=e.getChartsReleaseDate(),{md5:n,license:o,version:a,isTrial:l,type:d}=e.extractLicenseComponents(t);let u,p,g,m=n===this.md5.md5(o)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),f=null,y=!1;if(m&&(f=e.extractExpiry(o),m=!isNaN(f.getTime()),m))switch(p=r>f,a){case"legacy":case"2":m=!1;break;case"3":c(d)?m=!1:(g=d,d!==h["02"]&&d!==h["0102"]?(m=!1,y=!0):l&&(u=f<new Date,p=void 0))}return m?{licenseKey:t,valid:m,expiry:e.formatDate(f),expired:p,version:a,isTrial:l,trialExpired:u,invalidLicenseTypeForCombo:i?"BOTH"!==g:void 0,incorrectLicenseType:y,currentLicenseType:s,suppliedLicenseType:g}:{licenseKey:t,valid:m,incorrectLicenseType:y,currentLicenseType:s,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!c(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??window;if(!e)return"localhost";const t=e.location,{hostname:i=""}=t;return i}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??"undefined"!=typeof window?window:void 0;if(!e)return!1;const{pathname:t}=e.location;return!!t&&-1!==t.indexOf("forceWatermark")}isWebsiteUrl(){const e=this.getHostname();return null!==/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)}isLocalhost(){const e=this.getHostname();return null!==/^(?:127\.0\.0\.1|localhost)$/.exec(e)}isE2ETest(){const e=this.getHostname();return null!==/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(e)}static formatDate(e){const t=e.getDate(),i=e.getMonth(),s=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+s}static getChartsReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,r,n,o,a,l,c,h="",d=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)o=i.indexOf(u.charAt(d++)),a=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),s=o<<2|a>>4,r=(15&a)<<4|l>>2,n=(3&l)<<6|c,h+=String.fromCharCode(s),64!=l&&(h+=String.fromCharCode(r)),64!=c&&(h+=String.fromCharCode(n));return h=e.utf8_decode(h),h}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);s<128?t+=String.fromCharCode(s):s>127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}static setGridContext(t=!1){e.gridContext=t}static setLicenseKey(t){e.licenseKey=t}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const i=1===t.filter(e=>"TRIAL"===e).length,s=t.filter(e=>e.startsWith("v"))[0];return[s?s.replace("v",""):"legacy",i,h[t.filter(e=>h[e])[0]]]}centerPadAndOutput(e){const t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,t="*",i=""){console.error(e.padEnd(this.totalMessageLength-i.length,t)+i)}outputInvalidLicenseKey(t,i,s){e.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${d}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${d}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};u.RELEASE_INFORMATION="MTc0OTAyMzU3MDQyNA==",u.gridContext=!1;var p=u;function g(e,t,i){const s=(t,i,s,r)=>{let n=e[0];for(let o=t;s>0?o<=i:o>i;o+=s){const t=e[o];if(r(n,t))return!0;n=t}return!1},r=Math.floor(e.length/2);return!!s(t,r,t,i)||s(e.length-t,r,-t,i)}var{AxisInterval:m,Property:f}=s.n1,y=class extends m{};a([f],y.prototype,"minSpacing",2);var{BaseProperties:v,ChartAxisDirection:C,Property:b,Group:S}=s.n1,w=class extends v{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};a([b],w.prototype,"enabled",2),a([b],w.prototype,"text",2),a([b],w.prototype,"fontStyle",2),a([b],w.prototype,"fontWeight",2),a([b],w.prototype,"fontSize",2),a([b],w.prototype,"fontFamily",2),a([b],w.prototype,"padding",2),a([b],w.prototype,"color",2),a([b],w.prototype,"parallel",2);var x=class extends v{constructor(){super(...arguments),this.id=(0,r.sX)(this),this.defaultColorRange=[],this.shape="polygon",this.label=new w,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=C.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new S({name:this.id}),this.rangeGroup=new S({name:this.id}),this.labelGroup=new S({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,r){const{label:n}=this;e.x=t,e.y=i,e.text=n.text,e.textAlign="center",e.textBaseline=s,e.rotation=r,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.visible=!0}};a([b],x.prototype,"enabled",2),a([b],x.prototype,"type",2),a([b],x.prototype,"range",2),a([b],x.prototype,"value",2),a([b],x.prototype,"defaultColorRange",2),a([b],x.prototype,"fill",2),a([b],x.prototype,"fillOpacity",2),a([b],x.prototype,"stroke",2),a([b],x.prototype,"strokeWidth",2),a([b],x.prototype,"strokeOpacity",2),a([b],x.prototype,"lineDash",2),a([b],x.prototype,"shape",2),a([b],x.prototype,"label",2);var{ChartAxisDirection:E,getCrossLineValue:M,validateCrossLineValue:A,normalizeAngle360:T,Group:D,Path:I,Sector:R,RotatableText:P,ContinuousScale:k}=s.n1,L=class extends x{constructor(){super(),this.direction=E.Angle,this.polygonNode=new I,this.sectorNode=new R,this.lineNode=new I,this.crossLineRange=new D,this.labelNode=new P,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!k.is(this.scale))return!0;const[e,t]=this.scale.domain,i=M(this);if((0,r.cy)(i)){const[s,r]=i;return s>=e&&s<=t&&r>=s&&r<=t}return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!A(M(this),t)||!this.visibilityCheck())return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:r}=this;if(!e||"line"!==i||!t)return void(r.visible=!1);const n=t.convert(s);if(isNaN(n))return void(r.visible=!1);const{axisInnerRadius:o,axisOuterRadius:a}=this;r.visible=!0,r.stroke=this.stroke,r.strokeOpacity=this.strokeOpacity??1,r.strokeWidth=this.strokeWidth??1,r.fill=void 0,r.lineDash=this.lineDash;const l=a*Math.cos(n),c=a*Math.sin(n),h=o*Math.cos(n),d=o*Math.sin(n);r.path.clear(!0),r.path.moveTo(h,d),r.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:r,type:n,ticks:o}=this;if(!e||"range"!==n||"polygon"!==r||!s||!i)return void(t.visible=!1);const{axisInnerRadius:a,axisOuterRadius:l}=this,c=o.indexOf(i[0]),h=o.indexOf(i[1]),d=(c<=h?o.slice(c,h+1):o.slice(c).concat(o.slice(0,h+1))).map(e=>s.convert(e));t.visible=!0,this.setSectorNodeProps(t);const{path:u}=t;u.clear(!0),d.forEach((e,t)=>{const i=l*Math.cos(e),s=l*Math.sin(e);0===t?u.moveTo(i,s):u.lineTo(i,s)}),0===a?u.lineTo(0,0):d.slice().reverse().forEach(e=>{const t=a*Math.cos(e),i=a*Math.sin(e);u.lineTo(t,i)}),t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:r,shape:n,type:o}=this;if(!e||"range"!==o||"circle"!==n||!r||!i)return void(t.visible=!1);const{axisInnerRadius:a,axisOuterRadius:l}=this,c=i.map(e=>r.convert(e)),h=r.step??0,d=r instanceof s.n1.BandScale?h/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=a,t.outerRadius=l,t.startAngle=c[0]-d,t.endAngle=c[1]+d,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:n,type:o,ticks:a}=this;if(!e||!1===t.enabled||!t.text||!n||"range"===o&&!s)return void(i.visible=!1);i.visible=!0;const{axisInnerRadius:l,axisOuterRadius:c}=this;let h,d,u,p;if("line"===o){const e=T(n.convert(this.value)),i=1.5*Math.PI,s=(0,r.YX)(e,i)||e>i||e<Math.PI/2,o=(l+c)/2*Math.cos(e),a=(l+c)/2*Math.sin(e);h=o+t.padding*Math.cos(e+Math.PI/2),d=a+t.padding*Math.sin(e+Math.PI/2),p=s?"top":"bottom",u=s?e:e-Math.PI}else{const[e,i]=s.map(e=>T(n.convert(e)));let o=(e+i)/2;e>i&&(o-=Math.PI),o=T(o);const l=((0,r.YX)(o,0)||o>0)&&o<Math.PI;let g;g="circle"===this.shape||a.length<3?c-t.padding:c*Math.cos(Math.PI/a.length)-t.padding,h=g*Math.cos(o),d=g*Math.sin(o),p=l?"bottom":"top",u=l?o-Math.PI/2:o+Math.PI/2}this.setLabelNodeProps(i,h,d,p,u)}};L.className="AngleCrossLine";var{ChartAxisDirection:N,TextWrapper:_,TextUtils:O,Property:F,toRadians:G,normalizeAngle360:B,normalizeAngle360Inclusive:V,Path:H,RotatableText:U,Transformable:z,BBox:W,Selection:j,Line:K}=s.n1,$=class extends s.n1.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};a([F],$.prototype,"orientation",2);var Y=class extends s.n1.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=j.select(this.tickLineGroup,K,!1),this.gridLineGroupSelection=j.select(this.gridLineGroup,K,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new s.n1.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new H),this.includeInvisibleDomains=!0}get direction(){return N.Angle}createLabel(){return new $}calculateRotations(){const e=G(this.startAngle);return{rotation:e,parallelFlipRotation:B(e),regularFlipRotation:B(e-Math.PI/2)}}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:t,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=t?i.niceDomain(s,e):e,o=this.generateAngleTicks(n);this.tickData=o;const a=o.map(e=>e.value),l=a.reduce((e,t)=>Math.max("number"==typeof t?(0,r.o3)(t):0,e),0);return{niceDomain:n,tickDomain:n,ticks:a,rawTickCount:void 0,fractionDigits:l,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=B(-Math.PI/2+G(this.startAngle));return[e,e+(null!=this.endAngle?V(G(this.endAngle)-G(this.startAngle)):2*Math.PI)]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:e,y:i,moveTo:s,arc:r,radius:n=0,startAngle:o=0,endAngle:a=0})=>{r?t.arc(e,i,n,o,a):s?t.moveTo(e,i):t.lineTo(e,i)}),s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,n]=this.range,o=(0,r.YX)(n-s,2*Math.PI),a=[];if("circle"===t)o?a.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):a.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:B(s),endAngle:B(n),arc:!0,moveTo:!1});else if("polygon"===t){const t=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(t=>e.convert(t));t&&t.length>2&&t.forEach((e,t)=>{const s=i*Math.cos(e),r=i*Math.sin(e),n=0===t;a.push({x:s,y:r,moveTo:n})})}return{points:a,closePath:o}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:r}=this;if(!(i&&t>0))return;const n=t*r,o=i.length;this.gridLineGroupSelection.each((r,a,l)=>{const{value:c}=a,{stroke:h,lineDash:d}=i[l%o],u=e.convert(c);r.x1=n*Math.cos(u),r.y1=n*Math.sin(u),r.x2=t*Math.cos(u),r.y2=t*Math.sin(u),r.stroke=h,r.strokeWidth=s,r.lineDash=d,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((t,i,s)=>{const r=this.labelData[s];r&&!r.hidden?(t.text=r.text,t.setFont(e),t.fill=e.color,t.x=r.x,t.y=r.y,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline,t.visible=!0,r.rotation?(t.rotation=r.rotation,t.rotationCenterX=r.x,t.rotationCenterY=r.y):t.rotation=0):t.visible=!1})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((s,r)=>{const{value:n}=r,o=e.convert(n),a=Math.cos(o),l=Math.sin(o);s.x1=t*a,s.y1=t*l,s.x2=(t+i.size)*a,s.y2=(t+i.size)*l,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:n,scale:o,tick:a}=this;if(!s.enabled)return[];const l=new U,c=i.x-this.translation.x,h=i.x+i.width-this.translation.x,d=e.map((i,d)=>{const{value:u}=i,p=n+s.spacing+a.size,g=o.convert(u),m=p*Math.cos(g),f=p*Math.sin(g),{textAlign:y,textBaseline:v}=this.getLabelAlign(g),C=d===e.length-1&&u!==e[0]&&(0,r.YX)(B(g),B(o.convert(e[0]))),b=this.getLabelRotation(g);let S=this.formatTick(u,d,o.domain);l.text=S,l.x=m,l.y=f,l.setFont(s),l.textAlign=y,l.textBaseline=v,l.rotation=b,b&&(l.rotationCenterX=m,l.rotationCenterY=f);let w=b?z.toCanvas(l):l.getBBox();if(w&&t.hideWhenNecessary&&!b){const e=c-w.x,t=w.x+w.width-h,i=1;if(e>i||t>i){const i=w.width-Math.max(e,t);S=_.wrapText(S,{maxWidth:i,font:s,textWrap:"never"}),S===O.EllipsisChar&&(S=""),l.text=S,w=l.getBBox()}}return{text:S,x:m,y:f,textAlign:y,textBaseline:v,hidden:""===S||i.hidden||C,rotation:b,box:w}});return s.avoidCollisions&&this.avoidLabelCollisions(d),d}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:e})=>e).filter(e=>null!=e);return this.label.enabled&&0!==i.length?W.merge(i):null}getLabelOrientation(){const{label:e}=this;return e instanceof $?e.orientation:"fixed"}getLabelRotation(e){let t=G(this.label.rotation??0);e=B(e);const i=this.getLabelOrientation();return"parallel"===i?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):"perpendicular"===i&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,n;const o=this.getLabelOrientation(),a=(0,r.YX)(t,0),l=(0,r.YX)(i,0),c=(0,r.YX)(t,1),h=(0,r.YX)(i,-1),d=t>0&&!a,u=i>0&&!l;return"parallel"===o?(s="center",n=c&&l||u?"top":"bottom"):"perpendicular"===o?(s=h||d?"left":"right",n="middle"):(s="right",a?s="center":d&&(s="left"),n="bottom",l?n="middle":u&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof L&&(s.ticks=this.tickData.map(e=>e.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i)}),super.updateCrossLines()}};Y.CrossLineConstructor=L,a([F],Y.prototype,"startAngle",2),a([F],Y.prototype,"endAngle",2);var{Property:q,CategoryScale:X}=s.n1,Z=class extends Y{constructor(e){super(e,new X),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new y}generateAngleTicks(){const{scale:e,gridLength:t}=this,{values:i,minSpacing:s}=this.interval,r=i??e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks??[];if(r.length<2||null==s)return r.map(e=>({value:e,visible:!0}));const n=r[0],o=e.convert(n),a=t*Math.cos(o),l=t*Math.sin(o);for(let i=1;i<r.length-1;i++){const c=r[i],h=e.convert(c);if(h-o>Math.PI)break;const d=t*Math.cos(h),u=t*Math.sin(h);if(Math.sqrt((d-a)**2+(u-l)**2)>s){const e=new Set([n]);return g(r,i,(t,i)=>{e.add(i)}),r.map(t=>({value:t,visible:e.has(t)}))}}return[{value:n,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(e,i)=>{if(e.hidden||i.hidden)return!1;if(null==t)return e.box.collidesBBox(i.box);const s=e.box.clone().grow(t/2),r=i.box.clone().grow(t/2);return s.collidesBBox(r)},s=e[0],n=e.at(-1),o=new Set([s]),a=(0,r.YX)(s.x,n.x)&&(0,r.YX)(s.y,n.y),l=Math.floor(e.length/2);for(let t=1;t<=l;t++){const s=a?e.slice(0,-1):e;if(!g(s,t,i)){g(s,t,(e,t)=>{o.add(t)});break}}e.forEach(e=>{o.has(e)||(e.hidden=!0,e.box=void 0)})}};Z.className="AngleCategoryAxis",Z.type="angle-category",a([q],Z.prototype,"groupPaddingInner",2),a([q],Z.prototype,"paddingInner",2),a([q],Z.prototype,"interval",2);var Q={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:e=>new Z(e)},{range:J,isDenseInterval:ee,LinearScale:te}=s.n1,ie=class e extends te{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,t){const[i,s]=t;let r=te.getTickStep(i,s,e);const n=isNaN(e.maxTickCount)?1/0:e.maxTickCount,o=Math.abs(s-i)/r;let a=Math.pow(2,Math.ceil(Math.log(o)/Math.log(2)));return a>n&&(a/=2,r*=2),{count:a,step:r}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(e=>!isFinite(e))||s<=0)return{ticks:[],count:0};const{nice:r,interval:n}=t,[o,a]=i;if(n){const e=Math.abs(n),t=this.getPixelRange();if(!ee((a-o)/e,t))return J(o,a,e)}let l;if(r&&this.hasNiceRange()){const s=super.niceDomain(t,i);l=e.getNiceStepAndTickCount(t,s).step}else l=te.getTickStep(o,a,t);return J(o,a,l)}hasNiceRange(){const e=this.range.slice().sort((e,t)=>e-t);return[Math.PI,2*Math.PI].some(t=>(0,r.YX)(t,e[1]-e[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const r=s[0]>s[1],n=r?s[1]:s[0],{step:o,count:a}=e.getNiceStepAndTickCount(t,s),l=1/o,c=o>=1?Math.ceil(n/o+a)*o:Math.ceil((n+a*o)*l)/l;return r?[c,n]:[n,c]}getPixelRange(){return this.arcLength}},{Property:se,angleBetween:re,normalisedExtentWithMetadata:ne,findMinMax:oe}=s.n1,ae=class extends Y{constructor(e){super(e,new ie),this.shape="circle",this.interval=new y}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=ne(e,t,i);return{domain:s,clipped:r}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e);return(re(t,i)||2*Math.PI)*this.gridLength}generateAngleTicks(e){const{scale:t,range:i,nice:s}=this,{values:r,step:n,minSpacing:o,maxSpacing:a}=this.interval;let l;if(null==r){const{arcLength:r}=t,c=a?Math.floor(r/a):1,h=o?Math.floor(r/o):1/0,d=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),u={nice:s,interval:n,tickCount:Math.max(c,Math.min(h,d)),minTickCount:c,maxTickCount:h};l=t.ticks(u,e)?.ticks??[]}else{const[t,i]=oe(e.map(Number));l=r.filter(e=>e>=t&&e<=i).sort((e,t)=>e-t)}return l.map(e=>({value:e,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(e,i)=>{if(e.hidden||i.hidden)return!1;if(null==t)return e.box.collidesBBox(i.box);const s=e.box.clone().grow(t/2),r=i.box.clone().grow(t/2);return s.collidesBBox(r)},s=e[0],n=e.at(-1);s!==n&&(0,r.YX)(s.x,n.x)&&(0,r.YX)(s.y,n.y)&&(n.hidden=!0);for(let t=1;t<e.length;t*=2){let s=!1;for(let r=t;r<e.length;r+=t){const n=e[r];if(i(e[r-t],n)){s=!0;break}}if(!s)return void e.forEach((e,i)=>{i%t>0&&(e.hidden=!0,e.box=void 0)})}e.forEach((e,t)=>{t>0&&(e.hidden=!0,e.box=void 0)})}};ae.className="AngleNumberAxis",ae.type="angle-number",a([se],ae.prototype,"min",2),a([se],ae.prototype,"max",2),a([se],ae.prototype,"interval",2);var le={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:e=>new ae(e)},{OrdinalTimeScale:ce,Property:he,TimeAxisParentLevel:de}=s.n1,ue=class extends s.n1.CategoryAxis{constructor(e){super(e,new ce),this.parentLevel=new de}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}};ue.className="OrdinalTimeAxis",ue.type="ordinal-time",a([he],ue.prototype,"parentLevel",2);var pe={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:e=>new ue(e)},{ChartAxisDirection:ge,Property:me,getCrossLineValue:fe,validateCrossLineValue:ye,normalizeAngle360FromDegrees:ve,Group:Ce,Path:be,Sector:Se,RotatableText:we}=s.n1,xe=class extends w{constructor(){super(...arguments),this.positionAngle=void 0}};a([me],xe.prototype,"positionAngle",2);var Ee=class extends x{constructor(){super(),this.direction=ge.Radius,this.label=new xe,this.polygonNode=new be,this.sectorNode=new Se,this.crossLineRange=new Ce,this.labelNode=new we,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!ye(fe(this),t))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.updateRadii();const{innerRadius:i,outerRadius:s}=this;e&&(e=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup("range"===this.type,this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:r}=this;if(!t)return{innerRadius:0,outerRadius:0};const n=e=>r+s-e;let o,a;if("line"===i)o=n(t.convert(this.value)),a=o;else{const i=Math.abs(t?.bandwidth??0),s=e.map(e=>t.convert(e));o=n(Math.max(...s)),a=n(Math.min(...s))+i}this.outerRadius=o,this.innerRadius=a}drawPolygon(e,t,i){t.forEach((t,s)=>{const r=e*Math.cos(t),n=e*Math.sin(t);0===s?i.path.moveTo(r,n):i.path.lineTo(r,n)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:r,type:n,innerRadius:o,outerRadius:a}=this;if(!e||"polygon"!==r||!s||!t)return void(i.visible=!1);i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(a-l,t,i);const c=t.slice().reverse(),h="line"===n?a-l:o+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:n,shape:o,innerRadius:a,outerRadius:l}=this;if(!e||"circle"!==o||!s)return void(n.visible=!1);n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const c=this.getPadding(),h=(0,r.qE)(t,a+c,i),d=(0,r.qE)(t,l-c,i);n.innerRadius=Math.min(h,d),n.outerRadius=Math.max(h,d),this.setSectorNodeProps(n)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:n,shape:o,type:a}=this;if(!e||!1===i.enabled||!i.text||!n)return void(s.visible=!1);const l=ve((i.positionAngle??0)-90),c=((0,r.YX)(l,0)||l>0)&&l<Math.PI,h=c?l-Math.PI/2:l+Math.PI/2;let d;const u=this.gridAngles??[];d="line"===a?t+i.padding:"circle"===o||u.length<3?t-i.padding:t*Math.cos(Math.PI/u.length)-i.padding;const p=d*Math.cos(l),g=d*Math.sin(l);let m;m="line"===a?c?"top":"bottom":c?"bottom":"top",this.setLabelNodeProps(s,p,g,m,h)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof s.n1.BandScale?(i-t)/2:0}};Ee.className="RadiusCrossLine";var{ChartAxisDirection:Me,ZIndexMap:Ae,Property:Te,normalizeAngle360:De,toRadians:Ie,Caption:Re,Group:Pe,TransformableGroup:ke,Path:Le,Line:Ne,Selection:_e,AxisTickGenerator:Oe,AxisGroupZIndexMap:Fe}=s.n1,Ge=class extends s.n1.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};a([Te],Ge.prototype,"autoRotate",2),a([Te],Ge.prototype,"autoRotateAngle",2);var Be=class extends s.n1.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=_e.select(this.gridLineGroup,Ne,!1),this.tickGenerator=new Oe(this),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new ke({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new ke({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Ne({name:`${this.id}-Axis-line`,zIndex:Fe.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Pe({name:`${this.id}-gridPaths`,zIndex:Ae.AXIS_GRID})),this.gridPathSelection=_e.select(this.gridPathGroup,Le),this.headingLabelGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return Me.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,r=e*s,n=Ie(i);return{translationX:t.x,translationY:t.y-e-r,rotation:n,rotationCenterX:0,rotationCenterY:e+r}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const s=-Math.PI/2,r=this.label.getSideFlag(),n=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),o=this.tickGenerator.generateTicks({domain:e,niceMode:t,visibleRange:[0,1],primaryTickCount:void 0,parallelFlipRotation:0,regularFlipRotation:s,labelX:n,sideFlag:r,removeOverflowLabels:!1}),{tickData:a}=o,{ticks:l,rawTicks:c,rawTickCount:h,tickDomain:d,fractionDigits:u,niceDomain:p=e}=a,g=l.map(e=>this.getTickLabelProps(e,o));return this.generatedTicks={ticks:l,labels:g},{ticks:c,tickDomain:d,niceDomain:p,rawTickCount:h,fractionDigits:u,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=s.n1.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const n=e.length,[o,a]=this.gridRange??[0,2*Math.PI],l=(0,r.YX)(a-o,2*Math.PI),c="circle"===i?(e,t)=>{const{path:i}=e;i.clear(!0);const s=this.getTickRadius(t);l?(i.moveTo(s,0),i.arc(0,0,s,0,2*Math.PI)):(i.moveTo(s*Math.cos(o),s*Math.sin(o)),i.arc(0,0,s,De(o),De(a))),l&&i.closePath()}:(e,t)=>{const{path:i}=e,s=this.gridAngles;if(i.clear(!0),!s||s.length<3)return;const r=this.getTickRadius(t);s.forEach((e,t)=>{const n=r*Math.cos(e),o=r*Math.sin(e);0===t?i.moveTo(n,o):i.lineTo(n,o),s.forEach((e,t)=>{const s=r*Math.cos(e),n=r*Math.sin(e);0===t?i.moveTo(s,n):i.lineTo(s,n)}),i.closePath()}),i.closePath()};this.gridPathSelection.each((i,s,r)=>{((i,s)=>{const{stroke:r,lineDash:o}=e[s%n];i.stroke=r,i.strokeWidth=t,i.lineDash=o,i.fill=void 0})(i,r),c(i,s)})}updateTitle(){const e=e=>e.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let r=!1;const n=t.caption.node;t.enabled&&(r=!0,n.rotation=Math.PI/2,n.x=Math.floor((i[0]+i[1])/2),n.y=-Re.SMALL_PADDING,n.textAlign="center",n.textBaseline="bottom",n.text=this.callWithContext(s,this.getTitleFormatterParams(this.scale.domain))),n.visible=r}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof Ee){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:r}=this,n=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=n,e.axisInnerRadius=n*r}}),super.updateCrossLines()}createLabel(){return new Ge}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:r,textAlign:n}=t,o=this.scale.range,a=e.tickLabel??"",l=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),c=""!==a&&null!=a,h=s;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:h,text:a,textAlign:n,textBaseline:r,visible:c,x:l,y:e.translationY,rotationCenterX:l,rotationCenterY:e.translationY,range:o}}};Be.CrossLineConstructor=Ee,a([Te],Be.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:Ve,Property:He,CategoryScale:Ue}=s.n1,ze=class extends Be{constructor(e){super(e,new Ue),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],r=s*i;if(Ue.is(t)){const i=t.domain,s=i.length-1-i.indexOf(e.tick);return 0===s?r:t.inset+t.step*(s-.5)+t.bandwidth/2}{const i=(s-r)/t.domain.length;return s-e.translationY+r-i/2}}};ze.className="RadiusCategoryAxis",ze.type="radius-category",a([He],ze.prototype,"groupPaddingInner",2),a([Ve("scale","paddingInner"),He],ze.prototype,"paddingInner",2),a([Ve("scale","paddingOuter"),He],ze.prototype,"paddingOuter",2);var We={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:e=>new ze(e)},{Property:je,normalisedExtentWithMetadata:Ke,LinearScale:$e}=s.n1,Ye=class extends Be{constructor(e){super(e,new $e),this.shape="polygon"}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:e})=>e!==i).sort((e,t)=>t.tick-e.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translationY+s}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=Ke(e,t,i);return{domain:s,clipped:r}}};Ye.className="RadiusNumberAxis",Ye.type="radius-number",a([je],Ye.prototype,"min",2),a([je],Ye.prototype,"max",2);var qe={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:e=>new Ye(e)},{ObserveChanges:Xe,Property:Ze}=s.n1,Qe=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.destroyFns.push(()=>{e.animationManager.skip(!0)})}};a([Xe((e,t)=>{e.ctx.animationManager.skip(!t)}),Ze],Qe.prototype,"enabled",2),a([Xe((e,t)=>{e.ctx.animationManager.defaultDuration=t}),Ze],Qe.prototype,"duration",2);var Je={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Qe(e),themeTemplate:{animation:{enabled:!0}}},{focusCursorAtEnd:et}=s.n1,tt="text-input",it="canvas-overlay",st=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(it,tt),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>e.domManager.removeChild(it,tt))}setKeyDownHandler(e){this.element.addEventListener("keydown",e),this.destroyFns.push(()=>this.element.removeEventListener("keydown",e))}show(e){this.element.innerHTML='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>';const t=this.element.firstElementChild;(0,r.Bq)(t,"data-preventdefault",!1),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight="number"==typeof e.styles?.fontWeight?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",et(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",e=>{e.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:r,getTextPosition:n,alignment:o,textAlign:a}=this.layout;e.style.setProperty("width",s?`${s}px`:"unset");const l=t.getBoundingClientRect(),c=r(l.height);let h=c.x;"center"===o?h-=(s??l.width)/2:"right"===o&&(h-=s??l.width);const d=n();let u=c.y;"center"===d?u-=l.height/2:"bottom"===d&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",i.width-h+"px"),e.style.setProperty("text-align",o),t.style.setProperty("text-align",a)}getBBox(){const{left:e,top:t,width:i,height:r}=this.element.getBoundingClientRect();return new s.n1.BBox(e,t,i,r)}},{BaseProperties:rt,Property:nt}=s.n1,ot=class extends rt{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};a([nt],ot.prototype,"enabled",2),a([nt],ot.prototype,"axes",2);var at=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(at||{}),lt=Object.values(at),{BaseProperties:ct,Property:ht}=s.n1,dt=class extends ct{};a([ht],dt.prototype,"x",2),a([ht],dt.prototype,"y",2);var ut=class extends(Pt(kt(It(ct)))){},pt=class extends(Pt(kt(Rt(At(Lt(ct)))))){constructor(){super(...arguments),this.cornerRadius=2}};a([ht],pt.prototype,"enabled",2),a([ht],pt.prototype,"cornerRadius",2);var gt=class extends(Rt(ct)){},mt=class extends(Pt(kt(Rt(ct)))){},ft=class extends(Lt(ct)){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};a([ht],ft.prototype,"label",2),a([ht],ft.prototype,"position",2),a([ht],ft.prototype,"alignment",2);var yt=class extends(Lt(ct)){},vt=class extends(Lt(ct)){constructor(){super(...arguments),this.label=""}};function Ct(e){class t extends(function(e){class t extends e{}return a([ht],t.prototype,"locked",2),t}(It(e))){constructor(){super(...arguments),this.id=(0,r.lk)()}}return t}function bt(e){class t extends e{constructor(){super(...arguments),this.start=new dt,this.end=new dt}}return a([ht],t.prototype,"start",2),a([ht],t.prototype,"end",2),t}function St(e){class t extends e{}return a([ht],t.prototype,"x",2),a([ht],t.prototype,"y",2),t}function wt(e){class t extends e{}return a([ht],t.prototype,"value",2),t}function xt(e){class t extends e{constructor(){super(...arguments),this.background=new gt}}return a([ht],t.prototype,"background",2),t}function Et(e){class t extends e{constructor(){super(...arguments),this.handle=new mt}}return a([ht],t.prototype,"handle",2),t}function Mt(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new pt}}return a([ht],t.prototype,"axisLabel",2),t}function At(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return a([ht],t.prototype,"padding",2),a([ht],t.prototype,"textAlign",2),a([ht],t.prototype,"formatter",2),t}function Tt(e){class t extends e{}return a([ht],t.prototype,"extendStart",2),a([ht],t.prototype,"extendEnd",2),t}function Dt(e){return class extends e{setLocaleManager(e){this.localeManager??(this.localeManager=e)}}}function It(e){class t extends e{}return a([ht],t.prototype,"visible",2),t}function Rt(e){class t extends e{}return a([ht],t.prototype,"fill",2),a([ht],t.prototype,"fillOpacity",2),t}function Pt(e){class t extends e{}return a([ht],t.prototype,"stroke",2),a([ht],t.prototype,"strokeOpacity",2),a([ht],t.prototype,"strokeWidth",2),t}function kt(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return a([ht],t.prototype,"lineDash",2),a([ht],t.prototype,"lineDashOffset",2),a([ht],t.prototype,"lineStyle",2),t}function Lt(e){class t extends e{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return a([ht],t.prototype,"fontStyle",2),a([ht],t.prototype,"fontWeight",2),a([ht],t.prototype,"fontSize",2),a([ht],t.prototype,"fontFamily",2),a([ht],t.prototype,"color",2),t}function Nt(e){return(0,r.Et)(e)||(0,r.Kg)(e)||(0,r.$P)(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function _t(e){return Nt(e)?.value}a([ht],vt.prototype,"label",2),a([ht],vt.prototype,"position",2),a([ht],vt.prototype,"alignment",2);var{clampArray:Ot}=s.n1;function Ft(e,t){if(null==e.start||null==e.end)return;const i=Gt(e.start,t),s=Gt(e.end,t);return null!=i&&null!=s?{x1:i.x,y1:i.y,x2:s.x,y2:s.y}:void 0}function Gt(e,t){return{x:Bt(e.x,t.xAxis),y:Bt(e.y,t.yAxis)}}function Bt(e,t){if(null==e)return 0;const{value:i,groupPercentage:s}=Nt(e),{scale:r,snapToGroup:n}=t,o=0===r.bandwidth?r.step??0:r.bandwidth??0,a=n?o/2:o*s;return r.convert(i)+a}function Vt(e,t){return{x:Ht(e.x,t.xAxis),y:Ht(e.y,t.yAxis)}}function Ht(e,t){const{scale:i}=t;if(t.continuous&&null==i.step)return t.scaleInvert(e);const s=t.scaleInvertNearest(e),r=0===i.bandwidth?i.step:i.bandwidth??0,n=i.convert(s),o=n+r,a=Ot(e,i.range);return{value:s,groupPercentage:n===o?0:(a-n)/(o-n)}}var{BaseProperties:Ut}=s.n1,zt=class extends(Ct(bt(Et(Ut)))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},{Property:Wt}=s.n1,jt=class extends(Dt(At(Lt(zt)))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=0==this.text.length;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return Gt(this.end,e)}getTextPosition(){return this.position}};a([Wt],jt.prototype,"text",2);var{Property:Kt,Color:$t}=s.n1,Yt={top:6,right:12,bottom:9,left:12},qt=class extends(Rt(Pt(jt))){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return(0,r.Gv)(e)&&"callout"===e.type}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=$t.fromString(this.color??"#888888");return new $t(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return null==e?{...Yt}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding(),r=s.left??0,n=s.bottom??0;return{x:i.x+r,y:i.y-n}}};a([Kt],qt.prototype,"type",2);var{BaseProperties:Xt,Property:Zt}=s.n1,Qt=class extends(Ct(St(Et(At(Lt(Xt)))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=0==this.text.length;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return Gt(this,e)}getTextPosition(){return this.position}};a([Zt],Qt.prototype,"text",2);var{Property:Jt,Color:ei}=s.n1,ti=class extends(Rt(Pt(Qt))){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return(0,r.Gv)(e)&&"comment"===e.type}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=ei.fromString(this.color??"#888888");return new ei(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return null==e?{top:Math.max(.4*t,8),bottom:Math.max(.4*t,8),left:Math.max(.8*t,14),right:Math.max(.8*t,14)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};a([Jt],ti.prototype,"type",2);var{Vec2:ii}=s.n1;function si(e,t){return e?"dashed":t??"solid"}function ri(e,t){switch(t){case"solid":return[];case"dashed":return[4*e,2*e];case"dotted":return[0,2*e]}}function ni(e,t,i,s){const r=si(e,i);return t??e??ri(s??1,r)}function oi(e,t,i){const s=si(t,i);return e??"dotted"===s?"round":void 0}var{BaseProperties:ai,Property:li}=s.n1,ci=class extends(Pt(ai)){},hi=class extends(Lt(Rt(Pt(ai)))){constructor(){super(...arguments),this.divider=new ci}};a([li],hi.prototype,"divider",2);var di=class extends(Rt(Pt(Et(ai)))){constructor(){super(...arguments),this.statistics=new hi}};a([li],di.prototype,"statistics",2);var ui=class extends(Dt(xt(Pt(kt(zt))))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new hi,this.getVolume=()=>{},this.text=new ft}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ni(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};function pi(e){return class extends e{constructor(){super(...arguments),this.hasDateRange=!0}}}function gi(e){return class extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}}a([li],ui.prototype,"statistics",2),a([li],ui.prototype,"text",2);var mi=class extends(pi(ui)){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return(0,r.Gv)(e)&&"date-range"===e.type}};a([li],mi.prototype,"type",2),a([li],mi.prototype,"extendAbove",2),a([li],mi.prototype,"extendBelow",2);var fi=class extends(gi(ui)){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return(0,r.Gv)(e)&&"price-range"===e.type}};a([li],fi.prototype,"type",2),a([li],fi.prototype,"extendLeft",2),a([li],fi.prototype,"extendRight",2);var yi=class extends(pi(gi(ui))){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return(0,r.Gv)(e)&&"date-price-range"===e.type}};a([li],yi.prototype,"type",2);var vi=class extends(pi(gi(ui))){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new di,this.down=new di,this.direction="both"}static is(e){return(0,r.Gv)(e)&&"quick-date-price-range"===e.type}};a([li],vi.prototype,"type",2),a([li],vi.prototype,"up",2),a([li],vi.prototype,"down",2);var{TextWrapper:Ci,CachedTextMeasurerPool:bi,BBox:Si}=s.n1,wi=1.38;function xi(e){return{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},textAlign:e.textAlign,textBaseline:"center"==e.position?"middle":e.position,lineHeight:wi,avoidOrphans:!1,textWrap:"always"}}function Ei(e,t,i){return i?Ci.wrapText(t,{...xi(e),maxWidth:i}):t}function Mi(e,t,i,s){let r=s?.width??0,n=s?.height??0;if(!s){const i=null!=e.width?Ei(e,t,e.width):t;({width:r,height:n}=function(e,t){const i=xi(e),{lineMetrics:s,width:r}=bi.measureLines(t,i);return{width:r,height:s.length*(e.fontSize??14)*wi}}(e,i))}return new Si(i.x,i.y,r,n)}function Ai(e,t,i,s,{x:r,y:n},o){const{visible:a=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=s,p=c*wi;o??(o="center"==s.position?"middle":s.position);const g=i?s.getPlaceholderColor():s.color;e.setProperties({x:r,y:n,visible:a,text:t,fill:g,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:o})}var{BaseProperties:Ti,Property:Di}=s.n1,Ii=class extends(Rt(Pt(Ti))){},Ri=class extends(Rt(Pt(Qt))){constructor(){super(...arguments),this.type="note",this.background=new Ii,this.position="bottom",this.alignment="center",this.width=200}static is(e){return(0,r.Gv)(e)&&"note"===e.type}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??10;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,n=super.getTextInputCoords(e,t),o=this.getPadding().top,a=Mi(this,s,n);a.x=(0,r.qE)(i/2,a.x,e.seriesRect.width-i/2);const l=a.y-30-2*o,c=a.y+11+2*o;return l-Math.max(a.height,t)-34<0?(a.y=c,this.position="top"):(a.y=l+o,this.position="bottom"),{x:a.x,y:a.y}}};a([Di],Ri.prototype,"type",2),a([Di],Ri.prototype,"background",2);var{BaseProperties:Pi}=s.n1,ki=class extends(Ct(St(Et(Pi)))){getDefaultColor(e){}getDefaultOpacity(e){}},Li=class e extends(Rt(ki)){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof e}getDefaultColor(e){return"fill-color"===e?this.fill:void 0}getDefaultOpacity(e){return"fill-color"===e?this.fillOpacity:void 0}},{BaseProperties:Ni,Property:_i}=s.n1,Oi=class extends(Ct(wt(Et(Mt(Pt(kt(Ni))))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new ft}static is(e){return(0,r.Gv)(e)&&"horizontal-line"===e.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ni(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([_i],Oi.prototype,"type",2),a([_i],Oi.prototype,"text",2);var Fi=class extends(Ct(wt(Et(Mt(Pt(kt(Ni))))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new ft}static is(e){return(0,r.Gv)(e)&&"vertical-line"===e.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ni(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([_i],Fi.prototype,"type",2),a([_i],Fi.prototype,"text",2);var{BaseProperties:Gi,Property:Bi}=s.n1,Vi=class extends(Ct(xt(bt(Et(Tt(Pt(kt(Gi)))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new vt,this.snapToAngle=45}static is(e){return(0,r.Gv)(e)&&"disjoint-channel"===e.type}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return"number"==typeof e.start.y&&"number"==typeof e.end.y?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):r.Vy.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ni(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Bi],Vi.prototype,"type",2),a([Bi],Vi.prototype,"startHeight",2),a([Bi],Vi.prototype,"endHeight",2),a([Bi],Vi.prototype,"text",2);var{Property:Hi}=s.n1,Ui=class extends(Dt(function(e){return class extends e{}}(Tt(Pt(kt(zt)))))){constructor(){super(...arguments),this.text=new ft}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ni(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Hi],Ui.prototype,"text",2);var zi=class extends Ui{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return(0,r.Gv)(e)&&"arrow"===e.type}};a([Hi],zi.prototype,"type",2);var Wi=class extends Ui{constructor(){super(...arguments),this.type="line"}static is(e){return(0,r.Gv)(e)&&"line"===e.type}};a([Hi],Wi.prototype,"type",2);var{Property:ji}=s.n1,Ki=class extends Ui{constructor(){super(...arguments),this.label=new yt,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};a([ji],Ki.prototype,"label",2),a([ji],Ki.prototype,"reverse",2),a([ji],Ki.prototype,"showFill",2),a([ji],Ki.prototype,"isMultiColor",2),a([ji],Ki.prototype,"strokes",2),a([ji],Ki.prototype,"rangeStroke",2),a([ji],Ki.prototype,"bands",2);var{Property:$i}=s.n1,Yi=class extends Ki{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new dt}static is(e){return(0,r.Gv)(e)&&"fibonacci-retracement-trend-based"===e.type}};a([$i],Yi.prototype,"type",2),a([$i],Yi.prototype,"endRetracement",2);var{Property:qi}=s.n1,Xi=class extends Ki{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return(0,r.Gv)(e)&&"fibonacci-retracement"===e.type}};a([qi],Xi.prototype,"type",2);var{BaseProperties:Zi,Property:Qi}=s.n1,Ji=class extends(Ct(xt(bt(Et(Tt(Pt(kt(Zi)))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new ut,this.text=new vt,this.snapToAngle=45}static is(e){return(0,r.Gv)(e)&&"parallel-channel"===e.type}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return"number"==typeof e.start.y&&"number"==typeof e.end.y?(e.start.y-=this.height,e.end.y-=this.height):r.Vy.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ni(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Qi],Ji.prototype,"type",2),a([Qi],Ji.prototype,"height",2),a([Qi],Ji.prototype,"middle",2),a([Qi],Ji.prototype,"text",2);var{Property:es}=s.n1,ts=class extends Qt{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return(0,r.Gv)(e)&&"text"===e.type}};function is(e){return vi.is(e)}function ss(e){return Wi.is(e)||Oi.is(e)||Fi.is(e)||zi.is(e)||ns(e)}function rs(e){return Vi.is(e)||Ji.is(e)}function ns(e){return Xi.is(e)||Yi.is(e)}function os(e){return qt.is(e)||ti.is(e)||Ri.is(e)||ts.is(e)}function as(e){return mi.is(e)||fi.is(e)||yi.is(e)||vi.is(e)}function ls(e){return os(e)&&!Ri.is(e)}function cs(e){return ss(e)||rs(e)||as(e)&&!vi.is(e)}function hs(e){return ss(e)||rs(e)||as(e)||qt.is(e)||Ri.is(e)}function ds(e){return rs(e)||as(e)||qt.is(e)||ti.is(e)||Li.is(e)}function us(e){return os(e)&&!Ri.is(e)}function ps(e){return(ss(e)||rs(e)||as(e))&&!is(e)&&(0,r.Gv)(e.text)}function gs(e,t){"fontSize"in e&&(e.fontSize=t),ps(e)&&(e.text.fontSize=t)}function ms(e,t){const i=t?.strokeWidth??e.strokeWidth??1,s=t?.type??e.lineStyle,r=s??si(e.lineDash,s),n=ri(i,r);e.strokeWidth=i,e.computedLineDash=n,e.lineStyle=r,e.lineCap="dotted"===r?"round":void 0}function fs(e,t,i,s,r,n){switch(t){case"fill-color":"fill"in e&&(e.fill=s),"fillOpacity"in e&&(e.fillOpacity=r),"background"in e&&(e.background.fill=s,e.background.fillOpacity=r);break;case"line-color":"axisLabel"in e&&(e.axisLabel.fill=s,e.axisLabel.fillOpacity=r,e.axisLabel.stroke=s,e.axisLabel.strokeOpacity=r),"fill"in e&&"fillOpacity"in e&&function(e){return Ri.is(e)}(e)?(e.fill=s,e.fillOpacity=r):("strokeOpacity"in e&&(e.strokeOpacity=r),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=n,e.rangeStroke=s):"stroke"in e&&(e.stroke=s));break;case"text-color":"color"in e&&(e.color=i),ps(e)&&(e.text.color=s)}}a([es],ts.prototype,"type",2);var{deepClone:ys}=s.n1,vs=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(at).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:ys(this.colors),fontSizes:ys(this.fontSizes),lineStyles:ys(this.lineStyles),lineTextAlignments:ys(this.lineTextAlignments),lineTextPositions:ys(this.lineTextPositions),fibonacciOptions:ys(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=ys(i.colors),this.fontSizes=ys(i.fontSizes),this.lineStyles=ys(i.lineStyles),this.lineTextAlignments=ys(i.lineTextAlignments),this.lineTextPositions=ys(i.lineTextPositions),this.fibonacciOptions=ys(i.fibonacciOptions)}setDefaultColor(e,t,i,s,r,n){this.colors.get(e)?.set(t,[i,s,r,n])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if("fibonacci-retracement"!=e&&"fibonacci-retracement-trend-based"!=e)return;const s=this.fibonacciOptions.get(e);s[t]=i,this.fibonacciOptions.set(e,s)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[t,[s,r,n,o]=[]]of i)s&&r&&null!=n&&null!=o&&fs(e,t,s,r,n,o);for(const[t,i]of this.fontSizes)e.type===t&&null!=i&&gs(e,i);for(const[t,i]of this.lineStyles)e.type===t&&null!=i&&ms(e,i);for(const[t,i]of this.lineTextPositions)e.type===t&&null!=i&&(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type===t&&null!=i&&(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)e.type===t&&null!=i&&Object.keys(i).forEach(t=>{const s=i[t];null!=s&&e.set({[t]:s})})}},{Color:Cs}=s.n1,bs=e=>{try{const t=Cs.fromString(e),[i,s,r]=t.toHSB();return[i,s,r,t.a]}catch{return}},Ss=class extends s.n1.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),s=this.showWithChildren([t],{initialFocus:i,...e});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(e){let t=e.isMultiColor??!1,[i,s,n,o]=bs(e.color??"#f00")??[0,1,.5,1];o=e.opacity??o;const a=(0,r.n)("div","ag-charts-color-picker__content");a.innerHTML='<div class="ag-charts-color-picker__palette" tabindex="0"></div><div class="ag-charts-color-picker__color-row"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field"><span class="ag-charts-color-picker__color-label">Color</span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',a.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=a.querySelector(".ag-charts-color-picker__palette"),c=a.querySelector(".ag-charts-color-picker__hue-input"),h=a.querySelector(".ag-charts-color-picker__multi-color-button"),d=a.querySelector(".ag-charts-color-picker__alpha-input"),u=a.querySelector(".ag-charts-color-picker__color-input"),p=a.querySelector(".ag-charts-color-picker__color-label");h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const g=(r=!0)=>{const l=Cs.fromHSB(i,s,n,o).toHexString();if(a.style.setProperty("--h",`${i}`),a.style.setProperty("--s",`${s}`),a.style.setProperty("--v",`${n}`),a.style.setProperty("--a",`${o}`),a.style.setProperty("--color",l.slice(0,7)),a.style.setProperty("--color-a",l),c.value=`${i}`,d.value=`${o}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",1===o),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",t),p.classList.toggle("ag-charts-color-picker__color-label--multi-color",t),document.activeElement!==u&&(u.value=t?"Multi Colour":l.toUpperCase()),r||null==e.color){const r=Cs.fromHSB(i,s,n,1).toHexString();e.onChange?.(l,r,o,t)}r&&(this.hasChanged=!0)};g(!1);const m=e=>e.preventDefault(),f=e=>e.stopPropagation();return a.addEventListener("mousedown",f),a.addEventListener("touchstart",f),a.addEventListener("touchmove",f),a.addEventListener("keydown",e=>{switch(e.stopPropagation(),e.key){case"Enter":case"Escape":this.hide();break;default:return}e.preventDefault()}),l.addEventListener("pointerdown",e=>{e.preventDefault();const i=e.currentTarget;i.focus();const r=i.getBoundingClientRect(),o=({clientX:e,clientY:i})=>{t=!1,s=Math.min(Math.max((e-r.left)/r.width,0),1),n=1-Math.min(Math.max((i-r.top)/r.height,0),1),g()};o(e),window.addEventListener("pointermove",o),window.addEventListener("pointerup",()=>{window.removeEventListener("pointermove",o)},{once:!0})}),l.addEventListener("touchstart",m,{passive:!1}),l.addEventListener("touchmove",m,{passive:!1}),l.addEventListener("keydown",e=>{if("ArrowLeft"===e.key)s=(0,r.qE)(0,s-.01,1);else if("ArrowRight"===e.key)s=(0,r.qE)(0,s+.01,1);else if("ArrowUp"===e.key)n=(0,r.qE)(0,n+.01,1);else{if("ArrowDown"!==e.key)return;n=(0,r.qE)(0,n-.01,1)}e.preventDefault(),g()}),h.addEventListener("click",()=>{t=!t,g()}),c.addEventListener("input",e=>{t=!1,i=e.currentTarget.valueAsNumber??0,g()}),d.addEventListener("input",e=>{t=!1,o=e.currentTarget.valueAsNumber??0,g()}),u.addEventListener("input",e=>{t=!1;const r=bs(e.currentTarget.value);null!=r&&([i,s,n,o]=r,g())}),u.addEventListener("blur",()=>g()),u.addEventListener("keydown",e=>{"Enter"===e.key&&(e.currentTarget.blur(),g())}),{element:a,initialFocus:l}}};function ws(e){return!(e instanceof s.n1.LogScale||e instanceof s.n1.BandScale)}var xs=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:ws},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:ws}],Es=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],Ms=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],As=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],Ts=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],Ds=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],Is=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],Rs=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],Ps=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{Color:ks,FloatingToolbar:Ls,Listeners:Ns,Menu:_s,PropertiesArray:Os,ToolbarButtonProperties:Fs,ToolbarButtonWidget:Gs,Property:Bs}=s.n1,Vs=class extends Fs{constructor(){super(...arguments),this.checkedOverrides=new Fs}};a([Bs],Vs.prototype,"value",2),a([Bs],Vs.prototype,"checkedOverrides",2),a([Bs],Vs.prototype,"color",2),a([Bs],Vs.prototype,"strokeWidth",2),a([Bs],Vs.prototype,"isMultiColor",2);var Hs=class extends Gs{update(e){super.update(e),"line-stroke-width"===e.value&&this.updateLineStrokeWidth(e),"fill-color"!==e.value&&"line-color"!==e.value&&"text-color"!==e.value||this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},Us=class extends Ls{createButtonWidget(){return new Hs(this.localeManager)}},zs=class extends s.n1.BaseProperties{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new Os(Vs),this.destroyFns=[],this.events=new Ns,this.visibleButtons=[],this.toolbar=new Us(this.ctx,"annotation-options"),this.colorPicker=new Ss(this.ctx),this.textSizeMenu=new _s(this.ctx,"text-size"),this.lineStyleTypeMenu=new _s(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new _s(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const e of this.destroyFns)e()}addListener(e,t){return this.events.addListener(e,t)}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":cs(e),"line-stroke-width":cs(e),"line-color":hs(e),"text-color":us(e),"fill-color":ds(e),"text-size":ls(e),settings:ps(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(e=>t[e.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(null!=t&&null!=i){const{r:e,g:s,b:r}=ks.fromString(t);t=ks.fromArray([e,s,r,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:null!=e?String(e):void 0})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}dispatch(e,t){this.events.dispatch(e,t)}onButtonPress({event:e,button:t}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),t.value){case"line-style-type":{const t=cs(i)?si(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:Rs,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:t,sourceEvent:e.sourceEvent,onPress:e=>this.onLineStyleTypeMenuPress(e,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const t=cs(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:Is,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:t,sourceEvent:e.sourceEvent,onPress:e=>this.onLineStrokeWidthMenuPress(e,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:i?.getDefaultColor(t.value),opacity:i?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:null!=i?this.onColorPickerChange.bind(this,t.value,i):void 0,onChangeHide:(e=>{this.dispatch("saved-color",{type:i.type,colorPickerType:t.value,color:i.getDefaultColor(e)})}).bind(this,t.value)});break;case"text-size":{const t=os(i)?i.fontSize:void 0;this.textSizeMenu.show({items:Ps,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:t,sourceEvent:e.sourceEvent,onPress:e=>this.onTextSizeMenuPress(e,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":this.dispatch("pressed-delete");break;case"lock":i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break;case"settings":this.toolbar.toggleActiveButtonByIndex(t.index),this.dispatch("pressed-settings",e)}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,s={x:i.x,y:i.y+i.height+4},r={y:i.y-4};this.colorPicker.setAnchor(s,r);for(const[e,i]of t.entries()){const t=this.visibleButtons.at(e);if(!t)continue;const s={x:i.x,y:i.y+i.height-1},r={y:i.y};switch(t.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(s,r);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(s,r);break;case"text-size":this.textSizeMenu.setAnchor(s,r)}}}onColorPickerChange(e,t,i,s,r,n){this.dispatch("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:s,opacity:r,isMultiColor:n}),this.updateColorPickerColor(e,i,r,n)}onTextSizeMenuPress(e,t){if(!ls(t))return;const i=e.value;this.dispatch("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!cs(t))return;const i=e.value;this.dispatch("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!cs(t))return;const i=e.value;this.dispatch("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[e,i]of this.visibleButtons.entries())i&&("lock"===i.value?(this.toolbar.toggleSwitchCheckedByIndex(e,t),this.updateButtonByIndex(e,t?i.checkedOverrides.toJson():i.toJson())):this.toolbar.toggleButtonEnabledByIndex(e,!t));ls(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!cs(e))return;const t=e.strokeWidth??1,i=si(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(Rs.find(e=>e.value===i)??Rs[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(t=>t.value===e);-1!==i&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};a([Bs],zs.prototype,"enabled",2),a([Bs],zs.prototype,"buttons",2);var{StateMachine:Ws,StateMachineProperty:js,Vec2:Ks,Debug:$s}=s.n1,Ys=class extends Ws{constructor(e){const t=({context:t})=>{this.node?.drag(this.datum,this.offset,t,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:e,context:t})=>{this.hasMoved=!1,this.dragStart=e,this.offset=e,this.node?.dragStart(this.datum,e,t)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:t,context:i})=>{this.hasMoved=Ks.lengthSquared(Ks.sub(t,this.dragStart))>0,this.offset=t,this.node?.drag(this.datum,t,i,this.snapping),e.update()},dragEnd:{target:Ws.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=$s.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};a([js()],Ys.prototype,"snapping",2),a([js()],Ys.prototype,"datum",2),a([js()],Ys.prototype,"node",2);var{Property:qs}=s.n1,Xs=class extends Li{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return(0,r.Gv)(e)&&"arrow-down"===e.type}};a([qs],Xs.prototype,"type",2);var Zs=class e extends s.n1.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:t,locked:i}=this;return i?{point:{x:t.x,y:t.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-t.x,y:e.y-t.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=e.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,t){return this.handle.containsPoint(e,t)}};Zs.INACTIVE_STROKE_WIDTH=2;var Qs=Zs,Js=class e extends Qs{constructor(){super(),this.handle=new s.n1.Marker({shape:"circle"}),this.glow=new s.n1.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=e.HANDLE_SIZE,this.handle.strokeWidth=Qs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:Qs.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};Js.HANDLE_SIZE=7,Js.GLOW_SIZE=9;var er=Js,tr=class e extends Qs{constructor(){super(),this.handle=new s.n1.Rect,this.glow=new s.n1.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=e.CORNER_RADIUS,this.handle.width=e.HANDLE_SIZE,this.handle.height=e.HANDLE_SIZE,this.handle.strokeWidth=Qs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=e.CORNER_RADIUS,this.glow.width=e.GLOW_SIZE,this.glow.height=e.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const t=(e.HANDLE_SIZE-er.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=t,this.handle.y+=t,this.handle.width=er.HANDLE_SIZE,this.handle.height=er.HANDLE_SIZE,this.glow.width=er.GLOW_SIZE,this.glow.height=er.GLOW_SIZE}else this.handle.cornerRadius=e.CORNER_RADIUS,this.handle.width=e.HANDLE_SIZE,this.handle.height=e.HANDLE_SIZE,this.glow.width=e.GLOW_SIZE,this.glow.height=e.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(e.HANDLE_SIZE-er.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:"vertical"===this.gradient?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return"vertical"===this.gradient?"col-resize":"row-resize"}};tr.HANDLE_SIZE=12,tr.GLOW_SIZE=16,tr.CORNER_RADIUS=4;var ir=tr,sr=class e extends Qs{constructor(){super(),this.handle=new s.n1.Marker({shape:"circle"}),this.glow=new s.n1.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=e.HANDLE_SIZE,this.handle.strokeWidth=Qs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=e.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=er.HANDLE_SIZE,this.glow.size=er.GLOW_SIZE):(this.handle.size=e.HANDLE_SIZE,this.glow.size=e.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};sr.HANDLE_SIZE=11,sr.GLOW_SIZE=17;var rr=sr,{ZIndexMap:nr}=s.n1,or=class extends s.n1.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=nr.CHART_ANNOTATION}static isCheck(e,t){return(0,r.Gv)(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e){this.toggleHandles(e)}*nonHandleChildren(){for(const e of this.children())e instanceof Qs||(yield e)}computeBBoxWithoutHandles(){return s.n1.Transformable.toCanvas(this,s.n1.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(e,t,i){if(i||!t)return i&&null==t&&(t=new e,this.appendChild(t)),t;this.removeChild(t)}},{ContinuousScale:ar,Vec2:lr,toRadians:cr}=s.n1;function hr(e,t,i=!1,s,r=1){return Vt(i?dr(e,s?Gt(s,t):lr.origin(),r):e,t)}function dr(e,t,i){const s=lr.sub(e,t),r=cr(i),n=Math.round(lr.angle(s)/r)*r;return lr.rotate(s,n,t)}function ur(e,t){const i={};for(const[s,n]of(0,r.jO)(e))i[s]=Gt(n,t);return i}function pr(e,t,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:r,yAxis:n}=i,o=Object.keys(e),a=[],l=[],c=new Set(s.translateVectors??o),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),u=lr.multiply(t,lr.from(1,-1));for(const i of o)d.has(i)&&(e[i]=lr.add(e[i],h.has(i)?u:t),s.snap&&(e[i]=dr(e[i],s.snap.vectors[i],s.snap.angle))),a.push(r.getRangeOverflow(e[i].x)),l.push(n.getRangeOverflow(e[i].y));const p=(e,t)=>Math.abs(e)-Math.abs(t),g=(e,t,i)=>0!==s.overflowContinuous&&ar.is(e)?o.length===d.size?i.toSorted(p).at(-s.overflowContinuous-1)??0:i.filter(e=>0!==e).length<=s.overflowContinuous?0:i.filter((e,i)=>0!==e&&Math.abs(e)<=Math.abs(t)&&d.has(o[i])).toSorted(p).at(-1)??0:i.toSorted(p).at(-1)??0,m=lr.from(g(r.scale,t.x,a),g(n.scale,t.y,l));if(!lr.equal(m,lr.origin()))for(const t of o)d.has(t)&&(e[t]=lr.round(lr.sub(e[t],m),4));const f={};for(const t of o)f[t]=Vt(e[t],i);return f}var{Vec2:gr}=s.n1,mr=class extends or{constructor(){super(...arguments),this.handle=new rr,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Gt(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...ur({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(e.locked||!s)return;const{point:r}=pr({point:s.handle},gr.sub(t,s.offset),i);e.x=r.x,e.y=r.y}translate(e,t,i){if(e.locked)return;const{point:s}=pr({point:Gt(e,i)},t,i);e.x=s.x,e.y=s.y}toggleHandles(e){this.handle.visible=Boolean(e),this.handle.toggleHovered("handle"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const s=Gt(e,i),r=Vt({x:s.x-30,y:s.y-30},i);return t.x=r.x,t.y=r.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,!!i.containsPoint(e,t)&&(this.activeHandle="handle",!0)}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:s,y:r}=this.getHandleCoords(e,t,i),n=this.getHandleStyles(e);this.handle.update({...n,x:s,y:r}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const s=this.getHandleCoords(e,t);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},fr=class extends mr{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=Gt(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},yr=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function vr(e){s.n1.drawMarkerUnitPolygon(e,yr)}vr.anchor={x:.5,y:0};var Cr=class extends fr{constructor(){super(),this.type="arrow-up",this.shape=new s.n1.Marker({shape:vr}),this.append([this.shape])}static is(e){return or.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=rr.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y-=i,s}},br=yr.map(([e,t])=>[e,1-t]);function Sr(e){s.n1.drawMarkerUnitPolygon(e,br)}Sr.anchor={x:.5,y:1};var wr=class extends fr{constructor(){super(),this.type="arrow-down",this.shape=new s.n1.Marker({shape:Sr}),this.append([this.shape])}static is(e){return or.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i);return s.y-=e.size,s}getHandleCoords(e,t){const i=rr.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y+=i,s}},{StateMachine:xr,StateMachineProperty:Er,Debug:Mr}=s.n1,Ar=class extends xr{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({x:t.x,y:t.y}),e.create(i)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:xr.parent,reset:xr.parent},"waiting-first-render":{render:{target:xr.parent,action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}}}),this.debug=Mr.create(!0,"annotations")}};a([Er()],Ar.prototype,"node",2);var Tr=class extends Ar{createDatum(){return new Xs}},Dr={type:"arrow-down",datum:Xs,scene:wr,isDatum:Xs.is,translate:(e,t,i,s)=>{Xs.is(t)&&wr.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Xs.is(t)&&Xs.is(i)&&wr.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Xs.is(t)&&wr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Tr({...e,create:t("arrow-down")}),dragState:e=>new Ys(e)},{Property:Ir}=s.n1,Rr=class extends Li{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return(0,r.Gv)(e)&&"arrow-up"===e.type}};a([Ir],Rr.prototype,"type",2);var Pr=class extends Ar{createDatum(){return new Rr}},kr={type:"arrow-up",datum:Rr,scene:Cr,isDatum:Rr.is,translate:(e,t,i,s)=>{Rr.is(t)&&Cr.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Rr.is(t)&&Rr.is(i)&&Cr.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Rr.is(t)&&Cr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Pr({...e,create:t("arrow-up")}),dragState:e=>new Ys(e)},{Vec2:Lr,Vec4:Nr}=s.n1,_r=class extends or{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:s},r,n){const o={x1:e,y1:t,x2:i,y2:s};if(!r.extendStart&&!r.extendEnd)return o;const[a,l]=function(e,t){const[i,s]=ii.from(e),r=t.height,n=ii.gradient(s,i,r),o=ii.intercept(s,n,r),a=[{x:i.x,y:r??0},{x:i.x,y:null==r?t.height:r-t.height}];if(n===1/0)return a;let l=[ii.intersectAtY(n,o,0,r),ii.intersectAtY(n,o,t.height,r),ii.intersectAtX(n,o,0,r),ii.intersectAtX(n,o,t.width,r)];return l=l.filter(e=>e.x>=t.x&&e.x<=t.width&&e.y>=t.y&&e.y<=t.height).sort((e,t)=>e.x===t.x?0:e.x<t.x?-1:1),2!==l.length?a:l}(o,n.yAxis.bounds),c=o.x2<o.x1,h=o.y1>=o.y2,d=o.x2===o.x1;return r.extendEnd&&(d?o.y2=h?l.y:a.y:(o.x2=c?a.x:l.x,o.y2=c?a.y:l.y)),r.extendStart&&(d?o.y1=h?a.y:l.y:(o.x1=c?l.x:a.x,o.y1=c?l.y:a.y)),o}dragStart(e,t,i){this.dragState={offset:t,...ur({start:e.start,end:e.end},i)}}drag(e,t,i,s){e.locked||(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,Lr.sub(t,s.offset),i)}translate(e,t,i){e.locked||this.translatePoints(e,Gt(e.start,i),Gt(e.end,i),t,i)}copy(e,t,i){const s=Ft(e,i);if(!s)return;const r=this.computeBBoxWithoutHandles(),n={x:-r.width/2,y:-r.height/2};return this.translatePoints(t,Nr.start(s),Nr.end(s),n,i),t}translatePoints(e,t,i,s,r){const n=pr(this.getTranslatePointsVectors(t,i),s,r,{overflowContinuous:this.overflowContinuous});e.start.x=n.start.x,e.end.x=n.end.x,e.start.y=n.start.y,e.end.y=n.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},{Vec2:Or,Vec4:Fr}=s.n1,Gr=class extends _r{constructor(){super(...arguments),this.start=new rr,this.end=new rr,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Ft(e,t);null!=i&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e;else for(const[t,i]of(0,r.jO)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:r,dragState:n}=this;if(!r||!n)return;this[r].toggleDragging(!0);const o="start"===r?"end":"start",a=s?{vectors:{[r]:Gt(e[o],i)},angle:e.snapToAngle}:void 0,{[r]:l}=pr({[r]:n[r]},Or.sub(t,n.offset),i,{overflowContinuous:0,snap:a});e[r].x=l.x,e[r].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):!!s.containsPoint(e,t)&&(this.activeHandle="end",!0)}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,s){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return"start"===i?Fr.start(t):Fr.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},{Vec4:Br}=s.n1,Vr=class extends Gr{constructor(){super(...arguments),this.label=new s.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=Ft(e,t);if(null==i)return;const s=this.getTextBBox(e,i);this.updateLabel(e,s,i),this.updateHandles(e,i,s),this.updateShape(e,s,i),this.updateAnchor(e,i,t,s)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return Mi(e,i,Br.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:s,isPlaceholder:r}=e.getText();Ai(this.label,s,r,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return Br.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:Hr,Path:Ur}=s.n1,zr=class extends Vr{constructor(){super(),this.type="callout",this.shape=new Ur,this.append([this.shape,this.label,this.start,this.end])}static is(e){return or.isCheck(e,"callout")}drag(e,t,i,s){e.locked||("end"===this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const s=e.getPadding(),{bodyBounds:r={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:r.x+s.left,y:r.y-s.bottom}}getHandleStyles(e,t){return"start"===t?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,s){const{bodyBounds:r}=this.getDimensions(e,s,t)??{},n=r??s;this.anchor={x:n.x+i.seriesRect.x,y:n.y+i.seriesRect.y-n.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:s}=this;s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeWidth=e.strokeWidth??1,s.strokeOpacity=e.strokeOpacity??1;const{tailPoint:r,bodyBounds:n}=this.getDimensions(e,t,i)??{};r&&n&&this.updatePath(r,n)}updatePath(e,t){const{x:i,y:s}=e,{x:r,y:n,width:o,height:a}=t,l=n-a,c=r+o,h=this.calculateCalloutPlacement({x:i,y:s},t),d=[{coordinates:{x0:r,x1:r+8,y0:l+8,y1:l,cx:"topLeft"===h?i:r+8,cy:"topLeft"===h?s:l+8},type:"topLeft"===h?"calloutCorner":"corner"},{coordinates:{x0:r+8,x1:c-8,y0:l,y1:l,cx:i,cy:s},type:"top"===h?"calloutSide":"side"},{coordinates:{x0:c-8,x1:c,y0:l,y1:l+8,cx:"topRight"===h?i:c-8,cy:"topRight"===h?s:l+8},type:"topRight"===h?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+8,y1:n-8,cx:i,cy:s},type:"right"===h?"calloutSide":"side"},{coordinates:{x0:c,x1:c-8,y0:n-8,y1:n,cx:"bottomRight"===h?i:c-8,cy:"bottomRight"===h?s:n-8},type:"bottomRight"===h?"calloutCorner":"corner"},{coordinates:{x0:c-8,x1:r+8,y0:n,y1:n,cx:i,cy:s},type:"bottom"===h?"calloutSide":"side"},{coordinates:{x0:r+8,x1:r,y0:n,y1:n-8,cx:"bottomLeft"===h?i:r+8,cy:"bottomLeft"===h?s:n-8},type:"bottomLeft"===h?"calloutCorner":"corner"},{coordinates:{x0:r,x1:r,y0:n-8,y1:l+8,cx:i,cy:s},type:"left"===h?"calloutSide":"side"}],{path:u}=this.shape;u.clear(),u.moveTo(r,l+8),d.forEach(({coordinates:e,type:t})=>{this.drawPath(u,e,8,t)}),u.closePath()}drawPath(e,{x0:t,y0:i,x1:s,y1:r,cx:n,cy:o},a,l){switch(l){case"calloutCorner":e.lineTo(n,o),e.lineTo(s,r);break;case"corner":Hr(e,{x0:t,x1:s,y0:i,y1:r,cx:n,cy:o},a,!1);break;case"calloutSide":if(t!==s){const a=t>s?-1:1,l=Math.min(t,s)+Math.abs(s-t)/2;e.lineTo(l-6*a,i),e.lineTo(n,o),e.lineTo(l+6*a,i),e.lineTo(s,r)}else{const a=i>r?-1:1,l=Math.min(i,r)+Math.abs(i-r)/2;e.lineTo(t,l-6*a),e.lineTo(n,o),e.lineTo(t,l+6*a),e.lineTo(s,r)}break;default:e.lineTo(s,r)}}calculateCalloutPlacement(e,t){const i=t.x+t.width,s=t.y-t.height;let r,n;return e.x>i?r="right":e.x<t.x&&(r="left"),e.y>t.y?n="bottom":e.y<s&&(n="top"),r&&n?`${n}${r[0].toUpperCase()}${r.substring(1)}`:n??r}getDimensions(e,t,i){const{fontSize:s}=e,r=e.getPadding(),n=r.left+r.right,o=r.top+r.bottom,a=t.width+n,l=Math.max(t.height+o,s+o);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:a,height:l}}}containsPoint(e,t){const{start:i,end:s,shape:r}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const n=s.containsPoint(e,t)||r.containsPoint(e,t);return n&&(this.activeHandle="end"),n}};function Wr({key:e}){return"Escape"===e}function jr({key:e,shiftKey:t}){return!t&&"Enter"===e}var{StateMachine:Kr,StateMachineProperty:$r,Debug:Yr}=s.n1,qr=class extends Kr{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t,visible:!0}),e.create(i)},i=({point:t})=>{const{datum:i,node:s}=this;i?.set({end:t}),s?.toggleActive(!0),s?.toggleHandles({end:!1}),e.update()},s=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},r=()=>{e.delete()},n=({textInputValue:t,bbox:i})=>{const{datum:s}=this;if(null!=i&&null!=t&&t.length>0){if(!os(s))return;const r=Ei(s,t,i.width);s?.set({text:r}),e.update(),e.recordAction(`Create ${s?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Kr.parent,reset:Kr.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0})}}},end:{hover:i,drag:i,click:{target:"edit",action:s},dragEnd:{target:"edit",action:s},reset:{target:Kr.parent,action:r},cancel:{target:Kr.parent,action:r}},edit:{onEnter:()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:t=>{this.node?.setTextInputBBox(t),e.update()},color:({colorPickerType:t,colorOpacity:i,color:s,opacity:r,isMultiColor:n})=>{const{datum:o}=this;o&&("text-color"===t&&e.updateTextInputColor(s),fs(o,t,i,s,r,n),e.update())},fontSize:t=>{const{datum:i,node:s}=this;i&&s&&os(i)&&(i.fontSize=t,e.updateTextInputFontSize(t),e.update())},textInput:[{guard:Wr,target:Kr.parent,action:r},{guard:jr,target:Kr.parent,action:n}],click:{target:Kr.parent,action:n},dragStart:{target:Kr.parent,action:n},resize:{target:Kr.parent,action:n},onExit:()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},cancel:{target:Kr.parent,action:r}}}),this.debug=Yr.create(!0,"annotations")}};a([$r()],qr.prototype,"datum",2),a([$r()],qr.prototype,"node",2);var Xr=class extends qr{createDatum(){return new qt}},Zr={type:"callout",datum:qt,scene:zr,isDatum:qt.is,translate:(e,t,i,s)=>{if(qt.is(t)&&zr.is(e))return e.translate(t,i,s)},copy:(e,t,i,s)=>{if(qt.is(t)&&qt.is(i)&&zr.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{qt.is(t)&&zr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Xr({...e,create:t("callout")}),dragState:e=>new Ys(e)},Qr=class extends mr{constructor(){super(...arguments),this.label=new s.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=Gt(e,t),s=this.getTextBBox(e,i,t);this.updateLabel(e,s),this.updateHandle(e,i,s),this.updateShape(e,s),this.anchor=this.updateAnchor(e,s,t)}copy(e,t,i){const s=Gt(e,i),r=this.getTextBBox(e,s,i),n=e.getPadding(),o=n.left+n.right,a=n.top+n.bottom,l=(r.width+o)/2,c=r.height+a,h=Vt({x:s.x-l,y:s.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:s}=e.getText();return Mi(e,s,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:s}=e.getText();Ai(this.label,i,s,e,this.getLabelCoords(e,t),this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return"center"==e.position?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:Jr}=s.n1,en=class extends Qr{constructor(){super(),this.type="comment",this.shape=new s.n1.Path,this.append([this.shape,this.label,this.handle])}static is(e){return or.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i),r=e.getPadding();return s.y-=r.bottom+r.top,s}updatePath(e,t){const i=e.getPadding(),{x:s,y:r}=t;let{width:n,height:o}=t;const{fontSize:a}=e,l=i.left+i.right,c=i.top+i.bottom;n+=l,o=Math.max(o+c,a+c);const h=r-o,d=s+n,u=(a*wi+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,r),p.lineTo(s,h+u),Jr(p,{x0:s,x1:s+u,y0:h+u,y1:h,cx:s+u,cy:h+u},u,!1),p.lineTo(d-u,h),Jr(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,r-u),Jr(p,{x0:d,x1:d-u,y0:r-u,y1:r,cx:d-u,cy:r-u},u,!1),p.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},{StateMachine:tn,StateMachineProperty:sn,Debug:rn}=s.n1,nn=class extends tn{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({x:t.x,y:t.y}),e.create(i)},i=()=>{e.delete()},s=({textInputValue:t,bbox:i})=>{if(null!=i&&null!=t&&t.length>0){const{datum:s}=this;if(!os(s))return;const r=Ei(s,t,i.width);s?.set({text:r}),e.update(),e.recordAction(`Create ${s?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:tn.parent,reset:tn.parent},"waiting-first-render":{render:{target:"edit",action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}},edit:{onEnter:()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:t=>{this.node?.setTextInputBBox(t),e.update()},color:({colorPickerType:t,colorOpacity:i,color:s,opacity:r,isMultiColor:n})=>{this.datum&&("text-color"===t&&e.updateTextInputColor(s),fs(this.datum,t,i,s,r,n),e.update())},fontSize:t=>{const{datum:i,node:s}=this;i&&s&&os(i)&&(i.fontSize=t,e.updateTextInputFontSize(t),e.update())},textInput:[{guard:Wr,target:tn.parent,action:i},{guard:jr,target:tn.parent,action:s}],click:{target:tn.parent,action:s},dragStart:{target:tn.parent,action:s},resize:{target:tn.parent,action:s},onExit:()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},cancel:{target:tn.parent,action:i}}}),this.debug=rn.create(!0,"annotations")}};a([sn()],nn.prototype,"datum",2),a([sn()],nn.prototype,"node",2);var on=class extends nn{createDatum(){return new ti}},an={type:"comment",datum:ti,scene:en,isDatum:ti.is,translate:(e,t,i,s)=>{ti.is(t)&&en.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ti.is(t)&&ti.is(i)&&en.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ti.is(t)&&en.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new on({...e,create:t("comment")}),dragState:e=>new Ys(e)},{calculateLabelTranslation:ln,ChartAxisDirection:cn}=s.n1,hn=class extends s.n1.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new s.n1.Text({zIndex:1}),this.rect=new s.n1.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:s,fontSize:r,fontStyle:n,fontFamily:o,textAlign:a,color:l="white",formatter:c}=t,h=c?c({value:e}):i.scaleValueFormatter()(e);this.label.setProperties({fontWeight:s,fontSize:r,fontStyle:n,fontFamily:o,textAlign:a,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:s,fillOpacity:r,stroke:n,strokeOpacity:o}=e;t.setProperties({cornerRadius:i,fill:s,fillOpacity:r,stroke:n,strokeOpacity:o})}updatePosition({x:e,y:t,context:i,styles:{padding:s}}){const{label:r,rect:n}=this,o=r.getBBox()?.clone(),a=s??8,l=s??5;o.grow(a,"horizontal"),o.grow(l,"vertical");const c=i.direction===cn.X?Math.round(l/2):a,{xTranslation:h,yTranslation:d}=ln({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:o}),u=e+h,p=t+d;r.x=u,r.y=p,n.y=p-Math.round(o.height/2),n.x=u-Math.round(o.width/2),n.height=o.height,n.width=o.width}};hn.className="AxisLabel";var{Vec2:dn}=s.n1,un=class extends s.n1.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e,t){return super.setProperties(e,t),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:r,x2:n,y2:o}=this;let a=t+e;a%2==0&&(a+=1);const l=dn.from(i,r-Math.floor(a/2)),c=dn.from(n,o),h=dn.distance(l,c);this.collisionBBox=new s.n1.BBox(l.x,l.y,h,a)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:r,x2:n,y2:o}=this;if(!i)return!1;const a=dn.from(s,r),l=dn.from(n,o),c=dn.sub(dn.from(e,t),a),h=dn.sub(l,a),d=dn.rotate(c,dn.angle(c,h),a);return i.containsPoint(d.x,d.y)??!1}render(e){this.applyClipMask(e.ctx),super.render(e),this.closeClipMask(e.ctx)}setClipMask(e,t){const i=this.clipMask.get(e);null!=s.n1.jsonDiff(i,t)&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}applyClipMask(e){const{clipMask:t}=this;0!==t.size&&this.clipMask.forEach(t=>{const{x:i,y:s,radius:r}=t;e.save(),e.beginPath(),e.rect(0,0,e.canvas.width,e.canvas.height),e.ellipse(i,s,r,r,0,2*Math.PI,0,!0),e.clip()})}closeClipMask(e){0!==this.clipMask.size&&e.restore()}},pn=class extends s.n1.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),s=this.computeBBoxWithoutTransforms();return!!s&&s.grow(this.growCollisionBox).containsPoint(i.x,i.y)}},{Vec2:gn}=s.n1;function mn(e,t,i,s,r,n,o){if(!n||!r||!s)return void t.setClipMask(e);const{alignment:a,position:l}=s,c=yn(i,s.fontSize,o),{point:h,textBaseline:d}=vn(c,l,a);Cn(r,n,s,h,c.angle,d);const{x:u,y:p,width:g,height:m}=r.getBBox(),f={x:u+g/2,y:p+m/2,radius:gn.length(gn.from(g,m))/2+gn.length(c.offset)};return"center"===l?t.setClipMask(e,f):t.setClipMask(e),{clipMask:f,numbers:c}}function fn(e,t,i,s,r,n,o){if(!o||!n)return;const{alignment:a,position:l}=s,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let d=c;"bottom"===l?d=h:"inside"===l&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=yn(d,s.fontSize,r),{point:p,textBaseline:g}=vn(u,"inside"===l?"center":l,a,e);Cn(n,o,s,p,u.angle,g)}function yn(e,t,i){let[s,r]=gn.from(e);s.x>r.x&&([s,r]=[r,s]);const n=gn.normalized(gn.sub(r,s));return{left:s,right:r,normal:n,angle:gn.angle(n),inset:gn.multiply(n,rr.HANDLE_SIZE/2+(t??14)/2),offset:gn.multiply(n,(i??2)/2+(t??14)/3)}}function vn({left:e,right:t,normal:i,angle:s,inset:r,offset:n},o,a,l){let c;c="right"===a?gn.sub(t,r):"center"===a?gn.add(e,gn.multiply(i,gn.distance(e,t)/2)):gn.add(e,r);let h="bottom";return"bottom"===o?(c=gn.rotate(n,s+Math.PI/2,c),h="top"):"center"!==o||l?c=gn.rotate(n,s-Math.PI/2,c):h="middle",{point:c,textBaseline:h}}function Cn(e,t,i,s,r,n){e.setProperties({text:t,x:s.x,y:s.y,rotation:r,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:n})}var{ChartAxisDirection:bn,Vec2:Sn,Vec4:wn}=s.n1,xn=class extends or{constructor(){super(),this.type="cross-line",this.line=new un,this.middle=new ir,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return or.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=Oi.is(e);const s=this.isHorizontal?t.yAxis:t.xAxis,r=this.convertCrossLine(e,s);null!=r?(this.visible=e.visible??!0,this.visible&&(this.updateLine(e,r),this.updateHandle(e,r),this.updateText(e,r),this.updateAxisLabel(e,s,r))):this.visible=!1}updateLine(e,t){const{line:i}=this,{lineDashOffset:s,stroke:r,strokeWidth:n,strokeOpacity:o}=e,{x1:a,y1:l,x2:c,y2:h}=t;i.setProperties({x1:a,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:r,strokeWidth:n,strokeOpacity:o,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:r,strokeWidth:n,strokeOpacity:o}=e,a={fill:e.handle.fill,stroke:e.handle.stroke??r,strokeOpacity:e.handle.strokeOpacity??o,strokeWidth:e.handle.strokeWidth??n},l=Sn.sub(wn.center(t),Sn.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...a,...l}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(pn,this.text,!!e.text.label),mn(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new hn;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:r}=this,{direction:n,position:o}=t;if(e.axisLabel.enabled){s.visible=this.visible;const a="left"===o||"top"===o?wn.start(i):wn.end(i),l=n===bn.X?a.x:a.y;if(!t.inRange(l))return void(s.visible=!1);const c=_t(e.value);s.update({...Sn.add(a,Sn.required(r)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered("middle"===this.activeHandle)}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const s=Oi.is(e)?{x:t.x,y:Bt(e.value,i.yAxis)}:{x:Bt(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:s}}drag(e,t,i){const{activeHandle:s,dragState:r}=this;!e.locked&&r&&(s&&this[s].toggleDragging(!0),this.translatePoint(e,r.middle,Sn.sub(t,r.offset),i))}translate(e,t,i){if(e.locked)return;const s=Oi.is(e)?Sn.from(0,Bt(e.value,i.yAxis)):Sn.from(Bt(e.value,i.xAxis),0);this.translatePoint(e,s,t,i)}translatePoint(e,t,i,s){const r=Oi.is(e);r?i.x=0:i.y=0;const{point:n}=pr({point:t},i,s);e.value=r?n.y:n.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const s=Oi.is(e),r=this.isHorizontal?i.yAxis:i.xAxis,n=this.convertCrossLine(e,r);if(!n)return;const o=s?-30:0,a=s?0:-30,l=Vt({x:n.x1+a,y:n.y1+o},i);return t.set({value:s?l.y:l.x}),t}getCursor(){return null==this.activeHandle?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:s,text:r}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):s.isPointInPath(e,t)||Boolean(r?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":this.middle.containsPoint(e,t)?"handle":void 0}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(null==e.value)return;let i,s,r=0,n=0;const{bounds:o}=t,a=Bt(e.value,t);return Oi.is(e)?(i=o.width,n=a,s=a):(r=a,i=a,s=o.height),{x1:r,y1:n,x2:i,y2:s}}},{StateMachine:En,StateMachineProperty:Mn,Debug:An}=s.n1,Tn=class extends En{constructor(e,t){const i=({point:i})=>{const s="horizontal"===e,r=s?new Oi:new Fi;r.set({value:s?i.y:i.x}),t.create(r),t.recordAction(`Create ${s?"horizontal-line":"vertical-line"} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:En.parent,cancel:En.parent},"waiting-first-render":{render:{target:En.parent,action:()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()}}}}),this.debug=An.create(!0,"annotations")}};a([Mn()],Tn.prototype,"node",2);var Dn={type:"horizontal-line",datum:Oi,scene:xn,isDatum:Oi.is,translate:(e,t,i,s)=>{Oi.is(t)&&xn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Oi.is(t)&&Oi.is(i)&&xn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Oi.is(t)&&xn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Tn("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new Ys(e)},In={type:"vertical-line",datum:Fi,scene:xn,isDatum:Fi.is,translate:(e,t,i,s)=>{Fi.is(t)&&xn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Fi.is(t)&&Fi.is(i)&&xn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Fi.is(t)&&xn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Tn("vertical",{...e,create:t("vertical-line")}),dragState:e=>new Ys(e)},{Vec4:Rn}=s.n1,Pn=class{static updateBackground(e,t,i,s){const{background:r}=this,{seriesRect:n}=s;r.path.clear(!0);const o=Rn.from(0,0,n.width,n.height),a=this.getBackgroundPoints(e,t,i,o);for(let e=0;e<a.length;e++){const t=a[e];0===e?r.path.moveTo(t.x,t.y):r.path.lineTo(t.x,t.y)}r.path.closePath(),r.checkPathDirty();const l=this.getBackgroundStyles?.(e)??e.background;r.setProperties({fill:l.fill,fillOpacity:l.fillOpacity})}},kn=class extends _r{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new un,this.bottomLine=new un,this.background=new s.n1.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=Pn.updateBackground.bind(this)}update(e,t){const{locked:i,visible:s}=e,r=Ft(e,t),n=Ft(e.bottom,t);if(null==r||null==n)return void(this.visible=!1);this.visible=s??!0;const o=this.extendLine(r,e,t),a=this.extendLine(n,e,t);this.updateLines(e,o,a,t,r,n),this.updateHandles(e,r,n),this.updateText(e,r,n),this.updateBackground(e,o,a,t),this.updateAnchor(r,n);for(const e of Object.values(this.handles))e.toggleLocked(i??!1)}toggleHandles(e){const{handles:t}=this;if("boolean"!=typeof e)for(const[i,s]of Object.entries(e)){const e=t[i];e.visible=s??!0,e.toggleHovered(this.activeHandle===i)}else for(const[i,s]of Object.entries(t))s.visible=e,s.toggleHovered(this.activeHandle===i)}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;null!=e&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return null==this.activeHandle?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:s,bottomLine:r,text:n}=this;this.activeHandle=void 0;for(const[s,r]of Object.entries(i))if(r.containsPoint(e,t))return this.activeHandle=s,!0;return s.containsPoint(e,t)||r.containsPoint(e,t)||Boolean(n?.containsPoint(e,t))}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[i,s]of Object.entries(this.handles))if(s.containsPoint(e,t))return"handle"}updateAnchor(e,t){const{x:i,y:r}=s.n1.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i,this.anchor.y=r}},{Vec2:Ln,Vec4:Nn}=s.n1,_n=class extends kn{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new rr,topRight:new rr,bottomLeft:new rr,bottomRight:new ir},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return or.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,s){const{activeHandle:r,handles:n}=this;if(null==r)return;const{offset:o}=n[r].drag(t);n[r].toggleDragging(!0),"bottomRight"===r&&(o.x=0);let a=[],l=[],c=s;switch(r){case"topLeft":a=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":a=["bottomLeft"],l=["topLeft"];break;case"topRight":a=["topRight"],l=["bottomRight"];break;case"bottomRight":a=["bottomLeft","bottomRight"],c=!1}const h=Ft(e,i),d=Ft(e.bottom,i);if(!h||!d)return;const u={topLeft:Nn.start(h),topRight:Nn.end(h),bottomLeft:Nn.start(d),bottomRight:Nn.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:e.snapToAngle},g=pr(u,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:a,invertYVectors:l,snap:c?p:void 0});e.start.x=g.topLeft.x,e.start.y=g.topLeft.y,e.end.x=g.topRight.x,e.end.y=g.topRight.y,e.startHeight=g.topLeft.y-g.bottomLeft.y,e.endHeight=g.topRight.y-g.bottomRight.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,bottomRight:s,topLeft:r,topRight:n}=this.handles,o=i.getBBox().y-r.getBBox().y,a=s.getBBox().y-n.getBBox().y;return{start:e,end:t,bottomStart:Ln.add(e,Ln.from(0,o)),bottomEnd:Ln.add(t,Ln.from(0,a))}}updateLines(e,t,i){const{topLine:s,bottomLine:r}=this,{lineDashOffset:n,stroke:o,strokeOpacity:a,strokeWidth:l}=e,c={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:o,strokeOpacity:a,strokeWidth:l};s.setProperties({...t,...c}),r.setProperties({...i,...c})}updateHandles(e,t,i){const{handles:{topLeft:s,topRight:r,bottomLeft:n,bottomRight:o}}=this,a={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...a,...Nn.start(t)}),r.update({...a,...Nn.end(t)}),n.update({...a,...Nn.start(i)}),o.update({...a,...Ln.sub(Nn.end(i),Ln.from(o.handle.width/2,o.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(pn,this.text,!!e.text.label),fn(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const r=t.x1>t.x2,n=t.y1>t.y2,o=n?s.y2:s.y1,a=n?s.y1:s.y2,l=Ln.from(t);return e.extendEnd&&t.y2===a&&l.push(Ln.from(r?s.x1:s.x2,n?s.y1:s.y2)),e.extendEnd&&i.y2===o&&l.push(Ln.from(r?s.x1:s.x2,n?s.y2:s.y1)),l.push(...Ln.from(i).reverse()),e.extendStart&&i.y1===a&&l.push(Ln.from(r?s.x2:s.x1,n?s.y1:s.y2)),e.extendStart&&t.y1===o&&l.push(Ln.from(r?s.x2:s.x1,n?s.y2:s.y1)),l}},{StateMachine:On,StateMachineProperty:Fn,Debug:Gn}=s.n1,Bn=class extends On{constructor(e){const t=({point:t})=>{const i=new Vi;i.set({start:t,end:t,startHeight:0,endHeight:0}),e.create(i)},i=({offset:t,context:i})=>{const{datum:s,snapping:r}=this;s&&(s.set({end:hr(t,i,r,s.start,s.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},n=({point:t})=>{const{datum:i,node:s}=this,n=_t(i?.end.y),o=_t(i?.start.y),{y:a}=t;if(null==i||!(0,r.Et)(o)||!(0,r.Et)(n)||!(0,r.Et)(a))return;const l=n-(a??0),c=2*(o-n)+l,h={x:i.start.x,y:o-l},d={x:i.end.x,y:t.y};s?.toggleHandles(!0),e.validatePoint(h,{overflowContinuous:!0})&&e.validatePoint(d,{overflowContinuous:!0})&&(i.set({startHeight:c,endHeight:l}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:On.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:On.parent,action:o},cancel:{target:On.parent,action:o}},height:{hover:({point:t})=>{const{datum:i,node:s}=this,n=_t(i?.end.y),o=_t(i?.start.y),{y:a}=t;if(null==i||!(0,r.Et)(o)||!(0,r.Et)(n)||!(0,r.Et)(a))return;const l=n-(a??0),c=2*(o-n)+l,h={x:i?.start.x,y:o-c},d={x:i?.end.x,y:t.y};s?.toggleHandles({bottomLeft:!0,bottomRight:!0}),e.validatePoint(h,{overflowContinuous:!0})&&e.validatePoint(d,{overflowContinuous:!0})&&(i.set({startHeight:c,endHeight:l}),e.update())},click:{target:On.parent,action:n},drag:{target:On.parent,action:n},reset:{target:On.parent,action:o},cancel:{target:On.parent,action:o}}}),this.debug=Gn.create(!0,"annotations"),this.snapping=!1}};a([Fn()],Bn.prototype,"datum",2),a([Fn()],Bn.prototype,"node",2),a([Fn()],Bn.prototype,"snapping",2);var Vn={type:"disjoint-channel",datum:Vi,scene:_n,isDatum:Vi.is,translate:(e,t,i,s)=>{Vi.is(t)&&_n.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Vi.is(t)&&Vi.is(i)&&_n.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Vi.is(t)&&_n.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Bn({...e,create:t("disjoint-channel")}),dragState:e=>new Ys(e)},Hn=[0,23.6,38.2,50,61.8,78.6,100],Un={10:[...Hn,161.8,261.8,361.8,423.6],6:Hn,4:Hn.filter(e=>78.6!==e&&23.6!==e)};function zn({x1:e,y1:t,x2:i,y2:s},r,n,o,a=10){const l=t-s,c=n?-1:1;let h=o;const d=[];return Un[a].forEach((t,s)=>{const n=o+l*(t/100)*c,a=r.yAxis.scaleInvert(n);d.push({id:s,x1:e,x2:i,y1:h,y2:n,tag:100==t?0:1,label:{x1:Math.min(e,i)-10,x2:i,y1:n,y2:n,text:`${(t/100).toFixed(3)} (${a.toFixed(2)})`}}),h=n}),d}var{Vec2:Wn,Vec4:jn}=s.n1,Kn=class extends or{constructor(){super(),this.trendLine=new un,this.rangeFillsGroup=new s.n1.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=s.n1.Selection.select(this.rangeFillsGroup,s.n1.Range),this.rangeStrokesGroup=new s.n1.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=s.n1.Selection.select(this.rangeStrokesGroup,un),this.labelsGroup=new s.n1.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=s.n1.Selection.select(this.labelsGroup,pn),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=Ft(e,t);if(null==i)return void(this.visible=!1);if(i=jn.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,r=this.extendLine(i,e,t),n=s?r.y1:r.y2,o=s?r.y2:r.y1,a=zn(r,t,e.reverse,n,e.bands);this.updateRanges(e,a,t);const l={...r,y1:o,y2:o};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:s},r,n){const o={x1:e,y1:t,x2:i,y2:s};if(!r.extendStart&&!r.extendEnd)return o;const{x:a,width:l}=n.xAxis.bounds;return r.extendEnd&&(o[e>i?"x1":"x2"]=a+l),r.extendStart&&(o[e>i?"x2":"x1"]=a),o}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:s,strokeWidth:r,strokeOpacity:n,stroke:o}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:r,strokeOpacity:n,fillOpacity:0,stroke:o})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:r,rangeStroke:n,isMultiColor:o}=e;this.rangeStrokesGroupSelection.each((a,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,g=o?r[u%r.length]:n;a.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:d})})}updateRanges(e,t,i){const s=e=>e.id;this.rangeFillsGroupSelection.update(t,void 0,s),this.rangeStrokesGroupSelection.update(t,void 0,s),this.labelsGroupSelection.update(t,void 0,s),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:r,rangeStroke:n,showFill:o,isMultiColor:a}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const g=a?r[p%r.length]:n;o?l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,stroke:g,strokeOpacity:s,fill:g,fillOpacity:.15*(s??1),strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0}):l.visible=!1})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:r,rangeStroke:n,isMultiColor:o,label:{fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=e,u={fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(t,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((e,t,a)=>{const l=d??(o?s[a%s.length]:n),c=i.at(a);if(!c)return;const{text:h,...g}=t.label;if(p)e.setProperties({...u,text:h,x:g.x1,y:g.y1,textBaseline:"middle",textAlign:"end",fill:l}),mn(e.id,c,g);else{const t={...u,label:h,position:"center",alignment:"left",color:l};mn(e.id,c,g,t,e,h,r)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:s,...r}=i.datum.label;i.setProperties({...t,text:s,x:r.x1,y:r.y1,textBaseline:"middle",textAlign:"end"});const{x:n}=i.getBBox();return n>=e.bounds.x&&n<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:r}=e;this.text=this.updateNode(pn,this.text,!!s.label),mn(i.id,i,t,s,this.text,s.label,r)}updateAnchor(e,t,i,r){const n=jn.topCenter(t);Wn.apply(this.anchor,s.n1.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:s,text:r}=this;let n=!1;return s.each(i=>n||(n=i.isPointInPath(e,t))),n||i.isPointInPath(e,t)||Boolean(r?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.trendLine.isPointInPath(e,t)?"line":void 0}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,s){e.locked||(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:$n}=s.n1;function Yn(e,t,i={overflowContinuous:!1},s){if(null==t.x||null==t.y)return s&&r.Vy.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:n,yAxis:o}=e,a=i.overflowContinuous&&$n.is(n.scale),l=i.overflowContinuous&&$n.is(o.scale),c=a||qn(t.x,n),h=l||qn(t.y,o);if(c&&h)return!0;if(s){let e="x & y domains";c&&(e="y domain"),h&&(e="x domain");const i=_t(t.x),n=_t(t.y);r.Vy.warnOnce(`${s}is outside the ${e}, ignoring. - x: [${i}], y: ${n}]`)}return!1}function qn(e,t){const{domain:i}=t.scale,s=_t(e);return!i||null==s||!t.continuous||s>=i[0]&&s<=i.at(-1)}var{Vec2:Xn,Vec4:Zn}=s.n1,Qn=class extends Kn{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new un,this.start=new rr,this.end=new rr,this.endRetracement=new rr,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return or.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(null==i||null==s)return void(this.visible=!1);if(i=Zn.round(i),s=Zn.round(s),this.visible=e.visible??!0,!this.visible)return;null!=e.endRetracement.x&&null!=e.endRetracement.y||(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:r,bands:n}=e,o=function(e,t){const{x2:i,y1:s,y2:r}=e,n=s-r;return null==t?{x1:i,x2:i,y1:r-n,y2:r}:{x1:t.x1,x2:t.x2,y1:t.y2-n,y2:t.y2}}(i,s),a=this.extendLine(o,e,t),l=a.y2,c=a.y1,h=s?zn(a,t,r,l,n):[];this.updateRanges(e,h,t);const d={...a,y1:c,y2:c};this.updateText(e,d)}containsPoint(e,t){const{start:i,end:s,endRetracement:r,endRetracementLine:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):r.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):n.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ur({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:Xn.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:r,dragState:n}=this;if(!r||!n)return;this[r].toggleDragging(!0);const o=s?this.snapToAngle(e,t,i):Vt(this[r].drag(t).point,i);o&&Yn(i,o)&&(e[r].x=o.x,e[r].y=o.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,r=["start","end","endRetracement"];if(!s)return;const n=(r.indexOf(s)+1)%r.length,o=r[n];return this[s].toggleDragging(!0),Vt(dr(t,Gt(e[o],i),e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:s,translation:r,context:n}){const o=pr({start:t,end:i,endRetracement:s},r,n,{overflowContinuous:2});e.start.x=o.start.x,e.end.x=o.end.x,e.endRetracement.x=o.endRetracement.x,e.start.y=o.start.y,e.end.y=o.end.y,e.endRetracement.y=o.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:Gt(e.start,i),end:Gt(e.end,i),endRetracement:Gt(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:r}=this.getCoords(e,i);if(!s||!r)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:Zn.start(s),end:Zn.end(s),endRetracement:Zn.end(r),translation:{x:-n.width/2,y:-n.height/2},context:i}),t}getCoords(e,t){return{coords1:Ft(e,t),coords2:Ft({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of(0,r.jO)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle),this.endRetracement.toggleHovered("endRetracement"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return"start"===i?Zn.start(t):Zn.end(t)}},{StateMachine:Jn,StateMachineProperty:eo,Debug:to}=s.n1,io=class extends Jn{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({offset:t,context:i})=>{const{datum:s,snapping:r}=this;s&&(s.set({end:hr(t,i,r,s.start,s.snapToAngle)}),e.update())},s=()=>{const{datum:t}=this;t&&(t.endRetracement.x=t.end.x,t.endRetracement.y=t.end.y,this.node?.toggleHandles({end:!0}),e.update())},r=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},n=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Jn.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0,end:!1,endRetracement:!1})}}},end:{hover:i,click:{target:"endRetracement",action:s},drag:i,dragEnd:{target:"endRetracement",action:s},reset:{target:Jn.parent,action:n},cancel:{target:Jn.parent,action:n},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)}},endRetracement:{hover:({offset:t,context:i})=>{const{datum:s,snapping:r}=this;s&&(s.set({endRetracement:hr(t,i,r,s.end,s.snapToAngle)}),e.update())},click:{target:Jn.parent,action:r},drag:{target:Jn.parent,action:r},reset:{target:Jn.parent,action:n},cancel:{target:Jn.parent,action:n}}}),this.debug=to.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Yi}};a([eo()],io.prototype,"datum",2),a([eo()],io.prototype,"node",2),a([eo()],io.prototype,"snapping",2);var so={type:"fibonacci-retracement-trend-based",datum:Yi,scene:Qn,isDatum:Yi.is,translate:(e,t,i,s)=>{Yi.is(t)&&Qn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Yi.is(t)&&Yi.is(i)&&Qn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Yi.is(t)&&Qn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new io({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new Ys(e)},{Vec2:ro,Vec4:no}=s.n1,oo=class extends Kn{constructor(){super(),this.type="fibonacci-retracement",this.start=new rr,this.end=new rr,this.append([this.start,this.end])}static is(e){return or.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ur({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:ro.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:r,dragState:n}=this;if(!r||!n)return;this[r].toggleDragging(!0);const o=s?this.snapToAngle(e,t,i):Vt(this[r].drag(t).point,i);o&&Yn(i,o)&&(e[r].x=o.x,e[r].y=o.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,r=["start","end"].find(e=>e!==s);if(s&&r)return this[s].toggleDragging(!0),Vt(dr(t,Gt(e[r],i),e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:s,context:r}){const n=pr({start:t,end:i},s,r,{overflowContinuous:1});e.start.x=n.start.x,e.end.x=n.end.x,e.start.y=n.start.y,e.end.y=n.end.y}translate(e,t,i){this.translatePoints({datum:e,start:Gt(e.start,i),end:Gt(e.end,i),translation:t,context:i})}copy(e,t,i){const s=Ft(e,i);if(!s)return;const r=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-r.width/2,y:-r.height/2},context:i}),t}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e;else for(const[t,i]of(0,r.jO)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return"start"===i?no.start(t):no.end(t)}},{StateMachine:ao,StateMachineProperty:lo,Debug:co}=s.n1,ho=class extends ao{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({offset:t,context:i})=>{const{datum:s,snapping:r}=this;s&&(s.set({end:hr(t,i,r,s.start,s.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({end:!0}),e.update()},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:ao.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0,end:!1})}}},end:{hover:i,click:{target:ao.parent,action:s},drag:i,dragEnd:{target:ao.parent,action:s},reset:{target:ao.parent,action:r},cancel:{target:ao.parent,action:r},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)}}}),this.debug=co.create(!0,"annotations"),this.snapping=!1}};a([lo()],ho.prototype,"datum",2),a([lo()],ho.prototype,"node",2),a([lo()],ho.prototype,"snapping",2);var uo=class extends ho{createDatum(){return new zi}},po=class extends ho{createDatum(){return new Wi}},go=class extends ho{createDatum(){return new Xi}},mo={type:"fibonacci-retracement",datum:Xi,scene:oo,isDatum:Xi.is,translate:(e,t,i,s)=>{Xi.is(t)&&oo.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Xi.is(t)&&Xi.is(i)&&oo.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Xi.is(t)&&oo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new go({...e,create:t("fibonacci-retracement")}),dragState:e=>new Ys(e)},{Vec2:fo}=s.n1,yo=class extends s.n1.Group{},vo=class extends yo{constructor(){super(),this.type="arrow",this.path=new s.n1.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:r,...n}=e,o=fo.from(i,s),a=3*Math.PI/4,l=this.armLength+2*(e.strokeWidth??0),c=fo.rotate(fo.from(0,l),r+a,o),h=fo.rotate(fo.from(l,0),r-a,o);t.setProperties(n),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(o.x,o.y),t.path.lineTo(h.x,h.y)}},{Vec2:Co,Vec4:bo}=s.n1,So=class extends Gr{constructor(){super(),this.type="line",this.line=new un,this.append([this.line,this.start,this.end])}static is(e){return or.isCheck(e,"line")}update(e,t){let i=Ft(e,t);null!=i?(i=bo.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))):this.visible=!1}updateLine(e,t,i){const{line:s}=this,{lineDashOffset:r,stroke:n,strokeWidth:o,strokeOpacity:a}=e,l=this.extendLine(t,e,i);s.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:r,stroke:n,strokeWidth:o,strokeOpacity:a,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(pn,this.text,!!e.text.label),mn(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!e.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:r}=e,[n,o]=Co.from(t),a=Co.angle(Co.sub(o,n));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),null==this.startCap&&(this.startCap=new vo,this.append([this.startCap])),this.startCap.update({x:n.x,y:n.y,angle:a-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:r})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),null==this.endCap&&(this.endCap=new vo,this.append([this.endCap])),this.endCap.update({x:o.x,y:o.y,angle:a,stroke:i,strokeWidth:s,strokeOpacity:r}))}updateAnchor(e,t,i,r){const n=bo.topCenter(t);Co.apply(this.anchor,s.n1.Transformable.toCanvasPoint(this.line,n.x,n.y))}containsPoint(e,t){const{line:i,text:s}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||Boolean(s?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:r,endCap:n}=this;let[o,a]=Co.from(t);const l=Co.angle(Co.sub(a,o));return r&&(o=Co.rotate(Co.from(0,-rr.HANDLE_SIZE/2),l,o)),n&&(a=Co.rotate(Co.from(0,rr.HANDLE_SIZE/2),l,a)),"start"===i?o:a}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},wo={type:"line",datum:Wi,scene:So,isDatum:Wi.is,translate:(e,t,i,s)=>{Wi.is(t)&&So.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Wi.is(t)&&Wi.is(i)&&So.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Wi.is(t)&&So.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new po({...e,create:t("line")}),dragState:e=>new Ys(e)},xo={type:"arrow",datum:zi,scene:So,isDatum:zi.is,translate:(e,t,i,s)=>{zi.is(t)&&So.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(zi.is(t)&&zi.is(i)&&So.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{zi.is(t)&&So.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new uo({...e,create:t("arrow")}),dragState:e=>new Ys(e)};function Eo(e,t=0,i=0){let r=t;for(const t of e)if(Array.isArray(t)){for(const e of t)Mo(e,r);r+=s.n1.Group.computeChildrenBBox(t).width+i}else Mo(t,r),r+=t.getBBox().width+i}function Mo(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function Ao(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function To(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function Do(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var{Vec4:Io}=s.n1,Ro=class extends s.n1.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new s.n1.Rect,this.dateRangeBarsText=new s.n1.Text,this.dateRangeDivider=new s.n1.Line,this.dateRangeValueText=new s.n1.Text,this.priceRangeValueText=new s.n1.Text,this.priceRangeDivider=new s.n1.Line,this.priceRangePercentageText=new s.n1.Text,this.volumeText=new s.n1.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,r,n,o,a){this.verticalDirection=o;const l=this.updateStatistics(e,t,i,a),c=s.n1.Group.computeChildrenBBox(l.flat());c.grow(10),this.updateBackground(e,c,10),this.reposition(l,10,n),this.checkVisibility(e,n,r)}checkVisibility(e,t,i){const r=Io.from(new s.n1.BBox(0,0,t.seriesRect.width,t.seriesRect.height));Io.collides(i,r)?this.visible=e.visible??!0:this.visible=!1}updateStatistics(e,t,i,r){const{dateRangeBarsText:n,dateRangeDivider:o,dateRangeValueText:a,priceRangeValueText:l,priceRangeDivider:c,priceRangePercentageText:h,volumeText:d}=this,u=e.statistics.fontSize+3,p=this.getTextStyles(e),g={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:u},m=[n,o,a],f=[l,c,h],y=[];return t.priceRange&&(l.setProperties({...p,text:this.formatPriceRangeValue(t.priceRange.value,r)}),c.setProperties(g),h.setProperties({...p,text:this.formatPriceRangePercentage(t.priceRange.percentage,r)}),Eo(f,i.x,8),y.push(f)),t.dateRange&&(n.setProperties({...p,text:this.formatDateRangeBars(t.dateRange.bars,r)}),o.setProperties(g),a.setProperties({...p,text:this.formatDateRangeValue(t.dateRange.value)}),Eo(m,i.x,8),y.push(m)),null!=t.volume?(d.setProperties({...p,x:i.x,text:this.formatVolume(t.volume,r),visible:!0}),y.push(d)):d.visible=!1,function(e,t=0,i=0){let r=t;for(const t of e)if(Array.isArray(t)){for(const e of t)Ao(e,r);r+=s.n1.Group.computeChildrenBBox(t).height+i}else Ao(t,r),r+=t.getBBox().height+i}(y,i.y,6),c.y1+=-2,c.y2+=-2,o.y1+=-2,o.y2+=-2,y}updateBackground(e,t,i){const s=this.getBackgroundStyles(e);this.background.setProperties({...s,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:r,height:n}=i.seriesRect,o=Io.from(this.background.getBBox());let a=0;o.x1<0&&(a=-o.x1),o.x2>r&&(a=r-o.x2);const l=Math.min(t,n-o.y2);for(const t of e)if(Array.isArray(t)){const e=s.n1.Group.computeChildrenBBox(t).width;for(const i of t)To(i,a-e/2),Do(i,l)}else To(t,a-t.getBBox().width/2),Do(t,l);this.background.x+=a,this.background.y+=l}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const s=36e5,r=24*s,n=Math.floor(e/6e4),o=Math.floor(e/s),a=Math.floor(e/r),l=o%24,c=n%60;return a>=1&&t.push(`${a}d`),o>=1&&(e<r||0!==l)&&t.push(`${l}h`),(e<s||0!==c)&&t.push(`${c}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i=isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},Po=class extends Ro{getDirectionStyles(e){return"down"===this.verticalDirection?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},{Vec2:ko,Vec4:Lo}=s.n1,No=class extends Gr{constructor(){super(),this.type="measurer",this.horizontalLine=new un,this.verticalLine=new un,this.horizontalStartLine=new un,this.horizontalEndLine=new un,this.verticalStartLine=new un,this.verticalEndLine=new un,this.horizontalEndCap=new vo,this.verticalEndCap=new vo,this.background=new s.n1.Path({zIndex:-1}),this.updateBackground=Pn.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return or.isCheck(e,"measurer")}createStatisticsScene(){return new Ro}update(e,t){const i=Ft(e,t);if(null==i)return void(this.visible=!1);if(this.visible=e.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,e,t),r={...s,y2:s.y1},n={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,s),this.updateBackground(e,r,n,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const s={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[r,n]=ko.from(i.yAxis.bounds);return mi.is(t)?(t.extendAbove&&(s.y1=r.y),t.extendBelow&&(s.y2=n.y)):fi.is(t)&&(t.extendLeft&&(s.x1=r.x),t.extendRight&&(s.x2=n.x)),s}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:r,verticalEndLine:n,verticalEndCap:o}=this,{direction:a}=e;r.visible="vertical"!==a,n.visible="vertical"!==a,s.visible="vertical"!==a,t.visible="horizontal"!==a,i.visible="horizontal"!==a,o.visible="horizontal"!==a}updateLines(e,t){const{horizontalLine:i,verticalLine:s}=this,{direction:r}=e,{x1:n,y1:o,x2:a,y2:l}=t,c=ko.round(Lo.center(t),0),h=this.getLineStyles(e);"vertical"!==r&&i.setProperties({...h,x1:n,x2:a,y1:c.y,y2:c.y}),"horizontal"!==r&&s.setProperties({...h,x1:c.x,x2:c.x,y1:o,y2:l})}updateText(e,t){const{direction:i}=e,s=ko.round(Lo.center(t),0);let r;const n={...t};"vertical"===i?(r=this.verticalLine,n.x1=s.x,n.x2=s.x):(r=this.horizontalLine,n.y1=s.y,n.y2=s.y),this.text=this.updateNode(pn,this.text,!!e.text.label);const{id:o}=r,a=mn(o,r,n,e.text,this.text,e.text.label,e.strokeWidth);let l;if("both"===i&&a&&this.text){const e=Lo.from(this.text.getBBox()),{offset:t}=a.numbers;e.x1<=s.x+t.x&&e.x2>=s.x-t.x&&(l={x:s.x,y:a.clipMask.y,radius:this.text.getBBox().height/2+ko.length(t)})}this.verticalLine.setClipMask(o,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:r}=e,{x1:n,y1:o,x2:a,y2:l}=t,c=ko.round(Lo.center(t),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(e),p={stroke:h,strokeWidth:d,strokeOpacity:u};if("vertical"!==r){const e=n<=a?0:Math.PI;let t=a;"horizontal"===r&&(t+=n<=a?-2:2),i.update({...p,x:t,y:c.y,angle:e})}if("horizontal"!==r){const e=o<=l?Math.PI/2:Math.PI/-2;let t=l;"vertical"===r&&(t+=o<=l?-2:2),s.update({...p,x:c.x,y:t,angle:e})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:r,horizontalEndLine:n}=this,{direction:o}=e,{x1:a,y1:l,x2:c,y2:h}=t,d=this.getLineStyles(e);"horizontal"===o&&(i.setProperties({...d,x1:a,y1:l,x2:a,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),"vertical"===o&&(r.setProperties({...d,x1:a,y1:l,x2:c,y2:l}),n.setProperties({...d,x1:a,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const s=ko.add(Lo.bottomCenter(t),ko.from(0,10)),r={volume:this.getVolume(e)};e.hasPriceRange&&(r.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(r.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,r,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,r){const n=Lo.topCenter(t);ko.apply(this.anchor,s.n1.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(e,t,i,s){const[r,n]=ko.from(t),[o,a]=ko.from(i);return[r,n,a,o]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:r}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:r,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:s,verticalLine:r,horizontalStartLine:n,horizontalEndLine:o,verticalStartLine:a,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||r.isPointInPath(e,t)||n.visible&&n.isPointInPath(e,t)||o.visible&&o.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||Boolean(s?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(Lo.width(e)/i)*s:0}getDateRangeValue(e){const t=_t(e.start.x),i=_t(e.end.x);if(!(0,r.$P)(t)||!(0,r.$P)(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(null==e.start.y||null==e.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=_t(e.end.y),i=_t(e.start.y);if(!(0,r.Et)(t)||!(0,r.Et)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(null==e.start.y||null==e.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=_t(e.end.y),i=_t(e.start.y);if(!(0,r.Et)(t)||!(0,r.Et)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},_o=class extends No{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return or.isCheck(e,"quick-measurer")}createStatisticsScene(){return new Po}getDirectionStyles(e){return"down"===this.verticalDirection?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},{StateMachine:Oo,StateMachineProperty:Fo,Debug:Go}=s.n1,Bo=class extends Oo{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({point:t})=>{const{datum:i,node:s}=this;i?.set({end:t}),s?.toggleActive(!0),s?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},r=()=>e.delete();super("start",{start:{reset:Oo.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:Oo.parent,action:s},dragEnd:{target:Oo.parent,action:s},reset:{target:Oo.parent,action:r},cancel:{target:Oo.parent,action:r},onExit:()=>{e.showAnnotationOptions(),is(this.datum)||e.recordAction(`Create ${this.node?.type} annotation`)}}}),this.debug=Go.create(!0,"annotations")}};a([Fo()],Bo.prototype,"datum",2),a([Fo()],Bo.prototype,"node",2);var Vo=class extends Bo{createDatum(){return new mi}},Ho=class extends Bo{createDatum(){return new fi}},Uo=class extends Bo{createDatum(){return new yi}},zo=class extends Bo{createDatum(){return new vi}},Wo={type:"date-range",datum:mi,scene:No,isDatum:mi.is,translate:(e,t,i,s)=>{mi.is(t)&&No.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(mi.is(t)&&mi.is(i)&&No.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{mi.is(t)&&No.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Vo({...e,create:t("date-range")}),dragState:e=>new Ys(e)},jo={type:"price-range",datum:fi,scene:No,isDatum:fi.is,translate:(e,t,i,s)=>{fi.is(t)&&No.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(fi.is(t)&&fi.is(i)&&No.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{fi.is(t)&&No.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ho({...e,create:t("date-range")}),dragState:e=>new Ys(e)},Ko={type:"date-price-range",datum:yi,scene:No,isDatum:yi.is,translate:(e,t,i,s)=>{yi.is(t)&&No.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(yi.is(t)&&yi.is(i)&&No.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{yi.is(t)&&No.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Uo({...e,create:t("date-range")}),dragState:e=>new Ys(e)},$o={type:"quick-date-price-range",datum:vi,scene:_o,isDatum:vi.is,translate:(e,t,i,s)=>{vi.is(t)&&_o.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(vi.is(t)&&vi.is(i)&&_o.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{vi.is(t)&&_o.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new zo({...e,create:t("quick-date-price-range")}),dragState:e=>new Ys(e)},{ZIndexMap:Yo,TextWrapper:qo}=s.n1,Xo=class extends Qr{constructor(){super(),this.type="note",this.shape=new s.n1.Rect,this.iconBackground=new s.n1.SvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new s.n1.SvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new s.n1.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return or.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=(0,r.qE)(0,s.x,i.seriesRect.width-e.width);const n=e.getPadding().top,o=s.y-30-2*n,a=s.y+rr.HANDLE_SIZE+2*n;return o-s.height-34<0?(s.y=a,e.position="top"):(s.y=o+n,e.position="bottom"),s}updateLabel(e,t){const i=!1!==e.visible&&this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=qo.wrapText(e.text,{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},avoidOrphans:!1,textAlign:e.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const s=e.getPadding().top,r="top"===e.position;i.x=t.x-s,i.width=e.width+2*s,i.height=t.height+2*s,i.y=t.y+(r?0:-t.height)-s}updateIcon(e,t){const{active:i,iconBackground:s,iconLines:r}=this,{x:n,y:o}=Gt(e,t);s.x=n-11,s.y=o-20,r.x=s.x,r.y=s.y,s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeOpacity=e.strokeOpacity??1,s.strokeWidth=e.strokeWidth??1,r.fill=e.stroke,s.fillShadow.color=i?e.fill??"rgba(0, 0, 0, 0.22)":"rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const s=e.getPadding().top,r="top"===e.position,n=r?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+n*(t.height+s),position:r?"below":"above"}}getLabelCoords(e,t){const i="top"===e.position,s=e.getPadding().top+e.fontSize*wi/2;return{x:t.x,y:t.y+(i?s/2:0)}}getTextBaseline(e){return"top"===e.position?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+rr.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e){super.toggleHovered(e),this.label.visible=e,this.shape.visible=e,this.zIndex=e?Yo.CHART_ANNOTATION_FOCUSED:Yo.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return!(!this.shape.visible||!this.shape.containsPoint(e,t))||!!this.iconBackground.containsPoint(e,t)||super.containsPoint(e,t)}},Zo=class extends nn{createDatum(){return new Ri}},Qo={type:"note",datum:Ri,scene:Xo,isDatum:Ri.is,translate:(e,t,i,s)=>{Ri.is(t)&&Xo.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ri.is(t)&&Ri.is(i)&&Xo.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ri.is(t)&&Xo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Zo({...e,create:t("note")}),dragState:e=>new Ys(e)},{Vec2:Jo,Vec4:ea}=s.n1,ta=class extends kn{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new rr,topMiddle:new ir,topRight:new rr,bottomLeft:new rr,bottomMiddle:new ir,bottomRight:new rr},this.middleLine=new un,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return or.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:r,handles:n}=this;if(null==r)return;const{offset:o}=n[r].drag(t);n[r].toggleDragging(!0),"topMiddle"!==r&&"bottomMiddle"!==r||(o.x=0);let a=[],l=s;switch(r){case"topLeft":case"bottomLeft":a=["topLeft","bottomLeft"];break;case"topMiddle":a=["topLeft","topRight"],o.y-=ir.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":a=["topRight","bottomRight"];break;case"bottomMiddle":a=["bottomLeft","bottomRight"],o.y-=ir.HANDLE_SIZE/2,l=!1}const c=Ft(e,i),h=Ft(e.bottom,i);if(!c||!h)return;const d={topLeft:ea.start(c),topRight:ea.end(c),bottomLeft:ea.start(h),bottomRight:ea.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:e.snapToAngle},p=pr(d,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:a,snap:l?u:void 0});e.start.x=p.topLeft.x,e.start.y=p.topLeft.y,e.end.x=p.topRight.x,e.end.y=p.topRight.y,e.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:s}=this.handles,r=i.getBBox().y-s.getBBox().y;return{start:e,end:t,bottomStart:Jo.add(e,Jo.from(0,r)),bottomEnd:Jo.add(t,Jo.from(0,r))}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,s,r,n){const{topLine:o,middleLine:a,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=e,p=e.getLineDash(),g={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};o.setProperties({...t,...g}),l.setProperties({...i,...g});const m=this.extendLine({x1:r.x1,y1:n.y1+(r.y1-n.y1)/2,x2:r.x2,y2:n.y2+(r.y2-n.y2)/2},e,s);a.setProperties({...m,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??d,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:r,topRight:n,bottomLeft:o,bottomMiddle:a,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...ea.start(t)}),n.update({...c,...ea.end(t)}),o.update({...c,...ea.start(i)}),l.update({...c,...ea.end(i)}),r.update({...c,...Jo.sub(ea.center(t),Jo.from(r.handle.width/2,r.handle.height/2))}),a.update({...c,...Jo.sub(ea.center(i),Jo.from(a.handle.width/2,a.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(pn,this.text,!!e.text.label),fn(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const r=t.x1>t.x2,n=t.y1>t.y2,o=t.x1!==i.x1&&t.y1!==i.y1,a=t.x2!==i.x2&&t.y2!==i.y2,l=Jo.from(t);return e.extendEnd&&a&&l.push(Jo.from(r?s.x1:s.x2,n?s.y1:s.y2)),l.push(...Jo.from(i).reverse()),e.extendStart&&o&&l.push(Jo.from(r?s.x2:s.x1,n?s.y2:s.y1)),l}},{StateMachine:ia,StateMachineProperty:sa,Debug:ra}=s.n1,na=class extends ia{constructor(e){const t=({point:t})=>{const i=new Ji;i.set({start:t,end:t,height:0}),e.create(i)},i=({offset:t,context:i})=>{const{datum:s,snapping:r}=this;s&&(s.set({end:hr(t,i,r,s.start,s.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},n=({point:t})=>{const{datum:i,node:s}=this,n=_t(i?.end.y),o=_t(i?.start.y),{y:a}=t;if(null==i||!(0,r.Et)(o)||!(0,r.Et)(n)||!(0,r.Et)(a))return;const l=n-(a??0),c=o-l;s?.toggleHandles(!0),e.validatePoint({x:i.start.x,y:c},{overflowContinuous:!0})&&e.validatePoint({x:i.end.x,y:t.y},{overflowContinuous:!0})&&(i.set({height:l}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:ia.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:ia.parent,action:o},cancel:{target:ia.parent,action:o}},height:{hover:({point:t})=>{const{datum:i,node:s}=this,n=_t(i?.end.y),o=_t(i?.start.y),{y:a}=t;if(null==i||!(0,r.Et)(o)||!(0,r.Et)(n)||!(0,r.Et)(a))return;const l=n-(a??0),c=o-l;s?.toggleHandles({bottomLeft:!0,bottomRight:!0}),e.validatePoint({x:i.start.x,y:c},{overflowContinuous:!0})&&e.validatePoint({x:i.end.x,y:t.y},{overflowContinuous:!0})&&(i.set({height:l}),e.update())},click:{target:ia.parent,action:n},drag:{target:ia.parent,action:n},reset:{target:ia.parent,action:o},cancel:{target:ia.parent,action:o}}}),this.debug=ra.create(!0,"annotations"),this.snapping=!1}};a([sa()],na.prototype,"datum",2),a([sa()],na.prototype,"node",2),a([sa()],na.prototype,"snapping",2);var oa={type:"parallel-channel",datum:Ji,scene:ta,isDatum:Ji.is,translate:(e,t,i,s)=>{Ji.is(t)&&ta.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ji.is(t)&&Ji.is(i)&&ta.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ji.is(t)&&ta.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new na({...e,create:t("parallel-channel")}),dragState:e=>new Ys(e)},aa=class extends Qr{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return or.isCheck(e,"text")}getHandleCoords(e,t){const i=rr.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},la=class extends nn{createDatum(){return new ts}},ca={type:"text",datum:ts,scene:aa,isDatum:ts.is,translate:(e,t,i,s)=>{ts.is(t)&&aa.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ts.is(t)&&ts.is(i)&&aa.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ts.is(t)&&aa.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new la({...e,create:t("text")}),dragState:e=>new Ys(e)},ha={[wo.type]:wo,[Dn.type]:Dn,[In.type]:In,[oa.type]:oa,[Vn.type]:Vn,[mo.type]:mo,[so.type]:so,[Zr.type]:Zr,[an.type]:an,[Qo.type]:Qo,[ca.type]:ca,[xo.type]:xo,[kr.type]:kr,[Dr.type]:Dr,[Wo.type]:Wo,[jo.type]:jo,[Ko.type]:Ko,[$o.type]:$o};function da(e){for(const{isDatum:t}of Object.values(ha))if(t(e))return e}var{ActionOnSet:ua,ParallelStateMachine:pa,StateMachine:ga,StateMachineProperty:ma,Debug:fa}=s.n1,ya=class extends pa{constructor(e){super(new va(e=>{this.snapping=e}),new Ca(()=>{this.node=null==this.active?void 0:e.node(this.active)}),new ba(e,t=>{this.active=t,this.datum=null==this.active?void 0:e.datum(this.active),this.node=null==this.active?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};a([ma()],ya.prototype,"snapping",2),a([ma()],ya.prototype,"datum",2),a([ma()],ya.prototype,"node",2);var va=class extends ga{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},Ca=class extends ga{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},ba=class extends ga{constructor(e,t){const i=()=>{null!=this.active&&e.delete(this.active),this.active=void 0,e.select()},s={createDatum:t=>i=>{e.create(t,i),this.active=e.selectLast()}},r={...e,delete:i,showTextInput:()=>{null!=this.active&&e.showTextInput(this.active)},deselect:()=>{const t=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,t)},showAnnotationOptions:()=>{null!=this.active&&e.showAnnotationOptions(this.active)}},n=({colorPickerType:t,colorOpacity:i,color:s,opacity:r,isMultiColor:n})=>{this.datum&&("text-color"===t&&e.updateTextInputColor(s),fs(this.datum,t,i,s,r,n),e.update())},o=t=>{const{datum:i,node:s}=this;i&&s&&(os(i)?(i.fontSize=t,e.updateTextInputFontSize(t)):ps(i)&&(i.text.fontSize=t),e.update())},a=t=>{const{node:i}=this;i&&"setTextInputBBox"in i&&(i.setTextInputBBox(t),e.update())},l=({textInputValue:t,bbox:i})=>{const{datum:s}=this;if(null!=i&&null!=t&&t.length>0){if(!os(s))return;const r=Ei(s,t,i.width);s.set({text:r}),e.update(),e.recordAction(`Change ${s.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${s?.type} annotation`)},c=()=>{e.updateTextInputBBox(void 0)},h=()=>null!=this.active,d=()=>{const{active:e,datum:t}=this;return null!=e&&!!t&&ps(t)&&!t.locked},u=()=>null!=this.active&&!is(this.datum);super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:t})=>{this.hovered=e.hoverAtCoords(t,this.active,this.hovered),this.hoverCoords=t},translate:{guard:h,target:"translating",action:({translation:t})=>{e.startInteracting(),e.translate(this.active,t),e.update()}},copy:{guard:u,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:u,action:()=>{this.copied=e.copy(this.active),i()}},paste:{guard:()=>null!=this.copied,action:()=>{e.paste(this.copied)}},selectLast:()=>{const t=this.active;this.active=e.selectLast(),e.select(this.active,t)},click:[{guard:()=>{const{active:e,hovered:t,datum:i}=this;return null!=e&&t===e&&!!i&&os(i)&&!i.locked},target:"text-input"},{action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t)}}],dblclick:{guard:d,action:({offset:t})=>{const i="text"===e.getNodeAtCoords(t,this.active)?"text":"line";e.showAnnotationSettings(this.active,void 0,i)}},dragStart:[{guard:()=>null!=this.hovered,target:"dragging",action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t),e.startInteracting()}},{action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t)}}],color:{guard:h,action:n},fontSize:{guard:h,action:o},lineProps:{guard:h,action:t=>{const i=da(this.datum);i?.set(t),e.update(),e.recordAction(`Change ${i?.type} ${Object.entries(t).map(([e,t])=>`${e} to ${t}`).join(", ")}`)}},lineStyle:{guard:h,action:t=>{const{datum:i,node:s}=this;i&&s&&cs(i)&&(ms(i,t),e.update())}},lineText:{guard:h,action:t=>{const i=da(this.datum);ps(i)&&(rs(i)&&"center"===t.position&&(t.position="inside"),i.text.set(t),e.update())}},updateTextInputBBox:{guard:h,action:a},toolbarPressSettings:{guard:d,action:t=>{e.showAnnotationSettings(this.active,t)}},reset:()=>{null!=this.active&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{null!=this.active&&(e.delete(this.active),is(this.datum)||e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...Object.fromEntries(Object.entries(ha).map(([e,t])=>[e,t.createState(r,s)]))},dragging:{onEnter:(t,i)=>{if(null==this.active)return;const s=e.getAnnotationType(this.active);s&&(this.transitionRoot(s),this.transitionRoot("dragStart",i))},...Object.fromEntries(Object.entries(ha).map(([t,i])=>[t,i.dragState(e,s)]))},translating:{onEnter:()=>{},translate:{guard:h,target:"translating",action:({translation:t})=>{e.startInteracting(),e.translate(this.active,t),e.update()}},translateEnd:{guard:h,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(null==this.active)return;const t=da(this.datum);t&&"getTextInputCoords"in t&&(e.startInteracting(),e.showTextInput(this.active),t.visible=!1,e.update())},updateTextInputBBox:{guard:h,action:a},resize:{target:"idle",action:l},click:{target:"idle",action:l},drag:{target:"idle",action:l},textInput:[{guard:Wr,target:"idle",action:c},{guard:jr,target:"idle",action:l}],color:{guard:h,action:n},fontSize:{guard:h,action:o},cancel:{target:"idle",action:c},onExit:()=>{e.stopInteracting(),e.hideTextInput();const t=this.active;if(this.active=this.hovered=void 0,e.select(this.active,t),null==t)return;const i=e.datum(t),s=e.node(t);i&&s&&(i.visible=!0)}}}),this.setActive=t,this.debug=fa.create(!0,"annotations"),this.snapping=!1}};a([ua({changeValue(e){this.setActive(e)}}),ma()],ba.prototype,"active",2),a([ma()],ba.prototype,"hovered",2),a([ma()],ba.prototype,"hoverCoords",2),a([ma()],ba.prototype,"copied",2),a([ma()],ba.prototype,"snapping",2),a([ma()],ba.prototype,"datum",2),a([ma()],ba.prototype,"node",2);var{ActionOnSet:Sa,LayoutElement:wa,Menu:xa,PropertiesArray:Ea,ToolbarButtonProperties:Ma,Property:Aa,ChartAxisDirection:Ta}=s.n1,Da=class extends Ma{};a([Aa],Da.prototype,"value",2);var Ia=class extends s.n1.BaseProperties{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new Ea(Da),this.events=new s.n1.Listeners,this.annotationMenu=new xa(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(wa.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){for(const e of this.destroyFns)e()}addListener(e,t){return this.events.addListener(e,t)}toggleVisibility(e){this.toolbar.setHidden(!e)}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(e=>"clear"===e.value);this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"})}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(e,t){this.events.dispatch(e,t)}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i}){const s=this.ctx.axisManager.getAxisContext(Ta.Y)[0].scale;switch(t.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsLineAnnotations",xs.filter(e=>!e.visible||e.visible(s)));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsFibonacciAnnotations",Es);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsTextAnnotations",As);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsShapeAnnotations",Ts);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsMeasurerAnnotations",Ds)}}onToolbarButtonPressShowMenu(e,t,i,s,r){this.dispatch("pressed-show-menu");const n=this.buttons.findIndex(e=>e.value===i);this.toolbar.toggleActiveButtonByIndex(n),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show({items:r,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(t=>t.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.dispatch("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){"Escape"===e.key&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};a([Aa,Sa({changeValue(e){this.toolbar?.setHidden(!e)}})],Ia.prototype,"enabled",2),a([Aa],Ia.prototype,"padding",2),a([Aa],Ia.prototype,"buttons",2);var{BaseModuleInstance:Ra,InteractionState:Pa,Property:ka,ChartAxisDirection:La,getIconClassNames:Na}=s.n1,_a="ag-charts-annotations__axis-button",Oa=class extends Ra{constructor(e,t,i,s){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=Boolean(t.scale.bandwidth),e.domManager.addEventListener("focusin",({target:t})=>{const i=t instanceof HTMLElement?t:void 0;i&&e.domManager.contains(i,"series-area")||i===this.button.getElement()||this.hide()}),this.destroyFns.push(e.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseDrag(e)),e.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseMove(e)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.hide()),e.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new s.uB.ButtonWidget;return e.addClass(_a),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",_a)}onMouseMove(e){this.ctx.interactionManager.isState(Pa.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(Pa.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(Pa.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(Pa.Clickable)&&"touch"===e.device&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:s}=e;if(!this.enabled||!this.ctx.widgets.seriesWidget.getElement().contains(t.target))return void this.hide();this.toggleVisibility(!0);const r=this.getButtonCoordinates({x:i,y:s});this.coords={x:r.x+this.button.clientWidth/2,y:r.y+this.button.clientHeight/2},this.updatePosition(r)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Pa.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:r,snap:n,axisCtx:o,padding:a}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,r.height],[u,p]=[0,r.width];if(n&&(e=Bt(Ht(e-r.x,o),o)+r.x,t=Bt(Ht(t-r.y,o),o)+r.y),i===La.X){const i=5,r=c-Math.max(0,a-i);e-=l/2,t="top"===s?h-c+r:d-r}else{const i=9,r=l-Math.max(0,a-i);e="left"===s?u-l+r:p-r,t-=c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(null==t)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${_a}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(`<span class="${Na("zoom-in")} ${_a}-icon"></span>`)}};a([ka],Oa.prototype,"enabled",2);var{Color:Fa,DraggablePopover:Ga,NativeWidget:Ba,Vec2:Va,createButton:Ha,createCheckbox:Ua,createSelect:za,createTextArea:Wa,initRovingTabIndex:ja,getIconClassNames:Ka,mapValues:$a}=s.n1,Ya=class e extends Ga{constructor(e,t){super(e,t),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new Ss(this.ctx,{detached:!0}),this.destroyFns.push(e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,t){const i=super.showWithChildren(e,t);return i.classList.add("ag-charts-dialog"),i.setAttribute("role","dialog"),i.addEventListener("mousedown",e=>{e.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),i.addEventListener("keydown",this.onKeyDown.bind(this)),(0,r.zk)().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),i}updatePosition(e){super.updatePosition(e);const{anchor:t,fallbackAnchor:i}=this.getColorPickerAnchors()??{};t&&this.colorPicker.setAnchor(t,i)}createTabs(e,t,i){const s=(0,r.n)("div","ag-charts-dialog__tabs"),n=$a(i,()=>(0,r.wW)()),o=$a(i,()=>(0,r.wW)());for(const[e,t]of(0,r.jO)(i))(0,r.Wp)(t.panel,{id:o[e],role:"tabpanel","aria-labelledby":n[e]});const a=e=>{for(const[t,s]of(0,r.jO)(i))s.panel.classList.toggle("ag-charts-dialog__tab-panel--active",t===e),h[t].classList.toggle("ag-charts-dialog__tab-button--active",t===e),(0,r.Bq)(h[t],"aria-selected",t===e),t===e&&s.onShow?.()},l=new Ba((0,r.n)("div","ag-charts-dialog__header"));l.addListener("drag-start",e=>{const{sourceEvent:t}=e;t.target instanceof Element&&t.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(e)}),l.addListener("drag-move",e=>this.onDragMove(e)),l.addListener("drag-end",()=>this.onDragEnd());const c=new Xa;this.setDragHandle(c);const h=$a(i,(e,t)=>Ha({label:this.ctx.localeManager.t(e.label),onPress:()=>a(t)},{id:n[t],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[t]})),d=(0,r.n)("div","ag-charts-dialog__tab-list");(0,r.Wp)(d,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),s.append(l.getElement(),...Object.values(i).map(e=>e.panel)),a(t),ja({orientation:"horizontal",buttons:Object.values(h)}),{tabs:s,initialFocus:h[t]}}createTabPanel(){return(0,r.n)("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return(0,r.n)("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:t,value:i,onChange:s}){const n=this.createInputGroup(e);(0,r.Wp)(n,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const o="ag-charts-dialog__button--active",a=[];for(const e of t){const{icon:t,altText:r}=e,l=this.ctx.localeManager.t(r),c=Ha({icon:t,altText:l,onPress:()=>{for(const e of Array.from(n.children))e.classList.remove(o),e.ariaChecked="false";c.classList.add(o),c.ariaChecked="true",s(e.value)}},{"aria-checked":e.value===i,class:"ag-charts-dialog__button",role:"radio",title:l});e.value===i&&c.classList.add(o),n.appendChild(c),a.push(c)}return ja({orientation:"horizontal",buttons:a}),n}createSelect({altText:e,label:t,options:i,value:s,onChange:r}){const n=this.createInputGroup(t),o=this.ctx.localeManager.t(e),a=za({value:s,options:i,onChange:r},{class:"ag-charts-dialog__select","aria-label":o,title:o});return n.append(a),n}createTextArea({placeholder:e,value:t,onChange:i}){const s=e?this.ctx.localeManager.t(e):void 0;return Wa({value:t,onChange:i},{placeholder:s})}createCheckbox({label:e,checked:t,onChange:i}){const s=(0,r.wW)(),n=this.createInputGroup(e,{for:s}),o=Ua({checked:t,onChange:i},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return n.append(o),n}createColorPicker({color:e,opacity:t,label:i,altText:s,onChange:r,onChangeHide:n,isMultiColor:o,hasMultiColorOption:a}){const l=this.createInputGroup(i),c=this.ctx.localeManager.t(s),h=Ha({label:c,onPress:i=>{const{anchor:s,fallbackAnchor:l}=this.getColorPickerAnchors(h)??{};this.colorPicker.show({anchor:s,fallbackAnchor:l,color:e,opacity:t,isMultiColor:o,hasMultiColorOption:a,sourceEvent:i,onChange:(e,t,i,s)=>{h.style.setProperty("--color",e),h.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",s),r(e,t,i,s)},onChangeHide:n})}},{"aria-label":c,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:c});if(o)h.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const i=Fa.fromString(e),s=new Fa(i.r,i.g,i.b,t);h.style.setProperty("--color",s.toHexString())}return l.append(h),this.hideFns.push(()=>{this.colorPicker.hide()}),l}createHeaderCloseButton(){return Ha({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,t){const i=(0,r.n)("div","ag-charts-dialog__input-group"),s=(0,r.n)("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(e),(0,r.Bq)(s,"for",t?.for),i.appendChild(s),i}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||"Escape"!==e.key||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=i.domManager.getBoundingClientRect(),r=this.getPopoverElement();if(!t||!r)return;const n=Va.from(0,t.y),o=Va.from(s.width,t.height),a=Va.from(r),l=Va.from(.5,1);let c;if(t.width>1e3){const t=Va.sub(Va.add(n,Va.multiply(o,l)),Va.multiply(a,l));c=Va.sub(t,Va.from(0,e.offset))}else{const t=Va.sub(Va.add(n,o),a);c=Va.sub(t,e.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const t=this.colorPickerAnchorElement.getBoundingClientRect(),i=this.ctx.domManager.getBoundingClientRect(),s=Va.sub(Va.from(t.x,t.y),Va.from(i.left,i.top));return{anchor:Va.add(s,Va.from(0,t.height+5)),fallbackAnchor:Va.sub(s,Va.from(0,5))}}};Ya.offset=60;var qa=Ya,Xa=class extends Ba{constructor(){super((0,r.n)("div","ag-charts-dialog__drag-handle"));const e=new Ba((0,r.n)("span",Ka("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},{Listeners:Za,focusCursorAtEnd:Qa}=s.n1,Ja=class extends qa{constructor(e){super(e,"settings"),this.events=new Za,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(e,t){return this.events.addListener(e,t)}show(e,t){const i=this.createLinearLineTab(e,t),s=this.createLinearTextTab(e,t);let r="dialogHeaderLine";rs(e)?r="dialogHeaderChannel":ns(e)?r="dialogHeaderFibonacciRange":"date-range"===e.type?r="dialogHeaderDateRange":"price-range"===e.type?r="dialogHeaderPriceRange":"date-price-range"===e.type&&(r="dialogHeaderDatePriceRange");const{tabs:n,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:r,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});t.initialFocus=o,this.showWithChildren([n],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),s=this.createInputGroupLine(),r=this.createInputGroupLine(),n="isMultiColor"in e,o=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),!!n&&e.isMultiColor,n,t.onChangeLineColor,t.onChangeHideLineColor),a=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(s.append(o),"background"in e){const i=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);s.append(i),r.append(a)}else"showFill"in e?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:e=>t.onChangeLine({showFill:e})})),r.append(a)):s.append(a);return r.append(l),i.append(s,r),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,e=>t.onChangeLine({bands:e}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:rs(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:e=>t.onChangeLine({extendStart:e})}),this.createCheckbox({label:rs(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:e=>t.onChangeLine({extendEnd:e})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:e=>t.onChangeLine({extendAbove:e})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:e=>t.onChangeLine({extendBelow:e})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:e=>t.onChangeLine({extendLeft:e})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:e=>t.onChangeLine({extendRight:e})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:e=>t.onChangeLine({reverse:e})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:e=>t.onChangeText({label:e})}),r=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),n=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),o="inside"===e.text.position?"center":e.text.position,a=this.createPositionRadioGroup(o??"top",e=>t.onChangeText({position:e})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",e=>t.onChangeText({alignment:e})),c=this.createInputGroupLine();return c.append(r,n,a,l),i.append(s,c),{panel:i,onShow:()=>Qa(s)}}createColorPickerInput(e,t,i,s,r,n,o){const a="fill-color"===e?"dialogInputFillColorPicker":"dialogInputColorPicker",l="fill-color"===e?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:a,altText:l,color:t,opacity:i,isMultiColor:s,hasMultiColorOption:r,onChange:n,onChangeHide:o})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:Is.map(({label:e,value:t})=>({label:e,value:`${t}`})),value:String(e),onChange:e=>t(Number(e))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:Ms.map(({label:e,value:t})=>({label:e,value:`${t}`})),value:String(e),onChange:e=>t(Number(e))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:Ps.map(({label:e,value:t})=>({label:e,value:String(t)})),value:String(e),onChange:e=>t(Number(e))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function el(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}var{ChartUpdateType:tl,InteractionState:il,ObserveChanges:sl,PropertiesArray:rl,Property:nl,ChartAxisDirection:ol,Vec2:al,keyProperty:ll,valueProperty:cl,Selection:hl,BBox:dl}=s.n1,ul=class e extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,this.toolbar=new Ia(this.ctx),this.optionsToolbar=new zs(this.ctx,()=>{const e=this.state.getActive();if(null!=e)return da(this.annotationData.at(e))}),this.axesButtons=new ot,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new rl(e.createAnnotationDatum),this.defaults=new vs,this.container=new s.n1.Group({name:"static-annotations"}),this.annotations=new hl(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new Ja(this.ctx),this.textInput=new st(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:e}=this;return new ya({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(il.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(t,i,s)=>{let r;return this.annotations.each((e,s,n)=>{const o=e.containsPoint(t.x,t.y);o&&(r??(r=n)),e.toggleHovered(o||i===n)}),null!=r?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",null==r?void 0:this.annotations.at(r)?.getCursor()),r!==s&&this.update(),r},getNodeAtCoords:(e,t)=>{const i=this.annotations.at(t);if(i)return i.getNodeAtCoords(e.x,e.y)},translate:(e,t)=>{const i=this.annotations.at(e),s=da(this.annotationData.at(e));if(i&&s)return this.translateNode(i,s,t)},copy:e=>{const t=this.annotations.at(e),i=da(this.annotationData.at(e));if(t&&i)return this.createAnnotationDatumCopy(t,i)},paste:e=>{this.createAnnotation(e.type,e,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(e,t)=>{const{annotations:i,optionsToolbar:s,toolbar:r}=this;this.hideOverlays(),r.clearActiveButton(),r.resetButtonIcons();const n=null!=e?i.at(e):null,o=null!=t?i.at(t):null;o===n&&null!=n||(o?.toggleActive(!1),s.hide(),n?(this.pushAnnotationState(il.AnnotationsSelected),n.toggleActive(!0),s.updateButtons(this.annotationData.at(e)),this.postUpdateFns.push(()=>{s.show(),s.setAnchorScene(n)})):(this.popAnnotationState(il.AnnotationsSelected),this.popAnnotationState(il.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(il.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(il.Annotations)},stopInteracting:()=>{this.popAnnotationState(il.Annotations)},create:(e,t)=>{this.createAnnotation(e,t)},delete:e=>{this.annotationData.splice(e,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:(e,t)=>{const i=this.getAnnotationContext();return!i||Yn(i,e,t)},getAnnotationType:e=>function(e){for(const t of lt)if(t===e)return t}(this.annotationData[e].type),datum:e=>this.annotationData.at(e),node:e=>this.annotations.at(e),recordAction:e=>{this.recordActionAfterNextUpdate(e)},update:()=>{this.postUpdateFns.push(()=>{const e=this.state.getActive(),t=null!=e?this.annotations.at(e):null;null!=t&&this.optionsToolbar.setAnchorScene(t)}),this.update()},showTextInput:e=>{const t=da(this.annotationData.at(e));if(!(this.annotations.at(e)&&t&&"getTextInputCoords"in t&&"getTextPosition"in t))return;const i={color:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,placeholderColor:t.getPlaceholderColor()},s=this.getAnnotationContext();this.textInput.show({styles:i,layout:{getTextInputCoords:e=>al.add(t.getTextInputCoords(s,e),al.required(this.seriesRect)),getTextPosition:()=>t.getTextPosition(),alignment:t.alignment,textAlign:t.textAlign,width:t.width},text:t.text,placeholderText:t.placeholderText,onChange:(e,t)=>{this.state.transition("updateTextInputBBox",t)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:e=>{this.textInput.updateColor(e)},updateTextInputFontSize:e=>{const t=this.textInput.updateFontSize(e);this.state.transition("updateTextInputBBox",t)},updateTextInputBBox:e=>{this.state.transition("updateTextInputBBox",e)},showAnnotationOptions:e=>{const t=this.annotations.at(e);t&&!is(this.annotationData.at(e))&&(this.optionsToolbar.updateButtons(this.annotationData.at(e)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(t))},showAnnotationSettings:(e,t,i="line")=>{const s=this.annotationData.at(e);if(!ss(s)&&!rs(s)&&!as(s))return;if(is(s))return;const r=e=>(t,i,r,n)=>{this.setColorAndDefault(s.type,e,t,i,r,n),this.optionsToolbar.updateColorPickerColor(e,i,r,n)},n=e=>()=>{this.recordActionAfterNextUpdate(`Change ${s.type} ${e} to ${s.getDefaultColor(e)}`,["annotations","defaults"]),this.update()},o={initialSelectedTab:i,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:t,onChangeLine:e=>{this.state.transition("lineProps",e),null!=e.bands&&this.defaults.setDefaultFibonacciOptions(s.type,"bands",e.bands),null!=e.reverse&&this.defaults.setDefaultFibonacciOptions(s.type,"reverse",e.reverse),null!=e.showFill&&this.defaults.setDefaultFibonacciOptions(s.type,"showFill",e.showFill)},onChangeText:e=>{this.state.transition("lineText",e),e.alignment&&this.defaults.setDefaultLineTextAlignment(s.type,e.alignment),e.position&&this.defaults.setDefaultLineTextPosition(s.type,e.position),this.recordActionAfterNextUpdate(`Change ${s.type} text ${Object.keys(e).map(t=>`${t} to ${e[t]}`).join(", ")}`)},onChangeFillColor:r("fill-color"),onChangeHideFillColor:n("fill-color"),onChangeLineColor:r("line-color"),onChangeHideLineColor:n("line-color"),onChangeLineStyleType:e=>{this.setLineStyleTypeAndDefault(s.type,e),this.optionsToolbar.updateLineStyleType(Rs.find(t=>t.value===e)??Rs[0])},onChangeLineStyleWidth:e=>{this.setLineStyleWidthAndDefault(s.type,e),this.optionsToolbar.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)})},onChangeTextColor:r("text-color"),onChangeHideTextColor:n("text-color"),onChangeTextFontSize:e=>{this.setFontSizeAndDefault(s.type,e)}};this.settingsDialog.show(s,o)}})}setupListeners(){const{ctx:e,optionsToolbar:t,settingsDialog:i,toolbar:s}=this,{seriesWidget:r,seriesDragInterpreter:n,chartWidget:o}=e.widgets;this.destroyFns.push(n.addListener("click",this.hoverTouchPreHandler.bind(this)),n.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),n.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),n.addListener("mousemove",this.onHover.bind(this)),n.addListener("click",this.onClick.bind(this)),n.addListener("dblclick",this.onDoubleClick.bind(this)),n.addListener("drag-start",this.onDragStart.bind(this)),n.addListener("drag-move",this.onDrag.bind(this)),n.addListener("drag-end",this.onDragEnd.bind(this)),r.addListener("keydown",this.onKeyDown.bind(this)),r.addListener("keyup",this.onKeyUp.bind(this)),o.addListener("click",this.onCancel.bind(this)),e.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.zoomManager.addListener("zoom-change",()=>this.onResize()),e.domManager.addListener("resize",()=>this.onResize()),s.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),s.addListener("pressed-create-annotation",({annotation:e})=>{this.cancel(),this.pushAnnotationState(il.Annotations),this.state.transition(e),this.update()}),s.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),s.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),s.addListener("pressed-unrelated",()=>{this.reset()}),t.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),t.addListener("pressed-settings",({sourceEvent:e})=>{this.state.transition("toolbarPressSettings",e)}),t.addListener("pressed-lock",()=>{this.update()}),t.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),t.addListener("saved-color",({type:e,colorPickerType:t,color:i})=>{this.recordActionAfterNextUpdate(`Change ${e} ${t} to ${i}`,["annotations","defaults"])}),t.addListener("updated-color",({type:e,colorPickerType:t,colorOpacity:i,color:s,opacity:r,isMultiColor:n})=>{this.setColorAndDefault(e,t,i,s,r,n)}),t.addListener("updated-font-size",({type:e,fontSize:t})=>{this.setFontSizeAndDefault(e,t)}),t.addListener("updated-line-style",({type:e,lineStyleType:t})=>{this.setLineStyleTypeAndDefault(e,t)}),t.addListener("updated-line-width",({type:e,strokeWidth:t})=>{this.setLineStyleWidthAndDefault(e,t)}),i.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:t}=this;this.destroyFns.push(e.annotationManager.attachNode(this.container),()=>e.domManager.removeStyles(_a),()=>t.destroy())}async processData(e){if(!this.enabled||null==this.data||null==this.xKey||null==this.volumeKey)return;const t=[ll(this.xKey,void 0,{id:"date"}),cl(this.volumeKey,"number",{id:"volume"})],{dataModel:i,processedData:s}=await e.request("annotations",this.data,{props:t});this.dataModel=i,this.processedData=s}createAnnotationScene(e){if(e.type in ha)return new ha[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(ha)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in ha)return(new ha[e.type].datum).set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(ha)}], ignoring.`)}createAnnotation(e,t,i=!0){if(this.annotationData.push(t),i){const i=this.ctx.annotationManager.getAnnotationTypeStyles(e);i&&t.set(i),this.defaults.applyDefaults(t)}this.injectDatumDependencies(t),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,t){const{dataModel:i,processedData:s}=this;let n=_t(e),o=_t(t);if(!((0,r.vd)(n)&&(0,r.vd)(o)&&i&&s&&null!=this.volumeKey))return;n>o&&([n,o]=[o,n]);const a=i.resolveKeysById({id:"annotations"},"date",s),l=i.resolveColumnById({id:"annotations"},"volume",s);let c=0;for(let e=0;e<s.input.count;e++){const t=a[e];(0,r.vd)(t)&&t>=n&&t<=o&&(c+=l[e])}return c}translateNode(e,t,i){const s=this.getAnnotationConfig(t),r=this.getAnnotationContext();r&&s.translate(e,t,i,r)}createAnnotationDatumCopy(e,t){const i=this.getAnnotationConfig(t),s=new i.datum;s.set(t.toJson());const r=this.getAnnotationContext();if(r)return i.copy(e,t,s,r)}getAnnotationConfig(e){if(e.type in ha)return ha[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(ha)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(e){const t=e.series.paddedRect;this.seriesRect=t,this.container.setClipRect(t);for(const i of e.axes??[])i.direction===s.n1.ChartAxisDirection.X?this.xAxis=this.getAxis(i,t,this.xAxis?.button):this.yAxis=this.getAxis(i,t,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some(e=>e.hasData),t=this.yAxis.context.seriesIds().some(e=>{const t=this.ctx.chartService.series.find(t=>t.id===e);return t?.visible});return e&&t}animateAnnotations({from:e,to:t,phase:i}){const{annotations:s}=this;this.ctx.animationManager?.animate({from:e,to:t,id:"chart-annotations",phase:i,groupId:"opacity",onUpdate(e){s.each(t=>{t.opacity=e,"setAxisLabelOpacity"in t&&t.setAxisLabelOpacity(e)})},onStop(){s.each(e=>{e.opacity=t,"setAxisLabelOpacity"in e&&e.setAxisLabelOpacity(t)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,t,i){const s=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:r="bottom",direction:n}=s,o=e.gridPadding+e.seriesAreaPadding,a=new dl(0,0,t.width,t.height).grow(o,r),l=s.direction===ol.X?"vertical":"horizontal",{axesButtons:c,snap:h}=this;if(this.enabled&&c.enabled&&("xy"===c.axes||c.axes===n)){i??(i=new Oa(this.ctx,{...s,snapToGroup:h},e=>this.onAxisButtonClick(e,l),t));const r=el(e);i.update(t,r)}else i?.destroy(),i=void 0;return{layout:e,context:s,bounds:a,button:i}}recordActionAfterNextUpdate(e,t=["annotations"]){const{defaults:i,ctx:{annotationManager:s,historyManager:r}}=this,n=t.map(e=>"defaults"===e?i:s);this.postUpdateFns.push(()=>{r.record(e,...n),s.fireChangedEvent()})}setColorAndDefault(e,t,i,s,r,n){this.state.transition("color",{colorPickerType:t,colorOpacity:i,color:s,opacity:r,isMultiColor:n}),this.defaults.setDefaultColor(e,t,i,s,r,n)}setFontSizeAndDefault(e,t){this.state.transition("fontSize",t),this.defaults.setDefaultFontSize(e,t),this.recordActionAfterNextUpdate(`Change ${e} font size to ${t}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,t){this.state.transition("lineStyle",{type:t}),this.defaults.setDefaultLineStyleType(e,t),this.recordActionAfterNextUpdate(`Change ${e} line style to ${t}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,t){this.state.transition("lineStyle",{strokeWidth:t}),this.defaults.setDefaultLineStyleWidth(e,t),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${t}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:t,seriesRect:i,ctx:{annotationManager:s}}=this,r=this.getAnnotationContext();if(!i||!r)return;s.updateData(e.toJson().filter(e=>!is(e)));const n=this.showAnnotations();this.toolbar.refreshButtonsEnabled(n),this.toolbar.toggleClearButtonEnabled(e.length>0&&n),t.update(e??[],void 0,e=>e.id).each((e,t)=>{if(!n)return e.visible=!1,void("setAxisLabelVisible"in e&&e.setAxisLabelVisible(!1));"setAxisLabelVisible"in e&&e.setAxisLabelVisible(!0),this.injectDatumDependencies(t),function(e,t,i){for(const{update:s}of Object.values(ha))s(e,t,i)}(e,t,r)}),this.postUpdateFns.forEach(e=>e()),this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:e,xAxis:t,yAxis:i,snap:s}=this;if(e&&t&&i)return{seriesRect:e,xAxis:{...t.context,bounds:t.bounds,labelPadding:el(t.layout),snapToGroup:s},yAxis:{...i.context,bounds:i.bounds,labelPadding:el(t.layout),snapToGroup:s}}}onHover(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const s=e.sourceEvent.shiftKey,r=al.from(e),n=Vt(r,i);t.transition("hover",{offset:r,point:n,shiftKey:s,context:i})}onClick(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const s=e.sourceEvent.shiftKey,r=Vt(al.from(e),i),n=this.textInput.getValue(),o=this.textInput.getBBox();t.transition("click",{point:r,shiftKey:s,textInputValue:n,bbox:o})}onDoubleClick(e){const{state:t}=this;if(!this.getAnnotationContext())return;const i=al.from(e);t.transition("dblclick",{offset:i})}onAxisButtonClick(e,t){this.cancel(),this.reset();const i=this.getAnnotationContext();if(!this.annotationData||!i)return;const{state:s}=this;this.pushAnnotationState(il.Annotations);const r="horizontal"===t;if(s.transition(r?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const n=Vt(e,i);Yn(i,n)&&(s.transition("click",{point:n,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),t=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:t})}hoverTouchPreHandler(e){"touch"===e.device&&this.onHover(e)}dragMoveTouchPreHandler(e){"touch"===e.device&&this.ctx.interactionManager.isState(il.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(il.AnnotationsDraggable))return;const t=this.getAnnotationContext();if(!t)return;const i=al.from(e),s=Vt(i,t),r=this.textInput.getValue(),n=this.textInput.getBBox();this.state.transition("dragStart",{context:t,offset:i,point:s,textInputValue:r,bbox:n})}onDrag(e){if(!this.ctx.interactionManager.isState(il.AnnotationsDraggable))return;const t=this.getAnnotationContext();if(!t)return;const i=al.from(e),s=Vt(i,t),r=e.sourceEvent.shiftKey,n=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("drag",{context:t,offset:i,point:s,shiftKey:r,textInputValue:n,bbox:o})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:t}=e??{};t?.currentTarget===t?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const{key:s,shiftKey:r}=e,n=this.textInput.getValue(),o=this.textInput.getBBox();t.transition("textInput",{key:s,shiftKey:r,textInputValue:n,bbox:o,context:i})}onKeyDown(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const{sourceEvent:s}=e,{shiftKey:r,ctrlKey:n,metaKey:o}=s,a=n||o,l=n||r;t.transition("keyDown",{shiftKey:r,context:i});const c={x:0,y:0},h=Math.max(i?.xAxis.scale.bandwidth??0,l?10:1),d=Math.max(i?.yAxis.scale.bandwidth??0,l?10:1);switch(s.key){case"ArrowDown":c.y=d;break;case"ArrowUp":c.y=-d;break;case"ArrowLeft":c.x=-h;break;case"ArrowRight":c.x=h;break;case"Escape":return void this.onCancel();case"Backspace":case"Delete":return void this.onDelete()}if((c.x||c.y)&&(t.transition("translate",{translation:c}),s.stopPropagation(),s.preventDefault()),a)switch(s.key){case"c":return void t.transition("copy");case"x":return t.transition("cut"),void this.recordActionAfterNextUpdate("Cut annotation");case"v":return t.transition("paste"),void this.recordActionAfterNextUpdate("Paste annotation")}}onKeyUp(e){const{shiftKey:t}=e.sourceEvent,i=this.getAnnotationContext();i&&(this.state.transition("keyUp",{shiftKey:t,context:i}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[e,t]of this.annotationData.entries())is(t)&&this.annotationData.splice(e,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(il.Annotations)||this.ctx.interactionManager.isState(il.AnnotationsSelected)}update(e=tl.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};a([sl((e,t,i)=>{const{ctx:{annotationManager:s,stateManager:r}}=e;t!==i&&(e.toolbar?.toggleVisibility(Boolean(t)),!1===i&&!0===t?r.restoreState(s):!1===t&&e.clear())}),nl],ul.prototype,"enabled",2),a([nl],ul.prototype,"toolbar",2),a([nl],ul.prototype,"optionsToolbar",2),a([nl],ul.prototype,"axesButtons",2),a([nl],ul.prototype,"snap",2);var pl=ul,{FONT_SIZE_RATIO:gl,ThemeSymbols:ml}=s.n1,fl={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},yl={fill:ml.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},vl={color:{$ref:"backgroundColor"},fontSize:{$rem:[gl.LARGE]},fontFamily:{$ref:"fontFamily"}},Cl={...vl,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},bl={...vl,textAlign:"left"},Sl={...vl,position:"top",alignment:"center",color:{$ref:"textColor"}},wl={...vl,position:"top",alignment:"center",color:{$ref:"textColor"}},xl={...vl,fontSize:{$ref:"fontSize"},color:ml.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:ml.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:ml.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:ml.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},El={...fl,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...yl},text:{...Sl},statistics:{...xl}},Ml={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new pl(e),themeTemplate:{annotations:{enabled:!1,line:{...fl,handle:{...yl},text:{...Sl}},"horizontal-line":{...fl,handle:{...yl},axisLabel:{...Cl},text:{...Sl}},"vertical-line":{...fl,handle:{...yl},axisLabel:{...Cl},text:{...Sl}},"disjoint-channel":{...fl,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...yl},text:{...wl}},"parallel-channel":{...fl,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...yl},text:{...wl}},"fibonacci-retracement":{...fl,strokes:ml.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...yl},text:{...Sl,position:"center"},label:{...vl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...fl,strokes:ml.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...yl},text:{...Sl,position:"center"},label:{...vl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...fl,...bl,color:{$ref:"textColor"},handle:{...yl},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...bl,fontWeight:700,handle:{...yl},fill:{$ref:"foregroundColor"}},note:{...bl,color:ml.DEFAULT_TEXTBOX_COLOR,fill:ml.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...yl},background:{fill:ml.DEFAULT_TEXTBOX_FILL,stroke:ml.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...bl,color:{$ref:"textColor"},handle:{...yl}},arrow:{...fl,handle:{...yl},text:{...Sl}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...yl,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...yl,stroke:{$ref:"foregroundColor"}}},"date-range":{...El},"price-range":{...El},"date-price-range":{...El},"quick-date-price-range":{up:{...fl,fill:ml.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...yl},statistics:{...xl,color:"#fff",fill:ml.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...fl,stroke:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...yl,stroke:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...xl,color:"#fff",fill:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:{buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],padding:{$ref:"padding"}},optionsToolbar:{buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}}}},{BaseProperties:Al,ObserveChanges:Tl,ProxyProperty:Dl,Property:Il,calculatePlacement:Rl}=s.n1,Pl=class extends Al{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=(0,r.n)("img"),this.imageElement.onload=this.onImageLoad,this.node=new s.n1.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=Rl(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};a([Il],Pl.prototype,"top",2),a([Il],Pl.prototype,"right",2),a([Il],Pl.prototype,"bottom",2),a([Il],Pl.prototype,"left",2),a([Il],Pl.prototype,"width",2),a([Il],Pl.prototype,"height",2),a([Il],Pl.prototype,"opacity",2),a([Dl("imageElement.src"),Tl(e=>e.loadedSynchronously=e.complete)],Pl.prototype,"url",2);var{ActionOnSet:kl,Property:Ll}=s.n1,Nl=class extends s.n1.Background{constructor(){super(...arguments),this.image=new Pl}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER)}};a([Ll,kl({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],Nl.prototype,"image",2);var _l={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Nl(e)},{ActionOnSet:Ol,LayoutElement:Fl,Menu:Gl,Property:Bl}=s.n1,Vl=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],Hl=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new Gl(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(Fl.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show({items:Vl,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:e=>{this.setChartType(e.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=Vl.find(t=>t.value===e)?.icon;null!=t&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(e=>r.Vy.error(e))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=e&&Vl.some(t=>t.value===e)?e:"candlestick"}};a([Bl,Ol({changeValue(e){this.toolbar?.setHidden(!e)}})],Hl.prototype,"enabled",2);var Ul={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Hl(e)};function zl(e,t,i){let s=!0;if("separator"===t.type){const e=i.at(i.length-1);s=void 0!==e&&"separator"!==e.type}if(s&&(s=function(e,t){return"always"===e||("series-area"===e?"series-area"===t||"series-node"===t:e===t)}(t.showOn??"always",e)),s){const e=new $l(t);return i.push(e),e}}function Wl(e,t,i,s){t.isVisible(i)&&zl(e,t.builtins.items[i],s)}function jl(e,t,i,s){const{builtins:n}=t;if((0,r.bX)(i,n.lists))for(const r of n.lists[i])Wl(e,t,r,s);else Wl(e,t,i,s)}function Kl(e,t,i,s){for(const r of i)if("string"==typeof r)jl(e,t,r,s);else{const i=zl(e,r,s);r.items&&i&&r.items.length>0&&Kl(e,t,r.items,i.items)}"separator"===s[s.length-1]?.type&&s.pop()}var $l=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)void 0!==e[t]&&this.setField(t,this,e[t])}},Yl="ag-charts-context-menu",ql="ag-charts-dark-context-menu",{Deprecated:Xl,Property:Zl,ContextMenuRegistry:Ql}=s.n1,Jl="context-menu",ec="Use [items] instead",tc=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.closingSubMenus=0,this.menuWidget=new s.uB.MenuWidget;const t=this;if(this.deprecationMap={extraActions:{get items(){return t.extraActions??[]},showOn:"always"},extraSeriesAreaActions:{get items(){return t.extraSeriesAreaActions??[]},showOn:"series-area"},extraNodeActions:{get items(){return t.extraNodeActions??[]},showOn:"series-node"},extraLegendItemActions:{get items(){return t.extraLegendItemActions??[]},showOn:"legend-item"}},this.interactionManager=e.interactionManager,this.registry=e.contextMenuRegistry,this.element=e.domManager.addChild("canvas-overlay",Jl),this.element.classList.add(Yl),this.element.style.display="none",this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:e})=>{this.closingSubMenus>0||(null==e||e instanceof Node&&!this.element.contains(e))&&this.hide()}),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element),()=>this.menuWidget.destroy(),e.domManager.addListener("hidden",()=>this.hide()),this.menuWidget.addListener("close-widget",()=>this.onClose())),this.menuWidget.addClass(`${Yl}__menu`),"undefined"!=typeof MutationObserver){const e=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.destroyFns.push(()=>e.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&void 0!==t?.text&&(i=t.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(e=>{r.Vy.error("Unable to download chart",e)})},this.destroyFns.push(this.registry.addListener("context-complete",e=>this.onContext(e)))}createDeprecatedAdaptorItems(){const e=[];for(const t of Object.keys(this.deprecationMap)){const{items:i,showOn:s}=this.deprecationMap[t];e.push("separator");for(const{action:t,label:r}of i){const i="action",n=!0;e.push({type:i,showOn:s,enabled:n,label:r,action:t})}}return e}expandItemsOptions(e){const t=[],i=this.createDeprecatedAdaptorItems();return Kl(e,this.ctx.contextMenuRegistry,this.items,t),Kl(e,this.ctx.contextMenuRegistry,i,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,Ql.check("series-node",e)?this.pickedNode=e.context.pickedNode:Ql.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e.showOn);0!==t.length&&this.show(e.widgetEvent,t)}show(e,t){this.interactionManager.pushState(s.n1.InteractionState.ContextMenu),this.element.classList.toggle(ql,this.darkTheme),this.element.style.display="block";const i="touch"!==e.sourceEvent.pointerType&&void 0;void 0!==i&&this.ctx.chartService.overrideFocusVisible(i),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.open(e,{overrideFocusVisible:i})}hide(){this.menuWidget.close()}onClose(){this.interactionManager.popState(s.n1.InteractionState.ContextMenu),this.element.removeChild(this.menuWidget.getElement()),this.element.style.display="none"}onSubMenuOpen(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const s=this.ctx.domManager.getBoundingClientRect(),r=e.getBoundingClientRect(),n=s.right-r.right,o=r.left-s.left,{offsetWidth:a,offsetHeight:l}=t.getElement();let c=i.y;if(s.height>l){const e=s.bottom-r.top;e<l&&(c-=l-e)}if(n>=a)t.setBounds({x:i.x+i.width,y:c});else{const e=i.x-a,s=o+e;s>=0?t.setBounds({x:e,y:c}):t.setBounds({x:e-s,y:c})}}onSubMenuClose(e,t){e.setFocusOverride(void 0),this.closingSubMenus++,t.remove(),this.closingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.toggleClass(ql,this.darkTheme),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":const t=e.addSeparator();t.classList.add(`${Yl}__divider`),t.classList.toggle(ql,this.darkTheme),this.initTableCells(t);break;case"action":if(0===i.items.length){const t=new s.uB.MenuItemWidget;this.initButtonElement(t,i),e.addChild(t)}else{const{subMenuButton:t,subMenu:s}=e.addSubMenu();s.addClass(`${Yl}__menu`),s.addListener("open-widget",()=>this.onSubMenuOpen(t,s)),s.addListener("close-widget",()=>this.onSubMenuClose(t,s)),this.initButtonElement(t,i),this.createMenuItems(s,i.items)}break;default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return Ql.checkCallback("legend-item",e,t)?e=>{const i=e.sourceEvent;if(this.pickedLegendItem){const{seriesId:e,itemId:s}=this.pickedLegendItem;t({type:"contextmenu",seriesId:e,itemId:s,event:i}),this.hide()}else r.Vy.error("legend item not found")}:Ql.checkCallback("series-area",e,t)?()=>{t({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:Ql.checkCallback("series-node",e,t)?()=>{const{pickedNode:e,showEvent:i}=this,s=e?.series.createNodeContextMenuActionEvent(i,e);s?t(s):r.Vy.error("series node not found"),this.hide()}:()=>{t({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}initTableCells(e){const t=(0,r.n)("div"),i=(0,r.n)("div"),s=(0,r.n)("div");return t.classList.toggle("ag-charts-context-menu__icon",!0),i.classList.toggle("ag-charts-context-menu__label",!0),s.classList.toggle("ag-charts-context-menu__rightarrowhead",!0),t.ariaHidden="true",i.role="presentation",s.ariaHidden="true",e.append(t,i,s),{cellIcon:t,cellLabel:i,cellArrow:s}}initButtonElement(e,t){e.addClass(`${Yl}__item`),e.toggleClass(ql,this.darkTheme),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),n=`${Yl}__cellpadding`,{cellIcon:o,cellLabel:a,cellArrow:l}=this.initTableCells(e.getElement());if(a.textContent=i,a.classList.add(n),null!=t.iconUrl){const e=(0,r.n)("img");e.src=t.iconUrl,o.append(e),o.classList.add(n)}t.items.length>0&&(l.textContent="❯",l.classList.add(n));const{showOn:c,action:h}=t;if(null!=h){const t=this.createButtonOnClick(c,h);e.addListener("click",t),e.addListener("keydown",e=>{s.n1.isButtonClickEvent(e.sourceEvent)&&(e.sourceEvent.preventDefault(),t(e))})}e.addListener("mousemove",()=>e.focus({preventScroll:!0}))}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:n}=this.element;e=(0,r.qE)(0,e,i.width-s),t=(0,r.qE)(0,t,i.height-n),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(Jl),this.ctx.domManager.removeChild("canvas-overlay",Jl)}};a([Zl],tc.prototype,"enabled",2),a([Zl],tc.prototype,"darkTheme",2),a([Zl],tc.prototype,"items",2),a([Xl(ec)],tc.prototype,"extraActions",2),a([Xl(ec)],tc.prototype,"extraNodeActions",2),a([Xl(ec)],tc.prototype,"extraSeriesAreaActions",2),a([Xl(ec)],tc.prototype,"extraLegendItemActions",2);var ic={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:e=>new tc(e),themeTemplate:{contextMenu:{enabled:!0,darkTheme:s.n1.ThemeSymbols.IS_DARK_THEME}}},{BaseProperties:sc,Property:rc}=s.n1,nc=class extends s.n1.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};a([rc],nc.prototype,"enabled",2),a([rc],nc.prototype,"xOffset",2),a([rc],nc.prototype,"yOffset",2),a([rc],nc.prototype,"format",2),a([rc],nc.prototype,"renderer",2);var oc=class extends sc{constructor(e,t,i){super(),this.domManager=e,this.id=(0,r.sX)(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add("ag-charts-crosshair-label"),(0,r.Bq)(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",t),this.element.setAttribute("data-axis-id",i)}show(e){const{element:t}=this,i=e.x+this.xOffset,s=e.y+this.yOffset;t.style.top=`${Math.round(s)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:e,styles:t}){void 0!==e&&(this.element.innerHTML=e),void 0!==t&&Object.assign(this.element.style,t)}getBBox(){const{element:e}=this;return new s.n1.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if("string"==typeof e)return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:s=t.color,backgroundColor:r=t.backgroundColor,opacity:n=t.opacity??1}=e;return{html:`<div class="ag-charts-crosshair-label-content">\n                    <span>${i}</span>\n                </div>`,styles:{opacity:n,"background-color":r?.toLowerCase(),color:s}}}};a([rc],oc.prototype,"enabled",2),a([rc],oc.prototype,"xOffset",2),a([rc],oc.prototype,"yOffset",2),a([rc],oc.prototype,"format",2),a([rc],oc.prototype,"renderer",2);var{Group:ac,TranslatableGroup:lc,Line:cc,BBox:hc,InteractionState:dc,Property:uc,ZIndexMap:pc,formatNumber:gc,ChartAxisDirection:mc}=s.n1,fc=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=(0,r.sX)(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new nc,this.seriesRect=new hc(0,0,0,0),this.bounds=new hc(0,0,0,0),this.crosshairGroup=new lc({name:"crosshairs",zIndex:pc.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new ac({name:`${this.id}-crosshair-lines`,zIndex:pc.SERIES_CROSSHAIR})),this.lineGroupSelection=s.n1.Selection.select(this.lineGroup,cc,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:t})=>{const i=t instanceof HTMLElement&&e.domManager.contains(t,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(s.n1.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseHoverLike(e)),e.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseHoverLike(e)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),e.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),e.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),e.layoutManager.addListener("layout:complete",e=>this.layout(e)),()=>Object.values(this.labels).forEach(e=>e.destroy()))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:r}=this.axisCtx,n=i.find(e=>e.id===r);if(!n)return;this.axisLayout=n,this.bounds=e.clone().grow(n.gridPadding+n.seriesAreaPadding,s);const{crosshairGroup:o,bounds:a}=this;o.translationX=Math.round(a.x),o.translationY=Math.round(a.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(e){this.lineGroupSelection.update(e,e=>e.append(new cc),e=>e)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new oc(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:r,renderer:n}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=r,e.renderer=n}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:r,lineDash:n,lineDashOffset:o,axisLayout:a}=this;if(!a)return;const l=this.isVertical();e.each(e=>{e.stroke=i,e.strokeWidth=s,e.strokeOpacity=r,e.lineDash=n,e.lineDashOffset=o,e.y1=0,e.y2=l?t.height:0,e.x1=0,e.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===mc.X}isHover(e){return"mousemove"===e.type||"click"===e.type||"touch"===e.device&&"hover"===this.ctx.chartService.touch.dragAction}formatValue(e){const{labelFormatter:t,axisLayout:i}=this;if(t){const i=this.cachedCallWithContext(t,e);if(null!=i)return i}if("number"==typeof e){const t=(i?.label.fractionDigits??0)+((0,r.Fq)(e)?0:1);return gc(e,t)}return String(e??"")}onClick(e){"touch"===e.device&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?dc.Clickable:dc.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(dc.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(dc.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:r}=e.currentHighlight??{},n=s&&(r?.axes.x?.id===i.axisId||r?.axes.y?.id===i.axisId);if(this.activeHighlight=n?e.currentHighlight:void 0,this.activeHighlight){if(this.snap){const e=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(e),t.visible=!0}}else this.hideCrosshairs()}isInRange(e){return this.axisCtx.inRange(e)}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((i,s)=>{const r=e[s];if(!r)return i.visible=!1,void this.hideLabel(s);i.visible=!0;const{value:n,position:o}=r;let a=0,l=0;this.isVertical()?(a=o,i.x=Math.round(a)):(l=o,i.y=Math.round(l)),this.label.enabled?this.showLabel(a+t.x,l+t.y,n,s):this.hideLabel(s)})}getData(e){const{axisCtx:t}=this,i="pointer",{datum:s,xKey:r="",yKey:n=""}=this.activeHighlight??{},{currentX:o,currentY:a}=e,l=this.isVertical(),c=l?o:a;let h=s?.[l?r:n]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{datum:i,series:s,xKey:r="",aggregatedValue:n,cumulativeValue:o,midPoint:a}=e,l=s.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=s.axes[t.direction]?.id===t.axisId,d=l.indexOf("yKey")>-1&&h,u=l.indexOf("xKey")>-1&&h,p=n??o;if(d&&void 0!==p){const e=t.scale.convert(p)+c;return this.isInRange(e)?{yKey:{value:p,position:e}}:{}}if(u){const e=(this.isVertical()?a?.x:a?.y)??0,s=t.continuous?t.scaleInvert(e):i[r];return this.isInRange(e)?{xKey:{value:s,position:e}}:{}}const g={};return l.forEach(e=>{const r=s.properties[e],n=i[r],o=t.scale.convert(n)+c;this.isInRange(o)&&(g[e]={value:n,position:o})}),g}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:r}=this,n=this.labels[s],o=this.getLabelHtml(i,n);n.setLabelHtml(o);const{width:a,height:l}=n.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===mc.X?(h-=4,n.show({x:e-a/2,y:"bottom"===c?r.y+r.height+h:r.y-l-h})):(h-=8,n.show({x:"right"===c?r.x+r.width+h:r.x-a-h,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:s}=this.ctx;return i.call(this.axisCtx,s,e,...t)}};a([uc],fc.prototype,"enabled",2),a([uc],fc.prototype,"stroke",2),a([uc],fc.prototype,"lineDash",2),a([uc],fc.prototype,"lineDashOffset",2),a([uc],fc.prototype,"strokeWidth",2),a([uc],fc.prototype,"strokeOpacity",2),a([uc],fc.prototype,"snap",2),a([uc],fc.prototype,"label",2);var yc={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","unit-time","number","log","time"],moduleFactory:e=>new fc(e),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{ActionOnSet:vc,Property:Cc}=s.n1,bc=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=e.dataService}updateCallback(e,t){this.dataService&&(e&&null!=t?this.dataService.updateCallback(t):this.dataService.clearCallback())}};a([vc({newValue(e){this.updateCallback(e,this.getData)}}),Cc],bc.prototype,"enabled",2),a([vc({newValue(e){this.updateCallback(this.enabled,e)}}),Cc],bc.prototype,"getData",2),a([vc({newValue(e){this.dataService.requestThrottle=e}})],bc.prototype,"requestThrottle",2),a([vc({newValue(e){this.dataService.dispatchThrottle=e}})],bc.prototype,"updateThrottle",2),a([vc({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],bc.prototype,"updateDuringInteraction",2);var Sc={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new bc(e),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:wc,partialAssign:xc,mergeDefaults:Ec,BBox:Mc}=s.n1,Ac=class{constructor(e){this.components=e,this.union=Mc.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},Tc=class extends s.n1.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new s.n1.Path,this.capsPath=new s.n1.Path,this.bboxes=new Ac([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:r,lengthMax:n}=t,o=s??i*r;return Math.min(o,n)}getItemStylerParams(e,t,i){const{datum:s}=this;if(null==s||null==e.itemStyler)return;const{xLowerKey:r,xUpperKey:n,yLowerKey:o,yUpperKey:a}=e;return{...t,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:r,xUpperKey:n,yLowerKey:o,yUpperKey:a,highlighted:i}}formatStyles(e,t,i,s){let{cap:r,...n}=e;const o=this.getItemStylerParams(t,e,s);if(null!=o&&null!=t.itemStyler){const e=i.callWithContext(t.itemStyler,o);n=Ec(e,n),r=Ec(e?.cap,e,r)}return{whiskerStyle:n,capsStyle:r}}applyStyling(e,t){xc(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,s){if(void 0===this.datum)return;const{whiskerStyle:r,capsStyle:n}=this.formatStyles(e,t,i,s),{xBar:o,yBar:a,capDefaults:l}=this.datum,c=this.whiskerPath;this.applyStyling(c,r),c.path.clear(!0),void 0!==a&&(c.path.moveTo(a.lowerPoint.x,a.lowerPoint.y),c.path.lineTo(a.upperPoint.x,a.upperPoint.y)),void 0!==o&&(c.path.moveTo(o.lowerPoint.x,o.lowerPoint.y),c.path.lineTo(o.upperPoint.x,o.upperPoint.y)),c.path.closePath(),this.capLength=this.calculateCapLength(n??{},l);const h=this.capLength/2,d=this.capsPath;this.applyStyling(d,n),d.path.clear(!0),void 0!==a&&(d.path.moveTo(a.lowerPoint.x-h,a.lowerPoint.y),d.path.lineTo(a.lowerPoint.x+h,a.lowerPoint.y),d.path.moveTo(a.upperPoint.x-h,a.upperPoint.y),d.path.lineTo(a.upperPoint.x+h,a.upperPoint.y)),void 0!==o&&(d.path.moveTo(o.lowerPoint.x,o.lowerPoint.y-h),d.path.lineTo(o.lowerPoint.x,o.lowerPoint.y+h),d.path.moveTo(o.upperPoint.x,o.upperPoint.y-h),d.path.lineTo(o.upperPoint.x,o.upperPoint.y+h)),d.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:r}=this.datum??{},n=e/2,o=[];if(void 0!==s){const r=s.lowerPoint.y-s.upperPoint.y;o.push(new Mc(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,r),new Mc(s.lowerPoint.x-n,s.lowerPoint.y,e,i.strokeWidth),new Mc(s.upperPoint.x-n,s.upperPoint.y,e,i.strokeWidth))}if(void 0!==r){const s=r.upperPoint.x-r.lowerPoint.x;o.push(new Mc(r.lowerPoint.x,r.upperPoint.y,s,t.strokeWidth),new Mc(r.lowerPoint.x,r.lowerPoint.y-n,i.strokeWidth,e),new Mc(r.upperPoint.x,r.upperPoint.y-n,i.strokeWidth,e))}this.bboxes.components=o,this.bboxes.union=Mc.merge(o)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:r}=Mc.nearestBox(e,t,s.components);return{nearest:this,distanceSquared:r}}},Dc=class extends s.n1.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=wc(e,t,{children:this.children()});if(void 0!==i&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:Ic,Property:Rc}=s.n1,Pc=class extends Ic{};a([Rc],Pc.prototype,"visible",2),a([Rc],Pc.prototype,"stroke",2),a([Rc],Pc.prototype,"strokeWidth",2),a([Rc],Pc.prototype,"strokeOpacity",2),a([Rc],Pc.prototype,"lineDash",2),a([Rc],Pc.prototype,"lineDashOffset",2),a([Rc],Pc.prototype,"length",2),a([Rc],Pc.prototype,"lengthRatio",2);var kc=class extends Ic{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Pc}};a([Rc],kc.prototype,"yLowerKey",2),a([Rc],kc.prototype,"yLowerName",2),a([Rc],kc.prototype,"yUpperKey",2),a([Rc],kc.prototype,"yUpperName",2),a([Rc],kc.prototype,"xLowerKey",2),a([Rc],kc.prototype,"xLowerName",2),a([Rc],kc.prototype,"xUpperKey",2),a([Rc],kc.prototype,"xUpperName",2),a([Rc],kc.prototype,"visible",2),a([Rc],kc.prototype,"stroke",2),a([Rc],kc.prototype,"strokeWidth",2),a([Rc],kc.prototype,"strokeOpacity",2),a([Rc],kc.prototype,"lineDash",2),a([Rc],kc.prototype,"lineDashOffset",2),a([Rc],kc.prototype,"itemStyler",2),a([Rc],kc.prototype,"cap",2);var{fixNumericExtent:Lc,groupAccumulativeValueProperty:Nc,mergeDefaults:_c,valueProperty:Oc,ChartAxisDirection:Fc}=s.n1,Gc=class e extends s.n1.BaseModuleInstance{constructor(e){super(),this.properties=new kc;const t=function(e){for(const t of s.On)if(t===e.series.type)return e.series;throw new Error(`AG Charts - unsupported series type '${e.series.type}', error bars supported series types: ${s.On.join(", ")}`)}(e),{annotationGroup:i,annotationSelections:r}=t;this.cartesianSeries=t,this.groupNode=new Dc({name:`${i.id}-errorBars`}),i.appendChild(this.groupNode),this.selection=s.n1.Selection.select(this.groupNode,()=>this.errorBarFactory()),r.add(this.selection),t.addEventListener("seriesVisibilityChange",e=>this.onToggleSeriesItem(e)),this.destroyFns.push(t.addListener("data-processed",e=>this.onDataProcessed(e)),t.addListener("data-update",e=>this.onDataUpdate(e)),e.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),()=>i.removeChild(this.groupNode),()=>r.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:s}=this.properties;return(0,r.vM)(e)&&(0,r.vM)(t)||(0,r.vM)(i)&&(0,r.vM)(s)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return null!=e&&e>0}getUnstackPropertyDefinition(e){const t=[],{xLowerKey:i,xUpperKey:s,yLowerKey:r,yUpperKey:n,xErrorsID:o,yErrorsID:a}=this.getMaybeFlippedKeys(),{xScaleType:l,yScaleType:c}=e;return null!=r&&null!=n&&t.push(Oc(r,c,{id:`${a}-lower`}),Oc(n,c,{id:`${a}-upper`})),null!=i&&null!=s&&t.push(Oc(i,l,{id:`${o}-lower`}),Oc(s,l,{id:`${o}-upper`})),t}getStackPropertyDefinition(e){const t=[],{cartesianSeries:i}=this,{xLowerKey:s,xUpperKey:r,yLowerKey:n,yUpperKey:o,xErrorsID:a,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e,d=i.seriesGrouping?.groupIndex??i.id,u={invalidValue:null,missingValue:0,separateNegative:!0,...i.visible?{}:{forceValue:0}},p=(e,t,i,s)=>Nc(e,"normal","current",{id:`${t}-${i}`,groupId:`errorGroup-${d}-${i}`,...u},s),g=(e,i,s,r)=>{t.push(...p(e,s,"lower",r),...p(i,s,"upper",r))};return null!=n&&null!=o&&g(n,o,l,h),null!=s&&null!=r&&g(s,r,a,c),t}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:t,xUpperKey:i,xErrorsID:s,yLowerKey:n,yUpperKey:o,yErrorsID:a}=this.getMaybeFlippedKeys();if(e===Fc.X?(0,r.vM)(t)&&(0,r.vM)(i):(0,r.vM)(n)&&(0,r.vM)(o)){const{dataModel:t,processedData:i,cartesianSeries:r}=this;if(null!=t&&null!=i){const n={x:s,y:a}[e],o=t.getDomain(r,`${n}-lower`,"value",i),l=t.getDomain(r,`${n}-upper`,"value",i),c=[Math.min(...o,...l),Math.max(...o,...l)];return Lc(c)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,(0,r.vM)(e.dataModel)&&(0,r.vM)(e.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),t=this.cartesianSeries.axes[Fc.X]?.scale,i=this.cartesianSeries.axes[Fc.Y]?.scale;if(t&&i&&e)for(let s=0;s<e.length;s++){const{midPoint:n,xLower:o,xUpper:a,yLower:l,yUpper:c}=this.getDatum(e,s);if(null!=n){let h,d;(0,r.vM)(o)&&(0,r.vM)(a)&&(h={lowerPoint:{x:this.convert(t,o),y:n.y},upperPoint:{x:this.convert(t,a),y:n.y}}),(0,r.vM)(l)&&(0,r.vM)(c)&&(d={lowerPoint:{x:n.x,y:this.convert(i,l)},upperPoint:{x:n.x,y:this.convert(i,c)}}),e[s].xBar=h,e[s].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:s}=this.properties,[r,n]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([e,i]=[i,e],[t,s]=[s,t],[r,n]=[n,r]),{xLowerKey:e,xUpperKey:t,xErrorsID:r,yLowerKey:i,yUpperKey:s,yErrorsID:n}}static getDatumKey(e,t,i){if(null==t)return;const s=e.datum[t];if(null!=s){if("number"==typeof s)return s+i;r.Vy.warnOnce(`Found [${t}] error value of type ${typeof s}. Expected number type`)}}getDatum(t,i){const{xLowerKey:s,xUpperKey:r,yLowerKey:n,yUpperKey:o}=this.getMaybeFlippedKeys(),a=t[i],l=null!=a.cumulativeValue&&this.isStacked()?a.cumulativeValue-a.yValue:0,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:a.midPoint,xLower:e.getDatumKey(a,s,c),xUpper:e.getDatumKey(a,r,c),yLower:e.getDatumKey(a,n,h),yUpper:e.getDatumKey(a,o,h)}}convert(e,t){const i=(e.bandwidth??0)/2;return e.convert(t)+i}update(){const e=this.getNodeData();null!=e&&(this.selection.update(e),this.selection.each((e,t,i)=>this.updateNode(e,t,i)))}updateNode(e,t,i){e.datum=t,e.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1),e.updateBBoxes()}pickNodeExact(e){const{x:t,y:i}=e,s=this.groupNode.pickNode(t,i);if(null!=s)return{datum:s.datum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e){return this.groupNode.nearestSquared(e.x,e.y)}getTooltipParams(){const{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:s,xLowerName:r=e,xUpperName:n=t,yLowerName:o=i,yUpperName:a=s}=this.properties;return{xLowerKey:e,xLowerName:r,xUpperKey:t,xUpperName:n,yLowerKey:i,yLowerName:o,yUpperKey:s,yUpperName:a}}onToggleSeriesItem(e){this.groupNode.visible=e.visible}makeStyle(e){return{visible:e.visible,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cap:_c(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,t,i){const s=this.getNodeData();if(null!=s)for(let r=0;r<s.length;r++)if(e===s[r]){this.selection.at(r)?.update(t,this.properties,this.cartesianSeries,i);break}}onHighlightChange(e){const{previousHighlight:t,currentHighlight:i}=e;i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getHighlightStyle(),!0),t?.series===this.cartesianSeries&&this.restyleHighlightChange(t,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Tc}getWhiskerProperties(){const{stroke:e,strokeWidth:t,visible:i,strokeOpacity:s,lineDash:r,lineDashOffset:n}=this.properties;return{stroke:e,strokeWidth:t,visible:i,strokeOpacity:s,lineDash:r,lineDashOffset:n}}},Bc={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:s.On,moduleFactory:e=>new Gc(e),themeTemplate:{series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}}},{ZIndexMap:Vc,ActionOnSet:Hc,Property:Uc,ProxyPropertyOnWrite:zc}=s.n1,Wc=class extends s.n1.Background{constructor(){super(...arguments),this.image=new Pl,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new s.n1.Group({name:"foreground",zIndex:Vc.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;let s={x:0,y:0,width:t,height:i};this.image&&(s=this.image.performLayout(t,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const i=this.textNode.getBBox();t.x=e.x+e.width/2-i.width/2,t.y=e.y+e.height+10}};a([Uc,Hc({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],Wc.prototype,"image",2),a([Uc,zc("rectNode","fill")],Wc.prototype,"fill",2),a([Uc,zc("rectNode","fillOpacity")],Wc.prototype,"fillOpacity",2);var jc={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Wc(e)},{TranslatableGroup:Kc,SceneChangeDetection:$c}=s.n1,Yc=class extends Kc{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:r,y:n,width:o,height:a}=t;e.beginPath(),e.roundRect(r+s,n+s,o-2*s,a-2*s,i),e.clip()}};a([$c()],Yc.prototype,"inset",2),a([$c()],Yc.prototype,"cornerRadius",2);var{Property:qc,ZIndexMap:Xc,ActionOnSet:Zc,CategoryAxis:Qc,TextUtils:Jc,Padding:eh,Group:th,BBox:ih,ProxyProperty:sh}=s.n1,rh=class{constructor(){this.top=0,this.bottom=0}};a([qc],rh.prototype,"top",2),a([qc],rh.prototype,"bottom",2);var nh=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new rh,this.root=new th({name:"root"}),this.seriesRoot=this.root.appendChild(new Yc({name:"Series-root",zIndex:Xc.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new th({name:"Axes-Grids",zIndex:Xc.AXIS_GRID})),this.axisGroup=this.root.appendChild(new th({name:"Axes-Grids",zIndex:Xc.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new th({name:"Axes-Labels",zIndex:Xc.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new th({name:"Axes-Crosslines-Range",zIndex:Xc.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new th({name:"Axes-Crosslines-Line",zIndex:Xc.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new th({name:"Axes-Crosslines-Label",zIndex:Xc.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(e=>e.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(t=>!e.includes(t))??[];this.destroySeries(i);for(const i of e){if(t?.includes(i))continue;i.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const e=this;i.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return e.seriesRect}},i.resetAnimation("initial"===this.miniChartAnimationPhase?"initial":"disabled")}}destroySeries(e){e?.forEach(e=>{e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e={};this.axes.forEach(t=>{const i=t.direction;(e[i]??(e[i]=[])).push(t)}),this.series.forEach(t=>{t.directions.forEach(i=>{const s=e[i];if(!s)return void r.Vy.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const n=t.getKeys(i),o=this.findMatchingAxis(s,n);o?t.axes[i]=o:r.Vy.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`)})})}findMatchingAxis(e,t){for(const i of e){if(!i.keys.length)return i;if(t)for(const e of t)if(i.keys.includes(e))return i}}updateData(e){this.series.forEach(t=>t.setChartData(e)),"initial"===this.miniChartAnimationPhase&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(e=>e.resetAnimation("disabled"))})}async processData(e){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const e of this.axes)e.processData()}computeAxisPadding(){const e=new eh;return this.enabled?(this.axes.forEach(({position:t,thickness:i,line:s,label:r})=>{if(null==t)return;let n;n=i||(s.enabled?s.width:0)+(r.enabled?Jc.getLineHeight(r.fontSize??0)+r.spacing:0),e[t]=Math.ceil(n)}),e):e}async layout(e,t){const{padding:i}=this,s=null!=this.seriesRect,r=new ih(0,0,e,t-(i.top+i.bottom));this.seriesRect=r,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new ih(0,-i.top,e,t)),this.axes.forEach(i=>{const{position:n="left"}=i;switch(n){case"top":case"bottom":i.range=[0,r.width],i.gridLength=r.height;break;case"right":case"left":{const e=i instanceof Qc;i.range=e?[0,r.height]:[r.height,0],i.gridLength=r.width;break}}i.gridPadding=0,i.translation.x=0,i.translation.y=0,"right"===n?i.translation.x=e:"bottom"===n&&(i.translation.y=t),s||i.resetAnimation("initial"),i.calculateLayout(),i.update()}),await Promise.all(this.series.map(e=>e.update({seriesRect:r})))}};a([qc],nh.prototype,"enabled",2),a([sh(["seriesRoot","inset"])],nh.prototype,"inset",2),a([sh(["seriesRoot","cornerRadius"])],nh.prototype,"cornerRadius",2),a([Zc({changeValue(e,t=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],nh.prototype,"axes",2),a([Zc({changeValue(e,t){this.onSeriesChange(e,t)}})],nh.prototype,"series",2);var{SliderWidget:oh}=s.n1,ah=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[e,t]of["min","pan","max"].entries()){const i=this.sliders[e];i.step=oh.STEP_HUNDRETH,i.keyboardStep=oh.STEP_ONE,i.orientation="horizontal",i.setPreventsDefault(!1),i.addListener("drag-start",i=>this.onDragStart(e,i,t)),i.addListener("drag-move",e=>this.onDrag(i,e,t)),i.addListener("drag-end",()=>this.updateSliderRatios()),i.addListener("contextmenu",e=>this.onContextMenu(i,e))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;if(null!=e&&null!=t)return this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(100*e)/100,t=Math.round(100*t)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(1===e)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const s=this.sliders[e],r=this.toolbar.cssLeft(),n=s.cssLeft();this.dragStartX=r+n+t.offsetX,this.moveToFront(e),"touch"===t.device&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){"touch"===t.device&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:s}=t,{x:r,y:n}=this.toolbar.getBounds(),{x:o,y:a}=e.getBounds(),l=i+r+o,c=s+n+a;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=(0,r.qE)(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{Property:lh,SceneChangeDetection:ch,BBox:hh,ExtendedPath2D:dh}=s.n1,uh=class extends s.n1.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new dh}setCenter(e,t){this.dirtyPath=!0,this.centerX===e&&this.centerY===t||(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,s,r,n,o,a,l){const c=e.align(i+r*o)+l,h=c+e.align(i+r*o,r*(a-o))-2*l,d=e.align(s+n/2);e.setCenter(c,d),t.setCenter(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this;return new hh(e-i/2,t-s/2,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:r,cornerRadius:n,grip:o}=this,a=r/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;if(i.roundRect(e-c+a,t-h+a,2*(c-a),2*(h-a),n),o)for(let i=-.5;i<=.5;i+=1)for(let r=-1;r<=1;r+=1)s.arc(e+3*i,t+3*r,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle="string"==typeof i?i:"black",e.fill(this.gripPath.getPath2D())}};uh.className="RangeHandle",a([lh,ch()],uh.prototype,"width",2),a([lh,ch()],uh.prototype,"height",2),a([lh,ch()],uh.prototype,"cornerRadius",2),a([lh,ch()],uh.prototype,"grip",2);var{Path:ph,BBox:gh,ExtendedPath2D:mh,clippedRoundRect:fh,Property:yh,SceneChangeDetection:vh}=s.n1,Ch=class extends ph{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new mh}layout(e,t,i,s,r,n){r=isNaN(r)?this.min:r,n=isNaN(n)?this.max:n,e===this.x&&t===this.y&&i===this.width&&this.height===s&&r===this.min&&n===this.max||(this.x=e,this.y=t,this.width=i,this.height=s,this.min=r,this.max=n,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new gh(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:r,max:n}=this,o=e+i*r;return new gh(o,t,e+i*n-o,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:r,height:n,min:o,max:a,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const d=this.align(i)+h,u=this.align(s)+h,p=this.align(i,r)-2*h,g=this.align(s,n)-2*h,m=this.align(i+r*o)+h,f=m+this.align(i+r*o,r*(a-o))-2*h,y={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};fh(e,d,u,p,g,y,new gh(d,u,m-d,g)),fh(e,d,u,p,g,y,new gh(f,u,p+d-f,g)),f-m>1&&fh(t,d,u,p,g,y,new gh(m,u,f-m,g))}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};Ch.className="RangeMask",a([yh,vh()],Ch.prototype,"cornerRadius",2);var bh=class extends s.n1.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:s.n1.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new s.n1.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,r,n){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=r,this.rOffset=n,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){null!=e&&this.background.removeChild(e),null!=t&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:r,lOffset:n,rOffset:o}=this;return new s.n1.BBox(e-n,t,i+(n+o),r)}},{BaseModuleInstance:Sh,ObserveChanges:wh,Property:xh}=s.n1,Eh=class extends Sh{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new Ch,this.minHandle=new uh,this.maxHandle=new uh,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,t)=>({x:e,y:t})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new bh([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(e.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(s.n1.LayoutElement.Navigator,e=>this.onLayoutStart(e)),this.ctx.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.domProxy=new ah(e,this),this.updateGroupVisibility(),this.miniChart=new nh(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;null!=this.rangeSelector&&e!==this.rangeSelector.visible&&(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(e){if(this.enabled){const{layoutBox:t}=e,i=this.height+this.spacing;t.shrink(i,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.layoutBox.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:e,_max:r}=this.domProxy;this.layoutNodes(t,s,i,n,e,r),this.domProxy.updateBounds({x:t,y:s,width:i,height:n})}this.x=t,this.width=i,this.miniChart?.layout(i,n).catch(e=>r.Vy.error(e))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(s.n1.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&("pan"===e&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:n}=this,{minRange:o}=this.domProxy;let{_min:a,_max:l}=this.domProxy;const c=(t-s)/n;if("min"===e)a=(0,r.qE)(0,c,l-o);else if("max"===e)l=(0,r.qE)(a+o,c,1);else if("pan"===e&&null!=i){const e=l-a;a=(0,r.qE)(0,c-i,1-e),l=a+e}this.domProxy._min=a,this.domProxy._max=l,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:r,height:n}=this,{min:o,max:a}=t;this.domProxy.updateMinMax(o,a),this.layoutNodes(i,s,r,n,o,a)}layoutNodes(e,t,i,s,r,n){const{rangeSelector:o,mask:a,minHandle:l,maxHandle:c}=this;a.layout(e,t,i,s,r,n),o.layout(e,t,i,s,l.width/2,c.width/2),uh.align(l,c,e,t,i,s,r,n,a.strokeWidth/2),r+(n-r)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((i,s)=>{const r=i.getBBox(),n={x:r.x-e,y:r.y-t,height:r.height,width:r.width};this.domProxy.updateSliderBounds(s,n)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(e){return this.miniChart?.updateData(e)}async processData(e){if(this.miniChart)return this.miniChart?.processData(e)}};a([wh((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Eh.prototype,"miniChart",2),a([xh,wh((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(Boolean(t)),e.updateGroupVisibility()})],Eh.prototype,"enabled",2),a([xh],Eh.prototype,"height",2),a([xh,wh((e,t)=>{e.mask.cornerRadius=t})],Eh.prototype,"cornerRadius",2),a([xh],Eh.prototype,"spacing",2);var Mh={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Eh(e),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[s.n1.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}},{ToolbarButtonProperties:Ah,Property:Th}=s.n1,Dh=class extends Ah{};a([Th],Dh.prototype,"value",2);var{ChartAxisDirection:Ih,LayoutElement:Rh,PropertiesArray:Ph,Toolbar:kh,Property:Lh}=s.n1,Nh=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new Ph(Dh),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new kh(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(Rh.ToolbarBottom,this.onLayoutStart.bind(this)),e.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(e){const{buttons:t,ctx:i,enabled:s,toolbar:r,verticalSpacing:n}=this,{layoutBox:o}=e;if(!s||!i.zoomManager.isZoomEnabled())return void r.setHidden(!0);r.setHidden(!1),r.updateButtons(t);const a=r.getBounds().height;r.setBounds({x:o.x,y:o.y+o.height-a,width:o.width,height:a}),o.shrink({bottom:a+n})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i;"number"==typeof s?t.extendToEnd("zoom-buttons",Ih.X,s):Array.isArray(s)?t.updateWith("zoom-buttons",Ih.X,()=>s):"function"==typeof s&&t.updateWith("zoom-buttons",Ih.X,s),this.toolbar.toggleActiveButtonByIndex(e)}};a([Lh],Nh.prototype,"enabled",2),a([Lh],Nh.prototype,"buttons",2);var _h=864e5,Oh=30*_h,Fh={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Nh(e),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:Oh},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*Oh},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*Oh},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:365*_h},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(e,t)=>[e,t]}]}}},Gh=class e extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new s.n1.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(e,s)=>{if(null!=this.firstLayoutSection&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const r=i.getBounds().width;i.setBounds({x:e.x,y:e.y,width:r}),e.shrink({left:r+i.horizontalSpacing+(s??0)})},addToolbarListener:(e,s)=>i.addToolbarListener(e,e=>{const i=this.getSectionIndex(t,e.button.index);if(i<0)return;const r={...e,button:this.sectionButtons[t][i]};s(r)}),updateButtons:s=>{this.sectionButtons[t]=s;const r=e.SECTION_ORDER.flatMap(e=>this.sectionButtons[e]);i.updateButtons(r)},updateButtonByIndex:(e,s)=>{i.updateButtonByIndex(this.getIndex(t,e),s)},toggleActiveButtonByIndex:e=>{i.toggleActiveButtonByIndex(this.getIndex(t,e))},toggleButtonEnabledByIndex:(e,s)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,e),s)},setHidden:s=>{s?this.activeSections.delete(t):this.activeSections.add(t);let r=0;for(const n of e.SECTION_ORDER)if(n===t)for(const e of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(r+e,s);else r+=this.sectionButtons[n].length},destroy:()=>{s.setHidden(!0),0===this.activeSections.size&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const r of e.SECTION_ORDER){if(r===t)return s+i;s+=this.sectionButtons[r].length}return-1}getSectionIndex(t,i){let s=0;for(const r of e.SECTION_ORDER){if(r===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[r].length}return-1}};Gh.SECTION_ORDER=["chartToolbar","annotations"];var Bh=Gh,Vh={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Bh(e)},{CachedTextMeasurerPool:Hh,ZIndexMap:Uh,LayoutElement:zh,Property:Wh,BaseProperties:jh,valueProperty:Kh,TextUtils:$h,Group:Yh,Label:qh,Rect:Xh,Text:Zh}=s.n1,Qh={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},Jh={up:"positive",down:"negative"},ed={hlc:"altNeutral"},td=class extends jh{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};a([Wh],td.prototype,"fill",2),a([Wh],td.prototype,"fillOpacity",2);var id=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new qh,this.positive=new qh,this.negative=new qh,this.neutral=new qh,this.altNeutral=new qh,this.background=new td,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new Yh({name:"StatusBar",zIndex:Uh.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new s.n1.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new Xh),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(e.scene.attachNode(this.layer),e.layoutManager.registerElement(zh.Overlay,e=>this.startPerformLayout(e)),e.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),e.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(e){if(!this.enabled||null==this.data)return;const t=[];for(const e of this.labels){const{id:i,key:s}=e,r=this[s];null==r?e.domain=void 0:t.push(Kh(r,"number",{id:i}))}if(0===t.length)return;const{processedData:i,dataModel:s}=await e.request(this.id,this.data,{props:t});for(const e of this.labels){const{id:t,key:r}=e;null!=this[r]&&(e.domain=s.getDomain(this,t,"value",i))}}startPerformLayout(e){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:t}=e;this.labelGroup.translationY=t.y+0;const i=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),s=$h.getLineHeight(i),r=Qh[this.getChartType()]??0;let n,o=0,a="alphabetic";if("block"===this.layoutStyle)t.shrink(0+s+8,"top"),n=i+(s-i)/2;else{const{title:e}=this.ctx.chartService;if(a="top",n=0+e.padding,e.enabled){const t=e.node.getBBox();o=t.x+t.width+12}else o=e.padding}for(const{label:e,configuration:t,title:i,value:s,domain:l,formatter:c}of this.labels){if(null==l||0===(r&t)){i.visible=!1,s.visible=!1;continue}const h=Math.max(Hh.measureText(c.format(l[0]),{font:this.positive.getFont(),textBaseline:a,textAlign:"left"}).width,Hh.measureText(c.format(l[1]),{font:this.positive.getFont(),textBaseline:a,textAlign:"left"}).width,Hh.measureText(c.format(l[0]),{font:this.negative.getFont(),textBaseline:a,textAlign:"left"}).width,Hh.measureText(c.format(l[1]),{font:this.negative.getFont(),textBaseline:a,textAlign:"left"}).width);i.visible=!0,s.visible=!0;const d=Hh.measureText(e,{font:this.title.getFont(),textBaseline:a,textAlign:"left"});i.setFont(this.title),i.fill=this.title.color,i.text=e,i.textBaseline=a,i.y=n,i.x=o,o+=d.width+4,s.textBaseline=a,s.y=n,s.x=o,o+=h+12}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=o-12,this.backgroundNode.height=s+0+8,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.data?.at(-1);if(null==t)return void(this.labelGroup.visible=!1);this.labelGroup.visible=!0;const i=e?.itemId;let s=null!=i?Jh[i]:void 0;null==s&&null!=this.openKey&&null!=this.closeKey&&(s=t[this.openKey]<t[this.closeKey]?"positive":"negative");for(const{domain:e,value:i,key:r,formatter:n,style:o}of this.labels){if(null==e)continue;let a=o??s??"neutral";"neutral"===a&&(a=ed[this.getChartType()]??a);const l=this[r],c=null!=l?t?.[l]:void 0;i.setFont(this[a]),i.fill=this[a].color,i.text="number"==typeof c?n.format(c):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=e&&null!=Qh[e]||(e="candlestick"),e}};a([Wh],id.prototype,"enabled",2),a([Wh],id.prototype,"openKey",2),a([Wh],id.prototype,"highKey",2),a([Wh],id.prototype,"lowKey",2),a([Wh],id.prototype,"closeKey",2),a([Wh],id.prototype,"volumeKey",2),a([Wh],id.prototype,"title",2),a([Wh],id.prototype,"positive",2),a([Wh],id.prototype,"negative",2),a([Wh],id.prototype,"neutral",2),a([Wh],id.prototype,"altNeutral",2),a([Wh],id.prototype,"background",2),a([Wh],id.prototype,"layoutStyle",2);var sd={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new id(e),themeTemplate:{statusBar:{enabled:!1,layoutStyle:s.n1.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},{BaseProperties:rd,CartesianAxis:nd,ChartAxisDirection:od,ContinuousScale:ad,ChartUpdateType:ld,ObserveChanges:cd,TooltipManager:hd,Property:dd,findMinMax:ud,isObjectWithStringProperty:pd}=s.n1,gd=s.n1.Debug.create("sync");function md(e,t,i){const s=e.getKeys(t),r=e.getKeys(i);return e.shouldFlipXY?.()?[r,s]:[s,r]}function fd(e="x"){switch(e){case"x":return[od.X];case"y":return[od.Y];case"xy":return[od.X,od.Y]}}var yd=class extends rd{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="key",this.domainSync=new r.iN}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))gd("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=ld.PROCESS_DOMAIN){gd("ChartSync.updateChart()",e.id,ld[t],e),t===ld.PROCESS_DOMAIN?e.ctx.updateService.update(t,{forceNodeDataRefresh:!0}):e.ctx.updateService.update(t)}enabledZoomSync(){const{syncManager:e,zoomManager:t}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=t.addListener("zoom-change",()=>{for(const t of e.getGroupSiblings(this.groupId))t.modulesManager.getModule("sync")?.zoom&&t.ctx.zoomManager.updateZoom("sync",this.mergeZoom(t))})}enabledNodeInteractionSync(){const{highlightManager:e}=this.moduleContext;this.disableNodeInteractionSync?.(),this.disableNodeInteractionSync=e.addListener("highlight-change",this.onHighlightChange.bind(this))}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;gd("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[s]=fd(this.axes),n=s===od.X?od.Y:od.X,[o,a]=i?md(i,s,n):[];let l=o?.[0]?e.currentHighlight?.datum?.[o[0]]:void 0;const c=(0,r.$P)(l);if(c&&(l=l.getTime()),!e.currentHighlight?.datum){for(const e of t.getGroupSiblings(this.groupId))e.modulesManager.getModule("sync")?.nodeInteraction&&(e.ctx.highlightManager.updateHighlight(`${e.id}-sync`),e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`));return}const h="multi-series"===t.getGroupSyncMode(this.groupId);this.findMatchingHighlightNodes(s,n,h?a:[],c,l,e)}findMatchingHighlightNodes(e,t,i,s,n,o){const{syncManager:a}=this.moduleContext;gd("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const l of a.getGroupSiblings(this.groupId)){if(!l.modulesManager.getModule("sync")?.nodeInteraction)continue;let a=!1;for(const o of l.axes){if(!nd.is(o)||o.direction!==e)continue;const c=l.series.filter(s=>{if(!s.visible)return!1;if(i.length>0){const[,r]=md(s,e,t);return i.every(e=>r.includes(e))}return!0}).map(this.findMatchingNodes(o,e,s,n)).filter(r.vM);if(1===c.length&&c[0]?.nodeDatum!==l.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(l,c[0].nodeDatum),a=!0;break}}a||(gd("ChartSync.findMatchingHighlightNodes() - no matching nodes",l.id,o),this.dispatchHighlightUpdate(l))}}findMatchingNodes(e,t,i,s){return r=>{const n=r.getKeys(e.direction);if(e.keys.length&&!e.keys.some(e=>n.includes(e)))return;const o=r.contextNodeData?.nodeData??[];if(!o?.length)return;const a=o[0],l=`${t}Key`;if(!pd(a,l))return;const c=a[l],h=o.find(e=>{const t=e.datum[c];return i?t.getTime()===s:t===s});return h?{series:r,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){gd("ChartSync.dispatchHighlightUpdate()",e.id,t),e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t);const i=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&i){const i=e.seriesAreaBoundingBox,s=i.x+(t.midPoint?.x??t.point?.x??0),r=i.y+(t.midPoint?.y??t.point?.y??0),n=hd.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:r},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,n,e.getTooltipContent(t.series,t.datumIndex,t))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`);this.updateChart(e,ld.SERIES_UPDATE)}async getSyncedDomain(e){if(!nd.is(e)||"xy"!==this.axes&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,domainsByKey:s,positionDomains:r}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),"position"===this.domainMode?this.calculateDerivedDomain(e,r):"direction"===this.domainMode||0===e.keys.length?this.calculateDerivedDomain(e,i):this.calculateKeyDerivedDomain(e,s)}updateDomainState(e){var t,i,s,r,n;const{syncManager:o}=this.moduleContext,a=o.getChart().id,l=e.id,c=o.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),d=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0});((i=d.sources)[a]??(i[a]={}))[l]=e.dataDomain.domain,d.dirty=!0;const u=c.domainsByKey??(c.domainsByKey={});for(const t of e.keys??[]){const i=u[t]??(u[t]={derived:[],sources:{},dirty:!0});((s=i.sources)[a]??(s[a]={}))[l]=e.dataDomain.domain,i.dirty=!0}const p=c.domainsByPosition??(c.domainsByPosition={}),g=p[r=e.position]??(p[r]={derived:[],sources:{},dirty:!0});return((n=g.sources)[a]??(n[a]={}))[l]=e.dataDomain.domain,g.dirty=!0,{groupState:c,directionDomains:d,domainsByKey:u,positionDomains:g}}validateAxis(e,t){const i="multi-series"===this.moduleContext.syncManager.getGroupSyncMode(this.groupId);fd(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:s,nice:n,reverse:o}=e,a=new Set(e.boundSeries.flatMap(t=>t.getKeys(e.direction)));for(const e of t.members){const{axes:t,modulesManager:l}=e,c=fd(l.getModule("sync")?.axes),h=t.filter(e=>c.includes(e.direction)).filter(e=>e.boundSeries.some(t=>t.getKeys(e.direction).some(e=>a.has(e))));if(0===h.length)continue;const[d]=h;if(d.min!==i||d.max!==s||d.nice!==n||d.reverse!==o)return r.Vy.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),void(this.enabled=!1)}}validateSingleSeries(e,t){const i=t.members,[{axes:s}]=i,{direction:n,min:o,max:a,nice:l,reverse:c}=e;for(const e of s)if(n===e.direction&&(l!==e.nice||c!==e.reverse||o!==e.min&&((0,r.Bf)(o)||(0,r.Bf)(e.min))||a!==e.max&&((0,r.Bf)(a)||(0,r.Bf)(e.max))))return r.Vy.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),void(this.enabled=!1)}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;const i=t.derived;return t.derived=(0,r.Am)(Object.values(t.sources).map(e=>Object.values(e)).flat(2)),ad.is(e.scale)&&(t.derived=ud(t.derived)),t.dirty=!1,(0,r.r1)(i,t.derived)||(gd(e.id,"updated",e.keys,{before:i,after:t.derived}),this.updateSiblings()),t.derived}calculateKeyDerivedDomain(e,t){let i=[],s=[],n=!1;for(const o of e.keys??[]){const a=t[o],l=a.derived;i.push(...l),a.dirty?(a.derived=(0,r.Am)(Object.values(a.sources).map(e=>Object.values(e)).flat(2)),ad.is(e.scale)&&(a.derived=ud(a.derived)),s.push(...a.derived),a.dirty=!1,n||(n=!(0,r.r1)(l,a.derived))):s.push(...a.derived)}return ad.is(e.scale)&&(i=ud(i),s=ud(s)),n&&!(0,r.r1)(i,s)&&(gd(e.id,"updated",e.keys,{before:i,after:s}),this.updateSiblings()),s}removeAxis(e){if(!nd.is(e)||"xy"!==this.axes&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),s=t.getChart().id,r=e.id;delete i?.domains?.[e.direction]?.sources?.[s]?.[r];for(const t of e.keys??[])delete i?.domainsByKey?.[t]?.sources?.[s]?.[r];delete i?.domainsByPosition?.[e.position]?.sources?.[s]?.[r]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(e=>"init"===e.syncStatus);)gd("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.await(),t++;t>0&&gd("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}mergeZoom(e){const{zoomManager:t}=this.moduleContext;if("xy"===this.axes)return t.getZoom();const i=e.ctx.zoomManager.getZoom()??{};return i[this.axes]=t.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:e}=this.moduleContext;this.enabled?e.subscribe(this.groupId):e.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};yd.className="Sync",a([dd,cd(e=>e.onEnabledChange())],yd.prototype,"enabled",2),a([dd,cd((e,t,i)=>e.onGroupIdChange(t,i))],yd.prototype,"groupId",2),a([dd,cd(e=>e.onAxesChange())],yd.prototype,"axes",2),a([dd,cd(e=>e.onNodeInteractionChange())],yd.prototype,"nodeInteraction",2),a([dd,cd(e=>e.onZoomChange())],yd.prototype,"zoom",2),a([dd,cd(e=>e.onAxesChange())],yd.prototype,"domainMode",2);var vd={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new yd(e),themeTemplate:{sync:{enabled:!1}}},{Property:Cd}=s.n1,bd="#2196f3",Sd=class extends s.n1.Rect{constructor(){super(...arguments),this.fill=bd,this.fillOpacity=.2,this.zIndex=s.n1.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=bd}updateInvalid(){this.fill="#8a8a8a"}};Sd.className="ZoomRect",a([Cd],Sd.prototype,"fill",2),a([Cd],Sd.prototype,"fillOpacity",2);var wd={min:0,max:1},xd=wd.max-wd.min,Ed="middle",Md=(e,t=wd.min,i=wd.max)=>(0,r.qE)(t,e,i);function Ad(){return{x:{...wd},y:{...wd}}}function Td(e){return e.x.max-e.x.min}function Dd(e){return e.y.max-e.y.min}function Id(e,t,i=1e-10){return(0,r.YX)(e.min,t.min,i)&&(0,r.YX)(e.max,t.max,i)}function Rd(e,t,i){return Id(e.x,t.x,i)&&Id(e.y,t.y,i)}function Pd(e){return{x:{min:e?.x?.min??wd.min,max:e?.x?.max??wd.max},y:{min:e?.y?.min??wd.min,max:e?.y?.max??wd.max}}}function kd(e,t,i){if(!e)return{x:0,y:0};const s=Md(t-e.x,0,e.x+e.width),r=Md(i-e.y,0,e.y+e.height),n=1/e.width*s,o=1-1/e.height*r;return{x:Md(n),y:Md(o)}}function Ld(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function Nd(e,t,i){return{x:{min:e.x.min,max:e.x.min+Td(e)*t},y:{min:e.y.min,max:e.y.min+Dd(e)*i}}}function _d(e,t,i){const s=Td(e),r=Dd(e),n=e.x.min+s/2,o=e.y.min+r/2;return{x:{min:n-s*t/2,max:n+s*t/2},y:{min:o-r*i/2,max:o+r*i/2}}}function Od(e,t,i,s){const{min:r,max:n}=t,o=r+(n-r)/2,a=e.max-e.min;switch(i){case"start":return{min:r,max:t.min+a};case"end":return{min:t.max-a,max:n};case"middle":return{min:o-a/2,max:o+a/2};case"pointer":return function(e,t,i){const s=e.max-e.min,r=i-i*(1-(t.max-t.min-s));return{min:e.min+r,max:e.max+r}}(e,t,s??o);default:return{min:r,max:n}}}function Fd(e){return{x:Gd(e.x),y:Gd(e.y)}}function Gd(e){const t=e.max-e.min;let i=e.max>wd.max?wd.max-t:e.min,s=e.min<wd.min?t:e.max;return i=Math.max(wd.min,i),s=Math.min(wd.max,s),{min:i,max:s}}var Bd=class{update(e,t,i,r,n,o){return this.oldZoom??(this.oldZoom=Pd(t===s.n1.ChartAxisDirection.X?{...n,x:o}:{...n,y:o})),this.updateCoords(e.currentX,e.currentY),this.updateZoom(t,i,r)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:r,oldZoom:n}=this;let o=Pd(n);if(!r||!n)return e===s.n1.ChartAxisDirection.X?o.x:o.y;const a=kd(i,r.x1,r.y1),l=kd(i,r.x2,r.y2);if(e===s.n1.ChartAxisDirection.X){const e=(l.x-a.x)*Td(n);return o.x.max+=e,o.x=Od(o.x,n.x,t,a.x),o=Fd(o),o.x}const c=(l.y-a.y)*Dd(n);return o.y.max-=c,o.y=Od(o.y,n.y,t,a.y),o=Fd(o),o.y}},Vd=class{constructor(e,t,i,s,r,n){this.contextMenuRegistry=e,this.zoomManager=t,this.getModuleProperties=i,this.getRect=s,this.updateZoom=r,this.isZoomValid=n}registerActions(e){const{contextMenuRegistry:t}=this;if(!e)return t.setVisible("zoom-to-cursor",!1),void t.setVisible("pan-to-cursor",!1);t.setVisible("zoom-to-cursor",!0),t.setVisible("pan-to-cursor",!0),t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this);const i=e=>{const t=this.getRect();if(!t)return!0;const i=kd(t,e.x,e.y);return null!=this.iterateFindNextZoomAtPoint(i)},s=()=>!Rd(Pd(this.zoomManager.getZoom()),Ad()),r=t.addListener("context-setup",e=>{t.builtins.items["zoom-to-cursor"].enabled=i(e),t.builtins.items["pan-to-cursor"].enabled=s()});return()=>{r(),t.setVisible("zoom-to-cursor",!1),t.setVisible("pan-to-cursor",!1)}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(i&&t&&e?.target&&e instanceof MouseEvent)return kd({x:0,y:0,width:t.width,height:t.height},e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);null!=i&&this.updateZoom(i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=Pd(this.zoomManager.getZoom()),s=Td(i),r=Dd(i),n=t.x*s,o=t.y*r,a=xd/2;let l={x:{min:t.x-a,max:t.x+a},y:{min:t.y-a,max:t.y+a}};l=_d(l,s,r),l=Ld(l,i.x.min-t.x+n,i.y.min-t.y+o),this.updateZoom(Fd(l))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const t=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(t))return t}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),r=Pd(this.zoomManager.getZoom()),n=e.x*Td(r),o=e.y*Dd(r),a=xd/2;let l={x:{min:e.x-a,max:e.x+a},y:{min:e.y-a,max:e.y+a}};return l=_d(l,i?Td(r)*t:xd,s?Dd(r)*t:xd),l=Ld(l,r.x.min-e.x+n,r.y.min-e.y+o),Fd(l)}},{BBoxValues:Hd,ChartAxisDirection:Ud}=s.n1,zd=class{constructor(e){this.axesHandlers=e,this.axes=[]}destroy(){this.axes.forEach(e=>e.div.destroy())}update(e,t){if(this.axes.forEach(t=>t.div.setHidden(!e)),!e)return;const{X:i,Y:r}=s.n1.ChartAxisDirection,n=[...t.axisManager.getAxisContext(i),...t.axisManager.getAxisContext(r)],{removed:o,added:a}=this.diffAxisIds(n);o.length>0&&(this.axes=this.axes.filter(e=>!o.includes(e.axisId)||(e.div.destroy(),!1)));for(const e of a){const{axisId:i,direction:s}=e;this.axes.push(this.initAxis(t,i,this.axesHandlers,s))}for(const e of this.axes){const t=n.find(t=>t.axisId===e.axisId).getCanvasBounds();e.div.setHidden(Hd.isEmpty(t)),void 0!==t&&e.div.setBounds(t)}}toggleAxisDraggingCursor(e,t){for(const i of this.axes)i.direction===e&&i.div.setCursor(t?this.getCursor(e):void 0)}getCursor(e){return e===Ud.X?"ew-resize":"ns-resize"}initAxis(e,t,i,s){const r=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:"afterend"});return r.setCursor(this.getCursor(s)),r.addListener("drag-start",e=>{"touch"===e.device&&e.sourceEvent.preventDefault(),i.onDragStart(t,s)}),r.addListener("drag-move",e=>i.onDrag(e)),r.addListener("drag-end",i.onDragEnd),r.addListener("dblclick",()=>i.onDoubleClick(t,s)),{axisId:t,div:r,direction:s}}diffAxisIds(e){const t=this.axes.map(e=>e.axisId),i=e.map(e=>e.axisId);return{removed:t.filter(e=>!i.includes(e)),added:e.filter(e=>!t.includes(e.axisId))}}},Wd={off:1,short:.01,long:.002},jd=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max("number"==typeof e?e:Wd[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){null!=this.inertiaHandle&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:r=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:t-s,deltaY:i-r})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const r=this.zoomCoordsHistoryIndex%16;let n=r-1;n<0&&(n=e.length-1);let o=r;o>=e.length&&(o=0);const a=e[n],l=e[o];t=a.x-l.x,i=a.y-l.y,s=a.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const e=t/s,n=i/s,o=Math.hypot(e,n),a=Math.atan2(n,e),l=performance.now();this.inertiaHandle=(0,r.zk)().requestAnimationFrame(e=>{this.animateInertia(e,e,l,o,a)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:r}=e,n=Date.now();t[i%16]={x:s,y:r,t:n},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,r){const n=1-this.decelerationValue,o=-s/Math.log(n),a=s*(n**(t-i)-1)/Math.log(n),l=s*(n**(e-i)-1)/Math.log(n);this.onUpdate?.({type:"update",deltaX:-Math.cos(r)*(l-a),deltaY:-Math.sin(r)*(l-a)}),l>=o-1||(this.inertiaHandle=requestAnimationFrame(t=>{this.animateInertia(t,e,i,s,r)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}translateZooms(e,t,i,s){const n=kd(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),o=Math.sign(i)*n.x,a=-Math.sign(s)*n.y,l={};for(const[e,{direction:i,zoom:s}]of(0,r.jO)(t)){if(s&&s.min===wd.min&&s.max===wd.max)continue;let t=Pd({[i]:s});t=Fd(Ld(t,o*Td(t),a*Dd(t))),l[e]={direction:i,zoom:t[i]}}return l}},Kd=class{update(e,t,i,s){const r=e.deltaX*t*200;return this.translateZooms(i,s,r)}translateZooms(e,t,i){const n={},o=kd(e,e.x+Math.abs(i),0),a=i<0?-o.x:o.x;for(const[e,{direction:i,zoom:o}]of(0,r.jO)(t)){if(i!==s.n1.ChartAxisDirection.X)continue;let t=Pd({x:o});t=Fd(Ld(t,a*Td(t),0)),n[e]={direction:i,zoom:t.x}}return n}},$d=class{updateAxes(e,t,i,n){const o=e.sourceEvent,a={},{anchorPointX:l,anchorPointY:c,isScalingX:h,isScalingY:d,scrollingStep:u}=t,p=kd(i,o.offsetX??o.clientX,o.offsetY??o.clientY);for(const[t,{direction:i,zoom:o}]of(0,r.jO)(n)){if(null==o)continue;let r={...o};const n=u*e.deltaY*(o.max-o.min);if(i===s.n1.ChartAxisDirection.X&&h)r.max+=n,r=Od(r,o,l,p.x);else{if(i!==s.n1.ChartAxisDirection.Y||!d)continue;r.max+=n,r=Od(r,o,c,p.y)}a[t]={direction:i,zoom:Gd(r)}}return a}update(e,t,i,s){const{anchorPointX:r,anchorPointY:n,isScalingX:o,isScalingY:a,scrollingStep:l}=t,c=kd(i,e.offsetX+i.x,e.offsetY+i.y),h=e.deltaY;let d=Pd(s);return d.x.max+=o?l*h*Td(s):0,d.y.max+=a?l*h*Dd(s):0,o&&(d.x=Od(d.x,s.x,r,c.x)),a&&(d.y=Od(d.y,s.y,n,c.y)),d=Fd(d),d}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:r,isScalingX:n,isScalingY:o,scrollingStep:a}=t;let l=Pd(i);return l.x.max+=n?a*-e*Td(i):0,l.y.max+=o?a*-e*Dd(i):0,n&&(l.x=Od(l.x,i.x,s)),o&&(l.y=Od(l.y,i.y,r)),l=Fd(l),l}},Yd=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const s=e.currentX+(i?.x??0),r=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,r,t,i),this.updateRect(i)}stop(e,t,i){let s=Pd();return e&&t?(this.coords&&(s=this.createZoomFromCoords(t,i)),s=Fd(function(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}(s,t.width/e.width,t.height/e.height)),this.reset(),s):s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords)return void(this.coords={x1:e,y1:t,x2:e,y2:t});const{coords:r}=this;if(r.x2=e,r.y2=t,!s)return;const{isScalingX:n,isScalingY:o,keepAspectRatio:a}=i,l=this.getNormalisedDimensions();if(a&&n&&o){const e=s.width/s.height;r.y2<r.y1?r.y2=Math.min(r.y1-l.width/e,r.y1):r.y2=Math.max(r.y1+l.width/e,r.y1)}n||(r.x1=s.x,r.x2=s.x+s.width),o||(r.y1=s.y,r.y2=s.y+s.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:s,height:r}=i;let{x:n,y:o}=i;n=Math.max(n,e.x),n-=Math.max(0,n+s-(e.x+e.width)),o=Math.max(o,e.y),o-=Math.max(0,o+r-(e.y+e.height)),t.x=n,t.y=o,t.width=s,t.height=r;const a=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(a)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=Pd(t),s=this.getNormalisedDimensions(),r=kd(e,s.x,s.y+s.height);let n=Nd(i,s.width/e.width,s.height/e.height);return n=Ld(n,r.x*Td(i),r.y*Dd(i)),n=Fd(n),n}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:s=0}=this.coords??{};return{x:e<=i?e:i,y:t<=s?t:s,width:e<=i?i-e:e-i,height:t<=s?s-t:t-s}}},{ActionOnSet:qd,BaseProperties:Xd,ChartAxisDirection:Zd,NativeWidget:Qd,PropertiesArray:Jd,Toolbar:eu,ToolbarButtonProperties:tu,Property:iu}=s.n1,su=class extends tu{};a([iu],su.prototype,"value",2),a([iu],su.prototype,"section",2);var ru=class extends Xd{constructor(e,t,i,s,n,o,a){super(),this.ctx=e,this.getModuleProperties=t,this.getResetZoom=i,this.updateZoom=s,this.updateAxisZoom=n,this.resetZoom=o,this.isZoomValid=a,this.enabled=!1,this.buttons=new Jd(su),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new Qd((0,r.n)("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new eu(e.localeManager),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toggleVisibility("always"===this.visible),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const e of this.destroyFns)e()}toggleVisibleZoomed(e){"zoomed"===this.visible&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){const{buttons:t,container:i}=this,{rect:s}=e.series;this.toolbar.updateButtons(t),this.toggleButtons();const r=i.getBounds().height;i.setBounds({y:s.y+s.height-r})}onHover(e){if(!this.enabled||"hover"!==this.visible||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:s}}=this,{currentY:r,sourceEvent:{target:n}}=e,o=t.getElement(),a=r>o.offsetTop-i&&r<s.canvas.element.offsetHeight||n===o;this.toggleVisibility(a)}onLeave(){"hover"===this.visible&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:s,verticalSpacing:r}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const n=s.getElement();n.style.transitionDuration=t?"0s":"",n.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+r}px)`}toggleButtons(){const e=Pd(this.ctx.zoomManager.getZoom());if(!this.previousZoom||!Rd(this.previousZoom,e)){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":case"pan-left":s=e.x.min>wd.min;break;case"pan-end":case"pan-right":s=e.x.max<wd.max;break;case"zoom-out":s=!Rd(e,Ad());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=!Rd(e,this.getResetZoom())}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&"reset"!==e.value){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:n,zoom:o}]of(0,r.jO)(i))null!=o&&this.onButtonPressAxis(e,t,s,n,o)}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,r){const{isScalingX:n,isScalingY:o,scrollingStep:a}=t;let l={...r};const c=r.max-r.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=wd.max;break;case"pan-left":l.min-=c*a,l.max-=c*a;break;case"pan-right":l.min+=c*a,l.max+=c*a;break;case"zoom-in":case"zoom-out":{const i=s===Zd.X,c=i&&n||!i&&o;let h="zoom-in"===e.value?1-a:1+a;c||(h=1);const d=i?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*h,l=Od(l,r,d);break}}this.updateAxisZoom(i,s,Gd(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=Pd(this.ctx.zoomManager.getZoom());let r=Pd(s);switch(e.value){case"reset":return void this.resetZoom();case"pan-start":r.x.max=Td(r),r.x.min=0;break;case"pan-end":r.x.min=wd.max-Td(r),r.x.max=wd.max;break;case"pan-left":r=Ld(r,-Td(r)*i,0);break;case"pan-right":r=Ld(r,Td(r)*i,0);break;case"zoom-in":case"zoom-out":r=this.getNextZoomStateUnified(e.value,s,t)}this.updateZoom(Fd(r))}getNextZoomStateUnified(e,t,i){const{isScalingX:s,isScalingY:r,scrollingStep:n}=i,o="zoom-in"===e?1-n:1+n,a=Nd(t,s?o:1,r?o:1);return a.x=Od(a.x,t.x,this.getAnchorPointX(i)),a.y=Od(a.y,t.y,this.getAnchorPointY(i)),a}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return"pointer"===t?"end":t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return"pointer"===t?Ed:t}};a([iu,qd({changeValue(e){this.toolbar?.setHidden(!e)}})],ru.prototype,"enabled",2),a([iu],ru.prototype,"buttons",2),a([iu,qd({changeValue(e,t){null!=t&&this.toggleVisibility("always"===e)}})],ru.prototype,"visible",2),a([iu],ru.prototype,"anchorPointX",2),a([iu],ru.prototype,"anchorPointY",2);var nu=1e6;function ou({min:e,max:t},i,s,r){return 0===r?0:nu*((i-s)/r*(t-e)+e)}function au(e,t,i,s){return 0===t&&(t=30),0===s&&(s=30),!(e+t<i-s||i+s<e-t)}var lu=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(e,t,i){if(2!==e.sourceEvent.targetTouches.length)return!1;e.sourceEvent.preventDefault();const s=Array.from(e.sourceEvent.targetTouches),{x:r,y:n,width:o,height:a}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(e=>e.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const e of[0,1]){const t=s[e].clientX,i=n+a-s[e].clientY;this.touchStart.origins[e].identifier=s[e].identifier,this.touchStart.origins[e].normalX=ou(this.initialZoom.x,t,r,o),this.touchStart.origins[e].normalY=ou(this.initialZoom.y,i,n,a)}const[l,c]=s,[h,d]=this.touchStart.origins,u=au(l.clientX,l.radiusX,c.clientX,c.radiusX);return au(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=d.normalY=(h.normalY+d.normalY)/2),u&&(h.normalX=d.normalX=(h.normalX+d.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:s,y:r,width:n,height:o}=t.getBoundingClientRect(),{origins:a}=this.touchStart,l=[0,1].map(e=>i.find(t=>t.identifier===a[e].identifier)),c=a[0].normalX,h=a[1].normalX,d=l[0].clientX,u=l[1].clientX,p=a[0].normalY,g=a[1].normalY,m=r+o-l[0].clientY,f=r+o-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,g,m,f,s,r,n,o)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(e=>e.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,r,n,o,a,l,c,h,d){const{initialZoom:u,previous:p}=this;return{x:cu(e,t,i,s,p,"a1","a2",l,h,u.x),y:cu(r,n,o,a,p,"b1","b2",c,d,u.y)}}};function cu(e,t,i,s,r,n,o,a,l,c){if(e!=t){const c=r[n],h=r[o];return Math.abs(i-c)+Math.abs(s-h)<=1?(i=c,s=h):(r[n]=i,r[o]=s),function(e,t,i,s,r,n){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,s]=[Math.min(i,s),Math.max(i,s)];const o=nu*(s-r)/n,a=(i-r)/(s-r),l=(e-a*t)/(nu-nu*(i-r)/n+a*(o-nu));return{min:l,max:(t+(o-nu)*l)/o}}(e,t,i,s,a,l)}{const t=(e-(ou(c,i,a,l)+ou(c,s,a,l))/2)/nu;return{min:c.min+t,max:c.max+t}}}var{ActionOnSet:hu,ChartAxisDirection:du,ChartUpdateType:uu,Deprecated:pu,Property:gu,InteractionState:mu,ProxyProperty:fu}=s.n1,yu=e=>(0,r.GB)(e,10),vu="zoom-cursor",Cu="zoom-tooltip",bu=class extends s.n1.BaseProperties{constructor(e){super(),this.onChange=e,this.enabled=!1,this.padding=0}};a([gu,hu({changeValue(e){this.onChange({enabled:e,padding:this.padding})}})],bu.prototype,"enabled",2),a([gu,hu({changeValue(e){this.onChange({enabled:this.enabled,padding:e})}})],bu.prototype,"padding",2);var Su=class extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=xd/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX="end",this.anchorPointY=Ed,this.autoScaling=new bu(e=>{this.ctx.zoomManager.setAutoScaleYAxis(e.enabled,e.padding)}),this.buttons=new ru(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new Bd,this.panner=new jd,this.scroller=new $d,this.scrollPanner=new Kd,this.twoFingers=new lu,this.deceleration="short",this.dragState=0,this.isState=e=>this.ctx.interactionManager.isState(e),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=(0,r.sg)(()=>{this.isFirstWheelEvent=!0},100);const t=new Sd;this.selector=new Yd(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new Vd(e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new zd({onDragStart:(e,t)=>this.onAxisDragStart(e,t),onDrag:e=>{this.onDragMove({...e,currentX:e.offsetX,currentY:e.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(e,t)=>{this.hoveredAxis={id:e,direction:t},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(e.scene.attachNode(t),e.chartEventManager.addListener("series-keynav-zoom",e=>this.onNavZoom(e)),e.widgets.seriesDragInterpreter.addListener("dblclick",e=>this.onDoubleClick(e)),e.widgets.seriesDragInterpreter.addListener("drag-move",e=>this.onDragMove(e)),e.widgets.seriesDragInterpreter.addListener("drag-start",e=>this.onDragStart(e)),e.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),e.widgets.seriesWidget.addListener("wheel",e=>this.onWheel(e)),e.widgets.seriesWidget.addListener("touchstart",(e,t)=>this.onTouchStart(e,t)),e.widgets.seriesWidget.addListener("touchmove",(e,t)=>this.onTouchMove(e,t)),e.widgets.seriesWidget.addListener("touchend",e=>this.onTouchEnd(e)),e.widgets.seriesWidget.addListener("touchcancel",e=>this.onTouchEnd(e)),e.updateService.addListener("process-data",e=>this.onProcessData(e)),e.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e)),e.zoomManager.addListener("zoom-pan-start",e=>this.onZoomPanStart(e)),this.panner.addListener("update",e=>this.onPanUpdate(e)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){if("touch"!==e?.device)return!1;if("drag"!==this.ctx.chartService.touch.dragAction)return!0;if(this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:t,y:i}=this.getZoom();return 0===t.min&&1===t.max&&0===i.min&&1===i.max}onDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,hoveredAxis:s,ctx:{zoomManager:r}}=this;t&&i&&this.isState(mu.ZoomClickable)&&(s?r.resetAxisZoom("zoom",s.id):e?.preventZoomDblClick||this.resetZoom())}onDragStart(e){const{enabled:t,enableAxisDragging:i,enablePanning:s,enableSelecting:r,hoveredAxis:n,ctx:{domManager:o,zoomManager:a}}=this;if(!t)return;if(!this.hoveredAxis&&(!this.isState(mu.ZoomDraggable)||0!==this.dragState||this.isIgnoredTouch(e)))return;this.panner.stopInteractions();let l=0;if(i&&n)l=1;else if(null!=e){const t=this.isPanningKeyPressed(e.sourceEvent);!s||r&&!t?r&&!t&&(l=3):(o.updateCursor(vu,"grabbing"),l=2,this.panner.start())}0!==(this.dragState=l)&&a.fireZoomPanStartEvent("zoom")}onDragMove(e){const{anchorPointX:t,anchorPointY:i,axisDragger:r,dragState:n,enabled:o,paddedRect:a,panner:l,selector:c,seriesRect:h,shouldFlipXY:d,hoveredAxis:u,ctx:{interactionManager:p,tooltipManager:g,updateService:m,zoomManager:f}}=this;if(!o||!a||!h)return;if(!u&&(!this.isState(mu.ZoomDraggable)||this.isIgnoredTouch(e)))return;p.pushState(s.n1.InteractionState.ZoomDrag),"touch"===e.device&&e.sourceEvent.preventDefault();const y=this.getZoom();switch(n){case 1:{if(!u)break;const{id:s,direction:n}=u;let o=n===du.X?t:i;d&&(o=n===du.X?i:t);const a=f.getAxisZoom(s),l=r.update(e,n,o,h,y,a);f.setAxisManuallyAdjusted("zoom",s),this.updateAxisZoom(s,n,l);break}case 2:l.update(e);break;case 3:c.update(e,this.getModuleProperties(),a);break;case 0:return}g.updateTooltip(Cu),m.update(uu.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:e,dragState:t,enabled:i,panner:r,selector:n,ctx:{domManager:o,interactionManager:a,tooltipManager:l}}=this;if(a.popState(s.n1.InteractionState.ZoomDrag),i&&0!==t){switch(t){case 1:this.hoveredAxis=void 0,e.stop();break;case 2:r.stop();break;case 3:{if(!n.didUpdate())break;const e=this.getZoom(),t=n.stop(this.seriesRect,this.paddedRect,e);this.updateZoom(t);break}}this.dragState=0,o.updateCursor(vu),l.removeTooltip(Cu)}}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:r}=this;this.ctx.interactionManager.isState(s.n1.InteractionState.Default)&&t&&i&&(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(r.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:r}=this;if(!(t&&s&&r&&this.isState(mu.ZoomWheelable)))return;const{deltaX:n,deltaY:o}=e.sourceEvent,a=null!=n&&null!=o&&Math.abs(n)>Math.abs(o);i&&a?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,ctx:{zoomManager:n}}=this;if(!s)return;e.sourceEvent.preventDefault();const o=i.update(e,t,s,n.getAxisZooms());for(const[e,{direction:t,zoom:i}]of(0,r.jO)(o))this.updateAxisZoom(e,t,i)}onWheelScrolling(e){const{enableAxisDragging:t,enableIndependentAxes:i,hoveredAxis:n,scroller:o,seriesRect:a,ctx:{zoomManager:l}}=this;if(!a)return;const c=this.getZoom();let h=e.deltaY>0&&this.isMaxZoom(c);const d=t&&null!=n;let u=this.isScalingX(),p=this.isScalingY();d&&(u=n.direction===s.n1.ChartAxisDirection.X,p=!u);const g=this.getModuleProperties({isScalingX:u,isScalingY:p});let m=!0;if(!0===i){const t=o.updateAxes(e,g,a,l.getAxisZooms());for(const[e,{direction:i,zoom:s}]of(0,r.jO)(t))d&&n.id!==e||m&&(m=this.updateAxisZoom(e,i,s))}else{const t=o.update(e,g,a,this.getZoom());m=this.updateUnifiedZoom(t)}h||(h=e.deltaY<0&&!m),this.isFirstWheelEvent&&h||e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(e,t){this.hoveredAxis={id:e,direction:t},this.onDragStart(void 0)}onTouchStart(e,t){this.enableTwoFingerZoom&&0===this.dragState&&this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||4!==this.dragState)return;const i=this.twoFingers.update(e,t);this.updateZoom(Fd(i))}onTouchEnd(e){this.enableTwoFingerZoom&&4===this.dragState&&(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enableAxisDragging,this.ctx),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursors())}onZoomChange(e){"zoom"!==e.callerId&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(t))}onZoomPanStart(e){"zoom"===e.callerId&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:n}}=this;if(!i)return;const o=t.translateZooms(i,n.getAxisZooms(),e.deltaX,e.deltaY);for(const[e,{direction:t,zoom:i}]of(0,r.jO)(o))this.updateAxisZoom(e,t,i);s.updateTooltip(Cu)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return"xy"===this.axes||(this.shouldFlipXY?"y"===this.axes:"x"===this.axes)}isScalingY(){return"xy"===this.axes||(this.shouldFlipXY?"x"===this.axes:"y"===this.axes)}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(e){return Rd(e,Ad())}isZoomValid(e){const{minVisibleItems:t,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:r}}=this;if(0===t)return!0;const n=this.getZoom(),o=yu(Td(e))<yu(Td(n)),a=yu(Dd(e))<yu(Dd(n));return!o&&!a||(null!=i&&o?r.isVisibleItemsCountAtLeast(e,i):null!=s&&a?r.isVisibleItemsCountAtLeast(e,s):r.isVisibleItemsCountAtLeast(e,t))}isAxisZoomValid(e,t){const{minVisibleItems:i,minVisibleItemsX:s,minVisibleItemsY:r,ctx:{zoomManager:n}}=this,o=this.getZoom(),a=t.max-t.min,l=o[e].max-o[e].min,c={...o,[e]:t},h=e===du.X?s:r;return a>=l||n.isVisibleItemsCountAtLeast(c,h??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e):this.updateUnifiedZoom(e)}updateUnifiedZoom(e){return this.isZoomValid(e)?(this.ctx.zoomManager.updateZoom("zoom",e),!0):(this.ctx.updateService.update(uu.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e){this.updatePrimaryAxisZoom(e,du.X),this.updatePrimaryAxisZoom(e,du.Y)}updatePrimaryAxisZoom(e,t){const i=this.ctx.zoomManager.getPrimaryAxisId(t);null!=i&&this.updateAxisZoom(i,t,e[t])}updateAxisZoom(e,t,i){const{enableIndependentAxes:s,ctx:{zoomManager:r}}=this;if(!i)return!1;const n=this.getZoom();return!0!==s?(n[t]=i,this.updateUnifiedZoom(n)):!!this.isAxisZoomValid(t,i)&&(r.updateAxisZoom("zoom",e,i),!0)}toggleAxisDraggingCursors(){const{anchorPointX:e,anchorPointY:t,domProxy:i}=this,s=this.getZoom();let r=Td(s)!==xd,n=Dd(s)!==xd;if(!r){const t=Nd(s,.999,1);t.x=Od(t.x,s.x,e),r=this.isZoomValid(t)}if(!n){const e=Nd(s,1,.999);e.y=Od(e.y,s.y,t),n=this.isZoomValid(e)}i.toggleAxisDraggingCursor(du.X,r),i.toggleAxisDraggingCursor(du.Y,n)}getZoom(){return Pd(this.ctx.zoomManager.getZoom())}getResetZoom(){return Pd(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??!0===this.enableIndependentAxes,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};a([hu({newValue(e){this.onEnabledChange(e)}}),gu],Su.prototype,"enabled",2),a([gu],Su.prototype,"enableAxisDragging",2),a([gu],Su.prototype,"enableDoubleClickToReset",2),a([hu({changeValue(e){this.ctx.zoomManager.setIndependentAxes(Boolean(e))}}),gu],Su.prototype,"enableIndependentAxes",2),a([gu],Su.prototype,"enablePanning",2),a([gu],Su.prototype,"enableScrolling",2),a([gu],Su.prototype,"enableSelecting",2),a([gu],Su.prototype,"enableTwoFingerZoom",2),a([gu],Su.prototype,"panKey",2),a([gu],Su.prototype,"axes",2),a([gu],Su.prototype,"scrollingStep",2),a([gu],Su.prototype,"keepAspectRatio",2),a([gu],Su.prototype,"minVisibleItems",2),a([pu("Use [minVisibleItems] instead."),gu],Su.prototype,"minVisibleItemsX",2),a([pu("Use [minVisibleItems] instead."),gu],Su.prototype,"minVisibleItemsY",2),a([gu],Su.prototype,"anchorPointX",2),a([gu],Su.prototype,"anchorPointY",2),a([gu],Su.prototype,"autoScaling",2),a([gu],Su.prototype,"buttons",2),a([fu("panner.deceleration"),gu],Su.prototype,"deceleration",2);var wu={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:e=>new Su(e),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},{BaseProperties:xu,AxisTicks:Eu,ZIndexMap:Mu,ProxyProperty:Au,Property:Tu,LayoutElement:Du,Group:Iu,Rect:Ru,Marker:Pu,TranslatableGroup:ku,BBox:Lu}=s.n1,Nu=class extends xu{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};a([Tu],Nu.prototype,"thickness",2),a([Tu],Nu.prototype,"preferredLength",2);var _u=class{constructor(e){this.axisTicks=e}};a([Au("axisTicks.label")],_u.prototype,"label",2),a([Au("axisTicks.interval")],_u.prototype,"interval",2),a([Au("axisTicks.padding")],_u.prototype,"padding",2);var Ou=class{constructor(e){this.ctx=e,this.id=(0,r.sX)(this),this.legendGroup=new ku({name:"legend",zIndex:Mu.LEGEND}),this.gradientRect=new Ru,this.arrow=new Pu({shape:"triangle"}),this.ticksGroup=new Iu({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new Nu,this.spacing=20,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new Eu,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new _u(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(e.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(Du.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){return"right"===this.position||"left"===this.position}destroy(){this.destroyFns.forEach(e=>e())}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout(e){const[t]=this.data;if(!this.enabled||!t?.enabled||"gradient"!==t.legendType)return void(this.legendGroup.visible=!1);const{colorRange:i}=this.normalizeColorArrays(t);this.updateGradientRect(e.layoutBox,i);const s=this.updateAxis(t)??new Lu(0,0,0,0),{left:r,top:n}=this.getMeasurements(e.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=r,this.legendGroup.translationY=n}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,r]=t,n=i.length;return t=i.map((e,t)=>0===t?s:t===n-1?r:s+(r-s)*t/(n-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i}=this,{preferredLength:s,thickness:r}=this.gradient;let n;this.isVertical()?(n=0,i.width=r,i.height=Math.min(e.height,s)):(n=90,i.width=Math.min(e.width,s),i.height=r),i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((e,i)=>({stop:i/(t.length-1),color:e})),rotation:n}}updateAxis(e){const{axisTicks:t}=this,i=this.isVertical(),s=this.reverseOrder!==i;return t.position=this.position,t.translationX=i?this.gradient.thickness:0,t.translationY=i?0:this.gradient.thickness,t.scale.domain=s?e.colorDomain.slice().reverse():e.colorDomain,t.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],t.calculateLayout()}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(null==e?.colorValue)return void(t.visible=!1);const{scale:i,label:s}=this.axisTicks,r=s.fontSize??0,n=i.convert(e.colorValue);let{x:o,y:a}=this.gradientRect,l=Math.PI;this.isVertical()?(o-=r/2,a+=n,l/=2):(o+=n,a-=r/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=r,t.translationX=o,t.translationY=a}getMeasurements(e,t){let{x:i,y:s}=e,{width:r,height:n}=this.gradientRect;switch(this.isVertical()?r+=t.width+5:n+=t.height+5,this.position){case"left":s+=e.height/2-n/2,e.shrink(r+this.spacing,"left");break;case"right":i+=e.width-r,s+=e.height/2-n/2,e.shrink(r+this.spacing,"right");break;case"top":i+=e.width/2-r/2,e.shrink(n+this.spacing,"top");break;case"bottom":i+=e.width/2-r/2,s+=e.height-n,e.shrink(n+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Ou.className="GradientLegend",a([Tu],Ou.prototype,"enabled",2),a([Tu],Ou.prototype,"position",2),a([Tu],Ou.prototype,"reverseOrder",2),a([Tu],Ou.prototype,"gradient",2),a([Tu],Ou.prototype,"spacing",2);var Fu={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:e=>new Ou(e),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function Gu(e,t){const i=e.addChild("canvas-overlay","watermark"),s=(0,r.n)("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{ordinalTimeAxisOptionsDefs:Bu,angleNumberAxisOptionsDefs:Vu,angleCategoryAxisOptionsDefs:Hu,radiusNumberAxisOptionsDefs:Uu,radiusCategoryAxisOptionsDefs:zu}=s.n1,Wu={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:Bu,create:e=>new ue(e)},ju={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:Vu,create:e=>new ae(e)},Ku={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:Hu,create:e=>new Z(e)},$u={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:Uu,create:e=>new Ye(e)},Yu={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:zu,create:e=>new ze(e)},{Chart:qu,Property:Xu}=s.n1,Zu=class extends qu{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const e=this.getOptions();this.nodes!==e.nodes&&(this.nodes=e.nodes);const{nodes:t}=this;this.series.forEach(e=>{(function(e){return"sankey"===e.type||"chord"===e.type})(e)&&e.setChartNodes(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const r=s.clone();this.seriesRect=r,this.animationRect=r,t.visible=this.series.some(e=>e.visible);for(const e of[t,i])e.translationX=Math.floor(r.x),e.translationY=Math.floor(r.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:r,paddedRect:r}})}};Zu.className="FlowProportionChart",Zu.type="flow-proportion",a([Xu],Zu.prototype,"nodes",2);var{isAgFlowProportionChartOptions:Qu,flowProportionChartOptionsDefs:Ju}=s.n1,ep={type:"chart",name:"flow-proportion",enterprise:!0,options:Ju,detect:Qu,create:(e,t)=>new Zu(e,t)},{Chart:tp}=s.n1,ip=class extends tp{getChartType(){return"gauge"}performLayout(e){const{seriesRoot:t,annotationRoot:i,series:s,seriesArea:r}=this,{layoutBox:n}=e,o=n.clone();n.shrink(r.padding.toJson()),this.seriesRect=o.clone().translate(o.x-n.x,o.y-n.y),this.animationRect=n,t.visible=s.some(e=>e.visible);for(const e of[t,i])e.translationX=Math.floor(n.x),e.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:o,paddedRect:n}})}getAriaLabel(){const e=[],t=this.getCaptionText();0!==t.length&&e.push(t);for(const t of this.series)e.push(t.getCaptionText());const i=e.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};ip.className="GaugeChart",ip.type="gauge";var{isAgGaugeChartOptions:sp,gaugeChartOptionsDefs:rp}=s.n1,np={type:"chart",name:"gauge",enterprise:!0,options:rp,detect:sp,create:(e,t)=>new ip(e,t)},{Chart:op}=s.n1,ap=class extends op{getChartType(){return"hierarchy"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const r=s.clone();this.seriesRect=r,this.animationRect=r;for(const e of[t,i])e.translationX=Math.floor(r.x),e.translationY=Math.floor(r.y);t.visible=this.series[0].visible,t.setClipRect(r.clone()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:r,paddedRect:r}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};ap.className="HierarchyChart",ap.type="hierarchy";var{isAgHierarchyChartOptions:lp,hierarchyChartOptionsDefs:cp}=s.n1,hp={type:"chart",name:"hierarchy",enterprise:!0,options:cp,detect:lp,create:(e,t)=>new ap(e,t)},{Chart:dp}=s.n1,up=class extends dp{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const r=s.clone();this.seriesRect=r,this.animationRect=r;for(const e of[t,i])e.translationX=Math.floor(s.x),e.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:r,paddedRect:s}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};up.className="StandaloneChart",up.type="standalone";var{isAgStandaloneChartOptions:pp,standaloneChartOptionsDefs:gp}=s.n1,mp={type:"chart",name:"standalone",enterprise:!0,options:gp,detect:pp,create:(e,t)=>new up(e,t)},{Chart:fp,MercatorScale:yp,NumberAxis:vp,Property:Cp}=s.n1;function bp(e){return"map-shape"===e.type||"map-line"===e.type||"map-marker"===e.type||"map-shape-background"===e.type||"map-line-background"===e.type}var Sp=class extends fp{constructor(e,t){super(e,t),this.xAxis=new vp(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new vp(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;this.series.forEach(e=>{bp(e)&&e.setChartTopology(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const r=s.clone();this.seriesRect=r,this.animationRect=r;const n=this.series.filter(bp),o=n.reduce((e,t)=>{if(!t.visible)return e;const i=t.topologyBounds;return null==i?e:null==e?i:(e.merge(i),e)},void 0);let a;if(null!=o){const{lon0:e,lat0:t,lon1:i,lat1:s}=o,n=[[e,t],[i,s]],l=yp.bounds(n),{width:c,height:h}=r,d=Math.min(c/l.width,h/l.height),u=l.width*d,p=l.height*d,g=(c-u)/2,m=(h-p)/2,f=g,y=m,v=g+u,C=m+p,b=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),S=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),w=(v-f)/(b.max-b.min),x=f-w*b.min,E=(C-y)/(1-S.min-(1-S.max)),M=y-E*(1-S.max);a=new yp(n,[[x,M],[x+w,M+E]])}n.forEach(e=>{e.scale=a});const l=this.series.some(e=>e.visible);t.visible=l;for(const e of[t,i])e.translationX=Math.floor(r.x),e.translationY=Math.floor(r.y),e.setClipRect(r.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:r,paddedRect:r}})}};Sp.className="TopologyChart",Sp.type="topology",a([Cp],Sp.prototype,"topology",2);var{isAgTopologyChartOptions:wp,topologyChartOptionsDefs:xp}=s.n1,Ep={type:"chart",name:"topology",enterprise:!0,options:xp,detect:wp,create:(e,t)=>new Sp(e,t)},{annotationCalloutStylesDefs:Mp,annotationNoteStylesDefs:Ap,annotationTextStylesDef:Tp,annotationCommentStylesDefs:Dp,annotationMeasurerStylesDefs:Ip,annotationShapeStylesDefs:Rp,annotationChannelTextDefs:Pp,annotationCrossLineStyleDefs:kp,annotationFibonacciStylesDefs:Lp,annotationLineStyleDefs:Np,annotationLineTextDefs:_p,annotationDisjointChannelStyleDefs:Op,annotationParallelChannelStyleDefs:Fp}=s.n1,Gp=(0,r.fd)({__type:(0,r.mw)((0,r.dY)("date")),value:(0,r.or)(r.Yj,r.ai)},"a serializable date object"),Bp=(0,r.or)(r.Yj,r.ai,Gp),Vp=(0,r.or)(Bp,(0,r.fd)({value:Bp,groupPercentage:(0,r.fN)(-1,1)})),Hp={...Pp,label:r.Yj},Up={..._p,label:r.Yj},zp={x:Vp,y:r.ai},Wp=(0,r.is)({line:{...Np,start:zp,end:zp,text:Up},"horizontal-line":{...kp,value:Vp,text:Up},"vertical-line":{...kp,value:Vp,text:Up},"disjoint-channel":{...Op,startHeight:r.Ly,endHeight:r.Ly,start:zp,end:zp,text:Hp},"parallel-channel":{...Fp,height:r.Ly,start:zp,end:zp,text:Hp},"fibonacci-retracement":{...Lp,start:zp,end:zp,text:Up,reverse:r.zM},"fibonacci-retracement-trend-based":{...Lp,start:zp,end:zp,endRetracement:zp,text:Up,reverse:r.zM},callout:{...Mp,start:zp,end:zp,text:r.Yj},comment:{...Dp,...zp,text:r.Yj},note:{...Ap,...zp,text:r.Yj},text:{...Tp,...zp,text:r.Yj},arrow:{...Np,text:Up,start:zp,end:zp},"arrow-up":{...Rp,...zp},"arrow-down":{...Rp,...zp},"date-range":{...Ip,extendAbove:r.zM,extendBelow:r.zM,text:Up,start:zp,end:zp},"price-range":{...Ip,extendLeft:r.zM,extendRight:r.zM,text:Up,start:zp,end:zp},"date-price-range":{...Ip,text:Up,start:zp,end:zp}},"an annotation initial state object"),jp={chartType:(0,r.KC)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:(0,r.J$)(Wp),legend:(0,r.J$)({visible:r.zM,seriesId:r.Yj,itemId:r.Yj,legendItemName:r.Yj},"legend state array"),zoom:{rangeX:{start:(0,r.or)(r.ai,Gp),end:(0,r.or)(r.ai,Gp)},rangeY:{start:(0,r.or)(r.ai,Gp),end:(0,r.or)(r.ai,Gp)},ratioX:{start:r.CG,end:r.CG},ratioY:{start:r.CG,end:r.CG},autoScaledAxes:(0,r.jk)((0,r.dY)("y"))}},{ScalableGroup:Kp,Rect:$p,Line:Yp,BBox:qp,Selection:Xp,applyShapeFillBBox:Zp}=s.n1,Qp=class extends Kp{constructor(){super(),this.append([new $p({tag:0}),new $p({tag:2}),new $p({tag:1}),new Yp({tag:3}),new Yp({tag:3}),new Yp({tag:4}),new Yp({tag:4})])}updateDatumStyles(e,t,i,s,r){const{bandwidth:n,scaledValues:{xValue:o,medianValue:a}}=e;let{minValue:l,q1Value:c,q3Value:h,maxValue:d}=e.scaledValues;(i&&!s||!i&&s)&&([d,h,c,l]=[l,c,h,d]);const u=(e,t,s,r)=>i?{y:e,x:t,width:r,height:s}:{x:e,y:t,width:s,height:r},p=(e,t,s)=>i?{y1:e,y2:t,x:s}:{x1:e,x2:t,y:s},g=(e,t,s)=>i?{x1:t,x2:s,y:e}:{x:e,y1:t,y2:s},{fill:m,fillOpacity:f,stroke:y,strokeWidth:v,strokeOpacity:C,lineDash:b,lineDashOffset:S,cornerRadius:w,cap:x,whisker:E}=t,M=Xp.select(this,$p),[A]=M.selectByTag(0),[T]=M.selectByTag(2),[D]=M.selectByTag(1),I=M.selectByTag(3),R=M.selectByTag(4);E.strokeWidth>n&&(E.strokeWidth=n);const P=u(c,o,h-c,n);T.setProperties(P),A.setProperties(P),A.setProperties({cornerRadius:w});const k=Math.max(Math.round(a-v/2),c+v),L=Math.min(Math.round(a+v/2),h-v);var N,_,O,F;D.setProperties(P),D.setProperties({visible:k<L,cornerRadius:w,clipBBox:(N=k,_=o+v,O=L-k,F=Math.max(0,n-2*v),({x:N,y:_,width:O,height:F}=u(N,_,O,F)),new qp(N,_,O,F))});const G=Math.floor(o+n*(1-x.lengthRatio)/2),B=Math.ceil(o+n*(1+x.lengthRatio)/2);R[0].setProperties(g(l,G,B)),R[1].setProperties(g(d,G,B)),I[0].setProperties(p(Math.round(l+E.strokeWidth/2),c,Math.floor(o+n/2))),I[1].setProperties(p(h,Math.round(d-E.strokeWidth/2),Math.floor(o+n/2))),Zp(A,m,r),A.setProperties({fill:m,fillOpacity:f,strokeWidth:2*v,strokeOpacity:0}),D.setProperties({fill:y,fillOpacity:C,strokeWidth:0});for(const e of[...I,...R])e.setProperties(E);T.setProperties({stroke:y,strokeWidth:v,strokeOpacity:C,lineDash:b,lineDashOffset:S,cornerRadius:w,fillOpacity:0})}distanceSquared(e,t){const i=Xp.selectByClass(this,$p,Yp);return s.n1.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return void 0===e.midPoint?(r.Vy.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}},{BaseProperties:Jp,FillGradientDefaults:eg,FillPatternDefaults:tg,FillImageDefaults:ig,AbstractBarSeriesProperties:sg,SeriesTooltip:rg,Property:ng,mergeDefaults:og}=s.n1,ag=class extends Jp{constructor(){super(...arguments),this.lengthRatio=.5}};a([ng],ag.prototype,"lengthRatio",2);var lg=class extends Jp{};a([ng],lg.prototype,"stroke",2),a([ng],lg.prototype,"strokeWidth",2),a([ng],lg.prototype,"strokeOpacity",2),a([ng],lg.prototype,"lineDash",2),a([ng],lg.prototype,"lineDashOffset",2);var cg=class extends sg{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new eg,this.fillPatternDefaults=new tg,this.fillImageDefaults=new ig,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new ag,this.whisker=new lg,this.tooltip=new rg}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:r}=this,n=super.toJson();return n.whisker=og(n.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:r}),n}};a([ng],cg.prototype,"xKey",2),a([ng],cg.prototype,"minKey",2),a([ng],cg.prototype,"q1Key",2),a([ng],cg.prototype,"medianKey",2),a([ng],cg.prototype,"q3Key",2),a([ng],cg.prototype,"maxKey",2),a([ng],cg.prototype,"xName",2),a([ng],cg.prototype,"yName",2),a([ng],cg.prototype,"minName",2),a([ng],cg.prototype,"q1Name",2),a([ng],cg.prototype,"medianName",2),a([ng],cg.prototype,"q3Name",2),a([ng],cg.prototype,"maxName",2),a([ng],cg.prototype,"fill",2),a([ng],cg.prototype,"fillGradientDefaults",2),a([ng],cg.prototype,"fillPatternDefaults",2),a([ng],cg.prototype,"fillImageDefaults",2),a([ng],cg.prototype,"fillOpacity",2),a([ng],cg.prototype,"stroke",2),a([ng],cg.prototype,"strokeWidth",2),a([ng],cg.prototype,"strokeOpacity",2),a([ng],cg.prototype,"lineDash",2),a([ng],cg.prototype,"lineDashOffset",2),a([ng],cg.prototype,"cornerRadius",2),a([ng],cg.prototype,"itemStyler",2),a([ng],cg.prototype,"cap",2),a([ng],cg.prototype,"whisker",2),a([ng],cg.prototype,"tooltip",2);var{extractDecoratedProperties:hg,fixNumericExtent:dg,keyProperty:ug,mergeDefaults:pg,SeriesNodePickMode:gg,SMALLEST_KEY_INTERVAL:mg,valueProperty:fg,diff:yg,animationValidation:vg,computeBarFocusBounds:Cg,createDatumId:bg,ContinuousScale:Sg,ChartAxisDirection:wg,motion:xg,isGradientFill:Eg,getShapeStyle:Mg}=s.n1,Ag=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},Tg=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[gg.NEAREST_NODE,gg.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new cg,this.NodeEvent=Ag}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:r,q3Key:n,maxKey:o}=this.properties,a=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];a&&this.processedData&&p.push(yg(this.id,this.processedData)),a&&p.push(vg());const{processedData:g}=await this.requestDataModel(e,this.data,{props:[ug(t,d,{id:"xValue"}),fg(i,u,{id:"minValue"}),fg(s,u,{id:"q1Value"}),fg(r,u,{id:"medianValue"}),fg(n,u,{id:"q3Value"}),fg(o,u,{id:"maxValue"}),...h?[mg]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];if(e!==this.getBarDirection()){const{index:e,def:s}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[e];return"key"===s.type&&"category"===s.valueType?r:this.padBandExtent(r)}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue",!0);return dg(s)}getSeriesRange(e,t){return this.domainForVisibleRange(wg.Y,["maxValue","minValue"],"xValue",t,!0)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),r=this.getValueAxis();if(!(t&&i&&s&&r))return;const{xKey:n,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,cap:p,whisker:g}=this.properties,m=[],f=t.resolveKeysById(this,"xValue",i),y=t.resolveColumnById(this,"minValue",i),v=t.resolveColumnById(this,"q1Value",i),C=t.resolveColumnById(this,"medianValue",i),b=t.resolveColumnById(this,"q3Value",i),S=t.resolveColumnById(this,"maxValue",i),{barWidth:w,groupIndex:x}=this.updateGroupScale(s),E=Sg.is(s.scale)?-.5*w:0,{groupScale:M}=this,A=this.isVertical(),T={itemId:n,nodeData:m,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};return e?((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=f[t];if(null==i)return;const T=y[t],D=v[t],I=C[t],R=b[t],P=S[t];if([T,D,I,R,P].some(e=>"number"!=typeof e)||T>D||D>I||I>R||R>P)return;const k={xValue:Math.round(s.scale.convert(i)),minValue:Math.round(r.scale.convert(T)),q1Value:Math.round(r.scale.convert(D)),medianValue:Math.round(r.scale.convert(I)),q3Value:Math.round(r.scale.convert(R)),maxValue:Math.round(r.scale.convert(P))};k.xValue+=Math.round(M.convert(String(x)))+E;const L=Math.round(w),N=Math.abs(k.q3Value-k.q1Value),_=k.xValue+L/2,O=Math.min(k.q3Value,k.q1Value)+N/2,F={x:A?_:O,y:A?O:_};let G;G=A?{x:F.x-L/2,y:k.minValue,width:L,height:k.maxValue-k.minValue}:{x:k.minValue,y:F.y-L/2,width:k.maxValue-k.minValue,height:L},m.push({series:this,itemId:i,datum:e,datumIndex:t,xKey:n,bandwidth:L,scaledValues:k,cap:p,whisker:g,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,midPoint:F,focusRect:G})}),T):T}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:r,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:Mg({fill:e,fillOpacity:t,stroke:i,strokeOpacity:r,strokeWidth:s,lineDash:n,lineDashOffset:o},a,l,c)}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:r,yName:n,showInLegend:o,legendItemName:a}=this.properties;return r&&"category"===e?[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:a??n??t},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{xKey:n,xName:o,yName:a,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:m,maxKey:f,maxName:y,legendItemName:v,tooltip:C}=r,b=this.getCategoryAxis(),S=this.getValueAxis();if(!(i&&s&&b&&S))return;const w=s.dataSources.get(this.id)?.[e],x=i.resolveKeysById(this,"xValue",s)[e],E=i.resolveColumnById(this,"minValue",s)[e],M=i.resolveColumnById(this,"q1Value",s)[e],A=i.resolveColumnById(this,"medianValue",s)[e],T=i.resolveColumnById(this,"q3Value",s)[e],D=i.resolveColumnById(this,"maxValue",s)[e];if(null==x)return;const I=this.getItemBaseStyle(!1);return Object.assign(I,this.getItemStyleOverrides(String(e),w,I,!1)),this.formatTooltipWithContext(C,{heading:b.formatDatum(x),title:v??a,symbol:this.legendItemSymbol(),data:[{label:m,fallbackLabel:g,value:S.formatDatum(E)},{label:d,fallbackLabel:h,value:S.formatDatum(M)},{label:c,fallbackLabel:l,value:S.formatDatum(A)},{label:p,fallbackLabel:u,value:S.formatDatum(T)},{label:y,fallbackLabel:f,value:S.formatDatum(D)}]},{seriesId:t,datum:w,title:a,xKey:n,xName:o,yName:a,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:m,maxKey:f,maxName:y,...I})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=function(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}(t);xg.resetMotion([e],function(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}(t)),xg.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,cap:s,whisker:r,fillGradientDefaults:n,fillPatternDefaults:o,fillImageDefaults:a}=t,l=e?t.highlightStyle.item:void 0,c=this.getStrokeWidth(t.strokeWidth);return Mg({fill:l?.fill??t.fill,fillOpacity:l?.fillOpacity??t.fillOpacity,stroke:l?.stroke??t.stroke,strokeWidth:l?.strokeWidth??c,strokeOpacity:l?.strokeOpacity??t.strokeOpacity,lineDash:l?.lineDash??t.lineDash??[],lineDashOffset:l?.lineDashOffset??t.lineDashOffset,cornerRadius:i,cap:s,whisker:r},n,o,a)}getItemStyleOverrides(e,t,i,s){const{id:r,properties:n}=this,{xKey:o,minKey:a,q1Key:l,medianKey:c,q3Key:h,maxKey:d,fillGradientDefaults:u,fillPatternDefaults:p,fillImageDefaults:g,itemStyler:m}=n;if(null==m)return;const f=this.cachedDatumCallback(bg(e,s?"highlight":"node"),()=>this.callWithContext(m,{seriesId:r,datum:t,xKey:o,minKey:a,q1Key:l,medianKey:c,q3Key:h,maxKey:d,highlighted:s,...i}));return Mg(f,u,p,g)}updateDatumNodes({datumSelection:e,isHighlight:t}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed(),{highlightStyle:r}=this.properties;e.each((e,n)=>{let o=this.getFormattedStyles(n,t?"highlight":"node");t&&(o=pg(r.item,o));const{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=o;o.whisker=pg(o.whisker,{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d});const u=this.getShapeFillBBox();e.updateDatumStyles(n,o,i,s,u)})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Qp}getFormattedStyles(e,t){const{id:i,properties:s}=this,{xKey:r,minKey:n,q1Key:o,medianKey:a,q3Key:l,maxKey:c,itemStyler:h,cornerRadius:d,fillGradientDefaults:u,fillPatternDefaults:p,fillImageDefaults:g}=s,{datum:m,stroke:f,strokeWidth:y,strokeOpacity:v,lineDash:C,lineDashOffset:b,cap:S,whisker:w}=e;let x,E=1;Eg(e.fill)?x=e.fill:(x=e.fill,E=s.fillOpacity);let M=Mg({fill:x,fillOpacity:E,stroke:f,strokeWidth:y,strokeOpacity:v,lineDash:C,lineDashOffset:b,cornerRadius:d,cap:hg(S),whisker:hg(w)},u,p,g);if(h){const e=this.cachedDatumCallback(bg(m.index,t),()=>this.callWithContext(h,{datum:m,seriesId:i,highlighted:"highlight"===t,...M,xKey:r,minKey:n,q1Key:o,medianKey:a,q3Key:l,maxKey:c}));e&&(M=Mg(pg(e,M),u,p,g))}return M}computeFocusBounds({datumIndex:e}){return Cg(this,this.contextNodeData?.nodeData[e].focusRect)}};Tg.className="BoxPlotSeries",Tg.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:Dg,commonSeriesOptionsDefs:Ig}=s.n1,Rg={...Dg,...Ig,type:(0,r.mw)((0,r.dY)("box-plot")),xKey:(0,r.mw)(r.Yj),minKey:(0,r.mw)(r.Yj),q1Key:(0,r.mw)(r.Yj),medianKey:(0,r.mw)(r.Yj),q3Key:(0,r.mw)(r.Yj),maxKey:(0,r.mw)(r.Yj),xName:r.Yj,yName:r.Yj,minName:r.Yj,q1Name:r.Yj,medianName:r.Yj,q3Name:r.Yj,maxName:r.Yj,grouped:r.zM,legendItemName:r.Yj},{CARTESIAN_AXIS_TYPE:Pg}=s.n1.ThemeConstants,kg={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fill"},{$mix:[s.n1.SAFE_FILL_OPERATION,{$ref:"backgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:2},axes:{[Pg.NUMBER]:{crosshair:{snap:!1}},[Pg.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},Lg={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new Tg(e),tooltipDefaults:{range:"exact"},defaultAxes:s.n1.DIRECTION_SWAP_AXES,themeTemplate:kg,groupable:!0},Ng={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:Rg,create:e=>new Tg(e)},{findMinMax:_g}=s.n1;function Og(e,t=1){let i=Math.ceil(Math.log2(e.length/t))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function Fg(e){return _g(e.map(e=>Number(e)))}function Gg(e,t,i){return(e.valueOf()-t)/(i-t)}function Bg(e,t){return 4*Math.min(Math.floor(e*t),t-1)|0}function Vg(e,t,i,s,r,n){const o=new Int32Array(4*n).fill(-1),a=new Float64Array(4*n).fill(NaN);for(let l=0;l<e.length;l+=1){const c=e[l],h=t[l],d=i[l];if(null==c||null==h||null==d)continue;const u=Gg(c,s,r),p=h.valueOf(),g=d.valueOf(),m=Bg(u,n),f=-1===o[m+0];(f||u<a[m+0])&&(o[m+0]=l,a[m+0]=u),(f||u>a[m+1])&&(o[m+1]=l,a[m+1]=u),(f||g<a[m+2])&&(o[m+2]=l,a[m+2]=g),(f||p>a[m+3])&&(o[m+3]=l,a[m+3]=p)}return{indexData:o,valueData:a}}function Hg(e,t,i,{inPlace:s=!1}={}){const r=i/2|0,n=s?e:new Int32Array(4*r),o=s?t:new Float64Array(4*r);for(let i=0;i<r;i+=1){const s=4*i|0,r=2*s|0,a=r+4|0,l=-1===e[a+0],c=l||t[r+0]<t[a+0]?r:a;n[s+0]=e[c+0],o[s+0]=t[c+0];const h=l||t[r+1]>t[a+1]?r:a;n[s+1]=e[h+1],o[s+1]=t[h+1];const d=l||t[r+2]<t[a+2]?r:a;n[s+2]=e[d+2],o[s+2]=t[d+2];const u=l||t[r+3]>t[a+3]?r:a;n[s+3]=e[u+3],o[s+3]=t[u+3]}return{maxRange:r,indexData:n,valueData:o}}var{fixNumericExtent:Ug,keyProperty:zg,createDatumId:Wg,SeriesNodePickMode:jg,ChartAxisDirection:Kg,SMALLEST_KEY_INTERVAL:$g,valueProperty:Yg,diff:qg,animationValidation:Xg,computeBarFocusBounds:Zg,visibleRangeIndices:Qg,ContinuousScale:Jg,DiscreteTimeScale:em,BandScale:tm,getShapeStyle:im}=s.n1,sm=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},rm=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[jg.AXIS_ALIGNED,jg.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=sm,this.dataAggregationFilters=void 0}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:r,lowKey:n}=this.properties,o=!this.ctx.animationManager.isSkipped(),a=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:a,yScale:l}),u=[];o&&(this.processedData&&u.push(qg(this.id,this.processedData)),u.push(Xg())),i&&u.push(Yg(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[zg(t,h,{id:"xValue"}),Yg(s,d,{id:"closeValue"}),Yg(r,d,{id:"highValue"}),Yg(n,d,{id:"lowValue"}),...c?[$g]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){const i=this.axes[Kg.X];if(null==i||!Jg.is(i.scale)&&!em.is(i.scale))return;const s=e.resolveKeysById(this,"xValue",t),r=e.resolveColumnById(this,"highValue",t),n=e.resolveColumnById(this,"lowValue",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i,s){if(e.length<1e3)return;const[r,n]=Fg(s);let o=Og(e),{indexData:a,valueData:l}=Vg(e,t,i,r,n,o);const c=[{maxRange:o,indexData:a}];for(;o>64;)({indexData:a,valueData:l,maxRange:o}=Hg(a,l,o)),c.push({maxRange:o,indexData:a});return c.reverse(),c}(s,r,n,t.domain.keys[o])}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];if(e!==this.getBarDirection()){const{index:e,def:s}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[e];return"key"===s.type&&"category"===s.valueType?r:this.padBandExtent(r)}const s=this.domainForClippedRange(e,["highValue","lowValue"],"xValue",!0);return Ug(s)}getSeriesRange(e,t){return this.domainForVisibleRange(Kg.Y,["highValue","lowValue"],"xValue",t,!0)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(t&&i&&s&&n))return;const o=[],{xKey:a,highKey:l,lowKey:c}=this.properties,h=i.dataSources.get(this.id)??[],d=t.resolveKeysById(this,"xValue",i),u=t.resolveColumnById(this,"openValue",i),p=t.resolveColumnById(this,"closeValue",i),g=t.resolveColumnById(this,"highValue",i),m=t.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:y,groupIndex:v}=this.updateGroupScale(s),C=f.convert(String(v)),b=y>=1?y:f.rawBandwidth,S=tm.is(s.scale),w={itemId:a,nodeData:o,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!e)return w;const x=(e,t,i,r,l,c,d,u)=>{const p=h[e],g=S?d/2:0,m=s.scale.convert(t)+C+g,f=n.scale.convert(i),y=n.scale.convert(r),v=n.scale.convert(l),b=n.scale.convert(c),w=r>i,x=w?"up":"down",E=Math.min(v,b),M=Math.max(v,b)-E,A={x:m,y:E+M/2};o.push({series:this,itemId:x,datum:p,datumIndex:e,xKey:a,xValue:t,openValue:i,closeValue:r,highValue:l,lowValue:c,midPoint:A,aggregatedValue:r,isRising:w,centerX:m,width:d,y:E,height:M,yOpen:f,yClose:y,crisp:u})},{dataAggregationFilters:E}=this,M=s.scale,[A,T]=M.range,D=T-A,I=e=>M.convert(d[e])+C,R=E?.find(e=>e.maxRange>D);if(null==R){let[e,t]=Qg(h.length,s.range,e=>{const t=I(e);return[t,t+b]});i.input.count<1e3&&(e=0,t=i.input.count);for(let i=e;i<t;i+=1){const e=d[i];if(null==e)continue;const t=u[i],s=p[i],n=g[i],o=m[i];null!=o&&o<=t&&o<=s?null!=n&&n>=t&&n>=s?x(i,e,t,s,n,o,b,!0):r.Vy.warnOnce(`invalid high value for key [${l}] in data element, high value cannot be lower than datum open or close values.`):r.Vy.warnOnce(`invalid low value for key [${c}] in data element, low value cannot be higher than datum open or close values`)}}else{const{maxRange:e,indexData:t}=R,[i,r]=Qg(e,s.range,e=>{const i=4*e,s=t[i+0],r=t[i+1];if(-1!==s)return[I(s),I(r)+b]});for(let e=i;e<r;e+=1){const i=4*e,s=t[i+0],r=t[i+1],n=t[i+3],o=t[i+2];if(-1===s)continue;const a=(s+r)/2|0,l=d[a];null!=l&&x(a,l,u[s],p[r],g[n],m[o],Math.abs(I(r)-I(s))+b,!1)}}return w}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemBaseStyle(e,t){const{properties:i}=this,s=i.item[e],r=t?i.highlightStyle.item:void 0,n={fill:r?.fill??s.fill,fillOpacity:r?.fillOpacity??s.fillOpacity,stroke:r?.stroke??s.stroke,strokeWidth:r?.strokeWidth??s.strokeWidth,strokeOpacity:r?.strokeOpacity??s.strokeOpacity,lineDash:r?.lineDash??s.lineDash,lineDashOffset:r?.lineDashOffset??s.lineDashOffset};return s.fillGradientDefaults&&s.fillPatternDefaults&&s.fillImageDefaults?im(n,s.fillGradientDefaults,s.fillPatternDefaults,s.fillImageDefaults):n}getItemStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,a=o.item[i],{itemStyler:l}=o;if(null==l)return;const{xKey:c,openKey:h,closeKey:d,highKey:u,lowKey:p}=o,g=this.cachedDatumCallback(Wg(e,r?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:t,itemId:i,xKey:c,openKey:h,closeKey:d,highKey:u,lowKey:p,highlighted:r,...s}));return a.fillGradientDefaults&&a.fillPatternDefaults&&a.fillImageDefaults?im(g,a.fillGradientDefaults,a.fillPatternDefaults,a.fillImageDefaults):g}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{xKey:n,xName:o,yName:a,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:m,legendItemName:f,tooltip:y}=r,v=this.getCategoryAxis(),C=this.getValueAxis();if(!(i&&s&&v&&C))return;const b=s.dataSources.get(this.id)?.[e],S=i.resolveKeysById(this,"xValue",s)[e],w=i.resolveColumnById(this,"openValue",s)[e],x=i.resolveColumnById(this,"highValue",s)[e],E=i.resolveColumnById(this,"lowValue",s)[e],M=i.resolveColumnById(this,"closeValue",s)[e];if(null==S)return;const A=M>=w?"up":"down",T=this.properties.item[A],D=this.getItemBaseStyle(A,!1);Object.assign(D,this.getItemStyleOverrides(String(e),b,A,D,!1));let I={fill:T.fill??T.stroke,fillOpacity:T.fillOpacity??T.strokeOpacity??1,stroke:T.stroke,strokeWidth:T.strokeWidth??1,strokeOpacity:T.strokeOpacity??1,lineDash:T.lineDash??[0],lineDashOffset:T.lineDashOffset??0};return T.fillGradientDefaults&&T.fillPatternDefaults&&T.fillImageDefaults&&(I=im(I,T.fillGradientDefaults,T.fillPatternDefaults,T.fillImageDefaults)),this.formatTooltipWithContext(y,{heading:v.formatDatum(S),title:f,symbol:{marker:I},data:[{label:c,fallbackLabel:l,value:C.formatDatum(w)},{label:d,fallbackLabel:h,value:C.formatDatum(x)},{label:p,fallbackLabel:u,value:C.formatDatum(E)},{label:m,fallbackLabel:g,value:C.formatDatum(M)}]},{seriesId:t,datum:b,title:a,itemId:A,xKey:n,xName:o,yName:a,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:m,...D})}getDatumId(e){return Wg(e.xValue)}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(null==t)return;const{centerX:i,y:s,width:r,height:n}=t;return Zg(this,{x:i-r/2,y:s,width:r,height:n})}},{Path:nm,SceneChangeDetection:om,BBox:am}=s.n1,lm=class extends nm{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:e,y:t,width:i,height:s}=this;return new am(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:s,strokeAlignment:r}=this;let{centerX:n,yOpen:o,yClose:a}=this,l=n-t/2,c=n+t/2,h=e,d=e+i;if(s&&t>1){n=this.align(n),o=this.align(o),a=this.align(a);const s=this.align(t/2);l=n-s,c=n+s,h=this.align(e),d=h+this.align(h,i)}const u=(h+d)/2;return n+=r,l+=r,c+=r,h-=r,d+=r,o+=o<u?r:-r,a+=a<u?r:-r,{centerX:n,x0:l,x1:c,y0:h,y1:d,yOpen:o,yClose:a}}executeStroke(e,t){const{width:i,strokeWidth:s}=this;i<s&&(e.lineWidth=i),super.executeStroke(e,t)}};a([om()],lm.prototype,"centerX",2),a([om()],lm.prototype,"y",2),a([om()],lm.prototype,"width",2),a([om()],lm.prototype,"height",2),a([om()],lm.prototype,"yOpen",2),a([om()],lm.prototype,"yClose",2),a([om()],lm.prototype,"crisp",2),a([om()],lm.prototype,"strokeAlignment",2);var cm=class extends lm{updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:s,y0:r,y1:n,yOpen:o,yClose:a}=this.alignedCoordinates();e.clear(),e.moveTo(t,r),e.lineTo(t,n),Math.abs(s-i)>1&&(e.moveTo(i,o),e.lineTo(t,o),e.moveTo(t,a),e.lineTo(s,a))}},{SceneArrayChangeDetection:hm,SceneChangeDetection:dm,ExtendedPath2D:um,BBox:pm}=s.n1,gm=class extends lm{constructor(){super(...arguments),this.wickPath=new um,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}computeDefaultGradientFillBBox(){const{width:e,centerX:t,yOpen:i,yClose:s}=this,r=Math.min(i,s),n=Math.max(i,s),o=t-e/2;return new pm(o,r,t+e/2-o,n-r)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:r,lineDashOffset:n,wickStroke:o,wickStrokeWidth:a,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d}=this,{centerX:u,x0:p,x1:g,y0:m,y1:f,yOpen:y,yClose:v}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const C=null!=o&&o!==t||null!=a&&a!==i||null!=l&&l!==s||null!=c&&c!==r||null!=h&&h!==n?this.wickPath:e;if(Math.abs(g-p)<=3)return C.moveTo(u,m),void C.lineTo(u,f);const b=Math.min(y,v),S=Math.max(y,v);C.moveTo(u,m),C.lineTo(u,b+i/2),C.moveTo(u,f),C.lineTo(u,S-i/2);const w=d+i/2,x=S-b-2*w;if(x>0)e.rect(p+w,b+w,g-p-2*w,x);else{const t=(b+S)/2;e.moveTo(p,t),e.lineTo(g,t)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:r,lineDash:n,lineDashOffset:o,wickStroke:a=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=r,wickLineDash:h=n,wickLineDashOffset:d=o}=this;0!==l&&(e.globalAlpha*=c,"string"==typeof a&&(e.strokeStyle=a),e.lineWidth=l,null!=h&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};a([dm()],gm.prototype,"wickStroke",2),a([dm()],gm.prototype,"wickStrokeWidth",2),a([dm()],gm.prototype,"wickStrokeOpacity",2),a([hm()],gm.prototype,"wickLineDash",2),a([dm()],gm.prototype,"wickLineDashOffset",2);var{BaseProperties:mm,Property:fm,AbstractBarSeriesProperties:ym,SeriesTooltip:vm}=s.n1,Cm=class extends mm{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([fm],Cm.prototype,"stroke",2),a([fm],Cm.prototype,"strokeWidth",2),a([fm],Cm.prototype,"strokeOpacity",2),a([fm],Cm.prototype,"lineDash",2),a([fm],Cm.prototype,"lineDashOffset",2);var bm=class extends mm{constructor(){super(...arguments),this.up=new Cm,this.down=new Cm}};a([fm],bm.prototype,"up",2),a([fm],bm.prototype,"down",2);var Sm=class extends ym{};a([fm],Sm.prototype,"xKey",2),a([fm],Sm.prototype,"openKey",2),a([fm],Sm.prototype,"closeKey",2),a([fm],Sm.prototype,"highKey",2),a([fm],Sm.prototype,"lowKey",2),a([fm],Sm.prototype,"xName",2),a([fm],Sm.prototype,"yName",2),a([fm],Sm.prototype,"openName",2),a([fm],Sm.prototype,"closeName",2),a([fm],Sm.prototype,"highName",2),a([fm],Sm.prototype,"lowName",2);var wm=class extends Sm{constructor(){super(...arguments),this.tooltip=new vm,this.item=new bm}};a([fm],wm.prototype,"tooltip",2),a([fm],wm.prototype,"item",2),a([fm],wm.prototype,"itemStyler",2);var{FillGradientDefaults:xm,FillPatternDefaults:Em,FillImageDefaults:Mm,BaseProperties:Am,SeriesTooltip:Tm,Property:Dm}=s.n1,Im=class extends Am{};a([Dm],Im.prototype,"stroke",2),a([Dm],Im.prototype,"strokeWidth",2),a([Dm],Im.prototype,"strokeOpacity",2),a([Dm],Im.prototype,"lineDash",2),a([Dm],Im.prototype,"lineDashOffset",2);var Rm=class extends Am{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new xm,this.fillPatternDefaults=new Em,this.fillImageDefaults=new Mm,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Im}};a([Dm],Rm.prototype,"fill",2),a([Dm],Rm.prototype,"fillGradientDefaults",2),a([Dm],Rm.prototype,"fillPatternDefaults",2),a([Dm],Rm.prototype,"fillImageDefaults",2),a([Dm],Rm.prototype,"fillOpacity",2),a([Dm],Rm.prototype,"stroke",2),a([Dm],Rm.prototype,"strokeWidth",2),a([Dm],Rm.prototype,"strokeOpacity",2),a([Dm],Rm.prototype,"lineDash",2),a([Dm],Rm.prototype,"lineDashOffset",2),a([Dm],Rm.prototype,"cornerRadius",2),a([Dm],Rm.prototype,"wick",2);var Pm=class extends Am{constructor(){super(...arguments),this.up=new Rm,this.down=new Rm}};a([Dm],Pm.prototype,"up",2),a([Dm],Pm.prototype,"down",2);var km=class extends Sm{constructor(){super(...arguments),this.item=new Pm,this.tooltip=new Tm}};a([Dm],km.prototype,"item",2),a([Dm],km.prototype,"tooltip",2),a([Dm],km.prototype,"itemStyler",2);var{createDatumId:Lm,isGradientFill:Nm,isPatternFill:_m,isImageFill:Om,getShapeFill:Fm,applyShapeStyle:Gm,getShapeStyle:Bm}=s.n1,Vm=class extends rm{constructor(){super(...arguments),this.properties=new km}nodeFactory(){return new gm}updateDatumNodes({datumSelection:e,isHighlight:t}){const{id:i,properties:s}=this,{xKey:r,highKey:n,lowKey:o,openKey:a,closeKey:l,item:c,itemStyler:h}=s,{up:d,down:u}=c,p=Bm({fill:d.fill,fillOpacity:d.fillOpacity,stroke:d.stroke,strokeWidth:d.strokeWidth,strokeOpacity:d.strokeOpacity,lineDash:d.lineDash,lineDashOffset:d.lineDashOffset},d.fillGradientDefaults,d.fillPatternDefaults,d.fillImageDefaults),g=Bm({fill:u.fill,fillOpacity:u.fillOpacity,stroke:u.stroke,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,lineDash:u.lineDash,lineDashOffset:u.lineDashOffset},u.fillGradientDefaults,u.fillPatternDefaults,u.fillImageDefaults),m=t?s.highlightStyle.item:void 0;e.each((e,s)=>{const{isRising:c,centerX:f,width:y,y:v,height:C,yOpen:b,yClose:S,crisp:w}=s;let x;if(null!=h){const{fill:e,fillOpacity:m,stroke:f,strokeWidth:y,strokeOpacity:v,lineDash:C,lineDashOffset:b}=c?p:g;x=Bm(this.cachedDatumCallback(Lm(this.getDatumId(s),t?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:s.itemId,xKey:r,highKey:n,lowKey:o,openKey:a,closeKey:l,datum:s.datum,fill:e,fillOpacity:m,strokeOpacity:v,stroke:f,strokeWidth:y,lineDash:C,lineDashOffset:b,highlighted:t})),c?d.fillGradientDefaults:u.fillGradientDefaults,c?d.fillPatternDefaults:u.fillPatternDefaults,c?d.fillImageDefaults:u.fillImageDefaults)}e.centerX=f,e.width=y,e.y=v,e.height=C,e.yOpen=b,e.yClose=S,e.crisp=w;const E=c?p:g,M=c?d.wick:u.wick;Gm(e,{fill:m?.fill??x?.fill??E.fill,fillOpacity:m?.fillOpacity??x?.fillOpacity??E.fillOpacity,stroke:m?.stroke??x?.stroke??E.stroke,strokeWidth:m?.strokeWidth??x?.strokeWidth??E.strokeWidth,strokeOpacity:m?.strokeOpacity??x?.strokeOpacity??E.strokeOpacity,lineDash:m?.lineDash??x?.lineDash??E.lineDash,lineDashOffset:m?.lineDashOffset??x?.lineDashOffset??E.lineDashOffset},void 0,this.getShapeFillBBox());const A=x?.wick;e.wickStroke=m?.stroke??A?.stroke??M.stroke,e.wickStrokeWidth=m?.strokeWidth??A?.strokeWidth??M.strokeWidth,e.wickStrokeOpacity=m?.strokeOpacity??A?.strokeOpacity??M.strokeOpacity,e.wickLineDash=m?.lineDash??A?.lineDash??M.lineDash,e.wickLineDashOffset=m?.lineDashOffset??A?.lineDashOffset??M.lineDashOffset,e.strokeAlignment=(x?.strokeWidth??E.strokeWidth)/2})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=Fm(e.fill,e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults),s=Nm(i)?i.colorStops.map(e=>"string"==typeof e?e:{color:e.color,stop:null!=e.stop?.5*e.stop:void 0}):[{color:_m(i)||Om(i)?e.stroke:i,stop:0},{color:_m(i)||Om(i)?e.stroke:i,stop:.5}],r=Fm(t.fill,t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults),n={type:"gradient",gradient:"linear",rotation:90,colorStops:[...s,...Nm(r)?r.colorStops.map(e=>"string"==typeof e?e:{color:e.color,stop:null!=e.stop?.5*e.stop:void 0}):[{color:_m(r)||Om(r)?t.stroke:r,stop:.5}]],reverse:!1},o={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:n,fillOpacity:e.fillOpacity,stroke:o,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:r}}=this,{xKey:n,yName:o,showInLegend:a,legendItemName:l}=this.properties;return i?.length&&n&&"category"===e?[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&r.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??o??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!a}]:[]}};Vm.className="CandleStickSeries",Vm.type="candlestick";var{commonSeriesOptionsDefs:Hm,candlestickSeriesThemeableOptionsDef:Um}=s.n1,zm={...Um,...Hm,type:(0,r.mw)((0,r.dY)("candlestick")),xKey:(0,r.mw)(r.Yj),openKey:(0,r.mw)(r.Yj),highKey:(0,r.mw)(r.Yj),lowKey:(0,r.mw)(r.Yj),closeKey:(0,r.mw)(r.Yj),xName:r.Yj,yName:r.Yj,openName:r.Yj,highName:r.Yj,lowName:r.Yj,closeName:r.Yj};zm.pickOutsideVisibleMinorAxis=(0,r._L)(r.zM),zm.focusPriority=(0,r._L)(r.ai);var{CARTESIAN_AXIS_TYPE:Wm}=s.n1.ThemeConstants;function jm(e){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},"up"===e?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${e}.fill`}]},{$isPattern:[{$palette:`${e}.fill`}]},{$isImage:[{$palette:`${e}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${e}.fill`}]}]},[{$mix:[{$palette:`${e}.fill`},"black",.15]},{$mix:[{$palette:`${e}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS}}var Km={series:{item:{up:jm("up"),down:jm("down")},highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[Wm.NUMBER]:{crosshair:{snap:!1}},[Wm.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:$m,CARTESIAN_POSITION:Ym}=s.n1.ThemeConstants,qm={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new Vm(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:$m.NUMBER,position:Ym.LEFT},{type:$m.ORDINAL_TIME,position:Ym.BOTTOM}],themeTemplate:Km,groupable:!1},Xm={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:zm,create:e=>new Vm(e)},{CachedTextMeasurerPool:Zm,TextUtils:Qm,TextWrapper:Jm}=s.n1;function ef(e,t){return null!=e.lineHeight&&null!=e.fontSize?e.lineHeight*t/e.fontSize:Qm.getLineHeight(t)}function tf(e,t,i,s,{padding:n},o){const{spacing:a=0}=t,l=2*n,c=2*n+a,h=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(h>o(h+c,!1).height-c)return;const d=function(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:r,minimumFontSize:n=r}=t,o=i-s,a=r-n;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:r}];for(;l>s||c>n;)(o>0?(l-s)/o:-1)>(a>0?(c-n)/a:-1)?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c});return h.reverse(),h}(t,s),u={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},p={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let g,m;return(0,r.F4)(0,d.length-1,r=>{const{labelFontSize:n,secondaryLabelFontSize:h}=d[r],f=0===r,y=ef(t,n),v=ef(s,h),C=o(y+v+c,f),b=C.width-l,S=C.height-c;if(y+v>S)return;if(null!=g&&g.fontSize===n||(u.fontSize=n,g=of(t,e,b,S,u,t.wrapping,f?t.overflowStrategy:"hide")),null==g||g.width>b||g.height>S)return;if(null!=m&&m.fontSize===h||(p.fontSize=h,m=of(s,i,b,S,p,s.wrapping,f?s.overflowStrategy:"hide")),null==m)return;const w=g.height+m.height;return m.width>b||w>S?void 0:{width:Math.max(g.width,m.width),height:w+a,meta:C.meta,label:g,secondaryLabel:m}})}function sf(e,t,{padding:i},s){const n=2*i,o=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),a={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return(0,r.F4)(o,t.fontSize,i=>{const r=ef(t,i),l=i===o,c=s(r+n,l),h=c.width-n,d=c.height-n;if(r>d)return;a.fontSize=i;const u=Jm.wrapLines(e,{maxWidth:h,maxHeight:d,font:a,textWrap:t.wrapping,overflow:(l?t.overflowStrategy:void 0)??"hide"});if(!u.length)return;const p=function(e,{font:t,lineHeight:i=Qm.defaultLineHeight,maxWidth:s,maxHeight:r=1/0}){let n=i*e.length;for(;n>r;){if(1===e.length)return;e.pop(),e[e.length-1]=Jm.appendEllipsis(e.at(-1)),n=i*e.length}const o=Zm.measureLines(e,{font:t});let a,l;if(o.width>s){const e=[];l=0;for(const t of o.lineMetrics){if(t.width>s){if(!e.length)return;break}e.push(t.text),l=Math.max(l,t.width)}a=Jm.appendEllipsis(e.join("\n"))}else a=e.join("\n"),l=o.width;return{text:a,width:l,height:n}}(u,{lineHeight:r,font:a,maxWidth:h,maxHeight:d});return p?[{fontSize:i,lineHeight:r,...p},c.meta]:void 0})}function rf(e){return null!=e?.minimumFontSize&&null!=e?.fontSize&&e?.minimumFontSize>e?.fontSize}function nf(e,t,i,s,n,o){const a=t.enabled?e:void 0,l=s.enabled?i:void 0;let c,h,d;if((rf(t)||rf(s))&&r.Vy.warnOnce("minimumFontSize should be set to a value less than or equal to the font size"),null!=a&&null!=l&&(c=tf(a,t,l,s,n,o)),null==c&&null!=a&&(h=sf(a,t,n,o)),null!=h){const[e,t]=h;c={width:e.width,height:e.height,meta:t,label:e,secondaryLabel:void 0}}if(null==c&&null==a&&null!=l&&(d=sf(l,s,n,o)),null!=d){const[e,t]=d;c={width:e.width,height:e.height,meta:t,label:void 0,secondaryLabel:e}}return c}function of(e,t,i,s,r,n,o){const a=Jm.wrapLines(t,{maxWidth:i,maxHeight:s,font:r,textWrap:n,overflow:o});if(!a.length)return;const l=ef(e,r.fontSize),{width:c}=Zm.measureLines(a,{font:r});return{width:c,lineHeight:l,text:a.join("\n"),height:a.length*l,fontSize:r.fontSize}}var{Property:af}=s.n1,lf=class extends s.n1.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};a([af],lf.prototype,"wrapping",2),a([af],lf.prototype,"overflowStrategy",2),a([af],lf.prototype,"lineHeight",2),a([af],lf.prototype,"minimumFontSize",2);var cf=class extends lf{constructor(){super(...arguments),this.spacing=0}};a([af],cf.prototype,"spacing",2);var hf=class extends lf{},{CartesianSeriesProperties:df,SeriesTooltip:uf,Property:pf}=s.n1,gf=class extends df{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new cf,this.tooltip=new uf}};a([pf],gf.prototype,"title",2),a([pf],gf.prototype,"xKey",2),a([pf],gf.prototype,"yKey",2),a([pf],gf.prototype,"colorKey",2),a([pf],gf.prototype,"xName",2),a([pf],gf.prototype,"yName",2),a([pf],gf.prototype,"colorName",2),a([pf],gf.prototype,"colorRange",2),a([pf],gf.prototype,"stroke",2),a([pf],gf.prototype,"strokeOpacity",2),a([pf],gf.prototype,"strokeWidth",2),a([pf],gf.prototype,"textAlign",2),a([pf],gf.prototype,"verticalAlign",2),a([pf],gf.prototype,"itemPadding",2),a([pf],gf.prototype,"itemStyler",2),a([pf],gf.prototype,"label",2),a([pf],gf.prototype,"tooltip",2);var{SeriesNodePickMode:mf,computeBarFocusBounds:ff,getMissCount:yf,valueProperty:vf,ChartAxisDirection:Cf,DEFAULT_CARTESIAN_DIRECTION_KEYS:bf,DEFAULT_CARTESIAN_DIRECTION_NAMES:Sf,createDatumId:wf,ColorScale:xf,Rect:Ef,PointerEvents:Mf,applyShapeStyle:Af}=s.n1,Tf=class extends s.n1.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},Df={left:-.5,center:0,right:-.5},If={top:-.5,middle:0,bottom:-.5},Rf=class extends s.n1.CartesianSeries{constructor(e){super({moduleCtx:e,directionKeys:bf,directionNames:Sf,categoryKey:void 0,pickModes:[mf.NEAREST_NODE,mf.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new gf,this.NodeEvent=Tf,this.colorScale=new xf}async processData(e){const t=this.axes[Cf.X],i=this.axes[Cf.Y];if(!t||!i||!this.data?.length)return;const{xKey:s,yKey:r,colorRange:n,colorKey:o}=this.properties,a=this.axes[Cf.X]?.scale,l=this.axes[Cf.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[vf(s,c,{id:"xValue"}),vf(r,h,{id:"yValue"}),...o?[vf(o,d,{id:"colorValue",invalidValue:null})]:[]]});if(this.isColorScaleValid()){const e=u.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[e],this.colorScale.range=n,this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.input.count,n=yf(this,i.defs.values[s].missing);return!(0===r||r===n)}xCoordinateRange(e,t){const i=this.axes[Cf.X].scale,s=t*(i.bandwidth??0)/2,r=i.convert(e)+s;return[r,r+t*(i.bandwidth??10)]}yCoordinateRange(e,t){const i=this.axes[Cf.Y].scale,s=t*(i.bandwidth??0)/2,r=i.convert(e[0])+s;return[r,r+t*(i.bandwidth??10)]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return t&&i?e===Cf.X?t.getDomain(this,"xValue","value",i):t.getDomain(this,"yValue","value",i):[]}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,visible:t,axes:i,dataModel:s,processedData:n}=this,o=i[Cf.X],a=i[Cf.Y];if(!(e&&s&&n&&t&&o&&a))return;if("category"!==o.type||"category"!==a.type)return void r.Vy.warnOnce(`Heatmap series expected axes to have "category" type, but received "${o.type}" and "${a.type}" instead.`);const{xKey:l,xName:c,yKey:h,yName:d,colorKey:u,colorName:p,textAlign:g,verticalAlign:m,itemPadding:f,label:y}=this.properties,v=s.resolveColumnById(this,"xValue",n),C=s.resolveColumnById(this,"yValue",n),b=u?s.resolveColumnById(this,"colorValue",n):void 0,S=o.scale,w=a.scale,x=(S.bandwidth??0)/2,E=(w.bandwidth??0)/2,M=[],A=[],T=S.bandwidth??10,D=w.bandwidth??10,I=(T-2*f)*Df[g],R=(D-2*f)*If[m],P=()=>({width:T,height:D,meta:null});return(n.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=v[t],s=C[t],r=S.convert(i)+x,n=w.convert(s)+E,o=b?.[t],a=nf(null==o?void 0:this.getLabelText(y,{value:o,datum:e,colorKey:u,colorName:p,xKey:l,yKey:h,xName:c,yName:d}),this.properties.label,void 0,this.properties.label,{padding:f},P),k={x:r,y:n,size:0};if(M.push({series:this,itemId:h,datumIndex:t,yKey:h,xKey:l,xValue:i,yValue:s,colorValue:o,datum:e,point:k,width:T,height:D,midPoint:{x:r,y:n},missing:null!=b&&null==o}),null!=a?.label){const{text:i,fontSize:s,lineHeight:r,height:n}=a.label,{fontStyle:o,fontFamily:l,fontWeight:c,color:d}=this.properties.label,u=k.x+I*(T-2*f),p=k.y+R*(D-2*f)-.5*(a.height-n);A.push({series:this,itemId:h,datum:e,datumIndex:t,text:i,fontSize:s,lineHeight:r,fontStyle:o,fontFamily:l,fontWeight:c,color:d,textAlign:g,verticalAlign:m,x:u,y:p})}}),{itemId:this.properties.yKey??this.id,nodeData:M,labelData:A,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new Ef}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity}}getItemStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,{xKey:a,yKey:l,itemStyler:c}=o,h=this.isColorScaleValid()&&null!=i?this.colorScale.convert(i):"transparent";let d=null==s.fill?{fill:h}:void 0;if(null!=c){d??(d={});const i=this.cachedDatumCallback(wf(e,r?"highlight":"node"),()=>this.callWithContext(c,{seriesId:n,datum:t,xKey:a,yKey:l,highlighted:r,...s,fill:h}));Object.assign(d,i)}return d}updateDatumNodes(e){const{isHighlight:t}=e,i=this.axes[Cf.X],[s,r]=i?.visibleRange??[],n=!(0!==s||1!==r),o=this.getItemBaseStyle(t);e.datumSelection.each((e,i)=>{const{datumIndex:s,colorValue:r,datum:a,point:l,width:c,height:h}=i,d=this.getItemStyleOverrides(String(s),a,r,o,t);e.crisp=n,e.x=Math.floor(l.x-c/2),e.y=Math.floor(l.y-h/2),e.width=Math.ceil(c),e.height=Math.ceil(h),Af(e,o,d)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,r=s?t:[];return i.update(r)}updateLabelNodes(e){e.labelSelection.each((e,t)=>{e.text=t.text,e.fontSize=t.fontSize,e.lineHeight=t.lineHeight,e.fontStyle=t.fontStyle,e.fontFamily=t.fontFamily,e.fontWeight=t.fontWeight,e.fill=t.color,e.textAlign=t.textAlign,e.textBaseline=t.verticalAlign,e.x=t.x,e.y=t.y,e.pointerEvents=Mf.None})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n,colorScale:o}=this,{xKey:a,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,colorRange:p,title:g,legendItemName:m,tooltip:f}=n,y=r[Cf.X],v=r[Cf.Y];if(!(i&&s&&y&&v))return;const C=s.dataSources.get(this.id)?.[e],b=i.resolveColumnById(this,"xValue",s)[e],S=i.resolveColumnById(this,"yValue",s)[e],w=null!=d&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[e]:void 0;if(null==b)return;const x=[];let E;null==w?E=p[0]:(E=o.convert(w),x.push({label:u,fallbackLabel:d,value:String(w)})),x.push({label:l,fallbackLabel:a,value:y.formatDatum(b)},{label:h,fallbackLabel:c,value:v.formatDatum(S)});const M=this.getItemBaseStyle(!1);Object.assign(M,this.getItemStyleOverrides(String(e),C,w,M,!1)),null!=M.fill&&(E=M.fill);const A=null!=E?{marker:{shape:"square",fill:E,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return this.formatTooltipWithContext(f,{title:g??m,symbol:A,data:x},{seriesId:t,datum:C,title:g,xKey:a,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,...M})}getLegendData(e){return"gradient"===e&&this.isColorScaleValid()&&this.dataModel?[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]:[]}isLabelEnabled(){return this.properties.label.enabled&&Boolean(this.properties.colorKey)}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(void 0===t)return;const{width:i,height:s,midPoint:r}=t,n={x:r.x-i/2,y:r.y-s/2,width:i,height:s};return ff(this,n)}};Rf.className="HeatmapSeries",Rf.type="heatmap";var{commonSeriesOptionsDefs:Pf,heatmapSeriesThemeableOptionsDef:kf}=s.n1,Lf={...kf,...Pf,type:(0,r.mw)((0,r.dY)("heatmap")),xKey:(0,r.mw)(r.Yj),yKey:(0,r.mw)(r.Yj),colorKey:r.Yj,xName:r.Yj,yName:r.Yj,colorName:r.Yj,colorRange:(0,r.jk)(r.yW)},Nf={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$path:["./0",{$palette:"stroke"},{$palette:"strokes"}]}]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:_f,CARTESIAN_POSITION:Of}}=s.n1,Ff={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:e=>new Rf(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:_f.CATEGORY,position:Of.LEFT},{type:_f.CATEGORY,position:Of.BOTTOM}],themeTemplate:Nf},Gf={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:Lf,create:e=>new Rf(e)},{createDatumId:Bf}=s.n1,Vf=class extends rm{constructor(){super(...arguments),this.properties=new wm}nodeFactory(){return new cm}updateDatumNodes({datumSelection:e,isHighlight:t}){const{id:i,properties:s}=this,{xKey:r,highKey:n,lowKey:o,openKey:a,closeKey:l,item:c,itemStyler:h}=s,{up:d,down:u}=c,{stroke:p,strokeWidth:g,strokeOpacity:m,lineDash:f,lineDashOffset:y}=d,{stroke:v,strokeWidth:C,strokeOpacity:b,lineDash:S,lineDashOffset:w}=u,x=t?s.highlightStyle.item:void 0;e.each((e,s)=>{const{isRising:c,centerX:E,width:M,y:A,height:T,yOpen:D,yClose:I,crisp:R}=s;let P;if(null!=h){const{stroke:e,strokeWidth:p,strokeOpacity:g,lineDash:m,lineDashOffset:f}=c?d:u;P=this.cachedDatumCallback(Bf(this.getDatumId(s),t?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:s.itemId,xKey:r,highKey:n,lowKey:o,openKey:a,closeKey:l,datum:s.datum,strokeOpacity:g,stroke:e,strokeWidth:p,lineDash:m,lineDashOffset:f,highlighted:t}))}e.centerX=E,e.width=M,e.y=A,e.height=T,e.yOpen=D,e.yClose=I,e.crisp=R,e.stroke=x?.stroke??P?.stroke??(c?p:v),e.strokeWidth=x?.strokeWidth??P?.strokeWidth??(c?g:C),e.strokeOpacity=x?.strokeOpacity??P?.strokeOpacity??(c?m:b),e.lineDash=x?.lineDash??P?.lineDash??(c?f:S),e.lineDashOffset=x?.lineDashOffset??P?.lineDashOffset??(c?y:w),e.strokeAlignment=(P?.strokeWidth??(c?g:C))/2})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:s},visible:r}=this,{xKey:n,yName:o,item:{up:a,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!n||"category"!==e)return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:a.stroke,stop:0},{color:a.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:r&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??o??t},symbol:{marker:{fill:d,fillOpacity:a.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}};Vf.className="ohlc",Vf.type="ohlc";var{commonSeriesOptionsDefs:Hf,ohlcSeriesThemeableOptionsDef:Uf}=s.n1,zf={...Uf,...Hf,type:(0,r.mw)((0,r.dY)("ohlc")),xKey:(0,r.mw)(r.Yj),openKey:(0,r.mw)(r.Yj),highKey:(0,r.mw)(r.Yj),lowKey:(0,r.mw)(r.Yj),closeKey:(0,r.mw)(r.Yj),xName:r.Yj,yName:r.Yj,openName:r.Yj,highName:r.Yj,lowName:r.Yj,closeName:r.Yj};zf.pickOutsideVisibleMinorAxis=(0,r._L)(r.zM),zf.focusPriority=(0,r._L)(r.ai);var{CARTESIAN_AXIS_TYPE:Wf,CARTESIAN_POSITION:jf}=s.n1.ThemeConstants,Kf={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:e=>new Vf(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Wf.NUMBER,position:jf.LEFT},{type:Wf.ORDINAL_TIME,position:jf.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}}},axes:{[Wf.NUMBER]:{crosshair:{snap:!1}},[Wf.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},$f={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:zf,create:e=>new Vf(e)};function Yf(e,t,i,s,r,n){const o=e[n];return null!=o&&n===s[Bg(Gg(o,t,i),r)+3]}function qf(e,t,i,s,r,n){const o=e[n];return null!=o&&n===s[Bg(Gg(o,t,i),r)+2]}var{CartesianSeriesProperties:Xf,FillGradientDefaults:Zf,FillPatternDefaults:Qf,FillImageDefaults:Jf,InterpolationProperties:ey,SeriesMarker:ty,SeriesTooltip:iy,Property:sy,DropShadow:ry,Label:ny}=s.n1,oy=class extends ny{constructor(){super(...arguments),this.placement="outside",this.padding=6}};a([sy],oy.prototype,"placement",2),a([sy],oy.prototype,"padding",2);var ay=class extends Xf{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new Zf,this.fillPatternDefaults=new Qf,this.fillImageDefaults=new Jf,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new ey,this.shadow=(new ry).set({enabled:!1}),this.marker=new ty,this.label=new oy,this.tooltip=new iy,this.connectMissingData=!1}};a([sy],ay.prototype,"xKey",2),a([sy],ay.prototype,"yLowKey",2),a([sy],ay.prototype,"yHighKey",2),a([sy],ay.prototype,"xName",2),a([sy],ay.prototype,"yName",2),a([sy],ay.prototype,"yLowName",2),a([sy],ay.prototype,"yHighName",2),a([sy],ay.prototype,"fill",2),a([sy],ay.prototype,"fillGradientDefaults",2),a([sy],ay.prototype,"fillPatternDefaults",2),a([sy],ay.prototype,"fillImageDefaults",2),a([sy],ay.prototype,"fillOpacity",2),a([sy],ay.prototype,"stroke",2),a([sy],ay.prototype,"strokeWidth",2),a([sy],ay.prototype,"strokeOpacity",2),a([sy],ay.prototype,"lineDash",2),a([sy],ay.prototype,"lineDashOffset",2),a([sy],ay.prototype,"interpolation",2),a([sy],ay.prototype,"shadow",2),a([sy],ay.prototype,"marker",2),a([sy],ay.prototype,"label",2),a([sy],ay.prototype,"tooltip",2),a([sy],ay.prototype,"connectMissingData",2);var{CollapseMode:ly,isScaleValid:cy,pairUpSpans:hy,prepareAreaFillAnimationFns:dy,plotInterpolatedLinePathStroke:uy,prepareLinePathPropertyAnimation:py,areScalingEqual:gy}=s.n1;var{valueProperty:my,keyProperty:fy,ChartAxisDirection:yy,mergeDefaults:vy,updateLabelNode:Cy,fixNumericExtent:by,buildResetPathFn:Sy,resetLabelFn:wy,resetMarkerFn:xy,resetMarkerPositionFn:Ey,pathSwipeInAnimation:My,resetMotion:Ay,markerSwipeScaleInAnimation:Ty,seriesLabelFadeInAnimation:Dy,animationValidation:Iy,diff:Ry,updateClipPath:Py,computeMarkerFocusBounds:ky,plotAreaPathFill:Ly,plotLinePathStroke:Ny,interpolatePoints:_y,pathFadeInAnimation:Oy,markerFadeInAnimation:Fy,fromToMotion:Gy,pathMotion:By,extent:Vy,createDatumId:Hy,applyShapeFillBBox:Uy,PointerEvents:zy,Group:Wy,BBox:jy,ContinuousScale:Ky,DiscreteTimeScale:$y,findMinMax:Yy,getShapeStyle:qy,getShapeFill:Xy,applyShapeStyle:Zy}=s.n1,Qy=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Jy=class extends s.n1.CartesianSeries{constructor(e){super({moduleCtx:e,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[s.n1.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[yy.X]:["xKey"],[yy.Y]:["yLowKey","yHighKey"]},directionNames:{[yy.X]:["xName"],[yy.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:Sy({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:wy,marker:(e,t)=>({...xy(e),...Ey(e,t)})},clipFocusBox:!1}),this.properties=new ay,this.NodeEvent=Qy,this.dataAggregationFilters=void 0}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,r=this.axes[yy.X]?.scale,n=this.axes[yy.Y]?.scale,{xScaleType:o,yScaleType:a}=this.getScaleInformation({xScale:r,yScale:n}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(Ry(this.id,this.processedData)),c&&l.push(Iy());const{dataModel:h,processedData:d}=await this.requestDataModel(e,this.data,{props:[fy(t,o,{id:"xValue"}),my(i,a,{id:"yLowValue"}),my(s,a,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,d),this.animationState.transition("updateData")}aggregateData(e,t){const i=this.axes[yy.X];if(null==i||!Ky.is(i.scale)&&!$y.is(i.scale))return;const s=e.resolveKeysById(this,"xValue",t),r=e.resolveColumnById(this,"yHighValue",t),n=e.resolveColumnById(this,"yLowValue",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i,s){if(e.length<1e3)return;const[r,n]=Fg(s);let o=Og(e);const{indexData:a,valueData:l}=Vg(e,t,i,r,n,o);let c=[],h=[];for(let t=0;t<e.length;t+=1)Yf(e,r,n,a,o,t)&&c.push(t),qf(e,r,n,a,o,t)&&h.push(t);const d=[{maxRange:o,topIndices:c,bottomIndices:h}];for(;o>64;)({maxRange:o}=Hg(a,l,o,{inPlace:!0})),c=c.filter(Yf.bind(null,e,r,n,a,o)),h=h.filter(qf.bind(null,e,r,n,a,o)),d.push({maxRange:o,topIndices:c,bottomIndices:h});return d.reverse(),d}(s,r,n,t.domain.keys[o])}xCoordinateRange(e){const t=this.axes[yy.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[yy.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{domain:{keys:[s]}}=t;if(e===yy.X){const e=i.resolveProcessedDataDefById(this,"xValue");return"key"===e?.def.type&&"category"===e.def.valueType?s:by(Vy(s))}{const e=this.domainForClippedRange(yy.Y,["yHighValue","yLowValue"],"xValue",!0),t=Yy(e);return by(t)}}getSeriesRange(e,t){return this.domainForVisibleRange(yy.Y,["yHighValue","yLowValue"],"xValue",t,!0)}createNodeData(){const{data:e,dataModel:t,processedData:i,axes:s}=this,r=s[yy.X],n=s[yy.Y];if(!(e&&r&&n&&t&&i))return;const o=r.scale,a=n.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:d,marker:u,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],m=(o.bandwidth??0)/2,f=t.resolveKeysById(this,"xValue",i),y=t.resolveColumnById(this,"yHighValue",i),v=t.resolveColumnById(this,"yLowValue",i),C=[],b=[],S=[],w=(e,t,i)=>{const s=g[e],r=f[e];if(null==r)return;const n=S[S.length-1];if(Number.isFinite(t)&&Number.isFinite(i)){const d=(n,o,a)=>{b.push({index:e,series:this,itemId:n,datum:s,datumIndex:e,midPoint:{x:y,y:a},yHighValue:t,yLowValue:i,xValue:r,xKey:l,yLowKey:c,yHighKey:h,point:{x:y,y:a,size:x},enabled:!0});const d=this.createLabelData({datumIndex:e,point:{x:y,y:a},value:o,yLowValue:i,yHighValue:t,itemId:n,inverted:g,datum:s,series:this});C.push(d)},g=i>t,y=(p=e,o.convert(f[p])+m),v=a.convert(t),w=a.convert(i),{size:x}=u;d("high",t,v),d("low",i,w);const E={high:{point:{x:y,y:v},xDatum:r,yDatum:t},low:{point:{x:y,y:w},xDatum:r,yDatum:i}};Array.isArray(n)?n.push(E):null!=n?(n.skip+=1,S.push([E])):S.push([E])}else d||(Array.isArray(n)||null==n?S.push({skip:0}):n.skip+=1);var p},{dataAggregationFilters:x}=this,[E,M]=o.range,A=M-E,T=x?.find(e=>e.maxRange>A),D=T?.topIndices,I=T?.bottomIndices;let[R,P]=this.visibleRange("xValue",r.range,D);R=Math.max(R-1,0),P=Math.min(P+1,D?.length??f.length),i.input.count<1e3&&(R=0,P=i.input.count);for(let e=R;e<P;e+=1){const t=D?.[e]??e,i=I?.[e]??e;w(t,y[t],v[i])}const k=S.flatMap(e=>{if(!Array.isArray(e))return[];const t=e.map(e=>e.high);return _y(t,p)}),L=S.flatMap(e=>{if(!Array.isArray(e))return[];const t=e.map(e=>e.low);return _y(t,p)});return{itemId:`${c}-${h}`,labelData:C,nodeData:b,fillData:{itemId:"high",spans:k,phantomSpans:L},highStrokeData:{itemId:"high",spans:k},lowStrokeData:{itemId:"low",spans:L},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:e,point:t,value:i,itemId:s,inverted:r,datum:n,series:o}){const{xKey:a,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:u,yHighName:p,label:g}=this.properties,{placement:m,padding:f=10}=g;let y=s;r&&(y="low"===s?"high":"low");const v="outside"===m&&"high"===y||"inside"===m&&"low"===y?-1:1;return{x:t.x,y:t.y+f*v,series:o,itemId:s,datum:n,datumIndex:e,text:this.getLabelText(g,{value:i,datum:n,itemId:s,xKey:a,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:p,yName:d}),textAlign:"center",textBaseline:-1===v?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{opacity:t,visible:i}=e,[s,r]=e.paths,n=this.getStrokeWidth(this.properties.strokeWidth);r.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:zy.None,stroke:this.properties.stroke,strokeWidth:n,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i});const o=Xy(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),a=this.getShapeFillBBox();Uy(s,o,a),Zy(s,{stroke:void 0,fill:o,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,strokeWidth:n},void 0,a),s.setProperties({pointerEvents:zy.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:t,visible:i}),Py(this,r),Py(this,s)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const t of e)t.path.clear(),t.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),Ly(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i]=e;i.path.clear(),Ny(i,t.highStrokeData.spans),Ny(i,t.lowStrokeData.spans),i.markDirty("RangeArea")}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,s=e?t.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(e,t,i,s){const{id:r,properties:n}=this,{xKey:o,yHighKey:a,yLowKey:l,marker:c}=n,{itemStyler:h}=c;if(null!=h)return this.cachedDatumCallback(Hy(e,s?"highlight":"node"),()=>this.callWithContext(h,{seriesId:r,datum:t,xKey:o,yHighKey:a,yLowKey:l,highlighted:s,...i}))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yLowKey:r,yHighKey:n,marker:o,fill:a,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:d}=this.properties,u=vy(i&&this.properties.highlightStyle.item,o.getStyle(),{fill:a,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:d}),p=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(o,e,t.datum,t.point,{xKey:s,yHighKey:n,yLowKey:r},i,u,p)}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.pointerEvents=zy.None})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{Cy(e,this.properties.label,t)})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}getHighlightData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}getTooltipContent(e,t){const{id:i,dataModel:s,processedData:r,axes:n,properties:o}=this,{xName:a,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,tooltip:g}=o,m=n[yy.X],f=n[yy.Y];if(!(s&&r&&m&&f))return;const y=r.dataSources.get(this.id)?.[e],v=s.resolveKeysById(this,"xValue",r)[e],C=s.resolveColumnById(this,"yHighValue",r)[e],b=s.resolveColumnById(this,"yLowValue",r)[e];if(null==v)return;const S=this.getMarkerItemBaseStyle(!1);Object.assign(S,this.getMarkerItemStyleOverrides(String(e),e,S,!1));const w=`${f.formatDatum(b)} - ${f.formatDatum(C)}`;return this.formatTooltipWithContext(g,{heading:m.formatDatum(v),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${h??c} - ${p??u}`,value:w}]},{seriesId:i,datum:y,title:l,itemId:t?.itemId??"unknown",xName:a,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,...S})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:r,marker:n}=this.properties;return{marker:qy({shape:n.shape,fill:n.fill??e,stroke:n.stroke??t,fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},n.fillGradientDefaults,n.fillPatternDefaults,n.fillImageDefaults),line:{stroke:t,strokeOpacity:s,strokeWidth:i,lineDash:r}}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{yLowKey:s,yHighKey:r,yName:n,yLowName:o,yHighName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:`${s}-${r}`,seriesId:t,enabled:i,label:{text:`${n??`${o??s} - ${a??r}`}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Wy}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:r}=e,{animationManager:n}=this.ctx;this.updateAreaPaths(r,s),My(this,n,...r),Ay([t],Ey),Ty(this,n,t),Dy(this,"labels",n,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,contextData:r,paths:n,previousContextData:o}=e,[a,l]=n;if(null==a&&null==l)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(n,r)};if(null==r||null==o)return c(),Fy(this,t,"added",i),Oy(this,"fill_path_properties",t,"add",a),Oy(this,"stroke_path_properties",t,"add",l),void Dy(this,"labels",t,s);const h=function(e,t,i){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!cy(e.scales.x)||!cy(t.scales.x))return;let s="updated";t.visible&&!e.visible?s="removed":!t.visible&&e.visible&&(s="added");const r=hy({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},ly.Split);if(null==r)return;const n=hy({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},ly.Split);if(null==n)return;const o=hy({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},ly.Split);if(null==o)return;const a=hy({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},ly.Split);if(null==a)return;const l="fade",c=dy(s,r,n,l),h=function(e,t,i,s){return{status:e,path:{addPhaseFn:(e,s)=>{uy(e,s,t.added),uy(e,s,i.added)},updatePhaseFn:(e,s)=>{uy(e,s,t.moved),uy(e,s,i.moved)},removePhaseFn:(e,s)=>{uy(e,s,t.removed),uy(e,s,i.removed)}},pathProperties:py(e,s)}}(s,o,a,l);return{status:s,fill:c,stroke:h,hasMotion:(i?.changed??!0)||!gy(e.scales.x,t.scales.x)||!gy(e.scales.y,t.scales.y)||"updated"!==s}}(r,o,this.processedData?.reduced?.diff?.[this.id]);if(void 0===h)return t.skipCurrentBatch(),void c();"no-op"!==h.status&&(Gy(this.id,"fill_path_properties",t,[a],h.fill.pathProperties),Gy(this.id,"stroke_path_properties",t,[l],h.stroke.pathProperties),"added"===h.status?this.updateAreaPaths(n,r):"removed"===h.status?this.updateAreaPaths(n,o):(By(this.id,"fill_path_update",t,[a],h.fill.path),By(this.id,"stroke_path_update",t,[l],h.stroke.path)),h.hasMotion&&(Fy(this,t,void 0,i),Dy(this,"labels",t,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(n,r)}))}getFormattedMarkerStyle(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{xKey:t,yLowKey:i,yHighKey:s},!0)}computeFocusBounds(e){const t=ky(this,e),i=ky(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return jy.merge([t,i])}isDatumEnabled(e,t){return t%2==0&&super.isDatumEnabled(e,t)}};Jy.className="RangeAreaSeries",Jy.type="range-area";var{commonSeriesOptionsDefs:ev,rangeAreaSeriesThemeableOptionsDef:tv}=s.n1,iv={...tv,...ev,type:(0,r.mw)((0,r.dY)("range-area")),xKey:(0,r.mw)(r.Yj),yLowKey:(0,r.mw)(r.Yj),yHighKey:(0,r.mw)(r.Yj),xName:r.Yj,yName:r.Yj,yLowName:r.Yj,yHighName:r.Yj};iv.pickOutsideVisibleMinorAxis=(0,r._L)(r.zM),iv.focusPriority=(0,r._L)(r.ai);var sv={series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,size:6,strokeWidth:2},label:{enabled:!1,placement:"outside",padding:10,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"}},axes:{[s.n1.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:rv,CARTESIAN_POSITION:nv}}=s.n1,ov={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:e=>new Jy(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:rv.NUMBER,position:nv.LEFT},{type:rv.CATEGORY,position:nv.BOTTOM}],themeTemplate:sv},av={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:iv,create:e=>new Jy(e)},{AbstractBarSeriesProperties:lv,FillGradientDefaults:cv,FillPatternDefaults:hv,FillImageDefaults:dv,SeriesTooltip:uv,Property:pv,DropShadow:gv,Label:mv}=s.n1,fv=class extends mv{constructor(){super(...arguments),this.placement="inside",this.padding=6}};a([pv],fv.prototype,"placement",2),a([pv],fv.prototype,"padding",2);var yv=class extends lv{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new cv,this.fillPatternDefaults=new hv,this.fillImageDefaults=new dv,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=(new gv).set({enabled:!1}),this.label=new fv,this.tooltip=new uv,this.fastDataProcessing=!1}};a([pv],yv.prototype,"xKey",2),a([pv],yv.prototype,"yLowKey",2),a([pv],yv.prototype,"yHighKey",2),a([pv],yv.prototype,"xName",2),a([pv],yv.prototype,"yName",2),a([pv],yv.prototype,"yLowName",2),a([pv],yv.prototype,"yHighName",2),a([pv],yv.prototype,"fill",2),a([pv],yv.prototype,"fillGradientDefaults",2),a([pv],yv.prototype,"fillPatternDefaults",2),a([pv],yv.prototype,"fillImageDefaults",2),a([pv],yv.prototype,"fillOpacity",2),a([pv],yv.prototype,"stroke",2),a([pv],yv.prototype,"strokeWidth",2),a([pv],yv.prototype,"strokeOpacity",2),a([pv],yv.prototype,"lineDash",2),a([pv],yv.prototype,"lineDashOffset",2),a([pv],yv.prototype,"cornerRadius",2),a([pv],yv.prototype,"itemStyler",2),a([pv],yv.prototype,"shadow",2),a([pv],yv.prototype,"label",2),a([pv],yv.prototype,"tooltip",2),a([pv],yv.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:vv,valueProperty:Cv,keyProperty:bv,ChartAxisDirection:Sv,checkCrisp:wv,updateLabelNode:xv,SMALLEST_KEY_INTERVAL:Ev,LARGEST_KEY_INTERVAL:Mv,diff:Av,prepareBarAnimationFunctions:Tv,midpointStartingBarPosition:Dv,resetBarSelectionsFn:Iv,fixNumericExtent:Rv,seriesLabelFadeInAnimation:Pv,resetLabelFn:kv,animationValidation:Lv,computeBarFocusBounds:Nv,visibleRangeIndices:_v,createDatumId:Ov,ContinuousScale:Fv,DiscreteTimeScale:Gv,Rect:Bv,PointerEvents:Vv,motion:Hv,applyShapeStyle:Uv,findMinMax:zv,getShapeStyle:Wv,areScalingEqual:jv}=s.n1,Kv=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},$v=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[vv.AXIS_ALIGNED,vv.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:Iv,label:kv}}),this.properties=new yv,this.dataAggregationFilters=void 0,this.NodeEvent=Kv}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s,fastDataProcessing:r}=this.properties,n=!r,o=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:a}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(Av(this.id,this.processedData)),d.push(Lv()));const u=this.visible?{}:{forceValue:0},{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[bv(t,c,{id:"xValue"}),Cv(i,h,{id:"yLowValue",invalidValue:null,...u}),Cv(s,h,{id:"yHighValue",invalidValue:null,...u}),...l?[Ev,Mv]:[],...d],groupByKeys:n});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){if("grouped"!==t.type)return;const i=this.axes[Sv.X];if(null==i||!Fv.is(i.scale)&&!Gv.is(i.scale))return;const s=e.resolveKeysById(this,"xValue",t),r=e.resolveColumnById(this,"yHighValue",t),n=e.resolveColumnById(this,"yLowValue",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i,s){if(e.length<1e3)return;const[r,n]=Fg(s);let o=Og(e,5),{indexData:a,valueData:l}=Vg(e,t,i,r,n,o);const c=[{maxRange:o,indexData:a}];for(;o>64;)({indexData:a,valueData:l,maxRange:o}=Hg(a,l,o)),c.push({maxRange:o,indexData:a});return c.reverse(),c}(s,r,n,t.domain.keys[o])}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");return"key"===e?.def.type&&"category"===e?.def.valueType?s:this.padBandExtent(s)}{const t=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue",!0),i=zv(t);return Rv(i)}}getSeriesRange(e,t){return this.domainForVisibleRange(Sv.Y,["yHighValue","yLowValue"],"xValue",t,!0)}createNodeData(){const{data:e,dataModel:t,groupScale:i,processedData:s,visible:r}=this,n=this.getCategoryAxis(),o=this.getValueAxis();if(!(e&&n&&o&&t&&s?.dataSources))return;const a=n.scale,l=o.scale,c=this.getBarDirection()===Sv.X,{xKey:h,yLowKey:d,yHighKey:u,strokeWidth:p}=this.properties,g=`${d}-${u}`,m={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!r)return m;const f=s.dataSources.get(this.id)??[],y=t.resolveKeysById(this,"xValue",s),v=t.resolveColumnById(this,"yLowValue",s),C=t.resolveColumnById(this,"yHighValue",s),{barWidth:b,groupIndex:S}=this.updateGroupScale(n),w=Fv.is(a)?-.5*b:0,x=i.convert(String(S)),E=wv(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),M=e=>Math.round(a.convert(y[e]))+x+w,A=(e,t,i,s,r,n,o)=>{const a=f[e],b=y[e];if(null==b)return;const S=v[e],w=C[e];if(!Number.isFinite(S?.valueOf())||!Number.isFinite(w?.valueOf()))return;const[x,E]=S<w?[S,w]:[w,S],M=Math.round(l.convert(n)),A=Math.round(l.convert(r)),T=Math.max(p,Math.abs(A-M)),D={x:c?Math.min(M,A):i,y:c?i:Math.min(M,A),width:c?T:s,height:c?s:T},I={x:D.x+D.width/2,y:D.y+D.height/2},R=this.createLabelData({datumIndex:e,rect:D,barAlongX:c,yLowValue:x,yHighValue:E,datum:a,series:this}),P={index:t,valueIndex:e,series:this,itemId:g,datum:a,datumIndex:e,xValue:b,yLowValue:S,yHighValue:w,yLowKey:d,yHighKey:u,xKey:h,x:D.x,y:D.y,width:D.width,height:D.height,midPoint:I,crisp:o,labels:R};m.nodeData.push(P),m.labelData.push(...R)},{dataAggregationFilters:T}=this,[D,I]=a.range,R=I-D,P=T?.find(e=>e.maxRange>R);if(null!=P){const{maxRange:e,indexData:t}=P,[i,s]=_v(e,n.range,e=>{const i=4*e,s=t[i+0],r=t[i+1];if(-1!==s)return[M((s+r)/2|0),M(r)+b]});for(let e=i;e<s;e+=1){const i=4*e,s=t[i+0],r=t[i+1],n=t[i+2],o=t[i+3];if(-1===s)continue;const a=(s+r)/2|0;null!=y[a]&&A(a,0,M(a),Math.abs(M(s)-M(r))+b,v[n],C[o],!1)}}else if("ungrouped"===s.type){let[e,t]=_v(f.length,n.range,e=>[M(e),b]);s.input.count<1e3&&(e=0,t=s.input.count);for(let i=e;i<t;i+=1)A(i,0,M(i),b,v[i],C[i],E)}else for(const{datumIndex:e,groupIndex:i}of t.forEachGroupDatum(this,s))A(e,i,M(e),b,v[e],C[e],E);return m}createLabelData({datumIndex:e,rect:t,barAlongX:i,yLowValue:s,yHighValue:r,datum:n,series:o}){const{xKey:a,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p,label:g}=this.properties,m={datum:n,xKey:a,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p},{placement:f,padding:y}=g,v=y*("outside"===f?1:-1),C={datumIndex:e,x:t.x+(i?-v:t.width/2),y:t.y+(i?t.height/2:t.height+v),textAlign:i?"left":"center",textBaseline:i?"middle":"bottom",text:this.getLabelText(g,{itemId:"low",value:s,...m}),itemId:"low",datum:n,series:o},b={datumIndex:e,x:t.x+(i?t.width+v:t.width/2),y:t.y+(i?t.height/2:-v),textAlign:i?"right":"center",textBaseline:i?"middle":"top",text:this.getLabelText(g,{itemId:"high",value:r,...m}),itemId:"high",datum:n,series:o};return"outside"===f&&(C.textAlign=i?"right":"center",C.textBaseline=i?"middle":"top",b.textAlign=i?"left":"center",b.textBaseline=i?"middle":"bottom"),[C,b]}nodeFactory(){return new Bv}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,e=>this.getDatumId(e))}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:r,fillImageDefaults:n}=t,o=e?t.highlightStyle.item:void 0;return Wv({fill:o?.fill??t.fill,fillOpacity:o?.fillOpacity??t.fillOpacity,stroke:o?.stroke??t.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:o?.strokeOpacity??t.strokeOpacity,lineDash:o?.lineDash??t.lineDash??[],lineDashOffset:o?.lineDashOffset??t.lineDashOffset,cornerRadius:i},s,r,n)}getItemStyleOverrides(e,t,i,s){const{id:r,properties:n}=this,{xKey:o,yHighKey:a,yLowKey:l,itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=n;if(null==c)return;const p=this.cachedDatumCallback(Ov(e,s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:r,datum:t,xKey:o,yHighKey:a,yLowKey:l,highlighted:s,...i}));return Wv(p,h,d,u)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getCategoryDirection()===Sv.X,r=this.getItemBaseStyle(i),n=this.getShapeFillBBox();t.each((e,t)=>{const o=this.getItemStyleOverrides(String(t.datumIndex),t.datum,r,i);Uv(e,r,o,n),e.cornerRadius=o?.cornerRadius??r.cornerRadius,e.visible=s?t.width>0:t.height>0,e.crisp=t.crisp})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,e=>{e.pointerEvents=Vv.None})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{xv(e,this.properties.label,t)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{xKey:n,xName:o,yName:a,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u}=r,p=this.getCategoryAxis(),g=this.getValueAxis();if(!(i&&s&&p&&g))return;const m=s.dataSources.get(this.id)?.[e],f=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yHighValue",s)[e],v=i.resolveColumnById(this,"yLowValue",s)[e];if(null==f)return;const C=this.getItemBaseStyle(!1);Object.assign(C,this.getItemStyleOverrides(String(e),m,C,!1));const b=`${g.formatDatum(v)} - ${g.formatDatum(y)}`;return this.formatTooltipWithContext(u,{heading:p.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:a,fallbackLabel:`${h??l} - ${d??c}`,value:b}]},{seriesId:t,datum:m,title:a,xKey:n,xName:o,yName:a,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,...C})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:r,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:Wv({fill:e,stroke:t,fillOpacity:s,strokeOpacity:r,strokeWidth:i,lineDash:n,lineDashOffset:o},a,l,c)}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{yName:s,yLowName:r,yHighName:n,yLowKey:o,yHighKey:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:`${o}-${a}`,seriesId:t,enabled:i,label:{text:`${s??`${r??o} - ${n??a}`}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Tv(Dv(this.isVertical(),"normal"));Hv.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),Pv(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:r,previousContextData:n}=e,o=s.n1.calculateDataDiff(this.id,t,this.getDatumId.bind(this),r,n,this.processedData);this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=null==n?"fade":"normal",l=Tv(Dv(this.isVertical(),a));Hv.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],l,(e,t)=>this.getDatumId(t),o),!o?.changed&&jv(r.groupScale,n?.groupScale)||Pv(this,"labels",this.ctx.animationManager,i)}getDatumId(e){return`${e.xValue}-${e.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return Nv(this,this.contextNodeData?.nodeData[e])}};$v.className="RangeBarSeries",$v.type="range-bar";var{commonSeriesOptionsDefs:Yv,rangeBarSeriesThemeableOptionsDef:qv}=s.n1,Xv={...qv,...Yv,type:(0,r.mw)((0,r.dY)("range-bar")),xKey:(0,r.mw)(r.Yj),yLowKey:(0,r.mw)(r.Yj),yHighKey:(0,r.mw)(r.Yj),xName:r.Yj,yName:r.Yj,yLowName:r.Yj,yHighName:r.Yj};Xv.pickOutsideVisibleMinorAxis=(0,r._L)(r.zM),Xv.fastDataProcessing=(0,r._L)(r.zM),Xv.focusPriority=(0,r._L)(r.ai);var Zv={series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[s.n1.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},Qv={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:e=>new $v(e),tooltipDefaults:{range:"exact"},defaultAxes:s.n1.DIRECTION_SWAP_AXES,themeTemplate:Zv,groupable:!0},Jv={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:Xv,create:e=>new $v(e)},{AbstractBarSeriesProperties:eC,BaseProperties:tC,FillGradientDefaults:iC,FillPatternDefaults:sC,FillImageDefaults:rC,PropertiesArray:nC,SeriesTooltip:oC,Property:aC,DropShadow:lC,Label:cC}=s.n1,hC=class extends tC{};a([aC],hC.prototype,"totalType",2),a([aC],hC.prototype,"index",2),a([aC],hC.prototype,"axisLabel",2);var dC=class extends tC{};a([aC],dC.prototype,"renderer",2);var uC=class extends cC{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};a([aC],uC.prototype,"placement",2),a([aC],uC.prototype,"padding",2);var pC=class extends tC{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new iC,this.fillPatternDefaults=new sC,this.fillImageDefaults=new rC,this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=(new lC).set({enabled:!1}),this.label=new uC,this.tooltip=new dC}};a([aC],pC.prototype,"name",2),a([aC],pC.prototype,"fill",2),a([aC],pC.prototype,"fillGradientDefaults",2),a([aC],pC.prototype,"fillPatternDefaults",2),a([aC],pC.prototype,"fillImageDefaults",2),a([aC],pC.prototype,"stroke",2),a([aC],pC.prototype,"fillOpacity",2),a([aC],pC.prototype,"strokeOpacity",2),a([aC],pC.prototype,"lineDash",2),a([aC],pC.prototype,"lineDashOffset",2),a([aC],pC.prototype,"strokeWidth",2),a([aC],pC.prototype,"cornerRadius",2),a([aC],pC.prototype,"itemStyler",2),a([aC],pC.prototype,"shadow",2),a([aC],pC.prototype,"label",2),a([aC],pC.prototype,"tooltip",2);var gC=class extends tC{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};a([aC],gC.prototype,"enabled",2),a([aC],gC.prototype,"stroke",2),a([aC],gC.prototype,"strokeOpacity",2),a([aC],gC.prototype,"lineDash",2),a([aC],gC.prototype,"lineDashOffset",2),a([aC],gC.prototype,"strokeWidth",2);var mC=class extends tC{constructor(){super(...arguments),this.positive=new pC,this.negative=new pC,this.total=new pC}};a([aC],mC.prototype,"positive",2),a([aC],mC.prototype,"negative",2),a([aC],mC.prototype,"total",2);var fC=class extends eC{constructor(){super(...arguments),this.item=new mC,this.totals=new nC(hC),this.line=new gC,this.tooltip=new oC}};a([aC],fC.prototype,"xKey",2),a([aC],fC.prototype,"yKey",2),a([aC],fC.prototype,"xName",2),a([aC],fC.prototype,"yName",2),a([aC],fC.prototype,"item",2),a([aC],fC.prototype,"totals",2),a([aC],fC.prototype,"line",2),a([aC],fC.prototype,"tooltip",2);var{adjustLabelPlacement:yC,SeriesNodePickMode:vC,fixNumericExtent:CC,valueProperty:bC,keyProperty:SC,accumulativeValueProperty:wC,trailingAccumulatedValueProperty:xC,ChartAxisDirection:EC,createDatumId:MC,checkCrisp:AC,updateLabelNode:TC,prepareBarAnimationFunctions:DC,collapsedStartingBarPosition:IC,resetBarSelectionsFn:RC,seriesLabelFadeInAnimation:PC,resetLabelFn:kC,animationValidation:LC,DEFAULT_CARTESIAN_DIRECTION_KEYS:NC,DEFAULT_CARTESIAN_DIRECTION_NAMES:_C,computeBarFocusBounds:OC,isContinuous:FC,Rect:GC,motion:BC,applyShapeStyle:VC,getShapeStyle:HC}=s.n1,UC=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,directionKeys:NC,directionNames:_C,categoryKey:void 0,pickModes:[vC.NEAREST_NODE,vC.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:RC,label:kC}}),this.properties=new fC,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:r}=this.properties,{data:n=[]}=this;if(!this.visible)return;const o={missingValue:void 0,invalidValue:void 0},a=[],l=r.reduce((e,t)=>{const i=e.get(t.index);return i?i.push(t):e.set(t.index,[t]),e},new Map);n.forEach((e,i)=>{a.push(e),l.get(i)?.forEach(e=>a.push({...e.toJson(),[t]:e.axisLabel}))});const c=[];this.ctx.animationManager.isSkipped()||c.push(LC());const h=this.getCategoryAxis()?.scale,d=this.getValueAxis()?.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:d}),{processedData:m}=await this.requestDataModel(e,a,{props:[SC(t,p,{id:"xValue"}),wC(i,g,{...o,id:"yCurrent"}),wC(i,g,{...o,missingValue:0,id:"yCurrentTotal"}),wC(i,g,{...o,id:"yCurrentPositive",validation:e=>FC(e)&&Number(e)>=0}),wC(i,g,{...o,id:"yCurrentNegative",validation:e=>FC(e)&&Number(e)>=0}),xC(i,g,{...o,id:"yPrevious"}),bC(i,g,{id:"yRaw"}),bC("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:e=>"total"===e||"subtotal"===e}),...u?[s.n1.SMALLEST_KEY_INTERVAL,s.n1.LARGEST_KEY_INTERVAL]:[],...c]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[s],values:r}=t.domain;if(e===this.getCategoryDirection()){const t=i.resolveProcessedDataDefById(this,"xValue");if("key"===t?.def.type&&"category"===t?.def.valueType)return s;const r=e===EC.Y,n=this.getCategoryAxis().isReversed();return this.padBandExtent(s,n!==r)}{const e=r[i.resolveProcessedDataIndexById(this,"yCurrent")],t=[Math.min(0,e[0]),Math.max(0,e[1])];return CC(t)}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),r=this.getValueAxis();if(!(e&&s&&r&&t&&i))return;const{line:n}=this.properties,o=s.scale,a=r.scale,l=this.getBarDirection()===EC.X,c=this.getBandwidth(s)??10,h=s.isReversed(),d=r.isReversed();if("ungrouped"!==i.type)return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!this.visible)return u;const p=[],g=t.resolveKeysById(this,"xValue",i),m=t.resolveColumnById(this,"yRaw",i),f=t.resolveColumnById(this,"totalTypeValue",i),y=t.resolveColumnById(this,"yCurrent",i),v=t.resolveColumnById(this,"yPrevious",i),C=t.resolveColumnById(this,"yCurrentTotal",i),b=AC(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let S=0;const{xKey:w,yKey:x,xName:E,yName:M}=this.properties;(i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=f[t],s=this.isSubtotal(i),r=this.isTotal(i),A=r||s,T=g[t];if(null==T)return;const D=Math.round(o.convert(T)),I=m[t],{cumulativeValue:R,trailingValue:P}=function(e,t,i){return e||t?{cumulativeValue:C[i],trailingValue:t?S:0}:{cumulativeValue:y[i],trailingValue:v[i]}}(r,s,t);A&&(S=R??0);const k=Math.round(a.convert(R)),L=Math.round(a.convert(P)),N=function(e,t,i,s,r){return e?s:t?(s??0)-(r??0):i}(r,s,I,R,P),_=(N??0)>=0,O=this.getSeriesItemType(_,i),{strokeWidth:F,label:G}=this.getItemConfig(O),B=_?k:L,V=_?L:k,H=Math.max(F,Math.abs(V-B)),U={x:l?Math.min(B,V):D,y:l?D:Math.min(B,V),width:l?H:c,height:l?c:H},z={x:U.x+U.width/2,y:U.y+U.height/2},W=A?k:L,j=Math.floor(n.strokeWidth)%2/2,K=h?k:W,$=h?W:k;let Y,q;l?(Y={x:K+j,y:U.y},q={x:$+j,y:U.y+U.height}):(Y={x:U.x,y:K+j},q={x:U.x+U.width,y:$+j});const X={x:h?q.x:Y.x,y:h?q.y:Y.y,x2:h?Y.x:q.x,y2:h?Y.y:q.y,size:0};p.push(X);const Z="subtotal"===O?"total":O,Q=this.getLabelText(G,{itemId:Z,value:N,datum:e,xKey:w,yKey:x,xName:E,yName:M}),J={index:t,series:this,itemId:O,datum:e,datumIndex:t,cumulativeValue:R??0,xValue:T,yValue:N,yKey:x,xKey:w,x:U.x,y:U.y,width:U.width,height:U.height,midPoint:z,crisp:b,label:{text:Q,...yC({isUpward:(N??-1)>=0!==d,isVertical:!l,placement:G.placement,padding:G.padding,rect:U})}};u.nodeData.push(J),u.labelData.push(J)});const A=this.properties.line.enabled;return null!=y&&A&&(u.pointData=p),u}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const s=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),r=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),n=e.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[s]??[],a=i.domain.values[r]??[];o.length>0&&t.add("positive"),a.length>0&&t.add("negative");const l=i?.domain.values[n];l&&l.forEach(e=>{"total"!==e&&"subtotal"!==e||t.add("total")})}isSubtotal(e){return"subtotal"===e}isTotal(e){return"total"===e}nodeFactory(){return new GC}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle(e,t,i,s){const{id:r,properties:n}=this,o=n.item["subtotal"===i?"total":i],a=s?n.highlightStyle.item:void 0,{itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h,fillImageDefaults:d}=o,{xKey:u,yKey:p}=n,g=HC({fill:a?.fill??o.fill,fillOpacity:a?.fillOpacity??o.fillOpacity,stroke:a?.stroke??o.stroke,strokeWidth:a?.strokeWidth??o.strokeWidth,strokeOpacity:a?.strokeOpacity??o.strokeOpacity,lineDash:a?.lineDash??o.lineDash??[],lineDashOffset:a?.lineDashOffset??o.lineDashOffset,cornerRadius:o.cornerRadius},c,h,d);if(null!=l){let n=this.cachedDatumCallback(MC(e,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:r,itemId:i,datum:t,xKey:u,yKey:p,highlighted:s,...g}));n=HC(n,c,h,d),Object.assign(g,n)}return g}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getCategoryDirection()===EC.X,r=this.getShapeFillBBox();t.each((e,t)=>{const n=t.itemId,o=this.getItemStyle(String(t.datumIndex),t.datum,n,i);VC(e,o,void 0,r),e.visible=s?t.width>0:t.height>0,e.crisp=t.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(0===t.length)return i.update([]);const s=t.filter(e=>{const{label:t}=this.getItemConfig(e.itemId);return t.enabled});return i.update(s)}updateLabelNodes(e){e.labelSelection.each((e,t)=>{TC(e,this.getItemConfig(t.itemId).label,t.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{xKey:n,xName:o,yKey:a,yName:l,tooltip:c}=r,h=this.getCategoryAxis(),d=this.getValueAxis();if(!(i&&s&&h&&d))return;const u=s.dataSources.get(this.id)?.[e],p=i.resolveKeysById(this,"xValue",s)[e],g=i.resolveColumnById(this,"yRaw",s)[e],m=i.resolveColumnById(this,"yCurrentTotal",s),f=i.resolveColumnById(this,"totalTypeValue",s);if(null==p)return;const y=f[e],v=(g??0)>=0,C=this.getSeriesItemType(v,y);let b;if(this.isTotal(y))b=m[e];else if(this.isSubtotal(y)){b=m[e];for(let t=e-1;t>=0;t-=1)if(this.isSubtotal(f[t])){b-=m[t];break}}else b=g;const S=this.getItemStyle(String(e),u,C,!1);return this.formatTooltipWithContext(c,{heading:h.formatDatum(p),symbol:this.legendItemSymbol(C),data:[{label:l,fallbackLabel:a,value:d.formatDatum(b)}]},{seriesId:t,datum:u,title:l,itemId:C,xKey:n,xName:o,yKey:a,yName:l,...S})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:s,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=this.getItemConfig(e);return{marker:HC({fill:t,stroke:i,fillOpacity:s,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a},l,c,h)}}getLegendData(e){if("category"!==e)return[];const{id:t,seriesItemTypes:i}=this,s=[],{showInLegend:r}=this.properties;return i.forEach(e=>{const{name:i}=this.getItemConfig(e);var n;s.push({legendType:"category",id:t,itemId:e,seriesId:t,enabled:!0,label:{text:i??(n=e,n.charAt(0).toUpperCase()+n.substring(1))},symbol:this.legendItemSymbol(e),hideInLegend:!r,isFixed:!0})}),s}toggleSeriesItem(){}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s}=e,r=DC(IC(this.isVertical(),this.axes,"normal"));BC.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r),PC(this,"labels",this.ctx.animationManager,i);const{pointData:n}=s;n&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:r}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(e,t)=>e<t:(e,t)=>e>t,l=n?.scale.convert(0),c=t.reduce((e,t)=>(a(t.x,e)&&(e=t.x),e),o?1/0:0),h=(e,t,i,s,r)=>(e-t)/(i-t)*(r-s)+s;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:c,ease:s.n1.Motion.easeOut,collapsable:!1,onUpdate(e){r.clear(!0),t.forEach((t,i)=>{const s=h(e,l,c,l,t.x),n=h(e,l,c,l,t.x2);0!==i&&r.lineTo(s,t.y),r.moveTo(n,t.y2)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:r}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(e,t)=>e>t:(e,t)=>e<t,l=n?.scale.convert(0),c=t.reduce((e,t)=>(a(t.y,e)&&(e=t.y),e),o?0:1/0),h=(e,t,i,s,r)=>(e-t)/(i-t)*(r-s)+s;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:c,ease:s.n1.Motion.easeOut,collapsable:!1,onUpdate(e){r.clear(!0),t.forEach((t,i)=>{const s=h(e,l,c,l,t.y),n=h(e,l,c,l,t.y2);0!==i&&r.lineTo(t.x,s),r.moveTo(t.x2,n)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(0===t.length)return;const[i]=t;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:r}=e;r&&(r.forEach((e,t)=>{0!==t&&s.lineTo(e.x,e.y),s.moveTo(e.x2,e.y2)}),i.checkPathDirty())}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:r,lineDash:n,lineDashOffset:o}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:this.getStrokeWidth(i),strokeOpacity:r,lineDash:n,lineDashOffset:o,lineJoin:"round",pointerEvents:s.n1.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return OC(this,this.contextNodeData?.nodeData[e])}};UC.className="WaterfallSeries",UC.type="waterfall";var{commonSeriesOptionsDefs:zC,waterfallSeriesThemeableOptionsDef:WC}=s.n1,jC={...WC,...zC,type:(0,r.mw)((0,r.dY)("waterfall")),xKey:(0,r.mw)(r.Yj),yKey:(0,r.mw)(r.Yj),xName:r.Yj,yName:r.Yj,totals:(0,r.J$)({totalType:(0,r.mw)((0,r.KC)("total","subtotal")),index:(0,r.mw)(r.Ly),axisLabel:(0,r.mw)(r.Yj)},"a total definition options array")};function KC(e,t){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`./${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${e}.fill`}]},{$isPattern:[{$palette:`${e}.fill`}]},{$isImage:[{$palette:`${e}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${e}.fill`}]}]},[{$mix:[{$palette:`${e}.fill`},"black",.15]},{$mix:[{$palette:`${e}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,stroke:{$palette:`${e}.stroke`},strokeWidth:0,label:{enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end"}}}var $C={series:{item:{positive:KC("altUp",0),negative:KC("altDown",1),total:KC("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},YC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:e=>new UC(e),tooltipDefaults:{range:"exact"},defaultAxes:s.n1.DIRECTION_SWAP_AXES,themeTemplate:$C},qC={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:jC,create:e=>new UC(e)},{NewAreaSeriesModule:XC,NewBarSeriesModule:ZC,NewBubbleSeriesModule:QC,NewHistogramSeriesModule:JC,NewLineSeriesModule:eb,NewScatterSeriesModule:tb,numberFormatValidator:ib,without:sb}=s.n1,rb={width:r.Ly,height:r.Ly,grip:r.zM,fill:r.yW,stroke:r.yW,strokeWidth:r.Ly,cornerRadius:r.Ly},nb=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],ob={enabled:r.zM,height:r.Ly,spacing:r.Ly,cornerRadius:r.ai,mask:{fill:r.yW,fillOpacity:r.CG,stroke:r.yW,strokeWidth:r.Ly},minHandle:rb,maxHandle:rb,miniChart:{enabled:r.zM,padding:{top:r.Ly,bottom:r.Ly},label:{enabled:r.zM,avoidCollisions:r.zM,spacing:r.Ly,format:ib,formatter:r.E2,interval:{minSpacing:r.Ly,maxSpacing:r.Ly,values:r.YO,step:r.ai},...r.LV},series:(0,r.J$)((0,r.is)({area:sb(XC.options,nb),bar:sb(ZC.options,[...nb,"errorBar","label","legendItemName","direction"]),"box-plot":sb(Ng.options,[...nb,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"]),bubble:sb(QC.options,[...nb,"title","label","labelKey","labelName","sizeName"]),candlestick:sb(Xm.options,nb),heatmap:sb(Gf.options,[...nb,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"]),histogram:sb(JC.options,[...nb,"label"]),line:sb(eb.options,[...nb,"errorBar","title","label"]),ohlc:sb($f.options,nb),"range-area":sb(av.options,[...nb,"label","yLowName","yHighName"]),"range-bar":sb(Jv.options,[...nb,"direction","label","yLowName","yHighName"]),scatter:sb(tb.options,[...nb,"errorBar","title","label","labelKey","labelName"]),waterfall:sb(qC.options,[...nb,"direction"])},"miniChart series options"))}},{annotationOptionsDef:ab}=s.n1,lb={type:"plugin",name:"annotations",chartType:"cartesian",options:ab,create:()=>null},cb={type:"plugin",name:"navigator",chartType:"cartesian",options:ob,create:()=>null},hb={type:"plugin",name:"initialState",options:jp,create:()=>null};function db(e,t,i){i||(t=function(e){const t=new Set;for(const i of e)ub(e,i,t,[]);return 0!==t.size&&r.Vy.warnOnce("Some links formed circular references. These will be removed from the output."),0===t.size?e:e.filter(e=>!t.has(e))}(t));const s=new Map;for(const t of e)s.set(t.id,{datum:t,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let n=0;return s.forEach((e,i)=>{n=Math.max(n,pb(s,t,e,i,-1,[])+pb(s,t,e,i,1,[])+1)}),{links:t,nodeGraph:s,maxPathLength:n}}function ub(e,t,i,s){const r=s.indexOf(t);if(-1!==r){for(let e=r;e<s.length;e+=1)i.add(s[e]);return}s.push(t);const{toNode:n}=t;for(const t of e)t.fromNode===n&&ub(e,t,i,s);s.pop()}function pb(e,t,i,s,r,n){if(n.includes(s))return 1/0;let o=-1===r?i.maxPathLengthBefore:i.maxPathLengthAfter;if(-1===o){o=0;const a=-1===r?i.linksBefore:i.linksAfter;for(const i of t){const{fromNode:l,toNode:c}=i,h=-1===r?c.id:l.id,d=-1===r?l.id:c.id,u=s===h?e.get(d):void 0;null!=u&&(a.push({node:u,link:i}),n?.push(s),o=Math.max(o,pb(e,t,u,d,r,n)+1),n?.pop())}-1===r?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{Series:gb,DataController:mb,keyProperty:fb,valueProperty:yb,Selection:vb,Group:Cb,TransformableText:bb}=s.n1,Sb=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:r}=i,n=s.contextNodeData?.nodeData.find(e=>e.datumIndex.type===r.type&&e.datumIndex.index===r.index);this.size=n?.size,this.label=1===n?.type?n?.label:void 0}},wb=class extends gb{constructor(){super(...arguments),this.NodeEvent=Sb,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Cb({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Cb({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new Cb({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new Cb({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new Cb({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new Cb({name:"nodeGroup"})),this.labelSelection=vb.select(this.labelGroup,bb),this.linkSelection=vb.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=vb.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=vb.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=vb.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=vb.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=vb.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(e){this._chartNodes=e,this.nodes===e&&(this.nodeDataRefresh=!0)}async processData(e){const{data:t,nodes:i}=this;if(null==t)return;const{fromKey:s,toKey:r,sizeKey:n,idKey:o,labelKey:a}=this.properties,l=new mb("standalone",e.suppressFieldDotNotation),c=null!=i?l.request(this.id,i,{props:[fb(o,void 0,{id:"idValue",includeProperty:!1}),...null!=a?[yb(a,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=e.request(this.id,t,{props:[yb(s,void 0,{id:"fromValue",includeProperty:!1}),yb(r,void 0,{id:"toValue",includeProperty:!1}),...null!=n?[yb(n,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});null!=i&&l.execute();const[d,u]=await Promise.all([c,h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(null==d){const e=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),t=u.dataModel.resolveColumnById(this,"toValue",u.processedData),i=e=>{const t=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:t},type:1,index:t,linksBefore:[],linksAfter:[],id:e,size:0,label:e}};u.processedData.dataSources.get(this.id)?.forEach((s,r)=>{const n=e[r],o=t[r];null!=n&&null!=o&&(p.has(n)||p.set(n,i(n)),p.has(o)||p.set(o,i(o)))})}else{const e=d.dataModel.resolveColumnById(this,"idValue",d.processedData),t=null!=a?d.dataModel.resolveColumnById(this,"labelValue",d.processedData):void 0;d.processedData.dataSources.get(this.id)?.forEach((i,s)=>{const r=e[s],n=t?.[s];p.set(r,{series:this,itemId:void 0,datum:i,datumIndex:{type:1,index:s},type:1,index:s,linksBefore:[],linksAfter:[],id:r,size:0,label:n})})}this.processedNodes=p}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:r}=this;if(null==s||null==r){const{links:e,nodeGraph:t,maxPathLength:s}=db((new Map).values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:t,links:e,maxPathLength:s}}const{sizeKey:n}=this.properties,o=s.resolveColumnById(this,"fromValue",r),a=s.resolveColumnById(this,"toValue",r),l=null!=n?s.resolveColumnById(this,"sizeValue",r):void 0,c=new Map;this.processedNodes.forEach(t=>{const i=e(t);c.set(t.id,i)});const h=[];r.dataSources.get(this.id)?.forEach((e,i)=>{const s=o[i],r=a[i],n=null!=l?l[i]:1,d=c.get(s),u=c.get(r);if(n<=0||null==d||null==u)return;const p=t({series:this,itemId:void 0,datum:e,datumIndex:{type:0,index:i},type:0,index:i,fromNode:d,toNode:u,size:n});h.push(p)});const{links:d,nodeGraph:u,maxPathLength:p}=db(c.values(),h,i);return u.forEach(e=>{e.datum.linksBefore=e.linksBefore.map(e=>e.link),e.datum.linksAfter=e.linksAfter.map(e=>e.link)}),this.nodeCount=u.size,this.linkCount=d.length,{nodeGraph:u,links:d,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};null!=this._nodeDataDependencies&&this._nodeDataDependencies.seriesRectWidth===i.seriesRectWidth&&this._nodeDataDependencies.seriesRectHeight===i.seriesRectHeight||(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[];let n,o,a,l,c=this.ctx.highlightManager?.getActiveHighlight();if(c?.series===this&&null==c.type){const{itemId:e}=c;c=null!=e?s.find(t=>1===t.type&&t.id===e):void 0}else c?.series!==this&&(c=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=null!=c?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(e=>0===e.type),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(e=>1===e.type),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1}),1===c?.type?(n=s.filter(e=>0===e.type&&(e.toNode===c||e.fromNode===c)),o=n.map(e=>e.fromNode===c?e.toNode:e.fromNode),o.push(c),a=[],l=[c]):0===c?.type?(n=[c],o=[c.fromNode,c.toNode],a=[c],l=[]):(n=[],o=[],a=[],l=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:n,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:o,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:a,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[NaN,NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:r}=this.properties,{fill:n=s[t%s.length],fillOpacity:o=1,stroke:a=r[t%r.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:n,fillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(e){if("category"!==e)return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:e,label:i},s)=>({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:!0,label:{text:i??e},symbol:this.legendItemSymbol(1,s),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i,s=1/0;return this.linkSelection.each((r,n)=>{const o=r.containsPoint(e,t)?0:1/0;o<s&&(s=o,i=n)}),this.nodeSelection.each((r,n)=>{const o=r.distanceSquared(e,t);o<s&&(s=o,i=n)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}getDatumAriaText(e,t){return 0===e.type?this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey}):1===e.type?this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t}):void 0}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,s=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let r=s;if(0!==i||0===t)return;if(0===s?.type){const e=Array.from(this.linkSelection,e=>e.datum),i=e.indexOf(s)+t;if(i>=0&&i<e.length)r=e[i];else if(i>0)r=e[e.length-1];else{const e=Array.from(this.nodeSelection,e=>e.datum);r=e[e.length-1]}}else if(1===s?.type){const e=Array.from(this.nodeSelection,e=>e.datum),i=e.indexOf(s)+t;if(i>=0&&i<e.length)r=e[i];else if(i<0)r=e[0];else{const e=Array.from(this.linkSelection,e=>e.datum);r=e[0]}}if(null==r)return;const n=1===r.type?Array.from(this.nodeSelection).find(e=>e.datum===r):Array.from(this.linkSelection).find(e=>e.datum===r);if(null==n)return;const o=this.computeFocusBounds(n.node);return null!=o?{datum:n.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(n.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}:void 0}getCategoryValue(e){}datumIndexForCategoryValue(e){}},{Path:xb,SceneChangeDetection:Eb}=s.n1;function Mb({radius:e,startAngle:t,endAngle:i,tension:s}){const r=e*Math.cos(t),n=e*Math.sin(t),o=e*Math.cos(i),a=e*Math.sin(i);return{x:[r,r*s,o*s,o],y:[n,n*s,a*s,a]}}var Ab=class extends xb{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,s,r,n,o,a){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(s-t)*h+t,(r-o)*h+o,(n-a)*h+a,o,a)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:r,endAngle1:n,startAngle2:o,endAngle2:a}=this;r>o&&([r,o]=[o,r],[n,a]=[a,n]),e.clear();const l=t+s*Math.cos(r),c=i+s*Math.sin(r);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(a),i+s*Math.sin(a)),e.arc(t,i,s,a,o,!0),this.tensionedCurveTo(t+s*Math.cos(o),i+s*Math.sin(o),t,i,t,i,t+s*Math.cos(n),i+s*Math.sin(n)),e.arc(t,i,s,n,r,!0),e.closePath()}};a([Eb()],Ab.prototype,"centerX",2),a([Eb()],Ab.prototype,"centerY",2),a([Eb()],Ab.prototype,"radius",2),a([Eb()],Ab.prototype,"startAngle1",2),a([Eb()],Ab.prototype,"endAngle1",2),a([Eb()],Ab.prototype,"startAngle2",2),a([Eb()],Ab.prototype,"endAngle2",2),a([Eb()],Ab.prototype,"tension",2);var{FillGradientDefaults:Tb,FillPatternDefaults:Db,FillImageDefaults:Ib,BaseProperties:Rb,SeriesTooltip:Pb,SeriesProperties:kb,Property:Lb,Label:Nb}=s.n1,_b=class extends Nb{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};a([Lb],_b.prototype,"spacing",2),a([Lb],_b.prototype,"maxWidth",2);var Ob=class extends Rb{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};a([Lb],Ob.prototype,"fill",2),a([Lb],Ob.prototype,"fillOpacity",2),a([Lb],Ob.prototype,"stroke",2),a([Lb],Ob.prototype,"strokeOpacity",2),a([Lb],Ob.prototype,"strokeWidth",2),a([Lb],Ob.prototype,"lineDash",2),a([Lb],Ob.prototype,"lineDashOffset",2),a([Lb],Ob.prototype,"tension",2),a([Lb],Ob.prototype,"itemStyler",2);var Fb=class extends Rb{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};a([Lb],Fb.prototype,"spacing",2),a([Lb],Fb.prototype,"width",2),a([Lb],Fb.prototype,"fill",2),a([Lb],Fb.prototype,"fillOpacity",2),a([Lb],Fb.prototype,"stroke",2),a([Lb],Fb.prototype,"strokeOpacity",2),a([Lb],Fb.prototype,"strokeWidth",2),a([Lb],Fb.prototype,"lineDash",2),a([Lb],Fb.prototype,"lineDashOffset",2),a([Lb],Fb.prototype,"itemStyler",2);var Gb=class extends kb{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new Tb,this.fillPatternDefaults=new Db,this.fillImageDefaults=new Ib,this.fills=[],this.strokes=[],this.label=new _b,this.link=new Ob,this.node=new Fb,this.tooltip=new Pb}};a([Lb],Gb.prototype,"fromKey",2),a([Lb],Gb.prototype,"toKey",2),a([Lb],Gb.prototype,"idKey",2),a([Lb],Gb.prototype,"idName",2),a([Lb],Gb.prototype,"labelKey",2),a([Lb],Gb.prototype,"labelName",2),a([Lb],Gb.prototype,"sizeKey",2),a([Lb],Gb.prototype,"sizeName",2),a([Lb],Gb.prototype,"nodes",2),a([Lb],Gb.prototype,"fillGradientDefaults",2),a([Lb],Gb.prototype,"fillPatternDefaults",2),a([Lb],Gb.prototype,"fillImageDefaults",2),a([Lb],Gb.prototype,"fills",2),a([Lb],Gb.prototype,"strokes",2),a([Lb],Gb.prototype,"label",2),a([Lb],Gb.prototype,"link",2),a([Lb],Gb.prototype,"node",2),a([Lb],Gb.prototype,"tooltip",2);var{SeriesNodePickMode:Bb,CachedTextMeasurerPool:Vb,TextWrapper:Hb,TextUtils:Ub,createDatumId:zb,angleBetween:Wb,normalizeAngle360:jb,isBetweenAngles:Kb,Sector:$b,evaluateBezier:Yb,applyShapeStyle:qb,getShapeStyle:Xb,BBox:Zb}=s.n1,Qb=e=>e.startAngle+Wb(e.startAngle,e.endAngle)/2,Jb=class extends wb{constructor(e){super({moduleCtx:e,pickModes:[Bb.NEAREST_NODE,Bb.EXACT_SHAPE_MATCH]}),this.properties=new Gb}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new Ab}nodeFactory(){return new $b}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,label:{spacing:a,maxWidth:l,fontSize:c},node:{width:h,spacing:d}}=this.properties,u=t/2,p=i/2;let g=[];const{nodeGraph:m,links:f}=this.getNodeGraph(e=>({...e,centerX:u,centerY:p,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),e=>({...e,centerX:u,centerY:p,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let y=0;m.forEach(({datum:e,linksBefore:t,linksAfter:i},r)=>{const a=t.reduce((e,{link:t})=>e+t.size,0)+i.reduce((e,{link:t})=>e+t.size,0);if(0===a)m.delete(r);else{e.size=a,y+=e.size;const t=this.getLabelText(this.properties.label,{datum:e.datum,value:e.label,fromKey:s,toKey:n,sizeKey:o,size:e.size});e.label=String(t)}});let v=0;if(this.isLabelEnabled()){const e=this.properties.label.getFont();let t=0;m.forEach(({datum:i})=>{const{id:s,label:r}=i;if(null==r)return;const n=Hb.wrapText(r,{maxWidth:l,font:this.properties.label,textWrap:"never"}),{width:o}=Vb.measureText(n,{font:e,textAlign:"left",textBaseline:"middle"});t=Math.max(o,t),g.push({id:s,text:n,centerX:u,centerY:p,angle:NaN,radius:NaN})}),v=t+a}const C=m.size;let b=Math.min(t,i)/2-h-v,S=d/b;if(0!==v&&(C*S>=1.5*Math.PI||b<=0)&&(g=[],b=Math.min(t,i)/2-h,S=d/b),C*S>=2*Math.PI||b<=0)return void r.Vy.warnOnce("There was insufficient space to display the Chord Series.");const w=b,x=b+h,E=Math.max((2*Math.PI-C*S)/y,0);let M=0;m.forEach(({datum:e})=>{e.innerRadius=w,e.outerRadius=x,e.startAngle=M,e.endAngle=M+e.size*E,M=e.endAngle+S;const t=(e.innerRadius+e.outerRadius)/2,i=Qb(e);e.midPoint={x:e.centerX+t*Math.cos(i),y:e.centerY+t*Math.sin(i)}});const A=[];m.forEach(({datum:e,linksBefore:t,linksAfter:i})=>{const s=Qb(e),r=[...t.map(e=>({link:e.link,distance:Wb(Qb(e.node.datum),s),after:!1})),...i.map(e=>({link:e.link,distance:Wb(Qb(e.node.datum),s),after:!0}))];let n=e.startAngle;r.toSorted((e,t)=>e.distance-t.distance).forEach(({link:e,after:t})=>{const i=e.size*E;t?(e.startAngle1=n,e.endAngle1=n+i):(e.startAngle2=n,e.endAngle2=n+i),n+=e.size*E}),A.push(e)});const{tension:T}=this.properties.link;f.forEach(e=>{e.radius=b;const t=Mb({radius:b,startAngle:e.startAngle1,endAngle:e.endAngle2,tension:T}),i=Mb({radius:b,startAngle:e.startAngle2,endAngle:e.endAngle1,tension:T}),s=Yb(...t.x,.5),r=Yb(...t.y,.5),n=Yb(...i.x,.5),o=Yb(...i.y,.5);e.midPoint={x:e.centerX+(s+n)/2,y:e.centerY+(r+o)/2},A.push(e)}),g.forEach(e=>{const t=m.get(e.id)?.datum;null!=t&&(e.radius=x+a,e.angle=jb(t.startAngle+Wb(t.startAngle,t.endAngle)/2))}),g.sort((e,t)=>e.angle-t.angle);let D=1/0,I=-1/0;return g=g.filter(e=>{const t=Ub.getLineHeight(c),i=Math.atan2(t/2,e.radius),s=e.angle-i,r=e.angle+i;return!Kb(D,s,r)&&!Kb(I,s,r)&&(D=Math.min(s,D),I=Math.max(r,I),!0)}),{itemId:e,nodeData:A,labelData:g}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o}=this.properties.label;t.each((e,{text:t,centerX:a,centerY:l,radius:c,angle:h})=>{e.visible=!0,e.translationX=a+c*Math.cos(h),e.translationY=l+c*Math.sin(h),e.text=t,e.fill=i,e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textBaseline="middle",Math.cos(h)>=0?(e.textAlign="left",e.rotation=h):(e.textAlign="right",e.rotation=h-Math.PI)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>zb([e.type,e.id]))}getBaseNodeStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:r,strokeOpacity:n,lineDash:o,lineDashOffset:a}=t.node,l=e?t.highlightStyle.item:void 0;return Xb({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??r,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??a},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getNodeStyleOverrides(e,t,i,s,r,n,o){const{id:a,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:d}=l.node,u=n.fill??c[i%c.length],p=n.stroke??h[i%h.length];let g;if(o||(g??(g={}),g.fill=u,g.stroke=p),null!=d){const i=this.cachedDatumCallback(zb(e,"node",o?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:l=0,lineDash:c=[],lineDashOffset:h=0}=n;return this.callWithContext(d,{seriesId:a,datum:t,highlighted:o,label:r,size:s,fill:u,fillOpacity:e,stroke:p,strokeOpacity:i,strokeWidth:l,lineDash:c,lineDashOffset:h})});g??(g={}),Object.assign(g,i)}return Xb(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseNodeStyle(i),r=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:n,size:o,label:a}=t,l=this.getNodeStyleOverrides(String(n.index),t.datum,n.index,o,a,s,i);qb(e,s,l,r),e.centerX=t.centerX,e.centerY=t.centerY,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.inset=e.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>zb([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:r,strokeOpacity:n,lineDash:o,lineDashOffset:a,tension:l}=t.link,c=e?t.highlightStyle.item:void 0;return Xb({fill:c?.fill??i,fillOpacity:c?.fillOpacity??s,stroke:c?.stroke??r,strokeOpacity:c?.strokeOpacity??n,strokeWidth:c?.strokeWidth??this.getStrokeWidth(t.link.strokeWidth),lineDash:c?.lineDash??o,lineDashOffset:c?.lineDashOffset??a,tension:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getLinkStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,{fills:a,strokes:l}=o,{itemStyler:c}=o.link,h=s.fill??a[i%a.length],d=s.stroke??l[i%l.length];let u;if(r||(u??(u={}),u.fill=h,u.stroke=d),null!=c){const i=this.cachedDatumCallback(zb(e,"link",r?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:o=0,lineDash:a=[],lineDashOffset:l=0,tension:u}=s;return this.callWithContext(c,{seriesId:n,datum:t,highlighted:r,tension:u,fill:h,fillOpacity:e,stroke:d,strokeOpacity:i,strokeWidth:o,lineDash:a,lineDashOffset:l})});u??(u={}),Object.assign(u,i)}return Xb(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseLinkStyle(i),r=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:n}=t,o=t.fromNode.datumIndex,a=this.getLinkStyleOverrides(String(n.index),t.datum,o.index,s,i);e.centerX=t.centerX,e.centerY=t.centerY,e.radius=t.radius,e.startAngle1=t.startAngle1,e.endAngle1=t.endAngle1,e.startAngle2=t.startAngle2,e.endAngle2=t.endAngle2,qb(e,s,a,r),e.tension=a?.tension??s.tension})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),s=new Zb((e-i)/2,(t-i)/2,e,t);return{series:s,axis:s}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:r}=this,{fromKey:n,toKey:o,sizeKey:a,sizeName:l,tooltip:c}=r,h=this.contextNodeData?.nodeData.find(t=>t.datumIndex.type===e.type&&t.datumIndex.index===e.index);if(null==h)return;const d=0===h.type?h.fromNode.index:h.index,u=0===h.type?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=0===e.type?i?.dataSources.get(this.id)?.[e.index]:s?.dataSources.get(this.id)?.[e.index],g=h.size;let m;if(0===h.type){const t=h.fromNode.datumIndex,i=this.getBaseLinkStyle(!1);Object.assign(i,this.getLinkStyleOverrides(String(e.index),p,t.index,i,!1)),m=i}else{const t=h.label,i=this.getBaseNodeStyle(!1);Object.assign(i,this.getNodeStyleOverrides(String(e.index),p,e.index,g,t,i,!1)),m=i}return this.formatTooltipWithContext(c,{title:u,symbol:this.legendItemSymbol(h.type,d,m),data:null!=a?[{label:l,fallbackLabel:a,value:String(g)}]:[]},{seriesId:t,datum:p,title:u,fromKey:n,toKey:o,sizeKey:a,sizeName:l,size:g,...m})}computeFocusBounds(e){return e}};Jb.className="ChordSeries",Jb.type="chord";var{commonSeriesOptionsDefs:eS,chordSeriesThemeableOptionsDef:tS}=s.n1,iS={...tS,...eS,type:(0,r.mw)((0,r.dY)("chord")),fromKey:(0,r.mw)(r.Yj),toKey:(0,r.mw)(r.Yj),sizeKey:r.Yj,sizeName:r.Yj};iS.fillGradientDefaults=(0,r._L)(r.wi),iS.fillPatternDefaults=(0,r._L)(r.GY),iS.fillImageDefaults=(0,r._L)(r.Zd);var sS={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:e=>new Jb(e),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},rS={type:"series",name:"chord",chartType:"flow-proportion",enterprise:!0,options:iS,create:e=>new Jb(e)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:nS,CARTESIAN_POSITION:oS},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:aS}}=s.n1,lS={$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},[{type:nS.NUMBER,position:oS.LEFT},{type:nS.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"before"]},oS.TOP,oS.BOTTOM]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}}],[{type:nS.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"after"]},oS.RIGHT,oS.LEFT]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}},{type:nS.NUMBER,position:oS.BOTTOM}]]},cS={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,fills:[{$palette:"fill"}],strokes:[{$palette:"stroke"}],fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:aS,xOffset:3,yOffset:3,blur:5}},axes:{[nS.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter:e=>Math.abs(e.value).toFixed(e.fractionDigits??0)}},[nS.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:hS,BBox:dS,Path:uS,SceneChangeDetection:pS}=s.n1,gS=1e-6;function mS([e,t],[i,s]){return Math.abs(e-i)<=gS&&Math.abs(t-s)<=gS}var fS=class extends uS{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:r,y2:n,x3:o,y3:a}=this;return{x:(e+i+r+o)/4,y:(t+s+n+a)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:r,y1:n,x2:o,y2:a,x3:l,y3:c}=this;return Math.min(hS(e,t,i,s,r,n,1/0),hS(e,t,r,n,o,a,1/0),hS(e,t,o,a,l,c,1/0),hS(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:r,y2:n,x3:o,y3:a}=this,l=Math.min(e,i,r,o),c=Math.max(e,i,r,o)-l,h=Math.min(t,s,n,a),d=Math.max(t,s,n,a)-h;return new dS(l,h,c,d)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:r,x2:n,y2:o,x3:a,y3:l}=this,c=[[t,i],[s,r],[n,o],[a,l]];let h,d;e.clear(),c.forEach(t=>{if(null!=h&&mS(h,t)||null!=d&&mS(d,t))return;const[i,s]=t;null==h?e.moveTo(i,s):e.lineTo(i,s),h??(h=t),d=t}),e.closePath()}};a([pS()],fS.prototype,"x0",2),a([pS()],fS.prototype,"y0",2),a([pS()],fS.prototype,"x1",2),a([pS()],fS.prototype,"y1",2),a([pS()],fS.prototype,"x2",2),a([pS()],fS.prototype,"y2",2),a([pS()],fS.prototype,"x3",2),a([pS()],fS.prototype,"y3",2);var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:yS}=s.n1;function vS(e,t,i,s){const{x0:r,y0:n,x1:o,y1:a,x2:l,y2:c,x3:h,y3:d,opacity:u}=e;return i?{x0:(r+h)/2,y0:(n+d)/2,x1:(o+l)/2,y1:(a+c)/2,x2:(o+l)/2,y2:(a+c)/2,x3:(r+h)/2,y3:(n+d)/2,opacity:u}:{x0:(r+o)/2,y0:(n+a)/2,x1:(r+o)/2,y1:(n+a)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function CS(e,t){const{x0:i,y0:s,x1:r,y1:n,x2:o,y2:a,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:s,x1:r,y1:n,x2:o,y2:a,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:bS,SeriesZIndexMap:SS,valueProperty:wS,keyProperty:xS,ChartAxisDirection:ES,updateLabelNode:MS,SMALLEST_KEY_INTERVAL:AS,LARGEST_KEY_INTERVAL:TS,diff:DS,fixNumericExtent:IS,seriesLabelFadeInAnimation:RS,resetMotion:PS,resetLabelFn:kS,animationValidation:LS,computeBarFocusBounds:NS,ContinuousScale:_S,Group:OS,Selection:FS,PointerEvents:GS,motion:BS,checkCrisp:VS,createDatumId:HS,applyShapeStyle:US,getShapeStyle:zS,getShapeFill:WS}=s.n1,jS=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},KS=class extends s.n1.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[bS.AXIS_ALIGNED,bS.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:kS}}),this.NodeEvent=jS,this.connectorNodeGroup=this.contentGroup.appendChild(new OS({name:`${this.id}-series-connectorNodes`,zIndex:SS.BACKGROUND})),this.connectorSelection=FS.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=GS.None}get pickModeAxis(){return"main-category"}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.connectorNodeGroup.zIndex=[SS.BACKGROUND,e],!0)}isVertical(){return!super.isVertical()}connectionFactory(){return new fS}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:r}=this,n=this.getCategoryAxis()?.scale,o=this.getValueAxis()?.scale,{isContinuousX:a,xScaleType:l,yScaleType:c}=this.getScaleInformation({xScale:n,yScale:o}),h=[];this.ctx.animationManager.isSkipped()||(this.processedData&&h.push(DS(this.id,this.processedData)),h.push(LS()));const d=this.visible?{}:{forceValue:0},{processedData:u}=await this.requestDataModel(e,this.data,{props:[xS(t,l,{id:"xValue"}),wS(i,c,{id:"yValue",...d,validation:(e,t,i)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:r,itemId:i}),invalidValue:0}),...a?[AS,TS]:[],...h],groupByKeys:!1});this.smallestDataInterval=u.reduced?.smallestKeyInterval,this.largestDataInterval=u.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:r}}=this;if(!t||!i)return[];const{keys:[n]}=t.domain;if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");return"key"===e?.def.type&&"category"===e?.def.valueType?this.hasData?n.filter((e,t)=>r.getItemEnabled({seriesId:s,itemId:t})):[]:this.padBandExtent(n)}{const t=this.domainForClippedRange(e,["yValue"],"xValue",!0),i=Math.max(...t);return IS([-i,i])}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:s,processedData:r,id:n,ctx:{legendManager:o}}=this,a=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&a&&l&&i&&"ungrouped"===r?.type))return;const c=a.scale,h=l.scale,d=this.getBarDirection()===ES.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),m=`${p}`,f={itemId:m,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},y=this.visible;if(!y)return f;const v=i.resolveKeysById(this,"xValue",r),C=i.resolveColumnById(this,"yValue",r),{barWidth:b,groupIndex:S}=this.updateGroupScale(a),w=_S.is(c)?-.5*b:0,x=VS(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let E;return(r.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=y&&o.getItemEnabled({seriesId:n,itemId:t}),r=v[t];if(null==r)return;const a=Math.round(c.convert(r))+s.convert(String(S))+w,l=C[t],M=Math.round(h.convert(-l)),A=Math.round(h.convert(l)),T=Math.max(g,Math.abs(A-M)),D={x:d?Math.min(A,M):a,y:d?a:Math.min(A,M),width:d?T:b,height:d?b:T},I={x:D.x+D.width/2,y:D.y+D.height/2},R=this.createLabelData({datumIndex:t,rect:D,barAlongX:d,yDatum:l,datum:e,visible:i}),P={index:t,series:this,itemId:m,datum:e,datumIndex:t,xValue:r,yValue:l,xKey:u,yKey:p,x:D.x,y:D.y,width:D.width,height:D.height,midPoint:I,strokeWidth:g,crisp:x,label:R,visible:i};if(f.nodeData.push(P),null!=R&&f.labelData.push(R),null!=E){const e=E.rect,t=E.nodeDatum,i=E.datumIndex;d?f.connectorData.push({datum:t,datumIndex:i,x0:e.x,y0:e.y+e.height,x1:e.x+e.width,y1:e.y+e.height,x2:D.x+D.width,y2:D.y,x3:D.x,y3:D.y,opacity:1}):f.connectorData.push({datum:t,datumIndex:i,x0:e.x+e.width,y0:e.y,x1:D.x,y1:D.y,x2:D.x,y2:D.y+D.height,x3:e.x+e.width,y3:e.y+e.height,opacity:1})}i&&(E={itemId:m,rect:D,nodeDatum:P,datumIndex:t})}),f}updateNodes(e,t,i){super.updateNodes(e,t,i);const{connectorSelection:s}=this,r=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:r}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,e=>this.getDatumId(e))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,e=>this.getDatumId(e.datum))}updateConnectorNodes(e){const{fills:t,strokes:i,fillGradientDefaults:s,fillPatternDefaults:r,fillImageDefaults:n}=this.properties,{fill:o,fillOpacity:a,stroke:l,strokeOpacity:c,strokeWidth:h,lineDash:d,lineDashOffset:u}=this.connectorStyle(),p=this.getShapeFillBBox();e.connectorSelection.each((e,g)=>{const{datumIndex:m}=g;e.setProperties(CS(0,g));const f=WS(o??t[m%t.length],s,r,n);US(e,{fill:f,stroke:l??i[m%i.length],fillOpacity:a,strokeOpacity:c,strokeWidth:h,lineDash:d,lineDashOffset:u},void 0,p)})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,e=>{e.pointerEvents=GS.None})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{MS(e,this.properties.label,t)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{stageKey:n,valueKey:o,tooltip:a}=r,l=this.getCategoryAxis(),c=this.getValueAxis();if(!(i&&s&&l&&c))return;const h=s.dataSources.get(this.id)?.[e],d=i.resolveKeysById(this,"xValue",s)[e],u=i.resolveColumnById(this,"yValue",s)[e];return null!=d?this.formatTooltipWithContext(a,{symbol:this.legendItemSymbol(e),data:[{label:l.formatDatum(d),value:c.formatDatum(u)}]},{seriesId:t,datum:h,title:n,stageKey:n,valueKey:o,...this.tooltipStyle(h,e)}):void 0}resetAllAnimation(e){super.resetAllAnimation(e),PS([this.connectorSelection],CS)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=function(e){const t=e=>null==e;return{fromFn:(i,s,r)=>{let n;"updated"===r&&t(s)?r="removed":"updated"===r&&t(i.previousDatum)&&(r="added"),"added"===r&&i.previousDatum,n="unknown"===r||"added"===r?vS(s,i.previousDatum,e):{x0:i.x0,y0:i.y0,x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,x3:i.x3,y3:i.y3,opacity:i.opacity};const o=yS[r];return{...n,phase:o}},toFn:(i,s,r)=>{let n;return"removed"===r&&i.datum,n="removed"===r||t(s)?vS(s,i.previousDatum,e):CS(0,s),n}}}(this.isVertical());BS.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],i),RS(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),RS(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return HS(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return NS(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:r,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a,fillImageDefaults:l}=this.barStyle(),{fills:c,strokes:h}=this.properties,d=c[e%c.length]??"black",u=h[e%h.length]??"black";return{marker:zS({fill:d,fillOpacity:i,stroke:u,strokeWidth:t,strokeOpacity:s,lineDash:r,lineDashOffset:n},o,a,l)}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:r},visible:n}=this;if(!s||!i||"category"!==e)return[];const{showInLegend:o}=this.properties,a=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((e,i)=>{const s=a[i];if(null!=s)return{legendType:"category",id:t,datum:e,itemId:i,seriesId:t,enabled:n&&r.getItemEnabled({seriesId:t,itemId:i}),label:{text:String(s)},symbol:this.legendItemSymbol(i),skipAnimations:!0,hideInLegend:!o}}).filter(e=>null!=e)}},{FillGradientDefaults:$S,FillPatternDefaults:YS,FillImageDefaults:qS,Label:XS,AbstractBarSeriesProperties:ZS,SeriesTooltip:QS,AxisLabel:JS,Property:ew}=s.n1,tw=class extends XS{constructor(){super(...arguments),this.spacing=0}};a([ew],tw.prototype,"placement",2),a([ew],tw.prototype,"spacing",2);var iw=class extends JS{};a([ew],iw.prototype,"placement",2);var sw=class extends ZS{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new $S,this.fillPatternDefaults=new YS,this.fillImageDefaults=new qS,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new tw,this.stageLabel=new iw,this.tooltip=new QS}};function rw(e,{x:t,y:i,width:s,height:r,opacity:n}){return{x1:t,y1:i,x2:t+s,y2:i+r,opacity:n}}a([ew],sw.prototype,"stageKey",2),a([ew],sw.prototype,"valueKey",2),a([ew],sw.prototype,"fills",2),a([ew],sw.prototype,"fillGradientDefaults",2),a([ew],sw.prototype,"fillPatternDefaults",2),a([ew],sw.prototype,"fillImageDefaults",2),a([ew],sw.prototype,"fillOpacity",2),a([ew],sw.prototype,"strokes",2),a([ew],sw.prototype,"strokeWidth",2),a([ew],sw.prototype,"strokeOpacity",2),a([ew],sw.prototype,"lineDash",2),a([ew],sw.prototype,"lineDashOffset",2),a([ew],sw.prototype,"label",2),a([ew],sw.prototype,"stageLabel",2),a([ew],sw.prototype,"tooltip",2);var{formatValue:nw,Line:ow}=s.n1,aw=class extends KS{constructor(e){super({moduleCtx:e,animationResetFns:{datum:rw}}),this.properties=new sw}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.reduce((i,s,r)=>i+(t.getItemEnabled({seriesId:e,itemId:r})?1:0),0);return null!=i&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}connectorStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:r,fillGradientDefaults:n,fillPatternDefaults:o,fillImageDefaults:a}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:r,fillGradientDefaults:n,fillPatternDefaults:o,fillImageDefaults:a}}nodeFactory(){return new ow}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:r,visible:n}){const{stageKey:o,valueKey:a,label:l}=this.properties,{spacing:c,placement:h}=l;let d,u,p,g;if(i)switch(d=t.x+t.width/2,p="center",h){case"before":u=t.y-c,g="bottom";break;case"after":u=t.y+t.height+c,g="top";break;default:u=t.y+t.height/2,g="middle"}else switch(u=t.y+t.height/2,g="middle",h){case"before":d=t.x-c,p="right";break;case"after":d=t.x+t.width+c,p="left";break;default:d=t.x+t.width/2,p="center"}return{x:d,y:u,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:a,value:s,datum:r,stageKey:o,valueKey:a},e=>nw(e,0)),itemId:a,datum:r,datumIndex:e,series:this,visible:n}}updateDatumNodes(e){const t=e.isHighlight?this.properties.highlightStyle.item:void 0;e.datumSelection.each((e,i)=>{e.setProperties(rw(0,i)),e.stroke=t?.stroke,e.strokeWidth=t?.strokeWidth??0,e.strokeOpacity=t?.strokeOpacity??1,e.lineDash=t?.lineDash,e.lineDashOffset=t?.lineDashOffset??0})}tooltipStyle(e,t){const{fills:i,strokes:s}=this.properties,r=i[t%i.length]??"black",n=s[t%s.length]??"black",{fillOpacity:o,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:r,fillOpacity:o,stroke:n,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:h}}};aw.className="ConeFunnelSeries",aw.type="cone-funnel";var{commonSeriesOptionsDefs:lw,coneFunnelSeriesThemeableOptionsDef:cw}=s.n1,hw={...cw,...lw,type:(0,r.mw)((0,r.dY)("cone-funnel")),stageKey:(0,r.mw)(r.Yj),valueKey:(0,r.mw)(r.Yj)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:dw}}=s.n1,uw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:e=>new aw(e),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:lS,themeTemplate:{series:{direction:"vertical",fills:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},s.n1.SAFE_RANGE2_OPERATION]},strokes:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},s.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[dw.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter:e=>Math.abs(e.value).toFixed(e.fractionDigits??0)}},[dw.CATEGORY]:{line:{enabled:!1}}}}},pw={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:hw,create:e=>new aw(e)},{FillGradientDefaults:gw,FillPatternDefaults:mw,FillImageDefaults:fw,Label:yw,DropShadow:vw,AbstractBarSeriesProperties:Cw,BaseProperties:bw,SeriesTooltip:Sw,AxisLabel:ww,Property:xw}=s.n1,Ew=class extends yw{},Mw=class extends ww{};a([xw],Mw.prototype,"placement",2);var Aw=class extends bw{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([xw],Aw.prototype,"enabled",2),a([xw],Aw.prototype,"fill",2),a([xw],Aw.prototype,"fillOpacity",2),a([xw],Aw.prototype,"stroke",2),a([xw],Aw.prototype,"strokeWidth",2),a([xw],Aw.prototype,"strokeOpacity",2),a([xw],Aw.prototype,"lineDash",2),a([xw],Aw.prototype,"lineDashOffset",2);var Tw=class extends Cw{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new gw,this.fillPatternDefaults=new mw,this.fillImageDefaults=new fw,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Aw,this.shadow=(new vw).set({enabled:!1}),this.label=new Ew,this.stageLabel=new Mw,this.tooltip=new Sw}};a([xw],Tw.prototype,"stageKey",2),a([xw],Tw.prototype,"valueKey",2),a([xw],Tw.prototype,"fills",2),a([xw],Tw.prototype,"fillGradientDefaults",2),a([xw],Tw.prototype,"fillPatternDefaults",2),a([xw],Tw.prototype,"fillImageDefaults",2),a([xw],Tw.prototype,"fillOpacity",2),a([xw],Tw.prototype,"strokes",2),a([xw],Tw.prototype,"strokeWidth",2),a([xw],Tw.prototype,"strokeOpacity",2),a([xw],Tw.prototype,"lineDash",2),a([xw],Tw.prototype,"lineDashOffset",2),a([xw],Tw.prototype,"spacingRatio",2),a([xw],Tw.prototype,"itemStyler",2),a([xw],Tw.prototype,"dropOff",2),a([xw],Tw.prototype,"shadow",2),a([xw],Tw.prototype,"label",2),a([xw],Tw.prototype,"stageLabel",2),a([xw],Tw.prototype,"tooltip",2);var{ChartAxisDirection:Dw,resetBarSelectionsFn:Iw,prepareBarAnimationFunctions:Rw,midpointStartingBarPosition:Pw,createDatumId:kw,formatValue:Lw,Rect:Nw,motion:_w,applyShapeStyle:Ow,getShapeStyle:Fw}=s.n1,Gw=class extends KS{constructor(e){super({moduleCtx:e,animationResetFns:{datum:Iw}}),this.properties=new Tw}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:r,fillGradientDefaults:n,fillPatternDefaults:o,fillImageDefaults:a}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:r,fillGradientDefaults:n,fillPatternDefaults:o,fillImageDefaults:a}}connectorStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:r,lineDash:n,lineDashOffset:o}=this.properties.dropOff;return{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:r,lineDash:n,lineDashOffset:o,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}nodeFactory(){return new Nw}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:r}){const{valueKey:n,stageKey:o,label:a}=this.properties;return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(a,{itemId:o,value:i,datum:s,valueKey:n,stageKey:o},e=>Lw(e,0)),itemId:o,datum:s,datumIndex:e,series:this,visible:r}}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return Fw({fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,{stageKey:a,valueKey:l,fills:c,strokes:h,itemStyler:d}=o,u=s.fill??c[i%c.length]??"black",p=s.stroke??h[i%h.length]??"black",g={};if(r||(g.fill=u,g.stroke=p),null!=d){const i=this.cachedDatumCallback(kw(e,r?"highlight":"node"),()=>{const{fillOpacity:e,strokeOpacity:i,strokeWidth:o,lineDash:c,lineDashOffset:h}=s;return this.callWithContext(d,{seriesId:n,datum:t,highlighted:r,stageKey:a,valueKey:l,fill:u,fillOpacity:e,stroke:p,strokeOpacity:i,strokeWidth:o,lineDash:c,lineDashOffset:h})});Object.assign(g,i)}return Fw(g,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults)}updateDatumNodes(e){const{shadow:t}=this.properties,{datumSelection:i,isHighlight:s}=e,r=this.getCategoryDirection()===Dw.X,n=this.getItemBaseStyle(s),o=this.getShapeFillBBox();i.each((e,i)=>{const{datumIndex:a}=i,l=this.getItemStyleOverrides(String(i.datumIndex),i.datum,a,n,s);Ow(e,n,l,o),e.visible=r?i.width>0:i.height>0,e.crisp=i.crisp,e.fillShadow=t})}tooltipStyle(e,t){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(t),e,t,i,!1)),i}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),s=Rw(Pw(i,"normal"));_w.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],r=Rw(Pw(this.isVertical(),"fade"));_w.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(e,t)=>t.xValue,s)}};Gw.className="FunnelSeries",Gw.type="funnel";var{commonSeriesOptionsDefs:Bw,funnelSeriesThemeableOptionsDef:Vw}=s.n1,Hw={...Vw,...Bw,type:(0,r.mw)((0,r.dY)("funnel")),stageKey:(0,r.mw)(r.Yj),valueKey:(0,r.mw)(r.Yj)},Uw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:e=>new Gw(e),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:lS,themeTemplate:cS},zw={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:Hw,create:e=>new Gw(e)},Ww=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const r=e.nodes();if(0===r.length)this.node?.remove(),this.node=void 0;else{void 0===this.node&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const e=r[0],n=r.toReversed().find(e=>e.datum.datum.value>e.datum.datum.segmentStart)??r[r.length-1];this.node.datum=this.datum=e.datum,s(this.node,e,n)}}},jw={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function Kw(e,t){if(null==e)return"";const{min:i,max:s}=t,r=0!==i?Math.ceil(Math.log10(Math.abs(i))):0,n=0!==s?Math.ceil(Math.log10(Math.abs(s))):0,o=Math.max(2-Math.max(r,n),0);return e.toFixed(o)}function $w(e,t,i,s){if(null!=i.text)return i.text;const r=s??i.value;let n;return null!=i?.formatter&&(n=Yw(t,i.formatter,{seriesId:e,datum:void 0,value:r})),null!=n?String(n):void 0}function Yw(e,t,i){return s.n1.callWithContext(e.chartService,void 0,t,[i])}function qw({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}function Xw(e,t){const i=(0,r.nl)(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function Zw(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(e=>e.data&&e.data.length>0),s=(0,r.qE)(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(0===i.length)return;const{data:n,selection:o}=i[s];if(null==n||0===n.length)return;const a=(0,r.qE)(0,t.datumIndex,n.length-1),l=n[a];for(const e of o)if(e.datum===l)return{bounds:e.node,clipFocusBox:!0,datum:l,datumIndex:a,otherIndex:s}}var{BaseProperties:Qw,Property:Jw}=s.n1,ex=class extends Qw{getSegments(e,t){const{values:i,step:s,count:n}=this,o=Math.min(...e.domain),a=Math.max(...e.domain);let l;if(null!=i){const e=i.filter(e=>e>o&&e<a).sort((e,t)=>e-t);l=[o,...e,a]}else if(null!=s){const e=[];for(let t=o;t<a;t+=s)e.push(t);e.push(a),l=e}else if(null!=n){const e=n+1;l=Array.from({length:e+1},(t,i)=>i/e*(a-o)+o)}else{const t=e.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter(e=>e>o&&e<a);l=null!=t?[o,...t,a]:void 0}return null!=l&&l.length>t&&(r.Vy.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),l=void 0),l??(l=[o,a]),l}};a([Jw],ex.prototype,"values",2),a([Jw],ex.prototype,"step",2),a([Jw],ex.prototype,"count",2);var tx=class extends Qw{constructor(){super(...arguments),this.enabled=!1,this.interval=new ex,this.spacing=0}};a([Jw],tx.prototype,"enabled",2),a([Jw],tx.prototype,"interval",2),a([Jw],tx.prototype,"spacing",2);var{BaseProperties:ix,SeriesTooltip:sx,SeriesProperties:rx,PropertiesArray:nx,Property:ox,Label:ax,AxisLabel:lx}=s.n1,cx=class extends ax{};a([ox],cx.prototype,"spacing",2);var hx=class extends ix{constructor(){super(...arguments),this.value=0,this.label=new cx}};a([ox],hx.prototype,"text",2),a([ox],hx.prototype,"value",2),a([ox],hx.prototype,"shape",2),a([ox],hx.prototype,"placement",2),a([ox],hx.prototype,"spacing",2),a([ox],hx.prototype,"size",2),a([ox],hx.prototype,"rotation",2),a([ox],hx.prototype,"fill",2),a([ox],hx.prototype,"fillOpacity",2),a([ox],hx.prototype,"stroke",2),a([ox],hx.prototype,"strokeWidth",2),a([ox],hx.prototype,"strokeOpacity",2),a([ox],hx.prototype,"lineDash",2),a([ox],hx.prototype,"lineDashOffset",2),a([ox],hx.prototype,"label",2);var dx=class extends ix{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new nx(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([ox],dx.prototype,"enabled",2),a([ox],dx.prototype,"thickness",2),a([ox],dx.prototype,"thicknessRatio",2),a([ox],dx.prototype,"fills",2),a([ox],dx.prototype,"fillMode",2),a([ox],dx.prototype,"fill",2),a([ox],dx.prototype,"fillOpacity",2),a([ox],dx.prototype,"stroke",2),a([ox],dx.prototype,"strokeWidth",2),a([ox],dx.prototype,"strokeOpacity",2),a([ox],dx.prototype,"lineDash",2),a([ox],dx.prototype,"lineDashOffset",2);var ux=class extends ix{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};a([ox],ux.prototype,"values",2),a([ox],ux.prototype,"step",2),a([ox],ux.prototype,"minSpacing",2),a([ox],ux.prototype,"maxSpacing",2);var px=class extends lx{constructor(){super(...arguments),this.placement=void 0}};a([ox],px.prototype,"placement",2);var gx=class extends ix{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new nx(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new ux,this.label=new px}};a([ox],gx.prototype,"min",2),a([ox],gx.prototype,"max",2),a([ox],gx.prototype,"fills",2),a([ox],gx.prototype,"fillMode",2),a([ox],gx.prototype,"fill",2),a([ox],gx.prototype,"fillOpacity",2),a([ox],gx.prototype,"stroke",2),a([ox],gx.prototype,"strokeWidth",2),a([ox],gx.prototype,"strokeOpacity",2),a([ox],gx.prototype,"lineDash",2),a([ox],gx.prototype,"lineDashOffset",2),a([ox],gx.prototype,"defaultFill",2),a([ox],gx.prototype,"interval",2),a([ox],gx.prototype,"label",2);var mx=class extends cf{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};a([ox],mx.prototype,"text",2),a([ox],mx.prototype,"placement",2),a([ox],mx.prototype,"avoidCollisions",2);var fx=class extends rx{constructor(){super(...arguments),this.value=0,this.segmentation=new tx,this.defaultColorRange=[],this.targets=new nx(hx),this.defaultTarget=new hx,this.defaultScale=new gx,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new gx,this.bar=new dx,this.label=new mx,this.tooltip=new sx}};a([ox],fx.prototype,"value",2),a([ox],fx.prototype,"segmentation",2),a([ox],fx.prototype,"defaultColorRange",2),a([ox],fx.prototype,"targets",2),a([ox],fx.prototype,"defaultTarget",2),a([ox],fx.prototype,"defaultScale",2),a([ox],fx.prototype,"direction",2),a([ox],fx.prototype,"thickness",2),a([ox],fx.prototype,"cornerRadius",2),a([ox],fx.prototype,"cornerMode",2),a([ox],fx.prototype,"margin",2),a([ox],fx.prototype,"scale",2),a([ox],fx.prototype,"bar",2),a([ox],fx.prototype,"label",2),a([ox],fx.prototype,"tooltip",2);var{CachedTextMeasurerPool:yx,BBox:vx}=s.n1;function Cx(e){const{x0:t,y0:i,x1:s,y1:r,horizontalInset:n,verticalInset:o}=e;return{x:Math.min(t,s)+n,y:Math.min(i,r)+o,width:Math.max(Math.abs(s-t)-2*n,0),height:Math.max(Math.abs(r-i)-2*o,0)}}function bx(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:r}=e;return null!=t&&null!=i||null!=s&&null!=r}function Sx(e,t){const i=e?"initial":"update";return{node:{fromFn(s,r){const n=s.previousDatum;let{x0:o,y0:a,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p}=n??r;const{horizontalInset:g,verticalInset:m}=r,f=null!=n&&bx(n),y=bx(r);return f&&y||(!f&&y?(({x0:o,y0:a,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p}=r),e&&(t?u=r.clipX0:p=r.clipY0)):f&&!y?(({x0:o,y0:a,x1:l,y1:c}=r),h=void 0,d=void 0,u=void 0,p=void 0):e&&(t?l=o:c=a)),{x0:o,y0:a,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:m,phase:i}},toFn(e,t){const{x0:i,y0:s,x1:r,y1:n,clipX0:o,clipY0:a,clipX1:l,clipY1:c,horizontalInset:h,verticalInset:d}=t;return{x0:i,y0:s,x1:r,y1:n,clipX0:o,clipY0:a,clipX1:l,clipY1:c,horizontalInset:h,verticalInset:d}},applyFn(e,t){e.setProperties(wx(0,t))}}}}function wx(e,t){const{x:i,y:s,width:r,height:n}=Cx(t),o=function(e){if(!bx(e))return;const{x0:t,y0:i,x1:s,y1:r}=e,{x:n,y:o,width:a,height:l}=Cx(e);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=e;null!=c&&null!=h||(c=t,h=s),null!=d&&null!=u||(d=i,u=r);const p=Math.min(c,h),g=Math.min(d,u),m=Math.abs(h-c),f=Math.abs(u-d);return c=Math.max(n,p),d=Math.max(o,g),h=Math.min(n+a,p+m),u=Math.min(o+l,g+f),new vx(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}(t),a=function(e,t){if(null==t)return!0;const i=Cx(e),s=1e-6,r=i.x+s,n=i.y+s,o=i.x+i.width-s,a=i.y+i.height-s,l=t.x,c=t.x+t.width,h=t.y,d=t.y+t.height;return Math.max(r,l)<=Math.min(o,c)&&Math.max(n,h)<=Math.min(a,d)}(t,o);return{x:i,y:s,width:r,height:n,clipBBox:o,visible:a}}var xx={Before:"right",Center:"center",After:"left"},Ex={Before:"top",Center:"middle",After:"bottom"},Mx={Before:-1,Center:-.5,After:0},Ax={Before:0,Center:-.5,After:-1},{fromToMotion:Tx,resetMotion:Dx,SeriesNodePickMode:Ix,StateMachine:Rx,createDatumId:Px,CachedTextMeasurerPool:kx,toRadians:Lx,BBox:Nx,Group:_x,PointerEvents:Ox,Selection:Fx,Rect:Gx,Text:Bx,TransformableText:Vx,Marker:Hx,LinearScale:Ux,AxisTickGenerator:zx,NiceMode:Wx,easing:jx,getColorStops:Kx,findRangeExtent:$x}=s.n1,Yx={before:180,middle:0,after:0},qx={before:90,middle:0,after:-90},Xx=class{constructor(e,t){this.gauge=e,this.ctx=t}get defaultTickMinSpacing(){return 0}get range(){return this.gauge.range}get reverse(){return!1}get scale(){return this.gauge.scale}get label(){return this.gauge.properties.scale.label}get interval(){return this.gauge.properties.scale.interval}formatTick(e,t,i,s,r,n){const{label:o}=this;return this.formatWithContext(e,t,i)??(null!=o.format?n?.(e):void 0)??this.gauge.formatLabel(e)}formatWithContext(e,t,i){let s;return this.label.formatter&&(s=Yw(this.ctx,this.label.formatter,{value:e,index:t,domain:i,boundSeries:void 0})),s}inRange(){return!0}},Zx=class extends s.n1.Series{constructor(e){super({moduleCtx:e,useLabelLayer:!0,pickModes:[Ix.EXACT_SHAPE_MATCH,Ix.NEAREST_NODE]}),this.properties=new fx,this.seriesRect=Nx.NaN,this.gaugeRect=Nx.NaN,this.scale=new Ux,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new _x({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new _x({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new _x({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new _x({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new _x({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new _x({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new _x({name:"tickGroup"})),this.scaleSelection=Fx.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Fx.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Fx.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Fx.select(this.itemTargetLabelGroup,Bx),this.labelSelection=Fx.select(this.itemLabelGroup,Bx),this.highlightTargetSelection=Fx.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Fx.select(this.tickGroup,Vx),this.datumUnion=new Ww,this.axis=new Xx(this,e),this.tickGenerator=new zx(this.axis),this.animationState=new Rx("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=Ox.None,this.tickGroup.pointerEvents=Ox.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return"horizontal"===this.properties.direction}get hasData(){return!0}nodeFactory(){const e=new Gx;return e.crisp=!0,e}markerFactory(){return new Hx}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return Kw(e,this.properties.scale)}createLinearGradient(e,t,i){const{properties:s,horizontal:r}=this,{defaultColorRange:n}=s;return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:Kx(t,n,e.domain,i),rotation:r?90:0}}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:r}=this,{thickness:n}=e,o=$x(r.range);return new Nx(t,i,s?o:n,s?n:o)}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(e=>{const{text:i=t.text,value:s=t.value??0,shape:r=t.shape??"triangle",rotation:n=t.rotation??0,strokeWidth:o=t.strokeWidth??0,placement:a=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0,fill:h=t.fill??"black",fillOpacity:d=t.fillOpacity??1,stroke:u=t.stroke??"black",strokeOpacity:p=t.strokeOpacity??1,lineDash:g=t.lineDash??[0],lineDashOffset:m=t.lineDashOffset??0}=e,{enabled:f=t.label.enabled,color:y=t.label.color??"black",fontStyle:v=t.label.fontStyle??"normal",fontWeight:C=t.label.fontWeight??"normal",fontSize:b=t.label.fontSize,fontFamily:S=t.label.fontFamily,spacing:w=t.label.spacing??0}=e.label;return{text:i,value:s,shape:r,placement:a,spacing:l,size:c,rotation:n,fill:h,fillOpacity:d,stroke:u,strokeWidth:o,strokeOpacity:p,lineDash:g,lineDashOffset:m,label:{enabled:f,color:y,fontStyle:v,fontWeight:C,fontSize:b,fontFamily:S,spacing:w}}})}getTargetPoint(e){const{properties:t,originX:i,originY:s,horizontal:r,scale:n,gaugeRect:o}=this,{thickness:a}=t,{value:l,placement:c,spacing:h,size:d}=e,u=n.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=a+h+d/2;break;default:p=a/2}return{x:i+o.x+(r?u:p),y:s+o.y+(r?p:u)}}getTargetLabel(e){const{size:t,placement:i,label:s}=e,{spacing:r,color:n,fontStyle:o,fontWeight:a,fontSize:l,fontFamily:c}=s,h=t/2+r;let d,u,p=0,g=0;return this.horizontal?(d="center","after"===i?(u="top",g=h):(u="bottom",g=-h)):(u="middle","before"===i?(d="right",p=-h):(d="left",p=h)),{offsetX:p,offsetY:g,fill:n,textAlign:d,textBaseline:u,fontStyle:o,fontWeight:a,fontSize:l,fontFamily:c,lineHeight:void 0}}labelDatum(e,t){const{placement:i,avoidCollisions:s,spacing:r,text:n,color:o,fontSize:a,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:m=e=>this.formatLabel(e.value)}=e;return{placement:i,avoidCollisions:s,spacing:r,text:n,value:t,fill:o,fontSize:a,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:m}}verticalLabelInset(){const{properties:e}=this,{label:t}=e,i=t.text?.split("\n"),s=ef(t,t.fontSize)*(i?.length??1);return t.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,r=s.text?.split("\n"),n=s.getFont(),o=i.interval.values??e.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],a=(r??o?.map(e=>$w(this.id,this.ctx,this.labelDatum(s,e))??"")).reduce((e,t)=>{const{width:i}=kx.measureText(t,{font:n});return Math.max(e,i)},0);return s.spacing+a}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:r}=this,{value:n,segmentation:o,thickness:a,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u}=t;let p,g;s.domain=[d.min,d.max],s.range=i?[0,r.width]:[r.height,0],i?(g=1,p=Math.PI/2):"before"===d.label.placement?(g=1,p=0):(g=-1,p=0);const m=p-Math.PI/2;let f,y,v,C;i?(f=0,y=r.width,v=(r.height-a)/2,C=v+a,"outside-start"===u.placement?f+=this.horizontalLabelInset():"outside-end"===u.placement&&(y-=this.horizontalLabelInset())):(f=(r.width-a)/2,y=f+a,C=0,v=r.height,"outside-start"===u.placement?v-=this.verticalLabelInset():"outside-end"===u.placement&&(C+=this.verticalLabelInset())),this.gaugeRect=new Nx(Math.min(f,y),Math.min(v,C),Math.abs(y-f),Math.abs(C-v)),s.domain=[d.min,d.max],s.range=i?[f,y]:[v,C];const{ticks:b}=this.tickGenerator.generateTicks({domain:s.domain,primaryTickCount:void 0,visibleRange:[0,1],niceMode:Wx.Off,labelX:0,parallelFlipRotation:p,regularFlipRotation:m,sideFlag:g,removeOverflowLabels:!1}).tickData,S=this.getTargets(),w=[],x=[],E=[],M=[],[A,T]=s.range,D=Math.abs(T-A),I=i?s.convert(n):y,R=i?C:s.convert(n),P=o.enabled?o.spacing/2:0,k=i?P:0,L=i?0:P,N=Math.min(h.thickness??Math.round(h.thicknessRatio*a),a),_=-(a-N)/2,O=i?0:_,F=i?_:0,G="item"===c,B=Math.ceil(D);let V=o.enabled?o.interval.getSegments(s,B):void 0;const H=h.fill??this.createLinearGradient(s,h.fills,h.fillMode),U=d.fill??(h.enabled&&0===d.fills.length?d.defaultFill:void 0)??this.createLinearGradient(s,d.fills,d.fillMode);if(null==V&&G){const e={value:n,segmentStart:Math.min(...s.domain),segmentEnd:Math.max(...s.domain)};if(h.enabled){const t=1*Math.min(l,N/2,D/2),s=i?t:0,r=i?0:t;w.push({series:this,itemId:"value",datum:e,datumIndex:{type:0},type:0,x0:0+f-s-O,y0:0+v-r-F,x1:0+I+s+O,y1:0+R+r+F,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:H,horizontalInset:k,verticalInset:L})}const t=1*Math.min(l,a/2,D/2),r=i?t:0,o=i?0:t;M.push({series:this,itemId:"scale",datum:e,datumIndex:{type:0},type:0,x0:0+f-r,y0:0+v-o,x1:0+y+r,y1:0+C+o,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:U,horizontalInset:k,verticalInset:L})}else{V??(V=s.domain);const e=0+f-O,t=0+v-F,r=0+I+O,o=0+R+F;for(let a=0;a<V.length-1;a+=1){const c=V[a+0],d=V[a+1],u={value:n,segmentStart:c,segmentEnd:d},p=0===a,g=a===V.length-2,m=s.convert(c),b=s.convert(d),S=G||p?l:0,x=G||g?l:0,E=i?S:x,A=x,T=i?x:S,D=S;h.enabled&&w.push({series:this,itemId:`value-${a}`,datum:u,datumIndex:{type:0},type:0,x0:0+(i?m:f),y0:0+(i?v:m),x1:0+(i?b:y),y1:0+(i?C:b),clipX0:e,clipY0:t,clipX1:r,clipY1:o,topLeftCornerRadius:E,topRightCornerRadius:A,bottomRightCornerRadius:T,bottomLeftCornerRadius:D,fill:H,horizontalInset:k,verticalInset:L}),M.push({series:this,itemId:`scale-${a}`,datum:u,datumIndex:{type:0},type:0,x0:0+(i?m:f),y0:0+(i?v:m),x1:0+(i?b:y),y1:0+(i?C:b),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:E,topRightCornerRadius:A,bottomRightCornerRadius:T,bottomLeftCornerRadius:D,fill:U,horizontalInset:k,verticalInset:L})}}u.enabled&&E.push(this.labelDatum(u,n));const z=i?Yx:qx;for(let e=0;e<S.length;e+=1){const t=S[e],{value:i,text:s,shape:r,size:n,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=t,p=this.getTargetPoint(t),g=Lx(t.rotation+z[t.placement]);x.push({series:this,itemId:`target-${e}`,midPoint:p,datum:{value:i},datumIndex:{type:1,index:e},type:1,value:i,text:s,x:p.x,y:p.y,shape:r,size:n,rotation:g,fill:o,fillOpacity:a,stroke:l,strokeOpacity:h,strokeWidth:c,lineDash:d,lineDashOffset:u,label:this.getTargetLabel(t)})}return{itemId:e,nodeData:w,tickData:b,targetData:x,labelData:E,scaleData:M}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(null!=e&&e.series===this&&1===e.type)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,targetSelection:s,targetLabelSelection:r,scaleSelection:n,highlightTargetSelection:o,tickSelection:a}=this;this.seriesRect=e??Nx.NaN;const l=this.checkResize(e);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:n}),this.updateScaleNodes({scaleSelection:n}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:r}),this.updateTargetLabelNodes({targetLabelSelection:r}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null!=g?[g]:[],targetSelection:o}),this.updateTargetNodes({targetSelection:o,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:a}),this.updateTickNodes({tickSelection:a}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Px(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:r}=this,{bar:n}=r,{fillOpacity:o,stroke:a,strokeOpacity:l,lineDash:c,lineDashOffset:h}=n,d=this.getStrokeWidth(n.strokeWidth),u=i.animationManager.isSkipped(),p=this.getShapeFillBBox();t.each((e,t)=>{const{topLeftCornerRadius:i,topRightCornerRadius:r,bottomRightCornerRadius:n,bottomLeftCornerRadius:g,fill:m}=t;e.fill=m,e.fillBBox=p,e.fillOpacity=o,e.stroke=a,e.strokeOpacity=l,e.strokeWidth=d,e.lineDash=c,e.lineDashOffset=h,e.topLeftCornerRadius=i,e.topRightCornerRadius=r,e.bottomRightCornerRadius=n,e.bottomLeftCornerRadius=g,e.pointerEvents=this.properties.bar.enabled?s.n1.PointerEvents.All:s.n1.PointerEvents.None,(u||null==e.previousDatum)&&e.setProperties(wx(0,t))}),this.datumUnion.update(t,this.itemGroup,s.n1.Rect,(e,t,i)=>{e.pointerEvents=s.n1.PointerEvents.None,e.clipBBox??(e.clipBBox=new Nx(NaN,NaN,NaN,NaN)),e.x=t.x,e.y=t.y,e.clipBBox.x=t.clipBBox?.x??t.x,e.clipBBox.y=t.clipBBox?.y??t.y,this.horizontal?(e.height=e.clipBBox.height=i.height,e.width=i===t?i.width:i.x+i.width,e.clipBBox.width=e.width-(i.width-(i.clipBBox?.width??i.width)),e.topLeftCornerRadius=t.topLeftCornerRadius,e.bottomLeftCornerRadius=t.bottomLeftCornerRadius,e.topRightCornerRadius=i.topRightCornerRadius,e.bottomRightCornerRadius=i.bottomRightCornerRadius):(e.width=e.clipBBox.width=i.width,e.height=i===t?i.height:i.x+i.height,e.clipBBox.height=e.height-(i.height-(i.clipBBox?.height??i.height)),e.topLeftCornerRadius=t.topLeftCornerRadius,e.topRightCornerRadius=t.topRightCornerRadius,e.bottomLeftCornerRadius=i.bottomLeftCornerRadius,e.bottomRightCornerRadius=i.bottomRightCornerRadius)})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>Px(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{scale:i}=this.properties,{fillOpacity:s,stroke:r,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:l}=i,c=this.getShapeFillBBox();t.each((e,t)=>{const{topLeftCornerRadius:i,topRightCornerRadius:h,bottomRightCornerRadius:d,bottomLeftCornerRadius:u,fill:p}=t;e.fill=p,e.fillBBox=c,e.fillOpacity=s,e.stroke=r,e.strokeOpacity=n,e.strokeWidth=o,e.lineDash=a,e.lineDashOffset=l,e.topLeftCornerRadius=i,e.topRightCornerRadius=h,e.bottomRightCornerRadius=d,e.bottomLeftCornerRadius=u,e.setProperties(wx(0,t))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,e=>e.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e,s=i?this.properties.highlightStyle.item:void 0;t.each((e,t)=>{const{x:i,y:r,shape:n,size:o,rotation:a,fill:l,fillOpacity:c,stroke:h,strokeOpacity:d,strokeWidth:u,lineDash:p,lineDashOffset:g}=t;e.size=o,e.shape="line"===n?qw:n,e.fill=s?.fill??l,e.fillOpacity=s?.fillOpacity??c,e.stroke=s?.stroke??h,e.strokeOpacity=s?.strokeOpacity??d,e.strokeWidth=s?.strokeWidth??u,e.lineDash=s?.lineDash??p,e.lineDashOffset=s?.lineDashOffset??g,e.translationX=i,e.translationY=r,e.rotation=a})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((e,t)=>{const{x:i,y:s,text:r}=t,{offsetX:n,offsetY:o,fill:a,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,textAlign:u,textBaseline:p}=t.label;e.visible=!0,e.x=i+n,e.y=s+o,e.text=r,e.fill=a,e.fontStyle=l,e.fontWeight=c,e.fontSize=h,e.fontFamily=d,e.textAlign=u,e.textBaseline=p})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,e=>e.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:r,color:n,fontFamily:o=s.label.fontFamily,fontSize:a=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=Lx(i.scale.label.rotation??0);let p,g,m,f;this.horizontal?(d??(d="after"),p="center",g="before"===d?"bottom":"top",f=this.originY+t.y+("before"===d?-h:t.height+h)):(d??(d="before"),p="before"===d?"end":"start",g="middle",m=this.originX+t.x+("before"===d?-h:t.width+h)),e.tickSelection.each((e,t)=>{if(!r)return void(e.visible=!1);const i=m??t.translationY,s=f??t.translationY;e.visible=!0,e.text=t.tickLabel,e.fill=n,e.fontFamily=o,e.fontSize=a,e.fontStyle=l,e.fontWeight=c,e.textBaseline=g,e.textAlign=p,e.x=i,e.y=s,e.rotationCenterX=i,e.rotationCenterY=s,e.rotation=u})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,e=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((e,t)=>{e.fill=t.fill,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontFamily=t.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(null==e.text)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:r,gaugeRect:n}=this,{x:o,y:a,width:l,height:c}=n,h=e?.label??this.properties.value;let d;if(i){const e=s.convert(h);d=new Nx(o,a,e-o,c)}else{const e=s.convert(h);d=new Nx(o,e,l,c-e)}const u={seriesRect:r,gaugeRect:n,barRect:d},{margin:p}=this.properties;!function(e,t,i,s,r,n){const{seriesRect:o,gaugeRect:a,barRect:l}=r,{padding:c,horizontal:h}=s;i.each((i,s)=>{const r=$w(e.id,t,s,n?.label);let d,u,p;if("outside-start"===s.placement?h?(d=a.x,u=o.height):(d=o.width,u=o.height-(a.y+a.height)):"outside-end"===s.placement?h?(d=o.width-(a.x+a.width),u=o.height):(d=o.width,u=a.y):s.avoidCollisions&&(d=a.width,u=a.height),null==r)return;if(null!=d&&null!=u){const e=sf(r,s,{padding:c},()=>({width:d,height:u,meta:null}));p=e?.[0]}else{const e={fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,fontFamily:s.fontFamily,lineHeight:s.lineHeight},{width:t,height:i}=yx.measureText(r,{font:e});p={text:r,fontSize:s.fontSize,lineHeight:ef(s,s.fontSize),width:t,height:i}}if(null==p)return void(i.visible=!1);const g=h?a.x:a.y+a.height,m=h?a.x+a.width:a.y,f=h?l.x:l.y+l.height,y=h?l.x+l.width:l.y,v=s.spacing*(h?1:-1);let C,b,S,w;switch(s.placement){case"outside-start":C=-1/0,b=1/0,S=g-v,w="Before";break;case"outside-end":C=-1/0,b=1/0,S=m+v,w="After";break;case"inside-start":C=g,b=y,S=g+v,w="After";break;case"inside-end":C=y,b=m,S=m-v,w="Before";break;case"inside-center":C=g,b=m,S=(g+m)/2,w="Center";break;case"bar-inside":C=f,b=y,S=(f+y)/2,w="Center";break;case"bar-inside-end":C=f,b=y,S=y-v,w="Before";break;case"bar-outside-end":C=y,b=m,S=y+v,w="After";break;case"bar-end":C=-1/0,b=1/0,S=y,w="Center"}const x=h?S:a.x+a.width/2,E=h?a.y+a.height/2:S;let M,A;h?(M=x+Mx[w]*p.width,A=M+p.width):(M=E+Ax[w]*p.height,A=M+p.height);const T=Math.min(M,A)>=Math.min(C,b)&&Math.max(M,A)<=Math.max(C,b);!s.avoidCollisions||T?(i.visible=!0,i.text=p.text,i.fontSize=p.fontSize,i.lineHeight=p.lineHeight,i.textAlign=h?xx[w]:"center",i.textBaseline=h?"middle":Ex[w],i.x=x,i.y=E):i.visible=!1})}(this,this.ctx,t,{padding:p,horizontal:i},u,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Dx([this.datumSelection],wx),this.formatLabelText()}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each((t,r)=>{t.opacity=1,i=t.previousDatum?.value??e.from??r.value,s=r.value}),this.labelsHaveExplicitText());else if(i===s)this.formatLabelText({label:s});else{const r=`${this.id}_labels`;t.animate({id:r,groupId:"label",from:{label:i},to:{label:s},phase:e.phase??"update",ease:jx.easeOut,onUpdate:e=>this.formatLabelText(e)})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Sx(!0,this.horizontal);Tx(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),Tx(this.id,"label",e,[this.labelSelection],jw,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Sx(!1,this.horizontal);Tx(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let r,n;if(0===e.type?(r=i.value,n=i.label.text):({value:r,text:n}=i.targets[e.index]),null!=r)return this.formatTooltipWithContext(s,{data:[{label:n,fallbackLabel:"Value",value:this.formatLabel(r)}]},{seriesId:t,title:void 0,datum:void 0,value:r})}pickNodeClosestDatum(e){return Xw(this,e)}pickFocus(e){return Zw(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}};Zx.className="LinearGaugeSeries",Zx.type="linear-gauge";var Qx={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:e=>new Zx(e),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},s.n1.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",s.n1.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{spacing:11}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4}}},Jx={type:"series",name:"linear-gauge",chartType:"gauge",enterprise:!0,options:s.n1.linearGaugeSeriesOptionsDef,create:e=>new Zx(e)},eE={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1}};function tE(e,t,i,s){const[r,n]=e,[o,a]=t,l=o-r,c=a-n,h=l*l+c*c;let d,u;if(Math.abs(h)<1e-9)d=r,u=n;else{let e=((i-r)*l+(s-n)*c)/h;e=Math.max(0,Math.min(1,e)),d=r+e*(o-r),u=n+e*(a-n)}const p=i-d,g=s-u;return p*p+g*g}function iE(e,t,i){let s=1/0,r=e[e.length-1];for(const n of e)s=Math.min(s,tE(r,n,t,i)),r=n;return Math.sqrt(s)}function sE(e){let[t,i]=e[0],s=0;for(let r=1;r<e.length;r+=1){const[n,o]=e[r];s+=Math.hypot(n-t,o-i),t=n,i=o}return s}function rE(e){if(0===e.length)return;const t=sE(e)/2;let[i,s]=e[0],r=0;for(let n=1;n<e.length;n+=1){const[o,a]=e[n],l=Math.hypot(o-i,a-s),c=r+l;if(c>t){const e=(t-r)/l;return{point:[i+(o-i)*e,s+(a-s)*e],angle:Math.atan2(a-s,o-i)}}r=c,i=o,s=a}}var{LonLatBBox:nE}=s.n1;function oE(e,t,i,s,r){return null==e?e=new nE(t,i,s,r):(e.lon0=Math.min(e.lon0,t),e.lat0=Math.min(e.lat0,i),e.lon1=Math.max(e.lon1,s),e.lat1=Math.max(e.lat1,r)),e}function aE(e,t){return e.forEach(e=>{const[i,s]=e;t=oE(t,i,s,i,s)}),t}function lE(e,t,i){let s=!1,r=1/0;for(const n of e){let e=n[n.length-1],[o,a]=e;for(const l of n){const[n,c]=l;c>i!=a>i&&t<(o-n)*(i-c)/(a-c)+n&&(s=!s),r=Math.min(r,tE(e,l,t,i)),e=l,o=n,a=c}}return(s?-1:1)*Math.sqrt(r)}var{Path:cE,ExtendedPath2D:hE,BBox:dE,SceneChangeDetection:uE,SceneObjectChangeDetection:pE,objectsEqual:gE}=s.n1,mE=class extends cE{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new hE}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=null!=e?this.drawGeometry(e,void 0):void 0}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return null!=i&&!!this.getBBox().containsPoint(e,t)&&this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(null==i)return 1/0;const s=this.geometryDistance(i,e,t);return s>0?s*s:0}geometryDistance(e,t,i){const{renderMode:s,strokeWidth:r}=this,n=!!(1&s),o=!!(2&s),a=Math.max(r/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((e,s)=>Math.min(e,this.geometryDistance(s,t,i)),1/0);case"MultiPolygon":return n?e.coordinates.reduce((e,s)=>Math.min(e,Math.max(lE(s,t,i),0)),1/0):1/0;case"Polygon":return n?Math.max(lE(e.coordinates,t,i),0):1/0;case"MultiLineString":return o?e.coordinates.reduce((e,s)=>Math.min(e,Math.max(iE(s,t,i)-a,0)),1/0):1/0;case"LineString":return o?Math.max(iE(e.coordinates,t,i)-a,0):1/0;default:return 1/0}}drawGeometry(e,t){const{renderMode:i,path:s,strokePath:r}=this,n=!!(1&i),o=!!(2&i);switch(e.type){case"GeometryCollection":e.geometries.forEach(e=>{t=this.drawGeometry(e,t)});break;case"MultiPolygon":n&&e.coordinates.forEach(e=>{t=this.drawPolygon(s,e,t)});break;case"Polygon":n&&(t=this.drawPolygon(s,e.coordinates,t));break;case"LineString":o&&(t=this.drawLineString(r,e.coordinates,t,!1));break;case"MultiLineString":o&&e.coordinates.forEach(e=>{t=this.drawLineString(r,e,t,!1)})}return t}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let i=1;i<t.length;i+=1){const s=t[i];this.drawLineString(e,s,void 0,!0)}return i}drawLineString(e,t,i,s){if(t.length<2)return i;const r=s?t.length-1:t.length;for(let s=0;s<r;s+=1){const[r,n]=t[s];if(0===s?e.moveTo(r,n):e.lineTo(r,n),null==i)i=new dE(r,n,0,0);else{const{x:e,y:t}=i,s=e+i.width,o=t+i.height;i.x=Math.min(e,r),i.y=Math.min(t,n),i.width=Math.max(s,r)-i.x,i.height=Math.max(o,n)-i.y}}return s&&e.closePath(),i}};function fE(e,t){if(null!=e.bbox){const[i,s,r,n]=e.bbox;return t=oE(t,i,s,r,n)}switch(e.type){case"GeometryCollection":e.geometries.forEach(e=>{t=fE(e,t)});break;case"MultiPolygon":e.coordinates.forEach(e=>{e.length>0&&(t=aE(e[0],t))});break;case"Polygon":e.coordinates.length>0&&(t=aE(e.coordinates[0],t));break;case"MultiLineString":e.coordinates.forEach(e=>{t=aE(e,t)});break;case"LineString":t=aE(e.coordinates,t);break;case"MultiPoint":e.coordinates.forEach(e=>{const[i,s]=e;t=oE(t,i,s,i,s)});break;case"Point":{const[i,s]=e.coordinates;t=oE(t,i,s,i,s);break}}return t}function yE(e){switch(e.type){case"GeometryCollection":{let t,i;return e.geometries.forEach(e=>{const s=yE(e);if(null==s)return;const r=aE(s[0],void 0);if(null==r)return;const n=Math.abs(r.lat1-r.lat0)*Math.abs(r.lon1-r.lon0);(null==t||n>t)&&(t=n,i=s)}),i}case"MultiPolygon":{let t,i;return e.coordinates.forEach(e=>{const s=aE(e[0],void 0);if(null==s)return;const r=Math.abs(s.lat1-s.lat0)*Math.abs(s.lon1-s.lon0);(null==t||r>t)&&(t=r,i=e)}),i}case"Polygon":return e.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function vE(e){switch(e.type){case"GeometryCollection":{let t,i;return e.geometries.forEach(e=>{const s=vE(e);if(null==s)return;const r=sE(s);null!=r&&(null==t||r>t)&&(t=r,i=s)}),i}case"MultiLineString":{let t,i=0;return e.coordinates.forEach(e=>{const s=sE(e);s>i&&(i=s,t=e)}),t}case"LineString":return e.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function CE(e,t){if(null==e)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(e=>CE(e,t));case"MultiPolygon":case"Polygon":return!!(1&t);case"MultiLineString":case"LineString":return!!(2&t);case"MultiPoint":case"Point":return!!(4&t)}}function bE(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(e=>bE(e,t))};case"Polygon":return{type:"Polygon",coordinates:wE(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:SE(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:wE(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:xE(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:xE(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function SE(e,t){return e.map(e=>wE(e,t))}function wE(e,t){return e.map(e=>xE(e,t))}function xE(e,t){return e.map(e=>t.convert(e))}function EE(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(void 0!==i)for(const t of e.datumSelection.nodes())if(t.datum===i)return t}a([pE({equals:gE})],mE.prototype,"projectedGeometry",2),a([uE()],mE.prototype,"renderMode",2),s.n1.SeriesProperties;var ME=class extends s.n1.DataModelSeries{addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>{this.onLegendItemClick(e)}),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>{this.onLegendItemDoubleClick(e)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}},{Property:AE,SeriesProperties:TE,SeriesTooltip:DE,Label:IE}=s.n1,RE=class extends TE{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new IE,this.tooltip=new DE}};a([AE],RE.prototype,"topology",2),a([AE],RE.prototype,"title",2),a([AE],RE.prototype,"legendItemName",2),a([AE],RE.prototype,"idKey",2),a([AE],RE.prototype,"topologyIdKey",2),a([AE],RE.prototype,"idName",2),a([AE],RE.prototype,"labelKey",2),a([AE],RE.prototype,"labelName",2),a([AE],RE.prototype,"sizeKey",2),a([AE],RE.prototype,"sizeName",2),a([AE],RE.prototype,"colorKey",2),a([AE],RE.prototype,"colorName",2),a([AE],RE.prototype,"sizeDomain",2),a([AE],RE.prototype,"colorRange",2),a([AE],RE.prototype,"maxStrokeWidth",2),a([AE],RE.prototype,"stroke",2),a([AE],RE.prototype,"strokeOpacity",2),a([AE],RE.prototype,"strokeWidth",2),a([AE],RE.prototype,"lineDash",2),a([AE],RE.prototype,"lineDashOffset",2),a([AE],RE.prototype,"itemStyler",2),a([AE],RE.prototype,"label",2),a([AE],RE.prototype,"tooltip",2);var{getMissCount:PE,createDatumId:kE,SeriesNodePickMode:LE,valueProperty:NE,CachedTextMeasurerPool:_E,ColorScale:OE,LinearScale:FE,Selection:GE,Text:BE,Transformable:VE}=s.n1,HE=class extends ME{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[LE.EXACT_SHAPE_MATCH,LE.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new RE,this._chartTopology=void 0,this.colorScale=new OE,this.sizeScale=new FE,this.datumSelection=GE.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=GE.select(this.labelGroup,BE),this.highlightDatumSelection=GE.select(this.highlightNode,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0)}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const e=new mE;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(null==this.data)return;const{data:t,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,sizeKey:l,colorKey:c,labelKey:h,sizeDomain:d,colorRange:u}=this.properties,p=new Map;i?.features.forEach(e=>{const t=e.properties?.[o];null!=t&&CE(e.geometry,2)&&p.set(t,e)});const g=this.sizeScale.type,m=this.colorScale.type,f=this.scale?.type,{dataModel:y,processedData:v}=await this.requestDataModel(e,t,{props:[NE(a,f,{id:"idValue",includeProperty:!1}),NE(a,f,{id:"featureValue",includeProperty:!1,processor:()=>e=>p.get(e)}),...null!=h?[NE(h,"band",{id:"labelValue"})]:[],...null!=l?[NE(l,g,{id:"sizeValue"})]:[],...null!=c?[NE(c,m,{id:"colorValue"})]:[]]}),C=y.resolveColumnById(this,"featureValue",v);if(this.topologyBounds=C.reduce((e,t)=>{const i=t?.geometry;return null==i?e:fE(i,e)},void 0),null!=l){const e=y.resolveProcessedDataIndexById(this,"sizeValue"),t=v.domain.values[e]??[];s.domain=d??t}if(null!=u&&this.isColorScaleValid()){const e=y.resolveProcessedDataIndexById(this,"colorValue");n.domain=v.domain.values[e],n.range=u,n.update()}null==i&&r.Vy.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.input.count,n=PE(this,i.defs.values[s].missing);return!(0===r||r===n)}getLabelDatum(e,t,i,s){if(null==t||null==i)return;const r=vE(i);if(null==r)return;const{idKey:n,idName:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u,label:p}=this.properties,g=this.getLabelText(p,{value:t,datum:e,idKey:n,idName:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u});if(null==g)return;const m=_E.measureText(String(g),{font:s}),f=rE(r);if(null==f)return;const[y,v]=f.point,{width:C,height:b}=m;return{point:{x:y,y:v,size:0},label:{width:C,height:b,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,sizeKey:l,colorKey:c,labelKey:h,label:d}=n;if(null==t||null==i)return;const u=t.resolveColumnById(this,"idValue",i),p=t.resolveColumnById(this,"featureValue",i),g=null!=h?t.resolveColumnById(this,"labelValue",i):void 0,m=null!=l?t.resolveColumnById(this,"sizeValue",i):void 0,f=null!=c?t.resolveColumnById(this,"colorValue",i):void 0,y=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,y),y];const v=d.getFont(),C=new Map;i.dataSources.get(this.id)?.forEach((e,t)=>{const i=u[t],s=p[t]?.geometry??void 0,r=null!=s&&null!=o?bE(s,o):void 0;null!=i&&null!=r&&C.set(i,r)});const b=[],S=[],w=[];if((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=u[t],s=f?.[t],r=m?.[t],n=g?.[t],o=C.get(i);null==o&&w.push(i);const l=this.getLabelDatum(e,n,o,v);null!=l&&S.push(l),b.push({series:this,itemId:a,datum:e,datumIndex:t,idValue:i,labelValue:n,colorValue:s,sizeValue:r,projectedGeometry:o})}),w.length>10){const e=w.length-10;w.length=10,w.push(`(+${e} more)`)}return w.length>0&&r.Vy.warnOnce("some data items do not have matches in the provided topology",w),{itemId:e,nodeData:b,labelData:S}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let i=this.ctx.highlightManager?.getActiveHighlight();null==i||i.series===this&&null!=i.datum||(i=void 0);const s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=i?[i]:[],datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>kE(e.idValue))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset}}getItemStyleOverrides(e,t,i,s,r,n){const{id:o,properties:a,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:d}=a;let u;if(n||null==i||(u??(u={}),u.stroke=this.isColorScaleValid()?l.convert(i):h?.[0]??a.stroke),null!=s&&(u??(u={}),u.strokeWidth=c.convert(s,{clamp:!0})),null!=d){const i=this.cachedDatumCallback(kE(e,n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:t,highlighted:n,...r,...u}));u??(u={}),Object.assign(u,i)}return u}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getItemBaseStyle(i);t.each((e,t)=>{const{datum:r,datumIndex:n,colorValue:o,sizeValue:a,projectedGeometry:l}=t;if(null==l)return e.visible=!1,void(e.projectedGeometry=void 0);const c=this.getItemStyleOverrides(String(n),r,o,a,s,i);e.visible=!0,e.projectedGeometry=l,e.stroke=c?.stroke??s.stroke,e.strokeWidth=c?.strokeWidth??s.strokeWidth,e.strokeOpacity=c?.strokeOpacity??s.strokeOpacity,e.lineDash=c?.lineDash??s.lineDash,e.lineDashOffset=c?.lineDashOffset??s.lineDashOffset})}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,e=>{e.pointerEvents=s.n1.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o}=this.properties.label;t.each((e,{x:t,y:a,width:l,height:c,text:h})=>{e.visible=!0,e.x=t+l/2,e.y=a+c/2,e.text=h,e.fill=i,e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textAlign="center",e.textBaseline="middle"})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i,s=1/0;return this.datumSelection.each((r,n)=>{const o=r.distanceSquared(e,t);o<s&&(s=o,i=n)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=null!=i?vE(i):void 0,r=null!=s?rE(s)?.point:void 0,n=null!=r?{x:r[0],y:r[1]}:void 0;return this._previousDatumMidPoint={datum:e,point:n},n}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{strokeWidth:r,strokeOpacity:n,lineDash:o}=s;let{stroke:a}=s;if(null!=e&&this.isColorScaleValid()){const s=t.resolveColumnById(this,"colorValue",i)[e];a=this.colorScale.convert(s)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{stroke:a,strokeWidth:r,strokeOpacity:n,lineDash:o}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:s,visible:r}=this,{title:n,legendItemName:o,idKey:a,idName:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;return"gradient"===e&&null!=c&&null!=d?[{legendType:"gradient",enabled:r,seriesId:s,colorName:h,colorRange:d,colorDomain:t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===e?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:r,label:{text:o??n??l??a},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!u}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{idKey:n,idName:o,colorKey:a,colorName:l,sizeKey:c,sizeName:h,labelKey:d,labelName:u,title:p,legendItemName:g,tooltip:m}=r;if(!i||!s)return;const f=s.dataSources.get(this.id)?.[e],y=i.resolveColumnById(this,"idValue",s),v=[],C=null!=c?i.resolveColumnById(this,"sizeValue",s)[e]:void 0,b=null!=a?i.resolveColumnById(this,"colorValue",s)[e]:void 0;if(null!=c&&v.push({label:h,fallbackLabel:c,value:String(C)}),null!=a&&v.push({label:l,fallbackLabel:a,value:String(b)}),null!=d&&d!==n){const t=i.resolveColumnById(this,"labelValue",s)[e];v.push({label:u,fallbackLabel:d,value:t})}const S=this.getItemBaseStyle(!1);return Object.assign(S,this.getItemStyleOverrides(String(e),e,b,C,S,!1)),this.formatTooltipWithContext(m,{heading:y[e],title:p??g,symbol:this.legendItemSymbol(e),data:v},{seriesId:t,datum:f,title:p,idKey:n,idName:o,colorKey:a,colorName:l,sizeKey:c,sizeName:h,labelKey:d,labelName:u,...S})}computeFocusBounds(e){const t=EE(this,e);return t?VE.toCanvas(this.contentGroup,t.getBBox()):void 0}};HE.className="MapLineSeries",HE.type="map-line";var{commonSeriesOptionsDefs:UE,mapLineSeriesThemeableOptionsDef:zE,without:WE}=s.n1,jE={...zE,...WE(UE,["highlightStyle"]),type:(0,r.mw)((0,r.dY)("map-line")),idKey:(0,r.mw)(r.Yj),sizeKey:r.Yj,colorKey:r.Yj,labelKey:r.Yj,idName:r.Yj,sizeName:r.Yj,colorName:r.Yj,labelName:r.Yj,topology:r.eW,topologyIdKey:r.Yj,legendItemName:r.Yj,title:r.Yj};jE.colorRange=(0,r._L)((0,r.Uo)((0,r.jk)(r.yW),(0,r.O9)(1)));var KE={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line",moduleFactory:e=>new HE(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{stroke:s.n1.SAFE_STROKE_FILL_OPERATION,colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},$E={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:jE,create:e=>new HE(e)},{Property:YE,SeriesProperties:qE,SeriesTooltip:XE}=s.n1,ZE=class extends qE{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new XE}};a([YE],ZE.prototype,"topology",2),a([YE],ZE.prototype,"stroke",2),a([YE],ZE.prototype,"strokeOpacity",2),a([YE],ZE.prototype,"strokeWidth",2),a([YE],ZE.prototype,"lineDash",2),a([YE],ZE.prototype,"lineDashOffset",2),a([YE],ZE.prototype,"tooltip",2);var{createDatumId:QE,SeriesNodePickMode:JE,Group:eM,Selection:tM,PointerEvents:iM}=s.n1,sM=class extends ME{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[JE.EXACT_SHAPE_MATCH]}),this.properties=new ZE,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new eM({name:"itemGroup"})),this.datumSelection=tM.select(this.itemGroup,()=>this.nodeFactory())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0)}nodeFactory(){const e=new mE;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=iM.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((e,t)=>{const i=t.geometry;return null==i?e:fE(i,e)},void 0),null==e&&r.Vy.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i}=this;if(null==t)return;const s=[];return t.features.forEach((e,t)=>{const{geometry:r}=e,n=null!=r&&null!=i?bE(r,i):void 0;null!=n&&s.push({series:this,itemId:t,datum:e,datumIndex:0,index:t,projectedGeometry:n})}),{itemId:e,nodeData:s,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>QE(e.index))}updateDatumNodes(e){const{properties:t}=this,{datumSelection:i}=e,{stroke:s,strokeOpacity:r,lineDash:n,lineDashOffset:o}=t,a=this.getStrokeWidth(t.strokeWidth);i.each((e,t)=>{const{projectedGeometry:i}=t;if(null==i)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=i,e.stroke=s,e.strokeWidth=a,e.strokeOpacity=r,e.lineDash=n,e.lineDashOffset=o})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}};sM.className="MapLineBackgroundSeries",sM.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:rM}=s.n1,nM={...rM,type:(0,r.mw)((0,r.dY)("map-line-background")),topology:r.eW},oM={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:e=>new sM(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{stroke:{$path:["./1",{$palette:"stroke"},{$palette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},aM={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:nM,create:e=>new sM(e)},lM=(e,t,i)=>{let s=e,r=s;for(const e of t)if(null==s||i(s.value,e)>0)s={value:e,next:s},r=s;else{for(;null!=r.next&&i(r.next.value,e)<=0;)r=r.next;r.next={value:e,next:r.next}}return s};function cM(e,t,i){const s=aE(e[0],void 0);if(null==s)return;const r=(s.lon0+s.lon1)/2,n=(s.lat0+s.lat1)/2,o=Math.abs(s.lon1-s.lon0),a=Math.abs(s.lat1-s.lat0),l=function(e){if(0===e.length)return;let t=0,i=0,s=0,[r,n]=e[e.length-1];for(const[o,a]of e){const e=r*a-o*n;s+=e,t+=(r+o)*e,i+=(n+a)*e,r=o,n=a}return s*=3,[t/s,i/s]}(e[0]),[c,h]=l,d=-lE(e,c,h);let u;const p=(e,t)=>e-.5*Math.max(t-d,0),g=(t,s,r)=>{const{distance:n,maxDistance:o}=i(e,t,s,r),a=Math.hypot(c-t,h-s),l=Math.min(Math.max(c,t-r/2),t+r/2),d=Math.min(Math.max(h,s-r/2),s+r/2),u=Math.hypot(c-l,h-d);return{distance:n,maxDistance:o,value:p(n,a),maxValue:p(o,u),x:t,y:s,stride:r}},m=(e,t,i,s)=>{const r=g(t,i,s);r.maxDistance>=0&&e.push(r)},f=Math.min(o,a)/2;let y={value:g(r,n,f),next:null};for(;null!=y;){const e=y.value,{distance:i,value:s,maxValue:r,x:n,y:o,stride:a}=e;if(y=y.next,i>0&&(null==u||s>u.value)&&(u=e),null!=u&&r-u.value<=t)continue;const l=a/2,c=[];m(c,n-l,o-l,l),m(c,n+l,o-l,l),m(c,n-l,o+l,l),m(c,n+l,o+l,l),c.sort(hM),y=lM(y,c,hM)}if(null==u)return;const{distance:v,x:C,y:b}=u;return{x:C,y:b,distance:v}}var hM=(e,t)=>t.maxValue-e.maxValue;function dM(e,t){const i=cM(e,t,(e,t,i,s)=>{const r=-lE(e,t,i);return{distance:r,maxDistance:r+s*Math.SQRT2}});if(null==i)return;const{x:s,y:r}=i;return[s,r]}function uM(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(e=>uM(e,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const s=yE(e);i=null!=s?dM(s,t):void 0;break}case"Polygon":{const s=e.coordinates;i=null!=s?dM(s,t):void 0;break}case"MultiLineString":{const t=vE(e);i=null!=t?rE(t)?.point:void 0;break}case"LineString":{const t=e.coordinates;i=rE(t)?.point;break}}return null!=i?[i]:[]}var{BBox:pM}=s.n1;function gM(e){if(!e)return;const{range:t}=e,i=t[0][0],s=t[0][1],r=t[1][0]-i,n=t[1][1]-s,o=new pM(i,s,r,n);return{series:o,axis:o}}var{FillGradientDefaults:mM,FillPatternDefaults:fM,FillImageDefaults:yM,Property:vM,SeriesProperties:CM,SeriesTooltip:bM,Label:SM}=s.n1,wM=class extends SM{constructor(){super(...arguments),this.placement="bottom"}};a([vM],wM.prototype,"placement",2);var xM=class extends CM{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillGradientDefaults=new mM,this.fillPatternDefaults=new fM,this.fillImageDefaults=new yM,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new wM,this.tooltip=new bM}};a([vM],xM.prototype,"topology",2),a([vM],xM.prototype,"title",2),a([vM],xM.prototype,"legendItemName",2),a([vM],xM.prototype,"idKey",2),a([vM],xM.prototype,"topologyIdKey",2),a([vM],xM.prototype,"idName",2),a([vM],xM.prototype,"latitudeKey",2),a([vM],xM.prototype,"latitudeName",2),a([vM],xM.prototype,"longitudeKey",2),a([vM],xM.prototype,"longitudeName",2),a([vM],xM.prototype,"labelKey",2),a([vM],xM.prototype,"labelName",2),a([vM],xM.prototype,"sizeKey",2),a([vM],xM.prototype,"sizeName",2),a([vM],xM.prototype,"colorKey",2),a([vM],xM.prototype,"colorName",2),a([vM],xM.prototype,"colorRange",2),a([vM],xM.prototype,"shape",2),a([vM],xM.prototype,"size",2),a([vM],xM.prototype,"maxSize",2),a([vM],xM.prototype,"sizeDomain",2),a([vM],xM.prototype,"fill",2),a([vM],xM.prototype,"fillGradientDefaults",2),a([vM],xM.prototype,"fillPatternDefaults",2),a([vM],xM.prototype,"fillImageDefaults",2),a([vM],xM.prototype,"fillOpacity",2),a([vM],xM.prototype,"stroke",2),a([vM],xM.prototype,"strokeWidth",2),a([vM],xM.prototype,"strokeOpacity",2),a([vM],xM.prototype,"lineDash",2),a([vM],xM.prototype,"lineDashOffset",2),a([vM],xM.prototype,"itemStyler",2),a([vM],xM.prototype,"label",2),a([vM],xM.prototype,"tooltip",2);var{CachedTextMeasurerPool:EM,fromToMotion:MM,StateMachine:AM,getMissCount:TM,createDatumId:DM,SeriesNodePickMode:IM,valueProperty:RM,computeMarkerFocusBounds:PM,ColorScale:kM,LinearScale:LM,Group:NM,Selection:_M,Text:OM,Marker:FM,applyShapeStyle:GM,getShapeStyle:BM}=s.n1,VM=class extends ME{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[IM.EXACT_SHAPE_MATCH,IM.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new xM,this._chartTopology=void 0,this.colorScale=new kM,this.sizeScale=new LM,this.markerGroup=this.contentGroup.appendChild(new NM({name:"markerGroup"})),this.labelSelection=_M.select(this.labelGroup,OM,!1),this.markerSelection=_M.select(this.markerGroup,FM,!1),this.highlightMarkerSelection=_M.select(this.highlightNode,FM),this.animationState=new AM("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=null!=this.properties.latitudeKey&&null!=this.properties.longitudeKey;return super.hasData&&(null!=this.topology||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[3,e],this.highlightGroup.zIndex=[4,e],!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}async processData(e){if(null==this.data)return;const{data:t,topology:i,sizeScale:s,colorScale:r}=this,{topologyIdKey:n,idKey:o,latitudeKey:a,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,sizeDomain:u,colorRange:p}=this.properties,g=new Map;i?.features.forEach(e=>{const t=e.properties?.[n];null!=t&&g.set(t,e)});const m=this.sizeScale.type,f=this.colorScale.type,y=this.scale?.type,v=null!=a&&null!=l,{dataModel:C,processedData:b}=await this.requestDataModel(e,t,{props:[...null!=o?[RM(o,y,{id:"idValue",includeProperty:!1}),RM(o,y,{id:"featureValue",includeProperty:!1,processor:()=>e=>g.get(e)})]:[],...v?[RM(a,y,{id:"latValue"}),RM(l,y,{id:"lonValue"})]:[],...d?[RM(d,"band",{id:"labelValue"})]:[],...c?[RM(c,m,{id:"sizeValue"})]:[],...h?[RM(h,f,{id:"colorValue"})]:[]]}),S=null!=o?C.resolveColumnById(this,"featureValue",b):void 0,w=v?C.resolveColumnById(this,"latValue",b):void 0,x=v?C.resolveColumnById(this,"lonValue",b):void 0;if(this.topologyBounds=b.dataSources.get(this.id)?.reduce((e,t,i)=>{const s=S?.[i],r=s?.geometry;if(null!=r&&(e=fE(r,e)),null!=w&&null!=x){const t=x[i],s=w[i];e=oE(e,t,s,t,s)}return e},void 0),null!=c){const e=C.resolveProcessedDataIndexById(this,"sizeValue"),t=b.domain.values[e]??[];s.domain=u??t}if(null!=p&&this.isColorScaleValid()){const e=C.resolveProcessedDataIndexById(this,"colorValue");r.domain=b.domain.values[e],r.range=p,r.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.input.count,n=TM(this,i.defs.values[s].missing);return!(0===r||r===n)}getLabelDatum(e,t,i,s,r,n){if(null==t)return;const{idKey:o,idName:a,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:f,labelName:y,label:v,shape:C}=this.properties,{placement:b}=v,S=this.getLabelText(v,{value:t,datum:e,idKey:o,idName:a,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:f,labelName:y});if(null==S)return;const{width:w,height:x}=EM.measureText(String(S),{font:n});return{point:{x:i,y:s,size:r},label:{width:w,height:x,text:S},anchor:FM.anchor(C),placement:b}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,latitudeKey:l,longitudeKey:c,sizeKey:h,colorKey:d,labelKey:u,label:p}=n;if(null==t||null==i||null==o)return;const g=null!=l&&null!=c,m=null!=a?t.resolveColumnById(this,"idValue",i):void 0,f=null!=a?t.resolveColumnById(this,"featureValue",i):void 0,y=g?t.resolveColumnById(this,"latValue",i):void 0,v=g?t.resolveColumnById(this,"lonValue",i):void 0,C=null!=u?t.resolveColumnById(this,"labelValue",i):void 0,b=null!=h?t.resolveColumnById(this,"sizeValue",i):void 0,S=null!=d?t.resolveColumnById(this,"colorValue",i):void 0,w=n.maxSize??n.size;s.range=[Math.min(n.size,w),w];const x=p.getFont();let E;null!=m&&null!=f&&(E=new Map,i.dataSources.get(this.id)?.forEach((e,t)=>{const i=m[t],s=f[t]?.geometry??void 0,r=null!=s&&null!=o?bE(s,o):void 0;null!=i&&null!=r&&E.set(i,r)}));const M=[],A=[],T=[];if((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=m?.[t],r=v?.[t],a=y?.[t],c=S?.[t],h=b?.[t],d=C?.[t],u=null!=h?s.convert(h,{clamp:!0}):n.size,p=null!=i?E?.get(i):void 0;if(null!=i&&null==bE&&T.push(i),null!=r&&null!=a){const[s,n]=o.convert([r,a]),p=this.getLabelDatum(e,d,s,n,u,x);p&&A.push(p),M.push({series:this,itemId:l,datum:e,datumIndex:t,index:-1,idValue:i,lonValue:r,latValue:a,labelValue:d,sizeValue:h,colorValue:c,point:{x:s,y:n,size:u},midPoint:{x:s,y:n}})}else null!=p&&uM(p,1).forEach(([s,n],o)=>{const p=this.getLabelDatum(e,d,s,n,u,x);p&&A.push(p),M.push({series:this,itemId:l,datum:e,datumIndex:t,index:o,idValue:i,lonValue:r,latValue:a,labelValue:d,sizeValue:h,colorValue:c,point:{x:s,y:n,size:u},midPoint:{x:s,y:n}})})}),T.length>10){const e=T.length-10;T.length=10,T.push(`(+${e} more)`)}return T.length>0&&r.Vy.warnOnce("some data items do not have matches in the provided topology",T),{itemId:e,nodeData:M,labelData:A}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale!==this.scale&&(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:r}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();null==n||n.series===this&&null!=n.datum||(n=void 0);const o=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:o,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:n}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:null!=n?[n]:[],markerSelection:r}),this.updateMarkerNodes({markerSelection:r,isHighlight:!0,highlightedDatum:n}),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,e=>{e.pointerEvents=s.n1.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o}=this.properties.label;t.each((e,{x:t,y:a,width:l,height:c,text:h})=>{e.visible=!0,e.x=t+l/2,e.y=a+c/2,e.text=h,e.fill=i,e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textAlign="center",e.textBaseline="middle"})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,e=>DM([e.index,e.idValue,e.lonValue,e.latValue]))}getMarkerItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return BM({shape:t.shape,size:t.size,fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getMarkerItemStyleOverrides(e,t,i,s,r,n){const{id:o,properties:a,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:d}=a;let u;if(u??(u={}),n||null==i||(u.fill=this.isColorScaleValid()?l.convert(i):h?.[0]??a.fill),null!=s&&(u.size=c.convert(s,{clamp:!0})),null!=d){const i=this.cachedDatumCallback(DM(e,n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:t,highlighted:n,...r,...u}));u??(u={}),Object.assign(u,i)}return u}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:s}=e,r=this.getMarkerItemBaseStyle(i),n=gM(this.scale);t.each((e,t)=>{const{datumIndex:o,datum:a,point:l,colorValue:c,sizeValue:h}=t,d=this.getMarkerItemStyleOverrides(String(o),a,c,h,r,i);e.shape=d?.shape??r.shape,e.size=d?.size??r.size,GM(e,r,d,n),e.x=l.x,e.y=l.y,e.scalingCenterX=l.x,e.scalingCenterY=l.y,e.zIndex=i||null==s||a!==s.datum?0:1})}isProcessedDataAnimatable(){return!0}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:e}=this.ctx;MM(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],{fromFn:(e,t,i)=>"removed"===i?{scalingX:1,scalingY:1}:null==e.previousDatum?{scalingX:0,scalingY:0}:{scalingX:e.scalingX,scalingY:e.scalingY},toFn:(e,t,i)=>"removed"===i?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}})}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let s,r=1/0;return this.contextNodeData?.nodeData.forEach(e=>{const{x:n,y:o,size:a}=e.point,l=Math.max(Math.abs(n-t)-a,0),c=Math.max(Math.abs(o-i)-a,0),h=l*l+c*c;h<r&&(r=h,s=e)}),null!=s?{datum:s,distance:Math.sqrt(r)}:void 0}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{shape:r,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s;let{fill:d}=s;if(null!=e&&this.isColorScaleValid()){const s=t.resolveColumnById(this,"colorValue",i)[e];d=this.colorScale.convert(s)}return{marker:BM({shape:r,fill:d,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:l,lineDash:c,lineDashOffset:h},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:s,visible:r}=this,{title:n,legendItemName:o,idName:a,idKey:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;return"gradient"===e&&null!=c&&null!=d?[{legendType:"gradient",enabled:r,seriesId:s,colorName:h,colorRange:d,colorDomain:t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===e?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:r,label:{text:o??n??a??l??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!u}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{idKey:n,idName:o,latitudeKey:a,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:m,labelName:f,title:y,legendItemName:v,tooltip:C}=r;if(!i||!s)return;const b=s.dataSources.get(this.id)?.[e],S=null!=p?i.resolveColumnById(this,"sizeValue",s)[e]:void 0,w=null!=d?i.resolveColumnById(this,"colorValue",s)[e]:void 0,x=[];if(null!=S&&x.push({label:g,fallbackLabel:p,value:String(S)}),null!=w&&x.push({label:u,fallbackLabel:d,value:String(w)}),null!=m&&m!==n){const t=i.resolveColumnById(this,"labelValue",s)[e];x.push({label:f,fallbackLabel:m,value:t})}let E;if(null!=n)E=i.resolveColumnById(this,"idValue",s)[e];else if(null!=a&&null!=c){const t=i.resolveColumnById(this,"latValue",s)[e],r=i.resolveColumnById(this,"lonValue",s)[e];E=`${Math.abs(t).toFixed(4)}° ${t>=0?"N":"S"}, ${Math.abs(r).toFixed(4)}° ${r>=0?"W":"E"}`}const M=this.getMarkerItemBaseStyle(!1);return Object.assign(M,this.getMarkerItemStyleOverrides(String(e),e,w,S,M,!1)),this.formatTooltipWithContext(C,{heading:E,title:y??v,symbol:this.legendItemSymbol(e),data:x},{seriesId:t,datum:b,title:y,idKey:n,idName:o,latitudeKey:a,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:m,labelName:f,...M})}getFormattedMarkerStyle(e){const{datumIndex:t,colorValue:i,sizeValue:s}=e,r=this.getMarkerItemBaseStyle(!1);return Object.assign(r,this.getMarkerItemStyleOverrides(String(t),t,i,s,r,!1)),{size:r.size}}computeFocusBounds(e){return PM(this,e)}};VM.className="MapMarkerSeries",VM.type="map-marker";var{commonSeriesOptionsDefs:HM,mapMarkerSeriesThemeableOptionsDef:UM,without:zM}=s.n1,WM={...UM,...zM(HM,["highlightStyle"]),type:(0,r.mw)((0,r.dY)("map-marker")),idKey:r.Yj,latitudeKey:r.Yj,longitudeKey:r.Yj,sizeKey:r.Yj,colorKey:r.Yj,labelKey:r.Yj,idName:r.Yj,latitudeName:r.Yj,longitudeName:r.Yj,sizeName:r.Yj,colorName:r.Yj,labelName:r.Yj,topology:r.eW,topologyIdKey:r.Yj,legendItemName:r.Yj,title:r.Yj},jM={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:e=>new VM(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{shape:"circle",maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:.5,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},KM={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:WM,create:e=>new VM(e),validate(e,t,i){const s=(0,r.tf)(e,t,i),{cleared:n,invalid:o}=s;if(null==n?.idKey&&(null==n?.latitudeKey||null==n?.longitudeKey)){const e=e=>i?`${i}.${e}`:e,t=`Either \`${e("idKey")}\` or both \`${e("latitudeKey")}\` and \`${e("longitudeKey")}\` are required.`;o.push(new r.yI("required",t,null,i))}return s}};function $M(e,t,i,s,r){const[n,o]=e,[a,l]=t,c=1/r,h=a-n,d=l-o,[u,p]=o<=l?e:t,[g,m]=n<=a?e:t,[f,y]=o<=l?t:e,[v,C]=n<=a?t:e;let b=1/0;if(0!==h){const e=d/h;for(let t=0;t<=1;t+=1){const r=0===t?c:-c,a=(e*n-o-r*i+s)/(e-r);if(a>=g&&a<=v){const e=2*Math.abs(i-a);b=Math.min(b,e)}}}else for(let e=0;e<=1;e+=1){const t=(0===e?c:-c)*(n-i)+s;if(t>=p&&t<=y){const e=2*Math.abs(s-t)*r;b=Math.min(b,e)}}const S=r,w=Math.abs((u-i)/(p-s)),x=Math.abs((f-i)/(y-s));if(y<s&&x<S){const e=2*Math.abs(s-y)*r;b=Math.min(b,e)}else if(p>s&&w<S){const e=2*Math.abs(s-p)*r;b=Math.min(b,e)}const E=Math.abs((m-s)/(g-i)),M=Math.abs((C-s)/(v-i));if(v<i&&M<c){const e=2*Math.abs(i-v);b=Math.min(b,e)}else if(g>i&&E<c){const e=2*Math.abs(i-g);b=Math.min(b,e)}return b}function YM(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function qM(e,t,i,s,r,n){const o=r-n/2,a=r+n/2,[l,c]=t,[h,d]=i,u=h-l,p=d-c,[g,m]=l<=h?t:i,[f,y]=l<=h?i:t;if(0!==u){const t=p/u;for(let i=0;i<=1;i+=1){const r=((0===i?o:a)-c)/t+l;r>=g&&r<=f&&YM(e,s,r)}}else Math.max(o,Math.min(c,d))<=Math.min(a,Math.max(c,d))&&YM(e,s,l);return f<s&&y>=o&&y<=a?YM(e,s,f):g>s&&m>=o&&m<=a&&YM(e,s,g),e}var{Property:XM,SeriesProperties:ZM,SeriesTooltip:QM,FillGradientDefaults:JM,FillPatternDefaults:eA,FillImageDefaults:tA}=s.n1,iA=class extends ZM{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillGradientDefaults=new JM,this.fillPatternDefaults=new eA,this.fillImageDefaults=new tA,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new hf,this.tooltip=new QM}};a([XM],iA.prototype,"topology",2),a([XM],iA.prototype,"title",2),a([XM],iA.prototype,"legendItemName",2),a([XM],iA.prototype,"idKey",2),a([XM],iA.prototype,"idName",2),a([XM],iA.prototype,"topologyIdKey",2),a([XM],iA.prototype,"labelKey",2),a([XM],iA.prototype,"labelName",2),a([XM],iA.prototype,"colorKey",2),a([XM],iA.prototype,"colorName",2),a([XM],iA.prototype,"colorRange",2),a([XM],iA.prototype,"fill",2),a([XM],iA.prototype,"fillGradientDefaults",2),a([XM],iA.prototype,"fillPatternDefaults",2),a([XM],iA.prototype,"fillImageDefaults",2),a([XM],iA.prototype,"fillOpacity",2),a([XM],iA.prototype,"stroke",2),a([XM],iA.prototype,"strokeOpacity",2),a([XM],iA.prototype,"strokeWidth",2),a([XM],iA.prototype,"lineDash",2),a([XM],iA.prototype,"lineDashOffset",2),a([XM],iA.prototype,"padding",2),a([XM],iA.prototype,"itemStyler",2),a([XM],iA.prototype,"label",2),a([XM],iA.prototype,"tooltip",2);var{getMissCount:sA,createDatumId:rA,SeriesNodePickMode:nA,valueProperty:oA,CachedTextMeasurerPool:aA,TextUtils:lA,ColorScale:cA,Group:hA,Selection:dA,Text:uA,PointerEvents:pA,applyShapeStyle:gA,getShapeStyle:mA}=s.n1,fA=s.n1.MercatorScale.fixedScale(),yA=class extends ME{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[nA.EXACT_SHAPE_MATCH,nA.NEAREST_NODE]}),this.properties=new iA,this._chartTopology=void 0,this.colorScale=new cA,this.itemGroup=this.contentGroup.appendChild(new hA({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new hA({name:"itemLabelGroup"})),this.datumSelection=dA.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=dA.select(this.itemLabelGroup,uA),this.highlightDatumSelection=dA.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=pA.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const e=new mE;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(null==this.data)return;const{data:t,topology:i,colorScale:s}=this,{topologyIdKey:n,idKey:o,colorKey:a,labelKey:l,colorRange:c}=this.properties,h=new Map;i?.features.forEach(e=>{const t=e.properties?.[n];null!=t&&CE(e.geometry,1)&&h.set(t,e)});const d=this.colorScale.type,u=this.scale?.type,{dataModel:p,processedData:g}=await this.requestDataModel(e,t,{props:[oA(o,u,{id:"idValue",includeProperty:!1}),oA(o,u,{id:"featureValue",includeProperty:!1,processor:()=>e=>h.get(e)}),...l?[oA(l,"band",{id:"labelValue"})]:[],...a?[oA(a,d,{id:"colorValue"})]:[]]}),m=p.resolveColumnById(this,"featureValue",g);if(this.topologyBounds=m.reduce((e,t)=>{const i=t?.geometry;return null==i?e:fE(i,e)},void 0),null!=c&&this.isColorScaleValid()){const e=p.resolveProcessedDataIndexById(this,"colorValue");s.domain=g.domain.values[e],s.range=c,s.update()}null==i&&r.Vy.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.input.count,n=sA(this,i.defs.values[s].missing);return!(0===r||r===n)}getLabelLayout(e,t,i,s,r){if(null==t||null==s)return;const{idKey:n,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties,p=this.getLabelText(u,{value:t,datum:e,idKey:n,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h});if(null==p)return;const g=aA.measureText(String(p),{font:i}),m=p.split("\n").length,f=(g.width+2*d)/(m*lA.getLineHeight(u.fontSize)+2*d);if(r?.geometry===s&&r?.labelText===p&&r?.aspectRatio===f)return r;const y=yE(bE(s,fA));if(null==y)return;const v=function(e,{aspectRatio:t,precision:i}){const s=cM(e,i,(e,i,s,r)=>{const n=function(e,t,i,s){let r=!1,n=1/0;for(const o of e){let e=o[o.length-1],[a,l]=e;for(const c of o){const[o,h]=c;h>i!=l>i&&t<(a-o)*(i-h)/(l-h)+o&&(r=!r);const d=$M(e,c,t,i,s);n=Math.min(n,d),e=c,a=o,l=h}}return(r?1:-1)*n}(e,i,s,t),o=n+2*r*t;return{distance:n*Math.SQRT2,maxDistance:o*Math.SQRT2}});if(null==s)return;const{x:r,y:n,distance:o}=s;return{x:r,y:n,maxWidth:o/Math.SQRT2}}(y,{aspectRatio:f,precision:.001});if(null==v)return;const{x:C,y:b,maxWidth:S}=v;return{geometry:s,labelText:p,aspectRatio:f,x:C,y:b,maxWidth:S,fixedPolygon:y}}getLabelDatum(e,t){const{scale:i}=this;if(null==i)return;const{padding:s,label:r}=this.properties,{labelText:n,aspectRatio:o,x:a,y:l,maxWidth:c,fixedPolygon:h}=e,d={width:Math.ceil(c*t),height:Math.ceil(c*t/o),meta:a},u=sf(n,r,{padding:s},(e,i)=>{if(!i)return d;const s=function(e,t,i,s){const r={minX:-1/0,maxX:1/0};for(const n of e){let e=n[n.length-1];for(const o of n)qM(r,e,o,t,i,s),e=o}const{minX:n,maxX:o}=r;return Number.isFinite(n)&&Number.isFinite(o)?{x:t+(n+o)/2,width:o-n}:{x:t,width:0}}(h,a,l,e/t);return{width:s.width*t,height:e,meta:s.x}});if(null==u)return;const[{text:p,fontSize:g,lineHeight:m,width:f},y]=u;if(p===lA.EllipsisChar)return;const v=f<d.width?a:y,C=this.scale.convert(fA.invert([v,l]));return{x:C[0],y:C[1],text:p,fontSize:g,lineHeight:m}}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,scale:n,previousLabelLayouts:o}=this,{idKey:a,colorKey:l,labelKey:c,label:h}=s;if(null==t||null==i)return;const d=null!=n?(n.range[1][0]-n.range[0][0])/n.bounds.width:NaN,u=t.resolveColumnById(this,"idValue",i),p=t.resolveColumnById(this,"featureValue",i),g=null!=c?t.resolveColumnById(this,"labelValue",i):void 0,m=null!=l?t.resolveColumnById(this,"colorValue",i):void 0,f=h.getFont(),y=new Map;this.previousLabelLayouts=y;const v=[],C=[],b=[];if((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=u[t],s=m?.[t],r=g?.[t],l=p[t]?.geometry??void 0;null==l&&b.push(i);const c=this.getLabelLayout(e,r,f,l,o?.get(i));null!=c&&y.set(i,c);const h=null!=c&&null!=n?this.getLabelDatum(c,d):void 0;null!=h&&C.push(h);const S=null!=l&&null!=n?bE(l,n):void 0;v.push({series:this,itemId:a,datum:e,datumIndex:t,idValue:i,colorValue:s,labelValue:r,projectedGeometry:S})}),b.length>10){const e=b.length-10;b.length=10,b.push(`(+${e} more)`)}return b.length>0&&r.Vy.warnOnce("some data items do not have matches in the provided topology",b),{itemId:e,nodeData:v,labelData:C}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let s=this.ctx.highlightManager?.getActiveHighlight();null==s||s.series===this&&null!=s.datum||(s=void 0);const r=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:t}),this.updateLabelNodes({labelSelection:t}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=s?[s]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>rA(e.idValue))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return mA({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getItemStyleOverrides(e,t,i,s,r){const{id:n,properties:o,colorScale:a}=this,{colorRange:l,itemStyler:c}=o;let h;if(r||null==i||(h??(h={}),h.fill=this.isColorScaleValid()?a.convert(i):l?.[0]??o.fill),null!=c){const i=this.cachedDatumCallback(rA(e,r?"highlight":"node"),()=>this.callWithContext(c,{seriesId:n,datum:t,highlighted:r,...s,...h}));h??(h={}),Object.assign(h,i)}return mA(h,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getItemBaseStyle(i),r=gM(this.scale);t.each((e,t)=>{const{datum:n,datumIndex:o,colorValue:a,projectedGeometry:l}=t;if(null==l)return e.visible=!1,void(e.projectedGeometry=void 0);const c=this.getItemStyleOverrides(String(o),n,a,s,i);e.visible=!0,e.projectedGeometry=l,gA(e,s,c,r)})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:r,fontFamily:n}=this.properties.label;t.each((e,{x:t,y:o,text:a,fontSize:l,lineHeight:c})=>{e.visible=!0,e.x=t,e.y=o,e.text=a,e.fill=i,e.fontStyle=s,e.fontWeight=r,e.fontSize=l,e.lineHeight=c,e.fontFamily=n,e.textAlign="center",e.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i,s=1/0;return this.datumSelection.each((r,n)=>{const o=r.distanceSquared(e,t);o<s&&(s=o,i=n)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=null!=i?yE(i):void 0,r=null!=s?dM(s,2):void 0,n=null!=r?{x:r[0],y:r[1]}:void 0;return this._previousDatumMidPoint={datum:e,point:n},n}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{fillOpacity:r,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c}=s;let{fill:h}=s;if(null!=e&&this.isColorScaleValid()){const s=t.resolveColumnById(this,"colorValue",i)[e];h=this.colorScale.convert(s)}return{marker:mA({fill:h,fillOpacity:r,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:s,visible:r}=this,{title:n,legendItemName:o,idKey:a,idName:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;return"gradient"===e&&null!=c&&null!=d?[{legendType:"gradient",enabled:r,seriesId:s,colorName:h,colorRange:d,colorDomain:t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===e?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:r,label:{text:o??n??l??a},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!u}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{idKey:n,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h,legendItemName:d,title:u,tooltip:p}=r;if(!i||!s)return;const g=s.dataSources.get(this.id)?.[e],m=i.resolveColumnById(this,"idValue",s)[e],f=null!=a?i.resolveColumnById(this,"colorValue",s)[e]:void 0,y=[];if(null!=f&&y.push({label:l,fallbackLabel:a,value:String(f)}),null!=c&&c!==n){const t=i.resolveColumnById(this,"labelValue",s)[e];y.push({label:h,fallbackLabel:c,value:t})}const v=this.getItemBaseStyle(!1);return Object.assign(v,this.getItemStyleOverrides(String(e),e,f,v,!1)),this.formatTooltipWithContext(p,{heading:m,title:u??d,symbol:this.legendItemSymbol(e),data:y},{seriesId:t,datum:g,title:u,idKey:n,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h,...v})}computeFocusBounds(e){return EE(this,e)}};yA.className="MapShapeSeries",yA.type="map-shape";var{commonSeriesOptionsDefs:vA,mapShapeSeriesThemeableOptionsDef:CA,without:bA}=s.n1,SA={...CA,...bA(vA,["highlightStyle"]),type:(0,r.mw)((0,r.dY)("map-shape")),idKey:(0,r.mw)(r.Yj),colorKey:r.Yj,labelKey:r.Yj,idName:r.Yj,colorName:r.Yj,labelName:r.Yj,topology:r.eW,topologyIdKey:r.Yj,legendItemName:r.Yj,title:r.Yj},wA={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape",moduleFactory:e=>new yA(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{fill:{$palette:"fill"},stroke:{$ref:"backgroundColor"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}},tooltip:{range:"exact"}}},xA={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:SA,create:e=>new yA(e)},{FillGradientDefaults:EA,FillPatternDefaults:MA,FillImageDefaults:AA,Property:TA,SeriesProperties:DA,SeriesTooltip:IA}=s.n1,RA=class extends DA{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillGradientDefaults=new EA,this.fillPatternDefaults=new MA,this.fillImageDefaults=new AA,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new IA}};a([TA],RA.prototype,"topology",2),a([TA],RA.prototype,"fill",2),a([TA],RA.prototype,"fillGradientDefaults",2),a([TA],RA.prototype,"fillPatternDefaults",2),a([TA],RA.prototype,"fillImageDefaults",2),a([TA],RA.prototype,"fillOpacity",2),a([TA],RA.prototype,"stroke",2),a([TA],RA.prototype,"strokeOpacity",2),a([TA],RA.prototype,"strokeWidth",2),a([TA],RA.prototype,"lineDash",2),a([TA],RA.prototype,"lineDashOffset",2),a([TA],RA.prototype,"tooltip",2);var{createDatumId:PA,SeriesNodePickMode:kA,Selection:LA,Group:NA,PointerEvents:_A,getShapeStyle:OA}=s.n1,FA=class extends ME{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[kA.EXACT_SHAPE_MATCH]}),this.properties=new RA,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new NA({name:"itemGroup"})),this.datumSelection=LA.select(this.itemGroup,()=>this.nodeFactory())}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0)}nodeFactory(){const e=new mE;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=_A.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((e,t)=>{const i=t.geometry;return null==i?e:fE(i,e)},void 0),null==e&&r.Vy.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i}=this;if(null==t)return;const s=[];return t.features.forEach((e,t)=>{const{geometry:r}=e,n=null!=r&&null!=i?bE(r,i):void 0;null!=n&&s.push({series:this,itemId:t,datum:e,datumIndex:0,index:t,projectedGeometry:n})}),{itemId:e,nodeData:s,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>PA(e.index))}updateDatumNodes(e){const{properties:t}=this,{datumSelection:i}=e,{fill:s,fillOpacity:r,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:l}=t,c=this.getStrokeWidth(t.strokeWidth);i.each((e,t)=>{const{projectedGeometry:i}=t;if(null==i)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=i;const h=OA({fill:s,fillOpacity:r,stroke:n,strokeWidth:c,strokeOpacity:o,lineDash:a,lineDashOffset:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);e.setProperties(h)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}};FA.className="MapShapeBackgroundSeries",FA.type="map-shape-background";var{commonSeriesOptionsDefs:GA,mapShapeBackgroundSeriesThemeableOptionsDef:BA}=s.n1,VA={...BA,...GA,type:(0,r.mw)((0,r.dY)("map-shape-background")),topology:r.eW},HA={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:e=>new FA(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$ref:"backgroundColor"},strokeWidth:1,fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:[{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}],rotation:0,reverse:!1},fillPatternDefaults:{...s.n1.FILL_PATTERN_DEFAULTS,fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS}}},UA={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:VA,create:e=>new FA(e)},{ChartAxisDirection:zA,PolarAxis:WA,diff:jA,fixNumericExtent:KA,groupAccumulativeValueProperty:$A,keyProperty:YA,normaliseGroupTo:qA,resetLabelFn:XA,seriesLabelFadeInAnimation:ZA,seriesLabelFadeOutAnimation:QA,valueProperty:JA,animationValidation:eT,createDatumId:tT,SeriesNodePickMode:iT,normalizeAngle360:sT,CategoryScale:rT,motion:nT,applyShapeStyle:oT,isGradientFill:aT,getShapeStyle:lT}=s.n1,cT=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},hT=class extends s.n1.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",useLabelLayer:!0,canHaveAxes:!0,pickModes:[iT.NEAREST_NODE,iT.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:XA}}),this.NodeEvent=cT,this.groupScale=new rT,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===zA.Angle)return t.getDomain(this,"angleValue","key",i);{const e=t.getDomain(this,"radiusValue-end","value",i),s=Number.isFinite(e[1]-e[0])?[e[0]>0?0:e[0],e[1]<0?0:e[1]]:[];return KA(s)}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,l=[];(0,r.vM)(s)&&l.push(qA([o,a],Math.abs(s))),n&&this.processedData&&l.push(jA(this.id,this.processedData)),n&&l.push(eT());const c=this.visible?{}:{forceValue:0},h=this.axes[zA.Radius]?.scale.type,d=this.axes[zA.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[YA(t,d,{id:"angleValue"}),JA(i,h,{id:"radiusValue-raw",invalidValue:null,...c}),...$A(i,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...c},h),...$A(i,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:a,separateNegative:!0,...c},h),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return(e!==s.r||t!==s.cx||i!==s.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}isRadiusAxisReversed(){return this.axes[zA.Radius]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const e=this.axes[zA.Radius];return e instanceof WA?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||!e||"grouped"!==e.type)return;const s=this.axes[zA.Angle],r=this.axes[zA.Radius],n=s?.scale,o=r?.scale;if(!n||!o)return;const a=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),h=t.resolveColumnById(this,"radiusValue-raw",e),d=t.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,p=0;s instanceof Z&&(u=s.groupPaddingInner,p=s.paddingInner);const g=(n.bandwidth??0)*(1-p),{index:m,visibleGroupCount:f}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:f}).map((e,t)=>String(t)),i.range=[-g/2,g/2],i.paddingInner=f>1?u:0;const y=this.isRadiusAxisReversed(),v=y?this.radius:this.getAxisInnerRadius(),C=y?this.getAxisInnerRadius():this.radius,b=C+v,{angleKey:S,radiusKey:w,angleName:x,radiusName:E,label:M}=this.properties,A=(e,t,i,s)=>{const r=this.getLabelText(M,{value:t,datum:e,angleKey:S,radiusKey:w,angleName:x,radiusName:E});if(r)return{x:i,y:s,text:r,textAlign:"center",textBaseline:"middle"}},T=[],D={itemId:w,nodeData:T,labelData:T};if(!this.visible)return D;const{dataSources:I}=e,R=I.get(this.id)??[];for(const{datumIndex:s,group:r}of t.forEachGroupDatum(this,e)){const e=R[s],t=a[s];if(null==t)return;const u=h[s],p=u>=0&&!Object.is(u,-0),g=l[s],f=c[s],S=r.aggregation[d][p?1:0]??0,w=p===y;if(void 0===g||void 0===f)return;let x,E;if(1===R.length)x=-.5*Math.PI,E=1.5*Math.PI;else{const e=n.convert(t);x=sT(e+i.convert(String(m))),E=sT(x+i.bandwidth)}const M=x+i.bandwidth/2,D=b-o.convert(g),I=b-o.convert(f),P=(D+I)/2,k=b-o.convert(0),L=b-o.convert(S),N=Math.cos(M)*P,_=Math.sin(M)*P,O=this.properties.label.enabled?A(e,u,N,_):void 0,F=this.getColumnWidth(x,E);T.push({series:this,datum:e,datumIndex:s,point:{x:N,y:_,size:0},midPoint:{x:N,y:_},label:O,angleValue:t,radiusValue:u,negative:w,innerRadius:D,outerRadius:I,stackInnerRadius:k,stackOuterRadius:L,startAngle:x,endAngle:E,midAngle:M,axisInnerRadius:v,axisOuterRadius:C,columnWidth:F,index:s})}return{itemId:w,nodeData:T,labelData:T}}getColumnWidth(e,t){return NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return lT({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,s){const{id:r,properties:n}=this,{angleKey:o,radiusKey:a,itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h,fillImageDefaults:d}=n;if(null==l)return;const u=this.cachedDatumCallback(tT(e,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:r,datum:t,highlighted:s,angleKey:o,radiusKey:a,...i}));return lT(u,c,h,d)}updateSectorSelection(e,t){let i=[];if(t){const e=this.ctx.highlightManager?.getActiveHighlight();e?.datum&&e.series===this&&i.push(e)}else i=this.nodeData;const s=this.isRadiusAxisReversed(),r=s?this.radius:this.getAxisInnerRadius(),n=s?this.getAxisInnerRadius():this.radius,o=this.getShapeFillBBox(),a=this.getItemBaseStyle(t);e.update(i,void 0,e=>this.getDatumId(e)).each((e,i)=>{const{datum:s,datumIndex:l,midPoint:c}=i,h=this.getItemStyleOverrides(String(l),s,a,t),d=h?.fill??a.fill,u=aT(d)&&"item"===d.bounds?{centerX:c?.x??0,centerY:c?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:n};this.updateItemPath(e,i,t),oT(e,a,h,o,u),e.cornerRadius=h?.cornerRadius??a.cornerRadius,e.lineJoin="round"})}updateLabels(){const{label:e}=this.properties;this.labelSelection.update(this.nodeData).each((t,i)=>{e.enabled&&i.label?(t.x=i.label.x,t.y=i.label.y,t.fill=e.color,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=i.label.text,t.textAlign=i.label.textAlign,t.textBaseline=i.label.textBaseline,t.visible=!0):t.visible=!1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();nT.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),ZA(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();nT.fromToMotion(this.id,"datums",t,[e],i),QA(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{angleKey:o,angleName:a,radiusKey:l,radiusName:c,tooltip:h}=n,d=r[zA.Angle],u=r[zA.Radius];if(!(i&&s&&d&&u))return;const p=s.dataSources.get(this.id)?.[e],g=i.resolveKeysById(this,"angleValue",s)[e],m=i.resolveColumnById(this,"radiusValue-raw",s)[e];if(null==g)return;const f=this.getItemBaseStyle(!1);return Object.assign(f,this.getItemStyleOverrides(String(e),e,f,!1)),this.formatTooltipWithContext(h,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(m)}]},{seriesId:t,datum:p,title:a,angleKey:o,angleName:a,radiusKey:l,radiusName:c,...f})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=this.properties,d=lT({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:r,strokeWidth:n,lineDash:o,lineDashOffset:a},l,c,h);return s.n1.isGradientFill(d.fill)&&(d.fill={...d.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:d}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{radiusKey:s,radiusName:r,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:r??s},symbol:this.legendItemSymbol(),hideInLegend:!n}]}getDatumId(e){return tT(e.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:dT,FillGradientDefaults:uT,FillPatternDefaults:pT,FillImageDefaults:gT,SeriesTooltip:mT,Property:fT,Label:yT}=s.n1,vT=class extends dT{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new uT,this.fillPatternDefaults=new pT,this.fillImageDefaults=new gT,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new yT,this.tooltip=new mT}};a([fT],vT.prototype,"angleKey",2),a([fT],vT.prototype,"angleName",2),a([fT],vT.prototype,"radiusKey",2),a([fT],vT.prototype,"radiusName",2),a([fT],vT.prototype,"fill",2),a([fT],vT.prototype,"fillGradientDefaults",2),a([fT],vT.prototype,"fillPatternDefaults",2),a([fT],vT.prototype,"fillImageDefaults",2),a([fT],vT.prototype,"fillOpacity",2),a([fT],vT.prototype,"stroke",2),a([fT],vT.prototype,"strokeWidth",2),a([fT],vT.prototype,"strokeOpacity",2),a([fT],vT.prototype,"lineDash",2),a([fT],vT.prototype,"lineDashOffset",2),a([fT],vT.prototype,"cornerRadius",2),a([fT],vT.prototype,"itemStyler",2),a([fT],vT.prototype,"rotation",2),a([fT],vT.prototype,"stackGroup",2),a([fT],vT.prototype,"normalizedTo",2),a([fT],vT.prototype,"label",2),a([fT],vT.prototype,"tooltip",2);var{motion:CT}=s.n1;function bT(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(t,i)=>({startAngle:e.startAngle.get(t)[i],endAngle:e.endAngle.get(t)[i]});return{calculate:(i,s,r)=>{t.forEach(t=>{const n=e[t];let o=("removed"===r||"updated"===r?i:s)[t],a=("removed"===r?i:s)[t];isNaN(a)&&(a=i.previousDatum?.[t]??NaN);const l=o-a;Math.abs(l)>Math.PI&&(o-=2*Math.sign(l)*Math.PI),n.set(s,{from:o,to:a})})},from:e=>i(e,"from"),to:e=>i(e,"to")}}function ST(e,t,i){if("updated"===i){if(null==e.previousDatum||isNaN(e.previousDatum.startAngle)||isNaN(e.previousDatum.endAngle))return"added";if(isNaN(t.startAngle)||isNaN(t.endAngle))return"removed"}return"added"===i&&null!=e.previousDatum?"updated":i}function wT(e,{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:r,axisOuterRadius:n,startAngle:o,endAngle:a}){return{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:r,axisOuterRadius:n,startAngle:o,endAngle:a}}var{SectorBox:xT,motion:ET}=s.n1;function MT(e){const{negative:t,innerRadius:i,outerRadius:s,stackInnerRadius:r,stackOuterRadius:n}=e;return{innerRadius:t?n:r,outerRadius:t?r:n,clipInnerRadius:t?s:i,clipOuterRadius:t?i:s}}function AT(e,t){const{startAngle:i,endAngle:s}=t,{innerRadius:r,outerRadius:n,clipInnerRadius:o,clipOuterRadius:a}=MT(t);return{innerRadius:r,outerRadius:n,startAngle:i,endAngle:s,clipSector:new xT(i,s,o,a)}}var{Sector:TT,SectorBox:DT,PolarZIndexMap:IT}=s.n1,RT=class extends hT{constructor(e){super(e,{animationResetFns:{item:AT}}),this.properties=new vT}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[0,IT.FOREGROUND,e],this.highlightGroup.zIndex=[0,IT.HIGHLIGHT,e],this.labelGroup.zIndex=[0,IT.LABEL,e],!0)}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new TT}updateItemPath(e,t,i){const{negative:s}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=s?0:this.properties.cornerRadius,e.endOuterCornerRadius=s?0:this.properties.cornerRadius,e.startInnerCornerRadius=s?this.properties.cornerRadius:0,e.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:i,endAngle:s}=t,{innerRadius:r,outerRadius:n,clipInnerRadius:o,clipOuterRadius:a}=MT(t);e.innerRadius=r,e.outerRadius=n,e.startAngle=i,e.endAngle=s,e.clipSector=new DT(i,s,o,a)}}getColumnTransitionFunctions(){return function(e){const t=bT();return{toFn:(i,s,r)=>{const{startAngle:n,endAngle:o}=t.to(s);let a,l,c;if("removed"===r)a=e,l=e,c=new xT(n,o,a,l);else{let t,i;({innerRadius:a,outerRadius:l,clipInnerRadius:t,clipOuterRadius:i}=MT(s)),isNaN(a)&&(a=e),isNaN(l)&&(l=e),isNaN(t)&&(t=e),isNaN(i)&&(i=e),c=new xT(n,o,t,i)}return{innerRadius:a,outerRadius:l,startAngle:n,endAngle:o,clipSector:c}},fromFn:(i,s,r)=>{r=ST(i,s,r),t.calculate(i,s,r);const{startAngle:n,endAngle:o}=t.from(s);let a,l,c;return"removed"===r||"updated"===r?(a=i.innerRadius,l=i.outerRadius,c=i.clipSector):(a=e,l=e),c??(c=new xT(n,o,a,l)),{innerRadius:a,outerRadius:l,startAngle:n,endAngle:o,clipSector:c,phase:ET.NODE_UPDATE_STATE_TO_PHASE_MAPPING[r]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}};RT.className="NightingaleSeries",RT.type="nightingale";var{commonSeriesOptionsDefs:PT,nightingaleSeriesThemeableOptionsDef:kT}=s.n1,LT={...kT,...PT,type:(0,r.mw)((0,r.dY)("nightingale")),angleKey:(0,r.mw)(r.Yj),radiusKey:(0,r.mw)(r.Yj),angleName:r.Yj,radiusName:r.Yj,grouped:r.zM,stacked:r.zM,stackGroup:r.Yj,normalizedTo:r.ai},{ThemeConstants:{POLAR_AXIS_TYPE:NT,POLAR_AXIS_SHAPE:_T}}=s.n1,OT={$path:["./shape",_T.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},FT={series:{fill:{$palette:"fill"},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$palette:"stroke"}]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[NT.ANGLE_CATEGORY]:{shape:OT,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[NT.RADIUS_NUMBER]:{shape:OT}}},{ThemeConstants:{POLAR_AXIS_TYPE:GT}}=s.n1,BT={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:e=>new RT(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:GT.ANGLE_CATEGORY},{type:GT.RADIUS_NUMBER}],themeTemplate:FT,stackable:!0,groupable:!0,stackedByDefault:!0},VT={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:LT,create:e=>new RT(e)},{SeriesProperties:HT,FillGradientDefaults:UT,FillPatternDefaults:zT,FillImageDefaults:WT,SeriesTooltip:jT,Property:KT,Label:$T,DropShadow:YT}=s.n1,qT=class extends $T{},XT=class extends $T{constructor(){super(...arguments),this.spacing=0}};a([KT],XT.prototype,"spacing",2),a([KT],XT.prototype,"placement",2);var ZT=class extends HT{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new UT,this.fillPatternDefaults=new zT,this.fillImageDefaults=new WT,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=(new YT).set({enabled:!1}),this.label=new qT,this.stageLabel=new XT,this.tooltip=new jT}};function QT(e,{x:t,y:i,top:s,right:r,bottom:n,left:o}){e.x0=t-s/2,e.x1=t+s/2,e.x2=t+n/2,e.x3=t-n/2,e.y0=i-o/2,e.y1=i-r/2,e.y2=i+r/2,e.y3=i+o/2}a([KT],ZT.prototype,"stageKey",2),a([KT],ZT.prototype,"valueKey",2),a([KT],ZT.prototype,"fills",2),a([KT],ZT.prototype,"fillGradientDefaults",2),a([KT],ZT.prototype,"fillPatternDefaults",2),a([KT],ZT.prototype,"fillImageDefaults",2),a([KT],ZT.prototype,"fillOpacity",2),a([KT],ZT.prototype,"strokes",2),a([KT],ZT.prototype,"strokeWidth",2),a([KT],ZT.prototype,"strokeOpacity",2),a([KT],ZT.prototype,"lineDash",2),a([KT],ZT.prototype,"lineDashOffset",2),a([KT],ZT.prototype,"direction",2),a([KT],ZT.prototype,"reverse",2),a([KT],ZT.prototype,"spacing",2),a([KT],ZT.prototype,"aspectRatio",2),a([KT],ZT.prototype,"itemStyler",2),a([KT],ZT.prototype,"shadow",2),a([KT],ZT.prototype,"label",2),a([KT],ZT.prototype,"stageLabel",2),a([KT],ZT.prototype,"tooltip",2);var{StateMachine:JT,valueProperty:eD,SeriesNodePickMode:tD,CachedTextMeasurerPool:iD,TextUtils:sD,createDatumId:rD,BBox:nD,Group:oD,Selection:aD,Text:lD,PointerEvents:cD,applyShapeStyle:hD,fromToMotion:dD,seriesLabelFadeInAnimation:uD,getShapeStyle:pD}=s.n1,gD=class extends s.n1.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[tD.EXACT_SHAPE_MATCH,tD.NEAREST_NODE]}),this.properties=new ZT,this.itemGroup=this.contentGroup.appendChild(new oD({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new oD({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new oD({name:"stageLabelGroup"})),this.datumSelection=aD.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=aD.select(this.itemLabelGroup,lD),this.stageLabelSelection=aD.select(this.stageLabelGroup,lD),this.highlightDatumSelection=aD.select(this.highlightNode,()=>this.nodeFactory()),this.animationState=new JT("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=cD.None,this.stageLabelGroup.pointerEvents=cD.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}nodeFactory(){return new fS}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}async processData(e){if(null==this.data)return;const{id:t,visible:i,ctx:{legendManager:s}}=this,{stageKey:r,valueKey:n}=this.properties,o=this.visible?{}:{forceValue:0};await this.requestDataModel(e,this.data,{props:[eD(r,"band",{id:"xValue"}),eD(n,"number",{id:"yValue",...o,validation:(e,r,n)=>i&&s.getItemEnabled({seriesId:t,itemId:n}),invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:r,ctx:{legendManager:n}}=this,{stageKey:o,valueKey:a,direction:l,reverse:c="horizontal"===l,spacing:h,aspectRatio:d,label:u,stageLabel:p}=s;if(null==t||null==i)return;const g="horizontal"===l,m=t.resolveColumnById(this,"xValue",i),f=t.resolveColumnById(this,"yValue",i),y=iD.getMeasurer({font:p.getFont()});let v,C;g?(v="center",C="before"===p.placement?"bottom":"top"):(v="after"===p.placement?"left":"right",C="middle");const b=p.enabled?[]:void 0;let S=0,w=0,x=0;const E=i.dataSources.get(this.id)??[];E.forEach((t,i)=>{const s=m[i],l=f[i],c=r&&n.getItemEnabled({seriesId:e,itemId:i});if(x+=l,null==b)return;const h=this.getLabelText(this.properties.stageLabel,{datum:t,value:s,stageKey:o,valueKey:a}),{width:d}=y.measureText(h),p=h.split("\n").length*sD.getLineHeight(u.fontSize);S=Math.max(S,d),w=Math.max(w,p),b.push({x:NaN,y:NaN,text:h,textAlign:v,textBaseline:C,visible:c})});const M=this._nodeDataDependencies?.seriesRectWidth??0,A=this._nodeDataDependencies?.seriesRectHeight??0,T=h*(i.input.count-1);let D,I,R;if(g){const e=w+p.spacing;D=new nD(0,"before"===p.placement?e:0,M,A-e)}else{const e=S+p.spacing;D=new nD("after"===p.placement?0:e,0,M-e,A)}if(null!=d&&0!==d){const e="horizontal"===l?1/d:d,t=Math.min(D.width,D.height*e),i=t/e;D=new nD(D.x+(D.width-t)/2,D.y+(D.height-i)/2,t,i)}g?R="before"===p.placement?D.y-p.spacing:D.y+D.height+p.spacing:I="after"===p.placement?D.x+D.width+p.spacing:D.x-p.spacing;const P=D.width-(g?T:0),k=D.height-(g?0:T);if(P<0||k<0)return;const L=[],N=[];let _=0;return E.forEach((t,i)=>{const s=m[i],l=f[i],d=r&&n.getItemEnabled({seriesId:e,itemId:i}),p=_+l,y=(_+p)/(2*x),v=(p-_)/x,C=g?P*y+h*i:.5*P,S=g?.5*k:k*y+h*i,w=D.x+C,E=D.y+S;if(null!=b){const e=b[i];e.x=I??w,e.y=R??E}let M,A,T,O;if(g){const e=P*v;M=e,T=e;const t=(C+e/2)*(k/D.width),i=(C-e/2)*(k/D.width);A=c?D.height-t:t,O=c?D.height-i:i}else{const e=k*v;A=e,O=e;const t=(S-e/2)*(P/D.height),i=(S+e/2)*(P/D.height);M=c?D.width-t:t,T=c?D.width-i:i}const F={x:w,y:E,text:this.getLabelText(u,{datum:t,value:l,stageKey:o,valueKey:a}),textAlign:"center",textBaseline:"middle",visible:d};N.push(F),L.push({series:this,itemId:a,datum:t,datumIndex:i,index:i,xValue:s,yValue:l,x:w,y:E,top:M,right:A,bottom:T,left:O,label:F,enabled:d,midPoint:{x:w,y:E}}),_=p}),{itemId:e,nodeData:L,labelData:N,stageLabelData:b,bounds:D}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:r}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();null==n||n.series===this&&null!=n.datum||(n=void 0);const o=this.contextNodeData?.nodeData??[],a=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=n?[n]:[],datumSelection:r}),this.updateDatumNodes({datumSelection:r,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return pD({fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getItemStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,{fills:a,strokes:l,stageKey:c,valueKey:h,itemStyler:d}=o,u=s.fill??a[i%a.length],p=s.stroke??l[i%l.length],g={};if(r||(g.fill=u,g.stroke=p),null!=d){const i=this.cachedDatumCallback(rD(e,r?"highlight":"node"),()=>this.callWithContext(d,{seriesId:n,datum:t,stageKey:c,valueKey:h,highlighted:r,fill:u,stroke:p,...s}));Object.assign(g,i)}return pD(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{properties:s}=this,{shadow:r}=s,n=this.getItemBaseStyle(i),o=this.contextNodeData?.bounds,a=o?{series:o,axis:o}:void 0;t.each((e,t)=>{const{datumIndex:s,datum:o}=t,l=this.getItemStyleOverrides(String(s),o,s,n,i);hD(e,n,l,a),QT(e,t),e.fillShadow=r})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){const{labelSelection:t,labelProperties:i}=e,{color:s,fontSize:r,fontStyle:n,fontWeight:o,fontFamily:a}=i;t.each((e,{visible:t,x:i,y:l,text:c,textAlign:h,textBaseline:d})=>{e.visible=t,e.x=i,e.y=l,e.text=c,e.fill=s,e.fontStyle=n,e.fontWeight=o,e.fontSize=r,e.fontFamily=a,e.textAlign=h,e.textBaseline=d})}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(void 0!==t)for(const e of this.datumSelection)if(e.datum===t)return e.node}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:r}=this,{stageKey:n,valueKey:o,tooltip:a}=r;if(!i||!s)return;const l=s.dataSources.get(this.id)?.[e],c=i.resolveColumnById(this,"xValue",s)[e],h=i.resolveColumnById(this,"yValue",s)[e];if(null==c)return;const d=this.getLabelText(this.properties.stageLabel,{datum:s.dataSources.get(this.id)?.[e],value:h,stageKey:n,valueKey:o}),u=this.getItemBaseStyle(!1);return Object.assign(u,this.getItemStyleOverrides(String(e),e,e,u,!1)),this.formatTooltipWithContext(a,{symbol:this.legendItemSymbol(e),data:[{label:String(c),value:d}]},{seriesId:t,datum:l,title:void 0,stageKey:n,valueKey:o,...u})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}pickNodeClosestDatum({x:e,y:t}){let i,s=1/0;return this.datumSelection.each((r,n)=>{const o=r.distanceSquared(e,t);o<s&&(s=o,i=n)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}legendItemSymbol(e){const{fills:t,strokes:i,strokeWidth:s,fillOpacity:r,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.properties,l=t[e%t.length]??"black",c=i[e%i.length]??"black";return{marker:pD({fill:l,fillOpacity:r,stroke:c,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:r},visible:n}=this;if(!i||!t||"category"!==e)return[];const{showInLegend:o}=this.properties,a=[],l=i.resolveColumnById(this,"xValue",t);return(t.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=l[t];a.push({legendType:"category",id:s,itemId:t,seriesId:s,enabled:n&&r.getItemEnabled({seriesId:s,itemId:t}),label:{text:i},symbol:this.legendItemSymbol(t),hideInLegend:!o})}),a}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,s=(r=i.direction,{fromFn:(e,t)=>{const{x:i,y:s}=t;let{top:n,right:o,bottom:a,left:l}=t;return"vertical"===r?(n=0,a=0):(l=0,o=0),{x:i,y:s,top:n,right:o,bottom:a,left:l}},toFn:(e,t)=>{const{x:i,y:s,top:r,right:n,bottom:o,left:a}=t;return{x:i,y:s,top:r,right:n,bottom:o,left:a}},applyFn:QT});var r;dD(this.id,"nodes",this.ctx.animationManager,[e],s),uD(this,"labels",this.ctx.animationManager,t)}};gD.className="PyramidSeries",gD.type="pyramid";var{commonSeriesOptionsDefs:mD,pyramidSeriesThemeableOptionsDef:fD}=s.n1,yD={...fD,...mD,type:(0,r.mw)((0,r.dY)("pyramid")),stageKey:(0,r.mw)(r.Yj),valueKey:(0,r.mw)(r.Yj)},{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:vD}}=s.n1,CD={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:e=>new gD(e),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:{series:{direction:"vertical",strokeWidth:0,spacing:2,fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},stageLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:vD,xOffset:3,yOffset:3,blur:5}}}},bD={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:yD,create:e=>new gD(e)},{ThemeConstants:{POLAR_AXIS_TYPE:SD}}=s.n1,wD={series:{stroke:{$palette:"stroke"},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[SD.ANGLE_CATEGORY]:{label:{spacing:10}}}},xD=s.n1.mergeDefaults({series:{stroke:s.n1.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},wD),ED=s.n1.mergeDefaults({series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:.8,strokeWidth:2,marker:{enabled:!1,fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS}}},wD),{Label:MD,SeriesMarker:AD,SeriesProperties:TD,SeriesTooltip:DD,Property:ID}=s.n1,RD=class extends TD{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new AD,this.label=new MD,this.tooltip=new DD,this.connectMissingData=!1}};a([ID],RD.prototype,"angleKey",2),a([ID],RD.prototype,"radiusKey",2),a([ID],RD.prototype,"angleName",2),a([ID],RD.prototype,"radiusName",2),a([ID],RD.prototype,"stroke",2),a([ID],RD.prototype,"strokeWidth",2),a([ID],RD.prototype,"strokeOpacity",2),a([ID],RD.prototype,"lineDash",2),a([ID],RD.prototype,"lineDashOffset",2),a([ID],RD.prototype,"rotation",2),a([ID],RD.prototype,"marker",2),a([ID],RD.prototype,"label",2),a([ID],RD.prototype,"tooltip",2),a([ID],RD.prototype,"connectMissingData",2);var{ChartAxisDirection:PD,PolarAxis:kD,SeriesNodePickMode:LD,valueProperty:ND,fixNumericExtent:_D,seriesLabelFadeInAnimation:OD,markerFadeInAnimation:FD,resetMarkerFn:GD,animationValidation:BD,computeMarkerFocusBounds:VD,extent:HD,BBox:UD,Group:zD,Path:WD,PointerEvents:jD,Selection:KD,Text:$D,Marker:YD,mergeDefaults:qD,getShapeStyle:XD}=s.n1,ZD=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},QD=class extends s.n1.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",useLabelLayer:!0,pickModes:[LD.NEAREST_NODE,LD.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:GD},clipFocusBox:!1}),this.properties=new RD,this.NodeEvent=ZD,this.lineGroup=this.contentGroup.appendChild(new zD({name:"radar-line"})),this.lineSelection=KD.select(this.lineGroup,WD),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}nodeFactory(){return new YD}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===PD.Angle)return t.getDomain(this,"angleValue","value",i);{const e=t.getDomain(this,"radiusValue","value",i),s=HD(0===e.length?e:[0].concat(e));return _D(s)}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(BD());const r=this.axes[PD.Radius]?.scale.type,n=this.axes[PD.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[ND(t,n,{id:"angleValue"}),ND(i,r,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return(e!==s.r||t!==s.cx||i!==s.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[PD.Radius];return e instanceof kD?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:n,radiusName:o,marker:a,label:l}=this.properties,c=this.axes[PD.Angle]?.scale,h=this.axes[PD.Radius]?.scale;if(!c||!h)return;const d=t.resolveColumnById(this,"angleValue",e),u=t.resolveColumnById(this,"radiusValue",e),p=this.getAxisInnerRadius(),g=(e.dataSources.get(this.id)??[]).map((e,t)=>{const g=d[t],m=u[t],f=c.convert(g),y=this.radius+p-h.convert(m),v=Math.cos(f),C=Math.sin(f),b=v*y,S=C*y;let w;if(l.enabled){const t=this.getLabelText(l,{value:m,datum:e,angleKey:i,radiusKey:s,angleName:n,radiusName:o});if(t){let e="right";(0,r.YX)(v,0)?e="center":v>0&&(e="left");let i="bottom";(0,r.YX)(C,0)?i="middle":C>0&&(i="top"),w={x:b+v*a.size,y:S+C*a.size,text:t,textAlign:e,textBaseline:i}}}return{series:this,datum:e,datumIndex:t,index:t,point:{x:b,y:S,size:a.size},midPoint:{x:b,y:S},label:w,angleValue:g,radiusValue:m,missing:!(0,r.Bf)(f)||!(0,r.Bf)(y)}});return{itemId:s,nodeData:g,labelData:g}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=KD.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(e){return e?.fill??this.properties.marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:s,radiusKey:r}=i;return{seriesId:t,datum:e,angleKey:s,radiusKey:r}}updateMarkers(e,t){const{visible:i}=this,{marker:s,stroke:r,strokeWidth:n,strokeOpacity:o,highlightStyle:a}=this.properties;let l=[];if(i&&s.shape&&s.enabled)if(t){const e=this.ctx.highlightManager?.getActiveHighlight();e?.datum&&(l=[e])}else l=this.nodeData;const c=qD(t&&a.item,s.getStyle(),{stroke:r,strokeWidth:n,strokeOpacity:o}),h=this.getShapeFillBBox();e.update(l).each((e,i)=>{this.updateMarkerStyle(s,e,i.datum,i.point,this.getDatumStylerProperties(i),t,c,h)})}updateLabels(){const{label:e}=this.properties;this.labelSelection.update(this.nodeData).each((t,i)=>{e.enabled&&i.label?(t.x=i.label.x,t.y=i.label.y,t.fill=e.color,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=i.label.text,t.textAlign=i.label.textAlign,t.textBaseline=i.label.textBaseline,t.visible=!0):t.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{angleKey:o,angleName:a,radiusKey:l,radiusName:c,tooltip:h,marker:d}=n,u=r[PD.Angle],p=r[PD.Radius];if(!(i&&s&&u&&p))return;const g=s.dataSources.get(this.id)?.[e],m=i.resolveColumnById(this,"angleValue",s)[e],f=i.resolveColumnById(this,"radiusValue",s)[e];if(null==m)return;const y=this.getMarkerStyle(d,g,this.getDatumStylerProperties(g),!1);return this.formatTooltipWithContext(h,{heading:u.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(f)}]},{seriesId:t,datum:g,title:a,angleKey:o,radiusKey:l,angleName:a,radiusName:c,...y})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,marker:r}=this.properties;return{marker:XD({shape:r.shape,enabled:r.enabled||t<=0,fill:this.getMarkerFill()??r.stroke??e??"rgba(0, 0, 0, 0)",stroke:r.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:r.fillOpacity,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset},r.fillGradientDefaults,r.fillPatternDefaults,r.fillImageDefaults),line:{stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:s}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{radiusKey:r,radiusName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:r,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:r}),label:{text:n??r},symbol:this.legendItemSymbol(),hideInLegend:!o}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:s}=this,{x:r,y:n}=e,o=this.radius;if(Math.sqrt((r-i)**2+(n-s)**2)>o+this.properties.marker.size)return;let a,l=1/0;for(const r of t){const{point:{x:t=NaN,y:n=NaN}={}}=r;if(isNaN(t)||isNaN(n))continue;const o=Math.sqrt((e.x-t-i)**2+(e.y-n-s)**2);o<l&&(l=o,a=r)}return a?{datum:a,distance:Math.max(l-(a.point?.size??0),0)}:void 0}computeLabelsBBox(){const{label:e}=this.properties;this.maybeRefreshNodeData();const t=[],i=new $D;return this.nodeData.forEach(s=>{if(!e.enabled||!s.label)return;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(e),i.setAlign(s.label);const r=i.getBBox();t.push(r)}),0===t.length?null:UD.merge(t)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){const e=this.getLineNode();e&&(e.fill=void 0,e.lineJoin="round",e.lineCap="round",e.pointerEvents=jD.None,e.stroke=this.properties.stroke,e.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset)}getLinePoints(){const{nodeData:e,resetInvalidToZero:t}=this,{connectMissingData:i}=this.properties;if(0===e.length)return[];const s=this.axes[PD.Radius],r=this.axes[PD.Angle],n=r?.isReversed(),o=s?.isReversed(),a=o&&!n?[...e].reverse():e,l=[];let c,h=!1;return a.forEach((e,s)=>{let{x:r,y:n}=e.point;const o=isNaN(r)||isNaN(n);o||(c??(c=e)),o&&!i&&(r=0,n=0);const a=0===s||!t&&!i&&(o||h);l.push({x:r,y:n,moveTo:a}),h=o}),void 0!==c&&l.push({x:c.point.x,y:c.point.y,moveTo:!1}),l}animateSinglePath(e,t,i){const{path:s}=e;s.clear(!0);const r=this.getAxisInnerRadius(),n=this.axes[PD.Radius],o=n?.isReversed(),a=o?this.radius+r-n?.scale.convert(0):r;t.forEach(e=>{const{x:t,y:r,arc:n,radius:o=0,startAngle:l=0,endAngle:c=0,moveTo:h}=e,d=Math.atan2(r,t),u=a*Math.cos(d),p=a*Math.sin(d),g=u*(1-i)+t*i,m=p*(1-i)+r*i;n?s.arc(t,r,o,l,c):h?s.moveTo(g,m):s.lineTo(g,m)}),e.checkPathDirty()}animatePaths(e){const t=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,t,e)}animateEmptyUpdateReady(){const{itemSelection:e,labelSelection:t}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:e=>this.animatePaths(e),onStop:()=>this.animatePaths(1)}),FD(this,i,"added",e),OD(this,"labels",i,t)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints();e.fill=void 0,e.stroke=this.properties.stroke,e.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,t.clear(!0);for(const{x:e,y:s,moveTo:r}of i)r?t.moveTo(e,s):t.lineTo(e,s);e.checkPathDirty()}}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{angleKey:t,radiusKey:i},!0)}computeFocusBounds(e){return VD(this,e)}};QD.className="RadarSeries";var{FillGradientDefaults:JD,FillPatternDefaults:eI,FillImageDefaults:tI,Property:iI}=s.n1,sI=class extends RD{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new JD,this.fillPatternDefaults=new eI,this.fillImageDefaults=new tI,this.fillOpacity=1}};a([iI],sI.prototype,"fill",2),a([iI],sI.prototype,"fillGradientDefaults",2),a([iI],sI.prototype,"fillPatternDefaults",2),a([iI],sI.prototype,"fillImageDefaults",2),a([iI],sI.prototype,"fillOpacity",2);var{Group:rI,Path:nI,PointerEvents:oI,Selection:aI,ChartAxisDirection:lI,applyShapeStyle:cI,getShapeFill:hI,getShapeStyle:dI}=s.n1,uI=class extends QD{constructor(e){super(e),this.properties=new sI,this.areaGroup=this.contentGroup.appendChild(new rI({name:"radar-area"})),this.areaSelection=aI.select(this.areaGroup,nI),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){return e?.fill??this.properties.marker.fill??this.properties.fill}beforePathAnimation(){super.beforePathAnimation();const e=this.getAreaNode(),{fillOpacity:t,fill:i}=this.properties,s=dI({fill:i,fillOpacity:t},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);cI(e,s,void 0,this.getShapeFillBBox()),e.pointerEvents=oI.None,e.stroke=void 0}animatePaths(e){super.animatePaths(e),this.animateSinglePath(this.getAreaNode(),this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=e=>{const t=this.axes[e];return t instanceof s.n1.PolarAxis?t:void 0},i=t(lI.Radius),r=t(lI.Angle),n=i?.isReversed();if(!n)return e;const o=r?.getAxisLinePoints()?.points??[];return e.concat(...o)}resetPaths(){super.resetPaths();const e=this.getAreaNode();if(e){const{path:t}=e,i=this.getAreaPoints(),s=hI(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),r=this.getShapeFillBBox();cI(e,{fill:s,stroke:void 0,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset},void 0,r),e.lineJoin=e.lineCap="round",t.clear(!0),i.forEach(({x:e,y:i,moveTo:s,arc:r,radius:n=0,startAngle:o=0,endAngle:a=0})=>{r?t.arc(e,i,n,o,a):s?t.moveTo(e,i):t.lineTo(e,i)}),t.closePath(),e.checkPathDirty()}}};uI.className="RadarAreaSeries",uI.type="radar-area";var{commonSeriesOptionsDefs:pI,radarAreaSeriesThemeableOptionsDef:gI}=s.n1,mI={...gI,...pI,type:(0,r.mw)((0,r.dY)("radar-area")),angleKey:(0,r.mw)(r.Yj),radiusKey:(0,r.mw)(r.Yj),angleName:r.Yj,radiusName:r.Yj},{ThemeConstants:{POLAR_AXIS_TYPE:fI}}=s.n1,yI={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:e=>new uI(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:fI.ANGLE_CATEGORY},{type:fI.RADIUS_NUMBER}],themeTemplate:ED},vI={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:mI,create:e=>new uI(e)},CI=class extends QD{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};CI.className="RadarLineSeries",CI.type="radar-line";var{commonSeriesOptionsDefs:bI,radarLineSeriesThemeableOptionsDef:SI}=s.n1,wI={...SI,...bI,type:(0,r.mw)((0,r.dY)("radar-line")),angleKey:(0,r.mw)(r.Yj),radiusKey:(0,r.mw)(r.Yj),angleName:r.Yj,radiusName:r.Yj},{POLAR_AXIS_TYPE:xI}=s.n1.ThemeConstants,EI={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:e=>new CI(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:xI.ANGLE_CATEGORY},{type:xI.RADIUS_NUMBER}],themeTemplate:xD},MI={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:wI,create:e=>new CI(e)},{SeriesProperties:AI,FillGradientDefaults:TI,FillPatternDefaults:DI,FillImageDefaults:II,SeriesTooltip:RI,Property:PI,Label:kI}=s.n1,LI=class extends AI{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new TI,this.fillPatternDefaults=new DI,this.fillImageDefaults=new II,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new kI,this.tooltip=new RI}};a([PI],LI.prototype,"angleKey",2),a([PI],LI.prototype,"radiusKey",2),a([PI],LI.prototype,"angleName",2),a([PI],LI.prototype,"radiusName",2),a([PI],LI.prototype,"fill",2),a([PI],LI.prototype,"fillGradientDefaults",2),a([PI],LI.prototype,"fillPatternDefaults",2),a([PI],LI.prototype,"fillImageDefaults",2),a([PI],LI.prototype,"fillOpacity",2),a([PI],LI.prototype,"stroke",2),a([PI],LI.prototype,"strokeWidth",2),a([PI],LI.prototype,"strokeOpacity",2),a([PI],LI.prototype,"lineDash",2),a([PI],LI.prototype,"lineDashOffset",2),a([PI],LI.prototype,"cornerRadius",2),a([PI],LI.prototype,"itemStyler",2),a([PI],LI.prototype,"rotation",2),a([PI],LI.prototype,"stackGroup",2),a([PI],LI.prototype,"normalizedTo",2),a([PI],LI.prototype,"label",2),a([PI],LI.prototype,"tooltip",2);var{SectorBox:NI,motion:_I}=s.n1;function OI(e){return{toFn:(t,i,s)=>{let r,n,o,a,l;return"removed"===s?(r=e,n=e,o=i.innerRadius,a=i.outerRadius,l=new NI(r,n,o,a)):(r=i.startAngle,n=i.endAngle,o=isNaN(i.innerRadius)?t.innerRadius:i.innerRadius,a=isNaN(i.outerRadius)?t.outerRadius:i.outerRadius,l=i.clipSector),{startAngle:r,endAngle:n,innerRadius:o,outerRadius:a,clipSector:l}},fromFn:(t,i,s)=>{let r,n,o,a,l;return s=function(e,t,i){if("updated"===i){if(null==e.previousDatum||isNaN(e.previousDatum.innerRadius)||isNaN(e.previousDatum.outerRadius))return"added";if(isNaN(t.innerRadius)||isNaN(t.outerRadius))return"removed"}return"added"===i&&null!=e.previousDatum?"updated":i}(t,i,s),"removed"===s||"updated"===s?(r=t.startAngle,n=t.endAngle,o=t.innerRadius,a=t.outerRadius,l=t.clipSector):(r=e,n=e,o=i.innerRadius,a=i.outerRadius),l??(l=new NI(r,n,o,a)),{startAngle:r,endAngle:n,innerRadius:o,outerRadius:a,clipSector:l,phase:_I.NODE_UPDATE_STATE_TO_PHASE_MAPPING[s]}}}}function FI(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{ChartAxisDirection:GI,PolarAxis:BI,diff:VI,groupAccumulativeValueProperty:HI,keyProperty:UI,normaliseGroupTo:zI,valueProperty:WI,fixNumericExtent:jI,resetLabelFn:KI,seriesLabelFadeInAnimation:$I,seriesLabelFadeOutAnimation:YI,animationValidation:qI,angleBetween:XI,createDatumId:ZI,CategoryScale:QI,Sector:JI,SectorBox:eR,motion:tR,isGradientFill:iR,applyShapeStyle:sR,getShapeStyle:rR}=s.n1,nR=class extends s.n1.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},oR=class extends s.n1.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:FI,label:KI}}),this.properties=new LI,this.NodeEvent=nR,this.groupScale=new QI,this.circleCache={r:0,cx:0,cy:0}}get defaultShapeStyle(){const e=this.axes[GI.Angle]?.scale;return{...this.properties.fillGradientDefaults.toJson(),rotation:s.n1.toDegrees(e.range[0])+90}}nodeFactory(){return new JI}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===GI.Angle){const e=t.getDomain(this,"angleValue-end","value",i),s=[e[0]>0?0:e[0],e[1]<0?0:e[1]];return jI(s)}return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,l=[];(0,r.vM)(s)&&l.push(zI([o,a],Math.abs(s))),n&&(this.processedData&&l.push(VI(this.id,this.processedData)),l.push(qI()));const c=this.visible?{}:{forceValue:0},h=this.axes[GI.Radius]?.scale.type,d=this.axes[GI.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[UI(i,h,{id:"radiusValue"}),WI(t,d,{id:"angleValue-raw",invalidValue:null,...c}),...HI(t,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...c},d),...HI(t,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:a,separateNegative:!0,...c},d),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return(e!==s.r||t!==s.cx||i!==s.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const e=this.axes[GI.Radius];return e instanceof BI?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||!e||"grouped"!==e.type)return;const i=this.axes[GI.Angle],s=this.axes[GI.Radius],r=i?.scale,n=s?.scale;if(!r||!n)return;const o=t.resolveKeysById(this,"radiusValue",e),a=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof ze&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((e,t)=>String(t)),u.range=[0,Math.abs(n.bandwidth??0)],u.paddingInner=g>1?d:0;const m=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,f=i.isReversed(),y=s.isReversed(),v=y?this.radius:this.getAxisInnerRadius(),C=(y?this.getAxisInnerRadius():this.radius)+v,{angleKey:b,radiusKey:S,angleName:w,radiusName:x,label:E}=this.properties,M=(e,t,i,s)=>{const r=this.getLabelText(E,{value:t,datum:e,angleKey:b,radiusKey:S,angleName:w,radiusName:x});if(r)return{x:i,y:s,text:r,textAlign:"center",textBaseline:"middle"}},A=[],T={itemId:S,nodeData:A,labelData:A};if(!this.visible)return T;const{dataSources:D}=e,I=D.get(this.id)??[];for(const{datumIndex:i,group:s}of t.forEachGroupDatum(this,e)){const e=I[i],t=o[i];if(null==t)return;const d=c[i],g=a[i],y=l[i],v=d>=0&&!Object.is(d,-0),b=s.aggregation[h][v?1:0],S=v===f;let w=r.convert(g,{clamp:!0}),x=r.convert(y,{clamp:!0}),E=r.convert(0,{clamp:!0}),T=r.convert(b,{clamp:!0});S&&([E,T]=[T,E],[w,x]=[x,w]);const D=C-n.convert(t)+u.convert(String(p)),R=D+m,P=(D+R)/2,k=w+XI(w,x)/2,L=Math.cos(k)*P,N=Math.sin(k)*P,_=this.properties.label.enabled?M(e,d,L,N):void 0,O=new eR(w,x,D,R);A.push({series:this,datum:e,datumIndex:i,point:{x:L,y:N,size:0},midPoint:{x:L,y:N},label:_,angleValue:d,radiusValue:t,innerRadius:D,outerRadius:R,startAngle:E,endAngle:T,clipSector:O,reversed:S,index:i})}return T}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return rR({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},this.defaultShapeStyle,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,s){const{id:r,properties:n}=this,{angleKey:o,radiusKey:a,itemStyler:l}=n;let c;return null!=l&&(c=this.cachedDatumCallback(ZI(e,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:r,datum:t,highlighted:s,angleKey:o,radiusKey:a,...i}))),rR(c,this.defaultShapeStyle,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateSectorSelection(e,t){let i=[];if(t){const e=this.ctx.highlightManager?.getActiveHighlight();e?.datum&&e.series===this&&i.push(e)}else i=this.nodeData;const r=this.getItemBaseStyle(t),n=this.getShapeFillBBox();e.update(i,void 0,e=>this.getDatumId(e)).each((e,i)=>{const{datum:o,datumIndex:a}=i,l=this.getItemStyleOverrides(String(a),o,r,t),c=l?.cornerRadius??r.cornerRadius,h=l?.fill??r.fill,d=s.n1.isGradientFill(h)&&"item"!==h.bounds?{centerX:0,centerY:0}:void 0;sR(e,r,l,n,d),e.lineJoin="round",e.inset=null!=e.stroke?e.strokeWidth/2:0,e.startInnerCornerRadius=o.reversed?c:0,e.startOuterCornerRadius=o.reversed?c:0,e.endInnerCornerRadius=o.reversed?0:c,e.endOuterCornerRadius=o.reversed?0:c,t&&(e.startAngle=i.startAngle,e.endAngle=i.endAngle,e.clipSector=i.clipSector,e.innerRadius=i.innerRadius,e.outerRadius=i.outerRadius)})}updateLabels(){const{label:e}=this.properties;this.labelSelection.update(this.nodeData).each((t,i)=>{e.enabled&&i.label?(t.x=i.label.x,t.y=i.label.y,t.fill=e.color,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=i.label.text,t.textAlign=i.label.textAlign,t.textBaseline=i.label.textBaseline,t.visible=!0):t.visible=!1})}getBarTransitionFunctions(){const e=this.axes[GI.Angle]?.scale;let t=0;if(!e)return OI(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),OI(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();tR.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),$I(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();tR.fromToMotion(this.id,"datums",t,[e],i),YI(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:r,properties:n}=this,{angleKey:o,angleName:a,radiusKey:l,radiusName:c,tooltip:h}=n,d=r[GI.Angle],u=r[GI.Radius];if(!(i&&s&&d&&u))return;const p=s.dataSources.get(this.id)?.[e],g=i.resolveKeysById(this,"radiusValue",s)[e],m=i.resolveColumnById(this,"angleValue-raw",s)[e];if(null==g)return;const f=this.getItemBaseStyle(!1);return Object.assign(f,this.getItemStyleOverrides(String(e),e,f,!1)),this.formatTooltipWithContext(h,{heading:u.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:a,fallbackLabel:o,value:d.formatDatum(m)}]},{seriesId:t,datum:p,title:a,angleKey:o,angleName:a,radiusKey:l,radiusName:c,...f})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:r,lineDash:n,lineDashOffset:o,fillPatternDefaults:a,fillImageDefaults:l}=this.properties,c=rR({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:r,lineDash:n,lineDashOffset:o},this.defaultShapeStyle,a,l);return iR(c.fill)&&(c.fill={...c.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:c}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{angleKey:s,angleName:r,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:r??s},symbol:this.legendItemSymbol(),hideInLegend:!n}]}getDatumId(e){return ZI(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};oR.className="RadialBarSeries",oR.type="radial-bar";var{commonSeriesOptionsDefs:aR,radialBarSeriesThemeableOptionsDef:lR}=s.n1,cR={...lR,...aR,type:(0,r.mw)((0,r.dY)("radial-bar")),angleKey:(0,r.mw)(r.Yj),radiusKey:(0,r.mw)(r.Yj),angleName:r.Yj,radiusName:r.Yj,grouped:r.zM,stacked:r.zM,stackGroup:r.Yj,normalizedTo:r.ai},{ThemeConstants:{POLAR_AXIS_TYPE:hR}}=s.n1,dR={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[hR.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:uR}=s.n1.ThemeConstants,pR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:e=>new oR(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:uR.ANGLE_NUMBER},{type:uR.RADIUS_CATEGORY}],themeTemplate:dR,stackable:!0,groupable:!0},gR={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:cR,create:e=>new oR(e)},{Property:mR}=s.n1,fR=class extends vT{};a([mR],fR.prototype,"columnWidthRatio",2),a([mR],fR.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:yR,PolarAxis:vR,RadialColumnShape:CR,getRadialColumnWidth:bR}=s.n1,SR=class extends hT{constructor(e){super(e,{animationResetFns:{item:wT}}),this.properties=new fR}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new CR}getColumnTransitionFunctions(){return function(e){const t=bT();return{toFn:(i,s,r)=>{const{startAngle:n,endAngle:o}=t.to(s);let a,l,c,h,d;return"removed"===r?(a=i.innerRadius,l=i.innerRadius,c=i.columnWidth,h=i.axisInnerRadius,d=i.axisOuterRadius):(a=isNaN(s.innerRadius)?e:s.innerRadius,l=isNaN(s.outerRadius)?e:s.outerRadius,c=isNaN(s.columnWidth)?i.columnWidth:s.columnWidth,h=s.axisInnerRadius,d=s.axisOuterRadius),{innerRadius:a,outerRadius:l,columnWidth:c,axisInnerRadius:h,axisOuterRadius:d,startAngle:n,endAngle:o}},fromFn:(i,s,r)=>{r=ST(i,s,r),t.calculate(i,s,r);const{startAngle:n,endAngle:o}=t.from(s);let a,l,c,h,d;return"removed"===r||"updated"===r?(a=i.innerRadius,l=i.outerRadius,c=i.columnWidth,h=i.axisInnerRadius,d=i.axisOuterRadius):(a=e,l=e,c=s.columnWidth,h=s.axisInnerRadius,d=s.axisOuterRadius),{innerRadius:a,outerRadius:l,columnWidth:c,axisInnerRadius:h,axisOuterRadius:d,startAngle:n,endAngle:o,phase:CT.NODE_UPDATE_STATE_TO_PHASE_MAPPING[r]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}isRadiusAxisCircle(){const e=this.axes[yR.Radius];return e instanceof vR&&"circle"===e.shape}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),e.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return bR(e,t,this.radius,i,s)}};SR.className="RadialColumnSeries",SR.type="radial-column";var{commonSeriesOptionsDefs:wR,radialColumnSeriesThemeableOptionsDef:xR}=s.n1,ER={...xR,...wR,type:(0,r.mw)((0,r.dY)("radial-column")),angleKey:(0,r.mw)(r.Yj),radiusKey:(0,r.mw)(r.Yj),angleName:r.Yj,radiusName:r.Yj,grouped:r.zM,stacked:r.zM,stackGroup:r.Yj,normalizedTo:r.ai},{ThemeConstants:{POLAR_AXIS_TYPE:MR,POLAR_AXIS_SHAPE:AR}}=s.n1,TR={$path:["./shape",AR.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},DR={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[MR.ANGLE_CATEGORY]:{shape:TR,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[MR.RADIUS_NUMBER]:{shape:TR,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:IR}=s.n1.ThemeConstants,RR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:e=>new SR(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:IR.ANGLE_CATEGORY},{type:IR.RADIUS_NUMBER}],themeTemplate:DR,stackable:!0,groupable:!0},PR={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:ER,create:e=>new SR(e)},{SvgPath:kR,Rotatable:LR,Translatable:NR,Scalable:_R}=s.n1,OR=class extends(LR(_R(NR(kR)))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};OR.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{BaseProperties:FR,SeriesTooltip:GR,SeriesProperties:BR,PropertiesArray:VR,AxisLabel:HR,Property:UR,Label:zR}=s.n1,WR=class extends zR{};a([UR],WR.prototype,"spacing",2);var jR=class extends FR{constructor(){super(...arguments),this.label=new WR}};a([UR],jR.prototype,"text",2),a([UR],jR.prototype,"value",2),a([UR],jR.prototype,"shape",2),a([UR],jR.prototype,"placement",2),a([UR],jR.prototype,"spacing",2),a([UR],jR.prototype,"size",2),a([UR],jR.prototype,"rotation",2),a([UR],jR.prototype,"fill",2),a([UR],jR.prototype,"fillOpacity",2),a([UR],jR.prototype,"stroke",2),a([UR],jR.prototype,"strokeWidth",2),a([UR],jR.prototype,"strokeOpacity",2),a([UR],jR.prototype,"lineDash",2),a([UR],jR.prototype,"lineDashOffset",2),a([UR],jR.prototype,"label",2);var KR=class extends FR{constructor(){super(...arguments),this.enabled=!0,this.fills=new VR(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([UR],KR.prototype,"enabled",2),a([UR],KR.prototype,"fills",2),a([UR],KR.prototype,"fillMode",2),a([UR],KR.prototype,"fill",2),a([UR],KR.prototype,"fillOpacity",2),a([UR],KR.prototype,"stroke",2),a([UR],KR.prototype,"strokeWidth",2),a([UR],KR.prototype,"strokeOpacity",2),a([UR],KR.prototype,"lineDash",2),a([UR],KR.prototype,"lineDashOffset",2);var $R=class extends FR{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};a([UR],$R.prototype,"values",2),a([UR],$R.prototype,"step",2),a([UR],$R.prototype,"minSpacing",2),a([UR],$R.prototype,"maxSpacing",2);var YR=class extends HR{},qR=class extends FR{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new VR(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new $R,this.label=new YR}};a([UR],qR.prototype,"min",2),a([UR],qR.prototype,"max",2),a([UR],qR.prototype,"fills",2),a([UR],qR.prototype,"fillMode",2),a([UR],qR.prototype,"fill",2),a([UR],qR.prototype,"fillOpacity",2),a([UR],qR.prototype,"stroke",2),a([UR],qR.prototype,"strokeWidth",2),a([UR],qR.prototype,"strokeOpacity",2),a([UR],qR.prototype,"lineDash",2),a([UR],qR.prototype,"lineDashOffset",2),a([UR],qR.prototype,"defaultFill",2),a([UR],qR.prototype,"interval",2),a([UR],qR.prototype,"label",2);var XR=class extends FR{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([UR],XR.prototype,"enabled",2),a([UR],XR.prototype,"radiusRatio",2),a([UR],XR.prototype,"spacing",2),a([UR],XR.prototype,"fill",2),a([UR],XR.prototype,"fillOpacity",2),a([UR],XR.prototype,"stroke",2),a([UR],XR.prototype,"strokeWidth",2),a([UR],XR.prototype,"strokeOpacity",2),a([UR],XR.prototype,"lineDash",2),a([UR],XR.prototype,"lineDashOffset",2);var ZR=class extends cf{};a([UR],ZR.prototype,"text",2);var QR=class extends hf{};a([UR],QR.prototype,"text",2);var JR=class extends BR{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new tx,this.defaultColorRange=[],this.targets=new VR(jR),this.defaultTarget=new jR,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new qR,this.bar=new KR,this.needle=new XR,this.label=new ZR,this.secondaryLabel=new QR,this.tooltip=new GR}};a([UR],JR.prototype,"value",2),a([UR],JR.prototype,"startAngle",2),a([UR],JR.prototype,"endAngle",2),a([UR],JR.prototype,"segmentation",2),a([UR],JR.prototype,"defaultColorRange",2),a([UR],JR.prototype,"targets",2),a([UR],JR.prototype,"defaultTarget",2),a([UR],JR.prototype,"outerRadiusRatio",2),a([UR],JR.prototype,"innerRadiusRatio",2),a([UR],JR.prototype,"outerRadius",2),a([UR],JR.prototype,"innerRadius",2),a([UR],JR.prototype,"cornerRadius",2),a([UR],JR.prototype,"cornerMode",2),a([UR],JR.prototype,"spacing",2),a([UR],JR.prototype,"scale",2),a([UR],JR.prototype,"bar",2),a([UR],JR.prototype,"needle",2),a([UR],JR.prototype,"label",2),a([UR],JR.prototype,"secondaryLabel",2),a([UR],JR.prototype,"tooltip",2);var{SectorBox:eP}=s.n1;function tP(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function iP(e){return null!=e.clipStartAngle&&null!=e.clipEndAngle}function sP(e,t){const{clipStartAngle:i,clipEndAngle:s,innerRadius:r,outerRadius:n}=e;return new eP(i,t?i:s,r,n)}function rP(e,t){const i=e?"initial":"update";return{node:{fromFn(t,s){const r=t.previousDatum;let{startAngle:n,endAngle:o}=r??s;const a=null!=r&&iP(r)?sP(r,e):void 0,l=iP(s)?sP(s,e):void 0;let c;return null!=a&&null!=l?c=a:null==a&&null!=l?(c=l,n=s.startAngle,o=s.endAngle):null!=a&&null==l?(c=void 0,n=s.startAngle,o=s.endAngle):e&&(o=n),{startAngle:n,endAngle:o,clipSector:c,phase:i}},toFn(e,t){const{startAngle:i,endAngle:s}=t;let r;return iP(t)&&(r=sP(t,!1)),{startAngle:i,endAngle:s,clipSector:r}},applyFn(e,t){const{startAngle:i,endAngle:s}=t;let{clipSector:r}=t;null!=r&&(r=new eP(Math.max(i,r.startAngle),Math.min(s,r.endAngle),r.innerRadius,r.outerRadius));const n=null==r||tP(i,s,r);e.startAngle=i,e.endAngle=s,e.clipSector=r,e.visible=n}},needle:{fromFn(s){let{angle:r}=s.previousDatum??s.datum;return e&&(r=t),{rotation:r,phase:i}},toFn(e,t){const{angle:i}=t;return{rotation:i}}}}}function nP(e,t){const{startAngle:i,endAngle:s}=t,r=function(e){const{startAngle:t,endAngle:i,clipStartAngle:s,clipEndAngle:r,innerRadius:n,outerRadius:o}=e;if(null!=s&&null!=r)return new eP(Math.max(s,t),Math.min(r,i),n,o)}(t);return{startAngle:i,endAngle:s,clipSector:r,visible:null==r||tP(i,s,r)}}function oP(e,t){const{angle:i}=t;return{rotation:i}}var aP={top:0,middle:.5,bottom:1},{fromToMotion:lP,resetMotion:cP,CachedTextMeasurerPool:hP,SeriesNodePickMode:dP,StateMachine:uP,createDatumId:pP,normalizeAngle360:gP,normalizeAngle360Inclusive:mP,isBetweenAngles:fP,sectorBox:yP,toDegrees:vP,toRadians:CP,BBox:bP,Group:SP,PointerEvents:wP,Selection:xP,Sector:EP,SectorBox:MP,Text:AP,Marker:TP,getColorStops:DP}=s.n1,IP={inside:90,middle:0,outside:-90},RP=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],PP=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],kP=class extends s.n1.Series{constructor(e){super({moduleCtx:e,useLabelLayer:!0,pickModes:[dP.EXACT_SHAPE_MATCH,dP.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new JR,this.scale=new ie,this.scaleGroup=this.contentGroup.appendChild(new SP({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new SP({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new SP({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new SP({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new SP({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new SP({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new SP({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new SP({name:"tickGroup"})),this.scaleSelection=xP.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=xP.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=xP.select(this.itemNeedleGroup,OR),this.targetSelection=xP.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=xP.select(this.itemTargetLabelGroup,AP),this.labelSelection=xP.select(this.itemLabelGroup,AP),this.highlightTargetSelection=xP.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=xP.select(this.tickGroup,s.n1.TransformableText),this.datumUnion=new Ww,this.animationState=new uP("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=wP.None,this.tickGroup.pointerEvents=wP.None,this.itemNeedleGroup.pointerEvents=wP.None,this.itemLabelGroup.pointerEvents=wP.None}get hasData(){return null!=this.properties.value}nodeFactory(){return new EP}markerFactory(){const e=new TP;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return Kw(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:n,outerRadius:o}=this.properties,{min:a,max:l,label:c,interval:h}=n,d=CP(t.startAngle-90),u=CP(t.endAngle-90),p=mP(u-d)>Math.PI,g=p||fP(1.5*Math.PI,d,u),m=p||fP(0*Math.PI,d,u),f=p||fP(.5*Math.PI,d,u),y=p||fP(1*Math.PI,d,u);let v,C;v=y&&!m?"right":!y&&m?"left":"center",C=g&&!f?"bottom":!g&&f?"top":"middle";const b=yP({startAngle:d,endAngle:u,innerRadius:0,outerRadius:.5}),S=2*-(b.x+b.width/2),w=2*-(b.y+b.height/2),x=Math.min(i/b.width,s/b.height);e.domain=[a,l],e.range=[d,u],e.arcLength=x/2;const{maxSpacing:E,minSpacing:M}=h,{arcLength:A}=e,T=E?Math.floor(A/E):1,D=M?Math.floor(A/M):1/0,I=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),R=Math.max(T,Math.min(D,I)),P=h.values??e.ticks({nice:!1,interval:h.step,minTickCount:T,maxTickCount:D,tickCount:R})?.ticks??[],k=P.reduce((e,t)=>Math.max(e,"number"==typeof t?(0,r.o3)(t):0),0),L=e.tickFormatter({domain:e.domain,ticks:P,fractionDigits:k,specifier:"string"==typeof c.format?c.format:void 0}),N=c.getFont(),_=P.map((t,i)=>{let s;c.formatter&&(s=Yw(this.ctx,c.formatter,{value:t,index:i,domain:e.domain,boundSeries:void 0})),void 0===s&&(s=L(t));const{width:r,height:n}=hP.measureText(s,{font:N});return{index:i,value:t,text:s,width:r,height:n}}),O=_.reduce((e,t)=>Math.max(e,t.width),0),F=_.reduce((e,t)=>Math.max(e,t.height),0),G=c.enabled?Math.max(O,F)+c.spacing:0,B=Math.max(.5*x-G,0),V=o??B;return this.centerX=i/2+S*V,this.centerY=s/2+w*V,this.radius=V,this.textAlign=v,this.verticalAlign=C,_}createConicGradient(e,t){const{scale:i}=this,{domain:s,range:r}=i,[n,o]=r,{defaultColorRange:a}=this.properties,l=gP((n+o)/2+Math.PI),c=mP(o-n);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:DP(e,a,s,t).map(({color:e,stop:t})=>(t=Math.min(Math.max(t,0),1),{stop:t=((t=(n+c*t-l)/(2*Math.PI))%1+1)%1,color:e})),rotation:vP(l)+90}}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this;return new bP(e-i,t-i,2*i,2*i)}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(e=>{const{text:i=t.text,value:s=t.value??0,shape:r=t.shape??"triangle",rotation:n=t.rotation??0,strokeWidth:o=t.strokeWidth??0,placement:a=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0,fill:h=t.fill??"black",fillOpacity:d=t.fillOpacity??1,stroke:u=t.stroke??"black",strokeOpacity:p=t.strokeOpacity??1,lineDash:g=t.lineDash??[0],lineDashOffset:m=t.lineDashOffset??0}=e,{enabled:f=t.label.enabled,color:y=t.label.color??"black",fontStyle:v=t.label.fontStyle??"normal",fontWeight:C=t.label.fontWeight??"normal",fontSize:b=t.label.fontSize,fontFamily:S=t.label.fontFamily,spacing:w=t.label.spacing??0}=e.label;return{text:i,value:s,shape:r,placement:a,spacing:l,size:c,rotation:n,fill:h,fillOpacity:d,stroke:u,strokeWidth:o,strokeOpacity:p,lineDash:g,lineDashOffset:m,label:{enabled:f,color:y,fontStyle:v,fontWeight:C,fontSize:b,fontFamily:S,spacing:w}}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:r}=i,{placement:n,spacing:o,size:a}=e,l=t*r,c=t*s;switch(n){case"inside":return Math.max(c-o-a/2,0);case"outside":return l+o+a/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:r,label:n}=e,{spacing:o,color:a,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=n,u=t.convert(i),p=gP(u)/(Math.PI/2)|0,g=s/2+o;let m,f,y,v;switch(r){case"outside":({textAlign:m,textBaseline:f}=RP[p]),y=g*Math.cos(u),v=g*Math.sin(u);break;case"inside":({textAlign:m,textBaseline:f}=PP[p]),y=-g*Math.cos(u),v=-g*Math.sin(u);break;default:m="center",f="bottom",y=0,v=-g}return{offsetX:y,offsetY:v,fill:a,textAlign:m,textBaseline:f,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:r,centerX:n,centerY:o}=this,{value:a,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:g,scale:m,label:f,secondaryLabel:y}=s,{outerRadius:v=r*c,innerRadius:C=r*l}=s,b=this.getTargets(),S=[],w=[],x=[],E=[],M=[],A="item"===u,T=i.convert(i.domain[0]),D=i.convert(a),I=Math.ceil(mP(D-T)*r);let R=h.enabled?h.interval.getSegments(i,I):void 0;const P=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",k=m.fill??(g.enabled&&0===m.fills.length?m.defaultFill:void 0)??this.createConicGradient(m.fills,m.fillMode);if(null==R&&A){const e={value:a,segmentStart:Math.min(...i.domain),segmentEnd:Math.max(...i.domain)},t=Math.min(d,(v-C)/2)/((C+v)/2);S.push({series:this,itemId:"value",datum:e,datumIndex:{type:0},type:0,centerX:n,centerY:o,outerRadius:v,innerRadius:C,startAngle:T-t,endAngle:D+t,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:P}),M.push({series:this,itemId:"scale",datum:e,datumIndex:{type:0},type:0,centerX:n,centerY:o,outerRadius:v,innerRadius:C,startAngle:i.range[0]-t,endAngle:i.range[1]+t,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:k})}else{R??(R=i.domain);for(let e=0;e<R.length-1;e++){const t=R[e],s=R[e+1],r={value:a,segmentStart:t,segmentEnd:s},l=0===e,c=e===R.length-2,h=i.convert(t),u=i.convert(s);S.push({series:this,itemId:`value-${e}`,datum:r,datumIndex:{type:0},type:0,centerX:n,centerY:o,outerRadius:v,innerRadius:C,startAngle:h,endAngle:u,clipStartAngle:T,clipEndAngle:D,startCornerRadius:A||l?d:0,endCornerRadius:A||c?d:0,fill:P}),M.push({series:this,itemId:`scale-${e}`,datum:r,datumIndex:{type:0},type:0,centerX:n,centerY:o,outerRadius:v,innerRadius:C,startAngle:h,endAngle:u,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:A||l?d:0,endCornerRadius:A||c?d:0,fill:k})}}if(!p.enabled&&f.enabled){const{text:e,color:t,fontSize:i,minimumFontSize:s,fontStyle:r,fontWeight:l,fontFamily:c,lineHeight:h,formatter:d=e=>this.formatLabel(e.value)}=f;E.push({label:"primary",centerX:n,centerY:o,text:e,value:a,fill:t,fontSize:i,minimumFontSize:s,fontStyle:r,fontWeight:l,fontFamily:c,lineHeight:h,formatter:d})}if(!p.enabled&&y.enabled){const{text:e,color:t,fontSize:i,minimumFontSize:s,fontStyle:r,fontWeight:l,fontFamily:c,lineHeight:h,formatter:d}=y;E.push({label:"secondary",centerX:n,centerY:o,text:e,value:a,fill:t,fontSize:i,minimumFontSize:s,fontStyle:r,fontWeight:l,fontFamily:c,lineHeight:h,formatter:d})}if(p.enabled){let e=null!=p.radiusRatio?r*p.radiusRatio:C;e=Math.max(e-p.spacing,0);const t=i.convert(a);x.push({centerX:n,centerY:o,radius:e,angle:t,series:this})}for(let e=0;e<b.length;e+=1){const t=b[e],{value:s,text:r,size:a,shape:l,fill:c,fillOpacity:h,stroke:d,strokeWidth:u,strokeOpacity:p,lineDash:g,lineDashOffset:m}=t;if(s<Math.min(...i.domain)||s>Math.max(...i.domain))continue;const f=this.getTargetRadius(t),y=i.convert(s),v=CP(t.rotation+IP[t.placement]);w.push({series:this,itemId:`target-${e}`,midPoint:{x:f*Math.cos(y)+n,y:f*Math.sin(y)+o},datum:{value:s},datumIndex:{type:1,index:e},type:1,value:s,text:r,centerX:n,centerY:o,shape:l,radius:f,angle:y,rotation:v,size:a,fill:c,fillOpacity:h,stroke:d,strokeOpacity:p,strokeWidth:u,lineDash:g,lineDashOffset:m,label:this.getTargetLabel(t)})}return{itemId:t,nodeData:S,needleData:x,targetData:w,labelData:E,scaleData:M,tickData:e}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(null!=e&&e.series===this&&1===e.type)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:s,targetSelection:r,targetLabelSelection:n,scaleSelection:o,highlightTargetSelection:a,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],m=this.contextNodeData?.tickData??[],f=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:n}),this.updateTargetLabelNodes({targetLabelSelection:n}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null!=f?[f]:[],targetSelection:a}),this.updateTargetNodes({targetSelection:a,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:m,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>pP(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:r}=this,{bar:n,segmentation:o}=r,a=o.spacing??0,{fillOpacity:l,stroke:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=n,p=this.getStrokeWidth(n.strokeWidth),g=i.animationManager.isSkipped(),m=this.getShapeFillBBox();t.each((e,t)=>{const{centerX:i,centerY:r,innerRadius:n,outerRadius:o,startCornerRadius:f,endCornerRadius:y,fill:v}=t;e.centerX=i,e.centerY=r,e.innerRadius=n,e.outerRadius=o,e.pointerEvents=this.properties.bar.enabled?s.n1.PointerEvents.All:s.n1.PointerEvents.None,e.fill=v,e.fillBBox=m,e.fillOpacity=l,e.stroke=c,e.strokeOpacity=h,e.strokeWidth=p,e.lineDash=d,e.lineDashOffset=u,e.startOuterCornerRadius=f,e.startInnerCornerRadius=f,e.endOuterCornerRadius=y,e.endInnerCornerRadius=y,e.radialEdgeInset=(a+e.strokeWidth)/2,e.concentricEdgeInset=e.strokeWidth/2,(g||null==e.previousDatum)&&e.setProperties(nP(0,t))}),this.datumUnion.update(t,this.itemGroup,s.n1.Sector,(e,t,i)=>{e.clipSector??(e.clipSector=new MP(NaN,NaN,NaN,NaN)),e.centerX=t.centerX,e.centerY=t.centerY,e.outerRadius=e.clipSector.outerRadius=t.outerRadius,e.innerRadius=e.clipSector.innerRadius=t.innerRadius,e.startAngle=e.clipSector.startAngle=t.startAngle,e.startInnerCornerRadius=t.startInnerCornerRadius,e.startOuterCornerRadius=t.startOuterCornerRadius,e.endAngle=i.endAngle,e.clipSector.endAngle=i.clipSector?.endAngle??i.endAngle,e.endInnerCornerRadius=i.endInnerCornerRadius,e.endOuterCornerRadius=i.endOuterCornerRadius,e.pointerEvents=s.n1.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>pP(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{scale:i,segmentation:s}=this.properties,r=s.spacing??0,{fillOpacity:n,stroke:o,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:h}=i,d=this.getShapeFillBBox();t.each((e,t)=>{const{centerX:i,centerY:s,innerRadius:u,outerRadius:p,startCornerRadius:g,endCornerRadius:m,fill:f}=t;e.centerX=i,e.centerY=s,e.innerRadius=u,e.outerRadius=p,e.fill=f,e.fillBBox=d,e.fillOpacity=n,e.stroke=o,e.strokeOpacity=a,e.strokeWidth=l,e.lineDash=c,e.lineDashOffset=h,e.startOuterCornerRadius=g,e.startInnerCornerRadius=g,e.endOuterCornerRadius=m,e.endInnerCornerRadius=m,e.radialEdgeInset=(r+e.strokeWidth)/2,e.concentricEdgeInset=e.strokeWidth/2,e.setProperties(nP(0,t))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>pP([]))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:s,stroke:r,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((e,t)=>{const{centerX:h,centerY:d,radius:u}=t,p=2*u;e.d=OR.defaultPathData,e.fill=i,e.fillOpacity=s,e.stroke=r,e.strokeOpacity=n,e.strokeWidth=o/p,e.lineDash=a.map(e=>e/p),e.lineDashOffset=l/p,e.translationX=h,e.translationY=d,e.scalingX=p,e.scalingY=p,c&&e.setProperties(oP(0,t))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,e=>e.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e,s=i?this.properties.highlightStyle.item:void 0;t.each((e,t)=>{const{centerX:i,centerY:r,angle:n,radius:o,shape:a,size:l,rotation:c,fill:h,fillOpacity:d,stroke:u,strokeOpacity:p,strokeWidth:g,lineDash:m,lineDashOffset:f}=t;e.shape="line"===a?qw:a,e.size=l,e.fill=s?.fill??h,e.fillOpacity=s?.fillOpacity??d,e.stroke=s?.stroke??u,e.strokeOpacity=s?.strokeOpacity??p,e.strokeWidth=s?.strokeWidth??g,e.lineDash=s?.lineDash??m,e.lineDashOffset=s?.lineDashOffset??f,e.translationX=i+o*Math.cos(n),e.translationY=r+o*Math.sin(n),e.rotation=n+c})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((e,t)=>{const{centerX:i,centerY:s,radius:r,angle:n,text:o}=t,{offsetX:a,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:m}=t.label;null!=o?(e.visible=!0,e.x=i+r*Math.cos(n)+a,e.y=s+r*Math.sin(n)+l,e.text=o,e.fill=c,e.fontStyle=h,e.fontWeight=d,e.fontSize=u,e.fontFamily=p,e.textAlign=g,e.textBaseline=m):e.visible=!1})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,e=>e.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((e,t)=>{e.fill=t.fill,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontFamily=t.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,e=>e.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:r,properties:n}=this,{enabled:o,color:a,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=n.scale.label,p=CP(n.scale.label.rotation??0);e.tickSelection.each((e,n)=>{if(!o)return void(e.visible=!1);e.visible=!0,e.text=n.text,e.fill=a,e.fontFamily=l,e.fontSize=c,e.fontStyle=h,e.fontWeight=d,e.textAlign="center",e.textBaseline="middle";const g=t.convert(n.value),{width:m,height:f}=n,y=Math.abs(i*Math.cos(g)),v=Math.abs(i*Math.sin(g)),C=Math.min(Math.max(Math.abs(i/Math.tan(g)),y-m/2),y+m/2),b=Math.min(Math.max(Math.abs(i*Math.tan(g)),v-f/2),v+f/2),S=Math.hypot(C,b),w=s+(S+u)*Math.cos(g),x=r+(S+u)*Math.sin(g);e.x=w,e.y=x,e.rotationCenterX=w,e.rotationCenterY=x,e.rotation=p})}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(null==e.text)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:r}=this,{spacing:n,innerRadiusRatio:o}=this.properties;!function(e,t,i,s,r,n){const{padding:o,textAlign:a,verticalAlign:l}=s;let c,h;if(i.each((e,t)=>{"primary"===t.label?c=t:"secondary"===t.label&&(h=t)}),null==c)return;const d=$w(e.id,t,c,n?.label);if(null==d)return;const u=null!=h?$w(e.id,t,h,n?.secondaryLabel):void 0,p={padding:o},g="center"===a?2:1,m="middle"===l?2:1,f=e=>({width:Math.sqrt(Math.max(r**2-(e/m)**2,0))*g,height:Math.min(e,m*r),meta:null});let y,v,C;if(null!=h&&null!=u){const e=tf(d,c,u,h,p,f);y=e?.label,v=e?.secondaryLabel,C=e?.height??0}else{const e=sf(d,c,p,f);y=e?.[0],v=void 0,C=e?.[0].height??0}const b=C*aP[l];i.each((e,t)=>{let i;if("primary"===t.label?i=y:"secondary"===t.label&&(i=v),null==i)return void(e.visible=!1);e.visible=!0,e.text=i.text,e.fontSize=i.fontSize,e.lineHeight=i.lineHeight,e.textAlign=a,e.textBaseline="middle";const s="primary"===t.label?i.height/2:C-i.height/2;e.y=t.centerY+s-b,e.x=t.centerX})}(this,this.ctx,t,{padding:n,textAlign:s,verticalAlign:r},i*o,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),cP([this.datumSelection],nP),cP([this.needleSelection],oP),this.formatLabelText()}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,s,r,n;if(this.labelSelection.each((t,o)=>{t.opacity=1,"primary"===o.label?(i=t.previousDatum?.value??e.from??o.value,s=o.value):"secondary"===o.label&&(r=t.previousDatum?.value??e.from??o.value,n=o.value)}),this.labelsHaveExplicitText());else if(null==s||null==n)this.formatLabelText();else if(i===s&&r===n)this.formatLabelText({label:s,secondaryLabel:n});else{const o=`${this.id}_labels`;t.animate({id:o,groupId:"label",from:{label:i,secondaryLabel:r},to:{label:s,secondaryLabel:n},phase:e.phase??"update",onUpdate:e=>this.formatLabelText(e)})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=rP(!0,this.scale.range[0]);lP(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),lP(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),lP(this.id,"label",e,[this.labelSelection],jw,(e,t)=>t.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=rP(!1,this.scale.range[0]);lP(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),lP(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let r,n;if(0===e.type?(r=i.value,n=i.label.text):({value:r,text:n}=i.targets[e.index]),null!=r)return this.formatTooltipWithContext(s,{data:[{label:n,fallbackLabel:"Value",value:this.formatLabel(r)}]},{seriesId:t,title:void 0,datum:void 0,value:r})}pickNodeClosestDatum(e){return Xw(this,e)}pickFocus(e){return Zw(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((e,i)=>{const s=$w(this.id,this.ctx,i);null!=s&&t.push(s)}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}};kP.className="RadialGaugeSeries",kP.type="radial-gauge";var{FONT_SIZE_RATIO:LP}=s.n1,NP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:e=>new kP(e),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},s.n1.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",s.n1.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[LP.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}}}},_P={type:"series",name:"radial-gauge",chartType:"gauge",enterprise:!0,options:s.n1.radialGaugeSeriesOptionsDef,create:e=>new kP(e)};function OP(e){e.nodes.sort((e,t)=>Math.round(100*(e.datum.y-t.datum.y))/100||-(e.datum.size-t.datum.size))}function FP(e,t,i,s,r,n,o,a){const l=(i-e)/(s-t),c=(o-r)/(a-n),h=(l*c*(n-t)+e*c-r*l)/(c-l);return e<i?h>e&&h<Math.min(i,o):h<e&&h>Math.max(i,o)}function GP(e,t){let i=!1;const s=e.nodes.filter(e=>1===t(e).length);let r=!0;for(let e=0;r&&e<s.length;e+=1){r=!1;for(let e=0;e<s.length-1;e+=1){const{datum:n}=s[e],o=t(s[e])[0].node.datum,{datum:a}=s[e+1],l=t(s[e+1])[0].node.datum;if(!(FP(n.x,n.y,o.x,o.y,a.x,a.y,l.x,l.y)||FP(n.x,n.y+n.height/2,o.x,o.y+o.height/2,a.x,a.y+a.height/2,l.x,l.y+l.height/2)||FP(n.x,n.y+n.height,o.x,o.y+o.height,a.x,a.y+a.height,l.x,l.y+l.height)))continue;const c=s[e];s[e]=s[e+1],s[e+1]=c;const h=n.y;n.y=a.y+a.height-n.height,a.y=h,i=!0,r=!0}}return i}function BP(e){let t=!1;return OP(e),t=GP(e,e=>e.linksBefore)||t,t=GP(e,e=>e.linksAfter)||t,t}function VP(e,t,i,s){return e.nodes.forEach(({datum:e,linksBefore:t,linksAfter:r})=>{const n=1===s?r:t,o=function(e){if(0===e.length)return;let t=0,i=0;for(const{node:{datum:s}}of e)t+=s.y*s.size,i+=s.size;return t/i}(1===s?t:r);if(null!=o){const t=0!==n.length?i:1;e.y=e.y+(o-e.y)*t}}),function(e,t){const{nodes:i}=e,{seriesRectHeight:s,nodeSpacing:r}=t;OP(e);let n=0,o=0;for(const{datum:e}of i){const t=Math.max(o-e.y,0);e.y+=t,n+=t,o=e.y+e.height+r}if(o-r<s)return n>0;let a=s;for(let e=i.length-1;e>=0;e-=1){const{datum:t}=i[e],s=t.y+t.height,o=Math.min(a-s,0);t.y+=o,n+=o,a=t.y-r}return!0}(e,t)}function HP(e,t,i){let s=!1;for(const r of e)s=VP(r,t,i,1)||s;return s}function UP(e,t,i){let s=!1;for(let r=e.length-1;r>=0;r-=1)s=VP(e[r],t,i,-1)||s;return s}function zP(e){let t=!1;for(let i=e.length-1;i>=0;i-=1)t=BP(e[i])||t;return t}var{BBox:WP,Path:jP,SceneChangeDetection:KP,splitBezier:$P}=s.n1;function YP(e,t,i,s,r,n,o,a,l,c){let h,d;if(r!==i&&l!==o){const e=-(s-t)/(r-i),c=-(a-n)/(l-o);h=(o-i+e*t-c*n)/(e-c),d=e*(h-t)+i}else if(r===i&&l!==o)h=t,d=-(a-n)/(l-o)*(h-a)+l;else{if(r===i||l!==o)throw new Error("Offsetting flat bezier curve");h=a,d=-(s-t)/(r-i)*(h-t)+i}const u=Math.hypot(i-d,t-h),p=(u+c)/u,g=Math.hypot(l-d,a-h),m=(g+c)/g,f=h+(s-h)*p,y=d+(r-d)*p,v=h+(n-h)*m,C=d+(o-d)*m,b=h+(a-h)*m,S=d+(l-d)*m;e.cubicCurveTo(f,y,v,C,b,S)}var qP=class extends jP{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new WP(e,i,t,s)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.x1+t,s=this.x2-t,r=this.y1+t,n=this.y2+t,o=this.height-2*t;if(o<0||i>s)return;const a=i,l=r+o/2,c=(i+s)/2,h=r+o/2,d=(i+s)/2,u=n+o/2,p=s,g=n+o/2;if(e.moveTo(a,l-o/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1<this.height*Math.SQRT2)e.cubicCurveTo(c,h-o/2,d,u-o/2,p,g-o/2),e.lineTo(p,g+o/2),e.cubicCurveTo(d,u+o/2,c,h+o/2,a,l+o/2);else{const[t,i]=$P(a,l,c,h,d,u,p,g,.5),s=(n>r?1:-1)*o/2;YP(e,t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y,s),YP(e,i[0].x,i[0].y,i[1].x,i[1].y,i[2].x,i[2].y,i[3].x,i[3].y,-s),e.lineTo(p,g+o/2),YP(e,i[3].x,i[3].y,i[2].x,i[2].y,i[1].x,i[1].y,i[0].x,i[0].y,s),YP(e,t[3].x,t[3].y,t[2].x,t[2].y,t[1].x,t[1].y,t[0].x,t[0].y,-s)}e.closePath()}};a([KP()],qP.prototype,"x1",2),a([KP()],qP.prototype,"x2",2),a([KP()],qP.prototype,"y1",2),a([KP()],qP.prototype,"y2",2),a([KP()],qP.prototype,"height",2),a([KP()],qP.prototype,"inset",2);var{BaseProperties:XP,FillGradientDefaults:ZP,FillPatternDefaults:QP,FillImageDefaults:JP,SeriesTooltip:ek,SeriesProperties:tk,Property:ik,Label:sk}=s.n1,rk=class extends sk{constructor(){super(...arguments),this.spacing=1}};a([ik],rk.prototype,"spacing",2);var nk=class extends XP{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};a([ik],nk.prototype,"fill",2),a([ik],nk.prototype,"fillOpacity",2),a([ik],nk.prototype,"stroke",2),a([ik],nk.prototype,"strokeOpacity",2),a([ik],nk.prototype,"strokeWidth",2),a([ik],nk.prototype,"lineDash",2),a([ik],nk.prototype,"lineDashOffset",2),a([ik],nk.prototype,"itemStyler",2);var ok=class extends XP{constructor(){super(...arguments),this.spacing=1,this.width=1,this.alignment="justify",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};a([ik],ok.prototype,"spacing",2),a([ik],ok.prototype,"width",2),a([ik],ok.prototype,"alignment",2),a([ik],ok.prototype,"fill",2),a([ik],ok.prototype,"fillOpacity",2),a([ik],ok.prototype,"stroke",2),a([ik],ok.prototype,"strokeOpacity",2),a([ik],ok.prototype,"strokeWidth",2),a([ik],ok.prototype,"lineDash",2),a([ik],ok.prototype,"lineDashOffset",2),a([ik],ok.prototype,"itemStyler",2);var ak=class extends tk{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new ZP,this.fillPatternDefaults=new QP,this.fillImageDefaults=new JP,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new rk,this.link=new nk,this.node=new ok,this.tooltip=new ek}};a([ik],ak.prototype,"nodes",2),a([ik],ak.prototype,"fromKey",2),a([ik],ak.prototype,"toKey",2),a([ik],ak.prototype,"idKey",2),a([ik],ak.prototype,"idName",2),a([ik],ak.prototype,"labelKey",2),a([ik],ak.prototype,"labelName",2),a([ik],ak.prototype,"sizeKey",2),a([ik],ak.prototype,"sizeName",2),a([ik],ak.prototype,"fillGradientDefaults",2),a([ik],ak.prototype,"fillPatternDefaults",2),a([ik],ak.prototype,"fillImageDefaults",2),a([ik],ak.prototype,"defaultColorRange",2),a([ik],ak.prototype,"defaultPatternFills",2),a([ik],ak.prototype,"fills",2),a([ik],ak.prototype,"strokes",2),a([ik],ak.prototype,"label",2),a([ik],ak.prototype,"link",2),a([ik],ak.prototype,"node",2),a([ik],ak.prototype,"tooltip",2);var{Transformable:lk,applyShapeStyle:ck,SeriesNodePickMode:hk,CachedTextMeasurerPool:dk,TextWrapper:uk,TextUtils:pk,createDatumId:gk,getShapeStyle:mk,Rect:fk,BBox:yk}=s.n1,vk=class extends wb{constructor(e){super({moduleCtx:e,pickModes:[hk.NEAREST_NODE,hk.EXACT_SHAPE_MATCH]}),this.properties=new ak}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new qP}nodeFactory(){return new fk}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,label:{spacing:a},node:{spacing:l,width:c,alignment:h}}=this.properties,{nodeGraph:d,links:u,maxPathLength:p}=this.getNodeGraph(e=>({...e,x:NaN,y:NaN,width:c,height:NaN}),e=>({...e,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),g=d,m=this.isLabelEnabled()?(t-c)*(1-p/(p+1)):0,f=(t-c-2*m)/(p-1),y=[];for(let e=0;e<p;e+=1){const t=m+e*f;y.push({index:e,size:0,nodes:[],x:t})}g.forEach(e=>{const{datum:t,linksBefore:i,linksAfter:r,maxPathLengthBefore:a,maxPathLengthAfter:l}=e,c=Math.max(i.reduce((e,{link:t})=>e+t.size,0),r.reduce((e,{link:t})=>e+t.size,0));if(0===i.length&&0===r.length||0===c)return void(e.columnIndex=-1);let d;switch(h){case"left":d=y[a];break;case"right":d=y[p-1-l];break;case"center":if(0!==i.length)d=y[a];else if(0!==r.length){const e=r.reduce((e,t)=>Math.min(e,t.node.maxPathLengthBefore),p)-1;d=y[e]}else d=y[0];break;case"justify":d=0===r.length?y[p-1]:y[a]}t.x=d.x,t.size=c;const u=this.getLabelText(this.properties.label,{datum:t.datum,value:t.label,fromKey:s,toKey:n,sizeKey:o,size:c});t.label=String(u),d.nodes.push(e),d.size+=c,e.columnIndex=d.index}),g.forEach(e=>{let t=1/0,i=0;e.linksAfter.forEach(e=>{const s=e.node,{columnIndex:r}=s;r<t?(t=r,i=s.datum.size):r===t&&(i=Math.max(i,s.datum.size))}),e.closestColumnIndex=t,e.maxSizeOfClosestNodesAfter=i});const v=y.reduce((e,{size:t,nodes:s})=>{const r=(1-(s.length-1)*(l/i))/t;return Math.min(e,r)},1/0);for(let e=y.length-1;e>=0;e-=1)y[e].nodes.sort((e,t)=>e.closestColumnIndex-t.closestColumnIndex||e.maxSizeOfClosestNodesAfter-t.maxSizeOfClosestNodesAfter||e.datum.size-t.datum.size);!function(e,t){e.forEach(e=>{!function({nodes:e,size:t},{seriesRectHeight:i,nodeSpacing:s,sizeScale:r}){let n=(i-(i*t*r+s*(e.length-1)))/2;e.forEach(({datum:e})=>{const t=i*e.size*r;e.y=n,e.height=t,n+=t+s})}(e,t)});let i=!1;for(let s=0;s<6;s+=1){const s=HP(e,t,1);i=UP(e,t,.5);const r=zP(e);if(!s&&!i&&!r)break}i&&(HP(e,t,1),zP(e))}(y,{seriesRectHeight:i,nodeSpacing:l,sizeScale:v});let C=!1;if(g.forEach(({datum:e,linksBefore:t,linksAfter:s})=>{C||(C=e.height<0);const r=e.y+e.height,n=t=>t.sort((t,i)=>{const s=t.node.datum,n=i.node.datum,o=s.y+s.height,a=n.y+n.height;return Math.atan2(s.y-e.y,Math.abs(s.x-e.x))-Math.atan2(n.y-e.y,Math.abs(n.x-e.x))+(Math.atan2(o-r,Math.abs(s.x-e.x))-Math.atan2(a-r,Math.abs(n.x-e.x)))});let o=e.y;n(t).forEach(({link:e})=>{e.y2=o,o+=e.size*i*v});let a=e.y;n(s).forEach(({link:e})=>{e.y1=a,a+=e.size*i*v})}),C)return void r.Vy.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");const b=[],S=[],{fontSize:w}=this.properties.label,x=this.properties.label.getFont();return y.forEach((e,i)=>{const s=0===i,r=i===y.length-1;let n=-1/0;e.nodes.sort((e,t)=>e.datum.y-t.datum.y),e.nodes.forEach(({datum:e})=>{if(e.midPoint={x:e.x+e.width/2,y:e.y+e.height/2},b.push(e),null==e.label)return;const i=s?e.x-a:e.x+e.width+a,o=e.y+e.height/2;let l;if(!s&&!r){const i=o-pk.getLineHeight(w),s=o+pk.getLineHeight(w);let r=t;g.forEach(({datum:t})=>{t.x>e.x&&Math.max(t.y,i)<=Math.min(t.y+t.height,s)&&(r=Math.min(r,t.x-a))});const n=r-e.x-2*a;l=uk.wrapText(e.label,{maxWidth:n,maxHeight:e.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(null==l||""===l){const t=s||r?a:2*a;l=uk.wrapText(e.label,{maxWidth:f-t,maxHeight:e.height,font:this.properties.label,textWrap:"never"})}if(""===l)return;const{height:c}=dk.measureText(l,{font:x,textAlign:"left",textBaseline:"middle"}),h=o+c/2;o-c/2>=n&&(S.push({x:i,y:o,leading:s,text:l}),n=h)})}),u.forEach(e=>{const{fromNode:t,toNode:s,size:r}=e;e.height=i*r*v,e.x1=t.x+c,e.x2=s.x,e.midPoint={x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2+e.height/2},b.push(e)}),{itemId:e,nodeData:b,labelData:S}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o}=this.properties.label;t.each((e,{x:t,y:a,leading:l,text:c})=>{e.visible=!0,e.x=t,e.y=a,e.text=c,e.fill=i,e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textAlign=l?"right":"left",e.textBaseline="middle"})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>gk([e.type,e.id]))}getBaseNodeStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:r,strokeOpacity:n,lineDash:o,lineDashOffset:a}=t.node,l=e?t.highlightStyle.item:void 0;return mk({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??r,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??a},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getNodeStyleOverrides(e,t,i,s,r,n,o){const{id:a,properties:l}=this,{fills:c,strokes:h,defaultColorRange:d,defaultPatternFills:u}=l,{itemStyler:p}=l.node,g=n.fill??c[i%c.length],m=n.stroke??h[i%h.length],f=d[i%d.length].map(e=>({color:e})),y=u[i%u.length];let v;if(o||(v??(v={}),v.fill=g,v.stroke=m),null!=p){const i=this.cachedDatumCallback(gk(e,"node",o?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:l=0,lineDash:c=[],lineDashOffset:h=0}=n;return this.callWithContext(p,{seriesId:a,datum:t,highlighted:o,label:r,size:s,fill:g,fillOpacity:e,stroke:m,strokeOpacity:i,strokeWidth:l,lineDash:c,lineDashOffset:h})});v??(v={}),Object.assign(v,i)}return mk(v,{...this.properties.fillGradientDefaults.toJson(),colorStops:f},{...this.properties.fillPatternDefaults.toJson(),fill:y,stroke:y},this.properties.fillImageDefaults)}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseNodeStyle(i),r=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:n,size:o,label:a}=t,l=this.getNodeStyleOverrides(String(n.index),t.datum,n.index,o,a,s,i);e.x=t.x,e.y=t.y,e.width=Math.max(t.width,0),e.height=Math.max(t.height,0),ck(e,s,l,r)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new yk(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>gk([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(e){const{properties:t}=this,{fill:i,fillOpacity:s,stroke:r,strokeOpacity:n,lineDash:o,lineDashOffset:a}=t.link,l=e?t.highlightStyle.item:void 0;return mk({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??r,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.link.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??a},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getLinkStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,{fills:a,strokes:l,defaultColorRange:c,defaultPatternFills:h}=o,{itemStyler:d}=o.link,u=s.fill??a[i%a.length],p=s.stroke??l[i%l.length],g=c[i%c.length].map(e=>({color:e})),m=h[i%h.length];let f;if(r||(f??(f={}),f.fill=u,f.stroke=p),null!=d){const i=this.cachedDatumCallback(gk(e,"link",r?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:o=0,lineDash:a=[],lineDashOffset:l=0}=s;return this.callWithContext(d,{seriesId:n,datum:t,highlighted:r,fill:u,fillOpacity:e,stroke:p,strokeOpacity:i,strokeWidth:o,lineDash:a,lineDashOffset:l})});f??(f={}),Object.assign(f,i)}return mk(f,{...this.properties.fillGradientDefaults.toJson(),colorStops:g},{...this.properties.fillPatternDefaults.toJson(),fill:m,stroke:m},this.properties.fillImageDefaults)}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getBaseLinkStyle(i),r=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:n}=t,o=t.fromNode.datumIndex,a=this.getLinkStyleOverrides(String(n.index),t.datum,o.index,s,i);e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.height=t.height,ck(e,s,a,r),e.inset=e.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:r}=this,{fromKey:n,toKey:o,sizeKey:a,sizeName:l,tooltip:c}=r,h=this.contextNodeData?.nodeData.find(t=>t.datumIndex.type===e.type&&t.datumIndex.index===e.index);if(null==h)return;const d=0===h.type?h.fromNode.index:h.index,u=0===h.type?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=0===e.type?i?.dataSources.get(this.id)?.[e.index]:s?.dataSources.get(this.id)?.[e.index],g=h.size;let m;if(0===h.type){const t=h.fromNode.datumIndex,i=this.getBaseLinkStyle(!1);Object.assign(i,this.getLinkStyleOverrides(String(e.index),p,t.index,i,!1)),m=i}else{const t=h.label,i=this.getBaseNodeStyle(!1);Object.assign(i,this.getNodeStyleOverrides(String(e.index),p,e.index,g,t,i,!1)),m=i}return this.formatTooltipWithContext(c,{title:u,symbol:this.legendItemSymbol(h.type,d,m),data:null!=a?[{label:l,fallbackLabel:a,value:String(g)}]:[]},{seriesId:t,datum:p,title:u,fromKey:n,toKey:o,sizeKey:a,sizeName:l,size:g,...m})}computeFocusBounds(e){if(e instanceof fk){const{x:t,y:i,width:s,height:r}=e,n=new yk(t,i,s,r);return lk.toCanvas(this.contentGroup,n)}return e}};vk.className="SankeySeries",vk.type="sankey";var{commonSeriesOptionsDefs:Ck,sankeySeriesThemeableOptionsDef:bk}=s.n1,Sk={...bk,...Ck,type:(0,r.mw)((0,r.dY)("sankey")),fromKey:(0,r.mw)(r.Yj),toKey:(0,r.mw)(r.Yj),sizeKey:r.Yj,sizeName:r.Yj};Sk.fillGradientDefaults=(0,r._L)(r.wi),Sk.fillPatternDefaults=(0,r._L)(r.GY),Sk.fillImageDefaults=(0,r._L)(r.Zd),Sk.defaultColorRange=(0,r._L)((0,r.jk)((0,r.jk)(r.yW))),Sk.defaultPatternFills=(0,r._L)((0,r.jk)(r.yW));var wk={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:e=>new vk(e),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:s.n1.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0}},legend:{enabled:!1,toggleSeries:!1}}},xk={type:"series",name:"sankey",chartType:"flow-proportion",enterprise:!0,options:Sk,create:e=>new vk(e)},{HierarchySeriesProperties:Ek,HighlightStyle:Mk,SeriesTooltip:Ak,Property:Tk}=s.n1,Dk=class extends Mk{constructor(){super(...arguments),this.label=new cf,this.secondaryLabel=new cf}};a([Tk],Dk.prototype,"fill",2),a([Tk],Dk.prototype,"fillOpacity",2),a([Tk],Dk.prototype,"stroke",2),a([Tk],Dk.prototype,"strokeWidth",2),a([Tk],Dk.prototype,"strokeOpacity",2),a([Tk],Dk.prototype,"label",2),a([Tk],Dk.prototype,"secondaryLabel",2);var Ik=class extends Ek{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new Dk,this.label=new cf,this.secondaryLabel=new hf,this.tooltip=new Ak}};a([Tk],Ik.prototype,"sizeName",2),a([Tk],Ik.prototype,"labelKey",2),a([Tk],Ik.prototype,"secondaryLabelKey",2),a([Tk],Ik.prototype,"fillOpacity",2),a([Tk],Ik.prototype,"strokeWidth",2),a([Tk],Ik.prototype,"strokeOpacity",2),a([Tk],Ik.prototype,"cornerRadius",2),a([Tk],Ik.prototype,"sectorSpacing",2),a([Tk],Ik.prototype,"padding",2),a([Tk],Ik.prototype,"itemStyler",2),a([Tk],Ik.prototype,"highlightStyle",2),a([Tk],Ik.prototype,"label",2),a([Tk],Ik.prototype,"secondaryLabel",2),a([Tk],Ik.prototype,"tooltip",2);var{fromToMotion:Rk,normalizeAngle360:Pk,createDatumId:kk,Sector:Lk,Group:Nk,ScalableGroup:_k,Selection:Ok,TransformableText:Fk,BBox:Gk,applyShapeStyle:Bk,getShapeStyle:Vk}=s.n1,Hk=class extends s.n1.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function Uk(e,t=0,i=2*Math.PI/e.sumSize){for(const s of e.children){const e=t+s.sumSize*i;s.startAngle=t,s.endAngle=e,Uk(s,t,i),t=e}}var zk=class extends s.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=Hk,this.properties=new Ik,this.scalingGroup=this.contentGroup.appendChild(new _k),this.sectorGroup=this.scalingGroup.appendChild(new Nk),this.sectorLabelGroup=this.scalingGroup.appendChild(new Nk),this.highlightSectorGroup=this.scalingGroup.appendChild(new Nk),this.datumSelection=Ok.select(this.sectorGroup,Lk),this.labelSelection=Ok.select(this.sectorLabelGroup,Nk),this.highlightSelection=Ok.select(this.highlightSectorGroup,Lk)}processData(){super.processData(),Uk(this.rootNode)}updateSelections(){const e=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(null!=e?[e]:[],void 0,e=>this.getDatumId(e)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(null==t)return;if(null==t.seriesRect)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,e=>this.getDatumId(e)),this.labelSelection.update(i,e=>{e.append([new Fk({tag:0}),new Fk({tag:1})])},e=>this.getDatumId(e))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle:void 0;return Vk({fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,s,r,n){const{id:o,properties:a,colorScale:l}=this,{fills:c,strokes:h,itemStyler:d}=a,u=e[0],p=r.fill??c[u%c.length],g=r.stroke??h[u%h.length],m={};if(n||(m.fill=null!=s?l.convert(s):p,m.stroke=g),null!=d){const s=this.cachedDatumCallback(kk(e.join(":"),n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:t,depth:i,highlighted:n,fill:p,stroke:g,...r}));Object.assign(m,s)}return Vk(m,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(null==e||null==t)return;const{width:r,height:n}=e.seriesRect,{sectorSpacing:o=0,padding:a=0,cornerRadius:l,childrenKey:c,colorKey:h,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m}=this.properties;this.contentGroup.translationX=r/2,this.contentGroup.translationY=n/2;const f=.5*o,y=Math.min(r,n)/2,v=y/(i+1),C=-Math.PI/2,b={series:new Gk(-y,-y,2*y,2*y),axis:new Gk(-y,-y,2*y,2*y)};this.rootNode?.walk(e=>{const{startAngle:t,endAngle:i}=e;if(null!=e.depth){const s=(t+i)/2+C,r=(e.depth+.5)*v;e.midPoint.x=Math.cos(s)*r,e.midPoint.y=Math.sin(s)*r}}),this.rootNode?.walk(e=>{const{datum:t,depth:i,startAngle:s,endAngle:r,parent:n,sumSize:o}=e;let l,y;if(e.label=void 0,e.secondaryLabel=void 0,e.contentHeight=0,null!=t&&null!=i&&null!=u){const e=t[u];l=this.getLabelText(this.properties.label,{depth:i,datum:t,childrenKey:c,colorKey:h,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:e})}if(""===l&&(l=void 0),null!=t&&null!=i&&null!=p){const e=t[p];y=this.getLabelText(this.properties.secondaryLabel,{depth:i,datum:t,childrenKey:c,colorKey:h,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:e})}if(""===y&&(y=void 0),null==i)return;const b=i*v+f,S=(i+1)*v-f,w=b>f?f/b:f,x=S>f?f/S:f,E=r+w-(s+w),M=r+x-(s+x),A=nf(l,this.properties.label,y,this.properties.secondaryLabel,{padding:a},e=>{if(0===i&&n?.sumSize===o)return{width:2*Math.sqrt(S**2-(.5*e)**2),height:e,meta:0};const t=e,s=2*Math.sqrt(S**2-(b+t)**2),r=E<Math.PI?2*b*Math.tan(.5*E):1/0,a=Math.min(s,r),l=Math.PI/4;let c,h;return 0===i?(c=e,h=Math.sqrt(S**2-(c/2)**2)-e/(2*Math.tan(.5*M))):Pk(E)<l?(c=2*b*Math.tan(.5*E),h=Math.sqrt(S**2-(c/2)**2)-b):(h=0,c=0),a>=h?{width:a,height:t,meta:1}:{width:h,height:c,meta:2}});if(null==A)return;const{width:T,height:D,meta:I,label:R,secondaryLabel:P}=A,k=C+(s+r)/2,L=(Math.sin(k)>=0?3:12)&(Math.cos(k)>=0?6:9);let N;switch(I){case 0:N=0;break;case 1:{const e=S-.58*(v-D),t=Math.sqrt((S-a)**2-(T/2)**2);N=Math.min(e,t);break}case 2:N=0===i?.5*(D/(2*Math.tan(.5*E))+.5*T+(Math.sqrt(S**2-(.5*D)**2)-.5*T)):.5*(b+S)}if(null!=R){const{fontStyle:t="normal",fontFamily:i,fontWeight:s="normal",color:r="black"}=this.properties.label;e.label={...R,fontStyle:t,fontFamily:i,fontWeight:s,color:r,labelPlacement:I,circleQuarter:L,radius:N,theta:k}}if(null!=P){const{fontStyle:t="normal",fontFamily:i,fontWeight:s="normal",color:r="black"}=this.properties.secondaryLabel;e.secondaryLabel={...P,fontStyle:t,fontFamily:i,fontWeight:s,color:r,labelPlacement:I,circleQuarter:L,radius:N,theta:k}}e.contentHeight=A.height});const S=(e,t,i,r)=>{const{datum:n,datumIndex:o,depth:a,colorValue:c,startAngle:h,endAngle:d}=e;if(null==a)return void(t.visible=!1);t.visible=!0;const u=this.getItemStyleOverrides(o,n,a,c,i,r),p=u.fill??i.fill,g=u.strokeWidth??i.strokeWidth,m=s.n1.isGradientFill(p)&&"item"!==p.bounds?b:void 0;Bk(t,i,u,m),t.centerX=0,t.centerY=0,t.innerRadius=a*v,t.outerRadius=(a+1)*v,t.startAngle=h+C,t.endAngle=d+C,t.inset=f+.5*g,t.cornerRadius=l},w=this.getItemBaseStyle(!1);this.datumSelection.each((e,t)=>{S(t,e,w,!1)});const x=this.getItemBaseStyle(!0);this.highlightSelection.each((e,t)=>{S(t,e,x,!0)});const E=(e,t,i,s)=>{const{depth:r,contentHeight:n}=e,o=0===i,a=o?e.label:e.secondaryLabel;if(null==r||null==a)return void(t.visible=!1);const{labelPlacement:l,circleQuarter:c,radius:h,theta:d}=a;let u;switch(s&&(u=(o?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),t.text=a.text,t.fontSize=a.fontSize,t.lineHeight=a.lineHeight,t.fontStyle=a.fontStyle,t.fontFamily=a.fontFamily,t.fontWeight=a.fontWeight,t.fill=u??a.color,l){case 0:t.textAlign="center",t.textBaseline="top",t.translationX=0,t.translationY=(o?0:n-a.height)-.5*n,t.rotation=0;break;case 1:{const e=!!(3&c),i=o===!e?h:h-(n-a.height);t.textAlign="center",t.textBaseline=e?"bottom":"top",t.translationX=Math.cos(d)*i,t.translationY=Math.sin(d)*i,t.rotation=e?d-.5*Math.PI:d+.5*Math.PI;break}case 2:{const e=!!(6&c),i=o===!e?.5*(n-a.height):.5*(a.height-n);t.textAlign="center",t.textBaseline="middle",t.translationX=Math.cos(d)*h+Math.cos(d+Math.PI/2)*i,t.translationY=Math.sin(d)*h+Math.sin(d+Math.PI/2)*i,t.rotation=e?d:d+Math.PI;break}}t.visible=!0},M=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(Fk).forEach(e=>{const t=e.closestDatum();E(t,e,e.tag,t===M)})}getTooltipContent(e){const{id:t,properties:i}=this,{labelKey:r,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,tooltip:d}=i,u=e.reduce((e,t)=>e?.children[t],this.rootNode);if(null==u)return;const{datum:p,depth:g}=u;if(null==p||null==g)return;const m=[],f=null!=a?p[a]:void 0;null!=f&&m.push({label:l,fallbackLabel:a,value:f});const y=null!=c?p[c]:void 0;null!=y&&m.push({label:h,fallbackLabel:c,value:y});const v=this.getItemBaseStyle(!1);Object.assign(v,this.getItemStyleOverrides(e,p,g,y,v,!1));const C=v.fill,b=Vk({shape:"square",fill:C,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults);return s.n1.isGradientFill(b.fill)&&(b.fill={...b.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:null!=r?p[r]:void 0,symbol:{marker:b},data:m},{seriesId:t,datum:p,title:void 0,depth:g,labelKey:r,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,...v})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.selectByClass(Lk))}animateEmptyUpdateReady(){Rk(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn:()=>({scalingX:1,scalingY:1}),fromFn:()=>({scalingX:0,scalingY:0})})}computeFocusBounds(e){return e}};zk.className="SunburstSeries",zk.type="sunburst";var{commonSeriesOptionsDefs:Wk,sunburstSeriesThemeableOptionsDef:jk,without:Kk}=s.n1,$k={...jk,...Kk(Wk,["highlightStyle"]),type:(0,r.mw)((0,r.dY)("sunburst")),labelKey:r.Yj,secondaryLabelKey:r.Yj,childrenKey:r.Yj,sizeKey:r.Yj,colorKey:r.Yj,sizeName:r.Yj,colorName:r.Yj},{FONT_SIZE_RATIO:Yk}=s.n1,qk={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:e=>new zk(e),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[Yk.LARGE]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},.75]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[Yk.SMALLEST]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},7/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0}}},Xk={type:"series",name:"sunburst",chartType:"hierarchy",enterprise:!0,options:$k,create:e=>new zk(e)},{BaseProperties:Zk,HierarchySeriesProperties:Qk,HighlightStyle:Jk,SeriesTooltip:eL,Property:tL,Label:iL}=s.n1,sL=class extends iL{constructor(){super(...arguments),this.spacing=0}};a([tL],sL.prototype,"spacing",2);var rL=class extends Zk{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new sL}};a([tL],rL.prototype,"fill",2),a([tL],rL.prototype,"fillOpacity",2),a([tL],rL.prototype,"stroke",2),a([tL],rL.prototype,"strokeWidth",2),a([tL],rL.prototype,"strokeOpacity",2),a([tL],rL.prototype,"cornerRadius",2),a([tL],rL.prototype,"textAlign",2),a([tL],rL.prototype,"gap",2),a([tL],rL.prototype,"padding",2),a([tL],rL.prototype,"interactive",2),a([tL],rL.prototype,"label",2);var nL=class extends Zk{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new cf,this.secondaryLabel=new hf}};a([tL],nL.prototype,"fill",2),a([tL],nL.prototype,"fillOpacity",2),a([tL],nL.prototype,"stroke",2),a([tL],nL.prototype,"strokeWidth",2),a([tL],nL.prototype,"strokeOpacity",2),a([tL],nL.prototype,"cornerRadius",2),a([tL],nL.prototype,"textAlign",2),a([tL],nL.prototype,"verticalAlign",2),a([tL],nL.prototype,"gap",2),a([tL],nL.prototype,"padding",2),a([tL],nL.prototype,"label",2),a([tL],nL.prototype,"secondaryLabel",2);var oL=class extends Zk{constructor(){super(...arguments),this.label=new cf}};a([tL],oL.prototype,"fill",2),a([tL],oL.prototype,"fillOpacity",2),a([tL],oL.prototype,"stroke",2),a([tL],oL.prototype,"strokeWidth",2),a([tL],oL.prototype,"strokeOpacity",2),a([tL],oL.prototype,"label",2);var aL=class extends Zk{constructor(){super(...arguments),this.label=new cf,this.secondaryLabel=new hf}};a([tL],aL.prototype,"fill",2),a([tL],aL.prototype,"fillOpacity",2),a([tL],aL.prototype,"stroke",2),a([tL],aL.prototype,"strokeWidth",2),a([tL],aL.prototype,"strokeOpacity",2),a([tL],aL.prototype,"label",2),a([tL],aL.prototype,"secondaryLabel",2);var lL=class extends Jk{constructor(){super(...arguments),this.group=new oL,this.tile=new aL}};a([tL],lL.prototype,"group",2),a([tL],lL.prototype,"tile",2);var cL=class extends Qk{constructor(){super(...arguments),this.highlightStyle=new lL,this.tooltip=new eL,this.group=new rL,this.tile=new nL,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};a([tL],cL.prototype,"sizeName",2),a([tL],cL.prototype,"labelKey",2),a([tL],cL.prototype,"secondaryLabelKey",2),a([tL],cL.prototype,"itemStyler",2),a([tL],cL.prototype,"highlightStyle",2),a([tL],cL.prototype,"tooltip",2),a([tL],cL.prototype,"group",2),a([tL],cL.prototype,"tile",2),a([tL],cL.prototype,"undocumentedGroupFills",2),a([tL],cL.prototype,"undocumentedGroupStrokes",2);var{TextUtils:hL,TextWrapper:dL,createDatumId:uL,Rect:pL,Group:gL,BBox:mL,Selection:fL,Text:yL,Transformable:vL,applyShapeStyle:CL,getShapeStyle:bL}=s.n1,SL=class extends s.n1.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}},wL=new yL;function xL(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var EL={left:0,center:.5,right:1},ML={top:0,middle:.5,bottom:1},AL=(s.n1.Group,class extends s.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=SL,this.properties=new cL,this.rectGroup=this.contentGroup.appendChild(new gL),this.datumSelection=fL.select(this.rectGroup,pL),this.labelSelection=fL.select(this.labelGroup,gL),this.highlightSelection=fL.select(this.rectGroup,pL)}groupTitleHeight(e,t){const{labelValue:i}=e,{label:s}=this.properties.group;if(null!=i&&!(s.fontSize>t.width/3||s.fontSize>t.height/3)){const{height:e}=function(e,t){const{fontStyle:i,fontWeight:s,fontSize:r,fontFamily:n}=t;wL.setProperties({text:e,fontStyle:i,fontWeight:s,fontSize:r,fontFamily:n,textAlign:"left",textBaseline:"top"});const{width:o,height:a}=wL.getBBox();return{width:o,height:a}}(i,s);return Math.max(e,s.fontSize)}}getNodePadding(e,t){if(null==e.parent)return{top:0,right:0,bottom:0,left:0};if(0===e.children.length){const{padding:e}=this.properties.tile;return{top:e,right:e,bottom:e,left:e}}const{label:{spacing:i},padding:s}=this.properties.group,r=this.groupTitleHeight(e,t);return{top:s+(null!=r?r+i:0),right:s,bottom:s,left:s}}sortChildren({children:e}){const t=Array.from(e,(e,t)=>t).filter(t=>xL(e[t])>0).sort((t,i)=>xL(e[i])-xL(e[t]));return{sortedChildrenIndices:t,childAt:i=>{const s=t[i];return e[s]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0)return e.bbox=void 0,e.padding=void 0,e.midPoint.x=NaN,void(e.midPoint.y=NaN);const r=null!=i?this.getNodePadding(e,t):{top:0,right:0,bottom:0,left:0};null==e.parent?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=NaN,e.midPoint.y=NaN):(e.bbox=t,e.padding=r,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:n,childAt:o}=this.sortChildren(e),a=n.every(e=>0===s[e].children.length),l=t.width-r.left-r.right,c=t.height-r.top-r.bottom;if(l<=0||c<=0)return;const h=n.length;let d=0,u=0,p=1/0,g=n.reduce((e,t)=>e+xL(s[t]),0);const m=new mL(t.x+r.left,t.y+r.top,l,c),f=m.clone();let y=0;for(;y<h;){const e=xL(o(y)),t=xL(o(u)),i=f.width<f.height;d+=e;const s=i?f.height:f.width,r=i?f.width:f.height,n=r*t/d;let l=s*d/g;const c=Math.max(n,l)/Math.min(n,l),h=Math.abs(1-c);if(h<p){p=h,y++;continue}d-=e,l=s*d/g;let v=i?f.x:f.y;for(let e=u;e<y;e++){const t=o(e),s=xL(t),n=i?v:f.x,c=i?f.y:v,h=r*s/d,u=new mL(n,c,i?h:l,i?l:h);this.applyGap(m,u,a),this.squarify(t,u),g-=s,v+=h}i?(f.y+=l,f.height-=l):(f.x+=l,f.width-=l),u=y,d=0,p=1/0}const v=f.width<f.height;let C=v?f.x:f.y;for(let e=u;e<h;e++){const t=o(e),i=v?C:f.x,s=v?f.y:C,r=xL(t)/g,n=f.width*(v?r:1),l=f.height*(v?1:r),c=new mL(i,s,n,l);this.applyGap(m,c,a),this.squarify(t,c),C+=v?n:l}}applyGap(e,t,i){const s=i?.5*this.properties.tile.gap:.5*this.properties.group.gap,n=e=>({left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}),o=n(e),a=n(t);["top","right","bottom","left"].forEach(e=>{(0,r.YX)(o[e],a[e])||t.shrink(s,e)})}createNodeData(){}getGroupBaseStyle(e){const{properties:t}=this,{group:i}=t,s=e?t.highlightStyle.group:void 0;return bL({fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getGroupStyleOverrides(e,t,i,s,r){const{id:n,properties:o}=this,{undocumentedGroupFills:a,undocumentedGroupStrokes:l,itemStyler:c}=o,h=s.fill??a[Math.min(i??0,a.length)],d=s.stroke??l[Math.min(i??0,l.length)],u={};if(r||(u.fill=h,u.stroke=d),null!=c){const o=this.cachedDatumCallback(uL(e.join(":"),r?"highlight":"node"),()=>this.callWithContext(c,{seriesId:n,datum:t,depth:i,highlighted:r,fill:h,stroke:d,...s}));Object.assign(u,o)}return bL(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getTileBaseStyle(e){const{properties:t}=this,{tile:i}=t,s=e?t.highlightStyle.tile:void 0;return bL({fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getTileStyleOverrides(e,t,i,s,r,n){const{id:o,properties:a,colorScale:l}=this,{fills:c,strokes:h,itemStyler:d}=a,u=e[0],p=r.fill??c[u%c.length],g=r.stroke??h[u%h.length],m={};if(n||(m.fill=null!=s?l.convert(s):p,m.stroke=g),null!=d){const s=this.cachedDatumCallback(uL(e.join(":"),n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:t,depth:i,highlighted:n,fill:p,stroke:g,...r}));Object.assign(m,s)}return bL(m,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateSelections(){let e=this.ctx.highlightManager?.getActiveHighlight();if(null==e||this.properties.group.interactive||0===e.children.length||(e=void 0),this.highlightSelection.update(null!=e?[e]:[],void 0,e=>this.getDatumId(e)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,e=>this.getDatumId(e)),this.labelSelection.update(i,e=>{e.append([new yL({tag:0}),new yL({tag:1})])},e=>this.getDatumId(e))}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:r,labelKey:n,secondaryLabelKey:o,sizeKey:a,sizeName:l,highlightStyle:c,tile:h,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!t)return;this.rootNode?.walk(e=>{const{datum:t,depth:c,children:u}=e,p=0===u.length,g=p?h.label:d.label;let m,f;if(null!=t&&null!=c&&null!=n){const e=t[n];m=this.getLabelText(g,{depth:c,datum:t,childrenKey:i,colorKey:s,colorName:r,labelKey:n,secondaryLabelKey:o,sizeKey:a,sizeName:l,value:e})}if(""===m&&(m=void 0),p&&null!=t&&null!=c&&null!=o){const e=t[o];f=this.getLabelText(h.secondaryLabel,{depth:c,datum:t,childrenKey:i,colorKey:s,colorName:r,labelKey:n,secondaryLabelKey:o,sizeKey:a,sizeName:l,value:e})}""===f&&(f=void 0),e.labelValue=m,e.secondaryLabelValue=f});const{width:p,height:g}=u;this.squarify(e,new mL(0,0,p,g)),this.rootNode?.walk(e=>{const{bbox:t,children:i,labelValue:s,secondaryLabelValue:r}=e;if(e.label=void 0,e.secondaryLabel=void 0,null!=t)if(0===i.length){const i={width:t.width,height:t.height,meta:null},n=nf(s,this.properties.tile.label,r,this.properties.tile.secondaryLabel,{padding:h.padding},()=>i);if(null==n)return;const{height:o,label:a,secondaryLabel:l}=n,{textAlign:c,verticalAlign:d,padding:u}=h,p=EL[c]??.5,g=t.x+u+(t.width-2*u)*p,m=ML[d]??.5,f=t.y+u+.5*o+(t.height-2*u-o)*m;if(null!=a){const{fontStyle:t="normal",fontFamily:i,fontWeight:s="normal",color:r="black"}=this.properties.tile.label;e.label={text:a.text,fontSize:a.fontSize,lineHeight:a.lineHeight,fontStyle:t,fontFamily:i,fontWeight:s,color:r,textAlign:c,verticalAlign:"middle",x:g,y:f-.5*(o-a.height)}}if(null!=l){const{fontStyle:t="normal",fontFamily:i,fontWeight:s="normal",color:r="black"}=this.properties.tile.secondaryLabel;e.secondaryLabel={text:l.text,fontSize:l.fontSize,lineHeight:l.fontSize,fontStyle:t,fontFamily:i,fontWeight:s,color:r,textAlign:c,verticalAlign:"middle",x:g,y:f+.5*(o-l.height)}}}else{if(null==s)return;{const{padding:i,textAlign:r}=d,n=this.groupTitleHeight(e,t);if(null==n)return;const o=t.width-2*i,a=dL.wrapText(s,{maxWidth:t.width-2*i,font:d.label,textWrap:"never"}),l=EL[r]??.5,{fontStyle:c="normal",fontFamily:h,fontWeight:u="normal",color:p="black"}=this.properties.group.label;e.label={text:a,fontSize:d.label.fontSize,lineHeight:hL.getLineHeight(d.label.fontSize),fontStyle:c,fontFamily:h,fontWeight:u,color:p,textAlign:r,verticalAlign:"middle",x:t.x+i+o*l,y:t.y+i+.5*n}}}});const m={series:new mL(0,0,p,g),axis:new mL(0,0,p,g)},f=(e,t,i,s,r)=>{const{bbox:n}=e;if(null==n)return void(t.visible=!1);const{datum:o,depth:a=-1,datumIndex:l,colorValue:c}=e,u=0===e.children.length,p=u?s:i,g=u?this.getTileStyleOverrides(l,o,a,c,p,r):this.getGroupStyleOverrides(l,o,a,p,r);t.crisp=!0,CL(t,p,g,m),t.cornerRadius=u?h.cornerRadius:d.cornerRadius,t.zIndex=[0,a,r?1:0];const f=e.parent?.children.every(e=>0===e.children.length),y=null!=e.parent?e.parent.bbox:void 0,v=null!=e.parent?e.parent.padding:void 0;!0===f&&null!=y&&null!=v?(t.clipBBox=n,t.x=y.x+v.left,t.y=y.y+v.top,t.width=y.width-(v.left+v.right),t.height=y.height-(v.top+v.bottom)):(t.clipBBox=void 0,t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height),t.visible=!0},y=this.getGroupBaseStyle(!1),v=this.getTileBaseStyle(!1);this.datumSelection.each((e,t)=>f(t,e,y,v,!1));const C=this.getGroupBaseStyle(!0),b=this.getTileBaseStyle(!0);this.highlightSelection.each((e,t)=>{f(t,e,C,b,!0)});const S=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(yL).forEach(e=>{const t=e.closestDatum();((e,t,i,s)=>{const r=0===e.children.length,n=0===i?e.label:e.secondaryLabel;if(null==n)return void(t.visible=!1);let o;if(s){const{tile:e,group:t}=c;o=e.secondaryLabel.color,r?0===i&&(o=e.label.color):o=t.label.color}t.text=n.text,t.fontSize=n.fontSize,t.lineHeight=n.lineHeight,t.fontStyle=n.fontStyle,t.fontFamily=n.fontFamily,t.fontWeight=n.fontWeight,t.fill=o??n.color,t.textAlign=n.textAlign,t.textBaseline=n.verticalAlign,t.x=n.x,t.y=n.y,t.visible=!0,t.zIndex=1})(t,e,e.tag,t===S)})}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((e,t)=>t.datumIndex.length-e.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return 0!==t.length?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i}=this,{labelKey:r,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,tooltip:d}=i,u=e.reduce((e,t)=>e?.children[t],this.rootNode);if(null==u)return;const{datum:p,depth:g,children:m}=u;if(null==p||null==g)return;const f=0===m.length,y=[],v=null!=a?p[a]:void 0;null!=v&&y.push({label:l,fallbackLabel:a,value:v});const C=null!=c?p[c]:void 0;let b;null!=C&&y.push({label:h,fallbackLabel:c,value:C}),f?(b=this.getTileBaseStyle(!1),Object.assign(b,this.getTileStyleOverrides(e,p,g,C,b,!1))):(b=this.getGroupBaseStyle(!1),Object.assign(b,this.getGroupStyleOverrides(e,p,g,b,!1)));const S=b.fill,w=bL({shape:"square",fill:S,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);s.n1.isGradientFill(w.fill)&&(w.fill={...w.fill,gradient:"linear",rotation:0,reverse:!1});const x=f?{marker:w}:void 0;return this.formatTooltipWithContext(d,{title:null!=r?p[r]:void 0,symbol:x,data:y},{seriesId:t,datum:p,title:void 0,depth:g,labelKey:r,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,...b})}computeFocusBounds(e){return vL.toCanvas(this.contentGroup,e.getBBox())}});AL.className="TreemapSeries",AL.type="treemap";var{commonSeriesOptionsDefs:TL,treemapSeriesThemeableOptionsDef:DL,without:IL}=s.n1,RL={...DL,...IL(TL,["highlightStyle"]),type:(0,r.mw)((0,r.dY)("treemap")),labelKey:r.Yj,secondaryLabelKey:r.Yj,childrenKey:r.Yj,sizeKey:r.Yj,colorKey:r.Yj,sizeName:r.Yj,colorName:r.Yj};RL.fillGradientDefaults=(0,r._L)(r.wi),RL.fillPatternDefaults=(0,r._L)(r.GY),RL.fillImageDefaults=(0,r._L)(r.Zd),RL.undocumentedGroupFills=(0,r._L)((0,r.jk)(r.yW)),RL.undocumentedGroupStrokes=(0,r._L)((0,r.jk)(r.yW));var{FONT_SIZE_RATIO:PL}=s.n1,kL={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:e=>new AL(e),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.5]},minimumFontSize:{$rem:[PL.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:[PL.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:0,padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0}}},LL={type:"series",name:"treemap",chartType:"hierarchy",enterprise:!0,options:RL,create:e=>new AL(e)},NL=(s.n1.ModuleRegistry,[Wu,Ng,Xm,pw,zw,Gf,$f,av,Jv,qC,ju,Ku,$u,Yu,VT,vI,MI,gR,PR,ep,rS,xk,np,Jx,_P,hp,Xk,LL,mp,bD,Ep,$E,aM,KM,xA,UA,lb,cb,hb]),_L={xMin:0,xMax:1,yMin:2,yMax:3,span:4};function OL(e,t){return Array.from({length:e},(e,i)=>{const s=4*i;return(t[s+0]+t[s+1])/2|0})}var{ChartAxisDirection:FL,ContinuousScale:GL,DiscreteTimeScale:BL}=s.n1,VL=class extends s.n1.BarSeries{aggregateData(e,t){if("ungrouped"!==t?.type)return;const i=this.axes[FL.X];if(null==i||!GL.is(i.scale)&&!BL.is(i.scale))return;const s=e.resolveKeysById(this,"xValue",t),r=e.resolveColumnById(this,"yValue-raw",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i){if(e.length<1e3)return;const[s,r]=Fg(i);let n=Og(e,5),{indexData:o,valueData:a}=Vg(e,t,t,s,r,n),l=OL(n,o);const c=[{maxRange:n,indexData:o,indices:l,indexes:_L}];for(;n>64;)({indexData:o,valueData:a,maxRange:n}=Hg(o,a,n)),l=OL(n,o),c.push({maxRange:n,indexData:o,indices:l,indexes:_L});return c.reverse(),c}(s,r,t.domain.keys[n])}},{BarSeriesModule:HL}=s.n1,UL={...HL,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new VL(e)};function zL(e,t,i,s,r,n){const o=e[n];if(null==o)return!1;const a=Bg(Gg(o,t,i),r);return n===s[a+0]||n===s[a+1]||n===s[a+2]||n===s[a+3]}var{ChartAxisDirection:WL,ContinuousScale:jL,DiscreteTimeScale:KL}=s.n1,$L=class extends s.n1.LineSeries{aggregateData(e,t){const i=this.axes[WL.X];if(null!=i&&(jL.is(i.scale)||KL.is(i.scale)))return function(e,t,i){if(e.length<1e3)return;const[s,r]=Fg(i);let n=Og(e,10);const{indexData:o,valueData:a}=Vg(e,t,t,s,r,n);let l=[];for(let t=0;t<e.length;t+=1)zL(e,s,r,o,n,t)&&l.push(t);const c=[{maxRange:n,indices:l}];for(;l.length>10&&n>64;)({maxRange:n}=Hg(o,a,n,{inPlace:!0})),l=l.filter(zL.bind(null,e,s,r,o,n)),c.push({maxRange:n,indices:l});return c.reverse(),c}(e.resolveColumnById(this,"xValue",t),e.resolveColumnById(this,"yValueRaw",t),e.getDomain(this,"xValue","value",t))}},{LineSeriesModule:YL}=s.n1,qL={...YL,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new $L(e)};s.n1.ModuleRegistry.registerMany(NL),s.n1.moduleRegistry.register(Q,le,Je,Ml,_l,UL,jc,Lg,qm,sS,uw,Uw,Kf,Ul,ic,yc,Sc,Bc,Qx,qL,KE,oM,jM,wA,HA,Mh,sd,Fu,Ff,BT,pe,yI,EI,pR,RR,We,NP,qe,Qv,ov,Fh,CD,wk,Vh,qk,vd,kL,YC,wu),s.n1.enterpriseModule.isEnterprise=!0,s.n1.enterpriseModule.styles='.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-chrome-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-chrome-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>\');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:calc(var(--ag-charts-chrome-font-size) * (13 / 12));font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-chrome-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-border);box-shadow:var(--ag-charts-shadow);color:var(--ag-charts-chrome-text-color);display:table;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;display:table-row;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__label,.ag-charts-context-menu__rightarrowhead{display:table-cell;vertical-align:middle}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent);text-align:left}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{display:table-row}.ag-charts-context-menu__divider>div{padding:5px 0}.ag-charts-context-menu__divider>div:after{content:"";display:block;border-top:1px solid #babfc7}.ag-charts-context-menu__divider.ag-charts-dark-context-menu{background:#2196f31a}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}\n',s.n1.enterpriseModule.licenseManager=e=>new p(e.container?.ownerDocument??("undefined"==typeof document?void 0:document)),s.n1.enterpriseModule.injectWatermark=Gu;var XL={setLicenseKey(e){p.setLicenseKey(e)}};s.xv,s.Mo,s.LW,s.a9,s.ui.create.bind(s.ui),s.ui.__createSparkline.bind(s.ui),p.setGridContext.bind(p),p.setLicenseKey.bind(p)},25573(e,t,i){"use strict";i.d(t,{ui:()=>a});var s=i(22155),r=i(45401);function n(e,t){return{...e,container:t.current}}function o(e,t){const i=(0,s.forwardRef)(function(t,i){const{options:r,style:o,className:a}=t,l=(0,s.useRef)(null),c=(0,s.useRef)();(0,s.useLayoutEffect)(()=>{const t=e(n(r,l));return c.current=t,()=>{t.destroy()}},[]);const h=void 0===c.current;return(0,s.useEffect)(()=>{h||c.current?.update(n(r,l)).catch(e=>console.error(e))},[r]),(0,s.useImperativeHandle)(i,()=>c.current,[]),(0,s.useMemo)(()=>(0,s.createElement)("div",{ref:l,style:o,className:a}),[o,a])});return i.displayName=t,i}var a=o(e=>r.ui.create(e),"AgCharts")},54989(e,t,i){"use strict";i.d(t,{$1h:()=>Rl,$Y_:()=>Ja,BFs:()=>gl,B_v:()=>Va,CJG:()=>ya,CS5:()=>rh,CSq:()=>Ta,Cf3:()=>Hh,CvR:()=>mr,D45:()=>xe,DDm:()=>qs,DKR:()=>Lr,Dvw:()=>Fh,E1g:()=>Uh,E3M:()=>Sh,EJF:()=>Ul,FiP:()=>No,G21:()=>Tr,GPp:()=>Mn,GsR:()=>lh,HDb:()=>Dt,HHt:()=>_r,HLc:()=>Zc,HM$:()=>Qc,H_$:()=>jn,HiW:()=>il,HvL:()=>Ad,Hyp:()=>Xa,IGk:()=>Qo,IqQ:()=>ka,Iu8:()=>On,J1w:()=>Vd,JPk:()=>dt,JWk:()=>Nr,Ju4:()=>Br,K02:()=>Mt,K42:()=>Pt,K4S:()=>$c,Kb3:()=>ll,LFT:()=>Wa,LIk:()=>ta,LT8:()=>cc,LfH:()=>Ml,Lhl:()=>nl,M4G:()=>dr,MDK:()=>aa,MSA:()=>Oo,MVO:()=>fn,NF5:()=>xd,Nat:()=>Oh,OH$:()=>jc,OPU:()=>dl,OQA:()=>Ur,OQU:()=>uc,OnL:()=>ia,PC7:()=>da,PIB:()=>br,PJL:()=>jr,PLc:()=>Rc,Pk_:()=>ec,Pmj:()=>bl,Q5x:()=>kr,Q90:()=>ed,QBm:()=>Cl,Qgm:()=>Pl,R4L:()=>Ha,RI_:()=>lr,RRV:()=>Vl,RYS:()=>jl,Rdv:()=>Na,Rlq:()=>Pa,Ry8:()=>ml,SEh:()=>cr,Sko:()=>cd,SpC:()=>tn,T6X:()=>Td,TJD:()=>Nn,TOO:()=>Hl,TUE:()=>Ln,TYQ:()=>Mc,TaT:()=>Kr,U$F:()=>cn,U3q:()=>pl,USV:()=>me,U_L:()=>gn,Udn:()=>wl,Ug$:()=>Vh,Unm:()=>Hr,VPZ:()=>Se,Vf_:()=>pe,VyI:()=>Pc,WO_:()=>Gn,XQb:()=>st,Xx1:()=>de,Y0b:()=>ho,YD7:()=>Ql,YEH:()=>Rn,YHi:()=>Bc,YtK:()=>qa,Yx9:()=>ct,YzF:()=>wd,ZvW:()=>Xr,_:()=>ar,_7R:()=>Ed,a1W:()=>D,a8A:()=>Ol,aBp:()=>Ec,aJZ:()=>xl,aP4:()=>_l,aS7:()=>Pd,aq:()=>ko,atK:()=>Go,auO:()=>za,bB5:()=>yc,bBw:()=>Dc,bLJ:()=>zl,c4$:()=>_c,dR4:()=>ce,dcM:()=>io,dsm:()=>he,eAL:()=>An,ehA:()=>Ga,fAn:()=>Uo,fK3:()=>oe,fNJ:()=>hc,fNO:()=>Sc,fRK:()=>hl,fVA:()=>La,fnn:()=>zh,gay:()=>qo,gvq:()=>Th,hK9:()=>Tl,hv8:()=>ur,i9O:()=>rc,iEP:()=>Bl,iH9:()=>wh,ia$:()=>Vo,ihO:()=>zn,j19:()=>co,jf3:()=>Tc,jfj:()=>jo,k$d:()=>Fl,k4Y:()=>Ic,k7d:()=>Ll,kNx:()=>Lt,kOq:()=>Pn,kem:()=>Al,lon:()=>Ma,m20:()=>ea,m5s:()=>_o,mE1:()=>ah,mSN:()=>gr,mqe:()=>_n,n76:()=>Id,o7C:()=>ae,oY$:()=>hr,o_p:()=>_a,obS:()=>ne,ock:()=>at,ofN:()=>ro,pA9:()=>Sl,pE7:()=>vn,pK6:()=>Dd,pNP:()=>Xl,pkb:()=>Il,pow:()=>xc,qRA:()=>Fn,qdQ:()=>Lc,qh$:()=>Wo,qkt:()=>nc,qyQ:()=>Rr,rdE:()=>Yo,s1r:()=>kc,sVA:()=>lt,stt:()=>en,syG:()=>re,tbO:()=>rt,tj3:()=>lo,tyx:()=>oo,uAl:()=>vr,uf_:()=>ht,uij:()=>el,utH:()=>uo,uvO:()=>Aa,v26:()=>Cc,vBt:()=>fl,vXh:()=>Wl,wX9:()=>ga,wjn:()=>ql,xA9:()=>Gh,xMA:()=>Lo,xSC:()=>Nc,yGC:()=>xn,yLQ:()=>on,yLT:()=>Cr,yOL:()=>Nt,yah:()=>le,ycK:()=>Kl,yuY:()=>ac,zCV:()=>vl,zIT:()=>In,zOQ:()=>Dl,zmE:()=>Fa,zsj:()=>ie});var s=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(e,t,i)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,d=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&h(e,i,t[i]);if(a)for(var i of a(t))c.call(t,i)&&h(e,i,t[i]);return e},u=(e,t)=>r(e,o(t)),p=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},g=(e,t,i,r)=>{for(var o,a=r>1?void 0:r?n(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r?o(t,i,a):o(a))||a);return r&&a&&s(t,i,a),a},m=(e,t)=>(i,s)=>t(i,s,e),f={};function y(e){return null==e||""===e?null:e}function v(e,t=!1){return null!=e&&(""!==e||t)}function C(e){return!v(e)}function b(e){return null==e||0===e.length}function S(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function w(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function x(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function E(e){if(null!=e&&""!==e)return e}function M(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function A(e,t,i=!1){const s=null==e,r=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&r)return 0;if(s)return-1;if(r)return 1;function n(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return n(e,t);if(!i)return n(e,t);try{return e.localeCompare(t)}catch(i){return n(e,t)}}function T(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(e=>t.push(e)),t}return Object.values(e)}p(f,{attrToBoolean:()=>x,attrToNumber:()=>w,attrToString:()=>E,defaultComparator:()=>A,exists:()=>v,jsonEquals:()=>M,makeNull:()=>y,missing:()=>C,missingOrEmpty:()=>b,toStringOrNull:()=>S,values:()=>T});var D=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=S(e);let i=0;for(;;){let s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},I={};p(I,{SKIP_JS_BUILTINS:()=>R,cloneObject:()=>k,deepCloneDefinition:()=>L,getAllValuesInObject:()=>N,getValueUsingField:()=>O,isNonNullObject:()=>G,iterateObject:()=>P,mergeDeep:()=>_,removeAllReferences:()=>F});var R=new Set(["__proto__","constructor","prototype"]);function P(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,s]of Object.entries(e))t(i,s)}function k(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(R.has(i[s]))continue;const r=i[s],n=e[r];t[r]=n}return t}function L(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(e=>{if(t&&t.indexOf(e)>=0||R.has(e))return;const r=i[e],n=G(r)&&r.constructor===Object;s[e]=n?L(r):r}),s}function N(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function _(e,t,i=!0,s=!1){v(t)&&P(t,(t,r)=>{if(R.has(t))return;let n=e[t];n!==r&&(s&&null==n&&null!=r&&"object"==typeof r&&r.constructor===Object&&(n={},e[t]=n),G(r)&&G(n)&&!Array.isArray(n)?_(n,r,i,s):(i||void 0!==r)&&(e[t]=r))})}function O(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let r=e;for(let e=0;e<s.length;e++){if(null==r)return;r=r[s[e]]}return r}function F(e,t=[],i){Object.keys(e).forEach(i=>{"object"!=typeof e[i]||t.includes(i)||(e[i]=void 0)});const s=Object.getPrototypeOf(e),r={};Object.getOwnPropertyNames(s).forEach(e=>{if("function"==typeof s[e]&&!t.includes(e)){const t=()=>{console.warn((e=>`AG Grid: Grid API function ${e}() cannot be called as the grid has been destroyed.\n    It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n    To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`)(e))};r[e]={value:t,writable:!0}}}),Object.defineProperties(e,r)}function G(e){return"object"==typeof e&&null!==e}var B={};p(B,{compose:()=>ee,debounce:()=>Z,doOnce:()=>H,errorOnce:()=>z,executeAfter:()=>X,executeInAWhile:()=>K,executeNextVMTurn:()=>q,getFunctionName:()=>W,isFunction:()=>j,noop:()=>te,throttle:()=>Q,waitUntil:()=>J,warnOnce:()=>U});var V={};function H(e,t){V[t]||(e(),V[t]=!0)}function U(e){H(()=>console.warn("AG Grid: "+e),e)}function z(e){H(()=>console.error("AG Grid: "+e),e)}function W(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function j(e){return!!(e&&e.constructor&&e.call&&e.apply)}function K(e){X(e,400)}var $=[],Y=!1;function q(e){$.push(e),Y||(Y=!0,window.setTimeout(()=>{const e=$.slice();$.length=0,Y=!1,e.forEach(e=>e())},0))}function X(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(e=>e()),t)}function Z(e,t){let i;return function(...s){const r=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(r,s)},t)}}function Q(e,t){let i=0;return function(...s){const r=(new Date).getTime();r-i<t||(i=r,e.apply(this,s))}}function J(e,t,i=100,s){const r=(new Date).getTime();let n=null,o=!1;const a=()=>{const a=(new Date).getTime()-r>i;(e()||a)&&(t(),o=!0,null!=n&&(window.clearInterval(n),n=null),a&&s&&console.warn(s))};a(),o||(n=window.setInterval(a,10))}function ee(...e){return t=>e.reduce((e,t)=>t(e),t)}var te=()=>{},ie=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(ie||{}),se=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,s){e.runVersionChecks(t),void 0!==s?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[s]&&(e.gridModulesMap[s]={}),e.gridModulesMap[s][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,s){e.setModuleBased(i),t&&t.forEach(t=>e.__register(t,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[r,n]=e.currentModuleVersion.split(".")||[];return i===r&&s===n}static runVersionChecks(t){if(e.currentModuleVersion||(e.currentModuleVersion=t.version),t.version?e.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const e=t.validate();if(!e.isValid){const t=e;console.error(`AG Grid: ${t.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&H(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){e.isBundled=!0}static __assertRegistered(t,i,s){var r;if(this.__isRegistered(t,s))return!0;const n=i+t;let o;if(e.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n        \n        <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n        \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){let n=null==(r=Object.entries(ie).find(([e,i])=>i===t))?void 0:r[0];o=`AG Grid: unable to use ${i} as the ${n} is not registered${e.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:\n           \n    import { ModuleRegistry } from '@ag-grid-community/core';\n    import { ${n} } from '${t}';\n    \n    ModuleRegistry.registerModules([ ${n} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n            \n    import 'ag-grid-enterprise';`;return H(()=>{console.warn(o)},n),!1}static __isRegistered(t,i){var s;return!!e.globalModulesMap[t]||!!(null==(s=e.gridModulesMap[i])?void 0:s[t])}static __getRegisteredModules(t){return[...T(e.globalModulesMap),...T(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return T(null!=(i=e.gridModulesMap[t])?i:{})||[]}static __isPackageBased(){return!e.moduleBased}};se.globalModulesMap={},se.gridModulesMap={},se.areGridScopedModules=!1;var re=se,ne=class{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return T(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),v(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),P(this.beanWrappers,(e,t)=>{let i;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const s=this.getBeansForParameters(i,t.bean.name),r=new(t.bean.bind.apply(t.bean,[null,...s]));t.beanInstance=r});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let t;return t=e.prototype.constructor?W(e.prototype.constructor):""+e,void console.error(`Context item ${t} is not a bean`)}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{const s=t.agClassAttributes;s&&s.forEach(t=>{const s=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=s})})})}methodWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{P(t.autowireMethods,(t,s)=>{if("agConstructor"===t)return;const r=this.getBeansForParameters(s,i);e[t].apply(e,r)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const e=i.constructor;e.hasOwnProperty("__agBeanMetaData")&&t(e.__agBeanMetaData,this.getBeanName(e)),i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&P(e,(e,s)=>{const r=this.lookupBeanInstance(t,s);i[Number(e)]=r}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const s=this.beanWrappers[t];return s?s.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(e=>this.callLifeCycleMethodsOnBean(e,t))}callLifeCycleMethodsOnBean(e,t,i){const s={};this.forEachMetaDataInHierarchy(e,e=>{const r=e[t];r&&r.forEach(e=>{e!=i&&(s[e]=!0)})}),Object.keys(s).forEach(t=>e[t]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,re.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;"function"==typeof t.destroy&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function oe(e,t,i){const s=ge(e.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(t)}function ae(e,t,i){const s=ge(e.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(t)}function le(e,t,i){const s=ge(e.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(t)}function ce(e){return t=>{ge(t).beanName=e}}function he(e){return(t,i,s)=>{ue(t,e,!1,0,i,null)}}function de(e){return(t,i,s)=>{ue(t,e,!0,0,i,null)}}function ue(e,t,i,s,r,n){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof n)return void console.error("AG Grid: Autowired should be on an attribute");const o=ge(e.constructor);o.agClassAttributes||(o.agClassAttributes=[]),o.agClassAttributes.push({attributeName:r,beanName:t,optional:i})}function pe(e){return(t,i,s)=>{const r="function"==typeof t?t:t.constructor;let n;if("number"==typeof s){let t;i?(n=ge(r),t=i):(n=ge(r),t="agConstructor"),n.autowireMethods||(n.autowireMethods={}),n.autowireMethods[t]||(n.autowireMethods[t]={}),n.autowireMethods[t][s]=e}}}function ge(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var me=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setBeans(e,t,i=null,s=null){if(this.frameworkOverrides=t,this.gos=e,i){const t=e.useAsyncEvents();this.addGlobalListener(i,t)}s&&this.addGlobalListener(s,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let r=s.get(e);return!r&&i&&(r=new Set,s.set(e,r)),r}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),0===s.size)&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gos&&this.gos.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const s=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const r=null!=(i=this.getListeners(s,t,!1))?i:new Set,n=new Set(r);n.size>0&&((i,s)=>{i.forEach(i=>{if(!s.has(i))return;const r=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(e)):()=>i(e);t?this.dispatchAsync(r):r()})})(n,r),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(i=>{const r=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(s,e)):()=>i(s,e);t?this.dispatchAsync(r):r()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(e=>e())}};g([m(0,pe("gridOptionsService")),m(1,pe("frameworkOverrides")),m(2,pe("globalEventListener")),m(3,pe("globalSyncEventListener"))],me.prototype,"setBeans",1),me=g([ce("eventService")],me);var fe=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing(()=>e(t))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing(()=>e(t,i))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return null!=(t=this.wrappedListeners.get(e))?t:e}unwrapGlobal(e){var t;return null!=(t=this.wrappedGlobalListeners.get(e))?t:e}},ye={resizable:!0,sortable:!0},ve=0;function Ce(){return ve++}var be=class e{constructor(e,t,i,s){this.instanceId=Ce(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new me,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const s=e.hide,r=e.initialHide;this.visible=void 0!==s?!s:!r,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,o=e.initialFlex;void 0!==n?this.flex=n:void 0!==o&&(this.flex=o)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=v(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=v(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,t;const i=this.colDef;this.minWidth=null!=(e=i.minWidth)?e:this.environment.getMinColWidth(),this.maxWidth=null!=(t=i.maxWidth)?t:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=v(this.colDef.tooltipField)||v(this.colDef.tooltipValueGetter)||v(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){var t,i;const s=null!=(t=e.minWidth)?t:this.environment.getMinColWidth(),r=null!=(i=e.maxWidth)?i:Number.MAX_SAFE_INTEGER;let n;const o=w(e.width),a=w(e.initialWidth);return n=null!=o?o:null!=a?a:200,Math.max(Math.min(n,r),s)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(C(this.colDef)||C(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){var i,s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new fe(this.frameworkOverrides));const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?s:t;this.eventService.addEventListener(e,r)}removeEventListener(e,t){var i,s;const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?s:t;this.eventService.removeEventListener(e,r)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){var t;return null!=(t=this.colDef[e])?t:ye[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}setMoving(e,t){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return C(this.sort)}isSorting(){return v(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&_(s,i),this.eventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(C(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(C(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){null!=this.minWidth&&(e=Math.max(e,this.minWidth)),null!=this.maxWidth&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return null!=this.maxWidth&&e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){v(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(e){U("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return null==t&&(t=e),t}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:e.EVENT_STATE_UPDATED,key:t})}};be.EVENT_MOVING_CHANGED="movingChanged",be.EVENT_LEFT_CHANGED="leftChanged",be.EVENT_WIDTH_CHANGED="widthChanged",be.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",be.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",be.EVENT_VISIBLE_CHANGED="visibleChanged",be.EVENT_FILTER_CHANGED="filterChanged",be.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",be.EVENT_SORT_CHANGED="sortChanged",be.EVENT_COL_DEF_CHANGED="colDefChanged",be.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",be.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",be.EVENT_PIVOT_CHANGED="columnPivotChanged",be.EVENT_VALUE_CHANGED="columnValueChanged",be.EVENT_STATE_UPDATED="columnStateUpdated",g([he("gridOptionsService")],be.prototype,"gos",2),g([he("environment")],be.prototype,"environment",2),g([he("columnHoverService")],be.prototype,"columnHoverService",2),g([he("frameworkOverrides")],be.prototype,"frameworkOverrides",2),g([ae],be.prototype,"initialise",1);var Se=be,we=class e{constructor(e,t,i,s){this.localEventService=new me,this.expandable=!1,this.instanceId=Ce(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some(e=>e.isVisible())}isPadding(){return this.padding}setExpanded(t){this.expanded=void 0!==t&&t;const i={type:e.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(i)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(t){this.children&&this.children.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addLeafColumns(t)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let t=!1,i=!1,s=!1;const r=this.findChildrenRemovingPadding();for(let e=0,n=r.length;e<n;e++){const n=r[e];if(!n.isVisible())continue;const o=n.getColumnGroupShow();"open"===o?(t=!0,s=!0):"closed"===o?(i=!0,s=!0):(t=!0,i=!0)}const n=t&&i&&s;if(this.expandable!==n){this.expandable=n;const t={type:e.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(t)}}findChildrenRemovingPadding(){const t=[],i=s=>{s.forEach(s=>{s instanceof e&&s.isPadding()?i(s.children):t.push(s)})};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};we.EVENT_EXPANDED_CHANGED="expandedChanged",we.EVENT_EXPANDABLE_CHANGED="expandableChanged",g([le],we.prototype,"destroy",1);var xe=we,Ee={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Me={};p(Me,{addSafePassiveEventListener:()=>tt,createEventPath:()=>Je,getCtrlForEventTarget:()=>Ze,getEventPath:()=>et,isElementInEventPath:()=>Qe,isEventSupported:()=>Xe,isStopPropagationForAgGrid:()=>qe,stopPropagationForAgGrid:()=>Ye});var Ae={};function Te(e){return null!=e&&e.length>0}function De(e){if(e&&e.length)return e[e.length-1]}function Ie(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,s)=>i?i(e,t[s]):t[s]===e)}function Re(e,t){return Ie(e,t)}function Pe(e){return e.sort((e,t)=>e-t)}function ke(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,r=e[i+1]===t;s&&r&&e.splice(i+1,1)}}function Le(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Ne(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function _e(e,t){for(let i=0;i<t.length;i++)Le(e,t[i])}function Oe(e,t){for(let i=0;i<t.length;i++)Ne(e,t[i])}function Fe(e,t,i){e.splice(i,0,t)}function Ge(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--)Fe(e,t[s],i)}function Be(e,t,i){Oe(e,t),t.slice().reverse().forEach(t=>Fe(e,t,i))}function Ve(e,t){return e.indexOf(t)>-1}function He(e){return[].concat.apply([],e)}function Ue(e,t){null!=t&&null!=e&&t.forEach(t=>e.push(t))}function ze(e){return e.map(S)}function We(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}p(Ae,{areEqual:()=>Ie,existsAndNotEmpty:()=>Te,flatten:()=>He,forEachReverse:()=>We,includes:()=>Ve,insertArrayIntoArray:()=>Ge,insertIntoArray:()=>Fe,last:()=>De,moveInArray:()=>Be,pushAll:()=>Ue,removeAllFromArray:()=>Oe,removeAllFromUnorderedArray:()=>_e,removeFromArray:()=>Ne,removeFromUnorderedArray:()=>Le,removeRepeatsFromArray:()=>ke,shallowCompare:()=>Re,sortNumerically:()=>Pe,toStrings:()=>ze});var je="__ag_Grid_Stop_Propagation",Ke=["touchstart","touchend","touchmove","touchcancel","scroll"],$e={};function Ye(e){e[je]=!0}function qe(e){return!0===e[je]}var Xe=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof $e[t])return $e[t];const i=document.createElement(e[t]||"div");return $e[t="on"+t]=t in i}})();function Ze(e,t,i){let s=t;for(;s;){const t=e.getDomData(s,i);if(t)return t;s=s.parentElement}return null}function Qe(e,t){return!(!t||!e)&&et(t).indexOf(e)>=0}function Je(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function et(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Je(t)}function tt(e,t,i,s){const r=Ve(Ke,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var it=class e{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:e.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new me),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,i){if(this.destroyed)return;e instanceof HTMLElement?tt(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null)}setupGridOptionListener(e,t){this.gos.addEventListener(e,t);const i=()=>(this.gos.removeEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const s={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(s)};e.forEach(e=>this.setupGridOptionListener(e,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){if(e)for(let i=0;i<e.length;i++)this.destroyBean(e[i],t);return[]}};it.EVENT_DESTROYED="destroyed",g([he("frameworkOverrides")],it.prototype,"frameworkOverrides",2),g([he("context")],it.prototype,"context",2),g([he("eventService")],it.prototype,"eventService",2),g([he("gridOptionsService")],it.prototype,"gos",2),g([he("localeService")],it.prototype,"localeService",2),g([he("environment")],it.prototype,"environment",2),g([le],it.prototype,"destroy",1);var st=it,rt=class extends st{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,s){const r=new D,{existingCols:n,existingGroups:o,existingColKeys:a}=this.extractExistingTreeData(i);r.addExistingKeys(a);const l=this.recursivelyCreateColumns(e,0,t,n,r,o,s),c=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+c);const h=this.balanceColumnTree(l,0,c,r);return nt(null,h,(e,t)=>{e instanceof xe&&e.setupExpandable(),e.setOriginalParent(t)}),{columnTree:h,treeDept:c}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&nt(null,e,e=>{if(e instanceof xe){const t=e;i.push(t)}else{const i=e;s.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map(e=>this.createAutoGroupTreeItem(t,e))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let e=i-1;e>=0;e--){const i=new xe(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([s]),s.setOriginalParent(i),s=i}return 0===i&&t.setOriginalParent(null),s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof xe;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const r=[];for(let n=0;n<e.length;n++){const o=e[n];if(o instanceof xe){const e=o,n=this.balanceColumnTree(e.getChildren(),t+1,i,s);e.setChildren(n),r.push(e)}else{let n,a;for(let e=i-1;e>=t;e--){const e=s.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),r=new xe(i,e,!0,t);this.createBean(r),a&&a.setChildren([r]),a=r,n||(n=a)}if(n&&a){if(r.push(n),e.some(e=>e instanceof xe)){a.setChildren([o]);continue}a.setChildren(e);break}r.push(o)}}return r}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const r=e[s];if(r instanceof xe){const e=r,s=this.findMaxDept(e.getChildren(),t+1);i<s&&(i=s)}}return i}recursivelyCreateColumns(e,t,i,s,r,n,o){if(!e)return[];const a=new Array(e.length);for(let l=0;l<a.length;l++){const c=e[l];this.isColumnGroup(c)?a[l]=this.createColumnGroup(i,c,t,s,r,n,o):a[l]=this.createColumn(i,c,s,r,o)}return a}createColumnGroup(e,t,i,s,r,n,o){const a=this.createMergedColGroupDef(t),l=r.getUniqueKey(a.groupId||null,null),c=new xe(a,l,!1,i);this.createBean(c);const h=this.findExistingGroup(t,n);h&&n.splice(h.idx,1);let d=null==h?void 0:h.group;d&&c.setExpanded(d.isExpanded());const u=this.recursivelyCreateColumns(a.children,i+1,e,s,r,n,o);return c.setChildren(u),c}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,r){const n=this.findExistingColumn(t,i);n&&(null==i||i.splice(n.idx,1));let o=null==n?void 0:n.column;if(o){const e=this.addColumnDefaultAndTypes(t,o.getColId());o.setColDef(e,t,r),this.applyColumnState(o,e,r)}else{const i=s.getUniqueKey(t.colId,t.field),r=this.addColumnDefaultAndTypes(t,i);o=new Se(r,t,i,e),this.context.createBean(o)}return this.dataTypeService.addColumnListeners(o),o}applyColumnState(e,t,i){const s=w(t.flex);if(void 0!==s&&e.setFlex(s),e.getFlex()<=0){const s=w(t.width);if(null!=s)e.setActualWidth(s,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const r=w(t.sortIndex);void 0!==r&&e.setSortIndex(r);const n=x(t.hide);void 0!==n&&e.setVisible(!n,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(s)if(null==e.colId){if(null!=e.field){if(s.field===e.field)return{idx:i,column:t[i]}}else if(s===e)return{idx:i,column:t[i]}}else if(t[i].getId()===e.colId)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const s=t[i];if(s.getColGroupDef()&&s.getId()===e.groupId)return{idx:i,group:s}}}addColumnDefaultAndTypes(e,t){const i={};_(i,this.gos.get("defaultColDef"),!1,!0);const s=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);s&&this.assignColumnTypes(s,i),_(i,e,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&n&&_(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Ee);P(this.gos.get("columnTypes")||{},(e,t)=>{e in i?console.warn(`AG Grid: the column type '${e}' is a default column type and cannot be overridden.`):(t.type&&U("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t)}),e.forEach(e=>{const s=i[e.trim()];s?_(t,s,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};function nt(e,t,i){if(t)for(let s=0;s<t.length;s++){const r=t[s];r instanceof xe&&nt(r,r.getChildren(),i),i(r,e)}}g([he("dataTypeService")],rt.prototype,"dataTypeService",2),g([m(0,pe("loggerFactory"))],rt.prototype,"setBeans",1),rt=g([ce("columnFactory")],rt);var ot=class e{constructor(e,t,i,s){this.displayedChildren=[],this.localEventService=new me,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return e.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){if(this.displayedChildren.forEach(t=>{t instanceof e&&t.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=De(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(t){let i=!1;return this.children.forEach(s=>{t===s&&(i=!0),s instanceof e&&s.isChildInThisGroupDeepSearch(t)&&(i=!0)}),i}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(t){this.displayedChildren.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addDisplayedLeafColumns(t)})}addLeafColumns(t){this.children.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addLeafColumns(t)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;null!=t&&t.isPadding();)t=t.getParent();if(!t||!t.providedColumnGroup.isExpandable())return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach(i=>{if(!(i instanceof e)||i.displayedChildren&&i.displayedChildren.length)switch(i.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i)}}),this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED))}};ot.EVENT_LEFT_CHANGED="leftChanged",ot.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",g([he("gridOptionsService")],ot.prototype,"gos",2);var at=ot,lt=class{};lt.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",lt.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",lt.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",lt.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",lt.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",lt.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",lt.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",lt.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",lt.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",lt.EVENT_COLUMN_MOVED="columnMoved",lt.EVENT_COLUMN_VISIBLE="columnVisible",lt.EVENT_COLUMN_PINNED="columnPinned",lt.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",lt.EVENT_COLUMN_RESIZED="columnResized",lt.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",lt.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",lt.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",lt.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",lt.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",lt.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",lt.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",lt.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",lt.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",lt.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",lt.EVENT_ROW_GROUP_OPENED="rowGroupOpened",lt.EVENT_ROW_DATA_UPDATED="rowDataUpdated",lt.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",lt.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",lt.EVENT_CHART_CREATED="chartCreated",lt.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",lt.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",lt.EVENT_CHART_DESTROYED="chartDestroyed",lt.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",lt.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",lt.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",lt.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",lt.EVENT_MODEL_UPDATED="modelUpdated",lt.EVENT_CUT_START="cutStart",lt.EVENT_CUT_END="cutEnd",lt.EVENT_PASTE_START="pasteStart",lt.EVENT_PASTE_END="pasteEnd",lt.EVENT_FILL_START="fillStart",lt.EVENT_FILL_END="fillEnd",lt.EVENT_RANGE_DELETE_START="rangeDeleteStart",lt.EVENT_RANGE_DELETE_END="rangeDeleteEnd",lt.EVENT_UNDO_STARTED="undoStarted",lt.EVENT_UNDO_ENDED="undoEnded",lt.EVENT_REDO_STARTED="redoStarted",lt.EVENT_REDO_ENDED="redoEnded",lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",lt.EVENT_CELL_CLICKED="cellClicked",lt.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",lt.EVENT_CELL_MOUSE_DOWN="cellMouseDown",lt.EVENT_CELL_CONTEXT_MENU="cellContextMenu",lt.EVENT_CELL_VALUE_CHANGED="cellValueChanged",lt.EVENT_CELL_EDIT_REQUEST="cellEditRequest",lt.EVENT_ROW_VALUE_CHANGED="rowValueChanged",lt.EVENT_CELL_FOCUSED="cellFocused",lt.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",lt.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",lt.EVENT_ROW_SELECTED="rowSelected",lt.EVENT_SELECTION_CHANGED="selectionChanged",lt.EVENT_TOOLTIP_SHOW="tooltipShow",lt.EVENT_TOOLTIP_HIDE="tooltipHide",lt.EVENT_CELL_KEY_DOWN="cellKeyDown",lt.EVENT_CELL_MOUSE_OVER="cellMouseOver",lt.EVENT_CELL_MOUSE_OUT="cellMouseOut",lt.EVENT_FILTER_CHANGED="filterChanged",lt.EVENT_FILTER_MODIFIED="filterModified",lt.EVENT_FILTER_OPENED="filterOpened",lt.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",lt.EVENT_SORT_CHANGED="sortChanged",lt.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",lt.EVENT_ROW_CLICKED="rowClicked",lt.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",lt.EVENT_GRID_READY="gridReady",lt.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",lt.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",lt.EVENT_VIEWPORT_CHANGED="viewportChanged",lt.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",lt.EVENT_FIRST_DATA_RENDERED="firstDataRendered",lt.EVENT_DRAG_STARTED="dragStarted",lt.EVENT_DRAG_STOPPED="dragStopped",lt.EVENT_CHECKBOX_CHANGED="checkboxChanged",lt.EVENT_ROW_EDITING_STARTED="rowEditingStarted",lt.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",lt.EVENT_CELL_EDITING_STARTED="cellEditingStarted",lt.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",lt.EVENT_BODY_SCROLL="bodyScroll",lt.EVENT_BODY_SCROLL_END="bodyScrollEnd",lt.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",lt.EVENT_PAGINATION_CHANGED="paginationChanged",lt.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",lt.EVENT_STORE_REFRESHED="storeRefreshed",lt.EVENT_STATE_UPDATED="stateUpdated",lt.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",lt.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged",lt.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",lt.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",lt.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",lt.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",lt.EVENT_FLASH_CELLS="flashCells",lt.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",lt.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",lt.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",lt.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",lt.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",lt.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",lt.EVENT_ROW_DRAG_ENTER="rowDragEnter",lt.EVENT_ROW_DRAG_MOVE="rowDragMove",lt.EVENT_ROW_DRAG_LEAVE="rowDragLeave",lt.EVENT_ROW_DRAG_END="rowDragEnd",lt.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",lt.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",lt.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",lt.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",lt.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",lt.EVENT_STORE_UPDATED="storeUpdated",lt.EVENT_FILTER_DESTROYED="filterDestroyed",lt.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",lt.EVENT_ROW_COUNT_READY="rowCountReady",lt.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",lt.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",lt.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",lt.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",lt.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var ct=new Set([lt.EVENT_GRID_PRE_DESTROYED,lt.EVENT_FILL_START]),ht=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},dt="ag-Grid-AutoColumn",ut=class extends st{createAutoGroupColumns(e){const t=[],i=this.gos.get("treeData");let s=this.gos.isGroupMultiAutoColumn();return i&&s&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),s=!1),s?e.forEach((e,i)=>{t.push(this.createOneAutoGroupColumn(e,i))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach((e,i)=>this.updateOneAutoGroupColumn(e,i,t))}createOneAutoGroupColumn(e,t){let i;i=e?`${dt}-${e.getId()}`:dt;const s=this.createAutoGroupColDef(i,e,t);s.colId=i;const r=new Se(s,null,i,!0);return this.context.createBean(r),r}updateOneAutoGroupColumn(e,t,i){const s=e.getColDef(),r="string"==typeof s.showRowGroup?s.showRowGroup:void 0,n=null!=r?this.columnModel.getPrimaryColumn(r):void 0,o=this.createAutoGroupColDef(e.getId(),null!=n?n:void 0,t);e.setColDef(o,null,i),this.columnFactory.applyColumnState(e,o,i)}createAutoGroupColDef(e,t,i){let s=this.createBaseColDef(t);_(s,this.gos.get("autoGroupColumnDef")),s=this.columnFactory.addColumnDefaultAndTypes(s,e),this.gos.get("treeData")||C(s.field)&&C(s.valueGetter)&&C(s.filterValueGetter)&&"agGroupColumnFilter"!==s.filter&&(s.filter=!1),i&&i>0&&(s.headerCheckboxSelection=!1);const r=this.gos.isColumnsSortingCoupledToGroup(),n=s.valueGetter||null!=s.field;return r&&!n&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const t=e.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:t.headerValueGetter}),t.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:t.cellRenderer,innerRendererParams:t.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}};g([he("columnModel")],ut.prototype,"columnModel",2),g([he("columnFactory")],ut.prototype,"columnFactory",2),ut=g([ce("autoGroupColService")],ut);var pt={};p(pt,{camelCaseToHumanText:()=>Ct,camelCaseToHyphenated:()=>bt,capitalise:()=>yt,escapeString:()=>vt,utf8_encode:()=>ft});var gt=/[&<>"']/g,mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ft(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function s(e){if(e>=0&&e<=31&&10!==e)return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=i(e,12),s+=i(e,6)):(function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),s=t(e>>12&15|224),s+=i(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const r=function(e){const t=[];if(!e)return[];const i=e.length;let s,r,n=0;for(;n<i;)s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<i?(r=e.charCodeAt(n++),56320==(64512&r)?t.push(((1023&s)<<10)+(1023&r)+65536):(t.push(s),n--)):t.push(s);return t}(e),n=r.length;let o,a=-1,l="";for(;++a<n;)o=r[a],l+=s(o);return l}function yt(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function vt(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(gt,e=>mt[e])}function Ct(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" "):null}function bt(e){return e.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var St={};function wt(e){const t=new Map;return e.forEach(e=>t.set(e[0],e[1])),t}function xt(e,t){const i=new Map;return e.forEach(e=>i.set(t(e),e)),i}function Et(e){const t=[];return e.forEach((e,i)=>t.push(i)),t}p(St,{convertToMap:()=>wt,keys:()=>Et,mapById:()=>xt});var Mt=class extends st{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.changeEventsDispatching=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation");const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.buildAutoGroupColumns(At(e.source))),this.addManagedPropertyListener("autoGroupColumnDef",e=>this.onAutoGroupColumnDefChanged(At(e.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],e=>this.onSharedColDefChanged(At(e.source))),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),At(e.source))),this.addManagedListener(this.eventService,lt.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;nt(null,e,e=>{i[e.getInstanceId()]=e}),t&&nt(null,t,e=>{i[e.getInstanceId()]=null});const s=Object.values(i).filter(e=>null!=e);this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,r=this.primaryColumnTree,n=this.columnFactory.createColumnTree(this.columnDefs,!0,r,t);this.destroyOldColumns(this.primaryColumnTree,n.columnTree),this.primaryColumnTree=n.columnTree,this.primaryHeaderRowCount=n.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(e=>this.primaryColumnsMap[e.getId()]=e),this.extractRowGroupColumns(t,s),this.extractPivotColumns(t,s),this.extractValueColumns(t,s),this.ready=!0;const o=void 0===this.gridColsArePrimary;(this.gridColsArePrimary||o||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispatching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){const t={type:lt.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t),"gridInitializing"===e&&this.onColumnsReady()}dispatchEverythingChanged(e){const t={type:lt.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(e=>this.gridColumns.indexOf(e)>=0),i=this.gridColumns.filter(e=>t.indexOf(e)<0);this.gridColumns=[...i,...t],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gos.get("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}checkViewportColumns(e=!1){if(null==this.displayedColumnsCenter)return;if(!this.extractViewport())return;const t={type:lt.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(U("Pivot mode not available with treeData."),!1)}setPivotMode(e,t){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;if(this.pivotMode=e,!this.gridColumns)return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:lt.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(C(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let s=null;return this.secondaryColumns.forEach(t=>{const r=t.getColDef().pivotKeys,n=t.getColDef().pivotValueColumn;Ie(r,e)&&n===i&&(s=t)}),s}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?De(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?De(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));const{columns:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:r,source:n="api"}=e;this.animationFrameService.flushAllFrames();const o=[];let a=-1;const l=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),c=null!=s?s:l;for(;0!==a;)a=0,this.actionOnGridColumns(t,e=>{if(o.indexOf(e)>=0)return!1;const t=this.autoWidthCalculator.getPreferredWidthForColumn(e,l);if(t>0){const i=this.normaliseColumnWidth(e,t);e.setActualWidth(i,n),o.push(e),a++}return!0},n);c||this.autoSizeColumnGroupsByColumns(t,n,r),this.dispatchColumnResizedEvent(o,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,s=null){if(e&&e.length){const r={type:lt.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(r)}}dispatchColumnChangedEvent(e,t,i){const s={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:s,finished:r}=e,n={type:lt.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:r,source:i};this.eventService.dispatchEvent(n)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,e=>e.getPinned()),r={type:lt.EVENT_COLUMN_PINNED,pinned:null!=s?s:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(r)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,e=>e.isVisible()),r={type:lt.EVENT_COLUMN_VISIBLE,visible:s,columns:e,column:i,source:t};this.eventService.dispatchEvent(r)}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let r;this.getGridColumns(e).forEach(e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||s.add(t),t=t.getParent()});for(const e of s){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(r=t.getHeaderCtrlForColumn(e),r)break;r&&r.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=e=>{for(let s=0;s<e.length;s++){const r=e[s];r instanceof Se?t.push(r):r instanceof xe&&i(r.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,s){const r=[];let n=null;for(let o=0;o<t.length;o++){const a=t[o],l=t.length-o,c=Math.min(a.getColSpan(e),l),h=[a];if(c>1){const e=c-1;for(let i=1;i<=e;i++)h.push(t[o+i]);o+=e}let d;i?(d=!1,h.forEach(e=>{i(e)&&(d=!0)})):d=!0,d&&(0===r.length&&n&&s&&s(a)&&r.push(n),r.push(a)),n=a}return r}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,t,e=>{const t=e.getLeft();return v(t)&&t>this.viewportLeft})}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const s="first"===t;let r;if(e instanceof at){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;r=s?t[0]:De(t)}else r=e;return(s?i[0]:De(i))===r}getAriaColumnIndex(e){let t;return t=e instanceof at?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,r=this.viewportRight+200;return!(t<s&&i<s||t>r&&i>r)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,s,r,n){if(!e||b(e))return;let o=!1;if(e.forEach(e=>{if(!e)return;const r=this.getPrimaryColumn(e);if(r){if(i){if(t.indexOf(r)>=0)return;t.push(r)}else{if(t.indexOf(r)<0)return;Ne(t,r)}s(r),o=!0}}),!o)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n);const a={type:r,columns:t,column:1===t.length?t[0]:null,source:n};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),lt.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),lt.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,e=>e.setPivotActive(!0,t),lt.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,lt.EVENT_COLUMN_PIVOT_CHANGED,!0,(e,i)=>{i.setPivotActive(e,t)},t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,e=>e.setPivotActive(!1,t),lt.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,s,r,n){if(!this.gridColumns)return;const o=new Map;t.forEach((e,t)=>o.set(e,t)),t.length=0,v(e)&&e.forEach(e=>{const i=this.getPrimaryColumn(e);i&&t.push(i)}),t.forEach((e,t)=>{const i=o.get(e);void 0!==i?s&&i!==t||o.delete(e):o.set(e,0)}),(this.primaryColumns||[]).forEach(e=>{const i=t.indexOf(e)>=0;r(i,e)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n),this.dispatchColumnChangedEvent(i,[...o.keys()],n)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,lt.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),lt.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),lt.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();v(i)&&t<i&&(t=i);const s=e.getMaxWidth();return v(s)&&e.isGreaterThanMax(t)&&(t=s),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,s){const r=[];e.forEach(e=>{const i=this.getPrimaryOrGridColumn(e.key);if(i&&(r.push({width:e.newWidth,ratios:[1],columns:[i]}),"shift"===this.gos.get("colResizeDefault")&&(t=!t),t)){const t=this.getDisplayedColAfter(i);if(!t)return;const s=i.getActualWidth()-e.newWidth,n=t.getActualWidth()+s;r.push({width:n,ratios:[1],columns:[t]})}}),0!==r.length&&this.resizeColumnSets({resizeSets:r,finished:i,source:s})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,r=0,n=!0;return t.forEach(e=>{const t=e.getMinWidth();s+=t||0;const i=e.getMaxWidth();v(i)&&i>0?r+=i:n=!1}),i>=s&&(!n||i<=r)}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(t&&!t.every(e=>this.checkMinAndMaxWidthsForSet(e))){if(i){const e=t&&t.length>0?t[0].columns:null;this.dispatchColumnResizedEvent(e,i,s)}return}const r=[],n=[];t.forEach(e=>{const{width:t,columns:i,ratios:o}=e,a={},l={};i.forEach(e=>n.push(e));let c=!0,h=0;for(;c;){if(h++,h>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}c=!1;const e=[];let s=0,r=t;i.forEach((t,i)=>{if(l[t.getId()])r-=a[t.getId()];else{e.push(t);const r=o[i];s+=r}});const n=1/s;e.forEach((i,s)=>{let h;s===e.length-1?h=r:(h=Math.round(o[s]*t*n),r-=h);const d=i.getMinWidth(),u=i.getMaxWidth();v(d)&&h<d?(h=d,l[i.getId()]=!0,c=!0):v(u)&&u>0&&h>u&&(h=u,l[i.getId()]=!0,c=!0),a[i.getId()]=h})}i.forEach(e=>{const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,s),r.push(e))})});const o=r.length>0;let a=[];o&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(s),this.updateBodyWidths(),this.checkViewportColumns());const l=n.concat(a);(o||i)&&this.dispatchColumnResizedEvent(l,i,s,a)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.getPrimaryColumn(e);s&&(s.setAggFunc(t),this.dispatchColumnChangedEvent(lt.EVENT_COLUMN_VALUE_CHANGED,[s],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupColumns[e],r=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,s);const n={type:lt.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:r,column:1===r.length?r[0]:null,source:i};this.eventService.dispatchEvent(n)}moveColumns(e,t,i,s=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const r=this.getGridColumns(e);!this.doesMovePassRules(r,t)||(Be(this.gridColumns,r,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:r,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return Be(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(e=>this.gridColumns.indexOf(e)<0).length>0||e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach(e=>{const s=(r=e.getColDef().lockPosition)?!0===r||"left"===r?0:2:1;var r;s<t&&(i=!1),t=s}),i}doesMovePassMarryChildren(e){let t=!0;return nt(null,this.gridBalancedTree,i=>{if(!(i instanceof xe))return;const s=i,r=s.getColGroupDef();if(!r||!r.marryChildren)return;const n=[];s.getLeafColumns().forEach(t=>{const i=e.indexOf(t);n.push(i)}),Math.max.apply(Math,n)-Math.min.apply(Math,n)>s.getLeafColumns().length-1&&(t=!1)}),t}moveColumnByIndex(e,t,i){if(!this.gridColumns)return;const s=this.gridColumns[e];this.moveColumns([s],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)):this.lastPrimaryOrder&&e.sort((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const s={type:lt.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(s);const r={type:lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(r)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var e;return null!=(e=this.gridColumns)?e:[]}isRowGroupEmpty(){return b(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gos.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,e=>e.getPinned()!==s&&(e.setPinned(s),!0),i,()=>({type:lt.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,s){if(b(e))return;const r=[];if(e.forEach(e=>{if(!e)return;const i=this.getGridColumn(e);i&&!1!==t(i)&&r.push(i)}),r.length&&(this.updateDisplayedColumns(i),v(s)&&s)){const e=s();e.columns=r,e.column=1===r.length?r[0]:null,this.eventService.dispatchEvent(e)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),r="After"===t?De(s):s[0],n=`getDisplayedCol${t}`;for(;;){const t=this[n](r);if(!t)return null;const s=this.getColumnGroupAtLevel(t,i);if(s!==e)return s}}getColumnGroupAtLevel(e,t){let i,s,r=e.getParent();for(;i=r.getProvidedColumnGroup().getLevel(),s=r.getPaddingLevel(),!(i+s<=t);)r=r.getParent();return r}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,r=null!=e.getSort()?e.getSort():null,n=null!=e.getSortIndex()?e.getSortIndex():null,o=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:r,sortIndex:n,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:o}}getColumnState(){if(C(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(e){const t=wt(this.gridColumns.map((e,t)=>[e.getColId(),t]));e.sort((e,i)=>(t.has(e.colId)?t.get(e.colId):-1)-(t.has(i.colId)?t.get(i.colId):-1))}resetColumnState(e){if(b(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let s=1e3,r=1e3,n=[];this.groupAutoColumns&&(n=n.concat(this.groupAutoColumns)),t&&(n=n.concat(t)),n.forEach(e=>{const t=this.getColumnStateFromColDef(e);C(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=s++),C(t.pivotIndex)&&t.pivot&&(t.pivotIndex=r++),i.push(t)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),s=t(i.sort,i.initialSort),r=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),o=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),l=t(i.flex,i.initialFlex);let c=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null!=c||null!=h&&0!=h||(c=null,h=null);let d=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);null!=d||null!=u&&0!=u||(d=null,u=null);const p=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:r,hide:n,pinned:o,width:a,flex:l,rowGroup:h,rowGroupIndex:c,pivot:u,pivotIndex:d,aggFunc:p}}applyColumnState(e,t){if(b(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(i,s,r)=>{const n=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const o=s.slice(),a={},l={},c=[],h=[];let d=0;const u=this.rowGroupColumns.slice(),p=this.pivotColumns.slice();i.forEach(i=>{const s=i.colId||"";if(s.startsWith(dt))return c.push(i),void h.push(i);const n=r(s);n?(this.syncColumnWithStateItem(n,i,e.defaultState,a,l,!1,t),Ne(o,n)):(h.push(i),d+=1)});const g=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,l,!1,t);o.forEach(g);const m=(e,t,i,s)=>{const r=e[i.getId()],n=e[s.getId()],o=null!=r,a=null!=n;if(o&&a)return r-n;if(o)return-1;if(a)return 1;const l=t.indexOf(i),c=t.indexOf(s),h=l>=0;return h&&c>=0?l-c:h?-1:1};this.rowGroupColumns.sort(m.bind(this,a,u)),this.pivotColumns.sort(m.bind(this,l,p)),this.updateGridColumns();const f=this.groupAutoColumns?this.groupAutoColumns.slice():[];return c.forEach(i=>{const s=this.getAutoColumn(i.colId);Ne(f,s),this.syncColumnWithStateItem(s,i,e.defaultState,null,null,!0,t)}),f.forEach(g),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),n(),{unmatchedAndAutoStates:h,unmatchedCount:d}};this.columnAnimationService.start();let{unmatchedAndAutoStates:s,unmatchedCount:r}=i(e.state||[],this.primaryColumns||[],e=>this.getPrimaryColumn(e));return(s.length>0||v(e.defaultState))&&(r=i(s,this.secondaryColumns||[],e=>this.getSecondaryColumn(e)).unmatchedCount),this.columnAnimationService.finish(),0===r}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(e=>{if(!e.colId||i[e.colId])return;const s=this.gridColumnsMap[e.colId];s&&(t.push(s),i[e.colId]=!0)});let s=0;this.gridColumns.forEach(e=>{const r=e.getColId();null==i[r]&&(r.startsWith(dt)?Fe(t,e,s++):t.push(e))}),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),s={};return i.forEach(e=>{s[e.colId]=e}),()=>{const r=this.getPrimaryAndSecondaryAndAutoColumns(),n=(t,i,s,r)=>{if(Ie(i.map(r),s.map(r)))return;const n=new Set(i);s.forEach(e=>{n.delete(e)||n.add(e)});const o=[...n],a={type:t,columns:o,column:1===o.length?o[0]:null,source:e};this.eventService.dispatchEvent(a)},o=e=>{const t=[];return r.forEach(i=>{const r=s[i.getColId()];r&&e(r,i)&&t.push(i)}),t},a=e=>e.getColId();n(lt.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,a),n(lt.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,a);const l=o((e,t)=>{const i=null!=e.aggFunc,s=i!=t.isValueActive(),r=i&&e.aggFunc!=t.getAggFunc();return s||r});l.length>0&&this.dispatchColumnChangedEvent(lt.EVENT_COLUMN_VALUE_CHANGED,l,e),this.dispatchColumnResizedEvent(o((e,t)=>e.width!=t.getActualWidth()),!0,e),this.dispatchColumnPinnedEvent(o((e,t)=>e.pinned!=t.getPinned()),e),this.dispatchColumnVisibleEvent(o((e,t)=>e.hide==t.isVisible()),e);const c=o((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex());c.length>0&&this.sortController.dispatchSortChangedEvents(e,c),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),s={};i.forEach(e=>s[e.colId]=e);const r={};e.forEach(e=>{s[e.colId]&&(r[e.colId]=!0)});const n=e.filter(e=>r[e.colId]),o=i.filter(e=>r[e.colId]),a=[];o.forEach((e,t)=>{const i=n&&n[t];if(i&&i.colId!==e.colId){const e=this.getGridColumn(i.colId);e&&a.push(e)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,s,r,n,o){var a;if(!e)return;const l=(e,s)=>{const r={value1:void 0,value2:void 0};let n=!1;return t&&(void 0!==t[e]&&(r.value1=t[e],n=!0),v(s)&&void 0!==t[s]&&(r.value2=t[s],n=!0)),!n&&i&&(void 0!==i[e]&&(r.value1=i[e]),v(s)&&void 0!==i[s]&&(r.value2=i[s])),r},c=l("hide").value1;void 0!==c&&e.setVisible(!c,o);const h=l("pinned").value1;void 0!==h&&e.setPinned(h);const d=null!=(a=e.getColDef().minWidth)?a:this.environment.getMinColWidth(),u=l("flex").value1;if(void 0!==u&&e.setFlex(u),null==u){const t=l("width").value1;null!=t&&null!=d&&t>=d&&e.setActualWidth(t,o)}const p=l("sort").value1;void 0!==p&&("desc"===p||"asc"===p?e.setSort(p,o):e.setSort(void 0,o));const g=l("sortIndex").value1;if(void 0!==g&&e.setSortIndex(g),n||!e.isPrimary())return;const m=l("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,o),this.valueColumns.push(e))):(v(m)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,o),Ne(this.valueColumns,e))));const{value1:f,value2:y}=l("rowGroup","rowGroupIndex");void 0===f&&void 0===y||("number"==typeof y||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,o),this.rowGroupColumns.push(e)),s&&"number"==typeof y&&(s[e.getId()]=y)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,o),Ne(this.rowGroupColumns,e)));const{value1:C,value2:b}=l("pivot","pivotIndex");void 0===C&&void 0===b||("number"==typeof b||C?(e.isPivotActive()||(e.setPivotActive(!0,o),this.pivotColumns.push(e)),r&&"number"==typeof b&&(r[e.getId()]=b)):e.isPivotActive()&&(e.setPivotActive(!1,o),Ne(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(e=>{const s=t(e);s&&i.push(s)}),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if("string"==typeof e&&i[e])return i[e];for(let i=0;i<t.length;i++)if(this.columnsMatch(t[i],e))return t[i];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&v(this.groupAutoColumns)&&!C(this.groupAutoColumns)&&this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,r=e.getColId()==t;return i||s||r}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,r){const n=e.headerValueGetter;if(n){const o=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:r});return"function"==typeof n?n(o):"string"==typeof n?this.expressionService.evaluate(n,o):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?Ct(e.field):""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let s,r=null;if(v(i)){const n=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,o=void 0!==e.getColDef().pivotTotalColumnIds;if(n&&!o)return t;r=i?i.getAggFunc():null,s=!0}else{const t=e.isValueActive(),i=this.pivotMode||!this.isRowGroupEmpty();t&&i?(r=e.getAggFunc(),s=!0):s=!1}if(s){const e="string"==typeof r?r:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof at)return e;const i=this.getAllDisplayedTrees(),s="number"==typeof t;let r=null;return Tt(i,!1,i=>{if(i instanceof at){const n=i;let o;o=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),o&&(r=n)}}),r}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(t,i)=>t.setValueActive(i,e),()=>{},()=>{},e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},e=>null!=e.initialAggFunc&&""!=e.initialAggFunc),this.valueColumns.forEach(e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(t,i)=>t.setRowGroupActive(i,e),e=>e.rowGroupIndex,e=>e.initialRowGroupIndex,e=>e.rowGroup,e=>e.initialRowGroup)}extractColumns(e=[],t=[],i,s,r,n,o){const a=[],l=[];(this.primaryColumns||[]).forEach(i=>{const c=e.indexOf(i)<0,h=i.getColDef(),d=x(n(h)),u=x(o(h)),p=w(s(h)),g=w(r(h));let m;m=void 0!==d?d:void 0!==p?null!==p&&p>=0:c?void 0!==u?u:!(void 0===g)&&null!=g&&g>=0:t.indexOf(i)>=0,m&&((c?null!=p||null!=g:null!=p)?a.push(i):l.push(i))});const c=e=>{const t=s(e.getColDef()),i=r(e.getColDef());return null!=t?t:i};a.sort((e,t)=>{const i=c(e),s=c(t);return i===s?0:i<s?-1:1});const h=[].concat(a);return t.forEach(e=>{l.indexOf(e)>=0&&h.push(e)}),l.forEach(e=>{h.indexOf(e)<0&&h.push(e)}),t.forEach(e=>{h.indexOf(e)<0&&i(e,!1)}),h.forEach(e=>{t.indexOf(e)<0&&i(e,!0)}),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(t,i)=>t.setPivotActive(i,e),e=>e.pivotIndex,e=>e.initialPivotIndex,e=>e.pivot,e=>e.initialPivot)}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];nt(null,this.primaryColumnTree,e=>{if(e instanceof xe){const i=e.getColGroupDef(),s={groupId:e.getGroupId(),open:i?i.openByDefault:void 0};t.push(s)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return nt(null,this.gridBalancedTree,t=>{t instanceof xe&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];if(e.forEach(e=>{const t=e.groupId,s=e.open,r=this.getProvidedColumnGroup(t);r&&r.isExpanded()!==s&&(this.logger.log("columnGroupOpened("+r.getGroupId()+","+s+")"),r.setExpanded(s),i.push(r))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length){const e={type:lt.EVENT_COLUMN_GROUP_OPENED,columnGroup:1===xe.length?i[0]:void 0,columnGroups:i};this.eventService.dispatchEvent(e)}this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;s=e instanceof xe?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return nt(null,this.gridBalancedTree,i=>{i instanceof xe&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&C(this.secondaryColumns)?this.gridColumns.filter(e=>{const t=this.groupAutoColumns&&Ve(this.groupAutoColumns,e),i=this.valueColumns&&Ve(this.valueColumns,e);return t||i}):this.gridColumns.filter(e=>this.groupAutoColumns&&Ve(this.groupAutoColumns,e)||e.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(e=>{v(e.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={},this.gridColumns.forEach(e=>{const t=e.getColDef(),i=t.showRowGroup;t&&v(i)&&(this.groupDisplayColumns.push(e),"string"==typeof i?this.groupDisplayColumnsMap[i]=e:!0===i&&this.getRowGroupColumns().forEach(t=>{this.groupDisplayColumnsMap[t.getId()]=e}))})}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return v(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e;if(i||!C(this.secondaryColumns)){if(i){this.processSecondaryColumnDefinitions(e);const i=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,i.columnTree),this.secondaryBalancedTree=i.columnTree,this.secondaryHeaderRowCount=i.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(e=>this.secondaryColumnsMap[e.getId()]=e),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=e=>{e.forEach(e=>{if(v(e.children)){const t=e;i&&i(t),s(t.children)}else t&&t(e)})};e&&s(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const e=wt(this.groupAutoColumns.map(e=>[e,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(t=>!e.has(t)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(t=>!e.has(t)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const e=this.secondaryColumns.some(e=>void 0!==this.gridColumnsMap[e.getColId()]);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,e&&(t=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,t=this.lastPrimaryOrder);if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(t),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(e=>this.gridColumnsMap[e.getId()]=e),this.setAutoHeightActive(),!Ie(e,this.gridBalancedTree)){const e={type:lt.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||U("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(C(e))return;const t=wt(e.map((e,t)=>[e,t]));let i=!0;if(this.gridColumns.forEach(e=>{t.has(e)&&(i=!1)}),i)return;const s=wt(this.gridColumns.map(e=>[e,!0])),r=e.filter(e=>s.has(e)),n=wt(r.map(e=>[e,!0])),o=this.gridColumns.filter(e=>!n.has(e)),a=r.slice();o.forEach(e=>{let t=e.getOriginalParent();if(!t)return void a.push(e);const i=[];for(;!i.length&&t;)t.getLeafColumns().forEach(e=>{const t=a.indexOf(e)>=0,s=i.indexOf(e)<0;t&&s&&i.push(e)}),t=t.getOriginalParent();if(!i.length)return void a.push(e);const s=i.map(e=>a.indexOf(e)),r=Math.max(...s);Fe(a,e,r+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!=(e=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?t:t.filter(e=>e.isVisible()||e.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(e=>{const r=e.getColDef().lockPosition;"right"===r?s.push(e):"left"===r||!0===r?t.push(e):i.push(e)}),[...t,...i,...s]}addAutoGroupToGridColumns(){if(C(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:lt.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],s=[];for(const r of e){const e=r.getPinned();e?!0===e||"left"===e?t.push(r):s.push(r):i.push(r)}this.ariaOrderColumns=t.concat(i).concat(s)}joinDisplayedColumns(){this.gos.get("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(s=>{if(i){let t=this.getWidthOfColsInList(s);s.forEach(i=>{t-=i.getActualWidth(),i.setLeft(t,e)})}else{let t=0;s.forEach(i=>{i.setLeft(t,e),t+=i.getActualWidth()})}_e(t,s)}),t.forEach(t=>{t.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(e=>{e instanceof at&&e.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,Tt(e,!0,e=>{e instanceof Se&&t.push(e)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t]}return C(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(t=>e[t.getId()]=!0);const t=(i,s,r)=>{let n=!1;for(let o=0;o<i.length;o++){const a=i[o];let l=!1;if(a instanceof Se)l=!0===e[a.getId()];else{const e=a.getDisplayedChildren();e&&(l=t(e,s,r+1))}l&&(n=!0,s[r]||(s[r]=[]),s[r].push(a))}return n};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.viewportColumns.map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let s=-1;if(e.resizingCols){const t=new Set(e.resizingCols);let i=this.displayedColumnsCenter;for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){s=e;break}}let r=0,n=[],o=0,a=0;for(let e=0;e<this.displayedColumnsCenter.length;e++)this.displayedColumnsCenter[e].getFlex()&&e>s?(n.push(this.displayedColumnsCenter[e]),a+=this.displayedColumnsCenter[e].getFlex(),o+=null!=(t=this.displayedColumnsCenter[e].getMinWidth())?t:0):r+=this.displayedColumnsCenter[e].getActualWidth();if(!n.length)return[];let l=[];r+o>this.flexViewportWidth&&(n.forEach(e=>{var t;return e.setActualWidth(null!=(t=e.getMinWidth())?t:0,i)}),l=n,n=[]);const c=[];let h;e:for(;;){h=this.flexViewportWidth-r;const e=h/a;for(let t=0;t<n.length;t++){const s=n[t],o=e*s.getFlex();let h=0;const d=s.getMinWidth(),u=s.getMaxWidth();if(v(d)&&o<d?h=d:v(u)&&o>u&&(h=u),h){s.setActualWidth(h,i),Le(n,s),a-=s.getFlex(),l.push(s),r+=s.getActualWidth();continue e}c[t]=Math.round(o)}break}let d=h;return n.forEach((e,t)=>{e.setActualWidth(Math.min(c[t],d),i),l.push(e),d-=c[t]}),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,i,n),n}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var r,n,o,h,d;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,s));const u={};s&&(null==(r=null==s?void 0:s.columnLimits)||r.forEach(e=>{var t=e,{key:i}=t,s=((e,t)=>{var i={};for(var s in e)l.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&a)for(var s of a(e))t.indexOf(s)<0&&c.call(e,s)&&(i[s]=e[s]);return i})(t,["key"]);u["string"==typeof i?i:i.getColId()]=s}));const p=this.getAllDisplayedColumns(),g=e===this.getWidthOfColsInList(p);if(e<=0||!p.length||g)return;const m=[],f=[];p.forEach(e=>{!0===e.getColDef().suppressSizeToFit?f.push(e):m.push(e)});const y=m.slice(0);let C=!1;const b=e=>{Ne(m,e),f.push(e)};for(m.forEach(e=>{var i,r;e.resetActualWidth(t);const n=null==u?void 0:u[e.getId()],o=null!=(i=null==n?void 0:n.minWidth)?i:null==s?void 0:s.defaultMinWidth,a=null!=(r=null==n?void 0:n.maxWidth)?r:null==s?void 0:s.defaultMaxWidth,l=e.getActualWidth();"number"==typeof o&&l<o?e.setActualWidth(o,t,!0):"number"==typeof a&&l>a&&e.setActualWidth(a,t,!0)});!C;){C=!0;const i=e-this.getWidthOfColsInList(f);if(i<=0)m.forEach(e=>{var i,r;const n=null!=(r=null==(i=null==u?void 0:u[e.getId()])?void 0:i.minWidth)?r:null==s?void 0:s.defaultMinWidth;"number"!=typeof n?e.setMinimum(t):e.setActualWidth(n,t,!0)});else{const e=i/this.getWidthOfColsInList(m);let r=i;for(let i=m.length-1;i>=0;i--){const a=m[i],l=null==u?void 0:u[a.getId()],c=null!=(n=null==l?void 0:l.minWidth)?n:null==s?void 0:s.defaultMinWidth,p=null!=(o=null==l?void 0:l.maxWidth)?o:null==s?void 0:s.defaultMaxWidth,g=null!=(h=a.getMinWidth())?h:0,f=null!=(d=a.getMaxWidth())?d:Number.MAX_VALUE,y="number"==typeof c&&c>g?c:a.getMinWidth(),S="number"==typeof p&&p<f?p:a.getMaxWidth();let w=Math.round(a.getActualWidth()*e);v(y)&&w<y?(w=y,b(a),C=!1):v(S)&&w>S?(w=S,b(a),C=!1):0===i&&(w=r),a.setActualWidth(w,t,!0),r-=w}}}y.forEach(e=>{e.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),i||this.dispatchColumnResizedEvent(y,!0,t)}buildDisplayedTrees(e){const t=[],i=[],s=[];e.forEach(e=>{switch(e.getPinned()){case"left":t.push(e);break;case"right":i.push(e);break;default:s.push(e)}});const r=new ht;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,r,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,r,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,r,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Tt(this.displayedTreeCentre,!1,e),Tt(this.displayedTreeLeft,!1,e),Tt(this.displayedTreeRight,!1,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Tt(this.getAllDisplayedTrees(),!1,e=>{e instanceof at&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gos.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if(!(this.rowGroupColumns.length>0||this.gos.get("treeData"))||i||t)this.groupAutoColumns=null;else{const t=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(t,this.groupAutoColumns)||e)return this.groupAutoColumns=t,!0}return!1}isGroupSuppressAutoColumn(){return"custom"===this.gos.get("groupDisplayType")||"custom"===this.gos.get("treeDataDisplayType")}autoColsEqual(e,t){return Ie(e,t,(e,t)=>e.getColId()===t.getColId())}getWidthOfColsInList(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getFirstDisplayedColumn(){const e=this.gos.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?De(s):s[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const t={type:lt.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(e=>e.isAutoHeaderHeight()).map(e=>e.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return null!=(e=this.gos.get("headerHeight"))?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!=(e=this.gos.get("floatingFiltersHeight"))?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!=(e=this.gos.get("groupHeaderHeight"))?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!=(e=this.gos.get("pivotHeaderHeight"))?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!=(e=this.gos.get("pivotGroupHeaderHeight"))?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}isColumnGroupingLocked(e){const t=this.gos.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===t)&&(-1===t||t>this.rowGroupColumns.findIndex(t=>t.getColId()===e.getColId()))}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const s=(e,t,s,r,n,o)=>{if(!t.length||!this.primaryColumns)return[];const a=Object.keys(e),l=new Set(a),c=new Set(a),h=new Set(t.map(e=>{const t=e.getColId();return c.delete(t),t}).concat(a)),d=[],u={};let p=0;for(let e=0;e<this.primaryColumns.length;e++){const t=this.primaryColumns[e].getColId();h.has(t)&&(d.push(t),u[t]=p++)}let g=1e3,m=!1,f=0;const y=t=>{const i=u[t];for(let t=f;t<i;t++){const i=d[t];c.has(i)&&(e[i][n]=g++,c.delete(i))}f=i};t.forEach(t=>{const a=t.getColId();if(l.has(a))y(a),e[a][n]=g++;else{const l=t.getColDef();(null===l[n]||void 0===l[n]&&null==l[o])&&(m||(l[s]||void 0===l[s]&&l[r]?y(a):(c.forEach(t=>{e[t][n]=g+u[t]}),g+=d.length,m=!0)),i[a]||(i[a]={colId:a}),i[a][n]=g++)}})};return s(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:s}=e,r=null==t?void 0:t.map(({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:s,columnLimits:r})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==(null==e?void 0:e.type))return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)})}};function At(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Tt(e,t,i){if(e)for(let s=0;s<e.length;s++){const r=e[s];r instanceof at&&Tt(t?r.getDisplayedChildren():r.getChildren(),t,i),i(r)}}g([he("expressionService")],Mt.prototype,"expressionService",2),g([he("columnFactory")],Mt.prototype,"columnFactory",2),g([he("displayedGroupCreator")],Mt.prototype,"displayedGroupCreator",2),g([he("ctrlsService")],Mt.prototype,"ctrlsService",2),g([he("autoWidthCalculator")],Mt.prototype,"autoWidthCalculator",2),g([he("columnAnimationService")],Mt.prototype,"columnAnimationService",2),g([he("autoGroupColService")],Mt.prototype,"autoGroupColService",2),g([he("valueCache")],Mt.prototype,"valueCache",2),g([he("animationFrameService")],Mt.prototype,"animationFrameService",2),g([he("sortController")],Mt.prototype,"sortController",2),g([he("columnDefFactory")],Mt.prototype,"columnDefFactory",2),g([de("aggFuncService")],Mt.prototype,"aggFuncService",2),g([ae],Mt.prototype,"init",1),g([le],Mt.prototype,"destroyColumns",1),g([m(0,pe("loggerFactory"))],Mt.prototype,"setBeans",1),Mt=g([ce("columnModel")],Mt);var Dt=class extends st{createDisplayedGroups(e,t,i,s){const r=this.mapOldGroupsById(s),n=[];let o=e;for(;o.length;){const e=o;o=[];let s=0;const a=a=>{const l=s;s=a;const c=e[l],h=(c instanceof at?c.getProvidedColumnGroup():c).getOriginalParent();if(null==h){for(let t=l;t<a;t++)n.push(e[t]);return}const d=this.createColumnGroup(h,t,r,i);for(let t=l;t<a;t++)d.addChild(e[t]);o.push(d)};for(let t=1;t<e.length;t++){const i=e[t],r=(i instanceof at?i.getProvidedColumnGroup():i).getOriginalParent(),n=e[s];r!==(n instanceof at?n.getProvidedColumnGroup():n).getOriginalParent()&&a(t)}s<e.length&&a(e.length)}return this.setupParentsIntoColumns(n,null),n}createColumnGroup(e,t,i,s){const r=e.getGroupId(),n=t.getInstanceIdForKey(r);let o=i[at.createUniqueId(r,n)];return o&&o.getProvidedColumnGroup()!==e&&(o=null),v(o)?o.reset():(o=new at(e,r,n,s),this.context.createBean(o)),o}mapOldGroupsById(e){const t={},i=e=>{e.forEach(e=>{if(e instanceof at){const s=e;t[e.getUniqueId()]=s,i(s.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(e=>{if(e.setParent(t),e instanceof at){const t=e;this.setupParentsIntoColumns(t.getChildren(),t)}})}};Dt=g([ce("displayedGroupCreator")],Dt);var It={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,excludeHiddenColumnsFromQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,enableChartToolPanelsButton:!0,suppressChartToolPanelsButton:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressParentsInRowNodes:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,suppressAggAtRootLevel:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,functionsPassive:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},Rt=class{};Rt.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],Rt.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],Rt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],Rt.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],Rt.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilterAllLevels","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval"],Rt.OTHER_PROPERTIES=["suppressStickyTotalRow"],Rt.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],Rt.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],Rt.FUNCTION_PROPERTIES=[...Rt.FUNCTIONAL_PROPERTIES,...Rt.CALLBACK_PROPERTIES],Rt.ALL_PROPERTIES=[...Rt.ARRAY_PROPERTIES,...Rt.OBJECT_PROPERTIES,...Rt.STRING_PROPERTIES,...Rt.NUMBER_PROPERTIES,...Rt.FUNCTION_PROPERTIES,...Rt.BOOLEAN_PROPERTIES,...Rt.OTHER_PROPERTIES];var Pt=Rt,kt=class e{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(t,i){"object"!=typeof t&&(t={});const s=d({},t);return e.getGridOptionKeys().forEach(t=>{const r=i[t];void 0!==r&&r!==e.VUE_OMITTED_PROPERTY&&(s[t]=r)}),s}static processOnChange(t,i,s){if(!t)return;const r={};let n=!1;if(Object.keys(t).filter(t=>e.ALL_PROPERTIES_AND_CALLBACKS_SET.has(t)).forEach(e=>{r[e]=t[e],n=!0}),!n)return;i.__internalUpdateGridOptions(r,!0);const o={type:lt.EVENT_COMPONENT_STATE_CHANGED};P(r,(e,t)=>{o[e]=t}),i.dispatchEvent(o)}};kt.EVENTS=T(lt),kt.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",kt.EXCLUDED_INTERNAL_EVENTS=[lt.EVENT_SCROLLBAR_WIDTH_CHANGED,lt.EVENT_CHECKBOX_CHANGED,lt.EVENT_HEIGHT_SCALE_CHANGED,lt.EVENT_BODY_HEIGHT_CHANGED,lt.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,lt.EVENT_SCROLL_VISIBILITY_CHANGED,lt.EVENT_COLUMN_HOVER_CHANGED,lt.EVENT_FLASH_CELLS,lt.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,lt.EVENT_DISPLAYED_ROWS_CHANGED,lt.EVENT_LEFT_PINNED_WIDTH_CHANGED,lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED,lt.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,lt.EVENT_STORE_UPDATED,lt.EVENT_COLUMN_PANEL_ITEM_DRAG_START,lt.EVENT_COLUMN_PANEL_ITEM_DRAG_END,lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,lt.EVENT_FULL_WIDTH_ROW_FOCUSED,lt.EVENT_HEADER_HEIGHT_CHANGED,lt.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,lt.EVENT_CELL_FOCUS_CLEARED,lt.EVENT_GRID_STYLES_CHANGED,lt.EVENT_FILTER_DESTROYED,lt.EVENT_ROW_DATA_UPDATE_STARTED,lt.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,lt.EVENT_DATA_TYPES_INFERRED,lt.EVENT_FIELD_VALUE_CHANGED,lt.EVENT_FIELD_PICKER_VALUE_SELECTED,lt.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,lt.EVENT_SUPPRESS_MENU_HIDE_CHANGED,lt.EVENT_SUPPRESS_FIELD_DOT_NOTATION,lt.EVENT_ROW_COUNT_READY,lt.EVENT_SIDE_BAR_UPDATED],kt.PUBLIC_EVENTS=kt.EVENTS.filter(e=>!Ve(kt.EXCLUDED_INTERNAL_EVENTS,e)),kt.EVENT_CALLBACKS=kt.EVENTS.map(e=>kt.getCallbackForEvent(e)),kt.BOOLEAN_PROPERTIES=Pt.BOOLEAN_PROPERTIES,kt.ALL_PROPERTIES=Pt.ALL_PROPERTIES,kt.ALL_PROPERTIES_AND_CALLBACKS=[...kt.ALL_PROPERTIES,...kt.EVENT_CALLBACKS],kt.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(kt.ALL_PROPERTIES_AND_CALLBACKS);var Lt=kt,Nt=class extends st{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(e=>this.addComponent(e))}addComponent(e){const t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};Nt=g([ce("agStackComponentsRegistry")],Nt);var _t={};function Ot(e,t,i){null==i||"string"==typeof i&&""==i?Gt(e,t):Ft(e,t,i)}function Ft(e,t,i){e.setAttribute(Bt(t),i.toString())}function Gt(e,t){e.removeAttribute(Bt(t))}function Bt(e){return`aria-${e}`}function Vt(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Ht(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function Ut(e){return parseInt(e.getAttribute("aria-level"),10)}function zt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function Wt(e){return e.getAttribute("aria-label")}function jt(e,t){Ot(e,"label",t)}function Kt(e,t){Ot(e,"labelledby",t)}function $t(e,t){Ot(e,"describedby",t)}function Yt(e,t){Ot(e,"live",t)}function qt(e,t){Ot(e,"atomic",t)}function Xt(e,t){Ot(e,"relevant",t)}function Zt(e,t){Ot(e,"level",t)}function Qt(e,t){Ot(e,"disabled",t)}function Jt(e,t){Ot(e,"hidden",t)}function ei(e,t){Ot(e,"activedescendant",t)}function ti(e,t){Ft(e,"expanded",t)}function ii(e){Gt(e,"expanded")}function si(e,t){Ft(e,"setsize",t)}function ri(e,t){Ft(e,"posinset",t)}function ni(e,t){Ft(e,"multiselectable",t)}function oi(e,t){Ft(e,"rowcount",t)}function ai(e,t){Ft(e,"rowindex",t)}function li(e,t){Ft(e,"colcount",t)}function ci(e,t){Ft(e,"colindex",t)}function hi(e,t){Ft(e,"colspan",t)}function di(e,t){Ft(e,"sort",t)}function ui(e){Gt(e,"sort")}function pi(e,t){Ot(e,"selected",t)}function gi(e,t){Ft(e,"checked",void 0===t?"mixed":t)}function mi(e,t){Ot(e,"controls",t.id),Kt(t,e.id)}function fi(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}p(_t,{getAriaCheckboxStateName:()=>fi,getAriaLabel:()=>Wt,getAriaLevel:()=>Ut,getAriaPosInSet:()=>zt,getAriaSortState:()=>Ht,removeAriaExpanded:()=>ii,removeAriaSort:()=>ui,setAriaActiveDescendant:()=>ei,setAriaAtomic:()=>qt,setAriaChecked:()=>gi,setAriaColCount:()=>li,setAriaColIndex:()=>ci,setAriaColSpan:()=>hi,setAriaControls:()=>mi,setAriaDescribedBy:()=>$t,setAriaDisabled:()=>Qt,setAriaExpanded:()=>ti,setAriaHidden:()=>Jt,setAriaLabel:()=>jt,setAriaLabelledBy:()=>Kt,setAriaLevel:()=>Zt,setAriaLive:()=>Yt,setAriaMultiSelectable:()=>ni,setAriaPosInSet:()=>ri,setAriaRelevant:()=>Xt,setAriaRole:()=>Vt,setAriaRowCount:()=>oi,setAriaRowIndex:()=>ai,setAriaSelected:()=>pi,setAriaSetSize:()=>si,setAriaSort:()=>di});var yi,vi,Ci,bi,Si,wi,xi,Ei,Mi={};function Ai(){return void 0===yi&&(yi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),yi}function Ti(){if(void 0===vi)if(Ai()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(vi=null!=e[1]?parseFloat(e[1]):0)}else vi=0;return vi}function Di(){if(void 0===Ci){const e=window;Ci=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Ci}function Ii(){return void 0===bi&&(bi=/(firefox)/i.test(navigator.userAgent)),bi}function Ri(){return void 0===Si&&(Si=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Si}function Pi(){return void 0===wi&&(wi=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),wi}function ki(){return!Ai()||Ti()>=15}function Li(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||Ii())?t.toString():null}function Ni(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function _i(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientWidth)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientWidth)||-1}function Oi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientHeight)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientHeight)||-1}function Fi(){return null==Ei&&Gi(),Ei}function Gi(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(Ei=i,xi=0===i)}function Bi(){return null==xi&&Gi(),xi}p(Mi,{browserSupportsPreventScroll:()=>ki,getBodyHeight:()=>Oi,getBodyWidth:()=>_i,getMaxDivHeight:()=>Ni,getSafariVersion:()=>Ti,getScrollbarWidth:()=>Fi,getTabIndex:()=>Li,isBrowserChrome:()=>Di,isBrowserFirefox:()=>Ii,isBrowserSafari:()=>Ai,isIOSUserAgent:()=>Pi,isInvisibleScrollbar:()=>Bi,isMacOsUserAgent:()=>Ri});var Vi={};p(Vi,{dateToFormattedString:()=>Zi,parseDateTimeFromString:()=>Qi,serialiseDate:()=>qi});var Hi={};function Ui(e,t){return e.toString().padStart(t,"0")}function zi(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function Wi(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null}function ji(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}function Ki(e,t,i){return"number"!=typeof e?"":$i(Math.round(100*e)/100,t,i)}function $i(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function Yi(e){return null==e?null:e.reduce((e,t)=>e+t,0)}function qi(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>Ui(e,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>Ui(e,2)).join(":")),s}p(Hi,{cleanNumber:()=>Wi,createArrayOfNumbers:()=>zi,decToHex:()=>ji,formatNumberCommas:()=>$i,formatNumberTwoDecimalPlacesAndCommas:()=>Ki,padStartWidthZeros:()=>Ui,sum:()=>Yi});var Xi=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Zi(e,t="YYYY-MM-DD"){const i=Ui(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>Ui(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Xi(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Xi(e.getDate())}`,DD:()=>Ui(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>r[e.getDay()],ddd:()=>r[e.getDay()].slice(0,3),dd:()=>r[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Xi(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(n).join("|"),"g");return t.replace(o,e=>e in n?n[e]():e)}function Qi(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(e=>parseInt(e,10));if(3!==s.filter(e=>!isNaN(e)).length)return null;const[r,n,o]=s,a=new Date(r,n-1,o);if(a.getFullYear()!==r||a.getMonth()!==n-1||a.getDate()!==o)return null;if(!i||"00:00:00"===i)return a;const[l,c,h]=i.split(":").map(e=>parseInt(e,10));return l>=0&&l<24&&a.setHours(l),c>=0&&c<60&&a.setMinutes(c),h>=0&&h<60&&a.setSeconds(h),a}var Ji,es={};function ts(e,t,i){const s=e.parentElement;let r=s&&s.firstChild;for(;r;)t&&r.classList.toggle(t,r===e),i&&r.classList.toggle(i,r!==e),r=r.nextSibling}p(es,{FOCUSABLE_EXCLUDE:()=>ss,FOCUSABLE_SELECTOR:()=>is,addOrRemoveAttribute:()=>Fs,addStylesToElement:()=>As,bindCellRendererToHtmlElement:()=>Bs,clearElement:()=>vs,copyNodeList:()=>_s,ensureDomOrder:()=>xs,formatSize:()=>Ls,getAbsoluteHeight:()=>us,getAbsoluteWidth:()=>ps,getElementRectWithOffset:()=>gs,getElementSize:()=>cs,getInnerHeight:()=>hs,getInnerWidth:()=>ds,getScrollLeft:()=>fs,insertWithDomOrder:()=>Ms,isElementChildOfClass:()=>ls,isFocusableFormField:()=>rs,isHorizontalScrollShowing:()=>Ts,isInDOM:()=>bs,isNodeOrElement:()=>Ns,isRtlNegativeScroll:()=>ms,isVerticalScrollShowing:()=>Ds,isVisible:()=>Ss,iterateNamedNodeMap:()=>Os,loadTemplate:()=>ws,nodeListForEach:()=>Gs,radioCssClass:()=>ts,removeFromParent:()=>Cs,setDisabled:()=>as,setDisplayed:()=>ns,setDomChildOrder:()=>Es,setElementHeight:()=>Ps,setElementWidth:()=>Is,setFixedHeight:()=>ks,setFixedWidth:()=>Rs,setScrollLeft:()=>ys,setVisible:()=>os});var is="[tabindex], input, select, button, textarea, [href]",ss="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function rs(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),s=t.call(e,ss),r=Ss(e);return i&&!s&&r}function ns(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Jt(e,!t)}function os(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Jt(e,!t)}function as(e,t){const i="disabled",s=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);s(e),Gs(e.querySelectorAll("input"),e=>s(e))}function ls(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function cs(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:r,borderBottomWidth:n,borderLeftWidth:o,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:h,marginTop:d,marginRight:u,marginBottom:p,marginLeft:g,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(r||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(o||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(c||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(d||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(p||"0"),marginLeft:parseFloat(g||"0"),boxSizing:m}}function hs(e){const t=cs(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function ds(e){const t=cs(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function us(e){const t=cs(e),i=t.marginBottom+t.marginTop;return Math.ceil(e.offsetHeight+i)}function ps(e){const t=cs(e),i=t.marginLeft+t.marginRight;return Math.ceil(e.offsetWidth+i)}function gs(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:r,borderBottomWidth:n}=cs(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(r||0),bottom:t.bottom+(n||0)}}function ms(){if("boolean"==typeof Ji)return Ji;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n            <span style="display: inline-block; width: 1px"></span>\n            <span style="display: inline-block; width: 1px"></span>\n        </div>',document.body.appendChild(e),e.scrollLeft=1,Ji=0===Math.floor(e.scrollLeft),document.body.removeChild(e),Ji}function fs(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),Di()&&!ms()&&(i=e.scrollWidth-e.clientWidth-i)),i}function ys(e,t,i){i&&(ms()?t*=-1:(Ai()||Di())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function vs(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function Cs(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function bs(e){return!!e.offsetParent}function Ss(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!bs(e)||"visible"!==window.getComputedStyle(e).visibility)}function ws(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function xs(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Es(e,t){for(let i=0;i<t.length;i++){const s=t[i],r=e.children[i];r!==s&&e.insertBefore(s,r)}}function Ms(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function As(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const t=bt(i),r=s.toString(),n=r.replace(/\s*!important/g,""),o=n.length!=r.length?"important":void 0;e.style.setProperty(t,n,o)}}function Ts(e){return e.clientWidth<e.scrollWidth}function Ds(e){return e.clientHeight<e.scrollHeight}function Is(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Rs(e,t)}function Rs(e,t){t=Ls(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function Ps(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):ks(e,t)}function ks(e,t){t=Ls(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Ls(e){return"number"==typeof e?`${e}px`:e}function Ns(e){return e instanceof Node||e instanceof HTMLElement}function _s(e){if(null==e)return[];const t=[];return Gs(e,e=>t.push(e)),t}function Os(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function Fs(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Gs(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function Bs(e,t){e.then(e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)})}var Vs={};function Hs(e,t,i){const s={},r=e.filter(e=>!t.some(t=>t===e));return r.length>0&&r.forEach(e=>s[e]=Us(e,i).values),s}function Us(e,t,i,s){let r=t.map((t,i)=>({value:t,relevance:zs(e.toLowerCase(),t.toLocaleLowerCase()),idx:i}));if(r.sort((e,t)=>t.relevance-e.relevance),i&&(r=r.filter(e=>0!==e.relevance)),r.length>0&&s&&s>0){const e=r[0].relevance*s;r=r.filter(t=>e-t.relevance<0)}const n=[],o=[];for(const e of r)n.push(e.value),o.push(e.idx);return{values:n,indices:o}}function zs(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let r=0,n=-1;for(let e=0;e<i.length;e++){const t=s.indexOf(i[e],n+1);-1!==t&&(n=t,r+=100-100*n/1e4*100)}return r}p(Vs,{fuzzyCheckStrings:()=>Hs,fuzzySuggestions:()=>Us});var Ws={};p(Ws,{createIcon:()=>Ks,createIconNoSpan:()=>$s,iconNameClassMap:()=>js});var js={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus"};function Ks(e,t,i){const s=$s(e,t,i);if(s){const{className:e}=s;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return s}const r=document.createElement("span");return r.appendChild(s),r}function $s(e,t,i,s){let r=null;const n=i&&i.getColDef().icons;if(n&&(r=n[e]),t&&!r){const i=t.get("icons");i&&(r=i[e])}if(!r){const t=document.createElement("span");let i=js[e];return i||(s?i=e:(console.warn(`AG Grid: Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),Vt(t,"presentation"),t}{let e;if("function"==typeof r)e=r();else{if("string"!=typeof r)throw new Error("icon from grid options needs to be a string or a function");e=r}if("string"==typeof e)return ws(e);if(Ns(e))return e;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var Ys={};p(Ys,{isDeleteKey:()=>er,isEventFromPrintableCharacter:()=>Xs,isUserSuppressingHeaderKeyboardEvent:()=>Qs,isUserSuppressingKeyboardEvent:()=>Zs,normaliseQwertyAzerty:()=>Js});var qs=class{};function Xs(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key.length}function Zs(e,t,i,s,r){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const o=e.addGridCommonParams({event:t,editing:r,column:s,node:i,data:i.data,colDef:s.getColDef()});return!(!n||!n(o))}function Qs(e,t,i,s){const r=s.getDefinition(),n=r&&r.suppressHeaderKeyboardEvent;return!!v(n)&&!!n(e.addGridCommonParams({colDef:r,column:s,headerRowIndex:i,event:t}))}function Js(e){const{keyCode:t}=e;let i;switch(t){case 65:i=qs.A;break;case 67:i=qs.C;break;case 86:i=qs.V;break;case 68:i=qs.D;break;case 90:i=qs.Z;break;case 89:i=qs.Y;break;default:i=e.code}return i}function er(e,t=!1){return e===qs.DELETE||!t&&e===qs.BACKSPACE&&Ri()}qs.BACKSPACE="Backspace",qs.TAB="Tab",qs.ENTER="Enter",qs.ESCAPE="Escape",qs.SPACE=" ",qs.LEFT="ArrowLeft",qs.UP="ArrowUp",qs.RIGHT="ArrowRight",qs.DOWN="ArrowDown",qs.DELETE="Delete",qs.F2="F2",qs.PAGE_UP="PageUp",qs.PAGE_DOWN="PageDown",qs.PAGE_HOME="Home",qs.PAGE_END="End",qs.A="KeyA",qs.C="KeyC",qs.D="KeyD",qs.V="KeyV",qs.X="KeyX",qs.Y="KeyY",qs.Z="KeyZ";var tr={};function ir(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),r=Math.abs(e.clientY-t.clientY);return Math.max(s,r)<=i}p(tr,{areEventsNear:()=>ir});var sr={};function rr(e,t){if(!e)return!1;const i=(e,i)=>{const s=t[e.id],r=t[i.id],n=void 0!==s,o=void 0!==r;return n&&o?s-r:n||o?n?1:-1:e.__objectId-i.__objectId};let s,r,n=!1;for(let t=0;t<e.length-1;t++)if(s=e[t],r=e[t+1],i(s,r)>0){n=!0;break}return!!n&&(e.sort(i),!0)}p(sr,{sortRowNodesByOrder:()=>rr});var nr={};function or(e){const t=new Set;return e.forEach(e=>t.add(e)),t}p(nr,{convertToSet:()=>or});var ar=d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d({},_t),Ae),Mi),Vi),es),Me),B),Vs),f),Ws),Ys),St),tr),Hi),I),sr),nr),pt),lr=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},cr=(e=>(e[e.IN_PROGRESS=0]="IN_PROGRESS",e[e.RESOLVED=1]="RESOLVED",e))(cr||{}),hr=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(t){return new e(e=>{let i=t.length;const s=new Array(i);t.forEach((t,r)=>{t.then(t=>{s[r]=t,i--,0===i&&e(s)})})})}static resolve(t=null){return new e(e=>e(t))}then(t){return new e(e=>{1===this.status?e(t(this.resolution)):this.waiters.push(i=>e(t(i)))})}resolveNow(e,t){return 1===this.status?t(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}},dr=class{constructor(){this.timestamp=(new Date).getTime()}print(e){const t=(new Date).getTime()-this.timestamp;console.info(`${e} = ${t}`),this.timestamp=(new Date).getTime()}},ur=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.addCssClass(e));else if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.removeCssClass(e));else if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(e){if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach(e=>this.addOrRemoveCssClass(e,t))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}}},pr=class e extends st{constructor(e,t,i,s){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=s,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();0===this.tooltipTrigger&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),1===this.tooltipTrigger&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&U(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,i;return"show"===e?null!=(t=this.tooltipShowDelayOverride)?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):null!=(i=this.tooltipHideDelayOverride)?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Pi()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,s=this.parentComp.getGui(),r=null==(t=this.tooltipComp)?void 0:t.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(null==r?void 0:r.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=d({},this.parentComp.getTooltipParams());if(!v(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:lt.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.getContext().destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});r&&(this.tooltipPopupDestroyFunc=r.hideFunc),this.positionTooltip(),1===this.tooltipTrigger&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,lt.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(0===this.tooltipTrigger?(this.tooltipMouseEnterListener=this.addManagedListener(i,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(i,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(i,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(i,"focusout",this.onTooltipFocusOut.bind(this))||null));const n={type:lt.EVENT_TOOLTIP_SHOW,tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(n),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),s=null==(t=this.tooltipComp)?void 0:t.getGui(),r=e.relatedTarget;(null==s?void 0:s.contains(r))||(this.isInteractingWithTooltip=!1,i.contains(r)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(u(d({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(u(d({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=0===this.tooltipTrigger?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(e=>{e&&e()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){e.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};pr.isLocked=!1,g([he("popupService")],pr.prototype,"popupService",2),g([he("userComponentFactory")],pr.prototype,"userComponentFactory",2),g([ae],pr.prototype,"postConstruct",1);var gr=pr,mr=class extends st{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,s;if(null!=this.tooltipManager)return;const r={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new gr(r,null==(t=(e=this.ctrl).getTooltipShowDelayOverride)?void 0:t.call(e),null==(s=(i=this.ctrl).getTooltipHideDelayOverride)?void 0:s.call(i),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>{var e;return null==(e=this.tooltipManager)?void 0:e.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};g([he("beans")],mr.prototype,"beans",2),g([ae],mr.prototype,"postConstruct",1);var fr=new lr,yr=class e extends st{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=fr.next(),this.cssClassManager=new ur(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:i,hideDelayOverride:s,location:r,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);null!=t&&(this.tooltipFeature=this.createBean(new mr({getTooltipValue:()=>this.tooltipText,getGui:()=>this.getGui(),getLocation:()=>null!=r?r:"UNKNOWN",getColDef:null==e?void 0:e.getColDef,getColumn:null==e?void 0:e.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=s?()=>s:void 0,shouldDisplayTooltip:n})))}createChildComponentsFromTags(e,t){_s(e.childNodes).forEach(i=>{if(!(i instanceof HTMLElement))return;const s=this.createComponentFromElement(i,e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())},t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)})}createComponentFromElement(t,i,s){const r=t.nodeName,n=s?s[t.getAttribute("ref")]:void 0,o=this.agStackComponentsRegistry.getComponentClass(r);if(o){e.elementGettingCreated=t;const s=new o(n);return s.setParentComponent(this),this.createBean(s,null,i),s}return null}copyAttributesFromNode(e,t){Os(e.attributes,(e,i)=>t.setAttribute(e,i))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(s=>{i[s.attributeName]===t&&(i[s.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;null!=t;){const i=t.__agComponentMetaData,s=W(t.constructor);i&&i[s]&&i[s].querySelectors&&i[s].querySelectors.forEach(t=>e(t)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(e=>e.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=ws(e);this.setTemplateFromElement(i,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(t=>{const i=i=>e[t.attributeName]=i;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const e=this.eGui.querySelector(t.querySelector);e&&i(e.__agComponent||e)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(null!=e)if(t||(t=this.eGui),Ns(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;os(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;ns(this.eGui,t,{skipAriaHidden:s});const r={type:e.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(r)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}};yr.EVENT_DISPLAYED_CHANGED="displayedChanged",g([he("agStackComponentsRegistry")],yr.prototype,"agStackComponentsRegistry",2),g([oe],yr.prototype,"preConstructOnComponent",1),g([oe],yr.prototype,"createChildComponentsPreConstruct",1);var vr=yr;function Cr(e){return Sr.bind(this,e,void 0)}function br(e){return Sr.bind(this,`[ref=${e}]`,e)}function Sr(e,t,i,s,r){null!==e?"number"!=typeof r?function(e,t,i){const s=function(e,t){return e.__agComponentMetaData||(e.__agComponentMetaData={}),e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={}),e.__agComponentMetaData[t]}(e,W(e.constructor));s[t]||(s[t]=[]),s[t].push(i)}(i,"querySelectors",{attributeName:s,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var wr=class extends vr{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}}):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}};g([br("eFloatingFilterText")],wr.prototype,"eFloatingFilterText",2),g([he("columnModel")],wr.prototype,"columnModel",2);var xr=class{constructor(e,t,i,s,r){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(t=>{this.alive?(this.dateComp=t,t&&(s.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),null==r||r(this))):e.destroyBean(t)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){ns(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let s=!1;(null==(t=this.dateComp)?void 0:t.refresh)&&"function"==typeof this.dateComp.refresh&&null!==this.dateComp.refresh(e)&&(s=!0),!s&&(null==(i=this.dateComp)?void 0:i.onParamsUpdated)&&"function"==typeof this.dateComp.onParamsUpdated&&null!==this.dateComp.onParamsUpdated(e)&&U("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Er=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{"string"!=typeof e&&([["displayKey"],["displayName"],["predicate","test"]].every(t=>!!t.some(t=>null!=e[t])||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter(t=>t===e)||[])})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},Mr={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"},Ar=class e extends st{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=d({shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(e.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",e=>{e.defaultPrevented||qe(e)||(this.callbacks.shouldStopEventPropagation(e)?Ye(e):e.key===qs.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))})}};Ar.FOCUS_MANAGED_CLASS="ag-focus-managed",g([he("focusService")],Ar.prototype,"focusService",2),g([ae],Ar.prototype,"postConstruct",1);var Tr=Ar,Dr="ag-resizer-wrapper",Ir=`<div class="${Dr}">\n        <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n        <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n        <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n        <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n        <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n        <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n        <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n        <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n    </div>`,Rr=class extends st{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:r,height:n,x:o,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,c=0;const h=Ss(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;c=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;l=parseInt(t.minHeight,10)-i}}if(this.minHeight=r||l,this.minWidth=i||c,s&&this.setWidth(s),n&&this.setHeight(n),s&&n||this.refreshSize(),e)this.center();else if(o||a)this.offsetElement(o,a);else if(h&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),s=parseFloat(e.style.left);t?this.offsetElement(isNaN(s)?0:s,isNaN(i)?0:i):this.setPosition(s,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const i=!!e[t],s=this.getResizerElement(t),r={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(r),this.resizeListeners.push(r),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=i)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))ks(i,e),e=us(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?ks(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,o=e?0:r.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-s.bottom}}return i+o-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Rs(t,e),e=ps(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Rs(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)}):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:r,topBuffer:n}=e,o=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!r,o)?0:o,movementY:this.shouldSkipY(t,!!s,n,a)?0:a}}shouldSkipX(e,t,i,s){const r=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:r.left;let l=a<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=o.right;return!!l||(l=t?s<0&&e.clientX>a+n.left||s>0&&e.clientX<a+n.left:i?s<0&&e.clientX>o.right||s>0&&e.clientX<a+n.left:s<0&&e.clientX>o.right||s>0&&e.clientX<o.right,l)}shouldSkipY(e,t,i=0,s){const r=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:r.top;let l=a<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=o.bottom;return!!l||(l=t?s<0&&e.clientY>a+n.top+i||s>0&&e.clientY<a+n.top:s<0&&e.clientY>o.bottom||s>0&&e.clientY<o.bottom,l)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(Ir,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Dr}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;i||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const r=e[s],n=!!r.style.flex&&"0 0 auto"!==r.style.flex;if(r===this.element)continue;let o=this.minHeight||0,a=this.minWidth||0;if(n){const e=window.getComputedStyle(r);e.minHeight&&(o=parseInt(e.minHeight,10)),e.minWidth&&(a=parseInt(e.minWidth,10))}else o=r.offsetHeight,a=r.offsetWidth;t+=o,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const r=i[s];r!==t&&(e?r.style.height=`${r.offsetHeight}px`:r.style.width=`${r.offsetWidth}px`,r.style.flex="0 0 auto",r===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:r,isBottom:n,isLeft:o}=this.currentResizer,a=r||o,l=n||s,{movementX:c,movementY:h}=this.calculateMouseMovement({e,isLeft:o,isTop:s}),d=this.position.x,u=this.position.y;let p=0,g=0;if(a&&c){const e=o?-1:1,t=this.getWidth(),i=t+c*e;let s=!1;o&&(p=t-i,(d+p<=0||i<=this.minWidth)&&(s=!0,p=0)),s||this.setWidth(i)}if(l&&h){const e=s?-1:1,t=this.getHeight(),i=t+h*e;let r=!1;s?(g=t-i,(u+g<=0||i<=this.minHeight)&&(r=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(r=!0),r||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&p||g)&&this.offsetElement(d+p,u+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:r,movementY:n}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+r,i+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};g([he("popupService")],Rr.prototype,"popupService",2),g([he("resizeObserverService")],Rr.prototype,"resizeObserverService",2),g([he("dragService")],Rr.prototype,"dragService",2);var Pr=class e extends vr{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new Tr(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Rr(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`\n            <form class="ag-filter-wrapper">\n                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n                    ${this.createBodyTemplate()}\n                </div>\n            </form>`;this.setTemplate(i,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetButtonsPanel()}updateParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(vs(this.eButtonsPanel),this.buttonListeners.forEach(e=>null==e?void 0:e()),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&Cs(this.eButtonsPanel));const i=document.createDocumentFragment(),s=e=>{let t,s;switch(e){case"apply":t=this.translate("applyFilter"),s=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),s=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),s=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),s=e=>{this.onBtCancel(e)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const r=ws(`<button\n                    type="${"apply"===e?"submit":"button"}"\n                    ref="${e}FilterButton"\n                    class="ag-button ag-standard-button ag-filter-apply-panel-button"\n                >${t}\n                </button>`);this.buttonListeners.push(this.addManagedListener(r,"click",s)),i.append(r)};or(e).forEach(e=>s(e)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const t=e.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),i=Z(this.checkApplyDebounce.bind(this),t);this.onBtApplyDebounce=()=>{this.debouncePending=!0,i()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),null==t||t()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;"Enter"!==i&&"Space"!==i||(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.getRefElement("applyFilterButton");t&&as(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(null==e?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(t,i){return e.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:i}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Mr[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};g([he("rowModel")],Pr.prototype,"rowModel",2),g([br("eFilterBody")],Pr.prototype,"eFilterBody",2),g([ae],Pr.prototype,"postConstruct",1);var kr=Pr,Lr=class extends vr{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:r}=this.config;null!=r&&this.setDisabled(r),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){vs(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(ns(this.eLabel,!1),Vt(this.eLabel,"presentation")):(ns(this.eLabel,!0),Vt(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||Is(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return as(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}};g([ae],Lr.prototype,"postConstruct",1);var Nr=class extends Lr{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();null!==Wt(e)?Kt(e,""):Kt(e,null!=t?t:"")}setAriaLabel(e){return jt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,lt.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Rs(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:lt.EVENT_FIELD_VALUE_CHANGED})),this}},_r=class extends Nr{constructor(e){if(super(e,(null==e?void 0:e.template)||'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',null==e?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=null==e?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:r,maxPickerWidth:n}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=r&&this.setPickerMinWidth(r),null!=n&&this.setPickerMaxWidth(n)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i,inputWidth:s}=this.config;if(i){const e=$s(i,this.gos);e&&this.eIcon.appendChild(e)}null!=s&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ti(e,!1),this.ariaRole&&Vt(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(null==e?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case qs.UP:case qs.DOWN:case qs.ENTER:case qs.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case qs.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:r,modalPicker:n=!0}=this.config,o={modal:n,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,r)},a=this.popupService.addPopup(o),{maxPickerHeight:l,minPickerWidth:c,maxPickerWidth:h,variableWidth:d}=this;d?(c&&(t.style.minWidth=c),t.style.width=Ls(ps(this.eWrapper)),h&&(t.style.maxWidth=h)):Is(t,null!=h?h:ps(this.eWrapper));const u=null!=l?l:`${hs(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",u),t.style.position="absolute",this.alignPickerToComponent(),a.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){this.isAlive()&&(ti(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e))}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(null==(t=this.pickerComponent)?void 0:t.getGui().contains(e.relatedTarget))||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return Is(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}};g([he("popupService")],_r.prototype,"popupService",2),g([br("eLabel")],_r.prototype,"eLabel",2),g([br("eWrapper")],_r.prototype,"eWrapper",2),g([br("eDisplayField")],_r.prototype,"eDisplayField",2),g([br("eIcon")],_r.prototype,"eIcon",2);var Or=class e extends vr{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.options=[],this.itemEls=[]}init(){const e=this.getGui();this.addManagedListener(e,"mouseleave",()=>this.clearHighlighted()),this.unFocusable||this.addManagedListener(e,"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case qs.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case qs.DOWN:case qs.UP:e.preventDefault(),this.navigate(t);break;case qs.PAGE_DOWN:case qs.PAGE_UP:case qs.PAGE_HOME:case qs.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===qs.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,r=Math.floor(this.getGui().clientHeight/s);let n=-1;e===qs.PAGE_HOME?n=0:e===qs.PAGE_END?n=i:e===qs.PAGE_DOWN?n=Math.min(t+r,i):e===qs.PAGE_UP&&(n=Math.max(t-r,0)),-1!==n&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{Cs(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{ri(t,i+1),si(t,e.length)})}renderOption(e,t){const i=this.gos.getDocument(),s=i.createElement("div");Vt(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const r=i.createElement("span");s.appendChild(r),r.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListener(s,"mousemove",()=>this.highlightItem(s)),this.addManagedListener(s,"mousedown",t=>{t.preventDefault(),this.setValue(e)}),this.createManagedBean(new mr({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex(t=>t.value===e);if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(e=>e.value===this.value);-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(t){if(!Ss(t))return;this.clearHighlighted(),this.highlightedEl=t,this.highlightedEl.classList.add(e.ACTIVE_CLASS),pi(this.highlightedEl,!0);const i=this.getGui(),{scrollTop:s,clientHeight:r}=i,{offsetTop:n,offsetHeight:o}=t;(n+o>s+r||n<s)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&Ss(this.highlightedEl)&&(this.highlightedEl.classList.remove(e.ACTIVE_CLASS),pi(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:lt.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}};Or.EVENT_ITEM_SELECTED="selectedItem",Or.ACTIVE_CLASS="ag-active-item",g([ae],Or.prototype,"init",1);var Fr=Or,Gr=class e extends _r{constructor(e){super(d({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},e))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new Fr("select",!0)),this.listComponent.setParentComponent(this);const t=this.listComponent.getAriaElement(),i=`ag-select-list-${this.listComponent.getCompId()}`;t.setAttribute("id",i),mi(this.getAriaElement(),t),this.listComponent.addManagedListener(this.listComponent,Fr.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,lt.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}onKeyDown(e){var t;const{key:i}=e;switch(i===qs.TAB&&this.hidePicker(),i){case qs.ENTER:case qs.UP:case qs.DOWN:case qs.PAGE_UP:case qs.PAGE_DOWN:case qs.PAGE_HOME:case qs.PAGE_END:e.preventDefault(),this.isPickerDisplayed?null==(t=this.listComponent)||t.handleKeyDown(e):super.onKeyDown(e);break;case qs.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return null==(e=this.listComponent)||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let s=this.listComponent.getDisplayValue();return null==s&&this.config.placeholder&&(s=this.config.placeholder),this.eDisplayField.textContent=s,this.setTooltip({newTooltipText:null!=s?s:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}};Gr.EVENT_ITEM_SELECTED="selectedItem";var Br=Gr,Vr=class extends Nr{constructor(e,t,i="text",s="input"){super(e,`\n            <div role="presentation">\n                <div ref="eLabel" class="ag-input-field-label"></div>\n                <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n                    <${s} ref="eInput" class="ag-input-field-input"></${s}>\n                </div>\n            </div>`,t),this.inputType=i,this.displayFieldTag=s}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Is(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Fs(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return jt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return as(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Fs(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Fs(this.eInput,"autocomplete",t)}return this}};g([br("eLabel")],Vr.prototype,"eLabel",2),g([br("eWrapper")],Vr.prototype,"eWrapper",2),g([br("eInput")],Vr.prototype,"eInput",2);var Hr=class extends Vr{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:lt.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const s=this.getInputElement(),r={type:lt.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(r)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},Ur=class extends Hr{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,lt.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},zr=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e;let{conditions:s}=t;if(!s){const{condition1:e,condition2:i}=t;s=[e,i]}const r=s.map(e=>this.getModelAsString(e)),n="AND"===t.operator?"andCondition":"orCondition";return r.join(` ${i(n,Mr[n])} `)}if(e.type===jr.BLANK||e.type===jr.NOT_BLANK)return i(e.type,e.type);{const t=e,s=this.optionsFactory.getCustomOption(t.type),{displayKey:r,displayName:n,numberOfInputs:o}=s||{};return r&&n&&0===o?(i(r,n),n):this.conditionToString(t,s)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!=(t=this.valueFormatter(null!=e?e:null))?t:"":String(e)}},Wr=class e extends kr{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(t){const i=this.optionsFactory.getCustomOption(t);if(i){const{numberOfInputs:e}=i;return null!=e?e:1}const s=[e.EMPTY,e.NOT_BLANK,e.BLANK];return t&&s.indexOf(t)>=0?0:t===e.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let r;if(i){const i=e,s=t;r=this.areSimpleModelsEqual(i,s)}else{const i=e,s=t;r=i.operator===s.operator&&Ie(i.conditions,s.conditions,(e,t)=>this.areSimpleModelsEqual(e,t))}return r}shouldRefresh(e){var t,i,s;const r=this.getModel(),n=r?null!=(t=r.conditions)?t:[r]:null,o=null!=(s=null==(i=e.filterOptions)?void 0:i.map(e=>"string"==typeof e?e:e.displayKey))?s:this.getDefaultFilterOptions();return!(n&&!n.every(e=>void 0!==o.find(t=>t===e.type))||"number"==typeof e.maxNumConditions&&n&&n.length>e.maxNumConditions)}refresh(e){return!!this.shouldRefresh(e)&&(!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0))}setModelIntoUi(e){if(e.operator){let t=e;t.conditions||(t.conditions=[t.condition1,t.condition2]);const i=this.validateAndUpdateConditions(t.conditions),s=this.getNumConditions();if(i<s)this.removeConditionsAndOperators(i);else if(i>s)for(let e=s;e<i;e++)this.createJoinOperatorPanel(),this.createOption();const r="OR"===t.operator;this.eJoinOperatorsAnd.forEach(e=>e.setValue(!r,!0)),this.eJoinOperatorsOr.forEach(e=>e.setValue(r,!0)),t.conditions.forEach((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)})}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),hr.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),U('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(null==i)return!0;const{operator:s}=i,r=[];if(s){const e=i;r.push(...null!=(t=e.conditions)?t:[])}else r.push(i);return r[s&&"OR"===s?"some":"every"](t=>this.individualConditionPasses(e,t))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Er,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;null!=e.suppressAndOrCondition&&U('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),null!=e.alwaysShowBothConditions&&U('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=null!=(t=e.maxNumConditions)?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(U('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!=(i=e.numAlwaysVisibleConditions)?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(U('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(U('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Br);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,e=>this.resetInput(e)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,r=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,r),this.resetJoinOperatorOr(i,s,r),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new Ur);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,i=!0;for(let e=0;e<this.getNumConditions();e++)this.isConditionUiComplete(e)?t=e:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const i=null!=(e=this.lastUiCompletePosition)?e:this.getNumConditions()-2;if(t<i){this.removeConditionsAndOperators(i+1);const e=t+1,s=i-e;s>0&&this.removeConditionsAndOperators(e,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((t,i)=>{const s=this.isConditionDisabled(i,e);t.setDisabled(s||this.filterListOptions.length<=1),1===i&&(as(this.eJoinOperatorPanels[0],s),this.eJoinOperatorsAnd[0].setDisabled(s),this.eJoinOperatorsOr[0].setDisabled(s))}),this.eConditionBodies.forEach((e,t)=>{ns(e,this.isConditionBodyVisible(t))});const i="OR"===(null!=t?t:this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e,t)=>{e.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((e,t)=>{e.setValue(i,!0)}),this.forEachInput((t,i,s,r)=>{this.setElementDisplayed(t,i<r),this.setElementDisabled(t,this.isConditionDisabled(s,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(e=>Cs(e))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(e=>{Cs(e.getGui()),this.destroyBean(e)})}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(null==e?void 0:e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof Vr&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const r=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const r=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||r)&&(this.removeConditionsAndOperators(e,1),s=!0,r&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,r),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(j(this.filterPlaceholder)){const e=this.filterPlaceholder,s=this.eTypes[t].getValue();i=e({filterOptionKey:s,filterOption:this.translate(s),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,r)=>{if(!(t instanceof Vr))return;const n=0===i&&r>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",o=0===i&&r>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,s)),t.setInputAriaLabel(o)})}setElementValue(e,t,i){e instanceof Vr&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof vr&&ns(e.getGui(),t)}setElementDisabled(e,t){e instanceof vr&&as(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Vr&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),r=this.getInputs(e);for(let t=0;t<r.length;t++){const n=r[t];null!=n&&i(n,t,e,s)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(t){return!(t>=this.getNumConditions())&&(this.getConditionType(t)!==e.EMPTY&&!this.getValues(t).some(e=>null==e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(e=>this.resetType(e)),this.eJoinOperatorsAnd.forEach((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t)),this.eJoinOperatorsOr.forEach((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t)),this.joinOperatorId++,this.forEachInput(e=>this.resetInput(e)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),hr.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,r){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${r}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((e,s,r,n)=>{r===t&&this.setElementValue(e,null!=i[s]?i[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s,r)=>{this.setElementValue(t,0===i&&0===s?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,e=>{this.attachElementOnChange(e,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),r=this.optionsFactory.getCustomOption(t.type),n=this.evaluateCustomFilter(r,s,i);return null!=n?n:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:s}=e;return null==s||t.some(e=>null==e)?void 0:s(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}};Wr.EMPTY="empty",Wr.BLANK="blank",Wr.NOT_BLANK="notBlank",Wr.EQUALS="equals",Wr.NOT_EQUAL="notEqual",Wr.LESS_THAN="lessThan",Wr.LESS_THAN_OR_EQUAL="lessThanOrEqual",Wr.GREATER_THAN="greaterThan",Wr.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",Wr.IN_RANGE="inRange",Wr.CONTAINS="contains",Wr.NOT_CONTAINS="notContains",Wr.STARTS_WITH="startsWith",Wr.ENDS_WITH="endsWith";var jr=Wr,Kr=class e extends jr{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(t){switch(t){case e.EQUALS:case e.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case e.GREATER_THAN:case e.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case e.LESS_THAN:case e.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case e.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case e.BLANK:return!0;case e.NOT_BLANK:return!1}return!1}evaluateNonNullValue(t,i,s){const r=this.comparator(),n=null!=t[0]?r(t[0],i):0;switch(s.type){case e.EQUALS:return 0===n;case e.NOT_EQUAL:return 0!==n;case e.GREATER_THAN:return n>0;case e.GREATER_THAN_OR_EQUAL:return n>=0;case e.LESS_THAN:return n<0;case e.LESS_THAN_OR_EQUAL:return n<=0;case e.IN_RANGE:{const e=r(t[1],i);return this.scalarFilterParams.inRangeInclusive?n>=0&&e<=0:n>0&&e<0}case e.BLANK:return this.isBlank(i);case e.NOT_BLANK:return!this.isBlank(i);default:return console.warn('AG Grid: Unexpected type of filter "'+s.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},$r=1/0,Yr=class extends zr{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},r=i==jr.IN_RANGE||2===s,n=Qi(e.dateFrom),o=Qi(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;return r?`${null!==n?Zi(n,a):"null"}-${null!==o?Zi(o,a):"null"}`:null!=n?Zi(n,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},qr=class e extends Kr{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=$r,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Qi(t)||null,i&&Qi(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);console.warn(`AG Grid: DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",$r),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Qi(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Qi(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Yr(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new xr(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const r=this.gos.getDocument().createElement("div");r.classList.add(`ag-filter-${s}`),r.classList.add(`ag-filter-date-${s}`),t.push(r),e.appendChild(r),i.push(this.createDateCompWrapper(r))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(e=>e.destroy())}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,r,n)=>{r!==e||!t||s>=n||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=qi(s[0])),s.length>1&&(i.dateTo=qi(s[1])),d({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,s,r)=>{i<r&&t.push(e.getDate())}),t}translate(e){return e===Kr.LESS_THAN?super.translate("before"):e===Kr.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};qr.DEFAULT_FILTER_OPTIONS=[Kr.EQUALS,Kr.NOT_EQUAL,Kr.LESS_THAN,Kr.GREATER_THAN,Kr.IN_RANGE,Kr.BLANK,Kr.NOT_BLANK],g([he("userComponentFactory")],qr.prototype,"userComponentFactory",2);var Xr=qr,Zr=class extends vr{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return null==e?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;t=e.operator?e.conditions[0]:e,this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Er,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[jr.IN_RANGE,jr.EMPTY,jr.BLANK,jr.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}};g([he("columnModel")],Zr.prototype,"columnModel",2);var Qr=class extends Zr{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n                <div ref="eDateWrapper" style="display: flex;"></div>\n            </div>')}getDefaultFilterOptions(){return Xr.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Yr(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(Qi(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){ns(this.eDateWrapper,e),ns(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=qi(this.dateComp.getDate());this.params.parentFilterInstance(t=>{if(t){const i=Qi(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const e=kr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Z(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new xr(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}};g([he("userComponentFactory")],Qr.prototype,"userComponentFactory",2),g([br("eReadOnlyText")],Qr.prototype,"eReadOnlyText",2),g([br("eDateWrapper")],Qr.prototype,"eDateWrapper",2);var Jr=class extends vr{constructor(){super('\n            <div class="ag-filter-filter">\n                <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListener(t,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()}),this.addManagedListener(t,"input",e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&Ai(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:r,minValidDate:n,maxValidDate:o}=e.filterParams||{};if(n&&s&&U("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),o&&r&&U("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),n&&o){const[e,t]=[n,o].map(e=>e instanceof Date?e:Qi(e));e&&t&&e.getTime()>t.getTime()&&U("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}n?n instanceof Date?t.min=Zi(n):t.min=n:s&&(t.min=`${s}-01-01`),o?o instanceof Date?t.max=Zi(o):t.max=o:r&&(t.max=`${r}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Qi(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(qi(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Di()||Ii()||Ai()&&Ti()>=14.1}};g([br("eDateInput")],Jr.prototype,"eDateInput",2);var en=class extends Vr{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=v(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",t=>{Xs(t)&&t.key&&!e.test(t.key)&&t.preventDefault()}),this.addManagedListener(this.eInput,"paste",t=>{var i;const s=null==(i=t.clipboardData)?void 0:i.getData("text");s&&s.split("").some(t=>!e.test(t))&&t.preventDefault()})}},tn=class extends en{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof s&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,Fs(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Fs(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Fs(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue(e=>super.setValue(e,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},e)}setValueOrInputValue(e,t,i){if(v(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(s||(s=(i=this.adjustPrecision(i))!=this.normalizeValue(i)),s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},sn=class extends zr{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==jr.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function rn(e){const{allowedCharPattern:t}=null!=e?e:{};return null!=t?t:null}var nn=class e extends Kr{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new sn(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(null!=t?t:null):t;super.setElementValue(e,s)}createValueElement(){const e=rn(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),Vt(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const r=this.createManagedBean(s?new en({allowedCharPattern:s}):new tn);r.addCssClass(`ag-filter-${i}`),r.addCssClass("ag-filter-filter"),t.push(r),e.appendChild(r.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,s,r)=>{i<r&&t.push(this.processValue(this.stringToFloat(e.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=y(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}};nn.DEFAULT_FILTER_OPTIONS=[Kr.EQUALS,Kr.NOT_EQUAL,Kr.GREATER_THAN,Kr.GREATER_THAN_OR_EQUAL,Kr.LESS_THAN,Kr.LESS_THAN_OR_EQUAL,Kr.IN_RANGE,Kr.BLANK,Kr.NOT_BLANK];var on=nn,an=class extends zr{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==jr.IN_RANGE||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}},ln=class e extends jr{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return""===t?e:t}getDefaultDebounceMs(){return 500}setParams(t){this.textFilterParams=t,super.setParams(t),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?e.DEFAULT_FORMATTER:e.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new an(this.localeService,this.optionsFactory)}getTextMatcher(){const t=this.textFilterParams.textCustomComparator;return t?(ar.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:e,value:i,filterText:s})=>t(e,i,s)):this.textFilterParams.textMatcher||e.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(t,i){const s=[];return this.forEachPositionInput(t,(t,r,n,o)=>{var a;if(r<o){let r=y(t.getValue());i&&this.textFilterParams.trimInput&&(r=null!=(a=e.trimInput(r))?a:null,t.setValue(r,!0)),s.push(r)}}),s}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Vt(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new en);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){const t=[jr.NOT_EQUAL,jr.NOT_CONTAINS,jr.BLANK];return!!e&&t.indexOf(e)>=0}evaluateNonNullValue(e,t,i,s){const r=e.map(e=>this.formatter(e))||[],n=this.formatter(t),{api:o,colDef:a,column:l,columnApi:c,context:h,textFormatter:p}=this.textFilterParams;if(i.type===jr.BLANK)return this.isBlank(t);if(i.type===jr.NOT_BLANK)return!this.isBlank(t);const g={api:o,colDef:a,column:l,columnApi:c,context:h,node:s.node,data:s.data,filterOption:i.type,value:n,textFormatter:p};return r.some(e=>this.matcher(u(d({},g),{filterText:e})))}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};ln.DEFAULT_FILTER_OPTIONS=[jr.CONTAINS,jr.NOT_CONTAINS,jr.EQUALS,jr.NOT_EQUAL,jr.STARTS_WITH,jr.ENDS_WITH,jr.BLANK,jr.NOT_BLANK],ln.DEFAULT_FORMATTER=e=>e,ln.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),ln.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case ln.CONTAINS:return t.indexOf(i)>=0;case ln.NOT_CONTAINS:return t.indexOf(i)<0;case ln.EQUALS:return t===i;case ln.NOT_EQUAL:return t!=i;case ln.STARTS_WITH:return 0===t.indexOf(i);case ln.ENDS_WITH:const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length;default:return!1}};var cn=ln,hn=class extends st{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new en(null==(t=this.params)?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",e=>this.valueChangedListener(e)),this.addManagedListener(i,"keydown",e=>this.valueChangedListener(e))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},dn=class extends Zr{postConstruct(){this.setTemplate('\n            <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n        ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!=(t=e.browserAutoComplete)&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=kr.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const e=kr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t=Z(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();vs(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===qs.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=cn.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}};g([br("eFloatingFilterInputContainer")],dn.prototype,"eFloatingFilterInputContainer",2),g([ae],dn.prototype,"postConstruct",1);var un=class extends st{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new tn),this.eFloatingFilterTextInput=this.createManagedBean(new en),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,e=>this.valueChangedListener(e)),this.setupListeners(i,e=>this.valueChangedListener(e))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},pn=class extends dn{init(e){var t;super.init(e),this.filterModelFormatter=new sn(this.localeService,this.optionsFactory,null==(t=e.filterParams)?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){rn(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return on.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=rn(e.filterParams),this.allowedCharPattern?this.createManagedBean(new hn({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new un)}},gn=class extends dn{init(e){super.init(e),this.filterModelFormatter=new an(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return cn.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new hn)}},mn=class e{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new me,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",r,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",r,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(t){if(this.touching)return;this.touchStart=t.touches[0],this.touching=!0,this.moved=!1;const i=this.touchStart;window.setTimeout(()=>{const s=this.touchStart===i;if(this.touching&&s&&!this.moved){this.moved=!0;const i={type:e.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:t};this.eventService.dispatchEvent(i)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);t&&!ir(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(t){if(this.touching){if(!this.moved){const t={type:e.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&t.cancelable&&t.preventDefault(),this.touching=!1}}checkForDoubleTap(){const t=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0)if(t-this.lastTapTime>e.DOUBLE_TAP_MILLIS){const t={type:e.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.lastTapTime=null}else this.lastTapTime=t;else this.lastTapTime=t}destroy(){this.destroyFuncs.forEach(e=>e())}};mn.EVENT_TAP="tap",mn.EVENT_DOUBLE_TAP="doubleTap",mn.EVENT_LONG_TAP="longTap",mn.DOUBLE_TAP_MILLIS=500;var fn=mn,yn=class e extends vr{constructor(t){super(),t||this.setTemplate(e.TEMPLATE)}attachCustomElements(e,t,i,s,r){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=r}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),(this.column.isSortable()||this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",()=>this.updateIcons()),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,lt.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const s=$s(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;ns(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;ns(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;ns(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,lt.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);ns(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=null!=(e=this.sortController.getDisplaySortIndexForColumn(this.column))?e:-1,s=t.some(e=>{var t;return null!=(t=this.sortController.getDisplaySortIndexForColumn(e))&&t}),r=i>=0&&s;ns(this.eSortOrder,r,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():vs(this.eSortOrder)}};yn.TEMPLATE='<span class="ag-sort-indicator-container">\n            <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n        </span>',g([br("eSortOrder")],yn.prototype,"eSortOrder",2),g([br("eSortAsc")],yn.prototype,"eSortAsc",2),g([br("eSortDesc")],yn.prototype,"eSortDesc",2),g([br("eSortMixed")],yn.prototype,"eSortMixed",2),g([br("eSortNone")],yn.prototype,"eSortNone",2),g([he("columnModel")],yn.prototype,"columnModel",2),g([he("sortController")],yn.prototype,"sortController",2);var vn=yn,Cn=class e extends vr{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&t.enableFilterButton==e.enableFilterButton&&t.enableFilterIcon==e.enableFilterIcon&&(this.setDisplayName(e),!0)}workOutTemplate(){var t;let i=null!=(t=this.params.template)?t:e.TEMPLATE;return i=i&&i.trim?i.trim():i,i}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=vt(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const s=$s(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new fn(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&v(this.eMenu),r=s?new fn(this.eMenu,!0):t;if(this.params.enableMenu){const e=s?"EVENT_TAP":"EVENT_LONG_TAP",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListener(r,fn[e],t)}if(this.params.enableSorting){const e=e=>{var t,s;const r=e.touchStart.target;i&&((null==(t=this.eMenu)?void 0:t.contains(r))||(null==(s=this.eFilterButton)?void 0:s.contains(r)))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,fn.EVENT_TAP,e)}if(this.params.enableFilterButton){const e=new fn(this.eFilterButton,!0);this.addManagedListener(e,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>e.destroy())}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>r.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return Cs(this.eMenu),void(this.eMenu=void 0);const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedListener(this.eMenu,"click",()=>this.params.showColumnMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){var t,i,s,r;const{column:n}=this.params,o=this.menuService.isLegacyMenuEnabled();if(e&&!o){if(this.menuService.isFilterMenuInHeaderEnabled(n))return this.params.showFilter(null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(null!=(r=null!=(s=this.eMenu)?s:this.eFilterButton)?r:this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new vn(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListener(this.params.column,Se.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=(new Date).getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!t&&!i){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}});const e=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const e=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),t=!(null==e?void 0:e.every(e=>this.params.column.getSort()==e.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",t)}};this.addManagedListener(this.eventService,lt.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){this.eFilterButton&&(this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0)}configureFilter(e,t,i){if(!e)return Cs(t),!1;const{column:s}=this.params;return this.addInIcon("filter",t,s),this.addManagedListener(s,Se.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();ns(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,i,s,r;return e?null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui():null!=(r=null!=(s=this.eMenu)?s:this.eFilterButton)?r:this.getGui()}};Cn.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n            <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n            <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n            <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n                <span ref="eText" class="ag-header-cell-text"></span>\n                <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n                <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n            </div>\n        </div>',g([he("sortController")],Cn.prototype,"sortController",2),g([he("menuService")],Cn.prototype,"menuService",2),g([he("columnModel")],Cn.prototype,"columnModel",2),g([br("eFilter")],Cn.prototype,"eFilter",2),g([br("eFilterButton")],Cn.prototype,"eFilterButton",2),g([br("eSortIndicator")],Cn.prototype,"eSortIndicator",2),g([br("eMenu")],Cn.prototype,"eMenu",2),g([br("eLabel")],Cn.prototype,"eLabel",2),g([br("eText")],Cn.prototype,"eText",2),g([br("eSortOrder")],Cn.prototype,"eSortOrder",2),g([br("eSortAsc")],Cn.prototype,"eSortAsc",2),g([br("eSortDesc")],Cn.prototype,"eSortDesc",2),g([br("eSortMixed")],Cn.prototype,"eSortMixed",2),g([br("eSortNone")],Cn.prototype,"eSortNone",2);var bn=Cn,Sn=class e extends vr{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&U("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=e=>{if(qe(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=e=>{Ye(e)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,xe.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,xe.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new fn(e,!0);this.addManagedListener(i,fn.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();ns(this.eOpenIcon,e),ns(this.eCloseIcon,!e)}else ns(this.eOpenIcon,!1),ns(this.eCloseIcon,!1)}addInIcon(e,t){const i=$s(e,this.gos,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return ns(this.eOpenIcon,!1),void ns(this.eCloseIcon,!1)}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(v(t)){const e=vt(t,!0);this.getRefElement("agLabel").textContent=e}this.addOrRemoveCssClass("ag-sticky-label",!(null==(e=i.getColGroupDef())?void 0:e.suppressStickyLabel))}};Sn.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n            <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n            <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n            <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n        </div>',g([he("columnModel")],Sn.prototype,"columnModel",2),g([br("agOpened")],Sn.prototype,"eOpenIcon",2),g([br("agClosed")],Sn.prototype,"eCloseIcon",2);var wn=Sn,xn=class extends vr{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},En=class e extends xn{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),v(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===qs.LEFT||t===qs.UP||t===qs.RIGHT||t===qs.DOWN||e.shiftKey&&t===qs.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return v(e)||v(this.params.value)?this.params.parseValue(e):this.params.value}};En.TEMPLATE='<div class="ag-large-text">\n            <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n        </div>',g([br("eTextArea")],En.prototype,"eTextArea",2);var Mn=En,An=class extends xn{constructor(){super('<div class="ag-cell-edit-wrapper">\n                <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n            </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:r,value:n,eventKey:o}=e;if(C(r))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=o&&o===qs.ENTER;let a=!1;r.forEach(s=>{const r={value:s},o=i.formatValue(e.column,null,s),l=null!=o;r.text=l?o:s,t.addOption(r),a=a||n===s}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:h}=e;null!=l&&t.setPickerGap(l),null!=h&&t.setPickerMaxHeight(h),null!=c&&t.setPickerMaxWidth(c),"fullRow"!==s.get("editType")&&this.addManagedListener(this.eSelect,Br.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};g([he("valueService")],An.prototype,"valueService",2),g([br("eSelect")],An.prototype,"eSelect",2);var Tn=class extends xn{constructor(e){super(`\n            <div class="ag-cell-edit-wrapper">\n                ${e.getTemplate()}\n            </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===qs.BACKSPACE||e.eventKey===qs.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==qs.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",e=>{const{key:t}=e;t!==qs.PAGE_UP&&t!==qs.PAGE_DOWN||e.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Ai()||s.getFocusableElement().focus();const r=s.getInputElement();this.highlightAllOnFocus?r.select():null==(t=(e=this.cellEditorInput).setCaret)||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};g([br("eInput")],Tn.prototype,"eInput",2);var Dn=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return v(e)||v(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=v(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},In=class extends Tn{constructor(){super(new Dn)}},Rn=class extends vr{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),r=v(s)?s:i,n=t>=0;this.eDelta.textContent=n?"↑"+r:"↓"+r,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),vs(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(v(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:v(e.value)?this.eValue.textContent=i:vs(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}};g([he("filterManager")],Rn.prototype,"filterManager",2);var Pn=class extends vr{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let i=e.value;return C(i)&&(i=""),i!==this.lastValue&&!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,v(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:v(e.value)?this.eCurrent.textContent=i:vs(this.eCurrent),!0)}};g([he("filterManager")],Pn.prototype,"filterManager",2);var kn=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:e.EVENT_DATA_CHANGED,node:this,oldData:i,newData:t,update:s}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=v(this.id)?this.createDaemonNode():null,s=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const r=this.createDataChangedEvent(e,s,!1);this.dispatchLocalEvent(r)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_SELECTABLE_CHANGED)),i)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:null!=e&&e,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getCallback("getRowId");if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!v(this.rowTop)||!v(this.rowHeight))&&e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_TOP_CHANGED)),this.setDisplayed(null!==t))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DISPLAYED_CHANGED)))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DRAGGING_CHANGED)))}setHighlighted(t){t!==this.highlighted&&(this.highlighted=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_MASTER_CHANGED)))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_GROUP_CHANGED)))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Z(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(null==s)return;if(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(r=>{let n=s[r.getId()];if(null==n){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(r.getPinned()){case"left":t=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":t=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:t=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(t.includes(r))return void(e=!0);n=-1}}else t=!1;n>i&&(i=n)}),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const r=this.beans.rowModel;r.onRowHeightChangedDebounced&&r.onRowHeightChangedDebounced()}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_UI_LEVEL_CHANGED)))}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_EXPANDED_CHANGED));const r=Object.assign({},this.createGlobalRowEvent(lt.EVENT_ROW_GROUP_OPENED),{expanded:t,event:i||null});this.beans.rowNodeEventThrottle.dispatchExpanded(r,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,i){const s=(()=>{var t;return"string"!=typeof e?e:null!=(t=this.beans.columnModel.getGridColumn(e))?t:this.beans.columnModel.getPrimaryColumn(e)})(),r=this.getValueFromValueService(s);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(s,r,t,i),!1;const n=this.beans.valueService.setValue(this,s,t,i);return this.dispatchCellChangedEvent(s,t,r),this.checkRowSelectable(),n}getValueFromValueService(e){var t,i;const s=this.leafGroup&&this.beans.columnModel.isPivotMode(),r=this.group&&this.expanded&&!this.footer&&!s;let n=!1;const o=null!=(t=this.beans.gos.get("groupTotalRow"))?t:this.beans.gos.get("groupIncludeFooter");n="function"!=typeof o?!!o:!!(null!=(i=this.beans.gos.getCallback("groupTotalRow"))?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const a=this.beans.gos.get("groupSuppressBlankHeader"),l=r&&n&&!a;return this.beans.valueService.getValue(e,this,!1,l)}dispatchEventForSaveValueReadOnly(e,t,i,s){const r=this.beans.gos.addGridCommonParams({type:lt.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s});this.beans.eventService.dispatchEvent(r)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);C(this.groupData)&&(this.groupData={});const s=i.getColId(),r=this.groupData[s];r!==t&&(this.groupData[s]=t,this.dispatchCellChangedEvent(i,t,r))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,s=t?t[e]:void 0;if(i===s)return;const r=this.beans.columnModel.lookupGridColumn(e);r&&this.dispatchCellChangedEvent(r,i,s)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const e=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(e?!!i&&i(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&b(this.childrenAfterGroup)}dispatchCellChangedEvent(t,i,s){const r={type:e.EVENT_CELL_CHANGED,node:this,column:t,newValue:i,oldValue:s};this.dispatchLocalEvent(r)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(t=>t.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let t=!1,i=!1,s=!1;if(!(null==(e=this.childrenAfterGroup)?void 0:e.length))return this.selectable?this.selected:null;for(let e=0;e<this.childrenAfterGroup.length;e++){const r=this.childrenAfterGroup[e];let n=r.isSelected();if(!r.selectable){const e=r.calculateSelectedFromChildren();if(null===e)continue;n=e}switch(n){case!0:t=!0;break;case!1:i=!0;break;default:s=!0}}return s||t&&i?void 0:!!t||!i&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}selectThisNode(t,i,s="api"){const r=!this.selectable&&t,n=this.selected===t;if(r||n)return!1;this.selected=t,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_ROW_SELECTED));const o=this.sibling;o&&o.footer&&o.eventService&&o.dispatchLocalEvent(o.createLocalRowEvent(e.EVENT_ROW_SELECTED));const a=u(d({},this.createGlobalRowEvent(lt.EVENT_ROW_SELECTED)),{event:i||null,source:s});return this.beans.eventService.dispatchEvent(a),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(u(d({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var i,s;this.eventService||(this.eventService=new me),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new fe(this.beans.frameworkOverrides));const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?s:t;this.eventService.addEventListener(e,r)}removeEventListener(e,t){var i,s;if(!this.eventService)return;const r=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?s:t;this.eventService.removeEventListener(e,r),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,s=!1,r=null;for(;i&&!s;){const n=t.parent;v(n)&&t.firstChild?n.rowGroupColumn===e&&(s=!0,r=n):i=!1,t=n}return s?r:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach(e=>{t.has(e)||(i[e]=this[e])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};kn.ID_PREFIX_ROW_GROUP="row-group-",kn.ID_PREFIX_TOP_PINNED="t-",kn.ID_PREFIX_BOTTOM_PINNED="b-",kn.OBJECT_ID_SEQUENCE=0,kn.EVENT_ROW_SELECTED="rowSelected",kn.EVENT_DATA_CHANGED="dataChanged",kn.EVENT_CELL_CHANGED="cellChanged",kn.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",kn.EVENT_MASTER_CHANGED="masterChanged",kn.EVENT_GROUP_CHANGED="groupChanged",kn.EVENT_MOUSE_ENTER="mouseEnter",kn.EVENT_MOUSE_LEAVE="mouseLeave",kn.EVENT_HEIGHT_CHANGED="heightChanged",kn.EVENT_TOP_CHANGED="topChanged",kn.EVENT_DISPLAYED_CHANGED="displayedChanged",kn.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",kn.EVENT_LAST_CHILD_CHANGED="lastChildChanged",kn.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",kn.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",kn.EVENT_EXPANDED_CHANGED="expandedChanged",kn.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",kn.EVENT_SELECTABLE_CHANGED="selectableChanged",kn.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",kn.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",kn.EVENT_DRAGGING_CHANGED="draggingChanged";var Ln=kn,Nn=class extends vr{constructor(){super('\n            <div class="ag-selection-checkbox" role="presentation">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=fi(e,t),[s,r]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],n=e(s,r);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",e=>{Ye(e)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",e=>{Ye(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(i,t)?0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e):i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}),this.addManagedListener(this.rowNode,Ln.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.rowNode,Ln.EVENT_DATA_CHANGED,e),this.addManagedListener(this.rowNode,Ln.EVENT_CELL_CHANGED,e),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i;let s=this.rowNode.selectable;const r=this.getIsVisible();if(s)if("function"==typeof r){const t=null==(e=this.overrides)?void 0:e.callbackParams;if(this.column){const e=this.column.createColumnFunctionCallbackParams(this.rowNode);s=r(d(d({},t),e))}else s=r(u(d({},t),{node:this.rowNode,data:this.rowNode.data}))}else s=null!=r&&r;if(null==(t=this.column)?void 0:t.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!s),this.setVisible(!0),void this.setDisplayed(!0);(null==(i=this.overrides)?void 0:i.removeHidden)?this.setDisplayed(s):this.setVisible(s)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null==(t=null==(e=this.column)?void 0:e.getColDef())?void 0:t.checkboxSelection}};g([br("eCheckbox")],Nn.prototype,"eCheckbox",2),g([ae],Nn.prototype,"postConstruct",1);var _n=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(_n||{}),On=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(On||{}),Fn=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Fn||{}),Gn=class extends st{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Ks("columnMovePin",this.gos,null),this.eHideIcon=Ks("columnMoveHide",this.gos,null),this.eMoveIcon=Ks("columnMoveMove",this.gos,null),this.eLeftIcon=Ks("columnMoveLeft",this.gos,null),this.eRightIcon=Ks("columnMoveRight",this.gos,null),this.eGroupIcon=Ks("columnMoveGroup",this.gos,null),this.eAggregateIcon=Ks("columnMoveValue",this.gos,null),this.ePivotIcon=Ks("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=Ks("dropNotAllowed",this.gos,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(t=>t.dragSource===e);t&&(this.dragService.removeDragSource(t.params),Ne(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,s,r,n;const o=this.getHorizontalDirection(e),a=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const l=this.dropTargets.filter(t=>this.isMouseOnDropTarget(e,t)),c=this.findCurrentDropTarget(e,l);if(c!==this.lastDropTarget)this.leaveLastTargetIfExists(e,o,a,t),null!==this.lastDropTarget&&null===c&&(null==(s=(i=this.dragSource).onGridExit)||s.call(i,this.dragItem)),null===this.lastDropTarget&&null!==c&&(null==(n=(r=this.dragSource).onGridEnter)||n.call(r,this.dragItem)),this.enterDragTargetIfExists(c,e,o,a,t),this.lastDropTarget=c;else if(c&&c.onDragging){const i=this.createDropTargetEvent(c,e,o,a,t);c.onDragging(i)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const s=e.clientX>=t.left&&e.clientX<t.right,r=e.clientY>=t.top&&e.clientY<t.bottom;if(!s||!r)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const t of i)if(this.allContainersIntersect(e,t)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const s=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of s)for(const i of t)if(-1!==He(this.getAllContainersFromDropTarget(i)).indexOf(e))return i;return null}enterDragTargetIfExists(e,t,i,s,r){if(e){if(e.onDragEnter){const n=this.createDropTargetEvent(e,t,i,s,r);e.onDragEnter(n)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const r=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(r)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(e=>e.external).find(t=>t.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,r){const n=e.getContainer(),o=n.getBoundingClientRect(),{gridApi:a,columnApi:l,dragItem:c,dragSource:h}=this;return{event:t,x:t.clientX-o.left,y:t.clientY-o.top,vDirection:s,hDirection:i,dragSource:h,fromNudge:r,dragItem:c,api:a,columnApi:l,dropZoneTarget:n}}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,s=_i()-2,r=Oi()-2,n=gs(t.offsetParent),{clientY:o,clientX:a}=e;let l=o-n.top-i/2,c=a-n.left-10;const h=this.gos.getDocument(),d=h.defaultView||window,u=d.pageYOffset||h.documentElement.scrollTop,p=d.pageXOffset||h.documentElement.scrollLeft;s>0&&c+t.clientWidth>s+p&&(c=s+p-t.clientWidth),c<0&&(c=0),r>0&&l+t.clientHeight>r+u&&(l=r+u-t.clientHeight),l<0&&(l=0),t.style.left=`${c}px`,t.style.top=`${l}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=ws(Gn.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;j(i)&&(i=i()),t.innerHTML=vt(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gos.getDocument();let r=null,n=null;try{r=s.fullscreenElement}catch(e){}finally{r||(r=this.gos.getRootNode());n=r.querySelector("body")||(r instanceof ShadowRoot?r:r instanceof Document?null==r?void 0:r.documentElement:r)}this.eGhostParent=n,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){vs(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():Gn.ICON_NOT_ALLOWED),e){case Gn.ICON_PINNED:i=this.ePinnedIcon;break;case Gn.ICON_MOVE:i=this.eMoveIcon;break;case Gn.ICON_LEFT:i=this.eLeftIcon;break;case Gn.ICON_RIGHT:i=this.eRightIcon;break;case Gn.ICON_GROUP:i=this.eGroupIcon;break;case Gn.ICON_AGGREGATE:i=this.eAggregateIcon;break;case Gn.ICON_PIVOT:i=this.ePivotIcon;break;case Gn.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case Gn.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}};Gn.ICON_PINNED="pinned",Gn.ICON_MOVE="move",Gn.ICON_LEFT="left",Gn.ICON_RIGHT="right",Gn.ICON_GROUP="group",Gn.ICON_AGGREGATE="aggregate",Gn.ICON_PIVOT="pivot",Gn.ICON_NOT_ALLOWED="notAllowed",Gn.ICON_HIDE="hide",Gn.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n            <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n            <div class="ag-dnd-ghost-label"></div>\n        </div>',g([he("dragService")],Gn.prototype,"dragService",2),g([he("mouseEventService")],Gn.prototype,"mouseEventService",2),g([he("columnApi")],Gn.prototype,"columnApi",2),g([he("gridApi")],Gn.prototype,"gridApi",2),g([ae],Gn.prototype,"init",1),g([le],Gn.prototype,"clearDragSourceParamsList",1),Gn=g([ce("dragAndDropService")],Gn);var Bn=class extends vr{constructor(e,t,i,s,r,n){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=r,this.suppressVisibilityChange=n,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild($s("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new Un(this,this.beans,this.rowNode,this.column):new Hn(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&U("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var e;const i=this.getDragItem(),s=(null==(e=i.rowNodes)?void 0:e.length)||1,r=this.getRowDragText(this.column);return r?r(i,s):1===s?this.cellValueFn():`${s} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};g([he("beans")],Bn.prototype,"beans",2),g([ae],Bn.prototype,"postConstruct",1),g([le],Bn.prototype,"removeDragSource",1);var Vn=class extends st{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=j(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},Hn=class extends Vn{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,lt.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}};g([ae],Hn.prototype,"postConstruct",1);var Un=class extends Vn{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,lt.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,lt.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,lt.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),i=this.gos.get("suppressRowDrag"),s=this.beans.dragAndDropService.hasExternalDropZones(),r=t&&!s||i;this.setDisplayedOrVisible(r)}};g([ae],Un.prototype,"postConstruct",1);var zn=class extends st{init(e,t,i,s,r,n,o){var a,l,c,h;this.params=o,this.eGui=t,this.eCheckbox=i,this.eExpanded=s,this.eContracted=r,this.comp=e,this.compClass=n;const{node:d,value:u,colDef:p}=o,g=this.isTopLevelFooter();if(!g){if(this.isEmbeddedRowMismatch())return;if(d.footer&&this.gos.get("groupHideOpenParents")&&(p&&p.showRowGroup)!==(d.rowGroupColumn&&d.rowGroupColumn.getColId()))return}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!g){const e=o.node.footer&&o.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)}),t="multipleColumns"!=this.gos.get("groupDisplayType")||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!o.node.footer&&(!o.node.group||null!=o.node.rowGroupIndex&&o.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)})),i=!d.group&&((null==(a=this.params.colDef)?void 0:a.field)||(null==(l=this.params.colDef)?void 0:l.valueGetter)),s=this.isExpandable(),r=this.columnModel.isPivotMode()&&d.leafGroup&&(null==(c=d.rowGroupColumn)?void 0:c.getColId())===(null==(h=o.column)?void 0:h.getColDef().showRowGroup);if(!(this.showingValueForOpenedParent||s||i||t||e||r))return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=null==(e=this.params.colDef)?void 0:e.cellAriaRole,s=null==(t=this.params.column)?void 0:t.getColDef().cellAriaRole;return i||s||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void ii(t);const i=()=>{ti(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,Ln.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow())return!1;if(null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e)return!0;if(!0===e.showRowGroup)return!0;const t=this.columnModel.getRowGroupColumns();return!t||0===t.length||t[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}C(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gos.get("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return void(this.showingValueForOpenedParent=!1)}const i=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:s,value:r}=t;let n=s;if(null==n){const t=this.displayedGroupNode.rowGroupColumn&&(null==(e=this.params.column)?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));n=""===this.displayedGroupNode.key&&this.displayedGroupNode.group&&t?this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):null!=r?r:null}this.comp.setInnerRenderer(i,n)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t&&!t.isRowGroupDisplayed(e.getId()))return this.params;const i=this.params,{value:s,node:r}=this.params,n=this.valueService.formatValue(e,r,s);return u(d({},i),{valueFormatted:n})}addFooterValue(){let e=this.params.totalValueGetter;if(!e){const t=this.params.footerValueGetter;t&&(e=t,U("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let t="";if(e){const i=k(this.params);i.value=this.params.value,"function"==typeof e?t=e(i):"string"==typeof e?t=this.expressionService.evaluate(e,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=e=>e&&e.componentClass==this.compClass;if(t&&!i(t))return t;const s=this.displayedGroupNode.rowGroupColumn,r=s?s.getColDef():void 0;if(!r)return;const n=this.userComponentFactory.getCellRendererDetails(r,e);return n&&!i(n)?n:i(n)&&r.cellRendererParams&&r.cellRendererParams.innerRenderer?this.userComponentFactory.getInnerRendererDetails(r.cellRendererParams,e):void 0}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,Ln.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,t=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(t)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=$s("groupExpanded",this.gos,null),s=$s("groupContracted",this.gos,null);i&&this.eExpanded.appendChild(i),s&&this.eContracted.appendChild(s);const r=t.eGridCell;(null==(e=this.params.column)?void 0:e.isCellEditable(t.node))&&this.gos.get("enableGroupEdit")||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(r,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(r,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,Ln.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Ln.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Ln.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Ln.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Ln.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(e){qe(e)||(Ye(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!e.isExpandable()||e.footer||t)return!1;const i=this.params.column;return null==i||"string"!=typeof i.getColDef().showRowGroup||this.isShowRowGroupForThisRow()}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:s}=e,r=this.isExpandable();if(r){const e=!!this.showingValueForOpenedParent||s.expanded;this.comp.setExpandedDisplayed(e),this.comp.setContractedDisplayed(!e)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const n=i.isPivotMode(),o=n&&t.leafGroup,a=r&&!o,l=s.footer&&-1===s.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),n?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",o):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,Ln.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,s=this.gos.get("treeData"),r=!i||s||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+r,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new Bn(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const e=new Nn;this.getContext().createBean(e),e.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(e.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(e))}this.comp.setCheckboxVisible(t)}onKeyDown(e){e.key!==qs.ENTER||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){qe(e)||Qe(this.eExpanded,e)||Qe(this.eContracted,e)||this.onExpandOrContract(e)}};g([he("expressionService")],zn.prototype,"expressionService",2),g([he("valueService")],zn.prototype,"valueService",2),g([he("columnModel")],zn.prototype,"columnModel",2),g([he("userComponentFactory")],zn.prototype,"userComponentFactory",2),g([he("ctrlsService")],zn.prototype,"ctrlsService",2);var Wn=class e extends vr{constructor(){super(e.TEMPLATE)}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setContractedDisplayed:e=>ns(this.eContracted,e),setExpandedDisplayed:e=>ns(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e)},i=this.createManagedBean(new zn),s=!e.colDef,r=this.getGui();i.init(t,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&Vt(r,i.getCellAriaRole())}setRenderDetails(e,t){if(e){const t=e.newAgStackInstance();if(!t)return;t.then(e=>{if(!e)return;const t=()=>this.context.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};Wn.TEMPLATE='<span class="ag-cell-wrapper">\n            <span class="ag-group-expanded" ref="eExpanded"></span>\n            <span class="ag-group-contracted" ref="eContracted"></span>\n            <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n            <span class="ag-group-value" ref="eValue"></span>\n            <span class="ag-group-child-count" ref="eChildCount"></span>\n        </span>',g([br("eExpanded")],Wn.prototype,"eExpanded",2),g([br("eContracted")],Wn.prototype,"eContracted",2),g([br("eCheckbox")],Wn.prototype,"eCheckbox",2),g([br("eValue")],Wn.prototype,"eValue",2),g([br("eChildCount")],Wn.prototype,"eChildCount",2);var jn=Wn,Kn=class e extends vr{constructor(){super(e.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=$s("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}};Kn.TEMPLATE='<div class="ag-loading">\n            <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n            <span class="ag-loading-text" ref="eLoadingText"></span>\n        </div>',g([br("eLoadingIcon")],Kn.prototype,"eLoadingIcon",2),g([br("eLoadingText")],Kn.prototype,"eLoadingText",2);var $n=Kn,Yn=class e extends vr{constructor(){super(e.TEMPLATE)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>Kt(e.eParentOfValue)),Kt(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");jt(this.getGui(),t)}setupLoading(){const e=this.gos.getDocument().createElement("div");e.classList.add("ag-skeleton-effect"),this.getGui().appendChild(e);const t=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");jt(this.getGui(),t)}refresh(e){return!1}destroy(){super.destroy()}};Yn.TEMPLATE='<div class="ag-skeleton-container"></div>';var qn=Yn,Xn=class e extends vr{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_LOADING_OVERLAY_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("loadingOoo","Loading...")})}}};Xn.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var Zn=Xn,Qn=class e extends vr{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_NO_ROWS_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")})}}};Qn.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var Jn=Qn,eo=class extends xn{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=vt(t,!0)}},to=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==qs.UP&&e.key!==qs.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!v(e)&&!v(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},io=class extends Tn{constructor(){super(new to)}},so=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return v(e)||v(this.params.value)?null!=e?e:null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return qi(e,!1)}},ro=class extends Tn{constructor(){super(new so)}},no=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return v(e)||v(this.params.value)?this.params.parseValue(null!=e?e:""):this.params.value}getStartValue(){var e,t;return qi(null!=(t=this.parseDate(null!=(e=this.params.value)?e:void 0))?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}},oo=class extends Tn{constructor(){super(new no(()=>this.dataTypeService))}};g([he("dataTypeService")],oo.prototype,"dataTypeService",2);var ao=class e extends vr{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),Yt(t,"polite"),this.addManagedListener(t,"click",e=>{if(Ye(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)}),this.addManagedListener(t,"dblclick",e=>{Ye(e)}),this.addManagedListener(this.params.eGridCell,"keydown",e=>{if(e.key===qs.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,s;let r,n=!0;if(e.node.group&&e.column){const i=e.column.getColId();i.startsWith(dt)?r=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[i]?r=null!=(t=e.value)?t:void 0:n=!1}else r=null!=(i=e.value)?i:void 0;if(!n)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(r);const o=null!=e.disabled?e.disabled:!(null==(s=e.column)?void 0:s.isCellEditable(e.node));this.eCheckbox.setDisabled(o);const a=this.localeService.getLocaleTextFunc(),l=fi(a,r),c=o?l:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${l})`;this.eCheckbox.setInputAriaLabel(c)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:s,value:r}=this.params,n={type:lt.EVENT_CELL_EDITING_STARTED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:r};this.eventService.dispatchEvent(n);const o=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:lt.EVENT_CELL_EDITING_STOPPED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:r,oldValue:r,newValue:e,valueChanged:o};this.eventService.dispatchEvent(a)}};ao.TEMPLATE='\n        <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n            <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n        </div>',g([br("eCheckbox")],ao.prototype,"eCheckbox",2);var lo=ao,co=class extends xn{constructor(){super('\n            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}init(e){var t;this.params=e;const i=null!=(t=e.value)?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,lt.EVENT_FIELD_VALUE_CHANGED,e=>this.setAriaLabel(e.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=fi(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}};g([br("eCheckbox")],co.prototype,"eCheckbox",2);var ho=class extends vr{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=null!=(t=this.params.cssClassPrefix)?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=ws(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild($s("check",this.gos)):this.params.icon&&(Ns(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=ws(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=ws(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=ws(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";ti(t,!1),e.appendChild($s(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},uo=class extends st{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Jr,agColumnHeader:bn,agColumnGroupHeader:wn,agSortIndicator:vn,agTextColumnFloatingFilter:gn,agNumberColumnFloatingFilter:pn,agDateColumnFloatingFilter:Qr,agReadOnlyFloatingFilter:wr,agAnimateShowChangeCellRenderer:Rn,agAnimateSlideCellRenderer:Pn,agGroupCellRenderer:jn,agGroupRowRenderer:jn,agLoadingCellRenderer:$n,agSkeletonCellRenderer:qn,agCheckboxCellRenderer:lo,agCellEditor:In,agTextCellEditor:In,agNumberCellEditor:io,agDateCellEditor:ro,agDateStringCellEditor:oo,agSelectCellEditor:An,agLargeTextCellEditor:Mn,agCheckboxCellEditor:co,agTextColumnFilter:cn,agNumberColumnFilter:on,agDateColumnFilter:Xr,agLoadingOverlay:Zn,agNoRowsOverlay:Jn,agTooltipComponent:eo,agMenuItem:ho},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}init(){const e=this.gos.get("components");null!=e&&P(e,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=s)return i(s,!0);const r=this.jsComps[t];if(r)return i(r,this.getFrameworkOverrides().isFrameworkComponent(r));const n=this.agGridDefaults[t];if(n)return i(n,!1);const o=this.enterpriseAgDefaultCompsModule[t];return o?re.__assertRegistered(o,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):H(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=Us(t,[...Object.keys(this.agGridDefaults).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(`         Did you mean: [${i.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};g([ae],uo.prototype,"init",1),uo=g([ce("userComponentRegistry")],uo);var po={propertyName:"dateComponent",cellRenderer:!1},go={propertyName:"headerComponent",cellRenderer:!1},mo={propertyName:"headerGroupComponent",cellRenderer:!1},fo={propertyName:"cellRenderer",cellRenderer:!0},yo={propertyName:"loadingCellRenderer",cellRenderer:!0},vo={propertyName:"cellEditor",cellRenderer:!1},Co={propertyName:"innerRenderer",cellRenderer:!0},bo={propertyName:"loadingOverlayComponent",cellRenderer:!1},So={propertyName:"noRowsOverlayComponent",cellRenderer:!1},wo={propertyName:"tooltipComponent",cellRenderer:!1},xo={propertyName:"filter",cellRenderer:!1},Eo={propertyName:"floatingFilterComponent",cellRenderer:!1},Mo={propertyName:"toolPanel",cellRenderer:!1},Ao={propertyName:"statusPanel",cellRenderer:!1},To={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Do={propertyName:"loadingCellRenderer",cellRenderer:!0},Io={propertyName:"groupRowRenderer",cellRenderer:!0},Ro={propertyName:"detailCellRenderer",cellRenderer:!0},Po={propertyName:"menuItem",cellRenderer:!1},ko=class{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}};ko.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var Lo=class extends st{getHeaderCompDetails(e,t){return this.getCompDetails(e,go,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,mo,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,To,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Do,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Io,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ro,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,Co,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,Co,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,fo,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,yo,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,vo,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,xo,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,po,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,bo,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,So,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,wo,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,fo,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,Eo,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Mo,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,Ao,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,Po,"agMenuItem",t,!0)}getCompDetails(e,t,i,s,r=!1){const{propertyName:n,cellRenderer:o}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:h,popupFromSelector:d,popupPositionFromSelector:u}=this.getCompKeys(e,t,s);const p=e=>{const t=this.userComponentRegistry.retrieve(n,e);t&&(l=t.componentFromFramework?void 0:t.component,c=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==l&&null==c&&null!=i&&p(i),l&&o&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(n,l)),!l&&!c)return void(r&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`));const g=this.mergeParamsWithApplicationProvidedParams(e,t,s,h),m=null==l,f=l||c;return{componentFromFramework:m,componentClass:f,params:g,type:t,popupFromSelector:d,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(f,m,g,t)}}getCompKeys(e,t,i){const{propertyName:s}=t;let r,n,o,a,l,c;if(e){const t=e,h=t[s+"Selector"],d=h?h(i):null,u=e=>{"string"==typeof e?r=e:null!=e&&!0!==e&&(this.getFrameworkOverrides().isFrameworkComponent(e)?o=e:n=e)};d?(u(d.component),a=d.params,l=d.popup,c=d.popupPosition):u(t[s])}return{compName:r,jsComp:n,fwComp:o,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:c}}newAgStackInstance(e,t,i,s){const r=s.propertyName;let n;if(t){const t=this.componentMetadataProvider.retrieve(r);n=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,s)}else n=new e;const o=this.initComponent(n,i);return null==o?hr.resolve(n):o.then(()=>n)}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const r=this.gos.getGridCommonParams();_(r,i);const n=e&&e[t.propertyName+"Params"];return"function"==typeof n?_(r,n(i)):"object"==typeof n&&_(r,n),_(r,s),r}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:s,jsComp:r,fwComp:n}=this.getCompKeys(e,xo);return s?i=ko.getFloatingFilterType(s):null==r&&null==n&&!0===e.filter&&(i=t()),i}};g([he("gridOptions")],Lo.prototype,"gridOptions",2),g([he("agComponentUtils")],Lo.prototype,"agComponentUtils",2),g([he("componentMetadataProvider")],Lo.prototype,"componentMetadataProvider",2),g([he("userComponentRegistry")],Lo.prototype,"userComponentRegistry",2),g([de("frameworkComponentWrapper")],Lo.prototype,"frameworkComponentWrapper",2),Lo=g([ce("userComponentFactory")],Lo);var No=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(No||{}),_o=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(_o||{}),Oo=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),r=this.scrollByTick;this.tickLeft=e.clientX<s.left+r,this.tickRight=e.clientX>s.right-r,this.tickUp=e.clientY<s.top+r&&!i,this.tickDown=e.clientY>s.bottom-r&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Fo=class extends st{constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new Oo({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?Gn.ICON_NOT_ALLOWED:Gn.ICON_MOVE}shouldPreventRowMove(){return!!this.columnModel.getRowGroupColumns().length||(!!this.filterManager.isAnyFilterPresent()||!!this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(lt.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent(lt.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),r=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(r[0],t):this.moveRows(r,t))}getRowIndexNumber(e){return parseInt(De(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,s=this.mouseEventService.getNormalisedPosition(e).y,r=e.dragItem.rowNodes;let n=i?1:0;if(this.isFromThisGrid(e))r.forEach(e=>{e.rowTop<s&&(n-=1)}),this.moveRows(r,s,n);else{const e=this.gos.getCallback("getRowId");let t=this.clientSideRowModel.getRowIndexAtPixel(s)+1;0===this.clientSideRowModel.getHighlightPosition(s)&&t--,this.clientSideRowModel.updateRowData({add:r.map(e=>e.data).filter(t=>!this.clientSideRowModel.getRowNode(e?e({data:t,level:0}):t.id)),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var s;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),null==(s=this.rangeService)||s.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void U("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_ENTER,t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_LEAVE,t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_MOVE,t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(d({isInterestedIn:e=>2===e,getIconName:()=>Gn.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),r=this.onDragging.bind(this),n=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_ENTER,t))}:i,onDragLeave:e.onDragLeave?t=>{s(t),e.onDragLeave(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_LEAVE,t))}:s,onDragging:e.onDragging?t=>{r(t),e.onDragging(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_MOVE,t))}:r,onDragStop:e.onDragStop?t=>{n(t),e.onDragStop(this.draggingToRowDragEvent(lt.EVENT_ROW_DRAG_END,t))}:n,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:r,onDragStop:n,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let s,r,n=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(n=this.rowModel.getRowIndexAtPixel(i),s=this.rowModel.getRow(n)),t.vDirection){case 1:r="down";break;case 0:r="up";break;default:r=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:s,y:i,vDirection:r})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(lt.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent(lt.EVENT_ROW_DRAG_END,e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(e=>{e.setDragging(!1)})}};g([he("dragAndDropService")],Fo.prototype,"dragAndDropService",2),g([he("rowModel")],Fo.prototype,"rowModel",2),g([he("paginationProxy")],Fo.prototype,"paginationProxy",2),g([he("columnModel")],Fo.prototype,"columnModel",2),g([he("focusService")],Fo.prototype,"focusService",2),g([he("sortController")],Fo.prototype,"sortController",2),g([he("filterManager")],Fo.prototype,"filterManager",2),g([he("selectionService")],Fo.prototype,"selectionService",2),g([he("mouseEventService")],Fo.prototype,"mouseEventService",2),g([he("ctrlsService")],Fo.prototype,"ctrlsService",2),g([de("rangeService")],Fo.prototype,"rangeService",2),g([ae],Fo.prototype,"postConstruct",1);var Go=class extends st{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(t=>t.dragSource===e);t&&(this.removeListener(t),Ne(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:r}=e;i.addEventListener("mousedown",t);let n=null;const o=this.gos.get("suppressTouch");s&&!o&&(n=t=>{rs(t.target)||(t.cancelable&&(t.preventDefault(),r&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=t=>this.onTouchUp(t,e.eElement),r=t.target,n=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:r,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:r,type:"touchend",listener:s,options:{passive:!0}},{target:r,type:"touchcancel",listener:s,options:{passive:!0}}];this.addTemporaryEvents(n),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=this.gos.getRootNode(),r=[{target:s,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:s,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:s,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(r),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(e=>{const{target:t,type:i,listener:s,options:r}=e;t.addEventListener(i,s,r)}),this.dragEndFunctions.push(()=>{e.forEach(e=>{const{target:t,type:i,listener:s,options:r}=e;t.removeEventListener(i,s,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return ir(e,t,v(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:lt.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;Ai()&&(null==(i=this.gos.getDocument().getSelection())||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=null==t?void 0:t.tagName.toLocaleLowerCase();return!!(null==i?void 0:i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:lt.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}};g([he("mouseEventService")],Go.prototype,"mouseEventService",2),g([le],Go.prototype,"removeAllListeners",1),Go=g([ce("dragService")],Go);var Bo="ag-list-item-hovered",Vo=class extends st{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?Gn.ICON_PINNED:Gn.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new Oo({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const s=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,ts(s,Bo),ts(s,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),n=Math.max(0,(e.y-i+r)/s),o=this.params.getNumRows(this.comp)-1,a=0|Math.min(o,n);return{rowIndex:a,position:Math.round(n)>n||n>o?"bottom":"top",component:this.virtualList.getComponentAt(a)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${Bo}`).forEach(e=>{[Bo,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(t=>{e.classList.remove(t)})}),this.lastHoveredListItem=null}};function Ho(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}g([he("dragAndDropService")],Vo.prototype,"dragAndDropService",2),g([ae],Vo.prototype,"postConstruct",1);var Uo=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){delete this.detailGridInfoMap[e]}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;P(this.detailGridInfoMap,(i,s)=>{v(s)&&(e(s,t),t++)})}getDataAsCsv(e){if(re.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){re.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return!(!re.__assertRegistered("@ag-grid-enterprise/excel-export","api."+e,this.context.getGridId())||1===this.excelCreator.getFactoryMode()&&(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),1))}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(re.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(re.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){re.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),s=`aria-${e}`;null===t?i.removeAttribute(s):i.setAttribute(s,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,s){U(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${null!=s?s:""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(e))}flashCells(e={}){const t=e=>U(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);v(e.fadeDelay)&&t("fade"),v(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(e))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(t))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return U("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i,s){this.expansionService.setRowNodeExpanded(e,t,i,s)}onGroupExpandedOrCollapsed(){C(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){C(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return re.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){re.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(e=>e.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==e.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1)))return;const{nodes:t,source:i,newValue:s}=e,r=t;this.selectionService.setNodesSelected({nodes:r,source:null!=i?i:"api",newValue:s})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return C(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){C(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!C(this.clientSideRowModel))return this.selectionService.getBestCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t),"ensureVisible")}forEachLeafNode(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return U("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(re.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return Ho(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(e))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return re.__assertRegistered("@ag-grid-enterprise/side-bar","api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance"))return Ho(this.sideBarService.getSideBarComp().getToolPanelInstance(e))}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(v(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:e,rowNode:t})}getCellValue(e){var t;const{colKey:i,rowNode:s,useFormatter:r}=e;let n=null!=(t=this.columnModel.getPrimaryColumn(i))?t:this.columnModel.getGridColumn(i);if(C(n))return null;const o=this.valueService.getValue(n,s);if(r){const e=this.valueService.formatValue(n,s,o);return null!=e?e:vt(o,!0)}return o}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){var e;const t=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const i={type:lt.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(i),this.destroyCalled=!0,null==(e=this.ctrlsService.get("gridCtrl"))||e.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},F(this,["isDestroyed"],t)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(re.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):re.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),re.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(re.__assertRegistered("@ag-grid-enterprise/charts","api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>t())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(e){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(e))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(e))}downloadChart(e){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(e))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(e))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(e.chartId))}createRangeChart(e){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(e))}createPivotChart(e){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(e))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(e))}updateChart(e){return this.assertChart("updateChart",()=>this.chartService.updateChart(e))}restoreChart(e,t){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(e,t))}assertClipboard(e,t){re.__assertRegistered("@ag-grid-enterprise/clipboard","api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(e))}cutToClipboard(e){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(e))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(e))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(e))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(e,t){U("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){U("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"}):console.error(`AG Grid: column '${e}' not found`)}showContextMenu(e){const{rowNode:t,column:i,value:s,x:r,y:n}=e||{};let{x:o,y:a}=this.menuService.getContextMenuPosition(t,i);null!=r&&(o=r),null!=n&&(a=n),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:o,clientY:a}),rowNode:t,column:i,value:s})}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showColumnMenu({column:t,positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(Ho)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(Ho)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn(`AG Grid: no column found for ${e.colKey}`);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const s=this.navigationService.getCellByPosition(i);s&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),s.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const s=null!=(t=e.startRow)?t:0,r=null!=(i=e.route)?i:[];s<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,s,r):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(e));this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(e,t)):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions()):this.logMissingRowModel("flushAsyncTransactions","clientSide")}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){"number"==typeof e?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,s="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,s)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e,t){this.gos.updateGridOptions({options:e,force:t,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){U(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){U("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){U("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){U("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){U("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){U("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){U("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};g([he("rowRenderer")],Uo.prototype,"rowRenderer",2),g([he("navigationService")],Uo.prototype,"navigationService",2),g([he("filterManager")],Uo.prototype,"filterManager",2),g([he("columnModel")],Uo.prototype,"columnModel",2),g([he("selectionService")],Uo.prototype,"selectionService",2),g([he("gridOptionsService")],Uo.prototype,"gos",2),g([he("valueService")],Uo.prototype,"valueService",2),g([he("alignedGridsService")],Uo.prototype,"alignedGridsService",2),g([he("eventService")],Uo.prototype,"eventService",2),g([he("pinnedRowModel")],Uo.prototype,"pinnedRowModel",2),g([he("context")],Uo.prototype,"context",2),g([he("rowModel")],Uo.prototype,"rowModel",2),g([he("sortController")],Uo.prototype,"sortController",2),g([he("paginationProxy")],Uo.prototype,"paginationProxy",2),g([he("focusService")],Uo.prototype,"focusService",2),g([he("dragAndDropService")],Uo.prototype,"dragAndDropService",2),g([he("menuService")],Uo.prototype,"menuService",2),g([he("valueCache")],Uo.prototype,"valueCache",2),g([he("animationFrameService")],Uo.prototype,"animationFrameService",2),g([he("ctrlsService")],Uo.prototype,"ctrlsService",2),g([he("overlayService")],Uo.prototype,"overlayService",2),g([he("stateService")],Uo.prototype,"stateService",2),g([he("expansionService")],Uo.prototype,"expansionService",2),g([he("apiEventService")],Uo.prototype,"apiEventService",2),g([he("frameworkOverrides")],Uo.prototype,"frameworkOverrides",2),g([he("undoRedoService")],Uo.prototype,"undoRedoService",2),g([he("rowNodeBlockLoader")],Uo.prototype,"rowNodeBlockLoader",2),g([de("csvCreator")],Uo.prototype,"csvCreator",2),g([de("excelCreator")],Uo.prototype,"excelCreator",2),g([de("rangeService")],Uo.prototype,"rangeService",2),g([de("clipboardService")],Uo.prototype,"clipboardService",2),g([de("aggFuncService")],Uo.prototype,"aggFuncService",2),g([de("statusBarService")],Uo.prototype,"statusBarService",2),g([de("chartService")],Uo.prototype,"chartService",2),g([de("ssrmTransactionManager")],Uo.prototype,"serverSideTransactionManager",2),g([de("sideBarService")],Uo.prototype,"sideBarService",2),g([ae],Uo.prototype,"init",1),Uo=g([ce("gridApi")],Uo);var zo=class extends st{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VISIBLE,()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return v(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:zo.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:zo.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:zo.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(i=>{const s=this.getQuickFilterTextForColumn(i,e);return v(s)&&s.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:r}=this;return r(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const r=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(r)}return v(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(i=>{const s=this.getQuickFilterTextForColumn(i,e);v(s)&&t.push(s)}),t.join(zo.QUICK_FILTER_SEPARATOR)}};zo.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",zo.QUICK_FILTER_SEPARATOR="\n",g([he("valueService")],zo.prototype,"valueService",2),g([he("columnModel")],zo.prototype,"columnModel",2),g([he("rowModel")],zo.prototype,"rowModel",2),g([ae],zo.prototype,"postConstruct",1),zo=g([ce("quickFilterService")],zo);var Wo=class extends st{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,lt.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,lt.EVENT_ROW_DATA_UPDATED,()=>this.onNewRowsLoaded("rowDataUpdated")),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",e=>this.setAdvancedFilterModel(e.currentValue)),this.addManagedListener(this.eventService,lt.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onAdvancedFilterEnabledChanged(e)),this.addManagedListener(this.eventService,lt.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,zo.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=d({},null!=(i=null==(t=null==(e=this.gos.get("initialState"))?void 0:e.filter)?void 0:t.filterModel)?i:{})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],s=this.getFilterModel();if(e){const t=or(Object.keys(e));this.allColumnFilters.forEach((s,r)=>{const n=e[r];i.push(this.setModelOnFilterWrapper(s.filterPromise,n)),t.delete(r)}),t.forEach(t=>{const s=this.columnModel.getPrimaryColumn(t)||this.columnModel.getGridColumn(t);if(!s)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+t);if(!s.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const r=this.getOrCreateFilterWrapper(s,"NO_UI");r?i.push(this.setModelOnFilterWrapper(r.filterPromise,e[t])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)})}else this.allColumnFilters.forEach(e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))});hr.all(i).then(()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach((t,r)=>{const n=s?s[r]:null,o=e?e[r]:null;ar.jsonEquals(n,o)||i.push(t.column)}),i.length>0&&this.onFilterChanged({columns:i,source:t})})}setModelOnFilterWrapper(e,t){return new hr(i=>{e.then(e=>{"function"!=typeof e.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||hr.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const s=this.getModelFromFilterWrapper(t);v(s)&&(e[i]=s)}),e}getModelFromFilterWrapper(e){var t;const i=e.filterPromise.resolveNow(null,e=>e);return null==i?null!=(t=this.initialFilterModel[e.column.getColId()])?t:null:"function"!=typeof i.getModel?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):i.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(null==(t=this.advancedFilterService)?void 0:t.isFilterPresent())&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!(null==(e=this.advancedFilterService)?void 0:e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gos.getGroupAggFiltering(),i=e=>{if(!e.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!e.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach(t=>{if(t.filterPromise.resolveNow(!1,e)){const e=t.filterPromise.resolveNow(null,e=>e);i(t.column)?this.activeAggregateFilters.push(e):this.activeColumnFilters.push(e)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const s=i.filterPromise.resolveNow(!1,e=>e.isFilterActive());i.column.setFilterActive(s,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:s,aggData:r}=e,n=i?this.activeAggregateFilters:this.activeColumnFilters,o=i?r:s;for(let i=0;i<n.length;i++){const s=n[i];if(null!=s&&s!==t){if("function"!=typeof s.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!s.doesFilterPass({node:e,data:o}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:s,columns:r}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",s),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(e=>{e.filterPromise&&e.filterPromise.then(e=>{e&&e!==i&&e.onAnyFilterChanged&&e.onAnyFilterChanged()})});const n={source:t,type:lt.EVENT_FILTER_CHANGED,columns:r||[]};s&&_(n,s),this.processingFilterChange=!0,this.eventService.dispatchEvent(n),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!(null!=(e=this.gos.get("allowShowChangeAfterFilter"))&&e)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach(e=>{e.filterPromise.then(e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getGridColumn(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}getFilterComponent(e,t,i=!0){var s;if(i)return(null==(s=this.getOrCreateFilterWrapper(e,t))?void 0:s.filterPromise)||null;const r=this.cachedFilter(e);return r?r.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,e=>e.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i||(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let s;const r=u(d({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(s,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(s,e)(t),doesRowPassOtherFilter:e=>this.doesRowPassOtherFilters(s,e)}),n=this.userComponentFactory.getFilterDetails(i,r,t);return n?{filterPromise:()=>{const e=n.newAgStackInstance();return e&&e.then(e=>s=e),e},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:k(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const s={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:r,compDetails:n}=this.createFilterInstance(e);return s.filterPromise=null!=(i=null==r?void 0:r())?i:null,s.compDetails=n,s}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),s&&s===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();null==e||e.forEach(e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled())return!1;if(!e.isFilterAllowed())return!1;const s=this.allColumnFilters.get(e.getColId());return null==(i=null==(t=null==s?void 0:s.filterPromise)?void 0:t.resolveNow(!0,e=>"function"!=typeof(null==e?void 0:e.isFilterAllowed)||(null==e?void 0:e.isFilterAllowed())))||i}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getFilterComponent(e,"NO_UI");null!=i&&i.then(e=>{t(Ho(e))})},s=e.getColDef(),r=u(d({},this.createFilterParams(e,s)),{filterChangedCallback:()=>i(t=>this.filterChangedCallbackFactory(t,e)())}),n=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,xo,r);let o=this.userComponentFactory.getDefaultFloatingFilterType(s,()=>this.getDefaultFloatingFilter(e));null==o&&(o="agReadOnlyFloatingFilter");const a={column:e,filterParams:n,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,a,o)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,e=>e&&e.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:lt.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(s)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:lt.EVENT_FILTER_MODIFIED,column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{var s;const r=null!=(s=null==i?void 0:i.source)?s:"api",n={filter:e,additionalEventAttributes:i,columns:[t],source:r};this.callOnFilterChangedOutsideRenderCycle(n)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s))return void this.destroyFilter(i,"paramsUpdated");const r=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then(e=>{!1===(!(null==e?void 0:e.refresh)||e.refresh(d(u(d({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>this.doesRowPassOtherFilters(e,t)}),r)))&&this.destroyFilter(i,"paramsUpdated")}):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,Se.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(i)))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(null==i?void 0:i.render)&&(null==s?void 0:s.render)&&i.render===s.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(null!=e?e:null),this.onFilterChanged({source:"advancedFilter"})))}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&this.columnModel.getAllGridColumns().some(e=>e.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,e=>{if(!t)return;const i=Ho(e);t(i)});return Ho(i)}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstance(e,e=>{t(e)})})}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const s=this.getFilterComponent(i,"NO_UI"),r=s&&s.resolveNow(null,e=>e);return r?setTimeout(t,0,r):s&&s.then(e=>{t(e)}),r}warnAdvancedFilters(){U("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;null==(t=this.advancedFilterService)||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let i=()=>{};const s=new Promise(e=>{i=e});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),s}const i=this.columnModel.getPrimaryColumn(e),s=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return s?(r=this.setModelOnFilterWrapper(s.filterPromise,t),new Promise(e=>{r.then(t=>e(t))})):Promise.resolve();var r}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&null!=(t=this.cachedFilter(i))?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};g([he("valueService")],Wo.prototype,"valueService",2),g([he("columnModel")],Wo.prototype,"columnModel",2),g([he("rowModel")],Wo.prototype,"rowModel",2),g([he("userComponentFactory")],Wo.prototype,"userComponentFactory",2),g([he("rowRenderer")],Wo.prototype,"rowRenderer",2),g([he("dataTypeService")],Wo.prototype,"dataTypeService",2),g([he("quickFilterService")],Wo.prototype,"quickFilterService",2),g([de("advancedFilterService")],Wo.prototype,"advancedFilterService",2),g([ae],Wo.prototype,"init",1),Wo=g([ce("filterManager")],Wo);var jo=class extends vr{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,lt.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var e,t;return null!=(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?t:null}afterInit(){var e,t,i;return null!=(i=null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?void 0:t.then(()=>{}))?i:hr.resolve()}afterGuiAttached(e){var t,i;null==(i=null==(t=this.filterWrapper)?void 0:t.filterPromise)||i.then(t=>{var i;null==(i=null==t?void 0:t.afterGuiAttached)||i.call(t,e)})}afterGuiDetached(){var e,t;null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)||t.then(e=>{var t;null==(t=null==e?void 0:e.afterGuiDetached)||t.call(e)})}createFilter(e){var t;const{column:i,source:s}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(i,s),(null==(t=this.filterWrapper)?void 0:t.filterPromise)&&this.filterWrapper.filterPromise.then(t=>{let r=t.getGui();if(v(r)||console.warn(`AG Grid: getGui method from filter returned ${r}, it should be a DOM element or an HTML template string.`),"string"==typeof r&&(r=ws(r)),this.appendChild(r),e){const e={type:lt.EVENT_FILTER_OPENED,column:i,source:s,eGui:this.getGui()};this.eventService.dispatchEvent(e)}})}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getPrimaryColumn(this.column)||(vs(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};g([he("filterManager")],jo.prototype,"filterManager",2),g([he("columnModel")],jo.prototype,"columnModel",2),g([ae],jo.prototype,"postConstruct",1);var Ko=class extends vr{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},$o=class e extends Ko{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>ns(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}};$o.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell">\n            <div ref="eFloatingFilterBody" role="presentation"></div>\n            <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n                <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n            </div>\n        </div>',g([br("eFloatingFilterBody")],$o.prototype,"eFloatingFilterBody",2),g([br("eButtonWrapper")],$o.prototype,"eButtonWrapper",2),g([br("eButtonShowMainFilter")],$o.prototype,"eButtonShowMainFilter",2),g([ae],$o.prototype,"postConstruct",1),g([le],$o.prototype,"destroyFloatingFilterComp",1);var Yo=$o,qo=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(qo||{}),Xo=class extends st{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=null!=(e=this.gos.get("domLayout"))?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(U(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}};g([ae],Xo.prototype,"postConstruct",1);var Zo=class extends st{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Z(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Z(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?Z(this.onVScroll.bind(this),100):this.onVScroll.bind(this),r=i?Z(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),t.onScrollCallback(r)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:s,stickyBottomCenter:r,centerHeader:n,bottomCenter:o,fakeHScrollComp:a}=this.ctrlsService.getParams();n.setHorizontalScroll(-t),o.setContainerTranslateX(t),i.setContainerTranslateX(t),s.setContainerTranslateX(t),r.setContainerTranslateX(t);const l=this.centerRowsCtrl.getViewportElement(),c=0===this.lastScrollSource[1];e=Math.abs(e),c?a.setScrollPosition(e):ys(l,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;s=0===e?fs(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:lt.EVENT_BODY_SCROLL,direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const e=u(d({},t),{type:lt.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(e)},100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!Pi())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=hs(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&ms()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&ms()?e>0?0:i:Math.min(Math.max(e,0),i)),ys(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){s=t;break}}else if(e===i||e===i.data){s=t;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);const s=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{s||this.paginationProxy.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),r=i.getStickyTopHeight(),n=i.getStickyBottomHeight(),o=this.paginationProxy.getRow(e);let a;do{const e=o.rowTop,i=o.rowHeight,s=this.paginationProxy.getPixelOffset(),l=o.rowTop-s,c=l+o.rowHeight,h=this.getVScrollPosition(),d=this.heightScaler.getDivStretchOffset(),u=h.top+d,p=h.bottom+d,g=p-u,m=this.heightScaler.getScrollPositionForPixel(l),f=this.heightScaler.getScrollPositionForPixel(c-g),y=Math.min((m+f)/2,l);let v=null;"top"===t?v=m:"bottom"===t?v=f:"middle"===t?v=y:u+r>l?v=m-r:p-n<c&&(v=f+n),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),a=e!==o.rowTop||i!==o.rowHeight}while(a);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i)return;if(i.isPinned())return;if(!this.columnModel.isColumnDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{null!==s&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),r=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),n=this.centerRowsCtrl.getCenterWidth(),o=this.enableRtl;let a=(o?i:s)||r,l=o?s:i;"auto"!==t&&(a="start"===t,l="end"===t);const c="middle"===t;if(a||l||c){const{colLeft:t,colMiddle:i,colRight:s}=this.getColumnBounds(e);return c?i-n/2:a?o?s:t:o?t-n:s-n}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:r}=this.getColumnBounds(e),n=this.enableRtl;return{columnBeforeStart:n?t>r:i<r,columnAfterEnd:n?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),s=e.getActualWidth(),r=e.getLeft(),n=t?-1:1,o=t?i-r:r;return{colLeft:o,colMiddle:o+s/2*n,colRight:o+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}};g([he("ctrlsService")],Zo.prototype,"ctrlsService",2),g([he("animationFrameService")],Zo.prototype,"animationFrameService",2),g([he("paginationProxy")],Zo.prototype,"paginationProxy",2),g([he("rowModel")],Zo.prototype,"rowModel",2),g([he("rowContainerHeightService")],Zo.prototype,"heightScaler",2),g([he("rowRenderer")],Zo.prototype,"rowRenderer",2),g([he("columnModel")],Zo.prototype,"columnModel",2),g([ae],Zo.prototype,"postConstruct",1);var Qo=(e=>(e.ANIMATION_ON="ag-row-animation",e.ANIMATION_OFF="ag-row-no-animation",e))(Qo||{}),Jo="ag-force-vertical-scroll",ea=class extends st{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,r,n,o){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=r,this.eStickyTop=n,this.eStickyBottom=o,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",e=>this.setCellTextSelection(e.currentValue)),this.createManagedBean(new Xo(this.comp)),this.bodyScrollFeature=this.createManagedBean(new Zo(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,r,n,o]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,lt.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(e=>{this.addManagedListener(e,"focusin",t=>{const{target:i}=t,s=ls(i,"ag-root",e);e.classList.toggle("ag-has-focus",!s)}),this.addManagedListener(e,"focusout",t=>{const{target:i,relatedTarget:s}=t,r=e.contains(s),n=ls(s,"ag-root",e);ls(i,"ag-root",e)||r&&!n||e.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(Bi()?16:0)}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(t))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===Li(i))return void this.rowRenderer.stopEditing();let s=t.some(e=>e.contains(i))&&this.mouseEventService.isElementInThisGrid(i);if(!s){const e=this.popupService;s=e.getActivePopups().some(e=>e.contains(i))||e.isElementWithinCustomPopup(i)}s||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(t=>this.addManagedListener(t,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?Jo:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&Ds(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(t,e)};e(),this.addManagedListener(this.eventService,lt.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",e=>this.onFullWidthContainerWheel(e,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Pi())return;const t=new fn(this.eBodyViewport);this.addManagedListener(t,fn.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Fo(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,s=ds(this.eGridBody)-i;s>0?this.columnModel.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}};g([he("animationFrameService")],ea.prototype,"animationFrameService",2),g([he("rowContainerHeightService")],ea.prototype,"rowContainerHeightService",2),g([he("ctrlsService")],ea.prototype,"ctrlsService",2),g([he("columnModel")],ea.prototype,"columnModel",2),g([he("scrollVisibleService")],ea.prototype,"scrollVisibleService",2),g([he("menuService")],ea.prototype,"menuService",2),g([he("headerNavigationService")],ea.prototype,"headerNavigationService",2),g([he("dragAndDropService")],ea.prototype,"dragAndDropService",2),g([he("pinnedRowModel")],ea.prototype,"pinnedRowModel",2),g([he("rowRenderer")],ea.prototype,"rowRenderer",2),g([he("popupService")],ea.prototype,"popupService",2),g([he("mouseEventService")],ea.prototype,"mouseEventService",2),g([he("rowModel")],ea.prototype,"rowModel",2),g([he("filterManager")],ea.prototype,"filterManager",2);var ta=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(ta||{}),ia=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(ia||{}),sa="ag-cell-range-selected",ra=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(sa,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),pi(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,r=!t&&e.bottom,n=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",r),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",n)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>Ve([1,0],e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,r=!1;const n=this.cellCtrl.getCellPosition().column,o=this.beans.columnModel;let a,l;e?(a=o.getDisplayedColAfter(n),l=o.getDisplayedColBefore(n)):(a=o.getDisplayedColBefore(n),l=o.getDisplayedColAfter(n));const c=this.rangeService.getCellRanges().filter(e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e));a||(r=!0),l||(i=!0);for(let e=0;e<c.length&&!(t&&i&&s&&r);e++){const n=c[e],o=this.rangeService.getRangeStartRow(n),h=this.rangeService.getRangeEndRow(n);!t&&this.beans.rowPositionUtils.sameRow(o,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(h,this.cellCtrl.getCellPosition())&&(s=!0),!r&&a&&n.columns.indexOf(a)<0&&(r=!0),!i&&l&&n.columns.indexOf(l)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:r}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=De(t),r=this.cellCtrl.getCellPosition(),n=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),o=e.get("enableRangeHandle");let a=1===i&&!this.cellCtrl.isEditing()&&(n||o);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(r,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),a=0===s.type}return a&&null!=s.endRow&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,r)}addSelectionHandle(){const e=this.beans.gos,t=De(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&C(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},na=class extends st{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,lt.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();Ie(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let r=0;i&&r<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),i&&!C(i))&&s===i.getPinned();r++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?De(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===this.column.getPinned()?t+this.beans.columnModel.getBodyContainerWidth()+(e||0):t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},oa=class extends st{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,e=>this.cellComp.addOrRemoveCssClass(e,!0),e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!0))}destroy(){super.destroy()}},aa=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};g([he("resizeObserverService")],aa.prototype,"resizeObserverService",2),g([he("paginationProxy")],aa.prototype,"paginationProxy",2),g([he("context")],aa.prototype,"context",2),g([he("gridOptionsService")],aa.prototype,"gos",2),g([he("environment")],aa.prototype,"environment",2),g([he("rowRenderer")],aa.prototype,"rowRenderer",2),g([he("valueService")],aa.prototype,"valueService",2),g([he("eventService")],aa.prototype,"eventService",2),g([he("columnModel")],aa.prototype,"columnModel",2),g([he("headerNavigationService")],aa.prototype,"headerNavigationService",2),g([he("navigationService")],aa.prototype,"navigationService",2),g([he("columnAnimationService")],aa.prototype,"columnAnimationService",2),g([he("focusService")],aa.prototype,"focusService",2),g([he("popupService")],aa.prototype,"popupService",2),g([he("stylingService")],aa.prototype,"stylingService",2),g([he("columnHoverService")],aa.prototype,"columnHoverService",2),g([he("userComponentFactory")],aa.prototype,"userComponentFactory",2),g([he("userComponentRegistry")],aa.prototype,"userComponentRegistry",2),g([he("animationFrameService")],aa.prototype,"animationFrameService",2),g([he("dragService")],aa.prototype,"dragService",2),g([he("dragAndDropService")],aa.prototype,"dragAndDropService",2),g([he("sortController")],aa.prototype,"sortController",2),g([he("filterManager")],aa.prototype,"filterManager",2),g([he("rowContainerHeightService")],aa.prototype,"rowContainerHeightService",2),g([he("frameworkOverrides")],aa.prototype,"frameworkOverrides",2),g([he("cellPositionUtils")],aa.prototype,"cellPositionUtils",2),g([he("rowPositionUtils")],aa.prototype,"rowPositionUtils",2),g([he("selectionService")],aa.prototype,"selectionService",2),g([he("rowCssClassCalculator")],aa.prototype,"rowCssClassCalculator",2),g([he("rowModel")],aa.prototype,"rowModel",2),g([he("ctrlsService")],aa.prototype,"ctrlsService",2),g([he("ctrlsFactory")],aa.prototype,"ctrlsFactory",2),g([he("agStackComponentsRegistry")],aa.prototype,"agStackComponentsRegistry",2),g([he("valueCache")],aa.prototype,"valueCache",2),g([he("rowNodeEventThrottle")],aa.prototype,"rowNodeEventThrottle",2),g([he("localeService")],aa.prototype,"localeService",2),g([he("syncService")],aa.prototype,"syncService",2),g([he("ariaAnnouncementService")],aa.prototype,"ariaAnnouncementService",2),g([de("rangeService")],aa.prototype,"rangeService",2),g([de("selectionHandleFactory")],aa.prototype,"selectionHandleFactory",2),g([ae],aa.prototype,"postConstruct",1),aa=g([ce("beans")],aa);var la=class extends aa{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!qe(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:s}=this.beans,r=e.ctrlKey||e.metaKey;i&&r&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const n=this.cellCtrl.createEvent(e,lt.EVENT_CELL_CLICKED);t.dispatchEvent(n);const o=this.column.getColDef();o.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{o.onCellClicked(n)})},0),!s.get("singleClickEdit")&&!o.singleClickEdit||s.get("suppressClickEdit")||e.shiftKey&&0!=(null==i?void 0:i.getCellRanges().length)||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Pi()||Xe("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,lt.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,r=e.target,{cellCtrl:n,beans:o}=this,{eventService:a,rangeService:l,focusService:c}=o;if(this.isRightClickInExistingRange(e))return;const h=l&&0!=l.getCellRanges().length;if(!s||!h){const e=Ai()&&!n.isEditing()&&!rs(r);n.focusCell(e)}if(s&&h&&!c.isCellFocused(n.getCellPosition())){e.preventDefault();const t=c.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:s}=t,r=o.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s}),n=null==r?void 0:r.getCellCtrl(e);(null==n?void 0:n.isEditing())&&n.stopEditing(),c.setFocusedCell({column:e,rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(r)){if(l){const e=this.cellCtrl.getCellPosition();if(s)l.extendLatestRangeToCell(e);else{const s=t||i;l.setRangeToCell(e,s)}}a.dispatchEvent(this.cellCtrl.createEvent(e,lt.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return ls(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,lt.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,lt.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){}},ca=class extends st{constructor(e,t,i,s,r){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=r}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case qs.ENTER:this.onEnterKeyDown(e);break;case qs.F2:this.onF2KeyDown(e);break;case qs.ESCAPE:this.onEscapeKeyDown(e);break;case qs.TAB:this.onTabKeyDown(e);break;case qs.BACKSPACE:case qs.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case qs.DOWN:case qs.UP:case qs.RIGHT:case qs.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){var i;const{cellCtrl:s,beans:r,rowNode:n}=this,{gos:o,rangeService:a,eventService:l}=r;if(!s.isEditing()){if(l.dispatchEvent({type:lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),er(e,o.get("enableCellEditingOnBackspace"))){if(a&&o.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){const e=s.getColumn(),t=null!=(i=this.beans.valueService.parseValue(e,n,"",n.getValueFromValueService(e)))?i:null;n.setDataValue(e,t,"cellClear")}}else s.startRowOrCellEdit(e,t);l.dispatchEvent({type:lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?qs.UP:qs.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(qs.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(qs.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===r&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},ha=class extends vr{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild($s("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);t?t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e})):(()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}})()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}};g([ae],ha.prototype,"postConstruct",1);var da=class{static getHeaderClassesFromColDef(e,t,i,s){return C(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}static getToolPanelClassesFromColDef(e,t,i,s){return C(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}static getColumnClassesFromCollDef(e,t,i,s,r){if(C(e))return[];let n;return n="function"==typeof e?e(this.getClassParams(t,i,s,r)):e,"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}},ua=0,pa=class e extends st{constructor(e,t,i,s){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.instanceId=e.getId()+"-"+ua++,this.colIdSanitised=vt(this.column.getId()),i.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new na(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellPositionFeature)||e.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new oa(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellCustomStyleFeature)||e.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new la(this,this.beans,this.column),this.addDestroyFunc(()=>{var e;null==(e=this.cellMouseListenerFeature)||e.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new ca(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var e;null==(e=this.cellKeyboardListenerFeature)||e.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new ra(this.beans,this),this.addDestroyFunc(()=>{var e;null==(e=this.cellRangeFeature)||e.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const s={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&v(t))return O(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new mr(s,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,s,r){var n,o,a,l;this.cellComp=e,this.eGui=t,this.printLayout=s,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),null==(n=this.cellPositionFeature)||n.setComp(t),null==(o=this.cellCustomStyleFeature)||o.setComp(e),null==(a=this.tooltipFeature)||a.refreshToolTip(),null==(l=this.cellKeyboardListenerFeature)||l.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(e=>e()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,s=r=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:n,paddingBottom:o,borderBottomWidth:a,borderTopWidth:l}=cs(t),c=n+o+a+l,h=e.offsetHeight+c;if(r<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout(()=>s(r+1),0)}const d=Math.max(h,i);this.rowNode.setRowAutoHeight(d,this.column)},r=()=>s(0);r();const n=this.beans.resizeObserverService.observeResize(e,r);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return null!=(e=this.column.getColDef().cellAriaRole)?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){var e;return null!=(e=this.valueFormatted)?e:this.value}showValue(e=!1){var t;const i=this.getValueToDisplay();let s;if(this.rowNode.stub){const e=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(s,i,e),null==(t=this.cellRangeFeature)||t.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned||"function"!=typeof e&&!0!==e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return t||i||s||r}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});const s=this.createCellEditorParams(e,t),r=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(r,s);this.editCompDetails=n;const o=null!=(null==n?void 0:n.popupFromSelector)?n.popupFromSelector:!!r.cellEditorPopup,a=null!=(null==n?void 0:n.popupPositionFromSelector)?n.popupPositionFromSelector:r.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,o,a,this.beans.gos.get("reactiveCustomComponents"));const l=this.createEvent(i,lt.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(l)}setEditing(e){var t;this.editing!==e&&(this.editing=e,null==(t=this.cellRangeFeature)||t.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return i?i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}:t}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),s=this.rowNode.getValueFromValueService(this.column);let r=!1;return i&&(r=this.saveNewValue(s,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(s,t,!e&&!!r),r}dispatchEditingStoppedEvent(e,t,i){const s=u(d({},this.createEvent(null,lt.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(s)}createCellEditorParams(e,t){return this.beans.gos.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:t,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)})}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,i,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{var i;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),null==(i=this.tooltipFeature)||i.refreshToolTip()}})}parseValue(e){return this.beans.valueService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){var t;this.refreshShouldDestroy()?null==(t=this.rowCtrl)||t.recreateCell(this):this.refreshCell(e)}refreshCell(e){var t,i,s,r;if(this.suppressRefreshCell||this.editing)return;const n=this.column.getColDef(),o=null!=e&&!!e.newData,a=null!=e&&!!e.suppressFlash||!!n.suppressCellFlash,l=null==n.field&&null==n.valueGetter&&null==n.showRowGroup,c=e&&e.forceRefresh||l||o,h=!!this.cellComp,d=this.updateAndFormatValue(h);if(h){if(c||d){this.showValue(o);const e=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!e&&(this.beans.gos.get("enableCellChangeFlash")||n.enableCellChangeFlash)&&this.flashCell(),null==(t=this.cellCustomStyleFeature)||t.applyUserStyles(),null==(i=this.cellCustomStyleFeature)||i.applyClassesFromColDef()}null==(s=this.tooltipFeature)||s.refreshToolTip(),null==(r=this.cellCustomStyleFeature)||r.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const t=e?qs.UP:qs.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.getCellPosition(),!1)}}flashCell(e){var t,i;const s=null!=(t=null==e?void 0:e.flashDuration)?t:null==e?void 0:e.flashDelay,r=null!=(i=null==e?void 0:e.fadeDuration)?i:null==e?void 0:e.fadeDelay;this.animateCell("data-changed",s,r)}animateCell(e,t,i){if(!this.cellComp)return;const s=`ag-cell-${e}`,r=`ag-cell-${e}-animation`,{gos:n}=this.beans;t||(t=n.get("cellFlashDuration")),v(i)||(i=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(s,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},i))},t)})}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var t;return null!=(t=this.callValueFormatter(e))?t:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.processCharacter(e)}onKeyDown(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.onKeyDown(e)}onMouseEvent(e,t){var i;null==(i=this.cellMouseListenerFeature)||i.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&(null==(e=this.cellPositionFeature)||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;da.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);ci(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return null==(e=this.cellPositionFeature)?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,t)})}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&(null==e?void 0:e.forceBrowserFocus)&&(this.focusEventToRestore=e));this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:y(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(this.cellComp)if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing){const e=this.getCellEditor();if(null==e?void 0:e.refresh){const{eventKey:t,cellStartedEdit:i}=this.editCompDetails.params,s=this.createCellEditorParams(t,i),r=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(r,s);e.refresh(n.params)}}else this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,lt.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(i)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new Nn;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new ha(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc(()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const s=this.beans.gos.get("pagination"),r=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(r){if(!n)return void U("managed row dragging is only allowed in the Client Side Row Model");if(s)return void U("managed row dragging is not possible when doing pagination")}const o=new Bn(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(o),o}};pa.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var ga=pa,ma=0,fa=class e extends st{constructor(e,t,i,s,r){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=s,this.printLayout=r,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+ma++,this.rowId=vt(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=vt(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),"left"===i?this.leftGui=s:"right"===i?this.rightGui=s:"fullWidth"===i?this.fullWidthGui=s:this.centerGui=s,this.initialiseRowComp(s),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),e){case"left":this.leftGui=void 0;break;case"right":this.rightGui=void 0;break;case"fullWidth":this.fullWidthGui=void 0;break;case"center":this.centerGui=void 0}}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(e=>e.element.style.display=t)}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(e=>s.addOrRemoveCssClass(e,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&ti(t.element,1==this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=vt(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(q(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(q(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void U("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new Bn(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),s=this.createBean(i,this.beans.context);this.rowDragComps.push(s)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!re.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>{var t;return null==(t=null==e?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()}):[null==(t=null==(e=this.fullWidthGui)?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),r=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(s);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":r?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){this.isFullWidth()||(e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0))}createCellCtrls(e,t,i=null){const s={list:[],map:{}},r=(e,t)=>{s.list.push(t),s.map[e]=t};return t.forEach(t=>{const i=t.getInstanceId();let s=e.map[i];s||(s=new ga(t,this.rowNode,this.beans,this)),r(i,s)}),e.list.forEach(e=>{null==s.map[e.getColumn().getInstanceId()]&&(this.isCellEligibleToBeRemoved(e,i)?e.destroy():r(e.getColumn().getInstanceId(),e))}),s}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)})}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list;default:throw new Error(`Unhandled case: ${e}`)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const t=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t);const i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const s=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,s,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const s=e.isEditing(),r=this.beans.focusService.isCellFocused(e.getCellPosition());if(s||r){const t=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(t)>=0)&&i}return i}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=v(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),s=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=s}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=s}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(e.element,t).params),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),r=e(this.rightGui,"right");return t&&i&&s&&r}addListeners(){this.addManagedListener(this.rowNode,Ln.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,Ln.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,Ln.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,Ln.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,Ln.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,lt.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,lt.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,lt.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,lt.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,lt.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,lt.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,lt.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,lt.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach(e=>{this.addRowDraggerToRow(e)}):(this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[])}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,Ln.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,Ln.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell())this.beans.rowRenderer.redrawRow(this.rowNode);else{if(this.isFullWidth())return void(this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode));this.getAllCellCtrls().forEach(t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)}),this.onRowSelected(),this.postProcessCss()}}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(t=>{const i=0===e,s=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),ti(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:y(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(t=>t.element.contains(e.target));if((t?t.element:null)!==e.target)return;const i=this.rowNode,s=this.beans.focusService.getFocusedCell(),r={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s&&s.column};this.beans.navigationService.navigateToNextCell(e,e.key,r,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||qe(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),i=t?t.element:null,s=i===e.target;let r=null;s||(r=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!r)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const t=null==(e=this.allRowGuis.find(e=>Ss(e.element)))?void 0:e.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var t;const i=this.rowNode,s=!!e&&this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned,r=this.fullWidthGui?this.fullWidthGui.element:null==(t=this.centerGui)?void 0:t.element;r&&(r.classList.toggle("ag-full-width-focus",s),s&&r.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach(e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(qe(e))return;const t=this.createRowEventWithSource(lt.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=ls(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(qe(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource(lt.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,s=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const r=this.gos.get("rowMultiSelectWithClick"),n=!this.gos.get("suppressRowDeselection"),o="rowClicked";if(this.rowNode.isSelected())r?this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):i?n&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!s,rangeSelect:s,event:e,source:o});else{const t=!r&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:s,event:e,source:o})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const i=this.gos.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,i,s)=>this.addFullWidthRowDragging(e,t,i,s),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new mr(i,this.beans))}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const r=new Bn(()=>i,this.rowNode,void 0,e,t,s);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let s=!1;for(const r of t){const t=r.stopEditing(e);i&&!e&&!s&&t&&(s=!0)}if(s){const e=this.createRowEvent(lt.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(lt.EVENT_ROW_EDITING_STARTED):this.createRowEvent(lt.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){this.editingRow||this.getAllCellCtrls().reduce((s,r)=>{const n=r===t;return n?r.startEditing(e,n,i):r.startEditing(null,n,i),!!s||r.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach(e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return"left"===e?"left":"right"===e?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;return t&&(i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})),i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),pi(e.element,t),!e.element.contains(this.beans.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,Ln.EVENT_MOUSE_ENTER,()=>{this.beans.dragService.isDragging()||this.gos.get("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,Ln.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),s)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),s=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,r=s?Math.min(i,s)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=`${t}px`,r&&e.element.style.setProperty("--ag-line-height",r)})}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky())if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const t=this.createRowEvent(lt.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach(e=>e.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.paginationProxy.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&v(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,s=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?s:this.beans.rowContainerHeightService.getRealPixelPosition(s)}return t+"px"}setRowTopStyle(e){this.allRowGuis.forEach(t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach(i=>{i.getColumn()==e&&(t=i)}),null!=t||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),s=this.rowNode.rowIndex%2==0,r=i+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",s),e.rowComp.addOrRemoveCssClass("ag-row-odd",!s),ai(e.element,r)})}};fa.DOM_DATA_KEY_ROW_CTRL="renderedRow";var ya=fa,va=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Xe("touchstart")?"touchstart":"mousedown"].forEach(e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedListener(this.element,e,t)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||qe(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Pi())return;const e=new fn(this.element);this.addManagedListener(e,fn.EVENT_LONG_TAP,e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,ya.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const r=i?i.getRowNode():null,n=s?s.getColumn():null;let o=null;if(n){const i=e||t;s.dispatchCellContextMenuEvent(null!=i?i:null),o=this.valueService.getValue(n,r)}const a=this.ctrlsService.getGridBodyCtrl(),l=s?s.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:r,column:n,value:o,anchorToElement:l})}getControlsForEventTarget(e){return{cellCtrl:Ze(this.gos,e,ga.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Ze(this.gos,e,ya.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),r=e.getColumn(),n=e.isEditing();if(Zs(this.gos,i,s,r,n)||"keydown"!==t||(!n&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Xs(i)&&e.processCharacter(i)),"keydown"===t){const t=e.createEvent(i,lt.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),r=this.focusService.getFocusedCell(),n=r&&r.column;if(!Zs(this.gos,i,s,n,!1)){const s=i.key;if("keydown"===t)switch(s){case qs.PAGE_HOME:case qs.PAGE_END:case qs.PAGE_UP:case qs.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case qs.UP:case qs.DOWN:e.onKeyboardNavigate(i);break;case qs.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent(lt.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=Js(e);return i===qs.A?this.onCtrlAndA(e):i===qs.C?this.onCtrlAndC(e):i===qs.D?this.onCtrlAndD(e):i===qs.V?this.onCtrlAndV(e):i===qs.X?this.onCtrlAndX(e):i===qs.Y?this.onCtrlAndY():i===qs.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[e,i]=[t.isEmpty("top"),t.isEmpty("bottom")],r=e?null:"top";let n,o;i?(n=null,o=this.paginationProxy.getRowCount()-1):(n="bottom",o=t.getPinnedBottomRowData().length-1);const a=this.columnModel.getAllDisplayedColumns();if(b(a))return;s.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:o,rowEndPinned:n,columnStart:a[0],columnEnd:De(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};g([he("mouseEventService")],va.prototype,"mouseEventService",2),g([he("valueService")],va.prototype,"valueService",2),g([he("menuService")],va.prototype,"menuService",2),g([he("ctrlsService")],va.prototype,"ctrlsService",2),g([he("navigationService")],va.prototype,"navigationService",2),g([he("focusService")],va.prototype,"focusService",2),g([he("undoRedoService")],va.prototype,"undoRedoService",2),g([he("columnModel")],va.prototype,"columnModel",2),g([he("paginationProxy")],va.prototype,"paginationProxy",2),g([he("pinnedRowModel")],va.prototype,"pinnedRowModel",2),g([de("rangeService")],va.prototype,"rangeService",2),g([de("clipboardService")],va.prototype,"clipboardService",2),g([ae],va.prototype,"postConstruct",1);var Ca=class extends st{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedListener(this.eventService,lt.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=ds(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");t.length&&(i&&(t=i({columns:t,viewportWidth:e})),this.columnModel.setColumnsPinned(t,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.columnModel.getDisplayedLeftColumns()],s=[...this.columnModel.getDisplayedRightColumns()];let r=0,n=0;const o=[];let a=t-0-e;for(;(n<i.length||r<s.length)&&a>0;){if(r<s.length){const e=s[r++];a-=e.getActualWidth(),o.push(e)}if(n<i.length&&a>0){const e=i[n++];a-=e.getActualWidth(),o.push(e)}}return o}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=hs(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:lt.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}};g([he("ctrlsService")],Ca.prototype,"ctrlsService",2),g([he("pinnedWidthService")],Ca.prototype,"pinnedWidthService",2),g([he("columnModel")],Ca.prototype,"columnModel",2),g([he("scrollVisibleService")],Ca.prototype,"scrollVisibleService",2),g([ae],Ca.prototype,"postConstruct",1);var ba=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;ns(this.element,t),Rs(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};g([he("pinnedWidthService")],ba.prototype,"pinnedWidthService",2),g([ae],ba.prototype,"postConstruct",1);var Sa=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;ns(this.element,t),Rs(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};g([he("pinnedWidthService")],Sa.prototype,"pinnedWidthService",2),g([ae],Sa.prototype,"postConstruct",1);var wa=class extends st{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}};g([he("rowContainerHeightService")],wa.prototype,"maxDivHeightScaler",2),g([ae],wa.prototype,"postConstruct",1);var xa=class extends st{constructor(e){super(),this.eContainer=e}postConstruct(){this.rangeService&&(this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature())}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};g([he("dragService")],xa.prototype,"dragService",2),g([de("rangeService")],xa.prototype,"rangeService",2),g([ae],xa.prototype,"postConstruct",1);var Ea=class extends st{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gos.isDomLayout("print"),i=e.getBodyContainerWidth(),s=e.getDisplayedColumnsLeftWidth(),r=e.getDisplayedColumnsRightWidth();let n;t?n=i+s+r:(n=i,this.addSpacer&&0===(this.gos.get("enableRtl")?s:r)&&this.scrollVisibleService.isVerticalScrollShowing()&&(n+=this.gos.getScrollbarWidth())),this.callback(n)}};g([he("columnModel")],Ea.prototype,"columnModel",2),g([he("scrollVisibleService")],Ea.prototype,"scrollVisibleService",2),g([ae],Ea.prototype,"postConstruct",1);var Ma=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e.TOP_LEFT="topLeft",e.TOP_RIGHT="topRight",e.TOP_CENTER="topCenter",e.TOP_FULL_WIDTH="topFullWidth",e.STICKY_TOP_LEFT="stickyTopLeft",e.STICKY_TOP_RIGHT="stickyTopRight",e.STICKY_TOP_CENTER="stickyTopCenter",e.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",e.STICKY_BOTTOM_LEFT="stickyBottomLeft",e.STICKY_BOTTOM_RIGHT="stickyBottomRight",e.STICKY_BOTTOM_CENTER="stickyBottomCenter",e.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",e.BOTTOM_LEFT="bottomLeft",e.BOTTOM_RIGHT="bottomRight",e.BOTTOM_CENTER="bottomCenter",e.BOTTOM_FULL_WIDTH="bottomFullWidth",e))(Ma||{}),Aa=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e))(Aa||{});function Ta(e){switch(e){case"center":case"topCenter":case"stickyTopCenter":case"bottomCenter":case"stickyBottomCenter":return"center";case"left":case"topLeft":case"stickyTopLeft":case"bottomLeft":case"stickyBottomLeft":return"left";case"right":case"topRight":case"stickyTopRight":case"bottomRight":case"stickyBottomRight":return"right";case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return"fullWidth";default:throw Error("Invalid Row Container Type")}}var Da=wt([["center","ag-center-cols-container"],["left","ag-pinned-left-cols-container"],["right","ag-pinned-right-cols-container"],["fullWidth","ag-full-width-container"],["topCenter","ag-floating-top-container"],["topLeft","ag-pinned-left-floating-top"],["topRight","ag-pinned-right-floating-top"],["topFullWidth","ag-floating-top-full-width-container"],["stickyTopCenter","ag-sticky-top-container"],["stickyTopLeft","ag-pinned-left-sticky-top"],["stickyTopRight","ag-pinned-right-sticky-top"],["stickyTopFullWidth","ag-sticky-top-full-width-container"],["stickyBottomCenter","ag-sticky-bottom-container"],["stickyBottomLeft","ag-pinned-left-sticky-bottom"],["stickyBottomRight","ag-pinned-right-sticky-bottom"],["stickyBottomFullWidth","ag-sticky-bottom-full-width-container"],["bottomCenter","ag-floating-bottom-container"],["bottomLeft","ag-pinned-left-floating-bottom"],["bottomRight","ag-pinned-right-floating-bottom"],["bottomFullWidth","ag-floating-bottom-full-width-container"]]),Ia=wt([["center","ag-center-cols-viewport"],["topCenter","ag-floating-top-viewport"],["stickyTopCenter","ag-sticky-top-viewport"],["bottomCenter","ag-floating-bottom-viewport"],["stickyBottomCenter","ag-sticky-bottom-viewport"]]),Ra=class e extends st{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer="topFullWidth"===this.name||"stickyTopFullWidth"===this.name||"stickyBottomFullWidth"===this.name||"bottomFullWidth"===this.name||"fullWidth"===this.name}static getRowContainerCssClasses(e){return{container:Da.get(e),viewport:Ia.get(e)}}static getPinned(e){switch(e){case"bottomLeft":case"topLeft":case"stickyTopLeft":case"stickyBottomLeft":case"left":return"left";case"bottomRight":case"topRight":case"stickyTopRight":case"stickyBottomRight":case"right":return"right";default:return null}}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>this.viewportSizeFeature=this.createManagedBean(new Ca(this)))}registerWithCtrlsService(){switch(this.name){case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return;default:this.ctrlsService.register(this.name,this)}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new va(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();this.forContainers(["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],()=>{this.pinnedWidthFeature=this.createManagedBean(new ba(this.eContainer)),this.addManagedListener(this.eventService,lt.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],()=>{this.pinnedWidthFeature=this.createManagedBean(new Sa(this.eContainer)),this.addManagedListener(this.eventService,lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["center","left","right","fullWidth"],()=>this.createManagedBean(new wa(this.eContainer,"center"===this.name?i:void 0))),this.forContainers(["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right","stickyTopCenter","stickyTopLeft","stickyTopRight","stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],()=>this.createManagedBean(new xa(this.eContainer))),this.forContainers(["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>this.createManagedBean(new Ea(e=>this.comp.setContainerWidth(`${e}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(["stickyTopCenter","stickyTopLeft","stickyTopRight","stickyTopFullWidth","stickyBottomCenter","stickyBottomLeft","stickyBottomRight","stickyBottomFullWidth"].indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{this.addManagedListener(this.eViewport,"scroll",()=>this.eViewport.scrollLeft=0)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return ds(this.eViewport)}getCenterViewportScrollLeft(){return fs(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return bs(this.eViewport)}getViewportScrollLeft(){return fs(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||Ts(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){ys(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!e.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.getRowCtrls();if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),s=this.gos.get("embedFullWidthRows")||i,r=t.filter(e=>{const t=e.isFullWidth();return this.isFullWithContainer?!s&&t:s||!t});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}getRowCtrls(){switch(this.name){case"topCenter":case"topLeft":case"topRight":case"topFullWidth":return this.rowRenderer.getTopRowCtrls();case"stickyTopCenter":case"stickyTopLeft":case"stickyTopRight":case"stickyTopFullWidth":return this.rowRenderer.getStickyTopRowCtrls();case"stickyBottomCenter":case"stickyBottomLeft":case"stickyBottomRight":case"stickyBottomFullWidth":return this.rowRenderer.getStickyBottomRowCtrls();case"bottomCenter":case"bottomLeft":case"bottomRight":case"bottomFullWidth":return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}};g([he("dragService")],Ra.prototype,"dragService",2),g([he("ctrlsService")],Ra.prototype,"ctrlsService",2),g([he("columnModel")],Ra.prototype,"columnModel",2),g([he("resizeObserverService")],Ra.prototype,"resizeObserverService",2),g([he("rowRenderer")],Ra.prototype,"rowRenderer",2),g([ae],Ra.prototype,"postConstruct",1);var Pa=Ra,ka=class extends vr{constructor(){super('<div class="ag-root ag-unselectable" role="treegrid">\n        <ag-header-root ref="gridHeader"></ag-header-root>\n        <div class="ag-floating-top" ref="eTop" role="presentation">\n            <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>\n            <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>\n            <ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>\n            <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-body" ref="eBody" role="presentation">\n            <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n                <ag-row-container ref="leftContainer" name="left"></ag-row-container>\n                <ag-row-container ref="centerContainer" name="center"></ag-row-container>\n                <ag-row-container ref="rightContainer" name="right"></ag-row-container>\n                <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>\n            </div>\n            <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n        </div>\n        <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n            <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>\n            <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>\n            <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>\n            <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">\n            <ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>\n            <ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>\n            <ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>\n            <ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n            <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>\n            <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>\n            <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>\n            <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>\n        </div>\n        <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n        <ag-overlay-wrapper></ag-overlay-wrapper>\n    </div>')}init(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>li(this.getGui(),e),setRowCount:e=>oi(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.toggle("ag-layout-print",t.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(Jo,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(i=>i.classList.toggle(e,t))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new ea),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&ni(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};g([he("resizeObserverService")],ka.prototype,"resizeObserverService",2),g([de("rangeService")],ka.prototype,"rangeService",2),g([br("eBodyViewport")],ka.prototype,"eBodyViewport",2),g([br("eStickyTop")],ka.prototype,"eStickyTop",2),g([br("eStickyBottom")],ka.prototype,"eStickyBottom",2),g([br("eTop")],ka.prototype,"eTop",2),g([br("eBottom")],ka.prototype,"eBottom",2),g([br("gridHeader")],ka.prototype,"headerRootComp",2),g([br("eBody")],ka.prototype,"eBody",2),g([ae],ka.prototype,"init",1);var La=class extends st{postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:lt.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};g([he("ctrlsService")],La.prototype,"ctrlsService",2),g([he("columnAnimationService")],La.prototype,"columnAnimationService",2),g([ae],La.prototype,"postConstruct",1),La=g([ce("scrollVisibleService")],La);var Na=class extends st{constructor(){super(...arguments),this.gridInstanceId=Na.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[Na.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Ze(this.gos,e.target,ga.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[Na.GRID_DOM_KEY];if(v(e))return e===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let s,r;if(null!=i.clientX||null!=i.clientY?(s=i.clientX,r=i.clientY):(s=i.x,r=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();s+=e.getScrollFeature().getHScrollPosition().left,r+=t.top}return{x:s,y:r}}};Na.gridInstanceSequence=new lr,Na.GRID_DOM_KEY="__ag_grid_instance",g([he("ctrlsService")],Na.prototype,"ctrlsService",2),Na=g([ce("mouseEventService")],Na);var _a=class extends st{constructor(){super(),this.onPageDown=Q(this.onPageDown,100),this.onPageUp=Q(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,r=e.ctrlKey||e.metaKey,n=!!this.rangeService&&e.shiftKey,o=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case qs.PAGE_HOME:case qs.PAGE_END:r||s||(this.onHomeOrEndKey(i),a=!0);break;case qs.LEFT:case qs.RIGHT:case qs.UP:case qs.DOWN:if(!o)return!1;!r||s||n||(this.onCtrlUpDownLeftRight(i,o),a=!0);break;case qs.PAGE_DOWN:case qs.PAGE_UP:r||s||(a=this.handlePageUpDown(i,o,t))}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===qs.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){var t;const{scrollIndex:i,scrollType:s,scrollColumn:r,focusIndex:n,focusColumn:o}=e;v(r)&&!r.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(r),v(i)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i,s),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(n),this.focusService.setFocusedCell({rowIndex:n,column:o,rowPinned:null,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell({rowIndex:n,rowPinned:null,column:o})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),s=this.paginationProxy.getPixelOffset(),r=t.top+i,n=this.paginationProxy.getRowIndexAtPixel(r+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),s=t.top,r=this.paginationProxy.getRowIndexAtPixel(s+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),r=this.paginationProxy.getPageFirstRow(),n=this.paginationProxy.getPageLastRow(),o=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(e.rowIndex),l=i?(null==a?void 0:a.rowHeight)-s-o:s-o,c=(null==a?void 0:a.rowTop)+l;let h,d=this.paginationProxy.getRowIndexAtPixel(c+o);if(d===e.rowIndex){const s=i?-1:1;t=d=e.rowIndex+s}i?(h="bottom",d<r&&(d=r),t<r&&(t=r)):(h="top",d>n&&(d=n),t>n&&(t=n)),this.isRowTallerThanView(d)&&(t=d,h="top"),this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:d,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const s=t?-1:1,r=this.getViewportHeight(),n=this.paginationProxy.getPageLastRow();let o=0,a=e.rowIndex;for(;a>=0&&a<=n;){const e=this.paginationProxy.getRow(a);if(e){const t=null!=(i=e.rowHeight)?i:0;if(o+t>r)break;o+=t}a+=s}return Math.max(0,Math.min(a,n))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let r=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(r-=s),r}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s,column:r}=i;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:r,focusIndex:s,focusColumn:r})}onHomeOrEndKey(e){const t=e===qs.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),s=t?i[0]:De(i),r=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:r,scrollType:null,scrollColumn:s,focusIndex:r,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(!1===s)if(i){const{rowIndex:i,rowPinned:s}=e.getRowPosition();(s?0===i:i===this.paginationProxy.getPageFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof ga&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else s&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s,r=e.isEditing();if(!r&&e instanceof ga){const t=e.getRowCtrl();t&&(r=t.isEditing())}return s=r?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===s?s:s||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const r=this.findNextCellToFocusOn(s,t,!0);return!1===r?null:null!=r&&(r.startEditing(null,!0,i),r.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),r=this.findNextCellToFocusOn(s,t,!0);if(!1===r)return null;if(null==r)return!1;const n=r.getCellPosition(),o=this.isCellEditable(s),a=this.isCellEditable(n),l=n&&s.rowIndex===n.rowIndex&&s.rowPinned===n.rowPinned;return o&&e.setFocusOutOnEditor(),l||(e.getRowCtrl().stopEditing(),r.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(r.setFocusInOnEditor(),r.focusCell()):r.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let s;s=e instanceof ya?u(d({},e.getRowPosition()),{column:t?i[0]:De(i)}):e.getCellPosition();const r=this.findNextCellToFocusOn(s,t,!1);if(!1===r)return null;if(r instanceof ga)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r.getRowPosition(),t);return v(r)}findNextCellToFocusOn(e,t,i){var s;let r=e;for(;;){e!==r&&(e=r),t||(r=this.getLastCellOfColSpan(r)),r=this.cellNavigationService.getNextTabbedCell(r,t);const n=this.gos.getCallback("tabToNextCell");if(v(n)){const s=n({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:r||null});if(!0===s||null===s)null===s&&U("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),r=e;else{if(!1===s)return!1;s.floating&&(U("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),s.rowPinned=s.floating),r={rowIndex:s.rowIndex,column:s.column,rowPinned:s.rowPinned}}}if(!r)return null;if(r.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+r.rowIndex,column:r.column},fromCell:!0}),null}const o="fullRow"===this.gos.get("editType");if(i&&!o&&!this.isCellEditable(r))continue;this.ensureCellVisible(r);const a=this.getCellByPosition(r);if(!a){const e=this.rowRenderer.getRowByPosition(r);if(!e||!e.isFullWidth()||i)continue;return e}if(!a.isSuppressNavigable())return null==(s=this.rangeService)||s.setRangeToCell(r),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let r=i,n=!1;for(;r&&(r===i||!this.isValidNavigateCell(r));)this.gos.get("enableRtl")?t===qs.LEFT&&(r=this.getLastCellOfColSpan(r)):t===qs.RIGHT&&(r=this.getLastCellOfColSpan(r)),r=this.cellNavigationService.getNextCellToFocus(t,r),n=C(r);if(n&&e&&e.key===qs.UP&&(r={rowIndex:-1,rowPinned:null,column:i.column}),s){const s=this.gos.getCallback("navigateToNextCell");if(v(s)){const n=s({key:t,previousCellPosition:i,nextCellPosition:r||null,event:e});v(n)?(n.floating&&(U("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),n.rowPinned=n.floating),r={rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}):r=null}}if(!r)return;if(r.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+r.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const o=this.getNormalisedPosition(r);o?this.focusPosition(o):this.tryToFocusFullWidthRow(r)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const r=this.focusService.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?De(i):i[0])};this.focusPosition(n);const o=null!=r&&this.rowPositionUtils.before(n,r),a={type:lt.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column,isFullWidthCell:!0,floating:n.rowPinned,fromBelow:o};return this.eventService.dispatchEvent(a),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:De(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(null==i?void 0:i.sticky))&&C(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};g([he("mouseEventService")],_a.prototype,"mouseEventService",2),g([he("paginationProxy")],_a.prototype,"paginationProxy",2),g([he("focusService")],_a.prototype,"focusService",2),g([he("columnModel")],_a.prototype,"columnModel",2),g([he("rowModel")],_a.prototype,"rowModel",2),g([he("ctrlsService")],_a.prototype,"ctrlsService",2),g([he("rowRenderer")],_a.prototype,"rowRenderer",2),g([he("headerNavigationService")],_a.prototype,"headerNavigationService",2),g([he("rowPositionUtils")],_a.prototype,"rowPositionUtils",2),g([he("cellNavigationService")],_a.prototype,"cellNavigationService",2),g([he("pinnedRowModel")],_a.prototype,"pinnedRowModel",2),g([de("rangeService")],_a.prototype,"rangeService",2),g([ae],_a.prototype,"postConstruct",1),_a=g([ce("navigationService")],_a);var Oa=class e extends xn{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),e.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedListener(e,"keydown",e=>{Zs(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)})}};Oa.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",g([ae],Oa.prototype,"postConstruct",1);var Fa=Oa,Ga=class extends vr{constructor(e,t,i,s,r){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const o=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const a=(e,t)=>{null!=t&&""!=t?o.setAttribute(e,t):o.removeAttribute(e)};Vt(o,t.getCellAriaRole()),a("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&a("tabindex",l.toString());const c={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>As(o,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(c,this.getGui(),this.eCellWrapper,i,r)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!i&&!s&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;if(s){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const r=!i&&null!=this.eCellWrapper;r&&(Cs(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,o=n&&null==this.eCellValue;if(o){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const a=!n&&null!=this.eCellValue;a&&(Cs(this.eCellValue),this.eCellValue=void 0);const l=s||r||o||a;return l&&this.removeControls(),e||t&&this.addControls(),l}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,r=e.newAgStackInstance();if(!r)return;const{params:n}=e;r.then(e=>this.afterCellEditorCreated(s,e,n,t,i)),C(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();vs(t);const i=null!=e?vt(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Cs(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Cs(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:s}=e,r=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),r=this.afterCellRendererCreated.bind(this,i,s);t&&t.then(r)};t&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(this.isAlive()&&e===this.rendererVersion){if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();vs(e),e.appendChild(this.cellRendererGui)}}else this.beans.context.destroyBean(i)}afterCellEditorCreated(e,t,i,s,r){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const n=s||void 0!==t.isPopup&&t.isPopup();n?this.addPopupCellEditor(i,r):this.addInCellEditor(),this.refreshEditStyles(!0,n),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null==(i=this.rowCtrl)||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){"fullRow"===this.beans.gos.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Fa(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const r=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),o=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",a=this.beans.gos.get("enableRtl"),l={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:o,alignSide:a?"right":"left",keepWithinBounds:!0},c=r.positionPopupByComponent.bind(r,l),h=this.beans.localeService.getLocaleTextFunc(),d=r.addPopup({modal:n,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});d&&(this.hideEditorPopup=d.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&ki()&&e.focus({preventScroll:!0}),vs(this.getParentOfValue())}},Ba=class extends vr{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const r=this.getGui(),n=r.style;this.domOrder=this.rowCtrl.getDomOrder(),Vt(r,"row");const o=this.rowCtrl.getTabIndex();null!=o&&r.setAttribute("tabindex",o.toString());const a={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>As(r,e),setTop:e=>n.top=e,setTransform:e=>n.transform=e,setRowIndex:e=>r.setAttribute("row-index",e),setRowId:e=>r.setAttribute("row-id",e),setRowBusinessKey:e=>r.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(a,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then(e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)})}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null});const i=N(t).filter(e=>null!=e);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())}),Es(this.getGui(),t)}newCellComp(e){const t=new Ga(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=N(this.cellComps).filter(e=>null!=e);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},Va=class extends vr{constructor(){super(function(){const e=vr.elementGettingCreated.getAttribute("name"),t=Pa.getRowContainerCssClasses(e);let i;return i="center"===e||"topCenter"===e||"stickyTopCenter"===e||"bottomCenter"===e||"stickyBottomCenter"===e?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n                <div class="${t.container}" ref="eContainer"></div>\n            </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=vr.elementGettingCreated.getAttribute("name"),this.type=Ta(this.name)}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e};this.createManagedBean(new Pa(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=d({},this.rowComps);this.rowComps={},this.lastPlacedElement=null,e.forEach(e=>{const i=e.getInstanceId(),s=t[i];if(s)this.rowComps[i]=s,delete t[i],this.ensureDomOrder(s.getGui());else{if(!e.getRowNode().displayed)return;const t=new Ba(e,this.beans,this.type);this.rowComps[i]=t,this.appendRow(t.getGui())}}),N(t).forEach(e=>{this.eContainer.removeChild(e.getGui()),e.destroy()}),Vt(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?Ms(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(xs(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};g([he("beans")],Va.prototype,"beans",2),g([br("eViewport")],Va.prototype,"eViewport",2),g([br("eContainer")],Va.prototype,"eContainer",2),g([ae],Va.prototype,"postConstruct",1),g([le],Va.prototype,"preDestroy",1);var Ha=class{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?Gn.ICON_PINNED:Gn.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};g([he("columnModel")],Ha.prototype,"columnModel",2),g([he("gridOptionsService")],Ha.prototype,"gos",2);var Ua=class{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:r,fakeEvent:n,pinned:o,gos:a,columnModel:l}=e,c=0===i,h=1===i;let{allMovingColumns:d}=e;if(t){let e=[];d.forEach(t=>{var i;let s=null,r=t.getParent();for(;null!=r&&1===r.getDisplayedLeafColumns().length;)s=r,r=r.getParent();null!=s?((null==(i=s.getColGroupDef())?void 0:i.marryChildren)?s.getProvidedColumnGroup().getLeafColumns():s.getLeafColumns()).forEach(t=>{e.includes(t)||e.push(t)}):e.includes(t)||e.push(t)}),d=e}const u=d.slice();l.sortColumnsLikeGridColumns(u);const p=this.calculateValidMoves({movingCols:u,draggingRight:h,xPosition:s,pinned:o,gos:a,columnModel:l}),g=this.calculateOldIndex(u,l);if(0===p.length)return;const m=p[0];let f=null!==g&&!r;if(t&&(f=null!==g),f&&!n){if(c&&m>=g)return;if(h&&m<=g)return}const y=l.getAllDisplayedColumns();let v=[],C=null;for(let e=0;e<p.length;e++){const t=p[e],i=l.getProposedColumnOrder(u,t);if(!l.doesOrderPassRules(i))continue;const s=i.filter(e=>y.includes(e));if(null===C)C=s;else if(!Ie(s,C))break;const r=this.groupFragCount(i);v.push({move:t,fragCount:r})}return 0!==v.length?(v.sort((e,t)=>e.fragCount-t.fragCount),this.moveColumns(d,v[0].move,"uiColumnMoved",!1,l)):void 0}static moveColumns(e,t,i,s,r){return r.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),s=Pe(e.map(e=>i.indexOf(e))),r=s[0];return De(s)-r!==s.length-1?null:r}static groupFragCount(e){function t(e){let t=[],i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let s=0;s<e.length-1;s++){let r=t(e[s]),n=t(e[s+1]);[r,n]=r.length>n.length?[r,n]:[n,r],r.forEach(e=>{-1===n.indexOf(e)&&i++})}return i}static getDisplayedColumns(e,t){switch(t){case"left":return e.getDisplayedLeftColumns();case"right":return e.getDisplayedRightColumns();default:return e.getDisplayedCenterColumns()}}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:r,gos:n,columnModel:o}=e;if(n.get("suppressMovableColumns")||t.some(e=>e.getColDef().suppressMovable))return[];const a=this.getDisplayedColumns(o,r),l=o.getAllGridColumns(),c=a.filter(e=>Ve(t,e)),h=a.filter(e=>!Ve(t,e)),d=l.filter(e=>!Ve(t,e));let u,p=0,g=s;if(i){let e=0;c.forEach(t=>e+=t.getActualWidth()),g-=e}if(g>0){for(let e=0;e<h.length&&(g-=h[e].getActualWidth(),!(g<0));e++)p++;i&&p++}if(p>0){const e=h[p-1];u=d.indexOf(e)+1}else u=d.indexOf(h[0]),-1===u&&(u=0);const m=[u],f=(e,t)=>e-t;if(i){let e=u+1;const t=l.length-1;for(;e<=t;)m.push(e),e++;m.sort(f)}else{let e=u;const t=l.length-1;let i=l[e];for(;e<=t&&a.indexOf(i)<0;)e++,m.push(e),i=l[e];e=u-1;const s=0;for(;e>=s;)m.push(e),e--;m.sort(f).reverse()}return m}static normaliseX(e,t,i,s,r){const n=r.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=n.getBoundingClientRect().left),s.get("enableRtl")&&(e=n.clientWidth-e),null==t&&(e+=r.get("center").getCenterViewportScrollLeft()),e}},za=class{constructor(e){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!v(e)}init(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){return this.pinned?Gn.ICON_PINNED:Gn.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,s=(t||[]).filter(e=>i[e.getId()]);this.setColumnsVisible(s,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter(e=>!e.getColDef().lockPinned);this.columnModel.setColumnsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){var r;if(s){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;Ua.moveColumns(e,t,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,C(e.hDirection))return;const n=Ua.normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(n);const o=this.normaliseDirection(e.hDirection),a=e.dragSource.type,l=(null==(r=e.dragSource.getDragItem().columns)?void 0:r.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],c=Ua.attemptMoveColumns({allMovingColumns:l,isFromHeader:1===a,hDirection:o,xPosition:n,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel});c&&(this.lastMovedInfo=c)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Gn.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Gn.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Gn.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter(e=>!e.getColDef().lockPinned);if(e.length>0&&(this.dragAndDropService.setGhostIcon(Gn.ICON_PINNED),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};g([he("columnModel")],za.prototype,"columnModel",2),g([he("dragAndDropService")],za.prototype,"dragAndDropService",2),g([he("gridOptionsService")],za.prototype,"gos",2),g([he("ctrlsService")],za.prototype,"ctrlsService",2),g([ae],za.prototype,"init",1);var Wa=class extends st{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new za(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Ha(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}};g([he("dragAndDropService")],Wa.prototype,"dragAndDropService",2),g([he("columnModel")],Wa.prototype,"columnModel",2),g([he("ctrlsService")],Wa.prototype,"ctrlsService",2),g([ae],Wa.prototype,"postConstruct",1),g([ae],Wa.prototype,"init",1);var ja=class e extends Ko{constructor(t){super(e.TEMPLATE,t),this.headerCompVersion=0,this.column=t.getColumnGroupChild(),this.pinned=t.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const s={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?di(e,t):ui(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const r=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",r)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}};ja.TEMPLATE='<div class="ag-header-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n            <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n        </div>',g([br("eResize")],ja.prototype,"eResize",2),g([br("eHeaderCompWrapper")],ja.prototype,"eHeaderCompWrapper",2),g([ae],ja.prototype,"postConstruct",1),g([le],ja.prototype,"destroyHeaderComp",1);var Ka=ja,$a=class e extends Ko{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>ns(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(s=t)?e.setAttribute(i,s):e.removeAttribute(i);var i,s},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}};$a.TEMPLATE='<div class="ag-header-group-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n        </div>',g([br("eResize")],$a.prototype,"eResize",2),g([ae],$a.prototype,"postConstruct",1);var Ya=$a,qa=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(qa||{}),Xa=class extends vr{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){ai(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(e=>{const t=e.getInstanceId();let s=i[t];delete i[t],null==s&&(s=this.createHeaderComp(e),this.getGui().appendChild(s.getGui())),this.headerComps[t]=s}),P(i,(e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)}),t){const e=N(this.headerComps);e.sort((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft());const t=e.map(e=>e.getGui());Es(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new Ya(e);break;case"filter":t=new Yo(e);break;default:t=new Ka(e)}return this.createBean(t),t.setParentComponent(this),t}};g([ae],Xa.prototype,"init",1),g([le],Xa.prototype,"destroyHeaderCtrls",1);var Za=0,Qa=class e extends st{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+Za++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return Qs(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){this.comp&&this.column&&(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:i}=this;da.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.columnModel.getAriaColumnIndex(t);ci(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&(this.addManagedListener(this.eGui,"keydown",this.onGuiKeyDown.bind(this)),this.addManagedListener(this.eGui,"keyup",this.onGuiKeyUp.bind(this)))}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){var t;const i=this.gos.getActiveDomElement(),s=e.key===qs.LEFT||e.key===qs.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),i!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||s)&&(e.preventDefault(),e.stopImmediatePropagation()),!s)return;const r=e.key===qs.LEFT!==this.gos.get("enableRtl"),n=On[r?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),null==(t=this.resizeFeature)||t.toggleColumnResizing(!0)}else this.moveHeader(n)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),s=ds(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>s){if(!(s>e+i))return 0;t=s-e-i}}return t}getResizeDiff(e){let t=e.key===qs.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),s=this.gos.get("enableRtl");return i&&s!==("right"===i)&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=setTimeout(()=>{var e;null==(e=this.resizeFeature)||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case qs.PAGE_DOWN:case qs.PAGE_UP:case qs.PAGE_HOME:case qs.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const s=null!=e?e:t;this.gos.get("preventDefaultOnContextMenu")&&s.preventDefault();const r=i instanceof Se?i:void 0;this.menuService.isHeaderContextMenuEnabled(r)&&this.menuService.showHeaderContextMenu(r,e,t),this.dispatchColumnMouseEvent(lt.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};Qa.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",g([he("pinnedWidthService")],Qa.prototype,"pinnedWidthService",2),g([he("focusService")],Qa.prototype,"focusService",2),g([he("userComponentFactory")],Qa.prototype,"userComponentFactory",2),g([he("ctrlsService")],Qa.prototype,"ctrlsService",2),g([he("dragAndDropService")],Qa.prototype,"dragAndDropService",2),g([he("menuService")],Qa.prototype,"menuService",2),g([ae],Qa.prototype,"postConstruct",1);var Ja=Qa,el=class extends st{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?De(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,Se.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=v(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),r=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=r,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===r&&this.setLeft(r)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===e.getPinned()?i+this.beans.columnModel.getBodyContainerWidth()+t:i+t}setLeft(e){let t;if(v(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof Se)t=this.columnOrGroup;else{const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&hi(this.ariaEl,e.length),t=e[0]}}};g([ae],el.prototype,"postConstruct",1);var tl=class extends st{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}};g([he("columnHoverService")],tl.prototype,"columnHoverService",2),g([ae],tl.prototype,"postConstruct",1);var il=class extends Ja{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,Se.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=$s("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new Tr(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();jt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case qs.UP:case qs.DOWN:t||e.preventDefault();case qs.LEFT:case qs.RIGHT:if(t)return;e.stopPropagation();case qs.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case qs.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&ls(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==qs.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const s=this.getRowIndex();this.beans.focusService.setFocusedHeader(s,this.column)}setupHover(){this.createManagedBean(new tl([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,lt.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new el(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===(null==t?void 0:t.source)&&this.context.isDestroyed())return;const i=this.comp.getFloatingFilterComp();i&&i.then(i=>{var s;if(i){const r=e.getCurrentFloatingFilterParentModel(this.column);i.onParentModelChanged(r,t?this.gos.addGridCommonParams({columns:null!=(s=t.columns)?s:[],type:lt.EVENT_FILTER_CHANGED,source:"api"===t.source?"api":"columnFilter"}):null)}})};this.destroySyncListener=this.addManagedListener(this.column,Se.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,Se.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const s=!i&&this.active;i&&!this.active&&(null==(e=this.destroySyncListener)||e.call(this),null==(t=this.destroyFilterChangedListener)||t.call(this));const r=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();n&&r?n.then(e=>{var t;!e||this.beans.filterManager.areFilterCompsDifferent(null!=(t=this.userCompDetails)?t:null,r)?this.updateCompDetails(r,s):this.updateFloatingFilterParams(r)}):this.updateCompDetails(r,s)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null==(t=this.comp.getFloatingFilterComp())||t.then(e=>{let t=!1;(null==e?void 0:e.refresh)&&"function"==typeof e.refresh&&null!==e.refresh(i)&&(t=!0),!t&&(null==e?void 0:e.onParamsUpdated)&&"function"==typeof e.onParamsUpdated&&null!==e.onParamsUpdated(i)&&U("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},sl=class extends st{constructor(e,t,i,s,r){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=r}postConstruct(){const e=[];let t,i;const s=()=>{if(ns(this.eResize,t),!t)return;const s=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(s),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const s=new fn(this.eResize);s.addEventListener(fn.EVENT_DOUBLE_TAP,i),e.push(()=>{this.eResize.removeEventListener("dblclick",i),s.removeEventListener(fn.EVENT_DOUBLE_TAP,i),s.destroy()})}},r=()=>{e.forEach(e=>e()),e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||n!==i)&&(t=e,i=n,r(),s())};n(),this.addDestroyFunc(r),this.ctrl.addRefreshFunction(n)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:r}=this,n=this.normaliseResizeAmount(t),o=[{key:i,newWidth:r+n}];this.column.getPinned()&&this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(n-s)>ds(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50||(this.lastResizeAmount=n,this.columnModel.setColumnWidths(o,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}};g([he("horizontalResizeService")],sl.prototype,"horizontalResizeService",2),g([he("pinnedWidthService")],sl.prototype,"pinnedWidthService",2),g([he("ctrlsService")],sl.prototype,"ctrlsService",2),g([he("columnModel")],sl.prototype,"columnModel",2),g([ae],sl.prototype,"postConstruct",1);var rl=class extends st{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new Hr),this.cbSelectAll.addCssClass("ag-header-select-all"),Vt(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,lt.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),Jt(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection")&&(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),1))}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t&&(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const r={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(r):this.selectionService.deselectAllRowNodes(r)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;return"function"==typeof e&&(e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))),!!e&&this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection")}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};g([he("rowModel")],rl.prototype,"rowModel",2),g([he("selectionService")],rl.prototype,"selectionService",2);var nl=class extends Ja{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new sl(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new tl([this.column],t)),this.createManagedBean(new el(this.column,t,this.beans)),this.createManagedBean(new Tr(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListener(this.column,Se.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,s;if(!this.column.isResizable())return;const r=this.column.getActualWidth(),n=null!=(i=this.column.getMinWidth())?i:0,o=null!=(s=this.column.getMaxWidth())?s:Number.MAX_SAFE_INTEGER,a=Math.min(Math.max(r+e,n),o);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:r}=this,n=this.getPinned(),o=t.getBoundingClientRect().left,a=i.getActualWidth(),l=0===e!==s.get("enableRtl"),c=Ua.normaliseX(l?o-20:o+a+20,n,!0,s,r);Ua.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:c,pinned:n,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel}),r.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new rl(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===qs.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===qs.ENTER&&this.onEnterKeyDown(e),e.key===qs.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof bn&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui,r=this.column.getColDef();t||!i||r.headerComponent||(t=()=>{const e=s.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>null!=e?e:this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},o=this.createManagedBean(new mr(n));this.refreshFunctions.push(()=>o.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const e=this.column.getColDef(),t=da.getHeaderClassesFromColDef(e,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach(e=>{i.has(e)?i.delete(e):this.comp.addOrRemoveCssClass(e,!0)}),i.forEach(e=>this.comp.addOrRemoveCssClass(e,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:r,gos:n}=this,{columnModel:o}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?Gn.ICON_HIDE:Gn.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{a=!n.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};r.addDragSource(l,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,Se.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,Se.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,Se.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,Se.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:r,isSpanningTotal:n}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",r>0);const{columnModel:o}=s,a=o.getColumnHeaderRowHeight();if(0===r)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${a}px`);i.addOrRemoveCssClass("ag-header-span-total",n);const l=r*(o.isPivotMode()?o.getPivotGroupHeaderHeight():o.getGroupHeaderHeight());e.style.setProperty("top",-l+"px"),e.style.setProperty("height",`${a+l}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=i=>{if(!this.isAlive())return;const{paddingTop:r,paddingBottom:n,borderBottomWidth:o,borderTopWidth:a}=cs(this.getGui()),l=r+n+o+a,c=e.offsetHeight+l;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==c)return void window.setTimeout(()=>s(i+1),0)}t.setColumnHeaderHeight(this.column,c)};let r,n=!1;const o=()=>{const e=this.column.isAutoHeaderHeight();e&&!n&&a(),!e&&n&&l()},a=()=>{n=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=i.observeResize(e,()=>s(0))},l=()=>{n=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};o(),this.addDestroyFunc(()=>l()),this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,()=>n&&s(0)),this.addManagedListener(this.eventService,Se.EVENT_SORT_CHANGED,()=>{n&&window.setTimeout(()=>s(0))}),this.addRefreshFunction(o)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Ht(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>this.ariaDescriptionProperties.get(e)).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,lt.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(lt.EVENT_COLUMN_HEADER_CLICKED,this.column)),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column))}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?lt.EVENT_COLUMN_HEADER_MOUSE_OVER:lt.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof bn?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},ol=class extends st{constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach(e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())}),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),r=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(r,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let r=null;if(e&&(r=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),r){const e=r.getDisplayedLeafColumns(),t=s.groupAfterColumns=e.filter(e=>e.isResizable()),i=s.groupAfterStartWidth=this.getInitialSizeOfColumns(t);s.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else s.groupAfterColumns=void 0,s.groupAfterStartWidth=void 0,s.groupAfterRatios=void 0;return s}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:r,groupAfterStartWidth:n,groupAfterRatios:o}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=r,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=o}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var s,r,n;if(!this.resizeCols||!this.resizeRatios)return;const o={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:null!=(s=this.resizeTakeFromCols)?s:void 0,groupAfterStartWidth:null!=(r=this.resizeTakeFromStartWidth)?r:void 0,groupAfterRatios:null!=(n=this.resizeTakeFromRatios)?n:void 0};this.resizeColumns(o,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:r,resizeStartWidth:n,resizeRatios:o,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,h=[];if(h.push({columns:r,ratios:o,width:t}),a){const e=t-n;h.push({columns:a,ratios:c,width:l-e})}this.columnModel.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}getInitialSizeOfColumns(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(e=>e.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}};g([he("horizontalResizeService")],ol.prototype,"horizontalResizeService",2),g([he("autoWidthCalculator")],ol.prototype,"autoWidthCalculator",2),g([he("columnModel")],ol.prototype,"columnModel",2),g([ae],ol.prototype,"postConstruct",1);var al=class extends st{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,at.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}};g([ae],al.prototype,"postConstruct",1);var ll=class extends Ja{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),r=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new tl(r,t)),this.createManagedBean(new el(this.column,t,this.beans)),this.createManagedBean(new al(e,this.column)),this.resizeFeature=this.createManagedBean(new ol(e,i,s,this.column)),this.createManagedBean(new Tr(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(lt.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:r,ctrlsService:n}=this,o=r.get("enableRtl"),a=0===e,l=this.getPinned(),c=i.getBoundingClientRect(),h=c.left,d=c.width,u=Ua.normaliseX(a!==o?h-20:h+d+20,l,!0,r,n),p=s.getGroupId(),g=this.focusService.getFocusedHeader();Ua.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:u,pinned:l,fromEnter:!1,fakeEvent:!1,gos:r,columnModel:t.columnModel});const m=s.getDisplayedLeafColumns(),f=a?m[0]:De(m);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(f,"auto"),!this.isAlive()&&g&&this.restoreFocus(p,s,g)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const r=s[0].getParent();if(!r)return;const n=this.findGroupWidthId(r,e);n&&this.focusService.focusHeaderPosition({headerPosition:u(d({},i),{column:n})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(lt.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup())),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup()))}handleMouseOverChange(e){const t={type:e?lt.EVENT_COLUMN_HEADER_MOUSE_OVER:lt.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s="whenTruncated"===this.gos.get("tooltipShowMode"),r=this.eGui;t||!s||(null==i?void 0:i.headerGroupComponent)||(t=()=>{const e=r.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getGui:()=>r,getLocation:()=>"headerGroup",getTooltipValue:()=>null!=e?e:i&&i.headerTooltip,shouldDisplayTooltip:t};i&&(n.getColDef=()=>i),this.createBean(new mr(n))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,xe.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,xe.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=da.getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(e=>this.comp.addOrRemoveCssClass(e,!0))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach(e=>{this.addManagedListener(e,Se.EVENT_MOVING_CHANGED,t)}),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===qs.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:s,gos:r,dragAndDropService:n}=this,{columnModel:o}=t,a=i.getProvidedColumnGroup().getLeafColumns();let l=!r.get("suppressDragLeaveHidesColumns");const c=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?Gn.ICON_HIDE:Gn.ICON_NOT_ALLOWED,dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),a.forEach(e=>e.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>a.forEach(e=>e.setMoving(!1,"uiColumnDragged")),onGridEnter:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};n.addDragSource(c,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(e=>i[e.getId()]=e.isVisible());const s=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(e=>{t.indexOf(e)>=0&&(s.push(e),Ne(t,e))}),t.forEach(e=>s.push(e)),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}},cl=0,hl=class extends st{constructor(e,t,i){super(),this.instanceId=cl++,this.rowIndex=e,this.pinned=t,this.type=i;const s="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,lt.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return T(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let r=0;t.hasFloatingFilters()&&(i++,r=1);const n=e.getColumnGroupHeaderRowHeight(),o=e.getColumnHeaderRowHeight(),a=i-(1+r);for(let e=0;e<a;e++)s.push(n);s.push(o);for(let t=0;t<r;t++)s.push(e.getFloatingFiltersHeight());let l=0;for(let e=0;e<this.rowIndex;e++)l+=s[e];return{topOffset:l,rowHeight:s[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,columnModel:i}=this.beans;return!!t.isHeaderWrapperFocused(e)&&i.isDisplayed(e.getColumnGroupChild())};if(e)for(const[t,s]of e)i(s)?this.headerCellCtrls.set(t,s):this.destroyBean(s);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case"filter":s=this.createBean(new il(e,this.beans,this));break;case"group":s=this.createBean(new ll(e,this.beans,this));break;default:s=this.createBean(new nl(e,this.beans,this))}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach(s=>{const r=i.getVirtualHeaderGroupRow(s,t);e=e.concat(r)}),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const i=Array.from(this.headerCellCtrls.values()).find(t=>t.getColumnGroupChild()==e);return!!i&&i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}};g([he("beans")],hl.prototype,"beans",2),g([ae],hl.prototype,"postConstruct",1);var dl=class extends st{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,lt.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new Wa(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new lr,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new hl(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),s=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(s||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),s&&(this.columnsRowCtrl=this.createBean(new hl(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const s=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==s;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new hl(s,this.pinned,"filter")))})();const s=this.getAllCtrls();this.comp.setCtrls(s),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null!=e&&e.column.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Ea(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const s=0==i,r=this.hidden!==s,n=this.gos.get("enableRtl"),o=this.gos.getScrollbarWidth(),a=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?i+o:i;this.comp.setPinnedContainerWidth(`${a}px`),this.comp.setDisplayed(!s),r&&(this.hidden=s,this.refresh())};this.addManagedListener(this.eventService,lt.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,lt.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,lt.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof Se){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const s=this.getAllCtrls()[e];return!!s&&s.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};g([he("ctrlsService")],dl.prototype,"ctrlsService",2),g([he("scrollVisibleService")],dl.prototype,"scrollVisibleService",2),g([he("pinnedWidthService")],dl.prototype,"pinnedWidthService",2),g([he("columnModel")],dl.prototype,"columnModel",2),g([he("focusService")],dl.prototype,"focusService",2),g([he("filterManager")],dl.prototype,"filterManager",2);var ul=class e extends vr{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new dl(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const t="left"==this.pinned,i="right"==this.pinned,s=t?e.PINNED_LEFT_TEMPLATE:i?e.PINNED_RIGHT_TEMPLATE:e.CENTER_TEMPLATE;this.setTemplate(s),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let i;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&xs(this.eRowContainer,t,i),i=t};e.forEach(e=>{const i=e.getInstanceId(),r=t[i];delete t[i];const n=r||this.createBean(new Xa(e));this.headerRowComps[i]=n,this.rowCompsList.push(n),s(n)}),N(t).forEach(e=>this.destroyRowComp(e))}};ul.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',ul.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',ul.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n            <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n        </div>',g([br("eCenterContainer")],ul.prototype,"eCenterContainer",2),g([ae],ul.prototype,"init",1),g([le],ul.prototype,"destroyRowComps",1);var pl=ul,gl=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(gl||{}),ml=class extends st{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl});const e=this.gos.getDocument();this.addManagedListener(e,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s,column:r}=t,n=this.getHeaderRowCount(),o=0===e;let{headerRowIndex:a,column:l,headerRowIndexWithoutSpan:c}=o?this.headerPositionUtils.getColumnVisibleParent(r,s):this.headerPositionUtils.getColumnVisibleChild(r,s),h=!1;return a<0&&(a=0,l=r,h=!0),a>=n?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==c&&(this.currentHeaderRowWithoutSpan=c),!(!h&&!l)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),r=2===e,n=this.gos.get("enableRtl");let o,a;if(-1!==this.currentHeaderRowWithoutSpan?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,r!==n?(a="Before",o=this.headerPositionUtils.findHeader(s,a)):(a="After",o=this.headerPositionUtils.findHeader(s,a)),o||!t)return this.focusService.focusHeaderPosition({headerPosition:o,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:o,direction:a})}return this.focusNextHeaderRow(s,a,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let r,n=null;if("Before"===t?s>0&&(r=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!n)return!1;const{column:o,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,null==n?void 0:n.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof at){const s=e.getDisplayedLeafColumns();i="Before"===t?De(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};g([he("focusService")],ml.prototype,"focusService",2),g([he("headerPositionUtils")],ml.prototype,"headerPositionUtils",2),g([he("ctrlsService")],ml.prototype,"ctrlsService",2),g([ae],ml.prototype,"postConstruct",1),ml=g([ce("headerNavigationService")],ml);var fl=class extends st{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new Tr(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",s),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,s=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(s++,i=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),o=s-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=o*r,t+=n,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:lt.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(e=>e.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case qs.LEFT:t=2;case qs.RIGHT:v(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case qs.UP:t=0;case qs.DOWN:v(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=null!=e?e:t;s!==this.eGui&&s!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Pi())return;const t=new fn(this.eGui);this.addManagedListener(t,fn.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}};g([he("headerNavigationService")],fl.prototype,"headerNavigationService",2),g([he("focusService")],fl.prototype,"focusService",2),g([he("columnModel")],fl.prototype,"columnModel",2),g([he("ctrlsService")],fl.prototype,"ctrlsService",2),g([he("filterManager")],fl.prototype,"filterManager",2),g([he("menuService")],fl.prototype,"menuService",2);var yl=class e extends vr{constructor(){super(e.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new fl).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new pl("left")),t(new pl(null)),t(new pl("right"))}};yl.TEMPLATE='<div class="ag-header" role="presentation"/>',g([ae],yl.prototype,"postConstruct",1);var vl=yl,Cl=class extends st{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};g([he("dragService")],Cl.prototype,"dragService",2),g([he("ctrlsService")],Cl.prototype,"ctrlsService",2),Cl=g([ce("horizontalResizeService")],Cl);var bl=class extends st{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,r="left";const n=this.menuService.isLegacyMenuEnabled();!n&&this.gos.get("enableRtl")&&(s=1,r="right");let o=n?void 0:4*s,a=n?void 0:4;this.showPopup(e,s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,nudgeX:o,nudgeY:a,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},i,t,n)}showPopup(e,t,i,s,r){const n=e?this.createBean(new jo(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!(null==n?void 0:n.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const o=document.createElement("div");let a;Vt(o,"presentation"),o.classList.add("ag-menu"),r||o.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(o,"keydown",e=>this.trapFocusWithin(e,o)),o.appendChild(null==n?void 0:n.getGui());const l=this.menuService.isColumnMenuAnchoringEnabled()?null!=s?s:this.ctrlsService.getGridBodyCtrl().getGui():void 0,c=this.localeService.getLocaleTextFunc(),h=r&&"columnFilter"!==i?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),d=this.popupService.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const r=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),r&&s&&Ss(s)){const e=this.focusService.findTabbableParent(s);e&&e.focus()}null==n||n.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(o),anchorToElement:l,ariaLabel:h});d&&(this.hidePopup=a=d.hideFunc),n.afterInit().then(()=>{t(o),n.afterGuiAttached({container:i,hidePopup:a})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==qs.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:lt.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:null!=i?i:null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){var t;return e.isFilterAllowed()&&(null!=(t=e.getColDef().menuTabs)?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};g([he("filterManager")],bl.prototype,"filterManager",2),g([he("popupService")],bl.prototype,"popupService",2),g([he("focusService")],bl.prototype,"focusService",2),g([he("ctrlsService")],bl.prototype,"ctrlsService",2),g([he("menuService")],bl.prototype,"menuService",2),bl=g([ce("filterMenuFactory")],bl);var Sl=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(Sl||{}),wl=class extends st{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:r,forceFocusOutWhenTabGuardsAreEmpty:n,focusInnerElement:o,onFocusIn:a,onFocusOut:l,shouldStopEventPropagation:c,onTabKeyDown:h,handleKeyDown:d,eFocusableElement:u}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=o,this.eFocusableElement=u,this.focusTrapActive=!!r,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.providedFocusIn=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=c,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=d}postConstruct(){this.createManagedBean(new Tr(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===s)return;let r,n;e?(r=0,n=s):(r=s+1,n=i.length);const o=i.slice(r,n),a=this.gos.get("tabIndex");o.sort((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return s===a?1:i===a?-1:0===i?1:0===s?-1:i-s}),o[e?o.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}};g([he("focusService")],wl.prototype,"focusService",2),g([ae],wl.prototype,"postConstruct",1);var xl=class extends vr{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:e=>{t.forEach(t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new wl({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),Vt(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];vs(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){Ns(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},El=class e extends xl{constructor(t){super(e.getTemplate(t.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=t}postConstruct(){this.setupHeader(),this.params.items&&this.params.items.forEach(e=>this.addItem(e)),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>{var e,t,i;return null==(i=null==(t=null==(e=this.activeItem)?void 0:e.tabbedItem)?void 0:t.afterDetachedCallback)?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">\n            <div ref="eHeader"></div>\n            <div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>\n        </div>`}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,i=(e,i)=>{e.classList.add(`ag-tabs-${i}`),t&&e.classList.add(`${t}-${i}`)};e?(this.setupCloseButton(i),this.eTabHeader=this.gos.getDocument().createElement("div"),i(this.eHeader,"header-wrapper"),Vt(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Vt(this.eTabHeader,"tablist"),i(this.eTabHeader,"header")}setupCloseButton(e){const t=this.gos.getDocument(),i=t.createElement("button");e(i,"close-button");const s=$s("close",this.gos,void 0,!0);jt(i,this.params.closeButtonAriaLabel),i.appendChild(s),this.addManagedListener(i,"click",()=>{var e,t;return null==(t=(e=this.params).onCloseClicked)?void 0:t.call(e)});const r=t.createElement("div");e(r,"close-button-wrapper"),Vt(r,"presentation"),r.appendChild(i),this.eHeader.appendChild(r),this.eCloseButton=i}handleKeyDown(e){switch(e.key){case qs.RIGHT:case qs.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const t=e.key===qs.RIGHT,i=this.gos.get("enableRtl"),s=this.items.indexOf(this.activeItem),r=t!==i?Math.min(s+1,this.items.length-1):Math.max(s-1,0);if(s===r)return;e.preventDefault();const n=this.items[r];this.showItemWrapper(n),n.eHeaderButton.focus();break;case qs.UP:case qs.DOWN:e.stopPropagation()}}onTabKeyDown(e){var t,i,s,r;if(e.defaultPrevented)return;const{focusService:n,eHeader:o,eBody:a,activeItem:l,params:c}=this,{suppressTrapFocus:h,enableCloseButton:d}=c,u=this.gos.getActiveDomElement(),p=e.target,g=e.shiftKey;if(o.contains(u))return e.preventDefault(),void(d&&g&&!(null==(t=this.eCloseButton)?void 0:t.contains(u))?null==(i=this.eCloseButton)||i.focus():h&&g?null==(s=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,p))||s.focus():this.focusBody(e.shiftKey));let m=null;if(n.isTargetUnderManagedComponent(a,p)&&(g&&(m=this.focusService.findFocusableElementBeforeTabGuard(a,p)),m||h||(m=l.eHeaderButton)),!m&&a.contains(u)&&(m=n.findNextFocusableElement(a,!1,g),!m))return e.preventDefault(),void(h&&!g?this.forceFocusOutOfContainer(g):d&&!g?null==(r=this.eCloseButton)||r.focus():this.focusHeader());m&&(e.preventDefault(),m.focus())}focusInnerElement(e){e?this.focusHeader():this.focusBody(!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){this.focusService.focusInto(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");Vt(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),jt(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i,s,r,n,o;const{tabbedItem:a,eHeaderButton:l}=e;null==(i=(t=this.params).onItemClicked)||i.call(t,{item:a}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),vs(this.eBody),a.bodyPromise.then(e=>{this.eBody.appendChild(e);const t=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,t),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const t=a.getScrollableContainer&&a.getScrollableContainer()||e;this.lastScrollListener=this.addManagedListener(t,"scroll",()=>{this.tabbedItemScrollMap.set(a.name,t.scrollTop)});const i=this.tabbedItemScrollMap.get(a.name);void 0!==i&&setTimeout(()=>{t.scrollTop=i},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null==(o=(n=this.activeItem.tabbedItem).afterDetachedCallback)||o.call(n)),l.classList.add("ag-tab-selected"),this.activeItem=e):null==(r=(s=this.params).onActiveItemClicked)||r.call(s)}};g([he("focusService")],El.prototype,"focusService",2),g([br("eHeader")],El.prototype,"eHeader",2),g([br("eBody")],El.prototype,"eBody",2),g([ae],El.prototype,"postConstruct",1);var Ml=El,Al=class extends st{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{var i,s;let r=null!=(i=null==e?void 0:e.clientWidth)?i:0,n=null!=(s=null==e?void 0:e.clientHeight)?s:0,o=!0;const a=()=>{var i,s;if(o){const o=null!=(i=null==e?void 0:e.clientWidth)?i:0,l=null!=(s=null==e?void 0:e.clientHeight)?s:0;(o!==r||l!==n)&&(r=o,n=l,t()),this.doNextPolyfillTurn(a)}};return a(),()=>o=!1},r=this.gos.get("suppressBrowserResizeObserver");return i.ResizeObserver&&!r?(()=>{const s=new i.ResizeObserver(t);return s.observe(e),()=>s.disconnect()})():this.getFrameworkOverrides().wrapIncoming(()=>s(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){this.polyfillScheduled||(this.polyfillScheduled=!0,window.setTimeout(()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(e=>e())},50))}};Al=g([ce("resizeObserverService")],Al);var Tl=class extends st{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationProxy.getCurrentPage();e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,r=s.list,n=this.destroyTasks,o=(new Date).getTime();let a=(new Date).getTime()-o;const l=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;l||a<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(r.length)this.sortTaskList(s),e=r.pop().task;else{if(!n.length){this.cancelledTasks.clear();break}e=n.pop()}this.cancelledTasks.has(e)||e()}a=(new Date).getTime()-o}i.length||r.length||n.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask(()=>{t=!1,e()})):window.setTimeout(e,0)}}};g([he("ctrlsService")],Tl.prototype,"ctrlsService",2),g([he("paginationProxy")],Tl.prototype,"paginationProxy",2),g([ae],Tl.prototype,"init",1),Tl=g([ce("animationFrameService")],Tl);var Dl=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(Dl||{}),Il=class extends st{postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(e=>{e.id&&t.has(e.id)&&(e.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};g([he("rowModel")],Il.prototype,"rowModel",2),g([ae],Il.prototype,"postConstruct",1),Il=g([ce("expansionService")],Il);var Rl=class extends st{postConstruct(){var e;this.activeMenuFactory=null!=(e=this.enterpriseMenuFactory)?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const r=s.getBoundingClientRect();return{x:r.x+r.width/2,y:r.y+r.height/2}}showContextMenu(e){var t,i,s;const{column:r,rowNode:n}=e;let{anchorToElement:o,value:a}=e;n&&r&&null==a&&(a=n.getValueFromValueService(r)),null==o&&(o=this.getContextMenuAnchorElement(n,r)),null==(s=this.contextMenuFactory)||s.onContextMenu(null!=(t=e.mouseEvent)?t:null,null!=(i=e.touchEvent)?i:null,null!=n?n:null,null!=r?r:null,a,o)}showColumnChooser(e){var t;null==(t=this.columnChooserFactory)||t.showColumnChooser(e)}hidePopupMenu(){var e;null==(e=this.contextMenuFactory)||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;null==(e=this.columnChooserFactory)||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(null!=i?i:t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(null==e?void 0:e.getColDef().suppressHeaderContextMenu)&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Pi()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),s=null==(t=i.floatingFilterComponentParams)?void 0:t.suppressFilterButton;return null!=s&&U("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==i.suppressFloatingFilterButton?!s:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return null!=(e=this.gos.get("columnMenu"))?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?e:!this.gos.exists("suppressMenuHide")||e}showColumnMenuCommon(e,t,i,s){const{column:r,positionBy:n}=t;if("button"===n){const{buttonElement:n}=t;e.showMenuAfterButtonClick(r,n,i,s)}else if("mouse"===n){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(r,n,i,s)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).getHeaderCtrlForColumn(r);e.showMenuAfterButtonClick(r,t.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(null==i?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;return this.getCellGui(s,t)||(s.isFullWidth()?s.getFullWidthElement():i)}};g([he("filterMenuFactory")],Rl.prototype,"filterMenuFactory",2),g([he("ctrlsService")],Rl.prototype,"ctrlsService",2),g([he("animationFrameService")],Rl.prototype,"animationFrameService",2),g([he("filterManager")],Rl.prototype,"filterManager",2),g([he("rowRenderer")],Rl.prototype,"rowRenderer",2),g([de("columnChooserFactory")],Rl.prototype,"columnChooserFactory",2),g([de("contextMenuFactory")],Rl.prototype,"contextMenuFactory",2),g([de("enterpriseMenuFactory")],Rl.prototype,"enterpriseMenuFactory",2),g([ae],Rl.prototype,"postConstruct",1),Rl=g([ce("menuService")],Rl);var Pl=class extends st{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(e=>this.cloneItemIntoDummy(e,t)),i.appendChild(t);const s=t.offsetWidth;return i.removeChild(t),s+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),r=s.classList;["ag-header-cell","ag-header-group-cell"].some(e=>i.classList.contains(e))?(r.add("ag-header","ag-header-row"),s.style.position="static"):r.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(e=>n.classList.contains(e))){for(let e=0;e<n.classList.length;e++){const t=n.classList[e];"ag-row-position-absolute"!=t&&r.add(t)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}};g([he("rowRenderer")],Pl.prototype,"rowRenderer",2),g([he("ctrlsService")],Pl.prototype,"ctrlsService",2),g([he("rowCssClassCalculator")],Pl.prototype,"rowCssClassCalculator",2),g([ae],Pl.prototype,"postConstruct",1),Pl=g([ce("autoWidthCalculator")],Pl);var kl=class extends st{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i,s,r;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let n=null==(t=e.childStore)?void 0:t.getStoreBounds();return e.footer&&(n=null==(i=e.sibling.childStore)?void 0:i.getStoreBounds()),(null!=(s=null==n?void 0:n.heightPx)?s:0)+(null!=(r=null==n?void 0:n.topPx)?r:0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){const t=e.footer&&0===e.rowIndex,i=!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex);if(t||i){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=De(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),r=new Set,n=e=>{if(r.add(e),t){const t=this.getLastPixelOfGroup(e),r=s+i+e.rowHeight;e.stickyRowTop=t<r?i+(t-r):i}else{const t=this.getFirstPixelOfGroup(e),r=s-(i+e.rowHeight);e.stickyRowTop=t>r?i-(t-r):i}i=0,r.forEach(e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)})},o=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=e=>!!e.displayed&&(e.footer?!0!==o&&(("grand"!==o||-1!==e.level)&&(!("group"===o&&e.level>-1)&&!r.has(e))):!!e.isExpandable()&&(!0!==a&&(!r.has(e)&&e.expanded)));for(let e=0;e<100;e++){let e=s+i;t||(e=s-i);const r=this.rowModel.getRowIndexAtPixel(e),o=this.rowModel.getRow(r);if(null==o)break;const a=this.getStickyAncestors(o).find(e=>(t?e.rowIndex<r:e.rowIndex>r)&&l(e));if(a)n(a);else{if(!(t?o.rowTop<e:o.rowTop+o.rowHeight>e)||!l(o))break;n(o)}}return t||r.forEach(e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,r,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(t=>t.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const s="top"===e,r=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,n={},o=[];for(let e=0;e<r.length;e++){const i=r[e].getRowNode();t.has(i)?o.push(r[e]):(n[i.id]=r[e],i.sticky=!1)}const a=new Set;for(let e=0;e<o.length;e++)a.add(o[e].getRowNode());const l=[];t.forEach(e=>{a.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))});let c=!!l.length||o.length!==r.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),c=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),c=!0),this.destroyRowCtrls(n,!1);const h=[...o,...l];return h.sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex),s||h.reverse(),h.forEach(e=>e.setRowTop(e.getRowNode().stickyRowTop)),!!c&&(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0)}};g([he("rowModel")],kl.prototype,"rowModel",2),g([he("rowRenderer")],kl.prototype,"rowRenderer",2),g([he("ctrlsService")],kl.prototype,"ctrlsService",2),g([ae],kl.prototype,"postConstruct",1);var Ll=class extends st{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(e=>e.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener(lt.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(lt.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(lt.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(lt.EVENT_COLUMN_VISIBLE,t)},s=()=>{this.eventService.removeEventListener(lt.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(lt.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(lt.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(lt.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?i():s()}),this.gos.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,lt.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new kl(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new Nl(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=N(this.rowCtrlsByRowIndex),t=N(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,lt.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,lt.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,lt.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,lt.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(e=>{const t=t=>{this.getAllCellCtrls().forEach(i=>{i.getColumn()===e&&t(i)})},i=()=>{t(e=>e.onLeftChanged())},s=()=>{t(e=>e.onWidthChanged())},r=()=>{t(e=>e.onFirstRightPinnedChanged())},n=()=>{t(e=>e.onLastLeftPinnedChanged())},o=()=>{t(e=>e.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",s),e.addEventListener("firstRightPinnedChanged",r),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",o),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",s),e.removeEventListener("firstRightPinnedChanged",r),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",o)})})}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(e=>{e.destroyFirstPass(),e.destroySecondPass()}),e.length=0,t&&t.forEach(t=>{const i=new ya(t,this.beans,!1,!1,this.printLayout);e.push(i)})}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(null==(i=this.cachedRowCtrls)?void 0:i.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return null==e||e.forEach(e=>this.redrawRow(e,!0)),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=(null==e?void 0:e.suppressKeepFocus)?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,ga.DOM_DATA_KEY_CELL_CTRL),r=this.gos.getDomData(i,ya.DOM_DATA_KEY_ROW_CTRL);return s||r?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),r=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(r,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const i=t[s].getAllCellCtrls(),r=i.length;for(let t=0;t<r;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>e.refreshOrDestroyCell(t)),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(e=>{e.isFullWidth()&&(e.refreshFullWidth()||this.redrawRow(e.getRowNode(),!0))}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(e=>e.getCellRenderer()).filter(e=>null!=e);if(null==(t=e.columns)?void 0:t.length)return i;const s=[],r=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(e=>{if(r&&!this.isRowInMap(e.getRowNode(),r))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const i=t[e];null!=i&&s.push(i)}}),[...s,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>{const i=e.getCellEditor();i&&t.push(i)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter(e=>{const i=e.getRowNode();return this.isRowInMap(i,t)}):i}getCellCtrls(e,t){let i;v(t)&&(i={},t.forEach(e=>{const t=this.columnModel.getGridColumn(e);v(t)&&(i[t.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(e=>{e.getAllCellCtrls().forEach(e=>{const t=e.getColumn().getId();i&&!i[t]||s.push(e)})}),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];P(this.rowCtrlsByRowIndex,(t,i)=>{null==i.getRowNode().id&&e.push(t)}),this.removeRowCtrls(e);const t={};return P(this.rowCtrlsByRowIndex,(e,i)=>{const s=i.getRowNode();t[s.id]=i}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]})}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&ki()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,r=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let n=!1;this.stickyRowFeature&&(n=this.stickyRowFeature.checkStickyRows());const o=this.firstRenderedRow!==s||this.lastRenderedRow!==r;if((!t||n||o)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!n),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(e=>i[e]=!0);const s=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!i[e]);this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){let t=zi(this.firstRenderedRow,this.lastRenderedRow);const i=(e,i)=>{const s=i.getRowNode().rowIndex;null!=s&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(s)};P(this.rowCtrlsByRowIndex,i),P(e,i),t.sort((e,t)=>e-t);const s=[];for(let e=0;e<t.length;e++){const i=t[e],r=this.paginationProxy.getRow(i);r&&!r.sticky&&s.push(i)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const r=[];s.forEach(s=>{const n=this.createOrUpdateRowCtrl(s,e,t,i);v(n)&&r.push(n)}),e&&(!i||this.gos.get("suppressAnimationFrame")||this.printLayout?this.destroyRowCtrls(e,t):this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:lt.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))})}createOrUpdateRowCtrl(e,t,i,s){let r,n=this.rowCtrlsByRowIndex[e];if(n||(r=this.paginationProxy.getRow(e),v(r)&&v(t)&&t[r.id]&&r.alreadyRendered&&(n=t[r.id],t[r.id]=null)),!n){if(r||(r=this.paginationProxy.getRow(e)),!v(r))return;n=this.createRowCon(r,i,s)}return r&&(r.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];P(e,(e,s)=>{s&&(this.cachedRowCtrls&&s.isCacheable()?this.cachedRowCtrls.addRow(s):(s.destroyFirstPass(!t),t?(this.zombieRowCtrls[s.getInstanceId()]=s,i.push(()=>{s.destroySecondPass(),delete this.zombieRowCtrls[s.getInstanceId()]})):s.destroySecondPass()))}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),K(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const i=this.getRowBufferInPixels(),s=this.ctrlsService.getGridBodyCtrl(),r=this.gos.get("suppressRowVirtualisation");let n,o,a=!1;do{const e=this.paginationProxy.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:l}=this.paginationProxy.getCurrentPagePixelRange(),c=this.rowContainerHeightService.getDivStretchOffset(),h=s.getScrollFeature().getVScrollPosition(),d=h.top,u=h.bottom;r?(n=t+c,o=l+c):(n=Math.max(d+e-i,t)+c,o=Math.min(u+e+i,l)+c),this.firstVisibleVPixel=Math.max(d+e,t)+c,this.lastVisibleVPixel=Math.min(u+e,l)+c,a=this.ensureAllRowsInRangeHaveHeightsCalculated(n,o)}while(a);let l=this.paginationProxy.getRowIndexAtPixel(n),c=this.paginationProxy.getRowIndexAtPixel(o);const h=this.paginationProxy.getPageFirstRow(),d=this.paginationProxy.getPageLastRow();l<h&&(l=h),c>d&&(c=d),e=l,t=c}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),r=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>r&&(t=e+r);const n=e!==this.firstRenderedRow,o=t!==this.lastRenderedRow;if(n||o){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:lt.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:lt.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),s=this.focusService.isRowNodeFocused(i),r=e.isEditing(),n=i.detail;return(s||r||n)&&!!this.paginationProxy.isRowPresent(i)||t}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const r=this.gos.get("suppressAnimationFrame"),n=i&&!r&&!this.printLayout;return new ya(e,this.beans,t,n,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(e=>e.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow||i)}};g([he("animationFrameService")],Ll.prototype,"animationFrameService",2),g([he("paginationProxy")],Ll.prototype,"paginationProxy",2),g([he("columnModel")],Ll.prototype,"columnModel",2),g([he("pinnedRowModel")],Ll.prototype,"pinnedRowModel",2),g([he("rowModel")],Ll.prototype,"rowModel",2),g([he("focusService")],Ll.prototype,"focusService",2),g([he("beans")],Ll.prototype,"beans",2),g([he("rowContainerHeightService")],Ll.prototype,"rowContainerHeightService",2),g([he("ctrlsService")],Ll.prototype,"ctrlsService",2),g([ae],Ll.prototype,"postConstruct",1),Ll=g([ce("rowRenderer")],Ll);var Nl=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],Ne(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],Ne(this.entriesList,e)}getEntries(){return this.entriesList}},_l=class extends st{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(e){return b("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(b(i))return 0;for(let t=0;t<i.length;t++){const s=i[t];if(s.rowTop+s.rowHeight-1>=e)return t}return i.length-1}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:lt.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:lt.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let s=0;e.forEach((e,r)=>{const n=new Ln(this.beans);n.data=e;const o=t?Ln.ID_PREFIX_TOP_PINNED:Ln.ID_PREFIX_BOTTOM_PINNED;n.id=o+r,n.rowPinned=t?"top":"bottom",n.setRowTop(s),n.setRowHeight(this.gos.getRowHeightForNode(n).height),n.setRowIndex(r),s+=n.rowHeight,i.push(n)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){b(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){b(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=De(e);return t.rowTop+t.rowHeight}};g([he("beans")],_l.prototype,"beans",2),g([ae],_l.prototype,"init",1),_l=g([ce("pinnedRowModel")],_l);var Ol=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Ol||{}),Fl=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const r=e.childrenAfterGroup[s];r.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(r)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(e=>this.nodeIdsToColumns[i.id][e.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>i[e.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>!i[e.getId()])}},Gl=class e extends st{constructor(t){super(),this.state=e.STATE_WAITING_TO_LOAD,this.version=0,this.id=t}getId(){return this.id}load(){this.state=e.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=e.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(t){this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(t,i){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_LOADED,this.processServerResult(i))}dispatchLoadCompleted(t=!0){const i={type:e.EVENT_LOAD_COMPLETE,success:t,block:this};this.dispatchEvent(i)}};Gl.EVENT_LOAD_COMPLETE="loadComplete",Gl.STATE_WAITING_TO_LOAD="needsLoading",Gl.STATE_LOADING="loading",Gl.STATE_LOADED="loaded",Gl.STATE_FAILED="failed";var Bl=Gl,Vl=class extends st{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=ar.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(Bl.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){ar.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:Vl.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:Vl.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter(e=>e.getState()===Bl.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(e=>e.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};Vl.BLOCK_LOADED_EVENT="blockLoaded",Vl.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",g([he("rowModel")],Vl.prototype,"rowModel",2),g([ae],Vl.prototype,"postConstruct",1),g([m(0,pe("loggerFactory"))],Vl.prototype,"setBeans",1),Vl=g([ce("rowNodeBlockLoader")],Vl);var Hl=class extends st{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,lt.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,s){const r=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return r&&this.calculatePages(),r}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:lt.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const e={type:lt.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){if(!this.active||this.currentPage===e||"number"!=typeof this.currentPage)return;this.currentPage=e,this.calculatePages();const t={type:lt.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return C(this.topRowBounds)||C(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex)}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let s=t;s<=i;s++){const t=this.getRow(s);t&&e(t)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return!this.active||this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return v(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:v(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:v(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:v(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===e)return;this.calculatePages();const t={type:lt.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}if(i!==this.pageSize){this.calculatePages();const e={type:lt.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(v(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:lt.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};g([he("rowModel")],Hl.prototype,"rowModel",2),g([ae],Hl.prototype,"postConstruct",1),Hl=g([ce("paginationProxy")],Hl);var Ul=class extends st{processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,r){if(null==t&&null==e)return;const n={},o={},a=(e,t)=>{e.split(" ").forEach(e=>{""!=e.trim()&&t(e)})};if(t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const r=e[s],l=t[r];let c;"string"==typeof l?c=this.expressionService.evaluate(l,i):"function"==typeof l&&(c=l(i)),a(r,e=>{c?n[e]=!0:o[e]=!0})}}e&&r&&Object.keys(e).forEach(e=>a(e,e=>{n[e]||(o[e]=!0)})),r&&Object.keys(o).forEach(r),Object.keys(n).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return s="function"==typeof i?i(t):i,"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(e=>{i(e)})}};g([he("expressionService")],Ul.prototype,"expressionService",2),Ul=g([ce("stylingService")],Ul);var zl=class extends Hr{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},Wl=class extends Vr{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},jl=class extends en{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=Ai();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!=(t=qi(null!=e?e:null,!1))?t:void 0:e;return this.min===i||(this.min=i,Fs(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!=(t=qi(null!=e?e:null,!1))?t:void 0:e;return this.max===i||(this.max=i,Fs(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,Fs(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!=(e=Qi(this.getValue()))?e:void 0}setDate(e,t){this.setValue(qi(null!=e?e:null,!1),t)}},Kl=class extends Vr{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}},$l=class extends vr{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!v(t))return;let i=v(e);if(i){const s=null==t?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){const i=s+e.length,r=vt(t.slice(0,s),!0),n=vt(t.slice(s,i),!0),o=vt(t.slice(i));this.renderValueWithoutRenderer(`${r}<span class="ag-rich-select-row-text-highlight">${n}</span>${o}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),s=`ag-rich-select-row-${this.getCompId()}`;null==(t=i.parentElement)||t.setAttribute("id",s),e&&(ei(this.getParentComponent().getAriaElement(),s),this.wrapperEl.setAttribute("data-active-option",s)),pi(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gos.getDocument(),s=this.getGui(),r=i.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const n=vt(v(t)?t:e,!0);this.parsedValue=v(n)?n:null,s.appendChild(r),this.renderValueWithoutRenderer(n),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=v(e)?e:"&nbsp;")}populateWithRenderer(e,t){let i,s;return this.params.cellRenderer&&(s=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,shouldDisplayTooltip:t})}})),s&&(i=s.newAgStackInstance()),i&&Bs(i,this.getGui()),!!i&&(i.then(e=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(e)})}),!0)}onClick(){const e=this.getParentComponent(),t={type:lt.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};null==e||e.dispatchEvent(t)}};g([he("userComponentFactory")],$l.prototype,"userComponentFactory",2),g([ae],$l.prototype,"postConstruct",1);var Yl=class e extends xl{constructor(t){super(e.getTemplate((null==t?void 0:t.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:i="default",ariaRole:s="listbox",listName:r}=t||{};this.cssIdentifier=i,this.ariaRole=s,this.listName=r}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,lt.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const e=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;Vt(t,this.ariaRole),jt(t,e)}addResizeObserver(){const e=this.resizeObserverService.observeResize(this.getGui(),()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()));this.addDestroyFunc(e)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=zt(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case qs.UP:case qs.DOWN:this.navigate(e.key===qs.UP)&&e.preventDefault();break;case qs.PAGE_HOME:case qs.PAGE_END:case qs.PAGE_UP:case qs.PAGE_DOWN:null!==this.navigateToPage(e.key)&&e.preventDefault()}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(Ye(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(null==this.lastFocusedRowIndex)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return!(t<0||t>=this.model.getRowCount()||(this.focusRow(t),0))}navigateToPage(e,t="focused"){let i=!1;"focused"===t&&(t=this.getLastFocusedRow(),i=!0);const s=this.model.getRowCount()-1;let r=-1;return e===qs.PAGE_HOME?r=0:e===qs.PAGE_END?r=s:e===qs.PAGE_DOWN?r=Math.min(t+this.pageSize,s):e===qs.PAGE_UP&&(r=Math.max(t-this.pageSize,0)),-1===r?null:(i?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame(()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,i)=>e(t.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">\n                <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>\n            </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if("number"!=typeof e||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const s=e*this.rowHeight,r=s+this.rowHeight,n=this.getGui(),o=n.scrollTop,a=n.offsetHeight,l=o+a,c=t?0:this.rowHeight,h=l<r-c;if(o>s+c)return n.scrollTop=s,!0;if(h){const e=r-a;return n.scrollTop=e,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",J(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,s=i+t.offsetHeight,r=Math.floor(i/this.rowHeight),n=Math.floor(s/this.rowHeight);this.pageSize=Math.floor((s-i)/this.rowHeight),this.ensureRowsRendered(r,n,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((i,s)=>{(s<e||s>t)&&s!==this.lastFocusedRowIndex&&this.removeRow(s)}),i&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),Vt(i,"tree"===this.ariaRole?"treeitem":"option"),si(i,this.model.getRowCount()),ri(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=this.rowHeight*e+"px";const s=this.componentCreator(t,i);s.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(s.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:s,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,i)=>{var s,r;if(i>=e)this.removeRow(i);else{const e=this.model.getRow(i);(null==(r=(s=this.model).areRowsEqual)?void 0:r.call(s,t.value,e))?this.componentUpdater(e,t.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};g([he("resizeObserverService")],Yl.prototype,"resizeObserverService",2),g([he("animationFrameService")],Yl.prototype,"animationFrameService",2),g([br("eContainer")],Yl.prototype,"eContainer",2),g([ae],Yl.prototype,"postConstruct",1);var ql=Yl,Xl=class extends _r{constructor(e){var t,i;super(u(d({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!=(t=null==e?void 0:e.template)?t:'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',modalPicker:!1},e),{maxPickerHeight:null!=(i=null==e?void 0:e.maxPickerHeight)?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:s,value:r,valueList:n,searchStringCreator:o}=e||{};null!=s&&(this.cellRowHeight=s),void 0!==r&&(this.value=r),null!=n&&(this.values=n),o&&(this.searchStringCreator=o)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Z(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange(e=>this.searchTextFromString(e)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gos.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new ql({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setComponentUpdater((e,t)=>{}),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,lt.EVENT_FIELD_PICKER_VALUE_SELECTED,e=>{this.onListValueSelected(e.value,e.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",e=>e.preventDefault()),t.classList.add("ag-rich-select-list");const s=`ag-rich-select-list-${this.listComponent.getCompId()}`;i.setAttribute("id",s),jt(i,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),mi(this.eWrapper,i)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:s,initialInputValue:r}=this.config,n=this.config.valueFormatter?this.config.valueFormatter(e):e;if(s)return void this.eInput.setValue(null!=r?r:n);let o,a;if(i.cellRenderer&&(o=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:n})),o&&(a=o.newAgStackInstance()),a)vs(t),Bs(a,t),a.then(e=>{this.addDestroyFunc(()=>this.getContext().destroyBean(e))});else{if(v(this.value))t.innerText=n,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:e}=i;v(e)?(t.innerHTML=`${vt(e)}`,t.classList.add("ag-display-as-placeholder")):vs(t)}this.setTooltip({newTooltipText:null!=n?n:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null==(e=this.listComponent)||e.forEachRenderedRow((e,t)=>{e.highlightString(this.searchString)})}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null==(t=this.listComponent)||t.forEachRenderedRow((t,i)=>{const s=-1!==e&&this.highlightedItem===i;t.updateHighlighted(s)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:e=>t[e],areRowsEqual:(e,t)=>e===t}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));(null==(e=this.eLoading)?void 0:e.offsetParent)&&(null==(t=this.eLoading.parentElement)||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===qs.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Xs(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=e=>e}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map(e=>t(e)):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],s=[];if(!e.length)return{suggestions:i,filteredValues:s};const{searchType:r="fuzzy",filterList:n}=this.config;if("fuzzy"===r){const e=Us(this.searchString,t,!0);i=e.values;const r=e.indices;if(n&&r.length)for(let e=0;e<r.length;e++)s.push(this.values[r[e]])}else i=t.filter((e,t)=>{const i=e.toLocaleLowerCase(),o=this.searchString.toLocaleLowerCase(),a="match"===r?i.startsWith(o):-1!==i.indexOf(o);return n&&a&&s.push(this.values[t]),a});return{suggestions:i,filteredValues:s}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,s=this.buildSearchStrings(i);if(!s)return void this.highlightSelectedValue(-1);const{suggestions:r,filteredValues:n}=this.getSuggestionsAndFilteredValues(this.searchString,s),{filterList:o,highlightMatch:a,searchType:l="fuzzy"}=this.config,c=n.length,h=!(!o||""===this.searchString);if(this.filterListModel(h?n:i),r.length){const e=h?0:s.indexOf(r[0]);this.selectListItem(e)}else if(this.highlightSelectedValue(-1),!h||c)null==(e=this.listComponent)||e.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const e=null==(t=this.listComponent)?void 0:t.getAriaElement();e&&ei(e,null)}a&&"fuzzy"!==l&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=null==(e=this.listComponent)?void 0:e.getGui(),i=!!this.currentList&&0===this.currentList.length;null==t||t.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length||(this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e))}setValue(e,t,i){const s=this.currentList?this.currentList.indexOf(e):-1;return-1===s?this:(this.value=e,i||this.selectListItem(s),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new $l(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:s="fuzzy"}=this.config;return i&&"fuzzy"!==s&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const i=(null==t?void 0:t.getGui()).getBoundingClientRect(),s=t.getScrollTop(),r=e.clientY-i.top+s;return Math.floor(r/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===qs.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const s=this.highlightedItem,r=-1===s?0:s+(i?1:-1);this.selectListItem(r)}onPageNavigation(e){var t;if(!this.isPickerDisplayed)return;const i=null==(t=this.listComponent)?void 0:t.navigateToPage(e,this.highlightedItem);null!=i&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightSelectedValue(i)})}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){this.isPickerDisplayed&&this.currentList&&this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:lt.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case qs.LEFT:case qs.RIGHT:i||e.preventDefault();break;case qs.PAGE_HOME:case qs.PAGE_END:if(i){e.preventDefault();const i=this.eInput.getInputElement(),s=t===qs.PAGE_HOME?0:i.value.length;i.setSelectionRange(s,s);break}case qs.PAGE_UP:case qs.PAGE_DOWN:e.preventDefault(),this.onPageNavigation(t);break;case qs.DOWN:case qs.UP:this.onNavigationKeyDown(e,t);break;case qs.ESCAPE:this.isPickerDisplayed&&(Ss(this.listComponent.getGui())&&(e.preventDefault(),Ye(e)),this.hidePicker());break;case qs.ENTER:this.onEnterKeyDown(e);break;case qs.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};g([he("userComponentFactory")],Xl.prototype,"userComponentFactory",2),g([he("animationFrameService")],Xl.prototype,"animationFrameService",2),g([br("eInput")],Xl.prototype,"eInput",2);var Zl=class e extends Lr{constructor(t){super(t,e.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:i,step:s,value:r,onValueChange:n}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),null!=i&&this.setTextFieldWidth(i),null!=s&&this.setStep(s),null!=r&&this.setValue(r),null!=n&&this.onValueChange(n)}onValueChange(e){const t=lt.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}),this.addManagedListener(this.eSlider,t,()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,t){return this.getValue()===e||(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchEvent({type:lt.EVENT_FIELD_VALUE_CHANGED})),this}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};Zl.TEMPLATE='<div class="ag-slider">\n            <label ref="eLabel"></label>\n            <div class="ag-wrapper ag-slider-wrapper">\n                <ag-input-range ref="eSlider"></ag-input-range>\n                <ag-input-number-field ref="eText"></ag-input-number-field>\n            </div>\n        </div>',g([br("eLabel")],Zl.prototype,"eLabel",2),g([br("eSlider")],Zl.prototype,"eSlider",2),g([br("eText")],Zl.prototype,"eText",2),g([ae],Zl.prototype,"init",1);var Ql=Zl,Jl=class e extends vr{constructor(t={}){super(e.getTemplate(t)),this.params=t,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:i,items:s,suppressEnabledCheckbox:r,expanded:n,suppressToggleExpandOnEnableChange:o,useToggle:a}=t;this.cssIdentifier=t.cssIdentifier||"default",this.enabled=null==i||i,this.items=s||[],this.useToggle=null!=a&&a,this.alignItems=t.alignItems||"center",this.expanded=null==n||n,null!=r&&(this.suppressEnabledCheckbox=r),null!=o&&(this.suppressToggleExpandOnEnableChange=o)}static getTemplate(e){const t=e.cssIdentifier||"default";return`\n            <div class="ag-group ag-${t}-group" role="presentation">\n                <div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">\n                    <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n                </div>\n                <div ref="eContainer" class="ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container"></div>\n            </div>\n        `}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(null!=i&&i),this.refreshChildDisplay(),ns(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),null!=t&&this.onEnableChange(t)}refreshChildDisplay(){var e;ns(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),null==(e=this.eTitleBar)||e.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(t){var i;let s=!1;if((null==(i=this.eTitleBar)?void 0:i.isSuppressCollapse())&&!this.useToggle)t=!0,s=!0;else if(t=null!=t?t:!this.expanded,this.expanded===t)return this;return this.expanded=t,this.refreshChildDisplay(),ns(this.eContainer,t),s||this.dispatchEvent({type:t?e.EVENT_EXPANDED:e.EVENT_COLLAPSED}),this}addItems(e){e.forEach(e=>this.addItem(e))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const i=this.eContainer,s=e instanceof vr?e.getGui():e;s.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(i.insertAdjacentElement("afterbegin",s),this.items.unshift(s)):(i.appendChild(s),this.items.push(s))}hideItem(e,t){ns(this.items[t],!e)}getItemIndex(e){const t=e instanceof vr?e.getGui():e;return this.items.indexOf(t)}setTitle(e){var t;return null==(t=this.eTitleBar)||t.setTitle(e),this}addTitleBarWidget(e){var t;return null==(t=this.eTitleBar)||t.addWidget(e),this}addCssClassToTitleBar(e){var t;null==(t=this.eTitleBar)||t.addCssClass(e)}dispatchEnableChangeEvent(t){const i={type:e.EVENT_ENABLE_CHANGE,enabled:t};this.dispatchEvent(i)}setEnabled(e,t,i){var s;return this.enabled=e,this.refreshDisabledStyles(),i||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),null==(s=this.eToggle)||s.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(t){return this.addManagedListener(this,e.EVENT_ENABLE_CHANGE,e=>t(e.enabled)),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var t;return null==(t=this.eTitleBar)||t.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const t=!this.enabled;this.eContainer.classList.toggle("ag-disabled",t),null==(e=this.eTitleBar)||e.refreshDisabledStyles(this.suppressEnabledCheckbox&&t),this.eContainer.classList.toggle("ag-disabled-group-container",t)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new sc(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,sc.EVENT_EXPAND_CHANGED,e=>this.toggleGroupExpand(e.expanded)),e}createToggleTitleBar(){var e;const t=this.createManagedBean(new zl({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return t.addCssClass("ag-group-title-bar"),t.addCssClass(`ag-${null!=(e=this.params.cssIdentifier)?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=t,this.toggleGroupExpand(this.enabled),t}};Jl.EVENT_EXPANDED="expanded",Jl.EVENT_COLLAPSED="collapsed",Jl.EVENT_ENABLE_CHANGE="enableChange",g([br("eToolbar")],Jl.prototype,"eToolbar",2),g([br("cbGroupEnabled")],Jl.prototype,"cbGroupEnabled",2),g([br("eContainer")],Jl.prototype,"eContainer",2),g([ae],Jl.prototype,"postConstruct",1);var ec=Jl,tc="ag-disabled-group-title-bar",ic=class e extends vr{constructor(t={}){super(e.getTemplate(t)),this.suppressOpenCloseIcons=!1;const{title:i,suppressOpenCloseIcons:s}=t;i&&i.length>0&&(this.title=i),null!=s&&(this.suppressOpenCloseIcons=s)}static getTemplate(e){var t;const i=null!=(t=e.cssIdentifier)?t:"default";return`\n            <div class="ag-group-title-bar ag-${i}-group-title-bar ag-unselectable" role="button">\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n                <span ref="eTitle" class="ag-group-title ag-${i}-group-title"></span>\n            </div>\n        `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Ks("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Ks("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",e=>{switch(e.key){case qs.ENTER:case qs.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case qs.RIGHT:case qs.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===qs.RIGHT)}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ti(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;ns(this.eGroupOpenedIcon,t&&e),ns(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(t){const i={type:e.EVENT_EXPAND_CHANGED,expanded:t};this.dispatchEvent(i)}setTitle(e){const t=this.getGui(),i=!!e&&e.length>0;e=i?e:void 0,this.eTitle.textContent=null!=e?e:"",ns(t,i),e!==this.title&&(this.title=e);const s=t.classList.contains(tc);return this.refreshDisabledStyles(s),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(tc),t.removeAttribute("tabindex")):(t.classList.remove(tc),"string"==typeof this.title?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}};ic.EVENT_EXPAND_CHANGED="expandedChanged",g([br("eGroupOpenedIcon")],ic.prototype,"eGroupOpenedIcon",2),g([br("eGroupClosedIcon")],ic.prototype,"eGroupClosedIcon",2),g([br("eTitle")],ic.prototype,"eTitle",2),g([ae],ic.prototype,"postConstruct",1);var sc=ic,rc=class extends xl{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=null!=t?t:{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case qs.UP:case qs.RIGHT:case qs.DOWN:case qs.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case qs.ESCAPE:this.closeIfIsChild()&&Ye(e)}}handleFocusIn(e){var t,i;const s=e.relatedTarget;(this.tabGuardCtrl.isTabGuard(s)||!this.getGui().contains(s)&&!(null==(i=null==(t=this.activeMenuItem)?void 0:t.getSubMenuGui())?void 0:i.contains(s)))&&(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||(null==(t=this.activeMenuItem.getSubMenuGui())?void 0:t.contains(i))||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&hr.all(e.map(e=>"separator"===e?hr.resolve({eGui:this.createSeparator()}):"string"==typeof e?(console.warn(`AG Grid: unrecognised menu item ${e}`),hr.resolve({eGui:null})):this.addItem(e))).then(e=>{e.forEach(e=>{(null==e?void 0:e.eGui)&&(this.appendChild(e.eGui),e.comp&&this.menuItems.push(e.comp))})})}addItem(e){const t=this.createManagedBean(new ac);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListener(t,ac.EVENT_CLOSE_MENU,e=>{this.dispatchEvent(e)}),this.addManagedListener(t,ac.EVENT_MENU_ITEM_ACTIVATED,e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){return ws('\n            <div class="ag-menu-separator" aria-hidden="true">\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n            </div>')}handleNavKey(e){switch(e){case qs.UP:case qs.DOWN:const t=this.findNextItem(e===qs.UP);return void(t&&t!==this.activeMenuItem&&t.activate())}e===(this.gos.get("enableRtl")?qs.RIGHT:qs.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof ac)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(e=>!e.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?De(t):t[0];let i;e&&t.reverse();let s=!1;for(let e=0;e<t.length;e++){const r=t[e];if(s){i=r;break}r===this.activeMenuItem&&(s=!0)}return s&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};g([he("focusService")],rc.prototype,"focusService",2),g([ae],rc.prototype,"postConstruct",1);var nc=class extends xl{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===qs.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}};g([ae],nc.prototype,"postConstruct",1);var oc=class e extends st{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){var t,i;const{menuItemDef:s,isAnotherSubMenuOpen:r,level:n,childComponent:o,contextParams:a}=e;return this.params=e.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=r,this.childComponent=o,this.contextParams=a,this.cssClassPrefix=null!=(i=null==(t=this.params.menuItemParams)?void 0:t.cssClassPrefix)?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,u(d({},s),{level:n,isAnotherSubMenuOpen:r,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(e=>{var t;this.menuItemComp=e;const i=null==(t=e.configureDefaults)?void 0:t.call(e);i&&this.configureDefaults(!0===i?void 0:i)})}addListeners(e,t){(null==t?void 0:t.suppressClick)||this.addManagedListener(e,"click",e=>this.onItemSelected(e)),(null==t?void 0:t.suppressKeyboardSelect)||this.addManagedListener(e,"keydown",e=>{e.key!==qs.ENTER&&e.key!==qs.SPACE||(e.preventDefault(),this.onItemSelected(e))}),(null==t?void 0:t.suppressMouseDown)||this.addManagedListener(e,"mousedown",e=>{e.stopPropagation(),e.preventDefault()}),(null==t?void 0:t.suppressMouseOver)||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(t=!1){var i,s;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const r=ws('<div class="ag-menu" role="presentation"></div>');let n;this.eSubMenuGui=r;let o=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new nc(this.childComponent));e.setParentComponent(this);const t=e.getGui(),i="mouseenter",s=()=>this.cancelDeactivate();t.addEventListener(i,s),n=()=>t.removeEventListener(i,s),r.appendChild(t),this.childComponent.afterGuiAttached&&(o=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const i=this.createBean(new rc(this.level+1,this.contextParams));i.setParentComponent(this),i.addMenuItems(this.params.subMenu),r.appendChild(i.getGui()),this.addManagedListener(i,e.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e)),i.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),n=()=>this.destroyBean(i),t&&(o=()=>{i.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:r}),l=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:r,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:o});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var e,t;c&&c.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),n(),null==(t=(e=this.menuItemComp).setExpanded)||t.call(e,!1),this.eSubMenuGui=void 0},null==(s=(i=this.menuItemComp).setExpanded)||s.call(i,!0)}setAriaExpanded(e){this.suppressAria||ti(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e){var t,i;this.cancelActivate(),this.params.disabled||(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),null==(i=(t=this.menuItemComp).setActive)||i.call(t,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){var e,t;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),null==(t=(e=this.menuItemComp).setActive)||t.call(e,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){var t,i;null==(i=(t=this.menuItemComp).select)||i.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gos.addGridCommonParams(d({},this.contextParams)))):this.openSubMenu(e&&"keydown"===e.type),this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect||this.closeMenu(e)}closeMenu(t){const i={type:e.EVENT_CLOSE_MENU};t&&(t instanceof MouseEvent?i.mouseEvent=t:i.keyboardEvent=t),this.dispatchEvent(i)}onItemActivated(){const t={type:e.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(t)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),e.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),e.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,i,s;if(!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(e));let r=this.menuItemComp.getGui();const n=null==(i=(t=this.menuItemComp).getRootElement)?void 0:i.call(t);n&&((null==e?void 0:e.suppressRootStyles)||r.classList.add("ag-menu-option-custom"),r=n),this.eGui=r,this.suppressRootStyles=!!(null==e?void 0:e.suppressRootStyles),this.suppressRootStyles||(r.classList.add(this.cssClassPrefix),null==(s=this.params.cssClasses)||s.forEach(e=>r.classList.add(e)),this.params.disabled&&r.classList.add(`${this.cssClassPrefix}-disabled`)),(null==e?void 0:e.suppressTooltip)||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!(null==e?void 0:e.suppressAria),this.suppressAria||(Vt(r,"treeitem"),Zt(r,this.level+1),this.params.disabled&&Qt(r,!0)),(null==e?void 0:e.suppressTabIndex)||r.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(r,e),this.suppressFocus=!!(null==e?void 0:e.suppressFocus)}refreshTooltip(e,t){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),e&&this.menuItemComp&&(this.tooltipFeature=this.createBean(new mr({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};oc.EVENT_CLOSE_MENU="closeMenu",oc.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",oc.ACTIVATION_DELAY=80,g([he("popupService")],oc.prototype,"popupService",2),g([he("userComponentFactory")],oc.prototype,"userComponentFactory",2);var ac=oc,lc=class e extends vr{constructor(t){super(e.getTemplate(t)),this.config=t,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">\n            <div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">\n                <span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>\n                <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>\n            </div>\n            <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>\n        </div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:s,minWidth:r=250,width:n,minHeight:o=250,height:a,centered:l,popup:c,x:h,y:d}=this.config;this.positionableFeature=new Rr(this.getGui(),{minWidth:r,width:n,minHeight:o,height:a,centered:l,x:h,y:d,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const u=this.getGui();e&&this.setBodyComponent(e),i?ns(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(null!=t?t:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",e=>{if(u.contains(e.relatedTarget)||u.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()}),c&&this.positionableFeature.isPositioned()||(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(t){if(t!==this.closable&&(this.closable=t),t){const t=this.closeButtonComp=new vr(e.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),s=$s("close",this.gos);s.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(s),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const e=this.closeButtonComp.getGui();e.parentElement.removeChild(e),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,s=i.children,r=s.length;null==t&&(t=r),t=Math.max(0,Math.min(t,r)),e.addCssClass("ag-panel-title-bar-button");const n=e.getGui();0===t?i.insertAdjacentElement("afterbegin",n):t===r?i.insertAdjacentElement("beforeend",n):s[t-1].insertAdjacentElement("afterend",n),e.setParentComponent(this)}getBodyHeight(){return hs(this.eContentWrapper)}getBodyWidth(){return ds(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&Ss(e)&&this.close(),super.destroy()}};lc.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',g([br("eContentWrapper")],lc.prototype,"eContentWrapper",2),g([br("eTitleBar")],lc.prototype,"eTitleBar",2),g([br("eTitleBarButtons")],lc.prototype,"eTitleBarButtons",2),g([br("eTitle")],lc.prototype,"eTitle",2),g([ae],lc.prototype,"postConstruct",1);var cc=lc,hc=class extends cc{constructor(e){super(u(d({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",t=>{this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),s&&this.setMaximizable(s),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:s,afterGuiAttached:r}=this.config,n=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:s||n("ariaLabelDialog","Dialog"),afterGuiAttached:r});o&&(this.close=o.hideFunc)}onClosed(e){var t,i;this.destroy(),null==(i=(t=this.config).closedCallback)||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:i,height:s}=this.lastPosition;this.setWidth(i),this.setHeight(s),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){ns(this.maximizeIcon,!this.isMaximized),ns(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new vr('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=$s("maximize",this.gos),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=$s("minimize",this.gos),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}};g([he("popupService")],hc.prototype,"popupService",2);var dc=0,uc=class extends st{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedListener(this.eventService,lt.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){return this.gos.get("popupParent")||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);-1!==s&&(this.popupList[s].alignedToElement=t);const r=t.getBoundingClientRect(),n=this.getParentRect(),o=this.keepXYWithinBounds(i,r.top-n.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const l=n.right-n.left-a;let c;function h(){return r.right-n.left-2}function d(){return r.left-n.left-a}this.gos.get("enableRtl")?(c=d(),c<0&&(c=h(),this.setAlignedStyles(i,"left")),c>l&&(c=0,this.setAlignedStyles(i,"right"))):(c=h(),c>l&&(c=d(),this.setAlignedStyles(i,"right")),c<0&&(c=0,this.setAlignedStyles(i,"left"))),i.style.left=`${c}px`,i.style.top=`${o}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:r}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:r,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:r,eventSource:n,alignSide:o="left",position:a="over",column:l,rowNode:c,type:h}=e,d=n.getBoundingClientRect(),u=this.getParentRect(),p=this.getPopupIndex(t);-1!==p&&(this.popupList[p].alignedToElement=n),this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:r,updatePosition:()=>{let i,r=d.left-u.left;return"right"===o&&(r-=t.offsetWidth-d.width),"over"===a?(i=d.top-u.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),i="under"===this.shouldRenderUnderOrAbove(t,d,u,e.nudgeY||0)?d.top-u.top+d.height:d.top-t.offsetHeight-2*(s||0)-u.top),{x:r,y:i}},postProcessCallback:()=>this.callPostProcessPopup(h,t,n,null,l,c)})}shouldRenderUnderOrAbove(e,t,i,s){const r=i.bottom-t.bottom,n=t.top-i.top,o=e.offsetHeight+s;return r>o?"under":n>o||n>r?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:r}=s;r&&(["right","left","over","above","under"].forEach(t=>{r.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)}),t&&(r.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`)))}callPostProcessPopup(e,t,i,s,r,n){const o=this.gos.getCallback("postProcessPopup");o&&o({column:r,rowNode:n,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:r,skipObserver:n,updatePosition:o}=e,a={width:0,height:0},l=(n=!1)=>{let{x:l,y:c}=o();n&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(l+=s),r&&(c+=r),i&&(l=this.keepXYWithinBounds(t,l,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${l}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!n){const e=this.resizeObserverService.observeResize(t,()=>l(!0));setTimeout(()=>e(),uc.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),gs(t)}keepXYWithinBounds(e,t,i){const s=0===i,r=s?"clientHeight":"clientWidth",n=s?"top":"left",o=s?"offsetHeight":"offsetWidth",a=s?"scrollTop":"scrollLeft",l=this.gos.getDocument(),c=l.documentElement,h=this.getPopupParent(),d=h.getBoundingClientRect(),u=l.documentElement.getBoundingClientRect(),p=h===l.body,g=e[o];let m=p?(s?us:ps)(c)+c[a]:h[r];p&&(m-=Math.abs(u[n]-d[n]));const f=m-g;return Math.min(Math.max(t,0),Math.abs(f))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:r,positionCallback:n,anchorToElement:o}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const l=this.createPopupWrapper(i,s,!!r),c=this.addEventListenersToPopup(u(d({},e),{wrapperEl:l}));return n&&n(),this.addPopupToPopupList(i,l,c,o),{hideFunc:c}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();v(e.style.top)||(e.style.top=-1*t.top+"px"),v(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),r=document.createElement("div"),{allThemes:n}=this.environment.getTheme();return n.length&&r.classList.add(...n),r.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Vt(e,"dialog"),jt(e,t),r.appendChild(e),s.appendChild(r),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),r}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const e of Array.from(t.wrapper.classList))e.startsWith("ag-theme-")&&t.wrapper.classList.remove(e);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:r,closedCallback:n,afterGuiAttached:o,closeOnEsc:a,modal:l}=e;let c=!1;const h=e=>{s.contains(this.gos.getActiveDomElement())&&(e.key!==qs.ESCAPE||qe(e)||p({keyboardEvent:e}))},d=e=>p({mouseEvent:e}),u=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:o,touchEvent:a,keyboardEvent:l,forceHide:p}=e;(p||!this.isEventFromCurrentPopup({mouseEvent:o,touchEvent:a},r)&&!c)&&(c=!0,i.removeChild(s),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",d),this.eventService.removeEventListener(lt.EVENT_DRAG_STARTED,d),n&&n(o||a||l),this.removePopupFromPopupList(r))};return o&&o({hidePopup:p}),window.setTimeout(()=>{a&&t.addEventListener("keydown",h),l&&(t.addEventListener("mousedown",d),this.eventService.addEventListener(lt.EVENT_DRAG_STARTED,d),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",d))},0),p}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:dc++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(e=>e&&e()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const r=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=r,s.isAnchored=!0,r}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:r}=e,n=s.getBoundingClientRect(),o=i.top-n.top,a=i.left-n.left;let l=o,c=a;const h=r.style.top,d=parseInt(h.substring(0,h.length-1),10),u=r.style.left,p=parseInt(u.substring(0,u.length-1),10);return new hr(i=>{this.getFrameworkOverrides().setInterval(()=>{const i=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const h=i.top-n.top;if(h!=l){const e=this.keepXYWithinBounds(r,d+o-h,0);r.style.top=`${e}px`}l=h;const u=i.left-n.left;if(u!=c){const e=this.keepXYWithinBounds(r,p+a-u,1);r.style.left=`${e}px`}c=u},200).then(e=>{i(()=>{null!=e&&window.clearInterval(e)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,r=i||s;if(!r)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let e=n;e<this.popupList.length;e++)if(Qe(this.popupList[e].element,r))return!0;return this.isElementWithinCustomPopup(r.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,r=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),n=r.length,o=this.getWrapper(e);if(!o||s<=1||!t.contains(e))return;const a=i.indexOf(o),l=o.querySelectorAll("div"),c=[];for(l.forEach(e=>{0!==e.scrollTop&&c.push([e,e.scrollTop])}),n?o.classList.contains("ag-always-on-top")?a!==s-1&&De(r).insertAdjacentElement("afterend",o):a!==s-n-1&&r[0].insertAdjacentElement("beforebegin",o):a!==s-1&&De(i).insertAdjacentElement("afterend",o);c.length;){const e=c.pop();e[0].scrollTop=e[1]}}};uc.WAIT_FOR_POPUP_CONTENT_RESIZE=200,g([he("focusService")],uc.prototype,"focusService",2),g([he("ctrlsService")],uc.prototype,"ctrlsService",2),g([he("resizeObserverService")],uc.prototype,"resizeObserverService",2),g([ae],uc.prototype,"postConstruct",1),uc=g([ce("popupService")],uc);var pc=class extends vr{constructor(){super('\n        <div class="ag-autocomplete-row" role="presentation">\n            <div class="ag-autocomplete-row-label"></div>\n        </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(v(e)){const s=null==(t=this.value)?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){i=!0,this.hasHighlighting=!0;const t=s+e.length,r=vt(this.value.slice(0,s)),n=vt(this.value.slice(s,t)),o=vt(this.value.slice(t));this.getGui().lastElementChild.innerHTML=`${r}<b>${n}</b>${o}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!=(e=vt(this.value))?e:"&nbsp;"}},gc=class e extends xn{constructor(t){super(e.TEMPLATE),this.params=t,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new ql({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:e=>this.autocompleteEntries[e]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",e=>e.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),s=t===qs.UP?i-1:i+1;this.checkSetSelectedValue(s)}setSearch(e){this.searchString=e,v(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,s=!1;const r=e.toLocaleLowerCase(),n=t.filter(e=>{const t=e.toLocaleLowerCase().indexOf(r),n=0===t,o=t>=0;return o&&(!i||!s&&n||s===n&&e.length<i.length)&&(i=e,s=n),o});return!i&&n.length&&(i=n[0]),{topMatch:i,allMatches:n}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,s=i.map(e=>{var t;return null!=(t=e.displayValue)?t:e.key});let r,n;if(this.params.useFuzzySearch)r=Us(this.searchString,s,!0).values,n=r.length?r[0]:void 0;else{const e=this.runContainsSearch(this.searchString,s);r=e.allMatches,n=e.topMatch}let o=i.filter(({key:e,displayValue:t})=>r.includes(null!=t?t:e));if(!o.length&&this.selectedValue&&(null==(t=null==(e=this.params)?void 0:e.forceLastSelection)?void 0:t.call(e,this.selectedValue,this.searchString))&&(o=[this.selectedValue]),this.autocompleteEntries=o,this.virtualList.refresh(),!n)return;const a=r.indexOf(n);this.checkSetSelectedValue(a)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((t,i)=>{t.updateSelected(e===i)}))}createRowComponent(e){var t;const i=new pc;return this.getContext().createBean(i),i.setState(null!=(t=e.displayValue)?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),s=e.clientY-t.top+i,r=Math.floor(s/this.virtualList.getRowHeight());this.checkSetSelectedValue(r)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&null!=(e=this.selectedValue)?e:null}};gc.TEMPLATE='<div class="ag-autocomplete-list-popup">\n            <div ref="eList" class="ag-autocomplete-list"></div>\n        <div>',g([br("eList")],gc.prototype,"eList",2),g([ae],gc.prototype,"init",1);var mc=gc,fc=class e extends vr{constructor(){super('\n            <div class="ag-autocomplete" role="presentation">\n                <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n            </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(e){const t=y(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(t){this.updateLastPosition(),this.dispatchEvent({type:e.EVENT_VALUE_CHANGED,value:t}),this.validate(t)}updateAutocompleteList(e){var t,i,s,r;const n=null!=(i=null==(t=this.listGenerator)?void 0:t.call(this,e,this.lastPosition))?i:{enabled:!1};if(n.type&&n.type===(null==(s=this.autocompleteListParams)?void 0:s.type)||this.isListOpen&&this.closeList(),this.autocompleteListParams=n,null==(r=this.autocompleteListParams)?void 0:r.enabled){this.isListOpen||this.openList();const{searchString:e}=this.autocompleteListParams;this.autocompleteList.setSearch(null!=e?e:"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case qs.ENTER:this.onEnterKeyDown(e);break;case qs.TAB:this.onTabKeyDown(e);break;case qs.DOWN:case qs.UP:this.onUpDownKeyDown(e,t);break;case qs.LEFT:case qs.RIGHT:case qs.PAGE_HOME:case qs.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case qs.ESCAPE:this.onEscapeKeyDown(e);break;case qs.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){var t;const i=null==(t=this.autocompleteList)?void 0:t.getSelectedValue();i&&(this.closeList(),this.dispatchEvent({type:e.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:i,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){var i;e.preventDefault(),this.isListOpen?null==(i=this.autocompleteList)||i.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList(null!=(e=this.eAutocompleteInput.getValue())?e:null)}setCaret(e,t){const i=this.gos.getDocument(),s=this.gos.getActiveDomElement();!t||s&&s!==i.body||this.eAutocompleteInput.getFocusableElement().focus();const r=this.eAutocompleteInput.getInputElement();r.setSelectionRange(e,e),e===r.value.length&&(r.scrollLeft=r.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=null!=(e=this.eAutocompleteInput.getInputElement().selectionStart)?e:0}validate(t){var i;this.validator&&(this.validationMessage=this.validator(t),this.eAutocompleteInput.getInputElement().setCustomValidity(null!=(i=this.validationMessage)?i:""),this.valid=!this.validationMessage,this.dispatchEvent({type:e.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new mc({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:e.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return y(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:i,silent:s,updateListOnlyIfOpen:r,restoreFocus:n}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(null!=i?i:this.lastPosition,n),s||this.updateValue(t),r&&!this.isListOpen||this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};fc.EVENT_VALUE_CHANGED="eventValueChanged",fc.EVENT_VALUE_CONFIRMED="eventValueConfirmed",fc.EVENT_OPTION_SELECTED="eventOptionSelected",fc.EVENT_VALID_CHANGED="eventValidChanged",g([he("popupService")],fc.prototype,"popupService",2),g([br("eAutocompleteInput")],fc.prototype,"eAutocompleteInput",2),g([ae],fc.prototype,"postConstruct",1);var yc=fc,vc=class e extends vr{constructor(e,t,i,s){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=i,this.template=s}init(){var t;this.setTemplate(null!=(t=this.template)?t:e.TEMPLATE);const i=this.getGui();this.addElementClasses(i),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild($s("columnDrag",this.gos)),this.eButton.appendChild($s("cancel",this.gos)),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.localeService.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),jt(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const i=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(i)}}setupTooltip(){const e=()=>{const e=this.getTooltip();this.setTooltip({newTooltipText:e})};e(),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return Gn.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:t}=this,i=this.createGetDragItem(),s=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>s,getDragItem:i,dragItemName:this.getDisplayName()};e.addDragSource(r,!0),this.addDestroyFunc(()=>e.removeDragSource(r))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){ns(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const t={type:e.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addManagedListener(this.eButton,"click",e=>{this.dispatchEvent(t),e.stopPropagation()});const i=new fn(this.eButton);this.addManagedListener(i,fn.EVENT_TAP,()=>{this.dispatchEvent(t)}),this.addDestroyFunc(i.destroy.bind(i))}onKeyDown(t){t.key===qs.DELETE&&this.isRemovable()&&(t.preventDefault(),this.dispatchEvent({type:e.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=vt(this.getDisplayValue());this.eText.innerHTML=e}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${i}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};vc.EVENT_COLUMN_REMOVE="columnRemove",vc.TEMPLATE='<span role="option">\n          <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n          <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n          <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n        </span>',g([he("dragAndDropService")],vc.prototype,"dragAndDropService",2),g([br("eText")],vc.prototype,"eText",2),g([br("eDragHandle")],vc.prototype,"eDragHandle",2),g([br("eButton")],vc.prototype,"eButton",2),g([ae],vc.prototype,"init",1);var Cc=vc,bc=class e extends vr{constructor(t){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=t,this.state=e.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),Vt(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:i}=e;return t.contains(i.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,vs(this.getGui()),vs(this.ePillDropList)}init(e){this.params=null!=e?e:{},this.createManagedBean(new Tr(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Rr(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),jt(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const t=!this.horizontal;let i=e.key===qs.DOWN,s=e.key===qs.UP;if(!t){const t=this.gos.get("enableRtl");i=!t&&e.key===qs.RIGHT||t&&e.key===qs.LEFT,s=!t&&e.key===qs.LEFT||t&&e.key===qs.RIGHT}if(!i&&!s)return;const r=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,s);r&&(e.preventDefault(),r.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${i}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.dragAndDropService.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);if(t<0)return!1;const i=this.minimumAllowedNewInsertIndex(),s=Math.max(i,t),r=s!==this.insertIndex;return r&&(this.insertIndex=s),r}getNewInsertIndex(e){const t=e.event,i=this.horizontal?t.clientX:t.clientY,s=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),r=s.findIndex(e=>this.horizontal?e.right>i&&e.left<i:e.top<i&&e.bottom>i);if(-1===r){const e=this.gos.get("enableRtl");return s.every(e=>i>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:s.every(e=>i<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(t){this.state===e.STATE_NOT_DRAGGING&&(this.state=e.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(t.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(t){const i=this.getItems(t.dragSource.getDragItem());this.state=e.STATE_NEW_ITEMS_IN;const s=i.filter(e=>this.isItemDroppable(e,t)),r=s.every(e=>-1!==this.childPillComponents.map(e=>e.getItem()).indexOf(e));0!==s.length&&(this.potentialDndItems=s,r?this.state=e.STATE_NOT_DRAGGING:(this.handleDragEnterEnd(t),this.checkInsertIndex(t),this.refreshGui()))}isPotentialDndItems(){return Te(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(t){if(this.state===e.STATE_REARRANGE_ITEMS){const e=this.getItems(t.dragSource.getDragItem());this.removeItems(e)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(t),this.potentialDndItems=[],this.refreshGui()),this.state=e.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let t=!1;this.state===e.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),t=!0):t=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],!this.refreshOnDragStop()&&t||this.refreshGui()}this.state=e.STATE_NOT_DRAGGING}removeItems(e){const t=this.getExistingItems().filter(t=>!Ve(e,t));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),i=e.filter(e=>t.indexOf(e)<0);Ge(t,i,this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e){const t=this.getNonGhostItems().slice();return Ge(t,e,this.insertIndex),!Ie(t,this.getExistingItems())&&(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,i=this.getFocusedItem();let s=this.focusService.findNextFocusableElement();s||(s=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.isHorizontal()||(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),this.focusService.isKeyboardMode()&&this.restoreFocus(i,s)}getFocusedItem(){const e=this.getGui(),t=this.gos.getActiveDomElement();return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}restoreFocus(e,t){const i=this.getGui(),s=Array.from(i.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===s.length&&t.focus();const r=s[Math.min(s.length-1,e)];r&&r.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(e=>!Ve(this.potentialDndItems,e)):e}addItemsToGui(){const e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map(e=>this.createItemComponent(e,!0));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,t)=>{const i=e.getGui();ri(i,t+1),si(i,this.childPillComponents.length)})}createItemComponent(e,t){const i=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return i.addEventListener(Cc.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(i),this.guiDestroyFunctions.push(()=>this.destroyBean(i)),t||this.childPillComponents.push(i),i}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const i=document.createElement("div");if(Jt(i,!0),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),i.appendChild(t),!this.horizontal){const t=document.createElement("span");this.addElementClasses(t,"title"),t.innerHTML=e,i.appendChild(t)}this.appendChild(i)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=document.createElement("span");t.innerHTML=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=$s(this.gos.get("enableRtl")?"smallLeft":"smallRight",this.gos);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}};bc.STATE_NOT_DRAGGING="notDragging",bc.STATE_NEW_ITEMS_IN="newItemsIn",bc.STATE_REARRANGE_ITEMS="rearrangeItems",g([he("focusService")],bc.prototype,"focusService",2),g([he("dragAndDropService")],bc.prototype,"dragAndDropService",2);var Sc=bc,wc=["touchstart","touchend","touchmove","touchcancel"],xc=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new hr(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const r=Ve(wc,t);e.addEventListener(t,i,{capture:!!s,passive:r})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},Ec=class extends st{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===qs.UP,s=e===qs.DOWN,r=e===qs.LEFT;let n,o;if(i||s)o=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),n=t.column;else{const e=this.columnModel.getAllDisplayedColumns(),i=this.gos.get("enableRtl");o=t.rowIndex,n=r!==i?e[0]:De(e)}return{rowIndex:o,rowPinned:null,column:n}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case qs.UP:i=this.getCellAbove(i);break;case qs.DOWN:i=this.getCellBelow(i);break;case qs.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case qs.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}return!!i&&!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s)||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some(t=>t.getRowNode().rowIndex===e.rowIndex)?[...this.rowRenderer.getStickyTopRowCtrls()].sort((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex):[...this.rowRenderer.getStickyBottomRowCtrls()].sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex);const s=t?-1:1,r=i.findIndex(t=>t.getRowNode().rowIndex===e.rowIndex),n=i[r+s];return n?{rowIndex:n.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return"top"===t?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:"bottom"===t?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s,!0)||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,r=this.columnModel.getDisplayedColAfter(e.column);if(!r){r=t[0];const n=this.getRowBelow(e);if(C(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:r,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,r=this.columnModel.getDisplayedColBefore(e.column);if(!r){r=De(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(C(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:r,rowPinned:s}}};g([he("columnModel")],Ec.prototype,"columnModel",2),g([he("rowModel")],Ec.prototype,"rowModel",2),g([he("rowRenderer")],Ec.prototype,"rowRenderer",2),g([he("pinnedRowModel")],Ec.prototype,"pinnedRowModel",2),g([he("paginationProxy")],Ec.prototype,"paginationProxy",2),Ec=g([ce("cellNavigationService")],Ec);var Mc=class extends st{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=null!=(e=this.gos.get("alignedGrids"))?e:[];const i="function"==typeof t;"function"==typeof t&&(t=t());const s=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map(e=>{var t;if(!e)return z("alignedGrids contains an undefined option."),i||z('You may want to configure via a callback to avoid setup race conditions:\n                     "alignedGrids: () => [linkedGrid]"'),void z(s());if(e instanceof Uo)return e;const r=e;return"current"in r?null==(t=r.current)?void 0:t.api:(r.api||z(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${s()}`),r.api)}).filter(e=>!!e&&!e.isDestroyed())}init(){this.addManagedListener(this.eventService,lt.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{if(t.isDestroyed())return;const i=t.__getAlignedGridService();e(i)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case lt.EVENT_COLUMN_MOVED:case lt.EVENT_COLUMN_VISIBLE:case lt.EVENT_COLUMN_PINNED:case lt.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case lt.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case lt.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const e=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(e)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))})}processColumnEvent(e){var t;const i=e.column;let s=null;if(i&&(s=this.columnModel.getPrimaryColumn(i.getColId())),i&&!s)return;const r=this.getMasterColumns(e);switch(e.type){case lt.EVENT_COLUMN_MOVED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId}));this.columnModel.applyColumnState({state:i,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${t.toIndex}`)}break;case lt.EVENT_COLUMN_VISIBLE:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,hide:e.hide}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${t.visible}`)}break;case lt.EVENT_COLUMN_PINNED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,pinned:e.pinned}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${t.pinned}`)}break;case lt.EVENT_COLUMN_RESIZED:const i=e,s={};r.forEach(t=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${t.getActualWidth()}`),s[t.getId()]={key:t.getColId(),newWidth:t.getActualWidth()}}),null==(t=i.flexColumns)||t.forEach(e=>{s[e.getId()]&&delete s[e.getId()]}),this.columnModel.setColumnWidths(Object.values(s),!1,i.finished,"alignedGridChanged")}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(e=>{e.setGridOption("alwaysShowVerticalScroll",n)})}};g([he("columnModel")],Mc.prototype,"columnModel",2),g([he("ctrlsService")],Mc.prototype,"ctrlsService",2),g([m(0,pe("loggerFactory"))],Mc.prototype,"setBeans",1),g([ae],Mc.prototype,"init",1),Mc=g([ce("alignedGridsService")],Mc);var Ac=class extends st{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedListener(this.eventService,lt.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;const{newValue:i,clearSelection:s,suppressFinishActions:r,rangeSelect:n,nodes:o,event:a,source:l="api"}=e;if(0===o.length)return 0;if(o.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const c=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=o.map(e=>e.footer?e.sibling:e);if(n){if(o.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let e=null;if("checkboxSelected"===l&&!1===i&&this.lastRowNode&&(this.lastRowNode.id?e=this.lastRowNode:this.lastRowNode=null),null==e&&(e=this.getLastSelectedNode()),e){const t=h[0];if(t!==e&&this.isMultiselect())return this.selectRange(t,e,i,l)}}this.lastRowNode=i?null:h[0];let d=0;for(let e=0;e<h.length;e++){const s=h[e];c&&s.group||s.selectThisNode(i,a,l)&&d++,this.groupSelectsChildren&&(null==(t=s.childrenAfterGroup)?void 0:t.length)&&(d+=this.selectChildren(s,i,c,l))}if(!r&&(i&&(s||!this.isMultiselect())&&(d+=this.clearOtherNodes(h[0],l)),d>0)){this.updateGroupsFromChildrenSelections(l);const e={type:lt.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(e)}return d}selectRange(e,t,i=!0,s){const r=this.rowModel.getNodesInRangeForSelection(e,t);let n=0;r.forEach(e=>{e.group&&this.groupSelectsChildren||e.selectThisNode(i,void 0,s)&&n++}),this.updateGroupsFromChildrenSelections(s);const o={type:lt.EVENT_SELECTION_CHANGED,source:s};return this.eventService.dispatchEvent(o),n}selectChildren(e,t,i,s){const r=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return C(r)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:r})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());if(0==e.length)return null;return this.selectedNodes.get(De(e))||null}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new Fl(!0,i)).setInactive();let s=!1;return t.forEachChangedNodeDepthFirst(t=>{if(t!==i){const i=t.calculateSelectedFromChildren();s=t.selectThisNode(null!==i&&i,void 0,e)||s}}),s}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(r=>{if(r&&r.id!==e.id){const e=this.selectedNodes.get(r.id);s+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&r.parent&&i.set(r.parent.id,r.parent)}}),i.forEach(e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(v(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();if(this.resetNodes(),t){const t={type:lt.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(t)}}resetNodes(){var e;null==(e=this.selectedNodes)||e.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isSelected())t.push(r);else{const t=r;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:r,justCurrentPage:n}=e;if(n||r){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(r,n).forEach(t)}else this.selectedNodes.forEach(e=>{e&&t(e)}),this.reset(s);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s);const o={type:lt.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(o)}getSelectedCounts(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach(e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&s++)}),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(e=>e.selectable).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(e=>{if(e.group){if(!e.expanded){const t=e=>{var s;i.push(e),(null==(s=e.childrenAfterFilter)?void 0:s.length)&&e.childrenAfterFilter.forEach(t)};return void t(e)}this.groupSelectsChildren||i.push(e)}else i.push(e)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(e=>{i.push(e)}),i):(s.forEachNode(e=>{i.push(e)}),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e;this.getNodesToSelect(i,s).forEach(e=>e.selectThisNode(!0,void 0,t)),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const r={type:lt.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(r)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{(null==t?void 0:t.id)&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode(e=>{i.has(e.id)&&s.push(e)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}};g([he("rowModel")],Ac.prototype,"rowModel",2),g([he("paginationProxy")],Ac.prototype,"paginationProxy",2),g([ae],Ac.prototype,"init",1),Ac=g([ce("selectionService")],Ac);var Tc=class{constructor(e){this.viaApi=(e,...t)=>(U(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...t)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,s){this.viaApi("setColumnWidth",e,t,i,s)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};g([he("gridApi")],Tc.prototype,"api",2),Tc=g([ce("columnApi")],Tc);var Dc=class extends st{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener(lt.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener(lt.EVENT_CELL_VALUE_CHANGED,e,t)),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const r=e.getColDef(),n=r.field,o=e.getColId(),a=t.data;let l;const c=t.groupData&&void 0!==t.groupData[o],h=!s&&t.aggData&&void 0!==t.aggData[o],d=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&r.filterValueGetter?l=this.executeFilterValueGetter(r.filterValueGetter,a,e,t):this.isTreeData&&h?l=t.aggData[o]:this.isTreeData&&r.valueGetter?l=this.executeValueGetter(r.valueGetter,a,e,t):this.isTreeData&&n&&a?l=O(a,n,e.isFieldContainsDots()):c?l=t.groupData[o]:h?l=t.aggData[o]:r.valueGetter?l=this.executeValueGetter(r.valueGetter,a,e,t):u?l=O(a,t.field,e.isFieldContainsDots()):n&&a&&!d&&(l=O(a,n,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof l&&0===l.indexOf("=")){const i=l.substring(1);l=this.executeValueGetter(i,a,e,t)}if(null==l){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return l}parseValue(e,t,i,s){const r=e.getColDef(),n=this.gos.addGridCommonParams({node:t,data:null==t?void 0:t.data,oldValue:s,newValue:i,colDef:r,column:e}),o=r.valueParser;return v(o)?"function"==typeof o?o(n):this.expressionService.evaluate(o,n):i}formatValue(e,t,i,s,r=!0){let n,o=null;const a=e.getColDef();if(s?n=s:r&&(n=a.valueFormatter),n){const s=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});o="function"==typeof n?n(s):this.expressionService.evaluate(n,s)}else if(a.refData)return a.refData[i]||"";return null==o&&Array.isArray(i)&&(o=i.join(", ")),o}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let s=e.parent;for(;null!=s;){if(s.rowGroupColumn&&(!0===i||i===s.rowGroupColumn.getColId()))return s.key;s=s.parent}}setValue(e,t,i,s){const r=this.columnModel.getPrimaryColumn(t);if(!e||!r)return!1;C(e.data)&&(e.data={});const{field:n,valueSetter:o}=r.getColDef();if(C(n)&&C(o))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(r,i))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const a=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(r,e),newValue:i,colDef:r.getColDef(),column:r});let l;if(a.newValue=i,l=v(o)?"function"==typeof o?o(a):this.expressionService.evaluate(o,a):this.setValueUsingField(e.data,n,i,r.isFieldContainsDots()),void 0===l&&(l=!0),!l)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(r,e);const c={type:lt.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:e.data,node:e,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:s};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let r=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(r=n[e]===i,r||(n[e]=i)):n=n[e]}}else r=e[t]===i,r||(e[t]=i);return!r}executeFilterValueGetter(e,t,i,s){const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return"function"==typeof e?e(r):this.expressionService.evaluate(e,r)}executeValueGetter(e,t,i,s){const r=i.getColId(),n=this.valueCache.getValue(s,r);if(void 0!==n)return n;const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let a;return a="function"==typeof e?e(o):this.expressionService.evaluate(e,o),this.valueCache.setValue(s,r,a),a}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let r=i;return s&&(r=s(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof r||null==r||(r=String(r),"[object Object]"===r&&U("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),r}};g([he("expressionService")],Dc.prototype,"expressionService",2),g([he("columnModel")],Dc.prototype,"columnModel",2),g([he("valueCache")],Dc.prototype,"valueCache",2),g([he("dataTypeService")],Dc.prototype,"dataTypeService",2),g([ae],Dc.prototype,"init",1),Dc=g([ce("valueService")],Dc);var Ic=class extends st{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};g([m(0,pe("loggerFactory"))],Ic.prototype,"setBeans",1),Ic=g([ce("expressionService")],Ic);var Rc=class extends st{setBeans(e){this.logging=e.get("debug")}create(e){return new Pc(e,this.isLogging.bind(this))}isLogging(){return this.logging}};g([m(0,pe("gridOptionsService"))],Rc.prototype,"setBeans",1),Rc=g([ce("loggerFactory")],Rc);var Pc=class{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}},kc=class extends st{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>Gn.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new Xo(this.view)),this.addRtlSupport();const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>s()),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null==(e=null==t?void 0:t.getAttribute("row-id"))?void 0:e.startsWith("detail"))||!1}showDropZones(){return re.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return re.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return re.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return re.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const e={type:lt.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.view.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex(e=>e.contains(i))+(e?-1:1);return!(s<=0||s>=t.length)&&this.focusService.focusInto(t[s])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(De(t),!0);const e=De(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}};g([he("focusService")],kc.prototype,"focusService",2),g([he("resizeObserverService")],kc.prototype,"resizeObserverService",2),g([he("columnModel")],kc.prototype,"columnModel",2),g([he("ctrlsService")],kc.prototype,"ctrlsService",2),g([he("mouseEventService")],kc.prototype,"mouseEventService",2),g([he("dragAndDropService")],kc.prototype,"dragAndDropService",2);var Lc=class extends xl{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}};this.ctrl=this.createManagedBean(new kc);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.ctrl.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n                ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n                <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n                    <ag-grid-body ref="gridBody"></ag-grid-body>\n                    ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n                </div>\n                ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n                <ag-pagination></ag-pagination>\n                ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n            </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(e=>Ss(e))}};g([he("loggerFactory")],Lc.prototype,"loggerFactory",2),g([br("gridBody")],Lc.prototype,"gridBodyComp",2),g([br("sideBar")],Lc.prototype,"sideBarComp",2),g([br("rootWrapperBody")],Lc.prototype,"eRootWrapperBody",2),g([ae],Lc.prototype,"postConstruct",1);var Nc=class extends st{progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let r=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(e),i=null==t?void 0:t.filter(e=>e.isSortable());i&&(r=[e,...i])}r.forEach(e=>e.setSort(t,s));const n=[];if(!i&&!this.gos.get("alwaysMultiSort")||this.gos.get("suppressMultiSort")){const e=this.clearSortBarTheseColumns(r,s);n.push(...e)}this.updateSortIndex(e),n.push(...r),this.dispatchSortChangedEvents(s,n)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),s=t&&i||e,r=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(e=>e.setSortIndex(null));const n=r.filter(e=>!(t&&e.getColDef().showRowGroup||e===s));(s.getSort()?[...n,s]:n).forEach((e,t)=>{e.setSortIndex(t)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:lt.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):Nc.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,r=i==t.length-1;let n;return n=s||r?t[0]:t[i+1],Nc.DEFAULT_SORTING_ORDER.indexOf(n)<0?(console.warn("AG Grid: invalid sort type "+n),null):n}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter(e=>{const i=!!e.getAggFunc(),s=!e.isPrimary(),r=t?this.columnModel.getGroupDisplayColumnForGroup(e.getId()):e.getColDef().showRowGroup;return i||s||r})}const t=this.columnModel.getRowGroupColumns().filter(e=>!!e.getSort()),i={};e.forEach((e,t)=>i[e.getId()]=t),e.sort((e,t)=>{const s=e.getSortIndex(),r=t.getSortIndex();return null!=s&&null!=r?s-r:null==s&&null==r?i[e.getId()]>i[t.getId()]?1:-1:null==r?-1:1});const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map(e=>{var t;return null!=(t=this.columnModel.getGroupDisplayColumnForGroup(e.getId()))?t:e}))]);const r=new Map;return e.forEach((e,t)=>r.set(e,t)),s&&t.forEach(e=>{const t=this.columnModel.getGroupDisplayColumnForGroup(e.getId());r.set(e,r.get(t))}),r}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(null==t?void 0:t.length))return e.getSort();const i=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,s=i[0].getSort();return i.every(e=>e.getSort()==s)?s:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};Nc.DEFAULT_SORTING_ORDER=["asc","desc",null],g([he("columnModel")],Nc.prototype,"columnModel",2),Nc=g([ce("sortController")],Nc);var _c=class extends st{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",_c.toggleKeyboardMode),e.addEventListener("mousedown",_c.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",_c.toggleKeyboardMode),e.addEventListener("mousedown",_c.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=_c.keyboardModeActive,i="keydown"===e.type;i&&(e.ctrlKey||e.metaKey||e.altKey)||t!==i&&(_c.keyboardModeActive=i)}static unregisterGridCompController(e){_c.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}registerKeyboardFocusEvents(){const e=this.gos.getDocument();_c.addKeyboardModeEvents(e),_c.instanceCount++,this.addDestroyFunc(()=>{_c.instanceCount--,_c.unregisterGridCompController(e)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return _c.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),ya.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Ja.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return r&&(s.isFullWidthCell=r.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=d({type:lt.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:n=!1}=e,o=this.columnModel.getGridColumn(t);if(!o)return void(this.focusedCellPosition=null);this.focusedCellPosition=o?{rowIndex:i,rowPinned:y(s),column:o}:null;const a=u(d({type:lt.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:r,preventScrollOnBrowserFocus:n,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:r,headerRowIndex:n}=this.focusedHeaderPosition;return t===r&&i===n&&s==r.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:s,event:r,fromCell:n,rowWithoutSpanValue:o}=e;let{headerPosition:a}=e;if(n&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(s){const e=this.getFocusedHeader(),s=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:a,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");t&&r&&(a=t({key:r.key,previousHeaderPosition:e,nextHeaderPosition:a,headerRowCount:s,event:r}))}}return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:t,event:r,fromCell:n,rowWithoutSpanValue:o})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:s,event:r}=e,n=this.getFocusedHeader(),o=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:i,headerRowCount:o});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:s,event:r})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:s,headerPosition:r,headerRowCount:n}=e,o=t({backwards:"Before"===i,previousHeaderPosition:s,nextHeaderPosition:r,headerRowCount:n});return!0===o||null===o?(null===o&&U("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),s):!1===o?null:o}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:s,rowWithoutSpanValue:r,event:n}=e;if(-1===t.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(t.column);this.headerNavigationService.scrollToColumn(t.column,i);const o=this.ctrlsService.getHeaderRowContainerCtrl(t.column.getPinned()).focusHeader(t.headerRowIndex,t.column,n);return o&&(null!=r||s)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(null!=r?r:-1),o}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=De(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===y(t)}findFocusableElements(e,t,i=!1){const s=is;let r=ss;t&&(r+=", "+t),i&&(r+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(s)).filter(e=>Ss(e)),o=Array.prototype.slice.apply(e.querySelectorAll(r));return o.length?(a=o,n.filter(e=>-1===a.indexOf(e))):n;var a}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),r=t?De(s):s[0];return!!r&&(r.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let r=-1;for(let e=s-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){r=e;break}return r<=0?null:i[r-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),r=this.gos.getActiveDomElement();let n;n=t?s.findIndex(e=>e.contains(r)):s.indexOf(r);const o=n+(i?-1:1);return o<0||o>=s.length?null:s[o]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${Tr.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===Li(e)&&++i<=t;)e=e.parentElement;return null===Li(e)?null:e}focusGridView(e,t){var i;if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:r,rowPinned:n}=s,o=this.getFocusedHeader();return!e&&o&&(e=o.column),!(null==r||!e||(this.navigationService.ensureCellVisible({rowIndex:r,column:e,rowPinned:n}),this.setFocusedCell({rowIndex:r,column:e,rowPinned:y(n),forceBrowserFocus:!0}),null==(i=this.rangeService)||i.setRangeToCell({rowIndex:r,rowPinned:n,column:e}),0))}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){var t,i;return this.advancedFilterFocusColumn=null==e?void 0:e.column,null!=(i=null==(t=this.advancedFilterService)?void 0:t.getCtrl().focusHeaderComp())&&i}focusNextFromAdvancedFilter(e,t){var i,s;const r=null!=(s=t?void 0:this.advancedFilterFocusColumn)?s:null==(i=this.columnModel.getAllDisplayedColumns())?void 0:i[0];return e?this.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(r)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};_c.keyboardModeActive=!1,_c.instanceCount=0,g([he("eGridDiv")],_c.prototype,"eGridDiv",2),g([he("columnModel")],_c.prototype,"columnModel",2),g([he("headerNavigationService")],_c.prototype,"headerNavigationService",2),g([he("headerPositionUtils")],_c.prototype,"headerPositionUtils",2),g([he("rowRenderer")],_c.prototype,"rowRenderer",2),g([he("rowPositionUtils")],_c.prototype,"rowPositionUtils",2),g([he("cellPositionUtils")],_c.prototype,"cellPositionUtils",2),g([he("navigationService")],_c.prototype,"navigationService",2),g([he("ctrlsService")],_c.prototype,"ctrlsService",2),g([he("filterManager")],_c.prototype,"filterManager",2),g([de("rangeService")],_c.prototype,"rangeService",2),g([de("advancedFilterService")],_c.prototype,"advancedFilterService",2),g([ae],_c.prototype,"init",1),_c=g([ce("focusService")],_c);var Oc=class extends st{setMouseOver(e){this.selectedColumns=e;const t={type:lt.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:lt.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};Oc=g([ce("columnHoverService")],Oc);var Fc=class extends st{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{e(),t(this.executeLaterFuncs)},200)})}};g([he("ctrlsService")],Fc.prototype,"ctrlsService",2),g([ae],Fc.prototype,"postConstruct",1),Fc=g([ce("columnAnimationService")],Fc);var Gc=class extends st{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.addManagedListener(this.eventService,lt.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=this.gos.getRowHeightAsNumber(),i=Math.floor(e/t);this.paginationProxy.setPageSize(i,"autoCalculated")};this.isBodyRendered?Z(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};g([he("ctrlsService")],Gc.prototype,"ctrlsService",2),g([he("paginationProxy")],Gc.prototype,"paginationProxy",2),g([ae],Gc.prototype,"postConstruct",1),Gc=g([ce("paginationAutoPageSizeService")],Gc);var Bc=class extends st{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};g([ae],Bc.prototype,"init",1),Bc=g([ce("valueCache")],Bc);var Vc=class extends st{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,lt.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),r=new Fl(s,this.clientSideRowModel.getRootNode());r.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(r),r.forEachChangedNodeDepthFirst(e=>{i.push(e)})}this.rowRenderer.refreshCells({rowNodes:i})}};g([he("rowModel")],Vc.prototype,"rowModel",2),g([he("rowRenderer")],Vc.prototype,"rowRenderer",2),g([ae],Vc.prototype,"init",1),Vc=g([ce("changeDetectionService")],Vc);var Hc=class extends st{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(e){return!1}getGui(){return this.eGui}init(t){const i=e(t),s=typeof i;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=i?i:ws("<span></span>"):ws("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&e.prototype&&"getGui"in e.prototype}};g([he("componentMetadataProvider")],Hc.prototype,"componentMetadataProvider",2),Hc=g([ce("agComponentUtils")],Hc);var Uc=class extends st{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}};g([he("agComponentUtils")],Uc.prototype,"agComponentUtils",2),g([ae],Uc.prototype,"postConstruct",1),Uc=g([ce("componentMetadataProvider")],Uc);var zc={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:260}},Wc={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},jc=class extends st{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var e;const t=null!=(e=this.getTheme().el)?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:lt.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||0!==t.indexOf("ag-theme"))return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const s=this.calculatedSizes[t][e];return null!=s?s:(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const s="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),r=zc[s][e],n=this.gos.getDocument();if(i||(i=this.eGridDiv),!Wc[e])return r;const o=Wc[e],a=n.createElement("div"),l=Array.from(i.classList);a.classList.add(t,...l),a.style.position="absolute";const c=o.reduce((e,t)=>{const i=n.createElement("div");return i.style.position="static",i.classList.add(t),e.appendChild(i),i},a);let h=0;if(n.body){n.body.appendChild(a);const t=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(c)[t],10),n.body.removeChild(a)}return h||r}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,s=[];for(;t;){if(i=e.exec(t.className),i){const i=t.className.match(e);i&&(s=i);break}t=t.parentElement||void 0}if(!i)return{allThemes:s};const r=i[0];return this.calculatedTheme={theme:r,el:t,themeFamily:r.replace(/-dark$/,""),allThemes:s},this.calculatedTheme}getFromTheme(e,t){var i;return null!=(i=this.getSassVariable(t))?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return v(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};g([he("eGridDiv")],jc.prototype,"eGridDiv",2),g([ae],jc.prototype,"postConstruct",1),jc=g([ce("environment")],jc);var Kc=class extends st{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=Ni(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:lt.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:lt.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}};g([he("ctrlsService")],Kc.prototype,"ctrlsService",2),g([m(0,pe("loggerFactory"))],Kc.prototype,"agWire",1),g([ae],Kc.prototype,"postConstruct",1),Kc=g([ce("rowContainerHeightService")],Kc);var $c=class extends st{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),r="clientSide"===this.rowModel.getType()&&s,n=[],o=t=>{if(e&&!t.group)return;if(r&&t.group){const e=t.childrenAfterGroup.some(e=>!0===e.selectable);return void t.setRowSelectable(e,!0)}const s=!i||i(t);t.setRowSelectable(s,!0),!s&&t.isSelected()&&n.push(t)};if(r){const e=this.rowModel;new Fl(!1,e.getRootNode()).forEachChangedNodeDepthFirst(o,!0,!0)}else this.rowModel.forEachNode(o);n.length&&this.selectionService.setNodesSelected({nodes:n,newValue:!1,source:"selectableChanged"}),r&&this.selectionService instanceof Ac&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};g([he("rowModel")],$c.prototype,"rowModel",2),g([he("selectionService")],$c.prototype,"selectionService",2),g([ae],$c.prototype,"init",1),$c=g([ce("selectableService")],$c);var Yc=class extends vr{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:s,btLast:r,pageSizeComp:n}=this;this.activateTabIndex([t,i,s,r]),t.insertAdjacentElement("afterbegin",$s(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",$s(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",$s(e?"previous":"next",this.gos)),r.insertAdjacentElement("afterbegin",$s(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.onPaginationChanged()}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,lt.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",e=>{e.key!==qs.ENTER&&e.key!==qs.SPACE||(e.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc();return $i(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),r=e("firstPage","First Page"),n=e("previousPage","Previous Page"),o=e("nextPage","Next Page"),a=e("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">\n                <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>\n                <span class="ag-paging-row-summary-panel" role="status">\n                    <span id="ag-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-to">${i}</span>\n                    <span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-of">${s}</span>\n                    <span id="ag-${l}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n                </span>\n                <span class="ag-paging-page-summary-panel" role="presentation">\n                    <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n                    <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n                    <span class="ag-paging-description" role="status">\n                        <span id="ag-${l}-start-page">${t}</span>\n                        <span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n                        <span id="ag-${l}-of-page">${s}</span>\n                        <span id="ag-${l}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n                    </span>\n                    <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n                    <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>\n                </span>\n            </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),r=e===i-1;this.nextButtonDisabled=r||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Qt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let r,n;if(this.isZeroPagesToDisplay()?r=n=0:(r=t*e+1,n=r+t-1,i&&n>s&&(n=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(r),this.rowNodeBlockLoader.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(n)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const e=this.paginationProxy.getRow(0);if(e&&e.group&&!e.groupData&&!e.aggData)return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}};g([he("paginationProxy")],Yc.prototype,"paginationProxy",2),g([he("rowNodeBlockLoader")],Yc.prototype,"rowNodeBlockLoader",2),g([br("btFirst")],Yc.prototype,"btFirst",2),g([br("btPrevious")],Yc.prototype,"btPrevious",2),g([br("btNext")],Yc.prototype,"btNext",2),g([br("btLast")],Yc.prototype,"btLast",2),g([br("lbRecordCount")],Yc.prototype,"lbRecordCount",2),g([br("lbFirstRowOnPage")],Yc.prototype,"lbFirstRowOnPage",2),g([br("lbLastRowOnPage")],Yc.prototype,"lbLastRowOnPage",2),g([br("lbCurrent")],Yc.prototype,"lbCurrent",2),g([br("lbTotal")],Yc.prototype,"lbTotal",2),g([br("pageSizeComp")],Yc.prototype,"pageSizeComp",2),g([ae],Yc.prototype,"postConstruct",1);var qc=class e extends vr{constructor(){super(e.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new Xo(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(e=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(e.getGui()),this.activeOverlay=e,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),null==(e=this.updateListenerDestroyFunc)||e.call(this),vs(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};qc.TEMPLATE='\n        <div class="ag-overlay" role="presentation">\n            <div class="ag-overlay-panel" role="presentation">\n                <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>\n            </div>\n        </div>',g([he("overlayService")],qc.prototype,"overlayService",2),g([br("eOverlayWrapper")],qc.prototype,"eOverlayWrapper",2),g([ae],qc.prototype,"postConstruct",1);var Xc=qc,Zc=class extends st{getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(v(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}};g([he("rowModel")],Zc.prototype,"rowModel",2),g([he("pinnedRowModel")],Zc.prototype,"pinnedRowModel",2),g([he("paginationProxy")],Zc.prototype,"paginationProxy",2),Zc=g([ce("rowPositionUtils")],Zc);var Qc=class extends st{createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${null==i?"null":i}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,r=e.rowIndex===t.rowIndex;return i&&s&&r}};Qc=g([ce("cellPositionUtils")],Qc);var Jc=class{constructor(e){this.cellValueChanges=e}},eh=class extends Jc{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},th=class e{constructor(t){this.actionStack=[],this.maxStackSize=t||e.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};th.DEFAULT_STACK_SIZE=10;var ih=th,sh=class extends st{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:o,oldValue:a,value:l}=e,c={rowPinned:r,rowIndex:n,columnId:o.getColId(),newValue:l,oldValue:a};this.cellValueChanges.push(c)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new ih(e),this.redoStack=new ih(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,lt.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,lt.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,lt.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:lt.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:lt.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:lt.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:lt.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,r){if(!e)return!1;const n=e.pop();return!(!n||!n.cellValueChanges||(this.processAction(n,e=>e[s],r),n instanceof eh?this.processRange(this.rangeService,n.ranges||[n[i]]):this.processCell(n.cellValueChanges),t.push(n),0))}processAction(e,t,i){e.cellValueChanges.forEach(e=>{const{rowIndex:s,rowPinned:r,columnId:n}=e,o={rowIndex:s,rowPinned:r},a=this.rowPositionUtils.getRowNode(o);a.displayed&&a.setDataValue(n,t(e),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,r)=>{if(!s)return;const n=s.startRow,o=s.endRow;r===t.length-1&&(i={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,r={rowIndex:i,rowPinned:s},n=this.rowPositionUtils.getRowNode(r),o={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(o,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:r}=e,n=this.gridBodyCtrl.getScrollFeature(),o=this.columnModel.getGridColumn(s);if(!o)return;n.ensureIndexVisible(i),n.ensureColumnVisible(o);const a={rowIndex:i,column:o,rowPinned:r};this.focusService.setFocusedCell(u(d({},a),{forceBrowserFocus:!0})),null==t||t.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,lt.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,lt.EVENT_ROW_EDITING_STOPPED,()=>{const e=new Jc(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,lt.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,lt.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new Jc(this.cellValueChanges);this.pushActionsToUndoStack(e)}})}addPasteListeners(){this.addManagedListener(this.eventService,lt.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,lt.EVENT_PASTE_END,()=>{const e=new Jc(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,lt.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,lt.EVENT_FILL_END,e=>{const t=new eh(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,lt.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new eh(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new Jc(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};g([he("focusService")],sh.prototype,"focusService",2),g([he("ctrlsService")],sh.prototype,"ctrlsService",2),g([he("cellPositionUtils")],sh.prototype,"cellPositionUtils",2),g([he("rowPositionUtils")],sh.prototype,"rowPositionUtils",2),g([he("columnModel")],sh.prototype,"columnModel",2),g([de("rangeService")],sh.prototype,"rangeService",2),g([ae],sh.prototype,"init",1),sh=g([ce("undoRedoService")],sh);var rh=class extends st{findHeader(e,t){let i,s;if(e.column instanceof at?i=this.columnModel.getDisplayedGroupAtDirection(e.column,t):(s=`getDisplayedCol${t}`,i=this.columnModel[s](e.column)),!i)return;let{headerRowIndex:r}=e;if("filter"!==this.getHeaderRowType(r)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-r]}const{column:n,headerRowIndex:o}=this.getHeaderIndexToFocus(i,r);return{column:n,headerRowIndex:o}}getHeaderIndexToFocus(e,t){let i;if(e instanceof at&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let r=i;for(;r!==s;)t++,r=r.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some(e=>e.isSpanHeaderHeight())}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s="column"===i;let r="filter"===i?e:e.getParent(),n=t-1,o=n;if(s&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;o=n,n<0&&(r=e,n=t,o=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:o}}getColumnVisibleChild(e,t,i="After"){let s=e,r=t+1,n=r;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),n="After"===i?t[0]:De(t),o=[];let a=n;for(;a.getParent()!==e;)a=a.getParent(),o.push(a);if(s=n,n.isSpanHeaderHeight())for(let e=o.length-1;e>=0;e--){const t=o[e];if(!t.isPadding()){s=t;break}r++}else s=De(o),s||(s=n)}return{column:s,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i["start"===t?0:i.length-1];if(!s)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);return"group"==r?{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(s,e)}:{headerRowIndex:null==r?-1:e,column:s}}};g([he("columnModel")],rh.prototype,"columnModel",2),g([he("ctrlsService")],rh.prototype,"ctrlsService",2),rh=g([ce("headerPositionUtils")],rh);var nh=class{buildColumnDefs(e,t,i){const s=[],r={};return e.forEach(e=>{let n=!0,o=this.createDefFromColumn(e,t,i),a=e.getOriginalParent(),l=null;for(;a;){let e=null;if(a.isPadding()){a=a.getOriginalParent();continue}const t=r[a.getGroupId()];if(t){t.children.push(o),n=!1;break}if(e=this.createDefFromGroup(a),e&&(e.children=[o],r[e.groupId]=e,o=e,a=a.getOriginalParent()),null!=a&&l===a){n=!1;break}l=a}n&&s.push(o)}),s}createDefFromGroup(e){const t=L(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=L(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}};nh=g([ce("columnDefFactory")],nh);var oh=class{getInitialRowClasses(e){const t=[];return v(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),Ue(t,this.processClassesFromGridOptions(e.rowNode)),Ue(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach(e=>t.push(e))},s=this.gos.get("rowClass");if(s){if("function"==typeof s)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(s)}const r=this.gos.getCallback("getRowClass");return r&&i(r({data:e.data,node:e,rowIndex:e.rowIndex})),t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,e=>{t.push(e)},e=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};g([he("stylingService")],oh.prototype,"stylingService",2),g([he("gridOptionsService")],oh.prototype,"gos",2),oh=g([ce("rowCssClassCalculator")],oh);var ah=class extends st{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=e.map((e,t)=>({currentPos:t,rowNode:e}));return i.sort(this.compareRowNodes.bind(this,t)),i.map(e=>e.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,r=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],n="desc"===i.sort,o=this.getValue(s,i.column),a=this.getValue(r,i.column);let l;const c=this.getComparator(i,s);if(l=c?c(o,a,s,r,n):ar.defaultComparator(o,a,this.isAccentedSort),!isNaN(l)&&0!==l)return"asc"===i.sort?l:-1*l}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const r=!t.group&&i.getColDef().field;if(!r)return;const n=this.columnModel.getPrimaryColumn(r);return n?n.getColDef().comparator:void 0}getValue(e,t){var i,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const s=null==(i=e.allLeafChildren)?void 0:i[0];return s?this.valueService.getValue(t,s,!1,!1):void 0}const r=this.columnModel.getGroupDisplayColumnForGroup(t.getId());if(!r)return;return null==(s=e.groupData)?void 0:s[r.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};g([he("valueService")],ah.prototype,"valueService",2),g([he("columnModel")],ah.prototype,"columnModel",2),g([ae],ah.prototype,"init",1),ah=g([ce("rowNodeSorter")],ah);var lh=class extends st{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.params.leftHeader=e;break;case"right":this.params.rightHeader=e;break;default:this.params.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};lh.NAME="ctrlsService",lh=g([ce(lh.NAME)],lh);var ch=class extends st{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};ch=g([ce("ctrlsFactory")],ch);var hh=class extends vr{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Ri()||Pi())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=Bi(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui();["mouseenter","mousedown","touchstart"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),["mouseleave","touchend"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();J(()=>Ss(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}};g([br("eViewport")],hh.prototype,"eViewport",2),g([br("eContainer")],hh.prototype,"eContainer",2),g([he("scrollVisibleService")],hh.prototype,"scrollVisibleService",2),g([he("ctrlsService")],hh.prototype,"ctrlsService",2),g([he("animationFrameService")],hh.prototype,"animationFrameService",2);var dh=class e extends hh{constructor(){super(e.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Ea(e=>this.eContainer.style.width=`${e}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gos.getScrollbarWidth();i&&(t+=s),Rs(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let r=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(r+=s),Rs(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.gos.getScrollbarWidth()||0,r=i?0:0===s&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ks(this.getGui(),r),ks(this.eViewport,r),ks(this.eContainer,r),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return fs(this.getViewport(),this.enableRtl)}setScrollPosition(e){Ss(this.getViewport())||this.attemptSettingScrollPosition(e),ys(this.getViewport(),e,this.enableRtl)}};dh.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n            <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n            <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n                <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n            </div>\n            <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n        </div>',g([br("eLeftSpacer")],dh.prototype,"eLeftSpacer",2),g([br("eRightSpacer")],dh.prototype,"eRightSpacer",2),g([he("columnModel")],dh.prototype,"columnModel",2),g([he("pinnedRowModel")],dh.prototype,"pinnedRowModel",2),g([ae],dh.prototype,"postConstruct",1);var uh=dh,ph=class extends st{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:lt.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:lt.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};g([he("columnModel")],ph.prototype,"columnModel",2),g([ae],ph.prototype,"postConstruct",1),ph=g([ce("pinnedWidthService")],ph);var gh=class extends st{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(e=>this.eventService.dispatchEvent(e)),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}};g([he("animationFrameService")],gh.prototype,"animationFrameService",2),g([he("rowModel")],gh.prototype,"rowModel",2),g([ae],gh.prototype,"postConstruct",1),gh=g([ce("rowNodeEventThrottle")],gh);var mh=(e,t)=>{var i;return"clientSide"===(null!=(i=t.rowModelType)?i:"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null},fh={enableRowGroup:mh,rowGroup:mh,rowGroupIndex:mh,enablePivot:mh,enableValue:mh,pivot:mh,pivotIndex:mh,aggFunc:mh,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var t;const i=["columnsMenuTab","generalMenuTab"];return(null==(t=e.menuTabs)?void 0:t.some(e=>i.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>yh},yh={objectName:"colDef",allProperties:Object.keys({headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},validations:fh},vh={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},Ch={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{var t;const i=null!=(t=e.rowModelType)?t:"clientSide";switch(i){case"clientSide":const t=`treeData requires 'getDataPath' in the ${i} row model.`;return e.getDataPath?null:t;case"serverSide":const s=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:s}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{var t;switch(null!=(t=e.rowModelType)?t:"clientSide"){case"clientSide":return null;case"serverSide":const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t:null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},suppressParentsInRowNodes:{dependencies:{groupSelectsChildren:[void 0,!1]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>yh,defaultColDef:()=>yh,defaultColGroupDef:()=>yh,autoGroupColumnDef:()=>yh},bh={objectName:"gridOptions",allProperties:[...Pt.ALL_PROPERTIES,...Lt.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:{enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using  `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},validations:Ch},Sh=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new me,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const s=ct.has(t);if(s&&!e||!s&&e)return;const r=Lt.getCallbackForEvent(t),n=this.gridOptions[r];"function"==typeof n&&this.frameworkOverrides.wrapOutgoing(()=>{n(i)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new Tc(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return null!=(t=this.gridOptions[e])?t:vh[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return v(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>{const i=t;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,e(i)}:e}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}static toConstrainedNum(e,t){return i=>{const s=Sh.toNumber(i);if(!(null==s||s<e||s>t))return s}}static getCoercedValue(e,t){const i=Sh.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([e,i])=>{const s=Sh.getCoercedValue(e,i);t[e]=s}),t}updateGridOptions({options:e,force:t,source:i="api"}){const s={id:Sh.changeSetId++,properties:[]},r=[];Object.entries(e).forEach(([e,n])=>{"api"===i&&It[e]&&U(`${e} is an initial property and cannot be updated.`);const o=Sh.getCoercedValue(e,n),a=t||"object"==typeof o&&"api"===i,l=this.gridOptions[e];if(a||l!==o){this.gridOptions[e]=o;const t={type:e,currentValue:o,previousValue:l,changeSet:s,source:i};r.push(t)}}),this.validationService.processGridOptions(this.gridOptions),s.properties=r.map(e=>e.type),r.forEach(e=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${e.type} from `,e.previousValue," to  ",e.currentValue),this.propertyEventService.dispatchEvent(e)})}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Fi();null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:lt.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&C(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!=(t=this.gridOptions.domLayout)?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const s={node:e,data:e.data},r=this.getCallback("getRowHeight")(s);if(this.isNumeric(r))return 0===r&&U("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,r),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||C(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let r=e[s];C(r)&&(r={},e[s]=r),r[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&v(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&v(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return v(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!(null==e?void 0:e.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;return e||(this.gridOptions.groupIncludeTotalFooter?"bottom":void 0)}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};Sh.PROPERTY_COERCIONS=new Map([...Pt.BOOLEAN_PROPERTIES.map(e=>[e,Sh.toBoolean]),...Pt.NUMBER_PROPERTIES.map(e=>[e,Sh.toNumber]),["groupAggFiltering",e=>"function"==typeof e?e:Sh.toBoolean(e)],["pageSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",Sh.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",Sh.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",Sh.toConstrainedNum(0,Number.MAX_VALUE)]]),Sh.changeSetId=0,g([he("gridOptions")],Sh.prototype,"gridOptions",2),g([he("eventService")],Sh.prototype,"eventService",2),g([he("environment")],Sh.prototype,"environment",2),g([he("frameworkOverrides")],Sh.prototype,"frameworkOverrides",2),g([he("eGridDiv")],Sh.prototype,"eGridDiv",2),g([he("validationService")],Sh.prototype,"validationService",2),g([he("gridApi")],Sh.prototype,"api",2),g([ae],Sh.prototype,"init",1),g([le],Sh.prototype,"destroy",1),Sh=g([ce("gridOptionsService")],Sh);var wh=class extends st{getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,s)=>e({key:t,defaultValue:i,variableValues:s});const t=this.gos.get("localeText");return(e,i,s)=>{let r=t&&t[e];if(r&&s&&s.length){let e=0;for(;!(e>=s.length)&&-1!==r.indexOf("${variable}");)r=r.replace("${variable}",s[e++])}return null!=r?r:i}}};wh=g([ce("localeService")],wh);var xh=class e extends hh{constructor(){super(e.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new wa(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,lt.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Rs(this.getGui(),s),Rs(this.eViewport,s),Rs(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),s=t.scrollTop;i!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||Ss(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};xh.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n            <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n                <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n            </div>\n        </div>',g([ae],xh.prototype,"postConstruct",1);var Eh=xh,Mh={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Ah=["january","february","march","april","may","june","july","august","september","october","november","december"],Th=class extends st{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(At(e.source))})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([e,t])=>{this.dataTypeDefinitions[e]=u(d({},t),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(t)})});const i=null!=(e=this.gos.get("dataTypeDefinitions"))?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([e,s])=>{const r=this.processDataTypeDefinition(s,i,[e],t);r&&(this.dataTypeDefinitions[e]=r,s.dataTypeMatcher&&(this.dataTypeMatchers[e]=s.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(e=>{const i=this.dataTypeMatchers[e];i&&delete this.dataTypeMatchers[e],this.dataTypeMatchers[e]=null!=i?i:t[e].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=d(d({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let r;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=s[n];const o=t[n];if(i&&o&&(i=o),!this.validateDataTypeDefinition(e,i,n))return;r=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(n))return void U('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const o=t[n];if(!this.validateDataTypeDefinition(e,o,n))return;const a=this.processDataTypeDefinition(o,t,[...i,n],s);if(!a)return;r=this.mergeDataTypeDefinitions(a,e)}return u(d({},r),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(r)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(U('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(U(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if(null==(i=t.node)?void 0:i.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(u(d({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(u(d({},t),{value:t.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||(null==(s=e.dataTypeMatcher)?void 0:s.call(e,t.value)))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:s}=t;const{field:r}=t;if(void 0===s&&(s=e.cellDataType),null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(r,i)),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,i),n.columnTypes;U(`Missing data type definition - "${s}"`)}updateColDefAndGetColumnType(e,t,i){var s,r;const n=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),o=null!=(r=null!=(s=t.type)?s:n)?r:e.type;return e.type=o,o?this.convertColumnTypes(o):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener(Se.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(Se.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,s))return!1;const r=null===t.type?e.type:t.type;if(r){const e=null!=(i=this.gos.get("columnTypes"))?i:{};if(this.convertColumnTypes(r).some(t=>{const i=e[t.trim()];return i&&this.doColDefPropsPreventInference(i,s)}))return!1}return!this.doColDefPropsPreventInference(e,s)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const r=e[i];return null===r?(t[i]=!1,!1):void 0===s?!!r:r===s}inferCellDataType(e,t){var i;if(!e)return;let s;const r=this.getInitialData();if(r){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");s=O(r,e,t)}else this.initWaitForRowData(t);if(null==s)return;const[n]=null!=(i=Object.entries(this.dataTypeMatchers).find(([e,t])=>t(s)))?i:["object"];return n}getInitialData(){const e=this.gos.get("rowData");if(null==e?void 0:e.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(null==e?void 0:e.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,lt.EVENT_ROW_DATA_UPDATE_STARTED,e=>{const{firstRowData:s}=e;if(!s)return;null==i||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(s,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const r={type:lt.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(r)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[];const s={},r={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([e,n])=>{const o=this.columnModel.getGridColumn(e);if(!o)return;const a=o.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(o,"cellDataTypeInferred"))return;const l=o.getColDef();if(t&&l.type&&l.type!==a.type){const t=this.getUpdatedColumnState(o,n);t.rowGroup&&null==t.rowGroupIndex&&(s[e]=t),t.pivot&&null==t.pivotIndex&&(r[e]=t),i.push(t)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,r)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(e=>"string"!=typeof e)?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:"string"==typeof e?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e&&null!=(t=this.getDataTypeDefinition(e))?t:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null==(t=this.getDataTypeDefinition(e))?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const s=null==(i=this.getDataTypeDefinition(e))?void 0:i.dataTypeMatcher;return!s||s(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||U('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&U('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const s=(e,i,s)=>{let r=e.getColDef().valueFormatter;return r===t.groupSafeValueFormatter&&(r=t.valueFormatter),this.valueService.formatValue(e,i,s,r)},r=re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),n=this.localeService.getLocaleTextFunc(),o=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?d(d({},i),t):t};switch(t.baseDataType){case"number":e.cellEditor="agNumberCellEditor",r&&o({comparator:(e,t)=>{const i=null==e?0:parseInt(e),s=null==t?0:parseInt(t);return i===s?0:i>s?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===qs.SPACE,o(r?{valueFormatter:e=>v(e.value)?n(String(e.value),e.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=e=>s(e.column,e.node,e.value),r&&o({valueFormatter:e=>{const t=s(e.column,e.node,e.value);return v(t)?t:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Ah[Number(e)-1];return n(t,Mh[t])}return null!=e?e:n("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=e=>s(e.column,e.node,e.value);const i=t.dateParser;o(r?{valueFormatter:e=>{const t=s(e.column,e.node,e.value);return v(t)?t:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const t=i(null!=e?e:void 0);return t?[String(t.getFullYear()),String(t.getMonth()+1),String(t.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Ah[Number(e)-1];return n(t,Mh[t])}return null!=e?e:n("blanks","(Blanks)")}}:{comparator:(e,t)=>{const s=i(t);return null==t||s<e?-1:s>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const r=this.columnModel.getPrimaryColumn(i),n=null==r?void 0:r.getColDef();if(!r||!n)return 0;const o=null==e?"":s(r,null,e),a=null==t?"":s(r,null,t);return o===a?0:o>a?1:-1},e.keyCreator=e=>s(e.column,e.node,e.value),r?o({valueFormatter:e=>{const t=s(e.column,e.node,e.value);return v(t)?t:n("blanks","(Blanks)")}}):e.filterValueGetter=e=>s(e.column,e.node,this.valueService.getValue(e.column,e.node))}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>{var t,i;return""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:Number(e.newValue)},valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:S(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>{var t,i;return null==e.newValue?e.newValue:""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:"true"===String(e.newValue).toLowerCase()},valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Qi(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>{var i;return null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?null!=(i=qi(e.value,!1))?i:"":t("invalidDate","Invalid Date")},dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>{var t;return null!=(t=Qi(e))?t:void 0},dateFormatter:e=>{var t;return null!=(t=qi(null!=e?e:null,!1))?t:void 0},valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>{var t;return null!=(t=S(e.value))?t:""}}}}};g([he("rowModel")],Th.prototype,"rowModel",2),g([he("columnModel")],Th.prototype,"columnModel",2),g([he("valueService")],Th.prototype,"valueService",2),g([ae],Th.prototype,"init",1),Th=g([ce("dataTypeService")],Th);var Dh=class extends st{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(null!=e?e:[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=re.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new Pc("AG Grid",()=>this.gos.get("debug")).log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:lt.EVENT_GRID_READY};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,At(e.source))}};g([he("ctrlsService")],Dh.prototype,"ctrlsService",2),g([he("columnModel")],Dh.prototype,"columnModel",2),g([he("rowModel")],Dh.prototype,"rowModel",2),g([ae],Dh.prototype,"postConstruct",1),Dh=g([ce("syncService")],Dh);var Ih=class extends st{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,lt.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const e=this.userComponentFactory.getLoadingOverlayCompDetails({});this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const e=this.userComponentFactory.getNoRowsOverlayCompDetails({});this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const s=e.newAgStackInstance(),r=this.addManagedPropertyListener(i,({currentValue:e})=>{s.then(t=>{t.refresh&&t.refresh(this.gos.addGridCommonParams(d({},null!=e?e:{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(s,t,r)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gos.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){!this.columnModel.isReady()||this.paginationProxy.isEmpty()||this.manuallyDisplayed||this.hideOverlay()}};g([he("userComponentFactory")],Ih.prototype,"userComponentFactory",2),g([he("paginationProxy")],Ih.prototype,"paginationProxy",2),g([he("columnModel")],Ih.prototype,"columnModel",2),g([ae],Ih.prototype,"postConstruct",1),Ih=g([ce("overlayService")],Ih);var Rh=class extends st{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Z(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Z(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Z(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var e;this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=null!=(e=this.gos.get("initialState"))?e:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const t=this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,({source:e})=>{"gridInitializing"===e&&(null==t||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),i=this.addManagedListener(this.eventService,lt.EVENT_ROW_COUNT_READY,()=>{null==i||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),s=this.addManagedListener(this.eventService,lt.EVENT_FIRST_DATA_RENDERED,()=>{null==s||s(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,lt.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,lt.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var e;const t=null!=(e=this.gos.get("initialState"))?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,lt.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:s,pagination:r}=null!=(e=this.gos.get("initialState"))?e:{},n=this.gos.get("advancedFilterModel");(t||n)&&this.setFilterState(t,n),i&&this.setRowGroupExpansionState(i),s&&this.setRowSelectionState(s),r&&this.setPaginationState(r),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,lt.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,lt.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,lt.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,lt.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,lt.EVENT_PAGINATION_CHANGED,e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:s,columnOrder:r}=null!=(e=this.gos.get("initialState"))?e:{};s&&this.setFocusedCellState(s),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!(null==r?void 0:r.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedListener(this.eventService,lt.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,lt.EVENT_RANGE_SELECTION_CHANGED,e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,lt.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],r=[],n=[],o=[],a=[],l=[],c=[],h=this.columnModel.getColumnState();for(let e=0;e<h.length;e++){const{colId:d,sort:u,sortIndex:p,rowGroup:g,rowGroupIndex:m,aggFunc:f,pivot:y,pivotIndex:v,pinned:C,hide:b,width:S,flex:w}=h[e];c.push(d),u&&(t[null!=p?p:0]={colId:d,sort:u}),g&&(i[null!=m?m:0]=d),"string"==typeof f&&s.push({colId:d,aggFunc:f}),y&&(r[null!=v?v:0]=d),C&&("right"===C?o:n).push(d),b&&a.push(d),(w||S)&&l.push({colId:d,flex:null!=w?w:void 0,width:S})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:r.length||e?{pivotMode:e,pivotColIds:r}:void 0,columnPinning:n.length||o.length?{leftColIds:n,rightColIds:o}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:c.length?{orderedColIds:c}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:r,columnPinning:n,columnVisibility:o,columnSizing:a,columnOrder:l}=e,c={},h=e=>{let t=c[e];return t||(t={colId:e},c[e]=t,t)};t&&t.sortModel.forEach(({colId:e,sort:t},i)=>{const s=h(e);s.sort=t,s.sortIndex=i}),i&&i.groupColIds.forEach((e,t)=>{const i=h(e);i.rowGroup=!0,i.rowGroupIndex=t}),s&&s.aggregationModel.forEach(({colId:e,aggFunc:t})=>{h(e).aggFunc=t}),r&&(r.pivotColIds.forEach((e,t)=>{const i=h(e);i.pivot=!0,i.pivotIndex=t}),this.gos.updateGridOptions({options:{pivotMode:r.pivotMode},source:"gridInitializing"})),n&&(n.leftColIds.forEach(e=>{h(e).pinned="left"}),n.rightColIds.forEach(e=>{h(e).pinned="right"})),o&&o.hiddenColIds.forEach(e=>{h(e).hide=!0}),a&&a.columnSizingModel.forEach(({colId:e,flex:t,width:i})=>{const s=h(e);s.flex=null!=t?t:null,s.width=i});const d=null==l?void 0:l.orderedColIds,u=!!(null==d?void 0:d.length),p=u?d.map(e=>h(e)):Object.values(c);if(p.length){this.columnStates=p;const e={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnModel.applyColumnState({state:p,applyOrder:u,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.columnModel.isSecondaryColumnsPresent()){if(t){let i=[];for(const e of t)this.columnModel.getSecondaryColumn(e.colId)&&i.push(e);this.columnModel.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach(({groupId:e,open:i})=>{i&&t.push(e)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set(null==(t=e.columnGroup)?void 0:t.openColumnGroupIds),s=this.columnModel.getColumnGroupState().map(({groupId:e})=>{const t=i.has(e);return t&&i.delete(e),{groupId:e,open:t}});i.forEach(e=>{s.push({groupId:e,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnModel.setColumnGroupState(s,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&0===Object.keys(t).length&&(t=void 0);const i=null!=(e=this.filterManager.getAdvancedFilterModel())?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=null!=e?e:{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),s&&this.filterManager.setAdvancedFilterModel(s)}getRangeSelectionState(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges().map(e=>{const{id:t,type:i,startRow:s,endRow:r,columns:n,startColumn:o}=e;return{id:t,type:i,startRow:s,endRow:r,colIds:n.map(e=>e.getColId()),startColId:o.getColId()}});return(null==t?void 0:t.length)?{cellRanges:t}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach(e=>{const i=[];if(e.colIds.forEach(e=>{const t=this.columnModel.getGridColumn(e);t&&i.push(t)}),!i.length)return;let s=this.columnModel.getGridColumn(e.startColId);if(!s){const e=this.columnModel.getAllDisplayedColumns(),t=new Set(i);s=e.find(e=>t.has(e))}t.push(u(d({},e),{columns:i,startColumn:s}))}),this.rangeService.setCellRanges(t)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const s=null==(e=this.ctrlsService.getGridBodyCtrl())?void 0:e.getScrollFeature(),{left:r}=null!=(t=null==s?void 0:s.getHScrollPosition())?t:{left:0},{top:n}=null!=(i=null==s?void 0:s.getVScrollPosition())?i:{top:0};return n||r?{top:n,left:r}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:s}=e;null==(t=this.ctrlsService.getGridBodyCtrl())||t.getScrollFeature().setScrollPosition(i,s)}getSideBarState(){var e,t;return null==(t=null==(e=this.sideBarService)?void 0:e.getSideBarComp())?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(e||t)return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||(null==(e=null==t?void 0:t.toggledNodes)?void 0:e.length))?t:void 0}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([e,t])=>{M(t,this.cachedState[e])||(i=!0)}),this.cachedState=d(d({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),M(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState=u(d({},this.cachedState),{[e]:t})}refreshStaleState(){this.staleStateKeys.forEach(e=>{"rowSelection"===e&&this.setCachedStateValue(e,this.getRowSelectionState())}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(e=>this.queuedUpdateSources.add(e)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:lt.EVENT_STATE_UPDATED,sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};g([he("filterManager")],Rh.prototype,"filterManager",2),g([he("ctrlsService")],Rh.prototype,"ctrlsService",2),g([he("focusService")],Rh.prototype,"focusService",2),g([he("columnModel")],Rh.prototype,"columnModel",2),g([he("paginationProxy")],Rh.prototype,"paginationProxy",2),g([he("rowModel")],Rh.prototype,"rowModel",2),g([he("selectionService")],Rh.prototype,"selectionService",2),g([he("expansionService")],Rh.prototype,"expansionService",2),g([he("columnAnimationService")],Rh.prototype,"columnAnimationService",2),g([de("sideBarService")],Rh.prototype,"sideBarService",2),g([de("rangeService")],Rh.prototype,"rangeService",2),g([ae],Rh.prototype,"postConstruct",1),Rh=g([ce("stateService")],Rh);var Ph=class extends st{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,bh)}processColumnDefs(e){this.processOptions(e,yh)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:r,propertyExceptions:n,objectName:o,docsUrl:a}=t;r&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...null!=n?n:[],...Object.keys(s)],r,o,a);const l=new Set;Object.keys(e).forEach(t=>{var r;const n=s[t];if(n)if("renamed"in n){const{renamed:i,version:s}=n;l.add(`As of v${s}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=n;l.add(`As of v${i}, ${String(t)} is deprecated. ${null!=e?e:""}`)}const o=e[t];if(null==o||!1===o)return;const a=i[t];let c;if(!a)return;if("function"==typeof a){const i=a(e,this.gridOptions);if(!i)return;if("objectName"in i){const s=e[t];return Array.isArray(s)?void s.forEach(e=>{this.processOptions(e,i)}):void this.processOptions(e[t],i)}c=i}else c=a;const{module:h,dependencies:d,supportedRowModels:u}=c;if(u){const e=null!=(r=this.gridOptions.rowModelType)?r:"clientSide";if(!u.includes(e))return void l.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach(e=>{re.__assertRegistered(e,String(t),this.context.getGridId())||(i=!1,l.add(`${String(t)} is only available when ${e} is loaded.`))}),!i)return}if(d){const i=this.checkForWarning(t,d,e);if(i)return void l.add(i)}}),l.size>0&&l.forEach(e=>{U(e)})}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const s=Object.entries(t).find(([e,t])=>{const s=i[e];return!t.includes(s)});if(!s)return null;const[r,n]=s;return n.length>1?`'${String(e)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${n[0]}.`}checkProperties(e,t,i,s,r){const n=Hs(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(P(n,(e,t)=>{U(`invalid ${s} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}`)}),Object.keys(n).length>0&&r){const e=this.getFrameworkOverrides().getDocLink(r);U(`to see all the valid ${s} properties please check: ${e}`)}}};g([he("gridOptions")],Ph.prototype,"gridOptions",2),g([ae],Ph.prototype,"init",1),Ph=g([ce("validationService")],Ph);var kh=class extends st{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new fe(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!ct.has(e),r=s?this.asyncEventListeners:this.syncEventListeners;r.has(e)||r.set(e,new Set),r.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var i;const s=this.frameworkEventWrappingService.unwrap(t),r=this.asyncEventListeners.get(e),n=!!(null==r?void 0:r.delete(s));n||null==(i=this.syncEventListeners.get(e))||i.delete(s),this.eventService.removeEventListener(e,s,n)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{ct.has(e)&&t(e,i)},s=(e,i)=>{ct.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:s}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(s,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:s}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(s,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((e,i)=>{e.forEach(e=>this.eventService.removeEventListener(i,e,t)),e.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(e=>this.eventService.removeGlobalListener(e,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}};g([ae],kh.prototype,"postConstruct",1),kh=g([ce("apiEventService")],kh);var Lh=class extends vr{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,lt.EVENT_PAGINATION_CHANGED,e=>this.handlePaginationChanged(e))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(null==e?void 0:e.newPageSize))return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){vs(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),U("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n                Please make sure that the paginationPageSize grid option is set to one of the values in the \n                paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const s=this.localeService.getLocaleTextFunc(),r=s("pageSizeSelectorLabel","Page Size:"),n=e.map(e=>({value:String(e),text:String(e)})),o=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Br).addOptions(n).setValue(String(i?"":t)).setAriaLabel(o).setLabel(r).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=this.gos.get("paginationPageSizeSelector");return Array.isArray(e)&&this.validateValues(e)?[...e].sort((e,t)=>e-t):[20,50,100]}validateValues(e){if(!e.length)return U("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n                If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],s=i>0;if("number"!=typeof i)return U("The paginationPageSizeSelector grid option contains a non-numeric value.\n                    Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!s)return U("The paginationPageSizeSelector grid option contains a negative number or zero.\n                    Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};g([he("paginationProxy")],Lh.prototype,"paginationProxy",2),g([ae],Lh.prototype,"init",1);var Nh=class extends st{constructor(){super(),this.descriptionContainer=null,this.announceValue=Z(this.announceValue.bind(this),200)}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),Yt(t,"polite"),Xt(t,"additions text"),qt(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(vs(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};g([he("eGridDiv")],Nh.prototype,"eGridDiv",2),g([ae],Nh.prototype,"postConstruct",1),Nh=g([ce("ariaAnnouncementService")],Nh);var _h=class{};function Oh(e){_h.gridOptions=e}function Fh(e,t,i){if(!t)return z("No gridOptions provided to createGrid"),{};const s=(new Vh).create(e,t,t=>{const i=new Lc(e);t.createBean(i)},void 0,i);if(!Object.isFrozen(t)&&!(null==i?void 0:i.frameworkOverrides)){const e="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{z(`gridOptions.api is no longer supported. See ${e}.`)},configurable:!0}),Object.defineProperty(t,"columnApi",{get:()=>{z(`gridOptions.columnApi is no longer supported and all methods moved to the grid api. See ${e}.`)},configurable:!0})}return s}_h.gridOptions=void 0;var Gh=class{constructor(e,t,i){if(U("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t)return void z("No gridOptions provided to the grid");this.gridOptions=t;const s=(new Vh).create(e,t,t=>{const i=new Lc(e);t.createBean(i).addDestroyFunc(()=>{this.destroy()})},void 0,i);this.gridOptions.api=s,this.gridOptions.columnApi=new Tc(s)}destroy(){var e;this.gridOptions&&(null==(e=this.gridOptions.api)||e.destroy(),delete this.gridOptions.api,delete this.gridOptions.columnApi)}},Bh=1,Vh=class{create(e,t,i,s,r){var n;let o={};_h.gridOptions?(_(o,_h.gridOptions,!0,!0),o=d(d({},o),t)):o=t;const a=Sh.getCoercedGridOptions(o),l=!!a.debug,c=null!=(n=a.gridId)?n:String(Bh++),h=this.getRegisteredModules(r,c),u=this.createBeansList(a.rowModelType,h,c),p=this.createProvidedBeans(e,a,r);if(!u)return void z("Failed to create grid.");const g={providedBeanInstances:p,beanClasses:u,debug:l,gridId:c},m=new Pc("Context",()=>g.debug),f=new ne(g,m),y=f.getBean("beans");return this.registerModuleUserComponents(y,h),this.registerStackComponents(y,h),this.registerControllers(y,h),i(f),y.syncService.start(),s&&s(f),f.getBean("gridApi")}registerControllers(e,t){t.forEach(t=>{t.controllers&&t.controllers.forEach(t=>e.ctrlsFactory.register(t))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,s=re.__getRegisteredModules(t),r=[],n={},o=(e,t,i)=>{var s;n[(s=t).moduleName]||(n[s.moduleName]=!0,r.push(s),re.__register(s,e,i)),t.dependantModules&&t.dependantModules.forEach(t=>o(e,t,i))};return i&&i.forEach(e=>o(!0,e,t)),s&&s.forEach(e=>o(!re.__isPackageBased(),e,void 0)),r}registerModuleUserComponents(e,t){this.extractModuleEntity(t,e=>e.userComponents?e.userComponents:[]).forEach(t=>{e.userComponentRegistry.registerDefaultComponent(t.componentName,t.componentClass)})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;C(s)&&(s=new xc);const r={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(r,i.providedBeanInstances),r}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:Hr},{componentName:"AgRadioButton",componentClass:Ur},{componentName:"AgToggleButton",componentClass:zl},{componentName:"AgInputTextField",componentClass:en},{componentName:"AgInputTextArea",componentClass:Wl},{componentName:"AgInputNumberField",componentClass:tn},{componentName:"AgInputDateField",componentClass:jl},{componentName:"AgInputRange",componentClass:Kl},{componentName:"AgRichSelect",componentClass:Xl},{componentName:"AgSelect",componentClass:Br},{componentName:"AgSlider",componentClass:Ql},{componentName:"AgGridBody",componentClass:ka},{componentName:"AgHeaderRoot",componentClass:vl},{componentName:"AgSortIndicator",componentClass:vn},{componentName:"AgPagination",componentClass:Yc},{componentName:"AgPageSizeSelector",componentClass:Lh},{componentName:"AgOverlayWrapper",componentClass:Xc},{componentName:"AgGroupComponent",componentClass:ec},{componentName:"AgRowContainer",componentClass:Va},{componentName:"AgFakeHorizontalScroll",componentClass:uh},{componentName:"AgFakeVerticalScroll",componentClass:Eh},{componentName:"AgAutocomplete",componentClass:yc}];const i=this.extractModuleEntity(e,e=>e.agStackComponents?e.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const s=t.filter(t=>!t.rowModel||t.rowModel===e),r={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!r[e])return void z("Could not find row model for rowModelType = "+e);if(!re.__assertRegistered(r[e],`rowModelType = '${e}'`,i))return;const n=[aa,Zc,Qc,rh,Gc,Uo,uo,Hc,Uc,Al,Lo,Kc,Cl,wh,Ph,_l,Go,Dt,me,Sh,uc,Ac,Wo,Mt,ml,Hl,Ll,Ic,rt,Mc,_a,Bc,Dc,Rc,Pl,bl,Gn,Tc,_c,Na,jc,Ec,Ul,La,Nc,Oc,Fc,$c,ut,Vc,Tl,sh,Nt,nh,oh,Vl,ah,lh,ph,gh,ch,Th,zo,Dh,Ih,Rh,Il,kh,Nh,Rl],o=this.extractModuleEntity(s,e=>e.beans?e.beans:[]);n.push(...o);const a=[];return n.forEach(e=>{a.indexOf(e)<0&&a.push(e)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Hh=class{wrap(e,t,i=[],s){const r=this.createWrapper(e,s);return t.forEach(e=>{this.createMethod(r,e,!0)}),i.forEach(e=>{this.createMethod(r,e,!1)}),r}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}},Uh=class{};Uh.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},Uh.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],Uh.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var zh=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(zh||{}),Wh="undefined"==typeof globalThis?{}:globalThis;Wh.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Wh.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Wh.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Wh.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Wh.Node="undefined"==typeof Node?{}:Node,Wh.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var jh=class e{constructor(t,i,s,r,n,o){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=t,this.gos=i,this.eventService=s,this.columnModel=r,this.beans=o,this.selectionService=n,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return ar.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(t){if("string"==typeof t)return void console.warn("AG Grid: rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t);const i=this.rootNode,s=this.rootNode.sibling;i.childrenAfterFilter=null,i.childrenAfterGroup=null,i.childrenAfterAggFilter=null,i.childrenAfterSort=null,i.childrenMapped=null,i.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?i.allLeafChildren=t.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL)):(i.allLeafChildren=[],i.childrenAfterGroup=[]),s&&(s.childrenAfterFilter=i.childrenAfterFilter,s.childrenAfterGroup=i.childrenAfterGroup,s.childrenAfterAggFilter=i.childrenAfterAggFilter,s.childrenAfterSort=i.childrenAfterSort,s.childrenMapped=i.childrenMapped,s.allLeafChildren=i.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&ar.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:lt.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:lt.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(e)}}executeAdd(t,i){var s;const{add:r,addIndex:n}=t;if(ar.missingOrEmpty(r))return;const o=r.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL));if("number"==typeof n&&n>=0){const{allLeafChildren:e}=this.rootNode,t=e.length;let i=n;if(this.gos.get("treeData")&&n>0&&t>0)for(let r=0;r<t;r++)if((null==(s=e[r])?void 0:s.rowIndex)==n-1){i=r+1;break}const r=e.slice(0,i),a=e.slice(i,e.length);this.rootNode.allLeafChildren=[...r,...o,...a]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=o}executeRemove(e,t,i){const{remove:s}=e;if(ar.missingOrEmpty(s))return;const r={};s.forEach(e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),r[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(e=>!r[e.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(t,i,s){const{update:r}=t;ar.missingOrEmpty(r)||r.forEach(t=>{const r=this.lookupRowNode(t);r&&(r.updateData(t),!r.selectable&&r.isSelected()&&s.push(r),this.setMasterForRow(r,t,e.TOP_LEVEL,!1),i.update.push(r))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(t=>t.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new Ln(this.beans);s.group=!1,this.setMasterForRow(s,e,i,!0);const r=this.gos.get("suppressParentsInRowNodes");return t&&!r&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const t=this.columnModel.getRowGroupColumns(),s=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}};jh.TOP_LEVEL=0,jh.ROOT_NODE_ID="ROOT_NODE_ID";var Kh=jh,$h=class extends st{constructor(){super(...arguments),this.onRowHeightChanged_debounced=ar.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,lt.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,lt.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new Ln(this.beans),this.nodeManager=new Kh(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),r=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),n=new Set(["postSortRows","groupDisplayType","accentedSort"]),o=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...e,...t,...i,...s,...s,...r,...n,...o,...a];this.addManagedPropertyListeners(l,l=>{var c;const h=null==(c=l.changeSet)?void 0:c.properties;if(!h)return;const d=e=>h.some(t=>e.has(t));d(e)?this.setRowData(this.rootNode.allLeafChildren.map(e=>e.data)):d(t)?this.refreshModel({step:"group"}):d(i)?this.refreshModel({step:"filter"}):d(s)?this.refreshModel({step:"pivot"}):d(r)?this.refreshModel({step:"aggregate"}):d(n)?this.refreshModel({step:"sort"}):d(o)?this.refreshModel({step:"filter_aggregates"}):d(a)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let r,n=!1;do{r=!1;const o=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(o,i),c=Math.min(a,s);for(let e=l;e<=c;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),r=!0,n=!0}}r&&this.setRowTopAndRowIndex()}while(r);return n}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let r=0;r<this.rowsToDisplay.length;r++){const n=this.rowsToDisplay[r];if(null!=n.id&&i.add(n.id),null==n.rowHeight){const t=this.gos.getRowHeightForNode(n,s,e);n.setRowHeight(t.height,t.estimated)}n.setRowTop(t),n.setRowIndex(r),t+=n.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},r=e=>{if(s(e),s(e.detailNode),s(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(r)}};r(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),r=this.getRow(s),n=!this.gos.get("suppressAnimationFrame");return r!==e[0]&&(e.forEach(e=>{ar.removeFromArray(this.rootNode.allLeafChildren,e)}),e.forEach((e,t)=>{ar.insertIntoArray(this.rootNode.allLeafChildren,e,Math.max(s+i,0)+t)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:n}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const r=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(r),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=this.rootNode.childrenAfterSort[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(e){if(ar.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some(e=>e.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=ar.missingOrEmpty(e),i=new Fl(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter(e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0);return null==t||0==t.length}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(ar.exists(e)&&(t=i[e]),!ar.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")};console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`)}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const r={type:lt.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(r)}isEmpty(){const e=ar.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return ar.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return ar.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,s=!1;const r=[],n=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(o=>{if(!s)if(i&&(o===t||o===e)&&(s=!0,o.group&&n))r.push(...o.allLeafChildren);else{if(!i){if(o!==t&&o!==e)return;i=!0}(!o.group||!n)&&r.push(o)}}),r}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(ar.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let s=-1,r=-1;for(;;){const n=Math.floor((t+i)/2),o=this.rowsToDisplay[n];if(this.isRowInPixel(o,e))return n;if(o.rowTop<e?t=n+1:o.rowTop>e&&(i=n-1),s===t&&r===i)return n;s=t,r=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:r}=e;let{index:n}=e;const o=e=>{var s;const o=null==(s=t[0])?void 0:s.parent;if(!o)return;const a=r&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),c=r&&l({node:o});o===this.rootNode?a===e&&(o.createFooter(),i(o.sibling,n++)):c===e&&(o.createFooter(),i(o.sibling,n++))};o("top");for(let e=0;e<t.length;e++){const o=t[e];if(i(o,n++),o.hasChildren()&&!o.footer){let e=null;switch(s){case 0:e=o.childrenAfterGroup;break;case 1:e=o.childrenAfterAggFilter;break;case 2:e=o.childrenAfterSort;break;case 3:e=o.leafGroup?null:o.childrenAfterSort}e&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:s,index:n,includeFooterNodes:r}))}}return o("bottom"),n}doAggregate(e){var t;null==(t=this.aggregationStage)||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=r=>{r&&r.forEach(r=>{const n=()=>{r.expanded=e,s(r.childrenAfterGroup)};t?ar.exists(r.childrenAfterGroup)&&n():i?!r.leafGroup&&n():r.group&&n()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const r=e?"expandAll":"collapseAll",n={type:lt.EVENT_EXPAND_COLLAPSE_ALL,source:r};this.eventService.dispatchEvent(n)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:lt.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:lt.EVENT_ROW_COUNT_READY}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;null==(t=this.pivotStage)||t.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(Ln.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:lt.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const r=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(r),s.callback&&e.push(s.callback.bind(null,r)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),t.length>0){const e={type:lt.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++)e[this.rootNode.allLeafChildren[t].id]=t;return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const r={type:lt.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(r),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};g([he("columnModel")],$h.prototype,"columnModel",2),g([he("selectionService")],$h.prototype,"selectionService",2),g([he("valueCache")],$h.prototype,"valueCache",2),g([he("beans")],$h.prototype,"beans",2),g([he("filterStage")],$h.prototype,"filterStage",2),g([he("sortStage")],$h.prototype,"sortStage",2),g([he("flattenStage")],$h.prototype,"flattenStage",2),g([de("groupStage")],$h.prototype,"groupStage",2),g([de("aggregationStage")],$h.prototype,"aggregationStage",2),g([de("pivotStage")],$h.prototype,"pivotStage",2),g([de("filterAggregatesStage")],$h.prototype,"filterAggregatesStage",2),g([ae],$h.prototype,"init",1),$h=g([ce("rowModel")],$h);var Yh=class extends st{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};g([he("filterService")],Yh.prototype,"filterService",2),Yh=g([ce("filterStage")],Yh);var qh=class extends st{execute(e){const t=this.sortController.getSortOptions(),i=ar.exists(t)&&t.length>0,s=i&&ar.exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),r=t.some(e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,r)}};g([he("sortService")],qh.prototype,"sortService",2),g([he("sortController")],qh.prototype,"sortController",2),qh=g([ce("sortStage")],qh);var Xh=class extends st{execute(e){const t=e.rowNode,i=[],s=this.beans.columnModel.isPivotMode(),r=s&&t.leafGroup,n=r?[t]:t.childrenAfterSort,o=this.getFlattenDetails();if(this.recursivelyAddToRowsToDisplay(o,n,i,s,0),!r&&i.length>0&&o.grandTotalRow){t.createFooter();const e="top"===o.grandTotalRow;this.addRowNodeToRowsToDisplay(o,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,r){if(!ar.missingOrEmpty(t))for(let n=0;n<t.length;n++){const o=t[n],a=o.hasChildren(),l=s&&!a,c=e.groupRemoveSingleChildren&&a&&1===o.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&a&&o.leafGroup&&1===o.childrenAfterGroup.length,d=s&&o.leafGroup,u=e.hideOpenParents&&o.expanded&&!o.master&&!d;if(!(l||u||c||h)&&this.addRowNodeToRowsToDisplay(e,o,i,r),!s||!o.leafGroup)if(a){const t=c||h;if(o.expanded||t){const n=e.groupTotalRow({node:o});n||o.destroyFooter();const a=t?r:r+1;"top"===n&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a)),this.recursivelyAddToRowsToDisplay(e,o.childrenAfterSort,i,s,a),"bottom"===n&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a))}}else if(o.master&&o.expanded){const t=this.createDetailNode(o);this.addRowNodeToRowsToDisplay(e,t,i,r)}}}addRowNodeToRowsToDisplay(e,t,i,s,r){r?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(ar.exists(e.detailNode))return e.detailNode;const t=new Ln(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,ar.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};g([he("beans")],Xh.prototype,"beans",2),Xh=g([ce("flattenStage")],Xh);var Zh=class extends st{sort(e,t,i,s,r,n){const o=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(e=>e.isRowGroupActive());let l={};i&&s&&(l=this.calculateDirtyNodes(s));const c=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows");r&&r.forEachChangedNodeDepthFirst(s=>{var d;this.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter,!0);const u=c&&s.leafGroup;if(o&&a&&!s.leafGroup&&!n){const e=null==(d=this.columnModel.getRowGroupColumns())?void 0:d[s.level+1],t=null===(null==e?void 0:e.getSort()),i=s.childrenAfterAggFilter.slice(0);if(s.childrenAfterSort&&!t){const e={};s.childrenAfterSort.forEach((t,i)=>{e[t.id]=i}),i.sort((t,i)=>{var s,r;return(null!=(s=e[t.id])?s:0)-(null!=(r=e[i.id])?r:0)})}s.childrenAfterSort=i}else s.childrenAfterSort=!t||u?s.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(s,l,r,e):this.rowNodeSorter.doFullSort(s.childrenAfterAggFilter,e);if(s.sibling&&(s.sibling.childrenAfterSort=s.childrenAfterSort),this.updateChildIndexes(s),h){const e={nodes:s.childrenAfterSort};h(e)}}),this.updateGroupDataForHideOpenParents(r)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach(e=>t[e.id]=!0)};return e&&e.forEach(e=>{i(e.add),i(e.update),i(e.remove)}),t}doDeltaSort(e,t,i,s){const r=e.childrenAfterAggFilter,n=e.childrenAfterSort;if(!n)return this.rowNodeSorter.doFullSort(r,s);const o={},a=[];r.forEach(e=>{t[e.id]||!i.canSkip(e)?a.push(e):o[e.id]=!0});const l=n.filter(e=>o[e.id]),c=(e,t)=>({currentPos:t,rowNode:e}),h=a.map(c).sort((e,t)=>this.rowNodeSorter.compareRowNodes(s,e,t));return this.mergeSortedArrays(s,h,l.map(c)).map(({rowNode:e})=>e)}mergeSortedArrays(e,t,i){const s=[];let r=0,n=0;for(;r<t.length&&n<i.length;)this.rowNodeSorter.compareRowNodes(e,t[r],i[n])<0?s.push(t[r++]):s.push(i[n++]);for(;r<t.length;)s.push(t[r++]);for(;n<i.length;)s.push(i[n++]);return s}updateChildIndexes(e){if(ar.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],r=0===i,n=i===e.childrenAfterSort.length-1;s.setFirstChild(r),s.setLastChild(n),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return ar.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach(e=>{e.hasChildren()&&t(e)})};e&&e.executeFromRootNode(e=>t(e))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!ar.missing(e)&&e.forEach(e=>{this.columnModel.getGroupDisplayColumns().forEach(i=>{const s=i.getColDef().showRowGroup;if("string"!=typeof s)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const r=s,n=this.columnModel.getPrimaryColumn(r);if(n!==e.rowGroupColumn)if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(n);t&&e.setGroupValue(i.getId(),t.key)}})})}};g([he("columnModel")],Zh.prototype,"columnModel",2),g([he("rowNodeSorter")],Zh.prototype,"rowNodeSorter",2),Zh=g([ce("sortService")],Zh);var Qh=class extends st{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let r=0;r<t.childrenAfterGroup.length;r++){const n=t.childrenAfterGroup[r],o=s||this.filterManager.doesRowPassFilter({rowNode:n});n.childrenAfterGroup?e(t.childrenAfterGroup[r],o):i(n,o)}i(t,s)},s=t=>e(t,!1);t.executeFromRootNode(s)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};g([he("filterManager")],Qh.prototype,"filterManager",2),Qh=g([ce("filterService")],Qh);var Jh=class extends st{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(ar.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gos.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return ar.exists(e)&&e.forEach((e,n)=>{const o=t({data:e,level:0}),a=s[o];r&&(r[o]=n),a?(a.data!==e&&i.update.push(e),s[o]=void 0):i.add.push(e)}),ar.iterateObject(s,(e,t)=>{t&&i.remove.push(t.data)}),[i,r]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}};g([he("rowModel")],Jh.prototype,"rowModel",2),g([he("rowRenderer")],Jh.prototype,"rowRenderer",2),g([he("selectionService")],Jh.prototype,"selectionService",2),g([ae],Jh.prototype,"postConstruct",1);var ed={version:"31.3.4",moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[$h,Yh,qh,Xh,Zh,Qh,Jh=g([ce("immutableService")],Jh)]},td=Object.defineProperty,id=Object.getOwnPropertyDescriptor,sd=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?id(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&td(t,i,n),n},rd=class extends Bl{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){ar.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();ar.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,r)=>{this.startRow+r<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new Ln(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((t,i)=>{const s=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&s&&(this.rowNodes[i]=new Ln(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],s,this.startRow+i)});const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}};sd([he("beans")],rd.prototype,"beans",2),sd([ae],rd.prototype,"postConstruct",1),sd([le],rd.prototype,"destroyRowNodes",1);var nd,od=class e extends st{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new rd(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach(e=>e.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(t){const i=this.getBlocksInOrder().filter(e=>e!=t);i.sort((e,t)=>t.getLastAccessed()-e.getLastAccessed());const s=this.params.maxBlocksInCache>0,r=s?this.params.maxBlocksInCache-1:null,n=e.MAX_EMPTY_BLOCKS_TO_KEEP-1;i.forEach((e,t)=>{if(e.getState()===rd.STATE_WAITING_TO_LOAD&&t>=n||s&&t>=r){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,ar.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new lr;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){return ar.getAllValuesInObject(this.blocks).sort((e,t)=>e.getId()-t.getId())}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:lt.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(e=>this.destroyBlock(e))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,r=!1;const n=new lr;ar.missing(e)&&(r=!0);let o=!1;return this.getBlocksInOrder().forEach(a=>{o||(r&&s+1!==a.getId()?o=!0:(s=a.getId(),a.forEachNode(s=>{const n=s===e||s===t;(r||n)&&i.push(s),n&&(r=!r)},n,this.rowCount)))}),o||r?[]:i}};od.MAX_EMPTY_BLOCKS_TO_KEEP=2,sd([he("rowRenderer")],od.prototype,"rowRenderer",2),sd([he("focusService")],od.prototype,"focusService",2),sd([(nd=pe("loggerFactory"),(e,t)=>nd(e,t,0))],od.prototype,"setBeans",1),sd([le],od.prototype,"destroyAllBlocks",1);var ad=od,ld=class extends st{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&ar.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,lt.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,lt.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!ar.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){this.datasource&&(null!=this.gos.getCallback("getRowId")||this.selectionService.reset("rowDataChanged"),this.resetCache())}createModelUpdatedEvent(){return{type:lt.EVENT_MODEL_UPDATED,newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new lr},this.infiniteCache=this.createBean(new ad(this.cacheParams)),this.eventService.dispatchEventOnce({type:lt.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};sd([he("filterManager")],ld.prototype,"filterManager",2),sd([he("sortController")],ld.prototype,"sortController",2),sd([he("selectionService")],ld.prototype,"selectionService",2),sd([he("rowRenderer")],ld.prototype,"rowRenderer",2),sd([he("rowNodeBlockLoader")],ld.prototype,"rowNodeBlockLoader",2),sd([ae],ld.prototype,"init",1),sd([le],ld.prototype,"destroyDatasource",1);var cd={version:"31.3.4",moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[ld=sd([ce("rowModel")],ld)]},hd=Object.defineProperty,dd=Object.defineProperties,ud=Object.getOwnPropertyDescriptor,pd=Object.getOwnPropertyDescriptors,gd=Object.getOwnPropertySymbols,md=Object.prototype.hasOwnProperty,fd=Object.prototype.propertyIsEnumerable,yd=(e,t,i)=>t in e?hd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,vd=(e,t)=>{for(var i in t||(t={}))md.call(t,i)&&yd(e,i,t[i]);if(gd)for(var i of gd(t))fd.call(t,i)&&yd(e,i,t[i]);return e},Cd=(e,t)=>dd(e,pd(t)),bd=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?ud(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&hd(t,i,n),n},Sd=(e,t,i)=>new Promise((s,r)=>{var n=e=>{try{a(i.next(e))}catch(e){r(e)}},o=e=>{try{a(i.throw(e))}catch(e){r(e)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);a((i=i.apply(e,t)).next())}),wd=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},xd=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gos:s,processCellCallback:r,processHeaderCallback:n,processGroupHeaderCallback:o,processRowGroupCallback:a}=e;this.columnModel=t,this.valueService=i,this.gos=s,this.processCellCallback=r,this.processHeaderCallback=n,this.processGroupHeaderCallback=o,this.processRowGroupCallback=a}prepare(e){this.groupColumns=e.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""}extractRowCellValue(e,t,i,s,r){const n=this.gos.get("groupHideOpenParents")&&!r.footer||!this.shouldRenderGroupSummaryCell(r,e,t)?this.valueService.getValue(e,r):this.createValueForGroupNode(e,r);return this.processCell({accumulatedRowIndex:i,rowNode:r,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var s;if(!e||!e.group)return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null==(s=e.groupData)?void 0:s[t.getId()]))return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const r=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&r}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),r=t=>{var r,n;if(i||s)return t.key;const o=null==(r=t.groupData)?void 0:r[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(n=this.valueService.formatValue(t.rowGroupColumn,t,o))?n:o},n=t.footer,o=[r(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,o.push(r(t));const a=o.reverse().join(" -> ");return n?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:s,column:r,value:n,processCellCallback:o,type:a}=e;return o?{value:null!=(t=o(this.gos.addGridCommonParams({accumulatedRowIndex:i,column:r,node:s,value:n,type:a,parseValue:e=>this.valueService.parseValue(r,s,e,this.valueService.getValue(r,s)),formatValue:e=>{var t;return null!=(t=this.valueService.formatValue(r,s,e))?t:e}})))?t:""}:!1!==r.getColDef().useValueFormatterForExport?{value:null!=n?n:"",valueFormatted:this.valueService.formatValue(r,s,n)}:{value:null!=n?n:""}}},Ed=class{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const s=document.createElement("a"),r=i.URL.createObjectURL(t);s.setAttribute("href",r),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(r)},0)}},Md=class extends xd{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var s;0!=t&&(this.result+=this.columnSeparator);const r=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!=(s=r.valueFormatted)?s:r.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},Ad=class extends wd{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"}),r="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;Ed.download(this.getFileName(r),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:s}=this,{processCellCallback:r,processHeaderCallback:n,processGroupHeaderCallback:o,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:c}=e;return new Md({columnModel:t,valueService:i,gos:s,processCellCallback:r||void 0,processHeaderCallback:n||void 0,processGroupHeaderCallback:o||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};bd([he("columnModel")],Ad.prototype,"columnModel",2),bd([he("valueService")],Ad.prototype,"valueService",2),bd([he("gridSerializer")],Ad.prototype,"gridSerializer",2),bd([he("gridOptionsService")],Ad.prototype,"gos",2),bd([ae],Ad.prototype,"postConstruct",1),Ad=bd([ce("csvCreator")],Ad);var Td=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(Td||{}),Dd=class extends st{serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:r}=t,n=this.getColumnsToExport(i,r,s);return ar.compose(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const r=t.shouldRowBeSkipped||(()=>!1),n=this.gos.get("groupRemoveSingleChildren"),o=this.gos.get("groupRemoveLowestSingleChildren"),a=null!=t.rowPositions||!!t.onlySelected,l=this.gos.get("groupHideOpenParents")&&!a,c=this.columnModel.isPivotMode()?s.leafGroup:!s.group,h=!!s.footer,d=(t.skipRowGroups,o&&s.leafGroup),u=1===s.allChildrenCount&&(n||d);if(!c&&!h&&(t.skipRowGroups||u||l)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned)return;if(-1===s.level&&!c&&!h)return;if(r(this.gos.addGridCommonParams({node:s})))return;const p=e.onNewBodyRow(s);if(i.forEach((e,t)=>{p.onColumn(e,t,s)}),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new ht,r=this.displayedGroupCreator.createDisplayedGroups(t,s,null);this.recursivelyAddHeaderGroups(r,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach((t,i)=>{e.onColumn(t,i,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,r=s.getType(),n="clientSide"===r,o="serverSide"===r,a=!n&&e.onlySelected,l=this.processRow.bind(this,i,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>s.getRow(e.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(l,!0):o?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);else if(e.onlySelectedAllPages||a){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(l)}else"all"===c?s.forEachNode(l):n||o?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,s)=>{var r,n,o,a;return null!=e.rowIndex&&null!=s.rowIndex?e.rowIndex-s.rowIndex:e.level===s.level?(null==(r=e.parent)?void 0:r.id)===(null==(n=s.parent)?void 0:n.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:null!=(o=e.rowIndex)?o:-1},{rowNode:s,currentPos:null!=(a=s.rowIndex)?a:-1}):i(e.parent,s.parent):e.level>s.level?i(e.parent,s):i(e,s.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getGridColumns(i);const r=this.gos.get("treeData");let n=[];return n=e&&!s?this.columnModel.getAllGridColumns():this.columnModel.getAllDisplayedColumns(),t&&!r&&(n=n.filter(e=>e.getColId()!==dt)),n}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(e=>{const t=e;t.getChildren&&t.getChildren().forEach(e=>s.push(e))}),e.length>0&&e[0]instanceof at&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let r=0;t.forEach(e=>{const t=e;let n;n=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnModel.getDisplayNameForColumnGroup(t,"header");const o=t.getLeafColumns().reduce((e,t,i,s)=>{let r=ar.last(e);return"open"===t.getColumnGroupShow()?r&&null==r[1]||(r=[i],e.push(r)):r&&null==r[1]&&(r[1]=i-1),i===s.length-1&&r&&null==r[1]&&(r[1]=i),e},[]);s.onColumn(t,n||"",r++,t.getLeafColumns().length-1,o)})}};bd([he("displayedGroupCreator")],Dd.prototype,"displayedGroupCreator",2),bd([he("columnModel")],Dd.prototype,"columnModel",2),bd([he("rowModel")],Dd.prototype,"rowModel",2),bd([he("pinnedRowModel")],Dd.prototype,"pinnedRowModel",2),bd([he("selectionService")],Dd.prototype,"selectionService",2),bd([he("rowNodeSorter")],Dd.prototype,"rowNodeSorter",2),bd([he("sortController")],Dd.prototype,"sortController",2),Dd=bd([ce("gridSerializer")],Dd);var Id={version:"31.3.4",moduleName:"@ag-grid-community/csv-export",beans:[Ad,Dd]},Rd="\r\n",Pd=class{static createHeader(e={}){const t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),`<?xml ${t.map(t=>`${t}="${e[t]}"`).join(" ")} ?>`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(e=>{Object.keys(e.map).forEach(s=>{i+=this.returnAttributeIfPopulated(e.prefix+s,e.map[s],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(s=>{i+=this.returnAttributeIfPopulated(s,e.properties.rawMap[s],t)}));let s="<"+e.name+i;return e.children||null!=e.textNode?null!=e.textNode?s+">"+e.textNode+"</"+e.name+">"+Rd:(s+=">\r\n",e.children&&e.children.forEach(e=>{s+=this.createXml(e,t)}),s+"</"+e.name+">"+Rd):s+"/>"+Rd}static returnAttributeIfPopulated(e,t,i){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&i&&(s=i(t)),` ${e}="${s}"`}};function kd(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}var Ld=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,i=0,s=0,r=0;for(let n=0;n<e.length;n++)i=e[n],s=255&(t^i),r=Nd[s],t=t>>>8^r;return-1^t})("string"==typeof e?(new TextEncoder).encode(e):e):0,Nd=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),{utf8_encode:_d}=ar,Od=(e,t)=>Sd(void 0,null,function*(){const{content:i}=e,{size:s,content:r}=i?Bd(i):{size:0,content:Uint8Array.from([])};let n,o,a=!1;if("file"===e.type&&r&&s>0){const e=yield(e=>Sd(void 0,null,function*(){const t=new Blob([e]),{size:i,content:s}=yield(r=t,Sd(void 0,null,function*(){let e=0;const t=[],i=new WritableStream({write:i=>{t.push(i),e+=i.length}}),s=new ReadableStream({start:e=>{const t=new FileReader;t.onload=t=>{var i;(null==(i=t.target)?void 0:i.result)&&e.enqueue(t.target.result),e.close()},t.readAsArrayBuffer(r)}}),n=new window.CompressionStream("deflate-raw");return yield s.pipeThrough(n).pipeTo(i),{size:e,content:new Blob(t)}}));var r;return{size:i,content:new Uint8Array(yield s.arrayBuffer())}}))(r);n=e.content,o=e.size,a=!0}const l=Gd(e,a,t,s,r,o);return Cd(vd({},l),{content:n||r,isCompressed:a})}),Fd=(e,t)=>{const{content:i}=e,{content:s}=i?Bd(i):{content:Uint8Array.from([])},r=Gd(e,!1,t,s.length,s,void 0);return Cd(vd({},r),{content:s,isCompressed:!1})},Gd=(e,t,i,s,r,n)=>{const{content:o,path:a,created:l}=e,c=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),h=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),d=Ld(r),u=void 0!==n?n:s,p=_d(a),g=p!==a;let m="";if(g){const e=kd(1,1)+kd(Ld(p),4)+p;m="up"+kd(e.length,2)+e}const f="\0"+(g?"\0\b":"\0\0")+kd(t?8:0,2)+kd(c,2)+kd(h,2)+kd(u?d:0,4)+kd(null!=n?n:s,4)+kd(s,4)+kd(p.length,2)+kd(m.length,2),y="PK"+f+p+m,v="PK\0"+f+"\0\0\0\0\0\0"+(o?"\0\0\0\0":"\0\0\0")+kd(i,4)+p+m;return{localFileHeader:Uint8Array.from(y,e=>e.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,e=>e.charCodeAt(0))}},Bd=e=>{let t;return t="string"==typeof e?(e=>{const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t})(atob(e.split(";base64,")[1])):e,{size:t.length,content:t}},Vd=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static getZipFile(e="application/zip"){return Sd(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),i=new Uint8Array(0),s=0,r=0;for(const n of e){const{localFileHeader:e,centralDirectoryHeader:o,content:a}=n,l=new Uint8Array(t.length+e.length);l.set(t),l.set(e,t.length),t=l;const c=new Uint8Array(t.length+a.length);c.set(t),c.set(a,t.length),t=c;const h=new Uint8Array(i.length+o.length);h.set(i),h.set(o,i.length),i=h,s+=e.length+a.length,r+=o.length}const n=((e,t,i)=>{const s="PK\0\0\0\0"+kd(e,2)+kd(e,2)+kd(t,4)+kd(i,4)+"\0\0";return Uint8Array.from(s,e=>e.charCodeAt(0))})(e.length,r,s),o=new Uint8Array(t.length+i.length+n.length);return o.set(t),o.set(i,t.length),o.set(n,t.length+i.length),o}static buildCompressedFileStream(){return Sd(this,null,function*(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=yield Od(s,i),{localFileHeader:r,content:n}=e;t.push(e),i+=r.length+n.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=Fd(s,i),{localFileHeader:r,content:n}=e;t.push(e),i+=r.length+n.length}return this.packageFiles(t)}};Vd.folders=[],Vd.files=[],re.__registerModules([ed,cd,Id],!1,void 0)},28621(e,t,i){"use strict";i.d(t,{hFV:()=>pf});var s={};i.r(s),i.d(s,{AgChart:()=>Tm,AgCharts:()=>Am,AgErrorBarSupportedSeriesTypes:()=>A,AgTooltipPositionType:()=>T,Marker:()=>yd,VERSION:()=>Rm,_ModuleSupport:()=>Wm,_Scale:()=>Hm,_Scene:()=>Pm,_Theme:()=>Bm,_Util:()=>Um,__FORCE_MODULE_DETECTION:()=>D,time:()=>I});var r=i(54989),n=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=Reflect.get,g=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),m=Math.pow,f=(e,t,i)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))d.call(t,i)&&f(e,i,t[i]);if(c)for(var i of c(t))u.call(t,i)&&f(e,i,t[i]);return e},v=(e,t)=>o(e,l(t)),C=(e,t)=>{var i={};for(var s in e)d.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&c)for(var s of c(e))t.indexOf(s)<0&&u.call(e,s)&&(i[s]=e[s]);return i},b=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,s)=>{for(var r,o=s>1?void 0:s?a(t,i):t,l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s?r(t,i,o):r(o))||o);return s&&o&&n(t,i,o),o},w=(e,t,i)=>p(h(e),i,t),x=(e,t,i)=>new Promise((s,r)=>{var n=e=>{try{a(i.next(e))}catch(e){r(e)}},o=e=>{try{a(i.throw(e))}catch(e){r(e)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);a((i=i.apply(e,t)).next())}),E=function(e,t){this[0]=e,this[1]=t},M=e=>{var t,i=e[g("asyncIterator")],s=!1,r={};return null==i?(i=e[g("iterator")](),t=e=>r[e]=t=>i[e](t)):(i=i.call(e),t=e=>r[e]=t=>{if(s){if(s=!1,"throw"===e)throw t;return t}return s=!0,{done:!1,value:new E(new Promise(s=>{var r=i[e](t);if(!(r instanceof Object))throw TypeError("Object expected");s(r)}),1)}}),r[g("iterator")]=()=>r,t("next"),"throw"in i?t("throw"):r.throw=e=>{throw e},"return"in i&&t("return"),r},A=["bar","line","scatter"],T=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(T||{}),D=0,I={};b(I,{day:()=>te,friday:()=>ce,hour:()=>J,millisecond:()=>G,minute:()=>X,monday:()=>ne,month:()=>ue,saturday:()=>he,second:()=>$,sunday:()=>re,thursday:()=>le,tuesday:()=>oe,utcDay:()=>ve,utcHour:()=>ye,utcMinute:()=>fe,utcMonth:()=>Ce,utcYear:()=>be,wednesday:()=>ae,year:()=>ge});var R=new Map;function P(e,t){R.has(t)||(R.set(t,!0),e())}function k(e){return e}function*L(...e){for(const t of e)yield*M(t)}function N(e,t=0,i){const{leading:s=!0,trailing:r=!0}=null!=i?i:{};let n,o,a=!1;function l(){r&&o?(n=setTimeout(l,t),e(...o)):a=!1,o=null}return Object.assign(function(...i){a?o=i:(a=!0,n=setTimeout(l,t),s?e(...i):o=i)},{cancel(){clearTimeout(n),a=!1,o=null}})}P.clear=()=>R.clear();var _={log(...e){console.log(...e)},warn(e,...t){console.warn(`AG Charts - ${e}`,...t)},error(e,...t){"object"==typeof e?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)},table(...e){console.table(...e)},warnOnce(e,...t){P(()=>_.warn(e,...t),`Logger.warn: ${e}`)},errorOnce(e,...t){P(()=>_.error(e,...t),`Logger.error: ${e}`)}},O=class{constructor(e,t,i){this._encode=e,this._decode=t,this._rangeCallback=i}floor(e){const t=new Date(e),i=this._encode(t);return this._decode(i)}ceil(e){const t=new Date(Number(e)-1),i=this._encode(t);return this._decode(i+1)}range(e,t,i){var s;const r=null==(s=this._rangeCallback)?void 0:s.call(this,e,t),n=this._encode(i?this.floor(e):this.ceil(e)),o=this._encode(i?this.ceil(t):this.floor(t));if(o<n)return[];const a=[];for(let e=n;e<=o;e++){const t=this._decode(e);a.push(t)}return null==r||r(),a}},F=class extends O{getOffset(e,t){const i="number"==typeof e||e instanceof Date?this._encode(new Date(e)):0;return Math.floor(i)%t}every(e,t){let i,s=0;const r=e;r!==(e=Math.max(1,Math.round(e)))&&_.warnOnce(`interval step of [${r}] rounded to [${e}].`);const{snapTo:n="start"}=null!=t?t:{};if("string"==typeof n){const t=s;i=(i,r)=>{const o="start"===n?i:r;return s=this.getOffset(o,e),()=>s=t}}else"number"==typeof n?s=this.getOffset(new Date(n),e):n instanceof Date&&(s=this.getOffset(n,e));return new O(t=>{const i=this._encode(t);return Math.floor((i-s)/e)},t=>this._decode(t*e+s),i)}},G=new F(function(e){return e.getTime()},function(e){return new Date(e)}),B=G,V=(new Date(0).getFullYear(),1e3),H=6e4,U=36e5,z=864e5,W=6048e5,j=31536e6,K=(new Date).getTimezoneOffset()*H,$=new F(function(e){return Math.floor((e.getTime()-K)/V)},function(e){return new Date(K+e*V)}),Y=$,q=(new Date).getTimezoneOffset()*H,X=new F(function(e){return Math.floor((e.getTime()-q)/H)},function(e){return new Date(q+e*H)}),Z=X,Q=(new Date).getTimezoneOffset()*H,J=new F(function(e){return Math.floor((e.getTime()-Q)/U)},function(e){return new Date(Q+e*U)}),ee=J,te=new F(function(e){const t=e.getTimezoneOffset()*H;return Math.floor((e.getTime()-t)/z)},function(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}),ie=te;function se(e){const t=(7+e-4)%7;return new F(function(e){const i=e.getTimezoneOffset()*H;return Math.floor((e.getTime()-i)/W-t/7)},function(e){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*e+t),i})}var re=se(0),ne=se(1),oe=se(2),ae=se(3),le=se(4),ce=se(5),he=se(6),de=re,ue=new F(function(e){return 12*e.getFullYear()+e.getMonth()},function(e){const t=Math.floor(e/12);return new Date(t,e-12*t,1)}),pe=ue,ge=new F(function(e){return e.getFullYear()},function(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}),me=ge,fe=new F(function(e){return Math.floor(e.getTime()/H)},function(e){return new Date(e*H)}),ye=new F(function(e){return Math.floor(e.getTime()/U)},function(e){return new Date(e*U)}),ve=new F(function(e){return Math.floor(e.getTime()/z)},function(e){const t=new Date(0);return t.setUTCDate(t.getUTCDate()+e),t.setUTCHours(0,0,0,0),t}),Ce=new F(function(e){return 12*e.getUTCFullYear()+e.getUTCMonth()},function(e){const t=Math.floor(e/12),i=e-12*t;return new Date(Date.UTC(t,i,1))}),be=new F(function(e){return e.getUTCFullYear()},function(e){const t=new Date;return t.setUTCFullYear(e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t}),Se={isEnterprise:!1},we=class{constructor(){this.destroyFns=[]}destroy(){for(const e of this.destroyFns)e()}},xe=new class{constructor(){this.modules=[],this.dependencies=new Set,this.dependents=new Set}register(...e){for(const t of e){this.registerDependencies(t);const e=this.modules.find(e=>t.type===e.type&&t.optionsKey===e.optionsKey&&t.identifier===e.identifier);if(e){if("enterprise"===t.packageType&&"community"===e.packageType){const i=this.modules.indexOf(e);this.modules.splice(i,1,t)}}else this.modules.push(t)}}hasEnterpriseModules(){return this.modules.some(e=>"enterprise"===e.packageType)}*byType(...e){for(const t of this.modules)e.includes(t.type)&&this.dependencies.has(t.optionsKey)&&(yield t);for(const t of this.modules)!e.includes(t.type)||this.dependencies.has(t.optionsKey)||this.dependents.has(t.optionsKey)||(yield t);for(const t of this.modules)e.includes(t.type)&&this.dependents.has(t.optionsKey)&&(yield t)}registerDependencies(e){if(null!=e.dependencies&&0!==e.dependencies.length){if(this.dependencies.has(e.optionsKey))throw new Error(`Module [${e.optionsKey}] can not both be depended upon by any module and have dependencies of [${e.dependencies}].`);for(const t of e.dependencies){if(this.dependents.has(t))throw new Error(`Module [${t}] can not both be depended upon by any module and have dependencies of [${e.optionsKey}].`);this.dependencies.add(t)}this.dependents.add(e.optionsKey)}}},Ee=new class{constructor(){this.axesMap=new Map,this.hidden=new Set,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.instanceConstructor),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate),t.hidden&&this.hidden.add(e)}create(e,t){const i=this.axesMap.get(e);if(i)return new i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}publicKeys(){return[...this.keys()].filter(e=>!this.hidden.has(e))}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},Me=Symbol("BREAK"),Ae="__decorator_config";function Te(e,t){null==Object.getOwnPropertyDescriptor(e,Ae)&&Object.defineProperty(e,Ae,{value:{}});const i=e[Ae],s=t.toString();if(void 0!==i[s])return i[s];const r=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:r};const n=Object.getOwnPropertyDescriptor(e,t),o=null==n?void 0:n.set,a=null==n?void 0:n.get;return Object.defineProperty(e,t,{set:function(e){const{setters:n,observers:l}=i[s];let c;n.some(e=>e.length>2)&&(c=a?a.call(this):r.get(this));for(const i of n)if((e=i(this,t,e,c))===Me)return;o?o.call(this,e):r.set(this,e);for(const t of l)t(this,e,c)},get:function(){let e=a?a.call(this):r.get(this);for(const r of i[s].getters)if(e=r(this,t,e),e===Me)return;return e},enumerable:!0,configurable:!1}),i[s]}function De(e,t,i){return(s,r)=>{const n=Te(s,r);n.setters.push(e),t&&n.getters.unshift(t),i&&Object.assign(n,i)}}function Ie(e){return void 0!==e&&Ae in e}function Re(e){const t=new Set;for(;Ie(e);)t.add(null==e?void 0:e[Ae]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(e=>Object.keys(e))}function Pe(e){return Re(e).reduce((t,i)=>{var s;return t[i]=null!=(s=e[i])?s:null,t},{})}function ke(e){return null!=e}function Le(e){return Array.isArray(e)}function Ne(e){return"boolean"==typeof e}function _e(e){return e instanceof Date}function Oe(e){return _e(e)&&!isNaN(Number(e))}function Fe(e){return e instanceof RegExp}function Ge(e){return"function"==typeof e}function Be(e){return"object"==typeof e&&null!==e&&!Le(e)}function Ve(e){return Le(e)||He(e)}function He(e){return"object"==typeof e&&null!==e&&e.constructor===Object}function Ue(e){return"string"==typeof e}function ze(e){return"number"==typeof e}function We(e){return ze(e)&&Number.isFinite(e)}function je(e){return"undefined"!=typeof window&&e instanceof HTMLElement}function Ke(e,t){return Ue(t)&&Object.keys(e).includes(t)}function $e(e,t){return Object.values(e).includes(t)}function Ye(e){return"symbol"==typeof e}function qe(...e){return Xe(...e.reverse())}function Xe(...e){const t={};for(const i of e){if(!Be(i))continue;const e=Ie(i)?Re(i):Object.keys(i);for(const s of e)He(t[s])&&He(i[s])?t[s]=Xe(t[s],i[s]):null!=t[s]||(t[s]=i[s])}return t}function Ze(e,...t){return t&&Le(e)?e.map(e=>Xe(e,...t)):e}function Qe(e,t){return Object.entries(e).reduce((i,[s,r])=>(i[s]=t(r,s,e),i),{})}function Je(e,t){const i=y({},e);for(const e of t)delete i[e];return i}function et(e,t){return(Le(t)?t:t.split(".")).reduce((e,t)=>e[t],e)}var tt=new Set(["__proto__","constructor","prototype"]);function it(e,t,i){const s=Le(t)?t.slice():t.split("."),r=s.pop();s.some(e=>tt.has(e))||(s.reduce((e,t)=>e[t],e)[r]=i)}function st(e,t,i){if(void 0===i)return t;for(const s of e){const e=i[s];void 0!==e&&(t[s]=e)}return t}var rt=class extends Map{get(e){var t;return null!=(t=super.get(e))?t:"unknown"}isCartesian(e){return"cartesian"===this.get(e)}isPolar(e){return"polar"===this.get(e)}isHierarchy(e){return"hierarchy"===this.get(e)}isTopology(e){return"topology"===this.get(e)}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}},nt=class extends Map{set(e,t){return super.set(e,Xe(t,this.get(e)))}},ot=new rt,at=new rt,lt=new nt,ct=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology"],optionsInnerKey:"image"},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"],optionsInnerKey:"miniChart"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bullet"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"}];function ht(e){var t;return null==(t=ct.find(t=>"series"===t.type&&t.identifier===e))?void 0:t.chartTypes}function dt(e){if(!function(e){return"enterprise"===e.packageType}(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=ct.find(t=>t.type===e.type&&t.optionsKey===e.optionsKey&&t.identifier===e.identifier&&e.chartTypes.every(e=>t.chartTypes.includes(e)));return t&&(null!=t.useCount||(t.useCount=0),t.useCount++),null!=t}function ut(e){var t,i,s;return null!=(s=null==(i=null==(t=e.series)?void 0:t[0])?void 0:i.type)?s:"line"}function pt(e){const t=ut(e);return null==t||("cartesian"===t?(_.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):ot.isCartesian(t)||"cartesian"===(null==(i=ht(t))?void 0:i.find(e=>"cartesian"===e)));var i}function gt(e){const t=ut(e);return null!=t&&("polar"===t?(_.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):ot.isPolar(t)||"polar"===(null==(i=ht(t))?void 0:i.find(e=>"polar"===e)));var i}function mt(e){const t=ut(e);return null!=t&&("hierarchy"===t?(_.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):ot.isHierarchy(t)||"hierarchy"===(null==(i=ht(t))?void 0:i.find(e=>"hierarchy"===e)));var i}function ft(e){const t=ut(e);return null!=t&&("topology"===t?(_.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):ot.isTopology(t)||"topology"===(null==(i=ht(t))?void 0:i.find(e=>"topology"===e)));var i}function yt(e){return null!=e&&Ee.has(e)}var vt=class{set(e){const{className:t=this.constructor.name}=this.constructor;if("object"!=typeof e)return _.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const t of Re(this))if(i.has(t)){const s=e[t],r=this;bt(r[t])?r[t]=r[t]instanceof Ct?r[t].reset(s):r[t].set(s):r[t]=s,i.delete(t)}for(const e of i)_.warn(`unable to set [${e}] in ${t} - property is unknown`);return this}isValid(){return Re(this).every(e=>{const{optional:t}=function(e,t){const i=t.toString();for(;Ie(e);){const t=e[Ae];if(Object.hasOwn(t,i))return t[i];e=Object.getPrototypeOf(e)}}(this,e),i=t||void 0!==this[e];return i||_.warnOnce(`[${e}] is required.`),i})}toJson(){return Re(this).reduce((e,t)=>{const i=this[t];return e[t]=bt(i)?i.toJson():i,e},{})}},Ct=class e extends Array{constructor(e,...t){super(t.length),Object.defineProperty(this,"itemFactory",{value:e,enumerable:!1,configurable:!1}),this.set(t)}set(e){if(Le(e)){this.length=e.length;for(let t=0;t<e.length;t++)this[t]=(new this.itemFactory).set(e[t])}return this}reset(t){return new e(this.itemFactory,...t)}toJson(){return this.map(e=>{var t,i;return null!=(i=null==(t=null==e?void 0:e.toJson)?void 0:t.call(e))?i:e})}};function bt(e){return e instanceof vt||e instanceof Ct}var St="class-instance";function wt(e,t,i){if(Le(t)){if(!Le(e)||e.length!==t.length||t.some((t,i)=>null!=wt(e[i],t)))return t}else{if(He(t)){if(!He(e))return t;const s={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of r)if(e[n]!==t[n]&&!(null==i?void 0:i.includes(n)))if(typeof e[n]==typeof t[n]){const i=wt(e[n],t[n]);null!==i&&(s[n]=i)}else s[n]=t[n];return Object.keys(s).length?s:null}if(e!==t)return t}return null}function xt(e,t){return Le(e)?e.map(e=>xt(e,t)):He(e)?Qe(e,(e,i)=>{var s;return(null==(s=null==t?void 0:t.shallow)?void 0:s.includes(i))?Et(e):xt(e,t)}):Et(e)}function Et(e){return Le(e)?[...e]:He(e)?y({},e):_e(e)?new Date(e):Fe(e)?new RegExp(e.source,e.flags):e}function Mt(e,t,i,...s){var r;if(Le(e))t(e,...s),e.forEach((e,r)=>{Mt(e,t,i,...Tt(s,r))});else if(He(e)){t(e,...s);for(const n of Object.keys(e)){if(null==(r=null==i?void 0:i.skip)?void 0:r.includes(n))continue;const o=e[n];(Le(o)||He(o))&&Mt(o,t,i,...Tt(s,n))}}}function At(e,t,i={}){const{path:s,constructedArrays:r,matcherPath:n=(null==s?void 0:s.replace(/(\[[0-9+]+])/i,"[]")),skip:o=[]}=i;if(null==e)throw new Error(`AG Charts - target is uninitialised: ${null!=s?s:"<root>"}`);if(null==t)return e;if(bt(e))return e.set(t);const a=e,l=Dt(e);for(const c in t){if(tt.has(c))continue;const h=`${n?n+".":""}${c}`;if(o.includes(h))continue;const d=t[c],u=`${s?s+".":""}${c}`,p=a.constructor,g=a[c];let m;try{const t=Dt(g),s=Dt(d);if(l===St&&!(c in e)){_.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - property is unknown`);continue}if(null!=t&&null!=s&&s!==t&&(t!==St||"object"!==s)){_.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - can't apply type of [${s}], allowed types are: [${t}]`);continue}if(bt(g))a[c].set(d);else if("array"===s)if(null!=m||(m=null==r?void 0:r.get(g)),null==m)a[c]=d;else{const e=d;a[c]=e.map(e=>At(new m,e,v(y({},i),{path:u,matcherPath:h+"[]"})))}else s===St?a[c]=d:"object"===s?null!=g?At(g,d,v(y({},i),{path:u,matcherPath:h})):null==m?(a[c]={},At(a[c],d,v(y({},i),{path:u,matcherPath:h}))):a[c]=At(new m,d,v(y({},i),{path:u,matcherPath:h})):a[c]=d}catch(e){_.warn(`unable to set [${u}] in [${null==p?void 0:p.name}]; nested error is: ${e.message}`)}}return e}function Tt(e,t){return e.map(e=>null==e?void 0:e[t])}function Dt(e){return null==e?null:je(e)||_e(e)?"primitive":Le(e)?"array":Be(e)?He(e)?"object":St:Ge(e)?"function":"primitive"}var It=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],instanceConstructor:i,defaultAxes:s,themeTemplate:r,enterpriseThemeTemplate:n,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,swapDefaultAxesCondition:d,hidden:u}){this.setThemeTemplate(e,r,n),this.seriesMap.set(e,{instanceConstructor:i,defaultAxes:s,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,swapDefaultAxesCondition:d}),ot.set(e,t),u||at.set(e,t)}create(e,t){var i;const s=null==(i=this.seriesMap.get(e))?void 0:i.instanceConstructor;if(s)return new s(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){var t;const i=null==(t=this.seriesMap.get(e))?void 0:t.defaultAxes;return i?{axes:xt(i)}:null}setThemeTemplate(e,t,i={}){const s=this.themeTemplates.get(e);this.themeTemplates.set(e,{community:Xe(t,null==s?void 0:s.community),enterprise:Xe(i,t,null==s?void 0:s.community)})}getThemeTemplate(e){const t=this.themeTemplates.get(e);return Se.isEnterprise?null==t?void 0:t.enterprise:null==t?void 0:t.community}getPaletteFactory(e){var t;return null==(t=this.seriesMap.get(e))?void 0:t.paletteFactory}isSolo(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.solo)&&i}isGroupable(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.groupable)&&i}isStackable(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.stackable)&&i}isStackedByDefault(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.stackedByDefault)&&i}isDefaultAxisSwapNeeded(e){var t,i,s;let r;for(const n of null!=(t=e.series)?t:[]){const{type:e="line"}=n,t=null==(s=null==(i=this.seriesMap.get(e))?void 0:i.swapDefaultAxesCondition)?void 0:s.call(i,n);if(null!=t){if(null!=r&&r!=t)throw new Error("AG Charts - The provided series have incompatible directions");r=t}}return r}},Rt=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,instanceConstructor:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,instanceConstructor:i}),this.themeTemplates.set(t,s)}create(e,t){var i;const s=null==(i=this.legendMap.get(e))?void 0:i.instanceConstructor;if(s)return new s(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},Pt=(e=>(e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=17]="LARGE",e))(Pt||{}),kt=(e=>(e.NORMAL="normal",e.BOLD="bold",e.BOLDER="bolder",e.LIGHTER="lighter",e))(kt||{}),Lt=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(Lt||{}),Nt=(e=>(e.CATEGORY="category",e.ORDINAL_TIME="ordinal-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(Nt||{}),_t=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(_t||{}),Ot=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Ot||{}),Ft={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Gt={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Bt=Symbol("is-dark-theme"),Vt=Symbol("extends-axes-defaults"),Ht=Symbol("extends-axes-line-defaults"),Ut=Symbol("extends-axes-tick-defaults"),zt=Symbol("extends-axes-grid-line-defaults"),Wt=Symbol("extends-series-defaults"),jt=Symbol("extends-cartesian-marker-defaults"),Kt=Symbol("default-font"),$t=Symbol("default-label-colour"),Yt=Symbol("default-inverted-label-colour"),qt=Symbol("default-inside-series-label-colour"),Xt=Symbol("default-muted-label-colour"),Zt=Symbol("default-axis-grid-colour"),Qt=Symbol("default-axis-line-colour"),Jt=Symbol("default-cross-lines-colour"),ei=Symbol("default-background-colour"),ti=Symbol("default-shadow-colour"),ii=Symbol("default-colours"),si=Symbol("default-waterfall-series-positive-colors"),ri=Symbol("default-waterfall-series-negative-colors"),ni=Symbol("default-waterfall-series-total-colors"),oi=Symbol("default-waterfall-series-connector-line-stroke"),ai=Symbol("default-polar-series-stroke"),li=Symbol("default-diverging-series-colour-range"),ci=Symbol("default-hierarchy-fills"),hi=Symbol("default-hierarchy-strokes"),di=Symbol("default-annotation-stroke"),ui=Symbol("default-annotation-background-fill"),pi=Symbol("default-annotation-handle-fill"),gi="white",mi={fills:Object.values(Ft),strokes:Object.values(Gt)},fi={get cartesian(){return{seriesTypes:ot.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:ot.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:ot.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:ot.topologyTypes,commonOptions:[]}}},yi=Object.values(fi).reduce((e,{commonOptions:t})=>e.concat(t),[]),vi=class e{getPalette(){return mi}static getAxisDefaults(e){return Xe(e,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:"normal",fontSize:13,fontFamily:Kt,color:$t},label:{fontSize:12,fontFamily:Kt,padding:5,color:$t,avoidCollisions:!0},line:{enabled:!0,width:1,color:Qt},tick:{enabled:!1,width:1,color:Qt},gridLine:{enabled:!0,style:[{stroke:Zt,lineDash:[]}]},crossLines:{enabled:!1,fill:Jt,stroke:Jt,fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:12,fontFamily:Kt,padding:5,color:$t}}})}static getSeriesDefaults(){return{visible:!0,showInLegend:!0,highlightStyle:{item:{fill:"#ffffff54",stroke:"#0006",strokeWidth:2},series:{dimOpacity:1}},nodeClickRange:"exact",tooltip:{enabled:!0}}}static getCartesianSeriesMarkerDefaults(){return{enabled:!0,shape:"circle",size:7,strokeWidth:1}}static getChartDefaults(){return{background:{visible:!0,fill:ei},padding:{top:20,right:20,bottom:20,left:20},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:"normal",fontSize:17,fontFamily:Kt,color:$t,wrapping:"hyphenate"},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontSize:13,fontFamily:Kt,color:Xt,wrapping:"hyphenate"},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:13,fontFamily:Kt,color:"rgb(140, 140, 140)",wrapping:"hyphenate"},legend:{position:"bottom",spacing:30,listeners:{},item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},toggleSeriesVisible:!0,label:{color:$t,fontSize:12,fontFamily:Kt}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:$t},inactiveStyle:{fill:Xt},highlightStyle:{fill:$t},label:{color:$t}}},tooltip:{enabled:!0,darkTheme:Bt,range:"nearest",delay:0},overlays:{loading:{darkTheme:Bt},noData:{darkTheme:Bt},noVisibleSeries:{darkTheme:Bt}},listeners:{}}}constructor(e={}){const{overrides:t,palette:i}=xt(e),s=this.createChartConfigPerChartType(this.getDefaults());t&&this.mergeOverrides(s,t),this.config=Object.freeze(this.templateTheme(s)),this.palette=Xe(i,this.getPalette())}mergeOverrides(e,t){for(const{seriesTypes:i,commonOptions:s}of Object.values(fi)){const r=y({},t.common);for(const e of yi)s.includes(e)||delete r[e];if(r)for(const t of i){const i=t;e[i]=Xe(r,e[i])}}ot.seriesTypes.forEach(i=>{const s=i;t[s]&&(e[s]=Xe(t[s],e[s]))})}createChartConfigPerChartType(e){for(const[t,{seriesTypes:i}]of Object.entries(fi)){const s=lt.get(t);for(const t of i)e[t]||(e[t]=xt(s))}return e}getDefaults(){const t=(t,i)=>{var s;const r={},n=y(y(y({axes:{}},Rt.getThemeTemplates()),e.getChartDefaults()),lt.get(t));for(const o of i){r[o]=Xe(It.getThemeTemplate(o),null!=(s=r[o])?s:xt(n));const{axes:i}=r[o];for(const s of Ee.keys())i[s]=Xe(i[s],Ee.getThemeTemplate(s),"cartesian"===t&&e.cartesianAxisDefault[s])}return r};return Xe(t("cartesian",ot.cartesianTypes),t("polar",ot.polarTypes),t("hierarchy",ot.hierarchyTypes),t("topology",ot.topologyTypes))}templateTheme(e){const t=xt(e),{extensions:i,properties:s}=this.getTemplateParameters();return Mt(t,e=>{if(e.__extends__){const t=e.__extends__,s=i.get(t);if(null==s)throw new Error(`AG Charts - no template variable provided for: ${t}`);Object.keys(s).forEach(t=>{t in e?Be(e[t])&&(e[t]=Xe(e[t],s[t])):e[t]=s[t]}),delete e.__extends__}if(Le(e))for(let t=0;t<e.length;t++){const i=e[t];s.has(i)&&(e[t]=s.get(i))}else for(const[t,i]of Object.entries(e))s.has(i)&&(e[t]=s.get(i))}),xt(t)}static getDefaultColors(){return{fills:Ft,strokes:Gt}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ft.BLUE,stroke:Gt.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ft.ORANGE,stroke:Gt.ORANGE,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ft.GRAY,stroke:Gt.GRAY,label:{color:$t}}}getTemplateParameters(){const t=new Map;t.set(Vt,e.getAxisDefaults()),t.set(Ht,e.getAxisDefaults().line),t.set(Ut,e.getAxisDefaults().tick),t.set(zt,e.getAxisDefaults().gridLine),t.set(Wt,e.getSeriesDefaults()),t.set(jt,e.getCartesianSeriesMarkerDefaults());const i=new Map;return i.set(Bt,!1),i.set(Kt,"Verdana, sans-serif"),i.set($t,"rgb(70, 70, 70)"),i.set(Yt,"white"),i.set(Xt,"rgb(140, 140, 140)"),i.set(Zt,"rgb(224,234,241)"),i.set(Qt,"rgb(195, 195, 195)"),i.set(Jt,"rgb(70, 70, 70)"),i.set(qt,gi),i.set(ei,gi),i.set(ti,"rgba(0, 0, 0, 0.5)"),i.set(li,[Ft.ORANGE,Ft.YELLOW,Ft.GREEN]),i.set(ci,["#ffffff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"]),i.set(hi,["#ffffff","#c5cbd1","#a4b1bd","#8498a9","#648096"]),i.set(ai,gi),i.set(ii,e.getDefaultColors()),i.set(si,e.getWaterfallSeriesDefaultPositiveColors()),i.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),i.set(ni,e.getWaterfallSeriesDefaultTotalColors()),i.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),i.set(di,Gt.BLUE),i.set(ui,Ft.BLUE),i.set(pi,gi),{extensions:t,properties:i}}};vi.cartesianAxisDefault={number:vi.getAxisDefaults({line:{enabled:!1}}),log:vi.getAxisDefaults({base:10,line:{enabled:!1}}),category:vi.getAxisDefaults({groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:!1}}),time:vi.getAxisDefaults({gridLine:{enabled:!1}}),"grouped-category":vi.getAxisDefaults()};var Ci=vi,bi="#192232",Si={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},wi={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},xi={fills:Object.values(Si),strokes:Object.values(wi)},Ei=class e extends Ci{static getDefaultColors(){return{fills:Si,strokes:wi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Si.BLUE,stroke:wi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Si.ORANGE,stroke:wi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Si.GRAY,stroke:wi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(Bt,!0),t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(ai,bi),t.properties.set($t,"white"),t.properties.set(Xt,"#7D91A0"),t.properties.set(Zt,"#545A6E"),t.properties.set(Jt,"white"),t.properties.set(li,[Si.ORANGE,Si.YELLOW,Si.GREEN]),t.properties.set(ci,["#192834","#253746","#324859","#3f596c","#4d6a80"]),t.properties.set(hi,["#192834","#3b5164","#496275","#577287","#668399"]),t.properties.set(ei,bi),t.properties.set(qt,bi),t.properties.set(di,wi.BLUE),t.properties.set(ui,Si.BLUE),t.properties.set(pi,bi),t}getPalette(){return xi}constructor(e){super(e)}},Mi={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ai={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},Ti={fills:Object.values(Mi),strokes:Object.values(Ai)},Di=class e extends Ei{static getDefaultColors(){return{fills:Mi,strokes:Ai}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Mi.BLUE,stroke:Ai.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Mi.RED,stroke:Ai.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Mi.GRAY,stroke:Ai.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[Mi.ORANGE,Mi.YELLOW,Mi.GREEN]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Ai.BLUE),t.properties.set(ui,Mi.BLUE),t}getPalette(){return Ti}},Ii={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ri={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Pi={fills:Object.values(Ii),strokes:Object.values(Ri)},ki=class e extends Ci{static getDefaultColors(){return{fills:Ii,strokes:Ri}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ii.BLUE,stroke:Ri.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ii.RED,stroke:Ri.RED,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ii.GRAY,stroke:Ri.GRAY,label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[Ii.ORANGE,Ii.YELLOW,Ii.GREEN]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Ri.BLUE),t.properties.set(ui,Ii.BLUE),t}getPalette(){return Pi}},Li={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Ni={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff"},_i={fills:Object.values(Li),strokes:Object.values(Ni)},Oi=class e extends Ei{static getDefaultColors(){return{fills:Li,strokes:Ni}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Li.BLUE,stroke:Ni.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Li.RED,stroke:Ni.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#eeeeee",label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[Li.BLUE,Li.RED]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Ni.BLUE),t.properties.set(ui,Li.BLUE),t}getPalette(){return _i}},Fi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Gi={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb"},Bi={fills:Object.values(Fi),strokes:Object.values(Gi)},Vi=class e extends Ci{static getDefaultColors(){return{fills:Fi,strokes:Gi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Fi.BLUE,stroke:Gi.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Fi.RED,stroke:Gi.RED,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#888888",label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[Fi.BLUE,Fi.RED]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Gi.BLUE),t.properties.set(ui,Fi.BLUE),t}getPalette(){return Bi}},Hi={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Ui={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},zi={fills:Object.values(Hi),strokes:Object.values(Ui)},Wi=class e extends Ei{static getDefaultColors(){return{fills:v(y({},Hi),{RED:Hi.ORANGE}),strokes:v(y({},Ui),{RED:Ui.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Hi.BLUE,stroke:Ui.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Hi.ORANGE,stroke:Ui.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Hi.GRAY,stroke:Ui.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[Hi.ORANGE,Hi.YELLOW,Hi.GREEN]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Ui.BLUE),t.properties.set(ui,Hi.BLUE),t}getPalette(){return zi}},ji={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Ki={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},$i={fills:Object.values(ji),strokes:Object.values(Ki)},Yi=class e extends Ci{static getDefaultColors(){return{fills:v(y({},ji),{RED:ji.ORANGE}),strokes:v(y({},Ki),{RED:Ki.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:ji.BLUE,stroke:Ki.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:ji.ORANGE,stroke:Ki.ORANGE,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:ji.GRAY,stroke:Ki.GRAY,label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[ji.ORANGE,ji.YELLOW,ji.GREEN]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Ki.BLUE),t.properties.set(ui,ji.BLUE),t}getPalette(){return $i}},qi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Xi={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#c18aff",YELLOW:"#fff653",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Zi={fills:Object.values(qi),strokes:Object.values(Xi)},Qi=class e extends Ei{static getDefaultColors(){return{fills:qi,strokes:Xi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:qi.BLUE,stroke:Xi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:qi.ORANGE,stroke:Xi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:qi.GRAY,stroke:Xi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[qi.ORANGE,qi.YELLOW,qi.GREEN]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,Xi.BLUE),t.properties.set(ui,qi.BLUE),t}getPalette(){return Zi}},Ji={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},es={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},ts={fills:Object.values(Ji),strokes:Object.values(es)},is=class e extends Ci{static getDefaultColors(){return{fills:Ji,strokes:es}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ji.BLUE,stroke:es.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ji.ORANGE,stroke:es.ORANGE,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ji.GRAY,stroke:es.GRAY,label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ii,e.getDefaultColors()),t.properties.set(si,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(li,[Ji.ORANGE,Ji.YELLOW,Ji.GREEN]),t.properties.set(oi,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(di,es.BLUE),t.properties.set(ui,Ji.BLUE),t}getPalette(){return ts}},ss=()=>new Ci,rs=()=>new Ei,ns={undefined:ss,null:ss,"ag-default":ss,"ag-sheets":()=>new Yi,"ag-polychroma":()=>new Vi,"ag-vivid":()=>new is,"ag-material":()=>new ki},os=y(y({},{undefined:rs,null:rs,"ag-default-dark":rs,"ag-sheets-dark":()=>new Wi,"ag-polychroma-dark":()=>new Oi,"ag-vivid-dark":()=>new Qi,"ag-material-dark":()=>new Di}),ns);function as(e){let t=function(e){return void 0===e||"string"==typeof e||e instanceof Ci?e:"object"==typeof e?function(e){if(null===e)return;let t=!0;const{baseTheme:i,palette:s,overrides:r}=e;if(void 0!==i&&"string"!=typeof i&&"object"!=typeof i&&(_.warn(`invalid theme.baseTheme type ${typeof i}, expected (string | object).`),t=!1),void 0!==r&&"object"!=typeof r&&(_.warn(`invalid theme.overrides type ${typeof r}, expected object.`),t=!1),"object"==typeof s){if(null!==s){const{fills:e,strokes:i}=s;void 0===e||Array.isArray(e)||(_.warn("theme.overrides.fills must be undefined or an array"),t=!1),void 0===i||Array.isArray(i)||(_.warn("theme.overrides.strokes must be undefined or an array"),t=!1)}}else void 0!==s&&(_.warn(`invalid theme.palette type ${typeof s}, expected object.`),t=!1);return t?e:void 0}(e):void _.warn(`invalid theme value type ${typeof e}, expected object or string.`)}(e);if(t instanceof Ci)return t;if(null==t||"string"==typeof t){const e=os[t];return e?e():(_.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),ss())}const i=[];let s;for(;"object"==typeof t;)i.push(t.overrides),null!=s||(s=t.palette),t=t.baseTheme;const r={baseTheme:t,overrides:Xe(...i),palette:s};return new((r.baseTheme?as(r.baseTheme):ss()).constructor)(r)}function ls(e){if(0===e.length)return;let t=1/0,i=-1/0;for(let s of e)s instanceof Date&&(s=s.getTime()),"number"==typeof s&&(s<t&&(t=s),s>i&&(i=s));const s=[t,i];return s.every(isFinite)?s:void 0}function cs(e,t,i){return hs(e,t,i).extent}function hs(e,t,i){var s;let r=!1;return e.length>2&&(e=null!=(s=ls(e))?s:[NaN,NaN]),isNaN(t)||(r||(r=t>e[0]),e=[t,e[1]]),isNaN(i)||(r||(r=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:r}}function ds(e,t){if(null==e||null==t||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!ds(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function us(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function ps(e){return Array.from(new Set(e))}function gs(e,t){return e.reduce((e,i)=>{const s=t(i);return null!=e[s]||(e[s]=[]),e[s].push(i),e},{})}function ms(e,t,i=0){if(0===e.length)return[];const s=[];for(let r=0;r<t;r++)s.push(e.at((r+i)%e.length));return s}function fs(e,t){return t.reduce(([t,i],s)=>e(s)?[[...t,s],i]:[t,[...i,s]],[[],[]])}function*ys(e,t){for(const i of e)yield t(i)}function vs(e,t){return!t.some(t=>!function(e,t){return function(e,t){return e.includes(t)}(e,t)}(e,t))}var Cs={},bs=new WeakMap;function Ss(e){var t;return e?null==(t=Cs.document)?void 0:t[e]:Cs.document}function ws(e){var t;return e?null==(t=Cs.window)?void 0:t[e]:Cs.window}function xs(e,t,i){const s=Ss().createElement(e);return"object"==typeof t&&(i=t,t=void 0),t&&s.classList.add(t),i&&Object.assign(s.style,i),s}function Es(e,t){const{body:i}=Ss(),s=xs("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function Ms(e,t){var i,s;const r=Ss();if(t&&(null==(i=bs.get(r))?void 0:i.has(t)))return;const n=xs("style");n.innerHTML=e,r.head.insertBefore(n,r.head.querySelector("style")),t&&!bs.has(r)?bs.set(r,new Set([t])):t&&(null==(s=bs.get(r))||s.add(t))}function As(e){Cs.document=e}function Ts(e){Cs.window=e}"undefined"!=typeof window?Cs.window=window:"undefined"!=typeof globalThis&&(Cs.window=globalThis.window),"undefined"!=typeof document?Cs.document=document:"undefined"!=typeof globalThis&&(Cs.document=globalThis.document);var Ds=Date.now(),Is={create:(...e)=>Object.assign((...t)=>{Is.check(...e)&&("function"==typeof t[0]&&(t=us(t[0]())),(()=>{const e=Date.now()-Ds;if(e>2e3){const t=(Math.floor(e/100)/10).toFixed(1);_.log(`**** ${t}s since last log message ****`)}Ds=Date.now()})(),_.log(...t))},{check:()=>Is.check(...e)}),check:(...e)=>(0===e.length&&e.push(!0),us(ws("agChartsDebug")).some(t=>e.includes(t)))},Rs=new Set(["map-shape-background","map-line-background"]),Ps=class{constructor(e,t){var i,s;const r={shallow:["data"]},n=xt(e,r),o=this.optionsType(n);this.sanityCheckAndCleanup(n),this.userOptions=n,this.activeTheme=as(n.theme),this.defaultAxes=this.getDefaultAxes(n),this.specialOverrides=this.specialOverridesDefaults(y({},t));const a=this.getSeriesThemeConfig(o),{axes:l={},annotations:c={},series:h}=a,d=C(a,["axes","annotations","series"]);this.processedOptions=xt(Xe(this.userOptions,d,this.defaultAxes),r),this.processAxesOptions(this.processedOptions,l),this.processSeriesOptions(this.processedOptions),this.processMiniChartSeriesOptions(this.processedOptions),this.processAnnotationsOptions(this.processedOptions,c),(pt(this.processedOptions)||function(e){const t=ut(e);return gt(e)&&"pie"!==t&&"donut"!==t}(this.processedOptions))&&null==(null==(i=this.processedOptions.legend)?void 0:i.enabled)&&(null!=(s=this.processedOptions).legend||(s.legend={}),this.processedOptions.legend.enabled=this.processedOptions.series.length>1),this.enableConfiguredOptions(this.processedOptions),Se.isEnterprise||function(e){var t,i,s,r;const n=[],o=ot.get(ut(e));for(const{type:a,chartTypes:l,optionsKey:c,optionsInnerKey:h,identifier:d}of ct)if("unknown"===o||l.includes(o))if("root"===a||"legend"===a){const t=e[c];if(null==t)continue;h?t[h]&&(n.push(`${c}.${h}`),delete t[h]):(n.push(c),delete e[c])}else if("axis"===a){if(!("axes"in e)||!(null==(t=e.axes)?void 0:t.some(e=>e.type===d)))continue;n.push(`axis[type=${d}]`),e.axes=e.axes.filter(e=>e.type!==d)}else if("axis-option"===a){if(!("axes"in e)||!(null==(i=e.axes)?void 0:i.some(e=>e[c])))continue;n.push(`axis.${c}`),e.axes.forEach(e=>{e[c]&&delete e[c]})}else if("series"===a){if(!(null==(s=e.series)?void 0:s.some(e=>e.type===d)))continue;n.push(`series[type=${d}]`),e.series=e.series.filter(e=>e.type!==d)}else if("series-option"===a){if(!(null==(r=e.series)?void 0:r.some(e=>e[c])))continue;n.push(`series.${c}`),e.series.forEach(e=>{e[c]&&delete e[c]})}if(n.length){let t="ag-charts-enterprise",i="https://charts.ag-grid.com/javascript/installation/";"integrated"===e.mode&&(t="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",i="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),_.warnOnce([`unable to use these enterprise features as '${t}' has not been loaded:`,"",...n,"",`See: ${i}`].join("\n"))}}(this.processedOptions)}getOptions(){var e;return null!=(e=this.processedOptions)?e:{}}diffOptions(e){return wt(e,this.processedOptions)}getSeriesThemeConfig(e){var t,i;return xt(null!=(i=null==(t=this.activeTheme)?void 0:t.config[e])?i:{})}getDefaultAxes(e){const t=this.optionsType(e),i=It.cloneDefaultAxes(t);return It.isDefaultAxisSwapNeeded(e)&&this.swapAxesPosition(i),i}optionsType(e){var t,i,s;return null!=(s=null==(i=null==(t=e.series)?void 0:t[0])?void 0:i.type)?s:"line"}sanityCheckAndCleanup(e){var t;this.deprecationWarnings(e),this.axesTypeIntegrity(e),this.seriesTypeIntegrity(e),this.soloSeriesIntegrity(e),this.removeDisabledOptions(e),this.removeLeftoverSymbols(e),(null==(t=e.series)?void 0:t.some(e=>"bullet"===e.type))&&null!=e.sync&&!1!==e.sync.enabled&&(_.warnOnce("bullet series cannot be synced, disabling synchronization."),delete e.sync)}swapAxesPosition(e){var t;if(pt(e)){const[i,s]=null!=(t=e.axes)?t:[];e.axes=[v(y({},i),{position:s.position}),v(y({},s),{position:i.position})]}}processAxesOptions(e,t){"axes"in e&&(e.axes=e.axes.map(e=>{var i,s,r;const n=Xe(null==(i=t[e.type])?void 0:i[e.position],t[e.type]),{crossLines:o}=n,a=C(n,["crossLines"]);e.crossLines&&(e.crossLines=Ze(e.crossLines,o));const l=null==(s=a.gridLine)?void 0:s.style;(null==(r=e.gridLine)?void 0:r.style)&&(null==l?void 0:l.length)&&(e.gridLine.style=e.gridLine.style.map((e,t)=>null!=e.stroke||null!=e.lineDash?Xe(e,l.at(t%l.length)):e));const c=Xe(e,a),{top:h,right:d,bottom:u,left:p}=c;return C(c,["top","right","bottom","left"])}))}processSeriesOptions(e){const t=this.getDefaultSeriesType(e),i=this.getTooltipPositionDefaults(e),s=Boolean(Be(e.theme)&&e.theme.palette),r={colourIndex:0,userPalette:s},n=e.series.map(e=>{var n;null!=e.type||(e.type=t);const o=null!=(n=this.getSeriesThemeConfig(e.type).series)?n:{},{innerLabels:a}=o,l=C(o,["innerLabels"]),c=Rs.has(e.type)?{colourIndex:0,userPalette:s}:r,h=this.getSeriesPalette(e.type,c),d=Xe(this.getSeriesGroupingOptions(e),e,i,l,h);return d.innerLabels&&(d.innerLabels=Ze(d.innerLabels,a)),this.activeTheme.templateTheme(d)});e.series=this.setSeriesGroupingOptions(n)}processMiniChartSeriesOptions(e){var t,i;let s=null==(i=null==(t=e.navigator)?void 0:t.miniChart)?void 0:i.series;if(null==s)return;const r={colourIndex:0,userPalette:Boolean(Be(e.theme)&&e.theme.palette)};s=s.map(e=>{var t;null!=e.type||(e.type="line");const i=null!=(t=this.getSeriesThemeConfig(e.type).series)?t:{},{innerLabels:s}=i,n=C(i,["innerLabels"]),o=Xe(this.getSeriesGroupingOptions(e),e,n,this.getSeriesPalette(e.type,r));return this.activeTheme.templateTheme(o)}),e.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}processAnnotationsOptions(e,t){pt(e)}getSeriesPalette(e,t){const i=It.getPaletteFactory(e),{colourIndex:s,userPalette:r}=t,{fills:n=[],strokes:o=[]}=this.activeTheme.palette;return null==i?void 0:i({userPalette:r,colorsCount:Math.max(n.length,o.length),themeTemplateParameters:this.activeTheme.getTemplateParameters(),takeColors:e=>(t.colourIndex+=e,{fills:ms(n,e,s),strokes:ms(o,e,s)})})}getSeriesGroupingOptions(e){const t=It.isGroupable(e.type),i=It.isStackable(e.type),s=It.isStackedByDefault(e.type);e.grouped&&!t&&_.warnOnce(`unsupported grouping of series type "${e.type}".`),!e.stacked&&!e.stackGroup||i||_.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:n}=e;return null!=n||(n=(s||null!=e.stackGroup)&&!(t&&r)),null!=r||(r=!0),{stacked:i&&n,grouped:t&&r&&!(i&&n)}}setSeriesGroupingOptions(e){const t=this.getSeriesGrouping(e);Is.create(!0,"opts")("setSeriesGroupingOptions() - series grouping: ",t);const i={},s=t.reduce((e,t)=>{var i;return"default"===t.groupType||(null!=e[i=t.seriesType]||(e[i]=0),e[t.seriesType]+="stack"===t.groupType?1:t.series.length),e},{});return t.flatMap(e=>{var t;switch(null!=i[t=e.seriesType]||(i[t]=0),e.groupType){case"stack":const t=i[e.seriesType]++;return e.series.map((i,r)=>Object.assign(i,{seriesGrouping:{groupIndex:t,groupCount:s[e.seriesType],stackIndex:r,stackCount:e.series.length}}));case"group":return e.series.map(t=>Object.assign(t,{seriesGrouping:{groupIndex:i[e.seriesType]++,groupCount:s[e.seriesType],stackIndex:0,stackCount:0}}))}return e.series}).map(e=>{var t=e,{stacked:i,grouped:s}=t;return C(t,["stacked","grouped"])})}getSeriesGroupId(e){var t;return[e.type,e.xKey,e.stacked?null!=(t=e.stackGroup)?t:"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const t=new Map;return e.reduce((e,i)=>{const s=i.type;if(i.stacked||i.grouped){const r=this.getSeriesGroupId(i);if(!t.has(r)){const n={groupType:i.stacked?"stack":"group",seriesType:s,series:[]};t.set(r,n),e.push(n)}t.get(r).series.push(i)}else e.push({groupType:"default",seriesType:s,series:[i]});return e},[])}getDefaultSeriesType(e){if(pt(e))return"line";if(gt(e))return"pie";if(mt(e))return"treemap";if(ft(e))return"map-shape";throw new Error("Invalid chart options type detected.")}getTooltipPositionDefaults(e){var t;const i=null==(t=e.tooltip)?void 0:t.position;if(!He(i))return;const{type:s,xOffset:r,yOffset:n}=i,o={};return Ue(s)&&$e(T,s)&&(o.type=s),We(r)&&(o.xOffset=r),We(n)&&(o.yOffset=n),{tooltip:{position:o}}}deprecationWarnings(e){Object.entries({yKeys:"yKey",yNames:"yName"}).forEach(([t,i])=>{var s;(null==(s=e.series)?void 0:s.some(e=>null!=e[t]))&&_.warnOnce(`Property [series.${t}] is deprecated, please use [series.${i}] and multiple series instead.`)})}axesTypeIntegrity(e){var t;if("axes"in e){const i=null!=(t=e.axes)?t:[];for(const{type:t}of i)if(!yt(t)){delete e.axes;const i=Array.from(Ee.publicKeys()).join(", ");_.warnOnce(`unknown axis type: ${t}; expected one of: ${i}`)}}}seriesTypeIntegrity(e){var t;const i=null!=(t=e.series)?t:[];e.series=i.filter(({type:e})=>{if(null==e||null!=(t=e)&&ot.has(t)||function(e){return ct.some(t=>"series"===t.type&&t.identifier===e)}(e))return!0;var t;_.warnOnce(`unknown series type: ${e}; expected one of: ${at.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(e){const t=e.series;if(t&&t.length>1&&t.some(e=>It.isSolo(e.type))){const i=this.optionsType(e);if(It.isSolo(i))_.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),e.series=t.slice(0,1);else{const{solo:i,nonSolo:s}=gs(t,e=>It.isSolo(e.type)?"solo":"nonSolo"),r=ps(i.map(e=>e.type)).join(", ");_.warn(`Unable to mix these series types with the lead series type: ${r}`),e.series=s}}}enableConfiguredOptions(e){Mt(this.userOptions,(e,t)=>{t&&"enabled"in t&&!t._enabledFromTheme&&null==e.enabled&&(t.enabled=!0)},{skip:["data","theme"]},e),Mt(e,e=>{null!=e._enabledFromTheme&&delete e._enabledFromTheme},{skip:["data","theme"]})}removeDisabledOptions(e){Mt(e,e=>{"enabled"in e&&!1===e.enabled&&Object.keys(e).forEach(t=>{"enabled"!==t&&delete e[t]})},{skip:["data","theme"]})}removeLeftoverSymbols(e){Mt(e,e=>{if(e&&Be(e))for(const[t,i]of Object.entries(e))Ye(i)&&delete e[t]},{skip:["data"]})}specialOverridesDefaults(e){if(null!=e.window?Ts(e.window):"undefined"!=typeof window?e.window=window:"undefined"!=typeof globalThis&&(e.window=globalThis.window),null!=e.document?As(e.document):"undefined"!=typeof document?e.document=document:"undefined"!=typeof globalThis&&(e.document=globalThis.document),null==e.window)throw new Error("AG Charts - unable to resolve global window");if(null==e.document)throw new Error("AG Charts - unable to resolve global document");return e}};function ks(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");_.warnOnce(i)}}function Ls(e,t){const i=ks(),s=null==t?void 0:t.default;return De((t,r,n)=>(n!==s&&i(r.toString(),e),n))}function Ns(e,t){const i=ks();return De((s,r,n)=>(n!==s[e]&&(i(r.toString(),`Use [${e}] instead.`),it(s,e,t?t(n):n)),Me),(t,s)=>(i(s.toString(),`Use [${e}] instead.`),et(t,e)))}var _s={};b(_s,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ir,fromToMotion:()=>Rr,staticFromToMotion:()=>Pr});var Os=new Map;function Fs(){Os.clear()}function Gs(e){var t;const i=e.constructor,s=Object.hasOwn(i,"className")?i.className:i.name;if(!s)throw new Error(`The ${i} is missing the 'className' property.`);const r=(null!=(t=Os.get(s))?t:0)+1;return Os.set(s,r),`${s}-${r}`}var Bs="$interpolate",Vs=e=>null!=e[Bs];function Hs(e,t,i){return Math.min(i,Math.max(e,t))}function Us(e,t){const[i,s]=zs(t);return Hs(i,e,s)}function zs(e){return e.length?[Math.min(...e),Math.max(...e)]:[]}function Ws(e){const[t,i]=zs(e);return i-t}function js(e,t,i=1e-10){return Math.abs(e-t)<i}function Ks(e){return-1===Math.sign(e)||Object.is(e,-0)}function $s(e,t=2){const i=m(10,t);return Math.round(e*i)/i}function Ys(e,t=2){const i=Math.floor(Math.log(Math.abs(e))/Math.LN10);return i>=0||!isFinite(i)?e.toFixed(t):e.toFixed(Math.abs(i)-1+t)}function qs(e,t){return Math.floor(e%t+(e<0?t:0))}function Xs(e,t=10){const[,i=""]=(Math.abs(e)%1).toLocaleString("en-GB",{minimumFractionDigits:0,maximumFractionDigits:t}).split(".");return i.length}function Zs(e,t,i,s=1/0){const r={nearest:void 0,distanceSquared:s};for(const s of i){const i=s.distanceSquared(e,t);if(0===i)return{nearest:s,distanceSquared:0};i<r.distanceSquared&&(r.nearest=s,r.distanceSquared=i)}return r}function Qs(e,t,i,s=1/0){const{x:r,y:n}=i.transformPoint(e,t),o={nearest:void 0,distanceSquared:s};for(const e of i.children){const{nearest:t,distanceSquared:i}=e.nearestSquared(r,n,o.distanceSquared);if(0===i)return{nearest:t,distanceSquared:i};i<o.distanceSquared&&(o.nearest=t,o.distanceSquared=i)}return o}var Js=class e{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}clone(){const{x:t,y:i,width:s,height:r}=this;return new e(t,i,s,r)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,t){return e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const i=e-Hs(this.x,e,this.x+this.width),s=t-Hs(this.y,t,this.y+this.height);return i*i+s*s}static nearestBox(e,t,i){return Zs(e,t,i)}clip(e){if(void 0===e)return this;const t=Math.max(this.x,e.x),i=Math.max(this.y,e.y),s=Math.min(this.x+this.width,e.x+e.width),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.y=i,this.width=Math.max(0,s-t),this.height=Math.max(0,r-i),this}shrink(e,t){const i=(e,t)=>{switch(e){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=2*t;break;case"horizontal":this.x+=t,this.width-=2*t;break;case void 0:this.x+=t,this.width-=2*t,this.y+=t,this.height-=2*t}};return"number"==typeof e?i(t,e):"object"==typeof e&&Object.entries(e).forEach(([e,t])=>i(e,t)),this}grow(e,t){if("number"==typeof e)this.shrink(-e,t);else{const t=y({},e);for(const e in t)t[e]*=-1;this.shrink(t)}return this}combine(e){const{x:t,y:i,width:s,height:r}=this;this.x=Math.min(t,e.x),this.y=Math.min(i,e.y),this.width=Math.max(t+s,e.x+e.width)-this.x,this.height=Math.max(i+r,e.y+e.height)-this.y}static merge(t){let i=1/0,s=1/0,r=-1/0,n=-1/0;for(const e of t)e.x<i&&(i=e.x),e.y<s&&(s=e.y),e.x+e.width>r&&(r=e.x+e.width),e.y+e.height>n&&(n=e.y+e.height);return new e(i,s,r-i,n-s)}[Bs](t,i){return new e(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};Js.zero=new Js(0,0,0,0),Js.NaN=new Js(NaN,NaN,NaN,NaN);var er=Js,tr=(e=>(e[e.NONE=0]="NONE",e[e.TRIVIAL=1]="TRIVIAL",e[e.MINOR=2]="MINOR",e[e.MAJOR=3]="MAJOR",e))(tr||{}),ir=function(){try{return new Function("return true"),!0}catch(e){return!1}}();function sr(e){const{changeCb:t,convertor:i}=null!=e?e:{};return function(s,r){const n=`__${r}`;s[r]||(ir&&null==t&&null==i?function(e,t,i,s){const{redraw:r=1,type:n="normal",checkDirtyOnAssignment:o=!1}=null!=s?s:{},a=new Function("value",`\n        const oldValue = this.${i};\n        if (value !== oldValue) {\n            this.${i} = value;\n            ${"normal"===n?`this.markDirty(this, ${r});`:""}\n            ${"transform"===n?`this.markDirtyTransform(${r});`:""}\n            ${"path"===n?`if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, ${r}); }`:""}\n            ${"font"===n?`if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, ${r}); }`:""}\n        }\n        ${o?"if (value != null && value._dirty > 0) { this.markDirty(value, value._dirty); }":""}\n`),l=new Function(`return this.${i};`);Object.defineProperty(e,t,{set:a,get:l,enumerable:!0,configurable:!0})}(s,r,n,e):function(e,t,i,s){const{redraw:r=1,type:n="normal",changeCb:o,convertor:a,checkDirtyOnAssignment:l=!1}=null!=s?s:{};Object.defineProperty(e,t,{set:function(e){const t=this[i];(e=a?a(e):e)!==t&&(this[i]=e,"normal"===n&&this.markDirty(this,r),"transform"===n&&this.markDirtyTransform(r),"path"!==n||this._dirtyPath||(this._dirtyPath=!0,this.markDirty(this,r)),"font"!==n||this._dirtyFont||(this._dirtyFont=!0,this.markDirty(this,r)),null==o||o(this)),l&&null!=e&&e._dirty>0&&this.markDirty(e,e._dirty)},get:function(){return this[i]},enumerable:!0,configurable:!0})}(s,r,n,e))}}var rr=class{constructor(){this._dirty=3}markDirty(e,t=1){this._dirty<t&&(this._dirty=t)}markClean(e){this._dirty=0}isDirty(){return this._dirty>0}},nr=class e{get e(){return[...this.elements]}constructor(e=[1,0,0,1,0,0]){this.elements=e}setElements(e){const t=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this}get identity(){const e=this.elements;return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}AxB(e,t,i){const s=e[0]*t[0]+e[2]*t[1],r=e[1]*t[0]+e[3]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],a=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];(i=null!=i?i:e)[0]=s,i[1]=r,i[2]=n,i[3]=o,i[4]=a,i[5]=l}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(t){const i=new Array(6);return this.AxB(this.elements,t.elements,i),new e(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],r=t[2],n=t[3];const o=t[4],a=t[5],l=1/(i*n-s*r);return i*=l,s*=l,r*=l,n*=l,new e([n,-s,-r,i,r*a-n*o,s*o-i*a])}inverseTo(e){const t=this.elements;let i=t[0],s=t[1],r=t[2],n=t[3];const o=t[4],a=t[5],l=1/(i*n-s*r);return i*=l,s*=l,r*=l,n*=l,e.setElements([n,-s,-r,i,r*a-n*o,s*o-i*a]),this}invertSelf(){const e=this.elements;let t=e[0],i=e[1],s=e[2],r=e[3];const n=e[4],o=e[5],a=1/(t*r-i*s);return t*=a,i*=a,s*=a,r*=a,e[0]=r,e[1]=-i,e[2]=-s,e[3]=t,e[4]=s*o-r*n,e[5]=i*n-t*o,this}transformPoint(e,t){const i=this.elements;return{x:e*i[0]+t*i[2]+i[4],y:e*i[1]+t*i[3]+i[5]}}transformBBox(e,t){const i=this.elements,s=i[0],r=i[1],n=i[2],o=i[3],a=.5*e.width,l=.5*e.height,c=e.x+a,h=e.y+l,d=Math.abs(a*s)+Math.abs(l*n),u=Math.abs(a*r)+Math.abs(l*o);return t||(t=new er(0,0,0,0)),t.x=c*s+h*n+i[4]-d,t.y=c*r+h*o+i[5]-u,t.width=d+d,t.height=u+u,t}toContext(e){if(this.identity)return;const t=this.elements;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}static flyweight(t){return e.instance.setElements(t.elements)}static updateTransformMatrix(e,t,i,s,r,n,o){const[a,l]=[0,0],c=t,h=i;let d,u;1===c&&1===h?(d=0,u=0):(d=null==(null==o?void 0:o.scalingCenterX)?a:null==o?void 0:o.scalingCenterX,u=null==(null==o?void 0:o.scalingCenterY)?l:null==o?void 0:o.scalingCenterY);const p=s,g=Math.cos(p),m=Math.sin(p);let f,y;0===p?(f=0,y=0):(f=null==(null==o?void 0:o.rotationCenterX)?a:null==o?void 0:o.rotationCenterX,y=null==(null==o?void 0:o.rotationCenterY)?l:null==o?void 0:o.rotationCenterY);const v=r,C=n,b=d*(1-c)-f,S=u*(1-h)-y;return e.setElements([g*c,m*c,-m*h,g*h,g*b-m*S+f+v,m*b+g*S+y+C]),e}static fromContext(t){const i=t.getTransform();return new e([i.a,i.b,i.c,i.d,i.e,i.f])}};nr.instance=new nr;var or=nr,ar=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(ar||{}),lr=class e extends rr{constructor({isVirtual:t,tag:i,zIndex:s}={}){super(),this.serialNumber=e._nextSerialNumber++,this.id=Gs(this),this.isContainerNode=!1,this._virtualChildren=[],this._children=[],this.childSet={},this.matrix=new or,this.dirtyTransform=!1,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0,this.translationX=0,this.translationY=0,this._childNodeCounts={groups:0,nonGroups:0},this.visible=!0,this.dirtyZIndex=!1,this.zIndex=0,this.zIndexSubOrder=void 0,this.pointerEvents=0,this.isVirtual=null!=t&&t,this.tag=null!=i?i:NaN,this.zIndex=null!=s?s:0}get datum(){var e,t;return null!=(t=this._datum)?t:null==(e=this._parent)?void 0:e.datum}get previousDatum(){return this._previousDatum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum),this._datum=e}_setLayerManager(e){this._layerManager=e,this._debug=null==e?void 0:e.debug;for(const t of this._children)t._setLayerManager(e);for(const t of this._virtualChildren)t._setLayerManager(e)}get layerManager(){return this._layerManager}*ancestors(){let e=this;for(;e=e.parent;)yield e}*traverseUp(){yield this,yield*M(this.ancestors())}get parent(){return this._parent}get children(){return this._virtualChildren.length?this._children.concat(this._virtualChildren.flatMap(e=>e.children)):this._children}get virtualChildren(){return this._virtualChildren}hasVirtualChildren(){return this._virtualChildren.length>0}setProperties(e,t){const i=null!=t?t:Object.keys(e);for(const t of i)this[t]=e[t];return this}append(e){Array.isArray(e)||(e=[e]);for(const t of e){if(t.parent)throw new Error(`${t} already belongs to another parent: ${t.parent}.`);if(t.layerManager)throw new Error(`${t} already belongs to a scene: ${t.layerManager}.`);if(this.childSet[t.id])throw new Error(`Duplicate ${t.constructor.name} node: ${t}`);t.isVirtual?this._virtualChildren.push(t):this._children.push(t),this.childSet[t.id]=!0,t._parent=this,t._setLayerManager(this.layerManager)}this.dirtyZIndex=!0,this.markDirty(this,3)}appendChild(e){return this.append(e),e}removeChild(e){const t=()=>{throw new Error("The node to be removed is not a child of this node.")};if(e.parent!==this&&t(),e.isVirtual){const i=this._virtualChildren.indexOf(e);i<0&&t(),this._virtualChildren.splice(i,1)}else{const i=this._children.indexOf(e);i<0&&t(),this._children.splice(i,1)}return delete this.childSet[e.id],e._parent=void 0,e._setLayerManager(),this.dirtyZIndex=!0,this.markDirty(e,3),e}calculateCumulativeMatrix(){this.computeTransformMatrix();const e=or.flyweight(this.matrix);for(const t of this.ancestors())t.computeTransformMatrix(),e.preMultiplySelf(t.matrix);return e}transformPoint(e,t){return this.calculateCumulativeMatrix().invertSelf().transformPoint(e,t)}inverseTransformPoint(e,t){return this.calculateCumulativeMatrix().transformPoint(e,t)}transformBBox(e){return this.calculateCumulativeMatrix().invertSelf().transformBBox(e)}inverseTransformBBox(e){return this.calculateCumulativeMatrix().transformBBox(e)}markDirtyTransform(){this.dirtyTransform=!0,this.markDirty(this,3)}containsPoint(e,t){return!1}pickNode(e,t){var i;if(!this.visible||1===this.pointerEvents||!this.containsPoint(e,t))return;const{children:s}=this;if(s.length>1e3)for(let r=s.length-1;r>=0;r--){const n=s[r],o=(null==(i=n.computeTransformedBBox())?void 0:i.containsPoint(e,t))?n.pickNode(e,t):void 0;if(o)return o}else if(s.length)for(let i=s.length-1;i>=0;i--){const r=s[i].pickNode(e,t);if(r)return r}else if(!this.isContainerNode)return this}getCachedBBox(){var e;return null!=(e=this.cachedBBox)?e:er.zero}computeBBox(){}computeTransformedBBox(){const e=this.computeBBox();if(!e)return;this.computeTransformMatrix();const t=or.flyweight(this.matrix);for(const e of this.ancestors())e.computeTransformMatrix(),t.preMultiplySelf(e.matrix);return t.transformBBox(e,e),e}computeTransformMatrix(){if(!this.dirtyTransform)return;const{matrix:e,scalingX:t,scalingY:i,rotation:s,translationX:r,translationY:n,scalingCenterX:o,scalingCenterY:a,rotationCenterX:l,rotationCenterY:c}=this;or.updateTransformMatrix(e,t,i,s,r,n,{scalingCenterX:o,scalingCenterY:a,rotationCenterX:l,rotationCenterY:c}),this.dirtyTransform=!1}preRender(){this._childNodeCounts.groups=0,this._childNodeCounts.nonGroups=1;for(const e of this.children){const t=e.preRender();this._childNodeCounts.groups+=t.groups,this._childNodeCounts.nonGroups+=t.nonGroups}return this._childNodeCounts}render(e){const{stats:t}=e;this._dirty=0,this.cachedBBox=this.computeBBox(),t&&t.nodesRendered++}markDirty(e,t=1,i=t){this._dirty>t||this._dirty===t&&t===i||(this._dirty=t,this.parent?this.parent.markDirty(this,i):this.layerManager&&this.layerManager.markDirty())}get dirty(){return this._dirty}markClean(e){const{force:t=!1,recursive:i=!0}=null!=e?e:{};if(0!==this._dirty||t){if(this._dirty=0,!1!==i)for(const e of this._virtualChildren)e.markClean({force:t});if(!0===i)for(const e of this._children)e.markClean({force:t})}}onVisibleChange(){}get nodeCount(){let e=1,t=this._dirty>=0||this.dirtyTransform?1:0,i=this.visible?1:0;const s=s=>{const{count:r,visibleCount:n,dirtyCount:o}=s.nodeCount;e+=r,i+=n,t+=o};for(const e of this._children)s(e);for(const e of this._virtualChildren)s(e);return{count:e,visibleCount:i,dirtyCount:t}}onZIndexChange(){this.parent&&(this.parent.dirtyZIndex=!0)}};lr._nextSerialNumber=0,S([sr({type:"transform"})],lr.prototype,"scalingX",2),S([sr({type:"transform"})],lr.prototype,"scalingY",2),S([sr({type:"transform"})],lr.prototype,"scalingCenterX",2),S([sr({type:"transform"})],lr.prototype,"scalingCenterY",2),S([sr({type:"transform"})],lr.prototype,"rotationCenterX",2),S([sr({type:"transform"})],lr.prototype,"rotationCenterY",2),S([sr({type:"transform"})],lr.prototype,"rotation",2),S([sr({type:"transform"})],lr.prototype,"translationX",2),S([sr({type:"transform"})],lr.prototype,"translationY",2),S([sr({redraw:3,changeCb:e=>e.onVisibleChange()})],lr.prototype,"visible",2),S([sr({redraw:1,changeCb:e=>e.onZIndexChange()})],lr.prototype,"zIndex",2),S([sr({redraw:1,changeCb:e=>e.onZIndexChange()})],lr.prototype,"zIndexSubOrder",2);var cr=lr,hr=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*m((i+.055)/1.055,2.4)},dr=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*m(i,1/2.4)-.055):12.92*e},ur=class e{constructor(e,t,i,s=1){this.r=Hs(0,e||0,1),this.g=Hs(0,t||0,1),this.b=Hs(0,i||0,1),this.a=Hs(0,s||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!e.parseHex(t):t.indexOf("rgb")>=0?!!e.stringToRgba(t):!!e.nameToHex[t.toLowerCase()]}static fromString(t){if(t.indexOf("#")>=0)return e.fromHexString(t);const i=e.nameToHex[t.toLowerCase()];if(i)return e.fromHexString(i);if(t.indexOf("rgb")>=0)return e.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static tryParseFromString(t){try{return e.fromString(t)}catch(i){return _.warnOnce(`invalid color string: '${t}'.`),e.fromArray([0,0,0])}}static parseHex(e){let t;switch((e=e.replace(/ /g,"").slice(1)).length){case 6:case 8:t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(`${e[i]}${e[i+1]}`,16));break;case 3:case 4:t=e.split("").map(e=>parseInt(e,16)).map(e=>e+16*e)}if((null==t?void 0:t.length)>=3&&t.every(e=>e>=0))return 3===t.length&&t.push(255),t}static fromHexString(t){const i=e.parseHex(t);if(i){const[t,s,r,n]=i;return new e(t/255,s/255,r/255,n/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(e){let[t,i]=[NaN,NaN];for(let s=0;s<e.length;s++){const r=e[s];if(t||"("!==r){if(")"===r){i=s;break}}else t=s}const s=t&&i&&e.substring(t+1,i);if(!s)return;const r=s.split(","),n=[];for(let e=0;e<r.length;e++){const t=r[e];let i=parseFloat(t);if(isNaN(i))return;t.indexOf("%")>=0?(i=Hs(0,i,100),i/=100):3===e?i=Hs(0,i,1):(i=Hs(0,i,255),i/=255),n.push(i)}return n}static fromRgbaString(t){const i=e.stringToRgba(t);if(i){if(3===i.length)return new e(i[0],i[1],i[2]);if(4===i.length)return new e(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(4===t.length)return new e(t[0],t[1],t[2],t[3]);if(3===t.length)return new e(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,r=1){const n=e.HSBtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static fromHSL(t,i,s,r=1){const n=e.HSLtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static fromOKLCH(t,i,s,r=1){const n=e.OKLCHtoRGB(t,i,s);return new e(n[0],n[1],n[2],r)}static padHex(e){return 1===e.length?"0"+e:e}toHexString(){let t="#"+e.padHex(Math.round(255*this.r).toString(16))+e.padHex(Math.round(255*this.g).toString(16))+e.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(t+=e.padHex(Math.round(255*this.a).toString(16))),t}toRgbaString(e=3){const t=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,e);return 1!==this.a?(t.push(Math.round(this.a*i)/i),`rgba(${t.join(", ")})`):`rgb(${t.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return e.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,t,i){const s=hr(e),r=hr(t),n=hr(i),o=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*n),l=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*n),c=.2104542553*o+.793617785*a-.0040720468*l,h=1.9779984951*o-2.428592205*a+.4505937099*l,d=.0259040371*o+.7827717662*a-.808675766*l,u=180*Math.atan2(d,h)/Math.PI;return[c,Math.hypot(h,d),u>=0?u:u+360]}static OKLCHtoRGB(e,t,i){const s=e,r=t*Math.cos(i*Math.PI/180),n=t*Math.sin(i*Math.PI/180),o=m(s+.3963377774*r+.2158037573*n,3),a=m(s-.1055613458*r-.0638541728*n,3),l=m(s-.0894841775*r-1.291485548*n,3),c=-1.2684380046*o+2.6097574011*a-.3413193965*l,h=-.0041960863*o-.7034186147*a+1.707614701*l;return[dr(4.0767416621*o-3.3077115913*a+.2309699292*l),dr(c),dr(h)]}static RGBtoHSL(e,t,i){const s=Math.min(e,t,i),r=Math.max(e,t,i),n=(r+s)/2;let o,a;if(r===s)o=NaN,a=0;else{const l=r-s;a=n>.5?l/(2-r-s):l/(r+s),o=r===e?(t-i)/l+(t<i?6:0):r===t?(i-e)/l+2:(e-t)/l+4,o*=60}return[o,a,n]}static HSLtoRGB(e,t,i){if(0===t)return[i,i,i];const s=i<.5?i*(1+t):i+t-i*t,r=2*i-s;function n(e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+6*(s-r)*e:e<.5?s:e<2/3?r+(s-r)*(2/3-e)*6:r}return[n(e/360+1/3),n(e/360),n(e/360-1/3)]}static RGBtoHSB(e,t,i){const s=Math.min(e,t,i),r=Math.max(e,t,i);let n=NaN;if(s!==r){const o=r-s,a=(r-e)/o,l=(r-t)/o,c=(r-i)/o;n=e===r?c-l:t===r?2+a-c:4+l-a,n/=6,n<0&&(n+=1)}return[360*n,0===r?0:(r-s)/r,r]}static HSBtoRGB(e,t,i){isNaN(e)&&(e=0),e=(e%360+360)%360/360;let s=0,r=0,n=0;if(0===t)s=r=n=i;else{const o=6*(e-Math.floor(e)),a=o-Math.floor(o),l=i*(1-t),c=i*(1-t*a),h=i*(1-t*(1-a));switch(0|o){case 0:s=i,r=h,n=l;break;case 1:s=c,r=i,n=l;break;case 2:s=l,r=i,n=h;break;case 3:s=l,r=c,n=i;break;case 4:s=h,r=l,n=i;break;case 5:s=i,r=l,n=c}}return[s,r,n]}derive(t,i,s,r){const n=e.RGBtoHSB(this.r,this.g,this.b);let o=n[2];0==o&&s>1&&(o=.05);const a=((n[0]+t)%360+360)%360,l=Hs(0,n[1]*i,1);o=Hs(0,o*s,1);const c=Hs(0,this.a*r,1),h=e.HSBtoRGB(a,l,o);return h.push(c),e.fromArray(h)}brighter(){return this.derive(0,1,1/.7,1)}darker(){return this.derive(0,1,.7,1)}static interpolate(t,i){const s=e.tryParseFromString(t),r=e.tryParseFromString(i);return t=>{const i=(e,i)=>e*(1-t)+i*t;return new e(i(s.r,r.r),i(s.g,r.g),i(s.b,r.b),i(s.a,r.a)).toString()}}};ur.didDebug=!1,ur.nameToHex=Object.freeze({aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",transparent:"#00000000",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"});var pr=ur;function gr(e,t){return i=>Number(e)*(1-i)+Number(t)*i}var mr={};b(mr,{easeIn:()=>yr,easeInOut:()=>Cr,easeInOutQuad:()=>wr,easeInQuad:()=>br,easeOut:()=>vr,easeOutQuad:()=>Sr,inverseEaseOut:()=>xr,linear:()=>fr});var fr=e=>e,yr=e=>1-Math.cos(e*Math.PI/2),vr=e=>Math.sin(e*Math.PI/2),Cr=e=>-(Math.cos(e*Math.PI)-1)/2,br=e=>e*e,Sr=e=>1-m(1-e,2),wr=e=>e<.5?2*e*e:1-m(-2*e+2,2)/2,xr=e=>2*Math.asin(e)/Math.PI,Er=["initial","remove","update","add","trailing","end","none"],Mr={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},Ar=(e=>(e.Loop="loop",e.Reverse="reverse",e))(Ar||{});function Tr(e){return e.every(e=>e instanceof cr)?{nodes:e,selections:[]}:{nodes:[],selections:e}}var Dr=class{constructor(e){var t,i,s,r,n,o,a;this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=null==(t=e.autoplay)||t,this.ease=null!=(i=e.ease)?i:fr,this.phase=e.phase;const l=null!=(s=e.duration)?s:Mr[this.phase].animationDuration;this.duration=l*e.defaultDuration,this.delay=(null!=(r=e.delay)?r:0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,!0===e.skip&&(null==(n=this.onUpdate)||n.call(this,e.to,!1,this),null==(o=this.onStop)||o.call(this,this),null==(a=this.onComplete)||a.call(this,this),this.isComplete=!0),!1!==e.collapsable&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return e.from===e.to?0:"object"==typeof e.from&&wt(e.from,e.to)?t:0}play(e=!1){var t,i;this.isPlaying||this.isComplete||(this.isPlaying=!0,null==(t=this.onPlay)||t.call(this,this),this.autoplay&&(this.autoplay=!1,e&&(null==(i=this.onUpdate)||i.call(this,this.from,!0,this))))}pause(){this.isPlaying=!1}stop(){var e;this.isPlaying=!1,this.isComplete||(this.isComplete=!0,null==(e=this.onStop)||e.call(this,this))}update(e){var t,i;if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const s=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const r=this.interpolate(this.isReverse?1-this.delta:this.delta);null==(t=this.onUpdate)||t.call(this,r,!1,this);const n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,null==(i=this.onComplete)||i.call(this,this),e-(n-s)):0}get delta(){return this.ease(Hs(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if("object"!=typeof t||Vs(t))return this.interpolateValue(e,t);const i=[];for(const s in t){const r=this.interpolateValue(e[s],t[s]);null!=r&&i.push([s,r])}return e=>{const t={};for(const[s,r]of i)t[s]=r(e);return t}}interpolateValue(e,t){if(void 0!==e&&void 0!==t){if(Vs(e))return i=>e[Bs](t,i);try{switch(typeof e){case"number":return gr(e,t);case"string":return function(e,t){if("string"==typeof e)try{e=pr.fromString(e)}catch(t){e=pr.fromArray([0,0,0])}if("string"==typeof t)try{t=pr.fromString(t)}catch(e){t=pr.fromArray([0,0,0])}const i=gr(e.r,t.r),s=gr(e.g,t.g),r=gr(e.b,t.b),n=gr(e.a,t.a);return e=>pr.fromArray([i(e),s(e),r(e),n(e)]).toRgbaString()}(e,t);case"boolean":if(e===t)return()=>e}}catch(e){}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Ir={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Rr(e,t,i,s,r,n,o){const{fromFn:a,toFn:l,intermediateFn:c}=r,{nodes:h,selections:d}=Tr(s),u=(s,r)=>{var h;let d,u=0,p=0;for(const g of r){const m=s[u]===g,f={last:p>=r.length-1,lastLive:u>=s.length-1,prev:r[p-1],prevFromProps:d,prevLive:s[u-1],next:r[p+1],nextLive:s[u+(m?1:0)]},v=`${e}_${t}_${g.id}`;i.stopByAnimationId(v);let b="unknown";m?n&&o&&(b=kr(g,g.datum,n,o)):b="removed";const S=a(g,g.datum,b,f),{phase:w,start:x,finish:E,delay:M,duration:A}=S,T=C(S,["phase","start","finish","delay","duration"]),D=l(g,g.datum,b,f),{phase:I,start:R,finish:P,delay:k,duration:L}=D,N=C(D,["phase","start","finish","delay","duration"]),_=null==E&&null==P;i.animate({id:v,groupId:e,phase:null!=(h=null!=w?w:I)?h:"update",duration:null!=A?A:L,delay:null!=M?M:k,from:T,to:N,ease:vr,collapsable:_,onPlay:()=>{g.setProperties(y(y({},x),R))},onUpdate(e){g.setProperties(e),c&&g.setProperties(c(g,g.datum,b,f))},onStop:()=>{g.setProperties(y(y(y(y(y(y({},x),R),T),N),E),P))}}),m&&u++,p++,d=T}};let p=0;for(const s of d){const r=s.nodes();u(r.filter(e=>!s.isGarbage(e)),r),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:vr,onStop(){s.cleanup()}}),p++}u(h,h)}function Pr(e,t,i,s,r,n,o){const{nodes:a,selections:l}=Tr(s),{start:c,finish:h,phase:d}=o,u=null==h;i.animate({id:`${e}_${t}`,groupId:e,phase:null!=d?d:"update",from:r,to:n,ease:vr,collapsable:u,onPlay:()=>{if(c){for(const e of a)e.setProperties(c);for(const e of l)for(const t of e.nodes())t.setProperties(c)}},onUpdate(e){for(const t of a)t.setProperties(e);for(const t of l)for(const i of t.nodes())i.setProperties(e)},onStop:()=>{for(const e of a)e.setProperties(y(y({},n),h));for(const e of l)for(const t of e.nodes())t.setProperties(y(y({},n),h))}})}function kr(e,t,i,s){const r=i(e,t);return s.added.has(r)?"added":s.removed.has(r)?"removed":"updated"}var Lr=2*Math.PI;function Nr(e){return e%=Lr,(e+=Lr)%Lr}function _r(e){return e%=Lr,(e+=Lr)!==Lr&&(e%=Lr),e}function Or(e){return(e%=Lr)<-Math.PI?e+=Lr:e>=Math.PI&&(e-=Lr),e}function Fr(e,t,i){const s=Nr(e),r=Nr(t),n=_r(i);return r<=n?r<=s&&s<=n:r<=s||s<=n}function Gr(e){return e/180*Math.PI}function Br(e){return e/Math.PI*180}function Vr(e,t){return e=Nr(e),(t=Nr(t))-e+(e>t?2*Math.PI:0)}function Hr(e,t,i,s){return{x:e+i*Math.cos(s),y:t+i*Math.sin(s)}}var Ur=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(e){this[i]!==e&&(this[i]=e,this.invalid=!0)},enumerable:!0,configurable:!1})},zr=class e{constructor(){this.type="band",this.invalid=!0,this.interval=void 0,this.index=new Map,this.ordinalRange=[],this._domain=[],this.range=[0,1],this._bandwidth=1,this._step=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0,this.round=!1}static is(t){return t instanceof e}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&_.warnOnce("Expected update to not invalidate scale"))}set domain(e){this.invalid=!0;const t=[];this.index=new Map;const i=this.index;e.forEach(e=>{void 0===this.getIndex(e)&&i.set(e,t.push(e)-1)}),this._domain=t}get domain(){return this._domain}ticks(){this.refresh();let{interval:e=1}=this;"number"!=typeof e&&(e=Number(e));const t=Math.abs(Math.round(e));return this._domain.filter((e,i)=>i%t===0)}convert(e){this.refresh();const t=this.getIndex(e);if(void 0===t)return NaN;const i=this.ordinalRange[t];return void 0===i?NaN:i}invert(e){this.refresh();const t=this.ordinalRange.findIndex(t=>t===e);return this.domain[t]}invertNearest(e){var t;this.refresh();let i=-1,s=1/0;const r=this.ordinalRange.findIndex((t,r)=>{if(t===e)return!0;const n=Math.abs(e-t);return n<s&&(s=n,i=r),!1});return null!=(t=this.domain[r])?t:this.domain[i]}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=Hs(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this._paddingInner=Hs(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this._paddingOuter=Hs(0,e,1)}get paddingOuter(){return this._paddingOuter}update(){const e=this._domain.length;if(0===e)return;const t=this.round,i=this._paddingInner,s=this._paddingOuter,[r,n]=this.range,o=n-r,a=o/Math.max(1,e+2*s-i),l=t?Math.floor(a):a,c=r+(o-l*(e-i))/2,h=t?Math.round(c):c,d=l*(1-i),u=t?Math.round(d):d,p=a*(1-i),g=[];for(let t=0;t<e;t++)g.push(h+l*t);this._bandwidth=u,this._rawBandwidth=p,this._step=l,this.ordinalRange=g}getIndex(e){if(!(e instanceof Date))return this.index.get(e);const t=e.valueOf();let i=0;for(const e of this.index.keys()){if(e instanceof Date&&e.valueOf()===t)return i;i++}}};S([Ur],zr.prototype,"interval",2),S([Ur],zr.prototype,"range",2),S([Ur],zr.prototype,"round",2);var Wr=zr;function jr(e,t=[void 0]){return De((i,s,r)=>t.includes(r)?Ge(e)?e(r):e:r)}function Kr(e,t={}){const{optional:i=!1,property:s}=t;return De((r,n,o)=>{var a;const l=v(y({},t),{target:r,property:n});if(i&&void 0===o||e(o,l))return bt(r[n])&&!bt(o)?(r[n].set(o),r[n]):o;const c=null!=s?s:String(n).replace(/^_*/,""),h=null!=(a=r.constructor.className)?a:r.constructor.name.replace(/Properties$/,"");let d=zn(o);if(null!=d&&d.length>50){const e=d.length-50;d=d.slice(0,50)+`... (+${e} characters)`}return _.warn(`Property [${c}] of [${h}] cannot be set to [${d}]${e.message?`; expecting ${Hn(e,l)}`:""}, ignoring.`),Me},void 0,{optional:i})}var $r,Yr=(...e)=>{const t=[];return Vn((i,s)=>(t.length=0,e.every(e=>{const r=e(i,s);return r||t.push(Hn(e,s)),r})),()=>t.filter(Boolean).join(" AND "))},qr=(...e)=>Vn((t,i)=>e.some(e=>e(t,i)),t=>e.map(function(e){return t=>Hn(t,e)}(t)).filter(Boolean).join(" OR ")),Xr=Un(Vn((e,t)=>bt(e)||Be(e)&&bt(t.target[t.property]),"a properties object")),Zr=Un(Vn(e=>Be(e),"an object")),Qr=Vn(Ne,"a boolean"),Jr=Vn(Ge,"a function"),en=Vn(Ue,"a string"),tn=($r=Vn(We,"a number"),Object.assign($r,{restrict({min:e,max:t}={}){const i=["a number"],s=ze(e),r=ze(t);return s&&r?i.push(`between ${e} and ${t} inclusive`):s?i.push(`greater than or equal to ${e}`):r&&i.push(`less than or equal to ${t}`),Vn(i=>We(i)&&(!s||i>=e)&&(!r||i<=t),i.join(" "))}})),sn=Vn(e=>ze(e)&&isNaN(e),"NaN"),rn=tn.restrict({min:0}),nn=tn.restrict({min:0,max:1}),on=tn.restrict({min:-360,max:360}),an=qr(tn,sn),ln=function(e){return Object.assign(e,{restrict({length:e,minLength:t}={}){let i="an array";return ze(t)&&t>0?i="a non-empty array":ze(e)&&(i=`an array of length ${e}`),Vn(i=>Le(i)&&(!ze(e)||i.length===e)&&(!ze(t)||i.length>=t),i)}})}(Vn(Le,"an array")),cn=(e,t)=>Vn((t,i)=>Le(t)&&t.every(t=>e(t,i)),e=>{var i;const s=null!=(i=Hn(ln,e))?i:"";return t?`${s} of ${t}`:s}),hn=e=>We(e)||Oe(e),dn=e=>Vn((t,i)=>!hn(t)||!hn(i.target[e])||t<i.target[e],`to be less than ${e}`),un=e=>Vn((t,i)=>!hn(t)||!hn(i.target[e])||t>i.target[e],`to be greater than ${e}`),pn=Vn(Oe,"Date object"),gn=qr(pn,rn),mn="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",fn=Vn(e=>Ue(e)&&pr.validColorString(e),`color String. ${mn}`),yn=Vn(cn(fn),`color strings. ${mn}`),vn=cn(Qr,"boolean values"),Cn=cn(tn,"numbers"),bn=cn(en,"strings"),Sn=Vn(cn(pn),"Date objects"),wn=Vn(cn(Xr),"objects"),xn=Fn(["butt","round","square"],"a line cap"),En=Fn(["round","bevel","miter"],"a line join"),Mn=Vn(cn(rn),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),An=Fn(["top","right","bottom","left"],"a position"),Tn=Fn(["normal","italic","oblique"],"a font style"),Dn=qr(Fn(["normal","bold","bolder","lighter"],"a font weight"),tn.restrict({min:1,max:1e3})),In=Fn(["never","always","hyphenate","on-space"],"a text wrap strategy"),Rn=Fn(["left","center","right"],"a text align"),Pn=Fn(["top","middle","bottom"],"a vertical align"),kn=Fn(["ellipsis","hide"],"an overflow strategy"),Ln=Fn(["horizontal","vertical"],"a direction"),Nn=Fn(["inside","outside"],"a placement"),_n=qr(Fn(["exact","nearest"],"interaction range"),tn),On=Fn(["top","bottom","left","right"]);function Fn(e,t="a"){return Vn(t=>e.includes(t),`${t} keyword such as ${function(e){const t=e.map(e=>`'${e}'`);if(1===t.length)return t[0];const i=t.pop();return`${t.join(", ")} or ${i}`}(e)}`)}var Gn=qr(Yr(tn.restrict({min:1}),dn("maxSpacing")),sn),Bn=qr(Yr(tn.restrict({min:1}),un("minSpacing")),sn);function Vn(e,t){return e.message=t,e}function Hn(e,t){return Ge(e.message)?e.message(t):e.message}function Un(e){return Object.assign(e,{restrict:t=>Vn(e=>e instanceof t,i=>{var s;return null!=(s=Hn(e,i))?s:`an instance of ${t.name}`})})}function zn(e){if("number"==typeof e){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}return JSON.stringify(e)}var Wn=Vn(e=>We(e)&&e>0||e instanceof O,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),jn=class extends vt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6,this.color=void 0,this.interval=void 0,this.values=void 0}};S([Kr(Qr)],jn.prototype,"enabled",2),S([Kr(rn)],jn.prototype,"width",2),S([Kr(rn)],jn.prototype,"size",2),S([Kr(fn,{optional:!0})],jn.prototype,"color",2),S([Kr(Wn,{optional:!0})],jn.prototype,"interval",2),S([Kr(ln,{optional:!0})],jn.prototype,"values",2);var Kn=(e=>(e.X="x",e.Y="y",e))(Kn||{}),$n={constructedArrays:new WeakMap};function Yn(e,t){var i;null==(i=$n.constructedArrays)||i.set(e,t)}var qn=class e{constructor(t,i){this.invalid=!0,this.nice=!1,this.interval=void 0,this.tickCount=e.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.niceDomain=[],this.defaultClampMode="raw",this.domain=t,this.range=i}static is(t){return t instanceof e}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{range:t}=this,i=this.getDomain(),s=Math.abs(t[1]-t[0]),r=Math.abs(i[1]-i[0])/e+1,n=Math.floor(s),o=Math.min(r,n);return s/Math.max(1,o)}getDomain(){return this.nice&&(this.refresh(),this.niceDomain.length)?this.niceDomain:this.domain}convert(e,t){var i;const s=null!=(i=null==t?void 0:t.clampMode)?i:this.defaultClampMode;if(!this.domain||this.domain.length<2)return NaN;this.refresh();const r=this.getDomain().map(e=>this.transform(e)),[n,o]=r,{range:a}=this,[l,c]=a;if(e=this.transform(e),"clamped"===s){const[t,i]=zs(r.map(Number));if(Number(e)<t)return l;if(Number(e)>i)return c}return n===o?(l+c)/2:e===n?l:e===o?c:l+(Number(e)-Number(n))/(Number(o)-Number(n))*(c-l)}invert(e){this.refresh();const t=this.getDomain().map(e=>this.transform(e)),[i,s]=t,{range:r}=this,[n,o]=r,a=n>o;let l;return e<(a?o:n)?a?s:i:e>(a?n:o)?a?i:s:(l=n===o?this.toDomain((Number(i)+Number(s))/2):this.toDomain(Number(i)+(e-n)/(o-n)*(Number(s)-Number(i))),this.transformInvert(l))}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&_.warnOnce("Expected update to not invalidate scale"))}getPixelRange(){const[e,t]=this.range;return Math.abs(t-e)}};qn.defaultTickCount=5,qn.defaultMaxTickCount=6,S([Ur],qn.prototype,"domain",2),S([Ur],qn.prototype,"range",2),S([Ur],qn.prototype,"nice",2),S([Ur],qn.prototype,"interval",2),S([Ur],qn.prototype,"tickCount",2),S([Ur],qn.prototype,"minTickCount",2),S([Ur],qn.prototype,"maxTickCount",2);var Xn=qn,Zn={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function Qn(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+6e4*i;return Math.floor(s/864e5)}function Jn(e,t){const i=(t-new Date(e.getFullYear(),0,1).getDay()+7)%7,s=new Date(e.getFullYear(),0,i+1);return s<=e?Math.floor(Qn(e,s)/7)+1:0}function eo(e,t=e.getFullYear()){const i=new Date(t,0,1).getDay(),s=new Date(t,0,(4-i+7)%7-3+1);return s<=e?Math.floor(Qn(e,s)/7)+1:eo(e,t-1)}var to={a:e=>Zn.shortDays[e.getDay()],A:e=>Zn.days[e.getDay()],b:e=>Zn.shortMonths[e.getMonth()],B:e=>Zn.months[e.getMonth()],c:"%x, %X",d:(e,t)=>so(e.getDate(),2,null!=t?t:"0"),e:"%_d",f:(e,t)=>so(1e3*e.getMilliseconds(),6,null!=t?t:"0"),H:(e,t)=>so(e.getHours(),2,null!=t?t:"0"),I:(e,t)=>{const i=e.getHours()%12;return 0===i?"12":so(i,2,null!=t?t:"0")},j:(e,t)=>so(Qn(e)+1,3,null!=t?t:"0"),m:(e,t)=>so(e.getMonth()+1,2,null!=t?t:"0"),M:(e,t)=>so(e.getMinutes(),2,null!=t?t:"0"),L:(e,t)=>so(e.getMilliseconds(),3,null!=t?t:"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>so(e.getSeconds(),2,null!=t?t:"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>so(Jn(e,0),2,null!=t?t:"0"),V:(e,t)=>so(eo(e),2,null!=t?t:"0"),w:(e,t)=>so(e.getDay(),2,null!=t?t:"0"),W:(e,t)=>so(Jn(e,1),2,null!=t?t:"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>so(e.getFullYear()%100,2,null!=t?t:"0"),Y:(e,t)=>so(e.getFullYear(),4,null!=t?t:"0"),Z:e=>function(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${so(Math.floor(i/60),2,"0")}${so(Math.floor(i%60),2,"0")}`}(e),"%":()=>"%"},io={_:" ",0:"0","-":""};function so(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function ro(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(0!==i){const s=i>0?e.substring(0,i):e;t.push(s)}if(i<0)break;const s=e[i+1],r=io[s];null!=r&&i++;const n=e[i+1],o=to[n];if("function"==typeof o)t.push([o,r]);else if("string"==typeof o){const e=ro(o);t.push([e,r])}else t.push(`${null!=r?r:""}${n}`);e=e.substring(i+2)}return e=>{const i="number"==typeof e?new Date(e):e;return t.map(e=>"string"==typeof e?e:e[0](i,e[1])).join("")}}function no(e){return e instanceof Date?e.getTime():e}function oo(e,t){const i=ao(e,t);return e=>ro(i)(e)}function ao(e=[],t=e){let i=8;const s=e=>{e<i&&(i=e)};for(const t of e)s(lo(t));const r=no(t[0]),n=no(t.at(-1)),o=new Date(r).getFullYear(),a=new Date(n).getFullYear();return function(e,t,i){const s=no(i[0]),r=no(i.at(-1)),n=Math.abs(r-s),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",H,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",H,216e5,3,"%p"]," ",["day",z,6048e5,4,"%a"],["month",0===n?0:W,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",t||8===e?0:j,1/0,8,"%Y"]].filter(t=>{if("string"==typeof t)return!0;const[i,s,r,o]=t;return o>=e&&s<=n&&n<r}).reduce((e,t)=>("string"==typeof t?e.result.push(t):e.used.has(t[0])||(e.result.push(t),e.used.add(t[0])),e),{result:[],used:new Set}).result,a=o.findIndex(e=>"string"!=typeof e),l=o.length-[...o].reverse().findIndex(e=>"string"!=typeof e);return o.slice(a,l).map(e=>"string"==typeof e?e:e[4]).join("").replaceAll(/\s+/g," ").trim()}(i,a-o>0,e)}function lo(e){return Y.floor(e)<e?0:Z.floor(e)<e?1:ee.floor(e)<e?2:ie.floor(e)<e?3:pe.floor(e)<e?de.floor(e)<e?4:5:me.floor(e)<e?6:8}var co=(e,t=[])=>Object.assign(t,{fractionDigits:e});function ho(e,t,i,s,r){if(i<2)return go(e,t,t-e);const n=po(e,t,i,s,r);return isNaN(n)?co(0):go(e=Math.ceil(e/n)*n,t=Math.floor(t/n)*n,n)}var uo=[1,2,5,10];function po(e,t,i,s=0,r=1/0){const n=Math.abs(t-e),o=n/i,a=Math.floor(Math.log10(o)),l=Math.pow(10,a),c=uo.map(e=>{const t=e*l,o=Math.ceil(n/t);return{multiplier:e,isWithinBounds:o>=s&&o<=r,diffCount:Math.abs(o-i)}}).sort((e,t)=>e.isWithinBounds!==t.isWithinBounds?e.isWithinBounds?-1:1:e.diffCount-t.diffCount)[0].multiplier;return!c||isNaN(c)?NaN:c*l}function go(e,t,i){const s=Math.min(e,t),r=Math.max(e,t),n=Xs(i),o=Math.pow(10,n),a=Math.ceil((r-s)/i),l=co(n);for(let e=0;e<=a;e++){const t=s+i*e;l.push(Math.round(t*o)/o)}return l}function mo({start:e,stop:t,interval:i,count:s,availableRange:r}){return null!=s||(s=(t-e)/("number"==typeof i?i:1)),s>=r&&(_.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}var fo=class e extends Xn{constructor(){super([],[0,1]),this.type="time"}toDomain(e){return new Date(e)}static getTickInterval({start:t,stop:i,count:s,minCount:r,maxCount:n,target:o}){let a,l;const c=null!=s?s:Xn.defaultTickCount,h=null!=o?o:Math.abs(i-t)/Math.max(c,1),d=e.getIntervalIndex(h);if(0===d)l=Math.max(po(t,i,c,r,n),1),a=B;else if(d===e.tickIntervals.length)l=void 0===o?po(t/j,i/j,c,r,n):1,a=me;else{const t=h-e.tickIntervals[d-1][2]<e.tickIntervals[d][2]-h?d-1:d;[a,l]=e.tickIntervals[t]}return a.every(l)}static getIntervalIndex(t){let i=0;for(;i<e.tickIntervals.length&&t>e.tickIntervals[i][2];)i++;return i}invert(e){return new Date(super.invert(e))}ticks(){if(!this.domain||this.domain.length<2)return[];this.refresh();const[t,i]=this.getDomain().map(no),s=Math.min(t,i),r=Math.max(t,i),{interval:n,nice:o,tickCount:a,minTickCount:l,maxTickCount:c}=this;if(void 0!==n){const t=this.getPixelRange(),i=e.getTicksForInterval({start:s,stop:r,interval:n,availableRange:t});return null!=i?i:e.getDefaultTicks({start:s,stop:r,tickCount:a,minTickCount:l,maxTickCount:c})}if(o){if(2===a)return this.niceDomain;if(1===a)return this.niceDomain.slice(0,1)}return e.getDefaultTicks({start:s,stop:r,tickCount:a,minTickCount:l,maxTickCount:c})}static getDefaultTicks({start:t,stop:i,tickCount:s,minTickCount:r,maxTickCount:n}){const o=e.getTickInterval({start:t,stop:i,count:s,minCount:r,maxCount:n});return o?o.range(new Date(t),new Date(i)):[]}static getTicksForInterval({start:t,stop:i,interval:s,availableRange:r}){if(!s)return[];if(s instanceof O){const e=s.range(new Date(t),new Date(i));if(mo({start:t,stop:i,interval:s,count:e.length,availableRange:r}))return;return e}const n=Math.abs(s);if(mo({start:t,stop:i,interval:n,availableRange:r}))return;const o=[...e.tickIntervals];o.reverse();const a=o.find(e=>n%e[2]===0);if(a)return a[0].every(n/(a[2]/a[1])).range(new Date(t),new Date(i));let l=new Date(t);const c=new Date(i),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+n);return h}tickFormat({ticks:e,domain:t,specifier:i}){return null==i?oo(e,t):ro(i)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}updateNiceDomain(){let[e,t]=this.domain;for(let i=0;i<4;i++){this.updateNiceDomainIteration(e,t);const[i,s]=this.niceDomain;if(no(e)===no(i)&&no(t)===no(s))break;e=i,t=s}}updateNiceDomainIteration(t,i){const s=Math.min(no(t),no(i)),r=Math.max(no(t),no(i)),n=t>i,{interval:o}=this;let a;if(o instanceof O)a=o;else{const t="number"==typeof o?(r-s)/Math.max(o,1):this.tickCount;a=e.getTickInterval({start:s,stop:r,count:t,minCount:this.minTickCount,maxCount:this.maxTickCount})}if(a){const e=a.range(new Date(s),new Date(r),!0),t=n?[...e].reverse():e,i=t[0],o=t.at(-1);this.niceDomain=[i,o]}}};fo.tickIntervals=[[Y,1,V],[Y,5,5e3],[Y,15,15e3],[Y,30,3e4],[Z,1,H],[Z,5,3e5],[Z,15,9e5],[Z,30,18e5],[ee,1,U],[ee,3,108e5],[ee,6,216e5],[ee,12,432e5],[ie,1,z],[ie,2,1728e5],[de,1,W],[de,2,12096e5],[de,3,18144e5],[pe,1,2592e6],[pe,2,5184e6],[pe,3,7776e6],[pe,4,10368e6],[pe,6,15552e6],[me,1,j]];var yo=fo,vo=class e extends Wr{constructor(){super(...arguments),this.type="ordinal-time",this.tickCount=Xn.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.interval=void 0,this.index=new Map,this._domain=[]}static is(t){return t instanceof e}toDomain(e){return new Date(e)}set domain(e){if(this.invalid=!0,0===e.length)return void(this._domain=[]);const t=this.updateIndex(e);this._domain=t}get domain(){return this._domain}updateIndex(e){this.index=new Map;const{index:t}=this,i=[],s=[],r=e[0]>e.at(-1),n=r?0:1;e.forEach((o,a)=>{const l=e[a+1],c=r?o:this.toDomain(no(o)+1),h=r?this.toDomain(no(l)+1):l,d=r?[h,c]:[c,h];i.push(o),void 0!==l&&void 0===t.get(d)&&(s.push(Math.abs(no(h)-no(c))),t.set(d,a+n))}),s.sort((e,t)=>e-t);const o=s.length,a=Math.floor(o/2);this.medianInterval=o>2&&o%2==0?(s[a-1]+s[a+1])/2:s[a];const l=Math.max(0,yo.getIntervalIndex(this.medianInterval)-1),[c,h]=yo.tickIntervals[l],d=c.every(h),u=r?e.length-1:0,p=e[u],g=[d.floor(e[u]),p];return t.set(g,u),i}ticks(){if(!this.domain)return[];this.refresh();const[e,t]=[no(this.domain[0]),no(this.domain.at(-1))],i=Math.min(e,t),s=Math.max(e,t),r=e>t;let n;void 0!==this.interval&&(n=this.getTicksForInterval({start:i,stop:s,interval:this.interval}));const o=this.domain.length,{maxTickCount:a,tickCount:l}=this;let c,{minTickCount:h}=this;isFinite(a)&&o<=a&&(h=Math.max(1,o),c=this.medianInterval),null!=n||(n=this.getDefaultTicks({start:i,stop:s,tickCount:l,minTickCount:h,maxTickCount:a,isReversed:r,interval:c}));const d=new Set;return n.filter(e=>{const t=this.convert(e);return!isNaN(t)&&!d.has(t)&&(d.add(t),!0)})}getDefaultTicks({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:r,isReversed:n,interval:o}){const a=yo.getTickInterval({start:e,stop:t,count:i,minCount:s,maxCount:r,target:o});if(!a)return[];const l=Math.ceil(this.domain.length/r),c=[];for(const[e,t]of this.index.entries()){if(t%l>0)continue;const i=n?a.ceil(e[0]):a.floor(e[1]);c.splice(t,0,i)}return c}getTicksForInterval({start:e,stop:t,interval:i}){var s;const[r,n]=this.range,o=Math.abs(n-r);return null!=(s=yo.getTicksForInterval({start:e,stop:t,interval:i,availableRange:o}))?s:[]}convert(e){if("number"==typeof e&&(e=new Date(e)),!(e instanceof Date))return NaN;let t;this.refresh();for(const[i,s]of this.index.entries())if(e>=i[0]&&e<=i[1]){t=s;break}if(void 0===t)return NaN;const i=this.ordinalRange[t];return void 0===i?NaN:i}tickFormat({ticks:e,domain:t,specifier:i}){return null==i?oo(e,t):ro(i)}invert(e){return new Date(super.invert(e))}invertNearest(e){return new Date(super.invertNearest(e))}};S([Ur],vo.prototype,"tickCount",2),S([Ur],vo.prototype,"minTickCount",2),S([Ur],vo.prototype,"maxTickCount",2),S([Ur],vo.prototype,"interval",2);var Co=vo;function bo(e,t){return"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):null==e&&null==t?0:null==e?-1:null==t?1:String(e).localeCompare(String(t))}function So(e){return"function"==typeof e?e():e}function wo(e,t,i){for(const s in e){const r=i(So(e[s]),So(t[s]));if(0!==r)return r}return 0}var xo=class e extends cr{constructor(e){var t;super({isVirtual:null==e?void 0:e.isVirtual}),this.opts=e,this.opacity=1,this.lastBBox=void 0;const{zIndex:i,zIndexSubOrder:s}=null!=e?e:{};this.isContainerNode=!0,void 0!==i&&(this.zIndex=i),void 0!==s&&(this.zIndexSubOrder=s),this.name=null==(t=this.opts)?void 0:t.name}static is(t){return t instanceof e}onZIndexChange(){var e;super.onZIndexChange(),this.layer&&(null==(e=this._layerManager)||e.moveLayer(this.layer,this.zIndex,this.zIndexSubOrder))}isLayer(){return null!=this.layer}_setLayerManager(e){if(this._layerManager&&this.layer&&(this._layerManager.removeLayer(this.layer),this.layer=void 0),this.layer)throw new Error("AG Charts - unable to deregister scene rendering layer!");super._setLayerManager(e)}initialiseLayer(){var e;this.layer||this._layerManager&&!0===(null==(e=this.opts)?void 0:e.layer)&&(this.layer=this._layerManager.addLayer({name:this.name,zIndex:this.zIndex,zIndexSubOrder:this.zIndexSubOrder,getComputedOpacity:()=>this.getComputedOpacity(),getVisibility:()=>this.getVisibility()}))}getComputedOpacity(){let t=1;for(const i of this.traverseUp())i instanceof e&&(t*=i.opacity);return t}getVisibility(){for(const e of this.traverseUp())if(!e.visible)return!1;return!0}onVisibleChange(){this.layer&&(this.layer.enabled=this.visible)}markDirty(e,t=1){if(this.isVirtual)return void super.markDirty(e,t);let i=t;(t<2||null!=this.layer)&&(i=1),super.markDirty(e,t,i)}containsPoint(e,t){return!0}computeBBox(){return this.computeTransformMatrix(),e.computeBBox(this.children)}computeTransformedBBox(){return this.computeBBox()}preRender(){var e,t;const i=super.preRender();return i.groups+=1,i.nonGroups-=1,!0!==(null==(e=this.opts)?void 0:e.layer)||null!=this.layer||(i.nonGroups>0&&this.initialiseLayer(),(null==(t=this.opts)?void 0:t.nonEmptyChildDerivedZIndex)&&i.nonGroups>0&&this.deriveZIndexFromChildren()),i}deriveZIndexFromChildren(){var e;const t=this.children.filter(e=>e._childNodeCounts.nonGroups>0);this.sortChildren(t);const i=t.at(-1);this.zIndex=null!=(e=null==i?void 0:i.zIndex)?e:-1/0,this.zIndexSubOrder=null==i?void 0:i.zIndexSubOrder}render(e){var t,i;const{opts:{name:s}={},_debug:r}=this,{dirty:n,dirtyZIndex:o,layer:a,children:l,clipRect:c,dirtyTransform:h}=this;let{ctx:d,forceRender:u,clipBBox:p}=e;const{resized:g,stats:m}=e,f=d.getTransform(),C=n>=2||o||g;let b=C,S=!1;for(const e of l)if(b||(b=null==e.layerManager&&e.dirty>=1),S||(S=null!=e.layerManager&&e.dirty>=1),b)break;if(s&&(null==r||r({name:s,group:this,isDirty:C,isChildDirty:b,dirtyTransform:h,renderCtx:e,forceRender:u})),h)u="dirtyTransform";else if(a){const e=this.computeBBox();void 0!==this.lastBBox&&this.lastBBox.equals(e)||(u="dirtyTransform",this.lastBBox=e)}if(!(C||b||S||u))return s&&m&&(null==r||r({name:s,result:"skipping",renderCtx:e,counts:this.nodeCount,group:this})),a&&m&&(m.layersSkipped++,m.nodesSkipped+=this.nodeCount.count),void this.markClean({recursive:!1});const w=this.visible;if(a){if(d=a.context,d.save(),d.setTransform(a.pixelRatio,0,0,a.pixelRatio,0,0),"dirtyTransform"!==u&&(u=b||o),u&&a.clear(),p){const{width:t,height:i,x:n,y:o}=p;null==r||r(()=>({name:s,clipBBox:p,ctxTransform:d.getTransform(),renderCtx:e,group:this})),d.beginPath(),d.rect(n,o,t,i),d.clip()}d.setTransform(f)}else d.globalAlpha*=this.opacity;if(this.computeTransformMatrix(),this.matrix.toContext(d),c){const{x:t,y:i,width:n,height:o}=c;d.save(),null==r||r(()=>({name:s,clipRect:c,ctxTransform:d.getTransform(),renderCtx:e,group:this})),d.beginPath(),d.rect(t,i,n,o),d.clip(),p=this.matrix.transformBBox(c)}const x=this.hasVirtualChildren();o?(this.sortChildren(l),"dirtyTransform"!==u&&(u=!0)):x&&this.sortChildren(l);const E=u!==e.forceRender||p!==e.clipBBox||d!==e.ctx?v(y({},e),{ctx:d,forceRender:u,clipBBox:p}):e;let M=0;for(const e of l)e.visible&&w?u||0!==e.dirty?(d.save(),e.render(E),d.restore()):m&&(M+=e.nodeCount.count):(e.markClean(),m&&(M+=e.nodeCount.count));if(m&&(m.nodesSkipped+=M),super.render(e),c&&d.restore(),x)for(const e of this.virtualChildren)e.markClean({recursive:"virtual"});a&&(m&&m.layersRendered++,d.restore(),u&&a.snapshot(),null==(i=(t=a.context).verifyDepthZero)||i.call(t)),s&&m&&(null==r||r({name:s,result:"rendered",skipped:M,renderCtx:e,counts:this.nodeCount,group:this}))}sortChildren(e){this.dirtyZIndex=!1,e.sort((e,t)=>{var i,s;return wo([e.zIndex,...null!=(i=e.zIndexSubOrder)?i:[void 0,void 0],e.serialNumber],[t.zIndex,...null!=(s=t.zIndexSubOrder)?s:[void 0,void 0],t.serialNumber],bo)})}static computeBBox(e){let t=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of e){if(!n.visible)continue;const e=n.computeTransformedBBox();if(!e)continue;const{x:o,y:a,width:l,height:c}=e;o<t&&(t=o),a<s&&(s=a),o+l>i&&(i=o+l),a+c>r&&(r=a+c)}return new er(t,s,i-t,r-s)}setClipRectInGroupCoordinateSpace(e){this.clipRect=e?this.transformBBox(e):void 0}};xo.className="Group",S([sr({redraw:3,convertor:e=>Hs(0,e,1)})],xo.prototype,"opacity",2);var Eo=xo,Mo=class{constructor(e=[]){this.stops=e}},Ao=class extends Mo{constructor(e,t=0){super(e),this.angle=t}createGradient(e,t){const{stops:i,angle:s}=this,r=Nr(Gr(s+90)),n=Math.cos(r),o=Math.sin(r),a=t.width,l=t.height,c=t.x+.5*a,h=t.y+.5*l;if(a>0&&l>0){const t=Math.sqrt(l*l+a*a)/2,s=Math.atan2(l,a);let d;d=r<Math.PI/2?r:r<Math.PI?Math.PI-r:r<1.5*Math.PI?r-Math.PI:2*Math.PI-r;const u=t*Math.abs(Math.cos(d-s)),p=e.createLinearGradient(c+n*u,h+o*u,c-n*u,h-o*u);for(const e of i)p.addColorStop(e.offset,e.color);return p}return"black"}},To=/^linear-gradient\((.*?)deg,\s*(.*?)\s*\)$/i,Do=class e extends cr{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=e.defaultStyles.fill,this.stroke=e.defaultStyles.stroke,this.strokeWidth=e.defaultStyles.strokeWidth,this.lineDash=e.defaultStyles.lineDash,this.lineDashOffset=e.defaultStyles.lineDashOffset,this.lineCap=e.defaultStyles.lineCap,this.lineJoin=e.defaultStyles.lineJoin,this.opacity=e.defaultStyles.opacity,this.fillShadow=e.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}onFillChange(){const{fill:e}=this;let t;if((null==e?void 0:e.startsWith("linear-gradient"))&&(t=To.exec(e))){const e=parseFloat(t[1]),i=[],s=t[2],r=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let n;for(;n=r.exec(s);)i.push(n[0]);this.gradient=new Ao(i.map((e,t)=>({color:e,offset:t/(i.length-1)})),e)}else this.gradient=void 0}align(e,t){var i,s,r;const n=null!=(r=null==(s=null==(i=this.layerManager)?void 0:i.canvas)?void 0:s.pixelRatio)?r:1,o=Math.round(e*n)/n;return null==t?o:0===t?0:t<1?Math.ceil(t*n)/n:Math.round((t+e)*n)/n-o}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){if(this.fill){const{globalAlpha:i}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=i}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFill(e){var t,i;e.fillStyle=null!=(i=null==(t=this.gradient)?void 0:t.createGradient(e,this.computeBBox()))?i:this.fill}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){var t,i;const s=null!=(i=null==(t=this.layerManager)?void 0:t.canvas.pixelRatio)?i:1,r=this.fillShadow;(null==r?void 0:r.enabled)&&(e.shadowColor=r.color,e.shadowOffsetX=r.xOffset*s,e.shadowOffsetY=r.yOffset*s,e.shadowBlur=r.blur*s)}renderStroke(e,t){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=e;e.strokeStyle=this.stroke,e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.executeStroke(e,t),e.globalAlpha=i}}executeStroke(e,t){t?e.stroke(t):e.stroke()}containsPoint(e,t){return this.isPointInPath(e,t)}};Do.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},S([sr({redraw:2})],Do.prototype,"fillOpacity",2),S([sr({redraw:2})],Do.prototype,"strokeOpacity",2),S([sr({redraw:2,changeCb:e=>e.onFillChange()})],Do.prototype,"fill",2),S([sr({redraw:2})],Do.prototype,"stroke",2),S([sr({redraw:2})],Do.prototype,"strokeWidth",2),S([sr({redraw:2})],Do.prototype,"lineDash",2),S([sr({redraw:2})],Do.prototype,"lineDashOffset",2),S([sr({redraw:2})],Do.prototype,"lineCap",2),S([sr({redraw:2})],Do.prototype,"lineJoin",2),S([sr({redraw:2,convertor:e=>Hs(0,e,1)})],Do.prototype,"opacity",2),S([sr({redraw:2,checkDirtyOnAssignment:!0})],Do.prototype,"fillShadow",2);var Io=Do,Ro=class extends Io{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new er(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){var t;const{ctx:i,forceRender:s,stats:r}=e;if(0===this.dirty&&!s)return void(r&&(r.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:n,y1:o,x2:a,y2:l}=this;n=this.align(n),o=this.align(o),a=this.align(a),l=this.align(l);const{fill:c,opacity:h,isRange:d}=this;if(d&&c){const{fillOpacity:e}=this;i.fillStyle=c,i.globalAlpha=h*e,i.beginPath(),i.moveTo(n,o),i.lineTo(a,o),i.lineTo(a,l),i.lineTo(n,l),i.closePath(),i.fill()}const{stroke:u,strokeWidth:p,startLine:g,endLine:m}=this;if((g||m)&&u&&p){const{strokeOpacity:e,lineDash:t,lineDashOffset:s,lineCap:r,lineJoin:c}=this;i.strokeStyle=u,i.globalAlpha=h*e,i.lineWidth=p,t&&i.setLineDash(t),s&&(i.lineDashOffset=s),r&&(i.lineCap=r),c&&(i.lineJoin=c),i.beginPath(),g&&(i.moveTo(n,o),i.lineTo(a,o)),m&&(i.moveTo(a,l),i.lineTo(n,l)),i.stroke()}null==(t=this.fillShadow)||t.markClean(),super.render(e)}};Ro.className="Range",Ro.defaultStyles=v(y({},Io.defaultStyles),{strokeWidth:1}),S([sr({redraw:2})],Ro.prototype,"x1",2),S([sr({redraw:2})],Ro.prototype,"y1",2),S([sr({redraw:2})],Ro.prototype,"x2",2),S([sr({redraw:2})],Ro.prototype,"y2",2),S([sr({redraw:2})],Ro.prototype,"startLine",2),S([sr({redraw:2})],Ro.prototype,"endLine",2),S([sr({redraw:2})],Ro.prototype,"isRange",2);var Po=new WeakMap,ko=new WeakMap;function Lo(e,t){var i,s,r;const n=JSON.stringify(e,null,0);return Po.has(t)||Po.set(t,new Map),(null==(i=Po.get(t))?void 0:i.has(n))||null==(s=Po.get(t))||s.set(n,t(e)),null==(r=Po.get(t))?void 0:r.get(n)}function No(e){return(t,...i)=>{var s,r,n;const o=JSON.stringify(t,null,0);return ko.has(e)||ko.set(e,new Map),(null==(s=ko.get(e))?void 0:s.has(o))||null==(r=ko.get(e))||r.set(o,e(t,...i)),null==(n=ko.get(e))?void 0:n.get(o)}}function _o(e){const{redraw:t=3,changeCb:i}=null!=e?e:{};return sr({redraw:t,type:"font",changeCb:i})}var Oo=class e extends Io{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this._dirtyFont=!0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=e.defaultStyles.textAlign,this.textBaseline=e.defaultStyles.textBaseline}onTextChange(){var e,t;this.lines=null!=(t=null==(e=this.text)?void 0:e.split("\n").map(e=>e.trim()))?t:[]}get font(){return(null==this._font||this._dirtyFont)&&(this._dirtyFont=!1,this._font=Bo(this)),this._font}computeBBox(){const{x:t,y:i,lines:s,lineHeight:r,textBaseline:n,textAlign:o}=this,{top:a,left:l,width:c,height:h}=e.getTextSizeMultiline(s,Bo(this),n,o,r);return new er(t-l,i-a,c,h)}getLineHeight(t){var i,s;if(this.lineHeight)return this.lineHeight;const r=e.measureText(t,this.font,this.textBaseline,this.textAlign);return(null!=(i=r.fontBoundingBoxAscent)?i:r.emHeightAscent)+(null!=(s=r.fontBoundingBoxDescent)?s:r.emHeightDescent)}isPointInPath(e,t){const i=this.transformPoint(e,t),s=this.computeBBox();return!!s&&s.containsPoint(i.x,i.y)}render(e){const{ctx:t,forceRender:i,stats:s}=e;if(0===this.dirty&&!i)return void(s&&(s.nodesSkipped+=this.nodeCount.count));if(!this.lines.length||!this.layerManager)return void(s&&(s.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(t);const{fill:r,stroke:n,strokeWidth:o}=this;t.font=this.font,t.textAlign=this.textAlign,t.textBaseline=this.textBaseline;const a=this.layerManager.canvas.pixelRatio||1,{globalAlpha:l}=t;if(r){t.fillStyle=r,t.globalAlpha=l*this.opacity*this.fillOpacity;const{fillShadow:e}=this;(null==e?void 0:e.enabled)&&(t.shadowColor=e.color,t.shadowOffsetX=e.xOffset*a,t.shadowOffsetY=e.yOffset*a,t.shadowBlur=e.blur*a),this.renderLines((e,i,s)=>t.fillText(e,i,s))}if(n&&o){t.strokeStyle=n,t.lineWidth=o,t.globalAlpha=l*this.opacity*this.strokeOpacity;const{lineDash:e,lineDashOffset:i,lineCap:s,lineJoin:r}=this;e&&t.setLineDash(e),i&&(t.lineDashOffset=i),s&&(t.lineCap=s),r&&(t.lineJoin=r),this.renderLines((e,i,s)=>t.strokeText(e,i,s))}super.render(e)}renderLines(t){const{lines:i,x:s,y:r}=this,n=i.map(e=>this.getLineHeight(e)),o=n.reduce((e,t)=>e+t,0);let a=(n[0]-o)*e.getVerticalModifier(this.textBaseline);for(let e=0;e<i.length;e++)t(i[e],s,r+a),a+=n[e]}static wrapLines(t,i,s,r,n,o){const a="hide"!==o,l=new Go(r),c=t.split(/\r?\n/g);if(0===c.length)return{lines:void 0,truncated:!1};if("never"===n){const{text:t,truncated:s}=e.truncateLine(c[0],i,l,a?"auto":"never");return{lines:null!=t?[t]:void 0,truncated:s}}const h=[];let d=0,u=!1;for(const t of c){const o=e.wrapLine(t,i,s,l,r,n,d,a);if(null==o)return{lines:void 0,truncated:!1};if(h.push(...o.result),d=o.cumulativeHeight,o.truncated){u=!0;break}}return{lines:h,truncated:u}}static wrap(t,i,s,r,n,o="ellipsis"){var a;const{lines:l,truncated:c}=e.wrapLines(t,i,s,r,n,o);return{text:null!=(a=null==l?void 0:l.join("\n").trim())?a:"",truncated:c}}static wrapLine(t,i,s,r,n,o,a,l){if(!(t=t.trim()))return{result:[],truncated:!1,cumulativeHeight:a};const c=r.size(t);if(c.width<=i)return{result:[t],truncated:!1,cumulativeHeight:a+c.height};if(c.height>s||r.width("W")>i)return l?{result:[],truncated:!0,cumulativeHeight:a}:void 0;const h=t.split(/\s+/g),d=e.wrapLineSequentially(h,i,s,r,n,o,a,l);if(null==d)return;a=d.cumulativeHeight;let{lines:u}=d;if(!d.wordsBrokenOrTruncated&&!d.linesTruncated){const t=d.lines.length,s=e.wrapLineBalanced(h,i,r,t);s.length===u.length&&(u=s)}return{result:u.map(e=>e.join(" ")),truncated:d.linesTruncated,cumulativeHeight:a}}static breakWord(t,i,s,r,n){const o=i=>e.punctuationMarks.includes(t[i]),a=r?n.width("-"):0,l=[];let c=0,h=0;for(let e=0;e<t.length;e++){const r=t[e],o=n.width(r);c+o+a>(0===h?i:s)&&(l.push(e),c=0,h++),c+=o}const d=[];let u=0;for(const e of l){let i=t.substring(u,e);r&&i.length>0&&!o(e-1)&&!o(e)&&(i+="-"),d.push(i),u=e}return d.push(t.substring(u)),d}static truncateLine(e,t,i,s){e=e.trimEnd();const r=i.width(e);if(r>t&&"never"===s)return{text:void 0,truncated:!1};if(r<=t&&"force"!==s)return{text:e,truncated:!1};const n=i.width("…");let o=e,a=r;for(;o.length>0&&a+n>t;)o=o.slice(0,-1).trimEnd(),a=i.width(o);return a+n<=t?{text:`${o}…`,truncated:!0}:{text:void 0,truncated:!1}}static wrapLineSequentially(t,i,s,r,n,o,a,l){const{fontSize:c=0,lineHeight:h=c*e.defaultLineHeightRatio}=n,d="always"===o||"hyphenate"===o,u="hyphenate"===o,p=r.width(" ");let g=!1,m=!1;const f=[];let y=[],v=0;const C=()=>({lines:f,linesTruncated:m,wordsBrokenOrTruncated:g,cumulativeHeight:a}),b=()=>{if(!l)return;const t=y.join(" "),{text:s}=e.truncateLine(t,i,r,"force");return null!=s?(y.splice(0,y.length,s),m=!0,C()):void 0},S=()=>{const e=a+h;return!(e>=s||(y=[],v=0,a=e,f.push(y),0))};if(!S())return b();for(let s=0;s<t.length;s++){const n=t[s],o=r.width(n),a=0===y.length?0:p,c=v+a+o;if(c<=i)y.push(n),v=c;else if(o<=i){if(!S())return b();y.push(n),v=o}else{if(g=!0,!d){if(l){if(!S())return b();const{text:o}=e.truncateLine(n,i,r,"force");if(null==o)return;y.push(o),s<t.length-1&&(m=!0);break}return}{const t=i-v-a,s=e.breakWord(n,t,i,u,r);for(let e=0;e<s.length;e++){const t=s[e];if(t&&y.push(t),e===s.length-1)v=r.width(t);else if(!S())return b()}}}}return C()}static wrapLineBalanced(e,t,i,s){const r=e.reduce((e,t)=>e+i.width(t),0),n=i.width(" "),o=(r+n*(e.length-s-2))/s,a=[];let l=[],c=i.width(e[0]),h=!0;for(const s of e){const e=i.width(s);if(h){l=[],l.push(s),c=e,h=!1,a.push(l);continue}const r=c+n+e;r<=o?(l.push(s),c=r):r<=t?(l.push(s),h=!0):(l=[s],c=e,a.push(l))}return a}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}static getVerticalModifier(e){switch(e){case"top":case"hanging":return 0;case"bottom":case"alphabetic":case"ideographic":return 1;case"middle":return.5}}static get textContext(){if(!this._textContext){const e=xs("canvas");e.width=0,e.height=0,this._textContext=e.getContext("2d")}return this._textContext}static measureText(e,t,i,s){return this._measureText({text:e,font:t,textBaseline:i,textAlign:s})}static getTextSize(e,t){return this._getTextSize({text:e,font:t})}static getTextSizeMultiline(t,i,s=e.defaultStyles.textBaseline,r=e.defaultStyles.textAlign,n){var o,a;let l=0,c=0,h=0,d=0,u=0;for(const[e,n]of t.entries()){const p=this._measureText({text:n,font:i,textBaseline:s,textAlign:r});c=Math.max(c,p.actualBoundingBoxLeft),h=Math.max(h,p.width),0==e?(l+=p.actualBoundingBoxAscent,d+=p.actualBoundingBoxAscent):u+=null!=(o=p.fontBoundingBoxAscent)?o:p.emHeightAscent,e==t.length-1?d+=p.actualBoundingBoxDescent:u+=null!=(a=p.fontBoundingBoxDescent)?a:p.emHeightDescent}return null!=n&&(u=(t.length-1)*n),d+=u,l+=u*e.getVerticalModifier(s),{top:l,left:c,width:h,height:d}}};Oo.className="Text",Oo.defaultLineHeightRatio=1.15,Oo.defaultStyles=Object.assign({},Io.defaultStyles,{textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"}),Oo.ellipsis="…",Oo.punctuationMarks=[".",",","-",":",";","!","?","'",'"',"(",")"],Oo._measureText=No(({text:e,font:t,textBaseline:i,textAlign:s})=>{const r=Oo.textContext;return r.font!==t&&(r.font=t),r.textBaseline!==i&&(r.textBaseline=i),r.textAlign!==s&&(r.textAlign=s),r.measureText(e)}),Oo._getTextSize=No(({text:e,font:t})=>{const i=Oo.textContext;i.font!==t&&(i.font=t);const s=i.measureText(e);return{width:s.width,height:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent}}),S([sr({redraw:3})],Oo.prototype,"x",2),S([sr({redraw:3})],Oo.prototype,"y",2),S([sr({redraw:3,changeCb:e=>e.onTextChange()})],Oo.prototype,"text",2),S([_o()],Oo.prototype,"fontStyle",2),S([_o()],Oo.prototype,"fontWeight",2),S([_o()],Oo.prototype,"fontSize",2),S([_o()],Oo.prototype,"fontFamily",2),S([sr({redraw:3})],Oo.prototype,"textAlign",2),S([sr({redraw:3})],Oo.prototype,"textBaseline",2),S([sr({redraw:3})],Oo.prototype,"lineHeight",2);var Fo=Oo,Go=class{constructor(e){this.font=Ue(e)?e:Bo(e)}size(e){return e.includes("\n")?Fo.getTextSizeMultiline(e.split("\n").map(e=>e.trim()),this.font):Fo.getTextSize(e,this.font)}width(e){const{width:t}=this.size(e);return t}};function Bo(e){const{fontFamily:t,fontSize:i,fontStyle:s,fontWeight:r}=e;return[null!=s?s:"",null!=r?r:"",i+"px",t].join(" ").trim()}var Vo=class extends vt{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}getFont(){return Bo(this)}};function Ho(e){const{parallelFlipRotation:t=0,regularFlipRotation:i=0}=e,s=e.rotation?Nr(Gr(e.rotation)):0,r=!s&&t>=0&&t<=Math.PI?-1:1,n=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return e.parallel?o=r*Math.PI/2:-1===n&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:r,regularFlipFlag:n}}function Uo(e,t,i,s,r){const n=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI;if(e){if(!t&&!i)return"center";if(s*(n||o?-1:1)==-1)return"end"}else if(s*r===-1)return"end";return"start"}function zo(e,t,i,s,r){const{width:n,height:o}=t,a=new er(i,s,0,0);r.transformBBox(a,t);const{x:l,y:c}=t;return t.width=n,t.height=o,{point:{x:l,y:c},label:{text:e,width:n,height:o}}}S([Kr(Qr)],Vo.prototype,"enabled",2),S([Kr(fn,{optional:!0})],Vo.prototype,"color",2),S([Kr(Tn,{optional:!0})],Vo.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0})],Vo.prototype,"fontWeight",2),S([Kr(rn)],Vo.prototype,"fontSize",2),S([Kr(en)],Vo.prototype,"fontFamily",2),S([Kr(Jr,{optional:!0})],Vo.prototype,"formatter",2);var Wo=(e=>(e[e.SERIES_BACKGROUND_ZINDEX=0]="SERIES_BACKGROUND_ZINDEX",e[e.AXIS_GRID_ZINDEX=1]="AXIS_GRID_ZINDEX",e[e.AXIS_ZINDEX=2]="AXIS_ZINDEX",e[e.SERIES_CROSSLINE_RANGE_ZINDEX=3]="SERIES_CROSSLINE_RANGE_ZINDEX",e[e.SERIES_LAYER_ZINDEX=4]="SERIES_LAYER_ZINDEX",e[e.SERIES_HIGHLIGHT_ZINDEX=5]="SERIES_HIGHLIGHT_ZINDEX",e[e.AXIS_FOREGROUND_ZINDEX=6]="AXIS_FOREGROUND_ZINDEX",e[e.SERIES_CROSSHAIR_ZINDEX=7]="SERIES_CROSSHAIR_ZINDEX",e[e.SERIES_LABEL_ZINDEX=8]="SERIES_LABEL_ZINDEX",e[e.SERIES_CROSSLINE_LINE_ZINDEX=9]="SERIES_CROSSLINE_LINE_ZINDEX",e[e.SERIES_ANNOTATION_ZINDEX=10]="SERIES_ANNOTATION_ZINDEX",e[e.LEGEND_ZINDEX=11]="LEGEND_ZINDEX",e[e.NAVIGATOR_ZINDEX=12]="NAVIGATOR_ZINDEX",e))(Wo||{});function jo(e){return null!=e&&Object.hasOwn(e,"toString")&&Ue(e.toString())}function Ko(e){return null!=e&&Object.hasOwn(e,"valueOf")&&We(e.valueOf())}function $o(e){return We(e)||Oe(e)||Ko(e)}function Yo(e,t){return null!=e&&(!t||$o(e))}function qo(e){return jo(e)&&Object.hasOwn(e,"id")?e.id:e}var Xo=e=>"value"===e?Vn((e,t)=>"line"===t.target.type,e=>"range"===e.target.type?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):Vn((e,t)=>"range"===t.target.type,e=>"line"===e.target.type?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),Zo=(e,t,i,s)=>{const r="line"===e&&void 0!==t,n="range"===e&&void 0!==i;if(!r&&!n)return!0;const[o,a]=null!=i?i:[t,void 0],l=Xn.is(s)||Co.is(s),c=Yo(o,l)&&!isNaN(s.convert(o)),h=Yo(a,l)&&!isNaN(s.convert(a));if(r&&c||n&&c&&h)return!0;const d=["Expecting crossLine"];return n?(c||d.push(`range start ${zn(o)}`),h||d.push(`${c?"":"and "}range end ${zn(a)}`)):d.push(`value ${zn(o)}`),d.push("to match the axis scale domain."),_.warnOnce(d.join(" ")),!1},Qo={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},topLeft:{xTranslationDirection:1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:-1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:1},bottomRight:{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:1,yTranslationDirection:0},insideRight:{xTranslationDirection:-1,yTranslationDirection:0},insideTop:{xTranslationDirection:0,yTranslationDirection:1},insideBottom:{xTranslationDirection:0,yTranslationDirection:-1},insideTopLeft:{xTranslationDirection:1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomRight:{xTranslationDirection:-1,yTranslationDirection:-1}},Jo={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},topLeft:{xTranslationDirection:-1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},bottomRight:{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:0,yTranslationDirection:1},insideRight:{xTranslationDirection:0,yTranslationDirection:-1},insideTop:{xTranslationDirection:-1,yTranslationDirection:0},insideBottom:{xTranslationDirection:1,yTranslationDirection:0},insideTopLeft:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:-1},insideBottomRight:{xTranslationDirection:1,yTranslationDirection:-1}};function ea({yDirection:e,padding:t=0,position:i="top",bbox:s}){const r=e?Qo:Jo,{xTranslationDirection:n,yTranslationDirection:o}=r[i];return{xTranslation:n*(t+(e?s.width:s.height)/2),yTranslation:o*(t+(e?s.height:s.width)/2)}}var ta=({yDirection:e,xEnd:t,yStart:i,yEnd:s})=>e?{x:t/2,y:i}:{x:t,y:isNaN(s)?i:(i+s)/2},ia=({yDirection:e,xStart:t,xEnd:i,yStart:s,yEnd:r})=>e?{x:t,y:isNaN(r)?s:(s+r)/2}:{x:i/2,y:s},sa=({yDirection:e,xEnd:t,yStart:i,yEnd:s})=>e?{x:t,y:isNaN(s)?i:(i+s)/2}:{x:t/2,y:isNaN(s)?i:s},ra=({yDirection:e,xStart:t,xEnd:i,yStart:s,yEnd:r})=>e?{x:i/2,y:isNaN(r)?s:r}:{x:t,y:isNaN(r)?s:(s+r)/2},na=({yDirection:e,xStart:t,xEnd:i,yStart:s})=>e?{x:t/2,y:s}:{x:i,y:s},oa=({yDirection:e,xStart:t,yStart:i,yEnd:s})=>e?{x:t,y:isNaN(s)?i:s}:{x:t,y:i},aa=({yDirection:e,xEnd:t,yStart:i,yEnd:s})=>e?{x:t,y:i}:{x:t,y:isNaN(s)?i:s},la=({yDirection:e,xStart:t,xEnd:i,yStart:s,yEnd:r})=>e?{x:i,y:isNaN(r)?s:r}:{x:t,y:isNaN(r)?s:r},ca={top:{c:ta},bottom:{c:ra},left:{c:ia},right:{c:sa},topLeft:{c:na},topRight:{c:aa},bottomLeft:{c:oa},bottomRight:{c:la},inside:{c:({xEnd:e,yStart:t,yEnd:i})=>({x:e/2,y:isNaN(i)?t:(t+i)/2})},insideLeft:{c:ia},insideRight:{c:sa},insideTop:{c:ta},insideBottom:{c:ra},insideTopLeft:{c:na},insideBottomLeft:{c:oa},insideTopRight:{c:aa},insideBottomRight:{c:la}},ha=Fn(["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","inside","insideLeft","insideRight","insideTop","insideBottom","insideTopLeft","insideBottomLeft","insideTopRight","insideBottomRight"],"crossLine label position"),da=class{constructor(){this.enabled=void 0,this.text=void 0,this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)",this.position=void 0,this.rotation=void 0,this.parallel=void 0}};S([Kr(Qr,{optional:!0})],da.prototype,"enabled",2),S([Kr(en,{optional:!0})],da.prototype,"text",2),S([Kr(Tn,{optional:!0})],da.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0})],da.prototype,"fontWeight",2),S([Kr(rn)],da.prototype,"fontSize",2),S([Kr(en)],da.prototype,"fontFamily",2),S([Kr(tn)],da.prototype,"padding",2),S([Kr(fn,{optional:!0})],da.prototype,"color",2),S([Kr(ha,{optional:!0})],da.prototype,"position",2),S([Kr(on,{optional:!0})],da.prototype,"rotation",2),S([Kr(Qr,{optional:!0})],da.prototype,"parallel",2);var ua=class e{constructor(){this.id=Gs(this),this.enabled=void 0,this.type=void 0,this.range=void 0,this.value=void 0,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=void 0,this.strokeOpacity=void 0,this.lineDash=void 0,this.label=new da,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.group=new Eo({name:`${this.id}`,layer:!0,zIndex:e.LINE_LAYER_ZINDEX}),this.labelGroup=new Eo({name:`${this.id}`,layer:!0,zIndex:e.LABEL_LAYER_ZINDEX}),this.crossLineRange=new Ro,this.crossLineLabel=new Fo,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1;const{group:t,labelGroup:i,crossLineRange:s,crossLineLabel:r}=this;t.append(s),i.append(r),s.pointerEvents=1}update(e){const{enabled:t,data:i,type:s,value:r,range:n,scale:o}=this;if(!(s&&o&&t&&e&&Zo(s,r,n,o)&&0!==i.length))return this.group.visible=!1,void(this.labelGroup.visible=!1);this.group.visible=e,this.labelGroup.visible=e,this.group.zIndex=this.getZIndex(this.isRange),this.updateNodes()}calculateLayout(e,t){if(!e)return;if(!this.createNodeData(t))return;const{sideFlag:i,gridLength:s,data:r}=this,n=[],o=i*s,a=r[0],l=r[1],c=new er(Math.min(0,o),Math.min(a,l),Math.abs(0-o),Math.abs(a-l));n.push(c);const h=this.computeLabelBBox();return h&&n.push(h),er.merge(n)}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}createNodeData(e){var t,i,s;const{scale:r,gridLength:n,sideFlag:o,direction:a,label:{position:l="top"},clippedRange:c,strokeWidth:h=0}=this;if(this.data=[],!r)return!1;const d=null!=(t=r.bandwidth)?t:0,u=null!=(i=r.step)?i:0,p=(e?-1:1)*(r instanceof Wr?(u-d)/2:0),[g,m]=[0,o*n];let[f,y]=this.getRange();const v=void 0===y&&Co.is(r)?d/2+p:0;let[C,b]=[Number(r.convert(f,{clampMode:"clamped"}))-p+v,r.convert(y,{clampMode:"clamped"})+d+p];C=Us(C,c),b=Us(b,c),[f,y]=[Number(r.convert(f))+v,r.convert(y)+d];const S=(f===C||y===b||C!==b)&&Math.abs(b-C)>0;if(S&&C>b&&([C,b]=[b,C],[f,y]=[y,f]),f-p>=C&&(f-=p),y+p<=b&&(y+=p),this.isRange=S,this.startLine=h>0&&f>=C&&f<=C+p,this.endLine=h>0&&y>=b-d-p&&y<=b,!S&&!this.startLine&&!this.endLine)return!1;if(this.data=[C,b],this.label.enabled){const e="y"===a,{c:t=ta}=null!=(s=ca[l])?s:{},{x:i,y:r}=t({yDirection:e,xStart:g,xEnd:m,yStart:C,yEnd:b});this.labelPoint={x:i,y:r}}return!0}updateRangeNode(){var e;const{crossLineRange:t,sideFlag:i,gridLength:s,data:r,startLine:n,endLine:o,isRange:a,fill:l,fillOpacity:c,stroke:h,strokeWidth:d,lineDash:u}=this;t.x1=0,t.x2=i*s,t.y1=r[0],t.y2=r[1],t.startLine=n,t.endLine=o,t.isRange=a,t.fill=l,t.fillOpacity=null!=c?c:1,t.stroke=h,t.strokeWidth=null!=d?d:1,t.strokeOpacity=null!=(e=this.strokeOpacity)?e:1,t.lineDash=u}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}positionLabel(){const{crossLineLabel:e,labelPoint:{x:t,y:i}={},label:{parallel:s,rotation:r,position:n="top",padding:o=0},direction:a,parallelFlipRotation:l,regularFlipRotation:c}=this;if(void 0===t||void 0===i)return;const{defaultRotation:h,configuredRotation:d}=Ho({rotation:r,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});e.rotation=h+d,e.textBaseline="middle",e.textAlign="center";const u=e.computeTransformedBBox();if(!u)return;const p="y"===a,{xTranslation:g,yTranslation:m}=ea({yDirection:p,padding:o,position:n,bbox:u});e.translationX=t+g,e.translationY=i+m}getZIndex(t=!1){return t?e.RANGE_LAYER_ZINDEX:e.LINE_LAYER_ZINDEX}getRange(){var e;const{value:t,range:i,scale:s}=this,r=Xn.is(s)||Co.is(s),n=null!=(e=null==i?void 0:i[0])?e:t;let o=null==i?void 0:i[1];return r||void 0!==o||(o=n),r&&n===o&&(o=void 0),[n,o]}computeLabelBBox(){const{label:e}=this;if(!e.enabled)return;const t=new Fo;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text;const{labelPoint:{x:i,y:s}={},label:{parallel:r,rotation:n,position:o="top",padding:a=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(void 0===i||void 0===s)return;const{configuredRotation:d}=Ho({rotation:n,parallel:r,regularFlipRotation:h,parallelFlipRotation:c});t.rotation=d,t.textBaseline="middle",t.textAlign="center";const u=t.computeTransformedBBox();if(!u)return;const p="y"===l,{xTranslation:g,yTranslation:m}=ea({yDirection:p,padding:a,position:o,bbox:u});return t.translationX=i+g,t.translationY=s+m,t.computeTransformedBBox()}calculatePadding(e){var t,i,s,r,n,o,a,l;const{isRange:c,startLine:h,endLine:d,direction:u,label:{padding:p=0,position:g="top"}}=this;if(!c&&!h&&!d)return;const m=this.computeLabelBBox();if(null==(null==m?void 0:m.x)||null==(null==m?void 0:m.y))return;const f=function({yDirection:e,bbox:t,padding:i=0,position:s="top"}){const r={};return s.startsWith("inside")||("top"!==s||e?"bottom"!==s||e?"left"===s&&e?r.left=i+t.width:"right"===s&&e&&(r.right=i+t.width):r.bottom=i+t.height:r.top=i+t.height),r}({yDirection:"y"===u,padding:p,position:g,bbox:m});e.left=Math.max(null!=(t=e.left)?t:0,null!=(i=f.left)?i:0),e.right=Math.max(null!=(s=e.right)?s:0,null!=(r=f.right)?r:0),e.top=Math.max(null!=(n=e.top)?n:0,null!=(o=f.top)?o:0),e.bottom=Math.max(null!=(a=e.bottom)?a:0,null!=(l=f.bottom)?l:0)}};ua.LINE_LAYER_ZINDEX=9,ua.RANGE_LAYER_ZINDEX=3,ua.LABEL_LAYER_ZINDEX=8,ua.className="CrossLine",S([Kr(Qr,{optional:!0})],ua.prototype,"enabled",2),S([Kr(Fn(["range","line"],"a crossLine type"),{optional:!0})],ua.prototype,"type",2),S([Kr(Yr(Xo("range"),ln.restrict({length:2})),{optional:!0})],ua.prototype,"range",2),S([Kr(Xo("value"),{optional:!0})],ua.prototype,"value",2),S([Kr(fn,{optional:!0})],ua.prototype,"fill",2),S([Kr(nn,{optional:!0})],ua.prototype,"fillOpacity",2),S([Kr(fn,{optional:!0})],ua.prototype,"stroke",2),S([Kr(tn,{optional:!0})],ua.prototype,"strokeWidth",2),S([Kr(nn,{optional:!0})],ua.prototype,"strokeOpacity",2),S([Kr(Mn,{optional:!0})],ua.prototype,"lineDash",2);var pa=ua,ga=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){var t;const i=Ue(e)?e:e.optionsKey;null==(t=this.moduleMap.get(i))||t.moduleInstance.destroy(),this.moduleMap.delete(i)}getModule(e){var t;return null==(t=this.moduleMap.get(Ue(e)?e:e.optionsKey))?void 0:t.moduleInstance}isEnabled(e){return this.moduleMap.has(Ue(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){var e;for(const t of this.moduleMap.keys())null==(e=this.moduleMap.get(t))||e.moduleInstance.destroy();this.moduleMap.clear()}},ma={};function fa(e,t){const{nodes:i,selections:s}=Tr(e);for(const e of s){for(const i of e.nodes()){const e=t(i,i.datum);i.setProperties(e)}e.cleanup()}for(const e of i){const i=t(e,e.datum);e.setProperties(i)}}b(ma,{resetMotion:()=>fa});var ya=class{constructor(e,t,i){this.states=t,this.preTransitionCb=i,this.debug=Is.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,"color: green")}transition(e,t){var i,s;const r=this.states[this.state],n=null==r?void 0:r[e];if(!n)return void this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.state}`,"color: grey");let o=this.state;return"string"==typeof n?o=n:"object"==typeof n&&(o=n.target),this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${o}`,"color: green"),null==(i=this.preTransitionCb)||i.call(this,this.state,o),this.state=o,"function"==typeof n?n(t):"object"==typeof n&&(null==(s=n.action)||s.call(n,t)),this.state}},va=e=>`(${e})`,Ca=e=>`${va(e)}?`,ba=e=>Ca(`?:${e}`),Sa=new RegExp(["^",ba(`${Ca(".")}${va("[<>=^]")}`),Ca("[+\\-( ]"),Ca("[$€£¥₣₹#]"),Ca("0"),Ca("\\d+"),Ca(","),ba(`\\.${va("\\d+")}`),Ca("~"),Ca("[%a-z]"),"$"].join(""),"i"),wa=new RegExp(["^",va(".*?"),`#\\{${va(".+?")}\\}`,va(".*?"),"$"].join(""));function xa(e){let t,i;const s=wa.exec(e);s&&([,t,e,i]=s);const r=Sa.exec(e);if(!r)throw new Error(`The number formatter is invalid: ${e}`);const[,n,o,a,l,c,h,d,u,p,g]=r;return{fill:n,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:d,precision:parseInt(u),trim:Boolean(p),type:g,prefix:t,suffix:i}}function Ea(e){const t="string"==typeof e?xa(e):e,{fill:i,align:s,sign:r="-",symbol:n,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=t;let{trim:p}=t;const g=void 0===u||isNaN(u);let m,f;if(c)if(c in Ta&&c in Aa)m=g?Aa[c]:Ta[c];else if(c in Ta)m=Ta[c];else{if(!(c in Aa))throw new Error(`The number formatter type is invalid: ${c}`);m=Aa[c]}else m=Ta.g,p=!0;return f=null==u||g?c?6:12:u,e=>{let t=m(e,f);return p&&(t=t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(t=function(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),r=e.substring(i);for(let e=s.length-3;e>0;e-=3)s.splice(e,0,t);return`${s.join("")}${r}`}(t,l)),t=function(e,t,i=""){if("("===i)return e>=0?t:`(${t})`;return`${e>=0?"+"===i?"+":"":"−"}${t}`}(e,t,r),n&&"#"!==n&&(t=`${n}${t}`),"#"===n&&"x"===c&&(t=`0x${t}`),"s"===c&&(t=`${t}${function(e){return Pa[Da(e)]}(e)}`),"%"!==c&&"p"!==c||(t=`${t}%`),null==a||isNaN(a)||(t=function(e,t,i=" ",s=">"){let r=e;if(">"!==s&&s){if("<"===s)r=r.padEnd(t,i);else if("^"===s){const e=Math.max(0,t-r.length),s=Math.ceil(e/2),n=Math.floor(e/2);r=r.padStart(s+r.length,i),r=r.padEnd(n+r.length,i)}}else r=r.padStart(t,i);return r}(t,a,null!=i?i:o,s)),t=`${h}${t}${d}`,t}}var Ma=e=>Math.floor(Math.abs(e)),Aa={b:e=>Ma(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Ma(e).toString(8),x:e=>Ma(e).toString(16),X:e=>Aa.x(e).toUpperCase(),n:e=>Aa.d(e),"%":e=>`${Ma(100*e).toFixed(0)}`},Ta={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Ta.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Ta.f(e,t).toUpperCase(),g:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>Ta.g(e,t).toUpperCase(),n:(e,t)=>Ta.g(e,t),p:(e,t)=>Ta.r(100*e,t),r:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i))-(t-1);if(s<=0)return i.toFixed(-s);const r=Math.pow(10,s);return(Math.round(i/r)*r).toFixed()},s:(e,t)=>{const i=Da(e);return Ta.r(e/Math.pow(10,i),t)},"%":(e,t)=>Ta.f(100*e,t)};function Da(e){return Hs(Ia,e?3*Math.floor(Math.log10(Math.abs(e))/3):0,Ra)}var Ia=-24,Ra=24,Pa={[Ia]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[Ra]:"Y"};function ka(e,t){const i=xa(null!=t?t:",f"),{precision:s}=i;(null==s||isNaN(s))&&("f"===i.type||"%"===i.type?i.precision=Math.max(...e.map(e=>{if("number"!=typeof e||0===e)return 0;const t=Math.floor(Math.log10(Math.abs(e))),s=i.type?6:12,r=e.toExponential(s-1).replace(/\.?0+e/,"e"),n=r.indexOf(".");if(n<0)return t>=0?0:-t;const o=r.indexOf("e")-n;return Math.max(0,o-t-1)})):i.type&&!(i.type in Ta)||(i.precision=Math.max(...e.map(e=>{if("number"!=typeof e)return 0;const t=e.toExponential((i.type?6:12)-1).replace(/\.?0+e/,"e");return t.substring(0,t.indexOf("e")).replace(".","").length}))));const r=Ea(i);return e=>r(Number(e))}var La=class e extends Xn{constructor(){super([1,10],[0,1]),this.type="log",this.base=10,this.baseLog=k,this.basePow=k,this.log=e=>Math.min(...this.domain)>=0?this.baseLog(e):-this.baseLog(-e),this.pow=e=>Math.min(...this.domain)>=0?this.basePow(e):-this.basePow(-e),this.defaultClampMode="clamped"}toDomain(e){return e}transform(e){return Math.min(...this.domain)>=0?Math.log(e):-Math.log(-e)}transformInvert(e){return Math.min(...this.domain)>=0?Math.exp(e):-Math.exp(-e)}refresh(){this.base<=0&&(this.base=0,_.warnOnce("expecting a finite Number greater than to 0")),super.refresh()}update(){!this.domain||this.domain.length<2||(this.baseLog=e.getBaseLogMethod(this.base),this.basePow=e.getBasePowerMethod(this.base),this.nice&&this.updateNiceDomain())}updateNiceDomain(){const[e,t]=this.domain,i=e>t?Math.ceil:Math.floor,s=e>t?Math.floor:Math.ceil,r=this.pow(i(this.log(e))),n=this.pow(s(this.log(t)));this.niceDomain=[r,n]}ticks(){var e;const t=null!=(e=this.tickCount)?e:10;if(!this.domain||this.domain.length<2||t<1)return[];this.refresh();const i=this.base,[s,r]=this.getDomain(),n=Math.min(s,r),o=Math.max(s,r);let a=this.log(n),l=this.log(o);if(this.interval){const e=Math.abs(this.interval),t=Math.abs(l-a);let i=go(a,l,Math.min(t,e));i=co(i.fractionDigits,i.map(e=>this.pow(e)).filter(e=>e>=n&&e<=o));const s=this.getPixelRange();if(!mo({start:n,stop:o,interval:e,count:i.length,availableRange:s}))return i}if(i%1!=0||l-a>=t){let e=ho(a,l,Math.min(l-a,t));return e=co(e.fractionDigits,e.map(e=>this.pow(e))),e}const c=[],h=n>0;a=Math.floor(a)-1,l=Math.round(l)+1;const d=Ws(this.range)/t;let u=1/0;for(let e=a;e<=l;e++){const t=this.convert(this.pow(e+1));for(let s=1;s<i;s++){const r=h?s:i-s+1,a=this.pow(e)*r,l=this.convert(a),p=Math.abs(u-l),g=Math.abs(l-t);a>=n&&a<=o&&(1===s||p>=d&&g>=d||0===c.length)&&(c.push(a),u=l)}}return c}tickFormat({count:e,ticks:t,specifier:i}){return e!==1/0&&null==t&&this.ticks(),null!=i||(i=10===this.base?".0e":","),Ue(i)?Ea(i):i}static getBaseLogMethod(e){switch(e){case 10:return Math.log10;case Math.E:return Math.log;case 2:return Math.log2;default:const t=Math.log(e);return e=>Math.log(e)/t}}static getBasePowerMethod(e){switch(e){case 10:return e=>e>=0?m(10,e):1/m(10,-e);case Math.E:return Math.exp;default:return t=>m(e,t)}}};S([Ur],La.prototype,"base",2);var Na=La,_a=class e{constructor(e,t,i=!0){this.parentNode=e,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Is.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(cr,t)?()=>new t:t}static select(t,i,s=!0){return new e(t,i,s)}static selectAll(e,t){const i=[],s=e=>{t(e)&&i.push(e),e.children.forEach(s)};return s(e),i}static selectByClass(t,i,...s){return e.selectAll(t,e=>e instanceof i||s.some(t=>e instanceof t))}static selectByTag(t,i){return e.selectAll(t,e=>e.tag===i)}createNode(e,t,i){const s=this.nodeFactory(e);return s.datum=e,null==t||t(s),null==i?this._nodes.push(s):this._nodes.splice(i,0,s),this.parentNode.appendChild(s),s}update(e,t,i){if(this.garbageBin.size>0&&this.debug(`Selection - update() called with pending garbage: ${e}`),i){const s=new Map(e.map((e,t)=>[i(e),[e,t]]));for(const[e,t]of this._nodesMap.entries())if(s.has(t)){const[i]=s.get(t);e.datum=i,this.garbageBin.delete(e),s.delete(t)}else this.garbageBin.add(e);for(const[e,[i,r]]of s.entries())this._nodesMap.set(this.createNode(i,t,r),e)}else{const i=Math.max(e.length,this.data.length);for(let s=0;s<i;s++)s>=e.length?this.garbageBin.add(this._nodes[s]):s>=this._nodes.length?this.createNode(e[s],t):(this._nodes[s].datum=e[s],this.garbageBin.delete(this._nodes[s]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(e=>!this.garbageBin.has(e)||(this._nodesMap.delete(e),this.garbageBin.delete(e),this.parentNode.removeChild(e),!1))),this}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}hasGarbage(){return this.garbageBin.size>0}each(e){for(const t of this._nodes.entries())e(t[1],t[1].datum,t[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const t=this._nodes[e],i=this._nodes[e].datum;yield{node:t,datum:i,index:e}}}select(t){return e.selectAll(this.parentNode,t)}selectByClass(t){return e.selectByClass(this.parentNode,t)}selectByTag(t){return e.selectByTag(this.parentNode,t)}nodes(){return this._nodes}};function Oa(e,t,i,s){const r=e-i,n=t-s;return r*r+n*n}function Fa(e,t,i,s,r,n,o){if(i===r&&s===n)return Math.min(o,Oa(e,t,i,s));const a=r-i,l=n-s,c=Math.max(0,Math.min(1,((e-i)*a+(t-s)*l)/(a*a+l*l))),h=i+c*a,d=s+c*l;return Math.min(o,Oa(e,t,h,d))}function Ga(e,t,i,s,r,n,o,a,l){if(a&&([o,n]=[n,o]),!Fr(Math.atan2(t-s,e-i),n,o)){const o=i+Math.cos(n)*r,a=s+Math.sin(n)*r,c=i+Math.cos(n)*r,h=s+Math.sin(n)*r;return Math.min(l,Oa(e,t,o,a),Oa(e,t,c,h))}const c=r-Math.sqrt(Oa(e,t,i,s));return Math.min(l,c*c)}var Ba=class extends Io{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}computeBBox(){return new er(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){if(this.x1===this.x2||this.y1===this.y2){const{x:i,y:s}=this.transformPoint(e,t);return this.computeBBox().grow(this.strokeWidth/2).containsPoint(i,s)}return!1}distanceSquared(e,t){const{x1:i,y1:s,x2:r,y2:n}=this;return Fa(e,t,i,s,r,n,1/0)}render(e){var t;const{ctx:i,forceRender:s,stats:r,devicePixelRatio:n}=e;if(0===this.dirty&&!s)return void(r&&(r.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:o,y1:a,x2:l,y2:c}=this;if(o===l){const{strokeWidth:e}=this,t=Math.round(o*n)/n+Math.trunc(e*n)%2/(2*n);o=t,l=t}else if(a===c){const{strokeWidth:e}=this,t=Math.round(a*n)/n+Math.trunc(e*n)%2/(2*n);a=t,c=t}i.beginPath(),i.moveTo(o,a),i.lineTo(l,c),this.fillStroke(i),null==(t=this.fillShadow)||t.markClean(),super.render(e)}};function Va(e,t,i,s,r,n){if(0===e.size)return!1;let o=e.x,a=e.y;null!=t&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+r&&(l=i+r);let c=a;a<s?c=s:a>s+n&&(c=s+n);const h=o-l,d=a-c;return Math.sqrt(h*h+d*d)<=.5*e.size}function Ha(e,t,i,s,r){const n=e.x+e.width>t&&e.x<t+s,o=e.y+e.height>i&&e.y<i+r;return n&&o}function Ua(e,t,i,s,r){return t+s<e.x+e.width&&t>e.x&&i>e.y&&i+r<e.y+e.height}function za(e){return null!=e&&"object"==typeof e.point&&"object"==typeof e.label}Ba.className="Line",Ba.defaultStyles=Object.assign({},Io.defaultStyles,{fill:void 0,strokeWidth:1}),S([sr({redraw:3})],Ba.prototype,"x1",2),S([sr({redraw:3})],Ba.prototype,"y1",2),S([sr({redraw:3})],Ba.prototype,"x2",2),S([sr({redraw:3})],Ba.prototype,"y2",2);var Wa={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function ja(e,t){return e.length===t.length&&e.every((e,i)=>{const s=t[i];return Array.isArray(e)&&Array.isArray(s)?ja(e,s):e===s})}function Ka(e,t){return e.length===t.length&&e.every((e,i)=>Number(e)===Number(t[i]))}function $a(e){const t=Le(e)?e:e.split(".");if(1===t.length){const[e]=t;return De((t,i,s)=>t[e]=s,t=>t[e])}return De((e,i,s)=>it(e,t,s),e=>et(e,t))}function Ya(e){return De((t,i,s)=>t[e]=s)}function qa(e,t){return De((i,s,r)=>i[e][null!=t?t:s]=r)}function Xa(e){const{newValue:t,oldValue:i,changeValue:s}=e;return De((e,r,n,o)=>(n!==o&&(void 0!==o&&(null==i||i.call(e,o)),void 0!==n&&(null==t||t.call(e,n)),null==s||s.call(e,n,o)),n))}function Za(e){return t=e,(e,i)=>{Te(e,i).observers.push(t)};var t}function Qa(e,t,i){void 0===i||""===i?null==e||e.removeAttribute(t):null==e||e.setAttribute(t,i.toString())}function Ja(e,t,i,s,r){let{top:n,right:o,bottom:a,left:l,width:c,height:h}=r;return null!=l?null!=c?o=i-l+c:null!=o&&(c=i-l-o):null!=o&&null!=c&&(l=i-o-c),null!=n?null!=h?a=s-n-h:null!=a&&(h=s-a-n):null!=a&&null!=h&&(n=s-a-h),null==c?null==h?(c=e,h=t):c=Math.ceil(e*h/t):null==h&&(h=Math.ceil(t*c/e)),null==l&&(l=null==o?Math.floor((i-c)/2):i-o-c),null==n&&(n=null==a?Math.floor((s-h)/2):s-h-a),{x:l,y:n,width:c,height:h}}var el="ag-chart-tooltip",tl="ag-chart-dark-tooltip",il={html:"",ariaLabel:""};function sl(e){const t=(e,t,i)=>0===t||"."!==i[t-1]?". ":" ";return e.replace(/<br\s*\/?>/g,t).replace(/<\/p\s+>/g,t).replace(/<\/li\s*\/>/g,t).replace(/<[^>]+>/g,"")}function rl(e,t){var i,s,r;if("string"==typeof e)return{html:e,ariaLabel:e};const{content:n=(null!=(i=null==t?void 0:t.content)?i:""),title:o=(null==t?void 0:t.title),color:a=(null!=(s=null==t?void 0:t.color)?s:"white"),backgroundColor:l=(null!=(r=null==t?void 0:t.backgroundColor)?r:"#888")}=e;return{html:`${o?`<div class="${el}-title"\n        style="color: ${a}; background-color: ${l}">${o}</div>`:""}${n?`<div class="${el}-content">${n}</div>`:""}`,ariaLabel:sl(`${o?`${o}: `:""}${n}`)}}var nl=class extends vt{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};S([Kr(Fn(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"))],nl.prototype,"type",2),S([Kr(tn)],nl.prototype,"xOffset",2),S([Kr(tn)],nl.prototype,"yOffset",2);var ol=class extends vt{constructor(){super(),this.enabled=!0,this.delay=0,this.range="nearest",this.wrapping="hyphenate",this.position=new nl,this.darkTheme=!1,this.enableInteraction=!1,this.lastVisibilityChange=Date.now(),this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this.element=xs("div",el),Qa(this.element,"aria-hidden",!0),this.root=Ss("body"),this.root.appendChild(this.element)}destroy(){this.element.remove()}isVisible(){return!this.element.classList.contains(el+"-hidden")}show(e,t,i,s=!1){var r,n,o,a,l,c,h,d,u;const{element:p}=this;if(null!=i)p.innerHTML=i.html;else if(!p.innerHTML)return void this.toggle(!1);const g=null!=(n=null==(r=t.position)?void 0:r.type)?n:this.position.type,m=null!=(a=null==(o=t.position)?void 0:o.xOffset)?a:0,f=null!=(c=null==(l=t.position)?void 0:l.yOffset)?c:0,y=this.getTooltipBounds({positionType:g,meta:t,yOffset:f,xOffset:m,canvasRect:e}),v=this.getWindowSize(),C=Ja(p.clientWidth,p.clientHeight,e.width,e.height,y);C.x+=e.x,C.y+=e.y;const b=Hs(0,C.x,v.width-p.clientWidth-1),S=Hs(0,C.y,v.height-p.clientHeight),w=b!==C.x||S!==C.y,x=!("node"!==g&&"pointer"!==g||w||m||f),E=null!=(d=null!=(h=t.showArrow)?h:this.showArrow)?d:x;this.updateShowArrow(E),p.style.transform=`translate(${Math.round(b)}px, ${Math.round(S)}px)`,this.enableInteraction=null!=(u=t.enableInteraction)&&u,this.delay>0&&!s?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}getWindowSize(){const{innerWidth:e,innerHeight:t}=ws();return{width:e,height:t}}toggle(e){const{classList:t}=this.element,i=(e,i)=>t.toggle(`${el}-${e}`,i),s=this.isVisible();let r=1/0;if(e||clearTimeout(this.showTimeout),s!==e){const e=Date.now();r=e-this.lastVisibilityChange,this.lastVisibilityChange=e}r>5&&i("no-animation",!s&&e&&r>100),i("no-interaction",!this.enableInteraction),i("hidden",!e),i("arrow",this._showArrow),t.toggle(tl,this.darkTheme);for(const e of this.wrapTypes)t.toggle(`${el}-wrap-${e}`,e===this.wrapping)}pointerLeftOntoTooltip(e){var t;if(!this.enableInteraction)return!1;const i=null==(t=e.sourceEvent.relatedTarget)?void 0:t.classList,s=Boolean(["","-title","-content"].filter(e=>null==i?void 0:i.contains(`${el}${e}`)));return void 0!==i&&s}updateShowArrow(e){this._showArrow=e}getTooltipBounds({positionType:e,meta:t,yOffset:i,xOffset:s,canvasRect:r}){const{clientWidth:n,clientHeight:o}=this.element,a={width:n,height:o};switch(e){case"node":case"pointer":return a.top=t.offsetY+i-o-8,a.left=t.offsetX+s-n/2,a;case"top":return a.top=i,a.left=r.width/2-n/2+s,a;case"right":return a.top=r.height/2-o/2+i,a.left=r.width-n/2+s,a;case"left":return a.top=r.height/2-o/2+i,a.left=s,a;case"bottom":return a.top=r.height-o+i,a.left=r.width/2-n/2+s,a;case"top-left":return a.top=i,a.left=s,a;case"top-right":return a.top=i,a.left=r.width-n+s,a;case"bottom-right":return a.top=r.height-o+i,a.left=r.width-n+s,a;case"bottom-left":return a.top=r.height-o+i,a.left=s,a}}};S([Kr(Qr)],ol.prototype,"enabled",2),S([Kr(Qr,{optional:!0})],ol.prototype,"showArrow",2),S([Za((e,t,i)=>{t&&e.element.classList.add(t),i&&e.element.classList.remove(i)}),Kr(en,{optional:!0})],ol.prototype,"class",2),S([Kr(rn)],ol.prototype,"delay",2),S([Kr(_n)],ol.prototype,"range",2),S([Kr(In)],ol.prototype,"wrapping",2),S([Kr(Xr)],ol.prototype,"position",2),S([Kr(Qr)],ol.prototype,"darkTheme",2);var al=class extends vt{constructor(){super(...arguments),this.id=Gs(this),this.node=new Fo({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncated=!1}getOrAddRegion(e,t){return"root"===t?e.regionManager.getRegion("root"):e.regionManager.addRegionFromProperties({name:t,bboxproviders:[this.node],canInteraction:()=>this.enabled&&this.node.visible})}registerInteraction(e,t){const i=this.getOrAddRegion(e,t);return function(...e){return()=>{for(const t of e)t()}}(i.addListener("hover",t=>this.handleMouseMove(e,t)),i.addListener("leave",t=>this.handleMouseLeave(e,t)))}computeTextWrap(e,t){var i,s;const{text:r,wrapping:n}=this,o=Math.min(null!=(i=this.maxWidth)?i:1/0,e),a=null!=(s=this.maxHeight)?s:t;if(!isFinite(o)&&!isFinite(a))return void(this.node.text=r);const{text:l,truncated:c}=Fo.wrap(null!=r?r:"",o,a,this,n);this.node.text=l,this.truncated=c}updateTooltip(e,t){if(void 0!==t&&this.enabled&&this.node.visible&&this.truncated){const{offsetX:i,offsetY:s}=t;return e.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:t,showArrow:!1},rl({content:this.text})),!0}return!1}handleMouseMove(e,t){this.updateTooltip(e,t)&&t.consume()}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};al.SMALL_PADDING=10,al.LARGE_PADDING=20,S([Kr(Qr)],al.prototype,"enabled",2),S([Kr(en,{optional:!0}),qa("node")],al.prototype,"text",2),S([Kr(Rn,{optional:!0}),qa("node")],al.prototype,"textAlign",2),S([Kr(Tn,{optional:!0}),qa("node")],al.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0}),qa("node")],al.prototype,"fontWeight",2),S([Kr(rn),qa("node")],al.prototype,"fontSize",2),S([Kr(en),qa("node")],al.prototype,"fontFamily",2),S([Kr(fn,{optional:!0}),qa("node","fill")],al.prototype,"color",2),S([Kr(rn,{optional:!0})],al.prototype,"spacing",2),S([Kr(rn,{optional:!0})],al.prototype,"lineHeight",2),S([Kr(rn,{optional:!0})],al.prototype,"maxWidth",2),S([Kr(rn,{optional:!0})],al.prototype,"maxHeight",2),S([Kr(In)],al.prototype,"wrapping",2);var ll=["stroke","lineDash"],cl=cn(e=>Be(e)&&Object.keys(e).every(e=>ll.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),hl=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};S([Kr(Qr)],hl.prototype,"enabled",2),S([Kr(rn)],hl.prototype,"width",2),S([Kr(cl)],hl.prototype,"style",2);var dl=class extends vt{constructor(){super(...arguments),this.enabled=!0,this.autoWrap=!1,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.padding=5,this.minSpacing=NaN,this.color="rgba(87, 87, 87, 1)",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}};S([Kr(Qr)],dl.prototype,"enabled",2),S([Kr(Qr,{optional:!0})],dl.prototype,"autoWrap",2),S([Kr(rn,{optional:!0})],dl.prototype,"maxWidth",2),S([Kr(rn,{optional:!0})],dl.prototype,"maxHeight",2),S([Kr(Tn,{optional:!0})],dl.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0})],dl.prototype,"fontWeight",2),S([Kr(tn.restrict({min:1}))],dl.prototype,"fontSize",2),S([Kr(en)],dl.prototype,"fontFamily",2),S([Kr(rn)],dl.prototype,"padding",2),S([Kr(an),jr(NaN)],dl.prototype,"minSpacing",2),S([Kr(fn,{optional:!0})],dl.prototype,"color",2),S([Kr(on,{optional:!0})],dl.prototype,"rotation",2),S([Kr(Qr)],dl.prototype,"avoidCollisions",2),S([Kr(Qr)],dl.prototype,"mirrored",2),S([Kr(Qr)],dl.prototype,"parallel",2),S([Kr(Jr,{optional:!0})],dl.prototype,"formatter",2),S([Kr(en,{optional:!0})],dl.prototype,"format",2);var ul=class{constructor(){this.enabled=!0,this.width=1,this.color=void 0}};S([Kr(Qr)],ul.prototype,"enabled",2),S([Kr(rn)],ul.prototype,"width",2),S([Kr(fn,{optional:!0})],ul.prototype,"color",2);var pl=class extends vt{constructor(){super(...arguments),this.enabled=!1,this.spacing=al.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};function gl(e){const[t,i]=zs(e.range),s=Math.floor(t),r=Math.ceil(i);return{min:s,max:r,visible:s!==r}}S([Kr(Qr)],pl.prototype,"enabled",2),S([Kr(en,{optional:!0})],pl.prototype,"text",2),S([Kr(rn,{optional:!0})],pl.prototype,"spacing",2),S([Kr(Tn,{optional:!0})],pl.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0})],pl.prototype,"fontWeight",2),S([Kr(rn)],pl.prototype,"fontSize",2),S([Kr(en)],pl.prototype,"fontFamily",2),S([Kr(fn,{optional:!0})],pl.prototype,"color",2),S([Kr(In)],pl.prototype,"wrapping",2),S([Kr(Jr,{optional:!0})],pl.prototype,"formatter",2);var ml=2*Math.PI,fl=ml/2;function yl(e){const t=(t,i)=>{const[s=e.min,r=e.max]=zs(null!=i?i:[]);return t<s||t>r},i={fromFn(e,i,s){let r=e.y1+e.translationY,n=e.opacity;return("added"===s||t(e.datum.translationY,e.datum.range))&&(r=i.translationY,n=0),{y:0,translationY:r,opacity:n,phase:Ir[s]}},toFn(e,t,i){const s=t.translationY;let r=1;return"removed"===i&&(r=0),{y:0,translationY:s,opacity:r,finish:{y:s,translationY:0}}},intermediateFn:(e,i,s)=>({visible:!t(e.y)})},s={fromFn(e,i,s){var r;const n=null!=(r=e.previousDatum)?r:i,o=n.x,a=n.y,l=n.rotationCenterX;let c=Math.round(e.translationY),h=n.rotation,d=e.opacity;return"removed"===s||t(n.y,n.range)?h=i.rotation:("added"===s||t(e.datum.y,e.datum.range))&&(c=Math.round(n.translationY),d=0,h=i.rotation),{x:o,y:a,rotationCenterX:l,translationY:c,rotation:h,opacity:d,phase:Ir[s]}},toFn(e,t,i){var s,r;const n=t.x,o=t.y,a=t.rotationCenterX,l=Math.round(t.translationY);let c=0,h=1;var d,u;return"added"===i?(h=1,c=t.rotation):"removed"===i?(h=0,c=t.rotation):(d=null!=(r=null==(s=e.previousDatum)?void 0:s.rotation)?r:t.rotation,u=t.rotation,c=Math.abs(u-d)<fl?u:d>u?u+ml:u-ml),{x:n,y:o,rotationCenterX:a,translationY:l,rotation:c,opacity:h,finish:{rotation:t.rotation}}}};return{tick:i,line:{fromFn(e,t){var i;return v(y({},null!=(i=e.previousDatum)?i:t),{phase:Ir.updated})},toFn:(e,t)=>y({},t)},label:s,group:{fromFn(e,t){const{rotation:i,translationX:s,translationY:r}=e;return{rotation:i,translationX:s,translationY:r,phase:Ir.updated}},toFn(e,t){const{rotation:i,translationX:s,translationY:r}=t;return{rotation:i,translationX:s,translationY:r}}}}}function vl(){return(e,t)=>({rotation:t.rotation,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,translationX:t.translationX,translationY:t.translationY})}function Cl(e){const{visible:t,min:i,max:s}=e;return(e,r)=>{const n=r.translationY;return{y:n,translationY:0,opacity:1,visible:t&&n>=i&&n<=s}}}function bl(){return(e,t)=>({x:t.x,y:t.y,translationY:t.translationY,rotation:t.rotation,rotationCenterX:t.rotationCenterX})}function Sl(){return(e,t)=>y({},t)}var wl=class e{constructor(t,i,s){let r;this.moduleCtx=t,this.scale=i,this.id=Gs(this),this.nice=!0,this.reverse=!1,this.keys=[],this.dataDomain={domain:[],clipped:!1},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Eo({name:`${this.id}-axis`,zIndex:2}),this.lineNode=this.axisGroup.appendChild(new Ba),this.tickLineGroup=this.axisGroup.appendChild(new Eo({name:`${this.id}-Axis-tick-lines`,zIndex:2})),this.tickLabelGroup=this.axisGroup.appendChild(new Eo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.crossLineGroup=new Eo({name:`${this.id}-CrossLines`}),this.gridGroup=new Eo({name:`${this.id}-Axis-grid`}),this.gridLineGroup=this.gridGroup.appendChild(new Eo({name:`${this.id}-gridLines`,zIndex:1})),this.tickLineGroupSelection=_a.select(this.tickLineGroup,Ba,!1),this.tickLabelGroupSelection=_a.select(this.tickLabelGroup,Fo,!1),this.gridLineGroupSelection=_a.select(this.gridLineGroup,Ba,!1),this.line=new ul,this.tick=this.createTick(),this.gridLine=new hl,this.label=this.createLabel(),this.defaultTickMinSpacing=e.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,padding:this.label.padding,format:this.label.format}},this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new pl,this._titleCaption=new al,this.gridLength=0,this.fractionDigits=0,this.gridPadding=0,this.seriesAreaPadding=0,this.tickGenerationResult=void 0,this.maxThickness=1/0,this.moduleMap=new ga,this.refreshScale(),this.destroyFns.push(this._titleCaption.registerInteraction(this.moduleCtx,"root")),this._titleCaption.node.rotation=-Math.PI/2,this.axisGroup.appendChild(this._titleCaption.node),this.destroyFns.push(t.regionManager.getRegion("series").addListener("hover",e=>this.checkAxisHover(e))),this.animationManager=t.animationManager,this.animationState=new ya("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:e=>this.animateReadyUpdate(e),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this._crossLines=[],this.assignCrossLineArrayConstructor(this._crossLines),this.destroyFns.push(t.layoutService.addListener("layout-complete",e=>{null!=r&&null!=wt(e.chart,r)&&this.animationState.transition("resize"),r=y({},e.chart)})),!1!==(null==s?void 0:s.respondsToZoom)&&this.destroyFns.push(t.updateService.addListener("update-complete",e=>{this.minRect=e.minRect}))}get type(){var e;return null!=(e=this.constructor.type)?e:""}set crossLines(e){var t,i;null==(t=this._crossLines)||t.forEach(e=>this.detachCrossLine(e)),e&&this.assignCrossLineArrayConstructor(e),this._crossLines=e,null==(i=this._crossLines)||i.forEach(e=>{this.attachCrossLine(e),this.initCrossLine(e)})}get crossLines(){return this._crossLines}resetAnimation(e){"initial"===e&&this.animationState.transition("reset")}attachCrossLine(e){this.crossLineGroup.appendChild(e.group),this.crossLineGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineGroup.removeChild(e.group),this.crossLineGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}refreshScale(){var e;this.range=this.scale.range.slice(),null==(e=this.crossLines)||e.forEach(this.initCrossLine,this)}updateRange(){var e;const{range:t,visibleRange:i,scale:s}=this,r=(t[1]-t[0])/(i[1]-i[0]),n=r*i[0],o=t[0]-n;s.range=[o,o+r],null==(e=this.crossLines)||e.forEach(e=>{e.clippedRange=[t[0],t[1]]})}setCrossLinesVisible(e){this.crossLineGroup.visible=e}attachAxis(e,t){t.appendChild(this.gridGroup),e.appendChild(this.axisGroup),e.appendChild(this.crossLineGroup)}detachAxis(e,t){t.removeChild(this.gridGroup),e.removeChild(this.axisGroup),e.removeChild(this.crossLineGroup)}inRange(e,t=0,i=0){const[s,r]=zs(this.range);return e+t>=s-i&&e<=r+i}onLabelFormatChange(e,t,i){const{scale:s,fractionDigits:r}=this,n=!(s instanceof Na)&&r>0?e=>"number"==typeof e?e.toFixed(r):String(e):e=>String(e);if(i&&s&&s.tickFormat)try{this.labelFormatter=s.tickFormat({ticks:e,specifier:i})}catch(e){this.labelFormatter=n,_.warnOnce(`the axis label format string ${i} is invalid. No formatting will be applied`)}else this.labelFormatter=n}setTickInterval(e){var t;this.scale.interval=null!=(t=this.tick.interval)?t:e}setTickCount(e,t,i){const{scale:s}=this,r=Xn.is(s)||Co.is(s);if(e&&r)return"number"==typeof e?(s.tickCount=e,s.minTickCount=null!=t?t:0,void(s.maxTickCount=null!=i?i:1/0)):void(s instanceof yo&&this.setTickInterval(e))}onGridLengthChange(e,t){var i;(t&&!e||!t&&e)&&this.onGridVisibilityChange(),null==(i=this.crossLines)||i.forEach(this.initCrossLine,this)}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new dl}checkAxisHover(e){this.interactionEnabled&&this.computeBBox().containsPoint(e.offsetX,e.offsetY)&&this.moduleCtx.chartEventManager.axisHover(this.id,this.direction)}update(e=0,t=!0){if(!this.tickGenerationResult)return;const{rotation:i,parallelFlipRotation:s,regularFlipRotation:r}=this.calculateRotations(),n=this.label.getSideFlag();this.updatePosition();const o=this.getAxisLineCoordinates(),{tickData:a,combinedRotation:l,textBaseline:c,textAlign:h,primaryTickCount:d}=this.tickGenerationResult,u=this.tickLabelGroupSelection.nodes().map(e=>e.datum.tickId);if(this.updateSelections(o,a.ticks,{combinedRotation:l,textAlign:h,textBaseline:c,range:this.scale.range}),!t||this.animationManager.isSkipped())this.resetSelectionNodes();else{const e=this.calculateUpdateDiff(u,a);this.animationState.transition("update",e)}return this.updateAxisLine(),this.updateLabels(),this.updateVisibility(),this.updateGridLines(n),this.updateTickLines(),this.updateTitle({anyTickVisible:a.ticks.length>0}),this.updateCrossLines({rotation:i,parallelFlipRotation:s,regularFlipRotation:r}),this.updateLayoutState(),d}getAxisLineCoordinates(){const[e,t]=zs(this.range);return{x:0,y1:e,y2:t}}getTickLineCoordinates(e){const t=this.label.getSideFlag()*this.getTickSize(),i=Math.min(0,t);return{x1:i,x2:i+Math.abs(t),y:e.translationY}}getTickLabelProps(e,t){const{label:i}=this,{combinedRotation:s,textBaseline:r,textAlign:n,range:o}=t,a=e.tickLabel,l=i.getSideFlag()*(this.getTickSize()+i.padding+this.seriesAreaPadding),c=""!==a&&null!=a;return{tickId:e.tickId,translationY:e.translationY,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,rotation:s,rotationCenterX:l,text:a,textAlign:n,textBaseline:r,visible:c,x:l,y:0,range:o}}getTickSize(){return this.tick.enabled?this.tick.size:this.createTick().size}setTitleProps(e,t){var i;const{title:s}=this;if(s.enabled){if(e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.enabled=s.enabled,e.wrapping=s.wrapping,s.enabled){const r=e.node,n=(null!=(i=s.spacing)?i:0)+t.spacing,o=this.label.getSideFlag(),a=Nr(this.rotation),l=-1===o&&a>Math.PI&&a<2*Math.PI?-1:1,c=l*o*Math.PI/2,h=1===l?"bottom":"top",{range:d}=this,u=Math.floor(l*o*(d[0]+d[1])/2),p=-1===o?Math.floor(l*-n):Math.floor(-n),{callbackCache:g}=this.moduleCtx,{formatter:m=e=>e.defaultValue}=s,f=g.call(m,this.getTitleFormatterParams());r.setProperties({rotation:c,text:f,textBaseline:h,visible:!0,x:u,y:p})}}else e.enabled=!1}calculateLayout(e){var t,i;const{rotation:s,parallelFlipRotation:r,regularFlipRotation:n}=this.calculateRotations(),o=this.label.getSideFlag(),a=o*(this.getTickSize()+this.label.padding+this.seriesAreaPadding);this.updateScale(),this.tickGenerationResult=this.generateTicks({primaryTickCount:e,parallelFlipRotation:r,regularFlipRotation:n,labelX:a,sideFlag:o}),this.updateLayoutState();const l=this.tickGenerationResult,{tickData:c,combinedRotation:h,textBaseline:d,textAlign:u}=l,p=C(l,["tickData","combinedRotation","textBaseline","textAlign"]),g=[],{x:m,y1:f,y2:b}=this.getAxisLineCoordinates(),S=new er(m+Math.min(o*this.seriesAreaPadding,0),f,this.seriesAreaPadding,b-f);if(g.push(S),this.tick.enabled&&c.ticks.forEach(e=>{const{x1:t,x2:i,y:s}=this.getTickLineCoordinates(e),r=new er(t,s,i-t,0);g.push(r)}),this.label.enabled){const e=new Fo;c.ticks.forEach(t=>{const i=this.getTickLabelProps(t,{combinedRotation:h,textAlign:u,textBaseline:d,range:this.scale.range});if(!i.visible)return;e.setProperties(v(y({},i),{translationY:Math.round(t.translationY)}));const s=e.computeTransformedBBox();s&&g.push(s)})}if(null==(t=this.title)?void 0:t.enabled){const e=new al,t=er.merge(g).width;this.setTitleProps(e,{spacing:t});const i=e.node.computeTransformedBBox();i&&g.push(i)}const w=(e=>{const t=new or,{rotation:i,translationX:s,translationY:r,rotationCenterX:n,rotationCenterY:o}=this.getAxisTransform();return or.updateTransformMatrix(t,1,1,i,s,r,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:n,rotationCenterY:o}),t.transformBBox(e)})(er.merge(g)),x=this.isAnySeriesActive();return null==(i=this.crossLines)||i.forEach(e=>{var t;e.sideFlag=-o,e.direction=s===-Math.PI/2?"x":"y",e instanceof pa&&(e.label.parallel=null!=(t=e.label.parallel)?t:this.label.parallel),e.parallelFlipRotation=r,e.regularFlipRotation=n,e.calculateLayout(x,this.reverse)}),{primaryTickCount:e=p.primaryTickCount,bbox:w}}updateLayoutState(){this.layout.label={fractionDigits:this.fractionDigits,padding:this.label.padding,format:this.label.format}}setDomain(e){this.dataDomain=this.normaliseDataDomain(e),this.reverse&&this.dataDomain.domain.reverse(),this.scale.domain=this.dataDomain.domain}updateScale(){this.updateRange(),this.calculateDomain(),this.setTickInterval(this.tick.interval);const{scale:e,nice:t}=this;Xn.is(e)&&(e.nice=t,e.update())}calculateRotations(){const e=Gr(this.rotation);return{rotation:e,parallelFlipRotation:Nr(e),regularFlipRotation:Nr(e-Math.PI/2)}}generateTicks({primaryTickCount:e,parallelFlipRotation:t,regularFlipRotation:i,labelX:s,sideFlag:r}){var n;const{scale:o,tick:a,label:{parallel:l,rotation:c,fontFamily:h,fontSize:d,fontStyle:u,fontWeight:p}}=this,g=void 0!==e,{defaultRotation:m,configuredRotation:f,parallelFlipFlag:C,regularFlipFlag:b}=Ho({rotation:c,parallel:l,regularFlipRotation:i,parallelFlipRotation:t}),S=f+m,w=new or,{maxTickCount:x}=this.estimateTickCount({minSpacing:a.minSpacing,maxSpacing:null!=(n=a.maxSpacing)?n:NaN}),E=!Xn.is(o)&&!Co.is(o)||isNaN(x)?10:x;let M=Uo(l,f,0,r,b);const A=function(e,t,i,s){return e&&!t?i*s===-1?"hanging":"bottom":"middle"}(l,f,r,C),T={fontFamily:h,fontSize:d,fontStyle:u,fontWeight:p,textBaseline:A,textAlign:M};let D={rawTicks:[],ticks:[],labelCount:0},I=0,R=0,P=!0,k=!1;for(;P&&I<=E&&!k;){R=0,M=Uo(l,f,0,r,b);const t=this.getTickStrategies({secondaryAxis:g,index:I});for(const i of t){({tickData:D,index:I,autoRotation:R,terminate:k}=i({index:I,tickData:D,textProps:T,labelOverlap:P,terminate:k,primaryTickCount:e}));const t=0!==f||0!==R,n=S+R;M=Uo(l,f,R,r,b),P=!!this.label.avoidCollisions&&this.checkLabelOverlap(n,t,w,D.ticks,s,v(y({},T),{textAlign:M}))}}const L=m+f+R;return!g&&D.rawTicks.length>0&&(e=D.rawTicks.length),{tickData:D,primaryTickCount:e,combinedRotation:L,textBaseline:A,textAlign:M}}getTickStrategies({index:e,secondaryAxis:t}){const{scale:i,label:s,tick:r}=this,n=Xn.is(i)||Co.is(i),o=s.enabled&&s.avoidCollisions,a=!n&&0!==e&&o,l=!0===s.autoRotate&&void 0===s.rotation,c=[];let h;if(h=this.tick.values?3:t?1:a?2:0,c.push(({index:e,tickData:t,primaryTickCount:i,terminate:s})=>this.createTickData(h,e,t,s,i)),!n&&!isNaN(r.minSpacing)){const e=({index:e,tickData:t,primaryTickCount:i,terminate:s})=>this.createTickData(2,e,t,s,i);c.push(e)}if(!o)return c;if(s.autoWrap){const e=({index:e,tickData:t,textProps:i})=>this.wrapLabels(t,e,i);c.push(e)}else if(l){const e=({index:e,tickData:t,labelOverlap:i,terminate:s})=>({index:e,tickData:t,autoRotation:this.getAutoRotation(i),terminate:s});c.push(e)}return c}createTickData(e,t,i,s,r){var n;const{scale:o,tick:a}=this,{maxTickCount:l,minTickCount:c,defaultTickCount:h}=this.estimateTickCount({minSpacing:a.minSpacing,maxSpacing:null!=(n=a.maxSpacing)?n:NaN}),d=Xn.is(o)||Co.is(o),u=!d||isNaN(l)?10:l;let p=d?Math.max(h-t,c):l;const g=void 0===a.interval&&void 0===a.values&&p>c&&(d||2===e);let m=!0;for(;m&&t<=u;){const s=i.rawTicks;p=d?Math.max(h-t,c):l;const{rawTicks:n,ticks:o,labelCount:a}=this.getTicks({tickGenerationType:e,previousTicks:s,tickCount:p,minTickCount:c,maxTickCount:l,primaryTickCount:r});i.rawTicks=n,i.ticks=o,i.labelCount=a,m=!!g&&Ka(n,s),t++}const f=void 0!==a.interval||void 0!==a.values;return s||(s=f),{tickData:i,index:t,autoRotation:0,terminate:s}}checkLabelOverlap(e,t,i,s,r,n){or.updateTransformMatrix(i,1,1,e,0,0);const o=this.createLabelData(s,r,n,i),a=function(e,t){return isNaN(e)?t?0:10:e}(this.label.minSpacing,t);return function(e,t){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{point:{x:n,y:o},label:{text:a}}=r;let{label:{width:l,height:c}}=r;if(l+=null!=t?t:0,c+=null!=t?t:0,i.some(e=>Ha(e,n,o,l,c)))return!0;i.push({index:s,text:a,x:n,y:o,width:l,height:c,datum:r})}return!1}(o,a)}createLabelData(e,t,i,s){const r=[],n=new Go(i);for(const{tickLabel:i,translationY:o}of e){if(""===i||null==i)continue;const{width:e,height:a}=n.size(i),l=zo(i,new er(t,o,e,a),t,o,s);r.push(l)}return r}getAutoRotation(e){var t;return e?Nr(Gr(null!=(t=this.label.autoRotateAngle)?t:0)):0}getTicks({tickGenerationType:e,previousTicks:t,tickCount:i,minTickCount:s,maxTickCount:r,primaryTickCount:n}){var o;const{range:a,scale:l,visibleRange:c}=this;let h;switch(e){case 3:if(Xn.is(l)){const[e,t]=zs(l.getDomain().map(Number));h=this.tick.values.filter(i=>i>=e&&i<=t).sort((e,t)=>e-t)}else h=this.tick.values;break;case 1:h=Xn.is(l)?this.updateSecondaryAxisTicks(n):this.createTicks(i,s,r);break;case 2:h=this.filterTicks(t,i);break;default:h=this.createTicks(i,s,r)}this.fractionDigits=h.fractionDigits>=0?h.fractionDigits:0;const d=(null!=(o=l.bandwidth)?o:0)/2,u=[];let p=0;const g=new Map,m=Math.max(0,Math.floor(c[0]*h.length)),f=Math.min(h.length,Math.ceil(c[1]*h.length)),y=h.slice(m,f);this.onLabelFormatChange(y,h,this.label.format);for(let e=0;e<y.length;e++){const t=y[e],i=l.convert(t)+d;if(a.length>0&&!this.inRange(i,0,.001))continue;const s=this.formatTick(t,m+e);let r=s;if(g.has(r)){const e=g.get(r);g.set(r,e+1),r=`${r}_${e}`}else g.set(r,1);u.push({tick:t,tickId:r,tickLabel:s,translationY:Math.floor(i)}),""!==s&&null!=s&&p++}return{rawTicks:h,ticks:u,labelCount:p}}filterTicks(e,t){var i;const s=isNaN(this.tick.minSpacing)&&isNaN(null!=(i=this.tick.maxSpacing)?i:NaN)?2:Math.ceil(e.length/t);return e.filter((e,t)=>t%s===0)}createTicks(e,t,i){var s,r,n;return this.setTickCount(e,t,i),null!=(n=null==(r=(s=this.scale).ticks)?void 0:r.call(s))?n:[]}estimateTickCount({minSpacing:e,maxSpacing:t}){const{minRect:i,label:{avoidCollisions:s}}=this;if(!s)return{minTickCount:Xn.defaultMaxTickCount,maxTickCount:Xn.defaultMaxTickCount,defaultTickCount:Xn.defaultMaxTickCount};const r=this.calculateRangeWithBleed(),n=Math.max(this.defaultTickMinSpacing,r/Xn.defaultMaxTickCount);let o=!isNaN(t);isNaN(e)&&(e=n),isNaN(t)&&(t=r),e>t&&(e===n?e=t:t=e);let a=1;i&&(a="x"===this.direction?i.width:i.height),o&&(o=a<n);const l=Hs(1,Math.floor(r/e),o?Math.min(Math.floor(r/a),100):100),c=Math.min(l,Math.ceil(r/t));return{minTickCount:c,maxTickCount:l,defaultTickCount:Hs(c,Xn.defaultTickCount,l)}}updateVisibility(){this.moduleCtx.animationManager.isSkipped()&&this.resetSelectionNodes(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled}updateCrossLines({rotation:e,parallelFlipRotation:t,regularFlipRotation:i}){var s;const r=this.label.getSideFlag(),n=this.isAnySeriesActive();null==(s=this.crossLines)||s.forEach(s=>{var o;s.sideFlag=-r,s.direction=e===-Math.PI/2?"x":"y",s instanceof pa&&(s.label.parallel=null!=(o=s.label.parallel)?o:this.label.parallel),s.parallelFlipRotation=t,s.regularFlipRotation=i,s.update(n)})}updateTickLines(){const{tick:e,label:t}=this,i=t.getSideFlag();this.tickLineGroupSelection.each(t=>{t.strokeWidth=e.width,t.stroke=e.color,t.x1=i*this.getTickSize(),t.x2=0})}calculateAvailableRange(){return Ws(this.range)}calculateRangeWithBleed(){const e=1/Ws(this.visibleRange);return $s(this.calculateAvailableRange()*e,2)}calculateDomain(){const e=this.boundSeries.filter(e=>this.includeInvisibleDomains||e.isEnabled()).flatMap(e=>e.getDomain(this.direction));this.setDomain(e)}getAxisTransform(){return{rotation:Gr(this.rotation),rotationCenterX:0,rotationCenterY:0,translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineGroup:e,axisGroup:t,gridGroup:i,translation:s,gridLineGroupSelection:r,gridPadding:n,gridLength:o}=this,{rotation:a}=this.calculateRotations(),l=this.label.getSideFlag(),c=Math.floor(s.x),h=Math.floor(s.y);e.setProperties({rotation:a,translationX:c,translationY:h}),i.setProperties({rotation:a,translationX:c,translationY:h}),t.datum=this.getAxisTransform(),r.each(e=>{e.x1=n,e.x2=-l*o+n})}updateSecondaryAxisTicks(e){throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.")}updateSelections(e,t,i){this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?t:[],e=>e.append(new Ba),e=>e.tickId),this.tickLineGroupSelection.update(t,e=>e.appendChild(new Ba),e=>e.tickId),this.tickLabelGroupSelection.update(t.map(e=>this.getTickLabelProps(e,i)),e=>e.appendChild(new Fo),e=>e.tickId)}updateAxisLine(){const{line:e}=this,t=e.enabled?e.width:0;this.lineNode.setProperties({stroke:e.color,strokeWidth:t})}updateGridLines(e){const{gridLine:{style:t,width:i},gridPadding:s,gridLength:r}=this;0!==r&&0!==t.length&&this.gridLineGroupSelection.each((n,o,a)=>{const{stroke:l,lineDash:c}=t[a%t.length];n.setProperties({x1:s,x2:-e*r+s,fill:void 0,stroke:l,strokeWidth:i,lineDash:c})})}updateLabels(){const{label:e}=this;e.enabled&&this.tickLabelGroupSelection.each((e,t)=>{e.setProperties(t,["fill","fontFamily","fontSize","fontStyle","fontWeight","text","textAlign","textBaseline"])})}wrapLabels(e,t,i){const{parallel:s,maxWidth:r,maxHeight:n}=this.label;let o=this.maxThickness,a=Math.round(this.calculateAvailableRange()/e.labelCount);return s&&([o,a]=[a,o]),e.ticks.forEach(e=>{const{text:t}=Fo.wrap(e.tickLabel,null!=r?r:o,null!=n?n:a,i,"hyphenate");e.tickLabel=t}),{tickData:e,index:t,autoRotation:0,terminate:!0}}updateTitle(e){const{rotation:t,title:i,_titleCaption:s,lineNode:r,tickLineGroup:n,tickLabelGroup:o}=this;if(!i)return void(s.enabled=!1);let a=0;if(i.enabled&&e.anyTickVisible){const e=Eo.computeBBox([n,o,r]);a+=(0===t?e.width:e.height)+(this.tickLabelGroup.visible?0:this.seriesAreaPadding)}this.setTitleProps(s,{spacing:a})}formatTick(e,t){return this.datumFormatter(t)(e)}formatDatum(e){return String(e)}datumFormatter(e=0){const{label:t,labelFormatter:i,fractionDigits:s,moduleCtx:{callbackCache:r}}=this;return t.formatter?n=>{var o;return null!=(o=r.call(t.formatter,{value:s>0?n:String(n),index:e,fractionDigits:s,formatter:i}))?o:n}:i?e=>{var t;return null!=(t=r.call(i,e))?t:String(e)}:e=>String(e)}computeBBox(){return this.axisGroup.computeBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,t,i,s){this.tickLineGroup.setClipRectInGroupCoordinateSpace(new er(e,t,i,s))}clipGrid(e,t,i,s){this.gridGroup.setClipRectInGroupCoordinateSpace(new er(e,t,i,s))}calculatePadding(e,t){const i=.01*Math.abs(this.reverse?t:e);return[i,i]}getTitleFormatterParams(){var e;const t=this.boundSeries.reduce((e,t)=>{const i=t.getKeys(this.direction),s=t.getNames(this.direction);for(let t=0;t<i.length;t++)e.push({key:i[t],name:s[t]});return e},[]);return{direction:this.direction,boundSeries:t,defaultValue:null==(e=this.title)?void 0:e.text}}normaliseDataDomain(e){return{domain:[...e],clipped:!1}}getLayoutState(){return y({rect:this.computeBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale},this.layout)}getModuleMap(){return this.moduleMap}createModuleContext(){return null!=this.axisContext||(this.axisContext=this.createAxisContext()),v(y({},this.moduleCtx),{parent:this.axisContext})}createAxisContext(){return{axisId:this.id,direction:this.direction,continuous:Xn.is(this.scale),keys:()=>this.boundSeries.flatMap(e=>e.getKeys(this.direction)),seriesKeyProperties:()=>this.boundSeries.reduce((e,t)=>(t.getKeyProperties(this.direction).forEach(t=>{e.indexOf(t)<0&&e.push(t)}),e),[]),scaleValueFormatter:e=>{var t,i;return e?null==(i=(t=this.scale).tickFormat)?void 0:i.call(t,{specifier:e}):this.formatDatum},scaleBandwidth:()=>{var e;return null!=(e=this.scale.bandwidth)?e:0},scaleConvert:e=>this.scale.convert(e),scaleInvert:e=>{var t,i;return null==(i=(t=this.scale).invert)?void 0:i.call(t,e)}}}animateReadyUpdate(e){const{animationManager:t}=this.moduleCtx,i=yl(gl(this));Rr(this.id,"axis-group",t,[this.axisGroup],i.group),Rr(this.id,"line",t,[this.lineNode],i.line),Rr(this.id,"line-paths",t,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(e,t)=>t.tickId,e),Rr(this.id,"tick-labels",t,[this.tickLabelGroupSelection],i.label,(e,t)=>t.tickId,e)}resetSelectionNodes(){const{gridLineGroupSelection:e,tickLineGroupSelection:t,tickLabelGroupSelection:i,lineNode:s}=this,r=gl(this);fa([this.axisGroup],(e,t)=>({rotation:t.rotation,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,translationX:t.translationX,translationY:t.translationY})),fa([e,t],Cl(r)),fa([i],(e,t)=>({x:t.x,y:t.y,translationY:t.translationY,rotation:t.rotation,rotationCenterX:t.rotationCenterX})),fa([s],Sl())}calculateUpdateDiff(e,t){const i=new Set,s=new Set,r={},n=Math.max(e.length,t.ticks.length);for(let o=0;o<n;o++){const n=t.ticks[o],a=e[o],l=null==n?void 0:n.tickId;r[null!=l?l:a]=n,a!==l&&(s.has(l)?s.delete(l):l&&i.add(l),i.has(a)?i.delete(a):a&&s.add(a))}return{changed:i.size>0||s.size>0,added:i,removed:s}}isReversed(){return this.reverse}};wl.defaultTickMinSpacing=50,S([Kr(Qr)],wl.prototype,"nice",2),S([Kr(Qr)],wl.prototype,"reverse",2),S([Kr(bn)],wl.prototype,"keys",2),S([Kr(Xr,{optional:!0})],wl.prototype,"title",2),S([Za((e,t,i)=>e.onGridLengthChange(t,i))],wl.prototype,"gridLength",2);var xl=wl,El=class extends dl{constructor(){super(...arguments),this.autoRotateAngle=335}};S([Kr(Qr,{optional:!0})],El.prototype,"autoRotate",2),S([Kr(on)],El.prototype,"autoRotateAngle",2);var Ml=class e extends xl{constructor(){super(...arguments),this.thickness=0,this.position="left"}static is(t){return t instanceof e}get direction(){return["top","bottom"].includes(this.position)?"x":"y"}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}update(e,t){return this.updateDirection(),super.update(e,t)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}createAxisContext(){return v(y({},super.createAxisContext()),{position:this.position})}assignCrossLineArrayConstructor(e){Yn(e,pa)}createLabel(){return new El}};S([Kr(rn)],Ml.prototype,"thickness",2),S([Kr(An)],Ml.prototype,"position",2);var Al=Ml,Tl=class extends jn{constructor(){super(...arguments),this.minSpacing=NaN}};S([Kr(Gn),jr(NaN)],Tl.prototype,"minSpacing",2);var Dl=class extends Al{constructor(e,t=new Wr){super(e,t),this._paddingOverrideEnabled=!1,this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}set paddingInner(e){this._paddingOverrideEnabled=!0,this.scale.paddingInner=e}get paddingInner(){return this._paddingOverrideEnabled=!0,this.scale.paddingInner}set paddingOuter(e){this.scale.paddingOuter=e}get paddingOuter(){return this.scale.paddingOuter}createTick(){return new Tl}normaliseDataDomain(e){const t=[],i=new Set;for(const s of e){const e=s instanceof Date?s.getTime():s;i.has(e)||(i.add(e),t.push(s))}return{domain:t,clipped:!1}}calculateDomain(){if(!this._paddingOverrideEnabled){const e=this.boundSeries.map(e=>{var t;return null==(t=e.getBandScalePadding)?void 0:t.call(e)}).filter(e=>null!=e);e.length>0&&(this.scale.paddingInner=Math.min(...e.map(e=>e.inner)),this.scale.paddingOuter=Math.max(...e.map(e=>e.outer)))}return super.calculateDomain()}};Dl.className="CategoryAxis",Dl.type="category",S([Kr(nn)],Dl.prototype,"groupPaddingInner",2);var Il=class{constructor(e="",t,i=0){this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.screenX=0,this.screenY=0,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.label=e,this.parent=t,this.depth=t?t.depth+1:0,this.number=i}getLeftSibling(){return this.number>0&&this.parent?this.parent.children[this.number-1]:void 0}getLeftmostSibling(){return this.number>0&&this.parent?this.parent.children[0]:void 0}nextLeft(){return this.children?this.children[0]:this.thread}nextRight(){return this.children?this.children[this.children.length-1]:this.thread}getSiblings(){return this.parent?this.parent.children.filter((e,t)=>t!==this.number):[]}};function Rl(e,t,i){const s=i/(t.number-e.number);t.change-=s,t.shift+=i,e.change+=s,t.prelim+=i,t.mod+=i}function Pl(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function kl(e,t){const i=e.children;if(i.length){let s=i[0];i.forEach(e=>{kl(e,t),s=function(e,t,i){const s=e.getLeftSibling();if(s){let r=e,n=e,o=s,a=n.getLeftmostSibling(),l=n.mod,c=r.mod,h=o.mod,d=a.mod;for(;o.nextRight()&&n.nextLeft();){o=o.nextRight(),n=n.nextLeft(),a=a.nextLeft(),r=r.nextRight(),r.ancestor=e;const s=o.prelim+h-(n.prelim+l)+i;s>0&&(Rl(Pl(o,e,t),e,s),l+=s,c+=s),h+=o.mod,l+=n.mod,d+=a.mod,c+=r.mod}o.nextRight()&&!r.nextRight()?(r.thread=o.nextRight(),r.mod+=h-c):(n.nextLeft()&&!a.nextLeft()&&(a.thread=n.nextLeft(),a.mod+=l-d),t=e)}return t}(e,s,t)}),function(e){const t=e.children;if(t){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const r=t[s];r.prelim+=e,r.mod+=e,i+=r.change,e+=r.shift+i}}}(e);const r=(i[0].prelim+i.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+t,e.mod=e.prelim-r):e.prelim=r}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+t:0}}var Ll=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){const{x:i,y:s}=t(e);i>this.right&&(this.right=i),i<this.left&&(this.left=i),s>this.bottom&&(this.bottom=s),s<this.top&&(this.top=s)}};function Nl(e,t,i){e.x=e.prelim+t,e.y=e.depth,i.update(e),e.children.forEach(s=>Nl(s,t+e.mod,i))}function _l(e){const t=e.children;let i=0;t.forEach(e=>{_l(e),e.children.length?i+=e.leafCount:i++}),e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[e.children.length-1].subtreeRight,e.x=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.x,e.subtreeRight=e.x)}function Ol(e){const t=new Fl;return kl(e,1),Nl(e,-e.prelim,t),_l(e),t}var Fl=class{constructor(){this.dimensions=new Ll,this.leafCount=0,this.nodes=[],this.leafNodes=[],this.nonLeafNodes=[],this.depth=0}update(e){this.dimensions.update(e,e=>({x:e.x,y:e.y})),e.children.length?this.nonLeafNodes.push(e):(this.leafCount++,this.leafNodes.push(e)),e.depth>this.depth&&(this.depth=e.depth),this.nodes.push(e)}resize(e,t,i=0,s=0,r=!1){const n=this.leafCount-1,o=this.depth,a=this.dimensions;let l=1,c=1;if(e>0&&n){const t=(a.right-a.left)/n;l=e/n/t,r&&(l=-l)}if(t>0&&o){const e=(a.bottom-a.top)/o;c=t/o/e}const h=new Ll;this.nodes.forEach(e=>{e.screenX=e.x*l,e.screenY=e.y*c,h.update(e,e=>({x:e.screenX,y:e.screenY}))});const d=-h.left,u=-h.top;this.nodes.forEach(e=>{e.screenX+=d+i,e.screenY+=u+s})}},Gl=class extends dl{constructor(){super(...arguments),this.grid=!1}};S([Kr(Qr)],Gl.prototype,"grid",2);var Bl=class extends Al{constructor(e){super(e,new Wr),this.tickScale=new Wr,this.line=new ul,this.label=new Gl,this.labelColor="rgba(87, 87, 87, 1)",this.includeInvisibleDomains=!0;const{tickLineGroup:t,tickLabelGroup:i,gridLineGroup:s,tickScale:r,scale:n}=this;n.paddingOuter=.1,n.paddingInner=2*n.paddingOuter,this.refreshScale(),r.paddingInner=1,r.paddingOuter=0,this.gridLineSelection=_a.select(s,Ba),this.axisLineSelection=_a.select(t,Ba),this.separatorSelection=_a.select(t,Ba),this.labelSelection=_a.select(i,Fo)}updateRange(){const{range:e,visibleRange:t,scale:i}=this,s=(e[1]-e[0])/(t[1]-t[0]),r=s*t[0],n=e[0]-r;this.tickScale.range=i.range=[n,n+s],this.resizeTickTree()}resizeTickTree(){var e;const t=this.scale,i=t.domain.length?[t.convert(t.domain[0]),t.convert(t.domain[t.domain.length-1])]:t.range,s=this.tickTreeLayout,r=this.lineHeight;s&&s.resize(Math.abs(i[1]-i[0]),s.depth*r,(Math.min(i[0],i[1])||0)+(null!=(e=t.bandwidth)?e:0)/2,-s.depth*r,i[1]-i[0]<0)}get lineHeight(){return 1.5*this.label.fontSize}onGridVisibilityChange(){this.gridLineSelection.clear(),this.labelSelection.clear()}createTick(){return new Tl}calculateDomain(){var e;const{direction:t}=this;let i=null;const s=this.boundSeries.filter(e=>e.visible).flatMap(e=>{if("y"===t||i)return e.getDomain(t);if(null===i){const s=e.getDomain(t);return i=ze(s[0]),s}return[]});this.setDomain(null!=(e=ls(s))?e:ps(s));const{domain:r}=this.dataDomain;this.tickTreeLayout=Ol(function(e,t=!0){const i=new Il;let s=0;return t&&e.forEach(e=>s=Math.max(s,e.labels.length)),e.forEach(e=>{if(t)for(;e.labels.length<s;)e.labels.unshift("");!function(e,t){const i=t.labels.slice().reverse(),s=i.length-1;i.forEach((t,i)=>{const r=e.children,n=r.find(e=>e.label===t),o=i!==s;if(n&&o)e=n;else{const i=new Il(t,e);i.number=r.length,r.push(i),o&&(e=i)}})}(i,e)}),i}(r)),this.tickScale.domain=r.concat(""),this.resizeTickTree()}update(){this.computedLayout&&(this.updatePosition(),this.updateTitleCaption(),this.updateCategoryLabels(),this.updateSeparators(),this.updateAxisLines(),this.updateCategoryGridLines(),this.resetSelectionNodes())}updateTitleCaption(){const{_titleCaption:e}=this;e.node.visible=!1}updateCategoryLabels(){if(!this.computedLayout)return;const{tickLabelLayout:e}=this.computedLayout;this.labelSelection.update(e).each((e,t)=>{e.setProperties(t)})}updateSeparators(){if(!this.computedLayout)return;const{separatorLayout:e}=this.computedLayout,{range:t}=this;this.separatorSelection.update(e).each((e,i)=>{e.x1=i.x1,e.x2=i.x2,e.y1=i.y,e.y2=i.y,e.visible=i.y>=t[0]-1e-7&&i.y<=t[1]+1e-7,e.stroke=this.tick.color,e.fill=void 0,e.strokeWidth=1})}updateAxisLines(){if(!this.computedLayout)return;const{axisLineLayout:e}=this.computedLayout;this.axisLineSelection.update(e).each((e,t)=>{e.setProperties(v(y({},t),{stroke:this.line.color,strokeWidth:this.line.width})),e.x1=t.x,e.x2=t.x,e.y1=t.y1,e.y2=t.y2,e.strokeWidth=this.line.width,e.stroke=this.line.color})}updateCategoryGridLines(){const{gridLength:e,gridLine:t,label:i,range:s,tickScale:r}=this,n=r.ticks(),o=i.getSideFlag(),a=this.gridLineSelection.update(e?n:[]);if(e){const{width:i,style:n}=t,l=n.length;a.each((t,a,c)=>{const h=Math.round(r.convert(a));t.x1=0,t.x2=-o*e,t.y1=h,t.y2=h,t.visible=h>=s[0]&&h<=s[1];const{stroke:d,lineDash:u}=n[c%l];t.stroke=d,t.strokeWidth=i,t.lineDash=u,t.fill=void 0})}}computeLayout(){this.updateDirection(),this.calculateDomain(),this.updateRange();const{scale:e,label:t,label:{parallel:i},moduleCtx:{callbackCache:s},range:r,title:n,title:{formatter:o=e=>e.defaultValue}={}}=this,a=e.range[0],l=e.range[1],c=Math.abs(l-a)/e.domain.length||0,h=Math.ceil(t.fontSize/c),d=Gr(this.rotation),u=Math.abs(Math.cos(d))<1e-8,p=t.getSideFlag(),g=this.lineHeight,m=this.tickTreeLayout,f=e.ticks(),C=m?m.nodes:[],b=!!m&&m.depth>1,{defaultRotation:S,configuredRotation:w,parallelFlipFlag:x}=Ho({rotation:t.rotation,parallel:i,regularFlipRotation:Nr(d-Math.PI/2),parallelFlipRotation:Nr(d)}),E=[],M=new Map;let A=0;const T=new Fo,D=(e,i)=>{var a;if(T.setProperties({fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textAlign:"center",textBaseline:-1===x?"bottom":"hanging",translationX:e.screenY-.25*t.fontSize,translationY:e.screenX}),0===i){if(!((null==n?void 0:n.enabled)&&f.length>0))return!1;const i=s.call(o,this.getTitleFormatterParams());T.setProperties({fill:n.color,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,text:i,textBaseline:"hanging",translationX:e.screenY-.25*t.fontSize,translationY:e.screenX})}else{if(i%h!==0)return!1;if(!(e.screenX>=r[0]&&e.screenX<=r[1]))return!1;t.formatter?T.text=null!=(a=s.call(t.formatter,{value:String(e.label),index:i}))?a:String(e.label):T.text=String(e.label)}return!0};C.forEach((e,t)=>{if(!D(e,t))return;const i=T.computeTransformedBBox();i&&(M.set(t,i),!e.children.length&&i.width>A&&(A=i.width))});const I=p*t.padding,R=this.label.grid,P=[];C.forEach((e,t)=>{let i=D(e,t);const s=t;T.x=I,T.rotationCenterX=I;const r=!e.children.length;if(r)T.rotation=w,T.textAlign="end",T.textBaseline="middle";else{T.translationX-=A-g+this.label.padding;const t=e.leafCount*c,r=M.get(s);r&&r.width>t?(i=!1,M.delete(s)):T.rotation=u?S:-Math.PI/2}if(e.parent&&b){const t=r?e.screenX-c/2:e.screenX-e.leafCount*c/2;if(r)(e.number!==e.children.length-1||R)&&P.push({y:t,x1:0,x2:-A-2*this.label.padding});else{const i=-A-2*this.label.padding+e.screenY;P.push({y:t,x1:i+g,x2:i})}}let n;if(i){const e=T.computeTransformedBBox();e&&M.set(t,e),n=v(y({},{fill:(o=T).fill,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,rotation:o.rotation,rotationCenterX:o.rotationCenterX,rotationCenterY:o.rotationCenterY,text:o.text,textAlign:o.textAlign,textBaseline:o.textBaseline,translationX:o.translationX,translationY:o.translationY,visible:o.visible,x:o.x,y:o.y}),{visible:i})}else M.delete(t),n={visible:i};var o;E.push(n)});let k=0;P.forEach(e=>k=Math.min(k,e.x2)),P.push({y:Math.max(a,l),x1:0,x2:k});const L=[],N=[];P.forEach(e=>{if(e.y>=r[0]-1e-7&&e.y<=r[1]+1e-7){const{x1:t,x2:i,y:s}=e,r=new er(Math.min(t,i),s,Math.abs(t-i),0);N.push(r),L.push({x1:t,x2:i,y:s})}});const _=[],O=[],F=m?m.depth+1:1;for(let e=0;e<F;e++){const t=f.length>0&&(0===e||R&&b),i=e>0?-A-2*this.label.padding-(e-1)*g:0,s=new er(i,Math.min(...r),0,Math.abs(r[1]-r[0]));O.push(s),_.push({x:i,y1:r[0],y2:r[1],visible:t})}return{bbox:(e=>{const t=new or,{rotation:i,translationX:s,translationY:r,rotationCenterX:n,rotationCenterY:o}=this.getAxisTransform();return or.updateTransformMatrix(t,1,1,i,s,r,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:n,rotationCenterY:o}),t.transformBBox(e)})(er.merge([...M.values(),...N,...O])),tickLabelLayout:E,separatorLayout:L,axisLineLayout:_}}calculateLayout(){const{axisLineLayout:e,separatorLayout:t,tickLabelLayout:i,bbox:s}=this.computeLayout();return this.computedLayout={axisLineLayout:e,separatorLayout:t,tickLabelLayout:i},{bbox:s,primaryTickCount:void 0}}};Bl.className="GroupedCategoryAxis",Bl.type="grouped-category",S([Kr(fn,{optional:!0})],Bl.prototype,"labelColor",2);var Vl=class e{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:i,height:s,pixelRatio:r,position:n,insertAsFirstChild:o}=t;this.insertAsFirstChild=null!=o&&o,this.pixelRatio=function(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent.match(/\(iPhone; CPU iPhone OS (\d+_\d+_\d+) like Mac OS X\)/);if(null==e)return!1;const[t,i]=e[1].split("_").map(Number);return t<16||16===t&&i<6}()?1:null!=r?r:ws("devicePixelRatio"),this.element=xs("canvas"),this.element.width=Math.round((null!=i?i:this.width)*this.pixelRatio),this.element.height=Math.round((null!=s?s:this.height)*this.pixelRatio),n&&(this.element.style.position=n),this.context=this.element.getContext("2d"),this.onEnabledChange(),this.resize(null!=i?i:0,null!=s?s:0),e.debugContext(this.context)}static is(t){return t instanceof e}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t){if(!(e>0&&t>0))return;const{element:i,context:s,pixelRatio:r}=this;i.width=Math.round(e*r),i.height=Math.round(t*r),s.setTransform(r,0,0,r,0,0),i.style.width=e+"px",i.style.height=t+"px",this.width=e,this.height=t}snapshot(){}clear(){this.context.save(),this.context.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.context.clearRect(0,0,this.width,this.height),this.context.restore()}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onContainerChange(e,t){var i,s,r,n;e!==t&&(null==(i=this.element.parentNode)||i.removeChild(this.element),this.insertAsFirstChild&&(null==(s=this.container)?void 0:s.firstChild)?null==(r=this.container)||r.insertBefore(this.element,this.container.firstChild):null==(n=this.container)||n.appendChild(this.element))}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"block":"none")}static debugContext(e){if(Is.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(0===s)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(0!==s)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}};S([Za(e=>e.onEnabledChange())],Vl.prototype,"enabled",2),S([Za((e,t,i)=>e.onContainerChange(t,i))],Vl.prototype,"container",2);var Hl=Vl,Ul=class e{constructor(e,t){this.canvas=e,this.markDirty=t,this.debug=Is.create(!0,"scene"),this.layersMap=new Map,this.nextZIndex=0,this.nextLayerId=0}static sortLayers(e,t){var i,s;return wo([e.zIndex,...null!=(i=e.zIndexSubOrder)?i:[void 0,void 0],e.id],[t.zIndex,...null!=(s=t.zIndexSubOrder)?s:[void 0,void 0],t.id],bo)}get size(){return this.layersMap.size}forEach(t){Array.from(this.layersMap.values()).sort(e.sortLayers).forEach(t)}resize(e,t){this.canvas.resize(e,t),this.layersMap.forEach(({canvas:i})=>i.resize(e,t))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{zIndex:r=this.nextZIndex++,name:n,zIndexSubOrder:o,getComputedOpacity:a,getVisibility:l}=e,c=new Hl({width:t,height:i,pixelRatio:s,position:"absolute"}),h={id:this.nextLayerId++,name:n,canvas:c,zIndex:r,zIndexSubOrder:o,getComputedOpacity:a,getVisibility:l};return r>=this.nextZIndex&&(this.nextZIndex=r+1),this.layersMap.set(c,h),this.debug("Scene.addLayer() - layers",this.layersMap),h.canvas}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.markDirty(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}moveLayer(e,t,i){const s=this.layersMap.get(e);s&&(s.zIndex=t,s.zIndexSubOrder=i,this.markDirty(),this.debug("Scene.moveLayer() -  layers",this.layersMap))}clear(){this.layersMap.clear()}};function zl(e,t,i,s,r={}){if(!Is.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:n=0,layersSkipped:o=0,nodesRendered:a=0,nodesSkipped:l=0}=null!=s?s:{},c=performance.now(),h=t,{start:d}=h,u=C(h,["start"]),p=Object.entries(u).map(([e,t])=>$l(e,t)).filter(e=>null!=e).join(" + "),g=Object.entries(r).map(([e,t])=>`${e}: ${t}`).join(" ; "),m=Is.check("scene:stats:verbose"),f=[`${$l("⏱️",d,c)} (${p})`,`${g}`,`Layers: ${m?Kl(n,o):e.size}`,m?`Nodes: ${Kl(a,l)}`:null].filter(Ue),y=new Map(f.map(e=>[e,Fo.getTextSize(e,i.font)])),v=Math.max(...Array.from(y.values(),e=>e.width)),b=function(e,t){let i=0;for(const s of e)i+=t(s);return i}(y.values(),e=>e.height);i.save(),i.fillStyle="white",i.fillRect(0,0,v,b),i.fillStyle="black";let S=0;for(const[e,t]of y.entries())S+=t.height,i.fillText(e,2,S);i.restore()}function Wl(e){var t,i;return Is.check(!0,"scene")?y(y({node:e,name:null!=(t=e instanceof Eo?e.name:null)?t:e.id,dirty:tr[e.dirty]},(null==(i=e.parent)?void 0:i.isVirtual)?{virtualParentDirty:tr[e.parent.dirty],virtualParent:e.parent}:{}),e.children.map(e=>Wl(e)).reduce((e,t)=>{let{name:i}=t;const{node:{visible:s,opacity:r,zIndex:n,zIndexSubOrder:o},node:a,virtualParent:l}=t;(!s||r<=0)&&(i=`(${i})`),a instanceof Eo&&a.isLayer()&&(i=`*${i}*`);const c=[`${null!=i?i:"<unknown>"}`,`z: ${n}`,o&&`zo: ${o.map(e=>"function"==typeof e?`${e()} (fn)`:e).join(" / ")}`,l&&"(virtual parent)"].filter(e=>!!e).join(" ");let h=c,d=1;for(;null!=e[h]&&d<100;)h=`${c} (${d++})`;return e[h]=t,e},{})):{}}function jl(e){var t;if(0===e.dirty)return{dirtyTree:{},paths:[]};const i=e.children.map(e=>jl(e)).filter(e=>e.paths.length>0),s=Eo.is(e)&&null!=(t=e.name)?t:e.id,r=i.length?i.flatMap(e=>e.paths).map(e=>`${s}.${e}`):[s];return{dirtyTree:y({name:s,node:e,dirty:tr[e.dirty]},i.map(e=>e.dirtyTree).filter(e=>null!=e.dirty).reduce((e,t)=>{var i;return e[null!=(i=t.name)?i:"<unknown>"]=t,e},{})),paths:r}}function Kl(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function $l(e,t,i){const s=null!=i?i-t:t;return`${e}: ${Math.round(100*s)/100}ms`}var Yl=class{constructor({width:e,height:t,pixelRatio:i,canvasPosition:s}){this.debug=Is.create(!0,"scene"),this.id=Gs(this),this.root=null,this.isDirty=!1,this.canvas=new Hl({width:e,height:t,pixelRatio:i,position:s,insertAsFirstChild:"absolute"===s}),this.layersManager=new Ul(this.canvas,()=>{this.isDirty=!0})}get width(){var e,t;return null!=(t=null==(e=this.pendingSize)?void 0:e[0])?t:this.canvas.width}get height(){var e,t;return null!=(t=null==(e=this.pendingSize)?void 0:e[1])?t:this.canvas.height}setContainer(e){return this.canvas.container=e,this}setRoot(e){var t;return this.root===e||(this.isDirty=!0,null==(t=this.root)||t._setLayerManager(),this.root=e,e&&(e.visible=!0,e._setLayerManager(this.layersManager))),this}attachNode(e){var t;return null==(t=this.root)||t.appendChild(e),()=>this.removeChild(e)}appendChild(e){var t;return null==(t=this.root)||t.appendChild(e),this}removeChild(e){var t;return null==(t=this.root)||t.removeChild(e),this}download(e,t){var i;Es(this.canvas.toDataURL(t),null!=(i=null==e?void 0:e.trim())?i:"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t){return e=Math.round(e),t=Math.round(t),e>0&&t>0&&(e!==this.width||t!==this.height)&&(this.pendingSize=[e,t],this.isDirty=!0,!0)}render(e){return x(this,null,function*(){var t,i;const{debugSplitTimes:s={start:performance.now()},extraDebugStats:r}=null!=e?e:{},{canvas:n,canvas:{context:o}={},root:a,pendingSize:l}=this;if(!o)return;const c=performance.now();if(l&&(this.layersManager.resize(...l),this.pendingSize=void 0),a&&!a.visible)return void(this.isDirty=!1);if(a&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{redrawType:tr[a.dirty],tree:Wl(a)}),void zl(this.layersManager,s,o,void 0,r);const h={ctx:o,devicePixelRatio:null!=(t=this.canvas.pixelRatio)?t:1,forceRender:!0,resized:Boolean(l),debugNodes:{}};Is.check("scene:stats:verbose")&&(h.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0});let d=!1;if((!a||a.dirty>=1)&&(d=!0,n.clear()),a&&Is.check("scene:dirtyTree")){const{dirtyTree:e,paths:t}=jl(a);Is.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:e,paths:t})}if(a&&d&&(this.debug("Scene.render() - before",{redrawType:tr[a.dirty],canvasCleared:d,tree:Wl(a)}),a.visible&&(a.preRender(),o.save(),a.render(h),o.restore())),s["✍️"]=performance.now()-c,this.layersManager.size&&d){const e=performance.now();o.save(),o.resetTransform(),this.layersManager.forEach(e=>{e.canvas.enabled&&e.getVisibility()&&(o.globalAlpha=e.getComputedOpacity(),e.canvas.drawImage(o))}),o.restore(),s["⛙"]=performance.now()-e}null==(i=o.verifyDepthZero)||i.call(o),this.isDirty=!1,zl(this.layersManager,s,o,h.stats,r),function(e,t){e.save();for(const[i,s]of Object.entries(t)){const t=s.computeTransformedBBox();t?(e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(t.x,t.y,t.width,t.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,t.x,t.y,t.width),e.fillText(i,t.x,t.y,t.width)):_.log(`Scene.render() - no bbox for debugged node [${i}].`)}e.restore()}(o,h.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{redrawType:tr[a.dirty],tree:Wl(a),canvasCleared:d})})}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.canvas.container=void 0,this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};function ql(e){return new Promise(t=>{setTimeout(()=>t(void 0),e)})}Yl.className="Scene";var Xl=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(e=>_.errorOnce(e))})}acquireImmediately(e){return x(this,null,function*(){return!!this.available&&(yield this.acquire(e),!0)})}waitForClearAcquireQueue(){return x(this,null,function*(){return this.acquire(()=>x(this,null,function*(){}))})}dispatchNext(){return x(this,null,function*(){var e,t;this.available=!1;let[i,s]=null!=(e=this.acquireQueue.shift())?e:[];for(;i;){try{yield i(),null==s||s()}catch(e){_.error("mutex callback error",e),null==s||s()}[i,s]=null!=(t=this.acquireQueue.shift())?t:[]}this.available=!0})}},Zl=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if("function"!=typeof t)throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){var i;null==(i=this.eventListeners.get(e))||i.delete(t),0===this.eventListeners.size&&this.eventListeners.delete(e)}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){var t;null==(t=this.eventListeners.get(e.type))||t.forEach(t=>t(e))}},Ql=class extends vt{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}clear(){this.top=this.right=this.bottom=this.left=0}};function Jl(e,t){let i,s,r=0,n=!1;const o=()=>n,a=()=>{n=!1,null==s||s(),s=void 0,i=void 0,r>0&&e(l)},l=()=>{const e=r;r=0,n=!0;const i=t({count:e});i?i.then(a,a):a()};return{schedule(t){0!==r||o()||e(l,t),r++},await(){return x(this,null,function*(){if(o())for(null==i&&(i=new Promise(e=>{s=e}));o();)yield i})}}}S([Kr(rn)],Ql.prototype,"top",2),S([Kr(rn)],Ql.prototype,"right",2),S([Kr(rn)],Ql.prototype,"bottom",2),S([Kr(rn)],Ql.prototype,"left",2);var ec=class{constructor(){var e;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,t])=>this.observe(e,t)),this.queuedObserveRequests=[]},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:t,contentRect:i}of e){const{width:e,height:s}=i;this.checkSize(this.elements.get(t),t,e,s)}}),this.documentReady="complete"===Ss("readyState"),this.documentReady||null==(e=ws())||e.addEventListener("load",this.onLoad))}destroy(){var e,t;null==(e=ws())||e.removeEventListener("load",this.onLoad),null==(t=this.resizeObserver)||t.disconnect(),this.resizeObserver=null}checkSize(e,t,i,s){var r,n;e&&(i===(null==(r=e.size)?void 0:r.width)&&s===(null==(n=e.size)?void 0:n.height)||(e.size={width:i,height:s},e.cb(e.size,t)))}observe(e,t){var i;this.documentReady?(this.elements.has(e)?this.removeFromQueue(e):null==(i=this.resizeObserver)||i.observe(e),this.elements.set(e,{cb:t})):this.queuedObserveRequests.push([e,t])}unobserve(e){var t;null==(t=this.resizeObserver)||t.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},tc=class{constructor(){this.cache=new WeakMap}call(e,...t){let i,s=this.cache.get(e);const r=()=>{try{const r=e(...t);return s&&null!=i&&s.set(i,r),r}catch(e){return void _.warnOnce("User callback errored, ignoring",e)}};try{i=JSON.stringify(t)}catch(e){return r()}return null==s&&(s=new Map,this.cache.set(e,s)),s.has(i)?s.get(i):r()}invalidateCache(){this.cache=new WeakMap}},ic=class{constructor(e){this.annotationRoot=e}attachNode(e){return this.annotationRoot.append(e),()=>{var t;return null==(t=this.annotationRoot)||t.removeChild(e),this}}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){var t;return null==(t=this.styles)?void 0:t[e]}},sc=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(t=>t.symbol===e);if(s>=0){i.splice(s,1),0===i.length&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(e){_.errorOnce(e)}}dispatchWrapHandlers(e,t,...i){for(const s of this.getListenersByType(e))try{t(s.handler,...i)}catch(e){_.errorOnce(e)}}getListenersByType(e){var t;return null!=(t=this.registeredListeners.get(e))?t:[]}destroy(){this.registeredListeners.clear()}},rc=class extends sc{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=Is.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){"function"==typeof e&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return N(e=>this.fetch(e),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return N((e,t)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:t})},e,{leading:!0,trailing:!0})}fetch(e){return x(this,null,function*(){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;let s;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{s=yield this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(e){this.debug(`DataService - request failed | ${i}`),_.errorOnce(`DataService - request failed | [${e}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.findIndex(e=>e===i);-1===r||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(r+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error"))})}};S([Xa({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],rc.prototype,"dispatchThrottle",2),S([Xa({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],rc.prototype,"requestThrottle",2);var nc=class{constructor(e){this.maxAnimationTime=e,this.debug=Is.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Er.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){var e;return null!=(e=this.phases.get(Er[this.currentPhase]))?e:[]}checkOverlappingId(e){null!=e&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){var t;if(!e.isComplete)return Er.indexOf(e.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",e.id),void e.stop()):(this.controllers.set(e.id,e),void(null==(t=this.phases.get(e.phase))||t.push(e)))}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=null==t?void 0:t.indexOf(e);null!=i&&i>=0&&(null==t||t.splice(i,1))}progress(e){if(!this.isReady)return;let t=0===e?.01:e;const i=()=>{const e=Er[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:e,phaseMeta:Mr[e]}};let{phase:s,phaseControllers:r,phaseMeta:n}=i();const o=()=>null==Er[this.currentPhase],a=()=>{for(({phase:s,phaseControllers:r,phaseMeta:n}=i());!o()&&0===r.length;)this.currentPhase++,({phase:s,phaseControllers:r,phaseMeta:n}=i()),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},r)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${null==r?void 0:r.length} of ${l}`);do{const e=t,i=n.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let s=0;for(const n of r)i?n.stop():t=Math.min(n.update(e),t),n.isComplete&&(s++,this.removeAnimation(n));this.animationTimeConsumed+=e-t,this.debug(`AnimationBatch - updated ${r.length} controllers; ${s} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(_.warnOnce("Animation batch exceeded max animation time, skipping.",new Map(this.controllers.entries())),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&!0!==Mr[t.phase].skipIfNoEarlierAnimations){e=!1;break}if(!e)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(e=!0){if(!1===this.skipAnimations&&!0===e){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}pause(){for(const e of this.controllers.values())e.pause()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(e){_.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(e){if(null!=e&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},oc=class{constructor(){this.listeners=new sc,this.destroyFns=[]}addListener(e,t){return this.listeners.addListener(e,t)}removeListener(e){this.listeners.removeListener(e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e())}};function ac(e){const t=v(y({},e),{consumed:!1,consume(){var i,s;t.consumed=!0,e.sourceEvent instanceof Event?null==(i=e.sourceEvent)||i.preventDefault():null==(s=e.sourceEvent)||s.consume()}});return t}function lc(e,t,i){e.dispatchWrapHandlers(t,(e,t)=>{t.consumed||e(t)},i)}var cc=["click","dblclick","contextmenu","hover","drag-start","drag","drag-end","leave","enter","page-left","wheel"],hc=["blur","focus"],dc=["keydown","keyup"],uc=["pagehide","mousemove","mouseup"],pc=["click","dblclick","contextmenu","mousedown","mouseout","mouseenter","touchstart","touchmove","touchend","touchcancel","wheel","blur","focus","keydown","keyup"],gc=(e=>(e[e.Default=16]="Default",e[e.ZoomDrag=8]="ZoomDrag",e[e.Annotations=4]="Annotations",e[e.ContextMenu=2]="ContextMenu",e[e.Animation=1]="Animation",e[e.All=31]="All",e))(gc||{}),mc=class e extends oc{constructor(e,t){super(),this.keyboardOptions=e,this.debug=Is.create(!0,"interaction"),this.eventHandler=e=>this.processEvent(e),this.mouseDown=!1,this.touchDown=!1,this.clickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.dblclickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"},{offsetX:NaN,offsetY:NaN,type:"mouseup"},{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.stateQueue=17,this.rootElement=Ss("body"),this.element=t;for(const e of pc)e.startsWith("touch")?t.addEventListener(e,this.eventHandler,{passive:!0}):"wheel"===e?t.addEventListener(e,this.eventHandler,{passive:!1}):t.addEventListener(e,this.eventHandler);for(const e of uc)ws().addEventListener(e,this.eventHandler);Ms("\n.ag-chart-wrapper {\n    touch-action: none;\n}\n","interactionManager")}destroy(){super.destroy();for(const e of uc)ws().removeEventListener(e,this.eventHandler);for(const e of pc)this.element.removeEventListener(e,this.eventHandler)}addListener(e,t,i=16){return super.addListener(e,e=>{this.getState()&i&&t(e)})}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}getState(){return this.stateQueue&-this.stateQueue}processEvent(e){const t=this.decideInteractionEventTypes(e);t.length>0&&this.dispatchEvent(e,t).catch(e=>_.errorOnce(e))}dispatchEvent(e,t){return x(this,null,function*(){if(vs(cc,t))this.dispatchPointerEvent(e,t);else if(vs(hc,t))for(const i of t)lc(this.listeners,i,ac({type:i,sourceEvent:e}));else if(vs(dc,t))for(const i of t)lc(this.listeners,i,ac({type:i,sourceEvent:e}))})}dispatchPointerEvent(e,t){const i=this.calculateCoordinates(e);if(null!=i)for(const s of t)lc(this.listeners,s,this.buildPointerEvent(y({type:s,event:e},i)))}recordDown(e){e instanceof MouseEvent&&(st(["offsetX","offsetY"],this.clickHistory[0],e),st(["offsetX","offsetY"],this.dblclickHistory[2],this.dblclickHistory[0]),st(["offsetX","offsetY"],this.dblclickHistory[0],e)),this.dragStartElement=e.target}recordUp(e){e instanceof MouseEvent&&st(["offsetX","offsetY"],this.dblclickHistory[1],e),this.dragStartElement=void 0}decideInteractionEventTypes(e){const t="drag-start";switch(e.type){case"blur":case"focus":case"keydown":case"keyup":return this.keyboardOptions.enabled?[e.type]:[];case"click":case"dblclick":case"contextmenu":case"wheel":return[e.type];case"mousedown":return this.isEventOverElement(e)?(this.mouseDown=!0,this.recordDown(e),[t]):[];case"touchstart":return this.isEventOverElement(e)?(this.touchDown=!0,this.recordDown(e),[t]):[];case"touchmove":case"mousemove":return this.mouseDown||this.touchDown||this.isEventOverElement(e)?this.mouseDown||this.touchDown?["drag"]:["hover"]:[];case"mouseup":return this.mouseDown||this.isEventOverElement(e)?(this.mouseDown=!1,this.recordUp(e),["drag-end"]):[];case"touchend":return this.touchDown||this.isEventOverElement(e)?(this.touchDown=!1,this.recordUp(e),["drag-end"]):[];case"mouseout":case"touchcancel":return["leave"];case"mouseenter":const i=e instanceof MouseEvent&&!(1&~e.buttons);return this.mouseDown!==i?(this.mouseDown=i,[i?t:"drag-end"]):["enter"];case"pagehide":return["page-left"]}return[]}isEventOverElement(e){var t,i,s;return e.target===this.element||(null==(t=e.target)?void 0:t.parentElement)===this.element||(null==(s=null==(i=e.target)?void 0:i.parentElement)?void 0:s.parentElement)===this.element}calculateCoordinates(t){var i;if(t instanceof MouseEvent)return this.getMouseEventCoords(t);if("undefined"!=typeof TouchEvent&&t instanceof TouchEvent){const s=null!=(i=t.touches[0])?i:t.changedTouches[0],{clientX:r,clientY:n,pageX:o,pageY:a}=s;return v(y({},e.NULL_COORDS),{clientX:r,clientY:n,pageX:o,pageY:a})}if(t instanceof PageTransitionEvent){if(t.persisted)return;return e.NULL_COORDS}}getMouseEventCoords(e){const{clientX:t,clientY:i,pageX:s,pageY:r}=e;let{offsetX:n,offsetY:o}=e;const a=e=>{let t=0,i=0;for(;e;)t+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{x:t,y:i}};if(null!=this.dragStartElement&&e.target!==this.dragStartElement){const t=a(this.dragStartElement),i=a(e.target);n-=t.x-i.x,o-=t.y-i.y}return{clientX:t,clientY:i,pageX:s,pageY:r,offsetX:n,offsetY:o}}isWheelEvent(e){return"wheel"===e.type}buildPointerEvent(e){const{type:t,event:i,clientX:s,clientY:r}=e;let{offsetX:n,offsetY:o,pageX:a,pageY:l}=e;if(!We(n)||!We(o)){const e=this.element.getBoundingClientRect();n=s-e.left,o=r-e.top}if(!We(a)||!We(l)){const e=this.rootElement.getBoundingClientRect();a=s-e.left,l=r-e.top}let[c,h]=[NaN,NaN];if(this.isWheelEvent(i)){const e=0===i.deltaMode?.01:1;c=i.deltaX*e,h=i.deltaY*e}let d=[];"click"===i.type?d=this.clickHistory:"dblclick"===i.type&&(d=this.dblclickHistory);const u=ac({type:t,offsetX:n,offsetY:o,pageX:a,pageY:l,deltaX:c,deltaY:h,pointerHistory:d,sourceEvent:i});return this.debug("InteractionManager - builtEvent: ",u),u}};mc.NULL_COORDS={clientX:-1/0,clientY:-1/0,pageX:-1/0,pageY:-1/0,offsetX:-1/0,offsetY:-1/0};var fc=mc;function yc(e){return null==e||!isNaN(e)&&e>=0&&e<=2}var vc=class extends oc{constructor(e,t){super(),this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new nc(1.5*this.defaultDuration),this.debug=Is.create(!0,"animation"),this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!1,this.requestId=null,this.skipAnimations=!1}animate(e){var t,i=C(e,[]);const s=this.batch;try{s.checkOverlappingId(i.id)}catch(e){return void this.failsafeOnError(e)}const r=null!=(t=i.id)?t:Math.random().toString(),n=this.isSkipped()||"none"===i.phase;n&&this.debug("AnimationManager - skipping animation");const{delay:o,duration:a}=i;if(!yc(o))throw new Error(`Animation delay of ${o} is unsupported (${r})`);if(!yc(a))throw new Error(`Animation duration of ${a} is unsupported (${r})`);const l=new Dr(v(y({},i),{id:r,skip:n,autoplay:!!this.isPlaying&&i.autoplay,phase:i.phase,defaultDuration:this.defaultDuration}));if(!this.forceTimeJump(l,this.defaultDuration))return this.batch.addAnimation(l),l}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}pause(){if(this.isPlaying){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.pause()");try{this.batch.pause()}catch(e){this.failsafeOnError(e)}}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:(new Error).stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=requestAnimationFrame(e)}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let e;const t=i=>x(this,null,function*(){const s=()=>x(this,null,function*(){const t=i-(null!=e?e:i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:t}),this.interactionManager.pushState(1);try{this.batch.progress(t)}catch(e){this.failsafeOnError(e)}this.listeners.dispatch("animation-frame",{type:"animation-frame",deltaMs:t})});this.isSkippingFrames()?yield this.chartUpdateMutex.acquireImmediately(s):yield this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.listeners.dispatch("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))});this.listeners.dispatch("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){_.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.stop(),this.batch.destroy(),this.batch=new nc(1.5*this.defaultDuration),!0===e&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(1),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}},Cc=class e{constructor(t){this.canvas=t,this.debug=Is.create(!0,"aria"),this.canvas.appendChild(this.liveElem=e.createAnnouncer())}static createAnnouncer(){const e=Ss().createElement("div");return e.classList.add("ag-charts-aria-announcer"),Qa(e,"role","status"),Qa(e,"aria-live","assertive"),e}destroy(){this.canvas.removeChild(this.liveElem)}announceValue(e){this.debug(`AriaAnnouncementService - announceValue: ${e}`),this.liveElem.textContent=e}},bc=class extends oc{legendItemClick(e,t,i,s){const r={type:"legend-item-click",series:e,itemId:t,enabled:i,legendItemName:s};this.listeners.dispatch("legend-item-click",r)}legendItemDoubleClick(e,t,i,s,r){const n={type:"legend-item-double-click",series:e,itemId:t,enabled:i,legendItemName:r,numVisibleItems:s};this.listeners.dispatch("legend-item-double-click",n)}axisHover(e,t){const i={type:"axis-hover",axisId:e,direction:t};this.listeners.dispatch("axis-hover",i)}},Sc=class{constructor(){this.defaultActions=[],this.disabledActions=new Set}copyDefaultActions(){return[...this.defaultActions]}registerDefaultAction(e){e.id&&this.defaultActions.find(({id:t})=>t===e.id)||this.defaultActions.push(e)}enableAction(e){this.disabledActions.delete(e)}disableAction(e){this.disabledActions.add(e)}isDisabled(e){return this.disabledActions.has(e)}},wc=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),void 0!==t&&super.set(e,t),this}stateId(){var e;return null!=(e=Array.from(this.keys()).pop())?e:this.defaultState}stateValue(){var e;return null!=(e=Array.from(this.values()).pop())?e:this.defaultValue}},xc=class{constructor(e){this.element=e,this.stateTracker=new wc("default")}updateCursor(e,t){this.stateTracker.set(e,t),this.element.style.cursor=this.stateTracker.stateValue()}getCursor(){return this.element.style.cursor}};function Ec(e,t){return Math.sqrt(function(e,t){const i=e.screenX-t.screenX,s=e.screenY-t.screenY;return i*i+s*s}(e,t))}var Mc=class extends oc{constructor(e){super(),this.touchstart=e=>this.onTouchStart(e),this.touchmove=e=>this.onTouchMove(e),this.touchend=e=>this.onTouchEnd(e),this.touchcancel=e=>this.onTouchCancel(e),this.pinch={finger1:{identifier:NaN,screenX:NaN,screenY:NaN},finger2:{identifier:NaN,screenX:NaN,screenY:NaN},origin:{x:NaN,y:NaN},distance:NaN,status:0},this.element=e,e.addEventListener("touchstart",this.touchstart,{passive:!0}),e.addEventListener("touchmove",this.touchmove,{passive:!0}),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel)}destroy(){const{element:e}=this;e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel)}findPinchTouches(e){const{touches:t}=e,{finger1:i,finger2:s}=this.pinch;if(0!==this.pinch.status&&2===t.length){if(t[0].identifier===i.identifier&&t[1].identifier===s.identifier)return[t[0],t[1]];if(t[0].identifier===s.identifier&&t[1].identifier===i.identifier)return[t[1],t[0]]}}copyTouchData(e){const t=["identifier","screenX","screenY"];st(t,this.pinch.finger1,e.touches[0]),st(t,this.pinch.finger2,e.touches[1]),this.pinch.distance=Ec(this.pinch.finger1,this.pinch.finger2)}dispatchPinchEvent(e,t){const{finger1:i,finger2:s,origin:r}=this.pinch,n={type:e,finger1:i,finger2:s,deltaDistance:t,origin:r};this.listeners.dispatch(e,n)}onTouchStart(e){this.stopPinchTracking();const{pinch:t}=this;2===e.touches.length&&(t.status=1,this.copyTouchData(e),t.origin.x=(e.touches[0].clientX+e.touches[1].clientX)/2,t.origin.y=(e.touches[0].clientY+e.touches[1].clientY)/2)}onTouchMove(e){const t=this.findPinchTouches(e);if(void 0!==t){const[i,s]=t,{pinch:r}=this,n=Ec(i,s),o=n-r.distance;1===r.status?Math.abs(o)>1&&(r.status=2,this.copyTouchData(e),this.dispatchPinchEvent("pinch-start",0)):2===r.status?(r.distance=n,this.copyTouchData(e),this.dispatchPinchEvent("pinch-move",o)):_.error(`unexpected pinch.status: ${r.status}`)}}onTouchEnd(e){this.stopPinchTracking()}onTouchCancel(e){this.stopPinchTracking()}stopPinchTracking(){const{pinch:e}=this;2===e.status&&this.dispatchPinchEvent("pinch-end",0),this.pinch.status=0}},Ac=class extends oc{constructor(){super(...arguments),this.highlightStates=new wc,this.pickedStates=new wc}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i})}getActiveHighlight(){return this.activeHighlight}updatePicked(e,t){this.pickedStates.set(e,t),this.activePicked=this.pickedStates.stateValue()}getActivePicked(){return this.activePicked}isEqual(e,t){return e===t||(null==e?void 0:e.series)===(null==t?void 0:t.series)&&(null==e?void 0:e.itemId)===(null==t?void 0:t.itemId)&&(null==e?void 0:e.datum)===(null==t?void 0:t.datum)}},Tc=class extends oc{constructor(e){super(),this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.isClicking=!1,this.destroyFns.push(e.addListener("drag-start",e=>this.onClickStart(e),31),e.addListener("click",e=>this.onClickStop(e),31),e.addListener("drag-end",e=>this.onClickStop(e),31),e.addListener("wheel",e=>this.mouseBlur(e)),e.addListener("hover",e=>this.mouseBlur(e)),e.addListener("drag",e=>this.mouseBlur(e)),e.addListener("blur",e=>this.onBlur(e),31),e.addListener("focus",e=>this.onFocus(e),31),e.addListener("keydown",e=>this.onKeyDown(e),31))}destroy(){super.destroy()}onClickStart(e){this.isClicking=!0,this.mouseBlur(e)}onClickStop(e){this.isClicking=!1,this.mouseBlur(e)}mouseBlur(e){this.hasBrowserFocus&&(this.isMouseBlurred||(this.dispatch("blur",0,e),this.isMouseBlurred=!0))}onBlur(e){this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.dispatch("blur",0,e)}onFocus(e){this.hasBrowserFocus=!0,this.isClicking?this.isMouseBlurred=!0:(this.dispatch("browserfocus",1,e),this.dispatch("tab",0,e))}onKeyDown(e){if(this.hasBrowserFocus&&!this.isClicking)switch(this.isMouseBlurred=!1,e.sourceEvent.code){case"Tab":return e.sourceEvent.shiftKey?this.dispatch("tab",-1,e):this.dispatch("tab",1,e);case"ArrowDown":return this.dispatch("nav-vert",1,e);case"ArrowUp":return this.dispatch("nav-vert",-1,e);case"ArrowLeft":return this.dispatch("nav-hori",-1,e);case"ArrowRight":return this.dispatch("nav-hori",1,e);case"Space":case"Enter":return this.dispatch("submit",0,e)}}dispatch(e,t,i){const s=ac({type:e,delta:t,sourceEvent:i});lc(this.listeners,e,s)}},Dc={};b(Dc,{block:()=>Ic,css:()=>kc,elements:()=>Rc,modifiers:()=>Pc});var Ic="ag-charts-focus",Rc={wrapper:`${Ic}__wrapper`,indicator:`${Ic}__indicator`},Pc={hidden:`${Ic}--hidden`},kc=`\n.${Ic}.${Rc.wrapper} {\n    position: relative;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    overflow: hidden;\n    top: 0;\n    left: 0;\n}\n\n.${Ic}.${Rc.indicator} {\n    position: absolute;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    border: var(--ag-charts-focus-border);\n    box-shadow: var(--ag-charts-focus-border-shadow);\n}\n\n.${Pc.hidden} {\n    visibility: hidden;\n}\n`,Lc=["series","legend"],Nc=class extends sc{},_c=class{constructor(e,t,i,s){this.interactionManager=e,this.keyNavManager=t,this.canvasElement=i,this.currentTabIndex=0,this.isDragging=!1,this.leftCanvas=!1,this.regions=new Map,this.destroyFns=[],this.destroyFns.push(...cc.map(t=>e.addListener(t,this.processPointerEvent.bind(this),31)),this.keyNavManager.addListener("blur",this.onNav.bind(this)),this.keyNavManager.addListener("browserfocus",this.onFocus.bind(this)),this.keyNavManager.addListener("tab",this.onTab.bind(this)),this.keyNavManager.addListener("nav-vert",this.onNav.bind(this)),this.keyNavManager.addListener("nav-hori",this.onNav.bind(this)),this.keyNavManager.addListener("submit",this.onNav.bind(this))),Ms(kc,Ic),this.focusWrapper=Ss().createElement("div"),this.focusIndicator=Ss().createElement("div"),this.focusWrapper.appendChild(this.focusIndicator),s.appendChild(this.focusWrapper);const{block:r,elements:n,modifiers:o}=Dc;this.focusWrapper.classList.add(r,n.wrapper),this.focusIndicator.classList.add(r,n.indicator,o.hidden)}destroy(){this.destroyFns.forEach(e=>e()),this.currentRegion=void 0;for(const e of this.regions.values())e.listeners.destroy();this.focusWrapper.remove(),this.regions.clear()}addRegionFromProperties(e){const t={properties:e,listeners:new Nc};return this.regions.set(e.name,t),this.makeObserver(t)}addRegion(e,t,...i){return this.addRegionFromProperties({name:e,bboxproviders:[t,...i],canInteraction:()=>!0})}getRegion(e){return this.makeObserver(this.regions.get(e))}find(e,t){const i=[];for(const[s,r]of this.regions.entries())for(const s of r.properties.bboxproviders){const n=s.getCachedBBox();n.containsPoint(e,t)&&i.push([r,n.width*n.height])}return i.sort((e,t)=>e[1]-t[1]).map(e=>e[0])}makeObserver(e){const{interactionManager:t}=this;return new class{addListener(i,s,r=16){var n;return null!=(n=null==e?void 0:e.listeners.addListener(i,e=>{e.consumed||t.getState()&r&&s(e)}))?n:()=>{}}}}checkPointerHistory(e,t){for(const i of t.pointerHistory){const t=this.pickRegion(i.offsetX,i.offsetY);if(e.properties.name!==(null==t?void 0:t.properties.name))return!1}return!0}dispatch(e,t){null==e||e.listeners.dispatch(t.type,t)}handleDragging(e){const{currentRegion:t}=this;switch(e.type){case"drag-start":this.isDragging=!0,this.leftCanvas=!1;break;case"leave":return this.leftCanvas=!0,this.isDragging;case"enter":return this.leftCanvas=!1,this.isDragging;case"drag":if(this.isDragging)return this.dispatch(t,e),!0;break;case"drag-end":if(this.isDragging)return this.isDragging=!1,this.dispatch(t,e),this.leftCanvas&&this.dispatch(t,v(y({},e),{type:"leave"})),!0}return!1}processPointerEvent(e){if(this.handleDragging(e))return;const{currentRegion:t}=this,i=this.pickRegion(e.offsetX,e.offsetY);void 0!==t&&(null==i?void 0:i.properties.name)!==t.properties.name&&this.dispatch(t,v(y({},e),{type:"leave"})),void 0!==i&&i.properties.name!==(null==t?void 0:t.properties.name)&&this.dispatch(i,v(y({},e),{type:"enter"})),void 0!==i&&this.checkPointerHistory(i,e)&&this.dispatch(i,e),this.currentRegion=i}pickRegion(e,t){const i=this.find(e,t);return i.length>0?i[0]:void 0}getTabRegion(e){if(void 0!==e&&e>=0&&e<Lc.length)return this.regions.get(Lc[e])}dispatchTabStart(e){const{delta:t,sourceEvent:i}=e,s=ac({type:"tab-start",delta:t,sourceEvent:i}),r=this.getTabRegion(this.currentTabIndex);return this.dispatch(r,s),!!s.consumed}getNextInteractableTabIndex(e,t){const i=t<0?-1:1;let s=e;for(;0!==t;){const e=this.getTabRegion(s+i);if(void 0===e)return;e.properties.canInteraction()&&(t-=i),s+=i}return s}validateCurrentTabIndex(){var e;const t=this.getTabRegion(this.currentTabIndex);void 0===t||t.properties.canInteraction()||(this.currentTabIndex=null!=(e=this.getNextInteractableTabIndex(-1,1))?e:0)}onFocus(e){const{delta:t,sourceEvent:i}=e,s=t>0?this.getNextInteractableTabIndex(-1,1):this.getNextInteractableTabIndex(Lc.length,-1);this.currentTabIndex=null!=s?s:0;const r=this.getTabRegion(this.currentTabIndex);r&&this.dispatch(r,ac({type:"tab",delta:t,sourceEvent:i}))}onTab(e){if(this.dispatchTabStart(e))return;this.validateCurrentTabIndex();const t=this.getNextInteractableTabIndex(this.currentTabIndex,e.delta),i=this.getTabRegion(t),s=this.getTabRegion(this.currentTabIndex);if(void 0!==t&&(this.currentTabIndex=t),void 0!==s&&(null==i?void 0:i.properties.name)!==s.properties.name){const{delta:t,sourceEvent:i}=e,r=ac({type:"blur",delta:t,sourceEvent:i});this.dispatch(s,r)}void 0!==i&&i.properties.canInteraction()?this.dispatch(i,e):this.updateFocusIndicatorRect(void 0)}onNav(e){const t=this.getTabRegion(this.currentTabIndex);this.dispatch(t,e)}updateFocusWrapperRect(){this.focusWrapper.style.width=this.canvasElement.style.width,this.focusWrapper.style.height=this.canvasElement.style.height}updateFocusIndicatorRect(e){null!=e?(this.updateFocusWrapperRect(),this.focusIndicator.classList.remove(Pc.hidden),this.focusIndicator.style.width=`${e.width}px`,this.focusIndicator.style.height=`${e.height}px`,this.focusIndicator.style.left=`${e.x}px`,this.focusIndicator.style.top=`${e.y}px`):this.focusIndicator.classList.add(Pc.hidden)}},Oc=class extends oc{constructor(e){super(),this.element=e}static isGroup(e,t){return t.group===e}pressButton(e,t){this.listeners.dispatch("button-pressed",{type:"button-pressed",group:e,value:t})}toggleGroup(e,t){this.listeners.dispatch("group-toggled",{type:"group-toggled",group:e,visible:t})}toggleButton(e,t,i){this.listeners.dispatch("button-toggled",{type:"button-toggled",group:e,value:t,enabled:i})}proxyGroupOptions(e,t){this.listeners.dispatch("proxy-group-options",{type:"proxy-group-options",group:e,options:t})}},Fc=`\n.${el} {\n    transition: transform 0.1s ease;\n    max-width: 100%;\n    position: fixed;\n    left: 0px;\n    top: 0px;\n    z-index: 99999;\n    font: 12px Verdana, sans-serif;\n    color: rgb(70, 70, 70);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);\n}\n\n.${el}-wrap-always {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: none;\n}\n\n.${el}-wrap-hyphenate {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: auto;\n}\n\n.${el}-wrap-on-space {\n    overflow-wrap: normal;\n    word-break: normal;\n}\n\n.${el}-wrap-never {\n    white-space: pre;\n    text-overflow: ellipsis;\n}\n\n.${el}-no-interaction {\n    pointer-events: none;\n    user-select: none;\n}\n\n.${el}-no-animation {\n    transition: none !important;\n}\n\n.${el}-hidden {\n    visibility: hidden;\n}\n\n.${el}-title {\n    overflow: hidden;\n    position: relative;\n    padding: 8px 14px;\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px;\n    color: white;\n    background-color: #888888;\n    z-index: 1;\n    text-overflow: inherit;\n}\n\n.${el}-title:only-child {\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n}\n\n.${el}-content {\n    overflow: hidden;\n    padding: 6px 14px;\n    line-height: 1.7em;\n    background: white;\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    overflow: hidden;\n    text-overflow: inherit;\n}\n\n.${el}-arrow::before {\n    content: "";\n\n    position: absolute;\n    top: 100%;\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid #d9d9d9;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.${el}-arrow::after {\n    content: "";\n\n    position: absolute;\n    top: calc(100% - 1px);\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid white;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.ag-chart-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n`,Gc=class{constructor(e,t){if(this.canvasElement=e,this.tooltip=t,this.stateTracker=new wc,this.appliedState=null,"undefined"!=typeof IntersectionObserver){const e=new IntersectionObserver(e=>{for(const t of e)t.target===this.canvasElement&&0===t.intersectionRatio&&this.tooltip.toggle(!1)},{root:this.tooltip.root});e.observe(this.canvasElement),this.observer=e}Ms(Fc,"tooltip")}updateTooltip(e,t,i){var s;this.tooltip.enabled&&(null!=i||(i=null==(s=this.stateTracker.get(e))?void 0:s.content),this.stateTracker.set(e,{content:i,meta:t}),this.applyStates())}removeTooltip(e){this.tooltip.enabled&&(this.stateTracker.delete(e),this.applyStates())}getTooltipMeta(e){var t;return null==(t=this.stateTracker.get(e))?void 0:t.meta}destroy(){var e;null==(e=this.observer)||e.unobserve(this.canvasElement)}applyStates(){var e;const t=this.stateTracker.stateId(),i=t?this.stateTracker.get(t):null;if(null==(null==i?void 0:i.meta)||null==(null==i?void 0:i.content))return this.appliedState=null,void this.tooltip.toggle(!1);const s=this.canvasElement.getBoundingClientRect();if((null==(e=this.appliedState)?void 0:e.content)===(null==i?void 0:i.content)){const e=this.tooltip.isVisible();this.tooltip.show(s,null==i?void 0:i.meta,null,e)}else this.tooltip.show(s,null==i?void 0:i.meta,null==i?void 0:i.content);this.appliedState=i}static makeTooltipMeta(e,t){var i,s,r,n,o,a,l;const{offsetX:c,offsetY:h}=e,{tooltip:d}=t.series.properties,u={offsetX:c,offsetY:h,enableInteraction:null!=(s=null==(i=d.interaction)?void 0:i.enabled)&&s,lastPointerEvent:{type:e.type,offsetX:c,offsetY:h},showArrow:d.showArrow,position:{type:d.position.type,xOffset:d.position.xOffset,yOffset:d.position.yOffset}},p=null!=(l=null!=(n=null==(r=t.yBar)?void 0:r.upperPoint)?n:t.midPoint)?l:null==(a=(o=t.series).datumMidPoint)?void 0:a.call(o,t);if("node"===d.position.type&&p){const{x:e,y:i}=p,s=t.series.contentGroup.inverseTransformPoint(e,i);return v(y({},u),{offsetX:Math.round(s.x),offsetY:Math.round(s.y)})}return u}},Bc=class extends sc{constructor(){super(...arguments),this.layoutComplete="layout-complete"}addListener(e,t){if(this.isLayoutStage(e)||this.isLayoutComplete(e))return super.addListener(e,t);throw new Error(`AG Charts - unsupported listener type: ${e}`)}dispatchPerformLayout(e,t){return this.isLayoutStage(e)?this.getListenersByType(e).reduce((e,t)=>{try{return t.handler(e)}catch(t){return _.errorOnce(t),e}},t):t}dispatchLayoutComplete(e){this.dispatch(this.layoutComplete,e)}isLayoutStage(e){return e!==this.layoutComplete}isLayoutComplete(e){return e===this.layoutComplete}},Vc=class{constructor(){this.groups={}}registerSeries({id:e,seriesGrouping:t,visible:i,type:s}){var r;t&&(null!=(r=this.groups)[s]||(r[s]={}),this.groups[s][e]={grouping:t,visible:i})}deregisterSeries({id:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&0===Object.keys(this.groups[t]).length&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){var s;if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const r=new Set,n=new Set;for(const i of Object.values(null!=(s=this.groups[e])?s:{}))i.visible&&(r.add(i.grouping.groupIndex),i.grouping.groupIndex===t.groupIndex&&n.add(i.grouping.stackIndex));const o=Array.from(r);return o.sort((e,t)=>e-t),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(t.groupIndex)}}},Hc=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=4]="SERIES_UPDATE",e[e.TOOLTIP_RECALCULATION=5]="TOOLTIP_RECALCULATION",e[e.SCENE_RENDER=6]="SCENE_RENDER",e[e.NONE=7]="NONE",e))(Hc||{}),Uc=class extends sc{constructor(e){super(),this.updateCallback=e}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.dispatch("update-complete",{type:"update-complete",minRect:null==e?void 0:e.minRect,minVisibleRect:null==e?void 0:e.minVisibleRect})}},zc=class{constructor(e,t){const{scene:i,syncManager:s,element:r,updateCallback:n,updateMutex:o}=t;this.chartService=e,this.scene=i,this.syncManager=s,this.zoomManager=e.zoomManager,this.annotationManager=new ic(e.annotationRoot),this.ariaAnnouncementService=new Cc(i.canvas.element),this.chartEventManager=new bc,this.contextMenuRegistry=new Sc,this.cursorManager=new xc(r),this.highlightManager=new Ac,this.interactionManager=new fc(e.keyboard,r),this.keyNavManager=new Tc(this.interactionManager),this.regionManager=new _c(this.interactionManager,this.keyNavManager,this.scene.canvas.element,r),this.toolbarManager=new Oc(r),this.gestureDetector=new Mc(r),this.layoutService=new Bc,this.updateService=new Uc(n),this.seriesStateManager=new Vc,this.callbackCache=new tc,this.animationManager=new vc(this.interactionManager,o),this.animationManager.skip(),this.animationManager.play(),this.dataService=new rc(this.animationManager),this.tooltipManager=new Gc(this.scene.canvas.element,e.tooltip)}destroy(){this.tooltipManager.destroy(),this.regionManager.destroy(),this.keyNavManager.destroy(),this.interactionManager.destroy(),this.animationManager.stop(),this.animationManager.destroy(),this.ariaAnnouncementService.destroy(),this.chartEventManager.destroy(),this.highlightManager.destroy(),this.callbackCache.invalidateCache(),this.animationManager.reset(),this.syncManager.destroy()}},Wc=class extends vt{constructor(){super(...arguments),this.range="tooltip"}};S([Kr(Fn(["tooltip","node"],"a range"))],Wc.prototype,"range",2);var jc=class e{constructor(){this.domain=new Set}static is(t){return t instanceof e}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},Kc=class e{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e}static extendDomain(e,t=[1/0,-1/0]){for(const i of e)"number"==typeof i&&(t[0]>i&&(t[0]=i),t[1]<i&&(t[1]=i));return t}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}};function $c(e){return e.map(e=>Be(e)?JSON.stringify(e):e).join("-")}function Yc(e){const t=1e4;return Number.isInteger(e)?e:Math.abs(e)>t?Math.trunc(e):Math.round(e*t)/t}function qc(e,t){var i;const s=function(e){if(null==e)return[];let[t,i]=e.map(Number);return 0===t&&0===i?[0,1]:t===1/0&&i===-1/0?[]:(t===1/0?t=0:i===-1/0&&(i=0),We(t)&&We(i)?[t,i]:[])}(e);if(0===s.length)return s;let[r,n]=s;if(r===n){const[e,s]=null!=(i=null==t?void 0:t.calculatePadding(r,n))?i:[1,1];r-=e,n+=s}return[r,n]}function Xc(e,t){var i;return null!=(i=null==t?void 0:t.get(e.id))?i:0}var Zc=Symbol("invalid"),Qc=class{constructor(e,t="standalone"){this.opts=e,this.mode=t,this.debug=Is.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let i=!0;for(const t of e.props){if("key"===t.type&&!i)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===t.type&&i&&(i=!1)}const s=({matchGroupIds:e=[]})=>{for(const t of e)if(this.values.every(e=>e.groupId!==t))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${t}).`)};for(const t of e.props)switch(t.type){case"key":this.keys.push(v(y({},t),{index:this.keys.length,missing:new Map}));break;case"value":if(null==t.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(t)}`);this.values.push(v(y({},t),{index:this.values.length,missing:new Map}));break;case"aggregate":s(t),this.aggregates.push(v(y({},t),{index:this.aggregates.length}));break;case"group-value-processor":s(t),this.groupProcessors.push(v(y({},t),{index:this.groupProcessors.length}));break;case"property-value-processor":this.propertyProcessors.push(v(y({},t),{index:this.propertyProcessors.length}));break;case"reducer":this.reducers.push(v(y({},t),{index:this.reducers.length}));break;case"processor":this.processors.push(v(y({},t),{index:this.processors.length}))}}resolveProcessedDataDefById(e,t){var i;const s=null==(i=this.scopeCache.get(e.id))?void 0:i.get(t);if(!s)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:s.index,def:s}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveProcessedDataDefsByIds(e,t){return t.map(t=>[t,this.resolveProcessedDataDefById(e,t)])}resolveProcessedDataDefsValues(e,{keys:t,values:i}){const s={};for(const[r,{index:n,def:o}]of e){const e="key"===o.type?t:i;s[r]=e[n]}return s}getDomain(e,t,i="value",s){var r;const n=this.getDomainsByType(i,s);return null!=(r=null==n?void 0:n[this.resolveProcessedDataIndexById(e,t)])?r:[]}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e,t){var i;const{opts:{groupByKeys:s,groupByFn:r},aggregates:n,groupProcessors:o,reducers:a,processors:l,propertyProcessors:c}=this,h=performance.now();if(s&&0===this.keys.length)return;let d=this.extractData(e,t);if(s?d=this.groupData(d):r&&(d=this.groupData(d,r(d))),o.length>0&&this.postProcessGroups(d),n.length>0&&this.aggregateData(d),c.length>0&&this.postProcessProperties(d),a.length>0&&this.reduceData(d),l.length>0&&this.postProcessData(d),e.length>0)for(const t of L(this.keys,this.values))for(const[i,s]of t.missing)if(s>=e.length){const e=null==i?"":` for ${i}`;_.warnOnce(`the key '${t.property}' was not found in any data element${e}.`)}const u=performance.now();d.time=u-h,this.debug.check()&&function(e){var t,i;const s=(e,t)=>{t.length>0&&(_.log(`DataModel.processData() - ${e}`),_.table(t))};_.log("DataModel.processData() - processedData",e),s("Key Domains",e.domain.keys),s("Group Domains",null!=(t=e.domain.groups)?t:[]),s("Value Domains",e.domain.values),s("Aggregate Domains",null!=(i=e.domain.aggValues)?i:[]),"grouped"===e.type?s("Values",e.data.reduce((e,t)=>{var i,s;const r=null!=(i=t.keys)?i:[],n=null!=(s=t.aggValues)?s:[],o=t.keys.map(()=>{}),a=null==n?void 0:n.map(()=>{});return e.push(...t.values.map((e,t)=>[...0===t?r:o,...null!=e?e:[],...0==t?n:a])),e},[])):s("Values",e.data.reduce((e,t)=>{var i;const s=null!=(i=t.aggValues)?i:[];return e.push([...t.keys,...t.values,...s]),e},[]))}(d),this.scopeCache.clear();for(const e of L(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,s]of e.idsMap)for(const r of s)if(this.scopeCache.has(t)){if(null==(i=this.scopeCache.get(t))?void 0:i.has(r))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(r,e)}else this.scopeCache.set(t,new Map([[r,e]]));return d}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=null==e||0===e.length,s="string"==typeof t?t:t.id,r=this.values.findIndex(t=>(null==t.scopes||i&&!t.scopes.length||t.scopes.some(t=>null==e?void 0:e.includes(t)))&&(t.property===s||t.id===s||(t=>{if(t.idsMap)for(const[i,r]of t.idsMap)if((null==e?void 0:e.includes(i))&&r.has(s))return!0;return!1})(t)));if(-1===r)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return r}extractData(e,t){var i,s,r;const{dataDomain:n,processValue:o,scopes:a,allScopesHaveSameDefs:l}=this.initDataDomainProcessor(),c=new Map(null==t?void 0:t.map(e=>[e.id,e])),{keys:h,values:d}=this,u=new Array(e.length);let p=0,g=0;for(const[t,n]of e.entries()){const e={},m=a.size>0?new Set(a):void 0,f=new Array(h.length);let v,C=0;for(const e of h){if(v=o(e,n,v),v===Zc)break;f&&(f[C++]=v)}if(v===Zc)continue;const b=d.length>0?new Array(d.length):void 0;let S;for(const[h,u]of d.entries()){for(const r of null!=(i=u.scopes)?i:a){const i=c.get(r);if(S=o(u,null!=(s=null==i?void 0:i.data[t])?s:n,S,r),S!==Zc&&b){if(null!=i&&!1!==u.includeProperty){const t=u.includeProperty&&null!=u.id?u.id:u.property;null!=e[r]||(e[r]={}),e[r][t]=S}b[h]=S}}if(S===Zc){if(l)break;for(const e of null!=(r=u.scopes)?r:a)null==m||m.delete(e);if(0===(null==m?void 0:m.size))break}}if(S===Zc&&l)continue;if(0===(null==m?void 0:m.size))continue;const w={datum:y(y({},n),e),keys:f,values:b};!l&&m&&m.size<a.size&&(g++,w.validScopes=new Set(m)),u[p++]=w}u.length=p;const m=e=>{const t=n.get(e),i=t.getDomain();return Kc.is(t)&&i[0]>i[1]?[]:i};return{type:"ungrouped",input:{count:e.length},data:u,domain:{keys:h.map(m),values:d.map(m)},defs:{allScopesHaveSameDefs:l,keys:h,values:d},partialValidDataCount:g,time:0}}groupData(e,t){var i;const s=new Map;for(const r of e.data){const{keys:e,values:n,datum:o,validScopes:a}=r,l=null!=(i=null==t?void 0:t(r))?i:e,c=$c(l);if(s.has(c)){const e=s.get(c);if(e.values.push(n),e.datum.push(o),null!=a&&null!=e.validScopes)for(const t of e.validScopes)a.has(t)||e.validScopes.delete(t)}else s.set(c,{keys:l,values:[n],datum:[o],validScopes:a})}const r=new Array(s.size),n=new Array(s.size);let o=0;for(const{keys:e,values:t,datum:i,validScopes:a}of s.values())0!==(null==a?void 0:a.size)&&(n[o]=e,r[o++]={keys:e,values:t,datum:i,validScopes:a});return v(y({},e),{type:"grouped",data:r,domain:v(y({},e.domain),{groups:n})})}aggregateData(e){var t,i,s,r,n,o;const a="ungrouped"===e.type;e.domain.aggValues=[];for(const[l,c]of this.aggregates.entries()){const h=this.valueGroupIdxLookup(c),d=[1/0,-1/0];for(const u of e.data){if(null!=u.aggValues||(u.aggValues=new Array(this.aggregates.length)),u.validScopes)continue;const e=a?[u.values]:u.values;let p=null!=(i=null==(t=c.groupAggregateFunction)?void 0:t.call(c))?i:[1/0,-1/0];for(const t of e){const e=h.map(e=>t[e]),i=c.aggregateFunction(e,u.keys);i&&(p=null!=(r=null==(s=c.groupAggregateFunction)?void 0:s.call(c,i,p))?r:Kc.extendDomain(i,p))}const g=(null!=(o=null==(n=c.finalFunction)?void 0:n.call(c,p))?o:p).map(e=>Yc(e));u.aggValues[l]=g,Kc.extendDomain(g,d)}e.domain.aggValues.push(d)}}postProcessGroups(e){var t,i;const{groupProcessors:s}=this,r=new Set,n=new Map,o=new Map,a=new Map;for(const e of s){const t=this.valueGroupIdxLookup(e);o.set(e,t),a.set(e,e.adjust());for(const e of t){const t="category"===this.values[e].valueType;r.add(e),n.set(e,t?new jc:new Kc)}}const l=e=>{var t;for(const i of r)null==(t=n.get(i))||t.extend(e[i])};for(const r of e.data){for(const n of s){if(r.validScopes)continue;const s=null!=(t=o.get(n))?t:[],l=null==(i=a.get(n))?void 0:i();if(l)if("grouped"===e.type)for(const e of r.values)e&&l(e,s);else r.values&&l(r.values,s)}if("grouped"===e.type)for(const e of r.values)l(e);else l(r.values)}for(const[t,i]of n)e.domain.values[t]=i.getDomain()}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)t()(e,this.valueIdxLookup(s,i))}reduceData(e){var t;null!=e.reduced||(e.reduced={});for(const i of this.reducers){const s=i.reducer();let r=i.initialValue;for(const n of e.data)n.validScopes&&!(null==(t=i.scopes)?void 0:t.some(e=>{var t;return null==(t=n.validScopes)?void 0:t.has(e)}))||(r=s(r,n));e.reduced[i.property]=r}}postProcessData(e){null!=e.reduced||(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e)}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const e of t)if(e.scopes)for(const t of e.scopes)i.add(t);const s=new Map,r=new Map;let n=!0;const o=()=>{var r;for(const o of L(e,t))"category"===o.valueType?s.set(o,new jc):(s.set(o,new Kc),n&&(n=(null!=(r=o.scopes)?r:[]).length===i.size))};o();const a=this.buildAccessors(L(e,t));return{dataDomain:s,processValue:(e,t,i,n)=>{var l,c,h,d,u;let p,g;if(a.has(e.property)){try{g=a.get(e.property)(t)}catch(e){}p=null!=g}else p=e.property in t,g=p?t[e.property]:e.missingValue;if(null!=e.forceValue&&(g=p&&Ks(g)?-1*e.forceValue:e.forceValue,p=!0),!p&&!("missingValue"in e)){const t=null!=(l=e.missing.get(n))?l:0;e.missing.set(n,t+1)}if(s.has(e)||o(),p&&null!=(h=null==(c=e.validation)?void 0:c.call(e,g,t))&&!h){if(!("invalidValue"in e))return"integrated"!==this.mode&&_.warnOnce(`invalid value of type [${typeof g}] ignored:`,`[${g}]`),Zc;g=e.invalidValue}return e.processor&&(r.has(e)||r.set(e,e.processor()),g=null==(d=r.get(e))?void 0:d(g,i===Zc?void 0:i)),null==(u=s.get(e))||u.extend(g),g},initDataDomain:o,scopes:i,allScopesHaveSameDefs:n}}buildAccessors(e){const t=new Map;if("integrated"===this.mode)return t;for(const i of e){if(!i.property.includes(".")&&!i.property.includes("["))continue;let e;e=i.property.startsWith("[")?`return datum${i.property};`:`return datum.${i.property};`,t.set(i.property,new Function("datum",e))}return t}},Jc=class e{constructor(e){this.mode=e,this.debug=Is.create(!0,"data-model"),this.requested=[],this.status="setup"}request(e,t,i){return x(this,null,function*(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,r)=>{this.requested.push({id:e,opts:i,data:t,resolve:s,reject:r})})})}execute(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const e=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",e);const t=this.mergeRequested(e);this.debug("DataController.execute() - merged",t),this.debug.check()&&(ws().processedData=[]);const i=this.requested.map(({id:e})=>e),s=this.hasMultipleDataSources(e);for(const{opts:r,data:n,resolves:o,rejects:a,ids:l}of t)try{const t=new Qc(r,this.mode),c=t.processData(n,e);this.debug.check()&&ws("processedData").push(c),0===(null==c?void 0:c.partialValidDataCount)?o.forEach((e,r)=>e({dataModel:t,processedData:this.processScopedData(l[r],c,i,s)})):c?this.splitResult(t,c,l,o):a.forEach(e=>e(new Error("AG Charts - no processed data generated")))}catch(e){a.forEach(t=>t(e))}}hasMultipleDataSources(e){if(e.length){const[{data:t},...i]=e;return i.some(e=>t!==e.data)}return!1}processScopedData(e,t,i,s){const r=t=>{if(Array.isArray(t))return t.map(r);const n=s?y(y({},t),t[e]):t;for(const e of i)delete n[e];return n},n=t=>{var i;return Array.isArray(t)?t.map(n):null!=(i=null==t?void 0:t[e])?i:t};return v(y({},t),{data:t.data.map(e=>{var t;return v(y({},e),{datum:r(e.datum),values:s?null==(t=e.values)?void 0:t.map(n):e.values})})})}validateRequests(e){const t=[];for(const[i,s]of e.entries())i>0&&s.data.length!==e[0].data.length&&!1===s.opts.groupByData?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):t.push(s);return t}mergeRequested(t){const i=[];for(const s of t){const t=i.find(e.groupMatch(s));t?t.push(s):i.push([s])}return i.map(e.mergeRequests)}splitResult(e,t,i,s){for(let r=0;r<i.length;r++){const n=i[r];(0,s[r])({dataModel:e,processedData:v(y({},t),{data:t.data.filter(({validScopes:e})=>{var t;return null==(t=null==e?void 0:e.has(n))||t})})})}}static groupMatch({data:e,opts:t}){function i(e){return e.filter(e=>"key"===e.type).map(e=>e.property).join(";")}return([s])=>(!1===t.groupByData||s.data===e)&&s.opts.groupByKeys===t.groupByKeys&&s.opts.groupByFn===t.groupByFn&&i(s.opts.props)===i(t.props)}static mergeRequests(t){return t.reduce((t,i)=>{var s,r,{id:n,data:o,resolve:a,reject:l,opts:c}=i,h=c,{props:d}=h,u=C(h,["props"]);t.ids.push(n),t.rejects.push(l),t.resolves.push(a),null!=t.data||(t.data=o),null!=t.opts||(t.opts=v(y({},u),{props:[]}));for(const i of d){const o=v(y({},i),{scopes:[n]});e.createIdsMap(n,o);const a=t.opts.props.find(t=>t.type===o.type&&e.deepEqual(t,o));a?(null!=a.scopes||(a.scopes=[]),a.scopes.push(...null!=(s=o.scopes)?s:[]),"key"!==a.type&&"value"!==a.type||!(null==(r=o.idsMap)?void 0:r.size)||e.mergeIdsMap(o.idsMap,a.idsMap)):t.opts.props.push(o)}return t},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,t){for(const[i,s]of e)if(t.has(i))for(const e of s)t.get(i).add(e);else t.set(i,new Set(s))}static createIdsMap(e,t){null!=t.id&&(null!=t.idsMap||(t.idsMap=new Map),t.idsMap.has(e)?t.idsMap.get(e).add(t.id):t.idsMap.set(e,new Set([t.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;let s,r;if(Array.isArray(t)){if(r=t.length,r!==i.length)return!1;for(s=r-1;s>=0;s--)if(!e.deepEqual(t[s],i[s]))return!1;return!0}const n=Object.keys(t);if(r=n.length,r!==Object.keys(i).length)return!1;for(s=r-1;s>=0;s--){const r=n[s];if(!(e.skipKeys.has(r)||Object.hasOwn(i,r)&&e.deepEqual(t[r],i[r])))return!1}return!0}return!1}};Jc.skipKeys=new Set(["id","idsMap","type","scopes"]);var eh=Jc,th=class e extends oc{constructor(e){super(),this.chart=e}subscribe(t=e.DEFAULT_GROUP){let i=this.get(t);return i||(i=new Set,e.chartsGroups.set(t,i)),i.add(this.chart),this}unsubscribe(t=e.DEFAULT_GROUP){var i;return null==(i=this.get(t))||i.delete(this.chart),this}getChart(){return this.chart}getGroup(t=e.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i):[]}getGroupSiblings(t=e.DEFAULT_GROUP){return this.getGroup(t).filter(e=>e!==this.chart)}get(t){return e.chartsGroups.get(t)}};th.chartsGroups=new Map,th.DEFAULT_GROUP=Symbol("sync-group-default");var ih=th,sh=class extends oc{constructor(){super(...arguments),this.axisZoomManagers=new Map,this.state=new wc(void 0,"initial"),this.rejectCallbacks=new Map}updateAxes(e){var t;const i=new Map(e.map(e=>[e.id,this.axisZoomManagers.get(e.id)]));this.axisZoomManagers.clear();for(const s of e)this.axisZoomManagers.set(s.id,null!=(t=i.get(s.id))?t:new rh(s));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}updateZoom(e,t,i=!0,s){var r;if(s&&this.rejectCallbacks.set(e,s),0===this.axisZoomManagers.size){const n=this.state.stateId();return void("initial"===n||n===e||i?(this.state.set(e,t),n!==e&&(null==(r=this.rejectCallbacks.get(n))||r(e))):null==s||s(n))}this.state.set(e,t),this.axisZoomManagers.forEach(i=>{i.updateZoom(e,null==t?void 0:t[i.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){var s;null==(s=this.axisZoomManagers.get(t))||s.updateZoom(e,i),this.applyChanges(e)}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?null!=e||(e=i.getZoom()):"y"===i.getDirection()&&(null!=t||(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){var t,i;return null!=(i=null==(t=this.axisZoomManagers.get(e))?void 0:t.getZoom())?i:{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}applyChanges(e){if(!Array.from(this.axisZoomManagers.values(),e=>e.applyChanges()).some(Boolean))return;const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]=i.getZoom();this.listeners.dispatch("zoom-change",v(y({type:"zoom-change"},this.getZoom()),{axes:t,callerId:e}))}},rh=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new wc({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return xt(this.state.stateValue())}applyChanges(){const e=this.currentZoom;return this.currentZoom=this.state.stateValue(),e.min!==this.currentZoom.min||e.max!==this.currentZoom.max}},nh=class extends vt{constructor(){super(...arguments),this.enabled=!1}};function oh(e,t){const{bbox:i,showFocusBox:s}=t;if(s&&e.updateFocusIndicatorRect(t.bbox),void 0!==i){const{x:e,y:t}=i.computeCenter();return{type:"keyboard",offsetX:e,offsetY:t}}}S([Kr(Qr)],nh.prototype,"enabled",2),S([Kr(tn)],nh.prototype,"tabIndex",2);var ah=["top","right","bottom","left"],lh=["category","grouped-category","ordinal-time","number","log","time"],ch=class{constructor(){this.result=[],this.valid=[],this.invalid=[]}push(e,t){const{result:i,valid:s,invalid:r}=this;var n;(function(e){return lh.includes(e.type)})(t)&&("string"==typeof(n=t.position)&&ah.includes(n)?s.push(e):r.push(e)),i.push(e)}guessInvalidPositions(){const e=this.valid.filter(e=>lh.includes(e.type)).map(e=>e.position).filter(e=>void 0!==e),t=["top","right","bottom","left"];for(const i of this.invalid){let s=t.pop();for(;e.includes(s)&&void 0!==s;)s=t.pop();if(void 0===s)break;i.position=s}return this.result}},hh=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo","stacked","grouped","stackGroup"],dh=class extends ga{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&bt(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())"legend"===e.type&&(yield{legendType:e.identifier,legend:t})}},uh="ag-chart-overlay",ph="ag-chart-dark-overlay",gh=class extends vt{constructor(e,t){super(),this.className=e,this.defaultText=t,this.darkTheme=!1}getText(){var e;return null!=(e=this.text)?e:this.defaultText}getElement(e,t){null!=this.element||(this.element=xs("div",uh,{position:"absolute"})),this.element.classList.toggle(ph,this.darkTheme),this.focusBox=t;const i=this.element;if(i.style.left=`${t.x}px`,i.style.top=`${t.y}px`,i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,this.renderer){const e=this.renderer();e instanceof HTMLElement?i.replaceChildren(e):i.innerHTML=e}else{const t=xs("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",font:"12px Verdana, sans-serif"});t.innerText=this.getText(),i.replaceChildren(t),null==e||e.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){i.style.opacity="1"}})}return this.element}removeElement(e){if(this.element){if(e){const{element:t}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(e){t.style.opacity=String(e)},onStop(){t.remove()}})}else this.element.remove();this.element=void 0,this.focusBox=void 0}}};S([Kr(en,{optional:!0})],gh.prototype,"text",2),S([Kr(Jr,{optional:!0})],gh.prototype,"renderer",2),S([Kr(Qr)],gh.prototype,"darkTheme",2);var mh=class extends vt{constructor(){super(...arguments),this.loading=new gh("ag-chart-loading-overlay","Loading data..."),this.noData=new gh("ag-chart-no-data-overlay","No data to display"),this.noVisibleSeries=new gh("ag-chart-no-visible-series","No visible series")}getFocusInfo(){for(const e of[this.loading,this.noData,this.noVisibleSeries])if(void 0!==e.focusBox)return{text:e.getText(),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement()}};S([Kr(Xr)],mh.prototype,"loading",2),S([Kr(Xr)],mh.prototype,"noData",2),S([Kr(Xr)],mh.prototype,"noVisibleSeries",2);var fh=`\n.${uh} {\n    color: #181d1f;\n}\n\n.${uh}.${ph} {\n    color: #ffffff;\n}\n\n.${uh}--loading {\n    color: rgb(140, 140, 140); /* DEFAULT_MUTED_LABEL_COLOUR */\n}\n\n.${uh}__loading-background {\n    background: white; /* DEFAULT_BACKGROUND_FILL */\n}\n\n.${uh}.${ph} .${uh}__loading-background {\n    background: #192232; /* DEFAULT_DARK_BACKGROUND_FILL */\n}\n`;function yh(e,t=[0,0]){for(const i of e)"number"==typeof i&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function vh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>yh(e)}}function Ch(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:e=>yh(e),groupAggregateFunction:(e,t=[0,0])=>{var i,s;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(s=null==e?void 0:e[1])?s:0,t}}}function bh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>Kc.extendDomain(e)}}function Sh(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,t=[0,0])=>{var i,s;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(s=null==e?void 0:e[1])?s:0,t}}}function wh(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:e=>yh(e),groupAggregateFunction:(e,t=[0,0,-1])=>{var i,s;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(s=null==e?void 0:e[1])?s:0,t[2]++,t},finalFunction:(e=[0,0,0])=>{const t=e[0]+e[1];return t>=0?[0,t/e[2]]:[t/e[2],0]}}}function xh(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(e,i=[])=>{const s=i[1]-i[0];return t.aggregateFunction(e).map(e=>e/s)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function Eh(e){return()=>{let t=0;return i=>We(i)?(t+=e?Math.max(0,i):i,t):i}}function Mh(){return()=>{let e=0;return t=>{if(!We(t))return t;const i=e;return e+=t,i}}}var Ah={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s=i.keys[0],r=Math.abs(s-e);return e=s,!isNaN(r)&&r>0&&r<t?r:t}}},Th={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>null==e?void 0:e.slice().sort((e,t)=>{for(let i=0;i<e.length;i++){const s=e[i]-t[i];if(0!==s)return s}return 0})};function Dh({normaliseTo:e,mode:t}){const i=(t,i)=>{const s=t*e/i;return s>=0?Math.min(e,s):Math.max(-e,s)};return()=>()=>(e,s)=>{const r=[0,0];for(const i of s){const s=e[i],n=s<0?0:1;"sum"===t?r[n]+=s:r[n]=0===n?Math.min(r[n],s):Math.max(r[n],s)}const n=Math.max(Math.abs(r[0]),r[1]);for(const t of s)e[t]=i(e[t],n)}}function Ih(e,t,i="sum"){return{type:"group-value-processor",matchGroupIds:e,adjust:Lo({normaliseTo:t,mode:i},Dh)}}function Rh({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const r=e[1]-e[0],n=(i,s,n)=>{const o=e[0]+(i-s)/n*r;return 0===n?t:o>=e[1]?e[1]:o<e[0]?e[0]:o};return()=>(t,r)=>{let[o,a]=t.domain.values[r];null!=i&&(o=i),null!=s&&(a=s);const l=a-o;t.domain.values[r]=[e[0],e[1]];for(const e of t.data){let i=e.values;"ungrouped"===t.type&&(i=[i]);for(const e of i)e[r]=n(e[r],o,l)}}}function Ph(e,t,i,s,r){return{type:"property-value-processor",property:e,adjust:Lo({normaliseTo:t,rangeMin:s,rangeMax:r,zeroDomain:i},Rh)}}function kh(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:s}=t.defs,{input:r,data:n}=t;let o=!0,a=!0;const l=[];for(let t=0;t<s.length;t++)(null==e?void 0:e.includes(s[t].id))&&l.push([t,s[t]]);const c=(e,i,s)=>{var l;if("category"===i.valueType){const i=t.domain[s][e];return void(o&&(o=i.length===r.count))}let c=null==(l=n[0])?void 0:l[s][e];for(let t=1;(o||a)&&t<n.length;t++){const i=n[t][s][e];a&&(a=c<=i),o&&(o=c!==i),c=i}};for(let e=0;(o||a)&&e<i.length;e++)c(e,i[e],"keys");for(let e=0;(o||a)&&e<l.length;e++){const[t,i]=l[e];c(t,i,"values")}return{uniqueKeys:o,orderedKeys:a}}}}function Lh({mode:e,separateNegative:t}){return()=>()=>(i,s)=>{const r=[0,0];for(const n of s){const s=i[n],o=Ks(s)&&t?0:1;We(s)&&("normal"===e&&(r[o]+=s),i[n]=r[o],"trailing"===e&&(r[o]+=s))}}}function Nh({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(r,n)=>{let o=0;for(const a of n){const n=r[a],l=s&&"current"===t?0:i[a];i[a]=n;const c="current"===t?n:l;We(n)&&We(l)?("normal"===e&&(o+=c),r[a]=o,"trailing"===e&&(o+=c)):r[a]=o}s=!1}}}function _h(e,t,i,s=!1){let r;return r=t.startsWith("window")?Lo({mode:t.endsWith("-trailing")?"trailing":"normal",sum:i},Nh):Lo({mode:t,separateNegative:s},Lh),{type:"group-value-processor",matchGroupIds:[e],adjust:r}}function Oh(e,t=!0){return{type:"processor",property:"diff",calculate:i=>{const s=new Map,r=new Map,n=new Map,o=new Map,a=Math.max(e.data.length,i.data.length);for(let l=0;l<a;l++){const a=e.data[l],c=i.data[l],h=a?Fh(a.keys):"",d=c?Fh(c.keys):"";c&&a&&h===d?ds(a.values,c.values)||n.set(d,c):(o.has(d)?(!t&&ds(o.get(d).values,c.values)||(n.set(d,c),s.set(d,c)),o.delete(d)):c&&r.set(d,c),r.has(h)?(!t&&ds(r.get(h).values,a.values)||(n.set(h,a),s.set(h,a)),r.delete(h)):a&&(n.delete(h),o.set(h,a)))}return{changed:r.size>0||n.size>0||o.size>0,added:r,updated:n,removed:o,moved:s}}}}function Fh(e,...t){let i;return i=Le(e)?e.map(e=>qo(e)).join("___"):qo(e),("string"==typeof i||"number"==typeof i||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var Gh=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_BY_MAIN_AXIS_FIRST=1]="NEAREST_BY_MAIN_AXIS_FIRST",e[e.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST=2]="NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST",e[e.NEAREST_NODE=3]="NEAREST_NODE",e))(Gh||{});function Bh(e){return null!=e&&$o(e)}function Vh(e){return null!=e}function Hh(e){switch(e){case"number":case"log":case"ordinal-time":case"time":case"color":return Bh;default:return Vh}}function Uh(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function zh(e,t,i={}){return y({property:e,type:"key",valueType:Uh(t),validation:Hh(t)},i)}function Wh(e,t,i={}){return y({property:e,type:"value",valueType:Uh(t),validation:Hh(t)},i)}function jh(e,t={}){const i=t,{min:s=-1/0,max:r=1/0}=i,n=C(i,["min","max"]);return y({type:"value",property:e,valueType:"range",validation:Bh,processor:()=>e=>We(e)?Hs(s,e,r):e},n)}function Kh(e,t,i={}){const s=i,{onlyPositive:r}=s,n=C(s,["onlyPositive"]);return v(y({},Wh(e,t,n)),{processor:Eh(r)})}function $h(e,t,i={}){return v(y({},Wh(e,t,i)),{processor:Mh()})}function Yh(e,t,i="current",s,r){return[Wh(e,r,s),_h(s.groupId,t,i,s.separateNegative),...null!=s.rangeId?[bh(s.rangeId,s.groupId)]:[]]}var qh=class{constructor(e,t,{datum:i},s){this.type=e,this.event=t,this.datum=i,this.seriesId=s.id}},Xh=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},Zh=class extends Zl{constructor(e){super(),this.destroyFns=[],this.seriesGrouping=void 0,this.NodeEvent=qh,this.internalId=Gs(this),this.rootGroup=new Eo({name:"seriesRoot",isVirtual:!0}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new ga,this._declarationOrder=-1,this.seriesListeners=new sc;const{moduleCtx:t,pickModes:i=[1],directionKeys:s={},directionNames:r={},contentGroupVirtual:n=!0,canHaveAxes:o=!1}=e;this.ctx=t,this.directionKeys=s,this.directionNames=r,this.canHaveAxes=o,this.contentGroup=this.rootGroup.appendChild(new Eo({name:`${this.internalId}-content`,isVirtual:n,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.highlightGroup=new Eo({name:`${this.internalId}-highlight`,isVirtual:n,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("highlight")}),this.highlightNode=this.highlightGroup.appendChild(new Eo({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Eo({name:"highlightLabel",zIndex:10})),this.pickModes=i,this.labelGroup=this.rootGroup.appendChild(new Eo({name:`${this.internalId}-series-labels`,zIndex:8})),this.annotationGroup=new Eo({name:`${this.id}-annotation`,isVirtual:n,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("annotation")})}get id(){var e,t;return null!=(t=null==(e=this.properties)?void 0:e.id)?t:this.internalId}get type(){var e;return null!=(e=this.constructor.type)?e:""}get data(){var e;return null!=(e=this._data)?e:this._chartData}set visible(e){this.properties.visible=e,this.visibleChanged()}get visible(){return this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){var e,t;return null!=(t=null==(e=this.properties.tooltip)?void 0:e.enabled)&&t}onDataChange(){this.nodeDataRefresh=!0}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:r}=this;e&&this.ctx.seriesStateManager.deregisterSeries({id:i,type:s}),t&&this.ctx.seriesStateManager.registerSeries({id:i,type:s,visible:r,seriesGrouping:t}),this.fireEvent(new Xh(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}getGroupZIndexSubOrder(e,t=0){let i=0;switch(e){case"data":case"paths":break;case"labels":i+=2e4;break;case"marker":i+=1e4;break;case"highlight":t+=15e3;break;case"annotation":i+=15e3}return[()=>this._declarationOrder+i,t]}addListener(e,t){return this.seriesListeners.addListener(e,t)}dispatch(e,t){this.seriesListeners.dispatch(e,t)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns=[],this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(e,t){const i=this.resolveKeyDirection(e),s=null==t?void 0:t[i],r=[];if(!s)return r;const n=(...e)=>{for(const t of e)Array.isArray(t)?n(...t):"object"==typeof t?n(...Object.values(t)):r.push(t)};return n(...s.map(e=>this.properties[e])),r}getKeys(e){return this.getDirectionValues(e,this.directionKeys)}getKeyProperties(e){var t;return null!=(t=this.directionKeys[this.resolveKeyDirection(e)])?t:[]}getNames(e){return this.getDirectionValues(e,this.directionNames)}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(t=>t.getDomain(e));return t.concat(i.flat())}markNodeDataDirty(){this.nodeDataRefresh=!0}visibleChanged(){this.ctx.seriesStateManager.registerSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:t=!0}=this.properties.highlightStyle.series;if(!t||1===e)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return e}}getStrokeWidth(e){const{strokeWidth:t,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===t)return e;switch(this.isItemIdHighlighted()){case 1:return t;case 0:case 2:return e}}isItemIdHighlighted(){var e,t;const i=null==(t=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight())?void 0:t.series;return null==i?0:i!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNode(e,t){const{pickModes:i,visible:s,rootGroup:r}=this;if(s&&r.visible)for(const s of i){if(t&&!t.includes(s))continue;let i;switch(s){case 0:i=this.pickNodeExactShape(e);break;case 1:case 2:i=this.pickNodeMainAxisFirst(e,2===s);break;case 3:i=this.pickNodeClosestDatum(e)}if(i)return{pickMode:s,match:i.datum,distance:i.distance}}}pickNodeExactShape(e){const t=this.contentGroup.pickNode(e.x,e.y);if(t&&!0!==t.datum.missing)return{datum:t.datum,distance:0}}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=Zs(e.x,e.y,t);if(void 0!==i.nearest&&!0!==i.nearest.datum.missing)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}fireNodeClickEvent(e,t){this.fireEvent(new this.NodeEvent("nodeClick",e,t,this))}fireNodeDoubleClickEvent(e,t){this.fireEvent(new this.NodeEvent("nodeDoubleClick",e,t,this))}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}toggleSeriesItem(e,t){this.visible=t,this.nodeDataRefresh=!0,this.dispatch("visibility-changed",{itemId:e,enabled:t})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return v(y({},this.ctx),{series:this})}getLabelText(e,t,i=String){var s;return e.formatter&&null!=(s=this.ctx.callbackCache.call(e.formatter,y({seriesId:this.id},t)))?s:i(t.value)}getMarkerStyle(e,t,i=e.getStyle()){var s,r;const n=Xe({size:null!=(r=null==(s=t.datum.point)?void 0:s.size)?r:0},i);return e.formatter?Xe(this.ctx.callbackCache.call(e.formatter,v(y(y({seriesId:this.id},n),t),{datum:t.datum.datum})),n):n}updateMarkerStyle(e,t,i,s=t.getStyle(),{applyTranslation:r=!0}={}){const{point:n}=i.datum,o=this.getMarkerStyle(t,i,s),a=this.visible&&o.size>0&&n&&!isNaN(n.x)&&!isNaN(n.y);r?e.setProperties(v(y({visible:a},o),{translationX:null==n?void 0:n.x,translationY:null==n?void 0:n.y})):e.setProperties(y({visible:a},o)),"function"!=typeof t.shape||e.dirtyPath||(e.path.clear(!0),e.updatePath(),e.checkPathDirty())}getMinRects(e,t){}get nodeDataDependencies(){var e;return null!=(e=this._nodeDataDependencies)?e:{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=null!=e?e:{width:NaN,height:NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,r=null!=wt(this.nodeDataDependencies,s);return r&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),r}pickFocus(e){}};Zh.highlightedZIndex=1e12,S([Xa({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Zh.prototype,"seriesGrouping",2);var Qh=class{constructor(e,t,i){this.seriesRoot=e,this.highlightRoot=t,this.annotationRoot=i,this.groups={},this.series={},this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){var t,i,s;const{internalId:r,type:n,rootGroup:o,highlightGroup:a,annotationGroup:l,seriesGrouping:c}=e,{groupIndex:h=r}=null!=c?c:{};if(null!=this.series[r])throw new Error(`AG Charts - series already has an allocated layer: ${this.series[r]}`);0===Object.keys(this.series).length&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal"),null!=(t=this.groups)[n]||(t[n]={});const d=this.lookupIdx(h);let u=this.groups[n][d];return u||(u=null!=(s=(i=this.groups[n])[d])?s:i[d]={seriesIds:[],group:this.seriesRoot.appendChild(new Eo({name:`${n}-content`,layer:!0,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("data")})),highlight:this.highlightRoot.appendChild(new Eo({name:`${n}-highlight`,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("highlight")})),annotation:this.annotationRoot.appendChild(new Eo({name:`${n}-annotation`,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("annotation")}))}),this.series[r]={layerState:u,seriesConfig:e},u.seriesIds.push(r),u.group.appendChild(o),u.highlight.appendChild(a),u.annotation.appendChild(l),u.group}changeGroup(e){var t,i;const{internalId:s,seriesGrouping:r,type:n,rootGroup:o,highlightGroup:a,annotationGroup:l,oldGrouping:c}=e,{groupIndex:h=s}=null!=r?r:{};(null==(i=null==(t=this.groups[n])?void 0:t[h])?void 0:i.seriesIds.includes(s))||(null!=this.series[s]&&this.releaseGroup({internalId:s,seriesGrouping:c,type:n,rootGroup:o,highlightGroup:a,annotationGroup:l}),this.requestGroup(e))}releaseGroup(e){var t,i,s,r,n;const{internalId:o,seriesGrouping:a,rootGroup:l,highlightGroup:c,annotationGroup:h,type:d}=e,{groupIndex:u=o}=null!=a?a:{};if(null==this.series[o])throw new Error(`AG Charts - series doesn't have an allocated layer: ${o}`);const p=this.lookupIdx(u),g=null!=(s=null==(t=this.groups[d])?void 0:t[p])?s:null==(i=this.series[o])?void 0:i.layerState;if(g&&(g.seriesIds=g.seriesIds.filter(e=>e!==o),g.group.removeChild(l),g.highlight.removeChild(c),g.annotation.removeChild(h)),0===(null==g?void 0:g.seriesIds.length))this.seriesRoot.removeChild(g.group),this.highlightRoot.removeChild(g.highlight),this.annotationRoot.removeChild(g.annotation),delete this.groups[d][p],delete this.groups[d][o];else if((null==g?void 0:g.seriesIds.length)>0){const e=null==(n=this.series[null==(r=null==g?void 0:g.seriesIds)?void 0:r[0]])?void 0:n.seriesConfig;g.group.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("data"),g.highlight.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("highlight"),g.annotation.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("annotation")}delete this.series[o]}lookupIdx(e){return"normal"===this.mode?e:"string"!=typeof e||(e=Number(e.split("-").slice(-1)[0]))?Math.floor(30*Hs(0,e/this.expectedSeriesCount,1)):0}destroy(){for(const e of Object.values(this.groups))for(const t of Object.values(e))this.seriesRoot.removeChild(t.group),this.highlightRoot.removeChild(t.highlight),this.annotationRoot.removeChild(t.annotation);this.groups={},this.series={}}},Jh=class{constructor(e,t){this.chartLike=e,this.layoutService=t,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("start-layout",e=>this.positionPadding(e.shrinkRect)),this.layoutService.addListener("start-layout",e=>this.positionCaptions(e.shrinkRect)))}destroy(){this.destroyFns.forEach(e=>e())}positionPadding(e){const{padding:t}=this.chartLike;return e.shrink(t.left,"left"),e.shrink(t.top,"top"),e.shrink(t.right,"right"),e.shrink(t.bottom,"bottom"),{shrinkRect:e}}positionCaptions(e){var t,i;const{title:s,subtitle:r,footnote:n}=this.chartLike,o=e.clone(),a=t=>{var i;const s=e.height/10,r=null!=(i=t.lineHeight)?i:t.fontSize*Fo.defaultLineHeightRatio,n=e.width,o=Math.max(r,s);t.computeTextWrap(n,o)},l=e=>"left"===e?o.x:"right"===e?o.x+o.width:("center"!==e&&_.error(`invalid textAlign value: ${e}`),o.x+o.width/2),c=(e,t)=>{const i=o.y;e.node.x=l(e.textAlign),e.node.y=i,e.node.textBaseline="top",a(e);const s=e.node.computeBBox(),r=Math.ceil(s.y-i+s.height+t);o.shrink(r,"top")};if(s.node.visible=s.enabled,r.node.visible=r.enabled,n.node.visible=n.enabled,s.enabled){const{spacing:e=(r.enabled?al.SMALL_PADDING:al.LARGE_PADDING)}=s;c(s,e)}return r.enabled&&c(r,null!=(t=r.spacing)?t:0),n.enabled&&((e,t)=>{const i=o.y+o.height;e.node.x=l(e.textAlign),e.node.y=i,e.node.textBaseline="bottom",a(e);const s=e.node.computeBBox(),r=Math.ceil(i-s.y+t);o.shrink(r,"bottom")})(n,null!=(i=n.spacing)?i:0),{shrinkRect:o}}},ed=class{constructor(e,t,i,s){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=s,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){(this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow().catch(e=>_.errorOnce(e))}onZoomChange(){this.dirtyZoom=!0}updateWindow(){return x(this,null,function*(){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let t,i=!0;if(e){const s=this.zoomManager.getAxisZoom(e.id);t=this.getAxisWindow(e,s),i=this.shouldRefresh(e,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:null==t?void 0:t.min,windowEnd:null==t?void 0:t.max})})}getValidAxis(){return this.chart.axes.find(e=>"time"===e.type)}shouldRefresh(e,t){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(e.id);return!(i&&t.min===i.min&&t.max===i.max||(this.lastAxisZooms.set(e.id,t),0))}getAxisWindow(e,t){var i,s;const r=null==(s=(i=e.scale).getDomain)?void 0:s.call(i);if(!t||!r||0===r.length||isNaN(Number(r[0])))return;const n=Number(r[1])-Number(r[0]);return{min:new Date(Number(r[0])+n*t.min),max:new Date(Number(r[0])+n*t.max)}}},td=class{constructor(e,t,i,s,r){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutService=s,this.animationManager=r,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("layout-complete",e=>this.onLayoutComplete(e)))}destroy(){this.destroyFns.forEach(e=>e())}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(e=>e.hasData),s=this.chartLike.series.some(e=>e.visible);this.toggleOverlay(this.overlays.loading,e,t),this.toggleOverlay(this.overlays.noData,e,!t&&!i),this.toggleOverlay(this.overlays.noVisibleSeries,e,i&&!s)}toggleOverlay(e,t,i){if(i){const i=e.getElement(this.animationManager,t);this.chartLike.element.append(i)}else e.removeElement(this.animationManager)}},id=Is.create(!0,"opts"),sd=class extends vt{constructor(){super(...arguments),this.padding=new Ql(0)}};S([Kr(Qr,{optional:!0})],sd.prototype,"clip",2),S([Kr(Xr)],sd.prototype,"padding",2);var rd=class e extends Zl{constructor(e,t){var i,s;super(),this.id=Gs(this),this.seriesRoot=new Eo({name:`${this.id}-series-root`}),this.highlightRoot=new Eo({name:`${this.id}-highlight-root`,layer:!0,zIndex:5,nonEmptyChildDerivedZIndex:!0}),this.annotationRoot=new Eo({name:`${this.id}-annotation-root`,layer:!0,zIndex:10}),this.debug=Is.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this.padding=new Ql(20),this.seriesArea=new sd,this.title=new al,this.subtitle=new al,this.footnote=new al,this.keyboard=new nh,this.mode="standalone",this.destroyed=!1,this._skipSync=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new dh,this.zoomManager=new sh,this.processors=[],this.processedOptions={},this.userOptions={},this.queuedUserOptions=[],this._pendingFactoryUpdatesCount=0,this._performUpdateNoRenderCount=0,this._performUpdateSkipAnimations=!1,this.performUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new Xl,this.updateRequestors={},this.performUpdateTrigger=Jl((e,t=0)=>setTimeout(e,t),e=>x(this,[e],function*({count:e}){this.destroyed||this.updateMutex.acquire(()=>x(this,null,function*(){try{yield this.performUpdate(e)}catch(e){_.error("update error",e)}})).catch(e=>_.errorOnce(e))})),this._performUpdateSplits={},this.axes=[],this.series=[],this.focus={hasFocus:!1,series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.pointerScheduler=Jl((e,t)=>requestAnimationFrame(e),()=>{this.lastInteractionEvent&&(this.performUpdateType<=4?this.pointerScheduler.schedule():(this.handlePointer(this.lastInteractionEvent,!1),this.lastInteractionEvent=void 0))}),this.onSeriesNodeClick=e=>{const t=v(y({},e),{type:"seriesNodeClick"});Object.defineProperty(t,"series",{enumerable:!1,get:()=>e.series}),this.fireEvent(t)},this.onSeriesNodeDoubleClick=e=>{const t=v(y({},e),{type:"seriesNodeDoubleClick"});this.fireEvent(t)},this.seriesGroupingChanged=e=>{if(!(e instanceof Xh))return;const{series:t,seriesGrouping:i,oldGrouping:s}=e;null!=t.rootGroup.parent&&this.seriesLayerManager.changeGroup({internalId:t.internalId,type:t.type,rootGroup:t.rootGroup,highlightGroup:t.highlightGroup,annotationGroup:t.annotationGroup,getGroupZIndexSubOrder:e=>t.getGroupZIndexSubOrder(e),seriesGrouping:i,oldGrouping:s})},this.dataProcessListeners=new Set,this.chartOptions=e;let r=null==t?void 0:t.scene;const n=null!=(i=null==t?void 0:t.element)?i:xs("div","ag-chart-wrapper",{position:"relative",userSelect:"none"}),o=null==t?void 0:t.container;this.element=n;const a=new Eo({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.highlightRoot),a.append(this.annotationRoot),this.axisGridGroup=new Eo({name:"Axes-Grids",layer:!0,zIndex:1}),a.appendChild(this.axisGridGroup),this.axisGroup=new Eo({name:"Axes",layer:!0,zIndex:2}),a.appendChild(this.axisGroup),this.sizeMonitor=new ec,this.sizeMonitor.observe(this.element,e=>this.rawResize(e));const{overrideDevicePixelRatio:l}=e.specialOverrides;null!=r||(r=new Yl({pixelRatio:l,canvasPosition:"absolute"})),r.setRoot(a).setContainer(n),this.autoSize=!0,this.tooltip=new ol,this.seriesLayerManager=new Qh(this.seriesRoot,this.highlightRoot,this.annotationRoot);const c=this.ctx=new zc(this,{scene:r,syncManager:new ih(this),element:n,updateCallback:(e=0,t)=>this.update(e,t),updateMutex:this.updateMutex});this.overlays=new mh,null!=(s=this.overlays.loading).renderer||(s.renderer=()=>function(e,t){const{animationDuration:i}=Mr.add,s=xs("div",`${uh}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${i*t}ms linear 50ms both`}),r=xs("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),n=xs("p",{marginTop:"1em"});n.innerText=e;const o=xs("div",`${uh}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),a=xs("style");return a.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),s.replaceChildren(a,r,n,o),Ms(fh,"chartOverlays"),s}(this.overlays.loading.getText(),c.animationManager.defaultDuration)),this.processors=[new Jh(this,c.layoutService),new ed(this,c.dataService,c.updateService,c.zoomManager),new td(this,this.overlays,c.dataService,c.layoutService,c.animationManager)],this.highlight=new Wc,this.container=o;const{All:h}=gc,d=this.getModuleContext(),u=c.regionManager.addRegion("series",this.seriesRoot,this.axisGroup);c.regionManager.addRegion("root",a),this._destroyFns.push(c.dataService.addListener("data-load",e=>{this.data=e.data}),c.scene.attachNode(this.title.node),c.scene.attachNode(this.subtitle.node),c.scene.attachNode(this.footnote.node),this.title.registerInteraction(d,"title"),this.subtitle.registerInteraction(d,"subtitle"),this.footnote.registerInteraction(d,"footnote"),c.interactionManager.addListener("click",e=>this.onClick(e)),c.interactionManager.addListener("dblclick",e=>this.onDoubleClick(e)),u.addListener("hover",e=>this.onMouseMove(e)),u.addListener("leave",e=>this.onLeave(e)),u.addListener("blur",()=>this.onBlur()),u.addListener("tab",e=>this.onTab(e)),u.addListener("nav-vert",e=>this.onNavVert(e)),u.addListener("nav-hori",e=>this.onNavHori(e)),u.addListener("submit",e=>this.onSubmit(e)),c.keyNavManager.addListener("browserfocus",e=>this.onBrowserFocus(e)),c.interactionManager.addListener("page-left",()=>this.destroy()),c.interactionManager.addListener("contextmenu",e=>this.onContextMenu(e),h),c.animationManager.addListener("animation-start",()=>this.onAnimationStart()),c.animationManager.addListener("animation-frame",()=>{this.update(6)}),c.highlightManager.addListener("highlight-change",e=>this.changeHighlightDatum(e)),c.zoomManager.addListener("zoom-pan-start",()=>this.resetPointer()),c.zoomManager.addListener("zoom-change",()=>{this.resetPointer(),this.series.map(e=>{var t;return null==(t=e.animationState)?void 0:t.transition("updateData")});const e="initial"!==this.chartAnimationPhase;this.update(3,{forceNodeDataRefresh:!0,skipAnimations:e})}))}static getInstance(t){return e.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}onAutoSizeChange(e){const{style:t}=this.element;if(e){if(t.display="block",t.width="100%",t.height="100%",!this._lastAutoSize)return;this.resize(void 0,void 0,"autoSize option")}else t.display="inline-block",t.width="auto",t.height="auto"}download(e,t){this.ctx.scene.download(e,t)}getOptions(){var e;return null!=(e=this.queuedUserOptions.at(-1))?e:this.userOptions}getModuleContext(){return this.ctx}getAriaLabel(){var e;const t=[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ");return`chart, ${null!=(e=this.series.length)?e:0} series, ${t}`}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}destroy(e){if(this.destroyed)return;const t=null==e?void 0:e.keepTransferableResources;let i;return this.performUpdateType=7,this._destroyFns.forEach(e=>e()),this.processors.forEach(e=>e.destroy()),this.tooltip.destroy(),this.overlays.destroy(),this.sizeMonitor.unobserve(this.element),this.modulesManager.destroy(),t?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene,element:this.element}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(e=>e.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.zoomManager.destroy(),this.destroyed=!0,Object.freeze(this),i}resetPointer(e=!1){e||this.ctx.tooltipManager.removeTooltip(this.id),this.ctx.highlightManager.updateHighlight(this.id),this.lastInteractionEvent=void 0}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(()=>x(this,null,function*(){this.destroyed||(yield e(this),this.destroyed||this._pendingFactoryUpdatesCount--)})).catch(e=>_.errorOnce(e)))}update(e=0,t){var i,s;const{forceNodeDataRefresh:r=!1,skipAnimations:n,seriesToUpdate:o=this.series,newAnimationBatch:a}=null!=t?t:{};r&&this.series.forEach(e=>e.markNodeDataDirty());for(const e of o)this.seriesToUpdate.add(e);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this._skipSync=null!=(i=null==t?void 0:t.skipSync)&&i,this.debug.check()){let t=null!=(s=(new Error).stack)?s:"<unknown>";t=t.replace(/\([^)]*/g,""),this.updateRequestors[t]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.performUpdateTrigger.schedule(null==t?void 0:t.backOffMs))}performUpdate(e){return x(this,null,function*(){const{performUpdateType:t,extraDebugStats:i,_performUpdateSplits:s,ctx:r}=this,n=[...this.seriesToUpdate];this.performUpdateType=7,this.seriesToUpdate.clear(),0===this.updateShortcutCount&&t<6&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",Hc[t]);let o=performance.now();null!=s.start||(s.start=o);const a=e=>{null!=s[e]||(s[e]=0),s[e]+=performance.now()-o,o=performance.now()};let l=!1;switch(t){case 0:this.updateDOM();case 1:yield this.updateData(),a("⬇️");case 2:yield this.processData(),this.resetPointer(!0),a("🏭");case 3:if(this.checkUpdateShortcut(3))break;if(!this.checkFirstAutoSize(n)){l=!0;break}yield this.processLayout(),a("⌖");case 4:if(this.checkUpdateShortcut(4))break;const{seriesRect:e}=this;yield Promise.all(n.map(t=>t.update({seriesRect:e}))),a("🤔");case 5:if(this.checkUpdateShortcut(5))break;const o=r.tooltipManager.getTooltipMeta(this.id);t<=4&&null!=(null==o?void 0:o.lastPointerEvent)&&this.handlePointer(o.lastPointerEvent,!0),a("↖");case 6:if(this.checkUpdateShortcut(6))break;r.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,yield r.scene.render({debugSplitTimes:s,extraDebugStats:i}),this.ctx.regionManager.updateFocusWrapperRect(),this.extraDebugStats={};for(const e in s)delete s[e];case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}l||r.updateService.dispatchUpdateComplete(this.getMinRects());const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(c-s.start))/100,count:e,performUpdateType:Hc[t]})})}updateThemeClassName(){const{element:e,processedOptions:{theme:t}}=this,i="ag-charts-theme-",s=[`${i}default`,`${i}default-dark`];let r=s[0],n=!1;"string"==typeof t?(r=t.replace("ag-",i),n=t.includes("-dark")):"string"==typeof(null==t?void 0:t.baseTheme)&&(r=t.baseTheme.replace("ag-",i),n=t.baseTheme.includes("-dark")),s.includes(r)||(r=n?s[1]:s[0]),e.classList.forEach(t=>{t.startsWith(i)&&t!==r&&e.classList.remove(t)}),e.classList.add(r)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:t}=this.keyboard;this.element.tabIndex=e?null!=t?t:0:-1,Qa(this.ctx.scene.canvas.element,"role","figure"),Qa(this.ctx.scene.canvas.element,"aria-label",this.getAriaLabel())}checkUpdateShortcut(e){return this.updateShortcutCount>3?(_.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e&&(this.updateShortcutCount++,!0)}checkFirstAutoSize(e){if(this.autoSize&&!this._lastAutoSize){const t=this._performUpdateNoRenderCount++,i=40*m(t+1,2);if(t<8)return this.update(3,{seriesToUpdate:e,backOffMs:i}),this.debug("Chart.checkFirstAutoSize() - backing off until first size update",i),!1;this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}return this._performUpdateNoRenderCount=0,!0}onAxisChange(e,t=[]){for(const i of t)e.includes(i)||(i.detachAxis(this.axisGroup,this.axisGridGroup),i.destroy());for(const i of e)(null==t?void 0:t.includes(i))||i.attachAxis(this.axisGroup,this.axisGridGroup)}onSeriesChange(e,t){var i,s;const r=null!=(i=null==t?void 0:t.filter(t=>!e.includes(t)))?i:[];this.destroySeries(r),null==(s=this.seriesLayerManager)||s.setSeriesCount(e.length);for(const i of e){if(null==t?void 0:t.includes(i))continue;null==i.rootGroup.parent&&this.seriesLayerManager.requestGroup(i);const e=this;i.chart={get mode(){return e.mode},get isMiniChart(){return!1},get seriesRect(){return e.seriesRect},placeLabels:()=>e.placeLabels()},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}}destroySeries(e){null==e||e.forEach(e=>{e.removeEventListener("nodeClick",this.onSeriesNodeClick),e.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),e.removeEventListener("groupingChanged",this.seriesGroupingChanged),e.destroy(),this.seriesLayerManager.releaseGroup(e),e.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}updateAllSeriesListeners(){this.series.forEach(e=>{e.removeEventListener("nodeClick",this.onSeriesNodeClick),e.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.addSeriesListeners(e)})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e=gs(this.axes,e=>e.direction);this.series.forEach(t=>{t.directions.forEach(i=>{const s=e[i];if(!s)return void _.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const r=t.getKeys(i),n=s.find(e=>!e.keys.length||r.some(t=>e.keys.includes(t)));n?t.axes[i]=n:_.warnOnce(`no matching axis for direction [${i}] and keys [${r}]; check series and axes configuration.`)})})}rawResize({width:e,height:t}){var i;if(!this.autoSize)return;if(e=Math.floor(e),t=Math.floor(t),0===e&&0===t)return;const[s=0,r=0]=null!=(i=this._lastAutoSize)?i:[];s===e&&r===t||(this._lastAutoSize=[e,t],this.resize(void 0,void 0,"SizeMonitor"))}resize(e,t,i){var s,r,n,o;const{scene:a,animationManager:l}=this.ctx;if(null!=e||(e=null!=(r=this.width)?r:this.autoSize?null==(s=this._lastAutoSize)?void 0:s[0]:a.canvas.width),null!=t||(t=null!=(o=this.height)?o:this.autoSize?null==(n=this._lastAutoSize)?void 0:n[1]:a.canvas.height),this.debug(`Chart.resize() from ${i}`,{width:e,height:t,stack:(new Error).stack}),e&&t&&We(e)&&We(t)&&a.resize(e,t)){this.resetPointer(),l.reset();let e=!0;this.autoSize&&this._firstAutoSize&&(e=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:e})}}updateData(){return x(this,null,function*(){this.series.forEach(e=>e.setChartData(this.data));const e=this.modulesManager.mapModules(e=>{var t;return null==(t=e.updateData)?void 0:t.call(e,{data:this.data})});yield Promise.all(e)})}processData(){return x(this,null,function*(){if(this.series.some(e=>e.canHaveAxes)){this.assignAxesToSeries();const e=this.modulesManager.getModule("sync");(null==e?void 0:e.enabled)?e.syncAxes(this._skipSync):this.assignSeriesToAxes()}const e=new eh(this.mode),t=this.series.map(t=>t.processData(e)),i=this.modulesManager.mapModules(t=>{var i;return null==(i=t.processData)?void 0:i.call(t,{dataController:e})});e.execute(),yield Promise.all([...t,...i]);for(const{legendType:e,legend:t}of this.modulesManager.legends())t.data=this.getLegendData(e,"integrated"!==this.mode);this.dataProcessListeners.forEach(e=>e()),this.dataProcessListeners.clear()})}placeLabels(){const e=[],t=[];for(const i of this.series){if(!i.visible)continue;const s=i.getLabelData();za(null==s?void 0:s[0])&&(t.push(s),e.push(i))}const{seriesRect:i}=this,{top:s,right:r,bottom:n,left:o}=this.seriesArea.padding,a=i&&t.length>0?function(e,t,i=5){var s,r;const n=[];e=e.map(e=>e.slice().sort((e,t)=>t.point.size-e.point.size));for(let o=0;o<e.length;o++){const a=n[o]=[],l=e[o];if((null==l?void 0:l.length)&&l[0].label)for(let o=0,c=l.length;o<c;o++){const c=l[o],{point:h,label:d,marker:u}=c,{text:p,width:g,height:m}=d,f=.5*h.size;let y=0,v=0;if(f>0&&null!=c.placement){const e=Wa[c.placement];y=(.5*g+f+i)*e.x,v=(.5*m+f+i)*e.y}const C=h.x-.5*g+y-((null!=(s=null==u?void 0:u.center.x)?s:.5)-.5)*h.size,b=h.y-.5*m+v-((null!=(r=null==u?void 0:u.center.y)?r:.5)-.5)*h.size;t&&!Ua(t,C,b,g,m)||e.some(e=>e.some(e=>{var t;return Va(e.point,null==(t=e.marker)?void 0:t.center,C,b,g,m)}))||n.some(e=>e.some(e=>Ha(e,C,b,g,m)))||a.push({index:o,text:p,x:C,y:b,width:g,height:m,datum:c})}}return n}(t,{x:-o,y:-s,width:i.width+o+r,height:i.height+s+n}):[];return new Map(a.map((t,i)=>[e[i],t]))}getLegendData(e,t){var i,s;const r=this.series.filter(e=>e.properties.showInLegend).flatMap(t=>t.getLegendData(e));if(t&&r.every(e=>"category"===e.legendType)){const e={},t=new Map(this.series.map(e=>[e.id,e.type]));for(const{seriesId:n,marker:o,label:a}of r){if(null==o.fill)continue;const r=t.get(n),l=null!=(i=e[r])?i:e[r]={};null!=l[s=a.text]||(l[s]=o.fill),l[a.text]!==o.fill&&_.warnOnce(`legend item '${a.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}return r}processLayout(){return x(this,null,function*(){var e;const t=this.animationRect;yield this.performLayout(),t&&!(null==(e=this.animationRect)?void 0:e.equals(t))&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)})}performLayout(){return x(this,null,function*(){const{width:e,height:t}=this.ctx.scene;let i={shrinkRect:new er(0,0,e,t)};i=this.ctx.layoutService.dispatchPerformLayout("start-layout",i),i=this.ctx.layoutService.dispatchPerformLayout("before-series",i);const s=this.modulesManager.mapModules(e=>x(this,null,function*(){null!=e.performLayout&&(i=yield e.performLayout(i))}));return yield Promise.all(s),i.shrinkRect})}pickSeriesNode(e,t,i){var s,r;const n=performance.now(),o=t?[0]:void 0,a=[...this.series].reverse();let l;for(const t of a){if(!t.visible||!t.rootGroup.visible)continue;const{match:r,distance:n}=null!=(s=t.pickNode(e,o))?s:{};if(r&&null!=n&&((!l||l.distance>n)&&n<=(null!=i?i:1/0)&&(l={series:t,distance:n,datum:r}),0===n))break}return this.extraDebugStats.pickSeriesNode=Math.round((null!=(r=this.extraDebugStats.pickSeriesNode)?r:0)+(performance.now()-n)),l}onMouseMove(e){this.lastInteractionEvent=e,this.pointerScheduler.schedule(),this.extraDebugStats.mouseX=e.offsetX,this.extraDebugStats.mouseY=e.offsetY,this.update(6)}onLeave(e){this.tooltip.pointerLeftOntoTooltip(e)||(this.resetPointer(),this.update(6),this.ctx.cursorManager.updateCursor("chart"))}onBrowserFocus(e){e.delta>0?(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=0,this.focus.seriesIndex=0):(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=1/0,this.focus.seriesIndex=1/0)}onAnimationStart(){this.focus.hasFocus&&this.onBlur()}onBlur(){this.ctx.regionManager.updateFocusIndicatorRect(void 0),this.resetPointer(),this.focus.hasFocus=!1}onTab(e){this.handleFocus(),e.consume(),this.focus.hasFocus=!0}onNavVert(e){this.focus.seriesIndex+=e.delta,this.handleFocus(),e.consume()}onNavHori(e){this.focus.datumIndex+=e.delta,this.handleFocus(e.delta),e.consume()}onSubmit(e){const{series:t,datum:i}=this.focus,s=e.sourceEvent.sourceEvent;void 0!==t&&void 0!==i?t.fireNodeClickEvent(s,i):this.fireEvent({type:"click",event:s})}onContextMenu(e){this.ctx.tooltipManager.removeTooltip(this.id);const{Default:t,ContextMenu:i}=gc;this.ctx.interactionManager.getState()&(t|i)&&this.checkSeriesNodeRange(e,()=>{this.ctx.highlightManager.updateHighlight(this.id)})}handleFocus(e){this.focus.hasFocus=!0;const t=this.overlays.getFocusInfo();null==t?this.handleSeriesFocus(null!=e?e:0):(this.ctx.regionManager.updateFocusIndicatorRect(t.rect),this.ctx.ariaAnnouncementService.announceValue(t.text))}handleSeriesFocus(e){const{series:t,seriesRect:i,focus:s}=this,r=t.filter(e=>e.visible);if(0===r.length)return;s.seriesIndex=Hs(0,s.seriesIndex,r.length-1),s.series=r[s.seriesIndex];const n=s.series.pickFocus({datumIndex:s.datumIndex,datumIndexDelta:e,seriesRect:i});if(void 0===n)return;const{datum:o,datumIndex:a}=n;s.datumIndex=a,s.datum=o;const l=oh(this.ctx.regionManager,n);if(void 0!==l){this.lastInteractionEvent=l;const e=s.series.getTooltipHtml(o),t=Gc.makeTooltipMeta(this.lastInteractionEvent,o);this.ctx.highlightManager.updateHighlight(this.id,o),this.ctx.tooltipManager.updateTooltip(this.id,t,e),this.ctx.ariaAnnouncementService.announceValue(e.ariaLabel)}}static isHoverEvent(e){return void 0!==e&&"hover"===e.type}handlePointer(t,i){if(16!==this.ctx.interactionManager.getState()||!e.isHoverEvent(t))return;const{lastPick:s,hoverRect:r}=this,{offsetX:n,offsetY:o}=t,a=(e=!1)=>{s&&this.resetPointer(e)};(i?!this.ctx.animationManager.isActive():null==r?void 0:r.containsPoint(n,o))?(this.handlePointerTooltip(t,a),this.handlePointerNode(t)):a()}handlePointerTooltip(e,t){const{lastPick:i,tooltip:s}=this,{range:r}=s,{offsetX:n,offsetY:o}=e;let a;We(r)&&(a=r);const l=this.pickSeriesNode({x:n,y:o},"exact"===r,a);if(!l)return this.ctx.tooltipManager.removeTooltip(this.id),void("tooltip"===this.highlight.range&&t(!0));const c="node"===this.highlight.range||!i||i!==l.datum;let h;c&&(h=l.series.getTooltipHtml(l.datum),"tooltip"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,l.datum));const d=null!=a,u=this.tooltip.enabled&&l.series.tooltipEnabled,p="exact"===r&&0===l.distance,g=u&&("nearest"===r||d||p)&&(!c||void 0!==h),m=Gc.makeTooltipMeta(e,l.datum);g&&this.ctx.tooltipManager.updateTooltip(this.id,m,h)}handlePointerNode(e){this.checkSeriesNodeRange(e,(e,t)=>{(e.hasEventListener("nodeClick")||e.hasEventListener("nodeDoubleClick"))&&this.ctx.cursorManager.updateCursor("chart","pointer"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,t)})||(this.ctx.cursorManager.updateCursor("chart"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id))}onClick(e){this.checkSeriesNodeClick(e)?this.update(4):this.fireEvent({type:"click",event:e.sourceEvent})}onDoubleClick(e){this.checkSeriesNodeDoubleClick(e)?this.update(4):this.fireEvent({type:"doubleClick",event:e.sourceEvent})}checkSeriesNodeClick(e){return this.checkSeriesNodeRange(e,(t,i)=>t.fireNodeClickEvent(e.sourceEvent,i))}checkSeriesNodeDoubleClick(e){return this.checkSeriesNodeRange(e,(t,i)=>t.fireNodeDoubleClickEvent(e.sourceEvent,i))}checkSeriesNodeRange(e,t){var i;const s=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!1),r=null==s?void 0:s.datum,n=null==r?void 0:r.series.properties.nodeClickRange;let o;We(n)&&(o=n);let a=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!0);if(a?this.ctx.highlightManager.updatePicked(this.id,a.datum):this.ctx.highlightManager.updatePicked(this.id),r&&"nearest"===n)return t(r.series,r),!0;if("exact"!==n&&(a=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!1,o)),!a)return!1;const l=null!=o,c="exact"===n&&0===a.distance;return!(!l&&!c||void 0!==e.pointerHistory&&!(null==(i=e.pointerHistory)?void 0:i.every(e=>{const t={x:e.offsetX,y:e.offsetY},i=this.pickSeriesNode(t,!1,o);return(null==i?void 0:i.datum)===(null==a?void 0:a.datum)})))&&(t(a.series,a.datum),!0)}changeHighlightDatum(e){var t,i;const s=new Set,{series:r,datum:n}=null!=(t=e.currentHighlight)?t:{},{series:o,datum:a}=null!=(i=e.previousHighlight)?i:{};o&&s.add(o),r&&s.add(r),(null==o?void 0:o.properties.cursor)&&a&&this.ctx.cursorManager.updateCursor(o.id),(null==r?void 0:r.properties.cursor)&&n&&this.ctx.cursorManager.updateCursor(r.id,r.properties.cursor),this.lastPick=e.currentHighlight,null==r||null==o?this.update(4):this.update(4,{seriesToUpdate:s})}waitForUpdate(e=1e4,t=!1){return x(this,null,function*(){const i=performance.now();for(this._pendingFactoryUpdatesCount>0&&(yield this.updateMutex.waitForClearAcquireQueue());7!==this.performUpdateType;){if(performance.now()-i>e){const i=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(t)throw new Error(i);_.warnOnce(i)}yield ql(50)}yield this.updateMutex.waitForClearAcquireQueue()})}waitForDataProcess(e){return new Promise(t=>{this.dataProcessListeners.add(t),ze(e)&&setTimeout(()=>{this.dataProcessListeners.has(t)&&(this.dataProcessListeners.delete(t),t())},e)})}getMinRects(){const{width:e,height:t}=this.ctx.scene,i=this.series.map(i=>i.getMinRects(e,t)).filter(ke);if(0===i.length)return;let s=0,r=0,n=0,o=0;for(const{minRect:e,minVisibleRect:t}of i)s=Math.max(s,e.width),r=Math.max(r,e.height),n=Math.max(n,t.width),o=Math.max(o,t.height);const a=new er(0,0,s,r);let l=a.clone();return n>0&&o>0&&(l=new er(0,0,n,o)),{minRect:a,minVisibleRect:l}}filterMiniChartSeries(e){return null==e?void 0:e.filter(e=>!1!==e.showInMiniChart)}applyOptions(e){var t,i,s,r,n;const o=this.processedOptions,a=e.diffOptions(o),l=e.userOptions;if(null==a)return;id("AgChartV2.updateDelta() - applying delta",a);const c=Xe(a,o),h=this.applyModules(c);a.listeners&&this.registerListeners(this,a.listeners),At(this,a,{skip:["type","data","series","listeners","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","axes","topology"]});let d=!1,u="no-op";(null==(t=a.series)?void 0:t.length)&&(u=this.applySeries(this,a.series,null==o?void 0:o.series),d=!0),"replaced"===u&&this.resetAnimations(),this.applyAxes(this,c,o,u)&&(d=!0),a.data&&(this.data=a.data),(null==(i=a.legend)?void 0:i.listeners)&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,a.legend.listeners),a.listeners&&this.updateAllSeriesListeners(),this.chartOptions=e,this.processedOptions=c,this.userOptions=Xe(l,this.userOptions);const p=this.modulesManager.getModule("navigator"),g=this.modulesManager.getModule("zoom");(null==p?void 0:p.enabled)||(null==g?void 0:g.enabled)||this.ctx.zoomManager.updateZoom("chart");const m=null==p?void 0:p.miniChart,f=null!=(n=null==(r=null==(s=c.navigator)?void 0:s.miniChart)?void 0:r.series)?n:c.series;!0===(null==m?void 0:m.enabled)&&null!=f?this.applyMiniChartOptions(m,f,c,o):!1===(null==m?void 0:m.enabled)&&(m.series=[],m.axes=[]),Ms("\n/* Reset */\n\n[class^='ag-charts'],\n[class^='ag-charts']:focus,\n[class^='ag-charts']:after,\n[class^='ag-charts']:before {\n    box-sizing: border-box;\n    outline: none;\n}\n\nbutton[class^='ag-charts'] {\n    background: none;\n    border: 0;\n}\n\n\n\n/* Icons */\n\n[class^='ag-charts-icon'] {\n    display: block;\n    /* speak: none; */\n    mask-size: contain;\n    mask-repeat: no-repeat;\n    background-color: currentColor;\n}\n\n.ag-charts-icon-zoom-in {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+);\n}\n\n.ag-charts-icon-zoom-out {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-reset {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXJvdGF0ZS1jY3ciPjxwYXRoIGQ9Ik0zIDEyYTkgOSAwIDEgMCA5LTkgOS43NSA5Ljc1IDAgMCAwLTYuNzQgMi43NEwzIDgiLz48cGF0aCBkPSJNMyAzdjVoNSIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-left {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGVmdCI+PHBhdGggZD0ibTE1IDE4LTYtNiA2LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-right {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQiPjxwYXRoIGQ9Im05IDE4IDYtNi02LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-start {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tZmlyc3QiPjxwYXRoIGQ9Im0xNyAxOC02LTYgNi02Ii8+PHBhdGggZD0iTTcgNnYxMiIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-end {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGFzdCI+PHBhdGggZD0ibTcgMTggNi02LTYtNiIvPjxwYXRoIGQ9Ik0xNyA2djEyIi8+PC9zdmc+);\n}\n\n\n\n/* AG Charts Theme Default */\n\n.ag-charts-theme-default,\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-active-color: var(--ag-active-color, #2196f3);\n    --ag-charts-background-color: var(--ag-background-color, #fff);\n    --ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);\n    --ag-charts-border-color: var(--ag-border-color, #dddddd);\n\n    /* Sizing */\n    --ag-charts-font-size: var(--ag-font-size, 14px);\n    --ag-charts-size: var(--ag-grid-size, 8px);\n\n    /* Borders */\n    --ag-charts-border: var(--ag-borders, solid 1px);\n    --ag-charts-border-critical: var(--ag-borders-critical, solid 1px);\n\n    /* Toolbar */\n    --ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));\n    --ag-charts-toolbar-background-color: var(\n        --ag-header-background-color,\n        color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%)\n    );\n    --ag-charts-toolbar-size: var(--ag-header-height, 48px);\n    --ag-charts-toolbar-padding: calc(var(--ag-charts-size) * 2);\n    --ag-charts-toolbar-border: var(--ag-charts-border, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-border-critical: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);\n    --ag-charts-toolbar-disabled-foreground-color: var(\n        --ag-disabled-foreground-color,\n        color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%)\n    );\n    --ag-charts-toolbar-disabled-background-color: var(\n        --ag-input-disabled-background-color,\n        color-mix(in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6%)\n    );\n    --ag-charts-toolbar-gap: var(--ag-charts-size);\n\n    /* Buttons */\n    --ag-charts-button-padding: var(--ag-charts-size);\n    --ag-charts-button-radius: var(--ag-border-radius, 4px);\n\n    /* Focus Indicator */\n    --ag-charts-focus-border: solid 2px var(--ag-input-focus-border-color, var(--ag-charts-active-color));\n    --ag-charts-focus-border-shadow: var(--ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-focus-border) 47%));\n\n    /* Icons */\n    --ag-charts-icon-font-family: 'agChartsDefault';\n    --ag-charts-icon-font-weight: normal;\n    --ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);\n}\n\n\n\n/* AG Charts Theme Default Dark */\n\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));\n    --ag-charts-foreground-color: var(--ag-foreground-color, #fff);\n    --ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, 0.16));\n    --ag-charts-hover-color: var(\n        --ag-row-hover-color,\n        color-mix(in srgb, transparent, var(--ag-charts-active-color) 20%)\n    );\n\n    /* Toolbar */\n    --ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));\n}\n\n\n","chart"),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),d||(d=this.shouldForceNodeDataRefresh(a,u));const y=d||h?0:3;this.maybeResetAnimations(u),id("AgChartV2.applyChartOptions() - update type",Hc[y],{seriesStatus:u,forceNodeDataRefresh:d}),this.update(y,{forceNodeDataRefresh:d,newAnimationBatch:!0})}maybeResetAnimations(e){if("standalone"===this.mode)switch(e){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(e,t){const i=!!e.data||"data-change"===t||"replaced"===t,s=Rt.getKeys(),r=Object.values(s).some(t=>null!=e[t]),n=null!=e.title&&null!=e.subtitle;return i||r||n}applyMiniChartOptions(e,t,i,s){var r,n,o,a,l;const c=null!=(o=null==(n=null==(r=null==s?void 0:s.navigator)?void 0:r.miniChart)?void 0:n.series)?o:null==s?void 0:s.series,h=this.applySeries(e,this.filterMiniChartSeries(t),this.filterMiniChartSeries(c));this.applyAxes(e,i,s,h,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const d=e.axes,u=d.find(e=>"x"===e.direction);for(const e of d)e.gridLine.enabled=!1,e.label.enabled=e===u,e.tick.enabled=!1,e.interactionEnabled=!1;if(null!=u){const e=null==(a=i.navigator)?void 0:a.miniChart,t=null==e?void 0:e.label,s=null==(l=null==e?void 0:e.label)?void 0:l.interval;u.line.enabled=!1,u.label.set(Je(t,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),u.tick.set(Je(s,["enabled","width","size","color","interval","step"]));const r=null==s?void 0:s.step;null!=r&&(u.tick.interval=r)}}applyModules(e){var t;const{type:i}=this.constructor;let s=!1;for(const r of xe.byType("root","legend")){const n=null!=e[r.optionsKey]&&r.chartTypes.includes(i);n!==this.modulesManager.isEnabled(r)&&(n?(this.modulesManager.addModule(r,e=>new e.instanceConstructor(this.getModuleContext())),"legend"===r.type&&(null==(t=this.modulesManager.getModule(r))||t.attachLegend(this.ctx.scene)),this[r.optionsKey]=this.modulesManager.getModule(r)):(this.modulesManager.removeModule(r),delete this[r.optionsKey]),s=!0)}return s}applySeries(e,t,i){var s;if(!t)return"no-change";const r=function(e,t,i){var s,r,n,o;const a=(e,t)=>{const i=[e];for(const e of hh)e in t&&null!=t[e]&&i.push(`${e}=${t[e]}`);return i.join(";")},l=new Map;let c=0;for(const t of e){const e=a(t.type,t.properties);l.has(e)||l.set(e,[]),null==(s=l.get(e))||s.push([t,c++])}const h=new Map;for(const e of t){const t=a(e.type,e);h.has(t)||h.set(t,[]),null==(r=h.get(t))||r.push(e)}if(![...l.keys()].some(e=>h.has(e)))return{status:"no-overlap",oldKeys:l.keys(),newKeys:h.keys()};const d=[];let u=-1;for(const[e,t]of h.entries())for(const s of t){u++;const t=l.get(e);if(null==t||t.length<1){d.push({opts:s,idx:u,status:"add"}),l.delete(e);continue}const[r,a]=t.shift(),c=wt(null!=(n=null==i?void 0:i[a])?n:{},null!=s?s:{}),{groupIndex:h,stackIndex:p}=null!=(o=null==c?void 0:c.seriesGrouping)?o:{};null!=h||null!=p?d.push({opts:s,series:r,diff:c,idx:a,status:"series-grouping"}):c?d.push({opts:s,series:r,diff:c,idx:a,status:"update"}):d.push({opts:s,series:r,idx:a,status:"no-op"}),0===t.length&&l.delete(e)}for(const e of l.values())for(const[t,i]of e)d.push({series:t,idx:i,status:"remove"});return{status:"overlap",changes:d}}(e.series,t,i);if("no-overlap"===r.status)return id(`AgChartV2.applySeries() - creating new series instances, status: ${r.status}`,r),e.series=t.map(e=>this.createSeries(e)),"replaced";id("AgChartV2.applySeries() - matchResult",r);const n=[];let o=!1,a=!1,l=!1;for(const e of r.changes)switch(a||(a="series-grouping"===e.status),o||(o=null!=(null==(s=e.diff)?void 0:s.data)),l||(l="no-op"!==e.status),e.status){case"add":const t=this.createSeries(e.opts);n.push(t),id("AgChartV2.applySeries() - created new series",t);break;case"remove":id(`AgChartV2.applySeries() - removing series at previous idx ${e.idx}`,e.series);break;case"no-op":n.push(e.series),id(`AgChartV2.applySeries() - no change to series at previous idx ${e.idx}`,e.series);break;default:const{series:i,diff:s,idx:r}=e;id(`AgChartV2.applySeries() - applying series diff previous idx ${r}`,s,i),this.applySeriesValues(i,s),i.markNodeDataDirty(),n.push(i)}for(let e=0;e<n.length;e++)n[e]._declarationOrder=e;return id("AgChartV2.applySeries() - final series instances",n),e.series=n,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(e,t,i,s,r=[]){if(!("axes"in t)||!t.axes)return!1;r=["axes[].type",...r];const{axes:n}=t;return"replaced"!==s&&e.axes.length===n.length&&e.axes.every((e,t)=>e.type===n[t].type)&&pt(i)?(e.axes.forEach((e,t)=>{var s,o;const a=wt(null!=(o=null==(s=i.axes)?void 0:s[t])?o:{},n[t]);id(`AgChartV2.applyAxes() - applying axis diff idx ${t}`,a);const l=`axes[${t}]`;At(e,a,v(y({},$n),{path:l,skip:r}))}),!0):(id(`AgChartV2.applyAxes() - creating new axes instances; seriesStatus: ${s}`),e.axes=this.createAxis(n,r),!0)}createSeries(e){const t=It.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(t,e),this.applySeriesValues(t,e),t}applySeriesOptionModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();for(const r of xe.byType("series-option"))r.optionsKey in t&&r.seriesTypes.includes(e.type)&&s.addModule(r,e=>new e.instanceConstructor(i))}applySeriesValues(e,t){const i=e.getModuleMap(),s=t,{type:r,data:n,listeners:o,seriesGrouping:a,showInMiniChart:l}=s,c=C(s,["type","data","listeners","seriesGrouping","showInMiniChart"]);for(const e of ct)if("series-option"===e.type&&e.optionsKey in c){const t=i.getModule(e.optionsKey),s=c[e.optionsKey];delete c[e.optionsKey],t.properties.set(s)}e.properties.set(c),"data"in t&&e.setOptionsData(n),o&&this.registerListeners(e,o),"seriesGrouping"in t&&(e.seriesGrouping=null==a?void 0:y(y({},e.seriesGrouping),a))}createAxis(e,t){const i=new ch,s=this.getModuleContext();for(let r=0;r<e.length;r++){const n=e[r],o=Ee.create(n.type,s);this.applyAxisModules(o,n),At(o,n,v(y({},$n),{path:`axes[${r}]`,skip:t})),i.push(o,n)}return i.guessInvalidPositions()}applyAxisModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();for(const r of xe.byType("axis-option")){const n=null!=t[r.optionsKey];n!==s.isEnabled(r)&&(n?(s.addModule(r,e=>new e.instanceConstructor(i)),e[r.optionsKey]=s.getModule(r)):(s.removeModule(r),delete e[r.optionsKey]))}}registerListeners(e,t){e.clearEventListeners();for(const[i,s]of Object.entries(t))Ge(s)&&e.addEventListener(i,s)}};rd.chartsInstances=new WeakMap,S([Xa({newValue(e){this.destroyed||(e.setAttribute("data-ag-charts",""),e.appendChild(this.element),rd.chartsInstances.set(e,this))},oldValue(e){e.removeAttribute("data-ag-charts"),e.removeChild(this.element),rd.chartsInstances.delete(e)}})],rd.prototype,"container",2),S([Xa({newValue(e){this.resize(e,void 0,"width option")}})],rd.prototype,"width",2),S([Xa({newValue(e){this.resize(void 0,e,"height option")}})],rd.prototype,"height",2),S([Xa({newValue(e){this.onAutoSizeChange(e)}}),Kr(Qr)],rd.prototype,"autoSize",2),S([Kr(Xr)],rd.prototype,"padding",2),S([Kr(Xr)],rd.prototype,"seriesArea",2),S([Kr(Xr)],rd.prototype,"title",2),S([Kr(Xr)],rd.prototype,"subtitle",2),S([Kr(Xr)],rd.prototype,"footnote",2),S([Kr(Xr)],rd.prototype,"keyboard",2),S([Kr(Fn(["standalone","integrated"],"a chart mode"))],rd.prototype,"mode",2),S([Xa({changeValue(e,t){this.onAxisChange(e,t)}})],rd.prototype,"axes",2),S([Xa({changeValue(e,t){this.onSeriesChange(e,t)}})],rd.prototype,"series",2);var nd=rd;function od(e,t,i,s,r,n,o,a){const l=(i-e)*(a-n)-(s-t)*(o-r);if(0===l)return 0;const c=((o-r)*(t-n)-(e-r)*(a-n))/l,h=((i-e)*(t-n)-(s-t)*(e-r))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function ad(e,t,i,s,r,n,o,a,l,c,h,d){let u=0;const p=c-d,g=h-l,m=l*(d-c)-c*(h-l),f=ld(e,i,r,o),y=ld(t,s,n,a),v=function(e,t,i,s){if(0===e)return function(e,t,i){if(0===e)return function(e,t){const i=-t/e;return 0!==e&&i>=0&&i<=1?[i]:[]}(t,i);const s=t*t-4*e*i,r=[];if(0===s){const i=-t/(2*e);i>=0&&i<=1&&r.push(i)}else if(s>0){const i=Math.sqrt(s),n=(-t-i)/(2*e),o=(-t+i)/(2*e);n>=0&&n<=1&&r.push(n),o>=0&&o<=1&&r.push(o)}return r}(t,i,s);const r=t/e,n=i/e,o=(3*n-r*r)/9,a=(9*r*n-s/e*27-2*r*r*r)/54,l=o*o*o+a*a,c=1/3,h=[];if(l>=0){const e=Math.sqrt(l),t=Math.sign(a+e)*Math.pow(Math.abs(a+e),c),i=Math.sign(a-e)*Math.pow(Math.abs(a-e),c),s=Math.abs(Math.sqrt(3)*(t-i)/2),n=-c*r+(t+i);if(n>=0&&n<=1&&h.push(n),0===s){const e=-c*r-(t+i)/2;e>=0&&e<=1&&h.push(e)}}else{const e=Math.acos(a/Math.sqrt(-o*o*o)),t=c*r,i=2*Math.sqrt(-o),s=i*Math.cos(c*e)-t,n=i*Math.cos(c*(e+2*Math.PI))-t,l=i*Math.cos(c*(e+4*Math.PI))-t;s>=0&&s<=1&&h.push(s),n>=0&&n<=1&&h.push(n),l>=0&&l<=1&&h.push(l)}return h}(p*f[0]+g*y[0],p*f[1]+g*y[1],p*f[2]+g*y[2],p*f[3]+g*y[3]+m);for(const e of v){const t=e*e,i=e*t,s=f[0]*i+f[1]*t+f[2]*e+f[3],r=y[0]*i+y[1]*t+y[2]*e+y[3];let n;n=l===h?(r-c)/(d-c):(s-l)/(h-l),n>=0&&n<=1&&u++}return u}function ld(e,t,i,s){return[3*t-e-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function cd(e,t,i,s,r,n,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;n&&([r,s]=[s,r]);const h=(c-a)/(l-o),d=a-h*o,u=Math.pow(h,2)+1,p=2*(h*(d-t)-e),g=Math.pow(e,2)+Math.pow(d-t,2)-Math.pow(i,2),m=Math.pow(p,2)-4*u*g;if(m<0)return 0;const f=(-p+Math.sqrt(m))/2/u,y=(-p-Math.sqrt(m))/2/u;let v=0;return[f,y].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const n=i-e,a=h*i+d-t;Fr(Math.atan2(a,n),s,r)&&v++}),v}var hd=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,r){r=Math.min(r,i/2,s/2),this.moveTo(e,t+r),this.arc(e+r,t+r,r,Math.PI,1.5*Math.PI),this.lineTo(e+r,t),this.lineTo(e+i-r,t),this.arc(e+i-r,t+r,r,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+r),this.lineTo(e+i,t+s-r),this.arc(e+i-r,t+s-r,r,0,Math.PI/2),this.lineTo(e+i-r,t+s),this.lineTo(e+r,t+s),this.arc(e+ +r,t+s-r,r,Math.PI/2,Math.PI),this.lineTo(e,t+s-r),this.closePath()}arc(e,t,i,s,r,n){this.openedPath=!0,this.path2d.arc(e,t,i,s,r,n),this.commands.push(2),this.params.push(e,t,i,s,r,n?1:0)}cubicCurveTo(e,t,i,s,r,n){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,r,n),this.commands.push(3),this.params.push(e,t,i,s,r,n)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,s=this.params,r=i.length,n=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,d=0;for(let u=0,p=0;u<r;u++)switch(i[u]){case 0:d+=od(a,l,c,h,n,o,e,t),c=s[p++],a=c,h=s[p++],l=h;break;case 1:d+=od(c,h,s[p++],s[p++],n,o,e,t),c=s[p-2],h=s[p-1];break;case 3:d+=ad(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],n,o,e,t),c=s[p-2],h=s[p-1];break;case 2:const i=s[p++],r=s[p++],u=s[p++],g=s[p++],m=s[p++];d+=cd(i,r,u,g,m,Boolean(s[p++]),n,o,e,t),isNaN(a)||(d+=od(c,h,i+Math.cos(g)*u,r+Math.sin(g)*u,n,o,e,t)),c=i+Math.cos(m)*u,h=r+Math.sin(m)*u;break;case 4:d+=od(a,l,c,h,n,o,e,t)}return d%2==1}distanceSquared(e,t){let i=1/0;const s=this.commands,r=this.params,n=s.length;let o=NaN,a=NaN,l=0,c=0;for(let h=0,d=0;h<n;h++)switch(s[h]){case 0:l=o=r[d++],c=a=r[d++];break;case 1:i=Fa(e,t,l,c,r[d++],r[d++],i);break;case 3:_.error("Command.Curve distanceSquare not implemented");break;case 2:{const s=r[d++],n=r[d++],o=r[d++],a=r[d++],h=r[d++],u=s+Math.cos(a)*o,p=n+Math.sin(a)*o,g=Boolean(r[d++]);i=Fa(e,t,l,c,u,p,i),i=Ga(e,t,s,n,o,a,h,g,i),l=s+Math.cos(h)*o,c=n+Math.sin(h)*o;break}case 4:i=Fa(e,t,l,c,o,a,i)}return i}getPoints(){const{commands:e,params:t}=this,i=[];let s=0;for(let r=0;r<e.length;r++)switch(e[r]){case 0:case 1:i.push({x:t[s++],y:t[s++]});break;case 3:s+=4,i.push({x:t[s++],y:t[s++]});break;case 2:i.push({x:t[s++],y:t[s++]}),s+=4}return i}};function dd(e){const{redraw:t=3,changeCb:i,convertor:s}=null!=e?e:{};return sr({redraw:t,type:"path",convertor:s,changeCb:i})}var ud=class extends Io{constructor(){super(...arguments),this.path=new hd,this._clipX=NaN,this._clipY=NaN,this._dirtyPath=!0}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty(this,3))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){var e,t,i,s;this._dirtyPath||(this.dirtyPath=this.path.isDirty()||null!=(t=null==(e=this.fillShadow)?void 0:e.isDirty())&&t||null!=(s=null==(i=this._clipPath)?void 0:i.isDirty())&&s)}isPointInPath(e,t){const i=this.transformPoint(e,t);return this.path.closedPath&&this.path.isPointInPath(i.x,i.y)}distanceSquared(e,t){const i=this.transformPoint(e,t);return this.path.distanceSquared(i.x,i.y)}isDirtyPath(){return!1}updatePath(){}render(e){var t,i,s,r;const{ctx:n,forceRender:o,stats:a}=e;if(0!==this.dirty||o){if(this.computeTransformMatrix(),this.matrix.toContext(n),(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),isNaN(this._clipX)||isNaN(this._clipY)||null==this.clipMode)this.drawPath(n);else{n.save();const e=this.strokeWidth/2;if(null!=this._clipPath||(this._clipPath=new hd),this._clipPath.clear(),this._clipPath.rect(-e,-e,this._clipX+e,this._clipY+e+e),"normal"===this.clipMode&&n.clip(null==(t=this._clipPath)?void 0:t.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(n),"punch-out"===this.clipMode){n.clip(null==(i=this._clipPath)?void 0:i.getPath2D());const{x:e=-1e4,y:t=-1e4,width:r=2e4,height:o=2e4}=null!=(s=this.computeBBox())?s:{};n.clearRect(e,t,r,o)}n.restore()}null==(r=this.fillShadow)||r.markClean(),super.render(e)}else a&&(a.nodesSkipped+=this.nodeCount.count)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}};ud.className="Path",S([dd()],ud.prototype,"clipMode",2),S([dd()],ud.prototype,"clipX",1),S([dd()],ud.prototype,"clipY",1);var pd=class{constructor(e,t,i){this.root=new fd(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(t,i)=>e.distanceSquared(t,i)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},gd=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},md=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=null!=i?i:er.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(void 0===this.subdivisions?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:r}=this,n=this.maxdepth-1,o=i/2,a=s/2,l=new er(e,t,o,a),c=new er(e+o,t,o,a),h=new er(e,t+a,o,a),d=new er(e+o,t+a,o,a);return new gd(this.child(r,n,l),this.child(r,n,c),this.child(r,n,h),this.child(r,n,d))}},fd=class e extends md{addCondition(e){const{x:t,y:i}=e.hitTester.midPoint;return this.boundary.containsPoint(t,i)}findCondition(e,t,i){const{best:s}=i;return 0!==s.distanceSquared&&this.boundary.distanceSquared(e,t)<s.distanceSquared}findAction(e,t,i){const s=Zs(e,t,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(t,i,s){return new e(t,i,s)}},yd=class extends ud{constructor(){super(...arguments),this.x=0,this.y=0,this.size=12}computeBBox(){const{x:e,y:t,size:i}=this,{center:s}=this.constructor;return new er(e-i*s.x,t-i*s.y,i,i)}applyPath(e,t){const{path:i}=this;let{x:s,y:r}=this;null!=this.repeat&&(s=0,r=0),i.clear();for(const{x:n,y:o,t:a}of t)s+=n*e,r+=o*e,"move"===a?i.moveTo(s,r):i.lineTo(s,r);i.closePath()}executeFill(e,t){if(!t)return;if(null==this.repeat)return super.executeFill(e,t);e.save();let i=this.translationX,s=this.translationY;for(const r of this.repeat)e.translate(r.x-i,r.y-s),e.fill(t),i=r.x,s=r.y;e.restore()}executeStroke(e,t){if(!t)return;if(null==this.repeat)return super.executeStroke(e,t);e.save();let i=this.translationX,s=this.translationY;for(const r of this.repeat)e.translate(r.x-i,r.y-s),e.stroke(t),i=r.x,s=r.y;e.restore()}};yd.center={x:.5,y:.5},S([dd()],yd.prototype,"x",2),S([dd()],yd.prototype,"y",2),S([dd({convertor:Math.abs})],yd.prototype,"size",2),S([dd()],yd.prototype,"repeat",2);var vd=class extends yd{updatePath(){const{x:e,y:t,path:i,size:s}=this,r=s/2;i.clear(),i.arc(e,t,r,0,2*Math.PI),i.closePath()}};vd.className="Circle";var Cd=class e extends yd{updatePath(){const t=this.size/4.2;super.applyPath(t,e.moves)}};Cd.className="Cross",Cd.moves=[{x:-1,y:0,t:"move"},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:-1,y:1},{x:-1,y:-1}];var bd=Cd,Sd=class e extends yd{updatePath(){const t=this.size/2;super.applyPath(t,e.moves)}};Sd.className="Diamond",Sd.moves=[{x:0,y:-1,t:"move"},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}];var wd=Sd,xd=class extends yd{rad(e){return e/180*Math.PI}updatePath(){const{x:e,path:t,size:i,rad:s}=this,r=i/4,n=this.y+r/2;t.clear(),t.arc(e-r,n-r,r,s(130),s(330)),t.arc(e+r,n-r,r,s(220),s(50)),t.lineTo(e,n+r),t.closePath()}};xd.className="Heart";var Ed=class extends yd{updatePath(){const{path:e,x:t,y:i}=this,s=this.size,r=.5;e.clear(),e.moveTo(t+-.34375*s,i+-.65625*s),e.cubicCurveTo(t+-.34375*s,i+-.848509*s,t+-.192259*s,i+-1*s,t+0*s,i+-1*s),e.cubicCurveTo(t+(.692259-r)*s,i+-1*s,t+.34375*s,i+-.848509*s,t+.34375*s,i+-.65625*s),e.cubicCurveTo(t+.34375*s,i+-.506176*s,t+.284625*s,i+(.600181-1)*s,t+(.716461-r)*s,i+(.695393-1)*s),e.cubicCurveTo(t+.199009*s,i+-.280231*s,t+(.681271-r)*s,i+-.256896*s,t+(.663785-r)*s,i+(.766105-1)*s),e.cubicCurveTo(t+(.611893-r)*s,i+(.834367-1)*s,t+(.562228-r)*s,i+(.899699-1)*s,t+(.528896-r)*s,i+(.980648-1)*s),e.cubicCurveTo(t+(.524075-r)*s,i+(.992358-1)*s,t+(.512663-r)*s,i+0*s,t+0*s,i+0*s),e.cubicCurveTo(t+(.487337-r)*s,i+0*s,t+(.475925-r)*s,i+(.992358-1)*s,t+(.471104-r)*s,i+(.980648-1)*s),e.cubicCurveTo(t+(.487337-r)*s,i+0*s,t+(.475925-r)*s,i+(.992358-1)*s,t+(.471104-r)*s,i+(.980648-1)*s),e.cubicCurveTo(t+(.437772-r)*s,i+(.899699-1)*s,t+(.388107-r)*s,i+(.834367-1)*s,t+(.336215-r)*s,i+(.766105-1)*s),e.cubicCurveTo(t+(.318729-r)*s,i+-.256896*s,t+-.199009*s,i+-.280231*s,t+(.283539-r)*s,i+(.695393-1)*s),e.cubicCurveTo(t+-.284625*s,i+(.600181-1)*s,t+-.34375*s,i+-.506176*s,t+-.34375*s,i+-.65625*s),e.closePath()}};Ed.className="MapPin",Ed.center={x:.5,y:1};var Md=class e extends yd{updatePath(){const t=this.size/3;super.applyPath(t,e.moves)}};Md.className="Plus",Md.moves=[{x:-.5,y:-.5,t:"move"},{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:-1},{x:-1,y:0},{x:0,y:-1}];var Ad=Md,Td=class extends yd{updatePath(){const{path:e,x:t,y:i}=this,s=this.size/2;e.clear(),e.moveTo(this.align(t-s),this.align(i-s)),e.lineTo(this.align(t+s),this.align(i-s)),e.lineTo(this.align(t+s),this.align(i+s)),e.lineTo(this.align(t-s),this.align(i+s)),e.closePath()}};Td.className="Square";var Dd=class extends yd{updatePath(){const{x:e,y:t,path:i,size:s}=this,r=s/2,n=Math.PI/2;i.clear();for(let o=0;o<10;o++){const a=o%2==0?s:r,l=o*Math.PI/5-n,c=e+Math.cos(l)*a,h=t+Math.sin(l)*a;i.lineTo(c,h)}i.closePath()}};Dd.className="Star";var Id=class e extends yd{updatePath(){const t=1.1*this.size;super.applyPath(t,e.moves)}};Id.className="Triangle",Id.moves=[{x:0,y:-.48,t:"move"},{x:.5,y:.87},{x:-1,y:0}];var Rd=Id,Pd={circle:vd,cross:bd,diamond:wd,heart:xd,pin:Ed,plus:Ad,square:Td,star:Dd,triangle:Rd},kd=Object.keys(Pd);function Ld(e){return"string"==typeof e&&kd.includes(e)}function Nd(e=Td){return Ld(e)?Pd[e]:"function"==typeof e?e:Td}var _d=class extends Zh{constructor(){super(...arguments),this.showFocusBox=!0}getScaleInformation({xScale:e,yScale:t}){return{isContinuousX:Xn.is(e),isContinuousY:Xn.is(t),xScaleType:null==e?void 0:e.type,yScaleType:null==t?void 0:t.type}}getModulePropertyDefinitions(){var e,t;const i=null==(e=this.axes.x)?void 0:e.scale,s=null==(t=this.axes.y)?void 0:t.scale;return this.moduleMap.mapModules(e=>e.getPropertyDefinitions(this.getScaleInformation({xScale:i,yScale:s}))).flat()}requestDataModel(e,t,i){return x(this,null,function*(){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:r}=yield e.request(this.id,null!=t?t:[],i);return this.dataModel=s,this.processedData=r,this.dispatch("data-processed",{dataModel:s,processedData:r}),{dataModel:s,processedData:r}})}isProcessedDataAnimatable(){var e,t;const i=null==(t=null==(e=this.processedData)?void 0:e.reduced)?void 0:t.animationValidation;if(!i)return!0;const{orderedKeys:s,uniqueKeys:r}=i;return s&&r}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){return this.doPickFocus(e,this)}doPickFocus(e,t){const i=this.getNodeData();if(void 0===i||0===i.length)return;const{datumIndexDelta:s,seriesRect:r}=e,n=this.computeFocusDatumIndex(e,i,t.seriesItemEnabled);if(void 0===n)return;const{showFocusBox:o}=this,a=i[n],l=this.computeFocusBounds({datumIndex:n,datumIndexDelta:s,seriesRect:r});return void 0!==l?{bbox:l,showFocusBox:o,datum:a,datumIndex:n}:void 0}computeFocusDatumIndex(e,t,i){i&&t.length!==i.length&&_.error(`invalid state: nodeData.length (${t.length} !== seriesItemEnabled.length (${null==i?void 0:i.length})`);const s=e=>{const s=t[e];return(void 0===s.missing||!1===s.missing)&&(void 0===i||i[e])},r=e=>{for(;e>=0&&!s(e);)e--;return-1===e?void 0:e},n=e=>{for(;e<t.length&&!s(e);)e++;return e===t.length?void 0:e};let o;const a=Hs(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?o=r(a):e.datumIndexDelta>0?o=n(a):(null!=o||(o=n(a)),null!=o||(o=r(a))),void 0===o?0===e.datumIndexDelta?void 0:e.datumIndex-e.datumIndexDelta:o}},Od=class extends vt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};S([Kr(fn,{optional:!0})],Od.prototype,"fill",2),S([Kr(nn,{optional:!0})],Od.prototype,"fillOpacity",2),S([Kr(fn,{optional:!0})],Od.prototype,"stroke",2),S([Kr(rn,{optional:!0})],Od.prototype,"strokeWidth",2),S([Kr(nn,{optional:!0})],Od.prototype,"strokeOpacity",2),S([Kr(Mn,{optional:!0})],Od.prototype,"lineDash",2),S([Kr(rn,{optional:!0})],Od.prototype,"lineDashOffset",2);var Fd=class extends vt{};S([Kr(rn,{optional:!0})],Fd.prototype,"strokeWidth",2),S([Kr(nn,{optional:!0})],Fd.prototype,"dimOpacity",2),S([Kr(Qr,{optional:!0})],Fd.prototype,"enabled",2);var Gd=class extends vt{constructor(){super(...arguments),this.color="black"}};S([Kr(fn,{optional:!0})],Gd.prototype,"color",2);var Bd=class extends vt{constructor(){super(...arguments),this.item=new Od,this.series=new Fd,this.text=new Gd}};S([Kr(Xr)],Bd.prototype,"item",2),S([Kr(Xr)],Bd.prototype,"series",2),S([Kr(Xr)],Bd.prototype,"text",2);var Vd=class extends vt{constructor(){super(...arguments),this.visible=!0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlightStyle=new Bd}};S([Kr(en,{optional:!0})],Vd.prototype,"id",2),S([Kr(Qr)],Vd.prototype,"visible",2),S([Kr(Qr)],Vd.prototype,"showInLegend",2),S([Kr(en)],Vd.prototype,"cursor",2),S([Kr(_n)],Vd.prototype,"nodeClickRange",2),S([Kr(Xr)],Vd.prototype,"highlightStyle",2);var Hd={x:["xKey"],y:["yKey"]},Ud={x:["xName"],y:["yName"]},zd=class extends qh{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},Wd=class extends Vd{};S([Kr(en,{optional:!0})],Wd.prototype,"legendItemName",2);var jd=class extends _d{constructor(e){var t=e,{pathsPerSeries:i=1,hasMarkers:s=!1,hasHighlightedLabels:r=!1,pathsZIndexSubOrderOffset:n=[],datumSelectionGarbageCollection:o=!0,markerSelectionGarbageCollection:a=!0,animationAlwaysUpdateSelections:l=!1,animationResetFns:c,directionKeys:h,directionNames:d}=t,u=C(t,["pathsPerSeries","hasMarkers","hasHighlightedLabels","pathsZIndexSubOrderOffset","datumSelectionGarbageCollection","markerSelectionGarbageCollection","animationAlwaysUpdateSelections","animationResetFns","directionKeys","directionNames"]);if(super(y({directionKeys:h,directionNames:d,canHaveAxes:!0},u)),this.NodeEvent=zd,this.dataNodeGroup=this.contentGroup.appendChild(new Eo({name:`${this.id}-series-dataNodes`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.markerGroup=this.contentGroup.appendChild(new Eo({name:`${this.id}-series-markers`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("marker")})),this.labelGroup=this.contentGroup.appendChild(new Eo({name:`${this.id}-series-labels`,zIndex:8,zIndexSubOrder:this.getGroupZIndexSubOrder("labels")})),this.labelSelection=_a.select(this.labelGroup,Fo),this.highlightSelection=_a.select(this.highlightNode,()=>this.opts.hasMarkers?this.markerFactory():this.nodeFactory()),this.highlightLabelSelection=_a.select(this.highlightLabel,Fo),this.annotationSelections=new Set,this.minRectsCache={dirtyNodeData:!0},this.debug=Is.create(),!h||!d)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:i,hasMarkers:s,hasHighlightedLabels:r,pathsZIndexSubOrderOffset:n,directionKeys:h,directionNames:d,animationResetFns:c,animationAlwaysUpdateSelections:l,datumSelectionGarbageCollection:o,markerSelectionGarbageCollection:a},this.paths=[];for(let e=0;e<i;e++)this.paths[e]=new ud,this.paths[e].zIndex=4,this.paths[e].zIndexSubOrder=this.getGroupZIndexSubOrder("paths",e),this.contentGroup.appendChild(this.paths[e]);this.datumSelection=_a.select(this.dataNodeGroup,()=>this.nodeFactory(),o),this.markerSelection=_a.select(this.markerGroup,()=>this.markerFactory(),a),this.animationState=new ya("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:e=>this.resetAllAnimation(e),reset:"empty"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){var e;return null==(e=this.contextNodeData)?void 0:e.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e?this.animationState.transition("skip"):"disabled"===e&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update(e){return x(this,arguments,function*({seriesRect:e}){var t,i;const{visible:s,_contextNodeData:r}=this,n=(null==(i=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight())?void 0:i.series)===this,o=this.checkResize(e),a=yield this.updateHighlightSelection(n);yield this.updateSelections(s),yield this.updateNodes(a,n,s);const l=this.getAnimationData(e,r);l&&(o&&this.animationState.transition("resize",l),this.animationState.transition("update",l))})}updateSelections(e){return x(this,null,function*(){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if((e||!i)&&(this.nodeDataRefresh||this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=yield this.createNodeData();const e=this.isProcessedDataAnimatable();this._contextNodeData&&(null!=(t=this._contextNodeData).animationValid||(t.animationValid=e)),this.minRectsCache.dirtyNodeData=!0;const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.dispatch("data-update",{dataModel:i,processedData:s})}yield this.updateSeriesSelections()}})}updateSeriesSelections(e){return x(this,null,function*(){const{datumSelection:t,labelSelection:i,markerSelection:s,paths:r}=this,n=this._contextNodeData;if(!n)return;const{nodeData:o,labelData:a,itemId:l}=n;yield this.updatePaths({seriesHighlighted:e,itemId:l,contextData:n,paths:r}),this.datumSelection=yield this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelSelection=yield this.updateLabelSelection({labelData:a,labelSelection:i}),this.opts.hasMarkers&&(this.markerSelection=yield this.updateMarkerSelection({nodeData:o,markerSelection:s}))})}markerFactory(){return new(Nd())}getGroupZIndexSubOrder(e,t=0){var i;const s=super.getGroupZIndexSubOrder(e,t);if("paths"===e){const[e]=s,r=null!=(i=this.opts.pathsZIndexSubOrderOffset[t])?i:0;s[0]=Ge(e)?()=>Number(e())+r:Number(e)+r}return s}updateNodes(e,t,i){return x(this,null,function*(){var s;const{highlightSelection:r,highlightLabelSelection:n,opts:{hasMarkers:o,hasHighlightedLabels:a}}=this,l=!this.ctx.animationManager.isSkipped(),c=this.visible&&null!=this._contextNodeData&&i;this.rootGroup.visible=l||c,this.contentGroup.visible=l||c,this.highlightGroup.visible=(l||c)&&t;const h=this.getOpacity();o?(yield this.updateMarkerNodes({markerSelection:r,isHighlight:!0}),this.animationState.transition("highlightMarkers",r)):(yield this.updateDatumNodes({datumSelection:r,isHighlight:!0}),this.animationState.transition("highlight",r)),a&&(yield this.updateLabelNodes({labelSelection:n}));const{dataNodeGroup:d,markerGroup:u,datumSelection:p,labelSelection:g,markerSelection:m,paths:f,labelGroup:y}=this,{itemId:v}=null!=(s=this.contextNodeData)?s:{};d.opacity=h,d.visible=l||c,y.visible=c,o&&(u.opacity=h,u.zIndex=d.zIndex>=4?d.zIndex:d.zIndex+1,u.visible=c),y&&(y.opacity=h),yield this.updatePathNodes({seriesHighlighted:t,itemId:v,paths:f,opacity:h,visible:c,animationEnabled:l}),d.visible&&(yield this.updateDatumNodes({datumSelection:p,highlightedItems:e,isHighlight:!1}),yield this.updateLabelNodes({labelSelection:g}),o&&(yield this.updateMarkerNodes({markerSelection:m,isHighlight:!1})))})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum&&e.itemId===t.itemId);return 0===i.length?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){return x(this,null,function*(){var t;const{highlightSelection:i,highlightLabelSelection:s,_contextNodeData:r}=this;if(!r)return;const n=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight(),o=e&&(null==n?void 0:n.datum)?n:void 0;let a,l;if(null!=o){const e=this.isLabelEnabled(),{labelData:t,nodeData:i}=r;l=this.getHighlightData(i,o),a=e?this.getHighlightLabelData(t,o):void 0}return this.highlightSelection=yield this.updateHighlightSelectionItem({items:l,highlightSelection:i}),this.highlightLabelSelection=yield this.updateHighlightSelectionLabel({items:a,highlightLabelSelection:s}),l})}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)!0!==e.datum.missing&&(yield e)}getQuadTree(){if(void 0===this.quadtree){const{width:e,height:t}=this.ctx.scene.canvas,i=new er(0,0,e,t);this.quadtree=new pd(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodeExactShape(e){var t;const i=super.pickNodeExactShape(e);if(i)return i;const{x:s,y:r}=e,{opts:{hasMarkers:n}}=this;let o;const{dataNodeGroup:a,markerGroup:l}=this;if(o=a.pickNode(s,r),!o&&n&&(o=null==l?void 0:l.pickNode(s,r)),o&&!0!==o.datum.missing)return{datum:o.datum,distance:0};for(const i of this.moduleMap.modules()){const{datum:s}=null!=(t=i.pickNodeExact(e))?t:{};if(null!=s&&!0!==(null==s?void 0:s.missing))return{datum:s,distance:0}}}pickNodeClosestDatum(e){var t,i;const{x:s,y:r}=e,{axes:n,rootGroup:o,_contextNodeData:a}=this;if(!a)return;const l=n.x,c=n.y,h=o.transformPoint(s,r);let d,u=1/0;for(const e of a.nodeData){const{point:{x:t=NaN,y:i=NaN}={}}=e;if(isNaN(t)||isNaN(i))continue;if(!(null==l?void 0:l.inRange(t))||!(null==c?void 0:c.inRange(i)))continue;const s=Math.max(m(h.x-t,2)+m(h.y-i,2),0);s<u&&(u=s,d=e)}for(const t of this.moduleMap.modules()){const i=t.pickNodeNearest(e);if(void 0!==i&&i.distanceSquared<u){u=i.distanceSquared,d=i.datum;break}}return d?{datum:d,distance:Math.max(Math.sqrt(u)-(null!=(i=null==(t=d.point)?void 0:t.size)?i:0),0)}:void 0}pickNodeMainAxisFirst(e,t){var i,s,r,n;const{x:o,y:a}=e,{axes:l,rootGroup:c,_contextNodeData:h}=this;if(!h)return;const d=l.x,u=l.y,p=[d,u].filter(e=>e instanceof Dl).map(e=>e.direction);if(t&&0===p.length)return;const[g="x"]=p,f=c.transformPoint(o,a),y="x"===g?[f.x,f.y]:[f.y,f.x],v=[1/0,1/0];let C;for(const e of h.nodeData){const{x:t=NaN,y:r=NaN}=null!=(s=null!=(i=e.point)?i:e.midPoint)?s:{};if(isNaN(t)||isNaN(r)||!0===e.missing)continue;if(!(null==d?void 0:d.inRange(t))||!(null==u?void 0:u.inRange(r)))continue;const n="x"===g?[t,r]:[r,t];let o=!0;for(let e=0;e<n.length;e++){const t=Math.abs(n[e]-y[e]);if(t>v[e]){o=!1;break}t<v[e]&&(v[e]=t,v.fill(1/0,e+1,v.length))}o&&(C=e)}if(C){let t=Math.max(m(v[0],2)+m(v[1],2)-(null!=(n=null==(r=C.point)?void 0:r.size)?n:0),0);for(const i of this.moduleMap.modules()){const s=i.pickNodeMainAxisFirst(e);if(void 0!==s&&s.distanceSquared<t){C=s.datum,t=s.distanceSquared;break}}return{datum:C,distance:Math.sqrt(t)}}}onLegendItemClick(e){const{legendItemName:t}=this.properties,{enabled:i,itemId:s,series:r}=e,n=null!=t&&t===e.legendItemName;(r.id===this.id||n)&&this.toggleSeriesItem(s,i)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:r}=e,{legendItemName:n}=this.properties,o=null!=n&&n===e.legendItemName;s.id===this.id||o||t&&1===r?this.toggleSeriesItem(i,!0):this.toggleSeriesItem(i,!1)}isPathOrSelectionDirty(){return!1}getLabelData(){return[]}shouldFlipXY(){return!1}getMinRects(e,t){const{dirtyNodeData:i,sizeCache:s,minRect:r,minVisibleRect:n}=this.minRectsCache,o=JSON.stringify({width:e,height:t});if(o===s&&!i&&r&&n)return{minRect:r,minVisibleRect:n};const a=this.computeMinRects(e,t);return this.minRectsCache={dirtyNodeData:!1,sizeCache:o,minRect:null==a?void 0:a.minRect,minVisibleRect:null==a?void 0:a.minVisibleRect},a}computeMinRects(e,t){var i,s;const r=this._contextNodeData;if(!(null==r?void 0:r.nodeData.length))return;const{nodeData:n}=r,o=Array(n.length),a=Array(n.length);for(const[e,{midPoint:t}]of n.entries())o[e]=null!=(i=null==t?void 0:t.x)?i:0,a[e]=null!=(s=null==t?void 0:t.y)?s:0;let l,c,h,d;o.sort((e,t)=>e-t),a.sort((e,t)=>e-t);let u=0,p=0;for(let i=1;i<n.length;i++)o[i]>=0&&(null!=l||(l=i)),o[i]>e&&(null!=c||(c=i)),a[i]>=0&&(null!=h||(h=i)),a[i]>t&&(null!=d||(d=i)),u=Math.max(u,o[i]-o[i-1]),p=Math.max(p,a[i]-a[i-1]);null!=c||(c=n.length),null!=d||(d=n.length);const g=null!=l&&null!=c?o.slice(l,c):[],m=null!=h&&null!=d?a.slice(h,d):[];let f=0,y=0;for(let e=1;e<Math.max(g.length,m.length);e++){const t=g[e],i=g[e-1],s=m[e],r=m[e-1];null!=t&&null!=i&&(f=Math.max(f,t-i)),null!=s&&null!=r&&(y=Math.max(y,s-r))}return{minRect:new er(0,0,u,p),minVisibleRect:new er(0,0,f,y)}}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:s}=e,r=null!=i?i:[];if(t){const e=s;return this.updateMarkerSelection({nodeData:r,markerSelection:e})}return this.updateDatumSelection({nodeData:r,datumSelection:s})}updateHighlightSelectionLabel(e){var t;return this.updateLabelSelection({labelData:null!=(t=e.items)?t:[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return x(this,null,function*(){return e.datumSelection})}updateDatumNodes(e){return x(this,null,function*(){})}updateMarkerSelection(e){return x(this,null,function*(){return e.markerSelection})}updateMarkerNodes(e){return x(this,null,function*(){})}updatePaths(e){return x(this,null,function*(){e.paths.forEach(e=>e.visible=!1)})}updatePathNodes(e){return x(this,null,function*(){const{paths:t,opacity:i,visible:s}=e;for(const e of t)e.opacity=i,e.visible=s})}resetAllAnimation(e){var t,i,s;const{path:r,datum:n,label:o,marker:a}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),r&&e.paths.forEach(e=>{fa([e],r)}),n&&fa([e.datumSelection],n),o&&fa([e.labelSelection],o),a&&this.opts.hasMarkers&&fa([e.markerSelection],a),!1===(null==(s=e.contextData)?void 0:s.animationValid)&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){var t,i;const{datum:s}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};s&&fa([e],s)}animateReadyHighlightMarkers(e){var t,i;const{marker:s}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};s&&fa([e],s)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animationTransitionClear(){const e=this.getAnimationData();e&&this.animationState.transition("clear",e)}getAnimationData(e,t){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}}calculateScaling(){const e={};for(const t of Object.values(Kn)){const i=this.axes[t];if(i)if(i.scale instanceof Na){const{range:s,domain:r}=i.scale;e[t]={type:"log",convert:e=>i.scale.convert(e),domain:[r[0],r[1]],range:[s[0],s[1]]}}else if(i.scale instanceof Xn){const{range:s}=i.scale,r=i.scale.getDomain();e[t]={type:"continuous",domain:[r[0],r[1]],range:[s[0],s[1]]}}else if(i.scale){const{domain:s}=i.scale;e[t]={type:"category",domain:s,range:s.map(e=>i.scale.convert(e))}}}return e}},Kd=["top","right","bottom","left"],$d=class e extends nd{constructor(e,t){super(e,t),this.paired=!0,this.firstSeriesTranslation=!0,this._lastCrossLineIds=void 0,this._lastAxisWidths={top:0,bottom:0,left:0,right:0},this._lastClipSeries=!1,this._lastVisibility={crossLines:!0,series:!0}}onAxisChange(e,t){super.onAxisChange(e,t),this.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.firstSeriesTranslation=!0}performLayout(){return x(this,null,function*(){const t=yield w(e.prototype,this,"performLayout").call(this),{firstSeriesTranslation:i,seriesRoot:s,annotationRoot:r,highlightRoot:n}=this,{animationRect:o,seriesRect:a,visibility:l,clipSeries:c}=this.updateAxes(t);this.seriesRoot.visible=l.series,this.seriesRect=a,this.animationRect=o;const{x:h,y:d}=a;if(i){for(const e of[s,r,n])e.translationX=Math.floor(h),e.translationY=Math.floor(d);this.firstSeriesTranslation=!1}else{const{translationX:e,translationY:t}=s;Pr(this.id,"seriesRect",this.ctx.animationManager,[s,n,r],{translationX:e,translationY:t},{translationX:Math.floor(h),translationY:Math.floor(d)},{phase:"update"})}const u=a.clone().grow(this.seriesArea.padding);this.hoverRect=u;const p=this.seriesArea.clip||c?u:void 0;s.setClipRectInGroupCoordinateSpace(p),n.setClipRectInGroupCoordinateSpace(p),r.setClipRectInGroupCoordinateSpace(p),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:c,series:{rect:a,paddedRect:u,visible:l.series,shouldFlipXY:this.shouldFlipXY()},axes:this.axes.map(e=>y({id:e.id},e.getLayoutState()))});const g=this.modulesManager.mapModules(e=>{var t;return null==(t=e.performCartesianLayout)?void 0:t.call(e,{seriesRect:a})});return yield Promise.all(g),t})}updateAxes(e){var t;const i=this.axes.flatMap(e=>{var t;return null!=(t=e.crossLines)?t:[]}).map(e=>e.id);let s,r,n;null!=this._lastCrossLineIds&&this._lastCrossLineIds.length===i.length&&this._lastCrossLineIds.every((e,t)=>i[t]===e)?(s=y({},this._lastAxisWidths),r=this._lastClipSeries,n=y({},this._lastVisibility)):(s={top:0,bottom:0,left:0,right:0},r=!1,n={crossLines:!0,series:!0},this._lastCrossLineIds=i);const o=new Set(this.axes.map(e=>e.position));for(const e of Object.keys(s))o.has(e)||delete s[e];const a=(e,t,i)=>!Object.keys(e).some(e=>null==s[e])&&n.crossLines===i.crossLines&&n.series===i.series&&Object.entries(s).every(([t,i])=>{const s=e[t];return null==i&&null==s||i===s})&&r===t,l=e=>Qe(e,e=>e&&Math.abs(e)===1/0?0:null!=e?Math.ceil(e):e);let c={},h={},d=!1,u=null==(t=this.seriesRect)?void 0:t.clone(),p=0,g={};do{Object.assign(s,c),r=d,Object.assign(n,h);const t=this.updateAxesPass(s,e.clone(),u);if(c=l(t.axisWidths),h=t.visibility,d=t.clipSeries,u=t.seriesRect,g=t.primaryTickCounts,p++>10){_.warn("unable to find stable axis layout.");break}}while(!a(c,d,h));return this.axes.forEach(e=>{e.update(g[e.direction])}),this.axes.forEach(t=>{if(t.setCrossLinesVisible(n.crossLines),u)switch(t.clipGrid(u.x,u.y,u.width+5,u.height+5),t.position){case"left":case"right":t.clipTickLines(e.x,u.y,e.width+5,u.height+5);break;case"top":case"bottom":t.clipTickLines(u.x,e.y,u.width+5,e.height+5)}}),this._lastAxisWidths=s,this._lastVisibility=n,{seriesRect:u,animationRect:e,visibility:n,clipSeries:r}}updateAxesPass(e,t,i){const s={},r={},n={series:!0,crossLines:!0};let o=!1;const a={},l=this.applySeriesPadding(t),c=i?this.buildCrossLinePadding(e):{},h=this.buildAxisBound(l,e,c,n),d=this.buildSeriesRect(h,e);return this.axes.forEach(t=>{var i,n;const{position:c="left"}=t,{clipSeries:u,axisThickness:p,axisOffset:g}=this.calculateAxisDimensions({axis:t,seriesRect:d,paddedBounds:l,axisWidths:e,newAxisWidths:r,primaryTickCounts:a,clipSeries:o,addInterAxisPadding:(null!=(i=s[c])?i:0)>0});s[c]=(null!=(n=s[c])?n:0)+1,o=o||u,this.positionAxis({axis:t,axisBound:h,axisOffset:g,axisThickness:p,axisWidths:e,primaryTickCounts:a,seriesRect:d})}),{clipSeries:o,seriesRect:d,axisWidths:r,visibility:n,primaryTickCounts:a}}buildCrossLinePadding(e){var t;const i={};this.axes.forEach(e=>{e.crossLines&&e.crossLines.forEach(e=>{var t;null==(t=e.calculatePadding)||t.call(e,i)})});for(const[s,r=0]of Object.entries(i))i[s]=Math.max(r-(null!=(t=e[s])?t:0),0);return i}applySeriesPadding(e){const t=e.clone(),i=this.axes.slice().reverse();return Kd.forEach(e=>{const s=this.seriesArea.padding[e],r=i.find(t=>t.position===e);r?r.seriesAreaPadding=s:t.shrink(s,e)}),t}buildAxisBound(e,t,i,s){var r,n,o,a;const l=e.clone(),{top:c=0,right:h=0,bottom:d=0,left:u=0}=i,p=u+h,g=c+d,m=(null!=(r=t.left)?r:0)+(null!=(n=t.right)?n:0)+p,f=(null!=(o=t.top)?o:0)+(null!=(a=t.bottom)?a:0)+g;return l.width<=m||l.height<=f?(s.crossLines=!1,s.series=!1,l):(l.x+=u,l.y+=c,l.width-=p,l.height-=g,l)}buildSeriesRect(e,t){const i=e.clone(),{top:s,bottom:r,left:n,right:o}=t;return i.x+=null!=n?n:0,i.y+=null!=s?s:0,i.width-=(null!=n?n:0)+(null!=o?o:0),i.height-=(null!=s?s:0)+(null!=r?r:0),i.width=Math.max(0,i.width),i.height=Math.max(0,i.height),i}clampToOutsideSeriesRect(e,t,i,s){const{x:r,y:n,width:o,height:a}=e,l=[r,n,r+o,n+a][("x"===i?0:1)+(1===s?0:2)];return(1===s?Math.min:Math.max)(t,l)}calculateAxisDimensions(e){var t,i,s;const{axis:r,seriesRect:n,paddedBounds:o,axisWidths:a,newAxisWidths:l,primaryTickCounts:c,addInterAxisPadding:h}=e;let{clipSeries:d}=e;const{position:u="left",direction:p}=r,g=r instanceof Dl||r instanceof Bl,m="left"===u||"right"===u,f=null!=(t=l[u])?t:0,{min:y,max:v}=this.ctx.zoomManager.getAxisZoom(r.id);m?(g?(r.range=[0,n.height],r.visibleRange=[1-v,1-y]):(r.range=[n.height,0],r.visibleRange=[y,v]),r.gridLength=n.width):(r.range=[0,n.width],r.visibleRange=[y,v],r.gridLength=n.height);let C=r.nice?c[p]:void 0;const b="y"===p;r.thickness?r.maxThickness=r.thickness:r.maxThickness=.3*(b?o.width:o.height);const S=r.calculateLayout(C);let w;if(C=S.primaryTickCount,null!=c[p]||(c[p]=C),d||(d=r.dataDomain.clipped||r.visibleRange[0]>0||r.visibleRange[1]<1),null!=r.thickness&&r.thickness>0)w=r.thickness;else{const{bbox:e}=S;w=b?e.width:e.height}return h&&(w+=15),w=Math.ceil(w),l[u]=(null!=(i=l[u])?i:0)+w,r.gridPadding=(null!=(s=a[u])?s:0)-l[u],{clipSeries:d,axisThickness:w,axisOffset:f,primaryTickCount:C}}positionAxis(e){var t,i,s,r;const{axis:n,axisBound:o,axisWidths:a,seriesRect:l,axisOffset:c,axisThickness:h}=e,{position:d}=n;switch(d){case"top":n.translation.x=o.x+(null!=(t=a.left)?t:0),n.translation.y=this.clampToOutsideSeriesRect(l,o.y+1+c+h,"y",1);break;case"bottom":n.translation.x=o.x+(null!=(i=a.left)?i:0),n.translation.y=this.clampToOutsideSeriesRect(l,o.y+o.height+1-h-c,"y",-1);break;case"left":n.translation.y=o.y+(null!=(s=a.top)?s:0),n.translation.x=this.clampToOutsideSeriesRect(l,o.x+c+h,"x",1);break;case"right":n.translation.y=o.y+(null!=(r=a.top)?r:0),n.translation.x=this.clampToOutsideSeriesRect(l,o.x+o.width-h-c,"x",-1)}n.updatePosition({rotation:Gr(n.rotation),sideFlag:n.label.getSideFlag()})}shouldFlipXY(){return!this.series.some(e=>!(e instanceof jd&&e.shouldFlipXY()))}};$d.className="CartesianChart",$d.type="cartesian";var Yd=$d,qd=class e{static isInstance(t){var i;return t instanceof e||"AgChartInstanceProxy"===(null==(i=t.constructor)?void 0:i.name)&&null!=t.chart||null!=t.chart&&this.validateImplementation(t)}static validateImplementation(e){var t;const i=Object.keys(null!=(t=Object.getPrototypeOf(e))?t:{});return["getOptions","destroy"].every(e=>i.includes(e))}constructor(e){this.chart=e}getOptions(){return xt(this.chart.getOptions())}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.chart.destroy()}};qd.chartInstances=new WeakMap,S([Xa({oldValue(e){qd.chartInstances.delete(e)},newValue(e){qd.chartInstances.set(e,this)}})],qd.prototype,"chart",2);var Xd=qd,Zd=class extends Xn{constructor(){super([0,1],[0,1]),this.type="number"}toDomain(e){return e}ticks(){var e;const t=null!=(e=this.tickCount)?e:Xn.defaultTickCount;if(!this.domain||this.domain.length<2||t<1||this.domain.some(e=>!isFinite(e)))return[];this.refresh();const[i,s]=this.getDomain(),{interval:r}=this;if(r){const e=Math.abs(r);if(!mo({start:i,stop:s,interval:e,availableRange:this.getPixelRange()}))return go(i,s,e)}return ho(i,s,t,this.minTickCount,this.maxTickCount)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}getTickStep(e,t){var i,s;const r=null!=(i=this.tickCount)?i:Xn.defaultTickCount;return null!=(s=this.interval)?s:po(e,t,r,this.minTickCount,this.maxTickCount)}updateNiceDomain(){var e;const t=null!=(e=this.tickCount)?e:Xn.defaultTickCount;if(t<1)return void(this.niceDomain=[...this.domain]);let[i,s]=this.domain;if(1===t)[i,s]=function(e,t){const i=Math.abs(t-e),s=Math.floor(Math.log10(i)),r=Math.pow(10,s),n=e>t?Math.ceil:Math.floor,o=t<e?Math.floor:Math.ceil;return uo.map(s=>{const a=s*r,l=n(e/a)*a,c=o(t/a)*a;return{error:1-i/Math.abs(c-l),domain:[l,c]}}).sort((e,t)=>e.error-t.error)[0].domain}(i,s);else{const e=i>s?Math.ceil:Math.floor,t=s<i?Math.floor:Math.ceil,r=4;for(let n=0;n<r;n++){const r=i,n=s,o=this.getTickStep(i,s),[a,l]=this.domain;if(o>=1)i=e(a/o)*o,s=t(l/o)*o;else{const r=1/o;i=e(a*r)/r,s=t(l*r)/r}if(i===r&&s===n)break}}this.niceDomain=[i,s]}tickFormat({ticks:e,specifier:t}){return ka(null!=e?e:this.ticks(),t)}};var Qd=class extends jn{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};S([Kr(Gn),jr(NaN)],Qd.prototype,"minSpacing",2),S([Kr(Bn),jr(NaN)],Qd.prototype,"maxSpacing",2);var Jd=class extends Al{constructor(e,t=new Zd){super(e,t),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=hs(e,t,i);return{domain:s,clipped:r}}createTick(){return new Qd}updateSecondaryAxisTicks(e){if(null==this.dataDomain)throw new Error("AG Charts - dataDomain not calculated, cannot perform tick calculation.");if(0===this.dataDomain.domain.length)return[];const[t,i]=function(e,t,i){let[s,r]=zs(e);s=function(e,t,i){const s=Math.abs(t-e)/(i-1),r=Math.floor(Math.log10(s)),n=Math.pow(10,r);return Math.floor(e/n)*n}(Math.floor(s),r,t);const n=function(e,t,i){return function(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/i*10;return s>0&&s<=1?i/10:s>1&&s<=2?2*i/10:s>1&&s<=5?5*i/10:s>5&&s<=10?10*i/10:s>10&&s<=20?20*i/10:s>20&&s<=40?40*i/10:s>40&&s<=50?50*i/10:s>50&&s<=100?100*i/10:s}((t-e)/(i-1))}(s,r,t);r=s+(t-1)*n;const o=i?[r,s]:[s,r],a=function(e,t,i){const s=Math.floor(Math.log10(t)),r=t>0&&t<1?Math.abs(s):0,n=Math.pow(10,r),o=co(r);for(let s=0;s<i;s++){const i=e+t*s;o[s]=Math.round(i*n)/n}return o}(s,n,t);return[o,a]}(this.dataDomain.domain,null!=e?e:0,this.reverse);return this.scale.nice=!1,this.scale.domain=t,this.scale.update(),i}formatDatum(e){return"number"==typeof e?e.toFixed(2):String(e)}};Jd.className="NumberAxis",Jd.type="number",S([Kr(Yr(an,dn("max"))),jr(NaN)],Jd.prototype,"min",2),S([Kr(Yr(an,un("min"))),jr(NaN)],Jd.prototype,"max",2);var eu=Vn(e=>ze(e)&&0!==e,"a non-zero number"),tu=class extends Jd{constructor(e){super(e,new Na),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=hs(e,t,i),n=s[0]>s[1],o=s[0]<0&&s[1]>0,a=0===s[0]&&0===s[1];return(n||o||a)&&(o?_.warn("the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."):a&&_.warn("the data domain has 0 extent, no data is rendered.")),0===s[0]&&(s[0]=1),0===s[1]&&(s[1]=-1),{domain:s,clipped:r}}set base(e){this.scale.base=e}get base(){return this.scale.base}};tu.className="LogAxis",tu.type="log",S([Kr(Yr(an,eu,dn("max"))),jr(NaN)],tu.prototype,"min",2),S([Kr(Yr(an,eu,un("min"))),jr(NaN)],tu.prototype,"max",2);var iu=class extends jn{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};S([Kr(Gn),jr(NaN)],iu.prototype,"minSpacing",2),S([Kr(Bn),jr(NaN)],iu.prototype,"maxSpacing",2);var su=class extends Al{constructor(e){super(e,new yo),this.min=void 0,this.max=void 0,this.refreshScale()}normaliseDataDomain(e){var t;let{min:i,max:s}=this,r=!1;return"number"==typeof i&&(i=new Date(i)),"number"==typeof s&&(s=new Date(s)),e.length>2&&(e=(null!=(t=ls(e))?t:[0,1e3]).map(e=>new Date(e))),i instanceof Date&&(r||(r=i>e[0]),e=[i,e[1]]),s instanceof Date&&(r||(r=s<e[1]),e=[e[0],s]),e[0]>e[1]&&(e=[]),{domain:e,clipped:r}}createTick(){return new iu}onLabelFormatChange(e,t,i){i?super.onLabelFormatChange(e,t,i):this.labelFormatter=this.scale.tickFormat({ticks:e,domain:t})}calculatePadding(){return[0,0]}formatDatum(e){var t;const i=this.scale.tickFormat({specifier:"%m/%d/%y, %H:%M:%S"});return null!=(t=this.moduleCtx.callbackCache.call(i,e))?t:String(e)}};su.className="TimeAxis",su.type="time",S([Kr(Yr(gn,dn("max")),{optional:!0})],su.prototype,"min",2),S([Kr(Yr(gn,un("min")),{optional:!0})],su.prototype,"max",2);var ru=1e-6,nu=(e,t,i,s,r)=>{let n=!1,o=!1,a=s-Math.sqrt(Math.max(m(r,2)-m(i,2),0)),l=0,c=0,h=i-Math.sqrt(Math.max(m(r,2)-m(s,2),0));return a>e?(n=!0,a=e,l=i-Math.sqrt(Math.max(m(r,2)-m(s-e,2)))):a<ru&&(a=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(m(r,2)-m(i-t,2))),h=t):h<ru&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:n,trailingClipped:o}},ou=(e,{x0:t,y0:i,x1:s,y1:r,cx:n,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==r){const l=Math.atan2(i-o,t-n),c=Math.atan2(r-o,s-n);e.arc(n,o,a,l,c)}else e.lineTo(t,i)},au=(e,t,i,s,r,n,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=n;const d=Math.max(a+h,l+c),u=Math.max(a+l,h+c);if(d<=0&&u<=0)return void(null==o?e.rect(t,i,s,r):e.rect(o.x,o.y,o.width,o.height));if(null==o&&a===l&&a===c&&a===h)return void e.roundRect(t,i,s,r,a);if(s<0&&(t+=s,s=Math.abs(s)),r<0&&(i+=r,r=Math.abs(r)),s<=0||r<=0)return;if(null==o)o=new er(t,i,s,r);else{const e=Math.max(t,o.x),n=Math.min(t+s,o.x+o.width),a=Math.max(i,o.y),l=Math.min(i+r,o.y+o.height);o=new er(e,a,n-e,l-a)}const p=Math.max(d/r,u/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g,m,f,y,v=!0,C=!0,b=!0,S=!0;if(v){const e=nu(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);e.leadingClipped&&(S=!1),e.trailingClipped&&(C=!1),g={x0:Math.max(o.x+e.leading1,o.x),y0:Math.max(o.y+e.leading0,o.y),x1:Math.max(o.x+e.trailing1,o.x),y1:Math.max(o.y+e.trailing0,o.y),cx:t+a,cy:i+a}}if(C){const e=nu(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);e.leadingClipped&&(v=!1),e.trailingClipped&&(b=!1),m={x0:Math.min(o.x+o.width-e.leading0,o.x+o.width),y0:Math.max(o.y+e.leading1,o.y),x1:Math.min(o.x+o.width-e.trailing0,o.x+o.width),y1:Math.max(o.y+e.trailing1,o.y),cx:t+s-l,cy:i+l}}if(b){const e=nu(o.height,o.width,Math.max(o.x+o.width-(t+s-c),0),Math.max(o.y+o.height-(i+r-c),0),c);e.leadingClipped&&(C=!1),e.trailingClipped&&(S=!1),f={x0:Math.min(o.x+o.width-e.leading1,o.x+o.width),y0:Math.min(o.y+o.height-e.leading0,o.y+o.height),x1:Math.min(o.x+o.width-e.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-e.trailing0,o.y+o.height),cx:t+s-c,cy:i+r-c}}if(S){const e=nu(o.width,o.height,Math.max(o.y+o.height-(i+r-h),0),Math.max(t+h-o.x,0),h);e.leadingClipped&&(b=!1),e.trailingClipped&&(v=!1),y={x0:Math.max(o.x+e.leading0,o.x),y0:Math.min(o.y+o.height-e.leading1,o.y+o.height),x1:Math.max(o.x+e.trailing0,o.x),y1:Math.min(o.y+o.height-e.trailing1,o.y+o.height),cx:t+h,cy:i+r-h}}let w=!1;v&&null!=g&&(ou(e,g,a,!w),w||(w=!0)),C&&null!=m&&(ou(e,m,l,!w),w||(w=!0)),b&&null!=f&&(ou(e,f,c,!w),w||(w=!0)),S&&null!=y&&(ou(e,y,h,!w),w||(w=!0)),e.closePath()},lu=class extends ud{constructor(){super(...arguments),this.borderPath=new hd,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=Io.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Io.defaultStyles.strokeWidth,this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared,this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){var e,t,i;const{path:s,borderPath:r,crisp:n,topLeftCornerRadius:o,topRightCornerRadius:a,bottomRightCornerRadius:l,bottomLeftCornerRadius:c}=this;let{x:h,y:d,width:u,height:p,strokeWidth:g,clipBBox:m}=this;const f=1/(null!=(t=null==(e=this.layerManager)?void 0:e.canvas.pixelRatio)?t:1);let y=1;if(s.clear(!0),r.clear(!0),n&&(u<=f&&(y*=u/f),p<=f&&(y*=p/f),u=this.align(h,u),p=this.align(d,p),h=this.align(h),d=this.align(d),m=null!=m?new er(this.align(m.x),this.align(m.y),this.align(m.x,m.width),this.align(m.y,m.height)):void 0),g)if(u<f){const e=h+f/2;r.moveTo(e,d),r.lineTo(e,d+p),g=f,this.borderClipPath=void 0}else if(p<f){const e=d+f/2;r.moveTo(h,e),r.lineTo(h+u,e),g=f,this.borderClipPath=void 0}else if(g<u&&g<p){const e=g/2;h+=e,d+=e,u-=g,p-=g;const t=null==m?void 0:m.clone().shrink(e),i={topLeft:o>0?o-g:0,topRight:a>0?a-g:0,bottomRight:l>0?l-g:0,bottomLeft:c>0?c-g:0};this.borderClipPath=void 0,u>0&&p>0&&(null==t||(null==t?void 0:t.width)>0&&(null==t?void 0:t.height)>0)&&(au(s,h,d,u,p,i,t),au(r,h,d,u,p,i,t))}else this.borderClipPath=null!=(i=this.borderClipPath)?i:new hd,this.borderClipPath.clear(!0),this.borderClipPath.rect(h,d,u,p),r.rect(h,d,u,p);else{const e={topLeft:o,topRight:a,bottomRight:l,bottomLeft:c};this.borderClipPath=void 0,au(s,h,d,u,p,e,m)}[o,a,l,c].every(e=>0===e)?(this.hittester=(e,t)=>{const i=this.transformPoint(e,t);return this.getCachedBBox().containsPoint(i.x,i.y)},this.distanceSquared=(e,t)=>this.getCachedBBox().distanceSquared(e,t)):(this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared),this.effectiveStrokeWidth=g,this.lastUpdatePathStrokeWidth=g,this.microPixelEffectOpacity=y}computeBBox(){var e;const{x:t,y:i,width:s,height:r,clipBBox:n}=this;return null!=(e=null==n?void 0:n.clone())?e:new er(t,i,s,r)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAlpha(e){const{fillOpacity:t,microPixelEffectOpacity:i,opacity:s}=this;e.globalAlpha*=s*t*i}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{strokeOpacity:r,lineDash:n,lineDashOffset:o,lineCap:a,lineJoin:l,borderPath:c,borderClipPath:h,opacity:d,microPixelEffectOpacity:u}=this;h&&e.clip(h.getPath2D()),e.strokeStyle=t,e.globalAlpha*=d*r*u,e.lineWidth=i,n&&e.setLineDash(n),o&&(e.lineDashOffset=o),a&&(e.lineCap=a),l&&(e.lineJoin=l),e.stroke(c.getPath2D()),e.globalAlpha=s}}};lu.className="Rect",S([dd()],lu.prototype,"x",2),S([dd()],lu.prototype,"y",2),S([dd()],lu.prototype,"width",2),S([dd()],lu.prototype,"height",2),S([dd()],lu.prototype,"topLeftCornerRadius",2),S([dd()],lu.prototype,"topRightCornerRadius",2),S([dd()],lu.prototype,"bottomRightCornerRadius",2),S([dd()],lu.prototype,"bottomLeftCornerRadius",2),S([dd()],lu.prototype,"clipBBox",2),S([dd()],lu.prototype,"crisp",2);var cu=class extends we{constructor(e){super(),this.node=new Eo({name:"background",zIndex:0}),this.rectNode=new lu,this.visible=!0,this.fill="white",this.node.appendChild(this.rectNode),this.destroyFns.push(e.scene.attachNode(this.node),e.layoutService.addListener("layout-complete",e=>this.onLayoutComplete(e)))}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};S([Kr(Qr),qa("node","visible")],cu.prototype,"visible",2),S([Kr(fn,{optional:!0}),qa("rectNode","fill")],cu.prototype,"fill",2),S([Kr(Xr,{optional:!0})],cu.prototype,"image",2);var hu={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:cu};function du({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:r=0,itemPaddingX:n=0,forceResult:o=!1}){const a="horizontal"===e,l={max:a?s:i,fn:a?e=>e.width:e=>e.height,padding:a?n:r},c={max:a?i:s,fn:a?e=>e.height:e=>e.width,padding:a?r:n};let h=0;const d=[];for(;h<t.length;){const e=uu(t.slice(h),h,l,c,o);if(!e)return;h+=e.processedBBoxCount,d.push(e.pageIndices)}return function(e,t,i,s,r){let n=0,o=0;return{pages:e.map(e=>{"horizontal"===t&&(e=function(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((e,i)=>{e.forEach((e,s)=>{t[s][i]=e})}),t}(e));let a=0;const l=e.map(e=>{const t=e.map(e=>(a=Math.max(e,a),i[e]));let n=0,o=0;return t.forEach(e=>{n+=e.height+s,o=Math.max(o,e.width+r)}),{indices:e,bboxes:t,columnHeight:Math.ceil(n),columnWidth:Math.ceil(o)}});let c=0,h=0;return l.forEach(e=>{c+=e.columnWidth,h=Math.max(h,e.columnHeight)}),n=Math.max(c,n),o=Math.max(h,o),{columns:l,startIndex:e[0][0],endIndex:a,pageWidth:c,pageHeight:h}}),maxPageWidth:n,maxPageHeight:o}}(d,e,t,r,n)}function uu(e,t,i,s,r){let n=function(e,t){const i=e.length;let s=0;for(let r=0;r<i;r++)if(s+=t.fn(e[r])+t.padding,s>t.max)return i/r<2?Math.ceil(i/2):r;return i}(e,i);if(n<1){if(!r)return;n=1}let o=n;for(;o>=1;){const n=pu(e,t,o,i,s,r);if(null==n&&o<=1)return;if(null!=n){if("number"!=typeof n)return{processedBBoxCount:n.length*n[0].length,pageIndices:n};if(n<=1)return;o=n<o&&n>1?n:o,o--}else o--}}function pu(e,t,i,s,r,n){var o;const a=[];let l=0,c=0,h=[];const d=[];for(let u=0;u<e.length;u++){const p=(u+i)%i;0===p&&(l+=c,c=0,h.length>0&&a.push(h),h=[]);const g=s.fn(e[u])+s.padding;d[p]=Math.max(null!=(o=d[p])?o:0,g),c=Math.max(c,r.fn(e[u])+r.padding);const m=l+c,f=!n||a.length>0;if(m>r.max&&f){h=[];break}if(d.reduce((e,t)=>e+t,0)>s.max&&!n)return d.length<i?d.length:void 0;h.push(u+t)}return h.length>0&&a.push(h),a.length>0?a:void 0}var gu=class extends Eo{constructor(){super({name:"markerLabelGroup"}),this.label=new Fo,this.line=new Ba,this._marker=new Td,this._markerSize=15,this._spacing=8;const{marker:e,label:t,line:i}=this;t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1,this.append([i,e,t]),this.update()}set marker(e){this._marker!==e&&(this.removeChild(this._marker),this._marker=e,this.appendChild(e),this.update())}get marker(){return this._marker}set markerSize(e){this._markerSize!==e&&(this._markerSize=e,this.update())}get markerSize(){return this._markerSize}set spacing(e){this._spacing!==e&&(this._spacing=e,this.update())}get spacing(){return this._spacing}setSeriesStrokeOffset(e){const t=this.marker.size/2+e;this.line.x1=-t,this.line.x2=t,this.line.y1=0,this.line.y2=0,this.line.markDirtyTransform(),this.update()}update(){const{markerSize:e}=this,t=this.marker.constructor.center;this.marker.size=e,this.marker.x=(t.x-.5)*e,this.marker.y=(t.y-.5)*e;const i=this.line.visible?this.line.x2:-1/0,s=e/2;this.label.x=Math.max(i,s)+this.spacing}render(e){this.marker.opacity=this.opacity,this.label.opacity=this.opacity,this.line.opacity=this.opacity,super.render(e)}};gu.className="MarkerLabel",S([qa("label")],gu.prototype,"text",2),S([qa("label")],gu.prototype,"fontStyle",2),S([qa("label")],gu.prototype,"fontWeight",2),S([qa("label")],gu.prototype,"fontSize",2),S([qa("label")],gu.prototype,"fontFamily",2),S([qa("label","fill")],gu.prototype,"color",2),S([qa("marker","fill")],gu.prototype,"markerFill",2),S([qa("marker","stroke")],gu.prototype,"markerStroke",2),S([qa("marker","strokeWidth")],gu.prototype,"markerStrokeWidth",2),S([qa("marker","fillOpacity")],gu.prototype,"markerFillOpacity",2),S([qa("marker","strokeOpacity")],gu.prototype,"markerStrokeOpacity",2),S([qa("marker","visible")],gu.prototype,"markerVisible",2),S([qa("line","stroke")],gu.prototype,"lineStroke",2),S([qa("line","strokeWidth")],gu.prototype,"lineStrokeWidth",2),S([qa("line","strokeOpacity")],gu.prototype,"lineStrokeOpacity",2),S([qa("line","lineDash")],gu.prototype,"lineLineDash",2),S([qa("line","visible")],gu.prototype,"lineVisible",2);var mu=class extends vt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};S([Kr(fn)],mu.prototype,"color",2),S([Kr(Tn,{optional:!0})],mu.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0})],mu.prototype,"fontWeight",2),S([Kr(rn)],mu.prototype,"fontSize",2),S([Kr(en)],mu.prototype,"fontFamily",2);var fu=class extends vt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};S([Kr(rn)],fu.prototype,"size",2),S([Kr(fn,{optional:!0})],fu.prototype,"fill",2),S([Kr(nn,{optional:!0})],fu.prototype,"fillOpacity",2),S([Kr(fn,{optional:!0})],fu.prototype,"stroke",2),S([Kr(rn)],fu.prototype,"strokeWidth",2),S([Kr(nn)],fu.prototype,"strokeOpacity",2);var yu=class extends vt{constructor(e){super(),this.parent=e,this.shape=Rd,this.size=15,this.padding=8}};S([Xa({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],yu.prototype,"shape",2),S([Kr(rn)],yu.prototype,"size",2),S([Kr(rn)],yu.prototype,"padding",2);var vu=class extends vt{constructor(e,t,i,s){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.regionManager=i,this.cursorManager=s,this.id=Gs(this),this.marker=new yu(this),this.activeStyle=new fu,this.inactiveStyle=new fu,this.highlightStyle=new fu,this.label=new mu,this.group=new Eo({name:"pagination"}),this.labelNode=new Fo,this.destroyFns=[],this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this._nextButton=new Rd,this._previousButton=new Rd,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]);const r=this.regionManager.addRegion("pagination",this.group);this.destroyFns.push(r.addListener("click",e=>this.onPaginationClick(e)),r.addListener("hover",e=>this.onPaginationMouseMove(e))),this.update(),this.updateMarkers()}destroy(){this.destroyFns.forEach(e=>e())}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){this._orientation=e,"horizontal"===e?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}set nextButton(e){this._nextButton!==e&&(this.group.removeChild(this._nextButton),this._nextButton=e,this.group.appendChild(e))}get nextButton(){return this._nextButton}set previousButton(e){this._previousButton!==e&&(this.group.removeChild(this._previousButton),this._previousButton=e,this.group.appendChild(e))}get previousButton(){return this._previousButton}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.computeBBox();this.nextButton.translationX=e.x+e.width+this.marker.size/2+this.marker.padding}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:r,inactiveStyle:n,highlightStyle:o,highlightActive:a}=this,l=(e,t)=>t?n:e===a?o:r;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){var i;const{size:s}=this.marker;e.size=s,e.fill=t.fill,e.fillOpacity=null!=(i=t.fillOpacity)?i:1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=0===t,s=e===t-1,r=0===e;this.nextButtonDisabled=s||i,this.previousButtonDisabled=r||i}nextButtonContainsPoint(e,t){return!this.nextButtonDisabled&&this.nextButton.containsPoint(e,t)}previousButtonContainsPoint(e,t){return!this.previousButtonDisabled&&this.previousButton.containsPoint(e,t)}clickNext(){this.incrementPage(),this.onPaginationChanged()}clickPrevious(){this.decrementPage(),this.onPaginationChanged()}setPage(e){e=Hs(0,e,this.totalPages-1),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}onPaginationClick(e){const{offsetX:t,offsetY:i}=e;this.nextButtonContainsPoint(t,i)?(this.clickNext(),e.consume()):this.previousButtonContainsPoint(t,i)&&(this.clickPrevious(),e.consume())}onPaginationMouseMove(e){const{offsetX:t,offsetY:i}=e;this.nextButtonContainsPoint(t,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="next"):this.previousButtonContainsPoint(t,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="previous"):(this.cursorManager.updateCursor(this.id),this.highlightActive=void 0),this.updateMarkers(),this.chartUpdateCallback(6)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){const e=Nd(this.marker.shape||Rd);this.previousButton=new e,this.nextButton=new e,this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(e){e.append(this.group)}computeBBox(){return this.group.computeBBox()}};vu.className="Pagination",S([Kr(Xr)],vu.prototype,"marker",2),S([Kr(Xr)],vu.prototype,"activeStyle",2),S([Kr(Xr)],vu.prototype,"inactiveStyle",2),S([Kr(Xr)],vu.prototype,"highlightStyle",2),S([Kr(Xr)],vu.prototype,"label",2);var Cu=class extends vt{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.formatter=void 0}};S([Kr(rn,{optional:!0})],Cu.prototype,"maxLength",2),S([Kr(fn)],Cu.prototype,"color",2),S([Kr(Tn,{optional:!0})],Cu.prototype,"fontStyle",2),S([Kr(Dn,{optional:!0})],Cu.prototype,"fontWeight",2),S([Kr(rn)],Cu.prototype,"fontSize",2),S([Kr(en)],Cu.prototype,"fontFamily",2),S([Kr(Jr,{optional:!0})],Cu.prototype,"formatter",2);var bu=class extends vt{constructor(){super(...arguments),this.size=15,this.padding=8,this.enabled=!0}};S([Za(e=>{var t;return null==(t=e.parent)?void 0:t.onMarkerShapeChange()})],bu.prototype,"shape",2),S([Kr(rn)],bu.prototype,"size",2),S([Kr(rn)],bu.prototype,"padding",2),S([Kr(rn,{optional:!0})],bu.prototype,"strokeWidth",2),S([Kr(Qr)],bu.prototype,"enabled",2);var Su=class extends vt{};S([Kr(rn,{optional:!0})],Su.prototype,"strokeWidth",2),S([Kr(rn,{optional:!0})],Su.prototype,"length",2);var wu=class extends vt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.toggleSeriesVisible=!0,this.showSeriesStroke=!1,this.marker=new bu,this.label=new Cu,this.line=new Su}};S([Kr(rn,{optional:!0})],wu.prototype,"maxWidth",2),S([Kr(rn)],wu.prototype,"paddingX",2),S([Kr(rn)],wu.prototype,"paddingY",2),S([Kr(Qr)],wu.prototype,"toggleSeriesVisible",2),S([Kr(Qr)],wu.prototype,"showSeriesStroke",2),S([Kr(Xr)],wu.prototype,"marker",2),S([Kr(Xr)],wu.prototype,"label",2),S([Kr(Xr)],wu.prototype,"line",2);var xu=class extends vt{};S([Kr(Jr,{optional:!0})],xu.prototype,"legendItemClick",2),S([Kr(Jr,{optional:!0})],xu.prototype,"legendItemDoubleClick",2);var Eu=class extends vt{constructor(e){super(),this.ctx=e,this.id=Gs(this),this.group=new Eo({name:"legend",layer:!0,zIndex:11}),this.itemSelection=_a.select(this.group,gu),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.item=new wu,this.listeners=new xu,this.enabled=!0,this.position="bottom",this.spacing=20,this.characterWidths=new Map,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.focus={mode:"item",index:0},this.item.marker.parent=this,this.pagination=new vu(t=>e.updateService.update(t),e=>this.updatePageNumber(e),e.regionManager,e.cursorManager),this.pagination.attachPagination(this.group),this.item.marker.parent=this;const t=e.regionManager.addRegionFromProperties({name:"legend",bboxproviders:[this.group],canInteraction:()=>this.enabled&&this.group.visible});this.destroyFns.push(t.addListener("click",e=>this.checkLegendClick(e),17),t.addListener("dblclick",e=>this.checkLegendDoubleClick(e),17),t.addListener("hover",e=>this.handleLegendMouseMove(e)),t.addListener("leave",e=>this.handleLegendMouseExit(e),17),t.addListener("enter",e=>this.handleLegendMouseEnter(e),17),t.addListener("blur",e=>this.onBlur(e)),t.addListener("tab",e=>this.onTab(e)),t.addListener("tab-start",e=>this.onTabStart(e)),t.addListener("nav-vert",e=>this.onNav(e)),t.addListener("nav-hori",e=>this.onNav(e)),t.addListener("submit",e=>this.onSubmit(e)),e.layoutService.addListener("start-layout",e=>this.positionLegend(e.shrinkRect)),()=>this.detachLegend())}set data(e){this._data=e,this.updateGroupVisibility()}get data(){return this._data}destroy(){this.destroyFns.forEach(e=>e()),this.pagination.destroy()}onMarkerShapeChange(){this.itemSelection.clear(),this.group.markDirty(this.group,2)}getOrientation(){if(void 0!==this.orientation)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}getCharacterWidths(e){const{characterWidths:t}=this;if(t.has(e))return t.get(e);const i={"...":Fo.getTextSize("...",e).width};return t.set(e,i),i}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}detachLegend(){var e;null==(e=this.group.parent)||e.removeChild(this.group)}getItemLabel(e){const{ctx:{callbackCache:t}}=this,{formatter:i}=this.item.label;return i?t.call(i,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId}):e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:r,maxWidth:n,marker:{size:o,padding:a,shape:l},label:{maxLength:c=1/0,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p},line:g,showSeriesStroke:m}=this.item,f=[...this.data];this.reverseOrder&&f.reverse(),this.itemSelection.update(f);const y=[],v=Bo(r),C=null!=n?n:.8*e,b=o+a+i;if(this.itemSelection.each((e,t)=>{var i,s,r;const n=Nd(null!=l?l:t.marker.shape),f=null!=(i=t.marker.enabled)?i:this.item.marker.enabled;e.marker&&e.marker instanceof n||(e.marker=new n),e.markerSize=o,e.spacing=a,e.fontStyle=h,e.fontWeight=d,e.fontSize=u,e.fontFamily=p;const S=null!=(s=t.itemId)?s:t.id,w=this.getItemLabel(t),x=(null!=w?w:"<unknown>").replace(/\r?\n/g," ");e.text=this.truncate(x,c,C,b,v,S),m&&void 0!==t.line?(e.lineVisible=!0,e.markerVisible=f,e.setSeriesStrokeOffset(null!=(r=g.length)?r:5)):(e.lineVisible=!1,e.markerVisible=!0),y.push(e.computeBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return!1;const S=this.size,w=this.oldSize;S[0]=e,S[1]=t,S[0]===w[0]&&S[1]===w[1]||(w[0]=S[0],w[1]=S[1]);const{pages:x,maxPageHeight:E,maxPageWidth:M}=this.updatePagination(y,e,t);this.pages=x,this.maxPageSize=[M-i,E-s];const A=this.pagination.currentPage,T=this.pages[A];this.pages.length<1||!T?this.visible=!1:(this.visible=!0,this.updatePositions(A),this.update())}truncate(e,t,i,s,r,n){const o=e.split("");let a=!1;if(e.length>t&&(e=`${e.substring(0,t)}`,a=!0),Math.floor(s+Fo.getTextSize(e,r).width)>i){let t="";const n=this.getCharacterWidths(r);let l=s+n["..."];for(const e of o){if(n[e]||(n[e]=Fo.getTextSize(e,r).width),l+=n[e],l>i)break;t+=e}e=t,a=!0}return a?(e+="...",this.truncatedItems.add(n)):this.truncatedItems.delete(n),e}updatePagination(e,t,i){const s=this.getOrientation(),r=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:n,maxPageHeight:o,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=n.findIndex(e=>e.endIndex>=r);this.pagination.currentPage=Hs(0,h,n.length-1);const{paddingX:d,paddingY:u}=this.item,p=a-d,g=o-u;let m=0,f=-l.y-this.item.marker.size/2;return c?f+=g+8:(m+=-l.x+p+8,f+=(g-l.height)/2),this.pagination.translationX=m,this.pagination.translationY=f,this.pagination.update(),this.pagination.updateMarkers(),{maxPageHeight:o,maxPageWidth:a,pages:n}}calculatePagination(e,t,i){var s,r,n;const{paddingX:o,paddingY:a}=this.item,l=this.getOrientation(),c=["left","right"].includes(this.position);let h=this.pagination.computeBBox(),d=new er(0,0,0,0),u=[],p=0,g=0,m=0;const f=e=>e.width===h.width&&e.height===h.height,y=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(m++>10){_.warn("unable to find stable legend layout.");break}h=d;const f=t-(c?0:h.width),v=du({orientation:l,bboxes:e,maxHeight:i-(c?h.height:0),maxWidth:f,itemPaddingY:a,itemPaddingX:o,forceResult:y});u=null!=(s=null==v?void 0:v.pages)?s:[],p=null!=(r=null==v?void 0:v.maxPageWidth)?r:0,g=null!=(n=null==v?void 0:v.maxPageHeight)?n:0;const C=u.length;if(this.pagination.visible=C>1,this.pagination.totalPages=C,this.pagination.update(),d=this.pagination.computeBBox(),!this.pagination.visible)break}while(!f(d));return{maxPageWidth:p,maxPageHeight:g,pages:u,paginationBBox:h,paginationVertical:c}}getPageItemCount(e){let t=0;for(const i of this.pages[e].columns)t+=i.indices.length;return t}getNodeIndexFromFocusIndex(){const{index:e}=this.focus,t=this.pages[this.pagination.currentPage];let i=0;for(const s of t.columns){if(e<i+s.indices.length)return s.indices[e-i];i+=s.indices.length}return-1}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:r,startIndex:n,endIndex:o}=s[e];let a=0,l=0;const c=r.length,h=r[0].indices.length,d="horizontal"===this.getOrientation(),u=r[0].bboxes[0].height+t,p=[];i.each((e,t,i)=>{var s,g;if(i<n||i>o)return void(e.visible=!1);const m=i-n;let f=0,y=0;d?(f=m%c,y=Math.floor(m/c)):(f=Math.floor(m/h),y=m%h),e.visible=!0;const v=r[f];v&&(l=u*y,a=null!=(s=p[y])?s:0,p[y]=(null!=(g=p[y])?g:0)+v.columnWidth,e.translationX=Math.floor(a),e.translationY=Math.floor(l))})}updatePageNumber(e){const{pages:t}=this,{startIndex:i,endIndex:s}=t[e];0===i?this.paginationTrackingIndex=0:e===t.length-1?this.paginationTrackingIndex=s:this.paginationTrackingIndex=Math.floor((i+s)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.ctx.updateService.update(6)}update(){const{label:{color:e},marker:t,line:i,showSeriesStroke:s}=this.item;this.itemSelection.each((r,n)=>{var o,a;const l=n.marker;r.markerFill=l.fill,r.markerStroke=l.stroke,r.markerStrokeWidth=null!=(o=t.strokeWidth)?o:Math.min(2,l.strokeWidth),r.markerFillOpacity=l.fillOpacity,r.markerStrokeOpacity=l.strokeOpacity,r.opacity=n.enabled?1:.5,r.color=e;const{line:c}=n;s&&void 0!==c&&(r.lineStroke=c.stroke,r.lineStrokeOpacity=c.strokeOpacity,r.lineStrokeWidth=null!=(a=i.strokeWidth)?a:Math.min(2,c.strokeWidth),r.lineLineDash=c.lineDash)})}getDatumForPoint(e,t){const i=[],s={dist:1/0,datum:void 0};for(const r of this.group.children){if(!r.visible)continue;if(!(r instanceof gu))continue;const n=r.computeBBox();if(n.grow(this.item.paddingX/2,"horizontal"),n.grow(this.item.paddingY/2,"vertical"),n.containsPoint(e,t))return r.datum;const o=e-n.x-this.item.paddingX/2,a=t-n.y-this.item.paddingY/2,l=m(o,2)+m(a,2);o>=0&&a>=0&&l<s.dist&&(s.dist=l,s.datum=r.datum),i.push(n)}if(er.merge(i).containsPoint(e,t))return s.datum}computePagedBBox(){const e=this.group.computeBBox();if(this.pages.length<=1)return e;const[t,i]=this.maxPageSize;return e.height=Math.max(i,e.height),e.width=Math.max(t,e.width),e}checkLegendClick(e){const t=this.getDatumForPoint(e.offsetX,e.offsetY);this.doClick(t)&&e.consume()}doClick(e){const{listeners:{legendItemClick:t},ctx:{chartService:i,highlightManager:s},item:{toggleSeriesVisible:r},preventHidingAll:n}=this;if(!e)return!1;const{id:o,itemId:a,enabled:l}=e,c=i.series.find(e=>e.id===o);if(!c)return!1;let h=l;if(r){h=!l,n&&!h&&i.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length<2&&(h=!0);const t=h?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`${t}`),this.ctx.chartEventManager.legendItemClick(c,a,h,e.legendItemName)}return h?s.updateHighlight(this.id,{series:c,itemId:a,datum:void 0}):s.updateHighlight(this.id),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==t||t({type:"click",enabled:h,itemId:a,seriesId:c.id}),!0}checkLegendDoubleClick(e){var t;const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},item:{toggleSeriesVisible:r}}=this;if("integrated"===s.mode)return;const n=this.getDatumForPoint(e.offsetX,e.offsetY);if(!n)return;const{id:o,itemId:a,seriesId:l}=n,c=s.series.find(e=>e.id===o);if(c){if(e.consume(),r){const e=s.series.flatMap(e=>e.getLegendData("category")),i=e.filter(e=>e.enabled).length,r=e.find(e=>e.itemId===a&&e.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(c,a,null!=(t=null==r?void 0:r.enabled)&&t,i,null==r?void 0:r.legendItemName)}this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==i||i({type:"dblclick",enabled:!0,itemId:a,seriesId:c.id})}}handleLegendMouseMove(e){if(!this.enabled)return;const{offsetX:t,offsetY:i}=e;e.consume();const s=this.getDatumForPoint(t,i);this.doHover(e,s)}doHover(e,t){var i;const{item:{toggleSeriesVisible:s},listeners:r}=this;if(void 0===e||void 0===t)return this.ctx.cursorManager.updateCursor(this.id),void this.ctx.highlightManager.updateHighlight(this.id);const n=t?this.ctx.chartService.series.find(e=>e.id===(null==t?void 0:t.id)):void 0;if(t&&this.truncatedItems.has(null!=(i=t.itemId)?i:t.id)){const{offsetX:i,offsetY:s}=e;this.ctx.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:e,showArrow:!1},rl({content:this.getItemLabel(t)}))}else this.ctx.tooltipManager.removeTooltip(this.id);(s||null!=r.legendItemClick||null!=r.legendItemDoubleClick)&&this.ctx.cursorManager.updateCursor(this.id,"pointer"),(null==t?void 0:t.enabled)&&n?this.ctx.highlightManager.updateHighlight(this.id,{series:n,itemId:null==t?void 0:t.itemId,datum:void 0}):this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseExit(e){this.doMouseExit()}doMouseExit(){this.ctx.cursorManager.updateCursor(this.id),this.ctx.tooltipManager.removeTooltip(this.id),16===this.ctx.interactionManager.getState()&&this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseEnter(e){const{enabled:t,item:{toggleSeriesVisible:i},listeners:{legendItemClick:s,legendItemDoubleClick:r}}=this,n=this.getDatumForPoint(e.offsetX,e.offsetY);t&&void 0!==n&&(i||null!=s||null!=r)&&this.ctx.cursorManager.updateCursor(this.id,"pointer")}onBlur(e){this.doMouseExit(),this.focus.mode="item",this.ctx.regionManager.updateFocusIndicatorRect(void 0)}onTab(e){this.updateFocus(),e.consume()}onTabStart(e){if(!this.pagination.visible||!this.pagination.enabled)return;const t=t=>{this.focus.mode=t,this.updateFocus(),e.consume()};"item"===this.focus.mode&&1===e.delta?(this.focus.index=0===this.pagination.currentPage?1:0,t("page")):"page"===this.focus.mode&&-1===e.delta&&(this.focus.index=0,t("item"))}onNav(e){if("item"===this.focus.mode){const t=this.focus.index+e.delta,i=this.getPageItemCount(this.pagination.currentPage);this.focus.index=Hs(-1,t,i),this.updateFocus(),e.consume()}else"page"===this.focus.mode&&(e.delta<0&&(this.focus.index=0),e.delta>0&&(this.focus.index=1),this.updateFocus(),e.consume())}onSubmit(e){"item"===this.focus.mode?this.doClick(this.getFocusedItem().datum):"page"===this.focus.mode&&(0===this.focus.index&&this.pagination.clickPrevious(),1===this.focus.index&&this.pagination.clickNext(),this.ctx.ariaAnnouncementService.announceValue(`Legend page ${this.pagination.currentPage+1} of ${this.pages.length}`))}maybeChangeFocusPage(){const e=this.pagination.currentPage,t=this.getPageItemCount(e);if(-1===this.focus.index)this.pagination.setPage(e-1);else{if(this.focus.index!==t)return;this.pagination.setPage(e+1)}const{currentPage:i}=this.pagination;e===i?this.focus.index=Hs(0,this.focus.index,t-1):-1===this.focus.index?this.focus.index=this.getPageItemCount(i)-1:this.focus.index=0}getFocusedItem(){if("item"!==this.focus.mode)return _.error("getFocusedItem() should be called only when focus.mode is 'item'"),{nodeIndex:-1,node:void 0,datum:void 0};this.maybeChangeFocusPage();const e=this.getNodeIndexFromFocusIndex();if(e<0)return _.error(`Cannot access negative nodeIndex ${e}`),{nodeIndex:-1,node:void 0,datum:void 0};const t=this.itemSelection.nodes()[e];let i;return e<this.data.length?i=this.data[e]:_.error(`Cannot access datum[${e}]`),{nodeIndex:e,node:t,datum:i}}updateFocus(){const{focus:e,pagination:t}=this;if("item"===e.mode){const{nodeIndex:e,node:t,datum:i}=this.getFocusedItem();if(void 0===i)return;const s=null==t?void 0:t.computeTransformedBBox();this.doHover(oh(this.ctx.regionManager,{bbox:s,showFocusBox:!0}),i);const r=i&&this.getItemLabel(i);if(r){const t=i.enabled?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`Legend item ${e+1} of ${this.data.length}, ${r}, ${t}`)}}else if("page"===e.mode){const i=0===e.index?t.previousButton:t.nextButton;this.ctx.regionManager.updateFocusIndicatorRect(i.computeTransformedBBox());const s=["Previous legend page","Next legend page"][e.index];this.ctx.ariaAnnouncementService.announceValue(`${s}, button`)}}positionLegend(e){const t=e.clone();if(!this.enabled||!this.data.length)return{shrinkRect:t};const[i,s]=this.calculateLegendDimensions(e);this.group.translationX=0,this.group.translationY=0,this.calcLayout(i,s);const r=this.computePagedBBox(),n=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return e.height-r.height;default:return e.width-r.width}};if(this.visible){let i,s;switch(this.position){case"top":case"bottom":i=(e.width-r.width)/2,s=n(),t.shrink(r.height,this.position);break;default:i=n(),s=(e.height-r.height)/2,t.shrink(r.width,this.position)}this.group.translationX=Math.floor(-r.x+e.x+i),this.group.translationY=Math.floor(-r.y+e.y+s)}if(this.visible&&this.enabled&&this.data.length){const e=this.spacing;t.shrink(e,this.position);const i=r.clone();i.x+=this.group.translationX,i.y+=this.group.translationY}return{shrinkRect:t}}calculateLegendDimensions(e){const{width:t,height:i}=e,s=t/i;let r,n;switch(this.position){case"top":case"bottom":const e=s<1?Math.min(.5,1/s*.2):.2;r=this.maxWidth?Math.min(this.maxWidth,t):t,n=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*e);break;default:const o=s>1?Math.min(.5,.25*s):.25;r=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*o),n=this.maxHeight?Math.min(this.maxHeight,i):i}return[r,n]}};Eu.className="Legend",S([Kr(Xr)],Eu.prototype,"pagination",2),S([Kr(Xr)],Eu.prototype,"item",2),S([Kr(Xr)],Eu.prototype,"listeners",2),S([Za(e=>e.updateGroupVisibility()),Kr(Qr)],Eu.prototype,"enabled",2),S([Kr(An)],Eu.prototype,"position",2),S([Kr(rn,{optional:!0})],Eu.prototype,"maxWidth",2),S([Kr(rn,{optional:!0})],Eu.prototype,"maxHeight",2),S([Kr(Qr,{optional:!0})],Eu.prototype,"reverseOrder",2),S([Kr(Fn(["horizontal","vertical"],"an orientation"),{optional:!0})],Eu.prototype,"orientation",2),S([Kr(Qr,{optional:!0})],Eu.prototype,"preventHidingAll",2),S([Kr(rn)],Eu.prototype,"spacing",2);var Mu={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:Eu,packageType:"community"},Au=class extends ud{constructor(){super(...arguments),this.zIndex=3,this._fill="#f2f2f2",this._stroke="#999999",this._strokeWidth=1,this._lineCap="square",this._centerX=0,this._centerY=0,this._width=8,this._gripLineGap=2,this._gripLineLength=8,this._height=16}set centerX(e){this._centerX!==e&&(this._centerX=e,this.dirtyPath=!0)}get centerX(){return this._centerX}set centerY(e){this._centerY!==e&&(this._centerY=e,this.dirtyPath=!0)}get centerY(){return this._centerY}set width(e){this._width!==e&&(this._width=e,this.dirtyPath=!0)}get width(){return this._width}set gripLineGap(e){this._gripLineGap!==e&&(this._gripLineGap=e,this.dirtyPath=!0)}get gripLineGap(){return this._gripLineGap}set gripLineLength(e){this._gripLineLength!==e&&(this._gripLineLength=e,this.dirtyPath=!0)}get gripLineLength(){return this._gripLineLength}set height(e){this._height!==e&&(this._height=e,this.dirtyPath=!0)}get height(){return this._height}layout(e,t){this.centerX=e,this.centerY=t}static align(e,t,i,s,r,n,o,a){const l=e.strokeWidth/2,c=e.align(i+r*o)+l,h=c+e.align(i+r*o,r*(a-o))-2*l,d=e.align(s+n/2)+l;e.layout(c,d),t.layout(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this;return new er(e-i/2,t-s/2,i,s)}isPointInPath(e,t){const i=this.transformPoint(e,t);return this.computeBBox().containsPoint(i.x,i.y)}updatePath(){var e,t,i;const{centerX:s,centerY:r,path:n,strokeWidth:o,gripLineGap:a,gripLineLength:l}=this,c=null!=(i=null==(t=null==(e=this.layerManager)?void 0:e.canvas)?void 0:t.pixelRatio)?i:1;n.clear();const h=Math.floor(this.width/2*c)/c,d=Math.floor(this.height/2*c)/c;n.moveTo(s-h,r-d),n.lineTo(s+h,r-d),n.lineTo(s+h,r+d),n.lineTo(s-h,r+d),n.closePath();const u=Math.floor((a+o)/2*c)/c,p=Math.floor(l/2*c)/c;n.moveTo(s-u,r-p),n.lineTo(s-u,r+p),n.moveTo(s+u,r-p),n.lineTo(s+u,r+p)}};Au.className="RangeHandle",S([Kr(fn)],Au.prototype,"_fill",2),S([Kr(fn)],Au.prototype,"_stroke",2),S([Kr(rn)],Au.prototype,"_strokeWidth",2),S([Kr(xn)],Au.prototype,"_lineCap",2),S([Kr(rn)],Au.prototype,"_width",2),S([Kr(rn)],Au.prototype,"_gripLineGap",2),S([Kr(rn)],Au.prototype,"_gripLineLength",2),S([Kr(rn)],Au.prototype,"_height",2);var Tu=class extends ud{constructor(){super(...arguments),this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1}layout(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this.dirtyPath=!0}update(e,t){this.min=isNaN(e)?this.min:e,this.max=isNaN(t)?this.max:t,this.dirtyPath=!0}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new er(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:r,max:n}=this,o=e+i*r;return new er(o,t,e+i*n-o,s)}updatePath(){const{path:e,x:t,y:i,width:s,height:r,min:n,max:o,strokeWidth:a}=this,l=a/2;e.clear();const c=this.align(t)+l,h=this.align(i)+l,d=c+this.align(t,s)-2*l,u=h+this.align(i,r)-2*l;e.moveTo(c,h),e.lineTo(d,h),e.lineTo(d,u),e.lineTo(c,u),e.closePath();const p=this.align(t+s*n)+l,g=p+this.align(t+s*n,s*(o-n))-2*l;e.moveTo(p,h),e.lineTo(p,u),e.lineTo(g,u),e.lineTo(g,h),e.closePath()}};Tu.className="RangeMask";var Du=class extends Eo{constructor(e){super({name:"rangeSelectorGroup",layer:!0,zIndex:12}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.isContainerNode=!0,this.background=new Eo({name:"navigator-background"}),this.background.zIndex=1,this.appendChild(this.background),this.append(e)}layout(e,t,i,s,r,n){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=r,this.rOffset=n,this.background.translationX=e,this.background.translationY=t}updateBackground(e,t){null!=e&&this.background.removeChild(e),null!=t&&this.background.appendChild(t)}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:r,rOffset:n}=this;return new er(e-r,t,i+(r+n),s)}},Iu=class extends we{constructor(e){super(),this.ctx=e,this.miniChart=void 0,this.enabled=!1,this.mask=new Tu,this.minHandle=new Au,this.maxHandle=new Au,this.height=30,this.margin=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Du([this.mask,this.minHandle,this.maxHandle]),this._min=0,this._max=1,this.minRange=.001;const t=e.regionManager.addRegion("navigator",this.rangeSelector);this.destroyFns.push(e.scene.attachNode(this.rangeSelector),t.addListener("hover",e=>this.onHover(e),25),t.addListener("drag-start",e=>this.onDragStart(e),25),t.addListener("drag",e=>this.onDrag(e),25),t.addListener("drag-end",()=>this.onDragEnd(),25),t.addListener("leave",e=>this.onLeave(e),25),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.updateGroupVisibility()}updateBackground(e,t){var i;null==(i=this.rangeSelector)||i.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;null!=this.rangeSelector&&e!==this.rangeSelector.visible&&(this.rangeSelector.visible=e,e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}performLayout(e){return x(this,arguments,function*({shrinkRect:e}){if(this.enabled){const t=this.height+this.margin;e.shrink(t,"bottom"),this.y=e.y+e.height+this.margin}else this.y=0;return{shrinkRect:e}})}performCartesianLayout(e){return x(this,null,function*(){const{x:t,width:i}=e.seriesRect;if(this.enabled){const{y:e,height:s}=this;this.layoutNodes(t,e,i,s)}this.x=t,this.width=i})}onHover(e){if(!this.enabled)return;const{mask:t,minHandle:i,maxHandle:s}=this,{offsetX:r,offsetY:n}=e;i.containsPoint(r,n)||s.containsPoint(r,n)?this.ctx.cursorManager.updateCursor("navigator","ew-resize"):t.computeVisibleRangeBBox().containsPoint(r,n)?this.ctx.cursorManager.updateCursor("navigator","grab"):this.ctx.cursorManager.updateCursor("navigator")}onDragStart(e){if(!this.enabled)return;const{mask:t,minHandle:i,maxHandle:s,x:r,width:n,_min:o}=this,{offsetX:a,offsetY:l}=e;i.zIndex<s.zIndex?s.containsPoint(a,l)?this.dragging="max":i.containsPoint(a,l)&&(this.dragging="min"):i.containsPoint(a,l)?this.dragging="min":s.containsPoint(a,l)&&(this.dragging="max"),null==this.dragging&&t.computeVisibleRangeBBox().containsPoint(a,l)&&(this.dragging="pan",this.panStart=(a-r)/n-o),null!=this.dragging&&this.ctx.zoomManager.fireZoomPanStartEvent("navigator")}onDrag(e){if(!this.enabled||null==this.dragging)return;const{dragging:t,minRange:i,panStart:s,x:r,width:n}=this;let{_min:o,_max:a}=this;const{offsetX:l}=e,c=(l-r)/n;if("min"===t)o=Hs(0,c,a-i);else if("max"===t)a=Hs(o+i,c,1);else if("pan"===t&&null!=s){const e=a-o;o=Hs(0,c-s,1-e),a=o+e}this._min=o,this._max=a,this.updateZoom()}onDragEnd(){this.dragging=void 0}onLeave(e){this.ctx.cursorManager.updateCursor("navigator")}onZoomChange(e){const{x:t}=e;t&&(this._min=t.min,this._max=t.max,this.updateNodes(t.min,t.max))}layoutNodes(e,t,i,s){const{rangeSelector:r,mask:n,minHandle:o,maxHandle:a,_min:l,_max:c}=this;r.layout(e,t,i,s,o.width/2,a.width/2),n.layout(e,t,i,s),Au.align(o,a,e,t,i,s,l,c),l+(c-l)/2<.5?(o.zIndex=3,a.zIndex=4):(o.zIndex=4,a.zIndex=3)}updateNodes(e,t){this.mask.update(e,t)}updateZoom(){if(!this.enabled)return;const{_min:e,_max:t}=this,i=this.ctx.zoomManager.getZoom();return null!=e&&null!=t?this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t},y:null==i?void 0:i.y},!1,e=>{null==this.min&&null==this.max||_.warnOnce(`Could not apply [navigator.min] or [navigator.max] as [${e}] has modified the initial zoom state.`)}):void 0}};S([Kr(Xr,{optional:!0})],Iu.prototype,"miniChart",2),S([Kr(Qr),Za(e=>e.updateGroupVisibility())],Iu.prototype,"enabled",2),S([Kr(rn)],Iu.prototype,"height",2),S([Kr(rn)],Iu.prototype,"margin",2),S([Xa({newValue(e){this._min=e,this.updateZoom()}}),Kr(Yr(nn,dn("max")),{optional:!0})],Iu.prototype,"min",2),S([Xa({newValue(e){this._max=e,this.updateZoom()}}),Kr(Yr(nn,un("min")),{optional:!0})],Iu.prototype,"max",2);var Ru={type:"root",optionsKey:"navigator",packageType:"community",chartTypes:["cartesian"],instanceConstructor:Iu,themeTemplate:{navigator:{enabled:!1,height:30,mask:{fill:"#999999",stroke:"#999999",strokeWidth:1,fillOpacity:.2},minHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8},maxHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8}}}},Pu=({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}},ku=e=>{const{fill:t,stroke:i}=Pu(e);return{marker:{fill:t,stroke:i}}};function Lu(e,t,i,s,r){const{addPhaseFn:n,updatePhaseFn:o,removePhaseFn:a}=r,l=(s,r,n)=>{i.animate({id:`${e}_${t}_${r.id}_${s}`,groupId:e,from:0,to:1,ease:vr,collapsable:!1,onUpdate(e,t){t&&"removed"!==s||(r.path.clear(!0),n(e,r),r.checkPathDirty())},onStop(){"added"===s&&(r.path.clear(!0),n(1,r),r.checkPathDirty())},phase:Ir[s]})};for(const e of s)i.isSkipped()||(l("removed",e,a),l("updated",e,o)),l("added",e,n)}var Nu=null;function _u(e){if(null!=e)return""===e?"":(null!=Nu||(Nu=xs("div")),Nu.textContent=String(e),Nu.innerHTML)}function Ou({id:e},t,i,...s){Pr(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Fu({id:e},t,i,...s){Pr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Gu(e){return{opacity:1}}var Bu=class extends vt{constructor(){super(...arguments),this._dirty=3}markDirty(e,t=1){this._dirty<t&&(this._dirty=t)}markClean(e){this._dirty=0}isDirty(){return this._dirty>0}},Vu=class extends Bu{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};S([Kr(Qr),sr({redraw:3})],Vu.prototype,"enabled",2),S([Kr(fn),sr({redraw:3})],Vu.prototype,"color",2),S([Kr(tn),sr({redraw:3})],Vu.prototype,"xOffset",2),S([Kr(tn),sr({redraw:3})],Vu.prototype,"yOffset",2),S([Kr(rn),sr({redraw:3})],Vu.prototype,"blur",2);var Hu=Vn(e=>Ld(e)||"function"==typeof yd&&Object.create(e.prototype)instanceof yd,"a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Uu=class extends Bu{constructor(){super(...arguments),this.enabled=!0,this.shape=vd,this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1}getStyle(){const{size:e,fill:t,fillOpacity:i,stroke:s,strokeWidth:r,strokeOpacity:n}=this;return{size:e,fill:t,fillOpacity:i,stroke:s,strokeWidth:r,strokeOpacity:n}}getDiameter(){return this.size+this.strokeWidth}};S([Kr(Qr),sr({redraw:3})],Uu.prototype,"enabled",2),S([Kr(Hu),sr({redraw:3})],Uu.prototype,"shape",2),S([Kr(rn),sr({redraw:3})],Uu.prototype,"size",2),S([Kr(fn,{optional:!0}),sr({redraw:3})],Uu.prototype,"fill",2),S([Kr(nn),sr({redraw:3})],Uu.prototype,"fillOpacity",2),S([Kr(fn,{optional:!0}),sr({redraw:3})],Uu.prototype,"stroke",2),S([Kr(rn),sr({redraw:3})],Uu.prototype,"strokeWidth",2),S([Kr(nn),sr({redraw:3})],Uu.prototype,"strokeOpacity",2),S([Kr(Jr,{optional:!0}),sr({redraw:3})],Uu.prototype,"formatter",2);var zu=class extends vt{constructor(){super(...arguments),this.enabled=!1}};S([Kr(Qr)],zu.prototype,"enabled",2);var Wu=class extends vt{constructor(){super(...arguments),this.enabled=!0,this.interaction=new zu,this.position=new nl}toTooltipHtml(e,t){return this.renderer?rl(this.renderer(t),e):rl(e)}};S([Kr(Qr)],Wu.prototype,"enabled",2),S([Kr(Qr,{optional:!0})],Wu.prototype,"showArrow",2),S([Kr(Jr,{optional:!0})],Wu.prototype,"renderer",2),S([Kr(Xr)],Wu.prototype,"interaction",2),S([Kr(Xr)],Wu.prototype,"position",2);var ju=class extends Wd{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.shadow=new Vu,this.marker=new Uu,this.label=new Vo,this.tooltip=new Wu,this.connectMissingData=!1}};function Ku({id:e},t,i,...s){Pr(e,"markers",t,s,{opacity:0},{opacity:1},{phase:i?Ir[i]:"trailing"}),s.forEach(e=>e.cleanup())}function $u({id:e},t,...i){Pr(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(e=>e.cleanup())}function Yu({id:e,nodeDataDependencies:t},i,...s){const r=t.seriesRectWidth;Rr(e,"markers",i,s,{fromFn:(e,t)=>{var i,s;const n=null!=(s=null==(i=t.midPoint)?void 0:i.x)?s:r;let o=Hs(0,xr(n/r),1);return isNaN(o)&&(o=0),{scalingX:0,scalingY:0,delay:o,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function qu(e){return{opacity:1,scalingX:1,scalingY:1}}function Xu(e,t){var i,s,r,n;return{translationX:null!=(s=null==(i=t.point)?void 0:i.x)?s:NaN,translationY:null!=(n=null==(r=t.point)?void 0:r.y)?n:NaN}}function Zu(e,t){const i=(t,i)=>{const s=e[i][t];return Array.isArray(s)?s[0]:s},s=t=>{const{xValue:s}=t;return e.moved[s]?{point:i(s,"moved"),status:"updated"}:e.removed[s]?{point:i(s,"removed"),status:"removed"}:e.added[s]?{point:i(s,"added"),status:"added"}:{status:"unknown"}};return{fromFn:(e,i)=>{var r,n,o,a,l,c;const{status:h,point:d}=s(i);if("unknown"===h)return{opacity:0};const u={translationX:null!=(n=null==(r=null==d?void 0:d.from)?void 0:r.x)?n:e.translationX,translationY:null!=(a=null==(o=null==d?void 0:d.from)?void 0:o.y)?a:e.translationY,opacity:e.opacity,phase:Ir[h]};return"added"===t?v(y({},u),{opacity:0,translationX:null==(l=null==d?void 0:d.to)?void 0:l.x,translationY:null==(c=null==d?void 0:d.to)?void 0:c.y,phase:Ir.added}):("added"===h&&(u.opacity=0),u)},toFn:(e,i)=>{var r,n;const{status:o,point:a}=s(i);if("unknown"===o)return{opacity:0};const l={translationX:i.point.x,translationY:i.point.y,opacity:1,phase:Ir[o]};return"removed"===o||"removed"===t?v(y({},l),{translationX:null==(r=null==a?void 0:a.to)?void 0:r.x,translationY:null==(n=null==a?void 0:a.to)?void 0:n.y,opacity:0,phase:Ir.removed}):l}}}function Qu(e,{datumIndex:t}){const i=e.getNodeData();if(void 0===i)return;const s=i[t];if(void 0===s||void 0===s.point)return;const r=e.getFormattedMarkerStyle(s).size,n=r/2,{x:o,y:a}=e.contentGroup.inverseTransformPoint(s.point.x-n,s.point.y-n);return new er(o,a,r,r)}function Ju(e){return e.reduce(({min:e,max:t},i)=>((null==e||e.point.x>i.point.x)&&(e=i),(null==t||t.point.x<i.point.x)&&(t=i),{min:e,max:t}),{})}function ep(e,t,i){const s=(t.y-e.y)/(t.x-e.x);return{x:i,y:(i-e.x)*s+e.y}}function tp(e,t,i,s){let r=-1,n=0;const o=[];for(;n<e.length;)e[n].change!==t?e[n].change!==i?(o.length>0&&(s(o,r,n),o.length=0),r=n,n++):n++:(o.push(e[n]),n++);o.length>0&&s(o,r,n)}function ip(e,t){tp(e,"out","in",(i,s,r)=>{var n,o;-1===s&&e[r]?i.forEach(t=>t.to=e[r].from):r===e.length&&e[s]?i.forEach(t=>t.to=e[s].from):"intersect"===t&&(null==(n=e[s])?void 0:n.from)&&(null==(o=e[r])?void 0:o.from)?i.forEach(t=>t.to=ep(e[s].from,e[r].from,t.from.x)):i.forEach(e=>e.to=e.from)}),tp(e,"in","out",(i,s,r)=>{var n,o;-1===s&&e[r]?i.forEach(t=>t.from=e[r].to):r===e.length&&e[s]?i.forEach(t=>t.from=e[s].to):"intersect"===t&&(null==(n=e[s])?void 0:n.to)&&(null==(o=e[r])?void 0:o.to)?i.forEach(t=>t.from=ep(e[s].to,e[r].to,t.to.x)):i.forEach(e=>e.from=e.to)})}function sp(e,t,i){const s=isNaN(e.x)?t.x:e.x,r=isNaN(e.y)?t.y:e.y,n=t.x-e.x,o=t.y-e.y;return{x:s+(isNaN(n)?0:n*i),y:r+(isNaN(o)?0:o*i)}}function rp(e,t,i){const{path:s}=i;let r;for(const i of e){const{from:e,to:n}=i,o=t[i.change];if(null==o||null==e||null==n)continue;const{x:a,y:l}=sp(e,n,o);if(!1===i.moveTo)s.lineTo(a,l);else if(!0!==i.moveTo&&r){if(r){const e="in"===i.moveTo?o:1-o,{x:t,y:n}=sp(r,{x:a,y:l},e);s.lineTo(t,n),s.moveTo(a,l)}}else s.moveTo(a,l);r={x:a,y:l}}}function np({id:e,visible:t,nodeDataDependencies:i},s,...r){const{seriesRectWidth:n,seriesRectHeight:o}=i;Pr(e,"path_properties",s,r,{clipX:0},{clipX:n},{phase:"initial",start:{clipMode:"normal",clipY:o,visible:t},finish:{clipMode:void 0,visible:t}})}function op({id:e},t,i,s="add",...r){Pr(e,t,i,r,{opacity:0},{opacity:1},{phase:s})}function ap({id:e},t,i,...s){Pr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function lp(e){return t=>({opacity:e.getOpacity(),clipScalingX:1,clipMode:void 0})}function cp({nodeDataDependencies:e},t){const i=e=>isFinite(e)?e:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}function hp(e){return"continuous"===e.type||"log"===e.type}function dp(e){return"category"===e.type}function up(e,t){return e.domain.length===t.domain.length&&e.range.length===t.range.length&&e.domain.every((e,i)=>e===t.domain[i])&&e.range.every((e,i)=>e===t.range[i])}function pp(e,t){return void 0===e||void 0===t?void 0!==e||void 0!==t:hp(e)&&hp(t)?e.type===t.type&&up(e,t):!(!dp(e)||!dp(t))&&up(e,t)}function gp(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),"continuous"===t.type&&"number"==typeof e)return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if("log"===t.type&&"number"==typeof e)return t.convert(e);const i=t.domain.findIndex(t=>t===e);return i>=0?t.range[i]:NaN}function mp(e,t){const i=Number(e),s=Number(t);return isNaN(i)||isNaN(s)?e===t:Math.abs(s-i)<.25}function fp(e=!1,t=!1){return e===t?Boolean(e):e?"in":"out"}function yp(e,t,i={}){var s,r,n,o;const{backfillSplitMode:a="intersect"}=i,l=t=>{var i,s;return{x:gp(null!=(i=t.xValue)?i:NaN,e.scales.x),y:gp(null!=(s=t.yValue)?s:NaN,e.scales.y)}},c=e=>{var i,s;return{x:gp(null!=(i=e.xValue)?i:NaN,t.scales.x),y:gp(null!=(s=e.yValue)?s:NaN,t.scales.y)}},h=[],d={added:{},moved:{},removed:{}},u=(e,t,i,s="move")=>{e&&(isNaN(e.point.x)||isNaN(e.point.y))&&(e=t);const r={from:null==e?void 0:e.point,to:null==t?void 0:t.point,moveTo:fp(null==e?void 0:e.point.moveTo,null==t?void 0:t.point.moveTo),change:s};"move"===s?(d.moved[i]=r,y++,v++):"in"===s?(d.added[i]=r,v++):"out"===s&&(d.removed[i]=r,y++),h.push(r)},{min:p,max:g}=Ju(t.nodeData),{min:m,max:f}=Ju(e.nodeData);let y=0,v=0;for(;y<t.nodeData.length||v<e.nodeData.length;){const i=t.nodeData[y],a=e.nodeData[v],h=i?l(i):void 0,d=a?c(a):void 0,C=void 0;if(h&&mp(h.x,null==a?void 0:a.point.x))u(i,a,a.xValue,"move");else if(h&&h.x<(null!=(s=null==m?void 0:m.point.x)?s:-1/0))u(i,C,i.xValue,"out");else if(h&&h.x>(null!=(r=null==f?void 0:f.point.x)?r:1/0))u(i,C,i.xValue,"out");else if(d&&d.x<(null!=(n=null==p?void 0:p.point.x)?n:-1/0))u(C,a,a.xValue,"in");else if(d&&d.x>(null!=(o=null==g?void 0:g.point.x)?o:1/0))u(C,a,a.xValue,"in");else if(h&&h.x<(null==a?void 0:a.point.x))u(i,C,i.xValue,"out");else if(d&&d.x<(null==i?void 0:i.point.x))u(C,a,a.xValue,"in");else if(i)u(i,C,i.xValue,"out");else{if(!a)throw new Error("Unable to process points");u(C,a,a.xValue,"in")}}return ip(h,a),{result:h,resultMap:d}}function vp(e,t,i,s={}){var r,n,o;const{backfillSplitMode:a="intersect",multiDatum:l=!1}=s,c=[],h={added:{},moved:{},removed:{}},d={added:{},moved:{},removed:{}},u={in:"added",move:"moved",out:"removed"};let p,g;const m=(e,t)=>{var i;const s=u[t.change];l?(null!=(i=d[s])[e]||(i[e]=[]),d[s][e].push(t)):h[s][e]=t,p=t,g=qo(e)};let f=0,v=0,C=!1;for(;f<t.nodeData.length||v<e.nodeData.length;){const s=t.nodeData[f],a=e.nodeData[v],h=qo(null==s?void 0:s.xValue),d=qo(null==a?void 0:a.xValue);let u;if(h===d)u={change:"move",moveTo:fp(null!=(r=s.point.moveTo)&&r,a.point.moveTo),from:s.point,to:a.point},m(null==s?void 0:s.xValue,u),f++,v++;else if(null==i?void 0:i.removed.has(String(h)))u={change:"out",moveTo:null!=(n=s.point.moveTo)&&n,from:s.point},m(null==s?void 0:s.xValue,u),f++;else if(null==i?void 0:i.added.has(String(d)))u={change:"in",moveTo:null!=(o=a.point.moveTo)&&o,to:a.point},m(null==a?void 0:a.xValue,u),v++;else if(l&&p&&g===h)u=y({},p),m(null==s?void 0:s.xValue,u),f++;else{if(!l||!p||g!==d){C=!0;break}u=y({},p),m(null==a?void 0:a.xValue,u),v++}c.push(u)}let b=-1/0;return C||(C=c.some(e=>{const{change:t,to:{x:i=-1/0}={}}=e;if("out"===t)return;const s=i<b;return b=i,s})),C?{result:void 0,resultMap:void 0}:(ip(c,a),{result:c,resultMap:l?d:h})}function Cp(e,t,i){var s,r,n,o;let a="updated";const l=e=>e.visible;if(!l(t)&&l(e))a="added";else if(l(t)&&!l(e))a="removed";else for(let e=0;e<i.length&&"move"===i[e].change&&(null==(s=i[e].from)?void 0:s.x)===(null==(r=i[e].to)?void 0:r.x)&&(null==(n=i[e].from)?void 0:n.y)===(null==(o=i[e].to)?void 0:o.y);e++)if(e===i.length-1)return"no-op";return a}function bp(e,t,i,s,r){const n=Cp(e,t,i),o=function(e,t){const i="none"===t?"updated":e,s={fromFn:t=>{let s;return s="removed"===e?{finish:{visible:!1}}:"added"===e?{start:{visible:!0}}:{},y({phase:Ir[i]},s)},toFn:e=>({phase:Ir[i]})};return"fade"===t?{fromFn:t=>{const i="added"===e?0:t.opacity;return y({opacity:i},s.fromFn(t))},toFn:t=>y({opacity:"removed"===e?0:1},s.toFn(t))}:s}(n,s);return{status:n,path:{addPhaseFn:(e,t)=>{r(i,{move:1,in:e},t)},updatePhaseFn:(e,t)=>{r(i,{move:e},t)},removePhaseFn:(e,t)=>{r(i,{move:0,out:e},t)}},pathProperties:o}}function Sp(e,t,i){var s,r,n;const o="category"===(null==(s=e.scales.x)?void 0:s.type);if(o!==("category"===(null==(r=t.scales.x)?void 0:r.type)))return;const{result:a,resultMap:l}=o?vp(e,t,i):yp(e,t);let c="updated";if(t.visible&&!e.visible?c="removed":!t.visible&&e.visible&&(c="added"),void 0===a||void 0===l)return;const h=null==(n=null==i?void 0:i.changed)||n||function(e,t){return!pp(e.scales.x,t.scales.x)||!pp(e.scales.y,t.scales.y)}(e,t)||"updated"!==c,d=bp(e,t,a,"fade",rp),u=Zu(l,c);return v(y({},d),{marker:u,hasMotion:h})}S([Kr(en)],ju.prototype,"xKey",2),S([Kr(en,{optional:!0})],ju.prototype,"xName",2),S([Kr(en)],ju.prototype,"yKey",2),S([Kr(en,{optional:!0})],ju.prototype,"yName",2),S([Kr(rn,{optional:!0})],ju.prototype,"normalizedTo",2),S([Kr(fn)],ju.prototype,"fill",2),S([Kr(nn)],ju.prototype,"fillOpacity",2),S([Kr(fn)],ju.prototype,"stroke",2),S([Kr(rn)],ju.prototype,"strokeWidth",2),S([Kr(nn)],ju.prototype,"strokeOpacity",2),S([Kr(Mn)],ju.prototype,"lineDash",2),S([Kr(rn)],ju.prototype,"lineDashOffset",2),S([Kr(Xr)],ju.prototype,"shadow",2),S([Kr(Xr)],ju.prototype,"marker",2),S([Kr(Xr)],ju.prototype,"label",2),S([Kr(Xr)],ju.prototype,"tooltip",2),S([Kr(Qr)],ju.prototype,"connectMissingData",2);var wp=(e=>(e[e.Fill=0]="Fill",e[e.Stroke=1]="Stroke",e[e.Marker=2]="Marker",e[e.Label=3]="Label",e))(wp||{});function xp(e){const{points:t,phantomPoints:i}=e.fillData;return{top:t,bottom:i}}function Ep(e,t,i){return{scales:t.scales,nodeData:i[e],visible:t.visible}}function Mp(e,t,i){var s,r;const n="category"===(null==(s=e.scales.x)?void 0:s.type);if(n!==("category"===(null==(r=t.scales.x)?void 0:r.type)))return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const{resultMap:a}=n?vp(e,t,i,{backfillSplitMode:"static",multiDatum:!0}):yp(e,t,{backfillSplitMode:"static"}),{top:l,bottom:c}=n?function(e,t,i){const s=xp(t),r=xp(e),n={multiDatum:!0};return{top:vp(Ep("top",e,r),Ep("top",t,s),i,n),bottom:vp(Ep("bottom",e,r),Ep("bottom",t,s),i,n)}}(e,t,i):function(e,t){const i=xp(t),s=xp(e);return{top:yp(Ep("top",e,s),Ep("top",t,i)),bottom:yp(Ep("bottom",e,s),Ep("bottom",t,i))}}(e,t);if(void 0===a||void 0===l.result||void 0===c.result)return;const h=bp(e,t,[...l.result,...c.result.reverse()],!!t.stackVisible&&e.stackVisible?"none":"fade",rp),d=Zu(a,o);return{status:h.status,fill:h,marker:d}}var Ap=class extends jd{constructor(e){super({moduleCtx:e,directionKeys:Hd,directionNames:Ud,pathsPerSeries:2,pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[1,0],animationResetFns:{path:lp({getOpacity:()=>this.getOpacity()}),label:Gu,marker:(e,t)=>y(y({},{opacity:1,scalingX:1,scalingY:1}),Xu(0,t))}}),this.properties=new ju}processData(e){return x(this,null,function*(){var t,i;if(null==this.data||!this.properties.isValid())return;const{data:s,visible:r,seriesGrouping:{groupIndex:n=this.id,stackCount:o=1}={}}=this,{xKey:a,yKey:l,connectMissingData:c,normalizedTo:h}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=null==(t=this.axes.x)?void 0:t.scale,p=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:g,xScaleType:m,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:p}),C=[`area-stack-${n}-yValues`,`area-stack-${n}-yValues-trailing`,`area-stack-${n}-yValues-prev`,`area-stack-${n}-yValues-trailing-prev`,`area-stack-${n}-yValues-marker`],b=[];ke(h)&&(b.push(Ih([C[0],C[1],C[4]],h,"range")),b.push(Ih([C[2],C[3]],h,"range"))),!g&&d&&this.processedData&&b.push(Oh(this.processedData)),d&&b.push(kh());const S={invalidValue:null};c&&o>1&&(S.invalidValue=0),r||(S.forceValue=0),yield this.requestDataModel(e,s,{props:[zh(a,m,{id:"xValue"}),Wh(l,f,y({id:"yValueRaw"},S)),...Yh(l,"window","current",v(y({id:"yValueEnd"},S),{groupId:C[0]}),f),...Yh(l,"window-trailing","current",v(y({id:"yValueStart"},S),{groupId:C[1]}),f),...Yh(l,"window","last",v(y({id:"yValuePreviousEnd"},S),{groupId:C[2]}),f),...Yh(l,"window-trailing","last",v(y({id:"yValuePreviousStart"},S),{groupId:C[3]}),f),...Yh(l,"normal","current",v(y({id:"yValueCumulative"},S),{groupId:C[4]}),f),...b],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")})}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i||0===t.data.length)return[];const r=s.x,n=s.y,o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t),l=i.getDomain(this,"yValueEnd","value",t);return"x"===e?"key"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?a:qc(ls(a),r):qc(n instanceof tu||n instanceof su?l:[l[0]>0?0:l[0],l[1]<0?0:l[1]],n)}createNodeData(){return x(this,null,function*(){var e;const{axes:t,data:i,processedData:{data:s}={},dataModel:r}=this,n=t.x,o=t.y;if(!(n&&o&&i&&r&&this.properties.isValid()))return;const{yKey:a,xKey:l,marker:c,label:h,fill:d,stroke:u,connectMissingData:p}=this.properties,{scale:g}=n,{scale:m}=o,{isContinuousY:f}=this.getScaleInformation({xScale:g,yScale:m}),C=(null!=(e=g.bandwidth)?e:0)/2,b=r.resolveProcessedDataDefsByIds(this,["yValueStart","yValueEnd","yValueRaw","yValuePreviousStart","yValuePreviousEnd","yValueCumulative"]),S=e=>v(y({},e),{point:v(y({},e.point),{moveTo:!0})}),w=(e,t,i)=>{const s=g.convert(e)+C,r=m.convert(t);return[{point:{x:s,y:m.convert(i)},yValue:i,xValue:e},{point:{x:s,y:r},yValue:t,xValue:e}]},x=(e,t,i)=>{let s;return(ke(this.properties.normalizedTo)?f&&$o(i):!isNaN(i))&&(s=t),{x:g.convert(e)+C,y:m.convert(s),size:c.size}},E=a,M=[],A=[],{visibleSameStackCount:T}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),D={itemId:E,fillData:{itemId:E,points:[],phantomPoints:[]},strokeData:{itemId:E,points:[]},labelData:M,nodeData:A,scales:this.calculateScaling(),visible:this.visible,stackVisible:T>0},I=D.fillData.points,R=D.fillData.phantomPoints,P=D.strokeData.points;let k,L=-1,N=-1/0;return null==s||s.forEach(e=>{const{keys:t,keys:[i],datum:s,values:n}=e;n.forEach((e,n)=>{var o,g,m;L++;const f=s[n],y=r.resolveProcessedDataDefsValues(b,{keys:t,values:e}),{yValueRaw:v,yValueCumulative:C}=y;let{yValueStart:T,yValueEnd:D,yValuePreviousStart:_,yValuePreviousEnd:O}=y;const F=null!=v,G=x(i,+C,v);if(F&&c&&A.push({index:L,series:this,itemId:E,datum:f,midPoint:{x:G.x,y:G.y},cumulativeValue:D,yValue:v,xValue:i,yKey:a,xKey:l,point:G,fill:null!=(o=c.fill)?o:d,stroke:null!=(g=c.stroke)?g:u,strokeWidth:null!=(m=c.strokeWidth)?m:this.getStrokeWidth(this.properties.strokeWidth)}),F&&h){const e=this.getLabelText(h,{value:v,datum:f,xKey:l,yKey:a,xName:this.properties.xName,yName:this.properties.yName},e=>We(e)?e.toFixed(2):String(e));M.push({index:L,series:this,itemId:a,datum:f,x:G.x,y:G.y,label:e?{text:e,fontStyle:h.fontStyle,fontWeight:h.fontWeight,fontSize:h.fontSize,fontFamily:h.fontFamily,textAlign:"center",textBaseline:"bottom",fill:h.color}:void 0})}const B=null!=k&&null!=i,V=null!=N&&F;V||(T=null!=T?T:0,D=null!=T?T:0,_=null!=_?_:0,O=null!=_?_:0);const[H,U]=w(k,_,O),[z,W]=w(i,T,D);!B||p&&!V||(I.push(H,z),R.push(U,W)),V&&L>0&&P.push(S(H),z),k=i,N=v})}),P.length>0&&(P[0]=S(P[0])),D})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:e}=this.properties.marker;return new(Nd(e))}updatePathNodes(e){return x(this,null,function*(){const{opacity:t,visible:i,animationEnabled:s}=e,[r,n]=e.paths,o=this.getStrokeWidth(this.properties.strokeWidth);n.setProperties({tag:1,fill:void 0,lineJoin:n.lineCap="round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:o,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i}),r.setProperties({tag:0,stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,opacity:t,visible:i||s,strokeWidth:o}),cp(this,n),cp(this,r)})}updatePaths(e){return x(this,null,function*(){this.updateAreaPaths(e.paths,e.contextData)})}updateAreaPaths(e,t){this.updateFillPath(e,t),this.updateStrokePath(e,t)}updateFillPath(e,t){const{fillData:i}=t,[s]=e,{path:r}=s;let n;r.clear(!0);for(const{point:e}of L(i.points,function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]}(i.phantomPoints)))e.moveTo?r.moveTo(e.x,e.y):(null==n?void 0:n.y)!==e.y&&(n&&r.lineTo(n.x,n.y),r.lineTo(e.x,e.y)),n=e;n&&r.lineTo(n.x,n.y),r.closePath(),s.checkPathDirty()}updateStrokePath(e,t){const{strokeData:i}=t,[,s]=e,{path:r}=s;r.clear(!0);for(const{point:e}of i.points)e.moveTo?r.moveTo(e.x,e.y):r.lineTo(e.x,e.y);s.checkPathDirty()}updateMarkerSelection(e){return x(this,null,function*(){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])})}updateMarkerNodes(e){return x(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,marker:n,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:d}=this.properties,u=Xe(i&&d.item,n.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h});t.each((e,t)=>{this.updateMarkerStyle(e,n,{datum:t,highlighted:i,xKey:s,yKey:r},u)}),i||this.properties.marker.markClean()})}updateLabelSelection(e){return x(this,null,function*(){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.tag=3})})}updateLabelNodes(e){return x(this,null,function*(){const{labelSelection:t}=e,{enabled:i,fontStyle:s,fontWeight:r,fontSize:n,fontFamily:o,color:a}=this.properties.label;t.each((e,t)=>{const{x:l,y:c,label:h}=t;h&&i&&this.visible?(e.fontStyle=s,e.fontWeight=r,e.fontSize=n,e.fontFamily=o,e.textAlign=h.textAlign,e.textBaseline=h.textBaseline,e.text=h.text,e.x=l,e.y=c-10,e.fill=a,e.visible=!0):e.visible=!1})})}getTooltipHtml(e){const{id:t,axes:i,dataModel:s}=this,{xKey:r,xName:n,yName:o,tooltip:a,marker:l}=this.properties,{yKey:c,xValue:h,yValue:d,datum:u,itemId:p}=e,g=i.x,m=i.y;if(!this.properties.isValid()||!(g&&m&&We(d))||!s)return il;const f=g.formatDatum(h),y=m.formatDatum(d),v=_u(o),C=_u(f+": "+y),b=Xe({fill:this.properties.fill},l.getStyle(),{stroke:this.properties.stroke,strokeWidth:this.properties.strokeWidth}),{fill:S}=this.getMarkerStyle(l,{datum:e,xKey:r,yKey:c,highlighted:!1},b);return a.toTooltipHtml({title:v,content:C,backgroundColor:S},{datum:u,itemId:p,xKey:r,xName:n,yKey:c,yName:o,color:S,title:v,seriesId:t})}getLegendData(e){var t,i,s,r;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||"category"!==e)return[];const{yKey:n,yName:o,fill:a,stroke:l,fillOpacity:c,strokeOpacity:h,strokeWidth:d,lineDash:u,marker:p,visible:g}=this.properties,m=!p.enabled||void 0===p.fill;return[{legendType:e,id:this.id,itemId:n,seriesId:this.id,enabled:g,label:{text:null!=o?o:n},marker:{shape:p.shape,fill:m?a:p.fill,fillOpacity:m?c:p.fillOpacity,stroke:null!=(i=p.stroke)?i:l,strokeOpacity:null!=(s=p.strokeOpacity)?s:h,strokeWidth:null!=(r=p.strokeWidth)?r:0,enabled:p.enabled||d<=0},line:{stroke:l,strokeOpacity:h,strokeWidth:d,lineDash:u}}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:r}=e,{animationManager:n}=this.ctx;this.updateAreaPaths(r,s),np(this,n,...r),fa([t],Xu),Yu(this,n,t),Ou(this,"labels",n,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){var t,i;const{animationManager:s}=this.ctx,{markerSelection:r,labelSelection:n,contextData:o,paths:a,previousContextData:l}=e,[c,h]=a;if(null==c&&null==h)return;super.resetAllAnimation(e);const d=()=>{this.updateAreaPaths(a,o),this.updateStrokePath(a,o)};if(null==o||null==l)return d(),Ku(this,s,"added",r),op(this,"fill_path_properties",s,"add",c),op(this,"stroke",s,"trailing",h),void Ou(this,"labels",s,n);const u=Mp(o,l,null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(Ku(this,s,void 0,r),Rr(this.id,"fill_path_properties",s,[c],u.fill.pathProperties),Lu(this.id,"fill_path_update",s,[c],u.fill.path),this.updateStrokePath(a,o),op(this,"stroke",s,"trailing",h),Ou(this,"labels",s,n))}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Eo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,highlighted:!0})}computeFocusBounds(e){return Qu(this,e)}};Ap.className="AreaSeries",Ap.type="area";var Tp={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",instanceConstructor:Ap,stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:Wt,nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5},marker:{__extends__:jt,enabled:!1,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:Kt,color:$t}}},paletteFactory:e=>{const{marker:t}=ku(e);return{fill:t.fill,stroke:t.stroke,marker:t}}};function*Dp(e){for(const t of e.children)yield t}function Ip(e,t){for(const i of t){const t=i.datum;void 0===t?_.error("undefined datum"):e.addValue(i,t)}}function Rp(e,t){const{x:i,y:s}=e.contentGroup.transformPoint(t.x,t.y),{nearest:r,distanceSquared:n}=e.getQuadTree().find(i,s);if(void 0!==r)return{datum:r.value,distance:Math.sqrt(n)}}var Pp=class extends Wd{constructor(){super(...arguments),this.direction="vertical"}};S([Kr(Ln)],Pp.prototype,"direction",2);var kp=class extends jd{constructor(){super(...arguments),this.groupScale=new Wr,this.smallestDataInterval=void 0}getBandScalePadding(){return{inner:.2,outer:.1}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}updateGroupScale(e){const{groupScale:t,smallestDataInterval:i,ctx:{seriesStateManager:s}}=this,r=e.scale,n=Xn.is(r)?r.calcBandwidth(i):r.bandwidth,o=[],{index:a,visibleGroupCount:l}=s.getVisiblePeerGroupIndex(this);for(let e=0;e<l;e++)o.push(String(e));return t.domain=o,t.range=[0,null!=n?n:0],e instanceof Dl?t.paddingInner=e.groupPaddingInner:t.padding=e instanceof Bl?.1:0,t.round=0!==t.padding,{barWidth:t.bandwidth>=1?t.bandwidth:t.rawBandwidth,groupIndex:a}}resolveKeyDirection(e){return"x"===this.getBarDirection()?"x"===e?"y":"x":e}initQuadTree(e){Ip(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Rp(this,e)}},Lp=class extends Vo{constructor(){super(...arguments),this.placement="inside"}};S([Kr(Nn)],Lp.prototype,"placement",2);var Np=class extends Pp{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new Vu,this.label=new Lp,this.tooltip=new Wu}};function _p({rect:e,config:t}){const{crisp:i=!0,fill:s,stroke:r,strokeWidth:n,fillOpacity:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,fillShadow:h,cornerRadius:d=0,topLeftCornerRadius:u=!0,topRightCornerRadius:p=!0,bottomRightCornerRadius:g=!0,bottomLeftCornerRadius:m=!0,visible:f=!0}=t;e.crisp=i,e.fill=s,e.stroke=r,e.strokeWidth=n,e.fillOpacity=o,e.strokeOpacity=a,e.lineDash=l,e.lineDashOffset=c,e.fillShadow=h,e.topLeftCornerRadius=u?d:0,e.topRightCornerRadius=p?d:0,e.bottomRightCornerRadius=g?d:0,e.bottomLeftCornerRadius=m?d:0,e.visible=f}function Op(e){var t,i,s,r,n,o,a=e,{datum:l,isHighlighted:c,style:h,highlightStyle:d,formatter:u,seriesId:p,ctx:{callbackCache:g}}=a,m=C(a,["datum","isHighlighted","style","highlightStyle","formatter","seriesId","ctx"]);const{fill:f,fillOpacity:v,stroke:b,strokeWidth:S}=Xe(c&&d,h),{strokeOpacity:w,fillShadow:x,lineDash:E,lineDashOffset:M,cornerRadius:A=0,topLeftCornerRadius:T=!0,topRightCornerRadius:D=!0,bottomRightCornerRadius:I=!0,bottomLeftCornerRadius:R=!0}=h;let P;return u&&(P=g.call(u,y({datum:l.datum,xKey:l.xKey,fill:f,stroke:b,strokeWidth:S,cornerRadius:A,highlighted:c,seriesId:p},m))),{fill:null!=(t=null==P?void 0:P.fill)?t:f,stroke:null!=(i=null==P?void 0:P.stroke)?i:b,strokeWidth:null!=(s=null==P?void 0:P.strokeWidth)?s:S,fillOpacity:null!=(r=null==P?void 0:P.fillOpacity)?r:v,strokeOpacity:null!=(n=null==P?void 0:P.strokeOpacity)?n:w,lineDash:E,lineDashOffset:M,fillShadow:x,cornerRadius:null!=(o=null==P?void 0:P.cornerRadius)?o:A,topLeftCornerRadius:T,topRightCornerRadius:D,bottomRightCornerRadius:I,bottomLeftCornerRadius:R}}function Fp(e=[]){const[t,i]=e;return!(0!==t||1!==i)}S([Kr(en)],Np.prototype,"xKey",2),S([Kr(en,{optional:!0})],Np.prototype,"xName",2),S([Kr(en)],Np.prototype,"yKey",2),S([Kr(en,{optional:!0})],Np.prototype,"yName",2),S([Kr(en,{optional:!0})],Np.prototype,"stackGroup",2),S([Kr(tn,{optional:!0})],Np.prototype,"normalizedTo",2),S([Kr(fn)],Np.prototype,"fill",2),S([Kr(nn)],Np.prototype,"fillOpacity",2),S([Kr(fn)],Np.prototype,"stroke",2),S([Kr(rn)],Np.prototype,"strokeWidth",2),S([Kr(nn)],Np.prototype,"strokeOpacity",2),S([Kr(Mn)],Np.prototype,"lineDash",2),S([Kr(rn)],Np.prototype,"lineDashOffset",2),S([Kr(rn)],Np.prototype,"cornerRadius",2),S([Kr(Jr,{optional:!0})],Np.prototype,"formatter",2),S([Kr(Xr,{optional:!0})],Np.prototype,"shadow",2),S([Kr(Xr)],Np.prototype,"label",2),S([Kr(Xr)],Np.prototype,"tooltip",2);var Gp=e=>{var t;return Ks(null!=(t=e.yValue)?t:0)};function Bp(e,t,i){const{startingX:s,startingY:r}=function(e,t){const i=t[e?"y":"x"];let s=1/0,r=0;return i?(e?r=i.scale.convert(Xn.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Xn.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:r}):{startingX:s,startingY:r}}(e,t);return{isVertical:e,calculate:(t,i)=>{let n=e?t.x:s,o=e?r:t.y,a=e?t.width:0,l=e?0:t.height;const{opacity:c}=t;let h;return i&&(isNaN(n)||isNaN(o))&&(({x:n,y:o}=i),a=e?i.width:0,l=e?0:i.height,e&&!Gp(i)?o+=i.height:!e&&Gp(i)&&(n+=i.width)),h=null==t.clipBBox?void 0:Gp(t)?e?new er(n,o-l,a,l):new er(n-a,o,a,l):new er(n,o,a,l),{x:n,y:o,width:a,height:l,clipBBox:h,opacity:c}},mode:i}}function Vp(e,t){return{isVertical:e,calculate:t=>({x:e?t.x:t.x+t.width/2,y:e?t.y+t.height/2:t.y,width:e?t.width:0,height:e?0:t.height,clipBBox:t.clipBBox,opacity:t.opacity}),mode:t}}function Hp(e){const t=e=>null==e||isNaN(e.x)||isNaN(e.y);return{toFn:(i,s,r)=>{let n;return n="removed"===r&&null==i.datum&&"fade"===e.mode?v(y({},Up(0,s)),{opacity:0}):"removed"===r||t(s)?e.calculate(s,i.previousDatum):{x:s.x,y:s.y,width:s.width,height:s.height,clipBBox:s.clipBBox,opacity:s.opacity},n},fromFn:(i,s,r)=>{let n;"updated"===r&&t(s)?r="removed":"updated"===r&&t(i.previousDatum)&&(r="added"),n="added"===r&&null==i.previousDatum&&"fade"===e.mode?v(y({},Up(0,s)),{opacity:0}):"unknown"===r||"added"===r?e.calculate(s,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity};const o=Ir[r];return v(y({},n),{phase:o})}}}function Up(e,{x:t,y:i,width:s,height:r,clipBBox:n,opacity:o}){return{x:t,y:i,width:s,height:r,clipBBox:n,opacity:o}}function zp(e,t,i){if(void 0===e)return;const{x:s,y:r,width:n,height:o}=e;return t.inverseTransformBBox(new er(s,r,n,o)).clip(i)}function Wp(e,t,i){if(t.enabled&&i){const{x:s,y:r,text:n,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u}=t;e.setProperties({visible:!0,x:s,y:r,text:n,fill:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:o,textBaseline:a})}else e.visible=!1}function jp({isPositive:e,isVertical:t,placement:i,padding:s=0,rect:r}){let n=r.x+r.width/2,o=r.y+r.height/2,a="center",l="middle";switch(i){case"start":t?(o=e?r.y+r.height+s:r.y-s,l=e?"top":"bottom"):(n=e?r.x-s:r.x+r.width+s,a=e?"start":"end");break;case"outside":case"end":t?(o=e?r.y-s:r.y+r.height+s,l=e?"bottom":"top"):(n=e?r.x+r.width+s:r.x-s,a=e?"start":"end")}return{x:n,y:o,textAlign:a,textBaseline:l}}var Kp=class extends kp{constructor(e){super({moduleCtx:e,directionKeys:Hd,directionNames:Ud,pickModes:[0],pathsPerSeries:0,hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Up,label:Gu}}),this.properties=new Np}processData(e){return x(this,null,function*(){var t,i,s;if(!this.properties.isValid()||!this.data)return;const{seriesGrouping:{groupIndex:r=this.id}={},data:n=[]}=this,{xKey:o,yKey:a,normalizedTo:l}=this.properties,c=!this.ctx.animationManager.isSkipped(),h=null==(t=this.getCategoryAxis())?void 0:t.scale,d=null==(i=this.getValueAxis())?void 0:i.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:d}),m=`bar-stack-${r}-yValues`,f=`${m}-trailing`,v=[];We(l)&&v.push(Ih([m,f],Math.abs(l),"range")),c&&this.processedData&&v.push(Oh(this.processedData)),c&&v.push(kh());const C=this.visible?{}:{forceValue:0},{processedData:b}=yield this.requestDataModel(e,n,{props:[zh(o,p,{id:"xValue"}),Wh(a,g,y({id:"yValue-raw",invalidValue:null},C)),...Yh(a,"normal","current",y({id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:m,separateNegative:!0},C),g),...Yh(a,"trailing","current",y({id:"yValue-start",invalidValue:null,missingValue:0,groupId:f,separateNegative:!0},C),g),...u?[Ah]:[],...v],groupByKeys:!0,groupByData:!1});this.smallestDataInterval=null==(s=b.reduced)?void 0:s.smallestKeyInterval,this.animationState.transition("updateData")})}getSeriesDomain(e){var t;const{processedData:i,dataModel:s,smallestDataInterval:r}=this;if(!i||!s||0===i.data.length)return[];const n=this.getCategoryAxis(),o=this.getValueAxis(),a=s.resolveProcessedDataDefById(this,"xValue"),l=s.getDomain(this,"xValue","key",i),c=s.getDomain(this,"yValue-end","value",i);if(e===this.getCategoryDirection()){if("key"===(null==a?void 0:a.def.type)&&"category"===a.def.valueType)return l;const e=We(r)?.5*r:0,i=null!=(t=ls(l))?t:[NaN,NaN];return qc([i[0]+-e,i[1]+e],n)}return this.getValueAxis()instanceof tu?qc(c,o):qc([Math.min(0,c[0]),Math.max(0,c[1])],o)}createNodeData(){return x(this,null,function*(){const{dataModel:e}=this,t=this.getCategoryAxis(),i=this.getValueAxis();if(!(e&&t&&i&&this.properties.isValid()))return;const s=t.scale,r=i.scale,{xKey:n,yKey:o,xName:a,yName:l,fill:c,stroke:h,strokeWidth:d,cornerRadius:u,legendItemName:p,label:g}=this.properties,m=i.isReversed(),{barWidth:f,groupIndex:v}=this.updateGroupScale(t),C=Xn.is(s)?-.5*f:0,b=e.resolveProcessedDataIndexById(this,"xValue"),S=e.resolveProcessedDataIndexById(this,"yValue-raw"),w=e.resolveProcessedDataIndexById(this,"yValue-start"),x=e.resolveProcessedDataIndexById(this,"yValue-end"),E=e.resolveProcessedDataIndexById(this,"yValue-range"),M=!this.ctx.animationManager.isSkipped(),A={itemId:o,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible||M},{groupScale:T,processedData:D}=this;return null==D||D.data.forEach(({keys:e,datum:t,values:i,aggValues:M})=>{i.forEach((i,D)=>{var I;const R=e[b],P=s.convert(R),k=+i[x],L=+i[w],N=i[S],_=N>=0&&!Object.is(N,-0),O=_!==m,F=null!=(I=null==M?void 0:M[E][_?1:0])?I:0,G=P+T.convert(String(v))+C;if(isNaN(k))return;const B=r.convert(k),V=r.convert(L),H="x"===this.getBarDirection(),U=r.convert(F),z=r.convert(0),W={x:H?Math.min(B,V):G,y:H?G:Math.min(B,V),width:H?Math.abs(V-B):f,height:H?f:Math.abs(V-B)},j=new er(W.x,W.y,W.width,W.height),K={x:H?Math.min(z,U):G,y:H?G:Math.min(z,U),width:H?Math.abs(z-U):f,height:H?f:Math.abs(z-U),clipBBox:j},{fontStyle:$,fontWeight:Y,fontSize:q,fontFamily:X,color:Z,placement:Q}=g,J=this.getLabelText(this.properties.label,{datum:t[D],value:N,xKey:n,yKey:o,xName:a,yName:l,legendItemName:p},e=>We(e)?e.toFixed(2):String(e)),ee=J?y({text:J,fill:Z,fontStyle:$,fontWeight:Y,fontSize:q,fontFamily:X},jp({isPositive:_,isVertical:!H,placement:Q,rect:W})):void 0,te=this.shouldFlipXY()?W.height:W.width,ie={series:this,itemId:o,datum:t[D],valueIndex:D,cumulativeValue:k,xValue:R,yValue:N,yKey:o,xKey:n,capDefaults:{lengthRatioMultiplier:te,lengthMax:te},x:K.x,y:K.y,width:K.width,height:K.height,midPoint:{x:W.x+W.width/2,y:W.y+W.height/2},fill:c,stroke:h,opacity:1,strokeWidth:d,cornerRadius:u,topLeftCornerRadius:H!==O,topRightCornerRadius:O,bottomRightCornerRadius:H===O,bottomLeftCornerRadius:!O,clipBBox:j,label:ee,missing:null==N};A.nodeData.push(ie),A.labelData.push(ie)})}),A})}nodeFactory(){return new lu}updateDatumSelection(e){return x(this,null,function*(){return e.datumSelection.update(e.nodeData,e=>{e.tag=0},e=>Fh(e.xValue,e.valueIndex))})}updateDatumNodes(e){return x(this,null,function*(){if(!this.properties.isValid())return;const{yKey:t,stackGroup:i,fill:s,fillOpacity:r,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,formatter:h,shadow:d,highlightStyle:{item:u}}=this.properties,p=this.axes.x,g=Fp(null==p?void 0:p.visibleRange),m="x"===this.getCategoryDirection();e.datumSelection.each((p,f)=>{var y,v,C,b;const S={fill:s,stroke:n,fillOpacity:r,strokeOpacity:a,lineDash:l,lineDashOffset:c,fillShadow:d,strokeWidth:this.getStrokeWidth(o),cornerRadius:f.cornerRadius,topLeftCornerRadius:f.topLeftCornerRadius,topRightCornerRadius:f.topRightCornerRadius,bottomRightCornerRadius:f.bottomRightCornerRadius,bottomLeftCornerRadius:f.bottomLeftCornerRadius},w=m?(null!=(v=null==(y=f.clipBBox)?void 0:y.width)?v:f.width)>0:(null!=(b=null==(C=f.clipBBox)?void 0:C.height)?b:f.height)>0,x=Op({datum:f,ctx:this.ctx,seriesId:this.id,isHighlighted:e.isHighlight,highlightStyle:u,yKey:t,style:S,formatter:h,stackGroup:i});x.crisp=g,x.visible=w,_p({rect:p,config:x})})})}updateLabelSelection(e){return x(this,null,function*(){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,e=>{e.tag=1,e.pointerEvents=1})})}updateLabelNodes(e){return x(this,null,function*(){e.labelSelection.each((e,t)=>{Wp(e,this.properties.label,t.label)})})}getTooltipHtml(e){var t;const{id:i,processedData:s,ctx:{callbackCache:r}}=this,n=this.getCategoryAxis(),o=this.getValueAxis();if(!(s&&this.properties.isValid()&&n&&o))return il;const{xKey:a,yKey:l,xName:c,yName:h,fill:d,stroke:u,strokeWidth:p,tooltip:g,formatter:m,stackGroup:f,legendItemName:v}=this.properties,{xValue:C,yValue:b,datum:S,itemId:w}=e,x=n.formatDatum(C),E=o.formatDatum(b),M=_u(h),A=_u(x+": "+E);let T;m&&(T=r.call(m,{seriesId:i,datum:S,xKey:a,yKey:l,stackGroup:f,fill:d,stroke:u,strokeWidth:this.getStrokeWidth(p),highlighted:!1}));const D=null!=(t=null==T?void 0:T.fill)?t:d;return g.toTooltipHtml({title:M,content:A,backgroundColor:D},y({seriesId:i,itemId:w,datum:S,xKey:a,yKey:l,xName:c,yName:h,stackGroup:f,title:M,color:D,legendItemName:v},this.getModuleTooltipParams()))}getLegendData(e){var t,i;const{showInLegend:s}=this.properties;if("category"!==e||!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||!s)return[];const{yKey:r,yName:n,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,legendItemName:d,visible:u}=this.properties;return[{legendType:"category",id:this.id,itemId:r,seriesId:this.id,enabled:u,label:{text:null!=(i=null!=d?d:n)?i:r},marker:{fill:o,fillOpacity:c,stroke:a,strokeWidth:l,strokeOpacity:h},legendItemName:d}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const s=Hp(Bp(this.isVertical(),this.axes,"normal"));Rr(this.id,"nodes",this.ctx.animationManager,[e],s),Ou(this,"labels",this.ctx.animationManager,t),Ou(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){var t,i,s;const{datumSelection:r,labelSelection:n,annotationSelections:o,previousContextData:a}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff,c=null==a?"fade":"normal",h=Hp(Bp(this.isVertical(),this.axes,c));Rr(this.id,"nodes",this.ctx.animationManager,[r],h,(e,t)=>Fh(t.xValue,t.valueIndex),l),(null==(s=null==l?void 0:l.changed)||s)&&(Ou(this,"labels",this.ctx.animationManager,n),Ou(this,"annotations",this.ctx.animationManager,...o))}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e,seriesRect:t}){var i;return zp(null==(i=this.contextNodeData)?void 0:i.nodeData[e].clipBBox,this.contentGroup,t)}};Kp.className="BarSeries",Kp.type="bar";var $p={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",instanceConstructor:Kp,stackable:!0,groupable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],swapDefaultAxesCondition:e=>"horizontal"===(null==e?void 0:e.direction),themeTemplate:{series:{__extends__:Wt,direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:"normal",fontSize:12,fontFamily:Kt,color:qt,placement:"inside"},shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Pu},Yp=e=>{const t=pr.fromString(e),[i,s,r]=pr.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:r,a:t.a}},qp=class{constructor(){this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Yp)}update(){const{domain:e,range:t}=this;e.length<2&&(_.warnOnce("`colorDomain` should have at least 2 values."),0===e.length?e.push(0,1):1===e.length&&e.push(e[0]+1));for(let t=1;t<e.length;t++)if(e[t-1]>=e[t]){_.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((e,t)=>e-t);break}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(Yp)}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,r=t[0],n=t.at(-1),o=i[0],a=i[i.length-1];if(e<=r)return o;if(e>=n)return a;let l,c;if(2===t.length){const t=(e-r)/(n-r),s=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(t*(i.length-1)),i.length-2),c=(t-l*s)/s}else{for(l=0;l<t.length-2&&!(e<t[l+1]);l++);const i=t[l];c=(e-i)/(t[l+1]-i)}return((e,t,i)=>{let s,r;if(i=Hs(0,i,1),Number.isNaN(e.h)&&Number.isNaN(t.h))s=0,r=0;else if(Number.isNaN(e.h))s=t.h,r=t.c;else if(Number.isNaN(t.h))s=e.h,r=e.c;else{const n=e.h;let o=t.h;const a=t.h-e.h;a>180?o-=360:a<-180&&(o+=360),s=n*(1-i)+o*i,r=e.c*(1-i)+t.c*i}const n=e.l*(1-i)+t.l*i,o=e.a*(1-i)+t.a*i;return pr.fromOKLCH(n,r,s,o)})(s[l],s[l+1],c).toRgbaString()}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&_.warnOnce("Expected update to not invalidate scale"))}};S([Ur],qp.prototype,"domain",2),S([Ur],qp.prototype,"range",2);var Xp=class extends Uu{constructor(){super(...arguments),this.maxSize=30}};S([Kr(rn),sr({redraw:3})],Xp.prototype,"maxSize",2),S([Kr(Cn,{optional:!0}),sr({redraw:3})],Xp.prototype,"domain",2);var Zp=class extends Vo{constructor(){super(...arguments),this.placement="top"}};S([Kr(On)],Zp.prototype,"placement",2);var Qp=class extends Wd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new Xp,this.label=new Zp,this.tooltip=new Wu}};S([Kr(en)],Qp.prototype,"xKey",2),S([Kr(en)],Qp.prototype,"yKey",2),S([Kr(en)],Qp.prototype,"sizeKey",2),S([Kr(en,{optional:!0})],Qp.prototype,"labelKey",2),S([Kr(en,{optional:!0})],Qp.prototype,"colorKey",2),S([Kr(en,{optional:!0})],Qp.prototype,"xName",2),S([Kr(en,{optional:!0})],Qp.prototype,"yName",2),S([Kr(en,{optional:!0})],Qp.prototype,"sizeName",2),S([Kr(en,{optional:!0})],Qp.prototype,"labelName",2),S([Kr(en,{optional:!0})],Qp.prototype,"colorName",2),S([Kr(Cn,{optional:!0})],Qp.prototype,"colorDomain",2),S([Kr(yn)],Qp.prototype,"colorRange",2),S([Kr(en,{optional:!0})],Qp.prototype,"title",2),S([Kr(Xr)],Qp.prototype,"marker",2),S([Kr(Xr)],Qp.prototype,"label",2),S([Kr(Xr)],Qp.prototype,"tooltip",2);var Jp=class extends zd{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},eg=class extends jd{constructor(e){super({moduleCtx:e,directionKeys:Hd,directionNames:Ud,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Gu,marker:qu}}),this.NodeEvent=Jp,this.properties=new Qp,this.sizeScale=new Zd,this.colorScale=new qp}processData(e){return x(this,null,function*(){var t,i,s,r;if(!this.properties.isValid()||null==this.data||!this.visible)return;const n=null==(t=this.axes.x)?void 0:t.scale,o=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({xScale:n,yScale:o}),c=this.colorScale.type,h=this.sizeScale.type,{xKey:d,yKey:u,sizeKey:p,labelKey:g,colorDomain:m,colorRange:f,colorKey:y,marker:v}=this.properties,{dataModel:C,processedData:b}=yield this.requestDataModel(e,this.data,{props:[zh(d,a,{id:"xKey-raw"}),zh(u,l,{id:"yKey-raw"}),...g?[zh(g,"band",{id:"labelKey-raw"})]:[],Wh(d,a,{id:"xValue"}),Wh(u,l,{id:"yValue"}),Wh(p,h,{id:"sizeValue"}),...y?[Wh(y,c,{id:"colorValue"})]:[],...g?[Wh(g,"band",{id:"labelValue"})]:[]]}),S=C.resolveProcessedDataIndexById(this,"sizeValue"),w=null!=(s=b.domain.values[S])?s:[];if(this.sizeScale.domain=v.domain?v.domain:w,y){const e=C.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(r=null!=m?m:b.domain.values[e])?r:[],this.colorScale.range=f,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s="x"===e?"xValue":"yValue",r=t.resolveProcessedDataDefById(this,s),n=t.getDomain(this,s,"value",i);if("value"===(null==r?void 0:r.def.type)&&"category"===(null==r?void 0:r.def.valueType))return n;const o=this.axes[e];return qc(ls(n),o)}createNodeData(){return x(this,null,function*(){var e,t,i;const{axes:s,dataModel:r,processedData:n,colorScale:o,sizeScale:a}=this,{xKey:l,yKey:c,sizeKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:m,label:f,colorKey:v,marker:C,visible:b}=this.properties,S=Nd(C.shape),{placement:w}=f,x=s.x,E=s.y;if(!(r&&n&&b&&x&&E))return;const M=r.resolveProcessedDataIndexById(this,"xValue"),A=r.resolveProcessedDataIndexById(this,"yValue"),T=h?r.resolveProcessedDataIndexById(this,"sizeValue"):-1,D=v?r.resolveProcessedDataIndexById(this,"colorValue"):-1,I=d?r.resolveProcessedDataIndexById(this,"labelValue"):-1,R=x.scale,P=E.scale,k=(null!=(e=R.bandwidth)?e:0)/2,L=(null!=(t=P.bandwidth)?t:0)/2,N=[];a.range=[C.size,C.maxSize];const _=f.getFont();for(const{values:e,datum:t}of null!=(i=n.data)?i:[]){const i=e[M],s=e[A],r=R.convert(i)+k,n=P.convert(s)+L,b=this.getLabelText(f,{value:d?e[I]:s,datum:t,xKey:l,yKey:c,sizeKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:m}),x=Fo.getTextSize(String(b),_),E=h?a.convert(e[T]):C.size,O=v?o.convert(e[D]):void 0;N.push({series:this,itemId:c,yKey:c,xKey:l,datum:t,xValue:i,yValue:s,sizeValue:e[T],point:{x:r,y:n,size:E},midPoint:{x:r,y:n},fill:O,label:y({text:b},x),marker:S,placement:w})}return{itemId:c,nodeData:N,labelData:N,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var e,t;return null!=(t=null==(e=this.contextNodeData)?void 0:e.labelData)?t:[]}markerFactory(){const{shape:e}=this.properties.marker;return new(Nd(e))}updateMarkerSelection(e){return x(this,null,function*(){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?t:[];return i.update(s,void 0,e=>Fh([e.xValue,e.yValue,e.label.text]))})}updateMarkerNodes(e){return x(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,sizeKey:n,labelKey:o,marker:a}=this.properties,l=Xe(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize],t.each((e,t)=>{this.updateMarkerStyle(e,a,{datum:t,highlighted:i,xKey:s,yKey:r,sizeKey:n,labelKey:o},l)}),i||this.properties.marker.markClean()})}updateLabelSelection(e){return x(this,null,function*(){var t,i;const s=this.properties.label.enabled&&null!=(i=null==(t=this.chart)?void 0:t.placeLabels().get(this))?i:[];return e.labelSelection.update(s.map(e=>v(y({},e.datum),{point:{x:e.x,y:e.y,size:e.datum.point.size}})))})}updateLabelNodes(e){return x(this,null,function*(){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{var s,r,n,o;e.text=i.label.text,e.fill=t.color,e.x=null!=(r=null==(s=i.point)?void 0:s.x)?r:0,e.y=null!=(o=null==(n=i.point)?void 0:n.y)?o:0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})})}getTooltipHtml(e){var t;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return il;const{xKey:r,yKey:n,sizeKey:o,labelKey:a,xName:l,yName:c,sizeName:h,labelName:d,marker:u,tooltip:p}=this.properties,g=null!=(t=this.properties.title)?t:c,m=Xe({fill:e.fill,strokeWidth:this.getStrokeWidth(u.strokeWidth)},u.getStyle()),{fill:f="gray"}=this.getMarkerStyle(u,{datum:e,highlighted:!1,xKey:r,yKey:n,sizeKey:o,labelKey:a},m),{datum:y,xValue:v,yValue:C,sizeValue:b,label:{text:S},itemId:w}=e,x=_u(i.formatDatum(v)),E=_u(s.formatDatum(C));let M=`<b>${_u(null!=l?l:r)}</b>: ${x}<br><b>${_u(null!=c?c:n)}</b>: ${E}`;return o&&(M+=`<br><b>${_u(null!=h?h:o)}</b>: ${_u(String(b))}`),a&&(M=`<b>${_u(null!=d?d:a)}</b>: ${_u(S)}<br>`+M),p.toTooltipHtml({title:g,content:M,backgroundColor:f},{datum:y,itemId:w,xKey:r,xName:l,yKey:n,yName:c,sizeKey:o,sizeName:h,labelKey:a,labelName:d,title:g,color:f,seriesId:this.id})}getLegendData(){var e,t;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid())return[];const{yKey:i,yName:s,title:r,marker:n,visible:o}=this.properties,{shape:a,fill:l,stroke:c,fillOpacity:h,strokeOpacity:d,strokeWidth:u}=n;return[{legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:o,label:{text:null!=(t=null!=r?r:s)?t:i},marker:{shape:a,fill:null!=l?l:"rgba(0, 0, 0, 0)",stroke:null!=c?c:"rgba(0, 0, 0, 0)",fillOpacity:null!=h?h:1,strokeOpacity:null!=d?d:1,strokeWidth:null!=u?u:0}}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){$u(this,this.ctx.animationManager,e),Ou(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Eo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:r}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,sizeKey:s,labelKey:r,highlighted:!1})}computeFocusBounds(e){return Qu(this,e)}};eg.className="BubbleSeries",eg.type="bubble";var tg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",instanceConstructor:eg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:Wt,tooltip:{position:{type:"node"}},marker:{__extends__:jt,maxSize:30,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:Kt,color:$t}}},paletteFactory:ku},ig=class extends Wd{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Vu,this.label=new Vo,this.tooltip=new Wu}};S([Kr(en)],ig.prototype,"xKey",2),S([Kr(en,{optional:!0})],ig.prototype,"yKey",2),S([Kr(en,{optional:!0})],ig.prototype,"xName",2),S([Kr(en,{optional:!0})],ig.prototype,"yName",2),S([Kr(fn,{optional:!0})],ig.prototype,"fill",2),S([Kr(nn)],ig.prototype,"fillOpacity",2),S([Kr(fn,{optional:!0})],ig.prototype,"stroke",2),S([Kr(rn)],ig.prototype,"strokeWidth",2),S([Kr(nn)],ig.prototype,"strokeOpacity",2),S([Kr(Mn)],ig.prototype,"lineDash",2),S([Kr(rn)],ig.prototype,"lineDashOffset",2),S([Kr(rn)],ig.prototype,"cornerRadius",2),S([Kr(Qr)],ig.prototype,"areaPlot",2),S([Kr(ln,{optional:!0})],ig.prototype,"bins",2),S([Kr(Fn(["count","sum","mean"],"a histogram aggregation"))],ig.prototype,"aggregation",2),S([Kr(rn,{optional:!0})],ig.prototype,"binCount",2),S([Kr(Xr)],ig.prototype,"shadow",2),S([Kr(Xr)],ig.prototype,"label",2),S([Kr(Xr)],ig.prototype,"tooltip",2);var sg=class extends jd{constructor(e){super({moduleCtx:e,directionKeys:Hd,directionNames:Ud,pickModes:[0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Up,label:Gu}}),this.properties=new ig,this.calculatedBins=[]}deriveBins(e){const t=ho(e[0],e[1],10),i=po(e[0],e[1],10),[s]=t;return[[s-i,s],...t.map(e=>[e,e+i])]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],r=t||1,{start:n,binSize:o}=this.calculateNiceStart(i,s,r);return this.getBins(n,s,o,r)}getBins(e,t,i,s){const r=[],n=this.calculatePrecision(i);for(let o=0;o<s;o++){const a=Math.round((e+o*i)*n)/n;let l=Math.round((e+(o+1)*i)*n)/n;o===s-1&&(l=Math.max(l,t)),r[o]=[a,l]}return r}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,r=Math.floor(Math.log10(s)),n=Math.pow(10,r);return{start:Math.floor(e/n)*n,binSize:s}}processData(e){return x(this,null,function*(){var t,i;this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:s,yKey:r,areaPlot:n,aggregation:o}=this.properties,a=null==(t=this.axes.x)?void 0:t.scale,l=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({yScale:l,xScale:a}),d=[zh(s,c),Th];if(r){let e=Sh("groupAgg");"count"===o||("sum"===o?e=Ch("groupAgg"):"mean"===o&&(e=wh("groupAgg"))),n&&(e=xh("groupAgg",e)),d.push(Wh(r,h,{invalidValue:void 0}),e)}else{let e=Sh("groupAgg");n&&(e=xh("groupAgg",e)),d.push(e)}!this.ctx.animationManager.isSkipped()&&this.processedData&&d.push(Oh(this.processedData,!1)),yield this.requestDataModel(e,this.data,{props:d,groupByFn:e=>{var t;const i=qc(e.domain.keys[0]);if(0===i.length)return e.domain.groups=[],()=>[];const s=ze(this.properties.binCount)?this.calculateNiceBins(i,this.properties.binCount):null!=(t=this.properties.bins)?t:this.deriveBins(i),r=s.length;return this.calculatedBins=[...s],e=>{const t=e.keys[0];for(let e=0;e<r;e++){const i=s[e];if(t>=i[0]&&t<i[1])return i;if(e===r-1&&t<=i[1])return i}return[]}}}),this.animationState.transition("updateData")})}getSeriesDomain(e){var t,i,s,r;const{processedData:n,dataModel:o}=this;if(!n||!o||!this.calculatedBins.length)return[];const a=o.getDomain(this,"groupAgg","aggregate",n),l=null==(t=this.calculatedBins)?void 0:t[0][0],c=null==(r=this.calculatedBins)?void 0:r[(null!=(s=null==(i=this.calculatedBins)?void 0:i.length)?s:0)-1][1];return qc("x"===e?[l,c]:a)}createNodeData(){return x(this,null,function*(){var e;const{id:t,axes:i,processedData:s,ctx:{callbackCache:r}}=this,n=i.x,o=i.y;if(!n||!o)return;const{scale:a}=n,{scale:l}=o,{xKey:c,yKey:h,xName:d,yName:u,fill:p,stroke:g,strokeWidth:m,cornerRadius:f}=this.properties,{formatter:y=e=>String(e.value),fontStyle:v,fontWeight:C,fontSize:b,fontFamily:S,color:w}=this.properties.label,x=[],E={itemId:null!=(e=this.properties.yKey)?e:this.id,nodeData:x,labelData:x,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&s&&"grouped"===s.type?(s.data.forEach(e=>{var i;const{aggValues:[[s,n]]=[[0,0]],datum:E,datum:{length:M},keys:A,keys:[T,D]}=e,I=a.convert(T),R=a.convert(D),P=s+n,k=l.convert(0),L=l.convert(P),N=Math.abs(R-I),_=Math.abs(L-k),O=Math.min(I,R),F=Math.min(k,L);let G;0!==P&&(G={text:null!=(i=r.call(y,{value:P,datum:E,seriesId:t,xKey:c,yKey:h,xName:d,yName:u}))?i:String(P),fontStyle:v,fontWeight:C,fontSize:b,fontFamily:S,fill:w,x:O+N/2,y:F+_/2});const B={x:O+N/2,y:F+_/2},V=o.isReversed();x.push({series:this,datum:E,aggregatedValue:P,frequency:M,domain:A,yKey:h,xKey:c,x:O,y:F,xValue:I,yValue:L,width:N,height:_,midPoint:B,fill:p,stroke:g,cornerRadius:f,topLeftCornerRadius:!V,topRightCornerRadius:!V,bottomRightCornerRadius:V,bottomLeftCornerRadius:V,opacity:1,strokeWidth:m,label:G})}),x.sort((e,t)=>e.x-t.x),E):E})}nodeFactory(){return new lu}updateDatumSelection(e){return x(this,null,function*(){const{nodeData:t,datumSelection:i}=e;return i.update(t,e=>{e.tag=0,e.crisp=!0},e=>e.domain.join("_"))})}updateDatumNodes(e){return x(this,null,function*(){const{isHighlight:t}=e,{fillOpacity:i,strokeOpacity:s,lineDash:r,lineDashOffset:n,shadow:o,highlightStyle:{item:{fill:a,fillOpacity:l=i,stroke:c,strokeWidth:h}}}=this.properties;e.datumSelection.each((e,d,u)=>{var p,g;const{cornerRadius:m,topLeftCornerRadius:f,topRightCornerRadius:y,bottomRightCornerRadius:v,bottomLeftCornerRadius:C}=d,b=t&&void 0!==h?h:d.strokeWidth,S=t?l:i;e.fill=null!=(p=t?a:void 0)?p:d.fill,e.stroke=null!=(g=t?c:void 0)?g:d.stroke,e.fillOpacity=S,e.strokeOpacity=s,e.strokeWidth=b,e.lineDash=r,e.lineDashOffset=n,e.topLeftCornerRadius=f?m:0,e.topRightCornerRadius=y?m:0,e.bottomRightCornerRadius=v?m:0,e.bottomLeftCornerRadius=C?m:0,e.fillShadow=o,e.zIndex=t?Zh.highlightedZIndex:u,e.visible=d.height>0})})}updateLabelSelection(e){return x(this,null,function*(){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.tag=1,e.pointerEvents=1,e.textAlign="center",e.textBaseline="middle"})})}updateLabelNodes(e){return x(this,null,function*(){const t=this.isLabelEnabled();e.labelSelection.each((e,i)=>{const s=i.label;s&&t?(e.text=s.text,e.x=s.x,e.y=s.y,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.fontSize=s.fontSize,e.fontFamily=s.fontFamily,e.fill=s.fill,e.visible=!0):e.visible=!1})})}initQuadTree(e){Ip(e,Dp(this.contentGroup.children[0]))}pickNodeClosestDatum(e){return Rp(this,e)}getTooltipHtml(e){const t=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!t||!i)return il;const{xKey:s,yKey:r,xName:n,yName:o,fill:a,aggregation:l,tooltip:c}=this.properties,{aggregatedValue:h,frequency:d,domain:[u,p],itemId:g}=e,m=`${_u(null!=n?n:s)}: ${t.formatDatum(u)} - ${t.formatDatum(p)}`;let f=r?`<b>${_u(null!=o?o:r)} (${l})</b>: ${i.formatDatum(h)}<br>`:"";f+=`<b>Frequency</b>: ${d}`;const y={title:m,backgroundColor:a,content:f};return c.toTooltipHtml(y,{datum:{data:e.datum,aggregatedValue:e.aggregatedValue,domain:e.domain,frequency:e.frequency},itemId:g,xKey:s,xName:n,yKey:r,yName:o,color:a,title:m,seriesId:this.id})}getLegendData(e){var t,i;if(!(null==(t=this.data)?void 0:t.length)||"category"!==e)return[];const{xKey:s,yName:r,fill:n,fillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,visible:h}=this.properties;return[{legendType:"category",id:this.id,itemId:s,seriesId:this.id,enabled:h,label:{text:null!=(i=null!=r?r:s)?i:"Frequency"},marker:{fill:null!=n?n:"rgba(0, 0, 0, 0)",stroke:null!=a?a:"rgba(0, 0, 0, 0)",fillOpacity:o,strokeOpacity:c,strokeWidth:l}}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Hp(Bp(!0,this.axes,"normal"));Rr(this.id,"datums",this.ctx.animationManager,[e],i),Ou(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){var t,i;const s=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff,r=Hp(Bp(!0,this.axes,"normal"));Rr(this.id,"datums",this.ctx.animationManager,[e.datumSelection],r,(e,t)=>Fh(t.domain),s),Ou(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e,seriesRect:t}){var i;return zp(null==(i=this.contextNodeData)?void 0:i.nodeData[e],this.contentGroup,t)}};sg.className="HistogramSeries",sg.type="histogram";var rg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",instanceConstructor:sg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:Wt,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:12,fontFamily:Kt,color:qt},shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}}},ng=class extends Wd{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new Uu,this.label=new Vo,this.tooltip=new Wu,this.connectMissingData=!1}};S([Kr(en)],ng.prototype,"xKey",2),S([Kr(en)],ng.prototype,"yKey",2),S([Kr(en,{optional:!0})],ng.prototype,"xName",2),S([Kr(en,{optional:!0})],ng.prototype,"yName",2),S([Kr(en,{optional:!0})],ng.prototype,"title",2),S([Kr(fn)],ng.prototype,"stroke",2),S([Kr(rn)],ng.prototype,"strokeWidth",2),S([Kr(nn)],ng.prototype,"strokeOpacity",2),S([Kr(Mn)],ng.prototype,"lineDash",2),S([Kr(rn)],ng.prototype,"lineDashOffset",2),S([Kr(Xr)],ng.prototype,"marker",2),S([Kr(Xr)],ng.prototype,"label",2),S([Kr(Xr)],ng.prototype,"tooltip",2),S([Kr(Qr)],ng.prototype,"connectMissingData",2);var og=class extends jd{constructor(e){super({moduleCtx:e,directionKeys:Hd,directionNames:Ud,hasMarkers:!0,pickModes:[2,3,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:lp({getOpacity:()=>this.getOpacity()}),label:Gu,marker:(e,t)=>y(y({},{opacity:1,scalingX:1,scalingY:1}),Xu(0,t))}}),this.properties=new ng}processData(e){return x(this,null,function*(){var t,i;if(!this.properties.isValid()||null==this.data)return;const{xKey:s,yKey:r}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=null==(t=this.axes.x)?void 0:t.scale,a=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:a}),d=[];l||d.push(zh(s,c,{id:"xKey"})),n&&(d.push(kh(l?["xValue"]:void 0)),this.processedData&&d.push(Oh(this.processedData))),d.push(Wh(s,c,{id:"xValue"}),Wh(r,h,{id:"yValue",invalidValue:void 0})),yield this.requestDataModel(e,this.data,{props:d}),this.animationState.transition("updateData")})}getSeriesDomain(e){const{axes:t,dataModel:i,processedData:s}=this;if(!s||!i)return[];const r=t.x,n=t.y,o=i.resolveProcessedDataDefById(this,"xValue");if("x"===e){const e=i.getDomain(this,"xValue","value",s);return"value"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?e:qc(ls(e),r)}return qc(i.getDomain(this,"yValue","value",s),n)}createNodeData(){return x(this,null,function*(){var e,t,i;const{processedData:s,dataModel:r,axes:n}=this,o=n.x,a=n.y;if(!(s&&r&&o&&a))return;const{xKey:l,yKey:c,xName:h,yName:d,marker:u,label:p,connectMissingData:g,legendItemName:m}=this.properties,f=o.scale,y=a.scale,v=(null!=(e=f.bandwidth)?e:0)/2,C=(null!=(t=y.bandwidth)?t:0)/2,b=[],S=u.enabled?u.size:0,w=r.resolveProcessedDataIndexById(this,"xValue"),x=r.resolveProcessedDataIndexById(this,"yValue");let E,M=!0;for(let e=0;e<s.data.length;e++){const{datum:t,values:r}=null!=E?E:s.data[e],n=r[w],o=r[x];if(void 0===o)M=!g;else{const r=f.convert(n)+v;if(isNaN(r)){M=!g,E=void 0;continue}E=void 0===(null==(i=s.data[e+1])?void 0:i.values[x])?void 0:s.data[e+1];const a=y.convert(o)+C,u=this.getLabelText(p,{value:o,datum:t,xKey:l,yKey:c,xName:h,yName:d,legendItemName:m},e=>We(e)?e.toFixed(2):String(e));b.push({series:this,datum:t,yKey:c,xKey:l,point:{x:r,y:a,moveTo:M,size:S},midPoint:{x:r,y:a},yValue:o,xValue:n,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},label:u?{text:u,fontStyle:p.fontStyle,fontWeight:p.fontWeight,fontSize:p.fontSize,fontFamily:p.fontFamily,textAlign:"center",textBaseline:"bottom",fill:p.color}:void 0}),M=!1}}return{itemId:c,nodeData:b,labelData:b,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:e}=this.properties.marker;return new(Nd(e))}updatePathNodes(e){return x(this,null,function*(){const{paths:[t],opacity:i,visible:s,animationEnabled:r}=e;t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),r||(t.visible=s),cp(this,t)})}updateMarkerSelection(e){return x(this,null,function*(){let{nodeData:t}=e;const{markerSelection:i}=e,{shape:s,enabled:r}=this.properties.marker;return t=s&&r?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,e=>Fh(e.xValue))})}updateMarkerNodes(e){return x(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,stroke:n,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=Xe(i&&c.item,l.getStyle(),{stroke:n,strokeWidth:o,strokeOpacity:a}),d=this.ctx.animationManager.isSkipped();t.each((e,t)=>{this.updateMarkerStyle(e,l,{datum:t,highlighted:i,xKey:s,yKey:r},h,{applyTranslation:d})}),i||l.markClean()})}updateLabelSelection(e){return x(this,null,function*(){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])})}updateLabelNodes(e){return x(this,null,function*(){const{enabled:t,fontStyle:i,fontWeight:s,fontSize:r,fontFamily:n,color:o}=this.properties.label;e.labelSelection.each((e,a)=>{const{point:l,label:c}=a;a&&c&&t?(e.fontStyle=i,e.fontWeight=s,e.fontSize=r,e.fontFamily=n,e.textAlign=c.textAlign,e.textBaseline=c.textBaseline,e.text=c.text,e.x=l.x,e.y=l.y-10,e.fill=o,e.visible=!0):e.visible=!1})})}getTooltipHtml(e){var t;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return il;const{xKey:r,yKey:n,xName:o,yName:a,strokeWidth:l,marker:c,tooltip:h}=this.properties,{datum:d,xValue:u,yValue:p,itemId:g}=e,m=i.formatDatum(u),f=s.formatDatum(p),v=_u(null!=(t=this.properties.title)?t:a),C=_u(m+": "+f),b=Xe({fill:c.stroke},c.getStyle(),{strokeWidth:l}),{fill:S}=this.getMarkerStyle(c,{datum:e,xKey:r,yKey:n,highlighted:!1},b);return h.toTooltipHtml({title:v,content:C,backgroundColor:S},y({datum:d,itemId:g,xKey:r,xName:o,yKey:n,yName:a,title:v,color:S,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(e){var t,i,s,r,n,o,a,l,c,h;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||"category"!==e)return[];const{yKey:d,yName:u,stroke:p,strokeOpacity:g,strokeWidth:m,lineDash:f,title:y,marker:v,visible:C,legendItemName:b}=this.properties,S="rgba(0, 0, 0, 0)";return[{legendType:"category",id:this.id,itemId:d,legendItemName:b,seriesId:this.id,enabled:C,label:{text:null!=(s=null!=(i=null!=b?b:y)?i:u)?s:d},marker:{shape:v.shape,fill:null!=(r=v.fill)?r:S,stroke:null!=(o=null!=(n=v.stroke)?n:p)?o:S,fillOpacity:null!=(a=v.fillOpacity)?a:1,strokeOpacity:null!=(c=null!=(l=v.strokeOpacity)?l:g)?c:1,strokeWidth:null!=(h=v.strokeWidth)?h:0,enabled:v.enabled},line:{stroke:null!=p?p:S,strokeOpacity:g,strokeWidth:m,lineDash:f}}]}updatePaths(e){return x(this,null,function*(){this.updateLinePaths(e.paths,e.contextData)})}updateLinePaths(e,t){const{nodeData:i}=t,[s]=e,{path:r}=s;r.clear(!0);for(const e of i)e.point.moveTo?r.moveTo(e.point.x,e.point.y):r.lineTo(e.point.x,e.point.y);s.checkPathDirty()}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s,contextData:r,paths:n}=e,{animationManager:o}=this.ctx;this.updateLinePaths(n,r),np(this,o,...n),fa([t],Xu),Yu(this,o,t),Ou(this,"labels",o,i),Ou(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){var t,i;const{animationManager:s}=this.ctx,{markerSelection:r,labelSelection:n,annotationSelections:o,contextData:a,paths:l,previousContextData:c}=e,[h]=l;super.resetAllAnimation(e);const d=()=>{this.updateLinePaths(l,a)};if(null==a||null==c)return d(),Ku(this,s,"added",r),op(this,"path_properties",s,"add",h),Ou(this,"labels",s,n),void Ou(this,"annotations",s,...o);const u=Sp(a,c,null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(Ku(this,s,void 0,r),Rr(this.id,"path_properties",s,[h],u.pathProperties),Lu(this.id,"path_update",s,[h],u.path),u.hasMotion&&(Ou(this,"labels",s,n),Ou(this,"annotations",s,...o)))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Eo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,highlighted:!0})}computeFocusBounds(e){return Qu(this,e)}};og.className="LineSeries",og.type="line";var ag={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",instanceConstructor:og,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:Wt,tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,marker:{__extends__:jt,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:Kt,color:$t}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:e=>{const{marker:t}=ku(e);return{stroke:t.fill,marker:t}}},lg=class extends Vo{constructor(){super(...arguments),this.placement="top"}};S([Kr(On)],lg.prototype,"placement",2);var cg=class extends Wd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new Uu,this.label=new lg,this.tooltip=new Wu}};S([Kr(en)],cg.prototype,"xKey",2),S([Kr(en)],cg.prototype,"yKey",2),S([Kr(en,{optional:!0})],cg.prototype,"labelKey",2),S([Kr(en,{optional:!0})],cg.prototype,"colorKey",2),S([Kr(en,{optional:!0})],cg.prototype,"xName",2),S([Kr(en,{optional:!0})],cg.prototype,"yName",2),S([Kr(en,{optional:!0})],cg.prototype,"labelName",2),S([Kr(en,{optional:!0})],cg.prototype,"colorName",2),S([Kr(Cn,{optional:!0})],cg.prototype,"colorDomain",2),S([Kr(yn)],cg.prototype,"colorRange",2),S([Kr(en,{optional:!0})],cg.prototype,"title",2),S([Kr(Xr)],cg.prototype,"marker",2),S([Kr(Xr)],cg.prototype,"label",2),S([Kr(Xr)],cg.prototype,"tooltip",2);var hg=class extends jd{constructor(e){super({moduleCtx:e,directionKeys:Hd,directionNames:Ud,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:qu,label:Gu}}),this.properties=new cg,this.colorScale=new qp}processData(e){return x(this,null,function*(){var t,i,s;if(!this.properties.isValid()||null==this.data||!this.visible)return;const r=null==(t=this.axes.x)?void 0:t.scale,n=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:o,yScaleType:a}=this.getScaleInformation({xScale:r,yScale:n}),l=this.colorScale.type,{xKey:c,yKey:h,labelKey:d,colorKey:u,colorDomain:p,colorRange:g}=this.properties,{dataModel:m,processedData:f}=yield this.requestDataModel(e,this.data,{props:[zh(c,o,{id:"xKey-raw"}),zh(h,a,{id:"yKey-raw"}),...d?[zh(d,"band",{id:"labelKey-raw"})]:[],Wh(c,o,{id:"xValue"}),Wh(h,a,{id:"yValue"}),...u?[Wh(u,l,{id:"colorValue"})]:[],...d?[Wh(d,"band",{id:"labelValue"})]:[]]});if(u){const e=m.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(s=null!=p?p:f.domain.values[e])?s:[],this.colorScale.range=g,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s="x"===e?"xValue":"yValue",r=t.resolveProcessedDataDefById(this,s),n=t.getDomain(this,s,"value",i);if("value"===(null==r?void 0:r.def.type)&&"category"===(null==r?void 0:r.def.valueType))return n;const o=this.axes[e];return qc(ls(n),o)}createNodeData(){return x(this,null,function*(){var e,t,i;const{axes:s,dataModel:r,processedData:n,colorScale:o}=this,{xKey:a,yKey:l,labelKey:c,colorKey:h,xName:d,yName:u,labelName:p,marker:g,label:m,visible:f}=this.properties,{placement:v}=m,C=Nd(g.shape),b=s.x,S=s.y;if(!(r&&n&&f&&b&&S))return;const w=r.resolveProcessedDataIndexById(this,"xValue"),x=r.resolveProcessedDataIndexById(this,"yValue"),E=h?r.resolveProcessedDataIndexById(this,"colorValue"):-1,M=c?r.resolveProcessedDataIndexById(this,"labelValue"):-1,A=b.scale,T=S.scale,D=(null!=(e=A.bandwidth)?e:0)/2,I=(null!=(t=T.bandwidth)?t:0)/2,R=[],P=m.getFont();for(const{values:e,datum:t}of null!=(i=n.data)?i:[]){const i=e[w],s=e[x],r=A.convert(i)+D,n=T.convert(s)+I,f=this.getLabelText(m,{value:c?e[M]:s,datum:t,xKey:a,yKey:l,labelKey:c,xName:d,yName:u,labelName:p}),b=Fo.getTextSize(f,P),S=h?o.convert(e[E]):void 0;R.push({series:this,itemId:l,yKey:l,xKey:a,datum:t,xValue:i,yValue:s,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:r,y:n,size:g.size},midPoint:{x:r,y:n},fill:S,label:y({text:f},b),marker:C,placement:v})}return{itemId:l,nodeData:R,labelData:R,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var e,t;return null!=(t=null==(e=this.contextNodeData)?void 0:e.labelData)?t:[]}markerFactory(){const{shape:e}=this.properties.marker;return new(Nd(e))}updateMarkerSelection(e){return x(this,null,function*(){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])})}updateMarkerNodes(e){return x(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:r,labelKey:n,marker:o,highlightStyle:a}=this.properties,l=Xe(i&&a.item,o.getStyle());t.each((e,t)=>{this.updateMarkerStyle(e,o,{datum:t,highlighted:i,xKey:s,yKey:r,labelKey:n},l)}),i||o.markClean()})}updateLabelSelection(e){return x(this,null,function*(){var t,i;const s=this.isLabelEnabled()&&null!=(i=null==(t=this.chart)?void 0:t.placeLabels().get(this))?i:[];return e.labelSelection.update(s.map(({datum:e,x:t,y:i})=>v(y({},e),{point:{x:t,y:i,size:e.point.size},placement:"top"})),e=>{e.pointerEvents=1})})}updateLabelNodes(e){return x(this,null,function*(){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{var s,r,n,o;e.text=i.label.text,e.fill=t.color,e.x=null!=(r=null==(s=i.point)?void 0:s.x)?r:0,e.y=null!=(o=null==(n=i.point)?void 0:n.y)?o:0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})})}getTooltipHtml(e){const t=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!t||!i)return il;const{xKey:s,yKey:r,labelKey:n,xName:o,yName:a,labelName:l,title:c=a,marker:h,tooltip:d}=this.properties,{datum:u,xValue:p,yValue:g,label:m,itemId:f}=e,v=Xe({fill:e.fill,strokeWidth:this.getStrokeWidth(h.strokeWidth)},h.getStyle()),{fill:C="gray"}=this.getMarkerStyle(h,{datum:e,highlighted:!1,xKey:s,yKey:r,labelKey:n},v),b=_u(t.formatDatum(p)),S=_u(i.formatDatum(g));let w=`<b>${_u(null!=o?o:s)}</b>: ${b}<br><b>${_u(null!=a?a:r)}</b>: ${S}`;return n&&(w=`<b>${_u(null!=l?l:n)}</b>: ${_u(m.text)}<br>`+w),d.toTooltipHtml({title:c,content:w,backgroundColor:C},y({datum:u,itemId:f,xKey:s,xName:o,yKey:r,yName:a,labelKey:n,labelName:l,title:c,color:C,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(e){var t,i,s,r,n,o;const{yKey:a,yName:l,title:c,marker:h,visible:d}=this.properties,{fill:u,stroke:p,fillOpacity:g,strokeOpacity:m,strokeWidth:f}=h;return(null==(t=this.data)?void 0:t.length)&&this.properties.isValid()&&"category"===e?[{legendType:"category",id:this.id,itemId:a,seriesId:this.id,enabled:d,label:{text:null!=(i=null!=c?c:l)?i:a},marker:{shape:h.shape,fill:null!=(r=null!=(s=h.fill)?s:u)?r:"rgba(0, 0, 0, 0)",stroke:null!=(o=null!=(n=h.stroke)?n:p)?o:"rgba(0, 0, 0, 0)",fillOpacity:null!=g?g:1,strokeOpacity:null!=m?m:1,strokeWidth:null!=f?f:0}}]:[]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s}=e;$u(this,this.ctx.animationManager,t),Ou(this,"labels",this.ctx.animationManager,i),Ou(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Eo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,labelKey:s,highlighted:!0})}computeFocusBounds(e){return Qu(this,e)}};hg.className="ScatterSeries",hg.type="scatter";var dg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",instanceConstructor:hg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:Wt,tooltip:{position:{type:"node"}},marker:{__extends__:jt,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:Kt,color:$t}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:ku},ug=class e{constructor(e,t,i,s){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:r}=this;return new e(t,i,s,r)}[Bs](t,i){return new e(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function pg(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:r,outerRadius:n}=i;if(i.startAngle===i.endAngle||s<Math.min(r,n)||s>Math.max(r,n))return!1;const o=Or(i.startAngle),a=Or(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function gg(e,t){const{startAngle:i,endAngle:s,innerRadius:r,outerRadius:n}=t,o={x:n*Math.cos(i),y:n*Math.sin(i)},a={x:n*Math.cos(s),y:n*Math.sin(s)},l=0===r?{x:0,y:0}:{x:r*Math.cos(i),y:r*Math.sin(i)},c=0===r?{x:0,y:0}:{x:r*Math.cos(s),y:r*Math.sin(s)};return od(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||od(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||cd(0,0,n,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function mg(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},r={x:e.x,y:e.y+e.height},n={x:e.x+e.width,y:e.y+e.height};return gg({start:i,end:s},t)||gg({start:r,end:n},t)}function fg(e,t,i,s){if(0===i&&0===s)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let r=0,n=1;for(let o=0;o<8;o+=1){const o=(r+n)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*s)/(e+o*s))-t<0?r=o:n=o}return r}function yg(e,t){return Vr(e,t)<1e-6?t:Nr(e-t)+t}function vg(e,t,i=0){const s=Math.abs(t-e)>=2*Math.PI?2*Math.PI:Nr(t-e);return{startAngle:e=yg(e,i),endAngle:t=e+s}}function Cg(e,t,i,s,r,n){const o=Math.sin(n),a=Math.cos(n),l=m(e,2)+m(t,2)-m(i,2);let c=NaN,h=NaN,d=NaN,u=NaN;if(a>.5){const i=o/a,s=1+m(i,2),r=-2*(e+t*i),n=m(r,2)-4*s*l;if(n<0)return;const p=(-r+Math.sqrt(n))/(2*s),g=(-r-Math.sqrt(n))/(2*s);c=p,h=p*i,d=g,u=g*i}else{const i=a/o,s=1+m(i,2),r=-2*(t+e*i),n=m(r,2)-4*s*l;if(n<0)return;const p=(-r+Math.sqrt(n))/(2*s),g=(-r-Math.sqrt(n))/(2*s);c=p*i,h=p,d=g*i,u=g}const p=d*a+u*o,g=c*a+h*o>0?yg(Math.atan2(h-t,c-e),s):NaN,f=p>0?yg(Math.atan2(u-t,d-e),s):NaN;return g>=s&&g<=r?g:f>=s&&f<=r?f:void 0}function bg(e,t,i,s,r,n){const o=Math.hypot(e,t),a=o-(m(o,2)-m(i,2)+m(n,2))/(2*o),l=Math.atan2(t,e),c=Math.acos(-a/i),h=yg(l+c,s),d=yg(l-c,s);return h>=s&&h<=r?h:d>=s&&d<=r?d:void 0}var Sg=class{constructor(e,t,i,s,r){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=r,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){null==e||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){null==e||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},wg=class extends ud{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){const e=this.outerRadius;return new er(this.centerX-e,this.centerY-e,2*e,2*e)}normalizedRadii(){const{concentricEdgeInset:e}=this;return{innerRadius:Math.max(Math.min(this.innerRadius,this.outerRadius)+e,0),outerRadius:Math.max(Math.max(this.innerRadius,this.outerRadius)-e,0)}}normalizedClipSector(){const{clipSector:e}=this;if(null==e)return;const{startAngle:t,endAngle:i}=vg(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:r}=this.normalizedRadii(),n=vg(e.startAngle,e.endAngle,t);return new ug(Math.max(t,n.startAngle),Math.min(i,n.endAngle),Math.max(s,e.innerRadius),Math.min(r,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,r,n,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=vg(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(a&&h<=0)return;const p=this.getAngleOffset(h),g=this.getAngleOffset(d),m=a?this.getAngleOffset(h+e):this.getAngleOffset(d-e),f=o?l+m+t:c-m-t,y=a?h+e:d-e,v=y*Math.cos(f),C=y*Math.sin(f);if(null!=u){const e=1e-6;if(!(o||f>=l-e&&f<=u.endAngle-e))return;if(o&&!(f>=u.startAngle+e&&f<=c-e))return;if(a&&!(y>=u.innerRadius-e))return;if(!(a||y<=u.outerRadius+e))return}const b=new Sg(v,C,e,i,s);if(null!=u){let t,c;if(a?(b.clipStart(Cg(v,C,e,i,s,u.endAngle-p)),b.clipEnd(Cg(v,C,e,i,s,u.startAngle+p))):(b.clipStart(Cg(v,C,e,i,s,u.startAngle+g)),b.clipEnd(Cg(v,C,e,i,s,u.endAngle-g))),o?(t=bg(v,C,e,i,s,u.innerRadius),c=bg(v,C,e,i,s,u.outerRadius)):(t=bg(v,C,e,i,s,u.outerRadius),c=bg(v,C,e,i,s,u.innerRadius)),b.clipStart(t),b.clipEnd(c),null!=t){const{x:e,y:i}=b.pointAt(t),s=yg(Math.atan2(i,e),l);o?null==n||n.clipStart(s):r.clipEnd(s)}if(null!=c){const{x:e,y:t}=b.pointAt(c),i=yg(Math.atan2(t,e),l);o?r.clipStart(i):null==n||n.clipEnd(i)}}if(null!=u){const{x:e,y:t}=b.pointAt((b.a0+b.a1)/2);if(!pg(e,t,u))return}const{x:S,y:w}=b.pointAt(o===a?b.a0:b.a1),x=yg(Math.atan2(w,S),l),E=a?n:r;return o?null==E||E.clipStart(x):null==E||E.clipEnd(x),b}updatePath(){var e,t,i,s,r;const{path:n,centerX:o,centerY:a,concentricEdgeInset:l,radialEdgeInset:c}=this;let{startOuterCornerRadius:h,endOuterCornerRadius:d,startInnerCornerRadius:u,endInnerCornerRadius:p}=this;const{startAngle:g,endAngle:m}=vg(this.startAngle,this.endAngle),{innerRadius:f,outerRadius:y}=this.normalizedRadii(),v=this.normalizedClipSector(),C=m-g,b=C>=2*Math.PI-1e-6;if(n.clear(),(null!=(e=null==v?void 0:v.startAngle)?e:g)===(null!=(t=null==v?void 0:v.endAngle)?t:m))return;if(b&&null==this.clipSector&&0===h&&0===d&&0===u&&0===p)return n.moveTo(o+y*Math.cos(g),a+y*Math.sin(g)),n.arc(o,a,y,g,m),f>l&&(n.moveTo(o+f*Math.cos(m),a+f*Math.sin(m)),n.arc(o,a,f,m,g,!0)),void n.closePath();const S=this.getAngleOffset(f),w=this.getAngleOffset(y);if(C<2*w)return;const x=(null!=(i=null==v?void 0:v.innerRadius)?i:f)>l,E=f<l||C<2*S,M=y-f,A=Math.max(h,u,d,p),T=A>0?Math.min(M/A,1):1;h*=T,d*=T,u*=T,p*=T;const D=fg(y,C-2*w,-h,-d);if(h*=D,d*=D,!E&&x){const e=fg(f,C-2*S,u,p);u*=e,p*=e}else u=0,p=0;const I=Math.max(h+u,d+p),R=I>0?Math.min(M/I,1):1;h*=R,d*=R,u*=R,p*=R;let P=0,k=0;const L=h/(y-h),N=d/(y-d);if(L>=0&&L<.999999)P=Math.asin(L);else{P=C/2;const e=y/(1/Math.sin(P)+1);h=Math.min(e,h)}if(N>=0&&N<.999999)k=Math.asin(N);else{k=C/2;const e=y/(1/Math.sin(k)+1);d=Math.min(e,d)}const _=Math.asin(u/(f+u)),O=Math.asin(p/(f+p)),F=null!=(s=null==v?void 0:v.outerRadius)?s:y,G=this.getAngleOffset(F),B=new Sg(0,0,F,g+G,m-G),V=null!=(r=null==v?void 0:v.innerRadius)?r:f,H=this.getAngleOffset(V),U=x?new Sg(0,0,V,g+H,m-H):void 0;null!=v&&(B.clipStart(v.startAngle),B.clipEnd(v.endAngle),null==U||U.clipStart(v.startAngle),null==U||U.clipEnd(v.endAngle));const z=this.arc(h,P,g-.5*Math.PI,g+P,B,U,!0,!1),W=this.arc(d,k,m-k,m+.5*Math.PI,B,U,!1,!1),j=this.arc(p,O,m+.5*Math.PI,m+Math.PI-O,B,U,!1,!0),K=this.arc(u,_,g+Math.PI+_,g+1.5*Math.PI,B,U,!0,!0);if(E){const e=C<.5*Math.PI?c*(1+Math.cos(C))/Math.sin(C):NaN;let t;t=e>0&&e<y?Math.max(Math.hypot(c,e),f):f;const i=g+.5*C;n.moveTo(o+t*Math.cos(i),a+t*Math.sin(i))}else if(!0===(null==K?void 0:K.isValid())){const{x:e,y:t}=K.pointAt(K.a1);n.moveTo(o+e,a+t)}else if(!0===(null==U?void 0:U.isValid())){const{x:e,y:t}=U.pointAt(U.a0);n.moveTo(o+e,a+t)}else{const e=g+C/2,t=f*Math.cos(e),i=f*Math.sin(e);n.moveTo(o+t,a+i)}if(!0===(null==z?void 0:z.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=z;n.arc(o+e,a+t,i,s,r)}if(B.isValid()){const{r:e,a0:t,a1:i}=B;n.arc(o,a,e,t,i)}if(!0===(null==W?void 0:W.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=W;n.arc(o+e,a+t,i,s,r)}if(!E){if(!0===(null==j?void 0:j.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=j;n.arc(o+e,a+t,i,s,r)}if(!0===(null==U?void 0:U.isValid())){const{r:e,a0:t,a1:i}=U;n.arc(o,a,e,i,t,!0)}if(!0===(null==K?void 0:K.isValid())){const{cx:e,cy:t,r:i,a0:s,a1:r}=K;n.arc(o+e,a+t,i,s,r)}}n.closePath()}isPointInPath(e,t){var i;const s=this.transformPoint(e,t),{startAngle:r,endAngle:n,innerRadius:o,outerRadius:a}=null!=(i=this.clipSector)?i:this;return pg(s.x,s.y,{startAngle:r,endAngle:n,innerRadius:Math.min(o,a),outerRadius:Math.max(o,a)})}};wg.className="Sector",S([dd()],wg.prototype,"centerX",2),S([dd()],wg.prototype,"centerY",2),S([dd()],wg.prototype,"innerRadius",2),S([dd()],wg.prototype,"outerRadius",2),S([dd()],wg.prototype,"startAngle",2),S([dd()],wg.prototype,"endAngle",2),S([dd()],wg.prototype,"clipSector",2),S([dd()],wg.prototype,"concentricEdgeInset",2),S([dd()],wg.prototype,"radialEdgeInset",2),S([dd()],wg.prototype,"startOuterCornerRadius",2),S([dd()],wg.prototype,"endOuterCornerRadius",2),S([dd()],wg.prototype,"startInnerCornerRadius",2),S([dd()],wg.prototype,"endInnerCornerRadius",2);var xg=class extends al{constructor(){super(...arguments),this.showInLegend=!1}};S([Kr(Qr)],xg.prototype,"showInLegend",2);var Eg=class extends Vo{constructor(){super(...arguments),this.margin=2}set(e,t){return super.set(e)}};S([Kr(en)],Eg.prototype,"text",2),S([Kr(tn)],Eg.prototype,"margin",2);var Mg=class extends vt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};S([Kr(fn)],Mg.prototype,"fill",2),S([Kr(nn)],Mg.prototype,"fillOpacity",2);var Ag=class extends Vo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};S([Kr(rn)],Ag.prototype,"offset",2),S([Kr(on)],Ag.prototype,"minAngle",2),S([Kr(rn)],Ag.prototype,"minSpacing",2),S([Kr(rn)],Ag.prototype,"maxCollisionOffset",2),S([Kr(Qr)],Ag.prototype,"avoidCollisions",2);var Tg=class extends Vo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};S([Kr(tn)],Tg.prototype,"positionOffset",2),S([Kr(nn)],Tg.prototype,"positionRatio",2);var Dg=class extends vt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};S([Kr(yn,{optional:!0})],Dg.prototype,"colors",2),S([Kr(rn)],Dg.prototype,"length",2),S([Kr(rn)],Dg.prototype,"strokeWidth",2);var Ig=class extends Vd{constructor(){super(...arguments),this.fills=Object.values(Ft),this.strokes=Object.values(Gt),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=void 0,this.innerLabels=new Ct(Eg),this.title=new xg,this.innerCircle=new Mg,this.shadow=new Vu,this.calloutLabel=new Ag,this.sectorLabel=new Tg,this.calloutLine=new Dg,this.tooltip=new Wu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}isValid(){const e=super.isValid();return null==this.innerRadiusRatio&&null==this.innerRadiusOffset?(_.warnOnce("Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series."),!1):e}};function Rg(e,t,i,s){const r=[i.convert(0),i.convert(1)],n=[s.convert(0),s.convert(1)],o=Math.PI/-2+Gr(t),a=e?"initial":"update";return{nodes:{toFn:(e,t,i,{prevLive:s})=>{var n,a;let{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d}=t;const{stroke:u,fill:p}=t.sectorFormat;if("removed"===i&&s?(l=null==(n=s.datum)?void 0:n.endAngle,c=null==(a=s.datum)?void 0:a.endAngle):"removed"!==i||s||(l=o,c=o),"removed"===i){const e=(({radius:e})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*e}))(t);h=e.innerRadius,d=e.outerRadius}return{startAngle:l,endAngle:c,outerRadius:d,innerRadius:h,stroke:u,fill:p}},fromFn:(t,i,s,{prevFromProps:r})=>{var l,c,h,d,u,p;let{startAngle:g,endAngle:m,innerRadius:f,outerRadius:y}=t,{fill:v,stroke:C}=i.sectorFormat;if("unknown"===s||"added"===s&&!r?(g=o,m=o,f=i.innerRadius,y=i.outerRadius):"added"===s&&r&&(g=null!=(l=r.endAngle)?l:o,m=null!=(c=r.endAngle)?c:o,f=null!=(h=r.innerRadius)?h:i.innerRadius,y=null!=(d=r.outerRadius)?d:i.outerRadius),"added"===s&&!e){const e=(({radius:e})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*e}))(i);f=e.innerRadius,y=e.outerRadius}return"updated"===s&&(v=null!=(u=t.fill)?u:v,C=null!=(p=t.stroke)?p:C),{startAngle:g,endAngle:m,innerRadius:f,outerRadius:y,fill:v,stroke:C,phase:a}}},innerCircle:{fromFn:(e,t)=>{var i,s,r;return{size:null!=(r=null!=(s=null==(i=e.previousDatum)?void 0:i.radius)?s:e.size)?r:0,phase:a}},toFn:(e,t)=>{var i;return{size:null!=(i=t.radius)?i:0}}}}}function Pg(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,fill:t.sectorFormat.fill,stroke:t.sectorFormat.stroke}}function kg(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,r=Math.atan2(i,s),n=e.getItemNodes();for(const e of n)if(!0!==e.datum.missing&&Fr(r,e.startAngle,e.endAngle)){const t=Math.sqrt(s*s+i*i);let r=0;return t<e.innerRadius?r=e.innerRadius-t:t>e.outerRadius&&(r=t-e.outerRadius),{datum:e.datum,distance:r}}}function Lg(e,t){const i=e.getNodeData();if(void 0===i)return;const{centerX:s,centerY:r}=e,n=i[t.datumIndex],o=[{radius:n.innerRadius,angle:n.startAngle},{radius:n.innerRadius,angle:n.endAngle},{radius:n.outerRadius,angle:n.startAngle},{radius:n.outerRadius,angle:n.endAngle}],a=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const e of a)Fr(e,n.startAngle,n.endAngle)&&o.push({radius:n.outerRadius,angle:e});const l=o.map(({radius:e,angle:t})=>Hr(s,r,e,t)),c=l.map(e=>e.x),h=l.map(e=>e.y),d=Math.min(...c),u=Math.min(...h),p=Math.max(...c)-d,g=Math.max(...h)-u;return new er(d,u,p,g)}S([Kr(en)],Ig.prototype,"angleKey",2),S([Kr(en,{optional:!0})],Ig.prototype,"angleName",2),S([Kr(en,{optional:!0})],Ig.prototype,"radiusKey",2),S([Kr(en,{optional:!0})],Ig.prototype,"radiusName",2),S([Kr(rn,{optional:!0})],Ig.prototype,"radiusMin",2),S([Kr(rn,{optional:!0})],Ig.prototype,"radiusMax",2),S([Kr(en,{optional:!0})],Ig.prototype,"calloutLabelKey",2),S([Kr(en,{optional:!0})],Ig.prototype,"calloutLabelName",2),S([Kr(en,{optional:!0})],Ig.prototype,"sectorLabelKey",2),S([Kr(en,{optional:!0})],Ig.prototype,"sectorLabelName",2),S([Kr(en,{optional:!0})],Ig.prototype,"legendItemKey",2),S([Kr(yn)],Ig.prototype,"fills",2),S([Kr(yn)],Ig.prototype,"strokes",2),S([Kr(nn)],Ig.prototype,"fillOpacity",2),S([Kr(nn)],Ig.prototype,"strokeOpacity",2),S([Kr(Mn)],Ig.prototype,"lineDash",2),S([Kr(rn)],Ig.prototype,"lineDashOffset",2),S([Kr(rn)],Ig.prototype,"cornerRadius",2),S([Kr(Jr,{optional:!0})],Ig.prototype,"formatter",2),S([Kr(on)],Ig.prototype,"rotation",2),S([Kr(tn)],Ig.prototype,"outerRadiusOffset",2),S([Kr(nn)],Ig.prototype,"outerRadiusRatio",2),S([Kr(tn,{optional:!0})],Ig.prototype,"innerRadiusOffset",2),S([Kr(nn,{optional:!0})],Ig.prototype,"innerRadiusRatio",2),S([Kr(rn)],Ig.prototype,"strokeWidth",2),S([Kr(rn,{optional:!0})],Ig.prototype,"sectorSpacing",2),S([Kr(wn)],Ig.prototype,"innerLabels",2),S([Kr(Xr)],Ig.prototype,"title",2),S([Kr(Xr)],Ig.prototype,"innerCircle",2),S([Kr(Xr)],Ig.prototype,"shadow",2),S([Kr(Xr)],Ig.prototype,"calloutLabel",2),S([Kr(Xr)],Ig.prototype,"sectorLabel",2),S([Kr(Xr)],Ig.prototype,"calloutLine",2),S([Kr(Xr)],Ig.prototype,"tooltip",2),S([Kr(en,{optional:!0})],Ig.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var Ng=class extends _d{constructor(e){var t=e,{useLabelLayer:i=!1,pickModes:s=[0],canHaveAxes:r=!1,animationResetFns:n}=t,o=C(t,["useLabelLayer","pickModes","canHaveAxes","animationResetFns"]);super(v(y({},o),{useLabelLayer:i,pickModes:s,contentGroupVirtual:!1,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:r})),this.itemGroup=this.contentGroup.appendChild(new Eo),this.nodeData=[],this.itemSelection=_a.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=_a.select(this.labelGroup,Fo,!1),this.highlightSelection=_a.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.showFocusBox=!1,this.itemGroup.zIndexSubOrder=[()=>this._declarationOrder,1],this.animationResetFns=n,this.animationState=new ya("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return this.itemGroup.children}getNodeData(){return this.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}getLabelData(){return[]}computeLabelsBBox(e,t){return null}resetAllAnimation(){var e;const{item:t,label:i}=null!=(e=this.animationResetFns)?e:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&fa([this.itemSelection,this.highlightSelection],t),i&&fa([this.labelSelection],i),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){var t;const{item:i}=null!=(t=this.animationResetFns)?t:{};i&&fa([this.highlightSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(e){return{seriesRect:e}}},_g=class extends qh{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Og=class extends Ng{constructor(e){super({moduleCtx:e,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Pg,label:Gu}}),this.properties=new Ig,this.previousRadiusScale=new Zd,this.radiusScale=new Zd,this.backgroundGroup=this.rootGroup.appendChild(new Eo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Eo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new vd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new vd),this.innerCircleGroup=this.backgroundGroup.appendChild(new Eo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=_g,this.angleScale=new Zd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const t=new Eo({name:"pieCalloutLabels"}),i=new Eo({name:"pieSectorLabels"}),s=new Eo({name:"innerLabels"});this.labelGroup.append(t),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=_a.select(t,Eo),this.sectorLabelSelection=_a.select(i,Fo),this.innerLabelsSelection=_a.select(s,Fo),this.innerCircleSelection=_a.select(this.innerCircleGroup,vd)}addChartEventListeners(){var e;this.destroyFns.push(null==(e=this.ctx.chartEventManager)?void 0:e.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(e=>e))}nodeFactory(){return new wg}getSeriesDomain(e){return"x"===e?this.angleScale.domain:this.radiusScale.domain}processData(e){return x(this,null,function*(){var t,i,s,r,n;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:a,seriesItemEnabled:l}=this,{angleKey:c,radiusKey:h,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),m=[],f=[];p?m.push(zh(p,"band",{id:"legendItemKey"})):d?m.push(zh(d,"band",{id:"calloutLabelKey"})):u&&m.push(zh(u,"band",{id:"sectorLabelKey"}));const C=this.radiusScale.type,b=this.radiusScale.type;h&&f.push(jh(h,{id:"radiusValue",min:null!=(t=this.properties.radiusMin)?t:0,max:this.properties.radiusMax}),Wh(h,C,{id:"radiusRaw"}),Ph({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&f.push(Wh(d,"band",{id:"calloutLabelValue"})),u&&f.push(Wh(u,"band",{id:"sectorLabelValue"})),p&&f.push(Wh(p,"band",{id:"legendItemValue"})),g&&this.processedData&&m.length>0&&f.push(Oh(this.processedData)),f.push(kh()),o=o.map((e,t)=>a&&l[t]?e:v(y({},e),{[c]:0})),yield this.requestDataModel(e,o,{props:[...m,Kh(c,b,{id:"angleValue",onlyPositive:!0}),Wh(c,b,{id:"angleRaw"}),Ph({id:"angleValue"},[0,1],0,0),...f]});for(const e of null!=(n=null==(r=null==(s=this.processedData)?void 0:s.defs)?void 0:r.values)?n:[]){const{id:t,missing:i,property:s}=e,r=Xc(this,i);"angleRaw"!==t&&r>0&&_.warnOnce(`no value was found for the key '${String(s)}' on ${r} data element${r>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return x(this,null,function*(){var e;if(!this.nodeDataRefresh)return;const{nodeData:t=[]}=null!=(e=yield this.createNodeData())?e:{};this.nodeData=t,this.nodeDataRefresh=!1})}getProcessedDataIndexes(e){return{angleIdx:e.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?e.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?e.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?e.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?e.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return x(this,null,function*(){const{id:e,processedData:t,dataModel:i,angleScale:s}=this,{rotation:r,innerRadiusRatio:n}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:e,nodeData:[],labelData:[]};if(!t||!i||"ungrouped"!==t.type)return;const{angleIdx:o,radiusIdx:a,calloutLabelIdx:l,sectorLabelIdx:c,legendItemIdx:h}=this.getProcessedDataIndexes(i);let d=0,u=0;const p=t.data.map((e,t)=>{var i;const{datum:n,values:p}=e,g=p[o],m=s.convert(d)+Gr(r);d=g,u+=g;const f=s.convert(d)+Gr(r),v=Math.abs(f-m),C=m+v/2,b=p[o+1],S=a>=0&&null!=(i=p[a])?i:1,w=a>=0?p[a+1]:void 0,x=h>=0?p[h]:void 0,E=this.getLabels(n,C,v,!0,p[l],p[c],x),M=this.getSectorFormat(n,t,!1);return y({itemId:t,series:this,datum:n,index:t,angleValue:b,midAngle:C,midCos:Math.cos(C),midSin:Math.sin(C),startAngle:m,endAngle:f,sectorFormat:M,radiusValue:w,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:x},E)});return this.zerosumOuterRing.visible=0===u,this.zerosumInnerRing.visible=0===u&&null!=n&&1!==n&&n>0,{itemId:e,nodeData:p,labelData:p}})}getLabels(e,t,i,s,r,n,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>Gr(a.minAngle)&&(p.calloutLabel=v(y({},this.getTextAlignment(t)),{text:this.getLabelText(a,v(y({},u),{value:r})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,v(y({},u),{value:n}))}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Or(e)- -.75*Math.PI;return t[qs(Math.floor(i/(Math.PI/2)),t.length)]}getSectorFormat(e,t,i){var s,r,n,o,a;const{callbackCache:l,highlightManager:c}=this.ctx,{angleKey:h,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:f}=this.properties,y=c.getActiveHighlight(),v=i&&(null==y?void 0:y.series)===this&&t===y.itemId;let C=p[t%p.length];null==m&&null==C&&(C=f);const{fill:b,fillOpacity:S,stroke:w,strokeWidth:x,strokeOpacity:E}=Xe(v&&this.properties.highlightStyle.item,{fill:u.length>0?u[t%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:C,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let M;return g&&(M=l.call(g,{datum:e,angleKey:h,radiusKey:d,fill:b,stroke:w,fills:u,strokes:p,strokeWidth:x,highlighted:v,seriesId:this.id})),{fill:null!=(s=null==M?void 0:M.fill)?s:b,fillOpacity:null!=(r=null==M?void 0:M.fillOpacity)?r:S,stroke:null!=(n=null==M?void 0:M.stroke)?n:w,strokeWidth:null!=(o=null==M?void 0:M.strokeWidth)?o:x,strokeOpacity:null!=(a=null==M?void 0:M.strokeOpacity)?a:E}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t),this.nodeData=this.nodeData.map(e=>{var t=e,{radius:i}=t,s=C(t,["radius"]);return v(y({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var e,t;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(t=null==(e=this.properties.title)?void 0:e.spacing)?t:0))-Math.max(0,-i)}update(e){return x(this,arguments,function*({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:null==e?void 0:e.width,seriesRectHeight:null==e?void 0:e.height},s=null!=wt(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY(),i=t.node.computeBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i,0,e),t.node.translationY=isFinite(e)?e:0}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(e)})}updateTitleNodes(){var e,t;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(e=this.labelGroup)||e.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(t=this.labelGroup)||t.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}})}updateSelections(){return x(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return x(this,null,function*(){const{itemSelection:e,highlightSelection:t,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:r}=this,n=(e,t)=>{let i=this.nodeData;t&&(i=i.map(e=>v(y({},e),{sectorFormat:y({},e.sectorFormat)}))),e.update(i,void 0,e=>this.getDatumId(e)),this.ctx.animationManager.isSkipped()&&e.cleanup()};n(e,!1),n(t,!0),i.update(this.nodeData,e=>{const t=new Ba;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Fo;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),s.update(this.nodeData,e=>{e.pointerEvents=1}),r.update(this.properties.innerLabels,e=>{e.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),s=1;t=Math.ceil(2*e+s)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){return x(this,null,function*(){const t=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==t?void 0:t.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{var i,s;e.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:t})});const s=(e,t,i,s)=>{const r=this.getSectorFormat(t.datum,t.itemId,s);t.sectorFormat.fill=r.fill,t.sectorFormat.stroke=r.stroke;const n=this.ctx.animationManager.isSkipped();n&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(s||n)&&(e.fill=r.fill,e.stroke=r.stroke),e.strokeWidth=r.strokeWidth,e.fillOpacity=r.fillOpacity,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,e.fillShadow=this.properties.shadow,e.cornerRadius=this.properties.cornerRadius,e.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=r.stroke?r.strokeWidth:0))/2:0,e.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((e,t,i)=>s(e,t,0,!1)),this.highlightSelection.each((e,i,r)=>{const n=(null==t?void 0:t.series)===this&&e.datum.itemId===t.itemId;s(e,i,0,!0),e.visible=n}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var e;const{calloutLine:t}=this.properties,i=t.length,s=t.strokeWidth,r=null!=(e=t.colors)?e:this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((e,t)=>{var o;const a=e.datum,{calloutLabel:l,outerRadius:c}=a;if((null==l?void 0:l.text)&&!l.hidden&&0!==c){e.visible=!0,e.strokeWidth=s,e.stroke=r[t%r.length],e.fill=void 0;const h=a.midCos*c,d=a.midSin*c;let u=a.midCos*(c+i),p=a.midSin*(c+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const e=l.box;let t=u,i=p;u<e.x?t=e.x:u>e.x+e.width&&(t=e.x+e.width),p<e.y?i=e.y:p>e.y+e.height&&(i=e.y+e.height);const s=t-u,r=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(r,2)),a=o-n;a>0&&(u+=s*a/o,p+=r*a/o)}e.x1=h,e.y1=d,e.x2=u,e.y2=p}else e.visible=!1})}getLabelOverflow(e,t,i){const s=i.x-this.centerX,r=i.x+i.width-this.centerX,n=i.y-this.centerY,o=i.y+i.height-this.centerY;let a=1;t.x+1<s?a=(t.x+t.width-s)/t.width:t.x+t.width-1>r&&(a=(r-t.x)/t.width);const l=t.y+1<n||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e,t=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const r=[{x:e.x+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+e.height+i},{x:e.x+t,y:e.y+e.height+i}],n=m(s,2);return r.some(e=>m(e.x,2)+m(e.y,2)>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:r}=t,n=e.convert(0),o=this.nodeData,a=this.nodeData.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>{var t;return e.midSin<0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),d=a.filter(e=>{var t;return e.midSin>=0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),u=new Fo,p=e=>{var t;const r=e.calloutLabel;if(null==r)return new er(0,0,0,0);const n=e.outerRadius+i.length+s,o=e.midCos*n,a=e.midSin*n+r.collisionOffsetY;return u.text=r.text,u.x=o,u.y=a,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(t=r.collisionTextAlign)?t:r.textAlign,textBaseline:r.textBaseline}),u.computeBBox()},g=(e,t,i)=>{const s=p(e).grow(r/2),n=p(t).grow(r/2);if(s.x<n.x+n.width&&s.x+s.width>n.x&&("to-top"===i?s.y<n.y+n.height:s.y+s.height>n.y)){const e="to-top"===i?s.y-n.y-n.height:s.y+s.height-n.y;t.calloutLabel.collisionOffsetY=e}},m=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],s=e[t];g(i,s,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],s=e[t];g(i,s,"to-bottom")}},f=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>p(e)),s=i.map(e=>e.clone().grow(r/2));let l=!1;for(let t=0;t<s.length&&!l;t++){const i=s[t];for(let r=t+1;r<e.length;r++){const e=s[r];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:s}=e;return{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}}),h=i.some(e=>c.some(t=>mg(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};m(l),m(c),f(h),f(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,color:o}=i,a=new Fo;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:c}=s,h=c.calloutLabel,d=t.convert(c.radius),u=Math.max(0,d);if(!(null==h?void 0:h.text)||0===u||h.hidden)return void(s.visible=!1);const p=u+r+n,g=c.midCos*p,m=c.midSin*p+h.collisionOffsetY,f={textAlign:null!=(l=h.collisionTextAlign)?l:h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=m,a.setFont(this.properties.calloutLabel),a.setAlign(f);const y=a.computeBBox();let v=h.text,C=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,e);v=h.text.length===t?h.text:`${h.text.substring(0,t)}…`,C=!i}s.text=v,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(f),s.fill=o,s.visible=C})}computeLabelsBBox(e,t){return x(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Fo;let h;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=d.text,c.x=0,c.y=e,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.computeBBox(),l.push(h))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+r+n,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;c.text=d.text,c.x=p,c.y=g,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=c.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(h){const e=t.y-this.centerY,i=new er(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(m.collidesBBox(i))return void(d.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,t),r=d.text.length>2&&e<2;if(i||r||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:er.merge(l)})}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:r,fontFamily:n,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel;this.sectorLabelSelection.each((e,c)=>{const{sectorLabel:h,outerRadius:d}=c;let u=!1;if(h&&0!==d){const p=t*(1-a)+d*a+o;e.fill=l,e.fontStyle=s,e.fontWeight=r,e.fontSize=i,e.fontFamily=n,e.text=h.text,e.x=c.midCos*p,e.y=c.midSin*p,e.textAlign="center",e.textBaseline="middle";const g=e.computeBBox(),m=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:f,endAngle:y}=c,v={startAngle:f,endAngle:y,innerRadius:t,outerRadius:d};m.every(([e,t])=>pg(e,t,v))&&(u=!0)}e.visible=u})}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a,color:l}=s;i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.computeBBox()),t.push(s.margin)});const i=e=>0===e?0:t[e],s=e=>e===t.length-1?0:t[e],r=e.reduce((e,t,r)=>e+t.height+i(r)+s(r),0),n=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(n/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,n=-r/2;t<e.length;t++){const r=e[t].height+n+i(t);l.push(r),n=r+s(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(e){const{angleKey:t,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:r}=this.properties,{sectorLabel:n,calloutLabel:o,legendItem:a}=e;return r&&void 0!==a?a.text:i&&i!==t&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==t&&void 0!==(null==n?void 0:n.text)?n.text:void 0}pickNodeClosestDatum(e){return kg(this,e)}getTooltipHtml(e){var t;if(!this.properties.isValid())return il;const{datum:i,angleValue:s,sectorFormat:{fill:r},itemId:n}=e,o=_u(null==(t=this.properties.title)?void 0:t.text),a=We(s)?Ys(s):String(s),l=this.getDatumLegendName(e);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${a}`:a,backgroundColor:r},{datum:i,itemId:n,title:o,color:r,seriesId:this.id,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey})}getLegendData(e){var t,i,s,r,n;const{visible:o,processedData:a,dataModel:l}=this;if(!l||!(null==a?void 0:a.data.length)||!this.properties.isValid()||"category"!==e)return[];const{angleKey:c,calloutLabelKey:h,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||h&&h!==c||d&&d!==c))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),f=(null==(t=this.properties.title)?void 0:t.showInLegend)&&this.properties.title.text,y=[];for(let e=0;e<a.data.length;e++){const{datum:t,values:l}=a.data[e],v=[];f&&v.push(f);const C=this.getLabels(t,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==C.legendItem?v.push(C.legendItem.text):h&&h!==c&&void 0!==(null==(i=C.calloutLabel)?void 0:i.text)?v.push(null==(s=C.calloutLabel)?void 0:s.text):d&&d!==c&&void 0!==(null==(r=C.sectorLabel)?void 0:r.text)&&v.push(null==(n=C.sectorLabel)?void 0:n.text),0===v.length)continue;const b=this.getSectorFormat(t,e,!1);y.push({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:o&&this.seriesItemEnabled[e],label:{text:v.join(" - ")},marker:{fill:b.fill,stroke:b.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?t[u]:void 0})}return y}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendItemName:r}=e;s.id===this.id?this.toggleSeriesItem(i,t):null!=r&&this.toggleOtherSeriesItems(r,t)}toggleSeriesItem(e,t){this.seriesItemEnabled[e]=t,this.nodeDataRefresh=!0}toggleOtherSeriesItems(e,t){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},r)=>{i[s]===e&&this.toggleSeriesItem(r,t)})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Rg(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Rr(this.id,"nodes",t,[this.itemSelection,this.highlightSelection],i.nodes),Rr(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Ou(this,"callout",t,this.calloutLabelSelection),Ou(this,"sector",t,this.sectorLabelSelection),Ou(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var e,t,i,s,r,n;const{itemSelection:o,highlightSelection:a,processedData:l,radiusScale:c,previousRadiusScale:h}=this,{animationManager:d}=this.ctx,u=null==(e=null==l?void 0:l.reduced)?void 0:e.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(t=null==u?void 0:u.moved.size)?t:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(n=null==(r=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:r.uniqueKeys)||n;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const f=Rg(!1,this.properties.rotation,c,h);Rr(this.id,"nodes",d,[o,a],f.nodes,(e,t)=>this.getDatumId(t),u),Rr(this.id,"innerCircle",d,[this.innerCircleSelection],f.innerCircle),Ou(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ou(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Ou(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,radiusScale:i,previousRadiusScale:s}=this,{animationManager:r}=this.ctx,n=Rg(!1,this.properties.rotation,i,s);Rr(this.id,"nodes",r,[e,t],n.nodes),Rr(this.id,"innerCircle",r,[this.innerCircleSelection],n.innerCircle),Fu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Fu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Fu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(e){var t,i,s;const{calloutLabelKey:r,sectorLabelKey:n,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?e[o]:r?e[r]:n?e[n]:void 0}getDatumId(e){const{index:t}=e,i=this.getDatumIdFromData(e.datum);return null!=i?String(i):`${t}`}onDataChange(){var e;const{data:t,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(e=null==t?void 0:t.map((e,t)=>{var s;return null==(s=i[t])||s}))?e:[]}computeFocusBounds(e){return Lg(this,e)}};Og.className="DonutSeries",Og.type="donut";var Fg={series:{__extends__:Wt,title:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:14,fontFamily:Kt,color:Xt,spacing:5},calloutLabel:{enabled:!0,fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:Kt,color:$t,offset:3,minAngle:0},sectorLabel:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:12,fontFamily:Kt,color:qt,positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,rotation:0,shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5},innerLabels:{fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:Kt,color:$t,margin:2},__BACKGROUND_COLOR_DO_NOT_USE:ei}},Gg=({takeColors:e,colorsCount:t,userPalette:i})=>{const{fills:s,strokes:r}=e(t);return{fills:s,strokes:i?r:[],calloutLine:{colors:r}}},Bg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",instanceConstructor:Og,themeTemplate:Fg,paletteFactory:Gg},Vg=class extends al{constructor(){super(...arguments),this.showInLegend=!1}};S([Kr(Qr)],Vg.prototype,"showInLegend",2);var Hg=class extends Vo{set(e,t){return super.set(e)}};S([Ls("Use a Donut Series instead"),Kr(en,{optional:!0})],Hg.prototype,"text",2),S([Ls("Use a Donut Series instead"),Kr(tn,{optional:!0})],Hg.prototype,"margin",2);var Ug=class extends vt{};S([Ls("Use a Donut Series instead"),Kr(fn,{optional:!0})],Ug.prototype,"fill",2),S([Ls("Use a Donut Series instead"),Kr(nn,{optional:!0})],Ug.prototype,"fillOpacity",2);var zg=class extends Vo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};S([Kr(rn)],zg.prototype,"offset",2),S([Kr(on)],zg.prototype,"minAngle",2),S([Kr(rn)],zg.prototype,"minSpacing",2),S([Kr(rn)],zg.prototype,"maxCollisionOffset",2),S([Kr(Qr)],zg.prototype,"avoidCollisions",2);var Wg=class extends Vo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};S([Kr(tn)],Wg.prototype,"positionOffset",2),S([Kr(nn)],Wg.prototype,"positionRatio",2);var jg=class extends vt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};S([Kr(yn,{optional:!0})],jg.prototype,"colors",2),S([Kr(rn)],jg.prototype,"length",2),S([Kr(rn)],jg.prototype,"strokeWidth",2);var Kg=class extends Vd{constructor(){super(...arguments),this.fills=Object.values(Ft),this.strokes=Object.values(Gt),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=void 0,this.innerLabels=new Ct(Hg),this.title=new Vg,this.innerCircle=new Ug,this.shadow=new Vu,this.calloutLabel=new zg,this.sectorLabel=new Wg,this.calloutLine=new jg,this.tooltip=new Wu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}};S([Kr(en)],Kg.prototype,"angleKey",2),S([Kr(en,{optional:!0})],Kg.prototype,"angleName",2),S([Kr(en,{optional:!0})],Kg.prototype,"radiusKey",2),S([Kr(en,{optional:!0})],Kg.prototype,"radiusName",2),S([Kr(rn,{optional:!0})],Kg.prototype,"radiusMin",2),S([Kr(rn,{optional:!0})],Kg.prototype,"radiusMax",2),S([Kr(en,{optional:!0})],Kg.prototype,"calloutLabelKey",2),S([Kr(en,{optional:!0})],Kg.prototype,"calloutLabelName",2),S([Kr(en,{optional:!0})],Kg.prototype,"sectorLabelKey",2),S([Kr(en,{optional:!0})],Kg.prototype,"sectorLabelName",2),S([Kr(en,{optional:!0})],Kg.prototype,"legendItemKey",2),S([Kr(yn)],Kg.prototype,"fills",2),S([Kr(yn)],Kg.prototype,"strokes",2),S([Kr(nn)],Kg.prototype,"fillOpacity",2),S([Kr(nn)],Kg.prototype,"strokeOpacity",2),S([Kr(Mn)],Kg.prototype,"lineDash",2),S([Kr(rn)],Kg.prototype,"lineDashOffset",2),S([Kr(rn)],Kg.prototype,"cornerRadius",2),S([Kr(Jr,{optional:!0})],Kg.prototype,"formatter",2),S([Kr(on)],Kg.prototype,"rotation",2),S([Kr(tn)],Kg.prototype,"outerRadiusOffset",2),S([Kr(nn)],Kg.prototype,"outerRadiusRatio",2),S([Ls("Use a Donut Series instead"),Kr(tn,{optional:!0})],Kg.prototype,"innerRadiusOffset",2),S([Ls("Use a Donut Series instead"),Kr(nn,{optional:!0})],Kg.prototype,"innerRadiusRatio",2),S([Kr(rn)],Kg.prototype,"strokeWidth",2),S([Kr(rn,{optional:!0})],Kg.prototype,"sectorSpacing",2),S([Kr(wn)],Kg.prototype,"innerLabels",2),S([Kr(Xr)],Kg.prototype,"title",2),S([Kr(Xr)],Kg.prototype,"innerCircle",2),S([Kr(Xr)],Kg.prototype,"shadow",2),S([Kr(Xr)],Kg.prototype,"calloutLabel",2),S([Kr(Xr)],Kg.prototype,"sectorLabel",2),S([Kr(Xr)],Kg.prototype,"calloutLine",2),S([Kr(Xr)],Kg.prototype,"tooltip",2),S([Kr(en,{optional:!0})],Kg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var $g=class extends qh{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Yg=class extends Ng{constructor(e){super({moduleCtx:e,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Pg,label:Gu}}),this.properties=new Kg,this.previousRadiusScale=new Zd,this.radiusScale=new Zd,this.backgroundGroup=this.rootGroup.appendChild(new Eo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Eo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new vd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new vd),this.innerCircleGroup=this.backgroundGroup.appendChild(new Eo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=$g,this.angleScale=new Zd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const t=new Eo({name:"pieCalloutLabels"}),i=new Eo({name:"pieSectorLabels"}),s=new Eo({name:"innerLabels"});this.labelGroup.append(t),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=_a.select(t,Eo),this.sectorLabelSelection=_a.select(i,Fo),this.innerLabelsSelection=_a.select(s,Fo),this.innerCircleSelection=_a.select(this.innerCircleGroup,vd)}addChartEventListeners(){var e;this.destroyFns.push(null==(e=this.ctx.chartEventManager)?void 0:e.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(e=>e))}nodeFactory(){return new wg}getSeriesDomain(e){return"x"===e?this.angleScale.domain:this.radiusScale.domain}processData(e){return x(this,null,function*(){var t,i,s,r,n;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:a,seriesItemEnabled:l}=this,{angleKey:c,radiusKey:h,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),m=[],f=[];p?m.push(zh(p,"band",{id:"legendItemKey"})):d?m.push(zh(d,"band",{id:"calloutLabelKey"})):u&&m.push(zh(u,"band",{id:"sectorLabelKey"}));const C=this.radiusScale.type,b=this.radiusScale.type;h&&f.push(jh(h,{id:"radiusValue",min:null!=(t=this.properties.radiusMin)?t:0,max:this.properties.radiusMax}),Wh(h,C,{id:"radiusRaw"}),Ph({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&f.push(Wh(d,"band",{id:"calloutLabelValue"})),u&&f.push(Wh(u,"band",{id:"sectorLabelValue"})),p&&f.push(Wh(p,"band",{id:"legendItemValue"})),g&&this.processedData&&m.length>0&&f.push(Oh(this.processedData)),f.push(kh()),o=o.map((e,t)=>a&&l[t]?e:v(y({},e),{[c]:0})),yield this.requestDataModel(e,o,{props:[...m,Kh(c,b,{id:"angleValue",onlyPositive:!0}),Wh(c,b,{id:"angleRaw"}),Ph({id:"angleValue"},[0,1],0,0),...f]});for(const e of null!=(n=null==(r=null==(s=this.processedData)?void 0:s.defs)?void 0:r.values)?n:[]){const{id:t,missing:i,property:s}=e,r=Xc(this,i);"angleRaw"!==t&&r>0&&_.warnOnce(`no value was found for the key '${String(s)}' on ${r} data element${r>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return x(this,null,function*(){var e;if(!this.nodeDataRefresh)return;const{nodeData:t=[]}=null!=(e=yield this.createNodeData())?e:{};this.nodeData=t,this.nodeDataRefresh=!1})}getProcessedDataIndexes(e){return{angleIdx:e.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?e.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?e.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?e.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?e.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return x(this,null,function*(){const{id:e,processedData:t,dataModel:i,angleScale:s}=this,{rotation:r}=this.properties;if(!t||!i||"ungrouped"!==t.type)return;const{angleIdx:n,radiusIdx:o,calloutLabelIdx:a,sectorLabelIdx:l,legendItemIdx:c}=this.getProcessedDataIndexes(i);let h=0,d=0;const u=t.data.map((e,t)=>{var i;const{datum:u,values:p}=e,g=p[n],m=s.convert(h)+Gr(r);h=g,d+=g;const f=s.convert(h)+Gr(r),v=Math.abs(f-m),C=m+v/2,b=p[n+1],S=o>=0&&null!=(i=p[o])?i:1,w=o>=0?p[o+1]:void 0,x=c>=0?p[c]:void 0,E=this.getLabels(u,C,v,!0,p[a],p[l],x),M=this.getSectorFormat(u,t,!1);return y({itemId:t,series:this,datum:u,index:t,angleValue:b,midAngle:C,midCos:Math.cos(C),midSin:Math.sin(C),startAngle:m,endAngle:f,sectorFormat:M,radiusValue:w,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:x},E)});this.zerosumOuterRing.visible=0===d;const{innerRadiusRatio:p=1}=this.properties;return this.zerosumInnerRing.visible=0===d&&1!==p&&p>0,{itemId:e,nodeData:u,labelData:u}})}getLabels(e,t,i,s,r,n,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>Gr(a.minAngle)&&(p.calloutLabel=v(y({},this.getTextAlignment(t)),{text:this.getLabelText(a,v(y({},u),{value:r})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,v(y({},u),{value:n}))}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Or(e)- -.75*Math.PI;return t[qs(Math.floor(i/(Math.PI/2)),t.length)]}getSectorFormat(e,t,i){var s,r,n,o,a;const{callbackCache:l,highlightManager:c}=this.ctx,{angleKey:h,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:f}=this.properties,y=c.getActiveHighlight(),v=i&&(null==y?void 0:y.series)===this&&t===y.itemId;let C=p[t%p.length];null!=m&&(null!=C||(C=f));const{fill:b,fillOpacity:S,stroke:w,strokeWidth:x,strokeOpacity:E}=Xe(v&&this.properties.highlightStyle.item,{fill:u.length>0?u[t%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:C,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let M;return g&&(M=l.call(g,{datum:e,angleKey:h,radiusKey:d,fill:b,stroke:w,fills:u,strokes:p,strokeWidth:x,highlighted:v,seriesId:this.id})),{fill:null!=(s=null==M?void 0:M.fill)?s:b,fillOpacity:null!=(r=null==M?void 0:M.fillOpacity)?r:S,stroke:null!=(n=null==M?void 0:M.stroke)?n:w,strokeWidth:null!=(o=null==M?void 0:M.strokeWidth)?o:x,strokeOpacity:null!=(a=null==M?void 0:M.strokeOpacity)?a:E}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t),this.nodeData=this.nodeData.map(e=>{var t=e,{radius:i}=t,s=C(t,["radius"]);return v(y({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var e,t;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(t=null==(e=this.properties.title)?void 0:e.spacing)?t:0))-Math.max(0,-i)}update(e){return x(this,arguments,function*({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:null==e?void 0:e.width,seriesRectHeight:null==e?void 0:e.height},s=null!=wt(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY(),i=t.node.computeBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i,0,e),t.node.translationY=isFinite(e)?e:0}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(e)})}updateTitleNodes(){var e,t;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(e=this.labelGroup)||e.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(t=this.labelGroup)||t.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}})}updateSelections(){return x(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return x(this,null,function*(){const{itemSelection:e,highlightSelection:t,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:r}=this,n=(e,t)=>{let i=this.nodeData;t&&(i=i.map(e=>v(y({},e),{sectorFormat:y({},e.sectorFormat)}))),e.update(i,void 0,e=>this.getDatumId(e)),this.ctx.animationManager.isSkipped()&&e.cleanup()};n(e,!1),n(t,!0),i.update(this.nodeData,e=>{const t=new Ba;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Fo;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),s.update(this.nodeData,e=>{e.pointerEvents=1}),r.update(this.properties.innerLabels,e=>{e.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),s=1;t=Math.ceil(2*e+s)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){return x(this,null,function*(){const t=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==t?void 0:t.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{var i,s;e.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:t})});const s=(e,t,i,s)=>{const r=this.getSectorFormat(t.datum,t.itemId,s);t.sectorFormat.fill=r.fill,t.sectorFormat.stroke=r.stroke;const n=this.ctx.animationManager.isSkipped();n&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(s||n)&&(e.fill=r.fill,e.stroke=r.stroke),e.strokeWidth=r.strokeWidth,e.fillOpacity=r.fillOpacity,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,e.fillShadow=this.properties.shadow,e.cornerRadius=this.properties.cornerRadius,e.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=r.stroke?r.strokeWidth:0))/2:0,e.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((e,t,i)=>s(e,t,0,!1)),this.highlightSelection.each((e,i,r)=>{const n=(null==t?void 0:t.series)===this&&e.datum.itemId===t.itemId;s(e,i,0,!0),e.visible=n}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var e;const{calloutLine:t}=this.properties,i=t.length,s=t.strokeWidth,r=null!=(e=t.colors)?e:this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((e,t)=>{var o;const a=e.datum,{calloutLabel:l,outerRadius:c}=a;if((null==l?void 0:l.text)&&!l.hidden&&0!==c){e.visible=!0,e.strokeWidth=s,e.stroke=r[t%r.length],e.fill=void 0;const h=a.midCos*c,d=a.midSin*c;let u=a.midCos*(c+i),p=a.midSin*(c+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const e=l.box;let t=u,i=p;u<e.x?t=e.x:u>e.x+e.width&&(t=e.x+e.width),p<e.y?i=e.y:p>e.y+e.height&&(i=e.y+e.height);const s=t-u,r=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(r,2)),a=o-n;a>0&&(u+=s*a/o,p+=r*a/o)}e.x1=h,e.y1=d,e.x2=u,e.y2=p}else e.visible=!1})}getLabelOverflow(e,t,i){const s=i.x-this.centerX,r=i.x+i.width-this.centerX,n=i.y-this.centerY,o=i.y+i.height-this.centerY;let a=1;t.x+1<s?a=(t.x+t.width-s)/t.width:t.x+t.width-1>r&&(a=(r-t.x)/t.width);const l=t.y+1<n||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e,t=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const r=[{x:e.x+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+e.height+i},{x:e.x+t,y:e.y+e.height+i}],n=m(s,2);return r.some(e=>m(e.x,2)+m(e.y,2)>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:r}=t,n=e.convert(0),o=this.nodeData,a=this.nodeData.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>{var t;return e.midSin<0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),d=a.filter(e=>{var t;return e.midSin>=0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),u=new Fo,p=e=>{var t;const r=e.calloutLabel;if(null==r)return new er(0,0,0,0);const n=e.outerRadius+i.length+s,o=e.midCos*n,a=e.midSin*n+r.collisionOffsetY;return u.text=r.text,u.x=o,u.y=a,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(t=r.collisionTextAlign)?t:r.textAlign,textBaseline:r.textBaseline}),u.computeBBox()},g=(e,t,i)=>{const s=p(e).grow(r/2),n=p(t).grow(r/2);if(s.x<n.x+n.width&&s.x+s.width>n.x&&("to-top"===i?s.y<n.y+n.height:s.y+s.height>n.y)){const e="to-top"===i?s.y-n.y-n.height:s.y+s.height-n.y;t.calloutLabel.collisionOffsetY=e}},m=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],s=e[t];g(i,s,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],s=e[t];g(i,s,"to-bottom")}},f=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>p(e)),s=i.map(e=>e.clone().grow(r/2));let l=!1;for(let t=0;t<s.length&&!l;t++){const i=s[t];for(let r=t+1;r<e.length;r++){const e=s[r];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:s}=e;return{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}}),h=i.some(e=>c.some(t=>mg(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};m(l),m(c),f(h),f(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,color:o}=i,a=new Fo;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:c}=s,h=c.calloutLabel,d=t.convert(c.radius),u=Math.max(0,d);if(!(null==h?void 0:h.text)||0===u||h.hidden)return void(s.visible=!1);const p=u+r+n,g=c.midCos*p,m=c.midSin*p+h.collisionOffsetY,f={textAlign:null!=(l=h.collisionTextAlign)?l:h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=m,a.setFont(this.properties.calloutLabel),a.setAlign(f);const y=a.computeBBox();let v=h.text,C=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,e);v=h.text.length===t?h.text:`${h.text.substring(0,t)}…`,C=!i}s.text=v,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(f),s.fill=o,s.visible=C})}computeLabelsBBox(e,t){return x(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,r=s.length,{offset:n,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Fo;let h;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=d.text,c.x=0,c.y=e,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.computeBBox(),l.push(h))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+r+n,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;c.text=d.text,c.x=p,c.y=g,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=c.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(h){const e=t.y-this.centerY,i=new er(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(m.collidesBBox(i))return void(d.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,t),r=d.text.length>2&&e<2;if(i||r||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:er.merge(l)})}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:r,fontFamily:n,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=1===this.seriesItemEnabled.filter(Boolean).length;this.sectorLabelSelection.each((e,d)=>{const{sectorLabel:u,outerRadius:p}=d;let g=!1;if(u&&0!==p){const m=t*(1-a)+p*a+o;e.fill=l,e.fontStyle=s,e.fontWeight=r,e.fontSize=i,e.fontFamily=n,e.text=u.text,!c&&h?(e.x=0,e.y=0):(e.x=d.midCos*m,e.y=d.midSin*m),e.textAlign="center",e.textBaseline="middle";const f=e.computeBBox(),y=[[f.x,f.y],[f.x+f.width,f.y],[f.x+f.width,f.y+f.height],[f.x,f.y+f.height]],{startAngle:v,endAngle:C}=d,b={startAngle:v,endAngle:C,innerRadius:t,outerRadius:p};y.every(([e,t])=>pg(e,t,b))&&(g=!0)}e.visible=g})}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:r,fontWeight:n,fontSize:o,fontFamily:a,color:l,margin:c=2}=s;i.fontStyle=r,i.fontWeight=n,i.fontSize=o,i.fontFamily=a,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.computeBBox()),t.push(c)});const i=e=>0===e?0:t[e],s=e=>e===t.length-1?0:t[e],r=e.reduce((e,t,r)=>e+t.height+i(r)+s(r),0),n=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(n/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,n=-r/2;t<e.length;t++){const r=e[t].height+n+i(t);l.push(r),n=r+s(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(e){const{angleKey:t,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:r}=this.properties,{sectorLabel:n,calloutLabel:o,legendItem:a}=e;return r&&void 0!==a?a.text:i&&i!==t&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==t&&void 0!==(null==n?void 0:n.text)?n.text:void 0}pickNodeClosestDatum(e){return kg(this,e)}getTooltipHtml(e){var t;if(!this.properties.isValid())return il;const{datum:i,angleValue:s,sectorFormat:{fill:r},itemId:n}=e,o=_u(null==(t=this.properties.title)?void 0:t.text),a=We(s)?Ys(s):String(s),l=this.getDatumLegendName(e);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${a}`:a,backgroundColor:r},{datum:i,itemId:n,title:o,color:r,seriesId:this.id,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey})}getLegendData(e){var t,i,s,r,n;const{visible:o,processedData:a,dataModel:l}=this;if(!l||!(null==a?void 0:a.data.length)||"category"!==e)return[];const{angleKey:c,calloutLabelKey:h,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||h&&h!==c||d&&d!==c))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),f=(null==(t=this.properties.title)?void 0:t.showInLegend)&&this.properties.title.text,y=[];for(let e=0;e<a.data.length;e++){const{datum:t,values:l}=a.data[e],v=[];f&&v.push(f);const C=this.getLabels(t,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==C.legendItem?v.push(C.legendItem.text):h&&h!==c&&void 0!==(null==(i=C.calloutLabel)?void 0:i.text)?v.push(null==(s=C.calloutLabel)?void 0:s.text):d&&d!==c&&void 0!==(null==(r=C.sectorLabel)?void 0:r.text)&&v.push(null==(n=C.sectorLabel)?void 0:n.text),0===v.length)continue;const b=this.getSectorFormat(t,e,!1);y.push({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:o&&this.seriesItemEnabled[e],label:{text:v.join(" - ")},marker:{fill:b.fill,stroke:b.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?t[u]:void 0})}return y}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendItemName:r}=e;s.id===this.id?this.toggleSeriesItem(i,t):null!=r&&this.toggleOtherSeriesItems(r,t)}toggleSeriesItem(e,t){this.seriesItemEnabled[e]=t,this.nodeDataRefresh=!0}toggleOtherSeriesItems(e,t){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},r)=>{i[s]===e&&this.toggleSeriesItem(r,t)})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Rg(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Rr(this.id,"nodes",t,[this.itemSelection,this.highlightSelection],i.nodes),Rr(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Ou(this,"callout",t,this.calloutLabelSelection),Ou(this,"sector",t,this.sectorLabelSelection),Ou(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var e,t,i,s,r,n;const{itemSelection:o,highlightSelection:a,processedData:l,radiusScale:c,previousRadiusScale:h}=this,{animationManager:d}=this.ctx,u=null==(e=null==l?void 0:l.reduced)?void 0:e.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(t=null==u?void 0:u.moved.size)?t:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(n=null==(r=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:r.uniqueKeys)||n;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const f=Rg(!1,this.properties.rotation,c,h);Rr(this.id,"nodes",d,[o,a],f.nodes,(e,t)=>this.getDatumId(t),u),Rr(this.id,"innerCircle",d,[this.innerCircleSelection],f.innerCircle),Ou(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ou(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Ou(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,radiusScale:i,previousRadiusScale:s}=this,{animationManager:r}=this.ctx,n=Rg(!1,this.properties.rotation,i,s);Rr(this.id,"nodes",r,[e,t],n.nodes),Rr(this.id,"innerCircle",r,[this.innerCircleSelection],n.innerCircle),Fu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Fu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Fu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(e){var t,i,s;const{calloutLabelKey:r,sectorLabelKey:n,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?e[o]:r?e[r]:n?e[n]:void 0}getDatumId(e){const{index:t}=e,i=this.getDatumIdFromData(e.datum);return null!=i?String(i):`${t}`}onDataChange(){var e;const{data:t,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(e=null==t?void 0:t.map((e,t)=>{var s;return null==(s=i[t])||s}))?e:[]}computeFocusBounds(e){return Lg(this,e)}};Yg.className="PieSeries",Yg.type="pie";var qg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",instanceConstructor:Yg,themeTemplate:Fg,paletteFactory:Gg},Xg=["start","center","end"],Zg=["annotations","ranges","zoom"],Qg=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e.FloatingTop="floating-top",e.FloatingBottom="floating-bottom",e))(Qg||{}),Jg=Object.values(Qg),em=class extends vt{constructor(e,t){super(),this.onChange=e,this.onButtonsChange=t,this.align="start",this.position="top"}};S([Za(e=>{e.onChange(e.enabled)}),Kr(Qr)],em.prototype,"enabled",2),S([Za(e=>{e.onChange(e.enabled)}),Kr(Fn(["start","center","end"]),{optional:!0})],em.prototype,"align",2),S([Za(e=>{e.onChange(e.enabled)}),Kr(Fn(["top","right","bottom","left","floating-top","floating-bottom"]),{optional:!0})],em.prototype,"position",2),S([Za(e=>{e.onButtonsChange(e.buttons)}),Kr(ln,{optional:!0})],em.prototype,"buttons",2);var tm="ag-charts-toolbar",im={align:`${tm}__align`,button:`${tm}__button`,icon:`${tm}__icon`,label:`${tm}__label`},sm={top:`${tm}--top`,right:`${tm}--right`,bottom:`${tm}--bottom`,left:`${tm}--left`,"floating-top":`${tm}--floating-top`,"floating-bottom":`${tm}--floating-bottom`,hidden:`${tm}--hidden`,preventFlash:`${tm}--prevent-flash`,floatingHidden:`${tm}--floating-hidden`,align:{start:`${im.align}--start`,center:`${im.align}--center`,end:`${im.align}--end`},button:{hidden:`${im.button}--hidden`}},rm=`\n.${tm} {\n    align-items: center;\n    background: var(--ag-charts-toolbar-background-color);\n    border-bottom: var(--ag-charts-toolbar-border-critical);\n    border-top: var(--ag-charts-toolbar-border-critical);\n    border-left: var(--ag-charts-toolbar-border);\n    border-right: var(--ag-charts-toolbar-border);\n    display: flex;\n    flex-wrap: nowrap;\n    opacity: 1;\n    position: absolute;\n    transform: translateY(0);\n    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.${sm.hidden},\n.${sm.preventFlash} {\n    visibility: hidden;\n}\n\n.${sm.floatingHidden} {\n    opacity: 0;\n    transition: opacity 0.4s ease-in-out;\n}\n\n.${sm.top},\n.${sm.bottom} {\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    padding: 0 var(--ag-charts-toolbar-padding);\n    width: 100%;\n}\n\n.${sm.left},\n.${sm.right} {\n    flex-direction: column;\n    padding: var(--ag-charts-toolbar-padding) 0;\n    width: var(--ag-charts-toolbar-size);\n}\n\n.${sm["floating-top"]},\n.${sm["floating-bottom"]} {\n    background: none;\n    border: none;\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    overflow: hidden;\n    padding: 0 var(--ag-charts-toolbar-padding);\n    pointer-events: none;\n    width: 100%;\n}\n\n.${im.align} {\n    display: flex;\n    flex-direction: inherit;\n    flex-wrap: inherit;\n    max-width: 100%;\n}\n\n.${sm.align.center},\n.${sm.align.end} {\n    margin-left: auto;\n}\n\n.${sm.left} .${sm.align.center},\n.${sm.left} .${sm.align.end},\n.${sm.right} .${sm.align.center},\n.${sm.right} .${sm.align.end} {\n    margin-left: 0;\n    margin-top: auto;\n}\n\n.${sm["floating-top"]} .${im.align},\n.${sm["floating-bottom"]} .${im.align} {\n    gap: var(--ag-charts-toolbar-gap);\n    transition: transform 0.4s ease-in-out;\n}\n\n.${im.button} {\n    align-items: center;\n    border-radius: var(--ag-charts-button-radius);\n    color: var(--ag-charts-toolbar-foreground-color);\n    display: flex;\n    font-size: 14px;\n    font-weight: 500;\n    justify-content: center;\n    margin: 0;\n    padding: var(--ag-charts-button-padding);\n    pointer-events: all;\n    transition: background-color .25s ease-in-out;\n}\n\n.${sm.left} .${im.button},\n.${sm.right} .${im.button} {\n    height: var(--ag-charts-toolbar-size);\n    max-width: 100%;\n    overflow: hidden;\n}\n\n.${sm["floating-top"]} .${im.button},\n.${sm["floating-bottom"]} .${im.button} {\n    background: var(--ag-charts-toolbar-background-color);\n    border: var(--ag-charts-toolbar-border-critical);\n}\n\n.${sm.button.hidden} {\n    display: none;\n}\n\n.${im.button}:hover {\n    background: var(--ag-charts-toolbar-hover-color);\n}\n\n.${im.button}:disabled {\n    background: var(--ag-charts-toolbar-disabled-background-color);\n    color: var(--ag-charts-toolbar-disabled-foreground-color);\n}\n\n.${im.button}:not([disabled]) {\n    cursor: pointer;\n}\n\n.${im.icon} {\n    height: 1.2em;\n    width: 1.2em;\n}\n\n.${im.icon} + .${im.label} {\n    margin-left: var(--ag-charts-size);\n}\n\n.${im.icon},\n.${im.label} {\n    pointer-events: none;\n}\n\n`,nm=class extends we{constructor(e){super(),this.ctx=e,this.enabled=!0,this.annotations=new em(this.onGroupChanged.bind(this,"annotations"),this.onGroupButtonsChanged.bind(this,"annotations")),this.ranges=new em(this.onGroupChanged.bind(this,"ranges"),this.onGroupButtonsChanged.bind(this,"ranges")),this.zoom=new em(this.onGroupChanged.bind(this,"zoom"),this.onGroupButtonsChanged.bind(this,"zoom")),this.margin=10,this.floatingDetectionRange=28,this.positions={top:new Set,right:new Set,bottom:new Set,left:new Set,"floating-top":new Set,"floating-bottom":new Set},this.positionAlignments={top:{},right:{},bottom:{},left:{},"floating-top":{},"floating-bottom":{}},this.groupCallers={annotations:0,ranges:0,zoom:0},this.groupButtons={annotations:[],ranges:[],zoom:[]},this.pendingButtonToggledEvents=[],this.groupProxied=new Set,this.container=e.toolbarManager.element,this.elements={top:this.container.appendChild(xs("div")),right:this.container.appendChild(xs("div")),bottom:this.container.appendChild(xs("div")),left:this.container.appendChild(xs("div")),"floating-top":this.container.appendChild(xs("div")),"floating-bottom":this.container.appendChild(xs("div"))},Ms(rm,tm),this.renderToolbar("top"),this.renderToolbar("right"),this.renderToolbar("bottom"),this.renderToolbar("left"),this.renderToolbar("floating-top"),this.renderToolbar("floating-bottom"),this.toggleVisibilities(),this.destroyFns.push(e.interactionManager.addListener("hover",this.onHover.bind(this),31),e.interactionManager.addListener("leave",this.onLeave.bind(this),31),e.toolbarManager.addListener("button-toggled",this.onButtonToggled.bind(this)),e.toolbarManager.addListener("group-toggled",this.onGroupToggled.bind(this)),e.toolbarManager.addListener("proxy-group-options",this.onProxyGroupOptions.bind(this)),e.layoutService.addListener("layout-complete",this.onLayoutComplete.bind(this)),()=>this.destroyElements())}destroyElements(){for(const e of Object.values(this.elements))e.remove()}onHover(e){const{enabled:t,elements:i,floatingDetectionRange:s,ctx:{scene:r}}=this,{offsetY:n,sourceEvent:{target:o}}=e,{FloatingBottom:a,FloatingTop:l}=Qg;if(!t)return;const c=i[a],h=i[l],d=n>c.offsetTop-s&&n<r.canvas.element.offsetHeight||o===c,u=h.offsetTop+h.offsetHeight+s,p=n>0&&n<u||o===h;c.classList.toggle(sm.floatingHidden,!d),h.classList.toggle(sm.floatingHidden,!p),this.translateFloatingElements(a,d),this.translateFloatingElements(l,p)}onLeave(e){const{enabled:t,elements:i,ctx:{scene:s}}=this,{relatedTarget:r,target:n}=e.sourceEvent,{FloatingBottom:o,FloatingTop:a}=Qg;t&&n===s.canvas.element&&(Zg.some(e=>this.groupButtons[e].some(e=>e===r))||(i[o].classList.add(sm.floatingHidden),i[a].classList.add(sm.floatingHidden),this.translateFloatingElements(o,!1),this.translateFloatingElements(a,!1)))}onGroupChanged(e){null==this[e]||this.groupProxied.has(e)||(this.createGroup(e),this.toggleVisibilities())}onGroupButtonsChanged(e,t){this.enabled&&!this.groupProxied.has(e)&&(this.createGroupButtons(e,t),this.toggleVisibilities())}onLayoutComplete(){for(const e of Jg)this.elements[e].classList.remove(sm.preventFlash)}onButtonToggled(e){const{group:t,value:i,enabled:s}=e;if(0!==this.groupButtons[t].length)for(const e of this.groupButtons[t])e.dataset.toolbarValue===`${i}`&&(e.disabled=!s);else this.pendingButtonToggledEvents.push(e)}onGroupToggled(e){const{group:t,visible:i}=e;this.toggleGroup(t,i),this.toggleVisibilities()}onProxyGroupOptions(e){const{group:t,options:i}=e;this.groupProxied.add(t),this.createGroup(t,i.enabled,i.position),this.createGroupButtons(t,i.buttons),this.toggleGroup(t,i.enabled),this[t].set(i)}createGroup(e,t,i){null!=t||(t=this[e].enabled),null!=i||(i=this[e].position);for(const s of Jg)t&&i===s?this.positions[s].add(e):this.positions[s].delete(e)}createGroupButtons(e,t){var i,s;for(const t of this.groupButtons[e])t.remove();this.groupButtons[e]=[];const r=null!=(i=this[e].align)?i:"start",n=null!=(s=this[e].position)?s:"top",o=this.positionAlignments[n][r];for(const i of null!=t?t:[]){const t=this.createButtonElement(e,i);null==o||o.appendChild(t),this.groupButtons[e].push(t)}}toggleGroup(e,t){t?this.groupCallers[e]+=1:this.groupCallers[e]=Math.max(0,this.groupCallers[e]-1)}processPendingEvents(){var e;const t=(null!=(e=this.pendingButtonToggledEvents)?e:[]).slice();for(const e of t)this.onButtonToggled(e);this.pendingButtonToggledEvents=[]}performLayout(e){return x(this,arguments,function*({shrinkRect:e}){const{elements:t,margin:i}=this;return t.top.classList.contains(sm.hidden)||e.shrink(t.top.offsetHeight+2*i,"top"),t.right.classList.contains(sm.hidden)||e.shrink(t.right.offsetWidth+i,"right"),t.bottom.classList.contains(sm.hidden)||e.shrink(t.bottom.offsetHeight+2*i,"bottom"),t.left.classList.contains(sm.hidden)||e.shrink(t.left.offsetWidth+i,"left"),{shrinkRect:e}})}performCartesianLayout(e){return x(this,null,function*(){const{elements:t,margin:i}=this,{seriesRect:s}=e,{FloatingBottom:r,FloatingTop:n}=Qg;t.top.style.top=s.y-t.top.offsetHeight-2*i+"px",t.top.style.left=`${i}px`,t.top.style.width=`calc(100% - ${2*i}px)`,t.right.style.top=`${s.y+i}px`,t.right.style.right=`${i}px`,t.right.style.height=`calc(100% - ${s.y+2*i}px)`,t.bottom.style.bottom=`${i}px`,t.bottom.style.left=`${i}px`,t.bottom.style.width=`calc(100% - ${2*i}px)`,t.left.style.top=`${s.y}px`,t.left.style.left=`${i}px`,t.left.style.height=`calc(100% - ${s.y+2*i}px)`,t[n].style.top=`${s.y}px`,t[n].style.paddingTop=`${i}px`,t[r].style.top=s.y+s.height-t[r].offsetHeight+"px",t[r].style.paddingBottom=`${i}px`})}toggleVisibilities(){var e;if(null==this.elements)return;const t=e=>this[e].enabled&&this.groupCallers[e]>0,i=e=>t=>"string"!=typeof t.value&&"number"!=typeof t.value||`${t.value}`===e.dataset.toolbarValue;for(const e of Jg){const i=this.enabled&&Array.from(this.positions[e].values()).some(t);this.elements[e].classList.toggle(sm.hidden,!i)}for(const s of Zg){if(null==this[s])continue;const r=t(s);for(const t of this.groupButtons[s]){const n=r&&(null==(e=this[s].buttons)?void 0:e.some(i(t)));t.classList.toggle(sm.button.hidden,!n)}}}translateFloatingElements(e,t){const{elements:i,margin:s,positionAlignments:r}=this,n=i[e],o=Object.values(r[e]);for(const e of o)e.style.transform=t&&""!==e.style.transform?"translateY(0)":`translateY(${n.offsetHeight+s}px)`}renderToolbar(e="top"){const t=this.elements[e];t.classList.add(tm,sm[e],sm.preventFlash),"floating-top"!==e&&"floating-bottom"!==e||t.classList.add(sm.floatingHidden);for(const i of Xg){const s=xs("div");s.classList.add(im.align,sm.align[i]),t.appendChild(s),this.positionAlignments[e][i]=s}}createButtonElement(e,t){const i=xs("button");i.classList.add(im.button),i.dataset.toolbarGroup=e,i.tabIndex=-1,"string"!=typeof t.value&&"number"!=typeof t.value||(i.dataset.toolbarValue=`${t.value}`),t.tooltip&&(i.title=t.tooltip);let s="";return null!=t.icon&&(s=`<span class="ag-charts-icon-${t.icon} ${im.icon}"></span>`),null!=t.label&&(s=`${s}<span class="${im.label}">${t.label}</span>`),i.innerHTML=s,i.onclick=this.onButtonPress.bind(this,e,t.value),this.destroyFns.push(()=>i.remove()),i}onButtonPress(e,t){this.ctx.toolbarManager.pressButton(e,t)}};S([Za(e=>{e.processPendingEvents(),e.toggleVisibilities()}),Kr(Qr)],nm.prototype,"enabled",2);var om=864e5,am=30*om,lm={type:"root",optionsKey:"toolbar",packageType:"community",chartTypes:["cartesian"],instanceConstructor:nm,themeTemplate:{toolbar:{enabled:!0,annotations:{enabled:!1,position:"left",align:"start",buttons:[{label:"Li",value:"line"},{label:"PCh",value:"parallel-channel"}]},ranges:{enabled:!1,position:"top",align:"start",buttons:[{label:"1m",value:am},{label:"3m",value:3*am},{label:"6m",value:6*am},{label:"YTD",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"1y",value:365*om},{label:"All",value:(e,t)=>[e,t]}]},zoom:{enabled:!1,position:"top",align:"end",buttons:[{icon:"zoom-out",tooltip:"Zoom out",value:"zoom-out"},{icon:"zoom-in",tooltip:"Zoom in",value:"zoom-in"},{icon:"pan-left",tooltip:"Pan left",value:"pan-left"},{icon:"pan-right",tooltip:"Pan right",value:"pan-right"},{icon:"pan-start",tooltip:"Pan to the start",value:"pan-start"},{icon:"pan-end",tooltip:"Pan to the end",value:"pan-end"},{icon:"reset",tooltip:"Reset the zoom",value:"reset"}]}}}};var cm=class e extends nd{constructor(e,t){super(e,t)}performLayout(){return x(this,null,function*(){const t=yield w(e.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:r,highlightRoot:n}=this,o=t.clone();t.shrink(i.left,"left"),t.shrink(i.top,"top"),t.shrink(i.right,"right"),t.shrink(i.bottom,"bottom"),this.seriesRect=t,this.animationRect=t,this.hoverRect=t;for(const e of[s,r,n])e.translationX=Math.floor(t.x),e.translationY=Math.floor(t.y);return yield Promise.all(this.series.map(e=>x(this,null,function*(){yield e.update({seriesRect:t})}))),s.visible=this.series[0].visible,s.setClipRectInGroupCoordinateSpace(new er(t.x,t.y,t.width,t.height)),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:t,visible:!0},axes:[]}),t})}};cm.className="HierarchyChart",cm.type="hierarchy";var hm=cm,dm=class extends xl{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}computeLabelsBBox(e,t){return null}};S([Kr(Fn(["polygon","circle"],"a polar axis shape"))],dm.prototype,"shape",2),S([Kr(nn)],dm.prototype,"innerRadiusRatio",2);var um=class e extends nd{constructor(e,t){super(e,t),this.padding=new Ql(40),this.axisGroup.zIndex=6}performLayout(){return x(this,null,function*(){const t=yield w(e.prototype,this,"performLayout").call(this),i=t.clone();return this.computeSeriesRect(t),yield this.computeCircle(t),this.axes.forEach(e=>e.update()),this.hoverRect=t,this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:i,paddedRect:t,visible:!0},axes:[]}),t})}updateAxes(e,t,i){var s,r;const n=this.axes.find(e=>"x"===e.direction),o=this.axes.find(e=>"y"===e.direction);if(!(n instanceof dm&&o instanceof dm))return;const a=n.scale,l=null==(s=a.ticks)?void 0:s.call(a).map(e=>a.convert(e)),c=o.innerRadiusRatio;n.innerRadiusRatio=c,null==(r=n.computeRange)||r.call(n),n.gridLength=i,o.gridAngles=l,o.gridRange=n.range,o.range=[i,i*c],[n,o].forEach(i=>{i.translation.x=e,i.translation.y=t,i.calculateLayout()})}computeSeriesRect(e){const{seriesArea:{padding:t}}=this;e.shrink(t.left,"left"),e.shrink(t.top,"top"),e.shrink(t.right,"right"),e.shrink(t.bottom,"bottom"),this.seriesRect=e,this.animationRect=e}computeCircle(e){return x(this,null,function*(){const t=this.series.filter(e=>e instanceof Ng),i=this.axes.filter(e=>e instanceof dm),s=(e,i,s)=>{this.updateAxes(e,i,s),t.forEach(t=>{t.centerX=e,t.centerY=i,t.radius=s});const r=t.filter(e=>e instanceof Yg||e instanceof Og);if(r.length>1){const e=r.map(e=>{const t=e.getInnerRadius();return{series:e,innerRadius:t}}).sort((e,t)=>e.innerRadius-t.innerRadius);e.at(-1).series.surroundingRadius=void 0;for(let t=0;t<e.length-1;t++)e[t].series.surroundingRadius=e[t+1].innerRadius}},r=e.x+e.width/2,n=e.y+e.height/2,o=Math.max(0,Math.min(e.width,e.height)/2);let a=o;s(r,n,a);const l=(...l)=>x(this,[...l],function*({hideWhenNecessary:l=!1}={}){const c=[];for(const s of[...i,...t]){const t=yield s.computeLabelsBBox({hideWhenNecessary:l},e);t&&c.push(t)}if(0===c.length)return void s(r,n,o);const h=er.merge(c),d=this.refineCircle(h,a,e);s(d.centerX,d.centerY,d.radius),d.radius!==a&&(a=d.radius)});return yield l(),yield l(),yield l(),yield l({hideWhenNecessary:!0}),yield l({hideWhenNecessary:!0}),{radius:a,centerX:r,centerY:n}})}refineCircle(e,t,i){const s=-t,r=-t,n=t,o=t;let a=Math.max(0,s-e.x),l=Math.max(0,r-e.y),c=Math.max(0,e.x+e.width-n),h=Math.max(0,e.y+e.height-o);a=c=Math.max(a,c),l=h=Math.max(l,h);const d=i.width-a-c,u=i.height-l-h;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,f=Math.min(g,m);if(p<f){p=f;const e=a+c;if(2*p+(l+h)>i.height){const e=i.height-2*p;2*Math.min(l,h)>e?(l=e/2,h=e/2):l>h?l=e-h:h=e-l}if(2*p+e>i.width){const e=i.width-2*p;2*Math.min(a,c)>e?(a=e/2,c=e/2):a>c?a=e-c:c=e-a}}const y=a+2*p+c,v=l+2*p+h;return{centerX:i.x+(i.width-y)/2+a+p,centerY:i.y+(i.height-v)/2+l+p,radius:p}}};um.className="PolarChart",um.type="polar";var pm=um,gm=Math.PI/180,mm=e=>e*gm,fm=e=>-Math.log(Math.tan(.25*Math.PI+e*gm*.5)),ym=e=>e/gm,vm=e=>(Math.atan(Math.exp(-e))-.25*Math.PI)/(.5*gm),Cm=class e{constructor(t,i){this.domain=t,this.range=i,this.type="mercator",this.bounds=e.bounds(t)}static bounds(e){const[[t,i],[s,r]]=e,n=mm(t),o=fm(i),a=mm(s),l=fm(r);return new er(Math.min(n,a),Math.min(o,l),Math.abs(a-n),Math.abs(l-o))}static fixedScale(){return new e([[ym(0),vm(0)],[ym(1),vm(1)]],[[0,0],[1,1]])}convert([e,t]){const[[i,s],[r,n]]=this.range,o=(r-i)/this.bounds.width,a=(n-s)/this.bounds.height;return[(mm(e)-this.bounds.x)*o+i,(fm(t)-this.bounds.y)*a+s]}invert([e,t]){const[[i,s],[r,n]]=this.range,o=(r-i)/this.bounds.width,a=(n-s)/this.bounds.height;return[ym((e-i)/o+this.bounds.x),vm((t-s)/a+this.bounds.y)]}};function bm(e){return"map-shape"===e.type||"map-line"===e.type||"map-marker"===e.type||"map-shape-background"===e.type||"map-line-background"===e.type}var Sm=class e extends nd{constructor(e,t){super(e,t),this.xAxis=new Jd(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Jd(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}updateData(){return x(this,null,function*(){yield w(e.prototype,this,"updateData").call(this);const{topology:t}=this.getOptions();this.series.forEach(e=>{bm(e)&&e.setChartTopology(t)})})}performLayout(){return x(this,null,function*(){const t=yield w(e.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:r,highlightRoot:n}=this,o=t.clone();t.shrink(i.left,"left"),t.shrink(i.top,"top"),t.shrink(i.right,"right"),t.shrink(i.bottom,"bottom"),this.seriesRect=t,this.animationRect=t,this.hoverRect=t;const a=this.series.filter(bm),l=a.reduce((e,t)=>{if(!t.visible)return e;const i=t.topologyBounds;return null==i?e:null==e?i:(e.merge(i),e)},void 0);let c;if(null!=l){const{lon0:e,lat0:i,lon1:s,lat1:r}=l,n=[[e,i],[s,r]],o=Cm.bounds(n),{width:a,height:h}=t,d=Math.min(a/o.width,h/o.height),u=o.width*d,p=o.height*d,g=(a-u)/2,m=(h-p)/2,f=g,y=m,v=g+u,C=m+p,b=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),S=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),w=(v-f)/(b.max-b.min),x=f-w*b.min,E=(C-y)/(1-S.min-(1-S.max)),M=y-E*(1-S.max);c=new Cm(n,[[x,M],[x+w,M+E]])}a.forEach(e=>{e.scale=c});const h=this.series.some(e=>e.visible);s.visible=h;for(const e of[s,r,n])e.translationX=Math.floor(t.x),e.translationY=Math.floor(t.y),e.setClipRectInGroupCoordinateSpace(new er(t.x,t.y,t.width,t.height));return this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:t,visible:h},axes:[]}),t})}};Sm.className="TopologyChart",Sm.type="topology";var wm=Sm,xm=Is.create(!0,"opts");function Em(e){if(pt(e))return"cartesian";if(gt(e))return"polar";if(mt(e))return"hierarchy";if(ft(e))return"topology";throw new Error(`AG Chart - unknown type of chart for options with type: ${e.type}`)}var Mm=class e{static licenseCheck(e){var t,i,s,r;this.licenseChecked||(this.licenseManager=null==(i=(t=Se).licenseManager)?void 0:i.call(t,e),null==(s=this.licenseManager)||s.setLicenseKey(this.licenseKey,this.gridContext),null==(r=this.licenseManager)||r.validateLicense(),this.licenseChecked=!0)}static setLicenseKey(e){this.licenseKey=e}static setGridContext(e){this.gridContext=e}static getLicenseDetails(e){var t,i;return null==(i=(t=Se).licenseManager)?void 0:i.call(t,{}).getLicenseDetails(e)}static getInstance(e){return Im.getInstance(e)}static create(e){var t,i,s;this.licenseCheck(e);const r=Im.createOrUpdate(e);return(null==(t=this.licenseManager)?void 0:t.isDisplayWatermark())&&(null==(s=(i=Se).injectWatermark)||s.call(i,r.chart.element,this.licenseManager.getWatermarkMessage())),r}static update(t,i){if(!Xd.isInstance(t))throw new Error(e.INVALID_CHART_REF_MESSAGE);Im.createOrUpdate(i,t)}static updateDelta(t,i){if(!Xd.isInstance(t))throw new Error(e.INVALID_CHART_REF_MESSAGE);Im.updateUserDelta(t,i)}static download(t,i){if(!(t instanceof Xd))throw new Error(e.INVALID_CHART_REF_MESSAGE);Im.download(t,i).catch(e=>_.errorOnce(e))}static getImageDataURL(t,i){if(!(t instanceof Xd))throw new Error(e.INVALID_CHART_REF_MESSAGE);return Im.getImageDataURL(t,i)}};Mm.INVALID_CHART_REF_MESSAGE="AG Charts - invalid chart reference passed",Mm.licenseChecked=!1,Mm.gridContext=!1;var Am=Mm,Tm=class{static warnDeprecated(e){ks()(`AgChart.${e}`,`Use AgCharts.${e} instead`)}static create(e){return this.warnDeprecated("create"),Am.create(e)}static update(e,t){return this.warnDeprecated("update"),Am.update(e,t)}static updateDelta(e,t){return this.warnDeprecated("updateDelta"),Am.updateDelta(e,t)}static download(e,t){return this.warnDeprecated("download"),Am.download(e,t)}static getImageDataURL(e,t){return this.warnDeprecated("getImageDataURL"),Am.getImageDataURL(e,t)}},Dm=class e{static getInstance(e){const t=nd.getInstance(e);return t?Xd.chartInstances.get(t):void 0}static initialiseModules(){e.initialised||(function(){xe.register(hu,Mu,Ru,lm,Tp,$p,tg,ag,dg,Bg,qg,rg);for(const e of[Jd,Dl,su,Bl,tu])Ee.register(e.type,{instanceConstructor:e,hidden:e===Bl})}(),function(){for(const e of xe.modules){if("enterprise"!==e.packageType||dt(e)||_.errorOnce("Unexpected enterprise module registered: "+e.identifier),"root"===e.type&&e.themeTemplate)for(const t of e.chartTypes)lt.set(t,e.themeTemplate);if("series"===e.type){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);It.register(e.identifier,e)}if("series-option"===e.type&&e.themeTemplate)for(const t of e.seriesTypes)It.setThemeTemplate(t,e.themeTemplate);if("axis-option"===e.type&&e.themeTemplate)for(const t of e.axisTypes){const i=e.themeTemplate[t],s=y(y({},e.themeTemplate),i);for(const t of e.axisTypes)delete s[t];Ee.setThemeTemplate(t,s)}"axis"===e.type&&Ee.register(e.identifier,e),"legend"===e.type&&Rt.register(e.identifier,e)}if(xe.hasEnterpriseModules()){const e=ct.filter(({useCount:e})=>null==e||0===e);e.length>0&&_.errorOnce("Enterprise modules expected but not registered: ",e)}}(),e.initialised=!0)}static createOrUpdate(t,i){e.initialiseModules(),xm(">>> AgChartV2.createOrUpdate() user options",t);const s=t,{overrideDevicePixelRatio:r,document:n,window:o}=s,a=C(s,["overrideDevicePixelRatio","document","window"]),l=new Ps(a,{overrideDevicePixelRatio:r,document:n,window:o});let c=null==i?void 0:i.chart;return null!=c&&Em(a)===Em(c.processedOptions)||(c=e.createChartInstance(l,c)),null==i?i=new Xd(c):i.chart=c,xm.check()&&"undefined"!=typeof window&&(null!=window.agChartInstances||(window.agChartInstances={}),window.agChartInstances[c.id]=c),c.queuedUserOptions.push(a),c.requestFactoryUpdate(e=>{e.applyOptions(l),e.queuedUserOptions.splice(0,e.queuedUserOptions.indexOf(a))}),i}static updateUserDelta(t,i){Mt(i=xt(i,{shallow:["data"]}),e=>{if("object"==typeof e)for(const[t,i]of Object.entries(e))void 0===i&&Object.assign(e,{[t]:Symbol("UNSET")})},{skip:["data"]});const{chart:s}=t,r=s.getOptions(),n=Xe(i,r);xm(">>> AgChartV2.updateUserDelta() user delta",i),xm("AgChartV2.updateUserDelta() - base options",r),e.createOrUpdate(n,t)}static download(t,i){return x(this,null,function*(){try{const s=yield e.prepareResizedChart(t,i);s.chart.ctx.scene.download(null==i?void 0:i.fileName,null==i?void 0:i.fileFormat),s.destroy()}catch(e){_.errorOnce(e)}})}static getImageDataURL(t,i){return x(this,null,function*(){const s=yield e.prepareResizedChart(t,i),r=s.chart.ctx.scene.getDataURL(null==i?void 0:i.fileFormat);return s.destroy(),r})}static prepareResizedChart(t){return x(this,arguments,function*({chart:t},i={}){var s,r,n,o;const a=null!=(r=null!=(s=i.width)?s:t.width)?r:t.ctx.scene.canvas.width,l=null!=(o=null!=(n=i.height)?n:t.height)?o:t.ctx.scene.canvas.height,c=Xe({container:document.createElement("div"),overrideDevicePixelRatio:1,autoSize:!1,width:a,height:l},xe.hasEnterpriseModules()&&{animation:{enabled:!1}},t.userOptions),h=e.createOrUpdate(c);return h.chart.ctx.zoomManager.updateZoom("agChartV2",t.ctx.zoomManager.getZoom()),t.series.forEach((e,t)=>{e.visible||(h.chart.series[t].visible=!1)}),t.update(0,{forceNodeDataRefresh:!0}),yield h.chart.waitForUpdate(),h})}static createChartInstance(t,i){const s=null==i?void 0:i.destroy({keepTransferableResources:!0});return new(e.getChartByOptions(t.processedOptions))(t,s)}static getChartByOptions(e){if(pt(e))return Yd;if(mt(e))return hm;if(gt(e))return pm;if(ft(e))return wm;throw new Error("AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified")}};Dm.initialised=!1;var Im=Dm,Rm="9.3.2",Pm={};b(Pm,{Arc:()=>km,BBox:()=>er,BandScale:()=>Wr,Caption:()=>al,ChangeDetectableProperties:()=>Bu,Circle:()=>vd,ContinuousScale:()=>Xn,Diamond:()=>wd,DropShadow:()=>Vu,ExtendedPath2D:()=>hd,Group:()=>Eo,HdpiCanvas:()=>Hl,Image:()=>Fm,Label:()=>Vo,Line:()=>Ba,LinearGradientFill:()=>Lm,LinearScale:()=>Zd,Marker:()=>yd,Node:()=>cr,OrdinalTimeScale:()=>Co,Path:()=>ud,PointerEvents:()=>ar,RadialColumnShape:()=>_m,Rect:()=>lu,RedrawType:()=>tr,Scene:()=>Yl,SceneChangeDetection:()=>sr,ScenePathChangeDetection:()=>dd,Sector:()=>wg,SectorBox:()=>ug,Selection:()=>_a,Shape:()=>Io,Square:()=>Td,Text:()=>Fo,Tooltip:()=>ol,Triangle:()=>Rd,easing:()=>mr,getFont:()=>Bo,getMarker:()=>Nd,getRadialColumnWidth:()=>Om,motion:()=>Gm,nearestSquared:()=>Zs,nearestSquaredInContainer:()=>Qs,toRadians:()=>Gr,toTooltipHtml:()=>rl});var km=class extends ud{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return js(Nr(this.startAngle),Nr(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?e.closePath():2!==this.type||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new er(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(e,t){const i=this.transformPoint(e,t),s=this.computeBBox();return 0!==this.type&&s.containsPoint(i.x,i.y)&&this.path.isPointInPath(i.x,i.y)}};km.className="Arc",km.defaultStyles=Object.assign({},Io.defaultStyles,{lineWidth:1,fillStyle:null}),S([dd()],km.prototype,"centerX",2),S([dd()],km.prototype,"centerY",2),S([dd()],km.prototype,"radius",2),S([dd()],km.prototype,"startAngle",2),S([dd()],km.prototype,"endAngle",2),S([dd()],km.prototype,"counterClockwise",2),S([dd()],km.prototype,"type",2);var Lm=class extends Io{constructor(){super(...arguments),this.direction="to-right",this.stops=void 0,this._mask=void 0}get mask(){return this._mask}set mask(e){null!=this._mask&&this.removeChild(this._mask),null!=e&&this.appendChild(e),this._mask=e}isPointInPath(e,t){var i,s;return null!=(s=null==(i=this.mask)?void 0:i.isPointInPath(e,t))&&s}computeBBox(){var e;return null==(e=this.mask)?void 0:e.computeBBox()}render(e){const{mask:t,stops:i}=this,{ctx:s,devicePixelRatio:r}=e,n=1/r,o=null==t?void 0:t.computeTransformedBBox();if(null==t||null==i||null==o)return;t.dirtyPath&&(t.updatePath(),t.dirtyPath=!1),s.save(),s.clip(t.path.getPath2D()),s.setTransform(r,0,0,r,0,0);const a=Math.floor(o.x),l=Math.ceil(o.x+o.width),c=Math.floor(o.y),h=Math.ceil(o.y+o.height),d=new qp,[u,p]="to-right"===this.direction?[a,l]:[c,h];if(d.domain=i.map((e,t)=>u+(p-u)*t/(i.length-1)),d.range=i,d.update(),"to-right"===this.direction){const e=h-c;for(let t=a;t<=l;t+=n)s.fillStyle=d.convert(t),s.fillRect(t,c,n,e)}else{const e=l-a;for(let t=c;t<=h;t+=n)s.fillStyle=d.convert(t),s.fillRect(a,t,e,n)}s.restore()}};function Nm(e,t,i){const s=Math.sqrt(m(e,2)+m(t,2)),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}S([sr({redraw:3})],Lm.prototype,"direction",2),S([sr({redraw:3})],Lm.prototype,"stops",2),S([sr({redraw:3})],Lm.prototype,"_mask",2);var _m=class extends ud{constructor(){super(...arguments),this.borderPath=new hd,this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}getRotation(){const{startAngle:e,endAngle:t}=this;return Nr(e+Vr(e,t)/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,r=-e/2,n=e/2,o=-i,a=-t,l=this.getRotation(),c=[[r,a],[r,o],[n,o],[n,a],[r,a]].map(([e,t])=>Nm(e,t,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.lineTo(c[0].x,c[0].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:r,axisOuterRadius:n,isRadiusAxisReversed:o}=this,a=js(s,r),l=Math.asin(e/2/s),c=this.getRotation(),h=(e,t)=>Nm(e,t,c),d=(e,t)=>Math.sqrt(m(e,2)+m(t,2)),u=(e,t)=>t>e?0:Math.sqrt(m(e,2)-m(t,2)),p=(e,t,i)=>i?e<t:e>t,g=a&&!isNaN(l)&&l<Math.PI/6;let f=-e/2,y=e/2;const v=-i,C=-s*(g?Math.cos(l):1),b=p(n,d(s,e/2),!o);if(b){const e=u(n,s);f=-e,y=e}t.clear(!0);const S=h(f,C);t.moveTo(S.x,S.y);const w=js(s,i),x=p(n,d(i,e/2),!o);if(w&&g)t.arc(0,0,s,Nr(-l-Math.PI/2)+c,Nr(l-Math.PI/2)+c,!1);else if(x){const s=-u(n,e/2),r=u(n,i);if(!b){const e=h(f,s);t.lineTo(e.x,e.y)}if(t.arc(0,0,n,Math.atan2(s,f)+c,Math.atan2(v,-r)+c,!1),!js(r,0)){const e=h(r,v);t.lineTo(e.x,e.y)}t.arc(0,0,n,Math.atan2(v,r)+c,Math.atan2(s,y)+c,!1)}else{const e=h(f,v),i=h(y,v);t.lineTo(e.x,e.y),t.lineTo(i.x,i.y)}const E=h(y,C);if(t.lineTo(E.x,E.y),g)t.arc(0,0,s,Nr(l-Math.PI/2)+c,Nr(-l-Math.PI/2)+c,!0);else{const e=h(f,C);t.lineTo(e.x,e.y)}t.closePath()}};function Om(e,t,i,s,r){const n=Vr(e,t),o=n*(1-s)/2;if(e+=o,t-=o,n<.001)return 2*i*r;if(n>=2*Math.PI){const i=e+n/2;e=i-Math.PI,t=i+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),d=Math.floor(Math.sqrt(m(a-c,2)+m(l-h,2))),u=2*i*r;return Math.max(1,Math.min(u,d))}_m.className="RadialColumnShape",S([dd()],_m.prototype,"isBeveled",2),S([dd()],_m.prototype,"columnWidth",2),S([dd()],_m.prototype,"startAngle",2),S([dd()],_m.prototype,"endAngle",2),S([dd()],_m.prototype,"outerRadius",2),S([dd()],_m.prototype,"innerRadius",2),S([dd()],_m.prototype,"axisInnerRadius",2),S([dd()],_m.prototype,"axisOuterRadius",2),S([dd()],_m.prototype,"isRadiusAxisReversed",2);var Fm=class extends cr{constructor(e){super(),this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1,this.sourceImage=e}render(e){const{ctx:t,forceRender:i,stats:s}=e;if(0===this.dirty&&!i)return void(s&&s.nodesSkipped++);this.computeTransformMatrix(),this.matrix.toContext(t);const r=this.sourceImage;t.globalAlpha=this.opacity,t.drawImage(r,0,0,r.width,r.height,this.x,this.y,this.width,this.height),super.render(e)}};S([sr({redraw:3})],Fm.prototype,"x",2),S([sr({redraw:3})],Fm.prototype,"y",2),S([sr({redraw:3})],Fm.prototype,"width",2),S([sr({redraw:3})],Fm.prototype,"height",2),S([sr({redraw:3})],Fm.prototype,"opacity",2);var Gm=y(y({},_s),ma),Bm={};b(Bm,{CARTESIAN_AXIS_TYPE:()=>Nt,ChartTheme:()=>Ci,DEFAULT_ANNOTATION_BACKGROUND_FILL:()=>ui,DEFAULT_ANNOTATION_HANDLE_FILL:()=>pi,DEFAULT_ANNOTATION_STROKE:()=>di,DEFAULT_AXIS_GRID_COLOUR:()=>Zt,DEFAULT_AXIS_LINE_COLOUR:()=>Qt,DEFAULT_BACKGROUND_COLOUR:()=>ei,DEFAULT_COLOURS:()=>ii,DEFAULT_CROSS_LINES_COLOUR:()=>Jt,DEFAULT_DIVERGING_SERIES_COLOUR_RANGE:()=>li,DEFAULT_FONT_FAMILY:()=>Kt,DEFAULT_HIERARCHY_FILLS:()=>ci,DEFAULT_HIERARCHY_STROKES:()=>hi,DEFAULT_INSIDE_SERIES_LABEL_COLOUR:()=>qt,DEFAULT_INVERTED_LABEL_COLOUR:()=>Yt,DEFAULT_LABEL_COLOUR:()=>$t,DEFAULT_MUTED_LABEL_COLOUR:()=>Xt,DEFAULT_POLAR_SERIES_STROKE:()=>ai,DEFAULT_SHADOW_COLOUR:()=>ti,DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE:()=>oi,DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS:()=>ri,DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS:()=>si,DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS:()=>ni,EXTENDS_AXES_DEFAULTS:()=>Vt,EXTENDS_AXES_GRID_LINE_DEFAULTS:()=>zt,EXTENDS_AXES_LINE_DEFAULTS:()=>Ht,EXTENDS_AXES_TICK_DEFAULTS:()=>Ut,EXTENDS_CARTESIAN_MARKER_DEFAULTS:()=>jt,EXTENDS_SERIES_DEFAULTS:()=>Wt,FONT_SIZE:()=>Pt,FONT_WEIGHT:()=>kt,IS_DARK_THEME:()=>Bt,POLAR_AXIS_SHAPE:()=>Ot,POLAR_AXIS_TYPE:()=>_t,POSITION:()=>Lt,getChartTheme:()=>as,markerPaletteFactory:()=>ku,singleSeriesPaletteFactory:()=>Pu,themes:()=>Vm});var Vm=Qe(os,e=>null==e?void 0:e()),Hm={};b(Hm,{BandScale:()=>Wr,ColorScale:()=>qp,ContinuousScale:()=>Xn,Invalidating:()=>Ur,LinearScale:()=>Zd,OrdinalTimeScale:()=>Co,TimeScale:()=>yo});var Um={};function zm(e,t){const i={};if(Array.isArray(t))for(let s=0;s<e.length;s++)i[`${e[s]}`]=t[s];else for(let s=0;s<e.length;s++)i[`${e[s]}`]=t;return i}b(Um,{Color:()=>pr,Logger:()=>_,Padding:()=>Ql,angleBetween:()=>Vr,areArrayItemsStrictlyEqual:()=>ja,areArrayNumbersEqual:()=>Ka,bifurcate:()=>fs,checkDatum:()=>Yo,clamp:()=>Hs,clampArray:()=>Us,countFractionDigits:()=>Xs,createId:()=>Gs,deepClone:()=>xt,displacePointFromVector:()=>Hr,extent:()=>ls,findMinMax:()=>zs,findRangeExtent:()=>Ws,isBetweenAngles:()=>Fr,isContinuous:()=>$o,isDate:()=>Oe,isDenseInterval:()=>mo,isEqual:()=>js,isNegative:()=>Ks,isNumber:()=>We,isNumberEqual:()=>js,isNumberObject:()=>Ko,isString:()=>Ue,isStringObject:()=>jo,jsonApply:()=>At,jsonDiff:()=>wt,jsonWalk:()=>Mt,mod:()=>qs,normalisedExtent:()=>cs,normalisedExtentWithMetadata:()=>hs,normalizeAngle180:()=>Or,normalizeAngle360:()=>Nr,normalizeAngle360Inclusive:()=>_r,range:()=>go,resetIds:()=>Fs,round:()=>$s,sanitizeHtml:()=>_u,setAttribute:()=>Qa,shallowClone:()=>Et,tickFormat:()=>ka,tickStep:()=>po,ticks:()=>ho,toDegrees:()=>Br,toFixed:()=>Ys,toRadians:()=>Gr,transformIntegratedCategoryValue:()=>qo,zipObject:()=>zm});var Wm={};function jm({defs:e,values:t,xAxis:i,yAxis:s}){if(!i||!s)throw new Error("Axes must be defined");const r={};for(const[n,{def:o}]of e)if(Object.hasOwn(t,n)){const{scale:e}="key"===o.type?i:s;r[n]=Math.round(e.convert(t[n]))}return r}b(Wm,{AND:()=>Yr,ARRAY:()=>ln,ARRAY_OF:()=>cn,AbstractBarSeries:()=>kp,AbstractBarSeriesProperties:()=>Pp,ActionOnSet:()=>Xa,Animation:()=>Dr,AnimationManager:()=>vc,AreaSeriesTag:()=>wp,Axis:()=>xl,AxisLabel:()=>dl,AxisTick:()=>jn,BOOLEAN:()=>Qr,BOOLEAN_ARRAY:()=>vn,Background:()=>cu,BackgroundModule:()=>hu,BaseModuleInstance:()=>we,BaseProperties:()=>vt,COLOR_STRING:()=>fn,COLOR_STRING_ARRAY:()=>yn,CartesianAxis:()=>Al,CartesianSeries:()=>jd,CartesianSeriesNodeEvent:()=>zd,CartesianSeriesProperties:()=>Wd,CategoryAxis:()=>Dl,CategoryAxisTick:()=>Tl,ChartAxisDirection:()=>Kn,ChartEventManager:()=>bc,ChartOptions:()=>Ps,ChartUpdateType:()=>Hc,ContextMenuRegistry:()=>Sc,CursorManager:()=>xc,DATE:()=>pn,DATE_ARRAY:()=>Sn,DATE_OR_DATETIME_MS:()=>gn,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Hd,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Ud,DEFAULT_TOOLTIP_CLASS:()=>el,DEFAULT_TOOLTIP_DARK_CLASS:()=>tl,DEGREE:()=>on,DIRECTION:()=>Ln,DataController:()=>eh,DataModel:()=>Qc,DataModelSeries:()=>_d,DataService:()=>rc,Default:()=>jr,Deprecated:()=>Ls,DeprecatedAndRenamedTo:()=>Ns,EMPTY_TOOLTIP_CONTENT:()=>il,FONT_STYLE:()=>Tn,FONT_WEIGHT:()=>Dn,FUNCTION:()=>Jr,GREATER_THAN:()=>un,GestureDetector:()=>Mc,GroupedCategoryAxis:()=>Bl,HierarchyNode:()=>$m,HierarchySeries:()=>Ym,HierarchySeriesProperties:()=>qm,HighlightManager:()=>Ac,HighlightStyle:()=>Bd,INTERACTION_RANGE:()=>_n,InteractionManager:()=>fc,InteractionState:()=>gc,LABEL_PLACEMENT:()=>On,LESS_THAN:()=>dn,LINE_CAP:()=>xn,LINE_DASH:()=>Mn,LINE_JOIN:()=>En,Layers:()=>Wo,LayoutService:()=>Bc,LonLatBBox:()=>Xm,MARKER_SHAPE:()=>Hu,MATCHING_CROSSLINE_TYPE:()=>Xo,MAX_SPACING:()=>Bn,MIN_SPACING:()=>Gn,MercatorScale:()=>Cm,Motion:()=>mr,NAN:()=>sn,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ir,NUMBER:()=>tn,NUMBER_ARRAY:()=>Cn,NUMBER_OR_NAN:()=>an,Navigator:()=>Iu,NavigatorModule:()=>Ru,OBJECT:()=>Xr,OBJECT_ARRAY:()=>wn,OR:()=>qr,OVERFLOW_STRATEGY:()=>kn,ObserveChanges:()=>Za,PHASE_METADATA:()=>Mr,PHASE_ORDER:()=>Er,PLACEMENT:()=>Nn,PLAIN_OBJECT:()=>Zr,POINTER_INTERACTION_TYPES:()=>cc,POSITION:()=>An,POSITIVE_NUMBER:()=>rn,PolarAxis:()=>dm,PolarSeries:()=>Ng,PropertiesArray:()=>Ct,ProxyOnWrite:()=>Ya,ProxyProperty:()=>$a,ProxyPropertyOnWrite:()=>qa,QUICK_TRANSITION:()=>.2,RATIO:()=>nn,RepeatType:()=>Ar,SKIP_JS_BUILTINS:()=>tt,SMALLEST_KEY_INTERVAL:()=>Ah,SORT_DOMAIN_GROUPS:()=>Th,STRING:()=>en,STRING_ARRAY:()=>bn,Series:()=>Zh,SeriesGroupingChangedEvent:()=>Xh,SeriesItemHighlightStyle:()=>Od,SeriesMarker:()=>Uu,SeriesNodeEvent:()=>qh,SeriesNodePickMode:()=>Gh,SeriesProperties:()=>Vd,SeriesTooltip:()=>Wu,StateMachine:()=>ya,TEXT_ALIGN:()=>Rn,TEXT_WRAP:()=>In,ToolbarManager:()=>Oc,Tooltip:()=>ol,TooltipManager:()=>Gc,TooltipPosition:()=>nl,UNION:()=>Fn,UpdateService:()=>Uc,VERTICAL_ALIGN:()=>Pn,Validate:()=>Kr,ZoomManager:()=>sh,__FORCE_MODULE_DETECTION:()=>Zm,accumulateGroup:()=>_h,accumulatedValue:()=>Eh,accumulativeValueProperty:()=>Kh,addHitTestersToQuadtree:()=>Ip,adjustLabelPlacement:()=>jp,allInStringUnion:()=>vs,animationValidation:()=>kh,area:()=>xh,arraysEqual:()=>ds,assignJsonApplyConstructedArray:()=>Yn,backfillPathPointData:()=>ip,basicContinuousCheckDatumValidation:()=>Bh,bifurcate:()=>fs,buildFormatter:()=>ro,buildResetPathFn:()=>lp,calculateDefaultTimeTickFormat:()=>ao,calculatePlacement:()=>Ja,checkCrisp:()=>Fp,childrenIter:()=>Dp,circularSliceArray:()=>ms,clamp:()=>Hs,clampArray:()=>Us,collapsedStartingBarPosition:()=>Bp,computeBarFocusBounds:()=>zp,computeMarkerFocusBounds:()=>Qu,computeSectorFocusBounds:()=>Lg,convertValuesToScaleByDefs:()=>jm,countFractionDigits:()=>Xs,createDatumId:()=>Fh,createDeprecationWarning:()=>ks,createElement:()=>xs,dateToNumber:()=>no,deconstructSelectionsOrNodes:()=>Tr,deepClone:()=>xt,deepMerge:()=>qe,defaultTimeTickFormat:()=>oo,determinePathStatus:()=>Cp,diff:()=>Oh,downloadUrl:()=>Es,enterpriseModule:()=>Se,extent:()=>ls,extractDecoratedProperties:()=>Pe,findMinMax:()=>zs,findQuadtreeMatch:()=>Rp,findRangeExtent:()=>Ws,fixNumericExtent:()=>qc,fromToMotion:()=>Rr,getDocument:()=>Ss,getMissCount:()=>Xc,getPath:()=>et,getRectConfig:()=>Op,getWindow:()=>ws,groupAccumulativeValueProperty:()=>Yh,groupAverage:()=>wh,groupBy:()=>gs,groupCount:()=>Sh,groupSum:()=>Ch,injectStyle:()=>Ms,isArray:()=>Le,isBoolean:()=>Ne,isDate:()=>_e,isDecoratedObject:()=>Ie,isDefined:()=>ke,isEnumKey:()=>Ke,isEnumValue:()=>$e,isEqual:()=>js,isFiniteNumber:()=>We,isFunction:()=>Ge,isHtmlElement:()=>je,isNegative:()=>Ks,isNumber:()=>ze,isObject:()=>Be,isObjectLike:()=>Ve,isPlainObject:()=>He,isProperties:()=>bt,isRegExp:()=>Fe,isString:()=>Ue,isSymbol:()=>Ye,isValidDate:()=>Oe,jsonApply:()=>At,jsonDiff:()=>wt,jsonWalk:()=>Mt,keyProperty:()=>zh,listDecoratedProperties:()=>Re,mapIterable:()=>ys,mapValues:()=>Qe,markerFadeInAnimation:()=>Ku,markerPaletteFactory:()=>ku,markerScaleInAnimation:()=>$u,markerSwipeScaleInAnimation:()=>Yu,mergeArrayDefaults:()=>Ze,mergeDefaults:()=>Xe,midpointStartingBarPosition:()=>Vp,minMax:()=>Ju,mod:()=>qs,moduleRegistry:()=>xe,normaliseGroupTo:()=>Ih,normalisePropertyTo:()=>Ph,normalisedExtent:()=>cs,normalisedExtentWithMetadata:()=>hs,pairCategoryData:()=>vp,pairContinuousData:()=>yp,partialAssign:()=>st,pathFadeInAnimation:()=>op,pathFadeOutAnimation:()=>ap,pathSwipeInAnimation:()=>np,pickByMatchingAngle:()=>kg,predicateWithMessage:()=>Vn,prepareAreaPathAnimation:()=>Mp,prepareAxisAnimationContext:()=>gl,prepareAxisAnimationFunctions:()=>yl,prepareBarAnimationFunctions:()=>Hp,prepareLinePathAnimation:()=>Sp,prepareLinePathAnimationFns:()=>bp,prepareMarkerAnimation:()=>Zu,preparePieSeriesAnimationFunctions:()=>Rg,range:()=>bh,rangedValueProperty:()=>jh,renderPartialPath:()=>rp,resetAxisGroupFn:()=>vl,resetAxisLabelSelectionFn:()=>bl,resetAxisLineSelectionFn:()=>Sl,resetAxisSelectionFn:()=>Cl,resetBarSelectionsFn:()=>Up,resetIds:()=>Fs,resetLabelFn:()=>Gu,resetMarkerFn:()=>qu,resetMarkerPositionFn:()=>Xu,resetMotion:()=>fa,resetPieSelectionsFn:()=>Pg,round:()=>$s,seriesLabelFadeInAnimation:()=>Ou,seriesLabelFadeOutAnimation:()=>Fu,setDocument:()=>As,setPath:()=>it,setWindow:()=>Ts,shallowClone:()=>Et,singleSeriesPaletteFactory:()=>Pu,staticFromToMotion:()=>Pr,stringify:()=>zn,sum:()=>vh,sumValues:()=>yh,toArray:()=>us,toFixed:()=>Ys,toTooltipHtml:()=>rl,trailingAccumulatedValue:()=>Mh,trailingAccumulatedValueProperty:()=>$h,unique:()=>ps,updateClipPath:()=>cp,updateLabelNode:()=>Wp,updateRect:()=>_p,validateCrossLineValues:()=>Zo,valueProperty:()=>Wh,without:()=>Je});var Km=class e{constructor(e,t,i,s,r,n,o,a,l,c,h){this.series=e,this.index=t,this.datum=i,this.size=s,this.colorValue=r,this.fill=n,this.stroke=o,this.sumSize=a,this.depth=l,this.parent=c,this.children=h,this.midPoint={x:0,y:0}}contains(e){let t=e;for(;null!=t&&t.index>=this.index;){if(t===this)return!0;t=t.parent}return!1}walk(t,i=e.Walk.PreOrder){i===e.Walk.PreOrder&&t(this),this.children.forEach(e=>{e.walk(t,i)}),i===e.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*M(e)}};Km.Walk={PreOrder:0,PostOrder:1};var $m=Km,Ym=class extends Zh{constructor(e){super({moduleCtx:e,pickModes:[0],contentGroupVirtual:!1}),this.rootNode=new $m(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.colorDomain=[0,0],this.maxDepth=0,this.animationState=new ya("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}processData(){return x(this,null,function*(){var e,t;const{childrenKey:i,sizeKey:s,colorKey:r,fills:n,strokes:o,colorRange:a}=this.properties;let l=0,c=0,h=1/0,d=-1/0;const u=new Array((null!=(t=null==(e=this.data)?void 0:e.length)?t:0)+1).fill(void 0),p=(e,t)=>{const n=(l+=1,l),o=null!=t.depth?t.depth+1:0,a=null!=i?e[i]:void 0,p=null==a||0===a.length;let m=null!=s?e[s]:void 0;m=Number.isFinite(m)?Math.max(m,0):p?1:0;const f=m;c=Math.max(c,o);const y=null!=r?e[r]:void 0;return"number"==typeof y&&(u[n]=y,h=Math.min(h,y),d=Math.max(d,y)),g(new $m(this,n,e,m,y,void 0,void 0,f,o,t,[]),a)},g=(e,t)=>(null==t||t.forEach(t=>{const i=p(t,e);e.children.push(i),e.sumSize+=i.sumSize}),e),m=g(new $m(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.data),f=[h,d];let y;null!=a&&Number.isFinite(h)&&Number.isFinite(d)&&(y=new qp,y.domain=f,y.range=a,y.update()),m.children.forEach((e,t)=>{e.walk(e=>{let i;const s=u[e.index];null!=s&&(i=null==y?void 0:y.convert(s)),null!=i||(i=null==n?void 0:n[t%n.length]),e.fill=i,e.stroke=null==y?null==o?void 0:o[t%o.length]:"rgba(0, 0, 0, 0.2)"})}),this.rootNode=m,this.maxDepth=c,this.colorDomain=f})}update(e){return x(this,arguments,function*({seriesRect:e}){yield this.updateSelections(),yield this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)})}resetAllAnimation(e){var t;const i=null==(t=this.animationResetFns)?void 0:t.datum;this.ctx.animationManager.stopByAnimationGroupId(this.id),null!=i&&fa(e.datumSelections,i)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){var t;const i=null==(t=this.animationResetFns)?void 0:t.datum;null!=i&&fa([e],i)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(){return{datumSelections:[this.groupSelection]}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getLabelData(){return[]}getSeriesDomain(){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:s,visible:r}=this.properties;return"gradient"===e&&null!=t&&null!=s?[{legendType:"gradient",enabled:r,seriesId:this.id,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return`${e.index}`}getDatumId(e){return this.getDatumIdFromData(e)}},qm=class extends Vd{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Ft),this.strokes=Object.values(Gt)}};S([Kr(en)],qm.prototype,"childrenKey",2),S([Kr(en,{optional:!0})],qm.prototype,"sizeKey",2),S([Kr(en,{optional:!0})],qm.prototype,"colorKey",2),S([Kr(en,{optional:!0})],qm.prototype,"colorName",2),S([Kr(yn)],qm.prototype,"fills",2),S([Kr(yn)],qm.prototype,"strokes",2),S([Kr(yn,{optional:!0})],qm.prototype,"colorRange",2);var Xm=class{constructor(e,t,i,s){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=s}merge(e){this.lon0=Math.min(this.lon0,e.lon0),this.lat0=Math.min(this.lat0,e.lat0),this.lon1=Math.max(this.lon1,e.lon1),this.lat1=Math.max(this.lat1,e.lat1)}},Zm=0,Qm=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,ef=Object.getOwnPropertyNames,tf=Object.prototype.hasOwnProperty,sf=(e,t)=>{for(var i in t)Qm(e,i,{get:t[i],enumerable:!0})},rf=(e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of ef(t))tf.call(e,r)||r===i||Qm(e,r,{get:()=>t[r],enumerable:!(s=Jm(t,r))||s.enumerable});return e},nf=(e,t,i)=>(rf(e,t,"default"),i&&rf(i,t,"default")),of=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Jm(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Qm(t,i,n),n},af={};sf(af,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>r.Yx9,AbstractHeaderCellCtrl:()=>r.$Y_,AdvancedFilterModule:()=>cy,AgAbstractField:()=>r.JWk,AgAbstractLabel:()=>r.DKR,AgAutocomplete:()=>r.bB5,AgCheckbox:()=>r.Unm,AgDialog:()=>r.fNJ,AgGroupComponent:()=>r.Pk_,AgInputDateField:()=>r.RYS,AgInputNumberField:()=>r.SpC,AgInputRange:()=>r.ycK,AgInputTextArea:()=>r.vXh,AgInputTextField:()=>r.stt,AgMenuItemComponent:()=>r.yuY,AgMenuItemRenderer:()=>r.Y0b,AgMenuList:()=>r.i9O,AgMenuPanel:()=>r.qkt,AgPanel:()=>r.LT8,AgPickerField:()=>r.HHt,AgPromise:()=>r.oY$,AgPromiseStatus:()=>r.SEh,AgRadioButton:()=>r.OQA,AgRichSelect:()=>r.pNP,AgSelect:()=>r.Ju4,AgSlider:()=>r.YD7,AgStackComponentsRegistry:()=>r.yOL,AgToggleButton:()=>r.bLJ,AlignedGridsService:()=>r.TYQ,AnimateShowChangeCellRenderer:()=>r.YEH,AnimateSlideCellRenderer:()=>r.kOq,AnimationFrameService:()=>r.hK9,AutoScrollService:()=>r.MSA,AutoWidthCalculator:()=>r.Qgm,Autowired:()=>r.dsm,BarColumnLabelPlacement:()=>r.fnn,BaseComponentWrapper:()=>r.Cf3,Bean:()=>r.dR4,BeanStub:()=>r.XQb,Beans:()=>r.MDK,BodyDropPivotTarget:()=>r.R4L,BodyDropTarget:()=>r.LFT,CellComp:()=>r.ehA,CellCtrl:()=>r.wX9,CellNavigationService:()=>r.aBp,CellPositionUtils:()=>r.HM$,CellRangeType:()=>r.OnL,ChangedPath:()=>r.k$d,ChartMappings:()=>r.E1g,CheckboxCellEditor:()=>r.j19,CheckboxCellRenderer:()=>r.tj3,CheckboxSelectionComponent:()=>r.TJD,ClientSideRowModelSteps:()=>r.zOQ,ClipboardModule:()=>Fw,Column:()=>r.VPZ,ColumnApi:()=>r.jf3,ColumnFactory:()=>r.tbO,ColumnGroup:()=>r.ock,ColumnKeyCreator:()=>r.a1W,ColumnModel:()=>r.K02,ColumnsToolPanelModule:()=>EE,Component:()=>r.uAl,ComponentUtil:()=>r.kNx,Context:()=>r.obS,CssClassApplier:()=>r.PC7,CssClassManager:()=>r.hv8,CtrlsService:()=>r.GsR,DataTypeService:()=>r.gvq,DateCellEditor:()=>r.ofN,DateFilter:()=>r.ZvW,DateStringCellEditor:()=>r.tyx,DisplayedGroupCreator:()=>r.HDb,DragAndDropService:()=>r.WO_,DragService:()=>r.atK,DragSourceType:()=>r.qRA,EnterpriseCoreModule:()=>mf,Environment:()=>r.OH$,EventService:()=>r.USV,Events:()=>r.sVA,ExcelExportModule:()=>wA,ExcelFactoryMode:()=>r.FiP,ExpansionService:()=>r.pkb,ExpressionService:()=>r.k4Y,FilterManager:()=>r.qh$,FilterWrapperComp:()=>r.jfj,FiltersToolPanelModule:()=>VA,FloatingFilterMapper:()=>r.aq,FocusService:()=>r.c4$,GROUP_AUTO_COLUMN_ID:()=>r.JPk,Grid:()=>r.xA9,GridApi:()=>r.fAn,GridBodyComp:()=>r.IqQ,GridBodyCtrl:()=>r.m20,GridChartsModule:()=>Aw,GridComp:()=>r.qdQ,GridCoreCreator:()=>r.Ug$,GridCtrl:()=>r.s1r,GridHeaderComp:()=>r.zCV,GridHeaderCtrl:()=>r.vBt,GridOptionsService:()=>r.E3M,GroupCellRenderer:()=>r.H_$,GroupCellRendererCtrl:()=>r.ihO,GroupInstanceIdCreator:()=>r.uf_,HeaderCellCtrl:()=>r.Lhl,HeaderFilterCellComp:()=>r.rdE,HeaderFilterCellCtrl:()=>r.HiW,HeaderGroupCellCtrl:()=>r.Kb3,HeaderNavigationDirection:()=>r.BFs,HeaderNavigationService:()=>r.Ry8,HeaderPositionUtils:()=>r.CS5,HeaderRowComp:()=>r.Hyp,HeaderRowContainerComp:()=>r.U3q,HeaderRowContainerCtrl:()=>r.OPU,HeaderRowCtrl:()=>r.fRK,HeaderRowType:()=>r.YtK,HorizontalDirection:()=>r.Iu8,HorizontalResizeService:()=>r.QBm,KeyCode:()=>r.DDm,LargeTextCellEditor:()=>r.GPp,LayoutCssClasses:()=>r.gay,LicenseManager:()=>pf,LocaleService:()=>r.iH9,Logger:()=>r.VyI,LoggerFactory:()=>r.PLc,ManagedFocusFeature:()=>r.G21,MasterDetailModule:()=>ZA,MenuModule:()=>xT,MenuService:()=>r.$1h,ModuleNames:()=>r.zsj,ModuleRegistry:()=>r.syG,MouseEventService:()=>r.Rdv,MoveColumnFeature:()=>r.auO,MultiFilter:()=>OT,MultiFilterModule:()=>GT,NavigationService:()=>r.o_p,NumberCellEditor:()=>r.dcM,NumberFilter:()=>r.yLQ,NumberSequence:()=>r.RI_,Optional:()=>r.Xx1,PaginationProxy:()=>r.TOO,PillDragComp:()=>r.v26,PillDropZonePanel:()=>r.fNO,PinnedRowModel:()=>r.aP4,PivotDropZonePanel:()=>dx,PopupComponent:()=>r.yGC,PopupEditorWrapper:()=>r.zmE,PopupService:()=>r.OQU,PositionableFeature:()=>r.qyQ,PostConstruct:()=>r.o7C,PreConstruct:()=>r.fK3,PreDestroy:()=>r.yah,PrimaryColsPanel:()=>dE,PropertyKeys:()=>r.K42,ProvidedColumnGroup:()=>r.D45,ProvidedFilter:()=>r.Q5x,Qualifier:()=>r.Vf_,QuerySelector:()=>r.yLT,RangeSelectionModule:()=>Ry,RefSelector:()=>r.PIB,ResizeObserverService:()=>r.kem,RichSelectModule:()=>VT,RowAnimationCssClasses:()=>r.IGk,RowContainerComp:()=>r.B_v,RowContainerCtrl:()=>r.Rlq,RowContainerName:()=>r.lon,RowContainerType:()=>r.uvO,RowCtrl:()=>r.CJG,RowGroupDropZonePanel:()=>hx,RowGroupingModule:()=>yx,RowHighlightPosition:()=>r.m5s,RowNode:()=>r.TUE,RowNodeBlock:()=>r.iEP,RowNodeBlockLoader:()=>r.RRV,RowNodeSorter:()=>r.mE1,RowPositionUtils:()=>r.HLc,RowRenderer:()=>r.k7d,ScalarFilter:()=>r.TaT,ScrollVisibleService:()=>r.fVA,SelectCellEditor:()=>r.eAL,SelectableService:()=>r.K4S,SelectionHandleType:()=>r.LIk,ServerSideRowModelModule:()=>yD,ServerSideTransactionResultStatus:()=>r.a8A,SetFilter:()=>LD,SetFilterModule:()=>GD,SetLeftFeature:()=>r.uij,SideBarModule:()=>Hx,SimpleFilter:()=>r.PJL,SortController:()=>r.xSC,SortIndicatorComp:()=>r.pE7,SparklinesModule:()=>jI,StandardMenuFactory:()=>r.Pmj,StatusBarModule:()=>sR,StylingService:()=>r.EJF,TabGuardClassNames:()=>r.pA9,TabGuardComp:()=>r.aJZ,TabGuardCtrl:()=>r.Udn,TabbedLayout:()=>r.LfH,TextCellEditor:()=>r.zIT,TextFilter:()=>r.U$F,TextFloatingFilter:()=>r.U_L,Timer:()=>r.M4G,ToolPanelColDefService:()=>Bx,TooltipFeature:()=>r.CvR,TooltipStateManager:()=>r.mSN,TouchListener:()=>r.MVO,UserComponentFactory:()=>r.xMA,UserComponentRegistry:()=>r.utH,ValueCache:()=>r.YHi,ValueService:()=>r.bBw,ValuesDropZonePanel:()=>vx,VanillaFrameworkOverrides:()=>r.pow,VerticalDirection:()=>r.mqe,ViewportRowModelModule:()=>lR,VirtualList:()=>r.wjn,VirtualListDragFeature:()=>r.ia$,_:()=>r._,__FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT:()=>Tw,agCharts:()=>Dw,createGrid:()=>r.Dvw,exportMultipleSheetsAsExcel:()=>bA,getMultipleSheetsAsExcel:()=>CA,getRowContainerTypeForName:()=>r.CSq,provideGlobalGridOptions:()=>r.Nat});var lf=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(e,t){let i=e[0],s=e[1],r=e[2],n=e[3];i=this.ff(i,s,r,n,t[0],7,-680876936),n=this.ff(n,i,s,r,t[1],12,-389564586),r=this.ff(r,n,i,s,t[2],17,606105819),s=this.ff(s,r,n,i,t[3],22,-1044525330),i=this.ff(i,s,r,n,t[4],7,-176418897),n=this.ff(n,i,s,r,t[5],12,1200080426),r=this.ff(r,n,i,s,t[6],17,-1473231341),s=this.ff(s,r,n,i,t[7],22,-45705983),i=this.ff(i,s,r,n,t[8],7,1770035416),n=this.ff(n,i,s,r,t[9],12,-1958414417),r=this.ff(r,n,i,s,t[10],17,-42063),s=this.ff(s,r,n,i,t[11],22,-1990404162),i=this.ff(i,s,r,n,t[12],7,1804603682),n=this.ff(n,i,s,r,t[13],12,-40341101),r=this.ff(r,n,i,s,t[14],17,-1502002290),s=this.ff(s,r,n,i,t[15],22,1236535329),i=this.gg(i,s,r,n,t[1],5,-165796510),n=this.gg(n,i,s,r,t[6],9,-1069501632),r=this.gg(r,n,i,s,t[11],14,643717713),s=this.gg(s,r,n,i,t[0],20,-373897302),i=this.gg(i,s,r,n,t[5],5,-701558691),n=this.gg(n,i,s,r,t[10],9,38016083),r=this.gg(r,n,i,s,t[15],14,-660478335),s=this.gg(s,r,n,i,t[4],20,-405537848),i=this.gg(i,s,r,n,t[9],5,568446438),n=this.gg(n,i,s,r,t[14],9,-1019803690),r=this.gg(r,n,i,s,t[3],14,-187363961),s=this.gg(s,r,n,i,t[8],20,1163531501),i=this.gg(i,s,r,n,t[13],5,-1444681467),n=this.gg(n,i,s,r,t[2],9,-51403784),r=this.gg(r,n,i,s,t[7],14,1735328473),s=this.gg(s,r,n,i,t[12],20,-1926607734),i=this.hh(i,s,r,n,t[5],4,-378558),n=this.hh(n,i,s,r,t[8],11,-2022574463),r=this.hh(r,n,i,s,t[11],16,1839030562),s=this.hh(s,r,n,i,t[14],23,-35309556),i=this.hh(i,s,r,n,t[1],4,-1530992060),n=this.hh(n,i,s,r,t[4],11,1272893353),r=this.hh(r,n,i,s,t[7],16,-155497632),s=this.hh(s,r,n,i,t[10],23,-1094730640),i=this.hh(i,s,r,n,t[13],4,681279174),n=this.hh(n,i,s,r,t[0],11,-358537222),r=this.hh(r,n,i,s,t[3],16,-722521979),s=this.hh(s,r,n,i,t[6],23,76029189),i=this.hh(i,s,r,n,t[9],4,-640364487),n=this.hh(n,i,s,r,t[12],11,-421815835),r=this.hh(r,n,i,s,t[15],16,530742520),s=this.hh(s,r,n,i,t[2],23,-995338651),i=this.ii(i,s,r,n,t[0],6,-198630844),n=this.ii(n,i,s,r,t[7],10,1126891415),r=this.ii(r,n,i,s,t[14],15,-1416354905),s=this.ii(s,r,n,i,t[5],21,-57434055),i=this.ii(i,s,r,n,t[12],6,1700485571),n=this.ii(n,i,s,r,t[3],10,-1894986606),r=this.ii(r,n,i,s,t[10],15,-1051523),s=this.ii(s,r,n,i,t[1],21,-2054922799),i=this.ii(i,s,r,n,t[8],6,1873313359),n=this.ii(n,i,s,r,t[15],10,-30611744),r=this.ii(r,n,i,s,t[6],15,-1560198380),s=this.ii(s,r,n,i,t[13],21,1309151649),i=this.ii(i,s,r,n,t[4],6,-145523070),n=this.ii(n,i,s,r,t[11],10,-1120210379),r=this.ii(r,n,i,s,t[2],15,718787259),s=this.ii(s,r,n,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(n,e[3])}cmn(e,t,i,s,r,n){return t=this.add32(this.add32(t,e),this.add32(s,n)),this.add32(t<<r|t>>>32-r,i)}ff(e,t,i,s,r,n,o){return this.cmn(t&i|~t&s,e,t,r,n,o)}gg(e,t,i,s,r,n,o){return this.cmn(t&s|i&~s,e,t,r,n,o)}hh(e,t,i,s,r,n,o){return this.cmn(t^i^s,e,t,r,n,o)}ii(e,t,i,s,r,n,o){return this.cmn(i^(t|~s),e,t,r,n,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)r[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(r[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,r),s=0;s<16;s++)r[s]=0;return r[14]=8*t,this.md5cycle(i,r),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>8*s+4&15]+t[e>>8*s&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}};function cf(e){return null==e||0===e.length}var hf={"01":"GRID","02":"CHARTS","0102":"BOTH"},df=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new lf,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey),i=`AG Grid ${"BOTH"===t.currentLicenseType?"and AG Charts ":""}Enterprise`,s=void 0===t.suppliedLicenseType?"":`AG ${"BOTH"===t.suppliedLicenseType?"Grid and AG Charts":"GRID"===t.suppliedLicenseType?"Grid":"Charts"} Enterprise`;if(t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(i);else if(t.expired){const r=e.getGridReleaseDate(),n=e.formatDate(r);this.outputExpiredKey(t.expiry,n,i,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,r=i.substring(s),n=i.substring(0,s),[o,a,l]=e.extractBracketedInformation(i);return{md5:r,license:n,version:o,isTrial:a,type:l}}getLicenseDetails(t){const i=e.chartsLicenseManager?"BOTH":"GRID";if(cf(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:i};const s=e.getGridReleaseDate(),{md5:r,license:n,version:o,isTrial:a,type:l}=e.extractLicenseComponents(t);let c,h,d,u=r===this.md5.md5(n)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),p=null,g=!1;function m(){c=p<new Date,h=void 0}if(u&&(p=e.extractExpiry(n),u=!isNaN(p.getTime()),u))switch(h=s>p,o){case"legacy":case"2":a&&m();break;case"3":cf(l)?u=!1:(d=l,l!==hf["01"]&&l!==hf["0102"]||"BOTH"===i&&"BOTH"!==d?(u=!1,g=!0):a&&m())}return u?{licenseKey:t,valid:u,expiry:e.formatDate(p),expired:h,version:o,isTrial:a,trialExpired:c,incorrectLicenseType:g,currentLicenseType:i,suppliedLicenseType:d}:{licenseKey:t,valid:u,incorrectLicenseType:g,currentLicenseType:i,suppliedLicenseType:d}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!cf(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const e=(this.document.defaultView||window).location,{hostname:t=""}=e;return t}isForceWatermark(){const e=(this.document.defaultView||window).location,{pathname:t}=e;return!!t&&-1!==t.indexOf("forceWatermark")}isWebsiteUrl(){return null!==this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)}isLocalhost(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)}static formatDate(e){const t=e.getDate(),i=e.getMonth(),s=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+s}static getGridReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,r,n,o,a,l,c,h="",d=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)o=i.indexOf(u.charAt(d++)),a=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),s=o<<2|a>>4,r=(15&a)<<4|l>>2,n=(3&l)<<6|c,h+=String.fromCharCode(s),64!=l&&(h+=String.fromCharCode(r)),64!=c&&(h+=String.fromCharCode(n));return h=e.utf8_decode(h),h}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);s<128?t+=String.fromCharCode(s):s>127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}static setChartsLicenseManager(e){this.chartsLicenseManager=e}static setLicenseKey(e){this.licenseKey=e,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(e,!0)}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const i=1===t.filter(e=>"TRIAL"===e).length,s=t.filter(e=>0===e.indexOf("v"))[0];return[s?s.replace("v",""):"legacy",i,hf[t.filter(e=>hf[e])[0]]]}centerPadAndOutput(e){const t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,t="*",i=""){console.error(e.padEnd(this.totalMessageLength-i.length,t)+i)}outputInvalidLicenseKey(e,t,i){e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to obtain a combined license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid - please contact info@ag-grid.com to obtain a valid license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,t,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,t,i,s){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};df.RELEASE_INFORMATION="MTcxNTc3NTcyODYxNg==";var uf=df,pf=class extends r.XQb{validateLicense(){this.licenseManager=new uf(this.gos.getDocument()),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new uf(null).getLicenseDetails(e)}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){uf.setLicenseKey(e)}static setChartsLicenseManager(e){uf.setChartsLicenseManager(e)}};of([r.fK3],pf.prototype,"validateLicense",1),pf=of([(0,r.dR4)("licenseManager")],pf);var gf=class extends r.uAl{constructor(){super('<div class="ag-watermark">\n                <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n            </div>')}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}};of([(0,r.dsm)("licenseManager")],gf.prototype,"licenseManager",2),of([(0,r.PIB)("eLicenseTextRef")],gf.prototype,"eLicenseTextRef",2),of([r.o7C],gf.prototype,"postConstruct",1);var mf={version:"31.3.4",moduleName:r.zsj.EnterpriseCoreModule,beans:[pf],agStackComponents:[{componentName:"AgWatermark",componentClass:gf}]},ff=Object.defineProperty,yf=Object.defineProperties,vf=Object.getOwnPropertyDescriptor,Cf=Object.getOwnPropertyDescriptors,bf=Object.getOwnPropertySymbols,Sf=Object.prototype.hasOwnProperty,wf=Object.prototype.propertyIsEnumerable,xf=(e,t,i)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ef=(e,t)=>{for(var i in t||(t={}))Sf.call(t,i)&&xf(e,i,t[i]);if(bf)for(var i of bf(t))wf.call(t,i)&&xf(e,i,t[i]);return e},Mf=(e,t)=>yf(e,Cf(t)),Af=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?vf(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&ff(t,i,n),n},Tf=class extends r.uAl{constructor(e){super('\n            <div class="ag-advanced-filter-header" role="row">\n            </div>'),this.enabled=e}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter)),this.addManagedListener(this.eventService,r.sVA.EVENT_GRID_COLUMNS_CHANGED,()=>this.onGridColumnsChanged()),this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addGuiEventListener("focusout",e=>{this.getFocusableElement().contains(e.relatedTarget)||this.focusService.clearAdvancedFilterColumn()})}getFocusableElement(){var e,t;return null!=(t=null==(e=this.eAdvancedFilter)?void 0:e.getGui())?t:this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){var e;null==(e=this.eAdvancedFilter)||e.refresh()}getHeight(){return this.height}setInputDisabled(e){var t;null==(t=this.eAdvancedFilter)||t.setInputDisabled(e)}setupAdvancedFilter(e){const t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new zf);const e=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCssClass("ag-advanced-filter-header-cell"),this.height=this.columnModel.getFloatingFiltersHeight();const i=`${this.height}px`;t.style.height=i,t.style.minHeight=i,this.setAriaRowIndex(),r._.setAriaRole(e,"gridcell"),r._.setAriaColIndex(e,1),this.setAriaColumnCount(e),t.appendChild(e)}else r._.clearElement(t),this.destroyBean(this.eAdvancedFilter),this.height=0;r._.setDisplayed(t,e),this.enabled=e}setAriaColumnCount(e){r._.setAriaColSpan(e,this.columnModel.getAllGridColumns().length)}setAriaRowIndex(){r._.setAriaRowIndex(this.getGui(),this.headerNavigationService.getHeaderRowCount())}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case r.DDm.ENTER:this.hasFocus()&&this.focusService.focusInto(this.getFocusableElement())&&e.preventDefault();break;case r.DDm.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case r.DDm.UP:this.navigateUpDown(!0,e);break;case r.DDm.DOWN:this.navigateUpDown(!1,e);break;case r.DDm.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{const t=this.focusService.findNextFocusableElement(this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}}}navigateUpDown(e,t){this.hasFocus()&&this.focusService.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusService.focusLastHeader():this.focusService.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return this.gos.getActiveDomElement()===this.getFocusableElement()}};Af([(0,r.dsm)("columnModel")],Tf.prototype,"columnModel",2),Af([(0,r.dsm)("focusService")],Tf.prototype,"focusService",2),Af([(0,r.dsm)("headerNavigationService")],Tf.prototype,"headerNavigationService",2),Af([r.o7C],Tf.prototype,"postConstruct",1);var Df=class extends r.pNP{constructor(e){super(Mf(Ef({},e),{template:'\n                <div class="ag-picker-field" role="presentation">\n                    <div ref="eLabel"></div>\n                    <div ref="eWrapper" class="ag-wrapper ag-picker-collapsed">\n                        <div ref="eDisplayField" class="ag-picker-field-display"></div>\n                        <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n                        <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n                    </div>\n                </div>'})),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;r._.setDisplayed(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),r._.setAriaLabelledBy(this.eWrapper,""),r._.setAriaLabel(this.eWrapper,t)}onEnterKeyDown(e){r._.stopPropagationForAgGrid(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},If=class e extends r.XQb{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new r.ia$(this.comp,this.virtualList,{dragSourceType:r.qRA.AdvancedFilterBuilder,listItemDragStartEvent:e.EVENT_DRAG_STARTED,listItemDragEndEvent:e.EVENT_DRAG_ENDED,eventSource:this,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:()=>!1,getNumRows:e=>e.getNumItems(),moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.item}moveItem(e,t){this.comp.moveItem(e,t)}};If.EVENT_DRAG_STARTED="advancedFilterBuilderDragStarted",If.EVENT_DRAG_ENDED="advancedFilterBuilderDragEnded",Af([r.o7C],If.prototype,"postConstruct",1);var Rf=If,Pf=class extends r.XQb{constructor(e,t,i){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=i}postConstruct(){this.addManagedListener(this.eGui,"keydown",e=>{switch(e.key){case r.DDm.TAB:e.defaultPrevented||r._.stopPropagationForAgGrid(e);break;case r.DDm.UP:case r.DDm.DOWN:r._.stopPropagationForAgGrid(e);break;case r.DDm.ESCAPE:if(r._.isStopPropagationForAgGrid(e))return;this.eGui.contains(this.gos.getActiveDomElement())&&(e.preventDefault(),r._.stopPropagationForAgGrid(e),this.focusWrapper.focus())}}),this.addManagedListener(this.focusWrapper,"keydown",e=>{if(e.key===r.DDm.ENTER){if(r._.isStopPropagationForAgGrid(e))return;this.gos.getActiveDomElement()===this.focusWrapper&&(e.preventDefault(),r._.stopPropagationForAgGrid(e),this.eFocusableComp.getFocusableElement().focus())}}),this.addManagedListener(this.focusWrapper,"focusin",()=>{this.focusWrapper.classList.add("ag-advanced-filter-builder-virtual-list-item-highlight")}),this.addManagedListener(this.focusWrapper,"focusout",e=>{this.focusWrapper.contains(e.relatedTarget)||this.focusWrapper.classList.remove("ag-advanced-filter-builder-virtual-list-item-highlight")})}};function kf(e,t){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:e("advancedFilterBuilderAddCondition")},{key:"join",displayValue:e("advancedFilterBuilderAddJoin")}],valueFormatter:e=>{var t;return null==e?null:null!=(t=e.displayValue)?t:e.key},pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${null!=t?t:120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:e("advancedFilterBuilderAddButtonTooltip")}}Af([r.o7C],Pf.prototype,"postConstruct",1);var Lf=class{};Lf.EVENT_ADDED="advancedFilterBuilderAdded",Lf.EVENT_MOVED="advancedFilterBuilderMoved",Lf.EVENT_REMOVED="advancedFilterBuilderRemoved",Lf.EVENT_VALUE_CHANGED="advancedFilterBuilderValueChanged",Lf.EVENT_VALID_CHANGED="advancedFilterBuilderValidChanged";var Nf=class extends r.uAl{constructor(){super('\n            <div class="ag-advanced-filter-builder-item-condition" role="presentation"></div>\n        '),this.validationMessage=null}init(e){const{item:t,createPill:i}=e;this.item=t,this.createPill=i,this.filterModel=t.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advancedFilterExpressionService.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){var t;const i=this.advancedFilterExpressionService.getColumnDetails(e.colId);this.baseCellDataType=i.baseCellDataType,this.column=i.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:null!=(t=this.getColumnDisplayValue())?t:this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advancedFilterExpressionService.getColumnAutocompleteEntries()}),update:e=>this.setColumnKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),r._.exists(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){var e;this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:null!=(e=this.getOperatorDisplayValue())?e:this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:e=>this.setOperatorKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){var e;const t=null!=(e=this.getOperandDisplayValue())?e:"";this.eOperandPill=this.createPill({key:t,displayValue:t,baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:e=>this.setOperand(e),ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advancedFilterExpressionService.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advancedFilterExpressionService.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advancedFilterExpressionService.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advancedFilterExpressionService.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();const t=this.advancedFilterExpressionService.getColumnDetails(e);this.column=t.column;const i=t.baseCellDataType;this.baseCellDataType!==i&&(this.baseCellDataType=i,this.setOperatorKey(void 0),this.eOperatorPill&&(r._.removeFromParent(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){const t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,0===t?this.destroyOperandPill():(this.createOperandPill(),"number"!==this.baseCellDataType&&this.setOperand(""))),this.filterModel.type=e,this.validate()}setOperand(e){var t;let i=e;this.column&&(i=null!=(t=this.advancedFilterExpressionService.getOperandModelValue(e,this.baseCellDataType,this.column))?t:""),this.filterModel.filter=i,this.validate()}getNumOperands(e){var t,i;return null!=(i=null==(t=this.advancedFilterExpressionService.getExpressionOperator(this.baseCellDataType,e))?void 0:t.numOperands)?i:0}destroyOperandPill(){delete this.filterModel.filter,this.getGui().removeChild(this.eOperandPill.getGui()),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;r._.exists(this.getColumnKey())?r._.exists(this.getOperatorKey())?this.numOperands>0&&!r._.exists(this.getOperandDisplayValue())&&(e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationEnterValue")):e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationSelectOption"):e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationSelectColumn"),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchEvent({type:Lf.EVENT_VALID_CHANGED}))}getDefaultColumnDisplayValue(){return this.advancedFilterExpressionService.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advancedFilterExpressionService.translate("advancedFilterBuilderSelectOption")}};Af([(0,r.dsm)("advancedFilterExpressionService")],Nf.prototype,"advancedFilterExpressionService",2),Af([(0,r.dsm)("valueService")],Nf.prototype,"valueService",2);var _f=class extends r.uAl{constructor(e){super('\n            <div class="ag-advanced-filter-builder-pill-wrapper" role="presentation">\n                <div ref="ePill" class="ag-advanced-filter-builder-pill" role="button">\n                    <span ref="eLabel" class="ag-advanced-filter-builder-pill-display"></span>\n                </div>\n            </div>\n        '),this.params=e,this.value=e.value}postConstruct(){const{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,r._.setAriaDescribedBy(this.ePill,this.eLabel.id),r._.setAriaLabel(this.ePill,t),this.renderValue(),this.addManagedListener(this.ePill,"click",e=>{e.preventDefault(),this.showEditor()}),this.addManagedListener(this.ePill,"keydown",e=>{e.key===r.DDm.ENTER&&(e.preventDefault(),r._.stopPropagationForAgGrid(e),this.showEditor())}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;r._.setDisplayed(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);const e=this.eEditor.getGui();this.eEditor.addManagedListener(e,"keydown",e=>{switch(e.key){case r.DDm.ENTER:e.preventDefault(),r._.stopPropagationForAgGrid(e),this.updateValue(!0);break;case r.DDm.ESCAPE:e.preventDefault(),r._.stopPropagationForAgGrid(e),this.hideEditor(!0)}}),this.eEditor.addManagedListener(e,"focusout",()=>{this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){let t;switch(e){case"text":t=new r.stt;break;case"number":t=new r.SpC;break;case"date":t=new r.RYS}return this.createBean(t)}hideEditor(e){const{eEditor:t}=this;t&&(this.eEditor=void 0,this.getGui().removeChild(t.getGui()),this.destroyBean(t),r._.setDisplayed(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e;this.eLabel.classList.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),r._.exists(this.value)?"number"===this.params.type?(e=this.value,this.eLabel.classList.add("ag-advanced-filter-builder-value-number")):(e=`"${this.value}"`,this.eLabel.classList.add("ag-advanced-filter-builder-value-text")):(e=this.advancedFilterExpressionService.translate("advancedFilterBuilderEnterValue"),this.eLabel.classList.add("ag-advanced-filter-builder-value-empty")),this.eLabel.innerText=e}updateValue(e){var t;if(!this.eEditor)return;const i=null!=(t=this.eEditor.getValue())?t:"";this.dispatchEvent({type:r.sVA.EVENT_FIELD_VALUE_CHANGED,value:i}),this.value=i,this.renderValue(),this.hideEditor(e)}};Af([(0,r.PIB)("ePill")],_f.prototype,"ePill",2),Af([(0,r.PIB)("eLabel")],_f.prototype,"eLabel",2),Af([(0,r.dsm)("advancedFilterExpressionService")],_f.prototype,"advancedFilterExpressionService",2),Af([r.o7C],_f.prototype,"postConstruct",1);var Of=class extends r.uAl{constructor(){super('\n            <div class="ag-advanced-filter-builder-item-condition" role="presentation"></div>\n        ')}init(e){const{item:t,createPill:i}=e,s=t.filterModel;this.filterModel=s,this.ePill=i({key:s.type,displayValue:this.advancedFilterExpressionService.parseJoinOperator(s),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advancedFilterExpressionService.getJoinOperatorAutocompleteEntries()}),update:e=>s.type=e,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advancedFilterExpressionService.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}};Af([(0,r.dsm)("advancedFilterExpressionService")],Of.prototype,"advancedFilterExpressionService",2);var Ff=class extends r.pNP{constructor(e){super(Mf(Ef({},e),{template:'\n                <div class="ag-picker-field ag-advanced-filter-builder-pill-wrapper" role="presentation">\n                    <div ref="eLabel"></div>\n                    <div ref="eWrapper" class="ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed">\n                        <div ref="eDisplayField" class="ag-picker-field-display ag-advanced-filter-builder-pill-display"></div>\n                        <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n                        <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n                    </div>\n                </div>'})),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),r._.setAriaLabelledBy(this.eWrapper,""),r._.setAriaLabel(this.eWrapper,t)}createPickerComponent(){var e;if(!this.values){const{values:t}=this.params.getEditorParams();this.values=t;const i=this.value.key,s=null!=(e=t.find(e=>e.key===i))?e:{key:i,displayValue:this.value.displayValue};this.value=s}return super.createPickerComponent()}onEnterKeyDown(e){r._.stopPropagationForAgGrid(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},Gf=class extends r.aJZ{constructor(e,t,i){super('\n            <div class="ag-advanced-filter-builder-item-wrapper" role="presentation">\n                <div ref="eItem" class="ag-advanced-filter-builder-item" role="presentation">\n                    <div ref="eTreeLines" class="ag-advanced-filter-builder-item-tree-lines" aria-hidden="true"></div>\n                    <span ref="eDragHandle" class="ag-drag-handle" aria-hidden="true"></span>\n                    <span ref="eValidation" class="ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid" aria-hidden="true"></span>\n                </div>\n                <div ref="eButtons" class="ag-advanced-filter-builder-item-buttons">\n                    <span ref="eMoveUpButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                    <span ref="eMoveDownButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                    <div ref="eAddButton" role="presentation"></div>\n                    <span ref="eRemoveButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                </div>\n            </div>\n        '),this.item=e,this.dragFeature=t,this.focusWrapper=i,this.moveUpDisabled=!1,this.moveDownDisabled=!1}postConstruct(){const{filterModel:e,level:t,showMove:i}=this.item,s="join"===e.filterType;if(this.ePillWrapper=this.createManagedBean(s?new Of:new Nf),this.ePillWrapper.init({item:this.item,createPill:e=>this.createPill(e)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),0===t){const e=document.createElement("div");e.classList.add("ag-advanced-filter-builder-item-tree-line-vertical-bottom"),e.classList.add("ag-advanced-filter-builder-item-tree-line-root"),this.eTreeLines.appendChild(e),r._.setDisplayed(this.eDragHandle,!1),r._.setDisplayed(this.eButtons,!1),r._.setAriaExpanded(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(r._.createIconNoSpan("advancedFilterBuilderDrag",this.gos)),this.setupValidation(),this.setupMoveButtons(i),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();r._.setAriaLevel(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new Pf(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListener(this.ePillWrapper,Lf.EVENT_VALUE_CHANGED,()=>this.dispatchEvent({type:Lf.EVENT_VALUE_CHANGED})),this.addManagedListener(this.ePillWrapper,Lf.EVENT_VALID_CHANGED,()=>this.updateValidity())}setState(e){const{level:t}=this.item;if(0===t)return;const{showMove:i}=this.item,{disableMoveUp:s,disableMoveDown:n,treeLines:o,showStartTreeLine:a}=e;this.updateTreeLines(o,a),this.updateAriaExpanded(),i&&(this.moveUpDisabled=!!s,this.moveDownDisabled=!!n,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",s),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",n),r._.setAriaDisabled(this.eMoveUpButton,!!s),r._.setAriaDisabled(this.eMoveDownButton,!!n),this.moveUpTooltipFeature.refreshToolTip(),this.moveDownTooltipFeature.refreshToolTip())}focusMoveButton(e){(e?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(e){for(let t=0;t<e;t++){const e=document.createElement("div");this.eTreeLines.appendChild(e)}}updateTreeLines(e,t){const i=e.length-1,{children:s}=this.eTreeLines;for(let t=0;t<i;t++){const i=s.item(t);i&&i.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!e[t])}const r=s.item(i);if(r){r.classList.add("ag-advanced-filter-builder-item-tree-line-horizontal");const t=e[i];r.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-top",t),r.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!t)}this.eDragHandle.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-bottom",t)}setupValidation(){this.eValidation.appendChild(r._.createIconNoSpan("advancedFilterBuilderInvalid",this.gos)),this.validationTooltipFeature=this.createManagedBean(new r.CvR({getGui:()=>this.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){var e;const t=kf(e=>this.advancedFilterExpressionService.translate(e),null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.addSelectWidth),i=this.createManagedBean(new Df(t));this.addManagedListener(i,r.sVA.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>this.dispatchEvent({type:Lf.EVENT_ADDED,item:this.item,isJoin:"join"===e.key})),this.eAddButton.appendChild(i.getGui()),this.createManagedBean(new r.CvR({getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(r._.createIconNoSpan("advancedFilterBuilderRemove",this.gos)),this.addManagedListener(this.eRemoveButton,"click",()=>this.removeItem()),this.addManagedListener(this.eRemoveButton,"keydown",e=>{e.key===r.DDm.ENTER&&(e.preventDefault(),r._.stopPropagationForAgGrid(e),this.removeItem())}),this.createManagedBean(new r.CvR({getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderRemoveButtonTooltip")})),r._.setAriaLabel(this.eRemoveButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(r._.createIconNoSpan("advancedFilterBuilderMoveUp",this.gos)),this.addManagedListener(this.eMoveUpButton,"click",()=>this.moveItem(!0)),this.addManagedListener(this.eMoveUpButton,"keydown",e=>{e.key===r.DDm.ENTER&&(e.preventDefault(),r._.stopPropagationForAgGrid(e),this.moveItem(!0))}),this.moveUpTooltipFeature=this.createManagedBean(new r.CvR({getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveUpButtonTooltip")})),r._.setAriaLabel(this.eMoveUpButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(r._.createIconNoSpan("advancedFilterBuilderMoveDown",this.gos)),this.addManagedListener(this.eMoveDownButton,"click",()=>this.moveItem(!1)),this.addManagedListener(this.eMoveDownButton,"keydown",e=>{e.key===r.DDm.ENTER&&(e.preventDefault(),r._.stopPropagationForAgGrid(e),this.moveItem(!1))}),this.moveDownTooltipFeature=this.createManagedBean(new r.CvR({getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveDownButtonTooltip")})),r._.setAriaLabel(this.eMoveDownButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(r._.setDisplayed(this.eMoveUpButton,!1),r._.setDisplayed(this.eMoveDownButton,!1))}updateValidity(){r._.setVisible(this.eValidation,!this.item.valid),this.validationTooltipFeature.refreshToolTip(),this.updateAriaLabel()}createPill(e){var t,i;const{key:s,displayValue:n,cssClass:o,update:a,ariaLabel:l}=e,c=e=>{null!=e&&(a(e),this.dispatchEvent({type:Lf.EVENT_VALUE_CHANGED}))};if(e.isSelect){const{getEditorParams:a,pickerAriaLabelKey:h,pickerAriaLabelValue:d}=e,u=this.gos.get("advancedFilterBuilderParams"),p=`${null!=(t=null==u?void 0:u.pillSelectMinWidth)?t:140}px`,g=`${null!=(i=null==u?void 0:u.pillSelectMaxWidth)?i:200}px`,m=this.createBean(new Ff({pickerAriaLabelKey:h,pickerAriaLabelValue:d,pickerType:"ag-list",value:{key:s,displayValue:n},valueFormatter:e=>{var t;return null==e?null:null!=(t=e.displayValue)?t:e.key},variableWidth:!0,minPickerWidth:p,maxPickerWidth:g,getEditorParams:a,wrapperClassName:o,ariaLabel:l}));return this.addManagedListener(m,r.sVA.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>c(null==e?void 0:e.key)),m}{const t=this.createBean(new _f({value:n,cssClass:o,type:this.getInputType(e.baseCellDataType),ariaLabel:l}));return this.addManagedListener(t,r.sVA.EVENT_FIELD_VALUE_CHANGED,({value:e})=>c(e)),t}}getInputType(e){switch(e){case"text":case"object":case"boolean":return"text";case"number":return"number";case"date":case"dateString":return"date"}}setupDragging(){const e={type:r.qRA.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>r.WO_.ICON_NOT_ALLOWED,getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchEvent({type:Rf.EVENT_DRAG_STARTED,item:this.item}),onDragStopped:()=>this.dragFeature.dispatchEvent({type:Rf.EVENT_DRAG_ENDED})};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}updateAriaLabel(){const e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,i=this.ePillWrapper.getValidationMessage();let s;s=i?this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItemValidation",[e,t,i]):this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItem",[e,t]),r._.setAriaLabel(this.focusWrapper,s)}updateAriaExpanded(){r._.removeAriaExpanded(this.focusWrapper);const{filterModel:e}=this.item;"join"===(null==e?void 0:e.filterType)&&e.conditions.length&&r._.setAriaExpanded(this.focusWrapper,!0)}removeItem(){this.dispatchEvent({type:Lf.EVENT_REMOVED,item:this.item})}moveItem(e){this.dispatchEvent({type:Lf.EVENT_MOVED,item:this.item,backwards:e})}};Af([(0,r.PIB)("eTreeLines")],Gf.prototype,"eTreeLines",2),Af([(0,r.PIB)("eDragHandle")],Gf.prototype,"eDragHandle",2),Af([(0,r.PIB)("eItem")],Gf.prototype,"eItem",2),Af([(0,r.PIB)("eButtons")],Gf.prototype,"eButtons",2),Af([(0,r.PIB)("eValidation")],Gf.prototype,"eValidation",2),Af([(0,r.PIB)("eMoveUpButton")],Gf.prototype,"eMoveUpButton",2),Af([(0,r.PIB)("eMoveDownButton")],Gf.prototype,"eMoveDownButton",2),Af([(0,r.PIB)("eAddButton")],Gf.prototype,"eAddButton",2),Af([(0,r.PIB)("eRemoveButton")],Gf.prototype,"eRemoveButton",2),Af([(0,r.dsm)("beans")],Gf.prototype,"beans",2),Af([(0,r.dsm)("dragAndDropService")],Gf.prototype,"dragAndDropService",2),Af([(0,r.dsm)("advancedFilterExpressionService")],Gf.prototype,"advancedFilterExpressionService",2),Af([r.o7C],Gf.prototype,"postConstruct",1);var Bf=class extends r.uAl{constructor(e,t){super('\n            <div class="ag-advanced-filter-builder-item-wrapper" role="presentation">\n                <div ref="eItem" class="ag-advanced-filter-builder-item" role="presentation">\n                    <div class="ag-advanced-filter-builder-item-tree-lines" aria-hidden="true">\n                        <div class="ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal"></div>\n                    </div>\n                </div>\n            </div>\n        '),this.item=e,this.focusWrapper=t}postConstruct(){var e;r._.setAriaLevel(this.focusWrapper,2);const t=kf(e=>this.advancedFilterExpressionService.translate(e),null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.addSelectWidth),i=this.createManagedBean(new Df(t));this.addManagedListener(i,r.sVA.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>{this.dispatchEvent({type:Lf.EVENT_ADDED,item:this.item,isJoin:"join"===e.key})}),this.eItem.appendChild(i.getGui()),this.createManagedBean(new r.CvR({getGui:()=>i.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new Pf(this.getGui(),this.focusWrapper,i)),r._.setAriaLabel(this.focusWrapper,this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItem",[this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}};Af([(0,r.dsm)("beans")],Bf.prototype,"beans",2),Af([(0,r.dsm)("advancedFilterExpressionService")],Bf.prototype,"advancedFilterExpressionService",2),Af([(0,r.PIB)("eItem")],Bf.prototype,"eItem",2),Af([r.o7C],Bf.prototype,"postConstruct",1);var Vf=class extends r.uAl{constructor(){super('\n            <div role="presentation" class="ag-advanced-filter-builder" tabindex="-1">\n                <div role="presentation" class="ag-advanced-filter-builder-list" ref="eList"></div>\n                <div role="presentation" class="ag-advanced-filter-builder-button-panel">\n                    <button class="ag-button ag-standard-button ag-advanced-filter-builder-apply-button" ref="eApplyFilterButton"></button>\n                    <button class="ag-button ag-standard-button ag-advanced-filter-builder-cancel-button" ref="eCancelFilterButton"></button>\n                </div>\n            </div>'),this.validationMessage=null}postConstruct(){var e;const{showMoveButtons:t}=null!=(e=this.gos.get("advancedFilterBuilderParams"))?e:{};this.showMove=!!t,this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:e})=>{this.showMove=!!(null==e?void 0:e.showMoveButtons),this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new Rf(this,this.virtualList)),this.setupButtons()}refresh(){let e=this.virtualList.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),null!=e&&(this.virtualList.getComponentAt(e)||(e=0),this.virtualList.focusRow(e))}getNumItems(){return this.items.length}moveItem(e,t){t&&e&&this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.focusRow(0)}setupVirtualList(){this.virtualList=this.createManagedBean(new r.wjn({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderList")})),this.virtualList.setComponentCreator(this.createItemComponent.bind(this)),this.virtualList.setComponentUpdater(this.updateItemComponent.bind(this)),this.virtualList.setRowHeight(40),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.items.length,getRow:e=>this.items[e],areRowsEqual:(e,t)=>e===t}),this.buildList(),this.virtualList.refresh()}setupButtons(){this.eApplyFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilderApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedListener(this.eApplyFilterButton,"click",()=>{this.advancedFilterService.setModel(this.filterModel),this.filterManager.onFilterChanged({source:"advancedFilter"}),this.close()}),this.validationTooltipFeature=this.createManagedBean(new r.CvR({getGui:()=>this.eApplyFilterButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.validationMessage,getTooltipShowDelayOverride:()=>1e3})),this.validate(),this.addManagedListener(this.eApplyFilterButton,"mouseenter",()=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",!0)),this.addManagedListener(this.eApplyFilterButton,"mouseleave",()=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",!1)),this.eCancelFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilderCancel"),this.activateTabIndex([this.eCancelFilterButton]),this.addManagedListener(this.eCancelFilterButton,"click",()=>this.close())}removeItemFromParent(e){const t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,i){var s;const r=this.items[t],n="join"===(null==(s=r.filterModel)?void 0:s.filterType)&&"bottom"===i,o=n?r.filterModel:r.parent;if(!o)return;if(this.isChildOrSelf(o,e.filterModel)||r===e)return;let a;this.removeItemFromParent(e),n?a=0:(a=o.conditions.indexOf(r.filterModel),-1===a?a=o.conditions.length:"bottom"===i&&(a+=1)),o.conditions.splice(a,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||"join"===t.filterType&&t.conditions.some(t=>this.isChildOrSelf(e,t))}setupFilterModel(){const e=this.formatFilterModel(this.advancedFilterService.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return"join"!==(e=null!=e?e:{filterType:"join",type:"AND",conditions:[]}).filterType&&(e={filterType:"join",type:"AND",conditions:[e]}),e}buildList(){const e=(t,i,s,r)=>{i.push({filterModel:t,level:s,parent:r,valid:!0,showMove:this.showMove}),"join"===t.filterType&&(t.conditions.forEach(r=>e(r,i,s+1,t)),0===s&&i.push({filterModel:null,level:s+1,parent:t,valid:!0}))};this.items=[],e(this.filterModel,this.items,0)}refreshList(e){if(!e){const e=[];this.items.forEach(t=>{t.valid||e.push(t.filterModel)}),this.buildList(),e.length&&this.items.forEach(t=>{t.filterModel&&e.includes(t.filterModel)&&(t.valid=!1)})}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){const i=this.items.indexOf(e),s=(e,t)=>{const i=this.items.find(t=>t.filterModel===e),r=null==i?void 0:i.parent;if(r){const{conditions:i}=r;s(r,t),t.push(i[i.length-1]===e)}},r=[],{filterModel:n}=e;n&&(s(n,r),r[0]=!1);const o="join"===(null==n?void 0:n.filterType)&&!!n.conditions.length;t.setState({disableMoveUp:1===i,disableMoveDown:!this.canMoveDown(e,i),treeLines:r,showStartTreeLine:o})}createItemComponent(e,t){const i=this.createBean(e.filterModel?new Gf(e,this.dragFeature,t):new Bf(e,t));return i.addManagedListener(i,Lf.EVENT_REMOVED,({item:e})=>this.removeItem(e)),i.addManagedListener(i,Lf.EVENT_VALUE_CHANGED,()=>this.validate()),i.addManagedListener(i,Lf.EVENT_ADDED,({item:e,isJoin:t})=>this.addItem(e,t)),i.addManagedListener(i,Lf.EVENT_MOVED,({item:e,backwards:t})=>this.moveItemUpDown(e,t)),i instanceof Gf&&this.updateItemComponent(e,i),i}addItem(e,t){var i;const{parent:s,level:r,filterModel:n}=e,o="join"===(null==n?void 0:n.filterType),a=t?{filterType:"join",type:"AND",conditions:[]}:{},l=o?n:s;let c=o?0:l.conditions.indexOf(n);c>=0?(o||(c+=1),l.conditions.splice(c,0,a)):l.conditions.push(a);let h=this.items.indexOf(e);const d=h>=0;if(d){e.filterModel&&h++;const i=[{filterModel:a,level:o?r+1:r,parent:l,valid:t,showMove:this.showMove}];this.items.splice(h,0,...i)}this.refreshList(d),d&&(null==(i=this.virtualList.getComponentAt(h))||i.afterAdd())}removeItem(e){var t;const i=e.parent,{filterModel:s}=e,r=i.conditions.indexOf(s);i.conditions.splice(r,1);const n="join"===(null==(t=e.filterModel)?void 0:t.filterType),o=this.items.indexOf(e),a=!n&&o>=0;a&&this.items.splice(o,1),this.refreshList(a),o>=0&&this.virtualList.focusRow(o)}moveItemUpDown(e,t){const i=this.items.indexOf(e),s=t?i-1:i+1;if(0===s||!t&&!this.canMoveDown(e,i))return;const r=this.items[s],n=this.removeItemFromParent(e),{level:o,filterModel:a,parent:l}=e,{level:c,filterModel:h,parent:d}=r;if(t)if(c===o&&"join"===h.filterType)h.conditions.push(a);else if(c<=o){const e=d.conditions.indexOf(h);d.conditions.splice(e,0,a)}else l.conditions[n-1].conditions.push(a);else if(c===o)if("join"===h.filterType)h.conditions.splice(0,0,a);else{const e=d.conditions.indexOf(h);d.conditions.splice(e+1,0,a)}else if(n<l.conditions.length)l.conditions.splice(n+1,0,a);else{const e=this.items.find(e=>e.filterModel===l),t=e.parent.conditions.indexOf(e.filterModel)+1;e.parent.conditions.splice(t,0,a)}this.refreshList(!1);const u=this.items.findIndex(({filterModel:e})=>e===a);if(u>=0){const e=this.virtualList.getComponentAt(u);e instanceof Gf&&e.focusMoveButton(t)}}canMoveDown(e,t){return!(1===e.level&&t===this.items.length-2||1===e.level&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilterService.getCtrl().toggleFilterBuilder("ui")}validate(){let e=!this.items.every(({valid:e})=>e);e?this.validationMessage=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationIncomplete"):(e=JSON.stringify(this.filterModel)===this.stringifiedModel,this.validationMessage=e?this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationAlreadyApplied"):null),r._.setDisabled(this.eApplyFilterButton,e),this.validationTooltipFeature.refreshToolTip()}validateItems(){const e=e=>{e.type=void 0},t=e=>{delete e.filter};this.items.forEach(i=>{if(!i.valid||!i.filterModel||"join"===i.filterModel.filterType)return;const{filterModel:s}=i,{colId:n}=s,o=this.advancedFilterExpressionService.getColumnAutocompleteEntries().find(({key:e})=>e===n),a=this.advancedFilterExpressionService.getColumnDetails(s.colId);if(!o||!a.column)return i.valid=!1,s.colId=void 0,e(s),void t(s);const l=this.advancedFilterExpressionService.getDataTypeExpressionOperator(a.baseCellDataType).operators[s.type];if(!l)return i.valid=!1,e(s),void t(s);l.numOperands>0&&!r._.exists(s.filter)&&(i.valid=!1)})}};Af([(0,r.PIB)("eList")],Vf.prototype,"eList",2),Af([(0,r.PIB)("eApplyFilterButton")],Vf.prototype,"eApplyFilterButton",2),Af([(0,r.PIB)("eCancelFilterButton")],Vf.prototype,"eCancelFilterButton",2),Af([(0,r.dsm)("filterManager")],Vf.prototype,"filterManager",2),Af([(0,r.dsm)("advancedFilterService")],Vf.prototype,"advancedFilterService",2),Af([(0,r.dsm)("advancedFilterExpressionService")],Vf.prototype,"advancedFilterExpressionService",2),Af([(0,r.dsm)("beans")],Vf.prototype,"beans",2),Af([r.o7C],Vf.prototype,"postConstruct",1);var Hf=class e extends r.XQb{constructor(e){super(),this.enabled=e}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsService.whenReady(()=>this.setAdvancedFilterComp()),this.addManagedListener(this.eventService,r.sVA.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onEnabledChanged(e)),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog&&this.eBuilderDialog.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp=this.createManagedBean(new Tf(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){return!!this.eHeaderComp&&(this.eHeaderComp.getFocusableElement().focus(),!0)}refreshComp(){var e,t;null==(e=this.eFilterComp)||e.refresh(),null==(t=this.eHeaderComp)||t.refresh()}refreshBuilderComp(){var e;null==(e=this.eBuilderComp)||e.refresh()}getHeaderHeight(){var e,t;return null!=(t=null==(e=this.eHeaderComp)?void 0:e.getHeight())?t:0}setInputDisabled(e){var t,i;null==(t=this.eFilterComp)||t.setInputDisabled(e),null==(i=this.eHeaderComp)||i.setInputDisabled(e)}toggleFilterBuilder(t,i){if(i&&this.eBuilderDialog||!1===i&&!this.eBuilderDialog)return;if(this.eBuilderDialog)return this.builderDestroySource=t,void this.destroyBean(this.eBuilderDialog);this.setInputDisabled(!0);const{width:s,height:n,minWidth:o}=this.getBuilderDialogSize();this.eBuilderComp=this.createBean(new Vf),this.eBuilderDialog=this.createBean(new r.fNJ({title:this.advancedFilterExpressionService.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:s,height:n,resizable:!0,movable:!0,maximizable:!0,centered:!0,closable:!0,minWidth:o,afterGuiAttached:()=>{var e;return null==(e=this.eBuilderComp)?void 0:e.afterGuiAttached()}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener(r.fNJ.EVENT_DESTROYED,()=>{var t;this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchEvent({type:e.EVENT_BUILDER_CLOSED}),this.dispatchFilterBuilderVisibleChangedEvent(null!=(t=this.builderDestroySource)?t:"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){const i={type:r.sVA.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED,source:e,visible:t};this.eventService.dispatchEvent(i)}getBuilderDialogSize(){var e,t;const i=null!=(t=null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.minWidth)?t:500,s=this.popupService.getPopupParent(),n=Math.round(r._.getAbsoluteWidth(s))-2,o=Math.round(.75*r._.getAbsoluteHeight(s))-2;return{width:Math.min(Math.max(600,i),n),height:Math.min(600,o),minWidth:i}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventService.dispatchEvent({type:r.sVA.EVENT_HEADER_HEIGHT_CHANGED})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;const e=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!e,e){const t=this.createBean(new zf),i=t.getGui(),{allThemes:s}=this.environment.getTheme();s.length&&i.classList.add(...s),i.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),e.appendChild(i),this.eFilterComp=t}}setHeaderCompEnabled(){var e;null==(e=this.eHeaderComp)||e.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(r._.removeFromParent(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}};Hf.EVENT_BUILDER_CLOSED="advancedFilterBuilderClosed",Af([(0,r.dsm)("focusService")],Hf.prototype,"focusService",2),Af([(0,r.dsm)("ctrlsService")],Hf.prototype,"ctrlsService",2),Af([(0,r.dsm)("popupService")],Hf.prototype,"popupService",2),Af([(0,r.dsm)("advancedFilterExpressionService")],Hf.prototype,"advancedFilterExpressionService",2),Af([r.o7C],Hf.prototype,"postConstruct",1);var Uf=Hf,zf=class extends r.uAl{constructor(){super('\n            <div class="ag-advanced-filter" role="presentation" tabindex="-1">\n                <ag-autocomplete ref="eAutocomplete"></ag-autocomplete>\n                <button class="ag-button ag-standard-button ag-advanced-filter-apply-button" ref="eApplyFilterButton"></button>\n                <button class="ag-advanced-filter-builder-button" ref="eBuilderFilterButton">\n                    <span ref="eBuilderFilterButtonIcon" aria-hidden="true"></span>\n                    <span class="ag-advanced-filter-builder-button-label" ref="eBuilderFilterButtonLabel"></span>\n                </button>\n            </div>'),this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}postConstruct(){this.eAutocomplete.setListGenerator((e,t)=>this.generateAutocompleteListParams(t)).setValidator(()=>this.validateValue()).setForceLastSelection((e,t)=>this.forceLastSelection(e,t)).setInputAriaLabel(this.advancedFilterExpressionService.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advancedFilterExpressionService.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListener(this.eAutocomplete,r.bB5.EVENT_VALUE_CHANGED,({value:e})=>this.onValueChanged(e)),this.addManagedListener(this.eAutocomplete,r.bB5.EVENT_VALUE_CONFIRMED,({isValid:e})=>this.onValueConfirmed(e)),this.addManagedListener(this.eAutocomplete,r.bB5.EVENT_OPTION_SELECTED,({position:e,updateEntry:t,autocompleteType:i})=>this.onOptionSelected(e,t,i)),this.addManagedListener(this.eAutocomplete,r.bB5.EVENT_VALID_CHANGED,({isValid:e,validationMessage:t})=>this.onValidChanged(e,t)),this.setupApplyButton(),this.setupBuilderButton()}refresh(){const e=this.advancedFilterService.getExpressionDisplayValue();this.eAutocomplete.setValue({value:null!=e?e:"",position:null==e?void 0:e.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),r._.setDisabled(this.eApplyFilterButton,e||this.isApplyDisabled)}getTooltipParams(){const e=super.getTooltipParams();return e.location="advancedFilter",e}setupApplyButton(){this.eApplyFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedListener(this.eApplyFilterButton,"click",()=>this.onValueConfirmed(this.eAutocomplete.isValid())),r._.setDisabled(this.eApplyFilterButton,this.isApplyDisabled)}setupBuilderButton(){this.eBuilderFilterButtonIcon.appendChild(r._.createIconNoSpan("advancedFilterBuilder",this.gos)),this.eBuilderFilterButtonLabel.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedListener(this.eBuilderFilterButton,"click",()=>this.openBuilder()),this.addManagedListener(this.advancedFilterService.getCtrl(),Uf.EVENT_BUILDER_CLOSED,()=>this.closeBuilder())}onValueChanged(e){var t;e=r._.makeNull(e),this.advancedFilterService.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilterService.createExpressionParser(e);const i=null==(t=this.expressionParser)?void 0:t.parseExpression();i&&i!==e&&this.eAutocomplete.setValue({value:i,silent:!0,restoreFocus:!0})}onValueConfirmed(e){e&&!this.isApplyDisabled&&(r._.setDisabled(this.eApplyFilterButton,!0),this.advancedFilterService.applyExpression(),this.filterManager.onFilterChanged({source:"advancedFilter"}))}onOptionSelected(e,t,i){const{updatedValue:s,updatedPosition:r,hideAutocomplete:n}=this.updateExpression(e,t,i);this.eAutocomplete.setValue({value:s,position:r,updateListOnlyIfOpen:n,restoreFocus:!0})}validateValue(){var e,t,i;return(null==(e=this.expressionParser)?void 0:e.isValid())?null:null!=(i=null==(t=this.expressionParser)?void 0:t.getValidationMessage())?i:null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilterService.isCurrentExpressionApplied(),r._.setDisabled(this.eApplyFilterButton,this.isApplyDisabled),this.setTooltip({newTooltipText:t,showDelayOverride:1e3})}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advancedFilterExpressionService.getDefaultAutocompleteListParams("")}updateExpression(e,t,i){var s,r;return this.advancedFilterExpressionService.updateAutocompleteCache(t,i),null!=(r=null==(s=this.expressionParser)?void 0:s.updateExpression(e,t,i))?r:this.advancedFilterService.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},i){return!!i.toLocaleLowerCase().match(`^${(null!=t?t:e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,r._.setDisabled(this.eBuilderFilterButton,!0),this.advancedFilterService.getCtrl().toggleFilterBuilder("ui"))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,r._.setDisabled(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}};Af([(0,r.PIB)("eAutocomplete")],zf.prototype,"eAutocomplete",2),Af([(0,r.PIB)("eApplyFilterButton")],zf.prototype,"eApplyFilterButton",2),Af([(0,r.PIB)("eBuilderFilterButton")],zf.prototype,"eBuilderFilterButton",2),Af([(0,r.PIB)("eBuilderFilterButtonIcon")],zf.prototype,"eBuilderFilterButtonIcon",2),Af([(0,r.PIB)("eBuilderFilterButtonLabel")],zf.prototype,"eBuilderFilterButtonLabel",2),Af([(0,r.dsm)("advancedFilterService")],zf.prototype,"advancedFilterService",2),Af([(0,r.dsm)("advancedFilterExpressionService")],zf.prototype,"advancedFilterExpressionService",2),Af([(0,r.dsm)("filterManager")],zf.prototype,"filterManager",2),Af([r.o7C],zf.prototype,"postConstruct",1);var Wf={ariaAdvancedFilterBuilderItem:e=>`${e[0]}. Level ${e[1]}. Press ENTER to edit.`,ariaAdvancedFilterBuilderItemValidation:e=>`${e[0]}. Level ${e[1]}. ${e[2]} Press ENTER to edit.`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:e=>`Expression has an error. ${e[0]} - ${e[1]}.`,advancedFilterValidationMessageAtEnd:e=>`Expression has an error. ${e[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};function jf(e,t,i){if(!e)return"";const s=i-t;return s?e.slice(0,e.length-s):e}function Kf(e,t,i,s,r,n,o){const a=i+(!e.length||o?0:1);let l=0;return r&&(" "===e[a]?l=1:(s+=" ",n&&(s+='"'))),{updatedValue:e.slice(0,t)+s+e.slice(a),updatedPosition:t+s.length+l}}function $f(e,t,i,s){let r=t,n=!1;for(;r<e.length;){const t=e[r];if("("===t){s&&" "===e[r-1]?n=!0:r-=1;break}if(" "===t||i&&")"===t){r-=1;break}r++}return{endPosition:r,isEmpty:n}}function Yf(e,t,i,s){i!==t&&(e.expression=Kf(e.expression,s-t.length+1,s,i).updatedValue)}var qf=class{constructor(e,t){this.params=e,this.startPosition=t,this.type="column",this.valid=!0,this.hasStartChar=!1,this.hasEndChar=!1,this.colName=""}parse(e,t){if(e!==Qf.COL_START_CHAR||this.colName)if(e===Qf.COL_END_CHAR&&this.hasStartChar){if(this.parseColumn(!1,t))return this.hasEndChar=!0,!1;this.colName+=e}else this.colName+=e;else this.hasStartChar=!0}getDisplayValue(){return(this.hasStartChar?Qf.COL_START_CHAR:"")+this.colName+(this.hasEndChar?Qf.COL_END_CHAR:"")}getColId(){return this.colId}complete(e){this.parseColumn(!0,e)}getValidationError(){var e;return this.valid?null:{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidColumn"),startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}}parseColumn(e,t){var i;this.endPosition=t;const s=this.params.advancedFilterExpressionService.getColId(this.colName);return s&&this.hasStartChar&&(this.colId=s.colId,Yf(this.params,this.colName,s.columnName,t-1),this.colName=s.columnName,this.column=this.params.columnModel.getPrimaryColumn(this.colId),this.column)?(this.baseCellDataType=null!=(i=this.params.dataTypeService.getBaseDataType(this.column))?i:"text",!0):(e&&(this.valid=!1),this.baseCellDataType="text",!1)}},Xf=class{constructor(e,t,i){this.params=e,this.startPosition=t,this.baseCellDataType=i,this.type="operator",this.valid=!0,this.expectedNumOperands=0,this.operator=""}parse(e,t){if(" "===e||")"===e){if(this.parseOperator(!1,t-1))return!0;this.operator+=e}else this.operator+=e}complete(e){this.parseOperator(!0,e)}getValidationError(){var e;return this.valid?null:{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidOption"),startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}}getDisplayValue(){return this.operator}getOperatorKey(){return this.parsedOperator}parseOperator(e,t){const i=this.params.advancedFilterExpressionService.getDataTypeExpressionOperator(this.baseCellDataType),s=i.findOperator(this.operator);if(this.endPosition=t,s){this.parsedOperator=s;const e=i.operators[s];this.expectedNumOperands=e.numOperands;const r=e.displayValue;return Yf(this.params,this.operator,r,t),this.operator=r,!0}return!e&&null===s||(this.valid=!1),!1}},Zf=class{constructor(e,t,i,s){this.params=e,this.startPosition=t,this.baseCellDataType=i,this.column=s,this.type="operand",this.valid=!0,this.operand="",this.validationMessage=null}parse(e,t){if(" "===e){if(!this.quotes)return this.parseOperand(!1,t),!0;this.operand+=e}else if(")"===e){if("number"===this.baseCellDataType||!this.quotes)return this.parseOperand(!1,t-1),!0;this.operand+=e}else if(this.operand||this.quotes||"'"!==e&&'"'!==e){if(this.quotes&&e===this.quotes)return this.parseOperand(!1,t),!1;this.operand+=e}else this.quotes=e}complete(e){this.parseOperand(!0,e)}getValidationError(){var e;return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(e,t){const{advancedFilterExpressionService:i}=this.params;if(this.endPosition=t,this.modelValue=this.operand,e&&this.quotes)this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationMissingQuote");else if(""===this.modelValue)this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationMissingValue");else{const e=i.getOperandModelValue(this.operand,this.baseCellDataType,this.column);switch(null!=e&&(this.modelValue=e),this.baseCellDataType){case"number":(this.quotes||isNaN(this.modelValue))&&(this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationNotANumber"));break;case"date":case"dateString":null==e&&(this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationInvalidDate"))}}}},Qf=class{constructor(e,t){this.params=e,this.startPosition=t,this.isAwaiting=!0}parseExpression(){var e,t;let i=this.startPosition;const{expression:s}=this.params;for(;i<s.length;){const e=s[i];if(" "===e&&this.isAwaiting);else{if(this.isAwaiting=!1,!this.parser){let e;this.columnParser?this.operatorParser?(this.operandParser=new Zf(this.params,i,this.columnParser.baseCellDataType,this.columnParser.column),e=this.operandParser):(this.operatorParser=new Xf(this.params,i,this.columnParser.baseCellDataType),e=this.operatorParser):(this.columnParser=new qf(this.params,i),e=this.columnParser),this.parser=e}const t=this.parser.parse(e,i);if(null!=t){if(this.isComplete())return this.returnEndPosition(t?i-1:i,!0);this.parser=void 0,this.isAwaiting=!0}}i++}return null==(t=null==(e=this.parser)?void 0:e.complete)||t.call(e,i-1),this.returnEndPosition(i)}isValid(){return this.isComplete()&&this.columnParser.valid&&this.operatorParser.valid&&(!this.operandParser||this.operandParser.valid)}getValidationError(){var e,t,i,s,r;const n=null!=(r=null!=(i=null==(e=this.columnParser)?void 0:e.getValidationError())?i:null==(t=this.operatorParser)?void 0:t.getValidationError())?r:null==(s=this.operandParser)?void 0:s.getValidationError();if(n)return n;const o=this.params.expression.length;let a;return this.columnParser?this.operatorParser?this.operatorParser.expectedNumOperands&&!this.operandParser&&(a="advancedFilterValidationMissingValue"):a="advancedFilterValidationMissingOption":a="advancedFilterValidationMissingColumn",a?{message:this.params.advancedFilterExpressionService.translate(a),startPosition:o,endPosition:o}:null}getFunctionString(e){return this.getFunctionCommon(e,(e,t,i,s)=>`params.operators[${t}].evaluator(expressionProxy.getValue('${i.replace(/(['"])/,"\\$1")}', node), node, params.evaluatorParams[${s}]${null==e?"":`, params.operands[${e}]`})`)}getFunctionParsed(e){return this.getFunctionCommon(e,(e,t,i,s)=>(r,n,o)=>o.operators[t].evaluator(r.getValue(i,n),n,o.evaluatorParams[s],null==e?void 0:o.operands[e]))}getAutocompleteListParams(e){return this.isColumnPosition(e)?this.getColumnAutocompleteListParams(e):this.isOperatorPosition(e)?this.getOperatorAutocompleteListParams(e):this.isBeyondEndPosition(e)?void 0:{enabled:!1}}updateExpression(e,t,i){var s,r,n,o,a;const{expression:l}=this.params;if(this.isColumnPosition(e))return Kf(this.params.expression,this.startPosition,(null==(s=this.columnParser)?void 0:s.getColId())?this.columnParser.endPosition:$f(l,e).endPosition,this.params.advancedFilterExpressionService.getColumnValue(t),!0);if(this.isOperatorPosition(e)){const s=this.getBaseCellDataTypeFromOperatorAutocompleteType(i),c=this.hasOperand(s,t.key),h=c&&this.doesOperandNeedQuotes(s);let d;if(null!=(null==(r=this.operatorParser)?void 0:r.startPosition)&&e<this.operatorParser.startPosition)d=Kf(l,e,e,null!=(n=t.displayValue)?n:t.key,c,h);else{let i,s=!1;if(null==(o=this.operatorParser)?void 0:o.getOperatorKey())i=this.operatorParser.endPosition;else{const{endPosition:t,isEmpty:r}=$f(l,e,!0,!0);i=t,s=r}d=Kf(l,function(e,t,i){let s=t;for(;s<i&&" "===e[s];)s++;return s}(l,this.columnParser.endPosition+1,i),i,null!=(a=t.displayValue)?a:t.key,c,h,s)}return Mf(Ef({},d),{hideAutocomplete:!c})}return null}getModel(){const e=this.columnParser.getColId(),t={filterType:this.columnParser.baseCellDataType,colId:e,type:this.operatorParser.getOperatorKey()};return this.operatorParser.expectedNumOperands&&(t.filter=this.operandParser.getModelValue()),t}getFunctionCommon(e,t){var i,s;const r=this.columnParser.getColId(),n=null==(i=this.operatorParser)?void 0:i.getOperatorKey(),{operators:o,evaluatorParams:a,operands:l}=e,c=this.params.advancedFilterExpressionService.getExpressionOperator(this.columnParser.baseCellDataType,n),h=this.addToListAndGetIndex(o,c),d=this.params.advancedFilterExpressionService.getExpressionEvaluatorParams(r),u=this.addToListAndGetIndex(a,d);return t(0===(null==(s=this.operatorParser)?void 0:s.expectedNumOperands)?void 0:this.addToListAndGetIndex(l,this.getOperandValue()),h,r,u)}getOperandValue(){let e=this.operandParser.getRawValue();const{baseCellDataType:t,column:i}=this.columnParser;switch(t){case"number":e=Number(e);break;case"date":case"dateString":e=this.params.valueService.parseValue(i,null,e,void 0)}return"dateString"===t?this.params.dataTypeService.getDateParserFunction(i)(e):e}isComplete(){return!(!this.operatorParser||!(!this.operatorParser.expectedNumOperands||this.operatorParser.expectedNumOperands&&this.operandParser))}isColumnPosition(e){return!this.columnParser||null==this.columnParser.endPosition||e<=this.columnParser.endPosition+1}isOperatorPosition(e){return!this.operatorParser||null==this.operatorParser.endPosition||e<=this.operatorParser.endPosition+1}isBeyondEndPosition(e){return this.isComplete()&&null!=this.endPosition&&e>this.endPosition+1&&this.endPosition+1<this.params.expression.length}returnEndPosition(e,t){return this.endPosition=t?e:e-1,e}getColumnAutocompleteListParams(e){return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getColumnAutocompleteEntries(),"column",this.getColumnSearchString(e))}getColumnSearchString(e){var t,i,s,r,n;const o=null!=(i=null==(t=this.columnParser)?void 0:t.getDisplayValue())?i:"",a=jf(o,e,null==(null==(s=this.columnParser)?void 0:s.endPosition)?this.params.expression.length:this.columnParser.endPosition+1),l=(null==(r=this.columnParser)?void 0:r.hasStartChar)&&a.length>0,c=(null==(n=this.columnParser)?void 0:n.hasEndChar)&&a.length===o.length+2;return l?a.slice(1,c?-1:void 0):a}getOperatorAutocompleteListParams(e){var t,i,s,r,n;const o=null==(t=this.columnParser)?void 0:t.column;if(!o)return{enabled:!1};const a=this.columnParser.baseCellDataType,l=null!=(null==(i=this.operatorParser)?void 0:i.startPosition)&&e<this.operatorParser.startPosition?"":jf(null!=(r=null==(s=this.operatorParser)?void 0:s.getDisplayValue())?r:"",e,null==(null==(n=this.operatorParser)?void 0:n.endPosition)?this.params.expression.length:this.operatorParser.endPosition+1);return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getOperatorAutocompleteEntries(o,a),`operator-${a}`,l)}getBaseCellDataTypeFromOperatorAutocompleteType(e){return null==e?void 0:e.replace("operator-","")}hasOperand(e,t){var i,s;return!e||!t||(null!=(s=null==(i=this.params.advancedFilterExpressionService.getExpressionOperator(e,t))?void 0:i.numOperands)?s:0)>0}doesOperandNeedQuotes(e){return"number"!==e}addToListAndGetIndex(e,t){const i=e.length;return e.push(t),i}};function Jf(e,t,i){let s=!1;const r=e.toLocaleLowerCase(),n=r+" ",o=Object.entries(t).find(([e,t])=>{const o=i(t).toLocaleLowerCase();return o.startsWith(n)&&(s=!0),o===r});return o?o[0]:s?null:void 0}function ey(e,t){return(null!=t?t:Object.keys(e)).map(t=>({key:t,displayValue:e[t].displayValue}))}Qf.COL_START_CHAR="[",Qf.COL_END_CHAR="]";var ty=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return ey(this.operators,e)}findOperator(e){return Jf(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e}=this.params;this.operators={contains:{displayValue:e("advancedFilterContains"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e.includes(t)),numOperands:1},notContains:{displayValue:e("advancedFilterNotContains"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!0,(e,t)=>!e.includes(t)),numOperands:1},equals:{displayValue:e("advancedFilterTextEquals"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e===t),numOperands:1},notEqual:{displayValue:e("advancedFilterTextNotEqual"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!0,(e,t)=>e!=t),numOperands:1},startsWith:{displayValue:e("advancedFilterStartsWith"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e.startsWith(t)),numOperands:1},endsWith:{displayValue:e("advancedFilterEndsWith"),evaluator:(e,t,i,s)=>this.evaluateExpression(e,t,i,s,!1,(e,t)=>e.endsWith(t)),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e||"string"==typeof e&&0===e.trim().length,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e&&("string"!=typeof e||e.trim().length>0),numOperands:0}}}evaluateExpression(e,t,i,s,r,n){return null==e?r:i.caseSensitive?n(i.valueConverter(e,t),s):n(i.valueConverter(e,t).toLocaleLowerCase(),s.toLocaleLowerCase())}},iy=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return ey(this.operators,e)}findOperator(e){return Jf(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e("advancedFilterEquals"),evaluator:(e,i,s,r)=>this.evaluateSingleOperandExpression(e,i,s,r,!!s.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e("advancedFilterNotEqual"),evaluator:(e,i,s,r)=>this.evaluateSingleOperandExpression(e,i,s,r,!!s.includeBlanksInEquals,(e,i)=>!t(e,i)),numOperands:1},greaterThan:{displayValue:e("advancedFilterGreaterThan"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInGreaterThan,(e,t)=>e>t),numOperands:1},greaterThanOrEqual:{displayValue:e("advancedFilterGreaterThanOrEqual"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInGreaterThan,(e,t)=>e>=t),numOperands:1},lessThan:{displayValue:e("advancedFilterLessThan"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInLessThan,(e,t)=>e<t),numOperands:1},lessThanOrEqual:{displayValue:e("advancedFilterLessThanOrEqual"),evaluator:(e,t,i,s)=>this.evaluateSingleOperandExpression(e,t,i,s,!!i.includeBlanksInLessThan,(e,t)=>e<=t),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e,numOperands:0}}}evaluateSingleOperandExpression(e,t,i,s,r,n){return null==e?r:n(i.valueConverter(e,t),s)}},sy=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return ey(this.operators,e)}findOperator(e){return Jf(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e}=this.params;this.operators={true:{displayValue:e("advancedFilterTrue"),evaluator:e=>!!e,numOperands:0},false:{displayValue:e("advancedFilterFalse"),evaluator:e=>!1===e,numOperands:0},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e,numOperands:0}}}},ry=class extends r.XQb{constructor(){super(...arguments),this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){var t;const{type:i}=e;return null!=(t=this.expressionJoinOperators[i])?t:i}getColumnDisplayValue(e){const{colId:t}=e,i=this.getColumnAutocompleteEntries().find(({key:e})=>e===t);let s;return i?(s=i.displayValue,this.columnNameToIdMap[s.toLocaleUpperCase()]={colId:t,columnName:s}):s=t,s}getOperatorDisplayValue(e){var t,i;return null!=(i=null==(t=this.getExpressionOperator(e.filterType,e.type))?void 0:t.displayValue)?i:e.type}getOperandModelValue(e,t,i){var s;switch(t){case"number":return r._.exists(e)?Number(e):null;case"date":return r._.serialiseDate(this.valueService.parseValue(i,null,e,void 0),!1);case"dateString":const t=this.valueService.parseValue(i,null,e,void 0);return r._.serialiseDate(null!=(s=this.dataTypeService.getDateParserFunction(i)(t))?s:null,!1)}return e}getOperandDisplayValue(e,t){var i,s;const{colId:n,filter:o}=e,a=this.columnModel.getPrimaryColumn(n);let l="";if(null!=o){let n;switch(e.filterType){case"number":n=null!=(i=r._.toStringOrNull(o))?i:"";break;case"date":const e=r._.parseDateTimeFromString(o);n=a?this.valueService.formatValue(a,null,e):null;break;case"dateString":const t=r._.parseDateTimeFromString(o),s=a?this.dataTypeService.getDateFormatterFunction(a)(null!=t?t:void 0):null;n=a?this.valueService.formatValue(a,null,s):null}"number"!==e.filterType&&(n=null!=(s=null!=n?n:r._.toStringOrNull(o))?s:"",t||(n=`"${n}"`)),l=t?n:` ${n}`}return l}parseColumnFilterModel(e){var t,i;return`[${null!=(t=this.getColumnDisplayValue(e))?t:""}] ${null!=(i=this.getOperatorDisplayValue(e))?i:""}${this.getOperandDisplayValue(e)}`}updateAutocompleteCache(e,t){if("column"===t){const{key:t,displayValue:i}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:t,columnName:i}}}translate(e,t){let i=Wf[e];return"function"==typeof i&&(i=i(t)),this.localeService.getLocaleTextFunc()(e,i,t)}generateAutocompleteListParams(e,t,i){return{enabled:!0,type:t,searchString:i,entries:e}}getColumnAutocompleteEntries(){var e;if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;const t=null!=(e=this.columnModel.getAllPrimaryColumns())?e:[],i=[],s=this.gos.get("includeHiddenColumnsInAdvancedFilter");return t.forEach(e=>{e.getColDef().filter&&(s||e.isVisible()||e.isRowGroupActive())&&i.push({key:e.getColId(),displayValue:this.columnModel.getDisplayNameForColumn(e,"advancedFilter")})}),i.sort((e,t)=>{var i,s;const r=null!=(i=e.displayValue)?i:"",n=null!=(s=t.displayValue)?s:"";return r<n?-1:n>r?1:0}),i}getOperatorAutocompleteEntries(e,t){const i=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(i)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([e,t])=>({key:e,displayValue:t}))}getDefaultAutocompleteListParams(e){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",e)}getDataTypeExpressionOperator(e){return this.expressionOperators[e]}getExpressionOperator(e,t){var i,s;return null==(s=null==(i=this.getDataTypeExpressionOperator(e))?void 0:i.operators)?void 0:s[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){const t=e.toLocaleUpperCase(),i=this.columnNameToIdMap[t];if(i)return i;const s=this.getColumnAutocompleteEntries().find(({displayValue:e})=>e.toLocaleUpperCase()===t);if(s){const{key:e,displayValue:i}=s,r={colId:e,columnName:i};return this.columnNameToIdMap[t]=r,r}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;const i=this.columnModel.getPrimaryColumn(e);if(!i)return{valueConverter:e=>e};switch(this.dataTypeService.getBaseDataType(i)){case"dateString":t={valueConverter:this.dataTypeService.getDateParserFunction(i)};break;case"object":t=i.getColDef().filterValueGetter?{valueConverter:e=>e}:{valueConverter:(e,t)=>{var s;return null!=(s=this.valueService.formatValue(i,t,e))?s:"function"==typeof e.toString?e.toString():""}};break;case"text":case void 0:t={valueConverter:e=>r._.toStringOrNull(e)};break;default:t={valueConverter:e=>e}}const{filterParams:s}=i.getColDef();return s&&["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach(e=>{const i=s[e];i&&(t[e]=i)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){var t,i;const s=null!=(t=this.columnModel.getPrimaryColumn(e))?t:void 0;return{column:s,baseCellDataType:null!=(i=s?this.dataTypeService.getBaseDataType(s):void 0)?i:"text"}}generateExpressionOperators(){const e=(e,t)=>this.translate(e,t);return{text:new ty({translate:e}),boolean:new sy({translate:e}),object:new ty({translate:e}),number:new iy({translate:e,equals:(e,t)=>e===t}),date:new iy({translate:e,equals:(e,t)=>e.getTime()===t.getTime()}),dateString:new iy({translate:e,equals:(e,t)=>e.getTime()===t.getTime()})}}getColumnValue({displayValue:e}){return`${Qf.COL_START_CHAR}${e}${Qf.COL_END_CHAR}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(e){var t;const i=null==(t=e.getColDef().filterParams)?void 0:t.filterOptions;if(i)return i.every(e=>"string"==typeof e)?i:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}};Af([(0,r.dsm)("valueService")],ry.prototype,"valueService",2),Af([(0,r.dsm)("columnModel")],ry.prototype,"columnModel",2),Af([(0,r.dsm)("dataTypeService")],ry.prototype,"dataTypeService",2),Af([r.o7C],ry.prototype,"postConstruct",1),ry=Af([(0,r.dR4)("advancedFilterExpressionService")],ry);var ny=class{constructor(e){this.params=e,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(e){this.operators.push(""),this.operatorStartPositions.push(e),this.operatorEndPositions.push(void 0);const{expression:t}=this.params;for(;e<t.length;){const i=t[e];if(" "===i){if(this.parseOperator(e-1))return this.activeOperator++,e-1;this.operators[this.activeOperator]+=i}else this.operators[this.activeOperator]+=i;e++}return this.parseOperator(e-1),e}isValid(){return!(this.validationError||this.operators.length&&!this.parsedOperator)}getValidationError(){return this.validationError}getFunction(){return"OR"===this.parsedOperator?"||":"&&"}getModel(){return"OR"===this.parsedOperator?"OR":"AND"}getAutocompleteListParams(e,t){let i;if(null==t)i="";else{const s=this.operators[t],r=this.operatorEndPositions[t];i=jf(s,e,null==r?this.params.expression.length:r+1)}let s=this.params.advancedFilterExpressionService.getJoinOperatorAutocompleteEntries();return(t||null==t&&this.activeOperator)&&(s=s.filter(({key:e})=>e===this.parsedOperator)),this.params.advancedFilterExpressionService.generateAutocompleteListParams(s,"join",i)}updateExpression(e,t,i){var s,r;let{expression:n}=this.params;const o=null!=(s=t.displayValue)?s:t.key;if(0===i)for(let e=this.operatorEndPositions.length-1;e>0;e--){const t=this.operatorEndPositions[e];null!=t&&(n=Kf(n,this.operatorStartPositions[e],t,o).updatedValue)}return Kf(n,this.operatorStartPositions.length>i?this.operatorStartPositions[i]:e,null!=(r=this.operatorEndPositions.length>i?this.operatorEndPositions[i]:void 0)?r:$f(n,e,!0).endPosition,o,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){const t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",i=this.params.advancedFilterExpressionService.getExpressionJoinOperators(),s=Jf(t,i,e=>e);if(s){this.operatorEndPositions[this.activeOperator]=e;const r=i[s];if(this.activeOperator){if(s!==this.parsedOperator)return this.validationError||(this.validationError={message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:e-t.length+1,endPosition:e}),!1}else this.parsedOperator=s;return t!==r&&(Yf(this.params,t,r,e),this.operators[this.activeOperator]=r),!0}return null!==s&&(this.validationError||(this.validationError={message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:e-t.length+1,endPosition:e}),!0)}},oy=class e{constructor(e,t){this.params=e,this.startPosition=t,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new ny(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let t=this.startPosition;const{expression:i}=this.params;for(;t<i.length;){const s=i[t];if("("!==s||this.expectingOperator){if(")"===s)return this.endPosition=t-1,0===this.startPosition&&(this.extraEndBracket=!0),t;if(" "===s);else if(this.expectingExpression){const e=new Qf(this.params,t);t=e.parseExpression(),this.expressionParsers.push(e),this.expectingExpression=!1,this.expectingOperator=!0}else this.expectingOperator&&(t=this.operatorParser.parseExpression(t),this.expectingOperator=!1,this.expectingExpression=!0)}else{const i=new e(this.params,t+1);t=i.parseExpression(),this.expressionParsers.push(i),this.expectingExpression=!1,this.expectingOperator=!0}t++}return this.startPosition>0&&(this.missingEndBracket=!0),t}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(e=>e.isValid())}getValidationError(){const e=this.operatorParser.getValidationError();for(let t=0;t<this.expressionParsers.length;t++){const i=this.expressionParsers[t].getValidationError();if(i)return e&&e.startPosition<i.startPosition?e:i}if(e)return e;if(this.extraEndBracket)return{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationExtraEndBracket"),startPosition:this.endPosition+1,endPosition:this.endPosition+1};let t;return this.expressionParsers.length===this.operatorParser.getNumOperators()?t="advancedFilterValidationMissingCondition":this.missingEndBracket&&(t="advancedFilterValidationMissingEndBracket"),t?{message:this.params.advancedFilterExpressionService.translate(t),startPosition:this.params.expression.length,endPosition:this.params.expression.length}:null}getFunctionString(e){const t=this.expressionParsers.length>1,i=this.expressionParsers.map(t=>t.getFunctionString(e)).join(` ${this.operatorParser.getFunction()} `);return t?`(${i})`:i}getFunctionParsed(e){const t=this.operatorParser.getFunction(),i=this.expressionParsers.map(t=>t.getFunctionParsed(e)),s="&&"===t?"every":"some";return(e,t,r)=>i[s](i=>i(e,t,r))}getAutocompleteListParams(e){if(null!=this.endPosition&&e>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();const t=this.getExpressionParserIndex(e);if(null==t)return"("===this.params.expression[e]?{enabled:!1}:this.getColumnAutocompleteListParams();const i=this.expressionParsers[t].getAutocompleteListParams(e);if(!i){if(t<this.expressionParsers.length-1)return this.operatorParser.getAutocompleteListParams(e,t);if(this.expressionParsers.length===this.operatorParser.getNumOperators()){const t=this.operatorParser.getLastOperatorEndPosition();return null==t||e<=t+1?this.operatorParser.getAutocompleteListParams(e,this.operatorParser.getNumOperators()-1):this.getColumnAutocompleteListParams()}return")"===this.params.expression[e-1]?{enabled:!1}:this.operatorParser.getAutocompleteListParams(e)}return i}updateExpression(e,t,i){var s;const r=this.params.expression,n=this.getExpressionParserIndex(e);if(null==n){const e="column"===i?this.params.advancedFilterExpressionService.getColumnValue(t):null!=(s=t.displayValue)?s:t.key;return Kf(r,this.startPosition,this.startPosition,e,!0)}const o=this.expressionParsers[n].updateExpression(e,t,i);return null==o?"column"===i?Kf(r,e,r.length-1,this.params.advancedFilterExpressionService.getColumnValue(t),!0):null!=this.endPosition&&e>this.endPosition+1?null:this.operatorParser.updateExpression(e,t,n):o}getModel(){return this.expressionParsers.length>1?{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map(e=>e.getModel())}:this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(e){let t;for(let i=0;i<this.expressionParsers.length&&!(this.expressionParsers[i].startPosition>e);i++)t=i;return t}},ay=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new oy(this.params,0);const e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){const e=this.joinExpressionParser.getValidationError();if(!e)return null;const{message:t,startPosition:i,endPosition:s}=e;return i<this.params.expression.length?this.params.advancedFilterExpressionService.translate("advancedFilterValidationMessage",[t,this.params.expression.slice(i,s+1).trim()]):this.params.advancedFilterExpressionService.translate("advancedFilterValidationMessageAtEnd",[t])}getFunctionString(){const e=this.createFunctionParams();return{functionString:`return ${this.joinExpressionParser.getFunctionString(e)};`,params:e}}getFunctionParsed(){const e=this.createFunctionParams();return{expressionFunction:this.joinExpressionParser.getFunctionParsed(e),params:e}}getAutocompleteListParams(e){var t;return null!=(t=this.joinExpressionParser.getAutocompleteListParams(e))?t:{enabled:!1}}updateExpression(e,t,i){return this.joinExpressionParser.updateExpression(e,t,i)}getModel(){return this.isValid()?this.joinExpressionParser.getModel():null}createFunctionParams(){return{operands:[],operators:[],evaluatorParams:[]}}},ly=class extends r.XQb{constructor(){super(...arguments),this.appliedExpression=null,this.expression=null,this.isValid=!0}postConstruct(){this.setEnabled(this.gos.get("enableAdvancedFilter"),!0),this.ctrl=this.createManagedBean(new Uf(this.enabled)),this.expressionProxy={getValue:(e,t)=>{const i=this.columnModel.getPrimaryColumn(e);return i?this.valueService.getValue(i,t,!0):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",e=>this.setEnabled(!!e.currentValue)),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,e=>this.onNewColumnsLoaded(e)),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>this.updateValidity())}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){var e;const t=this.createExpressionParser(this.appliedExpression);return null==t||t.parseExpression(),null!=(e=null==t?void 0:t.getModel())?e:null}setModel(e){const t=(e,i)=>{if("join"===e.filterType){const s=this.advancedFilterExpressionService.parseJoinOperator(e),n=e.conditions.map(e=>t(e)).filter(e=>r._.exists(e)).join(` ${s} `);return i||e.conditions.length<=1?n:`(${n})`}return this.advancedFilterExpressionService.parseColumnFilterModel(e)},i=e?t(e,!0):null;this.setExpressionDisplayValue(i),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(e){this.expression=e}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(e){return e?new ay({expression:e,columnModel:this.columnModel,dataTypeService:this.dataTypeService,valueService:this.valueService,advancedFilterExpressionService:this.advancedFilterExpressionService}):null}getDefaultExpression(e){const t=this.advancedFilterExpressionService.getColumnValue(e)+" ";return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(e,t){const i=this.enabled,s=this.rowModel.getType(),n="clientSide"===s||"serverSide"===s;if(e&&!s&&r._.warnOnce("Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model."),this.enabled=e&&n,!t&&this.enabled!==i){const e={type:r.sVA.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,enabled:this.enabled};this.eventService.dispatchEvent(e)}}applyExpression(){const e=this.createExpressionParser(this.expression);null==e||e.parseExpression(),this.applyExpressionFromParser(e)}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid)return this.expressionFunction=null,this.expressionParams=null,void(this.appliedExpression=null);const{expressionFunction:t,params:i}=this.getFunction(e);this.expressionFunction=t,this.expressionParams=i,this.appliedExpression=this.expression}getFunction(e){if(this.gos.get("suppressAdvancedFilterEval"))return e.getFunctionParsed();{const{functionString:t,params:i}=e.getFunctionString();return{expressionFunction:new Function("expressionProxy","node","params",t),params:i}}}updateValidity(){this.advancedFilterExpressionService.resetColumnCaches();const e=this.createExpressionParser(this.expression);null==e||e.parseExpression();const t=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),t}onNewColumnsLoaded(e){if("gridInitializing"!==e.source||!this.dataTypeService.isPendingInference())return;this.ctrl.setInputDisabled(!0);const t=this.addManagedListener(this.eventService,r.sVA.EVENT_DATA_TYPES_INFERRED,()=>{null==t||t(),this.ctrl.setInputDisabled(!1)})}};Af([(0,r.dsm)("valueService")],ly.prototype,"valueService",2),Af([(0,r.dsm)("columnModel")],ly.prototype,"columnModel",2),Af([(0,r.dsm)("dataTypeService")],ly.prototype,"dataTypeService",2),Af([(0,r.dsm)("rowModel")],ly.prototype,"rowModel",2),Af([(0,r.dsm)("advancedFilterExpressionService")],ly.prototype,"advancedFilterExpressionService",2),Af([r.o7C],ly.prototype,"postConstruct",1),ly=Af([(0,r.dR4)("advancedFilterService")],ly);var cy={version:"31.3.4",moduleName:r.zsj.AdvancedFilterModule,beans:[ly,ry],agStackComponents:[{componentName:"agAdvancedFilter",componentClass:zf}],dependantModules:[mf]},hy={};sf(hy,{GridChartsModule:()=>Aw,__FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT:()=>Tw,agCharts:()=>Dw});var dy=Object.defineProperty,uy=Object.defineProperties,py=Object.getOwnPropertyDescriptor,gy=Object.getOwnPropertyDescriptors,my=Object.getOwnPropertySymbols,fy=Object.prototype.hasOwnProperty,yy=Object.prototype.propertyIsEnumerable,vy=(e,t,i)=>t in e?dy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Cy=(e,t)=>{for(var i in t||(t={}))fy.call(t,i)&&vy(e,i,t[i]);if(my)for(var i of my(t))yy.call(t,i)&&vy(e,i,t[i]);return e},by=(e,t)=>uy(e,gy(t)),Sy=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?py(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&dy(t,i,n),n},wy=class extends r.XQb{constructor(){super(...arguments),this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}init(){this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new r.MSA({scrollContainer:t.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),getHorizontalPosition:()=>t.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:e=>t.getScrollFeature().setHorizontalScrollPosition(e),shouldSkipVerticalScroll:()=>!this.gos.isDomLayout("normal"),shouldSkipHorizontalScroll:()=>!t.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach(t=>{const i=t.columns;t.columns=t.columns.filter(t=>t.isVisible()&&-1!==e.indexOf(t)),!r._.areEqual(i,t.columns)&&this.dispatchChangedEvent(!1,!0,t.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(e=>e.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=r._.last(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const i=this.columnModel.getAllDisplayedColumns(),s=t.map(e=>i.indexOf(e)).sort((e,t)=>e-t);return r._.last(s)-s[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!this.gos.get("enableRangeSelection"))return;const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;(this.gos.get("suppressMultiRangeSelection")||!t||r._.missing(this.cellRanges))&&this.removeAllCellRanges(!0);const s={rowIndex:e.rowIndex,rowPinned:e.rowPinned},n={startRow:s,endRow:s,columns:i,startColumn:e.column};this.cellRanges.push(n),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=r._.last(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,i=!1){const s=t.column,r=this.calculateColumnsBetween(e.startColumn,s);r&&!this.isLastCellOfRange(e,t)&&(e.columns=r,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},i||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:i}=e,s=(t,i)=>{const s=e.columns.filter(e=>e!==t);t?(e.startColumn=t,e.columns=i?[t,...s]:[...s,t]):e.columns=s},{left:n,right:o}=this.getRangeEdgeColumns(e);t!==i[0]||t===n?t===r._.last(i)&&t===o&&s(o,!1):s(n,!0)}getRangeEdgeColumns(e){const t=this.columnModel.getAllDisplayedColumns(),i=e.columns.map(e=>t.indexOf(e)).filter(e=>e>-1).sort((e,t)=>e-t);return{left:t[i[0]],right:t[r._.last(i)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,i=e.ctrlKey||e.metaKey,s=r._.last(this.cellRanges),n=this.newestRangeStartCell,o=s.columns[0],a=r._.last(s.columns),l=s.endRow.rowIndex,c=s.endRow.rowPinned,h={column:n.column===o?a:o,rowIndex:l,rowPinned:c},d=this.cellNavigationService.getNextCellToFocus(t,h,i);return d?(this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:n.column,columnEnd:d.column}),d):void 0}setCellRange(e){this.gos.get("enableRangeSelection")&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){r._.shallowCompare(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(e=>{e.columns&&e.startRow&&this.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.columns[0]}),this.cellRanges.push(e)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:i="rangeService",dispatchWrapperEvents:s,wrapperEventSource:n="deleteKey"}=e;if(s){const e={type:r.sVA.EVENT_RANGE_DELETE_START,source:n};this.eventService.dispatchEvent(e)}if(t||(t=this.cellRanges),t.forEach(e=>{this.forEachRowInRange(e,t=>{var s;const r=this.rowPositionUtils.getRowNode(t);if(r)for(let t=0;t<e.columns.length;t++){const n=this.columnModel.getGridColumn(e.columns[t]);if(!n||!n.isCellEditable(r))continue;const o=null!=(s=this.valueService.parseValue(n,r,"",r.getValueFromValueService(n)))?s:null;r.setDataValue(n,o,i)}})}),s){const e={type:r.sVA.EVENT_RANGE_DELETE_END,source:n};this.eventService.dispatchEvent(e)}}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let i,s=!1;if(e.columns)i=e.columns.map(e=>this.columnModel.getColumnWithValidation(e)).filter(e=>e);else{const t=this.columnModel.getColumnWithValidation(e.columnStart),r=this.columnModel.getColumnWithValidation(e.columnEnd);if(!t||!r)return;i=this.calculateColumnsBetween(t,r),i&&i.length&&(s=i[0]!==t)}if(i&&(t||0!==i.length))return{startRow:null!=e.rowStartIndex?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,endRow:null!=e.rowEndIndex?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0,columns:i,startColumn:s?r._.last(i):i[0]}}addCellRange(e){if(!this.gos.get("enableRangeSelection"))return;const t=this.createCellRangeFromCellRangeParams(e);t&&(t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.startColumn}),this.cellRanges.push(t),this.dispatchChangedEvent(!1,!0,t.id))}getCellRanges(){return this.cellRanges}isEmpty(){return 0===this.cellRanges.length}isMoreThanOneCell(){const e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;const t=this.cellRanges[0],i=this.getRangeStartRow(t),s=this.getRangeEndRow(t);return i.rowPinned!==s.rowPinned||i.rowIndex!==s.rowIndex||1!==t.columns.length}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;let t;this.cellRanges.forEach(t=>{this.forEachRowInRange(t,i=>{const s=`${i.rowPinned||"normal"}_${i.rowIndex}`,r=e.get(s),n=t.columns.map(e=>e.getId());if(r){const e=n.filter(e=>-1===r.indexOf(e));r.push(...e)}else e.set(s,n)})});for(const i of e.values()){const e=i.sort().join();if(void 0!==t){if(t!==e)return!1}else t=e}return!0}forEachRowInRange(e,t){const i=this.getRangeStartRow(e),s=this.getRangeEndRow(e);let r=i;for(;r&&(t(r),!this.rowPositionUtils.sameRow(r,s));)r=this.cellNavigationService.getRowBelow(r)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const i=null!==t.columns&&r._.includes(t.columns,e.column),s=this.isRowInRange(e.rowIndex,e.rowPinned,t);return i&&s}isLastCellOfRange(e,t){const{startRow:i,endRow:s}=e,n=this.rowPositionUtils.before(i,s)?s:i,o=t.rowIndex===n.rowIndex&&t.rowPinned===n.rowPinned,a=e.columns[0],l=r._.last(e.columns),c=e.startColumn===a?l:a;return t.column===c&&o}isBottomRightCell(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=e.columns.map(e=>i.indexOf(e)).sort((e,t)=>e-t),{startRow:n,endRow:o}=e,a=this.rowPositionUtils.before(n,o)?o:n,l=i.indexOf(t.column)===r._.last(s),c=t.rowIndex===a.rowIndex&&r._.makeNull(t.rowPinned)===r._.makeNull(a.rowPinned);return l&&c}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,i){const s=this.getRangeStartRow(i),r=this.getRangeEndRow(i),n={rowIndex:e,rowPinned:t||null},o=n.rowIndex===s.rowIndex&&n.rowPinned==s.rowPinned,a=n.rowIndex===r.rowIndex&&n.rowPinned==r.rowPinned;if(o||a)return!0;const l=!this.rowPositionUtils.before(n,s),c=this.rowPositionUtils.before(n,r);return l&&c}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!this.gos.get("enableRangeSelection"))return;const{ctrlKey:t,metaKey:i,shiftKey:s}=e,n=t||i,o=!this.gos.get("suppressMultiRangeSelection")&&n,a=s&&r._.existsAndNotEmpty(this.cellRanges);o||a&&!r._.exists(r._.last(this.cellRanges).type)||this.removeAllCellRanges(!0);const l=this.dragService.getStartTarget();if(l&&this.updateValuesOnMove(l),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=o&&this.getCellRangeCount(this.lastCellHovered)>1,a||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=r._.last(this.cellRanges);else{const e={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:e,endRow:e,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging)return;if(this.gos.get("suppressMultiRangeSelection"))return;if(this.isEmpty())return;const t=this.rowPositionUtils,i=r._.last(this.cellRanges),s=this.getRangeStartRow(i),n=this.getRangeEndRow(i),o=[];this.cellRanges.slice(0,-1).forEach(e=>{const a=this.getRangeStartRow(e),l=this.getRangeEndRow(e),c=e.columns,h=c.filter(e=>-1===i.columns.indexOf(e));if(h.length===c.length)return void o.push(e);if(t.before(n,a)||t.before(l,s))return void o.push(e);const d=o.length;if(t.before(a,s)){const e={columns:[...c],startColumn:i.startColumn,startRow:Cy({},a),endRow:this.cellNavigationService.getRowAbove(s)};o.push(e)}if(h.length>0){const e={columns:h,startColumn:r._.includes(h,i.startColumn)?i.startColumn:h[0],startRow:this.rowMax([Cy({},s),Cy({},a)]),endRow:this.rowMin([Cy({},n),Cy({},l)])};o.push(e)}t.before(n,l)&&o.push({columns:[...c],startColumn:i.startColumn,startRow:this.cellNavigationService.getRowBelow(n),endRow:Cy({},l)}),o.length-d===1&&(o[o.length-1].id=e.id)}),this.cellRanges=o,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(e=>{(void 0===t||this.rowPositionUtils.before(t,e))&&(t=e)}),t}rowMin(e){let t;return e.forEach(e=>{(void 0===t||this.rowPositionUtils.before(e,t))&&(t=e)}),t}updateValuesOnMove(e){const t=r._.getCtrlForEventTarget(this.gos,e,r.wX9.DOM_DATA_KEY_CELL_CTRL),i=null==t?void 0:t.getCellPosition();this.cellHasChanged=!1,!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i)}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,i=e=>t&&t.rowPinned===e&&this.newestRangeStartCell.rowPinned===e,s=i("top")||i("bottom");if(this.autoScrollService.check(e,s),!this.cellHasChanged)return;const r=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);r&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=r,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,i){const s={type:r.sVA.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:t,id:i};this.eventService.dispatchEvent(s)}calculateColumnsBetween(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=e===t,r=i.indexOf(e);if(r<0)return void console.warn(`AG Grid: column ${e.getId()} is not visible`);const n=s?r:i.indexOf(t);if(n<0)return void console.warn(`AG Grid: column ${t.getId()} is not visible`);if(s)return[e];const o=Math.min(r,n),a=o===r?n:r,l=[];for(let e=o;e<=a;e++)l.push(i[e]);return l}};Sy([(0,r.dsm)("rowModel")],wy.prototype,"rowModel",2),Sy([(0,r.dsm)("dragService")],wy.prototype,"dragService",2),Sy([(0,r.dsm)("columnModel")],wy.prototype,"columnModel",2),Sy([(0,r.dsm)("cellNavigationService")],wy.prototype,"cellNavigationService",2),Sy([(0,r.dsm)("pinnedRowModel")],wy.prototype,"pinnedRowModel",2),Sy([(0,r.dsm)("rowPositionUtils")],wy.prototype,"rowPositionUtils",2),Sy([(0,r.dsm)("cellPositionUtils")],wy.prototype,"cellPositionUtils",2),Sy([(0,r.dsm)("ctrlsService")],wy.prototype,"ctrlsService",2),Sy([(0,r.dsm)("valueService")],wy.prototype,"valueService",2),Sy([r.o7C],wy.prototype,"init",1),wy=Sy([(0,r.dR4)("rangeService")],wy);var xy=class extends r.uAl{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}init(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){this.cellHoverListener=this.addManagedListener(this.ctrlsService.get("gridCtrl").getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===r.LIk.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),i=this.getGui(),s=r._.last(this.rangeService.getCellRanges()),n=s.startRow,o=s.endRow;if(n&&o&&(this.rowPositionUtils.before(o,n)?(this.setRangeStartRow(o),this.setRangeEndRow(n)):(this.setRangeStartRow(n),this.setRangeEndRow(o))),t!==e||!r._.isVisible(i)){this.setCellCtrl(e);const t=e.getComp().getParentOfValue();t&&t.appendChild(i)}this.setCellRange(s)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return r._.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function Ey(e){const t=e.length;let i=0;if(t<=1)return e;for(let t=0;t<e.length;t++){const s=e[t],r=s.toString().split("e-");r.length>1?i=Math.max(i,parseInt(r[1],10)):Math.floor(s)!==s&&(i=Math.max(i,s.toString().split(".")[1].length))}let s=0,r=0,n=0,o=0,a=0;for(let i=0;i<t;i++)a=e[i],s+=i,r+=a,o+=i*i,n+=i*a;const l=(t*n-s*r)/(t*o-s*s),c=r/t-l*s/t,h=[];for(let e=0;e<=t;e++)h.push(parseFloat((e*l+c).toFixed(i)));return h}Sy([(0,r.dsm)("rowRenderer")],xy.prototype,"rowRenderer",2),Sy([(0,r.dsm)("dragService")],xy.prototype,"dragService",2),Sy([(0,r.dsm)("rangeService")],xy.prototype,"rangeService",2),Sy([(0,r.dsm)("mouseEventService")],xy.prototype,"mouseEventService",2),Sy([(0,r.dsm)("columnModel")],xy.prototype,"columnModel",2),Sy([(0,r.dsm)("cellNavigationService")],xy.prototype,"cellNavigationService",2),Sy([(0,r.dsm)("navigationService")],xy.prototype,"navigationService",2),Sy([(0,r.dsm)("rowPositionUtils")],xy.prototype,"rowPositionUtils",2),Sy([(0,r.dsm)("cellPositionUtils")],xy.prototype,"cellPositionUtils",2),Sy([(0,r.dsm)("ctrlsService")],xy.prototype,"ctrlsService",2),Sy([r.o7C],xy.prototype,"init",1);var My=class e extends xy{constructor(){super(e.TEMPLATE),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=r.LIk.FILL}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:i}=this.initialXY,{x:s,y:r}=this.mouseEventService.getNormalisedPosition(e),n=Math.abs(t-s),o=Math.abs(i-r),a=this.getFillHandleDirection();let l;l="xy"===a?n>o?"x":"y":a,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const e=this.getCellCtrl();if(!e)return;this.initialPosition=e.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t="x"===this.dragAxis,i=this.getCellRange(),s=i.columns.length,r=this.getRangeStartRow(),n=this.getRangeEndRow();let o;if(this.isUp||this.isLeft){const e=t?r:this.lastCellMarked;o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:e.rowIndex,rowStartPinned:e.rowPinned,columnStart:t?this.lastCellMarked.column:i.columns[0],rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnEnd:i.columns[s-1]})}else o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,columnStart:i.columns[0],rowEndIndex:t?n.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?n.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:i.columns[s-1]});o&&(this.raiseFillStartEvent(),this.handleValueChanged(i,o,e),this.rangeService.setCellRanges([o]),this.raiseFillEndEvent(i,o))}getFillHandleDirection(){const e=this.gos.get("fillHandleDirection");return e?"x"!==e&&"y"!==e&&"xy"!==e?(r._.warnOnce("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}raiseFillStartEvent(){const e={type:r.sVA.EVENT_FILL_START};this.eventService.dispatchEvent(e)}raiseFillEndEvent(e,t){const i={type:r.sVA.EVENT_FILL_END,initialRange:e,finalRange:t};this.eventService.dispatchEvent(i)}handleValueChanged(e,t,i){const s=this.rangeService.getRangeEndRow(e),n=this.rangeService.getRangeStartRow(e),o=this.rangeService.getRangeEndRow(t),a=this.rangeService.getRangeStartRow(t),l="y"===this.dragAxis;if(this.isReduce&&!this.gos.get("suppressClearOnFillReduction")){const i=l?e.columns:e.columns.filter(e=>t.columns.indexOf(e)<0),r=l?this.cellNavigationService.getRowBelow(o):a;return void(r&&this.clearCellsInRange(r,s,i))}const c=[],h=[],d=[],u=[];let p=!0,g=0;const m=()=>{c.length=0,h.length=0,d.length=0,u.length=0,g=0},f=(t,i)=>{let h=this.isUp?s:n,d=!1;for(l&&(p=!0,m());!d&&h;){const u=this.rowPositionUtils.getRowNode(h);if(!u)break;l&&t?y(c,t,u,()=>!this.rowPositionUtils.sameRow(h,this.isUp?n:s)):i&&(p=!0,m(),i.forEach(t=>y(c,t,u,()=>t!==(this.isLeft?e.columns[0]:r._.last(e.columns))))),d=this.rowPositionUtils.sameRow(h,this.isUp?a:o),h=this.isUp?this.cellNavigationService.getRowAbove(h):this.cellNavigationService.getRowBelow(h)}},y=(e,t,s,n)=>{var o,a;let l,c=!1;if(p)l=this.valueService.getValue(t,s),h.push(l),d.push(this.valueService.getValue(t,s,void 0,!0)),u.push(this.valueService.formatValue(t,s,l)),p=n();else{const{value:n,fromUserFunction:p,sourceCol:m,sourceRowNode:f}=this.processValues({event:i,values:e,initialValues:h,initialNonAggregatedValues:d,initialFormattedValues:u,col:t,rowNode:s,idx:g++});if(l=n,t.isCellEditable(s)){const e=this.valueService.getValue(t,s);p||(m&&!1!==(null==(o=m.getColDef())?void 0:o.useValueFormatterForExport)&&(l=null!=(a=this.valueService.formatValue(m,f,l))?a:l),!1!==t.getColDef().useValueParserForImport&&(l=this.valueService.parseValue(t,s,m?l:r._.toStringOrNull(l),e))),p&&e===l?c=!0:s.setDataValue(t,l,"rangeService")}}c||e.push({value:l,column:t,rowNode:s})};if(l)e.columns.forEach(e=>{f(e)});else{const e=this.isLeft?[...t.columns].reverse():t.columns;f(void 0,e)}}clearCellsInRange(e,t,i){const s={startRow:e,endRow:t,columns:i,startColumn:i[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[s]})}processValues(e){const{event:t,values:i,initialValues:s,initialNonAggregatedValues:n,initialFormattedValues:o,col:a,rowNode:l,idx:c}=e,h=this.gos.getCallback("fillOperation");let d;if(d="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",h){const e=h({event:t,values:i.map(({value:e})=>e),initialValues:s,initialNonAggregatedValues:n,initialFormattedValues:o,currentIndex:c,currentCellValue:this.valueService.getValue(a,l),direction:d,column:a,rowNode:l});if(!1!==e)return{value:e,fromUserFunction:!0}}const u=!i.some(({value:e})=>{const t=parseFloat(e);return isNaN(t)||t.toString()!==e.toString()});if(t.altKey||!u){if(u&&1===s.length){const e=this.isUp||this.isLeft?-1:1;return{value:parseFloat(r._.last(i).value)+1*e,fromUserFunction:!1}}const{value:e,column:t,rowNode:n}=i[c%i.length];return{value:e,fromUserFunction:!1,sourceCol:t,sourceRowNode:n}}return{value:r._.last(Ey(i.map(({value:e})=>Number(e)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(t,e))return;const i=this.rowPositionUtils.before(t,e),s=this.getRangeStartRow(),r=this.getRangeEndRow();i&&(t.rowPinned==s.rowPinned&&t.rowIndex>=s.rowIndex||s.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,i),this.isReduce=!1)}else{const i=e.column,s=t.column;if(i===s)return;const r=this.columnModel.getAllDisplayedColumns(),n=r.indexOf(i),o=r.indexOf(s);o<=n&&o>=r.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,o<n),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,i){const{navigationService:s,rangeService:r}=this;let n=e;do{const o=this.getCellRange(),a=o.columns.length;for(let l=0;l<a;l++){const c=o.columns[l],h={rowIndex:n.rowIndex,rowPinned:n.rowPinned},d=by(Cy({},h),{column:c}),u=r.isCellInSpecificRange(d,o),p=this.rowPositionUtils.sameRow(n,e);if(i&&(this.isUp=!0),!p){const e=s.getCellByPosition(d);if(e){this.markedCells.push(e);const s=e.getComp();u||(s.addOrRemoveCssClass("ag-selection-fill-left",0===l),s.addOrRemoveCssClass("ag-selection-fill-right",l===a-1)),s.addOrRemoveCssClass(i?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,t))}}}if(this.rowPositionUtils.sameRow(n,t))break}while(n=i?this.cellNavigationService.getRowAbove(n):this.cellNavigationService.getRowBelow(n))}reduceVertical(e,t){let i=e;do{const e=this.getCellRange(),s=e.columns.length,r=this.rowPositionUtils.sameRow(i,t);for(let r=0;r<s;r++){const s={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n=by(Cy({},s),{column:e.columns[r]}),o=this.navigationService.getCellByPosition(n);o&&(this.markedCells.push(o),o.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(i,t)))}if(r)break}while(i=this.cellNavigationService.getRowAbove(i))}extendHorizontal(e,t,i){const s=this.columnModel.getAllDisplayedColumns(),n=s.indexOf(i?t.column:e.column),o=s.indexOf(i?this.getCellRange().columns[0]:t.column),a=i?0:1,l=s.slice(n+a,o+a),c=this.getRangeStartRow(),h=this.getRangeEndRow();l.forEach(e=>{let t=c,s=!1;do{s=this.rowPositionUtils.sameRow(t,h);const n=this.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(n){this.markedCells.push(n);const s=n.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(t,c)),s.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(t,h)),i?(this.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",e===l[0])):s.addOrRemoveCssClass("ag-selection-fill-right",e===r._.last(l))}t=this.cellNavigationService.getRowBelow(t)}while(!s)})}reduceHorizontal(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i.indexOf(t.column),r=i.indexOf(e.column),n=i.slice(s,r),o=this.getRangeStartRow(),a=this.getRangeEndRow();n.forEach(e=>{let t=o,i=!1;do{i=this.rowPositionUtils.sameRow(t,a);const s=this.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});s&&(this.markedCells.push(s),s.getComp().addOrRemoveCssClass("ag-selection-fill-right",e===n[0])),t=this.cellNavigationService.getRowBelow(t)}while(!i)})}refresh(e){const t=this.rangeService.getCellRanges()[0];t.startRow&&t.endRow?super.refresh(e):this.destroy()}};My.TEMPLATE='<div class="ag-fill-handle"></div>',Sy([(0,r.dsm)("valueService")],My.prototype,"valueService",2);var Ay=My,Ty=class e extends xy{constructor(){super(e.TEMPLATE),this.type=r.LIk.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const i=this.rangeService.getCellRanges(),s=r._.last(i);this.rangeFixed||(this.fixRangeStartEnd(s),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},2===i.length&&i[0].type===r.OnL.DIMENSION&&s.type===r.OnL.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(s))&&this.rangeService.updateRangeEnd(i[0],by(Cy({},this.endPosition),{column:i[0].columns[0]}),!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=r._.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),i=this.rangeService.getRangeEndRow(e),s=e.columns[0];e.startRow=t,e.endRow=i,e.startColumn=s}};Ty.TEMPLATE='<div class="ag-range-handle"></div>';var Dy=Ty,Iy=class extends r.XQb{createSelectionHandle(e){return this.createBean(e===r.LIk.RANGE?new Dy:new Ay)}};Iy=Sy([(0,r.dR4)("selectionHandleFactory")],Iy);var Ry={version:"31.3.4",moduleName:r.zsj.RangeSelectionModule,beans:[wy,Iy],agStackComponents:[{componentName:"AgFillHandle",componentClass:Ay},{componentName:"AgRangeHandle",componentClass:Dy}],dependantModules:[mf]};nf(hy,s);var Py=Object.defineProperty,ky=Object.defineProperties,Ly=Object.getOwnPropertyDescriptor,Ny=Object.getOwnPropertyDescriptors,_y=Object.getOwnPropertySymbols,Oy=Object.prototype.hasOwnProperty,Fy=Object.prototype.propertyIsEnumerable,Gy=(e,t,i)=>t in e?Py(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,By=(e,t)=>{for(var i in t||(t={}))Oy.call(t,i)&&Gy(e,i,t[i]);if(_y)for(var i of _y(t))Fy.call(t,i)&&Gy(e,i,t[i]);return e},Vy=(e,t)=>ky(e,Ny(t)),Hy=(e,t)=>{var i={};for(var s in e)Oy.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&_y)for(var s of _y(e))t.indexOf(s)<0&&Fy.call(e,s)&&(i[s]=e[s]);return i},Uy=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Ly(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Py(t,i,n),n},zy=class e extends r.XQb{getData(e){if(e.crossFiltering){if(e.grouping)return console.warn("AG Grid: crossing filtering with row grouping is not supported."),{chartData:[],columnNames:{}};if(!this.gos.isRowModelType("clientSide"))return console.warn("AG Grid: crossing filtering is only supported in the client side row model."),{chartData:[],columnNames:{}}}this.gos.isRowModelType("serverSide")&&e.pivoting&&this.updatePivotKeysForSSRM();const t=this.extractRowsFromGridRowModel(e);return t.chartData=this.aggregateRowsByDimension(e,t.chartData),t}extractRowsFromGridRowModel(t){const{crossFiltering:i,startRow:s,endRow:n,valueCols:o,dimensionCols:a,grouping:l}=t;let c=[];const h={},d={},u={};let p,g={},m=[];if(i)g=this.getFilteredRowNodes(),m=this.getAllRowNodes(),p=m.length;else{const e=this.gridRowModel.getRowCount()-1;p=s===n&&0===s&&0===a.length&&0===o.length?0:(n>=0?Math.min(n,e):e)-s+1}p>0&&o.forEach(e=>{let t=[];const i=e.getColDef().pivotKeys;i&&(t=i.slice());const s=e.getColDef().headerName;s&&t.push(s),t.length>0&&(h[e.getId()]=t)});let f,y=0;for(let r=0;r<p;r++){const n=i?m[r]:this.gridRowModel.getRow(r+s);if(n.footer){y++;continue}const h={};a.forEach(t=>{const i=t.colId,s=this.columnModel.getGridColumn(i);if(s){const t=this.valueService.getValue(s,n);if(l){const s=t&&t.toString?String(t.toString()):"",o=e.getGroupLabels(n,s);h[i]={labels:o,toString:function(){return this.labels.filter(e=>!!e).reverse().join(" - ")}},n.group&&(d[o.toString()]=r-y);const a=o.slice(1,o.length).toString();a&&(u[a]=d[a])}else h[i]=t}else h[hv.DEFAULT_CATEGORY]=r+1}),o.forEach(e=>{const s=e.getColId();if(i){const i=s+"-filtered-out",r=this.valueService.getValue(e,n),o=null!=r&&"function"==typeof r.toNumber?r.toNumber():r;g[n.id]?(h[s]=o,h[i]=t.aggFunc||t.isScatter?void 0:0):(h[s]=t.aggFunc||t.isScatter?void 0:0,h[i]=o)}else{let t=this.valueService.getValue(e,n);t&&t.hasOwnProperty("toString")&&(t=parseFloat(t.toString())),h[s]=null!=t&&"function"==typeof t.toNumber?t.toNumber():t}}),c.push(h)}if(l){const e=r._.values(u),t=c;c=[],f=[];for(let i=0;i<t.length;i++)(r._.includes(e,i)?f:c).push(t[i])}return{chartData:c,columnNames:h,groupChartData:f}}aggregateRowsByDimension(e,t){const i=e.dimensionCols;if(!e.aggFunc||0===i.length)return t;const s=r._.last(i),n=s&&s.colId,o={},a=[];if(t.forEach(e=>{let t=o;i.forEach(s=>{const r=s.colId,o=e[r];if(r===n){let s=t[o];s||(s={__children:[]},i.forEach(t=>{const i=t.colId;s[i]=e[i]}),t[o]=s,a.push(s)),s.__children.push(e)}else t[o]||(t[o]={}),t=t[o]})}),r.syG.__assertRegistered(r.zsj.RowGroupingModule,"Charting Aggregation",this.context.getGridId())){const t=this.aggregationStage;a.forEach(i=>e.valueCols.forEach(s=>{if(e.crossFiltering)e.valueCols.forEach(s=>{const r=s.getColId(),n=i.__children.filter(e=>void 0!==e[r]).map(e=>e[r]);let o=t.aggregateValues(n,e.aggFunc);i[s.getId()]=o&&void 0!==o.value?o.value:o;const a=`${r}-filtered-out`,l=i.__children.filter(e=>void 0!==e[a]).map(e=>e[a]);let c=t.aggregateValues(l,e.aggFunc);i[a]=c&&void 0!==c.value?c.value:c});else{const r=i.__children.map(e=>e[s.getId()]);let n=t.aggregateValues(r,e.aggFunc);i[s.getId()]=n&&void 0!==n.value?n.value:n}}))}return a}updatePivotKeysForSSRM(){const e=this.columnModel.getSecondaryColumns();if(!e)return;const t=this.extractPivotKeySeparator(e);e.forEach(e=>{if(""===t)e.getColDef().pivotKeys=[];else{const i=e.getColId().split(t);e.getColDef().pivotKeys=i.slice(0,i.length-1)}})}extractPivotKeySeparator(e){if(0===e.length)return"";const t=(e,i)=>{const s=e.getGroupId();return e.getParent()?t(e.getParent(),s):i.split(s)[1][0]},i=e[0];return null==i.getParent()?"":t(i.getParent(),i.getColId())}static getGroupLabels(e,t){const i=[t];for(;e&&0!==e.level;)(e=e.parent)&&i.push(e.key);return i}getFilteredRowNodes(){const e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(){let e=[];return this.gridRowModel.forEachNode(t=>{e.push(t)}),this.sortRowNodes(e)}sortRowNodes(e){const t=this.sortController.getSortOptions();return t&&0!=t.length?this.rowNodeSorter.doFullSort(e,t):e}};Uy([(0,r.dsm)("rowModel")],zy.prototype,"gridRowModel",2),Uy([(0,r.dsm)("valueService")],zy.prototype,"valueService",2),Uy([(0,r.dsm)("columnModel")],zy.prototype,"columnModel",2),Uy([(0,r.dsm)("rowNodeSorter")],zy.prototype,"rowNodeSorter",2),Uy([(0,r.dsm)("sortController")],zy.prototype,"sortController",2),Uy([(0,r.Xx1)("aggregationStage")],zy.prototype,"aggregationStage",2);var Wy=zy,jy=class extends r.XQb{constructor(){super(...arguments),this.valueColsWithoutSeriesType=new Set}postConstruct(){const e=()=>this.valueColsWithoutSeriesType.clear();this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,e),this.addManagedListener(this.eventService,r.sVA.EVENT_ROW_DATA_UPDATED,e)}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getColDisplayName(e){return this.columnModel.getDisplayNameForColumn(e,"chart")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}getGroupDisplayColumns(){return this.columnModel.getGroupDisplayColumns()}isPivotMode(){return this.columnModel.isPivotMode()}isPivotActive(){return this.columnModel.isPivotActive()}getChartColumns(){const e=this.columnModel.getAllGridColumns(),t=new Set,i=new Set;return e.forEach(e=>{const s=e.getColDef(),r=s.chartDataType;if(r)switch(r){case"category":case"time":return void t.add(e);case"series":return void i.add(e);case"excluded":return;default:console.warn(`AG Grid: unexpected chartDataType value '${r}' supplied, instead use 'category', 'series' or 'excluded'`)}"ag-Grid-AutoColumn"!==s.colId?e.isPrimary()?(this.isInferredValueCol(e)?i:t).add(e):i.add(e):t.add(e)}),{dimensionCols:t,valueCols:i}}isInferredValueCol(e){const t=e.getColId();if("ag-Grid-AutoColumn"===t)return!1;const i=this.rowPositionUtils.getRowNode({rowIndex:0,rowPinned:null});if(!i)return this.valueColsWithoutSeriesType.has(t);let s=this.valueService.getValue(e,i);null==s&&(s=this.extractLeafData(i,e)),null!=s&&"function"==typeof s.toNumber&&(s=s.toNumber());const r="number"==typeof s;return r&&this.valueColsWithoutSeriesType.add(t),r}extractLeafData(e,t){if(!e.allLeafChildren)return null;for(let i=0;i<e.allLeafChildren.length;i++){const s=e.allLeafChildren[i],r=this.valueService.getValue(t,s);if(null!=r)return r}return null}destroy(){this.valueColsWithoutSeriesType.clear(),super.destroy()}};Uy([(0,r.dsm)("columnModel")],jy.prototype,"columnModel",2),Uy([(0,r.dsm)("valueService")],jy.prototype,"valueService",2),Uy([(0,r.dsm)("rowPositionUtils")],jy.prototype,"rowPositionUtils",2),Uy([r.o7C],jy.prototype,"postConstruct",1),jy=Uy([(0,r.dR4)("chartColumnService")],jy);var Ky=class e extends r.XQb{constructor(e){var t;super(),this.suppressComboChartWarnings=!1,this.chartDataModel=e,this.seriesChartTypes=null!=(t=e.params.seriesChartTypes)?t:[]}init(){this.initComboCharts()}update(e){this.seriesChartTypes=null!=e?e:this.seriesChartTypes,this.initComboCharts(),this.updateSeriesChartTypes()}initComboCharts(){const e=this.seriesChartTypes&&this.seriesChartTypes.length>0;("customCombo"===this.chartDataModel.chartType||e)&&(this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){this.chartDataModel.isComboChart()&&(this.seriesChartTypes=this.seriesChartTypes.map(e=>{const t=["groupedColumn","stackedColumn","stackedArea"].includes(e.chartType);return e.secondaryAxis=!t&&e.secondaryAxis,e}),"customCombo"!==this.chartDataModel.chartType?this.updateChartSeriesTypesForBuiltInCombos():this.updateSeriesChartTypesForCustomCombo())}updateSeriesChartTypesForCustomCombo(){this.seriesChartTypes&&this.seriesChartTypes.length>0||this.suppressComboChartWarnings||console.warn("AG Grid: 'seriesChartTypes' are required when the 'customCombo' chart type is specified."),this.seriesChartTypes=this.seriesChartTypes.map(t=>(e.SUPPORTED_COMBO_CHART_TYPES.includes(t.chartType)||(console.warn(`AG Grid: invalid chartType '${t.chartType}' supplied in 'seriesChartTypes', converting to 'line' instead.`),t.chartType="line"),t));const t=this.chartDataModel.valueColState.map(e=>{this.savedCustomSeriesChartTypes&&0!==this.savedCustomSeriesChartTypes.length||(this.savedCustomSeriesChartTypes=this.seriesChartTypes);return this.savedCustomSeriesChartTypes.find(t=>t.colId===e.colId)||(e.selected&&!this.suppressComboChartWarnings&&console.warn(`AG Grid: no 'seriesChartType' found for colId = '${e.colId}', defaulting to 'line'.`),{colId:e.colId,chartType:"line",secondaryAxis:!1})});this.seriesChartTypes=t,this.savedCustomSeriesChartTypes=t,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){const{chartType:e,valueColState:t}=this.chartDataModel;let i="columnLineCombo"===e?"groupedColumn":"stackedArea",s="columnLineCombo"===e?"line":"groupedColumn";const r=t.filter(e=>e.selected),n=Math.ceil(r.length/2);this.seriesChartTypes=r.map((e,t)=>{const r=t>=n?s:i;return{colId:e.colId,chartType:r,secondaryAxis:!1}})}};Ky.SUPPORTED_COMBO_CHART_TYPES=["line","groupedColumn","stackedColumn","area","stackedArea"],Uy([r.o7C],Ky.prototype,"init",1);var $y=Ky,Yy={area:{isCartesian:!0,canInvert:!0},bar:{isCartesian:!0,canInvert:!0},histogram:{isCartesian:!0},line:{isCartesian:!0,canInvert:!0},pie:{isPie:!0},donut:{isPie:!0,canInvert:!0},scatter:{isCartesian:!0},bubble:{isCartesian:!0},"radial-column":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radial-bar":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radar-line":{isPolar:!0,isEnterprise:!0,canInvert:!0},"radar-area":{isPolar:!0,isEnterprise:!0,canInvert:!0},nightingale:{isPolar:!0,isEnterprise:!0,canInvert:!0},"range-bar":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},"range-area":{isCartesian:!0,isEnterprise:!0},"box-plot":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},treemap:{isEnterprise:!0,isHierarchical:!0},sunburst:{isEnterprise:!0,isHierarchical:!0},heatmap:{isCartesian:!0,isEnterprise:!0},waterfall:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0}};function qy(e){return r.E1g.COMBO_CHART_TYPES.includes(e)}function Xy(e,t){var i;return!!(null==(i=Yy[e])?void 0:i[t])}var Zy=new Set(["stackedColumn","normalizedColumn","stackedBar","normalizedBar"]);function Qy(e){return Zy.has(e)}function Jy(e){return Xy(e,"isCartesian")}function ev(e){return Xy(e,"isPolar")}function tv(e){return Xy(e,"isHierarchical")}function iv(e){return"doughnut"===e?"donut":e}function sv(e){return r.E1g.CHART_TYPE_TO_SERIES_TYPE[e]}function rv(e){var t;return null!=(t=sv(e))?t:"line"}function nv(e){return Xy(e,"isPie")}function ov(e){return tv(rv(e))?void 0:1}function av(e){return tv(rv(e))?2:function(e){return"pie"===e||"waterfall"===e||"histogram"===e}(e)?1:void 0}function lv(e){return Xy(rv(e),"canInvert")}var cv=class e extends r.XQb{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.columnNames={},this.crossFiltering=!1,this.grouping=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}setParams(e){const{chartType:t,pivotChart:i,chartThemeName:s,switchCategorySeries:r,aggFunc:n,cellRange:o,suppressChartRanges:a,unlinkChart:l,crossFiltering:c,seriesGroupType:h}=e;this.chartType=t,this.pivotChart=null!=i&&i,this.chartThemeName=s,this.switchCategorySeries=!!r,this.aggFunc=n,this.referenceCellRange=o,this.suppliedCellRange=o,this.suppressChartRanges=null!=a&&a,this.unlinked=!!l,this.crossFiltering=!!c,this.seriesGroupType=h}init(){this.datasource=this.createManagedBean(new Wy),this.chartColumnService=this.createManagedBean(new jy),this.comboChartModel=this.createManagedBean(new $y(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){const{cellRange:t,seriesChartTypes:i}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(null==t?void 0:t.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||i)&&this.comboChartModel.update(i),this.unlinked||this.updateData()}updateCellRanges(e){const{updatedColState:t,resetOrder:i,maintainColState:s,setColsFromRange:r}=null!=e?e:{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);const{dimensionCols:n,valueCols:o}=this.chartColumnService.getChartColumns(),a=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,i),this.setDimensionCellRange(n,a,t),this.setValueCellRange(o,a,r),t||s||(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){const{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();const i={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:r._.includes(["scatter","bubble"],this.chartType)},{chartData:s,columnNames:n,groupChartData:o}=this.datasource.getData(i);this.chartData=s,this.groupChartData=o,this.columnNames=n,this.categoryAxisType=void 0}isGrouping(){const e=this.gos.get("treeData"),t=e?null:this.chartColumnService.getRowGroupColumns(),i=e||t&&t.length>0,s=this.getSelectedDimensions().map(({colId:e})=>e),r=this.chartColumnService.getGroupDisplayColumns().map(e=>e.getColId()).some(e=>s.includes(e));return!!i&&r}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getColDisplayName(e){return this.chartColumnService.getColDisplayName(e)}isPivotMode(){return this.chartColumnService.isPivotMode()}getChartDataType(e){const t=this.chartColumnService.getColumn(e);return t?t.getColDef().chartDataType:void 0}isPivotActive(){return this.chartColumnService.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===r.OnL.DIMENSION||null==this.referenceCellRange.startColumn?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return r._.convertToSet(this.chartColumnService.getAllDisplayedColumns());const e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),r._.convertToSet(e)}getRowIndexes(){let e=0,t=0;const{rangeService:i,valueCellRange:s,dimensionCellRange:r}=this,n=s||r;if(i&&n){e=i.getRangeStartRow(n).rowIndex;const s=i.getRangeEndRow(n);t="bottom"===s.rowPinned?-1:s.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){const{dimensionCols:t,valueCols:i}=this.chartColumnService.getChartColumns(),s=this.getAllColumnsFromRanges(),n=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];const o=tv(rv(this.chartType));let a=!1,l=1;const c=this.suppliedCellRange.columns[0];t.forEach(e=>{const t="ag-Grid-AutoColumn"===e.getColId();let i=!1;this.crossFiltering&&this.aggFunc?c.getColId()===e.getColId()&&(i=!0):i=!!t||(!a||o)&&s.has(e),this.dimensionColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:i,order:l++}),i&&(a=!0)});const h={colId:e.DEFAULT_CATEGORY,displayName:this.chartTranslationService.translate("defaultCategory"),selected:!a,order:0};this.dimensionColState.unshift(h);const d=this.referenceCellRange.columns.filter(e=>i.has(e));i.forEach(e=>{n&&r._.includes(this.referenceCellRange.columns,e)&&(e=d.shift()),this.valueColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:s.has(e),order:l++})})}updateColumnState(e,t){const i=t=>t.colId===e.colId,{dimensionColState:s,valueColState:r}=this,n=s.find(i),o=r.find(i);if(n)if(tv(rv(this.chartType)))n.selected=e.selected;else{const t=e.selected?n:s.filter(e=>e!==n).find(({selected:e})=>e);s.forEach(e=>e.selected=e===t)}else o&&(o.selected=e.selected);const a=[...s,...r],l=[];t||(a.forEach((t,i)=>{i===e.order&&l.push(e.colId),t.colId!==e.colId&&l.push(t.colId)}),a.forEach(e=>{const t=l.indexOf(e.colId);e.order=t>=0?l.indexOf(e.colId):a.length-1})),this.reorderColState()}reorderColState(){const e=(e,t)=>e.order-t.order;this.dimensionColState.sort(e),this.valueColState.sort(e)}setDimensionCellRange(t,i,s){this.dimensionCellRange=void 0;const n=tv(rv(this.chartType));if(!s&&!this.dimensionColState.length){const e=new Array;return t.forEach(t=>{e.length>0&&!n||!i.has(t)||e.push(t)}),void(e.length>0&&(this.dimensionCellRange=this.createCellRange(r.OnL.DIMENSION,...e)))}let o=s?[s]:[];if(this.crossFiltering&&this.aggFunc){const e=this.suppliedCellRange.columns[0];o=this.dimensionColState.filter(t=>t.colId===e.getColId())}else(n||0===o.length||o.some(({column:e})=>!e||!t.has(e)))&&(o=this.dimensionColState.filter(e=>e.selected));const a=1===o.length&&o[0].colId===e.DEFAULT_CATEGORY,l=o.map(({column:e})=>e).filter(e=>null!=e);l.length>0&&!a&&(this.dimensionCellRange=this.createCellRange(r.OnL.DIMENSION,...l))}setValueCellRange(e,t,i){this.valueCellRange=void 0;const s=[],n=av(this.chartType);let o=0;if(e.forEach(e=>{i?(null==n||o<n)&&t.has(e)&&(s.push(e),o++):this.valueColState.some(t=>t.selected&&t.colId===e.getColId())&&s.push(e)}),s.length>0){let e=[];this.valueColState.length>0?e=this.valueColState.map(e=>e.colId):t.forEach(t=>e.push(t.getColId())),s.sort((t,i)=>e.indexOf(t.getColId())-e.indexOf(i.getColId())),this.valueCellRange=this.createCellRange(r.OnL.VALUE,...s)}}resetCellRanges(e,t){if(!e&&!t)return;const{dimensionCols:i,valueCols:s}=this.chartColumnService.getChartColumns(),r=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(i,r),t&&this.setValueCellRange(s,r)}updateSelectedDimensions(e){const t=new Set(e.map(e=>e.getColId()));if(tv(rv(this.chartType))){const e=this.dimensionColState.filter(e=>t.has(e.colId)),i=new Set(e.map(e=>e.colId));this.dimensionColState=this.dimensionColState.map(e=>Vy(By({},e),{selected:i.has(e.colId)}))}else{const e=(this.dimensionColState.find(e=>t.has(e.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(t=>Vy(By({},t),{selected:t.colId===e}))}}syncDimensionCellRange(){const e=this.getSelectedDimensions();if(0===e.length)return;const t=e.map(({column:e})=>e).filter(e=>null!=e);t.length>0&&(this.dimensionCellRange=this.createCellRange(r.OnL.DIMENSION,...t))}isComboChart(e){return qy(null!=e?e:this.chartType)}};cv.DEFAULT_CATEGORY="AG-GRID-DEFAULT-CATEGORY",Uy([(0,r.dsm)("rangeService")],cv.prototype,"rangeService",2),Uy([(0,r.dsm)("chartTranslationService")],cv.prototype,"chartTranslationService",2),Uy([r.o7C],cv.prototype,"init",1);var hv=cv,dv=["number","category","grouped-category","log","time"];function uv(e,t){return!1!==t.clone&&t.isMergeableObject(e)?yv(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function pv(e,t,i){return e.concat(t).map(function(e){return uv(e,i)})}function gv(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function mv(e,t){try{return t in e}catch(e){return!1}}function fv(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){const t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t}(e)}function yv(e,t,i){(i=i||{}).arrayMerge=i.arrayMerge||pv,i.isMergeableObject=i.isMergeableObject||fv,i.cloneUnlessOtherwiseSpecified=uv;const s=Array.isArray(t);return s===Array.isArray(e)?s?i.arrayMerge(e,t,i):function(e={},t={},i){const s={};return i.isMergeableObject(e)&&gv(e).forEach(function(t){s[t]=uv(e[t],i)}),gv(t).forEach(function(r){(function(e,t){return mv(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(mv(e,r)&&i.isMergeableObject(t[r])?s[r]=function(e,t){if(!t.customMerge)return yv;const i=t.customMerge(e);return"function"==typeof i?i:yv}(r,i)(e[r],t[r],i):s[r]=uv(t[r],i))}),s}(e,t,i):uv(t,i)}function vv(e,t,i){if(null==e)return i;const s=t.split(".");let r=e;for(;s.length>1;)if(r=r[s.shift()],null==r)return i;const n=r[s[0]];return null!=n?n:i}function Cv(e){return r._.includes(Object.keys(Bm.themes),e)}var bv=dv.reduce((e,t)=>Vy(By({},e),{[t]:{title:{_enabledFromTheme:!0}}}),{});function Sv(e,t,i){const s=e.getExtraPaddingDirections();return{common:Vy(By({},t?{animation:{duration:500}}:void 0),{axes:bv,padding:{top:!i&&s.includes("top")?40:20,right:s.includes("right")?30:20,bottom:s.includes("bottom")?40:20,left:s.includes("left")?30:20}}),pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function wv(e,t){const{customChartThemes:i}=e,s=i&&i[t];return s||console.warn(`AG Grid: no stock theme exists with the name '${t}' and no custom chart theme with that name was supplied to 'customChartThemes'`),s}var xv=e=>t=>null==t||e(t),Ev=e=>"string"==typeof e,Mv=e=>"boolean"==typeof e,Av=e=>"object"==typeof e,Tv=(e,t)=>i=>`AG Grid - unable to update chart as invalid params supplied:  \`${e}: ${i}\`, expected ${t}.`,Dv=e=>`${e} is not supported in AG Charts Community (either 'ag-grid-charts-enterprise' or '@ag-grid-enterprise/charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,Iv=class e{static isEnterprise(){return Wm.enterpriseModule.isEnterprise}static isValidChartType(e){return!!sv(e)||qy(e)}static isLegacyChartType(t){return e.legacyChartTypes.includes(t)}static validateUpdateParams(t){switch(t.type){case"rangeChartUpdate":return e.validateUpdateRangeChartParams(t);case"pivotChartUpdate":return e.validateUpdatePivotChartParams(t);case"crossFilterChartUpdate":return e.validateUpdateCrossFilterChartParams(t);default:return console.warn(`AG Grid - Invalid value supplied for 'type': ${t.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}static validateCreateParams(t){return e.validateProperties(t,[e.enterpriseChartTypeValidation,e.switchCategorySeriesValidation])}static validateUpdateRangeChartParams(t){const i=[...e.commonUpdateValidations,e.enterpriseChartTypeValidation,...e.cellRangeValidations,{property:"seriesChartTypes",validationFn:e=>void 0===e||Array.isArray(e)&&e.every(Av),warnMessage:Tv("seriesChartTypes","Array of SeriesChartType")}];return e.validateProperties(t,i,[...e.baseUpdateChartParams,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType"],"UpdateRangeChartParams")}static validateUpdatePivotChartParams(t){const i=[...e.commonUpdateValidations];return e.validateProperties(t,i,[...e.baseUpdateChartParams],"UpdatePivotChartParams")}static validateUpdateCrossFilterChartParams(t){const i=[...e.commonUpdateValidations,...e.cellRangeValidations];return e.validateProperties(t,i,[...e.baseUpdateChartParams,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}static validateProperties(e,t,i,s){let r;for(const i of t){const{property:t,validationFn:s,warnMessage:n,warnIfFixed:o}=i;if(t in e){const i=e[t],a=s(i);if(!0===a)continue;if(!1===a)return console.warn(n(i)),!1;r=r||By({},e),r[t]=a,o&&console.warn(n(i))}}if(i)for(const t in e)if(!i.includes(t))return console.warn(`AG Grid - Unexpected property supplied. ${s} does not contain: \`${t}\`.`),!1;return r||!0}};Iv.legacyChartTypes=["doughnut"],Iv.baseUpdateChartParams=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"],Iv.validateChartType=xv(e=>{if(Iv.isValidChartType(e))return!0;if(Iv.isLegacyChartType(e)){const t=iv(e);return r._.warnOnce(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),Iv.validateAgChartThemeOverrides=xv(e=>"object"==typeof e),Iv.validateChartParamsCellRange=xv(e=>"object"==typeof e),Iv.validateAggFunc=xv(e=>"string"==typeof e||"function"==typeof e),Iv.enterpriseChartTypeValidation={property:"chartType",validationFn:xv(e=>Iv.isEnterprise()||!e||!function(e){return Xy(rv(e),"isEnterprise")}(e)),warnMessage:e=>Dv(`The '${e}' chart type`)},Iv.switchCategorySeriesValidation={property:"switchCategorySeries",validationFn:xv(e=>{if(!e||Iv.isEnterprise())return!0}),warnMessage:()=>Dv("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0},Iv.commonUpdateValidations=[{property:"chartId",validationFn:Ev,warnMessage:Tv("chartId","string")},{property:"chartType",validationFn:Iv.validateChartType,warnMessage:Tv("chartType","ChartType")},{property:"chartThemeName",validationFn:Ev,warnMessage:Tv("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:Iv.validateAgChartThemeOverrides,warnMessage:Tv("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:Mv,warnMessage:Tv("unlinkChart","boolean")}],Iv.cellRangeValidations=[{property:"cellRange",validationFn:Iv.validateChartParamsCellRange,warnMessage:Tv("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:Mv,warnMessage:Tv("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:Iv.validateAggFunc,warnMessage:Tv("aggFunc","string or IAggFunc")},Iv.switchCategorySeriesValidation];var Rv=Iv,Pv=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],kv=class e extends r.XQb{constructor(e){super(),this.model=e,this.isEnterprise=()=>Wm.enterpriseModule.isEnterprise}init(){this.setChartRange(),this.addManagedListener(this.eventService,r.sVA.EVENT_RANGE_SELECTION_CHANGED,e=>{e.id&&e.id===this.model.chartId&&this.updateForRangeChange()}),this.model.unlinked&&this.rangeService&&this.rangeService.setCellRanges([]),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_MOVED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PINNED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_VISIBLE,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_CELL_VALUE_CHANGED,this.updateForDataChange.bind(this))}update(e){if(!this.validUpdateType(e))return!1;const t=Rv.validateUpdateParams(e);if(!t)return!1;const i=!0===t?e:t;return this.applyValidatedChartParams(i),!0}applyValidatedChartParams(e){var t,i,s,r,n,o,a,l,c;const{chartId:h,chartType:d,chartThemeName:u,unlinkChart:p}=e,g={chartId:h,pivotChart:this.model.pivotChart,chartType:null!=d?d:this.model.chartType,chartThemeName:null!=u?u:this.model.chartThemeName,unlinkChart:null!=p?p:this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1};let m=By({},g);switch(e.type){case"rangeChartUpdate":m.cellRange=null!=(t=this.createCellRange(e))?t:this.model.suppliedCellRange,m.switchCategorySeries=null!=(i=e.switchCategorySeries)?i:this.model.switchCategorySeries,m.aggFunc=null!=(s=e.aggFunc)?s:this.model.aggFunc,m.seriesChartTypes=e.seriesChartTypes,m.suppressChartRanges=null!=(r=e.suppressChartRanges)?r:this.model.suppressChartRanges,m.seriesGroupType=null!=(n=e.seriesGroupType)?n:this.model.seriesGroupType;break;case"crossFilterChartUpdate":m.cellRange=null!=(o=this.createCellRange(e))?o:this.model.suppliedCellRange,m.switchCategorySeries=!1,m.aggFunc=null!=(a=e.aggFunc)?a:this.model.aggFunc,m.crossFiltering=!0,m.suppressChartRanges=null!=(l=e.suppressChartRanges)?l:this.model.suppressChartRanges;break;case"pivotChartUpdate":m.switchCategorySeries=!1}this.model.updateModel(m),m.unlinkChart||m.suppressChartRanges?null==(c=this.rangeService)||c.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;const{maintainColState:t,setColsFromRange:i}=null!=e?e:{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:i}),this.model.updateData(),this.setChartRange()}updateForDataChange(){this.model.unlinked||(this.model.updateData(),this.raiseChartModelUpdateEvent())}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(e){this.model.updateCellRanges(e),this.model.updateData(),e.skipAnimation&&this.getChartProxy().getChartRef().skipAnimations(),this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(e){this.chartProxy.updateThemeOverrides(e)}getChartUpdateParams(e){const t=this.getSelectedValueColState().map(e=>({colId:e.colId,displayName:e.displayName})),i=this.getChartData(),s=this.getSelectedDimensions(),r={data:i,groupData:this.model.groupChartData,grouping:this.isGrouping(),categories:s.map(e=>{var t;return{id:e.colId,name:e.displayName,chartDataType:null!=(t=this.model.categoryAxisType)?t:this.model.getChartDataType(e.colId)}}),fields:t,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:this.model.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(r):r}invertCategorySeriesParams(e){const[t]=e.categories,i=[{id:hv.DEFAULT_CATEGORY,name:""}],s=e.data.map((e,i)=>{const s=`${t.id}:${i}`,r=e[t.id];return{colId:s,displayName:null==r?"":String(r)}}),r=e.fields.map(i=>{const s={[hv.DEFAULT_CATEGORY]:i.displayName};for(const[r,n]of e.data.entries()){const e=`${t.id}:${r}`,o=n[i.colId];s[e]=o}return s});return Vy(By({},e),{categories:i,fields:s,data:r})}getChartModel(){const e=this.model.pivotChart?"pivot":"range",t=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:e,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy.getChartThemeOverrides(),chartPalette:this.chartProxy.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:t,seriesGroupType:this.model.seriesGroupType}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(e){this.updateMultiSeriesAndCategory(this.model.chartType,e),this.model.chartType=e,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent(),this.raiseChartOptionsChangedEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){lv(this.getChartType())&&(this.model.switchCategorySeries=e,this.raiseChartModelUpdateEvent())}getAggFunc(){return this.model.aggFunc}setAggFunc(e,t){this.model.aggFunc!==e&&(this.model.aggFunc=e,t||(this.model.updateData(),this.raiseChartModelUpdateEvent()))}updateMultiSeriesAndCategory(e,t){var i,s;const r=(e,t)=>{let i=0;for(const s of e)s.selected&&(i>=t?s.selected=!1:i++);0===i&&(e[0].selected=!0)},n=ov(t),o=av(t),a=null!=n&&(null!=(i=ov(e))?i:100)>(null!=n?n:100),l=null!=o&&(null!=(s=av(e))?s:100)>(null!=o?o:100);a&&r(this.model.dimensionColState,n),l&&r(this.model.valueColState,o),(a||l)&&(this.model.resetCellRanges(a,l),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||(this.raiseChartModelUpdateEvent(),this.raiseChartOptionsChangedEvent())}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||Pv}getThemes(){return this.getThemeNames().map(e=>{const t=Cv(e)?e:this.chartProxy.lookupCustomChartTheme(e);return Bm.getChartTheme(t)})}getPalettes(){return this.getThemes().map(e=>e.palette)}getThemeTemplateParameters(){return this.getThemes().map(e=>e.getTemplateParameters())}getValueColState(){return this.model.valueColState.map(this.displayNameMapper.bind(this))}getSelectedValueColState(){return this.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}displayNameMapper(e){const t=this.model.columnNames[e.colId];return e.displayName=t?t.join(" - "):this.model.getColDisplayName(e.column),e}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.getValueColState()}}setChartRange(e=!1){!this.rangeService||this.model.suppressChartRanges||this.model.unlinked||this.rangeService.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeService&&this.rangeService.setCellRanges([]):this.updateForGridChange(),this.dispatchEvent({type:e.EVENT_CHART_LINKED_CHANGED})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return r._.includes(["scatter","bubble"],this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){const e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(t,i,s){const r=this.model.comboChartModel.seriesChartTypes.find(e=>e.colId===t);if(r){const t="customCombo"!==this.model.chartType;t&&(this.model.chartType="customCombo");const n=r.chartType;null!=i&&(r.chartType=i),null!=s&&(r.secondaryAxis=s),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),t&&this.dispatchEvent({type:e.EVENT_CHART_TYPE_CHANGED}),n!==i&&this.dispatchEvent({type:e.EVENT_CHART_SERIES_CHART_TYPE_CHANGED}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){const e=this.getSelectedValueColState().map(e=>e.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){const t=null!=e?e:this.getChartType();return this.isComboChart(t)?["line","bar","area"]:[rv(t)]}getChartSeriesType(){const e=this.getSeriesChartTypes();if(0===e.length)return"bar";const t=e[0].chartType;return"columnLineCombo"===t?"bar":"areaColumnCombo"===t?"area":rv(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){var t;return e.cellRange&&(null==(t=this.rangeService)?void 0:t.createPartialCellRangeFromRangeParams(e.cellRange,!0))}validUpdateType(e){var t;if(!e.type)return console.warn("AG Grid - Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'."),!1;const i={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},s=null!=(t=Object.keys(i).find(e=>i[e]()))?t:"Range Chart",r=e.type===`${s[0].toLowerCase()}${s.slice(1).replace(/ /g,"")}Update`;return r||console.warn(`AG Grid - Unable to update chart as a '${e.type}' update type is not permitted on a ${s}.`),r}getCellRangeParams(){const e=this.getCellRanges(),t=e[0],i=t&&t.startRow||null,s=t&&t.endRow||null;return{rowStartIndex:i&&i.rowIndex,rowStartPinned:i&&i.rowPinned,rowEndIndex:s&&s.rowIndex,rowEndPinned:s&&s.rowPinned,columns:e.reduce((e,t)=>e.concat(t.columns.map(e=>e.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){var e;return null!=(e=this.model.seriesGroupType)?e:this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){const t={type:e.EVENT_CHART_MODEL_UPDATE};this.dispatchEvent(t)}raiseChartUpdatedEvent(){const t={type:e.EVENT_CHART_UPDATED};this.dispatchEvent(t)}raiseChartApiUpdateEvent(){const t={type:e.EVENT_CHART_API_UPDATE};this.dispatchEvent(t)}raiseChartOptionsChangedEvent(){const{chartId:e,chartType:t}=this.getChartModel(),i={type:r.sVA.EVENT_CHART_OPTIONS_CHANGED,chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy.getChartThemeOverrides()};this.eventService.dispatchEvent(i)}raiseChartRangeSelectionChangedEvent(){const e={type:r.sVA.EVENT_CHART_RANGE_SELECTION_CHANGED,id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()};this.eventService.dispatchEvent(e)}destroy(){super.destroy(),this.rangeService&&this.rangeService.setCellRanges([])}};kv.EVENT_CHART_UPDATED="chartUpdated",kv.EVENT_CHART_API_UPDATE="chartApiUpdate",kv.EVENT_CHART_MODEL_UPDATE="chartModelUpdate",kv.EVENT_CHART_TYPE_CHANGED="chartTypeChanged",kv.EVENT_CHART_SERIES_CHART_TYPE_CHANGED="chartSeriesChartTypeChanged",kv.EVENT_CHART_LINKED_CHANGED="chartLinkedChanged",Uy([(0,r.dsm)("rangeService")],kv.prototype,"rangeService",2),Uy([r.o7C],kv.prototype,"init",1);var Lv=kv,Nv=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.config=null!=t?t:{};const{selectedValueList:i,valueFormatter:s,valueList:n}=this.config;this.selectedValues=null!=i?i:[],this.valueList=null!=n?n:[],this.valueFormatter=null!=s?s:e=>r._.escapeString(e)}init(){const{ariaLabel:e,onValuesChange:t,dragSourceId:i}=this.config;this.dropZonePanel=this.createManagedBean(new Fv({getValues:()=>this.selectedValues,setValues:e=>this.updateValues(e),isDraggable:()=>this.selectedValues.length>1},e=>this.valueFormatter(e),e,i)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),null!=t&&(this.onValuesChange=t)}setValues(e,t){const{added:i,removed:s,updated:r}=this.getChanges(this.valueList,e);let n=!1;return(i.length||s.length||r.length)&&(n=!0),this.valueList=e,this.updateValues(t,n,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){const e=this.createSelectOptions();if(!e.length)return!1;const{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new r.Ju4({options:e,placeholder:t,onValueChange:e=>this.addValue(e),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){let e=[];const{maxSelection:t}=this.config;return t&&this.selectedValues.length>=t||this.valueList.forEach(t=>{this.selectedValues.includes(t)||e.push({value:t,text:this.valueFormatter(t)})}),e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,i){var s,r,n,o,a;const l=this.selectedValues;this.selectedValues=e;const c=this.getChanges(l,e),h=t||c.added.length||c.removed.length,d=this.gos.getActiveDomElement(),u=null==(s=this.eSelect)?void 0:s.getGui().contains(d),p=null==(r=this.dropZonePanel)?void 0:r.getGui().contains(d);i||null==(n=this.onValuesChange)||n.call(this,c);const g=!!h&&!this.refreshSelect();this.dropZonePanel.refreshGui(),h&&u&&(g?this.dropZonePanel.focusList(!0):null==(o=this.eSelect)||o.getFocusableElement().focus()),p&&!e.length&&(null==(a=this.eSelect)||a.getFocusableElement().focus())}getChanges(e,t){return{added:t.filter(t=>!e.includes(t)),removed:e.filter(e=>!t.includes(e)),updated:t.filter((t,i)=>e[i]!==t),selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();const e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(r._.removeFromParent(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}};Nv.TEMPLATE='<div class="ag-pill-select" role="presentation"></div>',Uy([r.o7C],Nv.prototype,"init",1);var _v=Nv,Ov=class extends r.v26{constructor(e,t,i,s,r,n){super(t,i,!1),this.value=e,this.valueFormatter=s,this.draggable=r,this.sourceId=n}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return r.qRA.ChartPanel}getDragSourceId(){return this.sourceId}isDraggable(){return this.draggable}},Fv=class extends r.fNO{constructor(e,t,i,s){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=i,this.sourceId=s}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||null!=this.sourceId&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?r.WO_.ICON_MOVE:r.WO_.ICON_NOT_ALLOWED}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,i){return new Ov(e,t,i,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===r.qRA.ChartPanel}};Uy([r.o7C],Fv.prototype,"postConstruct",1);var Gv=class extends r.uAl{constructor(e,t,i,s,r){super(r),this.chartController=e,this.autoScrollService=t,this.allowMultipleSelection=i,this.maxSelection=s,this.columnComps=new Map}refreshColumnComps(e){return!!r._.areEqual(r._.keys(this.columnComps),e.map(({colId:e})=>e))&&(e.forEach(e=>{this.columnComps.get(e.colId).setValue(e.selected,!0)}),!0)}createGroup(e,t,i,s,n){if(this.allowMultipleSelection){const r=e.filter(e=>e.selected);this.valuePillSelect=this.groupComp.createManagedBean(new _v({valueList:e,selectedValueList:r,valueFormatter:t,selectPlaceholder:this.chartTranslationService.translate(i),dragSourceId:s,onValuesChange:e=>this.onValueChange(e),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{const t=this.createValueSelectParams(e);t.onValueChange=t=>{e.forEach(e=>{e.selected=!1}),t.selected=!0,t.colId===hv.DEFAULT_CATEGORY&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:t,skipAnimation:null==n?void 0:n()})},this.valueSelect=this.groupComp.createManagedBean(new r.Ju4(t)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;const{options:t,value:i}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(i,!0)}createValueSelectParams(e){let t;return{options:e.map(e=>{var i;const s=null!=(i=e.displayName)?i:"";return e.selected&&(t=e),{value:e,text:s}}),value:t}}onDragging(e){const t=this.checkHoveredItem(e);if(!t)return;this.lastDraggedColumn=e.dragItem.columns[0];const{comp:i,position:s}=t,{comp:r,position:n}=this.lastHoveredItem||{};i===r&&s===n||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredItem={comp:i,position:s},i.getGui().classList.add("ag-list-item-hovered",`ag-item-highlight-${s}`))}checkHoveredItem(e){if(r._.missing(e.vDirection))return null;const t=e.event;for(const e of this.columnComps.values()){const i=e.getGui();if(!i.querySelector(".ag-chart-data-column-drag-handle"))continue;const s=i.getBoundingClientRect();if(t.clientY>=s.top&&t.clientY<=s.bottom){const r=i.clientHeight;return{comp:e,position:t.clientY>s.top+r/2?"bottom":"top"}}}return null}onDragLeave(){this.clearHoveredItems()}onDragStop(){if(this.lastHoveredItem){const{dimensionCols:e,valueCols:t}=this.chartController.getColStateForMenu(),i=[...e,...t].find(e=>e.column===this.lastDraggedColumn);if(i){let e=Array.from(this.columnComps.values()).indexOf(this.lastHoveredItem.comp);"bottom"===this.lastHoveredItem.position&&e++,i.order=e,this.chartController.updateForPanelChange({updatedColState:i})}}this.clearHoveredItems(),this.lastDraggedColumn=void 0,this.autoScrollService.ensureCleared()}clearHoveredItems(){this.columnComps.forEach(e=>{e.getGui().classList.remove("ag-list-item-hovered","ag-item-highlight-top","ag-item-highlight-bottom")}),this.lastHoveredItem=void 0}addDragHandle(e,t){const i=r._.createIconNoSpan("columnDrag",this.gos);i.classList.add("ag-drag-handle","ag-chart-data-column-drag-handle"),e.getGui().insertAdjacentElement("beforeend",i);const s={type:r.qRA.ChartPanel,eElement:i,dragItemName:t.displayName,getDragItem:()=>({columns:[t.column]}),onDragStopped:()=>this.onDragStop()};this.dragAndDropService.addDragSource(s,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(s))}addChangeListener(e,t){this.addManagedListener(e,r.sVA.EVENT_FIELD_VALUE_CHANGED,()=>{t.selected=e.getValue(),this.chartController.updateForPanelChange({updatedColState:t})})}isInterestedIn(e){return e===r.qRA.ChartPanel}onValueChange({added:e,updated:t,removed:i,selected:s}){let r,n;const o=()=>{s.forEach((e,t)=>{e.order=t}),n=!0};e.length?(r=e[0],r.selected=!0,o()):i.length?(r=i[0],r.selected=!1):t.length&&(o(),r=t[0]),r&&this.chartController.updateForPanelChange({updatedColState:r,resetOrder:n})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}};Uy([(0,r.dsm)("dragAndDropService")],Gv.prototype,"dragAndDropService",2),Uy([(0,r.dsm)("chartTranslationService")],Gv.prototype,"chartTranslationService",2);var Bv=class e extends Gv{constructor(t,i,s,r,n,o){super(t,i,r,void 0,e.TEMPLATE),this.title=s,this.dimensionCols=n,this.isOpen=o}init(){this.groupComp=this.createBean(new r.Pk_({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartMenuService.isLegacyFormat()?(this.createLegacyCategoriesGroup(this.dimensionCols),this.clearAggFuncControls()):(this.createCategoriesGroup(this.dimensionCols),this.createAggFuncControls(this.dimensionCols)),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){var t;this.chartMenuService.isLegacyFormat()?this.refreshColumnComps(e)||this.recreate(e):(null==(t=this.valuePillSelect)||t.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc()))}recreate(e){this.isOpen=this.groupComp.isExpanded(),r._.clearElement(this.getGui()),this.destroyBean(this.groupComp),this.dimensionCols=e,this.init()}createCategoriesGroup(e){this.createGroup(e,e=>{var t;return null!=(t=e.displayName)?t:""},"categoryAdd","categorySelect",()=>!this.chartController.getAggFunc())}createLegacyCategoriesGroup(e){const t=`chartDimension${this.groupComp.getCompId()}`,i=this.allowMultipleSelection;if(e.forEach(e=>{var s;const n={label:null!=(s=e.displayName)?s:"",value:e.selected,inputName:t},o=this.groupComp.createManagedBean(i?(()=>{const e=new r.Unm(n);return e.addCssClass("ag-data-select-checkbox"),e})():new r.OQA(n));this.addChangeListener(o,e),this.groupComp.addItem(o),this.columnComps.set(e.colId,o),i&&this.addDragHandle(o,e)}),i){const e=this.groupComp.getGui(),t={getIconName:()=>r.WO_.ICON_MOVE,getContainer:()=>e,onDragging:e=>this.onDragging(e),onDragLeave:()=>this.onDragLeave(),isInterestedIn:this.isInterestedIn.bind(this),targetContainsSource:!0};this.dragAndDropService.addDropTarget(t),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(t))}}createAggFuncControls(e){const t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new r.bLJ({label:this.chartTranslationService.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:null!=t,onValueChange:e=>{var t,i;const s=e?"sum":void 0;this.chartController.setAggFunc(s),null==(t=this.aggFuncSelect)||t.setValue(s,!0),null==(i=this.aggFuncSelect)||i.setDisplayed(null!=s)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new r.Ju4({options:[{value:"sum",text:this.chartTranslationService.translate("sum")},{value:"first",text:this.chartTranslationService.translate("first")},{value:"last",text:this.chartTranslationService.translate("last")},{value:"min",text:this.chartTranslationService.translate("min")},{value:"max",text:this.chartTranslationService.translate("max")},{value:"count",text:this.chartTranslationService.translate("count")},{value:"avg",text:this.chartTranslationService.translate("avg")}],value:"string"==typeof t?t:void 0,onValueChange:e=>{this.chartController.setAggFunc(e)}}))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){var i,s,r,n;const o=e.filter(e=>e.selected).some(e=>e.colId!==hv.DEFAULT_CATEGORY);null==(i=this.aggFuncToggle)||i.setValue(null!=t),null==(s=this.aggFuncSelect)||s.setValue("string"==typeof t?t:void 0,!0),null==(r=this.aggFuncToggle)||r.setDisplayed(o),null==(n=this.aggFuncSelect)||n.setDisplayed(o&&null!=t)}clearAggFuncControls(){this.aggFuncToggle=this.aggFuncToggle&&this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.aggFuncSelect&&this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};Bv.TEMPLATE='<div id="categoriesGroup"></div>',Uy([(0,r.dsm)("chartMenuService")],Bv.prototype,"chartMenuService",2),Uy([r.o7C],Bv.prototype,"init",1);var Vv=Bv,Hv=class e extends Gv{constructor(t,i,s,r,n,o,a,l){super(t,i,n,o,e.TEMPLATE),this.chartOptionsService=s,this.title=r,this.valueCols=a,this.isOpen=l}init(){if(this.groupComp=this.createBean(new r.Pk_({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){const e=this.groupComp.createManagedBean(new r.bLJ({label:this.chartTranslationService.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:e=>{this.chartOptionsService.setPairedMode(!!e),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(e)}this.chartMenuService.isLegacyFormat()?this.createLegacySeriesGroup(this.valueCols):this.createSeriesGroup(this.valueCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){var t,i;if(this.chartMenuService.isLegacyFormat())if(this.refreshColumnComps(e)){if(this.chartController.isActiveXYChart()){const t=this.generateGetSeriesLabel(e);e.forEach(e=>{this.columnComps.get(e.colId).setLabel(t(e))})}}else this.recreate(e);else null==(t=this.valuePillSelect)||t.setValueFormatter(this.generateGetSeriesLabel(e)),null==(i=this.valuePillSelect)||i.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e)}recreate(e){this.isOpen=this.groupComp.isExpanded(),r._.clearElement(this.getGui()),this.destroyBean(this.groupComp),this.valueCols=e,this.init()}createSeriesGroup(e){this.createGroup(e,this.generateGetSeriesLabel(e),"seriesAdd","seriesSelect")}createLegacySeriesGroup(e){const t=this.generateGetSeriesLabel(e);e.forEach(e=>{const i=t(e),s=this.groupComp.createManagedBean(new r.Unm({label:i,value:e.selected}));s.addCssClass("ag-data-select-checkbox"),this.addChangeListener(s,e),this.groupComp.addItem(s),this.columnComps.set(e.colId,s),this.addDragHandle(s,e)});const i=this.groupComp.getGui(),s={getIconName:()=>r.WO_.ICON_MOVE,getContainer:()=>i,onDragging:e=>this.onDragging(e),onDragLeave:()=>this.onDragLeave(),isInterestedIn:this.isInterestedIn.bind(this),targetContainsSource:!0};this.dragAndDropService.addDropTarget(s),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(s))}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return e=>{var t;return null!=(t=e.displayName)?t:""};const t=e.filter(e=>e.selected),i="bubble"===this.chartController.getChartType(),s=this.chartOptionsService.getPairedMode(),r=new Map;return r.set(0,"X"),r.set(1,"Y"),r.set(2,"size"),e=>{var n;const o=null!=(n=e.displayName)?n:"";if(!e.selected)return o;const a=t.indexOf(e);if(-1===a)return o;let l;return l=s?r.get(a%(i?3:2)):0===a?"X":i&&a%2==0?"size":"Y",`${o} (${l})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};Hv.TEMPLATE='<div id="seriesGroup"></div>',Uy([(0,r.dsm)("chartMenuService")],Hv.prototype,"chartMenuService",2),Uy([r.o7C],Hv.prototype,"init",1);var Uv=Hv,zv=class e extends r.uAl{constructor(t,i,s){super(e.TEMPLATE),this.chartController=t,this.columns=i,this.isOpen=s,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}init(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){r._.areEqual(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),r._.clearElement(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.init()}getValidColIds(e){const t=this.chartController.getSeriesChartTypes();return e.filter(e=>e.selected&&!!t.filter(t=>t.colId===e.colId)[0]).map(({colId:e})=>e)}createSeriesChartTypeGroup(e){this.seriesChartTypeGroupComp=this.createBean(new r.Pk_({title:this.chartTranslationService.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));const t=this.chartController.getSeriesChartTypes();e.forEach(e=>{if(!e.selected)return;const i=t.filter(t=>t.colId===e.colId)[0];if(!i)return;this.selectedColIds.push(e.colId);const s=this.seriesChartTypeGroupComp.createManagedBean(new r.Pk_({title:e.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),n=this.seriesChartTypeGroupComp.createManagedBean(new r.Unm({label:this.chartTranslationService.translate("secondaryAxis"),labelWidth:"flex",disabled:(e=>["groupedColumn","stackedColumn","stackedArea"].includes(e))(i.chartType),value:!!i.secondaryAxis,onValueChange:t=>this.chartController.updateSeriesChartType(e.colId,void 0,t)}));s.addItem(n);const o=e=>this.chartTranslationService.translate(e),a=[{value:"line",text:o("line")},{value:"area",text:o("area")},{value:"stackedArea",text:o("stackedArea")},{value:"groupedColumn",text:o("groupedColumn")},{value:"stackedColumn",text:o("stackedColumn")}],l=s.createManagedBean(new r.Ju4({labelAlignment:"left",labelWidth:"flex",options:a,value:i.chartType,onValueChange:t=>this.chartController.updateSeriesChartType(e.colId,t)}));s.addItem(l),this.seriesChartTypeGroupComp.addItem(s),this.chartTypeComps.set(e.colId,l),this.secondaryAxisComps.set(e.colId,n)}),this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){const e=this.chartController.getSeriesChartTypes();this.selectedColIds.forEach(t=>{const i=e.find(e=>e.colId===t);if(!i)return;const s=this.chartTypeComps.get(t),r=this.secondaryAxisComps.get(t);null==s||s.setValue(i.chartType),null==r||r.setValue(!!i.secondaryAxis),null==r||r.setDisabled(this.isSecondaryAxisDisabled(i.chartType))})}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(e){return["groupedColumn","stackedColumn","stackedArea"].includes(e)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}};zv.TEMPLATE='<div id="seriesChartTypeGroup"></div>',Uy([(0,r.dsm)("chartTranslationService")],zv.prototype,"chartTranslationService",2),Uy([r.o7C],zv.prototype,"init",1);var Wv=zv,jv=class e extends r.uAl{constructor(e,t){super(),this.getValue=e,this.setValue=t}init(){this.switchCategorySeriesToggleButton=this.createManagedBean(new r.bLJ({label:this.chartTranslationService.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.getValue(),onValueChange:e=>{this.setValue(e)}}));const t={title:void 0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-data",expanded:!0,items:[this.switchCategorySeriesToggleButton]};this.setTemplate(e.TEMPLATE,{switchCategorySeriesGroup:t})}refresh(){var e;null==(e=this.switchCategorySeriesToggleButton)||e.setValue(this.getValue(),!0)}};jv.TEMPLATE='<div>\n        <ag-group-component ref="switchCategorySeriesGroup"></ag-group-component>\n    </div>',Uy([(0,r.dsm)("chartTranslationService")],jv.prototype,"chartTranslationService",2),Uy([r.o7C],jv.prototype,"init",1);var Kv=jv,$v={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0}]},Yv=class e extends r.uAl{constructor(t,i){super(e.TEMPLATE),this.chartController=t,this.chartOptionsService=i,this.isSwitchCategorySeriesToggled=!1}init(){this.switchCategorySeriesPanel=this.addComponent(this.createManagedBean(new Kv(()=>this.chartController.isCategorySeriesSwitched(),e=>this.chartController.switchCategorySeries(e)))),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.createAutoScrollService(),this.updatePanels(),this.addManagedListener(this.chartController,Lv.EVENT_CHART_MODEL_UPDATE,this.updatePanels.bind(this)),this.addManagedListener(this.chartController,Lv.EVENT_CHART_API_UPDATE,this.updatePanels.bind(this))}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){var e,t,i,s,r;const n=this.chartType,o=this.isSwitchCategorySeriesToggled,{dimensionCols:a,valueCols:l}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();const c=this.isSwitchCategorySeriesToggled!==o;this.canRefresh(n,this.chartType)&&!c?(null==(e=this.categoriesDataPanel)||e.refresh(a),null==(t=this.seriesDataPanel)||t.refresh(l),null==(i=this.seriesChartTypePanel)||i.refresh(l)):this.recreatePanels(a,l),null==(s=this.switchCategorySeriesPanel)||s.setDisplayed(lv(this.chartType)&&!this.chartMenuService.isLegacyFormat()&&!this.chartController.isGrouping()),c&&(null==(r=this.switchCategorySeriesPanel)||r.refresh())}canRefresh(e,t){if(void 0===e)return!1;if(e===t)return!0;const i=e=>["columnLineCombo","areaColumnCombo","customCombo"].includes(e);return!(!i(e)||!i(t))}recreatePanels(e,t){var i;this.clearPanelComponents();const{chartType:s}=this;if(!s)return;const n=this.chartController.isCategorySeriesSwitched(),o=null==(i=this.getDataPanelDef().groups)?void 0:i.map(({type:i,isOpen:o})=>i===(n?"series":"categories")?this.categoriesDataPanel=this.createBean(new Vv(this.chartController,this.autoScrollService,this.getCategoryGroupTitle(n),this.getCategoryGroupMultipleSelect(s,n),e,o)):i===(n?"categories":"series")?this.seriesDataPanel=this.createBean(new Uv(this.chartController,this.autoScrollService,this.chartOptionsService,this.getSeriesGroupTitle(n),this.getSeriesGroupMultipleSelect(s,n),this.getSeriesGroupMaxSelection(s,n),t,o)):"seriesChartType"===i?this.chartController.isComboChart()?this.seriesChartTypePanel=this.createBean(new Wv(this.chartController,t,o)):null:(r._.warnOnce(`Invalid charts data panel group name supplied: '${i}'`),null)).filter(e=>null!=e);o&&this.addPanelComponents(o)}addPanelComponents(e){var t;const i=document.createDocumentFragment();for(const t of e)this.registerComponent(t),i.appendChild(t.getGui());const s=null==(t=this.switchCategorySeriesPanel)?void 0:t.getGui();return this.getGui().insertBefore(i,null!=s?s:null),e}clearPanelComponents(){const e=this.getGui();this.categoriesDataPanel&&e.removeChild(this.categoriesDataPanel.getGui()),this.seriesDataPanel&&e.removeChild(this.seriesDataPanel.getGui()),this.seriesChartTypePanel&&e.removeChild(this.seriesChartTypePanel.getGui()),this.categoriesDataPanel=this.destroyBean(this.categoriesDataPanel),this.seriesDataPanel=this.destroyBean(this.seriesDataPanel),this.seriesChartTypePanel=this.destroyBean(this.seriesChartTypePanel)}createAutoScrollService(){const e=this.getGui();this.autoScrollService=new r.MSA({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}addComponent(e){return this.registerComponent(e),this.getGui().appendChild(e.getGui()),e}registerComponent(e){e.addCssClass("ag-chart-data-section")}getDataPanelDef(){var e,t;return null!=(t=null==(e=this.gos.get("chartToolPanelsDef"))?void 0:e.dataPanel)?t:$v}getCategoryGroupTitle(e){return e?this.chartTranslationService.translate("seriesLabels"):this.chartTranslationService.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(e,t){return!t&&1!==ov(e)}getSeriesGroupTitle(e){return e?this.chartTranslationService.translate("categoryValues"):this.chartTranslationService.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(e,t){return 1!==this.getSeriesGroupMaxSelection(e,t)}getSeriesGroupMaxSelection(e,t){if(!t)return av(e)}};Yv.TEMPLATE='<div class="ag-chart-data-wrapper ag-scrollable-container"></div>',Uy([(0,r.dsm)("chartTranslationService")],Yv.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],Yv.prototype,"chartMenuService",2),Uy([r.o7C],Yv.prototype,"init",1);var qv=Yv,Xv=class e extends r.uAl{constructor(e){super(),this.activeComps=[],this.params=e,this.chartOptions=e.chartMenuUtils.getChartOptions()}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.params.name||this.chartTranslationService.translate("font"),enabled:this.params.enabled,suppressEnabledCheckbox:!!this.params.suppressEnabledCheckbox,onEnableChange:e=>{this.params.onEnableChange&&this.params.onEnableChange(e)}};this.setTemplate(e.TEMPLATE,{fontGroup:t,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:this.params.chartMenuUtils.getDefaultColorPickerParams(this.params.keyMapper("color"))})}addCompToPanel(e){this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){const e=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua,  serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode,  sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],t=this.getInitialFontValue("fontFamily");let i=e[0];if(t){const s=e.map(e=>e.toLowerCase()).indexOf(t.toLowerCase());if(s>=0)i=e[s];else{const s=r._.capitalise(t);e.push(s),i=s}}return{options:e.sort().map(e=>({value:e,text:e})),inputWidth:"flex",value:`${i}`,onValueChange:e=>this.setFont({fontFamily:e})}}getSizeSelectParams(){const e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue("fontSize");return r._.includes(e,t)||e.push(t),{options:e.sort((e,t)=>e-t).map(e=>({value:`${e}`,text:`${e}`})),inputWidth:"flex",value:`${t}`,onValueChange:e=>this.setFont({fontSize:parseInt(e,10)}),label:this.chartTranslationService.translate("size")}}getWeightStyleSelectParams(){var e,t;const i=null!=(e=this.getInitialFontValue("fontWeight"))?e:"normal",s=null!=(t=this.getInitialFontValue("fontStyle"))?t:"normal",r=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}];let n=r.find(e=>e.weight===i&&e.style===s);return n||(n={name:"predefined",weight:i,style:s},r.unshift(n)),{options:r.map(e=>({value:e.name,text:this.chartTranslationService.translate(e.name)})),inputWidth:"flex",value:n.name,onValueChange:e=>{const t=r.find(t=>t.name===e);this.setFont({fontWeight:t.weight,fontStyle:t.style})}}}addItemToPanel(e){this.fontGroup.addItem(e),this.activeComps.push(e)}destroyActiveComps(){this.activeComps.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){const{keyMapper:t}=this.params;Object.entries(e).forEach(([e,i])=>{i&&this.chartOptions.setValue(t(e),i)})}getInitialFontValue(e){const{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}};Xv.TEMPLATE='<div class="ag-font-panel">\n            <ag-group-component ref="fontGroup">\n                <ag-select ref="familySelect"></ag-select>\n                <ag-select ref="weightStyleSelect"></ag-select>\n                <div class="ag-charts-font-size-color">\n                    <ag-select ref="sizeSelect"></ag-select>\n                    <ag-color-picker ref="colorPicker"></ag-color-picker>\n                </div>\n            </ag-group-component>\n        </div>',Uy([(0,r.PIB)("fontGroup")],Xv.prototype,"fontGroup",2),Uy([(0,r.dsm)("chartTranslationService")],Xv.prototype,"chartTranslationService",2),Uy([r.o7C],Xv.prototype,"init",1);var Zv=Xv,Qv=class e extends r.uAl{constructor({chartMenuParamsFactory:e,isExpandedOnInit:t=!1}){super(),this.chartMenuUtils=e,this.isExpandedOnInit=t}init(){const t=this.chartMenuUtils.addEnableParams("legend.enabled",{cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("legend"),suppressEnabledCheckbox:!1,suppressToggleExpandOnEnableChange:!0,expanded:this.isExpandedOnInit,items:[this.createLabelPanel()]});this.setTemplate(e.TEMPLATE,{legendGroup:t,legendPositionSelect:this.chartMenuUtils.getDefaultLegendParams("legend.position"),legendPaddingSlider:this.getSliderParams("spacing","spacing",200),markerSizeSlider:this.getSliderParams("item.marker.size","markerSize",40),markerStrokeSlider:this.getSliderParams("item.marker.strokeWidth","markerStroke",10),markerPaddingSlider:this.getSliderParams("item.marker.padding","itemSpacing",20),itemPaddingXSlider:this.getSliderParams("item.paddingX","layoutHorizontalSpacing",50),itemPaddingYSlider:this.getSliderParams("item.paddingY","layoutVerticalSpacing",50)})}getSliderParams(e,t,i){return this.chartMenuUtils.getDefaultSliderParams(`legend.${e}`,t,i)}createLabelPanel(){const e={enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`legend.item.label.${e}`};return this.createManagedBean(new Zv(e))}};Qv.TEMPLATE='<div>\n            <ag-group-component ref="legendGroup">\n                <ag-select ref="legendPositionSelect"></ag-select>\n                <ag-slider ref="legendPaddingSlider"></ag-slider>\n                <ag-slider ref="markerSizeSlider"></ag-slider>\n                <ag-slider ref="markerStrokeSlider"></ag-slider>\n                <ag-slider ref="markerPaddingSlider"></ag-slider>\n                <ag-slider ref="itemPaddingXSlider"></ag-slider>\n                <ag-slider ref="itemPaddingYSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],Qv.prototype,"chartTranslationService",2),Uy([r.o7C],Qv.prototype,"init",1);var Jv=Qv,eC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t=this.chartMenuUtils.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("ticks"),suppressEnabledCheckbox:!1}),i=this.chartMenuUtils.getDefaultColorPickerParams("tick.color"),s=this.chartMenuUtils.getDefaultSliderParams("tick.width","width",10),r=this.chartMenuUtils.getDefaultSliderParams("tick.size","length",30);this.setTemplate(e.TEMPLATE,{axisTicksGroup:t,axisTicksColorPicker:i,axisTicksWidthSlider:s,axisTicksSizeSlider:r})}};eC.TEMPLATE='<div>\n            <ag-group-component ref="axisTicksGroup">\n                <ag-color-picker ref="axisTicksColorPicker"></ag-color-picker>\n                <ag-slider ref="axisTicksWidthSlider"></ag-slider>\n                <ag-slider ref="axisTicksSizeSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],eC.prototype,"chartTranslationService",2),Uy([r.o7C],eC.prototype,"init",1);var tC=eC,iC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}init(){const t=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("gridLines"),suppressEnabledCheckbox:!1}),i=this.getGridLineColorPickerParams("color"),s=this.getGridLineWidthSliderParams("thickness"),r=this.getGridLineDashSliderParams("lineDash");this.setTemplate(e.TEMPLATE,{gridLineGroup:t,gridLineColorPicker:i,gridLineWidthSlider:s,gridLineLineDashSlider:r})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",e,{formatInputValue:e=>{var t;return null==(t=null==e?void 0:e[0])?void 0:t.stroke},parseInputValue:e=>{var t;const i=null!=(t=this.chartOptions.getValue("gridLine.style"))?t:[];return 0===i.length?[{stroke:e,lineDash:[]}]:[Vy(By({},i[0]),{stroke:e})]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",e,10)}getGridLineDashSliderParams(e){var t,i;const s=this.chartOptions.getValue("gridLine.style"),r=null==(i=null==(t=null==s?void 0:s[0])?void 0:t.lineDash)?void 0:i[0],n=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(null!=r?r:0,e,30);return n.onValueChange=e=>{const t=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[e],stroke:t}])},n}};iC.TEMPLATE='<div>\n            <ag-group-component ref="gridLineGroup">\n                <ag-color-picker ref="gridLineColorPicker"></ag-color-picker>\n                <ag-slider ref="gridLineWidthSlider"></ag-slider>\n                <ag-slider ref="gridLineLineDashSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],iC.prototype,"chartTranslationService",2),Uy([r.o7C],iC.prototype,"init",1);var sC=iC,rC=class e extends r.DKR{constructor(t){super(t,e.TEMPLATE),this.radius=0,this.offsetX=0,this.offsetY=0}postConstruct(){super.postConstruct();const{value:e,onValueChange:t}=this.config;null!=e&&this.setValue(e,void 0,!0),null!=t&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:e=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:e=>this.calculateAngleDrag(e),onDragStop:()=>{}},this.dragService.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(e=>{null!=e&&""!==e||(e="0"),e=this.eAngleValue.normalizeValue(e);let t=parseFloat(e);t>180&&(t-=360),this.setValue(t)}),this.updateNumberInput(),r._.exists(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListener(this,r.sVA.EVENT_FIELD_VALUE_CHANGED,()=>{this.eAngleValue.getInputElement().contains(this.gos.getActiveDomElement())||this.updateNumberInput()})}updateNumberInput(){const e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){const t=this.parentCircleRect||{width:24,height:24},i=this.eChildCircle,s=t.width/2,r=t.height/2;i.style.left=`${s+8*Math.cos(e)}px`,i.style.top=`${r+8*Math.sin(e)}px`}calculatePolar(){const e=this.offsetX,t=this.offsetY,i=Math.atan2(t,e);this.degrees=this.toDegrees(i),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(i)}calculateCartesian(){const e=this.toRadians(this.getValue()),t=this.getRadius();this.setOffsetX(Math.cos(e)*t).setOffsetY(Math.sin(e)*t)}setOffsetX(e){return this.offsetX!==e&&(this.offsetX=e,this.calculatePolar()),this}setOffsetY(e){return this.offsetY!==e&&(this.offsetY=e,this.calculatePolar()),this}calculateAngleDrag(e){const t=this.parentCircleRect,i=t.width/2,s=t.height/2,r=e.clientX-t.left-i,n=e.clientY-t.top-s,o=Math.atan2(n,r);this.setValue(o,!0)}toDegrees(e){return e/Math.PI*180}toRadians(e){return e/180*Math.PI}normalizeNegativeValue(e){return e<0?360+e:e}normalizeAngle180(e){return(e%=2*Math.PI)<-Math.PI?e+=2*Math.PI:e>=Math.PI&&(e-=2*Math.PI),e}getRadius(){return this.radius}setRadius(e){return this.radius===e||(this.radius=e,this.calculateCartesian()),this}onValueChange(e){return this.addManagedListener(this,r.sVA.EVENT_FIELD_VALUE_CHANGED,()=>{e(this.degrees)}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,i){let s;return s=t?e:this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(s),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(s),i||this.dispatchEvent({type:r.sVA.EVENT_FIELD_VALUE_CHANGED})),this}setWidth(e){return r._.setFixedWidth(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragService.removeDragSource(this.dragListener),super.destroy()}};rC.TEMPLATE='<div class="ag-angle-select">\n            <div ref="eLabel"></div>\n            <div class="ag-wrapper ag-angle-select-wrapper">\n                <div ref="eAngleSelectField" class="ag-angle-select-field">\n                    <div ref="eParentCircle" class="ag-angle-select-parent-circle">\n                        <div ref="eChildCircle" class="ag-angle-select-child-circle"></div>\n                    </div>\n                </div>\n                <ag-input-number-field ref="eAngleValue"></ag-input-number-field>\n            </div>\n        </div>',Uy([(0,r.PIB)("eLabel")],rC.prototype,"eLabel",2),Uy([(0,r.PIB)("eParentCircle")],rC.prototype,"eParentCircle",2),Uy([(0,r.PIB)("eChildCircle")],rC.prototype,"eChildCircle",2),Uy([(0,r.PIB)("eAngleValue")],rC.prototype,"eAngleValue",2),Uy([(0,r.dsm)("dragService")],rC.prototype,"dragService",2);var nC=rC,oC=class extends r.XQb{constructor(e){super(),this.chartOptionsProxy=e}getDefaultColorPickerParams(e,t,i){return this.addValueParams(e,{label:this.chartTranslationService.translate(null!=t?t:"color"),labelWidth:"flex",inputWidth:"flex"},i)}getDefaultNumberInputParams(e,t,i){return this.addValueParams(e,{label:this.chartTranslationService.translate(t),labelWidth:"flex",inputWidth:"flex",precision:null==i?void 0:i.precision,step:null==i?void 0:i.step,min:null==i?void 0:i.min,max:null==i?void 0:i.max},{parseInputValue:e=>{const t=Number(e);return isNaN(t)?void 0:t},formatInputValue:e=>null==e?"":`${e}`})}getDefaultSliderParams(e,t,i,s){var r;let n=null!=(r=this.chartOptionsProxy.getValue(e))?r:0;s&&Array.isArray(n)&&(n=n[0]);const o=this.getDefaultSliderParamsWithoutValueParams(n,t,i);return o.onValueChange=t=>this.chartOptionsProxy.setValue(e,s?[t]:t),o}getDefaultSliderParamsWithoutValueParams(e,t,i){return{label:this.chartTranslationService.translate(t),minValue:0,maxValue:Math.max(e,i),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,i){const s=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslationService.translate(t),value:s,readOnly:null==i?void 0:i.readOnly,passive:null==i?void 0:i.passive};return r.onValueChange=t=>{this.chartOptionsProxy.setValue(e,"boolean"==typeof t?t:void 0)},r}getDefaultSelectParams(e,t,i,s){const r=this.chartOptionsProxy.getValue(e),n={label:this.chartTranslationService.translate(t),value:r,options:i,pickerType:null==s?void 0:s.pickerType,pickerAriaLabelKey:null==s?void 0:s.pickerAriaLabelKey,pickerAriaLabelValue:null==s?void 0:s.pickerAriaLabelValue};return n.onValueChange=t=>{this.chartOptionsProxy.setValue(e,t)},n}getDefaultLegendParams(e){return this.addValueParams(e,{label:this.chartTranslationService.translate("position"),labelWidth:"flex",inputWidth:"flex",options:["top","right","bottom","left"].map(e=>({value:e,text:this.chartTranslationService.translate(e)}))})}getDefaultFontPanelParams(e,t){const i=t=>`${e}.${t}`;return this.addEnableParams(i("enabled"),{name:this.chartTranslationService.translate(t),suppressEnabledCheckbox:!1,chartMenuUtils:this,keyMapper:i})}addValueParams(e,t,i){const s=this.chartOptionsProxy.getValue(e);return t.value=(null==i?void 0:i.formatInputValue)?i.formatInputValue(s):s,t.onValueChange=t=>{const s=(null==i?void 0:i.parseInputValue)?i.parseInputValue(t):t;this.chartOptionsProxy.setValue(e,s)},t}addEnableParams(e,t){var i;return t.enabled=null!=(i=this.chartOptionsProxy.getValue(e))&&i,t.onEnableChange=t=>this.chartOptionsProxy.setValue(e,t),t}getChartOptions(){return this.chartOptionsProxy}};Uy([(0,r.dsm)("chartTranslationService")],oC.prototype,"chartTranslationService",2);var aC=class e extends r.uAl{constructor(e,{chartController:t,chartOptionsService:i,isExpandedOnInit:s=!1,seriesType:r}){super(),this.activePanels=[],this.axisLabelUpdateFuncs=[],this.axisType=e,this.chartController=t,this.chartAxisOptionsProxy=i.getCartesianAxisOptionsProxy(e),this.chartAxisThemeOverridesProxy=i.getCartesianAxisThemeOverridesProxy(e),this.chartAxisAppliedThemeOverridesProxy=i.getCartesianAxisAppliedThemeOverridesProxy(e),this.chartOptionsSeriesProxy=i.getSeriesOptionsProxy(()=>null!=r?r:this.chartController.getChartSeriesType()),this.chartOptionsService=i,this.isExpandedOnInit=s}init(){var t;const i=this.axisType,s={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(i),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0},n=this.createManagedBean(new oC(this.chartAxisOptionsProxy)),o=this.createManagedBean(new oC(this.chartAxisThemeOverridesProxy)),a=this.getAxisTypeSelectParams(n,this.chartAxisAppliedThemeOverridesProxy),l=this.getAxisPositionSelectParams(n),c=this.getAxisTimeFormatSelectParams(n),h=this.getAxisColorInputParams(o),d=this.getAxisLineWidthSliderParams(o);this.setTemplate(e.TEMPLATE,{axisGroup:s,axisTypeSelect:null!=a?a:void 0,axisPositionSelect:null!=l?l:void 0,axisTimeFormatSelect:null!=c?c:void 0,axisColorInput:h,axisLineWidthSlider:d}),this.axisTypeSelect.setDisplayed(!!(null==(t=a.options)?void 0:t.length)),l||this.removeTemplateComponent(this.axisPositionSelect);const u=()=>{const e="time"===this.chartAxisOptionsProxy.getValue("type");r._.setDisplayed(this.axisTimeFormatSelect.getGui(),e)};c?(u(),this.addManagedListener(this.eventService,r.sVA.EVENT_CHART_OPTIONS_CHANGED,e=>{u()})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(o),this.initAxisTicks(o),this.initAxisLabels(o),this.addManagedListener(this.chartController,Lv.EVENT_CHART_UPDATED,()=>this.axisLabelUpdateFuncs.forEach(e=>e())),this.addManagedListener(this.chartController,Lv.EVENT_CHART_MODEL_UPDATE,()=>setTimeout(()=>{this.refreshAxisTypeSelect(n),u()}))}getAxisTypeSelectParams(e,t){const i=e.getChartOptions(),s=this.getAxisTypeSelectOptions(),r=e.getDefaultSelectParams("type","axisType",s);return r.onValueChange=e=>{var s;const r=i.getValue("type");if(e===r)return;const n=t.getValue("*"),o="time"===e,a="time"===r!==o?o?"%d %B %Y":void 0:null;if(this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,e),null!==a){const e=null!=(s=i.getValue("label"))?s:{};i.setValue("label",Vy(By({},e),{format:a}))}t.setValue("*",n)},r}refreshAxisTypeSelect(e){const t=this.getAxisTypeSelectOptions(),i=!!t.length;this.axisTypeSelect.setDisplayed(i),i&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){const e=this.chartController.getChartType();return["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(e)||this.chartController.isGrouping()||!this.isCategoryAxis()||this.chartController.isCategorySeriesSwitched()||!(()=>{const e=this.chartController.getChartData()[0];return!!e&&this.chartController.getSelectedDimensions().every(t=>!isNaN(parseFloat(e[t.colId])))})()?[]:["category","number","time"].map(e=>({value:e,text:this.translate(e)}))}isCategoryAxis(){const e="horizontal"===this.chartOptionsSeriesProxy.getValue("direction");return e&&"yAxis"===this.axisType||!e&&"xAxis"===this.axisType}getAxisPositionSelectParams(e){const t=((e,t)=>{if("heatmap"===e)return null;switch(t){case"xAxis":return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];case"yAxis":return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]}})(this.chartController.getChartType(),this.axisType);return t?e.getDefaultSelectParams("position","position",t):null}getAxisTimeFormatSelectParams(e){if(!this.isCategoryAxis())return null;const t=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return e.getDefaultSelectParams("label.format","timeFormat",t)}getAxisColorInputParams(e){return e.getDefaultColorPickerParams("line.color")}getAxisLineWidthSliderParams(e){var t;const i=e.getChartOptions(),s=e.getDefaultSliderParamsWithoutValueParams(null!=(t=i.getValue("line.enabled")?i.getValue("line.width"):null)?t:0,"thickness",10);return s.onValueChange=e=>{var t;t=0===e?null:e,i.setValues([{expression:"line.enabled",value:null!=t},{expression:"line.width",value:null!=t?t:0}])},s}initGridLines(e){if("heatmap"!==this.chartController.getChartType()){const t=this.createBean(new sC(e));this.axisGroup.addItem(t),this.activePanels.push(t)}}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;const t=this.createBean(new tC(e));this.axisGroup.addItem(t),this.activePanels.push(t)}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(e){const t={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:e,keyMapper:e=>`label.${e}`},i=this.createBean(new Zv(t));this.axisGroup.addItem(i),this.activePanels.push(i),this.addAdditionalLabelComps(i,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);const i=this.createRotationWidget("labelRotation",t),s=this.initLabelRotation(i,t);e.addCompToPanel(s),e.addCompToPanel(i)}initLabelRotation(e,t){const i=t.getChartOptions(),s=()=>i.getValue("label.rotation"),n="number"!=typeof s()&&i.getValue("label.autoRotate"),o=this.createBean(new r.Unm({label:this.translate("autoRotate"),value:n,onValueChange:t=>{t&&(this.prevRotation=s()),i.setValues([{expression:"label.autoRotate",value:t},{expression:"label.rotation",value:t?void 0:this.prevRotation}]),e.setDisabled(t)}}));return e.setDisabled(n),o}createRotationWidget(e,t){var i;const s=t.getChartOptions(),r=()=>s.getValue("label.rotation"),n=String.fromCharCode(176),o=`${this.chartTranslationService.translate(e)} ${n}`,a=new nC({label:o,labelWidth:"flex",value:null!=(i=r())?i:0,onValueChange:e=>s.setValue("label.rotation",e)});return this.axisLabelUpdateFuncs.push(()=>{var e;a.setValue(null!=(e=r())?e:0)}),this.createBean(a)}addLabelPadding(e,t){const i=this.createBean(new r.YD7(t.getDefaultSliderParams("label.padding","padding",30)));e.addCompToPanel(i)}translate(e){return this.chartTranslationService.translate(e)}removeTemplateComponent(e){r._.removeFromParent(e.getGui()),this.destroyBean(e)}destroyActivePanels(){this.activePanels.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};aC.TEMPLATE='<div>\n            <ag-group-component ref="axisGroup">\n                <ag-select ref="axisTypeSelect"></ag-select>\n                <ag-select ref="axisTimeFormatSelect"></ag-select>\n                <ag-select ref="axisPositionSelect"></ag-select>\n                <ag-color-picker ref="axisColorInput"></ag-color-picker>\n                <ag-slider ref="axisLineWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.PIB)("axisGroup")],aC.prototype,"axisGroup",2),Uy([(0,r.PIB)("axisTypeSelect")],aC.prototype,"axisTypeSelect",2),Uy([(0,r.PIB)("axisPositionSelect")],aC.prototype,"axisPositionSelect",2),Uy([(0,r.PIB)("axisTimeFormatSelect")],aC.prototype,"axisTimeFormatSelect",2),Uy([(0,r.dsm)("chartTranslationService")],aC.prototype,"chartTranslationService",2),Uy([r.o7C],aC.prototype,"init",1);var lC=aC,cC=class e extends r.uAl{constructor({chartController:e,chartAxisMenuParamsFactory:t,isExpandedOnInit:i=!1}){super(),this.chartController=e,this.chartMenuUtils=t,this.isExpandedOnInit=i}init(){const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0},i=this.chartMenuUtils.getDefaultColorPickerParams("line.color"),s=this.chartMenuUtils.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(e.TEMPLATE,{axisGroup:t,axisColorInput:i,axisLineWidthSlider:s}),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){const e=this.chartController.getChartType();if(["radarLine","radarArea"].includes(e)){const e=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:e,property:"shape"}))}"pie"!==e&&this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){const e={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`label.${e}`},t=this.createManagedBean(new Zv(e)),i=this.createOrientationWidget();t.addItemToPanel(i),this.axisGroup.addItem(t)}createOrientationWidget(){const e=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:e,property:"label.orientation"})}initRadiusAxis(){if(!Xy(rv(this.chartController.getChartType()),"isRadial"))return;const e=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],t=this.createManagedBean(new r.Pk_({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:e})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(t)}createSlider(e){const{labelKey:t,defaultMaxValue:i,step:s=.05,property:n}=e,o=this.chartMenuUtils.getDefaultSliderParams(n,t,i);return o.step=s,this.createManagedBean(new r.YD7(o))}createSelect(e){const{labelKey:t,options:i,property:s}=e;return this.createManagedBean(new r.Ju4(this.chartMenuUtils.addValueParams(s,{label:this.chartTranslationService.translate(t),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:i})))}translate(e){return this.chartTranslationService.translate(e)}};cC.TEMPLATE='<div>\n            <ag-group-component ref="axisGroup">\n                <ag-color-picker ref="axisColorInput"></ag-color-picker>\n                <ag-slider ref="axisLineWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.PIB)("axisGroup")],cC.prototype,"axisGroup",2),Uy([(0,r.dsm)("chartTranslationService")],cC.prototype,"chartTranslationService",2),Uy([r.o7C],cC.prototype,"init",1);var hC=cC,dC=class e extends r.uAl{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("padding"),suppressEnabledCheckbox:!0},i=e=>this.chartMenuUtils.getDefaultSliderParams("padding."+e,e,200);this.setTemplate(e.TEMPLATE,{chartPaddingGroup:t,paddingTopSlider:i("top"),paddingRightSlider:i("right"),paddingBottomSlider:i("bottom"),paddingLeftSlider:i("left")}),this.addManagedListener(this.eventService,r.sVA.EVENT_CHART_OPTIONS_CHANGED,e=>{this.updateTopPadding(e.chartOptions)})}updateTopPadding(e){const t=[...this.chartController.getChartSeriesTypes(),"common"].map(t=>{var i,s;return null==(s=null==(i=e[t])?void 0:i.padding)?void 0:s.top}).find(e=>null!=e);null!=t&&this.paddingTopSlider.setValue(`${t}`)}};dC.TEMPLATE='<div>\n            <ag-group-component ref="chartPaddingGroup">\n                <ag-slider ref="paddingTopSlider"></ag-slider>\n                <ag-slider ref="paddingRightSlider"></ag-slider>\n                <ag-slider ref="paddingBottomSlider"></ag-slider>\n                <ag-slider ref="paddingLeftSlider"></ag-slider>\n            </ag-group-component>\n        <div>',Uy([(0,r.PIB)("paddingTopSlider")],dC.prototype,"paddingTopSlider",2),Uy([(0,r.dsm)("chartTranslationService")],dC.prototype,"chartTranslationService",2),Uy([r.o7C],dC.prototype,"init",1);var uC=dC,pC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("background"),suppressEnabledCheckbox:!1}),i=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(e.TEMPLATE,{chartBackgroundGroup:t,colorPicker:i})}};pC.TEMPLATE='<div>\n            <ag-group-component ref="chartBackgroundGroup">\n                <ag-color-picker ref="colorPicker"></ag-color-picker>\n            </ag-group-component>\n        <div>',Uy([(0,r.dsm)("chartTranslationService")],pC.prototype,"chartTranslationService",2),Uy([r.o7C],pC.prototype,"init",1);var gC=pC,mC=class e extends r.uAl{constructor(t,i){super(e.TEMPLATE),this.chartMenuUtils=t,this.chartController=i,this.activePanels=[],this.chartOptions=t.getChartOptions()}init(){this.initFontPanel(),this.titlePlaceholder=this.chartTranslationService.translate("titlePlaceholder")}hasTitle(){const e=this.chartOptions.getValue("title");return e&&e.enabled&&e.text&&e.text.length>0}initFontPanel(){const e=this.hasTitle(),t={name:this.chartTranslationService.translate("title"),enabled:e,suppressEnabledCheckbox:!1,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`title.${e}`,onEnableChange:e=>{if(this.chartMenuService.doesChartToolbarExist(this.chartController)){const t=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",e?t-20:t+20)}this.chartOptions.setValue("title.enabled",e);const t=this.chartOptions.getValue("title.text"),i="Title"===t||0===(null==t?void 0:t.trim().length);e&&i&&this.chartOptions.setValue("title.text",this.titlePlaceholder)}},i=this.createBean(new Zv(t));i.addItemToPanel(this.createSpacingSlicer()),this.getGui().appendChild(i.getGui()),this.activePanels.push(i),this.addManagedListener(this.eventService,"chartTitleEdit",()=>{i.setEnabled(this.hasTitle())})}createSpacingSlicer(){const e=this.chartMenuUtils.getDefaultSliderParams("title.spacing","spacing",100);return e.value="10",this.createBean(new r.YD7(e))}destroyActivePanels(){this.activePanels.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};mC.TEMPLATE="<div></div>",Uy([(0,r.dsm)("chartTranslationService")],mC.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],mC.prototype,"chartMenuService",2),Uy([r.o7C],mC.prototype,"init",1);var fC=mC,yC=class e extends r.uAl{constructor({chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:i=!1,chartOptionsService:s,seriesType:r}){super(),this.chartController=e,this.chartMenuParamsFactory=t,this.chartOptionsSeriesProxy=s.getSeriesOptionsProxy(()=>null!=r?r:this.chartController.getChartSeriesType()),this.isExpandedOnInit=i}init(){this.chartSeriesMenuParamsFactory=this.createManagedBean(new oC(this.chartOptionsSeriesProxy));const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("chart"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new fC(this.chartMenuParamsFactory,this.chartController)),this.createManagedBean(new uC(this.chartMenuParamsFactory,this.chartController)),this.createManagedBean(new gC(this.chartMenuParamsFactory)),...this.createDirectionSelect()]};this.setTemplate(e.TEMPLATE,{chartGroup:t}),this.addManagedListener(this.eventService,r.sVA.EVENT_CHART_OPTIONS_CHANGED,()=>this.refresh())}refresh(){this.updateDirectionSelect()}createDirectionSelect(){if(this.chartMenuService.isLegacyFormat())return[];const e=["horizontal","vertical"].map(e=>({value:e,text:this.chartTranslationService.translate(e)})),t=this.chartSeriesMenuParamsFactory.getDefaultSelectParams("direction","direction",e);t.labelWidth="flex",t.inputWidth="flex";const i=t.onValueChange;return t.onValueChange=e=>{i(e),this.chartController.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new r.Ju4(t)),this.updateDirectionSelect(),[this.directionSelect]}updateDirectionSelect(){var e;null==(e=this.directionSelect)||e.setDisplayed(function(e){return Xy(rv(e),"canSwitchDirection")}(this.chartController.getChartType()))}};yC.TEMPLATE='<div>\n            <ag-group-component ref="chartGroup"></ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],yC.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],yC.prototype,"chartMenuService",2),Uy([r.o7C],yC.prototype,"init",1);var vC=yC,CC=class e extends r.uAl{constructor(e,t="shadow"){super(),this.chartMenuUtils=e,this.propertyKey=t}init(){const t=this.propertyKey,i=this.chartMenuUtils.addEnableParams(`${t}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("shadow"),suppressEnabledCheckbox:!1}),s=this.chartMenuUtils.getDefaultColorPickerParams(`${t}.color`);this.setTemplate(e.TEMPLATE,{shadowGroup:i,shadowColorPicker:s,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(e,t,i){const s=`${this.propertyKey}.${e}`,r=this.chartMenuUtils.getDefaultSliderParams(s,e,i);return r.minValue=t,r}};CC.TEMPLATE='<div>\n            <ag-group-component ref="shadowGroup">\n                <ag-color-picker ref="shadowColorPicker"></ag-color-picker>\n                <ag-slider ref="shadowBlurSlider"></ag-slider>\n                <ag-slider ref="shadowXOffsetSlider"></ag-slider>\n                <ag-slider ref="shadowYOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],CC.prototype,"chartTranslationService",2),Uy([r.o7C],CC.prototype,"init",1);var bC=CC,SC=class e extends r.uAl{constructor(e,t){super(),this.chartOptionsService=e,this.chartMenuUtils=t}init(){const t=this.chartOptionsService.getChartType(),i=r._.includes(["scatter","bubble"],t),s=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("markers"),suppressEnabledCheckbox:i,suppressOpenCloseIcons:!0}),n="bubble"===t;let o,a;n?(o=this.getSliderParams("marker.maxSize","maxSize",60),a=this.getSliderParams("marker.size","minSize",60)):(o={},a=this.getSliderParams("marker.size","size",60)),this.setTemplate(e.TEMPLATE,{seriesMarkersGroup:s,seriesMarkerShapeSelect:this.getMarkerShapeSelectParams(),seriesMarkerMinSizeSlider:o,seriesMarkerSizeSlider:a,seriesMarkerStrokeWidthSlider:this.getSliderParams("marker.strokeWidth","strokeWidth",10)}),n||this.seriesMarkerMinSizeSlider.setDisplayed(!1)}getMarkerShapeSelectParams(){return this.chartMenuUtils.addValueParams("marker.shape",{options:[{value:"square",text:"Square"},{value:"circle",text:"Circle"},{value:"cross",text:"Cross"},{value:"diamond",text:"Diamond"},{value:"plus",text:"Plus"},{value:"triangle",text:"Triangle"},{value:"heart",text:"Heart"}],label:this.chartTranslationService.translate("shape")})}getSliderParams(e,t,i){return this.chartMenuUtils.getDefaultSliderParams(e,t,i)}};SC.TEMPLATE='<div>\n            <ag-group-component ref="seriesMarkersGroup">\n                <ag-select ref="seriesMarkerShapeSelect"></ag-select>\n                <ag-slider ref="seriesMarkerMinSizeSlider"></ag-slider>\n                <ag-slider ref="seriesMarkerSizeSlider"></ag-slider>\n                <ag-slider ref="seriesMarkerStrokeWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.PIB)("seriesMarkerMinSizeSlider")],SC.prototype,"seriesMarkerMinSizeSlider",2),Uy([(0,r.dsm)("chartTranslationService")],SC.prototype,"chartTranslationService",2),Uy([r.o7C],SC.prototype,"init",1);var wC=SC,xC=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.picker=t.picker}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",e=>{e.key!==r.DDm.ENTER||e.defaultPrevented||this.destroy()}),this.addManagedListener(this.spectrumColor,"keydown",e=>this.moveDragger(e)),this.addManagedListener(this.spectrumAlphaSlider,"keydown",e=>this.moveAlphaSlider(e)),this.addManagedListener(this.spectrumHueSlider,"keydown",e=>this.moveHueSlider(e)),this.addManagedListener(this.spectrumVal,"mousedown",this.onSpectrumDraggerDown.bind(this)),this.addManagedListener(this.spectrumHue,"mousedown",this.onSpectrumHueDown.bind(this)),this.addManagedListener(this.spectrumAlpha,"mousedown",this.onSpectrumAlphaDown.bind(this)),this.addGuiEventListener("mousemove",e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListener(document,"mouseup",this.onMouseUp.bind(this)),this.addManagedListener(this.recentColors,"click",this.onRecentColorClick.bind(this)),this.addManagedListener(this.recentColors,"keydown",e=>{e.key!==r.DDm.ENTER&&e.key!==r.DDm.SPACE||(e.preventDefault(),this.onRecentColorClick(e))})}initTabIndex(){const e=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",e),this.spectrumHueSlider.setAttribute("tabindex",e),this.spectrumAlphaSlider.setAttribute("tabindex",e)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(e){this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(e)}onSpectrumDraggerMove(e){this.isSpectrumDragging&&this.moveDragger(e)}onSpectrumHueDown(e){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(e)}onSpectrumHueMove(e){this.isSpectrumHueDragging&&this.moveHueSlider(e)}onSpectrumAlphaDown(e){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(e)}onSpectrumAlphaMove(e){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(e)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(e){const t=this.spectrumValRect;if(!t)return;let i,s;if(e instanceof MouseEvent)i=e.clientX-t.left,s=e.clientY-t.top;else{const t=e.key===r.DDm.LEFT,n=e.key===r.DDm.RIGHT,o=e.key===r.DDm.UP,a=e.key===r.DDm.DOWN,l=o||a,c=t||n;if(!l&&!c)return;e.preventDefault();const{x:h,y:d}=this.getSpectrumValue();i=h+(c?t?-5:5:0),s=d+(l?o?-5:5:0)}i=Math.max(i,0),i=Math.min(i,t.width),s=Math.max(s,0),s=Math.min(s,t.height),this.setSpectrumValue(i/t.width,1-s/t.height)}moveHueSlider(e){const t=this.spectrumHueRect;if(!t)return;const i=this.moveSlider(this.spectrumHueSlider,e);null!=i&&(this.H=1-i/t.width,this.update())}moveAlphaSlider(e){const t=this.spectrumAlphaRect;if(!t)return;const i=this.moveSlider(this.spectrumAlphaSlider,e);null!=i&&(this.A=i/t.width,this.update())}moveSlider(e,t){var i;const s=e.getBoundingClientRect(),n=null==(i=e.parentElement)?void 0:i.getBoundingClientRect();if(!e||!n)return null;let o;if(t instanceof MouseEvent)o=t.clientX-n.left;else{const i=t.key===r.DDm.LEFT,n=t.key===r.DDm.RIGHT;if(!i&&!n)return null;t.preventDefault();const a=i?-5:5;o=parseFloat(e.style.left)-s.width/2+a}return o=Math.max(o,0),o=Math.min(o,n.width),e.style.left=o+s.width/2+"px",o}update(){const e=Um.Color.fromHSB(360*this.H,this.S,this.B,this.A),t=Um.Color.fromHSB(360*this.H,1,1),i=e.toRgbaString(),s=this.picker;Um.Color.fromString(s.getValue()).toRgbaString()!==i&&(this.colorChanged=!0),s.setValue(i),this.spectrumColor.style.backgroundColor=t.toRgbaString(),this.spectrumDragger.style.backgroundColor=i}setSpectrumValue(e,t){const i=this.spectrumValRect||this.refreshSpectrumRect();if(null==i)return;const s=this.spectrumDragger,r=s.getBoundingClientRect();e=Math.max(0,e),e=Math.min(1,e),t=Math.max(0,t),t=Math.min(1,t),this.S=e,this.B=t,s.style.left=e*i.width-r.width/2+"px",s.style.top=(1-t)*i.height-r.height/2+"px",this.update()}getSpectrumValue(){const e=this.spectrumDragger,t=e.getBoundingClientRect();return{x:parseFloat(e.style.left)+t.width/2,y:parseFloat(e.style.top)+t.height/2}}initRecentColors(){const t=e.recentColors.map((e,t)=>`<div class="ag-recent-color" id=${t} style="background-color: ${e}; width: 15px; height: 15px;" recent-color="${e}" tabIndex="${this.tabIndex}"></div>`);this.recentColors.innerHTML=t.join("")}setValue(e){const t=Um.Color.fromString(e),[i,s,r]=t.toHSB();this.H=(isNaN(i)?0:i)/360,this.A=t.a;const n=this.spectrumHueRect||this.refreshHueRect(),o=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=(this.H-1)*-n.width+"px",this.spectrumAlphaSlider.style.left=this.A*o.width+"px",this.setSpectrumValue(s,r)}onRecentColorClick(t){const i=t.target;if(!r._.exists(i.id))return;const s=parseInt(i.id,10);this.setValue(e.recentColors[s]),this.destroy()}addRecentColor(){const t=Um.Color.fromHSB(360*this.H,this.S,this.B,this.A).toRgbaString();let i=e.recentColors;this.colorChanged&&i[0]!==t&&(i=i.filter(e=>e!=t),i=[t].concat(i),i.length>e.maxRecentColors&&(i=i.slice(0,e.maxRecentColors)),e.recentColors=i)}destroy(){this.addRecentColor(),super.destroy()}};xC.maxRecentColors=8,xC.recentColors=[],xC.TEMPLATE='<div class="ag-color-panel" tabindex="-1">\n            <div ref="spectrumColor" class="ag-spectrum-color">\n                <div class="ag-spectrum-sat ag-spectrum-fill">\n                    <div ref="spectrumVal" class="ag-spectrum-val ag-spectrum-fill">\n                        <div ref="spectrumDragger" class="ag-spectrum-dragger"></div>\n                    </div>\n                </div>\n            </div>\n            <div class="ag-spectrum-tools">\n                <div ref="spectrumHue" class="ag-spectrum-hue ag-spectrum-tool">\n                    <div class="ag-spectrum-hue-background"></div>\n                    <div ref="spectrumHueSlider" class="ag-spectrum-slider"></div>\n                </div>\n                <div ref="spectrumAlpha" class="ag-spectrum-alpha ag-spectrum-tool">\n                    <div class="ag-spectrum-alpha-background"></div>\n                    <div ref="spectrumAlphaSlider" class="ag-spectrum-slider"></div>\n                </div>\n                <div ref="recentColors" class="ag-recent-colors"></div>\n            </div>\n        </div>',Uy([(0,r.PIB)("spectrumColor")],xC.prototype,"spectrumColor",2),Uy([(0,r.PIB)("spectrumVal")],xC.prototype,"spectrumVal",2),Uy([(0,r.PIB)("spectrumDragger")],xC.prototype,"spectrumDragger",2),Uy([(0,r.PIB)("spectrumHue")],xC.prototype,"spectrumHue",2),Uy([(0,r.PIB)("spectrumHueSlider")],xC.prototype,"spectrumHueSlider",2),Uy([(0,r.PIB)("spectrumAlpha")],xC.prototype,"spectrumAlpha",2),Uy([(0,r.PIB)("spectrumAlphaSlider")],xC.prototype,"spectrumAlphaSlider",2),Uy([(0,r.PIB)("recentColors")],xC.prototype,"recentColors",2),Uy([r.o7C],xC.prototype,"postConstruct",1);var EC=xC,MC=class extends r.HHt{constructor(e){super(By({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"colorPicker"},e))}postConstruct(){super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){const e=this.getGui().getBoundingClientRect();return this.createBean(new r.fNJ({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-190,y:e.top-250}))}renderAndPositionPicker(){const e=this.pickerComponent,t=this.createBean(new EC({picker:this}));return e.addCssClass("ag-color-dialog"),t.addDestroyFunc(()=>{e.isAlive()&&this.destroyBean(e)}),e.setParentComponent(this),e.setBodyComponent(t),t.setValue(this.getValue()),t.getGui().focus(),e.addDestroyFunc(()=>{this.isDestroyingPicker?this.isDestroyingPicker=!1:(this.beforeHidePicker(),this.isDestroyingPicker=!0,t.isAlive()&&this.destroyBean(t),this.isAlive()&&this.getFocusableElement().focus())}),()=>{var e;return null==(e=this.pickerComponent)?void 0:e.close()}}setValue(e){return this.value===e?this:(this.eDisplayField.style.backgroundColor=e,super.setValue(e))}getValue(){return this.value}},AC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{calloutGroup:t,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}};AC.TEMPLATE='<div>\n            <ag-group-component ref="calloutGroup">\n                <ag-slider ref="calloutLengthSlider"></ag-slider>\n                <ag-slider ref="calloutStrokeWidthSlider"></ag-slider>\n                <ag-slider ref="labelOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],AC.prototype,"chartTranslationService",2),Uy([r.o7C],AC.prototype,"init",1);var TC=AC,DC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},i=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);i.step=.05,this.setTemplate(e.TEMPLATE,{capsGroup:t,capLengthRatioSlider:i})}};DC.TEMPLATE='<div>\n            <ag-group-component ref="capsGroup">\n                <ag-slider ref="capLengthRatioSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],DC.prototype,"chartTranslationService",2),Uy([r.o7C],DC.prototype,"init",1);var IC=DC,RC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{lineGroup:t,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",.05)})}getSliderParams(e,t,i,s=1,r=!1){const n=this.chartMenuUtils.getDefaultSliderParams(i,e,t,r);return n.step=s,n}};RC.TEMPLATE='<div>\n            <ag-group-component ref="lineGroup">\n                <ag-color-picker ref="lineColorPicker"></ag-color-picker>\n                <ag-slider ref="lineStrokeWidthSlider"></ag-slider>\n                <ag-slider ref="lineOpacitySlider"></ag-slider>\n                <ag-slider ref="lineDashSlider"></ag-slider>                \n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],RC.prototype,"chartTranslationService",2),Uy([r.o7C],RC.prototype,"init",1);var PC=RC,kC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{whiskersGroup:t,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}};kC.TEMPLATE='<div>\n            <ag-group-component ref="whiskersGroup">\n                <ag-color-picker ref="whiskerColorPicker"></ag-color-picker>\n                <ag-slider ref="whiskerThicknessSlider"></ag-slider>\n                <ag-slider ref="whiskerOpacitySlider"></ag-slider>\n                <ag-slider ref="whiskerLineDashSlider"></ag-slider>\n                <ag-slider ref="whiskerLineDashOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],kC.prototype,"chartTranslationService",2),Uy([r.o7C],kC.prototype,"init",1);var LC=kC,NC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e,this.activePanels=[]}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{seriesItemsGroup:t,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){const e=[{value:"positive",text:this.chartTranslationService.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslationService.translate("seriesItemNegative")}];return{label:this.chartTranslationService.translate("seriesItemType"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:e,value:"positive",onValueChange:e=>{this.destroyActivePanels(),this.initSeriesControls(e)}}}initSeriesControls(e="positive"){this.initSlider("strokeWidth",10,`item.${e}.strokeWidth`),this.initSlider("lineDash",30,`item.${e}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${e}.strokeOpacity`,.05,!1),this.initSlider("fillOpacity",1,`item.${e}.fillOpacity`,.05,!1),this.initItemLabels(e)}initSlider(e,t,i,s=1,n=!1){const o=this.chartMenuUtils.getDefaultSliderParams(i,e,t,n);o.step=s;const a=this.seriesItemsGroup.createManagedBean(new r.YD7(o));this.seriesItemsGroup.addItem(a),this.activePanels.push(a)}initItemLabels(e){const t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,"seriesItemLabels"),i=this.createBean(new Zv(t));this.seriesItemsGroup.addItem(i),this.activePanels.push(i)}destroyActivePanels(){this.activePanels.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};NC.TEMPLATE='<div>\n            <ag-group-component ref="seriesItemsGroup">\n                <ag-select ref="seriesItemSelect"></ag-select>\n            </ag-group-component>\n        </div>',Uy([(0,r.PIB)("seriesItemsGroup")],NC.prototype,"seriesItemsGroup",2),Uy([(0,r.dsm)("chartTranslationService")],NC.prototype,"chartTranslationService",2),Uy([r.o7C],NC.prototype,"init",1);var _C=NC,OC=class e extends r.uAl{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{groupSpacing:Vy(By({},t),{title:this.chartTranslationService.translate("group")}),tileSpacing:Vy(By({},t),{title:this.chartTranslationService.translate("tile")}),groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};OC.TEMPLATE='<div>\n            <ag-group-component ref="groupSpacing">\n                <ag-slider ref="groupPaddingSlider"></ag-slider>\n                <ag-slider ref="groupSpacingSlider"></ag-slider>\n            </ag-group-component>\n            <ag-group-component ref="tileSpacing">\n                <ag-slider ref="tilePaddingSlider"></ag-slider>\n                <ag-slider ref="tileSpacingSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],OC.prototype,"chartTranslationService",2),Uy([r.o7C],OC.prototype,"init",1);var FC=OC,GC=class e extends r.uAl{constructor({chartController:e,chartOptionsService:t,seriesType:i,isExpandedOnInit:s=!1}){super(),this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth("lineWidth"),strokeWidth:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),lineDash:()=>this.initLineDash(),lineOpacity:()=>this.initLineOpacity(),fillOpacity:()=>this.initFillOpacity(),markers:()=>this.initMarkers(),labels:()=>this.initLabels(),shadow:()=>this.initShadow(),tooltips:()=>this.initTooltips(),bins:()=>this.initBins(),whiskers:()=>this.initWhiskers(),caps:()=>this.initCaps(),connectorLine:()=>this.initConnectorLine(),seriesItems:()=>this.initSeriesItemsPanel(),tileSpacing:()=>this.initTileSpacingPanel(),groupType:()=>this.initGroupType()},this.seriesWidgetMappings={bar:["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","shadow"],pie:["tooltips","strokeWidth","lineOpacity","fillOpacity","labels","shadow"],donut:["tooltips","strokeWidth","lineOpacity","fillOpacity","labels","shadow"],line:["tooltips","lineWidth","lineDash","lineOpacity","markers","labels"],scatter:["tooltips","markers","labels"],bubble:["tooltips","markers","labels"],area:["tooltips","lineWidth","lineDash","lineOpacity","fillOpacity","markers","labels","shadow"],histogram:["tooltips","bins","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","shadow"],"radial-column":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"radial-bar":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"radar-line":["tooltips","strokeWidth","lineDash","lineOpacity","markers","labels"],"radar-area":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","markers","labels"],nightingale:["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"box-plot":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","whiskers","caps"],"range-bar":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels"],"range-area":["tooltips","lineWidth","lineDash","lineOpacity","fillOpacity","markers","labels","shadow"],treemap:["tooltips","tileSpacing"],sunburst:["tooltips"],heatmap:["tooltips","labels","lineColor","lineWidth","lineOpacity"],waterfall:["tooltips","connectorLine","seriesItems"]},this.chartController=e,this.chartOptionsService=t,this.seriesType=i||this.chartController.getChartSeriesType(),this.isExpandedOnInit=s}init(){const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{seriesGroup:t}),this.chartMenuUtils=this.createManagedBean(new oC(this.chartOptionsService.getSeriesOptionsProxy(()=>this.seriesType))),this.chartOptions=this.chartMenuUtils.getChartOptions(),this.addManagedListener(this.chartController,Lv.EVENT_CHART_SERIES_CHART_TYPE_CHANGED,this.refreshWidgets.bind(this)),this.refreshWidgets()}refreshWidgets(){this.destroyActivePanels(),this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>{var e;!this.isAlive()||(this.chartController.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect()),(null!=(e=this.seriesWidgetMappings[this.seriesType])?e:[]).forEach(e=>this.widgetFuncs[e]()))}).catch(e=>console.error("AG Grid - chart rendering failed",e))}initSeriesSelect(){const e=this.seriesGroup.createManagedBean(new r.Ju4({label:this.translate("seriesType"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:this.getSeriesSelectOptions(),value:`${this.seriesType}`,onValueChange:e=>{this.seriesType=e,this.refreshWidgets()}}));this.seriesGroup.addItem(e),this.activePanels.push(e)}initTooltips(){const e=this.createBean(new r.bLJ(this.chartMenuUtils.addValueParams("tooltip.enabled",{label:this.translate("tooltips"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex"})));this.addWidget(e)}initLineColor(){const e=this.createBean(new MC(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor")));this.addWidget(e)}initStrokeWidth(e){const t=this.createBean(new r.YD7(this.chartMenuUtils.getDefaultSliderParams("strokeWidth",e,10)));this.addWidget(t)}initLineDash(){const e=this.createBean(new r.YD7(this.chartMenuUtils.getDefaultSliderParams("lineDash","lineDash",30,!0)));this.addWidget(e)}initLineOpacity(){const e=this.chartMenuUtils.getDefaultSliderParams("strokeOpacity","strokeOpacity",1);e.step=.05;const t=this.createBean(new r.YD7(e));this.addWidget(t)}initFillOpacity(){const e=this.chartMenuUtils.getDefaultSliderParams("fillOpacity","fillOpacity",1);e.step=.05;const t=this.createBean(new r.YD7(e));this.addWidget(t)}initLabels(){const e=nv(this.seriesType),t=e?"calloutLabel":"label",i=e?"calloutLabels":"labels",s=this.chartMenuUtils.getDefaultFontPanelParams(t,i),n=this.createBean(new Zv(s));if(e){const e=this.createBean(new TC(this.chartMenuUtils));n.addCompToPanel(e),this.activePanels.push(e)}if(this.addWidget(n),e){const e=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels"),t=this.createBean(new Zv(e)),i=this.getSectorLabelPositionRatio();t.addCompToPanel(i),this.addWidget(t)}if("range-bar"===this.seriesType){const e=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],t=n.createManagedBean(new r.Ju4(this.chartMenuUtils.addValueParams("label.placement",{label:this.translate("labelPlacement"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:e})));n.addCompToPanel(t),this.activePanels.push(t);const i=n.createManagedBean(new r.YD7(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));n.addCompToPanel(i),this.activePanels.push(i)}}getSectorLabelPositionRatio(){const e=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);return e.step=.05,this.createBean(new r.YD7(e))}initShadow(){const e=this.createBean(new bC(this.chartMenuUtils));this.addWidget(e)}initMarkers(){const e=this.createBean(new wC(this.chartOptionsService,this.chartMenuUtils));this.addWidget(e)}initBins(){var e;const t=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),i=(null!=(e=this.chartOptions.getValue("bins"))?e:this.chartOptions.getValue("calculatedBins",!0)).length;t.value=`${i}`,t.maxValue=Math.max(i,20);const s=this.createBean(new r.YD7(t));this.addWidget(s)}initWhiskers(){const e=this.createBean(new LC(this.chartMenuUtils));this.addWidget(e)}initCaps(){const e=this.createBean(new IC(this.chartMenuUtils));this.addWidget(e)}initConnectorLine(){const e=this.createBean(new PC(this.chartMenuUtils));this.addWidget(e)}initSeriesItemsPanel(){const e=this.createBean(new _C(this.chartMenuUtils));this.addWidget(e)}initTileSpacingPanel(){const e=this.createBean(new FC(this.chartMenuUtils));this.addWidget(e)}initGroupType(){const e=this.createBean(new r.Ju4({label:this.chartTranslationService.translate("seriesGroupType"),options:r.E1g.SERIES_GROUP_TYPES.map(e=>({value:e,text:this.chartTranslationService.translate(`${e}SeriesGroupType`)})),value:this.chartController.getSeriesGroupType(),onValueChange:e=>this.chartController.setSeriesGroupType(e)}));this.addWidget(e)}addWidget(e){this.seriesGroup.addItem(e),this.activePanels.push(e)}getSeriesSelectOptions(){const e=this.getActiveSeriesTypes();return["area","bar","line"].filter(t=>e.includes(t)).map(e=>({value:e,text:this.translate(e)}))}updateSeriesType(){const e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.chartController.getActiveSeriesChartTypes().map(e=>rv(e.chartType))}translate(e){return this.chartTranslationService.translate(e)}destroyActivePanels(){this.activePanels.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};GC.TEMPLATE='<div>\n            <ag-group-component ref="seriesGroup">\n            </ag-group-component>\n        </div>',Uy([(0,r.PIB)("seriesGroup")],GC.prototype,"seriesGroup",2),Uy([(0,r.dsm)("chartTranslationService")],GC.prototype,"chartTranslationService",2),Uy([r.o7C],GC.prototype,"init",1);var BC=GC,VC=class e extends r.uAl{constructor({chartMenuParamsFactory:e,isExpandedOnInit:t=!1}){super(),this.chartMenuUtils=e,this.isExpandedOnInit=t}init(){const t=this.chartMenuUtils.addEnableParams("gradientLegend.enabled",{cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("legend"),suppressEnabledCheckbox:!1,suppressToggleExpandOnEnableChange:!0,expanded:this.isExpandedOnInit,items:[this.createLabelPanel()]});this.setTemplate(e.TEMPLATE,{legendGroup:t,legendPositionSelect:this.chartMenuUtils.getDefaultLegendParams("gradientLegend.position"),gradientReverseCheckbox:this.getGradientReverseCheckboxParams(),gradientThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.gradient.thickness","thickness",40),gradientPreferredLengthSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.gradient.preferredLength","preferredLength",300),legendSpacingSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.spacing","spacing",200)})}getGradientReverseCheckboxParams(){return this.chartMenuUtils.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslationService.translate("reverseDirection"),labelWidth:"flex"})}createLabelPanel(){const e={enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`gradientLegend.scale.label.${e}`};return this.createManagedBean(new Zv(e))}};VC.TEMPLATE='<div>\n            <ag-group-component ref="legendGroup">\n                <ag-select ref="legendPositionSelect"></ag-select>\n                <ag-checkbox ref="gradientReverseCheckbox"></ag-checkbox>\n                <ag-slider ref="gradientThicknessSlider"></ag-slider>\n                <ag-slider ref="gradientPreferredLengthSlider"></ag-slider>\n                <ag-slider ref="legendSpacingSlider"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],VC.prototype,"chartTranslationService",2),Uy([r.o7C],VC.prototype,"init",1);var HC=VC,UC=class extends r.XQb{constructor(e,t,i,s){super(),this.chartController=e,this.eGui=t,this.cssClass=i,this.createPanels=s,this.panels=[]}postConstruct(){this.addManagedListener(this.chartController,Lv.EVENT_CHART_UPDATED,()=>this.refreshPanels(!0)),this.addManagedListener(this.chartController,Lv.EVENT_CHART_API_UPDATE,()=>this.refreshPanels(!1))}addComponent(e){this.createBean(e),this.panels.push(e),e.addCssClass(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){const t=this.chartController.getChartType(),i=this.chartController.isGrouping(),s=rv(t);e&&t===this.chartType&&i===this.isGrouping||(this.destroyPanels(),this.createPanels(t,s),this.chartType=t,this.isGrouping=i)}destroyPanels(){this.panels.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)}),this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}};Uy([r.o7C],UC.prototype,"postConstruct",1);var zC={groups:[{type:"chart"},{type:"legend"},{type:"series"},{type:"axis"}]},WC=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}init(){this.chartPanelFeature=this.createManagedBean(new UC(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){var i;null==(i=this.getFormatPanelDef().groups)||i.forEach(i=>{const s=i.type;if(!this.isGroupPanelShownInSeries(s,t))return;const n=Vy(By({},this.chartMenuContext),{isExpandedOnInit:i.isOpen,seriesType:t});switch(s){case"chart":this.chartPanelFeature.addComponent(new vC(n));break;case"legend":const s=["treemap","sunburst","heatmap"].includes(e)?new HC(n):new Jv(n);this.chartPanelFeature.addComponent(s);break;case"axis":ev(t)?this.chartPanelFeature.addComponent(new hC(n)):Jy(t)&&(this.chartPanelFeature.addComponent(new lC("xAxis",n)),this.chartPanelFeature.addComponent(new lC("yAxis",n)));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new lC("xAxis",n));break;case"verticalAxis":this.chartPanelFeature.addComponent(new lC("yAxis",n));break;case"series":this.chartPanelFeature.addComponent(new BC(n));break;case"navigator":r._.warnOnce("'navigator' is now displayed in the charts advanced settings instead of the format panel, and this setting will be ignored.");default:r._.warnOnce(`Invalid charts format panel group name supplied: '${i.type}'`)}})}getFormatPanelDef(){var e;return(null==(e=this.gos.get("chartToolPanelsDef"))?void 0:e.formatPanel)||zC}isGroupPanelShownInSeries(e,t){return["chart","legend","series"].includes(e)||Jy(t)&&["axis","horizontalAxis","verticalAxis"].includes(e)||ev(t)&&"axis"===e}};WC.TEMPLATE='<div class="ag-chart-format-wrapper"></div>',Uy([r.o7C],WC.prototype,"init",1);var jC=WC,KC=class extends r.uAl{constructor(e,t){super(),this.tooltipName=t,this.size=58,this.padding=5,this.root=new Pm.Group;const i=new Pm.Scene({width:this.size,height:this.size});i.canvas.element.classList.add("ag-chart-mini-thumbnail-canvas"),i.setRoot(this.root),i.setContainer(e),this.scene=i}init(){this.scene.canvas.element.title=this.chartTranslationService.translate(this.tooltipName),this.scene.render().catch(e=>{console.error("AG Grid - chart update failed",e)})}};Uy([(0,r.dsm)("chartTranslationService")],KC.prototype,"chartTranslationService",2),Uy([r.o7C],KC.prototype,"init",1);var $C=class extends KC{constructor(e,t){super(e,t),this.stroke="gray",this.axisOvershoot=3}addAxes(){const e=this.size,t=this.padding,i=new Pm.Line;i.x1=t,i.y1=t,i.x2=t,i.y2=e-t+this.axisOvershoot,i.stroke=this.stroke;const s=new Pm.Line;s.x1=t-this.axisOvershoot+1,s.y1=e-t,s.x2=e-t+1,s.y2=e-t,s.stroke=this.stroke;const r=this.root;r.append(i),r.append(s)}};function YC(e){const{stacked:t,size:i,padding:s,xScalePadding:r,xScaleDomain:n,yScaleDomain:o}=e,a=new Pm.BandScale;a.domain=n,a.range=[s,i-s],a.paddingInner=r,a.paddingOuter=r;const l=new Pm.LinearScale;l.domain=o,l.range=[i-s,s];const c=(e,t,i)=>e.map((e,s)=>{const r=i.convert(e),n=new Pm.Rect;return n.x=t.convert(s),n.y=r,n.width=t.bandwidth,n.height=i.convert(0)-r,n.strokeWidth=0,n.crisp=!0,n});return t?e.data.map(e=>c(e,a,l)):c(e.data,a,l)}function qC(e,t,i,s){const r=new Pm.LinearScale;r.domain=[0,4],r.range=[s,i-s];const n=new Pm.LinearScale;n.domain=[0,10],n.range=[i-s,s];const o=t.map(e=>{const t=new Pm.Path;return t.strokeWidth=3,t.lineCap="round",t.fill=void 0,e.forEach((e,i)=>{t.path[i>0?"lineTo":"moveTo"](r.convert(i),n.convert(e))}),t}),a=new Pm.Group;return a.setClipRectInGroupCoordinateSpace(new Pm.BBox(s,s,i-2*s,i-2*s)),a.append(o),e.append(a),o}function XC(e,t,i,s,r,n=0){const o=new Pm.LinearScale;o.domain=[0,7],o.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const a=new Pm.LinearScale;a.domain=[0,10],a.range=[s,r];const l=[],c=t.map(e=>{const t=new Pm.Path;return t.strokeWidth=1,t.strokeOpacity=.5,t.lineCap="round",t.fill=void 0,t.fillOpacity=.8,e.forEach((e,i)=>{const c=o.convert(i),h=s+r-a.convert(e),d=h*Math.cos(c),u=h*Math.sin(c);if(t.path[i>0?"lineTo":"moveTo"](d,u),n>0){const e=new Pm.Circle;e.x=d,e.y=u,e.size=n,l.push(e)}}),t.path.closePath(),t}),h=new Pm.Group,d=i/2;return h.translationX=d,h.translationY=d,h.append([...c,...l]),e.append(h),{paths:c,markers:l}}function ZC(e){let[t,i]=[1/0,-1/0];return{processedData:e.reduce((e,s,r)=>{const n=r>0?e[r-1]:void 0;null!=e[r]||(e[r]=[]);const o=e[r];return s.forEach((e,s)=>{n&&(e+=n[s]),o[s]=e,o[s]<t&&(t=o[s]),o[s]>i&&(i=o[s])}),e},[]),min:t,max:i}}Uy([r.o7C],$C.prototype,"addAxes",1);var QC=class extends $C{constructor(e,t,i){super(e,"groupedColumnTooltip"),this.columnData=[2,3,4];const{root:s,columnData:r,size:n,padding:o}=this;this.columns=YC({stacked:!1,root:s,data:r,size:n,padding:o,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3}),s.append(this.columns),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};QC.chartType="groupedColumn";var JC=class e extends $C{constructor(t,i,s,r,n,o=e.data,a=[0,16],l="stackedColumnTooltip"){super(t,l);const{root:c,size:h,padding:d}=this;this.stackedColumns=YC({stacked:!0,root:c,data:o,size:h,padding:d,xScaleDomain:[0,1,2],yScaleDomain:a,xScalePadding:.3}),c.append([].concat.apply([],this.stackedColumns)),this.updateColors(i,s)}updateColors(e,t){this.stackedColumns.forEach((i,s)=>i.forEach(i=>{i.fill=e[s],i.stroke=t[s]}))}};JC.chartType="stackedColumn",JC.data=[[8,12,16],[6,9,12],[2,3,4]];var eb=JC,tb=class e extends eb{constructor(t,i,s,r,n){super(t,i,s,r,n,e.data,[0,10],"normalizedColumnTooltip")}};tb.chartType="normalizedColumn",tb.data=[[10,10,10],[6,7,8],[2,4,6]];var ib=tb,sb=class extends $C{constructor(e,t,i){super(e,"groupedBarTooltip");const s=this.padding,r=this.size,n=new Pm.BandScale;n.domain=[0,1,2],n.range=[s,r-s],n.paddingInner=.3,n.paddingOuter=.3;const o=new Pm.LinearScale;o.domain=[0,4],o.range=[r-s,s];const a=o.convert(0),l=n.bandwidth;this.bars=[2,3,4].map((e,t)=>{const i=new Pm.Rect;return i.x=s,i.y=n.convert(t),i.width=a-o.convert(e),i.height=l,i.strokeWidth=0,i.crisp=!0,i}),this.updateColors(t,i),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};sb.chartType="groupedBar";var rb=class e extends $C{constructor(t,i,s,r,n,o=e.data,a=[0,16],l="stackedBarTooltip"){super(t,l);const c=this.size,h=this.padding,d=new Pm.BandScale;d.domain=[0,1,2],d.range=[h,c-h],d.paddingInner=.3,d.paddingOuter=.3;const u=new Pm.LinearScale;u.domain=a,u.range=[c-h,h];const p=u.convert(0),g=d.bandwidth;this.bars=o.map(e=>e.map((e,t)=>{const i=new Pm.Rect;return i.x=h,i.y=d.convert(t),i.width=p-u.convert(e),i.height=g,i.strokeWidth=0,i.crisp=!0,i})),this.updateColors(i,s),this.root.append([].concat.apply([],this.bars))}updateColors(e,t){this.bars.forEach((i,s)=>i.forEach(i=>{i.fill=e[s],i.stroke=t[s]}))}};rb.chartType="stackedBar",rb.data=[[8,12,16],[6,9,12],[2,3,4]];var nb=rb,ob=class e extends nb{constructor(t,i,s,r,n){super(t,i,s,r,n,e.data,[0,10],"normalizedBarTooltip")}};ob.chartType="normalizedBar",ob.data=[[10,10,10],[6,7,8],[2,4,6]];var ab=ob,lb=Pm.toRadians,cb=class extends KC{constructor(e,t,i,s,r,n=.6,o="donutTooltip"){super(e,o);const a=(this.size-2*this.padding)/2,l=a+this.padding,c=[[lb(-90),lb(30)],[lb(30),lb(120)],[lb(120),lb(180)],[lb(180),lb(210)],[lb(210),lb(240)],[lb(240),lb(270)]];this.sectors=c.map(([e,t])=>{const i=new Pm.Sector;return i.centerX=l,i.centerY=l,i.innerRadius=a*n,i.outerRadius=a,i.startAngle=e,i.endAngle=t,i.stroke=void 0,i.strokeWidth=0,i.inset=.75,i}),this.updateColors(t,i),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((i,s)=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})}};cb.chartType="donut";var hb=class extends cb{constructor(e,t,i,s,r){super(e,t,i,s,r,0,"pieTooltip")}};hb.chartType="pie";var db=class extends $C{constructor(e,t,i){super(e,"lineTooltip"),this.data=[[9,7,8,5,6],[5,6,3,4,1],[1,3,4,8,7]],this.lines=qC(this.root,this.data,this.size,this.padding),this.updateColors(t,i)}updateColors(e,t){this.lines.forEach((t,i)=>{t.stroke=e[i]})}};db.chartType="line";var ub=class extends $C{constructor(e,t,i){super(e,"scatterTooltip");const s=this.size,r=this.padding,n=new Pm.LinearScale;n.domain=[-.5,4],n.range=[2*r,s-r];const o=new Pm.LinearScale;o.domain=[-.5,3.5],o.range=[s-r,r];const a=[];[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]].forEach(e=>{e.forEach(([e,t])=>{const i=new Pm.Arc;i.strokeWidth=0,i.centerX=n.convert(e),i.centerY=o.convert(t),i.radius=2.5,a.push(i)})}),this.points=a,this.updateColors(t,i);const l=new Pm.Group;l.setClipRectInGroupCoordinateSpace(new Pm.BBox(r,r,s-2*r,s-2*r)),l.append(this.points),this.root.append(l)}updateColors(e,t){this.points.forEach((i,s)=>{i.stroke=t[s%t.length],i.fill=e[s%e.length]})}};ub.chartType="scatter";var pb=class extends $C{constructor(e,t,i){super(e,"bubbleTooltip");const s=this.size,r=this.padding,n=new Pm.LinearScale;n.domain=[0,1],n.range=[2*r,s-r];const o=new Pm.LinearScale;o.domain=[0,1],o.range=[s-r,r];const a=[];[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]].forEach(e=>{e.forEach(([e,t,i])=>{const s=new Pm.Arc;s.strokeWidth=0,s.centerX=n.convert(e),s.centerY=o.convert(t),s.radius=i,s.fillOpacity=.7,a.push(s)})}),this.points=a,this.updateColors(t,i);const l=new Pm.Group;l.setClipRectInGroupCoordinateSpace(new Pm.BBox(r,r,s-2*r,s-2*r)),l.append(this.points),this.root.append(l)}updateColors(e,t){this.points.forEach((i,s)=>{i.stroke=t[s%t.length],i.fill=e[s%e.length]})}};pb.chartType="bubble";var gb=class e extends $C{constructor(t,i,s,r,n,o=e.data){super(t,"groupedAreaTooltip");const a=this.size,l=this.padding,c=new Pm.BandScale;c.domain=[0,1,2],c.paddingInner=1,c.paddingOuter=0,c.range=[l+.5,a-l-.5];const h=new Pm.LinearScale;h.domain=[0,6],h.range=[a-l+.5,l];const d=2*o.length-1,u=[],p=h.convert(0);o.forEach((e,t)=>{const i=c.convert(t);e.forEach((e,s)=>{const r=h.convert(e),n=u[s]||(u[s]=[]);n[t]={x:i,y:r},n[d-t]={x:i,y:p}})}),this.areas=u.reverse().map(e=>{const t=new Pm.Path;t.strokeWidth=1,t.strokeOpacity=.75,t.fillOpacity=.7;const i=t.path;return i.clear(),e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),i.closePath(),t}),this.updateColors(i,s),this.root.append(this.areas)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};gb.chartType="area",gb.data=[[1,3,5],[2,6,4],[5,3,1]];var mb=gb,fb=class e extends $C{constructor(t,i,s,r,n,o=e.data,a="stackedAreaTooltip"){super(t,a);const l=this.size,c=this.padding,h=new Pm.BandScale;h.domain=[0,1,2],h.paddingInner=1,h.paddingOuter=0,h.range=[c+.5,l-c-.5];const d=new Pm.LinearScale;d.domain=[0,16],d.range=[l-c+.5,c+.5];const u=2*o.length-1,p=[];o.forEach((e,t)=>{const i=h.convert(t);let s=0;e.forEach((e,r)=>{const n=d.convert(s+e),o=p[r]||(p[r]=[]);o[t]={x:i,y:n},o[u-t]={x:i,y:d.convert(s)},s+=e})}),this.areas=p.map(e=>{const t=new Pm.Path;t.strokeWidth=0;const i=t.path;return i.clear(),e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),i.closePath(),t}),this.updateColors(i,s),this.root.append(this.areas)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};fb.chartType="stackedArea",fb.data=[[2,3,2],[3,6,5],[6,2,2]];var yb=fb,vb=class e extends yb{constructor(t,i,s,r,n,o=e.data){super(t,i,s,r,n,o,"normalizedAreaTooltip")}};vb.chartType="normalizedArea",vb.data=yb.data.map(e=>{const t=e.reduce((e,t)=>e+t,0);return e.map(e=>e/t*16)});var Cb=vb,bb=class extends $C{constructor(e,t,i){super(e,"histogramTooltip");const s=this.padding,r=this.size,n=[2,5,11,13,10,6,1],o=new Pm.LinearScale;o.domain=[0,n.length],o.range=[s,r-s];const a=new Pm.LinearScale;a.domain=[0,n.reduce((e,t)=>Math.max(e,t),0)],a.range=[r-s,s];const l=a.convert(0);this.bars=n.map((e,t)=>{const i=a.convert(e),s=o.convert(t),r=o.convert(t+1),n=new Pm.Rect;return n.x=s,n.y=i,n.width=r-s,n.height=l-i,n.strokeWidth=1,n.strokeOpacity=.75,n.crisp=!0,n}),this.updateColors(t,i),this.root.append(this.bars)}updateColors([e],[t]){this.bars.forEach(i=>{i.fill=e,i.stroke=t})}};bb.chartType="histogram";var Sb=class extends KC{constructor(e,t){super(e,t),this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}addAxes(){const e=this.size,t=this.padding,i=(e-2*t)/2,s=this.showAngleAxisLines?[i,.8*i,.6*i,.4*i]:[],r=new Pm.Line;r.x1=e/2,r.y1=t,r.x2=e/2,r.y2=e-t-i-s[s.length-1],r.stroke=this.stroke,r.strokeOpacity=.5,r.fill=void 0,r.visible=this.showRadiusAxisLine;const n=t+i;this.gridLines=s.map((e,t)=>{const i=new Pm.Path;return i.path.arc(n,n,e,0,2*Math.PI),i.strokeWidth=1,i.stroke=this.stroke,i.strokeOpacity=0===t?.5:.2,i.fill=void 0,i});const o=this.root;o.append(r),this.gridLines.length>0&&o.append(this.gridLines)}};Uy([r.o7C],Sb.prototype,"addAxes",1);var wb=class extends Sb{constructor(e,t,i){super(e,"radialColumnTooltip"),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;const{padding:s,size:r,data:n}=this,o=(r-2*s)/2,a=.4*o,l=new Pm.BandScale;l.domain=n[0].map((e,t)=>t),l.range=[0,2*Math.PI],l.paddingInner=0,l.paddingOuter=0;const c=.7*l.bandwidth,{processedData:h,max:d}=ZC(n),u=new Pm.LinearScale;u.domain=[0,d],u.range=[a,o];const p=this.size/2;this.series=h.map((e,t)=>{const i=0===t?void 0:h[t-1],s=new Pm.Group({zIndex:1e6}),r=e.map((e,t)=>{const s=null==i?void 0:i[t],r=u.convert(e),n=u.convert(null!=s?s:0),h=l.convert(t),d=h+c,g=Pm.getRadialColumnWidth(h,d,o,.5,.5),m=new Pm.RadialColumnShape;return m.scalingCenterX=p,m.scalingCenterY=p,m.columnWidth=g,m.innerRadius=n,m.outerRadius=r,m.startAngle=h,m.endAngle=d,m.isBeveled=!0,m.axisInnerRadius=a,m.axisOuterRadius=o,m.stroke=void 0,m.strokeWidth=0,m});return s.append(r),s.translationX=p,s.translationY=p,s}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};wb.chartType="radialColumn";var xb=class extends Sb{constructor(e,t,i){super(e,"radialBarTooltip"),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;const s=(this.size-this.padding)/2,r=.4*s,n=s+r,o=new Pm.BandScale;o.domain=this.data[0].map((e,t)=>t),o.range=[s,r],o.paddingInner=.5,o.paddingOuter=0;const a=o.bandwidth,{processedData:l,max:c}=ZC(this.data),h=new Pm.LinearScale;h.domain=[0,Math.ceil(1.5*c)];const d=1.5*Math.PI,u=d+2*Math.PI;h.range=[d,u];const p=this.size/2;this.series=l.map((e,t)=>{const i=t<0?void 0:l[t-1],s=new Pm.Group({zIndex:1e6}),r=e.map((e,t)=>{var s;const r=null!=(s=null==i?void 0:i[t])?s:0,l=n-o.convert(t),c=l+a,d=h.convert(r),u=h.convert(e),g=new Pm.Sector;return g.centerX=p,g.centerY=p,g.innerRadius=l,g.outerRadius=c,g.startAngle=d,g.endAngle=u,g.stroke=void 0,g.strokeWidth=0,g});return s.append(r),s}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};xb.chartType="radialBar";var Eb=class extends Sb{constructor(e,t,i){super(e,"radarLineTooltip"),this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;const s=(this.size-2*this.padding)/2,{paths:r,markers:n}=XC(this.root,this.data,this.size,s,0,this.markerSize);this.lines=r,this.markers=n,this.updateColors(t,i)}updateColors(e,t){this.lines.forEach((i,s)=>{const r=this.data[s].length;i.stroke=e[s];const n=s*r,o=n+r;this.markers.slice(n,o).forEach(i=>{i.stroke=t[s],i.fill=e[s]})})}};Eb.chartType="radarLine";var Mb=class extends Sb{constructor(e,t,i){super(e,"radarAreaTooltip"),this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]],this.showRadiusAxisLine=!1;const s=(this.size-2*this.padding)/2,r=s-.3*this.size;this.areas=XC(this.root,this.data,this.size,s,r).paths,this.updateColors(t,i)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}};Mb.chartType="radarArea";var Ab=class extends Sb{constructor(e,t,i){super(e,"nightingaleTooltip"),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;const s=(this.size-2*this.padding)/2,r=new Pm.BandScale;r.domain=this.data[0].map((e,t)=>t),r.range=[-Math.PI,Math.PI],r.paddingInner=0,r.paddingOuter=0;const n=.7*r.bandwidth,{processedData:o,max:a}=ZC(this.data),l=new Pm.LinearScale;l.domain=[0,a],l.range=[0,s];const c=this.size/2;this.series=o.map((e,t)=>{const i=t<0?void 0:o[t-1],s=new Pm.Group({zIndex:1e6}),a=e.map((e,t)=>{const s=null==i?void 0:i[t],o=l.convert(e),a=l.convert(null!=s?s:0),h=r.convert(t),d=h+n,u=new Pm.Sector;return u.centerX=c,u.centerY=c,u.innerRadius=a,u.outerRadius=o,u.startAngle=h,u.endAngle=d,u.stroke=void 0,u.strokeWidth=0,u});return s.append(a),s}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};Ab.chartType="nightingale";var Tb=class extends $C{constructor(e,t,i){super(e,"rangeBarTooltip"),this.bars=this.createRangeBar(this.root,[3,3.5,3],this.size,this.padding,"vertical"),this.updateColors(t,i)}updateColors(e,t){this.bars.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]})}createRangeBar(e,t,i,s,r){const n="horizontal"===r,o=2*s,a=new Pm.BandScale;a.domain=t.map((e,t)=>t),a.range=[s,i-s],a.paddingInner=.3,a.paddingOuter=.3;const l=new Pm.LinearScale;l.domain=[.7*t.reduce((e,t)=>Math.min(e,t),1/0),1.3*t.reduce((e,t)=>Math.max(e,t),0)],l.range=[o,i-o];const c=a.bandwidth,h=t.map((e,t)=>{const[i,s]=[.7*e,1.3*e],r=a.convert(t),o=l.convert(i),h=l.convert(s)-o,d=new Pm.Rect;return d.x=n?o:r,d.y=n?r:o,d.width=n?h:c,d.height=n?c:h,d.strokeWidth=0,d.crisp=!0,d});return e.append(h),h}};Tb.chartType="rangeBar";var Db=class extends $C{constructor(e,t,i){super(e,"rangeAreaTooltip");const s=[Ib({offset:1.5,length:4,pattern:{low:3,high:5,period:4}}),Ib({offset:1.5,length:4,pattern:{low:2.25,high:4.25,period:4}}),Ib({offset:3,length:4,pattern:{low:2.5,high:4.5,period:4}})].map(e=>e.map(([e,t])=>({x:e,low:t-.875,high:t+.875}))),{lines:r,areas:n}=this.createRangeArea(this.root,s,this.size,this.padding);this.lines=r,this.areas=n,this.updateColors(t,i)}updateColors(e,t){e=Pb(e,1,2),t=Pb(t,1,2),this.lines.forEach(([e,i],s)=>{e.fill=void 0,e.stroke=t[s],i.fill=void 0,i.stroke=t[s]}),this.areas.forEach((t,i)=>{t.fill=e[i]})}createRangeArea(e,t,i,s){const r=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.min(e,t),e),1/0),n=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.max(e,t),e),-1/0),o=t.reduce((e,t)=>t.reduce((e,{low:t})=>Math.min(e,t),e),1/0),a=t.reduce((e,t)=>t.reduce((e,{high:t})=>Math.max(e,t),e),-1/0),l=new Pm.LinearScale;l.domain=[r,n],l.range=[s,i-s];const c=2*s,h=new Pm.LinearScale;h.domain=[o,a],h.range=[i-c,c];const d=[],u=[];return t.map(e=>{const t=new Pm.Path,i=new Pm.Path,s=new Pm.Path;return d.push([t,i]),u.push(s),t.strokeWidth=0,i.strokeWidth=0,s.strokeWidth=0,s.fillOpacity=.8,t.path.clear(),i.path.clear(),s.path.clear(),e.map((e,r)=>{const{x:n,low:o,high:a}=e,c=l.convert(n),d=h.convert(o),u=h.convert(a),p=r>0?"lineTo":"moveTo";return t.path[p](c,u),i.path[p](c,d),s.path[p](c,u),[c,d]})}).forEach((e,t)=>{const i=e.length-1,s=u[t];for(let t=i;t>=0;t--){const[i,r]=e[t];s.path.lineTo(i,r)}}),e.append(u.concat(...d)),{lines:d,areas:u}}};function Ib(e){const{offset:t,length:i,pattern:s}=e,r=function(e,t,i){const{period:s}=i,r=e/s,n=[0,.5].map(e=>e-r).map(Rb).sort((e,t)=>e-t);return Array.from({length:Math.floor(n.length*(s/t))},(e,t)=>n[t%n.length]+Math.floor(t/n.length)).map(e=>e*s).map(t=>o(t,e,i))}(t,i,s),n=i;return 0!==r.length&&0===r[0][0]||r.unshift(o(0,t,s)),r[r.length-1][0]!==n&&r.push(o(n,t,s)),r;function o(e,t,i){return[e,a(t+e,i)]}function a(e,t){const{low:i,high:s,period:r}=t,n=Rb(e/r);return i+(s-i)*(n>.5?1-2*(n-.5):2*n)}}function Rb(e){const t=e%1;return t<0?t+1:t}function Pb(e,t,i){const s=[...e],r=s[t];return s[t]=s[i],s[i]=r,s}Db.chartType="rangeArea";var kb=class extends $C{constructor(e,t,i,s,r){super(e,"boxPlotTooltip");const n=this.padding,o=this.size,a=[11,11.5,10.5],l=new Pm.LinearScale;l.domain=[.8*a.reduce((e,t)=>Math.min(e,t),1/0),1.2*a.reduce((e,t)=>Math.max(e,t),0)],l.range=[o-1.5*n,n];const c=new Pm.BandScale;c.domain=a.map((e,t)=>t),c.range=[n,o-n],c.paddingInner=.4,c.paddingOuter=.2;const h=Math.round(c.bandwidth),d=Math.round(c.bandwidth/2);this.boxPlotGroups=a.map((e,t)=>{let[i,s,r,n]=[.8*e,.9*e,1.1*e,1.2*e];const o=Math.round(l.convert(r)),a=Math.round(c.convert(t)),u=Math.round(a+h),p=Math.round(l.convert(s)),g=Math.round(l.convert(i)),m=Math.round(l.convert(e)),f=Math.round(l.convert(n)),y=a+d,v=new Pm.Group,C=new Pm.Rect,b=new Pm.Line,S=new Pm.Line,w=new Pm.Line,x=new Pm.Line,E=new Pm.Line;return C.x=a,C.y=o,C.width=h,C.height=p-o,C.strokeWidth=1,C.strokeOpacity=.75,C.crisp=!0,this.setLineProperties(b,a,u,m,m),this.setLineProperties(S,y,y,f,o),this.setLineProperties(w,y,y,g,p),this.setLineProperties(x,a,u,f,f),this.setLineProperties(E,a,u,g,g),v.append([C,b,S,w,x,E]),v}),this.updateColors(t,i,s,r),this.root.append(this.boxPlotGroups)}updateColors(e,t,i,s){var r;const n=null==i?void 0:i.properties.get(Bm.DEFAULT_BACKGROUND_COLOUR),o=null!=(r=Array.isArray(n)?n[0]:n)?r:"white";this.boxPlotGroups.forEach((i,r)=>{var n;null==(n=i.children)||n.forEach(i=>{const n=e[r%e.length];i.fill=s?n:Um.Color.interpolate(n,o)(.7),i.stroke=t[r%t.length]})})}setLineProperties(e,t,i,s,r){e.x1=t,e.x2=i,e.y1=s,e.y2=r,e.strokeOpacity=.75}};kb.chartType="boxPlot";var Lb=class extends KC{constructor(e,t,i,s,r){super(e,"treemapTooltip");const{size:n,padding:o}=this,a=[[1,1],[3,2,1]],l=a.length%2==0?.3:.2,c=[o,n-o],h=a.length,d=h*(h+1)/2,u=l/(h-1),p=c[1]-c[0],g=p-l;let m=c[0];this.rects=a.reduce((e,t,i)=>{null!=e||(e=[]);const s=g*((h-i)/d),r=t.length,n=t.reduce((e,t)=>e+t,0),o=l/(r-1||1),a=r>1?p-l:p;let f=c[0];const y=t.map(e=>{const t=new Pm.Rect,i=a*e/n;return t.x=m,t.y=f,t.width=s,t.height=i,t.strokeWidth=.75,t.crisp=!0,f+=i+o,t});return m+=s+u,e.push(...y),e},[]),this.updateColors(t,i,s,r);const f=new Pm.Group;f.setClipRectInGroupCoordinateSpace(new Pm.BBox(o,o,n-o,n-o)),f.append(this.rects),this.root.append(f)}updateColors(e,t,i,s){var r;const{properties:n}=null!=i?i:{},o=null==n?void 0:n.get(Bm.DEFAULT_BACKGROUND_COLOUR),a=null!=(r=Array.isArray(o)?o[0]:o)?r:"white";this.rects.forEach((i,r)=>{i.fill=e[r%t.length],i.stroke=s?t[r%t.length]:a})}};Lb.chartType="treemap";var Nb=class extends Sb{constructor(e,t,i){super(e,"sunburstTooltip"),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;const{data:s,size:r,padding:n,angleOffset:o,innerRadiusRatio:a}=this,l=(r-2*n)/2,c=[o+0,o+2*Math.PI],h=Math.abs(c[1]-c[0]),d=[l*a,l],u=Math.abs(d[1]-d[0]);let p=0;const g=(e,t)=>{e.forEach(e=>{const i=t+1;p=Math.max(p,i),g(e,i)})};g(s,0);const m=u/p,f=this.size/2,y=c[0];this.series=[];const v=(e,t,i,s,r)=>{if(!Array.isArray(e))return;const n=t+1;let o=i;e.forEach((e,i,a)=>{let l=r;l||(l=new Pm.Group,this.series.push(l));const c=d[0]+t*m,h=d[0]+n*m,u=1/a.length,p=o,g=p+s*u,y=new Pm.Sector;y.centerX=f,y.centerY=f,y.innerRadius=c,y.outerRadius=h,y.startAngle=p,y.endAngle=g,y.stroke=void 0,y.strokeWidth=0,y.inset=.75,o=g,l.append(y),v(e,n,p,Math.abs(g-p),l)})};v(s,0,y,h),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{i.fill=e[s%e.length],i.stroke=t[s%t.length]})})}};Nb.chartType="sunburst";var _b=class extends KC{constructor(e,t,i,s,r){var n,o;super(e,"heatmapTooltip");const{size:a,padding:l}=this,c=Array.from({length:3},(e,t)=>Array.from({length:3},(e,t)=>t)),h=c.map((e,t)=>t),d=new Pm.BandScale;d.domain=h,d.range=[l,a-l],d.paddingInner=.01,d.paddingOuter=.1;const u=new Pm.BandScale;u.domain=h,u.range=[l,a-l],u.paddingInner=.01,u.paddingOuter=.1;const p=null!=(n=d.bandwidth)?n:0,g=null!=(o=u.bandwidth)?o:0;this.rects=c.reduce((e,t,i)=>{null!=e||(e=[]);const s=t.map((e,t)=>{const s=new Pm.Rect;return s.x=d.convert(i),s.y=u.convert(t),s.width=p,s.height=g,s.strokeWidth=0,s.crisp=!0,s});return e.push(...s),e},[]),this.updateColors(t,i,s,r);const m=new Pm.Group;m.setClipRectInGroupCoordinateSpace(new Pm.BBox(l,l,a-l,a-l)),m.append(this.rects),this.root.append(m)}updateColors(e,t,i,s){var r;const{properties:n}=null!=i?i:{},o=null==n?void 0:n.get(Bm.DEFAULT_DIVERGING_SERIES_COLOUR_RANGE),a=null==n?void 0:n.get(Bm.DEFAULT_BACKGROUND_COLOUR),l=null!=(r=Array.isArray(a)?a[0]:a)?r:"white",c=s?[e[0],e[1]]:o,h=s?t[0]:l;this.rects.forEach((e,t)=>{e.fill=Um.Color.interpolate(c[0],c[1])(.2*t),e.stroke=h})}};_b.chartType="heatmap";var Ob=class extends $C{constructor(e,t,i,s,r){super(e,"waterfallTooltip"),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(t,i,s,r)}updateColors(e,t,i,s){var r,n;const{data:o}=this,{properties:a}=null!=i?i:{},l={fill:e[0],stroke:t[0]},c={fill:e[1],stroke:t[1]},h=s?l:null!=(r=null==a?void 0:a.get(Bm.DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS))?r:l,d=s?c:null!=(n=null==a?void 0:a.get(Bm.DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS))?n:c;this.bars.forEach((e,t)=>{const i=o[t]>=0;e.fill=i?h.fill:d.fill,e.stroke=i?h.stroke:d.stroke})}createWaterfall(e,t,i,s,r){const n=2*s,{processedData:o,min:a,max:l}=ZC(t.map(e=>[e])),c=o.reduce((e,t)=>e.concat(t),[]),h=new Pm.LinearScale;h.domain=[Math.min(a,0),l],h.range=[i-n,n];const d=new Pm.BandScale;d.domain=t.map((e,t)=>t),d.range=[s,i-s],d.paddingInner=.2,d.paddingOuter=.3;const u=d.bandwidth,p=new Pm.Path;p.stroke="#575757",p.strokeWidth=0;const g=Math.floor(p.strokeWidth)%2/2,m=p.path;m.clear();const f="horizontal"===r,y=c.map((e,i)=>{const s=i>0?c[i-1]:0,r=t[i]>0,n=Math.round(h.convert(e)),o=Math.round(h.convert(s)),a=(r?n:o)-g,l=(r?o:n)+g,p=Math.abs(l-a),y=d.convert(i),v=new Pm.Rect;v.x=f?a:y,v.y=f?y:a,v.width=f?p:u,v.height=f?u:p,v.strokeWidth=0,v.crisp=!0;const C=n+g,b=o+g;if(i>0){const e=f?b:v.x,t=f?v.y:b;m.lineTo(e,t)}const S=f?C:v.x,w=f?v.y:C;return m.moveTo(S,w),v});return e.append([p,...y]),{bars:y}}};Ob.chartType="waterfall";var Fb=class extends $C{constructor(e,t,i){super(e,"columnLineComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:s,columnData:r,lineData:n,size:o,padding:a}=this;this.columns=YC({stacked:!1,root:s,data:r,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5}),s.append(this.columns),this.lines=qC(s,n,o,a),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]}),this.lines.forEach((t,i)=>{t.stroke=e[i+2]})}};Fb.chartType="columnLineCombo";var Gb=class extends $C{constructor(e,t,i){super(e,"areaColumnComboTooltip"),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];const{root:s,columnData:r,areaData:n,size:o,padding:a}=this;this.columns=YC({stacked:!1,root:s,data:r,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5});const l=new Pm.BandScale;l.range=[a,o-a],l.domain=[0,1,2,3,4],l.paddingInner=1,l.paddingOuter=0;const c=new Pm.LinearScale;c.range=[o-a,a],c.domain=[0,6];const h=[],d=c.convert(0),u=l.convert(0);n.forEach((e,t)=>{const i=h[t]||(h[t]=[]);e.forEach((e,t)=>{const s=e,r=t,n=l.convert(r),o=c.convert(s);i[t]={x:n,y:o}});const s=l.convert(e.length-1);h[t].push({x:s,y:d},{x:u,y:d})}),this.areas=h.map(e=>{const t=new Pm.Path;t.strokeWidth=0,t.fillOpacity=.8;const i=t.path;return e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),t}),s.append(this.areas),s.append([].concat.apply([],this.columns)),this.updateColors(t,i)}updateColors(e,t){this.areas.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]}),this.columns.forEach((i,s)=>{i.fill=e[s+1],i.stroke=t[s+1]})}};Gb.chartType="areaColumnCombo";var Bb=class extends KC{constructor(e,t,i){super(e,"customComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:s,columnData:r,lineData:n,size:o,padding:a}=this;this.columns=YC({stacked:!1,root:s,data:r,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5}),s.append(this.columns),this.lines=qC(s,n,o,a);const l="grey",c=new Pm.Line;c.x1=a,c.y1=a,c.x2=a,c.y2=o-a+3,c.stroke=l;const h=new Pm.Line;h.x1=a-3+1,h.y1=o-a,h.x2=o-a+1,h.y2=o-a,h.stroke=l;const d=new Pm.Path;this.buildPenIconPath(d),d.fill="whitesmoke",d.stroke="darkslategrey",d.strokeWidth=1,s.append([h,c,d]),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,s)=>{i.fill=e[s],i.stroke=t[s]}),this.lines.forEach((t,i)=>{t.stroke=e[i+2]})}buildPenIconPath(e){const{path:t}=e;t.moveTo(25.76,43.46),t.lineTo(31.27,48.53),t.moveTo(49.86,22),t.lineTo(49.86,22),t.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),t.lineTo(46.86,21.41),t.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),t.lineTo(25.51,43.8),t.lineTo(25.43,43.89),t.lineTo(23.01,51.89),t.lineTo(22.83,52.46),t.lineTo(31.02,48.86),t.lineTo(49.02,28.52),t.lineTo(49.02,28.52),t.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),t.lineTo(50.75,24.93),t.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),t.closePath(),t.moveTo(41.76,25.5),t.lineTo(47.34,30.5),t.moveTo(40.74,26.65),t.lineTo(46.25,31.71)}};Bb.chartType="customCombo";var Vb={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:QC},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:eb},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:ib}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:sb},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:nb},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:ab}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:hb},donut:{range:!0,pivot:!0,enterprise:!1,icon:cb},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:cb}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:db}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:ub},bubble:{range:!0,pivot:!0,enterprise:!1,icon:pb}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:mb},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:yb},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:Cb}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:Eb},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:Mb},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:Ab},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:wb},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:xb}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:kb},histogram:{range:!0,pivot:!1,enterprise:!1,icon:bb},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:Tb},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:Db}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:Lb},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:Nb}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:_b},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:Ob}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:Fb},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:Gb},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:Bb}}},Hb={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line"],scatterGroup:["scatter","bubble"],areaGroup:["area","stackedArea","normalizedArea"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},Ub=class e extends r.uAl{constructor(t,i,s,r,n,o=Hb){super(e.TEMPLATE),this.wrappers={},this.chartController=t,this.fills=i,this.strokes=s,this.themeTemplateParameters=r,this.isCustomTheme=n,this.chartGroups=By({},o)}init(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(e=>"customCombo"!==e));const e=this.getGui(),t=this.chartController.isEnterprise(),i=this.chartController.isPivotChart(),s=!i,n=Object.keys(this.chartGroups).map(e=>{var n;const o=e in Vb?Vb[e]:void 0;if(!o)return r._.warnOnce(`invalid chartGroupsDef config '${e}'`),null;const a=(null!=(n=this.chartGroups[e])?n:[]).map(n=>{const a=n in o?o[n]:void 0;return a?!t&&a.enterprise?null:s&&a.range||i&&a.pivot?a:null:(r._.warnOnce(`invalid chartGroupsDef config '${e}.${n}'`),null)}).filter(e=>null!=e);return 0===a.length?null:{label:this.chartTranslationService.translate(e),items:a}}).filter(e=>null!=e);for(const{label:t,items:i}of n){const s=this.createBean(new r.Pk_({title:t,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal"}));for(const e of i){const t=e.icon,i=document.createElement("div");i.classList.add("ag-chart-mini-thumbnail");const r=t.chartType;this.addManagedListener(i,"click",()=>{this.chartController.setChartType(r),this.updateSelectedMiniChart()}),this.wrappers[r]=i,this.createBean(new t(i,this.fills,this.strokes,this.themeTemplateParameters,this.isCustomTheme)),s.addItem(i)}e.appendChild(s.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){const e=this.chartController.getChartType();for(const t in this.wrappers){const i=t===e;this.wrappers[t].classList.toggle("ag-selected",i)}}};Ub.TEMPLATE='<div class="ag-chart-settings-mini-wrapper"></div>',Uy([(0,r.dsm)("chartTranslationService")],Ub.prototype,"chartTranslationService",2),Uy([r.o7C],Ub.prototype,"init",1);var zb=Ub,Wb=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.chartController=t,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes(),this.ePrevBtn.insertAdjacentElement("afterbegin",r._.createIconNoSpan("previous",this.gos)),this.eNextBtn.insertAdjacentElement("afterbegin",r._.createIconNoSpan("next",this.gos)),this.addManagedListener(this.ePrevBtn,"click",()=>this.setActivePalette(this.getPrev(),"left")),this.addManagedListener(this.eNextBtn,"click",()=>this.setActivePalette(this.getNext(),"right")),this.addManagedListener(this.chartController,Lv.EVENT_CHART_TYPE_CHANGED,()=>this.resetPalettes(!0)),this.addManagedListener(this.chartController,Lv.EVENT_CHART_API_UPDATE,()=>this.resetPalettes(!0)),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{const e=this.miniChartsContainers.find(e=>!e.getGui().classList.contains("ag-hidden")).getGui().querySelector(".ag-selected");if(e){const t=e.offsetParent;t&&this.eMiniChartsContainer.scrollTo(0,t.offsetTop)}},250)}resetPalettes(e){var t,i;const s=this.chartController.getPalettes(),n=this.chartController.getThemeTemplateParameters(),o=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.settingsPanel)?void 0:i.chartGroupsDef;if(r._.shallowCompare(s,this.palettes)&&!e||this.isAnimating)return;this.palettes=s,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(e=>e===this.chartController.getChartThemeName()),this.cardItems=[],r._.clearElement(this.eCardSelector),this.destroyMiniCharts();const{themes:a}=this;this.palettes.forEach((e,t)=>{const i=this.activePaletteIndex===t,{fills:s,strokes:r}=e,l=!Cv(a[t]),c=this.createBean(new zb(this.chartController,s,r,n[t],l,o));this.miniChartsContainers.push(c),this.eMiniChartsContainer.appendChild(c.getGui()),this.addCardLink(t),i?c.updateSelectedMiniChart():c.setDisplayed(!1)}),r._.setDisplayed(this.eNavBar,this.palettes.length>1),r._.radioCssClass(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(e){const t=document.createElement("div");t.classList.add("ag-chart-settings-card-item"),this.addManagedListener(t,"click",()=>{this.setActivePalette(e,e<this.activePaletteIndex?"left":"right")}),this.eCardSelector.appendChild(t),this.cardItems.push(t)}getPrev(){let e=this.activePaletteIndex-1;return e<0&&(e=this.palettes.length-1),e}getNext(){let e=this.activePaletteIndex+1;return e>=this.palettes.length&&(e=0),e}setActivePalette(e,t){if(this.isAnimating||this.activePaletteIndex===e)return;r._.radioCssClass(this.cardItems[e],"ag-selected","ag-not-selected");const i=this.miniChartsContainers[this.activePaletteIndex],s=i.getGui(),n=this.miniChartsContainers[e],o=n.getGui();i.updateSelectedMiniChart(),n.updateSelectedMiniChart();const a="left"===t?-1:1,l=o.style.left=r._.getAbsoluteWidth(this.getGui())*a+"px";this.activePaletteIndex=e,this.isAnimating=!0;const c="ag-animating";n.setDisplayed(!0),i.addCssClass(c),n.addCssClass(c),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{s.style.left=-parseFloat(l)+"px",o.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,i.removeCssClass(c),n.removeCssClass(c),i.setDisplayed(!1)},300)}destroyMiniCharts(){r._.clearElement(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}};Wb.TEMPLATE='<div class="ag-chart-settings-wrapper">\n            <div ref="eMiniChartsContainer" class="ag-chart-settings-mini-charts-container ag-scrollable-container"></div>\n            <div ref="eNavBar" class="ag-chart-settings-nav-bar">\n                <div ref="ePrevBtn" class="ag-chart-settings-prev">\n                    <button type="button" class="ag-button ag-chart-settings-prev-button"></button>\n                </div>\n                <div ref="eCardSelector" class="ag-chart-settings-card-selector"></div>\n                <div ref="eNextBtn" class="ag-chart-settings-next">\n                    <button type="button" class="ag-button ag-chart-settings-next-button"></button>\n                </div>\n            </div>\n        </div>',Uy([(0,r.PIB)("eMiniChartsContainer")],Wb.prototype,"eMiniChartsContainer",2),Uy([(0,r.PIB)("eNavBar")],Wb.prototype,"eNavBar",2),Uy([(0,r.PIB)("eCardSelector")],Wb.prototype,"eCardSelector",2),Uy([(0,r.PIB)("ePrevBtn")],Wb.prototype,"ePrevBtn",2),Uy([(0,r.PIB)("eNextBtn")],Wb.prototype,"eNextBtn",2),Uy([r.o7C],Wb.prototype,"postConstruct",1);var jb=Wb,Kb=class e extends r.uAl{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}init(){this.panels.forEach(e=>{const t=e.replace("chart","").toLowerCase(),i=this.createPanel(t),s=this.createTab(e,t,i);this.tabs.push(s),this.addDestroyFunc(()=>this.destroyBean(i))}),this.tabbedLayout=new r.LfH({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!this.chartMenuService.isLegacyFormat(),closeButtonAriaLabel:this.chartTranslationService.translate("ariaChartMenuClose"),onCloseClicked:()=>{var t;null==(t=this.eventSource)||t.focus({preventScroll:!0}),this.dispatchEvent({type:e.EVENT_CLOSED})}}),this.getContext().createBean(this.tabbedLayout)}createTab(e,t,i){const s=document.createElement("div");s.classList.add("ag-chart-tab",`ag-chart-${t}`),this.getContext().createBean(i),s.appendChild(i.getGui());const n=document.createElement("div"),o=this.chartTranslationService.translate(t);return n.innerText=o,{title:n,titleLabel:o,bodyPromise:r.oY$.resolve(s),getScrollableContainer:()=>s.querySelector(".ag-scrollable-container")||s,name:e}}showTab(e){const t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout&&this.tabbedLayout.getGui()}showMenu(e,t){var i;this.eventSource=e,t||null==(i=this.tabbedLayout)||i.focusHeader(!0)}destroy(){this.parentComponent&&this.parentComponent.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(t){const{chartController:i,chartOptionsService:s}=this.chartMenuContext;switch(t){case e.TAB_DATA:return new qv(i,s);case e.TAB_FORMAT:return new jC(this.chartMenuContext);default:return new jb(i)}}};Kb.EVENT_CLOSED="closed",Kb.TAB_DATA="data",Kb.TAB_FORMAT="format",Uy([(0,r.dsm)("chartTranslationService")],Kb.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],Kb.prototype,"chartMenuService",2),Uy([r.o7C],Kb.prototype,"init",1);var $b=Kb,Yb=class extends r.uAl{constructor(){super('<div class="ag-chart-menu" ref="eMenu"></div>'),this.buttonListenersDestroyFuncs=[]}updateParams(e){const{buttons:t}=e;this.createButtons(t)}createButtons(e){this.buttonListenersDestroyFuncs.forEach(e=>null==e?void 0:e()),this.buttonListenersDestroyFuncs=[];const t=this.eMenu;r._.clearElement(t),e.forEach(e=>{const{buttonName:i,iconName:s,callback:r}=e,n=this.createButton(s),o=this.chartTranslationService.translate(i+"ToolbarTooltip");o&&n instanceof HTMLElement&&(n.title=o),this.buttonListenersDestroyFuncs.push(this.addManagedListener(n,"click",e=>r(e.target))),t.appendChild(n)})}createButton(e){let t=r._.createIconNoSpan(e,this.gos,void 0,!0);return t.classList.add("ag-chart-menu-icon"),this.chartMenuService.isLegacyFormat()||(t=this.wrapButton(t)),t}wrapButton(e){const t=this.gos.getDocument().createElement("button");return t.appendChild(e),t.classList.add("ag-chart-menu-toolbar-button"),t}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}};Uy([(0,r.dsm)("chartTranslationService")],Yb.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],Yb.prototype,"chartMenuService",2),Uy([(0,r.PIB)("eMenu")],Yb.prototype,"eMenu",2);var qb=class e extends r.uAl{constructor(t,i,s){super(e.TEMPLATE),this.eChartContainer=t,this.eMenuPanelContainer=i,this.chartMenuContext=s,this.buttons={chartSettings:{iconName:"menu",callback:()=>this.showMenu({panel:this.defaultPanel})},chartData:{iconName:"menu",callback:()=>this.showMenu({panel:"chartData"})},chartFormat:{iconName:"menu",callback:()=>this.showMenu({panel:"chartFormat"})},chartLink:{iconName:"linked",callback:()=>this.chartMenuService.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuService.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"save",callback:()=>this.chartMenuService.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"menuAlt",callback:e=>this.showMenuList(e)}},this.panels=[],this.menuVisible=!1,this.chartController=s.chartController}postConstruct(){this.legacyFormat=this.chartMenuService.isLegacyFormat(),this.chartToolbar=this.createManagedBean(new Yb),this.getGui().appendChild(this.chartToolbar.getGui()),this.legacyFormat&&this.createLegacyToggleButton(),this.refreshToolbarAndPanels(),this.addManagedListener(this.eventService,r.sVA.EVENT_CHART_CREATED,e=>{var t;e.chartId===this.chartController.getChartId()&&Boolean(null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.defaultToolPanel)&&this.showMenu({panel:this.defaultPanel,animate:!1,suppressFocus:!0})}),this.addManagedListener(this.chartController,Lv.EVENT_CHART_LINKED_CHANGED,this.refreshToolbarAndPanels.bind(this)),this.refreshMenuClasses(),this.legacyFormat&&!this.gos.get("suppressChartToolPanelsButton")&&this.panels.length>0&&(this.getGui().classList.add("ag-chart-tool-panel-button-enable"),this.eHideButton&&this.addManagedListener(this.eHideButton,"click",this.toggleMenu.bind(this))),this.legacyFormat||this.getGui().classList.add("ag-chart-menu-wrapper"),this.addManagedListener(this.chartController,Lv.EVENT_CHART_API_UPDATE,this.refreshToolbarAndPanels.bind(this))}isVisible(){return this.menuVisible}getExtraPaddingDirections(){const e=[];return["chartMenu","chartLink","chartUnlink","chartDownload"].some(e=>this.chartToolbarOptions.includes(e))&&e.push("top"),["chartSettings","chartData","chartFormat"].some(e=>this.chartToolbarOptions.includes(e))&&e.push(this.gos.get("enableRtl")?"left":"right"),e}createLegacyToggleButton(){const e=this.gos.getDocument();this.eHideButton=e.createElement("button"),this.eHideButton.classList.add("ag-button","ag-chart-menu-close"),this.eHideButtonIcon=e.createElement("span"),this.eHideButtonIcon.classList.add("ag-icon","ag-icon-contracted"),this.eHideButton.appendChild(this.eHideButtonIcon),this.getGui().appendChild(this.eHideButton)}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){const{panels:e,defaultPanel:t,chartToolbarOptions:i}=this.chartMenuService.getToolbarOptionsAndPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=i}updateToolbar(){const e=this.chartToolbarOptions.map(e=>{const{iconName:t,callback:i}=this.buttons[e];return{buttonName:e,iconName:t,callback:i}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){const t=this.environment.chartMenuPanelWidth(),i=this.menuPanel=this.createBean(new r.LT8({minWidth:t,width:t,height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return i.setParentComponent(this),this.eMenuPanelContainer.appendChild(i.getGui()),this.tabbedMenu=this.createBean(new $b(this.panels,this.chartMenuContext)),this.addManagedListener(this.tabbedMenu,$b.EVENT_CLOSED,()=>{this.hideMenu(!1)}),this.addManagedListener(i,r.uAl.EVENT_DESTROYED,()=>this.destroyBean(this.tabbedMenu)),new r.oY$(t=>{window.setTimeout(()=>{i.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),t(i),this.legacyFormat&&this.addManagedListener(this.eChartContainer,"click",e=>{this.getGui().contains(e.target)||this.menuVisible&&this.hideMenu()})},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.showParent(this.menuPanel.getWidth()),this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}toggleMenu(){this.menuVisible?this.hideMenu(this.legacyFormat):this.showMenu({animate:this.legacyFormat})}showMenu(e){const{panel:t,animate:i=!0,eventSource:s,suppressFocus:r}=e;if(i||this.eMenuPanelContainer.classList.add("ag-no-transition"),this.menuPanel&&!t)this.showContainer(s,r);else{const e=t||this.defaultPanel;let i=this.panels.indexOf(e);i<0&&(console.warn(`AG Grid: '${t}' is not a valid Chart Tool Panel name`),i=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(i),this.showContainer(s,r)):this.createMenuPanel(i).then(()=>this.showContainer(s,r))}i||setTimeout(()=>{this.isAlive()&&this.eMenuPanelContainer.classList.remove("ag-no-transition")},500)}hideMenu(e=!0){e||this.eMenuPanelContainer.classList.add("ag-no-transition"),this.hideParent(),window.setTimeout(()=>{this.menuVisible=!1,this.refreshMenuClasses(),e||this.eMenuPanelContainer.classList.remove("ag-no-transition")},500)}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible),this.legacyFormat&&!this.gos.get("suppressChartToolPanelsButton")&&(this.eHideButtonIcon.classList.toggle("ag-icon-contracted",this.menuVisible),this.eHideButtonIcon.classList.toggle("ag-icon-expanded",!this.menuVisible))}showParent(e){this.eMenuPanelContainer.style.minWidth=`${e}px`}hideParent(){this.eMenuPanelContainer.style.minWidth="0"}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({animate:!1,eventSource:e}),chartMenuContext:this.chartMenuContext})}destroy(){super.destroy(),this.menuPanel&&this.menuPanel.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu&&this.tabbedMenu.isAlive()&&this.destroyBean(this.tabbedMenu)}};qb.TEMPLATE="<div></div>",Uy([(0,r.dsm)("chartMenuService")],qb.prototype,"chartMenuService",2),Uy([(0,r.dsm)("chartMenuListFactory")],qb.prototype,"chartMenuListFactory",2),Uy([r.o7C],qb.prototype,"postConstruct",1);var Xb=qb,Zb=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.chartMenu=t,this.destroyableChartListeners=[],this.editing=!1}init(){this.addManagedListener(this.getGui(),"keydown",e=>{this.editing&&"Enter"===e.key&&!e.shiftKey&&(this.handleEndEditing(),e.preventDefault())}),this.addManagedListener(this.getGui(),"input",()=>{this.editing&&this.updateHeight()}),this.addManagedListener(this.getGui(),"blur",()=>this.endEditing())}refreshTitle(e){this.chartController=e.chartController,this.chartOptionsService=e.chartOptionsService,this.chartMenuUtils=e.chartMenuParamsFactory.getChartOptions();for(const e of this.destroyableChartListeners)e();this.destroyableChartListeners=[];const t=this.chartController.getChartProxy().getChart(),i=t.canvasElement,s=this.addManagedListener(i,"dblclick",e=>{const{title:s}=t;if(s&&s.node.containsPoint(e.offsetX,e.offsetY)){const e=s.node.computeBBox(),t=s.node.inverseTransformPoint(e.x,e.y);this.startEditing(By(By({},e),t),i.width)}});let r=!1;const n=this.addManagedListener(i,"mousemove",e=>{const{title:s}=t,n=!!(s&&s.enabled&&s.node.containsPoint(e.offsetX,e.offsetY));r!==n&&(i.style.cursor=n?"pointer":""),r=n});this.destroyableChartListeners=[s,n]}startEditing(e,t){if(this.chartMenuService.isLegacyFormat()&&this.chartMenu&&this.chartMenu.isVisible())return;if(this.editing)return;this.editing=!0;const i=Math.max(Math.min(e.width+20,t),300),s=this.getGui();s.classList.add("currently-editing");const r=s.style;r.fontFamily=this.chartMenuUtils.getValue("title.fontFamily"),r.fontWeight=this.chartMenuUtils.getValue("title.fontWeight"),r.fontStyle=this.chartMenuUtils.getValue("title.fontStyle"),r.fontSize=this.chartMenuUtils.getValue("title.fontSize")+"px",r.color=this.chartMenuUtils.getValue("title.color");const n=this.chartMenuUtils.getValue("title.text"),o=n===this.chartTranslationService.translate("titlePlaceholder");s.value=o?"":n;const a=n.split(/\r?\n/g).length;r.left=Math.round(e.x+e.width/2-i/2-1)+"px",r.top=Math.round(e.y+e.height/2-a*this.getLineHeight()/2-2)+"px",r.width=Math.round(i)+"px",r.lineHeight=this.getLineHeight()+"px",this.updateHeight(),s.focus()}updateHeight(){const e=this.getGui(),t=this.chartMenuUtils.getValue("title.text").split(/\r?\n/g).length,i=e.value.split(/\r?\n/g).length;e.style.height=Math.round(Math.max(t,i)*this.getLineHeight())+4+"px"}getLineHeight(){const e=this.chartMenuUtils.getValue("title.lineHeight");return e?parseInt(e):Math.round(1.2*parseInt(this.chartMenuUtils.getValue("title.fontSize")))}handleEndEditing(){const e=this.chartMenuUtils.getValue("title.color");this.chartMenuUtils.setValue("title.color","rgba(0, 0, 0, 0)"),this.chartOptionsService.awaitChartOptionUpdate(()=>this.endEditing()),this.chartOptionsService.awaitChartOptionUpdate(()=>{this.chartMenuUtils.setValue("title.color",e)})}endEditing(){if(!this.editing)return;this.editing=!1;const e=this.getGui().value;e&&""!==e.trim()?(this.chartMenuUtils.setValue("title.text",e),this.chartMenuUtils.setValue("title.enabled",!0)):(this.chartMenuUtils.setValue("title.text",""),this.chartMenuUtils.setValue("title.enabled",!1)),this.getGui().classList.remove("currently-editing"),this.chartOptionsService.awaitChartOptionUpdate(()=>{this.eventService.dispatchEvent({type:"chartTitleEdit"})})}};Zb.TEMPLATE='<textarea\n             class="ag-chart-title-edit"\n             style="padding:0; border:none; border-radius: 0; min-height: 0; text-align: center; resize: none;" />\n        ',Uy([(0,r.dsm)("chartTranslationService")],Zb.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],Zb.prototype,"chartMenuService",2),Uy([r.o7C],Zb.prototype,"init",1);var Qb=Zb;function Jb(e){return null!=e.chart?e.chart:e}var eS=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.isEnterpriseCharts=Wm.enterpriseModule.isEnterprise,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=rv(this.chartType),null==this.chart?this.chart=Am.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){Am.update(this.getChartRef(),this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){Am.updateDelta(this.getChartRef(),{theme:{overrides:e}})}getChart(){return Jb(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,i){const{chart:s}=this,r=Jb(s),n=t||(r.title?r.title.text:"chart"),{width:o,height:a}=e||{};Am.download(s,{width:o,height:a,fileName:n,fileFormat:i})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){var e;return null!=(e=this.getChartOptions().theme.overrides)?e:{}}getChartPalette(){return Bm.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){const t=rv(this.chartProxyParams.chartType);Am.updateDelta(this.chart,{theme:{overrides:{[t]:{paired:e}}}})}isPaired(){const e=rv(this.chartProxyParams.chartType);return vv(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return wv(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((e,i)=>{const s=e[t],r=s&&s.toString?s.toString():"",n=By({},e);return n[t]={id:i,value:s,toString:()=>r},n})}getCommonChartOptions(e){var t,i;const s=this.clearThemeOverrides?{}:null!=(i=null==(t=this.chart)?void 0:t.getOptions())?i:{},n=null!=this.chart?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;const o=function(e,t,i,s,n){var o;const{chartOptionsToRestore:a,chartPaletteToRestore:l,chartThemeToRestore:c}=e,h=function(e){let t=e.getChartThemeName();const i=e.getChartThemes();return r._.includes(i,t)||(t=i[0]),t}(e),d=Cv(h),u=d?{baseTheme:h}:null!=(o=wv(e,h))?o:{},p=e.getGridOptionsChartThemeOverrides(),g=e.apiChartThemeOverrides,m=rv(e.chartType),f=e.crossFiltering?function(e,t,i){const s={listeners:{legendItemClick:t=>{e.getChart().series.forEach(e=>{e.toggleSeriesItem(t.itemId,t.enabled),e.toggleSeriesItem(`${t.itemId}-filtered-out`,t.enabled)})}}};return{[i]:{tooltip:{delay:500},legend:s,listeners:{click:e=>t.crossFilterCallback(e,!0)}}}}(t,e,m):void 0,y=[d?Sv(e,i,(()=>{const e=e=>!!e&&Object.keys(e).some(t=>vv(e[t],"title.enabled",!1));return e(p)||e(g)})()):void 0,s,f,p,g,By({},null!=a?a:{}),n].filter(e=>!!e).reduce((e,t)=>({baseTheme:e,overrides:t}),u);return l&&h===c&&(function(e,t){const i=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]);return i(e.fills,t.fills)&&i(e.strokes,t.strokes)}(l,Bm.getChartTheme(u).palette)||(y.palette=l)),y}(this.chartProxyParams,this,this.isEnterpriseCharts,this.getChartThemeDefaults(),null!=e?e:n),a=Vy(By({},s),{mode:"integrated"});return a.theme=o,a.container=this.chartProxyParams.parentElement,a}getChartThemeDefaults(){const e=this.getSeriesChartThemeDefaults(),t=e?{[this.standaloneChartType]:e}:{},i={enabled:!0,snap:!0,label:{enabled:!1}};return By({common:{navigator:{enabled:!1},zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:i},category:{crosshair:i},log:{crosshair:i},time:{crosshair:i}}}},t)}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){var e,t;if(this.clearThemeOverrides)return{};const i=null==(e=this.chart)?void 0:e.getOptions().theme;return null!=(t=null==i?void 0:i.overrides)?t:{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&(this.chart.destroy(),this.chart=void 0)}},tS=class extends eS{constructor(e){super(e),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[]}getUpdateOptions(e,t){const i=this.getAxes(e,t);return Vy(By({},t),{data:this.getData(e,i),axes:i,series:this.getSeries(e)})}getData(e,t){const i=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&i?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){const i=t[0].type,{categories:s,data:r}=e,[n]=s;switch(i){case"category":return this.transformCategoryData(r,n.id);case"time":return this.transformTimeData(r,n.id);default:return r}}getXAxisType(e){return e.grouping?"grouped-category":this.isXAxisOfType(e,"time",e=>e instanceof Date)?"time":this.isXAxisOfType(e,"number")?"number":"category"}isXAxisOfType(e,t,i){const[s]=e.categories;if(null==s?void 0:s.chartDataType)return s.chartDataType===t;if(!i)return!1;const r=e.data[0];return!!r&&i(r[s.id])}transformTimeData(e,t){var i;return(null==(i=e[0])?void 0:i[t])instanceof Date?e:e.map(e=>{const i=e[t];return"string"==typeof i?Vy(By({},e),{[t]:new Date(i)}):e})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return 0==this.crossFilteringSelectedPoints.length||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){const[i]=t.categories,s=e=>"area"===this.standaloneChartType?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?e+"-total":e:e+"-total";return e.map(e=>(e.yKey=s(e.yKey),e.listeners={nodeClick:t=>{const i=t.datum[e.xKey],s=t.event.metaKey||t.event.ctrlKey;this.crossFilteringAddSelectedPoint(s,i),this.crossFilterCallback(t)}},e.marker={formatter:e=>{const t=e.datum[i.id];return{fill:e.highlighted?"yellow":e.fill,size:e.highlighted?14:this.crossFilteringPointSelected(t)?8:0}}},"area"===this.standaloneChartType&&(e.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),"line"===this.standaloneChartType&&(e.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),e))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();const[t]=e.categories,i=e.fields[0].colId,s=`${i}-filtered-out`,r=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(n=>{const o=n[t.id];this.crossFilteringAllPoints.add(o);const a=this.crossFilteringPointSelected(o);return"area"===this.standaloneChartType&&r===e.chartId&&(n[`${i}-total`]=a?n[i]:n[i]+n[s]),"line"===this.standaloneChartType&&(n[`${i}-total`]=a?n[i]:n[i]+n[s]),n})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){const t=this.standaloneChartType;if("waterfall"!==t&&"box-plot"!==t&&"range-bar"!==t)return!1;const i=e.theme,s=e=>{var i,r,n;const o=null==(n=null==(r=null==(i=null==e?void 0:e.overrides)?void 0:i[t])?void 0:r.series)?void 0:n.direction;return null!=o?"horizontal"===o:"object"==typeof(null==e?void 0:e.baseTheme)&&s(e.baseTheme)};return s(i)}};function iS(e,t){const i=parseInt(e.slice(1,3),16),s=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return t?`rgba(${i}, ${s}, ${r}, ${t})`:`rgba(${i}, ${s}, ${r})`}function sS(e,t){return e.map(e=>{const i=Um.Color.fromString(e);return new Um.Color(i.r,i.g,i.b,t).toHexString()})}var rS=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),nS=class extends tS{constructor(e){super(e)}getAxes(e){const t=[{type:this.getXAxisType(e),position:this.isHorizontal()?"left":"bottom"},{type:"number",position:this.isHorizontal()?"bottom":"left"}];if(this.isNormalised()){const e=t[1];e.label=Vy(By({},e.label),{formatter:e=>Math.round(e.value)+"%"})}return t}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||Qy(this.chartType),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName}));return this.crossFiltering?this.extractCrossFilterSeries(i):i}extractCrossFilterSeries(e){const t=this.getChartPalette(),i=(e,i)=>Vy(By({},e),{highlightStyle:{item:{fill:void 0}},fill:null==t?void 0:t.fills[i],stroke:null==t?void 0:t.strokes[i],listeners:{nodeClick:this.crossFilterCallback}}),s=e=>{const t=e.yKey+"-filtered-out";return Vy(By({},yv({},e)),{yKey:t,fill:iS(e.fill,"0.3"),stroke:iS(e.stroke,"0.3"),showInLegend:!1})},r=[];for(let t=0;t<e.length;t++){const n=i(e[t],t);r.push(n),r.push(s(n))}return r}isNormalised(){return!this.crossFiltering&&r._.includes(["normalizedColumn","normalizedBar"],this.chartType)}isHorizontal(){return rS.has(this.chartType)}},oS=class extends tS{constructor(e){super(e)}getAxes(e){const t=[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}];if(this.isNormalised()){const e=t[1];e.label=Vy(By({},e.label),{formatter:e=>Math.round(e.value)+"%"})}return t}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName,normalizedTo:"normalizedArea"===this.chartType?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}isNormalised(){return!this.crossFiltering&&"normalizedArea"===this.chartType}},aS=class extends tS{constructor(e){super(e)}getAxes(e){return[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}},lS=class extends eS{constructor(e){super(e)}getAxes(e){const t="radial-bar"===this.standaloneChartType;return[{type:t?"angle-number":"angle-category"},{type:t?"radius-category":"radius-number"}]}getSeries(e){const{fields:t,categories:i,seriesGroupType:s}=e,[r]=i,n="radial-bar"===this.standaloneChartType,o=this.getSeriesGroupTypeOptions(s);return t.map(e=>{var t,i;return By({type:this.standaloneChartType,angleKey:n?e.colId:r.id,angleName:n?null!=(t=e.displayName)?t:void 0:r.name,radiusKey:n?r.id:e.colId,radiusName:n?r.name:null!=(i=e.displayName)?i:void 0},o)})}getSeriesGroupType(){var e,t;const i=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(i))return;const s=null==(t=null==(e=this.getChart().series)?void 0:e[0])?void 0:t.properties.toJson(),r=()=>s.normalizedTo?"normalized":"stacked";return"nightingale"===i?s.grouped?"grouped":r():s.stacked?r():"grouped"}getUpdateOptions(e,t){const i=this.getAxes(e);return Vy(By({},t),{data:this.getData(e,i),axes:i,series:this.getSeries(e)})}getData(e,t){if(t.some(e=>"angle-category"===e.type||"radius-category"===e.type)){const[t]=e.categories;return this.transformCategoryData(e.data,t.id)}return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:"grouped"===e||void 0,stacked:"grouped"!==e||void 0,normalizedTo:"normalized"===e?100:void 0}:{}}},cS=class e extends eS{constructor(e){super(e)}getUpdateOptions(e,t){return Vy(By({},t),{data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)})}getSeries(t){const[i]=t.categories,s=t.fields.length,r={currentOffset:0,offsetAmount:s>1?20:40},n=this.getFields(t).map(t=>{var n;const o={type:this.standaloneChartType,angleKey:t.colId,angleName:t.displayName,sectorLabelKey:t.colId,calloutLabelName:i.name,calloutLabelKey:i.id};if("donut"===this.chartType||"doughnut"===this.chartType){const{outerRadiusOffset:i,innerRadiusOffset:a}=e.calculateOffsets(r),l=t.displayName?{title:{text:t.displayName,showInLegend:s>1}}:void 0;return Vy(By(Vy(By({},o),{type:"donut",outerRadiusOffset:i,innerRadiusOffset:a}),l),{calloutLine:{colors:null==(n=this.getChartPalette())?void 0:n.strokes}})}return o});return this.crossFiltering?this.extractCrossFilterSeries(n):n}getCrossFilterData(e){const t=e.fields[0].colId,i=`${t}-filtered-out`;return e.data.map(e=>{const s=e[t]+e[i];return e[`${t}-total`]=s,e[i]=1,e[t]=e[t]/s,e})}extractCrossFilterSeries(e){const t=this.getChartPalette(),i=e[0],s=i.angleKey,r=(e=>Vy(By({},e),{legendItemKey:e.calloutLabelKey,calloutLabel:{enabled:!1},highlightStyle:{item:{fill:void 0}},radiusKey:e.angleKey,angleKey:e.angleKey+"-total",radiusMin:0,radiusMax:1,listeners:{nodeClick:this.crossFilterCallback}}))(i);return[(n=i,o=s,Vy(By({},yv({},r)),{radiusKey:o+"-filtered-out",fills:sS(null!=(a=n.fills)?a:t.fills,.3),strokes:sS(null!=(l=n.strokes)?l:t.strokes,.3),showInLegend:!1})),r];var n,o,a,l}static calculateOffsets(e){const t=e.currentOffset;e.currentOffset-=e.offsetAmount;const i=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:i}}getFields(e){return"pie"===this.chartType?e.fields.slice(0,1):e.fields}},hS=class extends tS{constructor(e){super(e)}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,i=this.isPaired(),s=this.getSeriesDefinitions(e.fields,i),r=t.id===hv.DEFAULT_CATEGORY?void 0:t,n=s.map(e=>{var t,i,s,n,o;return(null==e?void 0:e.sizeField)?{type:"bubble",xKey:e.xField.colId,xName:null!=(t=e.xField.displayName)?t:void 0,yKey:e.yField.colId,yName:null!=(i=e.yField.displayName)?i:void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,sizeKey:e.sizeField.colId,sizeName:null!=(s=e.sizeField.displayName)?s:"",labelKey:r?r.id:e.yField.colId,labelName:r?r.name:void 0}:{type:"scatter",xKey:e.xField.colId,xName:null!=(n=e.xField.displayName)?n:void 0,yKey:e.yField.colId,yName:null!=(o=e.yField.displayName)?o:void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,labelKey:r?r.id:e.yField.colId,labelName:r?r.name:void 0}});return this.crossFiltering?this.extractCrossFilterSeries(n,e):n}extractCrossFilterSeries(e,t){const{data:i}=t,s=this.getChartPalette(),r=e=>`${e}-filtered-out`,n=e.map((e,t)=>{const n=null==s?void 0:s.fills[t],o=null==s?void 0:s.strokes[t];let a;if("bubble"===e.type){const{sizeKey:t}=e;a=((e,t)=>{var i;const s=[1/0,-1/0];if(null!=t)for(const n of e){const e=null!=(i=n[t])?i:n[r(t)];e<s[0]&&(s[0]=e),e>s[1]&&(s[1]=e)}if(s[0]<=s[1])return s})(i,t)}const l=Vy(By({},e.marker),{fill:n,stroke:o,domain:a});return Vy(By({},e),{marker:l,highlightStyle:{item:{fill:"yellow"}},listeners:Vy(By({},e.listeners),{nodeClick:this.crossFilterCallback})})});return[...n,...n.map(e=>{let{yKey:t,xKey:i}=e,s={};return"bubble"===e.type&&(s={sizeKey:r(e.sizeKey)}),Vy(By(By({},e),s),{yKey:r(t),xKey:r(i),marker:Vy(By({},e.marker),{fillOpacity:.3,strokeOpacity:.3}),showInLegend:!1,listeners:Vy(By({},e.listeners),{nodeClick:e=>{const t=e.datum[r(i)],s=Vy(By({},e),{xKey:i,datum:Vy(By({},e.datum),{[i]:t})});this.crossFilterCallback(s)}})})})]}getSeriesDefinitions(e,t){if(e.length<2)return[];const i="bubble"===this.chartType;if(t)return i?e.map((t,i)=>i%3==0?{xField:t,yField:e[i+1],sizeField:e[i+2]}:null).filter(e=>e&&e.yField&&e.sizeField):e.map((t,i)=>i%2==0?{xField:t,yField:e[i+1]}:null).filter(e=>e&&e.yField);const s=e[0];return i?e.map((t,i)=>i%2==1?{xField:s,yField:t,sizeField:e[i+1]}:null).filter(e=>e&&e.sizeField):e.filter((e,t)=>t>0).map(e=>({xField:s,yField:e}))}},dS=class extends tS{constructor(e){super(e)}getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}computeSeriesStatistics(e,t){const{data:i,fields:s}=e,[r]=e.categories,n=r.id||hv.DEFAULT_CATEGORY,o=this.groupDataByCategory(n,i);return Array.from(o).map(([e,i])=>{const n={[r.id]:e};return s.forEach((e,s)=>{const r=i.map(t=>t[e.colId]).filter(e=>"number"==typeof e&&!isNaN(e));Object.entries(t(r)).forEach(([e,t])=>{n[`${e}:${s}`]=r.length>0?t:null})}),n})}groupDataByCategory(e,t){return t.reduce((t,i)=>{let s=(t=>{if(e===hv.DEFAULT_CATEGORY)return 1;const i=t[e];return null==i?"":i instanceof Date?i.getTime():i})(i);const r=t.get(s);return r?r.push(i):t.set(s,[i]),t},new Map)}},uS=class extends dS{constructor(e){super(e)}getSeries(e){const[t]=e.categories;return e.fields.map((e,i)=>{var s;return{type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:null!=(s=e.displayName)?s:void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${i}`,yHighKey:`max:${i}`}})}getData(e){return this.computeSeriesStatistics(e,e=>({min:Math.min(...e),max:Math.max(...e)}))}},pS=class extends tS{constructor(e){super(e)}getSeries(e){const t=e.fields[0];return[{type:this.standaloneChartType,xKey:t.colId,xName:t.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}},gS=class extends dS{constructor(e){super(e)}getSeries(e){const[t]=e.categories;return e.fields.map((e,i)=>{var s;return{type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:null!=(s=e.displayName)?s:void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${i}`,q1Key:`q1:${i}`,medianKey:`median:${i}`,q3Key:`q3:${i}`,maxKey:`max:${i}`}})}getData(e){return this.computeSeriesStatistics(e,e=>{const t=e.sort((e,t)=>e-t);return{min:t[0],q1:this.quantile(t,.25),median:this.quantile(t,.5),q3:this.quantile(t,.75),max:t[t.length-1]}})}quantile(e,t){const i=(e.length-1)*t,s=Math.floor(i),r=i-s;return void 0!==e[s+1]?e[s]+r*(e[s+1]-e[s]):e[s]}},mS=class extends eS{constructor(e){super(e)}getUpdateOptions(e,t){const i="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",s="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY",r="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY";return Vy(By({},t),{series:this.getSeries(e,i,s,r),data:this.getData(e,i,s,r)})}getSeries(e,t,i,s){const[r]=e.categories;return[{type:this.standaloneChartType,yKey:s,xKey:t,colorKey:i,yName:r.name,xName:void 0,colorName:void 0}]}getData(e,t,i,s){const[r]=e.categories;return n=e.data,o=(n,o)=>{const a=n[r.id],l=null==a?"":String(a),c={id:o,value:a,toString:()=>l};return e.fields.map(({colId:e,displayName:r})=>Vy(By({},n),{[t]:r,[i]:n[e],[s]:c}))},n.reduce((e,t,i,s)=>e.concat(o(t,i)),new Array);var n,o}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}},series:{tooltip:{renderer:fS}}}}};function fS(e){const{xKey:t,yKey:i,colorKey:s,yName:r,datum:n}=e;return{title:"",content:[{label:r,value:n[i]},{label:n[t],value:s&&n[s]}].map(({label:e,value:t})=>`<b>${yS(String(e))}:</b> ${yS(String(t))}`).join("<br>")}}function yS(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;"},i=`[${Object.keys(t).join("")}]`,s=new RegExp(i,"g");return e.replace(s,e=>t[e])}var vS=class extends tS{constructor(e){super(e)}getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}getSeries(e){var t;const[i]=e.categories,[s]=e.fields;return[{type:this.standaloneChartType,xKey:i.id,xName:i.name,yKey:s.colId,yName:null!=(t=s.displayName)?t:void 0}]}},CS=["number","category","time","grouped-category"],bS=[...CS,"angle-category","angle-number","radius-category","radius-number"],SS=class e extends r.XQb{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>this.setChartThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setChartThemeOverrides(e)}}getAxisThemeOverridesProxy(){return{getValue:e=>this.getAxisProperty(e),setValue:(e,t)=>this.setAxisThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setAxisThemeOverrides(e)}}getCartesianAxisOptionsProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,i)=>this.setCartesianAxisOptions(e,[{expression:t,value:i}]),setValues:t=>this.setCartesianAxisOptions(e,t)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,i)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:i}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,"*"===t?null:t),setValue:(t,i)=>this.setCartesianAxisThemeOverrides(e,[{expression:"*"===t?null:t,value:i}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,i)=>this.getSeriesOption(e(),t,i),setValue:(t,i)=>this.setSeriesOptions(e(),[{expression:t,value:i}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,i,s){const r=this.getRetainedChartThemeOverrideKeys(i,s),n=this.getRetainedChartAxisThemeOverrideKeys(null,i,s),o=this.createChartOptions();for(const t of r){const r=this.retrieveChartOptionsThemeOverride(e,i,t);void 0!==r&&this.assignChartOptionsThemeOverride(o,s,t,r)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:n,existingChartOptions:e,targetChartOptions:o,existingChartType:i,targetChartType:s}),o.theme.overrides}assignPersistedAxisOverrides(e){const{existingAxes:t,retainedChartAxisThemeOverrideKeys:i,existingChartOptions:s,targetChartOptions:r,existingChartType:n,targetChartType:o}=e;for(const{expression:e,targetAxisTypes:a}of i)for(const i of t.map(e=>e.type)){const t=this.retrieveChartOptionsThemeOverride(s,n,["axes",i,e].join("."));if(void 0!==t)for(const i of a)this.assignChartOptionsThemeOverride(r,o,["axes",i,e].join("."),t)}}getRetainedChartThemeOverrideKeys(e,t){const i=["zoom","navigator"];return["animation",...((e,t)=>{const s=new Array;return Jy(rv(e))&&Jy(rv(t))&&s.push(...i),s})(e,t)]}getRetainedChartAxisThemeOverrideKeys(e,t,i){return Jy(rv(t))&&Jy(rv(i))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(e=>({expression:e,targetAxisTypes:CS})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){const t="xAxis"===e?["",".top",".bottom"]:"yAxis"===e?["",".left",".right"]:["",".left",".right",".top",".bottom"],i=["crosshair"],s=new Array;for(const e of i)for(const i of t)s.push(`${e}${i}`);return s}getChartOption(e){return vv(this.getChart(),e,void 0)}setChartThemeOverrides(e){const t=this.getChartType(),i=this.createChartOptions();for(const{expression:s,value:r}of e)this.assignChartOptionsThemeOverride(i,t,s,r);this.applyChartOptions(i)}applyChartOptions(e,t){0!==Object.keys(e).length&&(this.updateChart(e),!(null==t?void 0:t.silent)&&this.raiseChartOptionsChangedEvent())}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(e=>console.error("AG Grid - chart update failed",e))}getAxisProperty(e){var t;return vv(null==(t=this.getChart().axes)?void 0:t[0],e,void 0)}setAxisThemeOverrides(e){var t;const i=this.getChart(),s=this.getChartType();let r=this.createChartOptions();for(const{expression:n,value:o}of e){const e=null==(t=i.axes)?void 0:t.filter(e=>{const t=n.split(".");let i=e;for(const e of t){if(!(e in i))return!1;i=i[e]}return!0});if(e)for(const t of e)this.isValidAxisType(t)&&this.assignChartAxisThemeOverride(r,s,t.type,null,n,o)}this.applyChartOptions(r)}getCartesianAxisProperty(e,t){const i=this.getChartAxes();return vv(this.getCartesianAxis(i,e),t,void 0)}getCartesianAxisThemeOverride(e,t){const i=this.getChartAxes(),s=this.getCartesianAxis(i,e);if(!s||!this.isValidAxisType(s))return;const r=this.getChartType(),n=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(n,r,s.type,"yAxis"===e?["left","right"]:["bottom","top"],t)}setCartesianAxisThemeOverrides(e,t){const i=this.getChartAxes(),s=this.getCartesianAxis(i,e);if(!s||!this.isValidAxisType(s))return;const r=this.getChartType();let n=this.createChartOptions();for(const{expression:i,value:o}of t)this.assignChartAxisThemeOverride(n,r,s.type,"yAxis"===e?["left","right"]:["bottom","top"],i,o);this.applyChartOptions(n)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,(e,i,s)=>{const r=i.indexOf(s);for(const{expression:i,value:s}of t)this.assignChartOption(e,`axes.${r}.${i}`,s)})}updateCartesianAxisOptions(e,t){const i=this.getChart().getOptions(),s="axes"in i?i.axes:void 0;if(!i||!s)return;const r=this.getChartAxes(),n=this.getCartesianAxis(r,e);if(!n)return;let o=this.createChartOptions();o.axes=s,t(o,r,n,i),this.applyChartOptions(o)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(i,s,r,n)=>{const o=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[r],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,o,o),existingChartOptions:n,targetChartOptions:i,existingChartType:o,targetChartType:o}),this.assignChartOption(i,"axes.0.type",t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case"xAxis":return"x"===e[0].direction?e[0]:e[1];case"yAxis":return"y"===e[1].direction?e[1]:e[0]}}getSeriesOption(t,i,s){const r=this.getChart().series.find(i=>e.isMatchingSeries(t,i));return vv(s?r:null==r?void 0:r.properties.toJson(),i,void 0)}setSeriesOptions(e,t){let i=this.createChartOptions();for(const{expression:s,value:r}of t)this.assignChartOptionsSeriesThemeOverride(i,e,`series.${s}`,r);this.applyChartOptions(i)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){var e;return null!=(e=this.getChart().axes)?e:[]}retrieveChartAxisThemeOverride(e,t,i,s,r){if(!s)return this.retrieveChartOptionsThemeOverride(e,t,["axes",i,...r?[r]:[]].join("."));for(const n of s){const s=this.retrieveChartOptionsThemeOverride(e,t,["axes",i,n,...r?[r]:[]].join("."));if(void 0!==s)return s}}assignChartAxisThemeOverride(e,t,i,s,r,n){if(s)for(const o of s)this.assignChartOptionsThemeOverride(e,t,["axes",i,o,...r?[r]:[]].join("."),n);else this.assignChartOptionsThemeOverride(e,t,["axes",i,...r?[r]:[]].join("."),n)}isValidAxisType(e){return bS.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){const t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),Am.updateDelta(t,e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,i){const s=this.getChartThemeOverridesSeriesTypeKeys(t);for(const t of s){const s=this.retrieveChartOptionsSeriesThemeOverride(e,t,i);if(void 0!==s)return s}}assignChartOptionsThemeOverride(e,t,i,s){const r=this.getChartThemeOverridesSeriesTypeKeys(t);for(const t of r)this.assignChartOptionsSeriesThemeOverride(e,t,i,s)}retrieveChartOptionsSeriesThemeOverride(e,t,i){return this.retrieveChartOption(e,["theme","overrides",t,...i?[i]:[]].join("."))}assignChartOptionsSeriesThemeOverride(e,t,i,s){this.assignChartOption(e,["theme","overrides",t,...i?[i]:[]].join("."),s)}getChartThemeOverridesSeriesTypeKeys(e){const t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push("common"),t}retrieveChartOption(e,t){return vv(e,t,void 0)}assignChartOption(e,t,i){!function(e,t,i){if(null==e)return;const s=t.split(".");let r=e;s.forEach((e,t)=>{r[e]||(r[e]={}),t<s.length-1&&(r=r[e])}),r[s[s.length-1]]=i}(e,t,i)}raiseChartOptionsChangedEvent(){const e=this.chartController.getChartModel(),t={type:r.sVA.EVENT_CHART_OPTIONS_CHANGED,chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions};this.eventService.dispatchEvent(t)}static isMatchingSeries(e,t){return function(e){return!!Yy[e]}(e)&&t.type===e}destroy(){super.destroy()}},wS=class extends tS{constructor(e){super(e)}getAxes(e){const t=e?e.fields:[],i=new Map(t.map(e=>[e.colId,e])),{primaryYKeys:s,secondaryYKeys:r}=this.getYKeys(t,e.seriesChartTypes),n=[{type:this.getXAxisType(e),position:"bottom"}];return s.length>0&&n.push({type:"number",keys:s,position:"left"}),r.length>0&&r.forEach(e=>{const t=i.get(e);if(!t||t.colId!==e)return;const s={type:"number",keys:[e],position:"right"};n.push(s)}),n}getSeries(e){const{fields:t,seriesChartTypes:i}=e,[s]=e.categories;return t.map(e=>{const t=i.find(t=>t.colId===e.colId);if(t){const i=t.chartType,r=["groupedColumn","groupedBar"].includes(i)?{grouped:!0}:{};return By({type:rv(i),xKey:s.id,yKey:e.colId,yName:e.displayName,stacked:["stackedArea","stackedColumn"].includes(i)},r)}})}getYKeys(e,t){const i=[],s=[];return e.forEach(e=>{const r=e.colId,n=t.find(e=>e.colId===r);n&&(n.secondaryAxis?s.push(r):i.push(r))}),{primaryYKeys:i,secondaryYKeys:s}}},xS=["chartSettings","chartData","chartFormat"],ES=["chartUnlink","chartLink","chartDownload"],MS={settings:"chartSettings",data:"chartData",format:"chartFormat"},AS=class extends r.XQb{isLegacyFormat(){return!this.chartService.isEnterprise()}downloadChart(e,t,i,s){e.chartController.getChartProxy().downloadChart(t,i,s)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advancedSettingsMenuFactory.showMenu(e,t)}hideAdvancedSettings(){this.advancedSettingsMenuFactory.hideMenu()}getToolbarOptionsAndPanels(e){var t,i,s;const n=this.isLegacyFormat();let o,a,l;if(Boolean(this.gos.get("chartToolPanelsDef"))||!n){const c=n?[e.isChartLinked()?"chartLink":"chartUnlink","chartDownload"]:["chartMenu"],h=this.gos.getCallback("getChartToolbarItems");l=h?h({defaultItems:c}).filter(e=>{if(!(n?ES:[...ES,"chartMenu"]).includes(e)){let t;return t=xS.includes(e)?`'${e}' is a Chart Tool Panel option and will be ignored since 'chartToolPanelsDef' is used. Please use 'chartToolPanelsDef.panels' grid option instead`:"chartMenu"===e?"'chartMenu' is only allowed as a Chart Toolbar Option when using AG Charts Enterprise":`'${e}' is not a valid Chart Toolbar Option`,r._.warnOnce(t),!1}return!0}):c;const d=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.panels)?void 0:i.map(e=>{const t=MS[e];return t||r._.warnOnce(`Invalid panel in chartToolPanelsDef.panels: '${e}'`),t}).filter(e=>Boolean(e));o=d||Object.values(MS),e.isPivotChart()&&(o=o.filter(e=>"chartData"!==e));const u=null==(s=this.gos.get("chartToolPanelsDef"))?void 0:s.defaultToolPanel;a=u&&MS[u]||o[0],n&&(l=o.length>0?[o[0],...l]:l)}else{let t=["chartSettings","chartData","chartFormat",e.isChartLinked()?"chartLink":"chartUnlink","chartDownload"];const i=this.gos.getCallback("getChartToolbarItems");if(i){const e=this.gos.get("suppressChartToolPanelsButton");t=i({defaultItems:e?t:ES}).filter(t=>{if(!xS.includes(t)&&!ES.includes(t))return r._.warnOnce(`'${t}' is not a valid Chart Toolbar Option`),!1;if(!e&&xS.includes(t)){const e=`'${t}' is a Chart Tool Panel option and will be ignored. Please use 'chartToolPanelsDef.panels' grid option instead`;return r._.warnOnce(e),!1}return!0}),e||(t=t.concat(xS))}e.isPivotChart()&&(t=t.filter(e=>"chartData"!==e));const s=["chartUnlink","chartLink","chartDownload"];o=t.filter(e=>-1===s.indexOf(e)),a=o[0],l=t.filter(e=>-1!==s.indexOf(e)||o.length&&e===o[0])}return{panels:o,defaultPanel:a,chartToolbarOptions:l}}doesChartToolbarExist(e){const{chartToolbarOptions:t}=this.getToolbarOptionsAndPanels(e);return["chartMenu",...ES].some(e=>t.includes(e))}doChartToolPanelsExist(e){const{panels:t}=this.getToolbarOptionsAndPanels(e);return t.length>0}};Uy([(0,r.dsm)("chartService")],AS.prototype,"chartService",2),Uy([(0,r.dsm)("advancedSettingsMenuFactory")],AS.prototype,"advancedSettingsMenuFactory",2),AS=Uy([(0,r.dR4)("chartMenuService")],AS);var TS="AG-GRID-DEFAULT-LABEL-KEY";function DS(e,t=null,i){const{depth:s,rootValues:r,value:n,children:o}=e;if(r)return r.map(e=>By({[TS]:t},e));if(0===s)return[By({[TS]:t},n)];const a=[];for(const[e,t]of o.entries())a.push(...DS(t,e,!0));return i?[By({[TS]:t,children:a},null!=n?n:{})]:a}function IS(e,t,i){const s={depth:0,children:new Map};return e.forEach(e=>{r(e,t(e),i,0,s)}),s;function r(e,t,i,s,n){if(s===t)return 0===s?(n.rootValues||(n.rootValues=[]),n.rootValues.push(e)):n.value=e,n;{const o=i(e,s),a=r(e,t,i,s+1,n.children.get(o)||{depth:0,children:new Map});return n.children.set(o,a),n.depth=Math.max(1+a.depth,n.depth),n}}}var RS=class extends eS{constructor(e){super(e)}getUpdateOptions(e,t){const{fields:i}=e,[s,r]=i;return Vy(By({},t),{series:this.getSeries(s,r),data:this.getData(e,s,r)})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}}}}getSeries(e,t){var i,s;return[{type:this.standaloneChartType,labelKey:TS,sizeKey:null==e?void 0:e.colId,sizeName:null!=(i=null==e?void 0:e.displayName)?i:void 0,colorKey:null==t?void 0:t.colId,colorName:null!=(s=null==t?void 0:t.displayName)?s:void 0}]}getData(e,t,i){var s;const{categories:n,data:o,groupData:a,grouping:l}=e;return l?function(e,t){return DS(IS(e,function(e){var i,s;return null!=(s=null==(i=t(e))?void 0:i.length)?s:0},function(e,i){const s=t(e);return s?s[s.length-1-i]:null}))}(i?o.concat(null!=(s=null==a?void 0:a.map(e=>{const i=By({},e);return delete i[t.colId],i}))?s:[]):o,e=>{var t,i;return null!=(i=null==(t=e[r.JPk])?void 0:t.labels)?i:null}):function(e,t){return DS(IS(e,function(e){return t.length},function(e,i){return null==(s=e[t[i]])?null:String(s);var s}))}(o,n.map(({id:e})=>e))}},PS=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.params=t}init(){const e=Vy(By({},this.params),{chartType:iv(this.params.chartType),chartThemeName:this.getThemeName()}),t=this.gos.get("enableRtl");this.addCssClass(t?"ag-rtl":"ag-ltr");const i=this.createBean(new hv(e));this.chartController=this.createManagedBean(new Lv(i)),this.chartOptionsService=this.createManagedBean(new SS(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog&&this.addDialog(),this.addMenu(),this.addTitleEditComp(),this.addManagedListener(this.getGui(),"focusin",this.setActiveChartCellRange.bind(this)),this.addManagedListener(this.chartController,Lv.EVENT_CHART_MODEL_UPDATE,this.update.bind(this)),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}createChart(){var t;let i;this.chartProxy&&(i=this.chartProxy.destroy({keepChartInstance:!0}));const s=this.chartController.getChartType(),r={chartType:s,chartInstance:i,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>{var e,t;return null!=(t=null==(e=this.chartMenu)?void 0:e.getExtraPaddingDirections())?t:[]},apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:null!=(t=this.params.crossFiltering)&&t,crossFilterCallback:(e,t)=>{this.params.crossFilteringContext.lastSelectedChartId=t?"":this.chartController.getChartId(),t&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(e,t)},parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:e=>this.chartTranslationService.translate(e)};if(this.params.chartOptionsToRestore=void 0,this.chartType=s,this.chartProxy=e.createChartProxy(r),!this.chartProxy)return void console.warn("AG Grid: invalid chart type supplied: ",r.chartType);const n=this.eChart.querySelector("canvas");n&&n.classList.add("ag-charts-canvas"),this.chartController.setChartProxy(this.chartProxy),this.createMenuContext(),this.titleEdit&&this.titleEdit.refreshTitle(this.chartMenuContext)}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new oC(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new oC(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}static createChartProxy(e){switch(e.chartType){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new nS(e);case"pie":case"donut":case"doughnut":return new cS(e);case"area":case"stackedArea":case"normalizedArea":return new oS(e);case"line":return new aS(e);case"scatter":case"bubble":return new hS(e);case"histogram":return new pS(e);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new lS(e);case"rangeBar":case"rangeArea":return new uS(e);case"boxPlot":return new gS(e);case"treemap":case"sunburst":return new RS(e);case"heatmap":return new mS(e);case"waterfall":return new vS(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new wS(e);default:throw`AG Grid: Unable to create chart as an invalid chartType = '${e.chartType}' was supplied.`}}addDialog(){const e=this.chartTranslationService.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:i}=this.getBestDialogSize();this.chartDialog=new r.fNJ({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:i,component:this,centered:!0,closable:!0}),this.getContext().createBean(this.chartDialog),this.chartDialog.addEventListener(r.fNJ.EVENT_DESTROYED,()=>{this.destroy(),this.chartMenuService.hideAdvancedSettings()})}getBestDialogSize(){const e=this.popupService.getPopupParent(),t=.75*r._.getAbsoluteWidth(e),i=.75*r._.getAbsoluteHeight(e),s=this.chartProxy.getChart();let n=this.params.insideDialog?850:s.width,o=this.params.insideDialog?470:s.height;return(n>t||o>i)&&(n=Math.min(n,t),o=Math.round(.553*n),o>i&&(o=i,n=Math.min(n,Math.round(o/.553)))),{width:n,height:o}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new Xb(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}addTitleEditComp(){this.titleEdit=this.createBean(new Qb(this.chartMenu)),this.eTitleEditContainer.appendChild(this.titleEdit.getGui()),this.chartProxy&&this.titleEdit.refreshTitle(this.chartMenuContext)}update(e){if((null==e?void 0:e.chartId)&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),i=t||this.chartEmpty?(e=>{const t=this.chartType,i=e,s=this.chartProxy.getChart(),r=null==s?void 0:s.getOptions(),n=null==s?void 0:s.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(r,n,t,null!=i?i:t)})(t):void 0;t&&this.createChart();const s=i&&(null==e?void 0:e.chartThemeOverrides)?yv(i,e.chartThemeOverrides):i||(null==e?void 0:e.chartThemeOverrides);this.updateChart(s),(null==e?void 0:e.chartId)&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,i=this.chartController.getSelectedValueColState(),s=this.chartController.getChartData(),r=this.handleEmptyChart(s,i.length);if(this.chartEmpty=r,r)return void(e&&this.chartController.updateThemeOverrides(e));let n=this.chartController.getChartUpdateParams(e);t.update(n),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()}),this.titleEdit.refreshTitle(this.chartMenuContext)}chartTypeChanged(e){const[t,i]=[this.chartController.getChartType(),null==e?void 0:e.chartType],s=i?iv(i):void 0;return this.chartType!==t?null!=s?s:t:s&&t!==s?s:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const i=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),s=this.chartController.getChartType();let n=1;this.chartController.isActiveXYChart()?n="bubble"===s?3:2:tv(rv(s))&&(n=0);const o=t<n||0===e.length;if(this.eChart){const e=i||o;r._.setDisplayed(this.eChart,!e),r._.setDisplayed(this.eEmpty,e)}return i?(this.eEmpty.innerText=this.chartTranslationService.translate("pivotChartRequiresPivotMode"),!0):!!o&&(this.eEmpty.innerText=this.chartTranslationService.translate("noDataToChart"),!0)}downloadChart(e,t,i){this.chartProxy.downloadChart(e,t,i)}openChartToolPanel(e){const t=e?MS[e]:e;this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||(this.chartController.setChartRange(!0),this.focusService.clearFocusedCell())}getThemeName(){const e=this.gos.get("chartThemes")||Pv;if(0===e.length)throw new Error("Cannot create chart: no chart themes available.");const{chartThemeName:t}=this.params;return r._.includes(e,t)?t:e[0]}getAllKeysInObjects(e){const t={};return e.filter(e=>null!=e).forEach(e=>{Object.keys(e).forEach(e=>t[e]=null)}),Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");t&&this.getAllKeysInObjects([t]).forEach(t=>{r._.includes(e,t)||console.warn("AG Grid: a custom chart theme with the name '"+t+"' has been supplied but not added to the 'chartThemes' list")})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,i=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:i})}raiseChartCreatedEvent(){const e={type:r.sVA.EVENT_CHART_CREATED,chartId:this.chartController.getChartId()};this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventService.dispatchEvent(e)})}raiseChartDestroyedEvent(){const e={type:r.sVA.EVENT_CHART_DESTROYED,chartId:this.chartController.getChartId()};this.eventService.dispatchEvent(e)}destroy(){var e;super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.destroyBean(this.titleEdit),this.chartDialog&&this.chartDialog.isAlive()&&this.destroyBean(this.chartDialog),null==(e=this.onDestroyColorSchemeChangeListener)||e.call(this);const t=this.getGui();r._.clearElement(t),r._.removeFromParent(t),this.raiseChartDestroyedEvent()}};PS.TEMPLATE='<div class="ag-chart" tabindex="-1">\n            <div ref="eChartContainer" tabindex="-1" class="ag-chart-components-wrapper">\n                <div ref="eChart" class="ag-chart-canvas-wrapper"></div>\n                <div ref="eEmpty" class="ag-chart-empty-text ag-unselectable"></div>\n            </div>\n            <div ref="eTitleEditContainer"></div>\n            <div ref="eMenuContainer" class="ag-chart-docked-container" style="min-width: 0px;"></div>\n        </div>',Uy([(0,r.PIB)("eChart")],PS.prototype,"eChart",2),Uy([(0,r.PIB)("eChartContainer")],PS.prototype,"eChartContainer",2),Uy([(0,r.PIB)("eMenuContainer")],PS.prototype,"eMenuContainer",2),Uy([(0,r.PIB)("eEmpty")],PS.prototype,"eEmpty",2),Uy([(0,r.PIB)("eTitleEditContainer")],PS.prototype,"eTitleEditContainer",2),Uy([(0,r.dsm)("chartCrossFilterService")],PS.prototype,"crossFilterService",2),Uy([(0,r.dsm)("chartTranslationService")],PS.prototype,"chartTranslationService",2),Uy([(0,r.dsm)("chartMenuService")],PS.prototype,"chartMenuService",2),Uy([(0,r.dsm)("focusService")],PS.prototype,"focusService",2),Uy([(0,r.dsm)("popupService")],PS.prototype,"popupService",2),Uy([r.o7C],PS.prototype,"init",1);var kS=PS,LS="31.3.4";function NS(e){return e=ew("chartOptions.legend.item.marker.type","shape",e),e=ew("chartOptions.seriesDefaults.marker.type","shape",e),ew("chartOptions.legend.padding","spacing",e)}function _S(e){var t;const i=e=tw("chartOptions.seriesDefaults.marker.minSize",e),{chartType:s,chartPalette:r,chartOptions:n}=i,o=n,{xAxis:a,yAxis:l}=o,c=Hy(o,["xAxis","yAxis"]),h=Hy(i,["chartType","chartPalette","chartOptions"]),d=function(e){switch(e){case"bar":case"stackedBar":case"normalizedBar":return["number","category"];case"groupedBar":return["number","grouped-category"];case"column":case"stackedColumn":case"normalizedColumn":case"line":case"area":case"stackedArea":case"normalizedArea":case"histogram":return["category","number"];case"groupedColumn":return["grouped-category","number"];case"scatter":case"bubble":return["number","number"];default:return}}(s),u=null==d?void 0:d.map((e,t)=>By({type:e},0===t?a:l));return By({chartType:s,chartThemeName:null!=(t={borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[r])?t:"ag-default",chartOptions:Vy(By({},c),{axes:u,xAxis:a,yAxis:l})},h)}function OS(e){return ew("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e)}function FS(e){return e=tw("chart",e=sw("chartOptions.seriesDefaults.highlightStyle",e,e=>{var t=e,{dimOpacity:i}=t,s=Hy(t,["dimOpacity"]);return By(By({},s),null!=i?{series:{dimOpacity:i}}:{})})),e=tw("chartOptions.seriesDefaults.tooltipClass",e),e=qS("chartOptions.axes[].label.rotation",0,e=tw("chartOptions.seriesDefaults.tooltipTracking",e)),qS("chartOptions.axes[].label.rotation",335,e)}function GS(e){const t=e=>{var t=e,{item:i,series:s}=t,r=Hy(t,["item","series"]);return By({item:By(By({},r),i)},s?{series:s}:{})};return e=sw("chartOptions.seriesDefaults.highlightStyle",e,t),sw("chartOptions.series[].highlightStyle",e,t)}function BS(e){e=QS("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=QS("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=tw("chartOptions.seriesDefaults.fill",e=QS("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e)),e=tw("chartOptions.seriesDefaults.stroke",e),e=tw("chartOptions.seriesDefaults.callout.colors",e),e=tw("chartOptions.xAxis",e);const t=e=tw("chartOptions.yAxis",e),{chartType:i,chartOptions:s}=t,r=s,{axes:n,series:o,seriesDefaults:a}=r,l=Hy(r,["axes","series","seriesDefaults"]),c=Hy(t,["chartType","chartOptions"]),h=iv(i),d=rv(h),u=[d],p={};if(!nv(d)){const e={top:{},bottom:{},left:{},right:{}},t=n.map(t=>{var i=t,{type:s}=i,r=Hy(i,["type"]);return{[s]:By(By({},e),r)}}).reduce(rw,{});dv.filter(e=>null==t[e]).forEach(i=>{t[i]=By({},e)}),p.axes=t}const g=u.map(e=>({[e]:By(Vy(By({},p),{series:a}),l)})).reduce(rw,{});return Vy(By({},c),{chartType:h,chartOptions:g})}function VS(e){return e=tw("chartOptions.*.title.padding",e),e=tw("chartOptions.*.subtitle.padding",e),XS("chartOptions.*.axes.*.title.enabled",!1,e=tw("chartOptions.*.axes.*.title.padding",e))}function HS(e){return e=ew("chartOptions.pie.series.callout","calloutLine",e),e=ew("chartOptions.pie.series.label","calloutLabel",e),e=ew("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=ew("chartOptions.pie.series.labelName","sectorLabelName",e),e=ew("chartOptions.donut.series.callout","calloutLine",e),e=ew("chartOptions.donut.series.label","calloutLabel",e),e=ew("chartOptions.donut.series.labelKey","sectorLabelKey",e),ew("chartOptions.donut.series.labelName","sectorLabelName",e)}function US(e){return e=JS("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=JS("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=JS("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=JS("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),QS("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e=JS("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e))}function zS(e){return tw("chartOptions.axes[].tick.count",e)}function WS(e){return sw("chartOptions.*.tooltip",e,e=>{var t=e,{tracking:i}=t,s=Hy(t,["tracking"]);const r=By({},s);return!1===i?(null!=r.position||(r.position={type:"pointer"}),null!=r.range||(r.range="nearest")):!0===i&&(null!=r.position||(r.position={type:"node"}),null!=r.range||(r.range="nearest")),r})}function jS(e){return e=ew("chartOptions.pie.series.labelKey","sectorLabelKey",e),XS("chartOptions.common.legend.position","right",e=ZS("chartOptions.common.legend.enabled",!0,e=tw("chartOptions.*.series.flipXY",e=WS(e=zS(e=ew("chartOptions.pie.series.labelName","sectorLabelName",e))))))}function KS(e){const t=ew("chartOptions.column","bar",e),i={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"}[t.chartThemeName]||t.chartThemeName;return Vy(By({},t),{chartThemeName:i})}function $S(e,t,i){if(YS(e)>YS(t.version)){const s=i(t);return s.version=e,s}return t}function YS(e){const{major:t,minor:i,patch:s}=function(e){const t="string"==typeof e?e.split(".").map(e=>Number(e)):[];if(3!==t.length||t.some(e=>isNaN(e)))throw new Error("AG Grid - Illegal version string: "+e);return{major:t[0],minor:t[1],patch:t[2]}}(e);return 1e4*t+100*i+s}function qS(e,t,i){return iw(e,!0,i,(e,i)=>{e[i]===t&&delete e[i]})}function XS(e,t,i){return iw(e,!1,i,(e,i)=>{null==e[i]&&(e[i]=t)})}function ZS(e,t,i){var s;"string"==typeof e&&(e=e.split("."));const r=e[0];return e.length>1&&(i[r]=ZS(e.slice(1),t,null!=(s=i[r])?s:{})),Object.keys(i).includes(r)||(i[r]=t),i}function QS(e,t,i){let s,r=!1;return i=iw(e,!0,i,(e,t)=>{r=!0,s=e[t],delete e[t]}),r?iw(t,!1,i,(e,t)=>{e[t]=s}):i}function JS(e,t,i){let s,r=!1;return i=iw(e,!0,i,(e,t)=>{r=!0,s=e[t],delete e[t]}),r?iw(t,!1,i,(e,t)=>{void 0===e[t]&&(e[t]=s)}):i}function ew(e,t,i){return iw(e,!0,i,(e,i)=>{e[t]=e[i],delete e[i]})}function tw(e,t){return iw(e,!0,t,(e,t)=>delete e[t])}function iw(e,t,i,s){const r=e instanceof Array?e:e.split("."),n=r.slice(0,r.length-1),o=r[r.length-1];return sw(n,i,e=>{const i=Object.keys(e).includes(o);if(t&&!i)return e;const r=By({},e);return s(r,o),r})}function sw(e,t,i){const s=e instanceof Array?e:e.split(".");if(t=By({},t),0===s.length)return i(t);if(s[0].startsWith("{")){const e=s[0].substring(1,s[0].lastIndexOf("}")).split(",");for(const r of e)null!=t[r]&&(t[r]=sw(s.slice(1),t[r],i))}else if(s[0].endsWith("[]")){const r=s[0].substring(0,e[0].indexOf("["));t[r]instanceof Array&&(t[r]=t[r].map(e=>sw(s.slice(1),e,i)))}else if("*"===s[0])for(const e in t)t[e]=sw(s.slice(1),t[e],i);else null!=t[s[0]]&&(t[s[0]]=sw(s.slice(1),t[s[0]],i));return t}var rw=(e,t)=>By(By({},e),t),nw=class extends r.XQb{constructor(){super(...arguments),this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>Wm.enterpriseModule.isEnterprise}updateChart(e){if(0===this.activeChartComps.size)return void console.warn("AG Grid - No active charts to update.");const t=[...this.activeChartComps].find(t=>t.getChartId()===e.chartId);t?t.update(e):console.warn(`AG Grid - Unable to update chart. No active chart found with ID: ${e.chartId}.`)}getChartModels(){const e=[];return this.activeChartComps.forEach(t=>e.push((e=>Vy(By({},e),{version:LS}))(t.getChartModel()))),e}getChartRef(e){let t;return this.activeCharts.forEach(i=>{i.chartId===e&&(t=i)}),t}getChartComp(e){let t;return this.activeChartComps.forEach(i=>{i.getChartId()===e&&(t=i)}),t}getChartImageDataURL(e){let t;return this.activeChartComps.forEach(i=>{i.getChartId()===e.chartId&&(t=i.getChartImageDataURL(e.fileFormat))}),t}downloadChart(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId);null==t||t.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId);null==t||t.openChartToolPanel(e.panel)}closeChartToolPanel(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e);null==t||t.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn"){const t=this.getSelectedRange();return this.createChart({cellRange:t,chartType:e})}restoreChart(e,t){if(!e)return void console.warn("AG Grid - unable to restore chart as no chart model is provided");let i,s,r,n;return e.version!==LS&&(e=function(e){return e.version,null==e.version&&(e.version=function(e){var t,i;const s=e;if(null!=e.version)return e.version;const r=(e,...t)=>Object.keys(e||{}).some(e=>t.includes(e)),n=s.chartOptions,o=r(n,"seriesDefaults")?null==n?void 0:n.seriesDefaults:null==n?void 0:n[Object.keys(n)[0]],a={"27.0.0":r(s,"seriesChartTypes"),"26.2.0":!r(n,"seriesDefaults"),"26.1.0":r(null==o?void 0:o.highlightStyle,"item"),"26.0.0":r(null==o?void 0:o.highlightStyle,"series"),"25.1.0":r(null==o?void 0:o.label,"minAngle"),"25.0.0":r(s,"modelType","aggFunc","unlinkChart","suppressChartRanges")||r(o,"lineDash","lineDashOffset"),"24.0.0":r(s,"chartThemeName","chart")||r(n,"series"),"23.2.0":r(n,"navigator"),"23.0.0":r(null==(i=null==(t=null==n?void 0:n.legend)?void 0:t.item)?void 0:i.marker,"shape"),"22.1.0":r(s,"chartPalette","chartType")},l="27.1.0",c=Object.entries(a).filter(([e,t])=>t),[h=l]=c[0];return h}(e)),e=$S("23.0.0",e,NS),e=$S("24.0.0",e,_S),e=$S("25.1.0",e,OS),e=$S("26.0.0",e,FS),e=$S("26.1.0",e,GS),e=$S("26.2.0",e,BS),e=$S("28.0.0",e,VS),e=$S("28.2.0",e,HS),e=$S("29.0.0",e,US),e=$S("29.1.0",e,zS),e=$S("29.2.0",e,WS),e=$S("30.0.0",e,jS),e=function(e){return e=tw("chartOptions.*.width",e),XS("chartOptions.*.axes.category.label.autoRotate",!0,e=tw("chartOptions.*.height",e))}(e=$S("31.0.0",e,KS)),$S(LS,e,e=>e)}(e)),"pivot"===e.modelType?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),i=this.createCellRange(void 0,!0),s=!0,r=!0):(i=this.createCellRange(e.cellRange),n=e.chartPalette),i?this.createChart(Vy(By({},e),{cellRange:i,pivotChart:s,suppressChartRanges:r,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:n})):void 0}createRangeChart(e){const t=this.createCellRange(e.cellRange);if(t)return this.createChart(Vy(By({},e),{cellRange:t}))}createPivotChart(e){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const t=this.createCellRange(void 0,!0);if(t)return this.createChart(Vy(By({},e),{cellRange:t,pivotChart:!0,suppressChartRanges:!0}))}createCrossFilterChart(e){const t=this.createCellRange(e.cellRange);if(!t)return;const i=!(void 0!==e.suppressChartRanges&&null!==e.suppressChartRanges)||e.suppressChartRanges;return this.createChart(Vy(By({},e),{cellRange:t,suppressChartRanges:i,crossFiltering:!0}))}createChart(e){const t=Rv.validateCreateParams(e);if(!t)return;e=!0===t?e:t;const{chartType:i,chartContainer:s}=e,r=this.gos.getCallback("createChartContainer"),n=Vy(By({},e),{chartId:this.generateId(),chartType:iv(i),insideDialog:!(s||r),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>this.activeChartComps.forEach(e=>e.crossFilteringReset())}),o=new kS(n);this.context.createBean(o);const a=this.createChartRef(o);if(s){s.appendChild(o.getGui());const e=this.environment.getTheme();e.el&&!e.el.contains(s)&&s.classList.add(e.theme)}else r?r(a):o.addEventListener(kS.EVENT_DESTROYED,()=>{this.activeChartComps.delete(o),this.activeCharts.delete(a)});return a}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.context.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){var e,t;const i=null!=(t=null==(e=this.rangeService)?void 0:e.getCellRanges())?t:[];return i.length>0?i[0]:{columns:[]}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){var i;const s=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.columnModel.getAllDisplayedColumns().map(e=>e.getColId())}:e,r=s&&(null==(i=this.rangeService)?void 0:i.createPartialCellRangeFromRangeParams(s,!0));return r||console.warn(`AG Grid - unable to create chart as ${t?"there are no columns in the grid":"no range is selected"}.`),r}destroyAllActiveCharts(){this.activeCharts.forEach(e=>e.destroyChart())}};nw.CHARTS_VERSION=Rm,Uy([(0,r.dsm)("columnModel")],nw.prototype,"columnModel",2),Uy([(0,r.Xx1)("rangeService")],nw.prototype,"rangeService",2),Uy([r.yah],nw.prototype,"destroyAllActiveCharts",1),nw=Uy([(0,r.dR4)("chartService")],nw);var ow=class extends r.XQb{translate(e){return this.localeService.getLocaleTextFunc()(e,ow.DEFAULT_TRANSLATIONS[e])}};ow.DEFAULT_TRANSLATIONS={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Data",format:"Format",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",orientation:"Orientation",polygon:"Polygon",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chart:"Chart",title:"Title",titlePlaceholder:"Chart title - double click to edit",background:"Background",font:"Font",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",heatmapTooltip:"Heatmap",waterfallTooltip:"Waterfall",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",group:"Group",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",area:"Area",bar:"Bar",column:"Column",line:"Line",scatter:"Scatter",histogram:"Histogram",radialColumn:"Radial Column",radialBar:"Radial Bar",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",boxPlot:"Box Plot",pie:"Pie",donut:"Donut",stackedArea:"StackedArea",groupedColumn:"Grouped Column",stackedColumn:"Stacked Column",advancedSettings:"Advanced Settings",ariaChartMenuClose:"Close Chart Edit Menu",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked"},ow=Uy([(0,r.dR4)("chartTranslationService")],ow);var aw=class extends r.XQb{filter(e,t=!1){const i=this.gridApi.getFilterModel();if(t)return void this.resetFilters(i);let s=aw.extractFilterColId(e);this.isValidColumnFilter(s)?this.updateFilters(i,e,s):console.warn("AG Grid: cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: '"+s+"'")}resetFilters(e){Object.keys(e).length>0&&(this.gridApi.setFilterModel(null),this.gridApi.onFilterChanged())}updateFilters(e,t,i){let s=aw.extractFilterColId(t),n=t.datum[s];if(void 0===n)return;let o=n.toString();if(t.event.metaKey||t.event.ctrlKey){const t=this.getCurrentGridValuesForCategory(i);let s;r._.includes(t,o)?s=t.filter(e=>e!==o):(s=t,s.push(o)),e[i]=this.getUpdatedFilterModel(i,s)}else{const t=[o];e={[i]:this.getUpdatedFilterModel(i,t)}}this.gridApi.setFilterModel(e)}getUpdatedFilterModel(e,t){return"agMultiColumnFilter"===this.getColumnFilterType(e)?{filterType:"multi",filterModels:[null,{filterType:"set",values:t}]}:{filterType:"set",values:t}}getCurrentGridValuesForCategory(e){let t=[];const i=this.getColumnById(e);return this.gridApi.forEachNodeAfterFilter(e=>{if(i&&!e.group){const s=this.valueService.getValue(i,e)+"";t.includes(s)||t.push(s)}}),t}static extractFilterColId(e){return e.xKey||e.calloutLabelKey}isValidColumnFilter(e){e.indexOf("-filtered-out")&&(e=e.replace("-filtered-out",""));let t=this.getColumnFilterType(e);return"boolean"==typeof t?t:r._.includes(["agSetColumnFilter","agMultiColumnFilter"],t)}getColumnFilterType(e){let t=this.getColumnById(e);if(t)return t.getColDef().filter}getColumnById(e){return this.columnModel.getGridColumn(e)}};function lw(e){return e&&e.match(/\d+\.\d+\.\d+/)}function cw({type:e,gridVersion:t,chartsVersion:i}){const s="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return s;const r=function(e){if(!e||!lw(e))return;const[t,i]=e.split(".")||[],s=`${t}.${i}.x`,r=parseInt(t,10)-28+6;return r<0?void 0:{gridMajorMinor:s,chartsMajorMinor:`${r}.${i}.x`}}(t);if(!r)return s;const{gridMajorMinor:n,chartsMajorMinor:o}=r;return"incompatible"===e?`AG Grid version ${t} and AG Charts version ${i} is not supported. AG Grid version ${n} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:"invalidCharts"===e?`AG Grid version ${n} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:s}Uy([(0,r.dsm)("gridApi")],aw.prototype,"gridApi",2),Uy([(0,r.dsm)("columnModel")],aw.prototype,"columnModel",2),Uy([(0,r.dsm)("valueService")],aw.prototype,"valueService",2),aw=Uy([(0,r.dR4)("chartCrossFilterService")],aw);var hw=class extends r.XQb{showMenuList(e){const{eventSource:t,showMenu:i,chartMenuContext:s}=e,r=this.chartMenuService.doChartToolPanelsExist(s.chartController),n=this.mapWithStockItems(this.getMenuItems(s.chartController,r),s,i,t,r);if(!n.length)return;const o=this.createBean(new dw(n));this.activeChartMenuList=o;let a=-1,l="left";this.gos.get("enableRtl")&&(a=1,l="right");const c=o.getGui();this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:()=>{this.destroyBean(o),this.activeChartMenuList=void 0;const e=this.gos.getDocument(),i=this.gos.getActiveDomElement();i&&i!==e.body||t.focus({preventScroll:!0})},afterGuiAttached:e=>o.afterGuiAttached(e),positionCallback:()=>{this.popupService.positionPopupByComponent({type:"chartMenu",eventSource:t,ePopup:c,alignSide:l,nudgeX:4*a,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(e,t){const i=[...t?["chartEdit"]:[],...e.isEnterprise()?["chartAdvancedSettings"]:[],e.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],s=this.gos.get("chartMenuItems");return s?Array.isArray(s)?s:s(this.gos.addGridCommonParams({defaultItems:i})):i}mapWithStockItems(e,t,i,s,r){if(!e)return[];const n=[];return e.forEach(e=>{let o;if(o="string"==typeof e?this.getStockMenuItem(e,t,i,s,r):By({},e),!o)return;const{subMenu:a}=o;Array.isArray(a)&&(o.subMenu=this.mapWithStockItems(a,t,i,s,r)),n.push(o)}),n}getStockMenuItem(e,t,i,s,r){switch(e){case"chartEdit":return r?this.createMenuItem(this.chartTranslationService.translate("chartEdit"),"chartsMenuEdit",i):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslationService.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuService.openAdvancedSettings(t,s));case"chartUnlink":return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslationService.translate("chartUnlink"),"unlinked",()=>this.chartMenuService.toggleLinked(t)):null;case"chartLink":return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslationService.translate("chartLink"),"linked",()=>this.chartMenuService.toggleLinked(t));case"chartDownload":return this.createMenuItem(this.chartTranslationService.translate("chartDownload"),"save",()=>this.chartMenuService.downloadChart(t))}return null}createMenuItem(e,t,i){return{name:e,icon:r._.createIconNoSpan(t,this.gos,null),action:i}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}};Uy([(0,r.dsm)("popupService")],hw.prototype,"popupService",2),Uy([(0,r.dsm)("chartMenuService")],hw.prototype,"chartMenuService",2),Uy([(0,r.dsm)("chartTranslationService")],hw.prototype,"chartTranslationService",2),hw=Uy([(0,r.dR4)("chartMenuListFactory")],hw);var dw=class extends r.uAl{constructor(e){super('\n            <div ref="eChartsMenu" role="presentation" class="ag-menu ag-chart-menu-popup"></div>\n        '),this.menuItems=e}init(){this.mainMenuList=this.createManagedBean(new r.i9O(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener(r.yuY.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){var e;null==(e=this.hidePopupFunc)||e.call(this)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};Uy([(0,r.dsm)("focusService")],dw.prototype,"focusService",2),Uy([(0,r.PIB)("eChartsMenu")],dw.prototype,"eChartsMenu",2),Uy([r.o7C],dw.prototype,"init",1);var uw=class e extends r.uAl{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(e.TEMPLATE,{animationGroup:t,animationHeightInput:i})}};uw.TEMPLATE='<div>\n            <ag-group-component ref="animationGroup">\n                <ag-input-number-field ref="animationHeightInput"></ag-input>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],uw.prototype,"chartTranslationService",2),Uy([r.o7C],uw.prototype,"init",1);var pw=uw,gw=class e extends r.uAl{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),s=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),r=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(e.TEMPLATE,{crosshairGroup:t,crosshairLabelCheckbox:i,crosshairSnapCheckbox:s,crosshairStrokeColorPicker:r})}};gw.TEMPLATE='<div>\n            <ag-group-component ref="crosshairGroup">\n                <ag-checkbox ref="crosshairLabelCheckbox"></ag-checkbox>\n                <ag-checkbox ref="crosshairSnapCheckbox"></ag-checkbox>\n                <ag-color-picker ref="crosshairStrokeColorPicker"></ag-color-picker>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],gw.prototype,"chartTranslationService",2),Uy([r.o7C],gw.prototype,"init",1);var mw=gw,fw=class e extends r.uAl{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);i.minValue=10;const s=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(e.TEMPLATE,{navigatorGroup:t,navigatorHeightSlider:i,navigatorMiniChartCheckbox:s})}};fw.TEMPLATE='<div>\n            <ag-group-component ref="navigatorGroup">\n                <ag-slider ref="navigatorHeightSlider"></ag-slider>\n                <ag-checkbox ref="navigatorMiniChartCheckbox"></ag-checkbox>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],fw.prototype,"chartTranslationService",2),Uy([r.o7C],fw.prototype,"init",1);var yw=fw,vw=class e extends r.uAl{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),s=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);s.step=.01,s.minValue=s.step;const r=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");i.onValueChange=(e=>t=>{e&&(e(t),this.zoomScrollingStepInput.setDisabled(!t))})(i.onValueChange),this.setTemplate(e.TEMPLATE,{zoomGroup:t,zoomScrollingCheckbox:i,zoomScrollingStepInput:s,zoomSelectingCheckbox:r}),this.zoomScrollingStepInput.setDisabled(!i.value)}};vw.TEMPLATE='<div>\n            <ag-group-component ref="zoomGroup">\n                <ag-checkbox ref="zoomSelectingCheckbox"></ag-checkbox>\n                <ag-checkbox ref="zoomScrollingCheckbox"></ag-checkbox>\n                <ag-slider ref="zoomScrollingStepInput"></ag-slider>\n            </ag-group-component>\n        </div>',Uy([(0,r.dsm)("chartTranslationService")],vw.prototype,"chartTranslationService",2),Uy([(0,r.PIB)("zoomScrollingStepInput")],vw.prototype,"zoomScrollingStepInput",2),Uy([r.o7C],vw.prototype,"init",1);var Cw=vw,bw=["navigator","zoom","animation","crosshair"],Sw=class e extends r.uAl{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}postConstruct(){this.chartPanelFeature=this.createManagedBean(new UC(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){bw.forEach(e=>{if(!this.isGroupPanelShownForSeries(e,t))return;const i=this.createPanel(e);this.chartPanelFeature.addComponent(i)})}isGroupPanelShownForSeries(e,t){return"animation"===e||Jy(t)}createPanel(e){const{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:i}=this.chartMenuContext;switch(e){case"navigator":return new yw(t);case"zoom":return new Cw(t);case"animation":return new pw(t);case"crosshair":return new mw(i)}}};Sw.TEMPLATE='<div class="ag-chart-advanced-settings-wrapper"></div>',Uy([r.o7C],Sw.prototype,"postConstruct",1);var ww=Sw,xw=class extends r.XQb{showMenu(e,t){this.hideMenu();const i=this.createBean(new Mw(e));this.activeDialog=this.createBean(new r.fNJ({title:this.chartTranslationService.translate("advancedSettings"),component:i,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var e;null==(e=this.focusService.findFocusableElements(i.getGui())[0])||e.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,null==t||t.focus({preventScroll:!0})}})),this.activeMenu=i}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}};Uy([(0,r.dsm)("focusService")],xw.prototype,"focusService",2),Uy([(0,r.dsm)("chartTranslationService")],xw.prototype,"chartTranslationService",2),xw=Uy([(0,r.dR4)("advancedSettingsMenuFactory")],xw);var Ew=class e extends r.aJZ{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new ww(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(e){if(e.defaultPrevented)return;e.preventDefault();const t=e.shiftKey,i=this.advancedSettingsPanel.getGui(),s=this.focusService.findNextFocusableElement(i,!1,t);if(s)s.focus();else{const e=this.focusService.findFocusableElements(i);e.length&&e[t?e.length-1:0].focus()}}};Ew.TEMPLATE='<div class="ag-chart-advanced-settings"></div>',Uy([(0,r.dsm)("focusService")],Ew.prototype,"focusService",2),Uy([r.o7C],Ew.prototype,"postConstruct",1);var Mw=Ew,Aw={version:LS,validate:()=>function({gridVersion:e,chartsVersion:t}){if(!lw(t))return{isValid:!1,message:cw({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!lw(e))return{isValid:!1,message:cw({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[i,s]=e.split(".")||[],[r,n,o]=t.split(".")||[],a=function({gridMajorVersion:e,chartsMajorVersion:t}){const i=parseInt(e,10)-28;return i===parseInt(t,10)-6&&i>=0}({gridMajorVersion:i,chartsMajorVersion:r});return a&&s===n||o.includes("beta")?{isValid:!0}:a&&s===n?{isValid:!1,message:cw({type:"invalid",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:cw({type:"incompatible",gridVersion:e,chartsVersion:t})}}({gridVersion:LS,chartsVersion:nw.CHARTS_VERSION}),moduleName:r.zsj.GridChartsModule,beans:[nw,ow,aw,hw,AS,xw],agStackComponents:[{componentName:"AgColorPicker",componentClass:MC},{componentName:"AgAngleSelect",componentClass:nC},{componentName:"AgPillSelect",componentClass:_v}],dependantModules:[Ry,mf]},Tw=0,Dw={time:I,AgChart:Tm},Iw=Object.defineProperty,Rw=Object.getOwnPropertyDescriptor,Pw=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Rw(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Iw(t,i,n),n},kw="paste",Lw="dragCopy",Nw="clipboard",_w=e=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,Ow=class extends r.XQb{constructor(){super(...arguments),this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}init(){this.logger=this.loggerFactory.create("ClipboardService"),"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}pasteFromClipboard(){this.logger.log("pasteFromClipboard"),!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(e=>{r._.doOnce(()=>{console.warn(e),console.warn(_w("readText"))},"clipboardApiError"),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=t=>{const i=(new Date).getTime();i-this.lastPasteOperationTime<50&&(e=!0,t.preventDefault()),this.lastPasteOperationTime=i};this.executeOnTempElement(e=>{e.addEventListener("paste",t),e.focus({preventScroll:!0})},i=>{const s=i.value;e?this.refocusLastFocusedCell():this.processClipboardData(s),i.removeEventListener("paste",t)})}refocusLastFocusedCell(){const e=this.focusService.getFocusedCell();e&&this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return r._.exists(e)?e:"\t"}processClipboardData(e){if(null==e)return;let t=Ow.stringToArray(e,this.getClipboardDelimiter());const i=this.gos.getCallback("processDataFromClipboard");i&&(t=i({data:t})),null!=t&&(this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t),this.doPasteOperation((e,i,s,r)=>{var n;(null==(n=this.rangeService)?void 0:n.isMoreThanOneCell())&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(this.rangeService,t,e,i,r):this.pasteStartingFromFocusedCell(t,e,i,s,r)}))}static stringToArray(e,t=","){const i=[],s=e=>"\r"===e||"\n"===e;let r=!1;if(""===e)return[[""]];for(let n=0,o=0,a=0;a<e.length;a++){const l=e[a-1],c=e[a],h=e[a+1],d=()=>{i[n]||(i[n]=[]),i[n][o]||(i[n][o]="")};if(d(),'"'===c&&(r?'"'===h?(i[n][o]+='"',a++):r=!1:(void 0===l||l===t||s(l))&&(r=!0)),!r&&'"'!==c){if(c===t){o++,d();continue}if(s(c)){o=0,n++,d(),"\r"===c&&"\n"===h&&a++;continue}}i[n][o]+=c}return i}doPasteOperation(e){const t="clipboard";let i;if(this.eventService.dispatchEvent({type:r.sVA.EVENT_PASTE_START,source:t}),this.clientSideRowModel){const e=this.gos.get("aggregateOnlyChangedColumns");i=new r.k$d(e,this.clientSideRowModel.getRootNode())}const s={},n=[];e(s,n,this.focusService.getFocusedCell(),i);const o=[...n];i&&(this.clientSideRowModel.doAggregate(i),i.forEachChangedNodeDepthFirst(e=>{o.push(e)})),this.rowRenderer.refreshCells({rowNodes:o}),this.dispatchFlashCells(s),this.fireRowChanged(n),this.refocusLastFocusedCell();const a={type:r.sVA.EVENT_PASTE_END,source:t};this.eventService.dispatchEvent(a)}pasteIntoActiveRange(e,t,i,s,r){const n=this.getRangeSize(e)%t.length!=0;let o=0,a=0;this.iterateActiveRanges(!1,(e,l,c,h)=>{if(h-o>=t.length){if(n)return;o+=a,a=0}const d=t[h-o];s.push(l);const u=this.gos.getCallback("processCellFromClipboard");c.forEach((t,s)=>{if(!t.isCellEditable(l)||t.isSuppressPaste(l))return;s>=d.length&&(s%=d.length);const n=this.processCell(l,t,d[s],Lw,u,!0);l.setDataValue(t,n,kw),r&&r.addParentNode(l.parent,[t]);const{rowIndex:o,rowPinned:a}=e,c=this.cellPositionUtils.createIdFromValues({rowIndex:o,column:t,rowPinned:a});i[c]=!0}),a++})}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;null!=t;)i.push(t),t=this.columnModel.getDisplayedColAfter(t);return i}pasteStartingFromFocusedCell(e,t,i,s,r){if(!s)return;const n={rowIndex:s.rowIndex,rowPinned:s.rowPinned},o=this.getDisplayedColumnsStartingAt(s.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,i,t,r):this.pasteMultipleValues(e,n,i,o,t,Nw,r)}isPasteSingleValueIntoRange(e){return this.hasOnlyOneValueToPaste(e)&&null!=this.rangeService&&!this.rangeService.isEmpty()}pasteSingleValueIntoRange(e,t,i,s){const r=e[0][0];this.iterateActiveRanges(!1,(e,n,o)=>{t.push(n),o.forEach(e=>this.updateCellValue(n,e,r,i,Nw,s))})}hasOnlyOneValueToPaste(e){return 1===e.length&&1===e[0].length}copyRangeDown(){if(!this.rangeService||this.rangeService.isEmpty())return;const e=[];this.doPasteOperation((t,i,s,r)=>{const n=this.gos.getCallback("processCellForClipboard"),o=this.gos.getCallback("processCellFromClipboard");this.iterateActiveRanges(!0,(s,a,l)=>{e.length?(i.push(a),l.forEach((i,n)=>{if(!i.isCellEditable(a)||i.isSuppressPaste(a))return;const l=this.processCell(a,i,e[n],Lw,o,!0);a.setDataValue(i,l,kw),r&&r.addParentNode(a.parent,[i]);const{rowIndex:c,rowPinned:h}=s,d=this.cellPositionUtils.createIdFromValues({rowIndex:c,column:i,rowPinned:h});t[d]=!0})):l.forEach(t=>{const i=this.processCell(a,t,this.valueService.getValue(t,a),Lw,n,!1,!0);e.push(i)})})})}removeLastLineIfBlank(e){const t=r._.last(e);if(t&&1===t.length&&""===t[0]){if(1===e.length)return;r._.removeFromArray(e,t)}}fireRowChanged(e){"fullRow"===this.gos.get("editType")&&e.forEach(e=>{const t={type:r.sVA.EVENT_ROW_VALUE_CHANGED,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned};this.eventService.dispatchEvent(t)})}pasteMultipleValues(e,t,i,s,r,n,o){let a=t;const l=null!=this.clientSideRowModel&&!this.gos.get("enableGroupEdit")&&!this.gos.get("treeData"),c=()=>{for(;;){if(!a)return null;const e=this.rowPositionUtils.getRowNode(a);if(a=this.cellNavigationService.getRowBelow({rowPinned:a.rowPinned,rowIndex:a.rowIndex}),null==e)return null;if(!(e.detail||e.footer||l&&e.group))return e}};e.forEach(e=>{const t=c();t&&(e.forEach((e,i)=>this.updateCellValue(t,s[i],e,r,n,o)),i.push(t))})}updateCellValue(e,t,i,s,r,n){if(!e||!t||!t.isCellEditable(e)||t.isSuppressPaste(e))return;if(e.group&&t.isValueActive())return;const o=this.processCell(e,t,i,r,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,o,kw);const{rowIndex:a,rowPinned:l}=e;s[this.cellPositionUtils.createIdFromValues({rowIndex:a,column:t,rowPinned:l})]=!0,n&&n.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){if(this.gos.get("suppressCutToClipboard"))return;const i={type:r.sVA.EVENT_CUT_START,source:t};this.eventService.dispatchEvent(i),this.copyOrCutToClipboard(e,!0);const s={type:r.sVA.EVENT_CUT_END,source:t};this.eventService.dispatchEvent(s)}copyOrCutToClipboard(e,t){let{includeHeaders:i,includeGroupHeaders:s}=e;this.logger.log(`copyToClipboard: includeHeaders = ${i}`),null==i&&(i=this.gos.get("copyHeadersToClipboard")),null==s&&(s=this.gos.get("copyGroupHeadersToClipboard"));const r={includeHeaders:i,includeGroupHeaders:s},n=!this.gos.get("suppressCopyRowsToClipboard");let o=null;!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange(this.rangeService)?n&&!this.selectionService.isEmpty()?(this.copySelectedRowsToClipboard(r),o=1):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(r),o=2):(this.copySelectedRangeToClipboard(r),o=0),t&&null!==o&&this.clearCellsAfterCopy(o)}clearCellsAfterCopy(e){if(this.eventService.dispatchEvent({type:r.sVA.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),0===e)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(1===e)this.clearSelectedRows();else{const e=this.focusService.getFocusedCell();if(null==e)return;const t=this.rowPositionUtils.getRowNode(e);t&&this.clearCellValue(t,e.column)}this.eventService.dispatchEvent({type:r.sVA.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}clearSelectedRows(){const e=this.selectionService.getSelectedNodes(),t=this.columnModel.getAllDisplayedColumns();for(const i of e)for(const e of t)this.clearCellValue(i,e)}clearCellValue(e,t){var i;if(!t.isCellEditable(e))return;const s=null!=(i=this.valueService.parseValue(t,e,"",e.getValueFromValueService(t)))?i:null;e.setDataValue(t,s,"clipboardService")}shouldSkipSingleCellRange(e){return this.gos.get("suppressCopySingleCellRanges")&&!e.isMoreThanOneCell()}iterateActiveRanges(e,t,i){if(!this.rangeService||this.rangeService.isEmpty())return;const s=this.rangeService.getCellRanges();e?this.iterateActiveRange(s[0],t,i,!0):s.forEach((e,r)=>this.iterateActiveRange(e,t,i,r===s.length-1))}iterateActiveRange(e,t,i,s){if(!this.rangeService)return;let r=this.rangeService.getRangeStartRow(e);const n=this.rangeService.getRangeEndRow(e);i&&e.columns&&i(e.columns);let o=0,a=!1;for(;!a&&null!=r;){const i=this.rowPositionUtils.getRowNode(r);a=this.rowPositionUtils.sameRow(r,n),t(r,i,e.columns,o++,a&&s),r=this.cellNavigationService.getRowBelow(r)}}copySelectedRangeToClipboard(e={}){if(!this.rangeService||this.rangeService.isEmpty())return;const t=this.rangeService.areAllRangesAbleToMerge(),{data:i,cellsToFlash:s}=t?this.buildDataFromMergedRanges(this.rangeService,e):this.buildDataFromRanges(this.rangeService,e);this.copyDataToClipboard(i),this.dispatchFlashCells(s)}buildDataFromMergedRanges(e,t){const i=new Set,s=e.getCellRanges(),r=new Map,n=[],o={};s.forEach(t=>{t.columns.forEach(e=>i.add(e));const{rowPositions:s,cellsToFlash:a}=this.getRangeRowPositionsAndCellsToFlash(e,t);s.forEach(e=>{const t=`${e.rowIndex}-${e.rowPinned||"null"}`;r.get(t)||(r.set(t,!0),n.push(e))}),Object.assign(o,a)});const a=this.columnModel.getAllDisplayedColumns(),l=Array.from(i);return l.sort((e,t)=>a.indexOf(e)-a.indexOf(t)),{data:this.buildExportParams({columns:l,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:o}}buildDataFromRanges(e,t){const i=e.getCellRanges(),s=[],r={};return i.forEach(i=>{const{rowPositions:n,cellsToFlash:o}=this.getRangeRowPositionsAndCellsToFlash(e,i);Object.assign(r,o),s.push(this.buildExportParams({columns:i.columns,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}),{data:s.join("\n"),cellsToFlash:r}}getRangeRowPositionsAndCellsToFlash(e,t){const i=[],s={},r=e.getRangeStartRow(t),n=e.getRangeEndRow(t);let o=r;for(;o&&(i.push(o),t.columns.forEach(e=>{const{rowIndex:t,rowPinned:i}=o,r=this.cellPositionUtils.createIdFromValues({rowIndex:t,column:e,rowPinned:i});s[r]=!0}),!this.rowPositionUtils.sameRow(o,n));)o=this.cellNavigationService.getRowBelow(o);return{rowPositions:i,cellsToFlash:s}}getCellsToFlashFromRowNodes(e){const t=this.columnModel.getAllDisplayedColumns(),i={};for(let s=0;s<e.length;s++){const{rowIndex:r,rowPinned:n}=e[s];if(null!=r)for(let e=0;e<t.length;e++){const s=t[e];i[this.cellPositionUtils.createIdFromValues({rowIndex:r,column:s,rowPinned:n})]=!0}}return i}copyFocusedCellToClipboard(e={}){const t=this.focusService.getFocusedCell();if(null==t)return;const i=this.cellPositionUtils.createId(t),s={rowPinned:t.rowPinned,rowIndex:t.rowIndex},r=t.column,n=this.buildExportParams({columns:[r],rowPositions:[s],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(n),this.dispatchFlashCells({[i]:!0})}copySelectedRowsToClipboard(e={}){const{columnKeys:t,includeHeaders:i,includeGroupHeaders:s}=e,r=this.buildExportParams({columns:t,includeHeaders:i,includeGroupHeaders:s});this.copyDataToClipboard(r);const n=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(n))}buildExportParams(e){const{columns:t,rowPositions:i,includeHeaders:s=!1,includeGroupHeaders:r=!1}=e,n={columnKeys:t,rowPositions:i,skipColumnHeaders:!s,skipColumnGroupHeaders:!r,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!i,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:e=>this.processRowGroupCallback(e),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(n,!0)}processRowGroupCallback(e){const{node:t,column:i}=e,s=this.gos.get("treeData"),r=this.gos.get("suppressGroupMaintainValueType");let n=(()=>{var e,n;if(s||r||!i)return t.key;const o=null==(e=t.groupData)?void 0:e[i.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(n=this.valueService.formatValue(t.rowGroupColumn,t,o))?n:o})();if(e.node.footer){let e="";n&&n.length&&(e=` ${n}`),n=`Total${e}`}const o=this.gos.getCallback("processCellForClipboard");if(o){let e=t.rowGroupColumn;return!e&&t.footer&&-1===t.level&&(e=this.columnModel.getRowGroupColumns()[0]),o({value:n,node:t,column:e,type:"clipboard",formatValue:i=>{var s;return null!=(s=this.valueService.formatValue(e,t,i))?s:i},parseValue:i=>this.valueService.parseValue(e,t,i,this.valueService.getValue(e,t))})}return n}dispatchFlashCells(e){window.setTimeout(()=>{const t={type:r.sVA.EVENT_FLASH_CELLS,cells:e};this.eventService.dispatchEvent(t)},0)}processCell(e,t,i,s,r,n,o){var a;return r?r({column:t,node:e,value:i,type:s,formatValue:i=>{var s;return null!=(s=this.valueService.formatValue(t,null!=e?e:null,i))?s:i},parseValue:i=>this.valueService.parseValue(t,null!=e?e:null,i,this.valueService.getValue(t,e))}):n&&!1!==t.getColDef().useValueParserForImport?this.valueService.parseValue(t,null!=e?e:null,i,this.valueService.getValue(t,e)):o&&!1!==t.getColDef().useValueFormatterForExport&&null!=(a=this.valueService.formatValue(t,null!=e?e:null,i))?a:i}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");t?t({data:e}):!this.gos.get("suppressClipboardApi")&&navigator.clipboard?navigator.clipboard.writeText(e).catch(t=>{r._.doOnce(()=>{console.warn(t),console.warn(_w("writeText"))},"clipboardApiError"),this.copyDataToClipboardLegacy(e)}):this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const i=this.gos.getDocument(),s=this.gos.getActiveDomElement();t.value=e||" ",t.select(),t.focus({preventScroll:!0}),i.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=s&&null!=s.focus&&s.focus({preventScroll:!0})})}executeOnTempElement(e,t){const i=this.gos.getDocument(),s=i.createElement("textarea");s.style.width="1px",s.style.height="1px",s.style.top=i.documentElement.scrollTop+"px",s.style.left=i.documentElement.scrollLeft+"px",s.style.position="absolute",s.style.opacity="0";const r=this.gridCtrl.getGui();r.appendChild(s);try{e(s)}catch(e){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout(()=>{t(s),r.removeChild(s)},100):r.removeChild(s)}getRangeSize(e){const t=e.getCellRanges();let i=0,s=0;return t.length>0&&(i=e.getRangeStartRow(t[0]).rowIndex,s=e.getRangeEndRow(t[0]).rowIndex),i-s+1}};Pw([(0,r.dsm)("csvCreator")],Ow.prototype,"csvCreator",2),Pw([(0,r.dsm)("loggerFactory")],Ow.prototype,"loggerFactory",2),Pw([(0,r.dsm)("selectionService")],Ow.prototype,"selectionService",2),Pw([(0,r.dsm)("rowModel")],Ow.prototype,"rowModel",2),Pw([(0,r.dsm)("ctrlsService")],Ow.prototype,"ctrlsService",2),Pw([(0,r.dsm)("valueService")],Ow.prototype,"valueService",2),Pw([(0,r.dsm)("focusService")],Ow.prototype,"focusService",2),Pw([(0,r.dsm)("rowRenderer")],Ow.prototype,"rowRenderer",2),Pw([(0,r.dsm)("columnModel")],Ow.prototype,"columnModel",2),Pw([(0,r.dsm)("cellNavigationService")],Ow.prototype,"cellNavigationService",2),Pw([(0,r.dsm)("cellPositionUtils")],Ow.prototype,"cellPositionUtils",2),Pw([(0,r.dsm)("rowPositionUtils")],Ow.prototype,"rowPositionUtils",2),Pw([(0,r.Xx1)("rangeService")],Ow.prototype,"rangeService",2),Pw([r.o7C],Ow.prototype,"init",1),Ow=Pw([(0,r.dR4)("clipboardService")],Ow);var Fw={version:"31.3.4",moduleName:r.zsj.ClipboardModule,beans:[Ow],dependantModules:[mf,r.n76]},Gw=Object.defineProperty,Bw=Object.defineProperties,Vw=Object.getOwnPropertyDescriptor,Hw=Object.getOwnPropertyDescriptors,Uw=Object.getOwnPropertySymbols,zw=Object.prototype.hasOwnProperty,Ww=Object.prototype.propertyIsEnumerable,jw=(e,t,i)=>t in e?Gw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Kw=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Vw(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Gw(t,i,n),n},$w=class extends r.XQb{execute(e){const t=r._.missingOrEmpty(this.columnModel.getValueColumns()),i=!this.gos.getCallback("getGroupRowAgg"),s=e.changedPath&&e.changedPath.isActive();if(t&&i&&s)return;const n=this.createAggDetails(e);this.recursivelyCreateAggData(n)}createAggDetails(e){const t=this.columnModel.isPivotActive(),i=this.columnModel.getValueColumns(),s=t?this.columnModel.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!this.gos.getGrandTotalRow(),changedPath:e.changedPath,valueColumns:i,pivotColumns:s,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return void 0!==this.gos.getGroupAggFiltering()||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{if(t.hasChildren()){if(-1===t.level&&!e.groupIncludeTotalFooter){const i=!this.columnModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&i)return void t.setAggData(null)}this.aggregateRowNode(t,e)}else t.aggData&&t.setAggData(null)},!0)}aggregateRowNode(e,t){const i=0===t.valueColumns.length,s=0===t.pivotColumns.length;let r;r=t.userAggFunc?t.userAggFunc({nodes:e.childrenAfterFilter}):i?null:s?this.aggregateRowNodeUsingValuesOnly(e,t):this.aggregateRowNodeUsingValuesAndPivot(e),e.setAggData(r),e.sibling&&e.sibling.setAggData(r)}aggregateRowNodeUsingValuesAndPivot(e){var t,i;const s={},r=null!=(t=this.columnModel.getSecondaryColumns())?t:[];let n=!0;for(let t=0;t<r.length;t++){const o=r[t],a=o.getColDef();if(null!=a.pivotTotalColumnIds){n=!1;continue}const l=null!=(i=a.pivotKeys)?i:[];let c;c=e.leafGroup?this.getValuesFromMappedSet(e.childrenMapped,l,a.pivotValueColumn):this.getValuesPivotNonLeaf(e,a.colId),s[a.colId]=this.aggregateValues(c,a.pivotValueColumn.getAggFunc(),a.pivotValueColumn,e,o)}if(!n)for(let t=0;t<r.length;t++){const i=r[t],n=i.getColDef();if(null==n.pivotTotalColumnIds||!n.pivotTotalColumnIds.length)continue;const o=n.pivotTotalColumnIds.map(e=>s[e]);s[n.colId]=this.aggregateValues(o,n.pivotValueColumn.getAggFunc(),n.pivotValueColumn,e,i)}return s}aggregateRowNodeUsingValuesOnly(e,t){const i={},s=t.changedPath.isActive()?t.changedPath.getValueColumnsForNode(e,t.valueColumns):t.valueColumns,r=t.changedPath.isActive()?t.changedPath.getNotValueColumnsForNode(e,t.valueColumns):null,n=this.getValuesNormal(e,s,t.filteredOnly),o=e.aggData;return s.forEach((t,s)=>{i[t.getId()]=this.aggregateValues(n[s],t.getAggFunc(),t,e)}),r&&o&&r.forEach(e=>{i[e.getId()]=o[e.getId()]}),i}getValuesPivotNonLeaf(e,t){return e.childrenAfterFilter.map(e=>e.aggData[t])}getValuesFromMappedSet(e,t,i){let s=e;for(let e=0;e<t.length;e++){const i=t[e];s=s?s[i]:null}return s?s.map(e=>this.valueService.getValue(i,e)):[]}getValuesNormal(e,t,i){const s=[];t.forEach(()=>s.push([]));const r=t.length,n=i?e.childrenAfterFilter:e.childrenAfterGroup,o=n.length;for(let e=0;e<o;e++){const i=n[e];for(let e=0;e<r;e++){const r=t[e],n=this.valueService.getValue(r,i);s[e].push(n)}}return s}aggregateValues(e,t,i,s,r){const n="string"==typeof t?this.aggFuncService.getAggFunc(t):t;return"function"!=typeof n?(console.error(`AG Grid: unrecognised aggregation function ${t}`),null):n(this.gos.addGridCommonParams({values:e,column:i,colDef:i?i.getColDef():void 0,pivotResultColumn:r,rowNode:s,data:s?s.data:void 0}))}};Kw([(0,r.dsm)("columnModel")],$w.prototype,"columnModel",2),Kw([(0,r.dsm)("valueService")],$w.prototype,"valueService",2),Kw([(0,r.dsm)("aggFuncService")],$w.prototype,"aggFuncService",2),$w=Kw([(0,r.dR4)("aggregationStage")],$w);var Yw=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(e,t){this.getSet(e).removeFromChildrenAfterGroup[t.id]=!0}isRemoveFromAllLeafChildren(e,t){return!!this.getSet(e).removeFromAllLeafChildren[t.id]}preventRemoveFromAllLeafChildren(e,t){delete this.getSet(e).removeFromAllLeafChildren[t.id]}removeFromAllLeafChildren(e,t){this.getSet(e).removeFromAllLeafChildren[t.id]=!0}getSet(e){return this.allSets[e.id]||(this.allSets[e.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(e)),this.allSets[e.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(e=>{const t=this.allSets[e.id];e.childrenAfterGroup=e.childrenAfterGroup.filter(e=>!t.removeFromChildrenAfterGroup[e.id]),e.allLeafChildren=e.allLeafChildren.filter(e=>!t.removeFromAllLeafChildren[e.id]),e.updateHasChildren(),e.sibling&&(e.sibling.childrenAfterGroup=e.childrenAfterGroup,e.sibling.allLeafChildren=e.allLeafChildren)}),this.allSets={},this.allParents.length=0}},qw=class extends r.XQb{execute(e){const t=this.createGroupingDetails(e);if(t.transactions)this.handleTransaction(t);else{const i=!0===e.afterColumnsChanged;this.shotgunResetEverything(t,i)}t.usingTreeData||(this.positionLeafsAndGroups(e.changedPath),this.orderGroups(t)),this.selectableService.updateSelectableAfterGrouping()}positionLeafsAndGroups(e){e.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const t=[],i=[];let s;e.childrenAfterGroup.forEach(e=>{var r;(null==(r=e.childrenAfterGroup)?void 0:r.length)?""!==e.key||s?i.push(e):s=e:t.push(e)}),s&&i.push(s),e.childrenAfterGroup=[...t,...i]}},!1)}createGroupingDetails(e){var t;const{rowNode:i,changedPath:s,rowNodeTransactions:r,rowNodeOrder:n}=e,o=this.gos.get("treeData"),a=o?null:this.columnModel.getRowGroupColumns();return{includeParents:!this.gos.get("suppressParentsInRowNodes"),expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:a,rootNode:i,pivotMode:this.columnModel.isPivotMode(),groupedColCount:o||!a?0:a.length,rowNodeOrder:n,transactions:r,changedPath:s,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),usingTreeData:o,suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),getDataPath:o?this.gos.get("getDataPath"):void 0,keyCreators:null!=(t=null==a?void 0:a.map(e=>e.getColDef().keyCreator))?t:[]}}handleTransaction(e){e.transactions.forEach(t=>{const i=e.usingTreeData?void 0:new Yw;if(r._.existsAndNotEmpty(t.remove)&&this.removeNodes(t.remove,e,i),r._.existsAndNotEmpty(t.update)&&this.moveNodesInWrongPath(t.update,e,i),r._.existsAndNotEmpty(t.add)&&this.insertNodes(t.add,e,!1),i){const t=i.getAllParents().slice();i.flush(),this.removeEmptyGroups(t,e)}}),e.rowNodeOrder&&this.sortChildren(e)}sortChildren(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{t.childrenAfterGroup&&r._.sortRowNodesByOrder(t.childrenAfterGroup,e.rowNodeOrder)&&e.changedPath.addParentNode(t)},!1,!0)}orderGroups(e){const t=e.initialGroupOrderComparator;r._.exists(t)&&function e(i){r._.exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((e,i)=>t({nodeA:e,nodeB:i})),i.childrenAfterGroup.forEach(t=>e(t)))}(e.rootNode)}getExistingPathForNode(e,t){const i=[];let s=t.usingTreeData?e:e.parent;for(;s&&s!==t.rootNode;)i.push({key:s.key,rowGroupColumn:s.rowGroupColumn,field:s.field}),s=s.parent;return i.reverse(),i}moveNodesInWrongPath(e,t,i){e.forEach(e=>{t.changedPath.isActive()&&t.changedPath.addParentNode(e.parent);const s=e=>e.key,n=this.getExistingPathForNode(e,t).map(s),o=this.getGroupInfo(e,t).map(s);r._.areEqual(n,o)||this.moveNode(e,t,i)})}moveNode(e,t,i){if(this.removeNodesInStages([e],t,i),this.insertOneNode(e,t,!0,i),e.setData(e.data),t.changedPath.isActive()){const i=e.parent;t.changedPath.addParentNode(i)}}removeNodes(e,t,i){this.removeNodesInStages(e,t,i),t.changedPath.isActive()&&e.forEach(e=>t.changedPath.addParentNode(e.parent))}removeNodesInStages(e,t,i){if(this.removeNodesFromParents(e,t,i),t.usingTreeData){this.postRemoveCreateFillerNodes(e,t);const i=e.map(e=>e.parent);this.removeEmptyGroups(i,t)}}forEachParentGroup(e,t,i){let s=t;for(;s&&s!==e.rootNode;)i(s),s=s.parent}removeNodesFromParents(e,t,i){const s=null==i,r=i||new Yw;e.forEach(e=>{this.removeFromParent(e,r),this.forEachParentGroup(t,e.parent,t=>{r.removeFromAllLeafChildren(t,e)})}),s&&r.flush()}postRemoveCreateFillerNodes(e,t){e.forEach(e=>{if(e.hasChildren()){const i=this.getExistingPathForNode(e,t),s=this.findParentForNode(e,i,t);s.expanded=e.expanded,s.allLeafChildren=e.allLeafChildren,s.childrenAfterGroup=e.childrenAfterGroup,s.childrenMapped=e.childrenMapped,s.updateHasChildren(),s.childrenAfterGroup.forEach(e=>e.parent=s)}})}removeEmptyGroups(e,t){let i=!0;const s=e=>{const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),i=e.parent;return!!(i&&i.childrenMapped&&i.childrenMapped[t]&&e.isEmptyRowGroupNode())};for(;i;){i=!1;const r=new Yw;e.forEach(e=>{this.forEachParentGroup(t,e,e=>{s(e)&&(i=!0,this.removeFromParent(e,r),e.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),r.flush()}}removeFromParent(e,t){e.parent&&(t?t.removeFromChildrenAfterGroup(e.parent,e):(r._.removeFromArray(e.parent.childrenAfterGroup,e),e.parent.updateHasChildren()));const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);e.parent&&e.parent.childrenMapped&&(e.parent.childrenMapped[i]=void 0),e.setRowTop(null),e.setRowIndex(null)}addToParent(e,t){const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);t&&(null!=t.childrenMapped&&(t.childrenMapped[i]=e),t.childrenAfterGroup.push(e),t.updateHasChildren())}areGroupColsEqual(e,t){return null!=e&&null!=t&&e.pivotMode===t.pivotMode&&r._.areEqual(e.groupedCols,t.groupedCols)&&r._.areEqual(e.keyCreators,t.keyCreators)}checkAllGroupDataAfterColsChanged(e){const t=i=>{i&&i.forEach(i=>{if(!e.usingTreeData&&!i.group)return;const s={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:i.allLeafChildren[0]};this.setGroupData(i,s,e),t(i.childrenAfterGroup)})};t(e.rootNode.childrenAfterGroup)}shotgunResetEverything(e,t){if(this.noChangeInGroupingColumns(e,t))return;this.selectionService.filterFromSelection(e=>e&&!e.group);const{rootNode:i,groupedCols:s}=e;i.leafGroup=!e.usingTreeData&&0===s.length,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const r=i.sibling;r&&(r.childrenAfterGroup=i.childrenAfterGroup,r.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,e,!1)}noChangeInGroupingColumns(e,t){let i=!1;const s=this.columnModel.getGroupDisplayColumns(),r=s?s.map(e=>e.getId()).join("-"):"";return t&&(i=e.usingTreeData||this.areGroupColsEqual(e,this.oldGroupingDetails),this.oldGroupDisplayColIds!==r&&this.checkAllGroupDataAfterColsChanged(e)),this.oldGroupingDetails=e,this.oldGroupDisplayColIds=r,i}insertNodes(e,t,i){e.forEach(e=>{this.insertOneNode(e,t,i),t.changedPath.isActive()&&t.changedPath.addParentNode(e.parent)})}insertOneNode(e,t,i,s){const r=this.getGroupInfo(e,t),n=this.findParentForNode(e,r,t,s);n.group||console.warn("AG Grid: duplicate group keys for row data, keys should be unique",[n.data,e.data]),t.usingTreeData?this.swapGroupWithUserNode(n,e,i):(e.parent=n,e.level=r.length,n.childrenAfterGroup.push(e),n.updateHasChildren())}findParentForNode(e,t,i,s){let r=i.rootNode;return t.forEach((t,n)=>{r=this.getOrCreateNextNode(r,t,n,i),(null==s?void 0:s.isRemoveFromAllLeafChildren(r,e))?null==s||s.preventRemoveFromAllLeafChildren(r,e):r.allLeafChildren.push(e)}),r}swapGroupWithUserNode(e,t,i){t.parent=e.parent,t.key=e.key,t.field=e.field,t.groupData=e.groupData,t.level=e.level,i||(t.expanded=e.expanded),t.leafGroup=e.leafGroup,t.rowGroupIndex=e.rowGroupIndex,t.allLeafChildren=e.allLeafChildren,t.childrenAfterGroup=e.childrenAfterGroup,t.childrenMapped=e.childrenMapped,t.sibling=e.sibling,t.updateHasChildren(),this.removeFromParent(e),t.childrenAfterGroup.forEach(e=>e.parent=t),this.addToParent(t,e.parent)}getOrCreateNextNode(e,t,i,s){const r=this.getChildrenMappedKey(t.key,t.rowGroupColumn);let n=e.childrenMapped?e.childrenMapped[r]:void 0;return n||(n=this.createGroup(t,e,i,s),this.addToParent(n,e)),n}createGroup(e,t,i,s){const n=new r.TUE(this.beans);return n.group=!0,n.field=e.field,n.rowGroupColumn=e.rowGroupColumn,this.setGroupData(n,e,s),n.key=e.key,n.id=this.createGroupId(n,t,s.usingTreeData,i),n.level=i,n.leafGroup=!s.usingTreeData&&i===s.groupedColCount-1,n.allLeafChildren=[],n.setAllChildrenCount(0),n.rowGroupIndex=s.usingTreeData?null:i,n.childrenAfterGroup=[],n.childrenMapped={},n.updateHasChildren(),n.parent=s.includeParents?t:null,this.setExpandedInitialValue(s,n),n}createGroupId(e,t,i,s){let n;return n=i?(e,t,i)=>{if(i<0)return null;const s=t?n(t,t.parent,i-1):null;return`${null==s?"":s+"-"}${i}-${e.key}`}:(e,t)=>{if(!e.rowGroupColumn)return null;const i=t?n(t,t.parent,0):null;return`${null==i?"":i+"-"}${e.rowGroupColumn.getColId()}-${e.key}`},r.TUE.ID_PREFIX_ROW_GROUP+n(e,t,s)}setGroupData(e,t,i){e.groupData={},this.columnModel.getGroupDisplayColumns().forEach(s=>{if(i.usingTreeData)return void(e.groupData[s.getColId()]=t.key);const r=e.rowGroupColumn;null!==r&&s.isRowGroupDisplayed(r.getId())&&(i.suppressGroupMaintainValueType?e.groupData[s.getColId()]=t.key:e.groupData[s.getColId()]=this.valueService.getValue(r,t.leafNode))})}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}setExpandedInitialValue(e,t){if(e.pivotMode&&t.leafGroup)return void(t.expanded=!1);const i=e.isGroupOpenByDefault;if(i){const e={rowNode:t,field:t.field,key:t.key,level:t.level,rowGroupColumn:t.rowGroupColumn};return void(t.expanded=1==i(e))}const{expandByDefault:s}=e;-1!==e.expandByDefault?t.expanded=t.level<s:t.expanded=!0}getGroupInfo(e,t){return t.usingTreeData?this.getGroupInfoFromCallback(e,t):this.getGroupInfoFromGroupColumns(e,t)}getGroupInfoFromCallback(e,t){const i=t.getDataPath?t.getDataPath(e.data):null;return null!=i&&0!==i.length||r._.warnOnce(`getDataPath() should not return an empty path for data ${e.data}`),i?i.map(e=>({key:e,field:null,rowGroupColumn:null})):[]}getGroupInfoFromGroupColumns(e,t){const i=[];return t.groupedCols.forEach(s=>{let r=this.valueService.getKeyForNode(s,e),n=null!=r&&""!==r;if((t.pivotMode||!t.groupAllowUnbalanced)&&!n&&(r="",n=!0),n){const t={key:r,field:s.getColDef().field,rowGroupColumn:s,leafNode:e};i.push(t)}}),i}};Kw([(0,r.dsm)("columnModel")],qw.prototype,"columnModel",2),Kw([(0,r.dsm)("selectableService")],qw.prototype,"selectableService",2),Kw([(0,r.dsm)("valueService")],qw.prototype,"valueService",2),Kw([(0,r.dsm)("beans")],qw.prototype,"beans",2),Kw([(0,r.dsm)("selectionService")],qw.prototype,"selectionService",2),qw=Kw([(0,r.dR4)("groupStage")],qw);var Xw=class extends r.XQb{init(){const e=()=>{var e;return null!=(e=this.gos.get("serverSidePivotResultFieldSeparator"))?e:"_"};this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e),i=function e(t,i=[]){return t.forEach(t=>{void 0!==t.children?e(t.children,i):i.push(t)}),i}(t);return this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i),{pivotColumnGroupDefs:t,pivotColumnDefs:i.map(e=>r._.cloneObject(e))}}createPivotColumnsFromUniqueValues(e){const t=this.columnModel.getPivotColumns(),i=t.length;return this.recursivelyBuildGroup(0,e,[],i,t)}recursivelyBuildGroup(e,t,i,s,n){const o=this.columnModel.getValueColumns();if(e>=s)return this.buildMeasureCols(i);const a=n[e].getColDef(),l=this.headerNameComparator.bind(this,a.pivotComparator);if(1===o.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===s-1){const e=[];return r._.iterateObject(t,t=>{const s=[...i,t],r=this.createColDef(o[0],t,s);r.columnGroupShow="open",e.push(r)}),e.sort(l),e}const c=[];return r._.iterateObject(t,(t,r)=>{const o=-1===this.pivotDefaultExpanded||e<this.pivotDefaultExpanded,a=[...i,t];c.push({children:this.recursivelyBuildGroup(e+1,r,a,s,n),headerName:t,pivotKeys:a,columnGroupShow:"open",openByDefault:o,groupId:this.generateColumnGroupId(a)})}),c.sort(l),c}buildMeasureCols(e){const t=this.columnModel.getValueColumns();return 0===t.length?[this.createColDef(null,"-",e)]:t.map(t=>{const i=this.columnModel.getDisplayNameForColumn(t,"header");return s=((e,t)=>{for(var i in t||(t={}))zw.call(t,i)&&jw(e,i,t[i]);if(Uw)for(var i of Uw(t))Ww.call(t,i)&&jw(e,i,t[i]);return e})({},this.createColDef(t,i,e)),Bw(s,Hw({columnGroupShow:"open"}));var s})}addExpandablePivotGroups(e,t){if(this.gos.get("suppressExpandablePivotGroups")||this.gos.get("pivotColumnGroupTotals"))return;const i=(e,t,s)=>{const r=e;if(r.children){const n=new Map;r.children.forEach(e=>{i(e,t,n)});const o=!r.children.some(e=>e.children);this.columnModel.getValueColumns().forEach(i=>{const s=this.columnModel.getDisplayNameForColumn(i,"header"),r=this.createColDef(i,s,e.pivotKeys);r.pivotTotalColumnIds=n.get(i.getColId()),r.columnGroupShow="closed",r.aggFunc=i.getAggFunc(),o||(e.children.push(r),t.push(r))}),this.merge(s,n)}else{const t=e;if(!t.pivotValueColumn)return;const i=t.pivotValueColumn.getColId(),r=s.has(i)?s.get(i):[];r.push(t.colId),s.set(i,r)}};e.forEach(e=>{i(e,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const i="after"===this.gos.get("pivotColumnGroupTotals"),s=this.columnModel.getValueColumns(),r=s.map(e=>e.getAggFunc());if(!r||r.length<1||!this.sameAggFuncs(r))return;const n=s[0];e.forEach(e=>{this.recursivelyAddPivotTotal(e,t,n,i)})}recursivelyAddPivotTotal(e,t,i,s){const r=e;if(!r.children){const t=e;return t.colId?[t.colId]:null}let n=[];if(r.children.forEach(e=>{const r=this.recursivelyAddPivotTotal(e,t,i,s);r&&(n=n.concat(r))}),r.children.length>1){const r=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),o=this.createColDef(i,r,e.pivotKeys,!0);o.pivotTotalColumnIds=n,o.aggFunc=i.getAggFunc();const a=e.children;s?a.push(o):a.unshift(o),t.push(o)}return n}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const i="after"===this.gos.get("pivotRowTotals"),s=this.columnModel.getValueColumns(),r=i?s.slice():s.slice().reverse();for(let s=0;s<r.length;s++){const n=r[s];let o=[];e.forEach(e=>{o=o.concat(this.extractColIdsForValueColumn(e,n))});const a=r.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");this.createRowGroupTotal(e,t,n,o,i,a)}}extractColIdsForValueColumn(e,t){const i=e;if(!i.children){const e=i;return e.pivotValueColumn===t&&e.colId?[e.colId]:[]}let s=[];return i.children.forEach(e=>{this.extractColIdsForValueColumn(e,t);const i=this.extractColIdsForValueColumn(e,t);s=s.concat(i)}),s}createRowGroupTotal(e,t,i,s,r,n){let o;if(0===this.columnModel.getValueColumns().length)o=this.createColDef(null,"-",[]);else{const e=this.columnModel.getDisplayNameForColumn(i,"header");o=this.createColDef(i,e,[]),o.pivotTotalColumnIds=s}o.colId=Xw.PIVOT_ROW_TOTAL_PREFIX+o.colId,t.push(o);const a=n?{children:[o],pivotKeys:[],groupId:`${Xw.PIVOT_ROW_TOTAL_PREFIX}_pivotGroup_${i.getColId()}`}:o;r?e.push(a):e.unshift(a)}createColDef(e,t,i,s=!1){const r={};if(e){const t=e.getColDef();Object.assign(r,t),r.hide=!1}return r.headerName=t,r.colId=this.generateColumnId(i||[],e&&!s?e.getColId():""),r.field=r.colId,r.valueGetter=e=>{var t;return null==(t=e.data)?void 0:t[e.colDef.field]},r.pivotKeys=i,r.pivotValueColumn=e,!0===r.filter&&(r.filter="agNumberColumnFilter"),r}sameAggFuncs(e){if(1==e.length)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}headerNameComparator(e,t,i){return e?e(t.headerName,i.headerName):t.headerName&&!i.headerName?1:!t.headerName&&i.headerName?-1:t.headerName&&i.headerName?t.headerName<i.headerName?-1:t.headerName>i.headerName?1:0:0}merge(e,t){t.forEach((t,i,s)=>{const r=[...e.has(i)?e.get(i):[],...t];e.set(i,r)})}generateColumnGroupId(e){return`pivotGroup_${this.columnModel.getPivotColumns().map(e=>e.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${this.columnModel.getPivotColumns().map(e=>e.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t={};for(let i=0;i<e.length;i++){const s=e[i].split(this.fieldSeparator);let r=t;for(let e=0;e<s.length;e++){const t=s[e];null==r[t]&&(r[t]={}),r=r[t]}}const i=(e,t,s,r)=>{var n;const o=[];for(let t in s){const n=s[t],a=i(`${e}${this.fieldSeparator}${t}`,t,n,r+1);o.push(a)}if(0===o.length){const i=this.columnModel.getPrimaryColumn(t);if(i){const s=null!=(n=this.columnModel.getDisplayNameForColumn(i,"header"))?n:t,r=this.createColDef(i,s,void 0,!1);return r.colId=e,r.aggFunc=i.getAggFunc(),r.valueGetter=t=>{var i;return null==(i=t.data)?void 0:i[e]},r}return{colId:e,headerName:t,valueGetter:t=>{var i;return null==(i=t.data)?void 0:i[e]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===o.length&&"colId"in o[0]?(o[0].headerName=t,o[0]):{openByDefault:-1===this.pivotDefaultExpanded||r<this.pivotDefaultExpanded,groupId:e,headerName:t,children:o}},s=[];for(let e in t){const r=i(e,e,t[e],0);s.push(r)}return s}};Xw.PIVOT_ROW_TOTAL_PREFIX="PivotRowTotal_",Kw([(0,r.dsm)("columnModel")],Xw.prototype,"columnModel",2),Kw([r.o7C],Xw.prototype,"init",1),Xw=Kw([(0,r.dR4)("pivotColDefService")],Xw);var Zw=class extends r.XQb{constructor(){super(...arguments),this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}execute(e){const t=e.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(t):this.executePivotOff(t)}executePivotOff(e){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.columnModel.isSecondaryColumnsPresent()&&(this.columnModel.setSecondaryColumns(null,"rowModelUpdated"),e&&e.setInactive())}executePivotOn(e){var t;const i=null!=(t=this.columnModel.getValueColumns().length)?t:1,s=this.gos.get("pivotMaxGeneratedColumns");let n;this.maxUniqueValues=-1===s?-1:s/i;try{n=this.bucketUpRowNodes(e)}catch(e){if(e.message===Zw.EXCEEDED_MAX_UNIQUE_VALUES){this.columnModel.setSecondaryColumns([],"rowModelUpdated");const t={type:r.sVA.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED,message:e.message};return this.eventService.dispatchEvent(t),void(this.lastTimeFailed=!0)}throw e}const o=this.setUniqueValues(n),a=this.columnModel.getValueColumns(),l=a.map(e=>`${e.getId()}-${e.getColDef().headerName}`).join("#"),c=a.map(e=>e.getAggFunc().toString()).join("#"),h=this.aggregationColumnsHashLastTime!==l,d=this.aggregationFuncsHashLastTime!==c;this.aggregationColumnsHashLastTime=l,this.aggregationFuncsHashLastTime=c;const u=this.columnModel.getRowGroupColumns().map(e=>e.getId()).join("#"),p=u!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=u;const g=this.gos.get("pivotRowTotals"),m=this.gos.get("pivotColumnGroupTotals"),f=this.gos.get("suppressExpandablePivotGroups"),y=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),v=g!==this.pivotRowTotalsLastTime||m!==this.pivotColumnGroupTotalsLastTime||f!==this.suppressExpandablePivotGroupsLastTime||y!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=g,this.pivotColumnGroupTotalsLastTime=m,this.suppressExpandablePivotGroupsLastTime=f,this.removePivotHeaderRowWhenSingleValueColumnLastTime=y,this.lastTimeFailed||o||h||p||d||v){const{pivotColumnGroupDefs:t,pivotColumnDefs:i}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=i,this.columnModel.setSecondaryColumns(t,"rowModelUpdated"),e&&e.setInactive()}this.lastTimeFailed=!1}setUniqueValues(e){return!(JSON.stringify(e)===JSON.stringify(this.uniqueValues)||(this.uniqueValues=e,0))}bucketUpRowNodes(e){this.currentUniqueCount=0;const t={};e.forEachChangedNodeDepthFirst(e=>{e.leafGroup&&(e.childrenMapped=null)});const i=e=>{var s;e.leafGroup?this.bucketRowNode(e,t):null==(s=e.childrenAfterFilter)||s.forEach(i)};return e.executeFromRootNode(i),t}bucketRowNode(e,t){const i=this.columnModel.getPivotColumns();0===i.length?e.childrenMapped=null:e.childrenMapped=this.bucketChildren(e.childrenAfterFilter,i,0,t),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t,i,s){const n={},o=t[i];if(e.forEach(e=>{let t=this.valueService.getKeyForNode(o,e);if(r._.missing(t)&&(t=""),!s[t]){this.currentUniqueCount+=1,s[t]={};const e=-1!==this.maxUniqueValues,i=this.currentUniqueCount>this.maxUniqueValues;if(e&&i)throw Error(Zw.EXCEEDED_MAX_UNIQUE_VALUES)}n[t]||(n[t]=[]),n[t].push(e)}),i===t.length-1)return n;{const e={};return r._.iterateObject(n,(r,n)=>{e[r]=this.bucketChildren(n,t,i+1,s[r])}),e}}getPivotColumnDefs(){return this.pivotColumnDefs}};Zw.EXCEEDED_MAX_UNIQUE_VALUES="Exceeded maximum allowed pivot column count.",Kw([(0,r.dsm)("valueService")],Zw.prototype,"valueService",2),Kw([(0,r.dsm)("columnModel")],Zw.prototype,"columnModel",2),Kw([(0,r.dsm)("pivotColDefService")],Zw.prototype,"pivotColDefService",2),Zw=Kw([(0,r.dR4)("pivotStage")],Zw);var Qw={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Jw=class extends r.XQb{constructor(){super(...arguments),this.aggFuncsMap={},this.initialised=!1}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){this.aggFuncsMap[Jw.AGG_SUM]=ex,this.aggFuncsMap[Jw.AGG_FIRST]=tx,this.aggFuncsMap[Jw.AGG_LAST]=ix,this.aggFuncsMap[Jw.AGG_MIN]=sx,this.aggFuncsMap[Jw.AGG_MAX]=rx,this.aggFuncsMap[Jw.AGG_COUNT]=nx,this.aggFuncsMap[Jw.AGG_AVG]=ox,this.initialised=!0}isAggFuncPossible(e,t){const i=this.getFuncNames(e),s=r._.includes(i,t),n=r._.exists(this.aggFuncsMap[t]);return s&&n}getDefaultFuncLabel(e){var t;return null!=(t=Qw[e])?t:e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(r._.exists(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,Jw.AGG_SUM))return Jw.AGG_SUM;const i=this.getFuncNames(e);return r._.existsAndNotEmpty(i)?i[0]:null}addAggFuncs(e){this.init(),r._.iterateObject(e,(e,t)=>{this.aggFuncsMap[e]=t})}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return null==t?Object.keys(this.aggFuncsMap).sort():t}clear(){this.aggFuncsMap={}}};function ex(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const s=t[e];"number"==typeof s?null===i?i=s:i+="number"==typeof i?s:BigInt(s):"bigint"==typeof s&&(i=null===i?s:("bigint"==typeof i?i:BigInt(i))+s)}return i}function tx(e){return e.values.length>0?e.values[0]:null}function ix(e){return e.values.length>0?r._.last(e.values):null}function sx(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const s=t[e];"number"!=typeof s&&"bigint"!=typeof s||!(null===i||i>s)||(i=s)}return i}function rx(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const s=t[e];"number"!=typeof s&&"bigint"!=typeof s||!(null===i||i<s)||(i=s)}return i}function nx(e){var t,i;const{values:s}=e;let r=0;for(let e=0;e<s.length;e++){const t=s[e];r+=null!=t&&"number"==typeof t.value?t.value:1}const n=null==(i=null==(t=e.rowNode)?void 0:t.aggData)?void 0:i[e.column.getColId()];return n&&n.value===r?n:{value:r,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function ox(e){var t,i,s;const{values:r}=e;let n=0,o=0;for(let e=0;e<r.length;e++){const t=r[e];let i=null;"number"==typeof t||"bigint"==typeof t?(i=t,o++):null==t||"number"!=typeof t.value&&"bigint"!=typeof t.value||"number"!=typeof t.count||(i=t.value*("number"==typeof t.value?t.count:BigInt(t.count)),o+=t.count),"number"==typeof i?n+="number"==typeof n?i:BigInt(i):"bigint"==typeof i&&(n=("bigint"==typeof n?n:BigInt(n))+i)}let a=null;o>0&&(a=n/("number"==typeof n?o:BigInt(o)));const l=null==(s=null==(t=e.rowNode)?void 0:t.aggData)?void 0:s[null==(i=e.column)?void 0:i.getColId()];return l&&l.count===o&&l.value===a?l:{count:o,value:a,toString:function(){return"number"==typeof this.value||"bigint"==typeof this.value?this.value.toString():""},toNumber:function(){return this.value}}}Jw.AGG_SUM="sum",Jw.AGG_FIRST="first",Jw.AGG_LAST="last",Jw.AGG_MIN="min",Jw.AGG_MAX="max",Jw.AGG_COUNT="count",Jw.AGG_AVG="avg",Kw([r.o7C],Jw.prototype,"init",1),Jw=Kw([(0,r.dR4)("aggFuncService")],Jw);var ax=class extends r.v26{constructor(e,t,i,s,r){super(t,i,r,'\n                <span role="option">\n                    <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n                    <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n                    <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n                    <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n                </span>\n            '),this.column=e,this.dropZonePurpose=s,this.popupShowing=!1}init(){this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnDrop"),super.init(),this.setupSort(),this.addManagedListener(this.eventService,r.VPZ.EVENT_SORT_CHANGED,()=>{this.setupAria()}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const i=this.gos.get("rowGroupPanelSuppressSort"),s=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!s){const i=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!i){const i=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(i)}super.addAdditionalAriaInstructions(e,t)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.localeService.getLocaleTextFunc(),{name:t,aggFuncName:i}=this.getColumnAndAggFuncName(),s=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),r={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},n=this.column.getSort(),o=this.gos.get("rowGroupPanelSuppressSort");return[i&&`${i}${s}`,t,this.isGroupingZone()&&!o&&n&&`, ${r[n]}`].filter(e=>!!e).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const e=this.column.getAggFunc(),i="string"==typeof e?e:"agg";t=this.localeService.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){const e=this.column.isSortable(),t=this.isGroupingZone();if(e&&t&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const e=e=>{e.preventDefault();const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.sortController.progressSort(this.column,t,"uiColumnSorted")};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===r.DDm.ENTER&&this.isGroupingZone()&&e(t)})}}getDefaultIconName(){return r.WO_.ICON_HIDE}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===r.DDm.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const e=new r.wjn({cssIdentifier:"select-agg-func"}),t=this.aggFuncService.getFuncNames(this.column),i=this.getGui(),s=e.getGui();e.setModel({getRow:function(e){return t[e]},getRowCount:function(){return t.length}}),this.getContext().createBean(e);const n=r._.loadTemplate('<div class="ag-select-agg-func-popup"></div>');n.style.top="0px",n.style.left="0px",n.appendChild(s),n.style.width=`${i.clientWidth}px`;const o=this.addManagedListener(n,"focusout",e=>{!n.contains(e.relatedTarget)&&l&&l.hideFunc()}),a=this.localeService.getLocaleTextFunc(),l=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:t=>{this.destroyBean(e),this.popupShowing=!1,"Escape"===(null==t?void 0:t.key)&&i.focus(),o&&o()},ariaLabel:a("ariaLabelAggregationFunction","Aggregation Function")});l&&e.setComponentCreator(this.createAggSelect.bind(this,l.hideFunc)),e.addGuiEventListener("keydown",t=>{if(t.key===r.DDm.ENTER||t.key===r.DDm.SPACE){const t=e.getLastFocusedRow();if(null==t)return;const i=e.getComponentAt(t);i&&i.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:i,ePopup:n,keepWithinBounds:!0,column:this.column,position:"under"}),e.refresh();let c=t.findIndex(e=>e===this.column.getAggFunc());-1===c&&(c=0),e.focusRow(c)}createAggSelect(e,t){const i=this.localeService.getLocaleTextFunc(),s=t.toString(),n=i(s,s);return new lx(()=>{if(e(),this.gos.get("functionsPassive")){const e={type:r.sVA.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST,columns:[this.column],aggFunc:t};this.eventService.dispatchEvent(e)}else this.columnModel.setColumnAggFunc(this.column,t,"toolPanelDragAndDrop")},n)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColumnGroupingLocked(this.column)}isAggregationZone(){return"aggregation"===this.dropZonePurpose}isGroupingZone(){return"rowGroup"===this.dropZonePurpose}getDragSourceType(){return r.qRA.ToolPanel}destroy(){super.destroy(),this.column=null}};Kw([(0,r.dsm)("popupService")],ax.prototype,"popupService",2),Kw([(0,r.dsm)("sortController")],ax.prototype,"sortController",2),Kw([(0,r.dsm)("columnModel")],ax.prototype,"columnModel",2),Kw([(0,r.Xx1)("aggFuncService")],ax.prototype,"aggFuncService",2),Kw([(0,r.PIB)("eSortIndicator")],ax.prototype,"eSortIndicator",2);var lx=class extends r.uAl{constructor(e,t){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=e,this.getGui().innerText=t,this.addGuiEventListener("click",this.selectItem)}},cx=class extends r.fNO{constructor(e,t){super(e),this.dropZonePurpose=t}init(e){super.init(e),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.refreshGui.bind(this)),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){var t;return null!=(t=e.columns)?t:[]}isInterestedIn(e){return e===r.qRA.HeaderCell||e===r.qRA.ToolPanel}minimumAllowedNewInsertIndex(){const e=this.gos.get("groupLockGroupColumns"),t=this.columnModel.getRowGroupColumns().length;return-1===e?t:Math.min(e,t)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem().columns;this.setColumnsVisible(t,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,i){if(e){const s=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}isRowGroupPanel(){return"rowGroup"===this.dropZonePurpose}refreshOnDragStop(){return!this.gos.get("functionsPassive")}createPillComponent(e,t,i,s){return new ax(e,t,i,this.dropZonePurpose,s)}};Kw([(0,r.dsm)("columnModel")],cx.prototype,"columnModel",2);var hx=class extends cx{constructor(e){super(e,"rowGroup")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),i=e("groups","Row Groups");super.init({icon:r._.createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,this.refreshGui.bind(this))}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const e=super.getTooltipParams();return e.location="rowGroupColumnsList",e}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setRowGroupColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?r.WO_.ICON_GROUP:r.WO_.ICON_NOT_ALLOWED}getExistingItems(){return this.columnModel.getRowGroupColumns()}};Kw([r.o7C],hx.prototype,"passBeansUp",1);var dx=class extends cx{constructor(e){super(e,"pivot")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),i=e("pivots","Column Labels");super.init({icon:r._.createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.refresh.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.checkVisibility.bind(this)),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const e=super.getTooltipParams();return e.location="pivotColumnsList",e}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(e);break;case"onlyWhenPivoting":const t=this.columnModel.isPivotActive();this.setDisplayed(e&&t);break;default:this.setDisplayed(!1)}else this.setDisplayed(e)}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:r.sVA.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setPivotColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?r.WO_.ICON_PIVOT:r.WO_.ICON_NOT_ALLOWED}getExistingItems(){return this.columnModel.getPivotColumns()}};Kw([r.o7C],dx.prototype,"passBeansUp",1);var ux=class extends r.uAl{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel()),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onRowGroupChanged()),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,()=>this.onRowGroupChanged()),this.addManagedPropertyListener("rowGroupPanelShow",()=>this.onRowGroupChanged()),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const e=document.createElement("div");return e.classList.add("ag-column-drop-wrapper"),r._.setAriaRole(e,"presentation"),this.rowGroupComp=new hx(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new dx(!0),this.createManagedBean(this.pivotComp),e.appendChild(this.rowGroupComp.getGui()),e.appendChild(this.pivotComp.getGui()),this.addManagedListener(this.rowGroupComp,r.uAl.EVENT_DISPLAYED_CHANGED,()=>this.onDropPanelVisible()),this.addManagedListener(this.pivotComp,r.uAl.EVENT_DISPLAYED_CHANGED,()=>this.onDropPanelVisible()),this.onDropPanelVisible(),e}onDropPanelVisible(){const e=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed();this.rowGroupComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",e),this.pivotComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",e)}onRowGroupChanged(){if(!this.rowGroupComp)return;const e=this.gos.get("rowGroupPanelShow");if("always"===e)this.rowGroupComp.setDisplayed(!0);else if("onlyWhenGrouping"===e){const e=!this.columnModel.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const e=this.gos.get("pivotPanelShow");if("always"===e)this.pivotComp.setDisplayed(!0);else if("onlyWhenPivoting"===e){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}};Kw([(0,r.dsm)("columnModel")],ux.prototype,"columnModel",2),Kw([r.o7C],ux.prototype,"postConstruct",1);var px=class extends r.XQb{execute(e){const t=this.columnModel.isPivotMode(),i=this.filterManager.isAggregateFilterPresent()||this.filterManager.isAggregateQuickFilterPresent(),s=this.gos.getGroupAggFiltering()||(t?e=>e.node.leafGroup:e=>!e.node.group),{changedPath:r}=e,n=(e,t=!1)=>{e.childrenAfterFilter&&(e.childrenAfterAggFilter=e.childrenAfterFilter,t&&e.childrenAfterAggFilter.forEach(e=>n(e,t)),this.setAllChildrenCount(e)),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)};r.forEachChangedNodeDepthFirst(i?e=>{var t;e.childrenAfterAggFilter=(null==(t=e.childrenAfterFilter)?void 0:t.filter(e=>{var t;return s({node:e})&&this.filterManager.doesRowPassAggregateFilters({rowNode:e})?(n(e,!0),!0):null==(t=e.childrenAfterAggFilter)?void 0:t.length}))||null,this.setAllChildrenCount(e),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)}:n,!0)}setAllChildrenCountTreeData(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{t++,t+=e.allChildrenCount}),e.setAllChildrenCount(t)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{e.group?t+=e.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){e.hasChildren()?this.gos.get("treeData")?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e):e.setAllChildrenCount(null)}};Kw([(0,r.dsm)("filterManager")],px.prototype,"filterManager",2),Kw([(0,r.dsm)("columnModel")],px.prototype,"columnModel",2),px=Kw([(0,r.dR4)("filterAggregatesStage")],px);var gx=class e extends r.aJZ{constructor(){super('\n            <div class="ag-group-filter">\n                <div ref="eGroupField"></div>\n                <div ref="eUnderlyingFilter"></div>\n            </div>\n        ')}postConstruct(){this.initialiseTabGuard({})}init(e){return this.params=e,this.validateParams(),this.updateGroups().then(()=>{this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onColumnRowGroupChanged())})}validateParams(){const{colDef:e}=this.params;e.field&&r._.warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),e.filterValueGetter&&r._.warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),e.filterParams&&r._.warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const e=this.updateGroupField();return this.getUnderlyingFilters(e)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return r._.warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];return this.columnModel.getSourceColumnsForGroupColumn(this.groupColumn)||(r._.warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){r._.clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const e=this.getSourceColumns(),t=e.filter(e=>e.isFilterAllowed());return t.length?(1===e.length?(this.selectedColumn=t[0],r._.setDisplayed(this.eGroupField,!1)):(this.selectedColumn&&t.some(e=>e.getId()===this.selectedColumn.getId())||(this.selectedColumn=t[0]),this.createGroupFieldSelectElement(t),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(r._.loadTemplate('<div class="ag-filter-separator"></div>')),r._.setDisplayed(this.eGroupField,!0)),t):(this.selectedColumn=void 0,r._.setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(e){this.eGroupFieldSelect=this.createManagedBean(new r.Ju4);const t=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(t("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(e.map(e=>{var t;return{value:e.getId(),text:null!=(t=this.columnModel.getDisplayNameForColumn(e,"groupFilter",!1))?t:void 0}})),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(e=>this.updateSelectedColumn(e)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),1===e.length&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(e){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),r.oY$.resolve();const t=[],i=[];return e.forEach(e=>{const s=this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU");(null==s?void 0:s.filterPromise)&&t.push(s.filterPromise.then(t=>(t&&i.push({filter:t,column:e}),e.getId()===this.selectedColumn.getId()&&(this.selectedFilter=null!=t?t:void 0),t)))}),r.oY$.all(t).then(()=>{this.filterColumnPairs=i,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e,t;if(r._.clearElement(this.eUnderlyingFilter),!this.selectedColumn)return r.oY$.resolve();const i=this.createManagedBean(new r.jfj(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=i,i.hasFilter()?(this.eUnderlyingFilter.appendChild(i.getGui()),null!=(t=null==(e=i.getFilter())?void 0:e.then(()=>{var e,t;null==(e=i.afterGuiAttached)||e.call(i,this.afterGuiAttachedParams),(null==(t=this.afterGuiAttachedParams)?void 0:t.suppressFocus)||!this.eGroupFieldSelect||this.eGroupFieldSelect.isDisabled()||this.eGroupFieldSelect.getFocusableElement().focus()}))?t:r.oY$.resolve()):r.oY$.resolve()}updateSelectedColumn(t){var i;if(!t)return;null==(i=this.filterWrapperComp)||i.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const s=this.getFilterColumnPair(t);this.selectedColumn=null==s?void 0:s.column,this.selectedFilter=null==s?void 0:s.filter,this.dispatchEvent({type:e.EVENT_SELECTED_COLUMN_CHANGED}),this.addUnderlyingFilterElement()}isFilterActive(){var e;return!!(null==(e=this.filterColumnPairs)?void 0:e.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return r.oY$.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement()}afterGuiDetached(){var e,t;r._.clearElement(this.eUnderlyingFilter),null==(t=null==(e=this.selectedFilter)?void 0:e.afterGuiDetached)||t.call(e)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchEvent({type:e.EVENT_COLUMN_ROW_GROUP_CHANGED}),this.eventService.dispatchEvent({type:"filterAllowedUpdated"})})}getFilterColumnPair(e){var t;if(e)return null==(t=this.filterColumnPairs)?void 0:t.find(({column:t})=>t.getId()===e)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}};gx.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",gx.EVENT_SELECTED_COLUMN_CHANGED="selectedColumnChanged",Kw([(0,r.dsm)("filterManager")],gx.prototype,"filterManager",2),Kw([(0,r.dsm)("columnModel")],gx.prototype,"columnModel",2),Kw([(0,r.PIB)("eGroupField")],gx.prototype,"eGroupField",2),Kw([(0,r.PIB)("eUnderlyingFilter")],gx.prototype,"eUnderlyingFilter",2),Kw([r.o7C],gx.prototype,"postConstruct",1);var mx=gx,fx=class extends r.uAl{constructor(){super('\n            <div ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>\n        '),this.haveAddedColumnListeners=!1}init(e){this.params=e;const t="multipleColumns"===this.gos.get("groupDisplayType");return new r.oY$(e=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,t?this.setupUnderlyingFloatingFilterElement().then(()=>e()):(this.setupReadOnlyFloatingFilterElement(),e())})}).then(()=>{this.addManagedListener(this.parentFilterInstance,mx.EVENT_SELECTED_COLUMN_CHANGED,()=>this.onSelectedColumnChanged()),this.addManagedListener(this.parentFilterInstance,mx.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onColumnRowGroupChanged())})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams()}setParams(){var e;const t=this.columnModel.getDisplayNameForColumn(this.params.column,"header",!0),i=this.localeService.getLocaleTextFunc();null==(e=this.eFloatingFilterText)||e.setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new r.stt),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,r._.clearElement(this.eFloatingFilter);const e=this.parentFilterInstance.getSelectedColumn();if(e&&!e.isVisible()){const t=this.filterManager.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(t)return this.compDetails=t,this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListener(e,r.VPZ.EVENT_VISIBLE_CHANGED,this.onColumnVisibleChanged.bind(this)),this.addManagedListener(e,r.VPZ.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))),t.newAgStackInstance().then(e=>{var t,i;this.underlyingFloatingFilter=e,null==(i=this.underlyingFloatingFilter)||i.onParentModelChanged(null==(t=this.parentFilterInstance.getSelectedFilter())?void 0:t.getModel()),this.appendChild(e.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),r.oY$.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){var t,i,s;if(!e.column)return;const r=this.filterManager.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);r&&((null==(t=this.underlyingFloatingFilter)?void 0:t.refresh)?this.underlyingFloatingFilter.refresh(r.params):null==(s=null==(i=this.underlyingFloatingFilter)?void 0:i.onParamsUpdated)||s.call(i,r.params))}onParentModelChanged(e,t){var i,s;this.showingUnderlyingFloatingFilter?null==(s=this.underlyingFloatingFilter)||s.onParentModelChanged(null==(i=this.parentFilterInstance.getSelectedFilter())?void 0:i.getModel(),t):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const e=this.parentFilterInstance.getSelectedFilter();if(!e)return this.eFloatingFilterText.setValue(""),void this.eFloatingFilterText.setDisplayed(!1);if(this.eFloatingFilterText.setDisplayed(!0),e.getModelAsString){const t=e.getModel();this.eFloatingFilterText.setValue(null==t?"":e.getModelAsString(t))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}};Kw([(0,r.dsm)("columnModel")],fx.prototype,"columnModel",2),Kw([(0,r.dsm)("filterManager")],fx.prototype,"filterManager",2),Kw([(0,r.PIB)("eFloatingFilter")],fx.prototype,"eFloatingFilter",2);var yx={version:"31.3.4",moduleName:r.zsj.RowGroupingModule,beans:[$w,px,qw,Xw,Zw,Jw],agStackComponents:[{componentName:"AgGridHeaderDropZones",componentClass:ux}],userComponents:[{componentName:"agGroupColumnFilter",componentClass:mx},{componentName:"agGroupColumnFloatingFilter",componentClass:fx}],dependantModules:[mf]},vx=class extends cx{constructor(e){super(e,"aggregation")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),i=e("values","Values");super.init({icon:r._.createIconNoSpan("valuePanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_VALUE_CHANGED,this.refreshGui.bind(this))}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const e=super.getTooltipParams();return e.location="valueColumnsList",e}getIconName(){return this.isPotentialDndItems()?r.WO_.ICON_AGGREGATE:r.WO_.ICON_NOT_ALLOWED}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:r.sVA.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setValueColumns(e,"toolPanelUi")}getExistingItems(){return this.columnModel.getValueColumns()}};Kw([r.o7C],vx.prototype,"passBeansUp",1);var Cx=Object.defineProperty,bx=Object.defineProperties,Sx=Object.getOwnPropertyDescriptor,wx=Object.getOwnPropertyDescriptors,xx=Object.getOwnPropertySymbols,Ex=Object.prototype.hasOwnProperty,Mx=Object.prototype.propertyIsEnumerable,Ax=(e,t,i)=>t in e?Cx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Tx=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?Sx(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Cx(t,i,n),n},Dx=class extends r.uAl{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}setElementToResize(e){this.elementToResize=e}postConstruct(){const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(e,t,i){const s={type:r.sVA.EVENT_TOOL_PANEL_SIZE_CHANGED,width:i,started:e,ended:t};this.eventService.dispatchEvent(s)}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const i=this.inverted?-1:1;let s=Math.max(this.minWidth,Math.floor(this.startingWidth-e*i));null!=this.maxWidth&&(s=Math.min(this.maxWidth,s)),this.elementToResize.style.width=`${s}px`,this.dispatchResizeEvent(!1,t,s)}setInverted(e){this.inverted=e}setMaxWidth(e){this.maxWidth=e}setMinWidth(e){this.minWidth=null!=e?e:100}};Tx([(0,r.dsm)("horizontalResizeService")],Dx.prototype,"horizontalResizeService",2),Tx([r.o7C],Dx.prototype,"postConstruct",1);var Ix=class e extends r.uAl{constructor(e){super(),this.toolPanelDef=e}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const e=this.createTemplate();this.setTemplate(e),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this)),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return'<div class="ag-side-button" role="presentation">\n                <button type="button" ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">\n                    <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n                    <span ref ="eLabel" class="ag-side-button-label"></span>\n                </button>\n            </div>'}setLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.toolPanelDef,i=e(t.labelKey,t.labelDefault);this.eLabel.innerText=i}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",r._.createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchEvent({type:e.EVENT_TOGGLE_BUTTON_CLICKED})}setSelected(e){this.addOrRemoveCssClass("ag-selected",e),r._.setAriaExpanded(this.eToggleButton,e)}getButtonElement(){return this.eToggleButton}};Ix.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",Tx([(0,r.PIB)("eToggleButton")],Ix.prototype,"eToggleButton",2),Tx([(0,r.PIB)("eIconWrapper")],Ix.prototype,"eIconWrapper",2),Tx([(0,r.PIB)("eLabel")],Ix.prototype,"eLabel",2),Tx([r.o7C],Ix.prototype,"postConstruct",1);var Rx=Ix,Px=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.buttonComps=[]}postConstruct(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){if(e.key!==r.DDm.TAB||!e.shiftKey)return;const t=r._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(t,!0)&&e.preventDefault()}setActiveButton(e){this.buttonComps.forEach(t=>{t.setSelected(e===t.getToolPanelId())})}addButtonComp(t){const i=this.createBean(new Rx(t));return this.buttonComps.push(i),this.appendChild(i),i.addEventListener(Rx.EVENT_TOGGLE_BUTTON_CLICKED,()=>{this.dispatchEvent({type:e.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}),i}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),r._.clearElement(this.getGui())}};Px.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",Px.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',Tx([(0,r.dsm)("focusService")],Px.prototype,"focusService",2),Tx([(0,r.dsm)("columnModel")],Px.prototype,"columnModel",2),Tx([r.o7C],Px.prototype,"postConstruct",1),Tx([r.yah],Px.prototype,"clearButtons",1);var kx=Px,Lx=class e{static parse(t){if(t){if(!0===t)return{toolPanels:[e.DEFAULT_COLUMN_COMP,e.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if("string"==typeof t)return e.parse([t]);if(Array.isArray(t)){const i=[];if(t.forEach(t=>{const s=e.DEFAULT_BY_KEY[t];s?i.push(s):console.warn(`AG Grid: the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(e.DEFAULT_BY_KEY).join(",")}`)}),0===i.length)return;return{toolPanels:i,defaultToolPanel:i[0].id}}return{toolPanels:e.parseComponents(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}}static parseComponents(t){const i=[];return t?(t.forEach(t=>{let s=null;if("string"==typeof t){const i=e.DEFAULT_BY_KEY[t];if(!i)return void console.warn(`AG Grid: the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(e.DEFAULT_BY_KEY).join(",")}`);s=i}else s=t;i.push(s)}),i):i}};Lx.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Lx.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Lx.DEFAULT_BY_KEY={columns:Lx.DEFAULT_COLUMN_COMP,filters:Lx.DEFAULT_FILTER_COMP};var Nx=Lx,_x=class e extends r.uAl{constructor(){super(e.TEMPLATE)}setupResize(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new Dx);e.setAttribute("id",`ag-${this.getCompId()}`),t.setElementToResize(e),this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){const{id:i,minWidth:s,maxWidth:r,width:n}=e;this.toolPanelId=i,this.width=n;const o=this.userComponentFactory.getToolPanelCompDetails(e,t),a=o.newAgStackInstance();this.params=o.params,null!=a?(a.then(this.setToolPanelComponent.bind(this)),null!=s&&this.resizeBar.setMinWidth(s),null!=r&&this.resizeBar.setMaxWidth(r)):console.warn(`AG Grid: error processing tool panel component ${i}. You need to specify 'toolPanel'`)}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t="left"===e,i=this.gos.get("enableRtl")?t:!t;this.resizeBar.setInverted(i)}refresh(){this.toolPanelCompInstance.refresh(this.params)}};_x.TEMPLATE='<div class="ag-tool-panel-wrapper" role="tabpanel"/>',Tx([(0,r.dsm)("userComponentFactory")],_x.prototype,"userComponentFactory",2),Tx([r.o7C],_x.prototype,"setupResize",1);var Ox=_x,Fx=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.toolPanelWrappers=[]}postConstruct(){var e;this.sideBarButtonsComp.addEventListener(kx.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=null!=(e=this.gos.get("initialState"))?e:{};this.setSideBarDef({sideBarDef:Nx.parse(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this),this.createManagedBean(new r.G21(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))}onTabKeyDown(e){if(e.defaultPrevented)return;const{focusService:t,sideBarButtonsComp:i}=this,s=this.getGui(),r=i.getGui(),n=this.gos.getActiveDomElement(),o=s.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target;if(!o)return;if(r.contains(n))return void(t.focusInto(o,e.shiftKey)&&e.preventDefault());if(!e.shiftKey)return;let l=null;o.contains(n)?l=this.focusService.findNextFocusableElement(o,void 0,!0):t.isTargetUnderManagedComponent(o,a)&&e.shiftKey&&(l=this.focusService.findFocusableElementBeforeTabGuard(o,a)),l||(l=r.querySelector(".ag-selected button")),l&&l!==e.target&&(e.preventDefault(),l.focus())}handleKeyDown(e){const t=this.gos.getActiveDomElement();if(!this.sideBarButtonsComp.getGui().contains(t))return;const i=this.sideBarButtonsComp.getGui(),s=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),n=s.findIndex(e=>e.contains(t));let o=null;switch(e.key){case r.DDm.LEFT:case r.DDm.UP:o=Math.max(0,n-1);break;case r.DDm.RIGHT:case r.DDm.DOWN:o=Math.min(n+1,s.length-1)}if(null===o)return;const a=s[o].querySelector("button");a&&(a.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:i}){if(this.setDisplayed(!1),this.sideBar=e,this.sideBar&&this.sideBar.toolPanels){const e=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(e,t,i),!this.toolPanelWrappers.length)return;const s=t?t.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(t?t.position:this.sideBar.position),s)if(t){const{openToolPanel:e}=t;e&&this.openToolPanel(e,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t="left"===e,i=t?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",t),this.addOrRemoveCssClass("ag-side-bar-right",!t),this.toolPanelWrappers.forEach(e=>{e.setResizerSizerSide(i)}),this.eventService.dispatchEvent({type:r.sVA.EVENT_SIDE_BAR_UPDATED}),this}setDisplayed(e,t){super.setDisplayed(e,t),this.eventService.dispatchEvent({type:r.sVA.EVENT_SIDE_BAR_UPDATED})}getState(){const e={};return this.toolPanelWrappers.forEach(t=>{var i,s;e[t.getToolPanelId()]=null==(s=null==(i=t.getToolPanelInstance())?void 0:i.getState)?void 0:s.call(i)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,i){var s;for(const r of e)this.createToolPanelAndSideButton(r,null==(s=null==t?void 0:t.toolPanels)?void 0:s[r.id],null==i?void 0:i[r.id])}validateDef(e){if(null==e.id)return console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if("agColumnsToolPanel"===e.toolPanel&&!r.syG.__assertRegistered(r.zsj.ColumnsToolPanelModule,"Column Tool Panel",this.context.getGridId()))return!1;if("agFiltersToolPanel"===e.toolPanel){if(!r.syG.__assertRegistered(r.zsj.FiltersToolPanelModule,"Filters Tool Panel",this.context.getGridId()))return!1;if(this.filterManager.isAdvancedFilterEnabled())return r._.warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(e,t,i){if(!this.validateDef(e))return;const s=this.sideBarButtonsComp.addButtonComp(e);let n;i?n=i:(n=this.getContext().createBean(new Ox),n.setToolPanelDef(e,{initialState:t,onStateUpdated:()=>this.eventService.dispatchEvent({type:r.sVA.EVENT_SIDE_BAR_UPDATED})})),n.setDisplayed(!1);const o=n.getGui();this.appendChild(o),this.toolPanelWrappers.push(n),r._.setAriaControls(s.getButtonElement(),o)}refresh(){this.toolPanelWrappers.forEach(e=>e.refresh())}openToolPanel(e,t="api"){const i=this.openedItem();i!==e&&(this.toolPanelWrappers.forEach(t=>{const i=e===t.getToolPanelId();t.setDisplayed(i)}),i!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,null!=i?i:void 0,t)))}getToolPanelInstance(e){const t=this.toolPanelWrappers.filter(t=>t.getToolPanelId()===e)[0];if(t)return t.getToolPanelInstance();console.warn(`AG Grid: unable to lookup Tool Panel as invalid key supplied: ${e}`)}raiseToolPanelVisibleEvent(e,t,i){const s=!!e&&!!t;if(t){const e={type:r.sVA.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:i,key:t,visible:!1,switchingToolPanel:s};this.eventService.dispatchEvent(e)}if(e){const t={type:r.sVA.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:i,key:e,visible:!0,switchingToolPanel:s};this.eventService.dispatchEvent(t)}}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;return this.toolPanelWrappers.forEach(t=>{t.isDisplayed()&&(e=t.getToolPanelId())}),e}onSideBarUpdated(){var e;const t=Nx.parse(this.gos.get("sideBar"));let i={};t&&this.sideBar&&(null==(e=t.toolPanels)||e.forEach(e=>{var t,s;const{id:n}=e;if(!n)return;const o=null==(t=this.sideBar.toolPanels)?void 0:t.find(e=>e.id===n);if(!o||e.toolPanel!==o.toolPanel)return;const a=this.toolPanelWrappers.find(e=>e.getToolPanelId()===n);if(!a)return;const l=this.gos.addGridCommonParams((c=((e,t)=>{for(var i in t||(t={}))Ex.call(t,i)&&Ax(e,i,t[i]);if(xx)for(var i of xx(t))Mx.call(t,i)&&Ax(e,i,t[i]);return e})({},null!=(s=e.toolPanelParams)?s:{}),bx(c,wx({onStateUpdated:()=>this.eventService.dispatchEvent({type:r.sVA.EVENT_SIDE_BAR_UPDATED})}))));var c;!0===a.getToolPanelInstance().refresh(l)&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(e=>e!==a),r._.removeFromParent(a.getGui()),i[n]=a)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:i})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(e=>{r._.removeFromParent(e.getGui()),this.destroyBean(e)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};Fx.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n            <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n        </div>',Tx([(0,r.dsm)("focusService")],Fx.prototype,"focusService",2),Tx([(0,r.dsm)("filterManager")],Fx.prototype,"filterManager",2),Tx([(0,r.dsm)("sideBarService")],Fx.prototype,"sideBarService",2),Tx([(0,r.PIB)("sideBarButtons")],Fx.prototype,"sideBarButtonsComp",2),Tx([r.o7C],Fx.prototype,"postConstruct",1);var Gx=Fx,Bx=class extends r.XQb{constructor(){super(...arguments),this.isColGroupDef=e=>e&&void 0!==e.children,this.getId=e=>this.isColGroupDef(e)?e.groupId:e.colId}createColumnTree(e){const t=[],i=(e,s)=>{if(this.isColGroupDef(e)){const t=e,n=void 0!==t.groupId?t.groupId:t.headerName,o=new r.D45(t,n,!1,s),a=[];return t.children.forEach(e=>{const t=i(e,s+1);t&&a.push(t)}),o.setChildren(a),o}{const i=e,s=i.colId?i.colId:i.field,r=this.columnModel.getPrimaryColumn(s);return r||t.push(i),r}},s=[];return e.forEach(e=>{const t=i(e,0);t&&s.push(t)}),t.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",t),s}syncLayoutWithGrid(e){const t=this.getLeafPathTrees();e(this.mergeLeafPathTrees(t))}getLeafPathTrees(){const e=(t,i)=>{let s;if(t instanceof r.D45)if(t.isPadding())s=i;else{const e=Object.assign({},t.getColGroupDef());e.groupId=t.getGroupId(),e.children=[i],s=e}else{const e=Object.assign({},t.getColDef());e.colId=t.getColId(),s=e}const n=t.getOriginalParent();return n?e(n,s):s};return this.columnModel.getAllGridColumns().filter(e=>{const t=e.getColDef();return e.isPrimary()&&!t.showRowGroup}).map(t=>e(t,t.getColDef()))}mergeLeafPathTrees(e){const t=(e,t)=>this.isColGroupDef(e)&&this.isColGroupDef(t)&&this.getId(e)===this.getId(t),i=(e,t)=>{if(!this.isColGroupDef(t))return e;const s=e,r=t;return r.children&&r.groupId&&this.addChildrenToGroup(s,r.groupId,r.children[0])||r.children.forEach(e=>i(s,e)),s},s=[];for(let r=1;r<=e.length;r++){const n=e[r-1],o=e[r];t(n,o)?e[r]=i(n,o):s.push(n)}return s}addChildrenToGroup(e,t,i){if(!this.isColGroupDef(e))return!0;const s=e,n=i;if(((e,t)=>{const i=e.children.map(this.getId),s=r._.includes(i,this.getId(t)),n=r._.last(e.children),o=n&&this.getId(n)!==this.getId(t);return s&&o})(s,n))return s.children.push(n),!0;if(s.groupId===t){const e=s.children.map(this.getId);if(!r._.includes(e,this.getId(n)))return s.children.push(n),!0}return s.children.forEach(e=>this.addChildrenToGroup(e,t,i)),!1}};Tx([(0,r.dsm)("columnModel")],Bx.prototype,"columnModel",2),Bx=Tx([(0,r.dR4)("toolPanelColDefService")],Bx);var Vx=class extends r.XQb{registerSideBarComp(e){this.sideBarComp=e}getSideBarComp(){return this.sideBarComp}};Vx=Tx([(0,r.dR4)("sideBarService")],Vx);var Hx={version:"31.3.4",moduleName:r.zsj.SideBarModule,beans:[Bx,Vx],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:Dx},{componentName:"AgSideBar",componentClass:Gx},{componentName:"AgSideBarButtons",componentClass:kx}],dependantModules:[mf]},Ux=Object.defineProperty,zx=Object.getOwnPropertyDescriptor,Wx=Object.getOwnPropertySymbols,jx=Object.prototype.hasOwnProperty,Kx=Object.prototype.propertyIsEnumerable,$x=(e,t,i)=>t in e?Ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Yx=(e,t)=>{for(var i in t||(t={}))jx.call(t,i)&&$x(e,i,t[i]);if(Wx)for(var i of Wx(t))Kx.call(t,i)&&$x(e,i,t[i]);return e},qx=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?zx(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&Ux(t,i,n),n},Xx=class e extends r.uAl{constructor(){super(e.TEMPLATE)}postConstruct(){this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",e=>{e.key===r.DDm.SPACE&&(e.preventDefault(),this.onExpandClicked())}),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedListener(this.eFilterTextField.getInputElement(),"keydown",this.onMiniFilterKeyDown.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));const e=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=r._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=r._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=r._.createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,i=!this.params.suppressColumnExpandAll,s=this.columnModel.isPrimaryColumnGroupsPresent(),n=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(n("searchOoo","Search...")),r._.setDisplayed(this.eFilterTextField.getGui(),e),r._.setDisplayed(this.eSelect.getGui(),t),r._.setDisplayed(this.eExpand,i&&s)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=r._.debounce(()=>{const e=this.eFilterTextField.getValue();this.dispatchEvent({type:"filterChanged",filterText:e})},e.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===r.DDm.ENTER&&setTimeout(()=>this.onSelectClicked(),e.DEBOUNCE_DELAY)}onSelectClicked(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchEvent({type:0===this.expandState?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,r._.setDisplayed(this.eExpandChecked,0===this.expandState),r._.setDisplayed(this.eExpandUnchecked,1===this.expandState),r._.setDisplayed(this.eExpandIndeterminate,2===this.expandState)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}};Xx.DEBOUNCE_DELAY=300,Xx.TEMPLATE='<div class="ag-column-select-header" role="presentation">\n            <div ref="eExpand" class="ag-column-select-header-icon"></div>\n            <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n            <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n        </div>',qx([(0,r.dsm)("columnModel")],Xx.prototype,"columnModel",2),qx([(0,r.PIB)("eExpand")],Xx.prototype,"eExpand",2),qx([(0,r.PIB)("eSelect")],Xx.prototype,"eSelect",2),qx([(0,r.PIB)("eFilterTextField")],Xx.prototype,"eFilterTextField",2),qx([r.o7C],Xx.prototype,"postConstruct",1);var Zx=Xx,Qx=class e{constructor(e,t,i,s=!1,n){this.eventService=new r.USV,this.displayName=e,this.dept=i,this.group=s,s?(this.columnGroup=t,this.expanded=n,this.children=[]):this.column=t}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.eventService.dispatchEvent({type:e.EVENT_EXPANDED_CHANGED}))}setPassesFilter(e){this.passesFilter=e}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}};Qx.EVENT_EXPANDED_CHANGED="expandedChanged";var Jx=Qx,eE=class extends r.uAl{constructor(e,t,i){super('<div class="ag-menu"></div>'),this.column=e,this.mouseEvent=t,this.parentEl=i,this.displayName=null}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),this.column instanceof r.VPZ?this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const e=this.getMappedMenuItems();if(0===e.length)return;this.displayContextMenu(e)}}initializeProperties(e){e instanceof r.D45?this.columns=e.getLeafColumns():this.columns=[e],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const e=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColumnGroupingLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${e("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${e("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>e("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>e("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>e("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(e){return[...e].concat(this.columns.filter(t=>-1===e.indexOf(t)))}removeColumnsFromList(e){return e.filter(e=>-1===this.columns.indexOf(e))}displayContextMenu(e){const t=this.getGui(),i=this.createBean(new r.i9O),s=this.localeService.getLocaleTextFunc();let n=()=>{};t.appendChild(i.getGui()),i.addMenuItems(e),i.addManagedListener(i,r.yuY.EVENT_CLOSE_MENU,()=>{this.parentEl.focus(),n()});const o=this.popupService.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(i.getGui()),ariaLabel:s("ariaLabelContextMenu","Context Menu"),closedCallback:e=>{e instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(i)}});o&&(n=o.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[];for(const t of this.menuItemMap.values()){const i=this.columns.some(e=>t.allowedFunction(e)&&!t.activeFunction(e)),s=this.columns.some(e=>t.allowedFunction(e)&&t.activeFunction(e));i&&e.push({name:t.activateLabel(this.displayName),icon:r._.createIconNoSpan(t.addIcon,this.gos,null),action:()=>t.activateFunction()}),s&&e.push({name:t.deactivateLabel(this.displayName),icon:r._.createIconNoSpan(t.removeIcon,this.gos,null),action:()=>t.deActivateFunction()})}return e}};qx([(0,r.dsm)("columnModel")],eE.prototype,"columnModel",2),qx([(0,r.dsm)("popupService")],eE.prototype,"popupService",2),qx([(0,r.dsm)("focusService")],eE.prototype,"focusService",2),qx([r.o7C],eE.prototype,"postConstruct",1);var tE=class e extends r.uAl{constructor(e,t,i,s){super(),this.modelItem=e,this.allowDragging=t,this.eventType=i,this.focusWrapper=s,this.processingColumnStateChange=!1,this.modelItem=e,this.columnGroup=e.getColumnGroup(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName(),this.allowDragging=t}init(){this.setTemplate(e.TEMPLATE),this.eDragHandle=r._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,r.sVA.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,Jx.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),r.PC7.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(e=>this.addOrRemoveCssClass(e,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;let t;"whenTruncated"===this.gos.get("tooltipShowMode")&&(t=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const i=e.headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:t})};i(),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,i)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumnGroup",e}handleKeyDown(e){switch(e.key){case r.DDm.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case r.DDm.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case r.DDm.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}}onContextMenu(e){const{columnGroup:t,gos:i}=this;if(i.get("functionsReadOnly"))return;const s=this.createBean(new eE(t,e,this.focusWrapper));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}addVisibilityListenersToAllChildren(){this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListener(e,r.VPZ.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,r.VPZ.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,r.VPZ.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,r.VPZ.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this))})}setupDragging(){if(!this.allowDragging)return void r._.setDisplayed(this.eDragHandle,!1);let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:r.qRA.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?r.WO_.ICON_HIDE:r.WO_.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:r.sVA.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.columnGroup};this.eventService.dispatchEvent(t)},onDragStopped:()=>{const e={type:r.sVA.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(e)},onGridEnter:t=>{e&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:null==t?void 0:t.visibleState,pivotState:null==t?void 0:t.pivotState,eventType:this.eventType})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},i={};return e.forEach(e=>{const s=e.getId();t[s]=e.isVisible(),i[s]=this.modelItemUtils.createPivotState(e)}),{columns:e,visibleState:t,pivotState:i}}setupExpandContract(){this.eGroupClosedIcon.appendChild(r._.createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(r._.createIcon("columnSelectOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));const e=new r.MVO(this.eColumnGroupIcons,!0);this.addManagedListener(e,r.MVO.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=i=>{i.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?t(i.getChildren()):e.push(i.getColumn()))})};return t(this.modelItem.getChildren()),e}onChangeCommon(e){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),i=this.cbSelect.getValue(),s=void 0===i?e("ariaIndeterminate","indeterminate"):i?e("ariaVisible","visible"):e("ariaHidden","hidden"),n=e("ariaToggleVisibility","Press SPACE to toggle visibility");r._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${n} (${s})`),r._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(e),this.cbSelect.setReadOnly(t),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.columnModel.isPivotMode(),t=this.getVisibleLeafColumns();let i=0,s=0;if(t.forEach(t=>{!e&&t.getColDef().lockVisible||(this.isColumnChecked(t,e)?i++:s++)}),!(i>0&&s>0))return i>0}workOutReadOnlyValue(){const e=this.columnModel.isPivotMode();let t=0;return this.columnGroup.getLeafColumns().forEach(i=>{e?i.isAnyFunctionAllowed()&&t++:i.getColDef().lockVisible||t++}),0===t}isColumnChecked(e,t){if(t){const t=e.isPivotActive(),i=e.isRowGroupActive(),s=e.isValueActive();return t||i||s}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.isExpanded();r._.setDisplayed(this.eGroupClosedIcon,!e),r._.setDisplayed(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){r._.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}};tE.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n            <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n                <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n                <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n            </span>\n            <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n            <span class="ag-column-select-column-label" ref="eLabel"></span>\n        </div>',qx([(0,r.dsm)("columnModel")],tE.prototype,"columnModel",2),qx([(0,r.dsm)("dragAndDropService")],tE.prototype,"dragAndDropService",2),qx([(0,r.dsm)("modelItemUtils")],tE.prototype,"modelItemUtils",2),qx([(0,r.PIB)("cbSelect")],tE.prototype,"cbSelect",2),qx([(0,r.PIB)("eLabel")],tE.prototype,"eLabel",2),qx([(0,r.PIB)("eGroupOpenedIcon")],tE.prototype,"eGroupOpenedIcon",2),qx([(0,r.PIB)("eGroupClosedIcon")],tE.prototype,"eGroupClosedIcon",2),qx([(0,r.PIB)("eColumnGroupIcons")],tE.prototype,"eColumnGroupIcons",2),qx([r.o7C],tE.prototype,"init",1);var iE=tE,sE=class extends r.XQb{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new r.ia$(this.comp,this.virtualList,{dragSourceType:r.qRA.ToolPanel,listItemDragStartEvent:r.sVA.EVENT_COLUMN_PANEL_ITEM_DRAG_START,listItemDragEndEvent:r.sVA.EVENT_COLUMN_PANEL_ITEM_DRAG_END,eventSource:this.eventService,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:e=>this.isMoveBlocked(e),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.column}isMoveBlocked(e){return!!this.gos.get("suppressMovableColumns")||!!this.getCurrentColumns(e).find(e=>{const t=e.getColDef();return!!t.suppressMovable||!!t.lockPosition})}moveItem(e,t){const i=this.getTargetIndex(e,t),s=this.getCurrentColumns(e);null!=i&&this.columnModel.moveColumns(s,i,"toolPanelUi")}getMoveDiff(e,t){const i=this.columnModel.getAllGridColumns(),s=this.getCurrentColumns(e),r=s[0],n=s.length;return i.indexOf(r)<t?n:0}getCurrentColumns(e){return e instanceof r.D45?e.getLeafColumns():[e]}getTargetIndex(e,t){if(!t)return null;const i=t.component;let s,r="top"===t.position;if(i instanceof iE?(s=i.getColumns()[0],r=!0):s=i.getColumn(),-1!==this.getCurrentColumns(e).indexOf(s))return null;const n=this.columnModel.getAllGridColumns().indexOf(s),o=r?n:n+1;return o-this.getMoveDiff(e,o)}};qx([(0,r.dsm)("columnModel")],sE.prototype,"columnModel",2),qx([r.o7C],sE.prototype,"postConstruct",1);var rE=class e extends r.uAl{constructor(e,t,i,s){super(),this.allowDragging=t,this.groupsExist=i,this.focusWrapper=s,this.processingColumnStateChange=!1,this.column=e.getColumn(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName()}init(){this.setTemplate(e.TEMPLATE),this.eDragHandle=r._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1");const s=r._.escapeString(this.displayName);this.eLabel.innerHTML=s;const n=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${n}`),this.setupDragging(),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,r.VPZ.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,r.VPZ.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,r.VPZ.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,r.VPZ.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,r.sVA.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),r.PC7.getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(e=>this.addOrRemoveCssClass(e,!0))}getColumn(){return this.column}setupTooltip(){let e;"whenTruncated"===this.gos.get("tooltipShowMode")&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const t=()=>{const t=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:t,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};t(),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,t)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumn",e.colDef=this.column.getColDef(),e}onContextMenu(e){const{column:t,gos:i}=this;if(i.get("functionsReadOnly"))return;const s=this.createBean(new eE(t,e,this.focusWrapper));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}handleKeyDown(e){e.key===r.DDm.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumn","Column"),i=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),s=e("ariaToggleVisibility","Press SPACE to toggle visibility");r._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${s} (${i})`),r._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging)return void r._.setDisplayed(this.eDragHandle,!1);let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:r.qRA.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?r.WO_.ICON_HIDE:r.WO_.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:r.sVA.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.column};this.eventService.dispatchEvent(t)},onDragStopped:()=>{const e={type:r.sVA.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(e)},onGridEnter:t=>{e&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:null==t?void 0:t.visibleState,pivotState:null==t?void 0:t.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},i={[e]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:t,pivotState:i}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.columnModel.isPivotMode();if(e){const e=this.column.isAnyFunctionActive();this.cbSelect.setValue(e)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,i=!0;if(e){const e=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();t=!e&&!s,i=t}else{const{enableRowGroup:e,enableValue:s,lockPosition:r,suppressMovable:n,lockVisible:o}=this.column.getColDef();t=!o,i=!!e||!!s||!(r||n)}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!i),this.addOrRemoveCssClass("ag-column-select-column-readonly",!i&&!t);const s=e&&this.gos.get("functionsPassive");this.cbSelect.setPassive(s),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){console.warn("AG Grid: can not expand a column item that does not represent a column group header")}};rE.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n            <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n            <span class="ag-column-select-column-label" ref="eLabel"></span>\n        </div>',qx([(0,r.dsm)("columnModel")],rE.prototype,"columnModel",2),qx([(0,r.dsm)("dragAndDropService")],rE.prototype,"dragAndDropService",2),qx([(0,r.dsm)("modelItemUtils")],rE.prototype,"modelItemUtils",2),qx([(0,r.PIB)("eLabel")],rE.prototype,"eLabel",2),qx([(0,r.PIB)("cbSelect")],rE.prototype,"cbSelect",2),qx([r.o7C],rE.prototype,"init",1);var nE=rE,oE=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},aE=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(e=>e()),this.destroyColumnItemFuncs=[]}init(e,t,i){this.params=e,this.allowDragging=t,this.eventType=i,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[r.sVA.EVENT_COLUMN_PIVOT_CHANGED,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,r.sVA.EVENT_COLUMN_VALUE_CHANGED,r.sVA.EVENT_COLUMN_VISIBLE,r.sVA.EVENT_NEW_COLUMNS_LOADED].forEach(e=>{this.addManagedListener(this.eventService,e,this.fireSelectionChangedEvent.bind(this))}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new r.wjn({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((e,t)=>(r._.setAriaLevel(t,e.getDept()+1),this.createComponentFromItem(e,t))),this.columnModel.isReady()&&this.onColumnsChanged(),this.params.suppressColumnMove||this.createManagedBean(new sE(this,this.virtualList))}createComponentFromItem(e,t){if(e.isGroup()){const i=new iE(e,this.allowDragging,this.eventType,t);return this.getContext().createBean(i),i}const i=new nE(e,this.allowDragging,this.groupsExist,t);return this.getContext().createBean(i),i}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const e=this.getExpandedStates(),t=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||t?this.buildTreeFromProvidedColumnDefs():this.buildTreeFromWhatGridIsDisplaying(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;return t.forEach(t=>{e[t]=!0}),e}return this.allColsTree?(this.forEachItem(t=>{if(!t.isGroup())return;const i=t.getColumnGroup();i&&(e[i.getId()]=t.isExpanded())}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(i=>{if(!i.isGroup())return;const s=i.getColumnGroup();if(s){const r=e[s.getId()];(null!=r||t)&&i.setExpanded(!!r)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(e){const t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some(e=>e&&void 0!==e.children),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()}buildListModel(e){const t=this.onColumnExpanded.bind(this),i=e=>{e.addEventListener(Jx.EVENT_EXPANDED_CHANGED,t);const i=e.removeEventListener.bind(e,Jx.EVENT_EXPANDED_CHANGED,t);this.destroyColumnItemFuncs.push(i)},s=(e,t,i)=>{e.forEach(e=>{e instanceof r.D45?n(e,t,i):o(e,t,i)})},n=(e,t,r)=>{const n=e.getColGroupDef();if(n&&n.suppressColumnsToolPanel)return;if(e.isPadding())return void s(e.getChildren(),t,r);const o=this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),a=new Jx(o,e,t,!0,this.expandGroupsByDefault);r.push(a),i(a),s(e.getChildren(),t+1,a.getChildren())},o=(e,t,i)=>{if(e.getColDef()&&e.getColDef().suppressColumnsToolPanel)return;const s=this.columnModel.getDisplayNameForColumn(e,"columnToolPanel");i.push(new Jx(s,e,t))};this.destroyColumnTree(),s(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=t=>{t.isPassesFilter()&&(this.displayedColsList.push(t),t.isGroup()&&t.isExpanded()&&t.getChildren().forEach(e))};this.allColsTree.forEach(e),this.virtualList.setModel(new oE(this.displayedColsList));const t=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=t&&this.focusRowIfAlive(t),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),i=e("columns","Columns"),s=this.displayedColsList.length;r._.setAriaLabel(this.virtualList.getAriaElement(),`${t} ${s} ${i}`)}focusRowIfAlive(e){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}forEachItem(e){const t=i=>{i.forEach(i=>{e(i),i.isGroup()&&t(i.getChildren())})};this.allColsTree&&t(this.allColsTree)}doSetExpandedAll(e){this.forEachItem(t=>{t.isGroup()&&t.setExpanded(e)})}setGroupsExpanded(e,t){if(!t)return void this.doSetExpandedAll(e);const i=[];this.forEachItem(s=>{if(!s.isGroup())return;const r=s.getColumnGroup().getId();t.indexOf(r)>=0&&(s.setExpanded(e),i.push(r))});const s=t.filter(e=>!r._.includes(i,e));s.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",s)}getExpandState(){let e=0,t=0;return this.forEachItem(i=>{i.isGroup()&&(i.isExpanded()?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const i=this.columnModel.isPivotMode();if(this.forEachItem(s=>{if(s.isGroup())return;if(!s.isPassesFilter())return;const r=s.getColumn(),n=r.getColDef();let o;if(i){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;o=r.isValueActive()||r.isPivotActive()||r.isRowGroupActive()}else{if(n.lockVisible)return;o=r.isVisible()}o?e++:t++}),!(e>0&&t>0))return!(0===e||t>0)}setFilterText(e){this.filterText=r._.exists(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=e=>{if(!r._.exists(this.filterText))return!0;const t=e.getDisplayName();return null==t||-1!==t.toLowerCase().indexOf(this.filterText)},t=(i,s)=>{let r=!1;if(i.isGroup()){const n=e(i);i.getChildren().forEach(e=>{const i=t(e,n||s);i&&(r=i)})}const n=!(!s&&!r)||e(i);return i.setPassesFilter(n),n};this.allColsTree.forEach(e=>t(e,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree?(this.forEachItem(t=>{t.isGroup()&&t.isExpanded()&&e.push(t.getColumnGroup().getId())}),e):e}};aE.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',qx([(0,r.dsm)("columnModel")],aE.prototype,"columnModel",2),qx([(0,r.dsm)("toolPanelColDefService")],aE.prototype,"colDefService",2),qx([(0,r.dsm)("modelItemUtils")],aE.prototype,"modelItemUtils",2),qx([r.yah],aE.prototype,"destroyColumnTree",1);var lE=aE,cE=class extends r.uAl{createTemplate(){return'<div class="ag-pivot-mode-panel">\n                <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n            </div>'}init(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const e=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(e("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,r.sVA.EVENT_FIELD_VALUE_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))}onBtPivotMode(){const e=!!this.cbPivotMode.getValue();if(e!==this.columnModel.isPivotMode()){this.gos.updateGridOptions({options:{pivotMode:e},source:"toolPanelUi"});const{api:t}=this;t&&t.refreshHeader()}}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.cbPivotMode.setValue(e)}};qx([(0,r.dsm)("columnModel")],cE.prototype,"columnModel",2),qx([(0,r.dsm)("gridApi")],cE.prototype,"api",2),qx([(0,r.PIB)("cbPivotMode")],cE.prototype,"cbPivotMode",2),qx([r.fK3],cE.prototype,"init",1);var hE=class e extends r.uAl{constructor(){super(e.TEMPLATE)}init(e,t,i){this.allowDragging=e,this.params=t,this.eventType=i,this.primaryColsHeaderPanel.init(this.params);const s=this.params.suppressColumnFilter,n=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&s&&n&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new r.qyQ(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}onFilterChanged(e){this.primaryColsListPanel.setFilterText(e.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(e){this.primaryColsHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}onSelectionChange(e){this.primaryColsHeaderPanel.setSelectionState(e.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}};hE.TEMPLATE='<div class="ag-column-select">\n            <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n            <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n        </div>',qx([(0,r.PIB)("primaryColsHeaderPanel")],hE.prototype,"primaryColsHeaderPanel",2),qx([(0,r.PIB)("primaryColsListPanel")],hE.prototype,"primaryColsListPanel",2);var dE=hE,uE=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params=Yx(Yx({},t),e),this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new cE),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new dE),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new hx(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new vx(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new dx(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const e=this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>{this.resetChildrenHeight(),this.setLastVisible()});this.childDestroyFuncs.push(()=>e())}this.initialised=!0}setPivotModeSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new cE),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new hx(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new vx(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new dx(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(e=>{if(!e)return;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))})}setLastVisible(){const e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach(e=>e.classList.remove("ag-last-column-drop"));const t=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=r._.last(t);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let t=0;t<e.length;t++){const i=e[t];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return r.syG.__assertRegistered(r.zsj.RowGroupingModule,"Row Grouping",this.context.getGridId())}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(e=>e()),this.childDestroyFuncs.length=0,r._.clearElement(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}};uE.TEMPLATE='<div class="ag-column-panel"></div>';var pE=uE,gE=class{selectAllChildren(e,t,i){const s=this.extractAllLeafColumns(e);this.setAllColumns(s,t,i)}setColumn(e,t,i){this.setAllColumns([e],t,i)}setAllColumns(e,t,i){this.columnModel.isPivotMode()?this.setAllPivot(e,t,i):this.setAllVisible(e,t,i)}extractAllLeafColumns(e){const t=[],i=e=>{e.forEach(e=>{e.isPassesFilter()&&(e.isGroup()?i(e.getChildren()):t.push(e.getColumn()))})};return i(e),t}setAllVisible(e,t,i){const s=[];e.forEach(e=>{e.getColDef().lockVisible||e.isVisible()!=t&&s.push({colId:e.getId(),hide:!t})}),s.length>0&&this.columnModel.applyColumnState({state:s},i)}setAllPivot(e,t,i){this.gos.get("functionsPassive")?this.setAllPivotPassive(e,t):this.setAllPivotActive(e,t,i)}setAllPivotPassive(e,t){const i=this.columnModel.getPivotColumns().slice(),s=this.columnModel.getValueColumns().slice(),n=this.columnModel.getRowGroupColumns().slice();let o=!1,a=!1,l=!1;const c=t?e=>{e.isAnyFunctionActive()||(e.isAllowValue()?(s.push(e),a=!0):e.isAllowRowGroup()?(n.push(e),o=!0):e.isAllowPivot()&&(i.push(e),l=!0))}:e=>{e.isAnyFunctionActive()&&(i.indexOf(e)>=0&&(r._.removeFromArray(i,e),o=!0),s.indexOf(e)>=0&&(r._.removeFromArray(s,e),a=!0),n.indexOf(e)>=0&&(r._.removeFromArray(n,e),l=!0))};if(e.forEach(c),o){const e={type:r.sVA.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:i};this.eventService.dispatchEvent(e)}if(l){const e={type:r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:n};this.eventService.dispatchEvent(e)}if(a){const e={type:r.sVA.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:n};this.eventService.dispatchEvent(e)}}setAllPivotActive(e,t,i){const s=[],r=t?e=>{if(!e.isAnyFunctionActive())if(e.isAllowValue()){const t="string"==typeof e.getAggFunc()?e.getAggFunc():this.aggFuncService.getDefaultAggFunc(e);s.push({colId:e.getId(),aggFunc:t})}else e.isAllowRowGroup()?s.push({colId:e.getId(),rowGroup:!0}):e.isAllowPivot()&&s.push({colId:e.getId(),pivot:!0})}:e=>{(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&s.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};e.forEach(r),s.length>0&&this.columnModel.applyColumnState({state:s},i)}updateColumns(e){const{columns:t,visibleState:i,pivotState:s,eventType:r}=e,n=t.map(e=>{const t=e.getColId();if(this.columnModel.isPivotMode()){const e=null==s?void 0:s[t];return{colId:t,pivot:null==e?void 0:e.pivot,rowGroup:null==e?void 0:e.rowGroup,aggFunc:null==e?void 0:e.aggFunc}}return{colId:t,hide:!(null==i?void 0:i[t])}});this.columnModel.applyColumnState({state:n},r)}createPivotState(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}};qx([(0,r.dsm)("aggFuncService")],gE.prototype,"aggFuncService",2),qx([(0,r.dsm)("columnModel")],gE.prototype,"columnModel",2),qx([(0,r.dsm)("gridOptionsService")],gE.prototype,"gos",2),qx([(0,r.dsm)("eventService")],gE.prototype,"eventService",2),gE=qx([(0,r.dR4)("modelItemUtils")],gE);var mE,fE,yE,vE,CE,bE,SE,wE,xE,EE={version:"31.3.4",moduleName:r.zsj.ColumnsToolPanelModule,beans:[gE],agStackComponents:[{componentName:"AgPrimaryColsHeader",componentClass:Zx},{componentName:"AgPrimaryColsList",componentClass:lE},{componentName:"AgPrimaryCols",componentClass:dE}],userComponents:[{componentName:"agColumnsToolPanel",componentClass:pE}],dependantModules:[mf,yx,Hx]},ME=Object.defineProperty,AE=Object.defineProperties,TE=Object.getOwnPropertyDescriptor,DE=Object.getOwnPropertyDescriptors,IE=Object.getOwnPropertySymbols,RE=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,kE=(e,t,i)=>t in e?ME(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,LE=(e,t)=>{for(var i in t||(t={}))RE.call(t,i)&&kE(e,i,t[i]);if(IE)for(var i of IE(t))PE.call(t,i)&&kE(e,i,t[i]);return e},NE=(e,t)=>AE(e,DE(t)),_E=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?TE(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&ME(t,i,n),n},OE={getTemplate(e){const t=(new Date).toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t}]}}},FE={getTemplate(e){const{name:t,ContentType:i,Extension:s,PartName:r}=e;return{name:t,properties:{rawMap:{Extension:s,PartName:r,ContentType:i}}}}},GE={getTemplate(e){const t=new Array(e).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${t+1}.xml`})),i=pA.worksheetImages.size,s=pA.worksheetHeaderFooterImages.size,r=pA.worksheetDataTables.size,n={};pA.workbookImageIds.forEach(e=>{const t="jpg"===e.type?"jpeg":e.type;n[t]=!0});const o=new Array(i).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${t+1}.xml`})),a=new Array(r).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${pA.getTableNameFromIndex(t)}.xml`})),l=Object.keys(n).map(e=>({name:"Default",ContentType:`image/${e}`,Extension:e}));return s&&l.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:[...l,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...t,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...o,...a,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"}].map(e=>FE.getTemplate(e))}}},BE={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},VE=e=>Math.round(96*e/72),HE=e=>Math.ceil(9525*e),UE=(e,t)=>{if(!t)return;let i;return i="number"==typeof t?t:t({rowIndex:e}),s=i,Math.round(72*s/96);var s},zE=(e,t)=>{const i=r.aS7.createHeader({encoding:"UTF-8",standalone:"yes"}),s=r.aS7.createXml(e);return t?s:`${i}${s}`},WE=e=>{const t=String.fromCharCode,i=Math.floor(e/26),s=e%26;return i&&26!==e?s?i<26?t(65+i-1)+t(65+s-1):WE(i)+t(65+s-1):WE(i-1)+"Z":t(65+e-1)},jE=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),KE=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor&&e.recolor.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},$E=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:null!=e.altText?e.altText:void 0}},children:[KE(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),YE=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:1e3*e.saturation}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:1e3*e.tint}}}),t},qE=(e,t)=>{let i;if(e.transparency){const t=Math.min(Math.max(e.transparency,0),100);i=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(1e3*t)}}}]}if(e.recolor)switch(i||(i=[]),e.recolor.toLocaleLowerCase()){case"grayscale":i.push({name:"a:grayscl"});break;case"sepia":i.push((r={color:"D9C3A5",tint:50,saturation:180},{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:(s={color:"black"}).color}},children:YE(s)},{name:"a:srgbClr",properties:{rawMap:{val:r.color}},children:YE(r)}]}));break;case"washout":i.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}})}var s,r;return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:i},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},XE=(e,t)=>{const i={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const t=e.rotation;i.properties={rawMap:{rot:6e4*Math.min(Math.max(t,0),360)}}}return{name:"xdr:spPr",children:[i,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},ZE=(e,t,i,s)=>({name:"xdr:pic",children:[$E(e,t+1),qE(e,i+1),XE(e,s)]}),QE={getTemplate(e){const{sheetIndex:t}=e,i=pA.worksheetImages.get(t),s=pA.worksheetImageIds.get(t);return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:i.map((e,t)=>{const i=(e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:i,width:s=0,height:r=0,totalHeight:n,totalWidth:o}=e,{offsetX:a=0,offsetY:l=0,row:c=1,rowSpan:h=1,column:d=1,colSpan:u=1}=t;return{from:{row:c-1,col:d-1,offsetX:HE(a),offsetY:HE(l)},to:{row:c-1+(i?1:h-1),col:d-1+(i?1:u-1),offsetX:HE(s+a),offsetY:HE(r+l)},height:HE(n||r),width:HE(o||s)}})(e);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[jE("from",i.from),jE("to",i.to),ZE(e,t,s.get(e.id).index,i),{name:"xdr:clientData"}]}})}}},JE={getTemplate(e,t){const{name:i,columns:s,rowCount:r,displayName:n,headerRowIndex:o,showRowStripes:a,showColumnStripes:l,showFilterButtons:c,highlightFirstColumn:h,highlightLastColumn:d}=e||{};if(!(e&&i&&Array.isArray(s)&&s.length&&r))return{name:"table"};const u=s.map((e,t)=>({name:"filterColumn",properties:{rawMap:{colId:t.toString(),hiddenButton:c[t]?0:1}}})),p=o+1,g=(t+1).toString(),m=`A${p}:${String.fromCharCode(64+s.length)}${p+r}`;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:i,displayName:t?`${n}_${t+1}`:n,ref:m,totalsRowShown:0,id:g}},children:[{name:"autoFilter",properties:{rawMap:{ref:m}},children:u},{name:"tableColumns",properties:{rawMap:{count:s.length}},children:s.map((e,t)=>({name:"tableColumn",properties:{rawMap:{id:(t+1).toString(),name:e,dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:h?1:0,showLastColumn:d?1:0,showRowStripes:a?1:0,showColumnStripes:l?1:0}}}]}}},eM=e=>{const[t,i,s,r]=e;return{name:`a:${t}`,children:[{name:`a:${i}`,properties:{rawMap:{val:s,lastClr:r}}}]}},tM=()=>({name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[eM(["dk1","sysClr","windowText","000000"]),eM(["lt1","sysClr","window","FFFFFF"]),eM(["dk2","srgbClr","44546A"]),eM(["lt2","srgbClr","E7E6E6"]),eM(["accent1","srgbClr","4472C4"]),eM(["accent2","srgbClr","ED7D31"]),eM(["accent3","srgbClr","A5A5A5"]),eM(["accent4","srgbClr","FFC000"]),eM(["accent5","srgbClr","5B9BD5"]),eM(["accent6","srgbClr","70AD47"]),eM(["hlink","srgbClr","0563C1"]),eM(["folHlink","srgbClr","954F72"])]}),iM=e=>{const[t,i,s,r]=e;return{name:`a:${t}`,properties:{rawMap:{script:s,typeface:i,panose:r}}}},sM=()=>({name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[iM(["latin","Calibri Light",void 0,"020F0302020204030204"]),iM(["ea",""]),iM(["cs",""]),iM(["font","游ゴシック Light","Jpan"]),iM(["font","맑은 고딕","Hang"]),iM(["font","等线 Light","Hans"]),iM(["font","新細明體","Hant"]),iM(["font","Times New Roman","Arab"]),iM(["font","Times New Roman","Hebr"]),iM(["font","Tahoma","Thai"]),iM(["font","Nyala","Ethi"]),iM(["font","Vrinda","Beng"]),iM(["font","Shruti","Gujr"]),iM(["font","MoolBoran","Khmr"]),iM(["font","Tunga","Knda"]),iM(["font","Raavi","Guru"]),iM(["font","Euphemia","Cans"]),iM(["font","Plantagenet Cherokee","Cher"]),iM(["font","Microsoft Yi Baiti","Yiii"]),iM(["font","Microsoft Himalaya","Tibt"]),iM(["font","MV Boli","Thaa"]),iM(["font","Mangal","Deva"]),iM(["font","Gautami","Telu"]),iM(["font","Latha","Taml"]),iM(["font","Estrangelo Edessa","Syrc"]),iM(["font","Kalinga","Orya"]),iM(["font","Kartika","Mlym"]),iM(["font","DokChampa","Laoo"]),iM(["font","Iskoola Pota","Sinh"]),iM(["font","Mongolian Baiti","Mong"]),iM(["font","Times New Roman","Viet"]),iM(["font","Microsoft Uighur","Uigh"]),iM(["font","Sylfaen","Geor"]),iM(["font","Arial","Armn"]),iM(["font","Leelawadee UI","Bugi"]),iM(["font","Microsoft JhengHei","Bopo"]),iM(["font","Javanese Text","Java"]),iM(["font","Segoe UI","Lisu"]),iM(["font","Myanmar Text","Mymr"]),iM(["font","Ebrima","Nkoo"]),iM(["font","Nirmala UI","Olck"]),iM(["font","Ebrima","Osma"]),iM(["font","Phagspa","Phag"]),iM(["font","Estrangelo Edessa","Syrn"]),iM(["font","Estrangelo Edessa","Syrj"]),iM(["font","Estrangelo Edessa","Syre"]),iM(["font","Nirmala UI","Sora"]),iM(["font","Microsoft Tai Le","Tale"]),iM(["font","Microsoft New Tai Lue","Talu"]),iM(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[iM(["latin","Calibri",void 0,"020F0502020204030204"]),iM(["ea",""]),iM(["cs",""]),iM(["font","游ゴシック","Jpan"]),iM(["font","맑은 고딕","Hang"]),iM(["font","等线","Hans"]),iM(["font","新細明體","Hant"]),iM(["font","Arial","Arab"]),iM(["font","Arial","Hebr"]),iM(["font","Tahoma","Thai"]),iM(["font","Nyala","Ethi"]),iM(["font","Vrinda","Beng"]),iM(["font","Shruti","Gujr"]),iM(["font","DaunPenh","Khmr"]),iM(["font","Tunga","Knda"]),iM(["font","Raavi","Guru"]),iM(["font","Euphemia","Cans"]),iM(["font","Plantagenet Cherokee","Cher"]),iM(["font","Microsoft Yi Baiti","Yiii"]),iM(["font","Microsoft Himalaya","Tibt"]),iM(["font","MV Boli","Thaa"]),iM(["font","Mangal","Deva"]),iM(["font","Gautami","Telu"]),iM(["font","Latha","Taml"]),iM(["font","Estrangelo Edessa","Syrc"]),iM(["font","Kalinga","Orya"]),iM(["font","Kartika","Mlym"]),iM(["font","DokChampa","Laoo"]),iM(["font","Iskoola Pota","Sinh"]),iM(["font","Mongolian Baiti","Mong"]),iM(["font","Arial","Viet"]),iM(["font","Microsoft Uighur","Uigh"]),iM(["font","Sylfaen","Geor"]),iM(["font","Arial","Armn"]),iM(["font","Leelawadee UI","Bugi"]),iM(["font","Microsoft JhengHei","Bopo"]),iM(["font","Javanese Text","Java"]),iM(["font","Segoe UI","Lisu"]),iM(["font","Myanmar Text","Mymr"]),iM(["font","Ebrima","Nkoo"]),iM(["font","Nirmala UI","Olck"]),iM(["font","Ebrima","Osma"]),iM(["font","Phagspa","Phag"]),iM(["font","Estrangelo Edessa","Syrn"]),iM(["font","Estrangelo Edessa","Syrj"]),iM(["font","Estrangelo Edessa","Syre"]),iM(["font","Nirmala UI","Sora"]),iM(["font","Microsoft Tai Le","Tale"]),iM(["font","Microsoft New Tai Lue","Talu"]),iM(["font","Ebrima","Tfng"])]}]}),rM=(e,t,i)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:i}),nM=e=>{const[t,i,s,r,n,o]=e,a=[];return a.push(rM("satMod",s)),r&&a.push(rM("lumMod",r)),n&&a.push(rM("tint",n)),o&&a.push(rM("shade",o)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:i}},children:a}]}},oM=(e,t)=>({name:"a:solidFill",children:[rM("schemeClr",e,t)]}),aM=e=>{const[t,i,s,r,n]=e,[o,a]=n;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[nM(i),nM(s),nM(r)]},{name:"a:lin",properties:{rawMap:{ang:o,scaled:a}}}]}},lM=e=>{const[t,i,s,r]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:i,cmpd:s,algn:r}},children:[oM("phClr"),rM("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},cM=e=>{const t=[];if(e){const[i,s,r,n,o]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:i,dist:s,dir:r,algn:n,rotWithShape:o}},children:[rM("srgbClr","000000",[rM("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},hM=()=>({name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:fillStyleLst",children:[oM("phClr"),aM(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),aM(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]},{name:"a:lnStyleLst",children:[lM(["6350","flat","sng","ctr"]),lM(["12700","flat","sng","ctr"]),lM(["19050","flat","sng","ctr"])]},{name:"a:effectStyleLst",children:[cM(),cM(),cM(["57150","19050","5400000","ctr","0"])]},{name:"a:bgFillStyleLst",children:[oM("phClr"),oM("phClr",[rM("tint","95000"),rM("satMod","170000")]),aM(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}]}),dM=()=>({name:"a:themeElements",children:[tM(),sM(),hM()]}),uM=()=>({name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[dM(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}),pM=e=>{const t=[];for(const i of e.keys()){const e=i.toString(),s={name:"t",textNode:r._.escapeString(e)};e.trim().length!==e.length&&(s.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[s]})}return t},gM=e=>({name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:pM(e)}),mM={getTemplate(e){let{formatCode:t,numFmtId:i}=e;return t.length&&(t=function(e){const t=e.split(/(\[[^\]]*\])/);for(let e=0;e<t.length;e++){let i=t[e];i.length&&(i.startsWith("[")||(i=i.replace(/\$/g,'"$"')),t[e]=r._.escapeString(i))}return t.join("")}(t)),{name:"numFmt",properties:{rawMap:{formatCode:t,numFmtId:i}}}}},fM=e=>({name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map(e=>mM.getTemplate(e))}),yM={getTemplate(e){const{size:t,colorTheme:i,color:s="FF000000",fontName:r="Calibri",family:n,scheme:o,italic:a,bold:l,strikeThrough:c,outline:h,shadow:d,underline:u,verticalAlign:p}=e,g=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:i,rgb:s}}},{name:"name",properties:{rawMap:{val:r}}}];return n&&g.push({name:"family",properties:{rawMap:{val:n}}}),o&&g.push({name:"scheme",properties:{rawMap:{val:o}}}),a&&g.push({name:"i"}),l&&g.push({name:"b"}),c&&g.push({name:"strike"}),h&&g.push({name:"outline"}),d&&g.push({name:"shadow"}),u&&g.push({name:"u",properties:{rawMap:{val:u}}}),p&&g.push({name:"vertAlign",properties:{rawMap:{val:p}}}),{name:"font",children:g}}},vM=e=>({name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(e=>yM.getTemplate(e))}),CM={getTemplate(e){const{patternType:t,fgTheme:i,fgTint:s,fgRgb:r,bgRgb:n,bgIndexed:o}=e,a={name:"patternFill",properties:{rawMap:{patternType:t}}};return(i||s||r)&&(a.children=[{name:"fgColor",properties:{rawMap:{theme:i,tint:s,rgb:r}}}]),(o||n)&&(a.children||(a.children=[]),a.children.push({name:"bgColor",properties:{rawMap:{indexed:o,rgb:n}}})),{name:"fill",children:[a]}}},bM=e=>({name:"fills",properties:{rawMap:{count:e.length}},children:e.map(e=>CM.getTemplate(e))}),SM={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot"},wM=["Dashed","DashDot","DashDotDot"],xM={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},EM={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},MM={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},AM=e=>null==e?e:("#"===e.charAt(0)&&(e=e.substring(1)),6===e.length?"FF"+e:e),TM=(e,t)=>{if(!e)return"thin";const i=(e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}})(t),s=SM[e];return"Continuous"===e?i:"medium"===i&&-1!==wM.indexOf(s)?`medium${s}`:s.charAt(0).toLowerCase()+s.substring(1)},DM=e=>EM[e]||"general",IM=e=>MM[e]||void 0,RM=e=>({name:"color",properties:{rawMap:{rgb:AM(e||"#000000")}}}),PM={getTemplate(e){const{left:t,right:i,top:s,bottom:r,diagonal:n}=e,o=t?[RM(t.color)]:void 0,a=i?[RM(i.color)]:void 0,l=s?[RM(s.color)]:void 0,c=r?[RM(r.color)]:void 0,h=n?[RM(n.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t&&t.style}},children:o},{name:"right",properties:{rawMap:{style:i&&i.style}},children:a},{name:"top",properties:{rawMap:{style:s&&s.style}},children:l},{name:"bottom",properties:{rawMap:{style:r&&r.style}},children:c},{name:"diagonal",properties:{rawMap:{style:n&&n.style}},children:h}]}}},kM=e=>({name:"borders",properties:{rawMap:{count:e.length}},children:e.map(e=>PM.getTemplate(e))}),LM=e=>{const t=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(t,0)},NM={getTemplate(e){const{horizontal:t,indent:i,readingOrder:s,rotate:r,shrinkToFit:n,vertical:o,wrapText:a}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&DM(t),indent:i,readingOrder:s&&LM(s),textRotation:r,shrinkToFit:n,vertical:o&&IM(o),wrapText:a}}}}},_M={getTemplate(e){const t=!1===e.protected?0:1;return{name:"protection",properties:{rawMap:{hidden:!0===e.hideFormula?1:0,locked:t}}}}},OM={getTemplate(e){const{alignment:t,borderId:i,fillId:s,fontId:r,numFmtId:n,protection:o,quotePrefix:a,xfId:l}=e,c=[];return t&&c.push(NM.getTemplate(t)),o&&c.push(_M.getTemplate(o)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:o?1:void 0,applyBorder:i?1:void 0,applyFill:s?1:void 0,borderId:i,fillId:s,applyFont:r?1:void 0,fontId:r,applyNumberFormat:n?1:void 0,numFmtId:n,quotePrefix:a?1:void 0,xfId:l}},children:c.length?c:void 0}}},FM=e=>({name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>OM.getTemplate(e))}),GM=e=>({name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>OM.getTemplate(e))}),BM={getTemplate(e){const{builtinId:t,name:i,xfId:s}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:i,xfId:s}}}}},VM=e=>({name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(e=>BM.getTemplate(e))}),HM=(e,t)=>(-1!==e.indexOf("mixedStyle")&&t>1&&(e+=`_${t}`),e),UM=()=>{mE={base:0},fE=[],yE=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],vE=[{patternType:"none"},{patternType:"gray125"}],CE=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],bE=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],SE=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],wE=[{builtinId:0,name:"Normal",xfId:0}]},zM=e=>{const{alignment:t,borders:i,font:s,interior:r,numberFormat:n,protection:o,quotePrefix:a}=e;let{id:l}=e,c=0,h=0,d=0,u=0;l&&(l=HM(l,xE),null==mE[l]&&(r&&(c=(e=>{const t=(i=e.pattern)?xM[i]||i:"none";var i;const s=AM(e.color),r=AM(e.patternColor);let n=vE.findIndex(e=>{const{patternType:i,fgRgb:n,bgRgb:o}=e;return i==t&&n==s&&o==r});return-1===n&&(n=vE.length,vE.push({patternType:t,fgRgb:s,bgRgb:r})),n})(r)),i&&(h=(e=>{const{borderBottom:t,borderTop:i,borderLeft:s,borderRight:r}=e;let n,o,a,l,c,h,d,u;s&&(a=TM(s.lineStyle,s.weight),d=AM(s.color)),r&&(l=TM(r.lineStyle,r.weight),u=AM(r.color)),t&&(n=TM(t.lineStyle,t.weight),c=AM(t.color)),i&&(o=TM(i.lineStyle,i.weight),h=AM(i.color));let p=CE.findIndex(e=>{const{left:t,right:i,top:s,bottom:r}=e;if(!t&&(a||d))return!1;if(!i&&(l||u))return!1;if(!s&&(o||h))return!1;if(!r&&(n||c))return!1;const{style:p,color:g}=t||{},{style:m,color:f}=i||{},{style:y,color:v}=s||{},{style:C,color:b}=r||{};return p==a&&g==d&&m==l&&f==u&&y==o&&v==h&&C==n&&b==c});return-1===p&&(p=CE.length,CE.push({left:{style:a,color:d},right:{style:l,color:u},top:{style:o,color:h},bottom:{style:n,color:c},diagonal:{style:void 0,color:void 0}})),p})(i)),s&&(d=(e=>{const{fontName:t="Calibri",color:i,size:s,bold:r,italic:n,outline:o,shadow:a,strikeThrough:l,underline:c,family:h,verticalAlign:d}=e,u=AM(i),p=(e=>{if(void 0===e)return;const t=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(t,0)})(h),g=c?c.toLocaleLowerCase():void 0,m=d?d.toLocaleLowerCase():void 0;let f=yE.findIndex(e=>e.fontName==t&&e.color==u&&e.size==s&&e.bold==r&&e.italic==n&&e.outline==o&&e.shadow==a&&e.strikeThrough==l&&e.underline==g&&e.verticalAlign==m&&e.family==p);return-1===f&&(f=yE.length,yE.push({fontName:t,color:u,size:s,bold:r,italic:n,outline:o,shadow:a,strikeThrough:l,underline:g,verticalAlign:m,family:null!=p?p.toString():void 0})),f})(s)),n&&(u=(e=>{if(BE[e])return BE[e];let t=fE.findIndex(t=>t.formatCode===e);return-1===t?(t=fE.length+164,fE.push({formatCode:e,numFmtId:t})):t=fE[t].numFmtId,t})(n.format)),mE[l]=SE.length,SE.push({alignment:t,borderId:h||0,fillId:c||0,fontId:d||0,numFmtId:u||0,protection:o,quotePrefix:a,xfId:0})))},WM=(e,t)=>mE[HM(e,t)]||0,jM={getTemplate(e){const t=fM(fE),i=vM(yE.map(t=>NE(LE({},t),{size:null!=t.size?t.size:e}))),s=bM(vE),r=kM(CE),n=FM(bE),o=GM(SE),a=VM(wE);return UM(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,i,s,r,n,o,a,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},KM={getTemplate(e,t){const i=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:i,"r:id":`rId${i}`}}}}},$M=e=>({name:"sheets",children:e.map((e,t)=>KM.getTemplate(e,t))}),YM=e=>({name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[$M(e)]}),qM={getTemplate(e){const{min:t,max:i,outlineLevel:s,s:r,width:n,hidden:o,bestFit:a}=e;let l=1,c="0";return n>1&&(l=(e=>Math.ceil((e-12)/7+1))(n),c="1"),{name:"col",properties:{rawMap:{min:t,max:i,outlineLevel:null!=s?s:void 0,width:l,style:r,hidden:o?"1":"0",bestFit:a?"1":"0",customWidth:c}}}}},XM={getTemplate(e,t,i){const{ref:s,data:n,styleId:o}=e,{type:a,value:l}=n||{type:"empty",value:null};let c=a;"f"===a?c="str":a.charAt(0)===a.charAt(0).toUpperCase()&&(c=(e=>{const t=e.charAt(0).toLowerCase();return"s"===t?"inlineStr":t})(a));const h={name:"c",properties:{rawMap:{r:s,t:"empty"===c?void 0:c,s:o?WM(o,i):void 0}}};if("empty"===c)return h;let d;return d="str"===c&&"f"===a?[{name:"f",textNode:r._.escapeString(l)}]:"inlineStr"===c?[{name:"is",children:[{name:"t",textNode:r._.escapeString(l)}]}]:[{name:"v",textNode:l}],Object.assign({},h,{children:d})}},ZM=e=>{var t;return""!==(null==(t=e.data)?void 0:t.value)||void 0!==e.styleId},QM={getTemplate(e,t,i){const{collapsed:s,hidden:r,height:n,outlineLevel:o,cells:a=[]}=e;return((e,t)=>{const i=[];let s=0;for(let t=0;t<e.length;t++){const r=e[t];r.mergeAcross&&(i.push({pos:t,excelPos:s}),s+=r.mergeAcross),s++}if(i.length)for(let s=i.length-1;s>=0;s--){const r=[],n=e[i[s].pos];for(let e=1;e<=n.mergeAcross;e++)r.push({ref:`${WE(i[s].excelPos+1+e)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});r.length&&e.splice(i[s].pos+1,0,...r)}})(a,t),{name:"row",properties:{rawMap:{r:t+1,collapsed:s?"1":"0",hidden:r?"1":"0",ht:n,customHeight:null!=n?"1":"0",spans:"1:1",outlineLevel:o||void 0}},children:a.filter(ZM).map((e,t)=>XM.getTemplate(e,t,i))}}},JM=e=>({name:"mergeCell",properties:{rawMap:{ref:e}}}),eA=e=>{if(null==e)return 1;const t=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return-1===t?1:t+1},tA=(e,t,i)=>e.reduce((e,s,n)=>{const o="Center"===(a=s.position)?"C":"Right"===a?"R":"L";var a;const l=(c=`${e}&amp;${o}`,(h=s.font)?(c+="&amp;&quot;",c+=h.fontName||"Calibri",h.bold!==h.italic?c+=h.bold?",Bold":",Italic":h.bold?c+=",Bold Italic":c+=",Regular",c+="&quot;",h.size&&(c+=`&amp;${h.size}`),h.strikeThrough&&(c+="&amp;S"),h.underline&&(c+="&amp;"+("Double"===h.underline?"E":"U")),h.color&&(c+=`&amp;K${h.color.replace("#","").toUpperCase()}`),c):c);var c,h;s.position||(s.position=["Left","Center","Right"][n]);const{image:d}=s;if("&[Picture]"===s.value&&d){const e=`${o}${t}${i}`;pA.addHeaderFooterImageToMap(d,e)}return`${l}${r._.escapeString((u=s.value,r._.iterateObject({"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"},(e,t)=>{u=u.replace(e,t)}),u))}`;var u},""),iA=e=>{const t=[];return["all","first","even"].forEach(i=>{const s=e[i],r="all"===i?"odd":i;if(s)for(const[e,n]of Object.entries(s)){const s=`${e.charAt(0).toUpperCase()}${e.slice(1)}`,o=e[0].toUpperCase();if(n){const e="all"===i?"":i.toUpperCase();t.push({name:`${r}${s}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:tA(n,o,e)})}}}),t},sA={getTemplate(e){const{worksheet:t,currentSheet:i,config:s}=e,{margins:n={},pageSetup:o,headerFooterConfig:a,suppressColumnOutline:l}=s,{table:c}=t,{rows:h,columns:d}=c,u=d&&d.length?((e,t,i)=>{const s=[],r=[];e.forEach((e,i)=>{const n=e.cells;let o,a=0;n.forEach((e,n)=>{const l=n+a+1,c=WE(l),h=i+1;if(e.mergeAcross){a+=e.mergeAcross;const t=WE(n+a+1);s.push(`${c}${h}:${t}${h}`)}t[l-1]||(t[l-1]={});const{collapsibleRanges:d}=e;d&&d.forEach(e=>{r.push([l+e[0],l+e[1]])}),o=t[l-1],o.min=l,o.max=l,e.ref=`${c}${h}`})}),r.sort((e,t)=>e[0]!==t[0]?e[0]-t[0]:t[1]-e[1]);const n=new Map,o=new Map;return r.filter(e=>{const t=e.toString();return!n.get(t)&&(n.set(t,!0),!0)}).forEach(e=>{const s=t.find(t=>t.min==e[0]&&t.max==e[1]),r=o.get(e[0]);t.push({min:e[0],max:e[1],outlineLevel:i?void 0:r||1,width:(s||{width:100}).width}),o.set(e[0],(r||0)+1)}),s})(h,d,!!l):[],{worksheetDataTables:p}=pA,g=p.get(i),m=r._.compose(e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),(e=>t=>{const i=e.reduce((e,t)=>t.outlineLevel&&t.outlineLevel>e?t.outlineLevel:e,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:i||void 0}}}),t})(h),(e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(e=>qM.getTemplate(e))}),t))(d),((e,t)=>i=>(e.length&&i.children.push({name:"sheetData",children:e.map((e,i)=>QM.getTemplate(e,i,t))}),i))(h,i+1),(y=u,e=>(y.length&&e.children.push({name:"mergeCells",properties:{rawMap:{count:y.length}},children:y.map(e=>JM(e))}),e)),(e=>t=>{const{top:i=.75,right:s=.7,bottom:r=.75,left:n=.7,header:o=.3,footer:a=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:r,footer:a,header:o,left:n,right:s,top:i}}}),t})(n),(e=>t=>{var i;return e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:(i=e.orientation,!i||"Portrait"!==i&&"Landscape"!==i?"portrait":i.toLocaleLowerCase()),paperSize:eA(e.pageSize)}}}),t})(o),(e=>t=>{if(!e)return t;const i=null!=e.first?1:0,s=null!=e.even?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:i,differentOddEven:s}},children:iA(e)}),t})(a),(e=>t=>{const i=pA.worksheetImages.get(e);return(null==i?void 0:i.length)&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t})(i),(e=>t=>(pA.worksheetHeaderFooterImages.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t))(i),(f=g,e=>(f&&e.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":"rId"+ ++e.rIdCounter}}}]}),e)));var f,y;const{children:v}=m({children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:v}}},rA=sA,nA={getTemplate(e){const{Id:t,Type:i,Target:s}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:i,Target:s}}}}},oA=e=>({name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:e.map(e=>nA.getTemplate(e))}),aA=e=>{const{aspectratio:t,rotation:i}=e||{},s={};return t&&(s.aspectratio="t"),i&&(s.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:s}}},lA={0:"0",5:"6554f",10:"13107f",15:"19661f",20:"26214f",25:".5",30:"39322f",35:"45875f",40:"52429f",45:"58982f",50:"1",55:"72818f",60:"1.25",65:"93623f",70:"109227f",75:"2",80:"2.5",85:"3.4",90:"5",95:"10",96:"12.5",97:"1092267f",98:"25",99:"50",100:"2147483647f"},cA=(e,t)=>{var i;let s;const{recolor:r,brightness:n,contrast:o,id:a}=e;var l;return r&&(s={},"Washout"!==r&&"Grayscale"!==r||(s.gain="19661f",s.blacklevel="22938f"),"Black & White"!==r&&"Grayscale"!==r||(s.grayscale="t","Black & White"===r&&(s.bilevel="t"))),r&&"Grayscale"!==r||(s||(s={}),null!=o&&50!==o&&(s.gain=null!=(i=lA[o])?i:"1"),null!=n&&50!==n&&(s.blacklevel=(l=n,(l-0)/100*1-.5).toString())),{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:a}}],rawMap:s}}},hA=e=>Math.floor(.74999943307122*(null!=e?e:0)),dA={getTemplate(e){const t=pA.worksheetHeaderFooterImages.get(e.sheetIndex)||[];var i;return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:[{name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]},{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[{name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}},(i=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"],{name:"v:formulas",children:i.map(e=>({name:"v:f",properties:{rawMap:{eqn:e}}}))}),{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}},aA({aspectratio:!0})]},...t.map((e,t)=>((e,t)=>{const{width:i=0,height:s=0,altText:r}=e,n=hA(i),o=hA(s);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${n}pt; height: ${o}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:r}},children:[cA(e,t+1),aA({rotation:!0})]}})(e,t))]}}},uA=class e{static createExcel(e,t,i){this.addSheetName(t),((e,t)=>{1===(xE=t)&&UM(),e.forEach(zM)})(e,this.sheetNames.length);let s=Object.assign({},i);return i.exportAsExcelTable&&(i.columnModel.isPivotActive()&&(this.showExcelTableNonCompatibleFeaturesWarning("pivot mode"),s.exportAsExcelTable=!1),i.gos.get("masterDetail")&&(this.showExcelTableNonCompatibleFeaturesWarning("master/detail"),s.exportAsExcelTable=!1)),this.processTableConfig(t,s),this.createWorksheet(t,s)}static showExcelTableNonCompatibleFeaturesWarning(e){console.warn(`AG Grid: Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables.\nPlease turn off ${e} to enable Excel table exports.`)}static getTableNameFromIndex(e){return`table${e+1}`}static getSanitizedTableName(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}static addTableToSheet(e,t){this.worksheetDataTables.has(e)?console.warn("Unable to add data table to Excel sheet: A table already exists."):this.worksheetDataTables.set(e,t)}static processTableConfig(t,i){var s;if(!i.exportAsExcelTable)return;const r="boolean"==typeof i.exportAsExcelTable?{}:i.exportAsExcelTable,{name:n,showColumnStripes:o,showRowStripes:a,showFilterButton:l,highlightFirstColumn:c,highlightLastColumn:h}=r,d=this.getSanitizedTableName(n||e.defaultTableDisplayName),u=this.sheetNames.length-1,{table:p}=t,{rows:g,columns:m}=p,f=i.columnModel.getHeaderRowCount(),y=f-1,v=g.length,C=m.length,b=[],S=[];for(let e=0;e<C;e++){const t=m[e];b.push(t.displayName||""),S.push("match"===l||void 0===l?null!=(s=t.filterAllowed)&&s:l)}b&&b.length&&v&&d?this.addTableToSheet(u,{name:this.getTableNameFromIndex(u),displayName:d,columns:b,showFilterButtons:S,headerRowIndex:y,rowCount:v-f,showRowStripes:null==a||a,showColumnStripes:null!=o&&o,highlightFirstColumn:null!=c&&c,highlightLastColumn:null!=h&&h}):console.warn("Unable to add data table to Excel sheet: Missing required parameters.")}static addHeaderFooterImageToMap(e,t){const i=this.sheetNames.length-1,s=e;s.headerFooterPosition=t,this.buildImageMap({imageToAdd:s,idx:i});let r=this.worksheetHeaderFooterImages.get(i);r||(r=[],this.worksheetHeaderFooterImages.set(i,r)),r.find(t=>t.id===e.id)||r.push(e)}static addBodyImageToMap(e,t,i,s,r){let n=this.sheetNames.length;const{row:o,column:a}=e.position||{},l=e;s&&(null==t||null==i||o&&a||(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:s.indexOf(i)+1})),((e,t)=>{const{colSpan:i,column:s}=e.position;if(e.width)if(i){const r=t.slice(s-1,s+i-1);let n=0;for(let t=0;t<r.length;t++){const i=r[t].getActualWidth();if(e.width<n+i){e.position.colSpan=t+1,e.totalWidth=e.width,e.width=e.totalWidth-n;break}n+=i}}else e.totalWidth=e.width})(l,s),((e,t)=>{const{rowSpan:i,row:s}=e.position;if(e.height)if(i){let r=0,n=0;for(let o=s;o<s+i;o++){const i=VE(UE(o,t)||20);if(e.height<r+i){e.position.rowSpan=n+1,e.totalHeight=e.height,e.height=e.totalHeight-r;break}r+=i,n++}}else e.totalHeight=e.height})(l,r)),this.buildImageMap({imageToAdd:l,idx:n});let c=this.worksheetImageIds.get(n);c||(c=new Map,this.worksheetImageIds.set(n,c));const h=this.worksheetImages.get(n);h?h.push(l):this.worksheetImages.set(n,[l]),c.get(e.id)||c.set(e.id,{index:c.size,type:e.imageType})}static buildImageMap(e){const{imageToAdd:t,idx:i}=e,s=this.images.get(t.id);if(s){const e=s.find(e=>e.sheetId===i);e?e.image.push(t):s.push({sheetId:i,image:[t]})}else this.images.set(t.id,[{sheetId:i,image:[t]}]),this.workbookImageIds.set(t.id,{type:t.imageType,index:this.workbookImageIds.size})}static addSheetName(e){const t=r._.escapeString(e.name)||"";let i="";for(;-1!==this.sheetNames.indexOf(`${t}${i}`);)if(""===i)i="_1";else{const e=parseInt(i.slice(1),10);i=`_${e+1}`}e.name=`${t}${i}`,this.sheetNames.push(e.name)}static getStringPosition(e){return this.sharedStrings.has(e)?this.sharedStrings.get(e):(this.sharedStrings.set(e,this.sharedStrings.size),this.sharedStrings.size-1)}static resetFactory(){this.sharedStrings=new Map,this.images=new Map,this.worksheetImages=new Map,this.worksheetHeaderFooterImages=new Map,this.workbookImageIds=new Map,this.worksheetImageIds=new Map,this.worksheetDataTables=new Map,this.sheetNames=[],this.factoryMode=r.FiP.SINGLE_SHEET}static createWorkbook(){return zE(YM(this.sheetNames))}static createStylesheet(e){return zE(jM.getTemplate(e))}static createSharedStrings(){return zE(gM(this.sharedStrings))}static createCore(e){return zE(OE.getTemplate(e))}static createContentTypes(e){return zE(GE.getTemplate(e))}static createRels(){const e=oA([{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}]);return zE(e)}static createTheme(){return zE(uM())}static createTable(e,t){return zE(JE.getTemplate(e,t))}static createWorkbookRels(e){const t=new Array(e).fill(void 0).map((e,t)=>({Id:`rId${t+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t+1}.xml`})),i=oA([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return zE(i)}static createDrawing(e){return zE(QE.getTemplate({sheetIndex:e}))}static createDrawingRel(e){const t=this.worksheetImageIds.get(e)||[],i=[];for(const[e,s]of t)i.push({Id:`rId${s.index+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${this.workbookImageIds.get(e).index+1}.${s.type}`});return zE(oA(i))}static createVmlDrawing(e){return zE(dA.getTemplate({sheetIndex:e}),!0)}static createVmlDrawingRel(e){const t=this.worksheetHeaderFooterImages.get(e)||[],i=[];for(let e=0;e<t.length;e++){const s=t[e],r=this.workbookImageIds.get(s.id);if(!r)continue;const{index:n,type:o}=r,a="jpg"===o?"jpeg":o;i.push({Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${n+1}.${a}`})}return zE(oA(i))}static createRelationships({drawingIndex:e,vmlDrawingIndex:t,tableIndex:i}={}){if(void 0===e&&void 0===t&&void 0===i)return"";const s=[];null!=e&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),null!=t&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`}),null!=i&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${this.getTableNameFromIndex(i)}.xml`});const r=oA(s);return zE(r)}static createWorksheet(e,t){return zE(rA.getTemplate({worksheet:e,currentSheet:this.sheetNames.length-1,config:t}))}};uA.sharedStrings=new Map,uA.sheetNames=[],uA.images=new Map,uA.worksheetImages=new Map,uA.worksheetHeaderFooterImages=new Map,uA.workbookImageIds=new Map,uA.worksheetImageIds=new Map,uA.worksheetDataTables=new Map,uA.defaultTableDisplayName="AG-GRID-TABLE",uA.factoryMode=r.FiP.SINGLE_SHEET;var pA=uA,gA=class extends r.NF5{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.config=Object.assign({},e),this.stylesByIds={},this.config.baseExcelStyles.forEach(e=>{this.stylesByIds[e.id]=e}),this.excelStyles=[...this.config.baseExcelStyles,{id:"_quotePrefix",quotePrefix:1}]}addCustomContent(e){e.forEach(e=>{const t=this.rows.length+1;let i;this.config.suppressRowOutline||null==e.outlineLevel||(i=e.outlineLevel);const s={height:UE(t,e.height||this.config.rowHeight),cells:(e.cells||[]).map((e,i)=>{var s,r,n;const o=this.addImage(t,this.columnsToExport[i],null==(s=e.data)?void 0:s.value);let a=null;e.styleId&&(a="string"==typeof e.styleId?[e.styleId]:e.styleId);const l=this.getStyleId(a);if(o)return this.createCell(l,this.getDataTypeForValue(o.value),null==o.value?"":o.value);const c=null!=(n=null==(r=e.data)?void 0:r.value)?n:"",h=this.getDataTypeForValue(c);return e.mergeAcross?this.createMergedCell(l,h,c,e.mergeAcross):this.createCell(l,h,c)}),outlineLevel:i};null!=e.collapsed&&(s.collapsed=e.collapsed),null!=e.hidden&&(s.hidden=e.hidden),this.rows.push(s)})}onNewHeaderGroupingRow(){const e=[];return this.rows.push({cells:e,height:UE(this.rows.length+1,this.config.headerRowHeight)}),{onColumn:(t,i,s,n,o)=>{const a=this.config.styleLinker({rowType:r.T6X.HEADER_GROUPING,rowIndex:1,value:`grouping-${i}`,columnGroup:t});e.push(NE(LE({},this.createMergedCell(this.getStyleId(a),this.getDataTypeForValue("string"),i,n)),{collapsibleRanges:o}))}}}onNewHeaderRow(){return this.onNewRow(this.onNewHeaderColumn,this.config.headerRowHeight)}onNewBodyRow(e){const t=this.onNewRow(this.onNewBodyColumn,this.config.rowHeight);return e&&this.addRowOutlineIfNecessary(e),t}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((e,t)=>this.convertColumnToExcel(e,t))}parse(){const e=this.rows.reduce((e,t)=>Math.max(e,t.cells.length),0);for(;this.cols.length<e;)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));const t={name:this.config.sheetName,table:{columns:this.cols,rows:this.rows}};return this.createExcel(t)}addRowOutlineIfNecessary(e){const{gos:t,suppressRowOutline:i,rowGroupExpandState:s="expanded"}=this.config;if(t.get("groupHideOpenParents")||i||null==e.level)return;const n=e.footer?1:0,o=r._.last(this.rows);if(o.outlineLevel=e.level+n,"expanded"===s)return;const a="collapsed"===s;if(e.isExpandable()){const t=!a&&e.expanded;o.collapsed=!t}o.hidden=!!e.parent&&-1!==e.parent.level&&(a||this.isAnyParentCollapsed(e.parent))}isAnyParentCollapsed(e){for(;e&&-1!==e.level;){if(!e.expanded)return!0;e=e.parent}return!1}convertColumnToExcel(e,t){const i=this.config.columnWidth,s=e?this.extractHeaderValue(e):void 0,r=null!=s?s:"",n=!!e&&e.isFilterAllowed();if(i)return"number"==typeof i?{width:i,displayName:r,filterAllowed:n}:{width:i({column:e,index:t}),displayName:r,filterAllowed:n};if(e){const t=75;return{width:Math.max(e.getActualWidth(),t),displayName:r,filterAllowed:n}}return{displayName:r,filterAllowed:n}}onNewHeaderColumn(e,t){return i=>{const s=this.extractHeaderValue(i),n=this.config.styleLinker({rowType:r.T6X.HEADER,rowIndex:e,value:s,column:i});t.push(this.createCell(this.getStyleId(n),this.getDataTypeForValue("string"),s))}}onNewBodyColumn(e,t){let i=0;return(s,n,o)=>{if(i>0)return void(i-=1);const{value:a,valueFormatted:l}=this.extractRowCellValue(s,n,e,"excel",o),c=this.config.styleLinker({rowType:r.T6X.BODY,rowIndex:e,value:a,column:s,node:o}),h=this.getStyleId(c),d=s.getColSpan(o),u=this.addImage(e,s,a);u?t.push(this.createCell(h,this.getDataTypeForValue(u.value),null==u.value?"":u.value)):d>1?(i=d-1,t.push(this.createMergedCell(h,this.getDataTypeForValue(a),a,d-1))):t.push(this.createCell(h,this.getDataTypeForValue(a),a,l))}}onNewRow(e,t){const i=[];return this.rows.push({cells:i,height:UE(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,i)()}}createExcel(e){const{excelStyles:t,config:i}=this;return pA.createExcel(t,e,i)}getDataTypeForValue(e){return void 0===e?"empty":this.isNumerical(e)?"n":"s"}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e&&e.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:console.warn(`AG Grid: Unrecognized data type for excel export [${e.id}.dataType=${e.dataType}]`)}return null}addImage(e,t,i){if(!this.config.addImageToCell)return;const s=this.config.addImageToCell(e,t,i);return s?(pA.addBodyImageToMap(s.image,e,t,this.columnsToExport,this.config.rowHeight),s):void 0}createCell(e,t,i,s){const r=this.getStyleById(e);!(null==r?void 0:r.dataType)&&"s"===t&&s&&(i=s);const n=this.getTypeFromStyle(r,i)||t,{value:o,escaped:a}=this.getCellValue(n,i),l=[];return r&&l.push(e),a&&l.push("_quotePrefix"),{styleId:e=this.getStyleId(l)||void 0,data:{type:n,value:o}}}createMergedCell(e,t,i,s){const r=null==i?"":i;return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:"s"===t?pA.getStringPosition(r).toString():i},mergeAcross:s}}getCellValue(e,t){let i=!1;if(null==t&&(e="s",t=""),"s"===e)t&&"'"===t[0]&&(i=!0,t=t.slice(1)),t=pA.getStringPosition(t).toString();else if("f"===e)t=t.slice(1);else if("n"===e){const e=Number(t);isNaN(e)?t="":""!==t&&(t=e.toString())}return{value:t,escaped:i}}getStyleId(e){if(!e||!e.length)return null;if(1===e.length)return e[0];const t=e.join("-");return this.mixedStyles[t]||this.addNewMixedStyle(e),this.mixedStyles[t].excelID}deepCloneObject(e){return JSON.parse(JSON.stringify(e))}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,i={};for(const t of e)for(const e of this.excelStyles)e.id===t&&r._.mergeDeep(i,this.deepCloneObject(e));i.id=t,i.name=t;const s=e.join("-");this.mixedStyles[s]={excelID:t,key:s,result:i},this.excelStyles.push(i),this.stylesByIds[t]=i}isFormula(e){return null!=e&&this.config.autoConvertFormulas&&e.toString().startsWith("=")}isNumerical(e){return"bigint"==typeof e||isFinite(e)&&""!==e&&!isNaN(parseFloat(e))}getStyleById(e){return null==e?null:this.stylesByIds[e]||null}},mA=(e,t)=>{const i="xl/drawings",s=`${i}/drawing${t+1}.xml`,n=`${i}/_rels/drawing${t+1}.xml.rels`;r.J1w.addFile(n,pA.createDrawingRel(e)),r.J1w.addFile(s,pA.createDrawing(e))},fA=(e,t)=>{const i="xl/drawings",s=`${i}/vmlDrawing${t+1}.vml`,n=`${i}/_rels/vmlDrawing${t+1}.vml.rels`;r.J1w.addFile(s,pA.createVmlDrawing(e)),r.J1w.addFile(n,pA.createVmlDrawingRel(e))},yA=(e,t={})=>{if(!e||0===e.length)return console.warn("AG Grid: Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty."),pA.resetFactory(),!1;const{fontSize:i=11,author:s="AG Grid"}=t;return(()=>{r.J1w.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]);const{images:e}=pA;if(!e.size)return;r.J1w.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;e.forEach(e=>{const i=e[0].image[0],{base64:s,imageType:n}=i,o="jpg"===n?"jpeg":n;r.J1w.addFile(`xl/media/image${++t}.${o}`,s,!0)})})(),(()=>{const{worksheetDataTables:e}=pA,t=e,i=Array.from(t.keys());for(let e=0;e<i.length;e++){const s=i[e],n=t.get(s);n&&r.J1w.addFile(`xl/tables/${n.name}.xml`,pA.createTable(n,e))}})(),(e=>{let t=0,i=0,s=0;const{images:n,worksheetDataTables:o,worksheetImages:a,worksheetHeaderFooterImages:l}=pA;for(let c=0;c<e.length;c++){const h=e[c];r.J1w.addFile(`xl/worksheets/sheet${c+1}.xml`,h,!1);const d=n.size>0&&a.has(c),u=o.size>0&&o.has(c),p=n.size&&l.has(c);if(!d&&!u&&!p)continue;let g,m,f;d&&(mA(c,t),m=t,t++),p&&(fA(c,i),f=i,i++),u&&(g=s++);const y=`xl/worksheets/_rels/sheet${c+1}.xml.rels`;r.J1w.addFile(y,pA.createRelationships({tableIndex:g,drawingIndex:m,vmlDrawingIndex:f}))}})(e),((e,t,i)=>{r.J1w.addFile("xl/workbook.xml",pA.createWorkbook()),r.J1w.addFile("xl/styles.xml",pA.createStylesheet(e)),r.J1w.addFile("xl/sharedStrings.xml",pA.createSharedStrings()),r.J1w.addFile("xl/theme/theme1.xml",pA.createTheme()),r.J1w.addFile("xl/_rels/workbook.xml.rels",pA.createWorkbookRels(i)),r.J1w.addFile("docProps/core.xml",pA.createCore(t)),r.J1w.addFile("[Content_Types].xml",pA.createContentTypes(i)),r.J1w.addFile("_rels/.rels",pA.createRels())})(i,s,e.length),pA.resetFactory(),!0},vA=e=>{const{data:t,fontSize:i,author:s}=e,n=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return yA(t,{author:s,fontSize:i})?r.J1w.getZipFile(n):Promise.resolve(void 0)},CA=e=>{const{data:t,fontSize:i,author:s}=e,n=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(yA(t,{author:s,fontSize:i}))return r.J1w.getUncompressedZipFile(n)},bA=e=>{const{fileName:t="export.xlsx"}=e;vA(e).then(e=>{if(e){const i="function"==typeof t?t():t;r._7R.download(i,e)}})},SA=class extends r.YzF{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};this.packageCompressedFile(i).then(e=>{if(e){const{fileName:i}=t,s="function"==typeof i?i(this.gos.getGridCommonParams()):i;r._7R.download(this.getFileName(s),e)}})}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};return this.packageFile(i)}setFactoryMode(e){pA.factoryMode=e}getFactoryMode(){return pA.factoryMode}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return CA(e)}exportMultipleSheetsAsExcel(e){bA(e)}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:s}=this;let r;if(null!=e.sheetName){const{sheetName:t}=e,i="function"==typeof t?t(this.gos.getGridCommonParams()):t;r=String(i).substring(0,31)}else r="ag-grid";const n=NE(LE({},e),{sheetName:r,columnModel:t,valueService:i,gos:s,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:this.gos.get("excelStyles")||[],styleLinker:this.styleLinker.bind(this)});return new gA(n)}styleLinker(e){const{rowType:t,rowIndex:i,value:s,column:n,columnGroup:o,node:a}=e,l=t===r.T6X.HEADER,c=t===r.T6X.HEADER_GROUPING,h=l?n:o;let d=[];if(l||c)return d.push("header"),c&&d.push("headerGroup"),h&&(d=d.concat(r.PC7.getHeaderClassesFromColDef(h.getDefinition(),this.gos,n||null,o||null))),d;const u=this.gos.get("excelStyles"),p=["cell"];if(!u||!u.length)return p;const g=u.map(e=>e.id);return this.stylingService.processAllCellClasses(n.getDefinition(),this.gos.addGridCommonParams({value:s,data:a.data,node:a,colDef:n.getDefinition(),column:n,rowIndex:i}),e=>{g.indexOf(e)>-1&&p.push(e)}),p.sort((e,t)=>g.indexOf(e)<g.indexOf(t)?-1:1)}isExportSuppressed(){return this.gos.get("suppressExcelExport")}packageCompressedFile(e){return vA(e)}packageFile(e){return CA(e)}};_E([(0,r.dsm)("columnModel")],SA.prototype,"columnModel",2),_E([(0,r.dsm)("valueService")],SA.prototype,"valueService",2),_E([(0,r.dsm)("stylingService")],SA.prototype,"stylingService",2),_E([(0,r.dsm)("gridSerializer")],SA.prototype,"gridSerializer",2),_E([(0,r.dsm)("gridOptionsService")],SA.prototype,"gos",2),_E([r.o7C],SA.prototype,"postConstruct",1),SA=_E([(0,r.dR4)("excelCreator")],SA);var wA={version:"31.3.4",moduleName:r.zsj.ExcelExportModule,beans:[SA,r.pK6,r.HvL],dependantModules:[r.n76,mf]},xA=Object.defineProperty,EA=Object.getOwnPropertyDescriptor,MA=Object.getOwnPropertySymbols,AA=Object.prototype.hasOwnProperty,TA=Object.prototype.propertyIsEnumerable,DA=(e,t,i)=>t in e?xA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,IA=(e,t)=>{for(var i in t||(t={}))AA.call(t,i)&&DA(e,i,t[i]);if(MA)for(var i of MA(t))TA.call(t,i)&&DA(e,i,t[i]);return e},RA=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?EA(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&xA(t,i,n),n},PA=class extends r.uAl{preConstruct(){this.setTemplate('<div class="ag-filter-toolpanel-search" role="presentation">\n                <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n                <ag-input-text-field ref="eFilterTextField" class="ag-filter-toolpanel-search-input"></ag-input-text-field>\n            </div>')}postConstruct(){const e=this.localeService.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this))}init(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=r._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=r._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=r._.createIconNoSpan("columnSelectIndeterminate",this.gos))}showOrHideOptions(){const e=!this.params.suppressFilterSearch,t=!this.params.suppressExpandAll,i=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search..."));const s=this.columnModel.getAllGridColumns().some(e=>e.getOriginalParent()&&e.isFilterAllowed());r._.setDisplayed(this.eFilterTextField.getGui(),e),r._.setDisplayed(this.eExpand,t&&s)}onSearchTextChanged(){this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=r._.debounce(()=>{this.dispatchEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()})},300)),this.onSearchTextChangedDebounced()}onExpandClicked(){const e=0===this.currentExpandState?{type:"collapseAll"}:{type:"expandAll"};this.dispatchEvent(e)}setExpandState(e){this.currentExpandState=e,r._.setDisplayed(this.eExpandChecked,0===this.currentExpandState),r._.setDisplayed(this.eExpandUnchecked,1===this.currentExpandState),r._.setDisplayed(this.eExpandIndeterminate,2===this.currentExpandState)}};RA([(0,r.dsm)("columnModel")],PA.prototype,"columnModel",2),RA([(0,r.PIB)("eExpand")],PA.prototype,"eExpand",2),RA([(0,r.PIB)("eFilterTextField")],PA.prototype,"eFilterTextField",2),RA([r.fK3],PA.prototype,"preConstruct",1),RA([r.o7C],PA.prototype,"postConstruct",1);var kA=class e extends r.uAl{constructor(t,i){super(e.TEMPLATE),this.expandedCallback=i,this.expanded=!1,this.hideHeader=t}postConstruct(){this.eExpandChecked=r._.createIconNoSpan("columnSelectOpen",this.gos),this.eExpandUnchecked=r._.createIconNoSpan("columnSelectClosed",this.gos),this.eExpand.appendChild(this.eExpandChecked),this.eExpand.appendChild(this.eExpandUnchecked)}setColumn(e){this.column=e,this.eFilterName.innerText=this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)||"",this.addManagedListener(this.eFilterToolPanelHeader,"click",this.toggleExpanded.bind(this)),this.addManagedListener(this.eFilterToolPanelHeader,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addInIcon("filter",this.eFilterIcon,this.column),r._.setDisplayed(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),r._.setDisplayed(this.eExpandChecked,!1),this.hideHeader?(r._.setDisplayed(this.eFilterToolPanelHeader,!1),this.eFilterToolPanelHeader.removeAttribute("tabindex")):this.eFilterToolPanelHeader.setAttribute("tabindex","0"),this.addManagedListener(this.column,r.VPZ.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))}onKeyDown(e){const{key:t}=e,{ENTER:i,SPACE:s,LEFT:n,RIGHT:o}=r.DDm;t!==i&&t!==s&&t!==n&&t!==o||(e.preventDefault(),t===i||t===s?this.toggleExpanded():t===r.DDm.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,i){if(null==t)return;const s=r._.createIconNoSpan(e,this.gos,i);t.appendChild(s)}isFilterActive(){return this.filterManager.isFilterActive(this.column)}onFilterChanged(){r._.setDisplayed(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),this.dispatchEvent({type:r.VPZ.EVENT_FILTER_CHANGED})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,r._.setAriaExpanded(this.eFilterToolPanelHeader,!0),r._.setDisplayed(this.eExpandChecked,!0),r._.setDisplayed(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){var t;const i=r._.loadTemplate('<div class="ag-filter-toolpanel-instance-filter"></div>'),s=this.createManagedBean(new r.jfj(this.column,"TOOLBAR"));this.filterWrapperComp=s,s.hasFilter()&&(null==(t=s.getFilter())||t.then(t=>{this.underlyingFilter=t,t&&(i.appendChild(s.getGui()),this.agFilterToolPanelBody.appendChild(i),s.afterGuiAttached({container:"toolPanel",suppressFocus:e}))}))}collapse(){var e;this.expanded&&(this.expanded=!1,r._.setAriaExpanded(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),r._.setDisplayed(this.eExpandChecked,!1),r._.setDisplayed(this.eExpandUnchecked,!0),null==(e=this.filterWrapperComp)||e.afterGuiDetached(),this.destroyBean(this.filterWrapperComp),this.expandedCallback())}removeFilterElement(){r._.clearElement(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}refreshFilter(e){var t;if(!this.expanded)return;const i=this.underlyingFilter;i&&(e?"function"==typeof i.refreshVirtualList&&i.refreshVirtualList():null==(t=i.afterGuiDetached)||t.call(i))}onFilterOpened(e){"COLUMN_MENU"===e.source&&e.column===this.column&&this.expanded&&this.collapse()}};kA.TEMPLATE='\n        <div class="ag-filter-toolpanel-instance">\n            <div class="ag-filter-toolpanel-header ag-filter-toolpanel-instance-header" ref="eFilterToolPanelHeader" role="button" aria-expanded="false">\n                <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n                <span ref="eFilterName" class="ag-header-cell-text"></span>\n                <span ref="eFilterIcon" class="ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon" aria-hidden="true"></span>\n            </div>\n            <div class="ag-filter-toolpanel-instance-body ag-filter" ref="agFilterToolPanelBody"></div>\n        </div>',RA([(0,r.PIB)("eFilterToolPanelHeader")],kA.prototype,"eFilterToolPanelHeader",2),RA([(0,r.PIB)("eFilterName")],kA.prototype,"eFilterName",2),RA([(0,r.PIB)("agFilterToolPanelBody")],kA.prototype,"agFilterToolPanelBody",2),RA([(0,r.PIB)("eFilterIcon")],kA.prototype,"eFilterIcon",2),RA([(0,r.PIB)("eExpand")],kA.prototype,"eExpand",2),RA([(0,r.dsm)("filterManager")],kA.prototype,"filterManager",2),RA([(0,r.dsm)("columnModel")],kA.prototype,"columnModel",2),RA([r.o7C],kA.prototype,"postConstruct",1);var LA=kA,NA=class e extends r.uAl{constructor(e,t,i,s,r){super(),this.columnGroup=e,this.childFilterComps=t,this.depth=s,this.expandedCallback=i,this.showingColumn=r}preConstruct(){this.setTemplate(e.TEMPLATE,{filterGroupComp:{cssIdentifier:"filter-toolpanel",direction:"vertical"}})}init(){this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),this.filterGroupComp.addCssClass(`ag-filter-toolpanel-group-level-${this.depth}`),this.filterGroupComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth}-header`),this.childFilterComps.forEach(e=>{this.filterGroupComp.addItem(e),e.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth+1}-header`)}),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filter")}setupTooltip(){if(!this.showingColumn)return;let e;"whenTruncated"===this.gos.get("tooltipShowMode")&&(e=()=>{const e=this.filterGroupComp.getGui().querySelector(".ag-group-title");return!e||e.scrollWidth>e.clientWidth});const t=()=>{const t=this.columnGroup.getColDef().headerTooltip;this.setTooltip({newTooltipText:t,location:"filterToolPanelColumnGroup",shouldDisplayTooltip:e})};t(),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,t)}getTooltipParams(){const e=super.getTooltipParams();return e.location="filterToolPanelColumnGroup",e}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}refreshFilters(t){this.childFilterComps.forEach(i=>{i instanceof e?i.refreshFilters(t):i.refreshFilter(t)})}isColumnGroup(){return this.columnGroup instanceof r.D45}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName?this.filterGroupName:""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,t){this.filterGroupComp.hideItem(e,t)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const t=r._.createIconNoSpan(e,this.gos);t&&t.classList.add("ag-filter-toolpanel-group-instance-header-icon"),this.filterGroupComp.addTitleBarWidget(t)}forEachToolPanelFilterChild(e){this.childFilterComps.forEach(t=>{t instanceof LA&&e(t)})}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.expand()),t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.collapse());this.addManagedListener(this.filterGroupComp,r.Pk_.EVENT_EXPANDED,e),this.addManagedListener(this.filterGroupComp,r.Pk_.EVENT_COLLAPSED,t)}getColumns(){return this.columnGroup instanceof r.D45?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){this.getColumns().forEach(e=>{this.addManagedListener(e,r.VPZ.EVENT_FILTER_CHANGED,()=>this.refreshFilterClass())}),this.columnGroup instanceof r.D45||this.addManagedListener(this.eventService,r.sVA.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this))}refreshFilterClass(){const e=this.getColumns();this.filterGroupComp.addOrRemoveCssClass("ag-has-filter",e.some(e=>e.isFilterActive()))}onFilterOpened(e){"COLUMN_MENU"===e.source&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){this.filterGroupName=this.columnGroup instanceof r.D45?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")}getColumnGroupName(e){return this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.columnModel.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),r._.clearElement(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}};NA.TEMPLATE='<div class="ag-filter-toolpanel-group-wrapper">\n            <ag-group-component ref="filterGroupComp"></ag-group-component>\n        </div>',RA([(0,r.PIB)("filterGroupComp")],NA.prototype,"filterGroupComp",2),RA([(0,r.dsm)("columnModel")],NA.prototype,"columnModel",2),RA([r.fK3],NA.prototype,"preConstruct",1),RA([r.o7C],NA.prototype,"init",1);var _A=NA,OA=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}init(e){this.initialised=!0;const t=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});r._.mergeDeep(t,e),this.params=t,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_MOVED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,r.sVA.EVENT_TOOL_PANEL_VISIBLE_CHANGED,e=>{"filters"===e.key&&this.refreshFilters(e.visible)}),this.addManagedListener(this.eventService,r.sVA.EVENT_DRAG_STARTED,()=>{this.suppressOnColumnsChanged=!0}),this.addManagedListener(this.eventService,r.sVA.EVENT_DRAG_STOPPED,()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}),this.columnModel.isReady()&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged)return void(this.onColumnsChangedPending=!0);const e=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||e?this.buildTreeFromProvidedColumnDefs():this.syncFilterLayout(),this.refreshAriaLabel()}syncFilterLayout(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const e=this.columnModel.getPrimaryColumnTree();this.recreateFilters(e)}setFiltersLayout(e){const t=this.toolPanelColDefService.createColumnTree(e);this.recreateFilters(t)}recreateFilters(e){const t=this.gos.getActiveDomElement();this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const i=this.getExpansionState();this.destroyFilters(),this.filterGroupComps=this.recursivelyAddComps(e,0,i);const s=this.filterGroupComps.length;s&&(this.filterGroupComps.forEach(e=>this.appendChild(e)),this.setFirstAndLastVisible(0,s-1)),r._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,i){return r._.flatten(e.map(e=>{if(e instanceof r.D45)return r._.flatten(this.recursivelyAddFilterGroupComps(e,t,i));const s=e;if(!this.shouldDisplayFilter(s))return[];const n=new LA(0===t,()=>this.onFilterExpanded());if(this.createBean(n),n.setColumn(s),i.get(s.getId())&&n.expand(),t>0)return n;const o=this.createBean(new _A(s,[n],this.onGroupExpanded.bind(this),t,!0));return o.addCssClassToTitleBar("ag-filter-toolpanel-header"),i.get(o.getFilterGroupId())||o.collapse(),o}))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaFilterPanelList","Filter List"),i=e("filters","Filters"),s=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;r._.setAriaLabel(this.getAriaElement(),`${t} ${s} ${i}`)}recursivelyAddFilterGroupComps(e,t,i){if(!this.filtersExistInChildren(e.getChildren()))return;const s=e.getColGroupDef();if(s&&s.suppressFiltersToolPanel)return[];const n=e.isPadding()?t:t+1,o=r._.flatten(this.recursivelyAddComps(e.getChildren(),n,i));if(e.isPadding())return o;const a=new _A(e,o,this.onGroupExpanded.bind(this),t,!1);this.createBean(a),a.addCssClassToTitleBar("ag-filter-toolpanel-header");const l=i.get(a.getFilterGroupId());return(this.isInitialState&&!l||!1===l)&&a.collapse(),[a]}filtersExistInChildren(e){return e.some(e=>e instanceof r.D45?this.filtersExistInChildren(e.getChildren()):this.shouldDisplayFilter(e))}shouldDisplayFilter(e){const t=e.getColDef()&&e.getColDef().suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){const e=new Map;if(this.isInitialState){const{expandedColIds:t,expandedGroupIds:i}=this.params.initialState;return t.forEach(t=>e.set(t,!0)),i.forEach(t=>e.set(t,!0)),e}const t=i=>{e.set(i.getFilterGroupId(),i.isExpanded()),i.getChildren().forEach(i=>{i instanceof _A?t(i):e.set(i.getColumn().getId(),i.isExpanded())})};return this.filterGroupComps.forEach(t),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){const i=[],s=n=>{const o=n.getFilterGroupId();(!t||r._.includes(t,o))&&(e&&n.isColumnGroup()?n.expand():n.collapse(),i.push(o)),n.getChildren().forEach(e=>{e instanceof _A&&s(e)})};if(this.filterGroupComps.forEach(s),this.onGroupExpanded(),t){const e=t.filter(e=>i.indexOf(e)<0);e.length>0&&console.warn("AG Grid: unable to find groups for these supplied groupIds:",e)}}expandFilters(e,t){const i=[],s=n=>{if(n instanceof _A){let t=!1;return n.getChildren().forEach(i=>{s(i)&&(e?(n.expand(),t=!0):n.isColumnGroup()||n.collapse())}),t}const o=n.getColumn().getColId(),a=!t||r._.includes(t,o);return a&&(e?n.expand():n.collapse(),i.push(o)),a};if(this.filterGroupComps.forEach(s),this.onGroupExpanded(),t){const e=t.filter(e=>i.indexOf(e)<0);e.length>0&&console.warn("AG Grid: unable to find columns for these supplied colIds:",e)}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchEvent({type:"filterExpanded"})}fireExpandedEvent(){let e=0,t=0;const i=s=>{s.isColumnGroup()&&(s.isExpanded()?e++:t++,s.getChildren().forEach(e=>{e instanceof _A&&i(e)}))};let s;this.filterGroupComps.forEach(i),s=e>0&&t>0?2:t>0?1:0,this.dispatchEvent({type:"groupExpanded",state:s})}performFilterSearch(e){this.searchFilterText=r._.exists(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){const t=t=>!r._.exists(e)||-1!==t.toLowerCase().indexOf(e),i=(e,s)=>{if(!(e instanceof _A))return t(e.getColumnFilterName()||"");const r=e.getChildren(),n=t(e.getFilterGroupName()),o=s||n;if(o){e.hideGroup(!1);for(let t=0;t<r.length;t++)i(r[t],o),e.hideGroupItem(!1,t);return!0}let a=!1;return r.forEach((t,r)=>{const n=i(t,s);e.hideGroupItem(!n,r),n&&(a=!0)}),e.hideGroup(!a),a};let s,n;this.filterGroupComps.forEach((e,t)=>{i(e,!1),void 0===s?e.containsCssClass("ag-hidden")||(s=t,n=t):e.containsCssClass("ag-hidden")||n===t||(n=t)}),this.setFirstAndLastVisible(s,n),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((i,s)=>{i.removeCssClass("ag-first-group-visible"),i.removeCssClass("ag-last-group-visible"),s===e&&i.addCssClass("ag-first-group-visible"),s===t&&i.addCssClass("ag-last-group-visible")})}refreshFilters(e){this.filterGroupComps.forEach(t=>t.refreshFilters(e))}getExpandedFiltersAndGroups(){const e=[],t=new Set,i=s=>{if(s instanceof _A){s.getChildren().forEach(e=>i(e));const r=s.getFilterGroupId();s.isExpanded()&&!t.has(r)&&e.push(r)}else s.isExpanded()&&t.add(s.getColumn().getColId())};return this.filterGroupComps.forEach(i),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),r._.clearElement(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}};OA.TEMPLATE='<div class="ag-filter-list-panel"></div>',RA([(0,r.dsm)("toolPanelColDefService")],OA.prototype,"toolPanelColDefService",2),RA([(0,r.dsm)("columnModel")],OA.prototype,"columnModel",2);var FA=OA,GA=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.initialised=!1,this.listenerDestroyFuncs=[]}init(e){this.initialised&&(this.listenerDestroyFuncs.forEach(e=>e()),this.listenerDestroyFuncs=[]),this.initialised=!0;const t=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});this.params=IA(IA({},t),e),this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);const i=this.params.suppressExpandAll,s=this.params.suppressFilterSearch;i&&s&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(this.addManagedListener(this.filtersToolPanelHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"searchChanged",this.onSearchChanged.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"filterExpanded",this.onFilterExpanded.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"groupExpanded",this.onGroupExpanded.bind(this)))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}onExpandAll(){this.filtersToolPanelListPanel.expandFilterGroups(!0)}onCollapseAll(){this.filtersToolPanelListPanel.expandFilterGroups(!1)}onSearchChanged(e){this.filtersToolPanelListPanel.performFilterSearch(e.searchText)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}onFilterExpanded(){this.params.onStateUpdated()}onGroupExpanded(e){this.filtersToolPanelHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}expandFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)}collapseFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)}expandFilters(e){this.filtersToolPanelListPanel.expandFilters(!0,e)}collapseFilters(e){this.filtersToolPanelListPanel.expandFilters(!1,e)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(e){return this.init(e),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}destroy(){super.destroy()}};GA.TEMPLATE='<div class="ag-filter-toolpanel">\n            <ag-filters-tool-panel-header ref="filtersToolPanelHeaderPanel"></ag-filters-tool-panel-header>\n            <ag-filters-tool-panel-list ref="filtersToolPanelListPanel"></ag-filters-tool-panel-list>\n         </div>',RA([(0,r.PIB)("filtersToolPanelHeaderPanel")],GA.prototype,"filtersToolPanelHeaderPanel",2),RA([(0,r.PIB)("filtersToolPanelListPanel")],GA.prototype,"filtersToolPanelListPanel",2);var BA=GA,VA={version:"31.3.4",moduleName:r.zsj.FiltersToolPanelModule,beans:[],agStackComponents:[{componentName:"AgFiltersToolPanelHeader",componentClass:PA},{componentName:"AgFiltersToolPanelList",componentClass:FA}],userComponents:[{componentName:"agFiltersToolPanel",componentClass:BA}],dependantModules:[Hx,mf]},HA=Object.defineProperty,UA=Object.getOwnPropertyDescriptor,zA=Object.getOwnPropertySymbols,WA=Object.prototype.hasOwnProperty,jA=Object.prototype.propertyIsEnumerable,KA=(e,t,i)=>t in e?HA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,$A=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?UA(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&HA(t,i,n),n},YA=class extends r.XQb{constructor(){super(...arguments),this.loadRowDataVersion=0}init(e,t){this.params=t,this.comp=e,null!=t.pinned||(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.addThemeToDetailGrid(),this.createDetailGrid(),this.loadRowData(),this.addManagedListener(this.eventService,r.sVA.EVENT_FULL_WIDTH_ROW_FOCUSED,this.onFullWidthRowFocused.bind(this)))}onFullWidthRowFocused(e){const t=this.params,i={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},s={rowIndex:e.rowIndex,rowPinned:e.rowPinned};this.rowPositionUtils.sameRow(i,s)&&this.focusService.focusInto(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",i=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height";this.comp.addOrRemoveCssClass(t,!0),this.comp.addOrRemoveDetailGridCssClass(i,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;"everything"==e||"nothing"==e||"rows"==e?this.refreshStrategy=e:(null!=e&&console.warn("AG Grid: invalid cellRendererParams.refreshStrategy = '"+e+"' supplied, defaulting to refreshStrategy = 'rows'."),this.refreshStrategy="rows")}addThemeToDetailGrid(){const{theme:e}=this.environment.getTheme();e&&this.comp.addOrRemoveDetailGridCssClass(e,!0)}createDetailGrid(){if(r._.missing(this.params.detailGridOptions))return void console.warn("AG Grid: could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions");const e=this.gos.get("detailRowAutoHeight"),t=((e,t)=>{for(var i in t||(t={}))WA.call(t,i)&&KA(e,i,t[i]);if(zA)for(var i of zA(t))jA.call(t,i)&&KA(e,i,t[i]);return e})({},this.params.detailGridOptions);e&&(t.domLayout="autoHeight"),this.comp.setDetailGrid(t)}registerDetailWithMaster(e,t){const i=this.params.node.id,s=this.params.api,r={id:i,api:e,columnApi:t},n=this.params.node;s.isDestroyed()||(s.addDetailGridInfo(i,r),n.detailGridInfo=r,this.addDestroyFunc(()=>{n.detailGridInfo===r&&(s.isDestroyed()||s.removeDetailGridInfo(i),n.detailGridInfo=null)}))}loadRowData(){var e,t,i;this.loadRowDataVersion++;const s=this.loadRowDataVersion;if("serverSide"===(null==(e=this.params.detailGridOptions)?void 0:e.rowModelType))return void(null==(i=null==(t=this.params.node.detailGridInfo)?void 0:t.api)||i.refreshServerSide({purge:!0}));const r=this.params.getDetailRowData;r?r({node:this.params.node,data:this.params.node.data,successCallback:e=>{this.loadRowDataVersion===s&&this.comp.setRowData(e)},context:this.gos.getGridCommonParams().context}):console.warn("AG Grid: could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData")}refresh(){const e=!0;switch(this.refreshStrategy){case"nothing":return e;case"everything":return!1}return this.loadRowData(),e}};$A([(0,r.dsm)("rowPositionUtils")],YA.prototype,"rowPositionUtils",2),$A([(0,r.dsm)("focusService")],YA.prototype,"focusService",2);var qA=class e extends r.uAl{init(e){this.params=e,this.selectAndSetTemplate();const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveDetailGridCssClass:(e,t)=>this.eDetailGrid.classList.toggle(e,t),setDetailGrid:e=>this.setDetailGrid(e),setRowData:e=>this.setRowData(e),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new YA),this.ctrl.init(t,e)}refresh(){return this.ctrl&&this.ctrl.refresh()}destroy(){super.destroy()}selectAndSetTemplate(){if(this.params.pinned)return void this.setTemplate('<div class="ag-details-row"></div>');const t=()=>{this.setTemplate(e.TEMPLATE)};if(r._.missing(this.params.template))t();else if("string"==typeof this.params.template)this.setTemplate(this.params.template);else if("function"==typeof this.params.template){const e=(0,this.params.template)(this.params);this.setTemplate(e)}else console.warn("AG Grid: detailCellRendererParams.template should be function or string"),t();null==this.eDetailGrid&&console.warn('AG Grid: reference to eDetailGrid was missing from the details template. Please add ref="eDetailGrid" to the template.')}setDetailGrid(e){if(!this.eDetailGrid)return;const t=this.context.getBean("agGridReact"),i=t?r._.cloneObject(t):void 0,s=this.context.getBean("frameworkComponentWrapper"),n=this.getFrameworkOverrides(),o=(0,r.Dvw)(this.eDetailGrid,e,{frameworkOverrides:n,providedBeanInstances:{agGridReact:i,frameworkComponentWrapper:s},modules:r.syG.__getGridRegisteredModules(this.params.api.getGridId())});this.detailApi=o,this.ctrl.registerDetailWithMaster(o,new r.jf3(o)),this.addDestroyFunc(()=>{null==o||o.destroy()})}setRowData(e){this.detailApi&&this.detailApi.setGridOption("rowData",e)}};qA.TEMPLATE='<div class="ag-details-row" role="gridcell">\n            <div ref="eDetailGrid" class="ag-details-grid" role="presentation"></div>\n        </div>',$A([(0,r.PIB)("eDetailGrid")],qA.prototype,"eDetailGrid",2);var XA=qA,ZA={version:"31.3.4",moduleName:r.zsj.MasterDetailModule,beans:[],userComponents:[{componentName:"agDetailCellRenderer",componentClass:XA}],controllers:[{controllerName:"detailCellRenderer",controllerClass:YA}],dependantModules:[mf]},QA=Object.defineProperty,JA=Object.defineProperties,eT=Object.getOwnPropertyDescriptor,tT=Object.getOwnPropertyDescriptors,iT=Object.getOwnPropertySymbols,sT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable,nT=(e,t,i)=>t in e?QA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,oT=(e,t)=>{for(var i in t||(t={}))sT.call(t,i)&&nT(e,i,t[i]);if(iT)for(var i of iT(t))rT.call(t,i)&&nT(e,i,t[i]);return e},aT=(e,t)=>JA(e,tT(t)),lT=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?eT(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&QA(t,i,n),n},cT=class extends r.XQb{hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,i,s){const r=s?"filterMenuTab":void 0;this.showMenu(e,s=>{var n;const o=s.getGui();this.popupService.positionPopupUnderMouseEvent({type:i,column:e,mouseEvent:t,ePopup:o}),r&&(null==(n=s.showTab)||n.call(s,r)),this.dispatchVisibleChangedEvent(!0,!1,e,r)},i,r,void 0,t.target)}showMenuAfterButtonClick(e,t,i,s){let r=-1,n="left";this.gos.get("enableRtl")&&(r=1,n="right");const o=s?"filterMenuTab":void 0,a=o?[o]:void 0,l=this.menuService.isLegacyMenuEnabled();let c=(l?9:4)*r,h=l?-23:4;this.showMenu(e,s=>{var r;const a=s.getGui();this.popupService.positionPopupByComponent({type:i,column:e,eventSource:t,ePopup:a,alignSide:n,nudgeX:c,nudgeY:h,position:"under",keepWithinBounds:!0}),o&&(null==(r=s.showTab)||r.call(s,o)),this.dispatchVisibleChangedEvent(!0,!1,e,o)},i,o,a,t)}showMenu(e,t,i,s,n,o){var a;const{menu:l,eMenuGui:c,anchorToElement:h,restoreFocusParams:d}=this.getMenuParams(e,n,o),u=[];u.push(t=>{const i=l.getGui();this.destroyBean(l),e&&(e.setMenuVisible(!1,"contextMenu"),this.menuUtils.restoreFocusOnClose(d,i,t))});const p=this.localeService.getLocaleTextFunc();if(this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:t=>{u.forEach(e=>e(t)),this.dispatchVisibleChangedEvent(!1,!1,e,s)},afterGuiAttached:e=>l.afterGuiAttached(Object.assign({},{container:i},e)),positionCallback:s?()=>t(l):void 0,ariaLabel:p("ariaLabelColumnMenu","Column Menu")}),s||(null==(a=l.showTabBasedOnPreviousSelection)||a.call(l),t(l)),this.menuService.isColumnMenuAnchoringEnabled()){const t=this.popupService.setPopupPositionRelatedToElement(c,h);t&&e&&this.addStopAnchoring(t,e,u)}l.addEventListener(dT.EVENT_TAB_SELECTED,t=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=t.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),null==e||e.setMenuVisible(!0,"contextMenu"),this.activeMenu=l,l.addEventListener(r.XQb.EVENT_DESTROYED,()=>{this.activeMenu===l&&(this.activeMenu=null)})}addStopAnchoring(e,t,i){e.then(e=>{t.addEventListener("leftChanged",e),t.addEventListener("visibleChanged",e),i.push(()=>{t.removeEventListener("leftChanged",e),t.removeEventListener("visibleChanged",e)})})}getMenuParams(e,t,i){const s={column:e,headerPosition:this.focusService.getFocusedHeader(),columnIndex:this.columnModel.getAllDisplayedColumns().indexOf(e),eventSource:i},r=this.createMenu(e,s,t,i);return{menu:r,eMenuGui:r.getGui(),anchorToElement:i||this.ctrlsService.getGridBodyCtrl().getGui(),restoreFocusParams:s}}createMenu(e,t,i,s){return this.menuService.isLegacyMenuEnabled()?this.createBean(new dT(e,t,this.lastSelectedTab,i,s)):this.createBean(new uT(e,t,s))}dispatchVisibleChangedEvent(e,t,i,s){var n,o;const a={type:r.sVA.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:t,key:null!=(o=null!=(n=this.lastSelectedTab)?n:s)?o:this.menuService.isLegacyMenuEnabled()?dT.TAB_GENERAL:"columnMenu",column:null!=i?i:null};this.eventService.dispatchEvent(a)}isMenuEnabled(e){var t;if(!this.menuService.isLegacyMenuEnabled())return!0;const i=!this.filterManager.isFilterAllowed(e),s=null!=(t=e.getColDef().menuTabs)?t:dT.TABS_DEFAULT;return(i&&s.includes(dT.TAB_FILTER)?s.length-1:s.length)>0}showMenuAfterContextMenuEvent(e,t,i){this.menuUtils.onContextMenu(t,i,t=>(this.showMenuAfterMouseEvent(e,t,"columnMenu"),!0))}};lT([(0,r.dsm)("popupService")],cT.prototype,"popupService",2),lT([(0,r.dsm)("focusService")],cT.prototype,"focusService",2),lT([(0,r.dsm)("ctrlsService")],cT.prototype,"ctrlsService",2),lT([(0,r.dsm)("columnModel")],cT.prototype,"columnModel",2),lT([(0,r.dsm)("filterManager")],cT.prototype,"filterManager",2),lT([(0,r.dsm)("menuUtils")],cT.prototype,"menuUtils",2),lT([(0,r.dsm)("menuService")],cT.prototype,"menuService",2),cT=lT([(0,r.dR4)("enterpriseMenuFactory")],cT);var hT=class e extends r.XQb{constructor(t,i,s,r,n){super(),this.column=t,this.restoreFocusParams=i,this.initialSelection=s,this.restrictTo=r,this.sourceElement=n,this.tabFactories={},this.includeChecks={},this.tabFactories[e.TAB_GENERAL]=this.createMainPanel.bind(this),this.tabFactories[e.TAB_FILTER]=this.createFilterPanel.bind(this),this.tabFactories[e.TAB_COLUMNS]=this.createColumnsPanel.bind(this),this.includeChecks[e.TAB_GENERAL]=()=>!0,this.includeChecks[e.TAB_FILTER]=()=>!!t&&this.filterManager.isFilterAllowed(t),this.includeChecks[e.TAB_COLUMNS]=()=>!0}init(){const e=this.getTabsToCreate().map(e=>this.createTab(e));this.tabbedLayout=new r.LfH({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout),this.addDestroyFunc(()=>this.destroyBean(this.tabbedLayout))}getTabsToCreate(){var t,i;return this.restrictTo?this.restrictTo:(null!=(i=null==(t=this.column)?void 0:t.getColDef().menuTabs)?i:e.TABS_DEFAULT).filter(e=>this.isValidMenuTabItem(e)).filter(e=>this.isNotSuppressed(e)).filter(e=>this.isModuleLoaded(e))}isModuleLoaded(t){return t!==e.TAB_COLUMNS||r.syG.__isRegistered(r.zsj.ColumnsToolPanelModule,this.context.getGridId())}isValidMenuTabItem(t){let i=!0,s=e.TABS_DEFAULT;return null!=this.restrictTo&&(i=this.restrictTo.indexOf(t)>-1,s=this.restrictTo),i=i&&e.TABS_DEFAULT.indexOf(t)>-1,i||console.warn(`AG Grid: Trying to render an invalid menu item '${t}'. Check that your 'menuTabs' contains one of [${s}]`),i}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(t){this.tabItemColumns&&t===e.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&t===e.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&t===e.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()}onTabItemClicked(t){let i=null;switch(t.item){case this.tabItemColumns:i=e.TAB_COLUMNS;break;case this.tabItemFilter:i=e.TAB_FILTER;break;case this.tabItemGeneral:i=e.TAB_GENERAL}i&&this.activateTab(i)}activateTab(t){const i={type:e.EVENT_TAB_SELECTED,key:t};this.dispatchEvent(i)}createMainPanel(){return this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return null!=(e=this.sourceElement)?e:this.getGui()}),this.mainMenuList.addEventListener(r.yuY.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.tabItemGeneral={title:r._.createIconNoSpan("menu",this.gos,this.column),titleLabel:e.TAB_GENERAL.replace("MenuTab",""),bodyPromise:r.oY$.resolve(this.mainMenuList.getGui()),name:e.TAB_GENERAL},this.tabItemGeneral}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const t=this.column?this.createManagedBean(new r.jfj(this.column,"COLUMN_MENU")):null;if(!(null==t?void 0:t.hasFilter()))throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:r._.createIconNoSpan("filter",this.gos,this.column),titleLabel:e.TAB_FILTER.replace("MenuTab",""),bodyPromise:r.oY$.resolve(null==t?void 0:t.getGui()),afterAttachedCallback:e=>t.afterGuiAttached(e),afterDetachedCallback:()=>t.afterGuiDetached(),name:e.TAB_FILTER},this.tabItemFilter}createColumnsPanel(){const t=document.createElement("div");t.classList.add("ag-menu-column-select-wrapper");const i=this.columnChooserFactory.createColumnSelectPanel(this,this.column).getGui();return i.classList.add("ag-menu-column-select"),t.appendChild(i),this.tabItemColumns={title:r._.createIconNoSpan("columns",this.gos,this.column),titleLabel:e.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:r.oY$.resolve(t),name:e.TAB_COLUMNS},this.tabItemColumns}afterGuiAttached(e){const{container:t,hidePopup:i}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:i}),i&&(this.hidePopupFunc=i,this.addDestroyFunc(i))}getGui(){return this.tabbedLayout.getGui()}};hT.EVENT_TAB_SELECTED="tabSelected",hT.TAB_FILTER="filterMenuTab",hT.TAB_GENERAL="generalMenuTab",hT.TAB_COLUMNS="columnsMenuTab",hT.TABS_DEFAULT=[hT.TAB_GENERAL,hT.TAB_FILTER,hT.TAB_COLUMNS],lT([(0,r.dsm)("filterManager")],hT.prototype,"filterManager",2),lT([(0,r.dsm)("columnChooserFactory")],hT.prototype,"columnChooserFactory",2),lT([(0,r.dsm)("columnMenuFactory")],hT.prototype,"columnMenuFactory",2),lT([(0,r.dsm)("menuUtils")],hT.prototype,"menuUtils",2),lT([r.o7C],hT.prototype,"init",1);var dT=hT,uT=class extends r.uAl{constructor(e,t,i){super('\n            <div ref="eColumnMenu" role="presentation" class="ag-menu ag-column-menu"></div>\n        '),this.column=e,this.restoreFocusParams=t,this.sourceElement=i}init(){this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return null!=(e=this.sourceElement)?e:this.getGui()}),this.mainMenuList.addEventListener(r.yuY.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};lT([(0,r.dsm)("columnMenuFactory")],uT.prototype,"columnMenuFactory",2),lT([(0,r.dsm)("menuUtils")],uT.prototype,"menuUtils",2),lT([(0,r.dsm)("focusService")],uT.prototype,"focusService",2),lT([(0,r.PIB)("eColumnMenu")],uT.prototype,"eColumnMenu",2),lT([r.o7C],uT.prototype,"init",1);var pT="ag-context-menu-open",gT=class extends r.XQb{hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(e,t,i){const s=[];if(r._.exists(e)&&r.syG.__isRegistered(r.zsj.ClipboardModule,this.context.getGridId())&&t&&(this.gos.get("suppressCutToClipboard")||s.push("cut"),s.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gos.get("enableCharts")&&r.syG.__isRegistered(r.zsj.GridChartsModule,this.context.getGridId())&&(this.columnModel.isPivotMode()&&s.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&s.push("chartRange")),r._.exists(e)){const e=!r.syG.__isRegistered(r.zsj.CsvExportModule,this.context.getGridId()),t=!r.syG.__isRegistered(r.zsj.ExcelExportModule,this.context.getGridId()),i=this.gos.get("suppressExcelExport")||t,n=this.gos.get("suppressCsvExport")||e;!(r._.isIOSUserAgent()||i&&n)&&s.push("export")}const n=s.length?s:void 0,o=null==t?void 0:t.getColDef().contextMenuItems;if(Array.isArray(o))return o;if("function"==typeof o)return o(this.gos.addGridCommonParams({column:t,node:e,value:i,defaultItems:n}));const a=this.gos.getCallback("getContextMenuItems");return a?a({column:t,node:e,value:i,defaultItems:n}):s}onContextMenu(e,t,i,s,r,n){this.menuUtils.onContextMenu(e,t,e=>this.showMenu(i,s,r,e,n))}showMenu(e,t,i,s,n){const o=this.getMenuItems(e,t,i),a=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===o||r._.missingOrEmpty(o))return!1;const l=new mT(o,t,e,i);this.createBean(l);const c=l.getGui(),h={column:t,rowNode:e,type:"contextMenu",mouseEvent:s,ePopup:c,nudgeY:1},d=this.localeService.getLocaleTextFunc(),u=this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:e=>{a.classList.remove(pT),this.destroyBean(l),this.dispatchVisibleChangedEvent(!1,void 0===e?"api":"ui")},click:s,positionCallback:()=>{const e=this.gos.get("enableRtl");this.popupService.positionPopupUnderMouseEvent(aT(oT({},h),{nudgeX:e?-1*(c.offsetWidth+1):1}))},anchorToElement:n,ariaLabel:d("ariaLabelContextMenu","Context Menu")});u&&(a.classList.add(pT),l.afterGuiAttached({container:"contextMenu",hidePopup:u.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=l,l.addEventListener(r.XQb.EVENT_DESTROYED,()=>{this.activeMenu===l&&(this.activeMenu=null)}),u&&l.addEventListener(r.yuY.EVENT_CLOSE_MENU,e=>{var t,i;return u.hideFunc({mouseEvent:null!=(t=e.mouseEvent)?t:void 0,keyboardEvent:null!=(i=e.keyboardEvent)?i:void 0,forceHide:!0})});const p=s&&s instanceof MouseEvent&&"mousedown"===s.type;return this.dispatchVisibleChangedEvent(!0,p?"api":"ui"),!0}dispatchVisibleChangedEvent(e,t="ui"){const i={type:r.sVA.EVENT_CONTEXT_MENU_VISIBLE_CHANGED,visible:e,source:t};this.eventService.dispatchEvent(i)}};lT([(0,r.dsm)("popupService")],gT.prototype,"popupService",2),lT([(0,r.dsm)("ctrlsService")],gT.prototype,"ctrlsService",2),lT([(0,r.dsm)("columnModel")],gT.prototype,"columnModel",2),lT([(0,r.dsm)("menuUtils")],gT.prototype,"menuUtils",2),lT([(0,r.Xx1)("rangeService")],gT.prototype,"rangeService",2),gT=lT([(0,r.dR4)("contextMenuFactory")],gT);var mT=class extends r.uAl{constructor(e,t,i,s){super('<div class="ag-menu" role="presentation"></div>'),this.menuItems=e,this.column=t,this.node=i,this.value=s,this.menuList=null,this.focusedCell=null}addMenuItems(){const e=this.createManagedBean(new r.i9O(0,{column:this.column,node:this.node,value:this.value})),t=this.menuItemMapper.mapWithStockItems(this.menuItems,null,()=>this.getGui());e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener(r.yuY.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e))}afterGuiAttached(e){e.hidePopup&&this.addDestroyFunc(e.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())}restoreFocusedCell(){const e=this.focusService.getFocusedCell();if(e&&this.focusedCell&&this.cellPositionUtils.equals(e,this.focusedCell)){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCell,s=this.gos.getDocument(),r=this.gos.getActiveDomElement();r&&r!==s.body||this.focusService.setFocusedCell({rowIndex:e,column:i,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!this.focusService.isKeyboardMode()})}}destroy(){this.restoreFocusedCell(),super.destroy()}};lT([(0,r.dsm)("menuItemMapper")],mT.prototype,"menuItemMapper",2),lT([(0,r.dsm)("focusService")],mT.prototype,"focusService",2),lT([(0,r.dsm)("cellPositionUtils")],mT.prototype,"cellPositionUtils",2),lT([r.o7C],mT.prototype,"addMenuItems",1);var fT=class extends r.XQb{mapWithStockItems(e,t,i){if(!e)return[];const s=[];return e.forEach(e=>{let r;if(r="string"==typeof e?this.getStockMenuItem(e,t,i):oT({},e),!r)return;const n=r,{subMenu:o}=n;o&&o instanceof Array&&(n.subMenu=this.mapWithStockItems(o,t,i)),null!=r&&s.push(r)}),s}getStockMenuItem(e,t,i){var s;const n=this.localeService.getLocaleTextFunc(),o=this.gos.get("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:n("pinColumn","Pin Column"),icon:r._.createIconNoSpan("menuPin",this.gos,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:n("pinLeft","Pin Left"),action:()=>this.columnModel.setColumnsPinned([t],"left","contextMenu"),checked:!!t&&t.isPinnedLeft()};case"pinRight":return{name:n("pinRight","Pin Right"),action:()=>this.columnModel.setColumnsPinned([t],"right","contextMenu"),checked:!!t&&t.isPinnedRight()};case"clearPinned":return{name:n("noPin","No Pin"),action:()=>this.columnModel.setColumnsPinned([t],null,"contextMenu"),checked:!!t&&!t.isPinned()};case"valueAggSubMenu":return r.syG.__assertRegistered(r.zsj.RowGroupingModule,"Aggregation from Menu",this.context.getGridId())&&((null==t?void 0:t.isPrimary())||(null==t?void 0:t.getColDef().pivotValueColumn))?{name:n("valueAggregation","Value Aggregation"),icon:r._.createIconNoSpan("menuValue",this.gos,null),subMenu:this.createAggregationSubMenu(t,this.aggFuncService)}:null;case"autoSizeThis":return{name:n("autosizeThiscolumn","Autosize This Column"),action:()=>this.columnModel.autoSizeColumn(t,"contextMenu",o)};case"autoSizeAll":return{name:n("autosizeAllColumns","Autosize All Columns"),action:()=>this.columnModel.autoSizeAllColumns("contextMenu",o)};case"rowGroup":return{name:n("groupBy","Group by")+" "+r._.escapeString(this.columnModel.getDisplayNameForColumn(t,"header")),disabled:(null==t?void 0:t.isRowGroupActive())||!(null==t?void 0:t.getColDef().enableRowGroup),action:()=>this.columnModel.addRowGroupColumns([t],"contextMenu"),icon:r._.createIconNoSpan("menuAddRowGroup",this.gos,null)};case"rowUnGroup":const a=r._.createIconNoSpan("menuRemoveRowGroup",this.gos,null),l=null==t?void 0:t.getColDef().showRowGroup,c=this.gos.get("groupLockGroupColumns");if(!0===l)return{name:n("ungroupAll","Un-Group All"),disabled:-1===c||c>=this.columnModel.getRowGroupColumns().length,action:()=>this.columnModel.setRowGroupColumns(this.columnModel.getRowGroupColumns().slice(0,c),"contextMenu"),icon:a};if("string"==typeof l){const e=this.columnModel.getPrimaryColumn(l),t=null!=e?r._.escapeString(this.columnModel.getDisplayNameForColumn(e,"header")):l;return{name:n("ungroupBy","Un-Group by")+" "+t,disabled:null!=e&&this.columnModel.isColumnGroupingLocked(e),action:()=>this.columnModel.removeRowGroupColumns([l],"contextMenu"),icon:a}}return{name:n("ungroupBy","Un-Group by")+" "+r._.escapeString(this.columnModel.getDisplayNameForColumn(t,"header")),disabled:!(null==t?void 0:t.isRowGroupActive())||!(null==t?void 0:t.getColDef().enableRowGroup)||this.columnModel.isColumnGroupingLocked(t),action:()=>this.columnModel.removeRowGroupColumns([t],"contextMenu"),icon:a};case"resetColumns":return{name:n("resetColumns","Reset Columns"),action:()=>this.columnModel.resetColumnState("contextMenu")};case"expandAll":return{name:n("expandAll","Expand All Row Groups"),action:()=>this.gridApi.expandAll()};case"contractAll":return{name:n("collapseAll","Collapse All Row Groups"),action:()=>this.gridApi.collapseAll()};case"copy":return r.syG.__assertRegistered(r.zsj.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:n("copy","Copy"),shortcut:n("ctrlC","Ctrl+C"),icon:r._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard()}:null;case"copyWithHeaders":return r.syG.__assertRegistered(r.zsj.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:n("copyWithHeaders","Copy with Headers"),icon:r._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return r.syG.__assertRegistered(r.zsj.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:n("copyWithGroupHeaders","Copy with Group Headers"),icon:r._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(r.syG.__assertRegistered(r.zsj.ClipboardModule,"Cut from Menu",this.context.getGridId())){const e=this.focusService.getFocusedCell(),t=e?this.rowPositionUtils.getRowNode(e):null,i=!!t&&(null==e?void 0:e.column.isCellEditable(t));return{name:n("cut","Cut"),shortcut:n("ctrlX","Ctrl+X"),icon:r._.createIconNoSpan("clipboardCut",this.gos,null),disabled:!i||this.gos.get("suppressCutToClipboard"),action:()=>this.clipboardService.cutToClipboard(void 0,"contextMenu")}}return null;case"paste":return r.syG.__assertRegistered(r.zsj.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:n("paste","Paste"),shortcut:n("ctrlV","Ctrl+V"),disabled:!0,icon:r._.createIconNoSpan("clipboardPaste",this.gos,null),action:()=>this.clipboardService.pasteFromClipboard()}:null;case"export":const h=[],d=r.syG.__isRegistered(r.zsj.CsvExportModule,this.context.getGridId()),u=r.syG.__isRegistered(r.zsj.ExcelExportModule,this.context.getGridId());return!this.gos.get("suppressCsvExport")&&d&&h.push("csvExport"),!this.gos.get("suppressExcelExport")&&u&&h.push("excelExport"),{name:n("export","Export"),subMenu:h,icon:r._.createIconNoSpan("save",this.gos,null)};case"csvExport":return{name:n("csvExport","CSV Export"),icon:r._.createIconNoSpan("csvExport",this.gos,null),action:()=>this.gridApi.exportDataAsCsv({})};case"excelExport":return{name:n("excelExport","Excel Export"),icon:r._.createIconNoSpan("excelExport",this.gos,null),action:()=>this.gridApi.exportDataAsExcel()};case"separator":return"separator";case"pivotChart":case"chartRange":return null!=(s=this.chartMenuItemMapper.getChartItems(e))?s:null;case"columnFilter":return t?{name:n("columnFilter","Column Filter"),icon:r._.createIconNoSpan("filter",this.gos,null),action:()=>this.menuService.showFilterMenu({column:t,buttonElement:i(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":return r.syG.__isRegistered(r.zsj.ColumnsToolPanelModule,this.context.getGridId())?{name:n("columnChooser","Choose Columns"),icon:r._.createIconNoSpan("columns",this.gos,null),action:()=>this.menuService.showColumnChooser({column:t,eventSource:i()})}:null;case"sortAscending":return{name:n("sortAscending","Sort Ascending"),icon:r._.createIconNoSpan("sortAscending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"asc",!1,"columnMenu")};case"sortDescending":return{name:n("sortDescending","Sort Descending"),icon:r._.createIconNoSpan("sortDescending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"desc",!1,"columnMenu")};case"sortUnSort":return{name:n("sortUnSort","Clear Sort"),icon:r._.createIconNoSpan("sortUnSort",this.gos,null),action:()=>this.sortController.setSortForColumn(t,null,!1,"columnMenu")};default:return console.warn(`AG Grid: unknown menu item type ${e}`),null}}createAggregationSubMenu(e,t){const i=this.localeService.getLocaleTextFunc();let s;if(e.isPrimary())s=e;else{const t=e.getColDef().pivotValueColumn;s=r._.exists(t)?t:void 0}const n=[];if(s){const e=s.isValueActive(),r=t.getFuncNames(s);n.push({name:i("noAggregation","None"),action:()=>{this.columnModel.removeValueColumns([s],"contextMenu"),this.columnModel.setColumnAggFunc(s,void 0,"contextMenu")},checked:!e}),r.forEach(r=>{n.push({name:i(r,t.getDefaultFuncLabel(r)),action:()=>{this.columnModel.setColumnAggFunc(s,r,"contextMenu"),this.columnModel.addValueColumns([s],"contextMenu")},checked:e&&s.getAggFunc()===r})})}return n}};lT([(0,r.dsm)("columnModel")],fT.prototype,"columnModel",2),lT([(0,r.dsm)("gridApi")],fT.prototype,"gridApi",2),lT([(0,r.dsm)("focusService")],fT.prototype,"focusService",2),lT([(0,r.dsm)("rowPositionUtils")],fT.prototype,"rowPositionUtils",2),lT([(0,r.dsm)("chartMenuItemMapper")],fT.prototype,"chartMenuItemMapper",2),lT([(0,r.dsm)("menuService")],fT.prototype,"menuService",2),lT([(0,r.dsm)("sortController")],fT.prototype,"sortController",2),lT([(0,r.Xx1)("clipboardService")],fT.prototype,"clipboardService",2),lT([(0,r.Xx1)("aggFuncService")],fT.prototype,"aggFuncService",2),fT=lT([(0,r.dR4)("menuItemMapper")],fT);var yT=class extends r.XQb{getChartItems(e){var t,i;if(!this.chartService)return void r.syG.__assertRegistered(r.zsj.GridChartsModule,`the Context Menu key "${e}"`,this.context.getGridId());const s="pivotChart"===e?new vT(this.gos,this.chartService,this.localeService):new CT(this.gos,this.chartService,this.localeService),n=this.chartService.isEnterprise();let o=s.getMenuItem();if(o&&o.subMenu&&!n){const e=t=>{var i;return aT(oT({},t),{subMenu:null==(i=t.subMenu)?void 0:i.filter(e=>!e._enterprise).map(t=>e(t))})};o=e(o)}const a=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.settingsPanel)?void 0:i.chartGroupsDef;return a&&(o=yT.filterAndOrderChartMenu(o,a,s.getConfigLookup())),this.cleanInternals(o)}cleanInternals(e){if(!e)return e;const t=e=>{var i;return null==e||delete e._key,null==e||delete e._enterprise,null==(i=null==e?void 0:e.subMenu)||i.forEach(e=>t(e)),e};return t(e)}static buildLookup(e){let t={};const i=e=>{t[e._key]=e,e.subMenu&&e.subMenu.forEach(e=>i(e))};return i(e),t}static filterAndOrderChartMenu(e,t,i){var s;const n=this.buildLookup(e);let o=aT(oT({},e),{subMenu:[]});if(Object.entries(t).forEach(([e,t])=>{var s,a;const l=i[e];if(null===l)return;if(null==l)return void r._.warnOnce(`invalid chartGroupsDef config '${e}'`);const c=n[l._key];if(c)if(c.subMenu){const i=t.map(t=>{const i=l[t];if(null!=i)return n[i];r._.warnOnce(`invalid chartGroupsDef config '${e}.${t}'`)}).filter(e=>void 0!==e);i.length>0&&(c.subMenu=i,null==(s=o.subMenu)||s.push(c))}else null==(a=o.subMenu)||a.push(c)}),0!=(null==(s=o.subMenu)?void 0:s.length))return o}};lT([(0,r.Xx1)("chartService")],yT.prototype,"chartService",2),yT=lT([(0,r.dR4)("chartMenuItemMapper")],yT);var vT=class{constructor(e,t,i){this.gos=e,this.chartService=t,this.localeService=i}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(t,i,s,r,n=!1)=>({name:e(t,i),action:()=>this.chartService.createPivotChart({chartType:s}),_key:r,_enterprise:n});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","pivotPie"),t("donut","Donut&lrm;","donut","pivotDonut")]},t("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","pivotScatter"),t("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","pivotArea"),t("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram&lrm;","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap&lrm;","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst&lrm;","sunburst","pivotSunburst",!0)]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:r._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},polarGroup:null,specializedGroup:null}}},CT=class{constructor(e,t,i){this.gos=e,this.chartService=t,this.localeService=i}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(t,i,s,r,n=!1)=>({name:e(t,i),action:()=>this.chartService.createChartFromCurrentRange(s),_key:r,_enterprise:n});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","rangePie"),t("donut","Donut&lrm;","donut","rangeDonut")],_key:"rangePieChart"},t("line","Line&lrm;","line","rangeLineChart"),{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","rangeScatter"),t("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","rangeArea"),t("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line&lrm;","radarLine","rangeRadarLine"),t("radarArea","Radar Area&lrm;","radarArea","rangeRadarArea"),t("nightingale","Nightingale&lrm;","nightingale","rangeNightingale"),t("radialColumn","Radial Column&lrm;","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar&lrm;","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot&lrm;","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram&lrm;","histogram","rangeHistogram",!1),t("rangeBar","Range Bar&lrm;","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area&lrm;","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap&lrm;","treemap","rangeTreemap"),t("sunburst","Sunburst&lrm;","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap&lrm;","heatmap","rangeHeatmap"),t("waterfall","Waterfall&lrm;","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:r._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},bT=class extends r.XQb{createColumnSelectPanel(e,t,i,s){var r,n;const o=e.createManagedBean(new dE),a=null!=(n=null!=(r=null!=s?s:null==t?void 0:t.getColDef().columnChooserParams)?r:null==t?void 0:t.getColDef().columnsMenuParams)?n:{},{contractColumnSelection:l,suppressColumnExpandAll:c,suppressColumnFilter:h,suppressColumnSelectAll:d,suppressSyncLayoutWithGrid:u,columnLayout:p}=a;return o.init(!!i,this.gos.addGridCommonParams({suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!l,suppressColumnExpandAll:!!c,suppressColumnFilter:!!h,suppressColumnSelectAll:!!d,suppressSyncLayoutWithGrid:!!p||!!u,onStateUpdated:()=>{}}),"columnMenu"),p&&o.setColumnLayout(p),o}showColumnChooser({column:e,chooserParams:t,eventSource:i}){this.hideActiveColumnChooser();const s=this.createColumnSelectPanel(this,e,!0,t),n=this.localeService.getLocaleTextFunc(),o=this.columnModel.getAllDisplayedColumns().indexOf(e),a=e?this.focusService.getFocusedHeader():null;this.activeColumnChooserDialog=this.createBean(new r.fNJ({title:n("chooseColumns","Choose Columns"),component:s,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var t;null==(t=this.focusService.findNextFocusableElement(s.getGui()))||t.focus(),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:t=>{const s=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&this.menuUtils.restoreFocusOnClose({column:e,headerPosition:a,columnIndex:o,eventSource:i},s,t,!0)}})),this.activeColumnChooser=s}hideActiveColumnChooser(){this.activeColumnChooserDialog&&this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){const i={type:r.sVA.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:"columnChooser",column:null!=t?t:null};this.eventService.dispatchEvent(i)}};lT([(0,r.dsm)("focusService")],bT.prototype,"focusService",2),lT([(0,r.dsm)("menuUtils")],bT.prototype,"menuUtils",2),lT([(0,r.dsm)("columnModel")],bT.prototype,"columnModel",2),bT=lT([(0,r.dR4)("columnChooserFactory")],bT);var ST=class extends r.XQb{createMenu(e,t,i){const s=e.createManagedBean(new r.i9O(0,{column:null!=t?t:null,node:null,value:null})),n=this.getMenuItems(t),o=this.menuItemMapper.mapWithStockItems(n,null!=t?t:null,i);return s.addMenuItems(o),s}getMenuItems(e){const t=this.getDefaultMenuOptions(e);let i;const s=null==e?void 0:e.getColDef().mainMenuItems;if(Array.isArray(s))i=s;else if("function"==typeof s)i=s(this.gos.addGridCommonParams({column:e,defaultItems:t}));else{const s=this.gos.getCallback("getMainMenuItems");i=s&&e?s({column:e,defaultItems:t}):t}return r._.removeRepeatsFromArray(i,ST.MENU_ITEM_SEPARATOR),i}getDefaultMenuOptions(e){const t=[],i=this.menuService.isLegacyMenuEnabled();if(!e)return i||t.push("columnChooser"),t.push("resetColumns"),t;const s=!e.getColDef().lockPinned,r=this.columnModel.getRowGroupColumns().length,n=r>0,o=e.isAllowValue(),a=e.isAllowRowGroup(),l=e.isPrimary(),c=this.columnModel.isPivotMode(),h="clientSide"===this.rowModel.getType(),d=this.gos.get("treeData"),u=l&&n&&o||!l;if(!i&&e.isSortable()){const i=e.getSort();"asc"!==i&&t.push("sortAscending"),"desc"!==i&&t.push("sortDescending"),i&&t.push("sortUnSort"),t.push(ST.MENU_ITEM_SEPARATOR)}return this.menuService.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(ST.MENU_ITEM_SEPARATOR)),s&&t.push("pinSubMenu"),u&&t.push("valueAggSubMenu"),(s||u)&&t.push(ST.MENU_ITEM_SEPARATOR),t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(ST.MENU_ITEM_SEPARATOR),e.getColDef().showRowGroup?t.push("rowUnGroup"):a&&e.isPrimary()&&(e.isRowGroupActive()?this.columnModel.isColumnGroupingLocked(e)||t.push("rowUnGroup"):t.push("rowGroup")),t.push(ST.MENU_ITEM_SEPARATOR),i||t.push("columnChooser"),t.push("resetColumns"),h&&(d||r>(c?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}};ST.MENU_ITEM_SEPARATOR="separator",lT([(0,r.dsm)("menuItemMapper")],ST.prototype,"menuItemMapper",2),lT([(0,r.dsm)("columnModel")],ST.prototype,"columnModel",2),lT([(0,r.dsm)("rowModel")],ST.prototype,"rowModel",2),lT([(0,r.dsm)("filterManager")],ST.prototype,"filterManager",2),lT([(0,r.dsm)("menuService")],ST.prototype,"menuService",2),ST=lT([(0,r.dR4)("columnMenuFactory")],ST);var wT=class extends r.XQb{restoreFocusOnClose(e,t,i,s){const{eventSource:r}=e,n=i instanceof KeyboardEvent;if(!s&&!n||!r)return;const o=this.gos.getDocument(),a=this.gos.getActiveDomElement();(t.contains(a)||a===o.body)&&this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,i){let s;i&&i.keyboardEvent&&(s=i.keyboardEvent),e(s&&{keyboardEvent:s});const r=this.focusService.getFocusedCell(),n=this.gos.getDocument(),o=this.gos.getActiveDomElement();if(!o||o===n.body)if(r){const{rowIndex:e,rowPinned:t,column:i}=r;this.focusService.setFocusedCell({rowIndex:e,column:i,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e,t,i){if((this.gos.get("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gos.get("suppressContextMenu")&&i(null!=e?e:t.touches[0]))){const i=null!=e?e:t;i&&i.cancelable&&i.preventDefault()}}focusHeaderCell(e){const{column:t,columnIndex:i,headerPosition:s,eventSource:n}=e;if(this.columnModel.getAllDisplayedColumns().some(e=>e===t)&&n&&r._.isVisible(n)){const e=this.focusService.findTabbableParent(n);e&&(t&&this.headerNavigationService.scrollToColumn(t),e.focus())}else if(s&&-1!==i){const e=this.columnModel.getAllDisplayedColumns(),t=e[i]||r._.last(e);t&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:s.headerRowIndex,column:t}})}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&2===e.which&&e.preventDefault()}};lT([(0,r.dsm)("focusService")],wT.prototype,"focusService",2),lT([(0,r.dsm)("headerNavigationService")],wT.prototype,"headerNavigationService",2),lT([(0,r.dsm)("columnModel")],wT.prototype,"columnModel",2),wT=lT([(0,r.dR4)("menuUtils")],wT);var xT={version:"31.3.4",moduleName:r.zsj.MenuModule,beans:[cT,gT,fT,yT,bT,ST,wT],dependantModules:[mf]},ET=Object.defineProperty,MT=Object.defineProperties,AT=Object.getOwnPropertyDescriptor,TT=Object.getOwnPropertyDescriptors,DT=Object.getOwnPropertySymbols,IT=Object.prototype.hasOwnProperty,RT=Object.prototype.propertyIsEnumerable,PT=(e,t,i)=>t in e?ET(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,kT=(e,t)=>{for(var i in t||(t={}))IT.call(t,i)&&PT(e,i,t[i]);if(DT)for(var i of DT(t))RT.call(t,i)&&PT(e,i,t[i]);return e},LT=(e,t)=>MT(e,TT(t)),NT=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?AT(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&ET(t,i,n),n},_T=class e extends r.aJZ{constructor(){super('<div class="ag-multi-filter ag-menu-list-compact"></div>'),this.filterDefs=[],this.filters=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.activeFilterIndices=[],this.lastActivatedMenuItem=null,this.afterFiltersReadyFuncs=[]}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}static getFilterDefs(e){const{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}init(t){this.params=t,this.filterDefs=e.getFilterDefs(t);const{column:i,filterChangedCallback:s}=t;this.column=i,this.filterChangedCallback=s;const n=[];return this.filterDefs.forEach((e,t)=>{const i=this.createFilter(e,t);null!=i&&n.push(i)}),new r.oY$(e=>{r.oY$.all(n).then(t=>{this.filters=t,this.refreshGui("columnMenu").then(()=>{e()})})}).then(()=>{this.afterFiltersReadyFuncs.forEach(e=>e()),this.afterFiltersReadyFuncs.length=0})}refreshGui(e){return e===this.lastOpenedInContainer?r.oY$.resolve():(this.removeAllChildrenExceptTabGuards(),this.destroyChildren(),r.oY$.all(this.filters.map((t,i)=>{const s=this.filterDefs[i],n=this.getFilterTitle(t,s);let o;if("subMenu"===s.display&&"toolPanel"!==e)o=this.insertFilterMenu(t,n).then(e=>e.getGui());else if("subMenu"===s.display||"accordion"===s.display){const e=this.insertFilterGroup(t,n);o=r.oY$.resolve(e.getGui())}else o=r.oY$.resolve(t.getGui());return o})).then(t=>{t.forEach((e,t)=>{t>0&&this.appendChild(r._.loadTemplate('<div class="ag-filter-separator"></div>')),this.appendChild(e)}),this.filterGuis=t,this.lastOpenedInContainer=e}))}getFilterTitle(e,t){return null!=t.title?t.title:e instanceof r.Q5x?e.getFilterTitle():"Filter"}destroyChildren(){this.guiDestroyFuncs.forEach(e=>e()),this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t){const i=this.createBean(new r.yuY);return i.init({menuItemDef:{name:t,subMenu:[],cssClasses:["ag-multi-filter-menu-item"],menuItem:r.Y0b,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:e,contextParams:{column:null,node:null,value:null}}).then(()=>{i.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(i)),this.addManagedListener(i,r.yuY.EVENT_MENU_ITEM_ACTIVATED,e=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==e.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=e.menuItem});const e=i.getGui();return i.addManagedListener(e,"keydown",e=>{const{key:t}=e;switch(t){case r.DDm.UP:case r.DDm.RIGHT:case r.DDm.DOWN:case r.DDm.LEFT:e.preventDefault(),t===r.DDm.RIGHT&&i.openSubMenu(!0)}}),i.addManagedListener(e,"focusin",()=>i.activate()),i.addManagedListener(e,"focusout",()=>{i.isSubMenuOpen()||i.isSubMenuOpening()||i.deactivate()}),i})}insertFilterGroup(e,t){const i=this.createBean(new r.Pk_({title:t,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(i)),i.addItem(e.getGui()),i.toggleGroupExpand(!1),e.afterGuiAttached&&i.addManagedListener(i,r.Pk_.EVENT_EXPANDED,()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})),i}isFilterActive(){return this.filters.some(e=>e.isFilterActive())}getLastActiveFilterIndex(){return this.activeFilterIndices.length>0?this.activeFilterIndices[this.activeFilterIndices.length-1]:null}doesFilterPass(e,t){let i=!0;return this.filters.forEach(s=>{i&&s!==t&&s.isFilterActive()&&(i=s.doesFilterPass(e))}),i}getFilterType(){return"multi"}getModelFromUi(){return{filterType:this.getFilterType(),filterModels:this.filters.map(e=>{const t=e;return"function"==typeof t.getModelFromUi?t.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.getFilterType(),filterModels:this.filters.map(e=>e.isFilterActive()?e.getModel():null)}:null}setModel(e){const t=(e,t)=>new r.oY$(i=>{const s=e.setModel(t);s?s.then(()=>i()):i()});let i=[];return null==e?i=this.filters.map((e,i)=>t(e,null).then(()=>{this.updateActiveList(i)})):this.filters.forEach((s,r)=>{const n=e.filterModels.length>r?e.filterModels[r]:null,o=t(s,n).then(()=>{this.updateActiveList(r)});i.push(o)}),r.oY$.all(i).then(()=>{})}applyModel(e="api"){let t=!1;return this.filters.forEach(i=>{i instanceof r.Q5x&&(t=i.applyModel(e)||t)}),t}getChildFilterInstance(e){return this.filters[e]}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=r.oY$.resolve()),t.then(()=>{const{filterDefs:t}=this;let i=!1;t&&r._.forEachReverse(t,(t,s)=>{var r;const n=0===s,o=!n||"inline"!==t.display,a=LT(kT({},null!=e?e:{}),{suppressFocus:o}),l=null==(r=this.filters)?void 0:r[s];if(l&&(this.executeFunctionIfExistsOnFilter(l,"afterGuiAttached",a),n&&(i=!0)),n&&o){const e=this.filterGuis[s];e&&(e.focus(),i=!0)}});const s=this.gos.getDocument(),n=this.gos.getActiveDomElement();i||n&&n!==s.body&&!this.getGui().contains(n)||this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged")}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded")}destroy(){this.filters.forEach(e=>this.destroyBean(e)),this.filters.length=0,this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeFunctionIfExists(e,...t){r._.forEachReverse(this.filters,i=>{this.executeFunctionIfExistsOnFilter(i,e,t)})}executeFunctionIfExistsOnFilter(e,t,...i){const s=e[t];"function"==typeof s&&s.apply(e,i)}createFilter(e,t){const{filterModifiedCallback:i,doesRowPassOtherFilter:s}=this.params;let r;const n=LT(kT({},this.filterManager.createFilterParams(this.column,this.column.getColDef())),{filterModifiedCallback:i,filterChangedCallback:e=>{this.executeWhenAllFiltersReady(()=>this.filterChanged(t,e))},doesRowPassOtherFilter:e=>s(e)&&this.doesFilterPass({node:e,data:e.data},r)}),o=this.userComponentFactory.getFilterDetails(e,n,"agTextColumnFilter");if(!o)return null;const a=o.newAgStackInstance();return a&&a.then(e=>r=e),a}executeWhenAllFiltersReady(e){this.filters&&this.filters.length>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveList(e){const t=this.filters[e];r._.removeFromArray(this.activeFilterIndices,e),t.isFilterActive()&&this.activeFilterIndices.push(e)}filterChanged(e,t){this.updateActiveList(e),this.filterChangedCallback(t);const i=this.filters[e];this.filters.forEach(e=>{e!==i&&"function"==typeof e.onAnyFilterChanged&&e.onAnyFilterChanged()})}onFocusIn(e){null==this.lastActivatedMenuItem||this.lastActivatedMenuItem.getGui().contains(e.target)||(this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=null)}getModelAsString(e){var t,i,s,r;if(!this.filters||!(null==(t=null==e?void 0:e.filterModels)?void 0:t.length))return"";const n=null!=(i=this.getLastActiveFilterIndex())?i:0,o=this.filters[n];return null!=(r=null==(s=o.getModelAsString)?void 0:s.call(o,e.filterModels[n]))?r:""}};NT([(0,r.dsm)("filterManager")],_T.prototype,"filterManager",2),NT([(0,r.dsm)("userComponentFactory")],_T.prototype,"userComponentFactory",2),NT([r.o7C],_T.prototype,"postConstruct",1);var OT=_T,FT=class extends r.uAl{constructor(){super('<div class="ag-multi-floating-filter ag-floating-filter-input"></div>'),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(e=>{const i=null==e?void 0:e.newAgStackInstance();null!=i&&(this.compDetailsList.push(e),t.push(i))}),r.oY$.all(t).then(e=>{e.forEach((e,t)=>{this.floatingFilters.push(e);const i=e.getGui();this.appendChild(i),t>0&&r._.setDisplayed(i,!1)})})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:i}=this.getCompDetailsList(e);t.length===this.compDetailsList.length&&t.every((e,t)=>!this.filterManager.areFilterCompsDifferent(this.compDetailsList[t],e))?i.forEach((e,t)=>{var i;const s=this.floatingFilters[t];let r=!1;s.refresh&&null!==s.refresh(e)&&(r=!0),r||null==(i=s.onParamsUpdated)||i.call(s,e)}):(r._.clearElement(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t))}getCompDetailsList(e){const t=[],i=[],s=e.filterParams;return OT.getFilterDefs(s).forEach((s,n)=>{const o=LT(kT({},e),{parentFilterInstance:e=>{this.parentMultiFilterInstance(t=>{const i=t.getChildFilterInstance(n);null!=i&&e(i)})}});r._.mergeDeep(o.filterParams,s.filterParams);const a=this.getCompDetails(s,o);a&&(t.push(a),i.push(o))}),{compDetailsList:t,floatingFilterParamsList:i}}onParentModelChanged(e,t){t&&t.afterFloatingFilter||this.parentMultiFilterInstance(i=>{if(null==e)this.floatingFilters.forEach((e,i)=>{e.onParentModelChanged(null,t),r._.setDisplayed(e.getGui(),0===i)});else{const s=i.getLastActiveFilterIndex();this.floatingFilters.forEach((i,n)=>{const o=e.filterModels.length>n?e.filterModels[n]:null;i.onParentModelChanged(o,t);const a=null==s?0===n:n===s;r._.setDisplayed(i.getGui(),a)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){var i;let s=null!=(i=this.userComponentFactory.getDefaultFloatingFilterType(e,()=>this.filterManager.getDefaultFloatingFilter(this.params.column)))?i:"agReadOnlyFloatingFilter";return this.userComponentFactory.getFloatingFilterCompDetails(e,t,s)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof OT))throw new Error("AG Grid - MultiFloatingFilterComp expects MultiFilter as its parent");e(t)})}};NT([(0,r.dsm)("userComponentFactory")],FT.prototype,"userComponentFactory",2),NT([(0,r.dsm)("filterManager")],FT.prototype,"filterManager",2);var GT={version:"31.3.4",moduleName:r.zsj.MultiFilterModule,beans:[],userComponents:[{componentName:"agMultiColumnFilter",componentClass:OT},{componentName:"agMultiColumnFloatingFilter",componentClass:FT}],dependantModules:[mf]},BT=class extends r.yGC{constructor(){super('<div class="ag-cell-edit-wrapper"></div>')}init(e){this.params=e;const{cellStartedEdit:t,cellHeight:i,values:s}=e;r._.missing(s)&&console.warn("AG Grid: agRichSelectCellEditor requires cellEditorParams.values to be set");const{params:n,valuesPromise:o}=this.buildRichSelectParams();this.richSelect=this.createManagedBean(new r.pNP(n)),this.richSelect.addCssClass("ag-cell-editor"),this.appendChild(this.richSelect),o&&o.then(e=>{this.richSelect.setValueList({valueList:e,refresh:!0});const t=this.getSearchStringCallback(e);t&&this.richSelect.setSearchStringCreator(t)}),this.addManagedListener(this.richSelect,r.sVA.EVENT_FIELD_PICKER_VALUE_SELECTED,this.onEditorPickerValueSelected.bind(this)),this.addManagedListener(this.richSelect.getGui(),"focusout",this.onEditorFocusOut.bind(this)),this.focusAfterAttached=t,r._.exists(i)&&this.richSelect.setRowHeight(i)}onEditorPickerValueSelected(e){this.params.stopEditing(!e.fromEnterKey)}onEditorFocusOut(e){this.richSelect.getGui().contains(e.relatedTarget)||this.params.stopEditing(!0)}buildRichSelectParams(){const{cellRenderer:e,value:t,values:i,formatValue:s,searchDebounceDelay:r,valueListGap:n,valueListMaxHeight:o,valueListMaxWidth:a,allowTyping:l,filterList:c,searchType:h,highlightMatch:d,valuePlaceholder:u,eventKey:p}=this.params,g={value:t,cellRenderer:e,searchDebounceDelay:r,valueFormatter:s,pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:n,allowTyping:l,filterList:c,searchType:h,highlightMatch:d,maxPickerHeight:o,maxPickerWidth:a,placeholder:u,initialInputValue:1===(null==p?void 0:p.length)?p:void 0};let m,f;return m="function"==typeof i?i(this.params):null!=i?i:[],Array.isArray(m)?(g.valueList=m,g.searchStringCreator=this.getSearchStringCallback(m)):f=m,{params:g,valuesPromise:f}}getSearchStringCallback(e){const{colDef:t}=this.params;if("object"==typeof e[0]&&t.keyCreator)return e=>e.map(e=>{const i=this.gos.addGridCommonParams({value:e,colDef:this.params.colDef,column:this.params.column,node:this.params.node,data:this.params.data});return t.keyCreator(i)})}afterGuiAttached(){const{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;if(e){const e=this.richSelect.getFocusableElement();e.focus();const{allowTyping:t,eventKey:i}=this.params;!t||i&&1===i.length||e.select()}this.richSelect.showPicker();const{eventKey:i}=t;i&&1===(null==i?void 0:i.length)&&this.richSelect.searchTextFromString(i)})}getValue(){return this.richSelect.getValue()}isPopup(){return!1}},VT={version:"31.3.4",moduleName:r.zsj.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:BT},{componentName:"agRichSelectCellEditor",componentClass:BT}],dependantModules:[mf]},HT=Object.defineProperty,UT=Object.defineProperties,zT=Object.getOwnPropertyDescriptor,WT=Object.getOwnPropertyDescriptors,jT=Object.getOwnPropertySymbols,KT=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,YT=(e,t,i)=>t in e?HT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,qT=(e,t)=>{for(var i in t||(t={}))KT.call(t,i)&&YT(e,i,t[i]);if(jT)for(var i of jT(t))$T.call(t,i)&&YT(e,i,t[i]);return e},XT=(e,t)=>{var i={};for(var s in e)KT.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&jT)for(var s of jT(e))t.indexOf(s)<0&&$T.call(e,s)&&(i[s]=e[s]);return i},ZT=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?zT(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&HT(t,i,n),n},QT=class extends r.iEP{constructor(e,t,i){super(0),this.nodeIdSequence=new r.RI_,this.info={},this.ssrmParams=e,this.parentRowNode=i,this.level=i.level+1,this.groupLevel=e.rowGroupCols?this.level<e.rowGroupCols.length:void 0,this.leafGroup=!!e.rowGroupCols&&this.level===e.rowGroupCols.length-1}postConstruct(){if(this.usingTreeData=this.gos.get("treeData"),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel){const e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}let e=1;const t=-1===this.parentRowNode.level,i=this.storeUtils.getServerSideInitialRowCount();t&&null!=i&&(e=i),this.initialiseRowNodes(e),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc(()=>this.rowNodeBlockLoader.removeBlock(this)),this.postSortFunc=this.gos.getCallback("postSortRows"),null!=i&&this.eventService.dispatchEventOnce({type:r.sVA.EVENT_ROW_COUNT_READY})}destroyRowNodes(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}}initialiseRowNodes(e,t=!1){this.destroyRowNodes();for(let i=0;i<e;i++){const e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});t&&(e.failedLoad=!0),this.allRowNodes.push(e),this.nodesAfterFilter.push(e),this.nodesAfterSort.push(e)}}getBlockStateJson(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}}loadFromDatasource(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,success:this.success.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})}getStartRow(){return 0}getEndRow(){return this.nodesAfterSort.length}createDataNode(e,t){const i=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=t?r._.insertIntoArray(this.allRowNodes,i,t):this.allRowNodes.push(i);const s=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(i,e,s,void 0),this.nodeManager.addRowNode(i),this.blockUtils.checkOpenByDefault(i),this.allNodesMap[i.id]=i,i}prefixId(e){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+e:e.toString()}processServerFail(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}processServerResult(e){if(!this.isAlive())return;const t=e.groupLevelInfo;t&&Object.assign(this.info,t),e.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(e.pivotResultFields);const i=this.allRowNodes.length>0?this.allNodesMap:void 0;this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},e.rowData||r._.warnOnce('"params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.'),this.createOrRecycleNodes(i,e.rowData),i&&this.blockUtils.destroyRowNodes(r._.getAllValuesInObject(i)),0===this.level&&this.eventService.dispatchEventOnce({type:r.sVA.EVENT_ROW_COUNT_READY}),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}createOrRecycleNodes(e,t){if(!t)return;const i=t=>{if(!e)return;const i=this.gos.getCallback("getRowId");if(!i)return;const s=this.parentRowNode.getGroupKeys(),r=this.level,n=i({data:t,parentKeys:s.length>0?s:void 0,level:r}),o=e[n];return o?(delete e[n],o):void 0},s=(e,t)=>{this.allNodesMap[e.id]=e,this.blockUtils.updateDataIntoRowNode(e,t),this.allRowNodes.push(e)};t.forEach(e=>{const t=i(e);t?s(t,e):this.createDataNode(e)})}flushAsyncTransactions(){window.setTimeout(()=>this.transactionManager.flushAsyncTransactions(),0)}filterAndSortNodes(){this.filterRowNodes(),this.sortRowNodes()}sortRowNodes(){const e=this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerSideSortOnServer(),t=this.sortController.getSortOptions(),i=!t||0==t.length;if(e||i)this.nodesAfterSort=this.nodesAfterFilter;else if(this.nodesAfterSort=this.rowNodeSorter.doFullSort(this.nodesAfterFilter,t),this.postSortFunc){const e={nodes:this.nodesAfterSort};this.postSortFunc(e)}}filterRowNodes(){const e=!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerSideFilterOnServer(),t=this.groupLevel;this.nodesAfterFilter=e||t?this.allRowNodes:this.allRowNodes.filter(e=>this.filterManager.doesRowPassFilter({rowNode:e}))}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach(e=>this.blockUtils.clearDisplayIndex(e))}getDisplayIndexEnd(){return this.displayIndexEnd}isDisplayIndexInStore(e){return 0!==this.getRowCount()&&e>=this.displayIndexStart&&e<this.displayIndexEnd}setDisplayIndexes(e,t){this.displayIndexStart=e.peek(),this.topPx=t.value;const i={};this.nodesAfterSort.forEach(s=>{this.blockUtils.setDisplayIndex(s,e,t),i[s.id]=!0}),this.allRowNodes.forEach(e=>{i[e.id]||this.blockUtils.clearDisplayIndex(e)}),this.displayIndexEnd=e.peek(),this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t=new r.RI_){e(this,t.next()),this.allRowNodes.forEach(i=>{const s=i.childStore;s&&s.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t=new r.RI_){this.allRowNodes.forEach(i=>{e(i,t.next());const s=i.childStore;s&&s.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t=new r.RI_,i=!1){this.nodesAfterSort.forEach(s=>{e(s,t.next());const r=s.childStore;r&&r.forEachNodeDeepAfterFilterAndSort(e,t,i)}),i&&this.parentRowNode.sibling&&e(this.parentRowNode.sibling,t.next())}getRowUsingDisplayIndex(e){if(this.isDisplayIndexInStore(e))return this.blockUtils.binarySearchForDisplayIndex(e,this.nodesAfterSort)}getRowBounds(e){for(let t=0;t<this.nodesAfterSort.length;t++){const i=this.nodesAfterSort[t],s=this.blockUtils.extractRowBounds(i,e);if(s)return s}return null}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(e>=this.topPx+this.heightPx){const t=this.nodesAfterSort[this.nodesAfterSort.length-1],i=t.rowTop+t.rowHeight;if(e>=i&&t.expanded){if(t.childStore&&t.childStore.getRowCount()>0)return t.childStore.getRowIndexAtPixel(e);if(t.detailNode)return t.detailNode.rowIndex}return t.rowIndex}let t=null;return this.nodesAfterSort.forEach(i=>{const s=this.blockUtils.getIndexAtPixel(i,e);null!=s&&(t=s)}),null==t?this.displayIndexEnd-1:t}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>this.allRowNodes.find(t=>t.key==e))}forEachChildStoreShallow(e){this.allRowNodes.forEach(t=>{const i=t.childStore;i&&e(i)})}refreshAfterFilter(e){const t=this.storeUtils.isServerSideFilterOnServer(),i=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e);if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||t&&i)return this.refreshStore(!0),void this.sortRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshAfterSort(e){const t=this.storeUtils.isServerSideSortOnServer(),i=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e);if(this.storeUtils.isServerSideSortAllLevels()||t&&i)return this.refreshStore(!0),void this.filterRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}applyTransaction(e){switch(this.getState()){case r.iEP.STATE_FAILED:return{status:r.a8A.StoreLoadingFailed};case r.iEP.STATE_LOADING:return{status:r.a8A.StoreLoading};case r.iEP.STATE_WAITING_TO_LOAD:return{status:r.a8A.StoreWaitingToLoad}}const t=this.gos.getCallback("isApplyServerSideTransaction");if(t&&!t({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:r.a8A.Cancelled};const i={status:r.a8A.Applied,remove:[],update:[],add:[]},s=[];return this.executeAdd(e,i),this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.filterAndSortNodes(),this.updateSelection(s),i}updateSelection(e){if(e.length>0){this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,clearSelection:!1,source:"rowDataChanged"});const t={type:r.sVA.EVENT_SELECTION_CHANGED,source:"rowDataChanged"};this.eventService.dispatchEvent(t)}}executeAdd(e,t){const{add:i,addIndex:s}=e;r._.missingOrEmpty(i)||("number"==typeof s&&s>=0?i.reverse().forEach(e=>{const i=this.createDataNode(e,s);t.add.push(i)}):i.forEach(e=>{const i=this.createDataNode(e);t.add.push(i)}))}executeRemove(e,t,i){const{remove:s}=e;if(null==s)return;const r={};s.forEach(e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),r[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s),this.nodeManager.removeNode(s))}),this.allRowNodes=this.allRowNodes.filter(e=>!r[e.id])}executeUpdate(e,t,i){const{update:s}=e;null!=s&&s.forEach(e=>{const s=this.lookupRowNode(e);s&&(this.blockUtils.updateDataIntoRowNode(s,e),!s.selectable&&s.isSelected()&&i.push(s),t.update.push(s))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(null!=t){const s=this.level,r=this.parentRowNode.getGroupKeys(),n=t({data:e,parentKeys:r.length>0?r:void 0,level:s});if(i=this.allNodesMap[n],!i)return console.error(`AG Grid: could not find row id=${n}, data item was not found for this id`),null}else if(i=this.allRowNodes.find(t=>t.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),null;return i}addStoreStates(e){e.push({suppressInfiniteScroll:!0,route:this.parentRowNode.getGroupKeys(),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}refreshStore(e){if(e){const e=this.nodesAfterSort?this.nodesAfterSort.length:1;this.initialiseRowNodes(e)}this.scheduleLoad(),this.fireStoreUpdatedEvent()}retryLoads(){this.getState()===r.iEP.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow(e=>e.retryLoads())}scheduleLoad(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()}fireStoreUpdatedEvent(){const e={type:r.sVA.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}getRowCount(){return this.nodesAfterSort.length}getTopLevelRowDisplayedIndex(e){return this.nodesAfterSort[e].rowIndex}isLastRowIndexKnown(){return this.getState()==r.iEP.STATE_LOADED}getRowNodesInRange(e,t){const i=[];let s=!1;return r._.missing(e)&&(s=!0),this.nodesAfterSort.forEach(r=>{const n=r===e||r===t;(s||n)&&i.push(r),n&&(s=!s)}),s?[]:i}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}};ZT([(0,r.dsm)("ssrmStoreUtils")],QT.prototype,"storeUtils",2),ZT([(0,r.dsm)("ssrmBlockUtils")],QT.prototype,"blockUtils",2),ZT([(0,r.dsm)("columnModel")],QT.prototype,"columnModel",2),ZT([(0,r.dsm)("rowNodeBlockLoader")],QT.prototype,"rowNodeBlockLoader",2),ZT([(0,r.dsm)("rowNodeSorter")],QT.prototype,"rowNodeSorter",2),ZT([(0,r.dsm)("sortController")],QT.prototype,"sortController",2),ZT([(0,r.dsm)("selectionService")],QT.prototype,"selectionService",2),ZT([(0,r.dsm)("ssrmNodeManager")],QT.prototype,"nodeManager",2),ZT([(0,r.dsm)("filterManager")],QT.prototype,"filterManager",2),ZT([(0,r.dsm)("ssrmTransactionManager")],QT.prototype,"transactionManager",2),ZT([(0,r.dsm)("rowModel")],QT.prototype,"serverSideRowModel",2),ZT([r.o7C],QT.prototype,"postConstruct",1),ZT([r.yah],QT.prototype,"destroyRowNodes",1);var JT=class{constructor(...e){if(e.length<1)throw new Error("AG Grid: At least one index must be provided.");this.indexes=e,this.maps=new Map(this.indexes.map(e=>[e,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(e,t){const i=this.maps.get(e);if(!i)throw new Error(`AG Grid: ${String(e)} not found`);return i.get(t)}set(e){this.indexes.forEach(t=>{const i=this.maps.get(t);if(!i)throw new Error(`AG Grid: ${String(t)} not found`);i.set(e[t],e)})}delete(e){this.indexes.forEach(t=>{const i=this.maps.get(t);if(!i)throw new Error(`AG Grid: ${String(t)} not found`);i.delete(e[t])})}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){const t=this.maps.get(e);if(!t)throw new Error(`AG Grid: ${String(e)} not found`);return t.values()}forEach(e){const t=this.getIterator(this.indexes[0]);let i;for(;(i=t.next())&&!i.done;)e(i.value)}find(e){const t=this.getIterator(this.indexes[0]);let i;for(;(i=t.next())&&!i.done;)if(e(i.value))return i.value}filter(e){const t=this.getIterator(this.indexes[0]);let i;const s=[];for(;(i=t.next())&&!i.done;)e(i.value)&&s.push(i.value);return s}},eD=class extends r.XQb{constructor(){super(...arguments),this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}init(){this.addManagedListener(this.rowNodeBlockLoader,r.RRV.BLOCK_LOADED_EVENT,()=>this.queueLoadCheck())}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,window.queueMicrotask(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}queueLoadAction(){const e=this.getBlockToLoad();if(!e)return;const t=this.nextBlockToLoad&&this.nextBlockToLoad.cache===e.cache&&this.nextBlockToLoad.index===e.index;if(!(t||this.nextBlockToLoad&&t)){this.nextBlockToLoad=e,window.clearTimeout(this.loaderTimeout);const t=Number(this.nextBlockToLoad.index),i=this.nextBlockToLoad.cache,s=e.index+e.cache.getBlockSize();this.loaderTimeout=window.setTimeout(()=>{i.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(i,t,s),this.nextBlockToLoad=void 0)},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(e,t,i){const s=this.rowNodeBlockLoader.getAvailableLoadingCount();null!=s&&0===s||(this.rowNodeBlockLoader.registerLoads(1),this.executeLoad(e,t,i),this.queueLoadCheck())}executeLoad(e,t,i){var s;const r=e.getSsrmParams(),n={startRow:t,endRow:i,rowGroupCols:r.rowGroupCols,valueCols:r.valueCols,pivotCols:r.pivotCols,pivotMode:r.pivotMode,groupKeys:e.store.getParentNode().getGroupKeys(),filterModel:r.filterModel,sortModel:r.sortModel},o=this.cacheLoadingNodesMap.get(e),a=()=>{for(let e=0;e<i-t;e++)o.delete(t+e)},l=this.gos.addGridCommonParams({request:n,success:s=>{this.rowNodeBlockLoader.loadComplete(),e.onLoadSuccess(t,i-t,s),a()},fail:()=>{this.rowNodeBlockLoader.loadComplete(),e.onLoadFailed(t,i-t),a()},parentNode:e.store.getParentNode()});(()=>{for(let e=0;e<i-t;e++)o.add(t+e)})(),null==(s=e.getSsrmParams().datasource)||s.getRows(l)}getBlockToLoad(){var e;const t=this.rowRenderer.getFirstVirtualRenderedRow(),i=this.rowRenderer.getLastVirtualRenderedRow();for(let e=t;e<=i;e++){const t=this.rowModel.getRow(e);if(!t)continue;const i=t.parent&&t.parent.childStore;if(!(i&&i instanceof iD))continue;const s=i.getCache(),r=s.getNodes().getBy("node",t);if(!r)continue;const n=this.cacheLoadingNodesMap.get(s);if(!(null==n?void 0:n.has(r.index))&&(t.__needsRefreshWhenVisible||t.stub&&!t.failedLoad))return{cache:s,index:s.getBlockStartIndex(r.index)}}let s=null,r=null,n=Number.MAX_SAFE_INTEGER;for(const e of this.cacheLoadingNodesMap.keys())e.getNodesToRefresh().forEach(o=>{if(null==o.rowIndex)return r=o,void(s=e);const a=e.getNodes().getBy("node",o);if(!a)return;const l=this.cacheLoadingNodesMap.get(e);if(null==l?void 0:l.has(a.index))return;const c=Math.abs(t-o.rowIndex),h=Math.abs(o.rowIndex-i);c<n&&(r=o,n=c,s=e),h<n&&(r=o,n=h,s=e)});if(!s)return;const o=s,a=null==(e=o.getNodes().getBy("node",r))?void 0:e.index;return null==a?void 0:{cache:o,index:o.getBlockStartIndex(a)}}isRowLoading(e,t){var i,s;return null!=(s=null==(i=this.cacheLoadingNodesMap.get(e))?void 0:i.has(t))&&s}};eD.DEFAULT_BLOCK_SIZE=100,ZT([(0,r.dsm)("rowNodeBlockLoader")],eD.prototype,"rowNodeBlockLoader",2),ZT([(0,r.dsm)("rowRenderer")],eD.prototype,"rowRenderer",2),ZT([(0,r.dsm)("rowModel")],eD.prototype,"rowModel",2),ZT([r.o7C],eD.prototype,"init",1),eD=ZT([(0,r.dR4)("lazyBlockLoadingService")],eD);var tD=class extends r.XQb{constructor(e,t,i){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=!1,this.storeParams=i}init(){this.lazyBlockLoadingService.subscribe(this),this.nodeMap=new JT("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set,this.defaultNodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),this.getRowIdFunc=this.gos.getCallback("getRowId"),this.isMasterDetail=this.gos.get("masterDetail")}destroyRowNodes(){this.lazyBlockLoadingService.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1}getRowByDisplayIndex(e){var t,i,s,r;if(!this.store.isDisplayIndexInStore(e))return;const n=this.nodeDisplayIndexMap.get(e);if(n)return(n.stub||n.__needsRefreshWhenVisible)&&this.lazyBlockLoadingService.queueLoadCheck(),n;if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);const o=this.nodeDisplayIndexMap.get(e-1);if(o){if(this.isMasterDetail&&o.master&&o.expanded)return o.detailNode;if(o.expanded&&(null==(t=o.childStore)?void 0:t.isDisplayIndexInStore(e)))return null==(i=o.childStore)?void 0:i.getRowUsingDisplayIndex(e);const s=this.nodeMap.getBy("node",o);return this.createStubNode(s.index+1,e)}const a=this.getSurroundingNodesByDisplayIndex(e);if(null==a){const t=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(t,e)}const{previousNode:l,nextNode:c}=a;if(l&&l.node.expanded&&(null==(s=l.node.childStore)?void 0:s.isDisplayIndexInStore(e)))return null==(r=l.node.childStore)?void 0:r.getRowUsingDisplayIndex(e);if(c){const t=c.node.rowIndex-e,i=c.index-t;return this.createStubNode(i,e)}const h=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(h,e)}createStubNode(e,t){const i=this.store.getRowBounds(t),s=this.createRowAtIndex(e,null,e=>{e.setRowIndex(t),e.setRowTop(i.rowTop),this.nodeDisplayIndexMap.set(t,e)});return this.lazyBlockLoadingService.queueLoadCheck(),s}getRowByStoreIndex(e){var t;return null==(t=this.nodeMap.getBy("index",e))?void 0:t.node}skipDisplayIndexes(e,t,i){if(0===e)return;const s=this.gos.getRowHeightAsNumber();t.skip(e),i.value+=e*s}setDisplayIndexes(e,t){this.nodeDisplayIndexMap.clear();const i={};this.nodeMap.forEach(e=>{i[e.index]=e.node});let s=-1;for(const r in i){const n=i[r],o=Number(r),a=o-1-s;this.skipDisplayIndexes(a,e,t),this.blockUtils.setDisplayIndex(n,e,t),this.nodeDisplayIndexMap.set(n.rowIndex,n),s=o}const r=this.numberOfRows-1-s;this.skipDisplayIndexes(r,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){if(e<0)throw new Error("AG Grid: setRowCount can only accept a positive row count.");this.numberOfRows=e,null!=t&&(this.isLastRowKnown=t,!1===t&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){var t;return null!=(t=this.nodeDisplayIndexMap.get(e))?t:null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,i;return this.nodeMap.forEach(s=>{e>s.node.rowIndex?(null==i||i.node.rowIndex<s.node.rowIndex)&&(i=s):(null==t||t.node.rowIndex>s.node.rowIndex)&&(t=s)}),i||t?{previousNode:i,nextNode:t}:null}getDisplayIndexFromStoreIndex(e){var t,i;const s=this.nodeMap.getBy("index",e);if(s)return s.node.rowIndex;let r,n;if(this.nodeMap.forEach(t=>{e>t.index?(null==n||n.index<t.index)&&(n=t):(null==r||r.index>t.index)&&(r=t)}),!r)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!n)return this.store.getDisplayIndexStart()+e;const o=e-n.index;return(null!=(i=null==(t=n.node.childStore)?void 0:t.getDisplayIndexEnd())?i:n.node.rowIndex)+o}createRowAtIndex(e,t,i){var s,r;const n=this.nodeMap.getBy("index",e);if(n){const{node:i}=n;if(i.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,i))return this.blockUtils.updateDataIntoRowNode(i,t),this.nodesToRefresh.delete(i),i;if(null==this.getRowIdFunc&&i.hasChildren()&&i.expanded)return this.nodesToRefresh.delete(i),i;this.destroyRowAtIndex(e)}if(t&&null!=this.getRowIdFunc){const i=this.getRowId(t),n=i&&(null==(s=this.removedNodeCache)?void 0:s.get(i));if(n)return null==(r=this.removedNodeCache)||r.delete(i),this.blockUtils.updateDataIntoRowNode(n,t),this.nodeMap.set({id:n.id,node:n,index:e}),n;const o=this.nodeMap.getBy("id",i);if(o){this.nodeMap.delete(o);const{node:i,index:s}=o;return this.blockUtils.updateDataIntoRowNode(i,t),this.nodeMap.set({id:i.id,node:i,index:e}),this.nodesToRefresh.delete(i),this.getBlockStartIndex(s)===this.getBlockStartIndex(e)||this.markBlockForVerify(s),i}}const o=this.blockUtils.createRowNode(this.store.getRowDetails());if(null!=t){const e=this.getPrefixedId(this.store.getIdSequence().next());this.blockUtils.setDataIntoRowNode(o,t,e,void 0),this.serverSideRowModel.setPaused(!0),this.blockUtils.checkOpenByDefault(o),this.serverSideRowModel.setPaused(!1),this.nodeManager.addRowNode(o)}return this.nodeMap.set({id:o.id,node:o,index:e}),i&&i(o),o}getBlockStates(){const e={},t={};this.nodeMap.forEach(({node:i,index:s})=>{var r;const n=this.getBlockStartIndex(s);i.stub||i.failedLoad||(e[n]=(null!=(r=e[n])?r:0)+1);let o="loaded";i.failedLoad?o="failed":this.lazyBlockLoadingService.isRowLoading(this,n)?o="loading":(this.nodesToRefresh.has(i)||i.stub)&&(o="needsLoading"),t[n]||(t[n]=new Set),t[n].add(o)});const i={loading:4,failed:3,needsLoading:2,loaded:1},s=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),r={};return Object.entries(t).forEach(([t,n])=>{var o;const a=[...n].sort((e,t)=>{var s,r;return(null!=(s=i[e])?s:0)-(null!=(r=i[t])?r:0)})[0],l=Number(t)/this.getBlockSize(),c=s?`${s}-${l}`:String(l);r[c]={blockNumber:l,startRow:Number(t),endRow:Number(t)+this.getBlockSize(),pageStatus:a,loadedRowCount:null!=(o=e[t])?o:0}}),r}destroyRowAtIndex(e){const t=this.nodeMap.getBy("index",e);t&&(this.nodeMap.delete(t),this.nodeDisplayIndexMap.delete(t.node.rowIndex),this.nodesToRefresh.size>0?this.removedNodeCache.set(t.node.id,t.node):this.blockUtils.destroyRowNode(t.node),this.nodesToRefresh.delete(t.node))}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(e){return this.defaultNodeIdPrefix?this.defaultNodeIdPrefix+"-"+e:e.toString()}markBlockForVerify(e){const[t,i]=this.getBlockBounds(e);this.nodeMap.filter(e=>e.index>=t&&e.index<i).forEach(({node:e})=>{e.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;if(null!=this.getRowIdFunc){const i=this.getRowId(e);return t.id===i}return t.data===e}purgeStubsOutsideOfViewport(){const e=this.api.getFirstDisplayedRowIndex(),t=this.api.getLastDisplayedRowIndex(),i=this.getBlockStartIndex(e),[s,r]=this.getBlockBounds(t);this.nodeMap.forEach(e=>{this.lazyBlockLoadingService.isRowLoading(this,e.index)||e.node.failedLoad||e.node.stub&&(e.index<i||e.index>r)&&this.destroyRowAtIndex(e.index)})}getBlocksDistanceFromRow(e,t){const i={};return e.forEach(({node:e,index:s})=>{const[r,n]=this.getBlockBounds(s);if(r in i)return;const o=Math.abs(e.rowIndex-t);let a;const l=this.nodeMap.getBy("index",[n-1]);l&&(a=Math.abs(l.node.rowIndex-t));const c=null==a||o<a?o:a;i[r]=c}),Object.entries(i)}purgeExcessRows(){var e;if(this.purgeStubsOutsideOfViewport(),null==this.store.getDisplayIndexEnd()||null==this.storeParams.maxBlocksInCache)return;const t=this.api.getFirstDisplayedRowIndex(),i=this.api.getLastDisplayedRowIndex(),s=new Set,r=new Set;this.nodeMap.forEach(({index:e,node:n})=>{const o=this.getBlockStartIndex(e);s.add(o),n.rowIndex>=t&&n.rowIndex<=i&&r.add(o)});const n=Math.max(r.size,null!=(e=this.storeParams.maxBlocksInCache)?e:0),o=s.size-n;if(o<=0)return;let a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;r.forEach(e=>{a>e&&(a=e),l<e&&(l=e)});const c=this.nodeMap.filter(({node:e,index:t})=>{const i=this.getBlockStartIndex(t);return!(i>=a&&i<=l||this.isNodeCached(e))});if(0===c.length)return;const h=t+(i-t)/2,d=this.getBlocksDistanceFromRow(c,h),u=this.getBlockSize();d.sort((e,t)=>Math.sign(t[1]-e[1]));for(let e=0;e<Math.min(o,d.length);e++){const t=Number(d[e][0]);for(let e=t;e<t+u;e++){const t=this.nodeMap.getBy("index",e);t&&!this.isNodeCached(t.node)&&this.destroyRowAtIndex(e)}}}isNodeFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!!t&&(null==t.rowPinned&&t.rowIndex===e.rowIndex)}isNodeCached(e){return e.isExpandable()&&e.expanded||this.isNodeFocused(e)}extractDuplicateIds(e){if(null==this.getRowIdFunc)return[];const t=new Set,i=new Set;return e.forEach(e=>{const s=this.getRowId(e);t.has(s)?i.add(s):t.add(s)}),[...i]}onLoadSuccess(e,t,i){if(!this.live)return;const s=i.groupLevelInfo;if(this.store.setStoreInfo(s),null!=this.getRowIdFunc){const s=this.extractDuplicateIds(i.rowData);if(s.length>0){const i=s.join(", ");return console.warn(`AG Grid: Unable to display rows as duplicate row ids (${i}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`),void this.onLoadFailed(e,t)}}i.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(i.pivotResultFields);const r=this.nodesToRefresh.size>0;if(i.rowData.forEach((t,i)=>{var s;const r=e+i,n=this.nodeMap.getBy("index",r);if(!(null==(s=null==n?void 0:n.node)?void 0:s.stub))return n&&this.doesNodeMatch(t,n.node)?(this.blockUtils.updateDataIntoRowNode(n.node,t),this.nodesToRefresh.delete(n.node),void(n.node.__needsRefreshWhenVisible=!1)):void this.createRowAtIndex(r,t);this.createRowAtIndex(r,t)}),null!=i.rowCount&&-1!==i.rowCount)this.numberOfRows=i.rowCount,this.isLastRowKnown=!0;else if(t>i.rowData.length)this.numberOfRows=e+i.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){const t=e+i.rowData.length+1;t>this.numberOfRows&&(this.numberOfRows=t)}this.isLastRowKnown&&this.nodeMap.filter(e=>e.index>=this.numberOfRows).forEach(e=>this.destroyRowAtIndex(e.index)),this.fireStoreUpdatedEvent();const n=0===this.nodesToRefresh.size;r&&n&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){0===this.nodesToRefresh.size&&(this.removedNodeCache.forEach(e=>{this.blockUtils.destroyRowNode(e)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){const e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t)return;if(this.nodesToRefresh.size>0)return;let i=-1;return null==this.nodeMap.find(e=>(i+=1,e.index!==i||!!e.node.__needsRefreshWhenVisible||!!e.node.stub))}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){var i;if(!this.live)return;const s=this.nodesToRefresh.size>0;for(let s=e;s<e+t&&s<this.getRowCount();s++){let{node:e}=null!=(i=this.nodeMap.getBy("index",s))?i:{};e&&this.nodesToRefresh.delete(e),e&&e.stub||(e&&!e.stub&&this.destroyRowAtIndex(s),e=this.createRowAtIndex(s)),e.__needsRefreshWhenVisible=!1,e.failedLoad=!0}const r=0===this.nodesToRefresh.size;s&&r&&this.fireRefreshFinishedEvent(),this.fireStoreUpdatedEvent()}markNodesForRefresh(){this.nodeMap.forEach(e=>{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingService.queueLoadCheck(),this.isLastRowKnown&&0===this.numberOfRows&&(this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent())}isNodeInCache(e){return!!this.nodeMap.getBy("id",e)}fireStoreUpdatedEvent(){this.live&&this.store.fireStoreUpdatedEvent()}getRowId(e){if(null==this.getRowIdFunc)return null;const{level:t}=this.store.getRowDetails(),i=this.store.getParentNode().getGroupKeys(),s=this.getRowIdFunc({data:e,parentKeys:i.length>0?i:void 0,level:t});return String(s)}getOrderedNodeMap(){const e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){const e=this.sortController.getSortOptions();if(!e.some(e=>null!=e.sort))return;const t=new Array(this.nodeMap.getSize());this.nodeMap.forEach(e=>t[e.index]=e.node),this.nodeMap.clear(),this.rowNodeSorter.doFullSort(t,e).forEach((e,t)=>{this.nodeMap.set({id:e.id,node:e,index:t})})}updateRowNodes(e){if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const t=[];return e.forEach(e=>{const i=this.getRowId(e),s=this.nodeMap.getBy("id",i);s&&(this.blockUtils.updateDataIntoRowNode(s.node,e),t.push(s.node))}),t}insertRowNodes(e,t){const i=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),s=null==t&&this.isLastRowKnown?i:t;if(null==s||i<s)return[];if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const r={};e.forEach(e=>{const t=this.getRowId(e);t&&this.isNodeInCache(t)||(r[t]=e)});const n=Object.values(r);let o=n.length;if(0===o)return[];const a=this.nodeMap.filter(e=>e.index>=s);return a.forEach(e=>this.nodeMap.delete(e)),a.forEach(e=>{this.nodeMap.set({node:e.node,index:e.index+o,id:e.id})}),this.numberOfRows+=o,n.map((e,t)=>this.createRowAtIndex(s+t,e))}removeRowNodes(e){if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const t=[],i=[];let s=0;const r=[...e],n=this.getOrderedNodeMap();let o=-1;for(let e in n){o+=1;const a=n[e],l=r.findIndex(e=>e===a.id);if(-1!==l){r.splice(l,1),this.destroyRowAtIndex(Number(e)),t.push(a.node),s+=1;continue}if(0===s)continue;const c=Number(e);o!==c&&i.push(a.node),this.nodeMap.delete(n[e]),this.nodeMap.set({id:a.id,node:a.node,index:c-s})}return this.numberOfRows-=this.isLastRowIndexKnown()?e.length:s,r.length>0&&i.length>0&&(i.forEach(e=>e.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingService.queueLoadCheck()),t}getBlockSize(){return this.storeParams.cacheBlockSize||eD.DEFAULT_BLOCK_SIZE}getBlockStartIndex(e){return e-e%this.getBlockSize()}getBlockBounds(e){const t=this.getBlockStartIndex(e);return[t,t+this.getBlockSize()]}};ZT([(0,r.dsm)("gridApi")],tD.prototype,"api",2),ZT([(0,r.dsm)("ssrmBlockUtils")],tD.prototype,"blockUtils",2),ZT([(0,r.dsm)("focusService")],tD.prototype,"focusService",2),ZT([(0,r.dsm)("ssrmNodeManager")],tD.prototype,"nodeManager",2),ZT([(0,r.dsm)("rowModel")],tD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("rowNodeSorter")],tD.prototype,"rowNodeSorter",2),ZT([(0,r.dsm)("sortController")],tD.prototype,"sortController",2),ZT([(0,r.dsm)("lazyBlockLoadingService")],tD.prototype,"lazyBlockLoadingService",2),ZT([r.o7C],tD.prototype,"init",1),ZT([r.yah],tD.prototype,"destroyRowNodes",1);var iD=class extends r.XQb{constructor(e,t,i){super(),this.idSequence=new r.RI_,this.ssrmParams=e,this.parentRowNode=i,this.storeParams=t,this.level=i.level+1,this.group=!!e.rowGroupCols&&this.level<e.rowGroupCols.length,this.leafGroup=!!e.rowGroupCols&&this.level===e.rowGroupCols.length-1,this.info={}}init(){var e;let t=1;if(0===this.level&&(t=null!=(e=this.storeUtils.getServerSideInitialRowCount())?e:1,this.eventService.dispatchEventOnce({type:r.sVA.EVENT_ROW_COUNT_READY})),this.cache=this.createManagedBean(new tD(this,t,this.storeParams)),!this.gos.get("treeData")&&this.group){const e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}}destroyRowNodes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.destroyBean(this.cache)}applyRowData(e,t,i){this.cache.onLoadSuccess(t,i,e)}applyTransaction(e){var t,i,s;const n=this.gos.getCallback("getRowId");if(!n)return console.warn("AG Grid: getRowId callback must be implemented for transactions to work. Transaction was ignored."),{status:r.a8A.Cancelled};const o=this.gos.getCallback("isApplyServerSideTransaction");if(o&&!o({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:r.a8A.Cancelled};const a=this.cache.isStoreFullyLoaded();let l,c,h;if((null==(t=e.update)?void 0:t.length)&&(l=this.cache.updateRowNodes(e.update)),null==(i=e.add)?void 0:i.length){let t=e.addIndex;null!=t&&t<0&&(t=void 0),c=this.cache.insertRowNodes(e.add,t)}if(null==(s=e.remove)?void 0:s.length){const t=e.remove.map(e=>n({level:this.level,parentKeys:this.parentRowNode.getGroupKeys(),data:e})),i=[...new Set(t)];h=this.cache.removeRowNodes(i)}const d=this.gos.get("serverSideEnableClientSideSort"),u=(null==l?void 0:l.length)||(null==c?void 0:c.length);return a&&d&&u&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(l,h),{status:r.a8A.Applied,update:l,add:c,remove:h}}updateSelectionAfterTransaction(e,t){const i=[];null==e||e.forEach(e=>{e.isSelected()&&!e.selectable&&i.push(e)}),null==t||t.forEach(e=>{e.isSelected()&&i.push(e)}),i.length&&this.selectionService.setNodesSelected({newValue:!1,clearSelection:!1,nodes:i,source:"rowDataChanged"})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach(e=>this.blockUtils.clearDisplayIndex(e.node)),this.parentRowNode.sibling&&this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling),this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){return this.parentRowNode.sibling?this.cache.getRowCount()+1:this.cache.getRowCount()}setRowCount(e,t){this.cache.setRowCount(e,t)}isDisplayIndexInStore(e){return 0!==this.cache.getRowCount()&&this.displayIndexStart<=e&&e<this.getDisplayIndexEnd()}setDisplayIndexes(e,t){this.displayIndexStart=e.peek(),this.topPx=t.value;const i=this.parentRowNode.level>-1&&this.gos.getGroupTotalRowCallback()({node:this.parentRowNode});i||this.parentRowNode.destroyFooter(),"top"===i&&(this.parentRowNode.createFooter(),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t)),this.cache.setDisplayIndexes(e,t),"bottom"===i&&(this.parentRowNode.createFooter(),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t)),this.displayIndexEnd=e.peek(),this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t=new r.RI_){e(this,t.next()),this.cache.getNodes().forEach(i=>{const s=i.node.childStore;s&&s.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t=new r.RI_){this.cache.getNodes().forEach(i=>{e(i.node,t.next());const s=i.node.childStore;s&&s.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t=new r.RI_,i=!1){const s=this.parentRowNode.level>-1&&this.gos.getGroupTotalRowCallback()({node:this.parentRowNode});"top"===s&&e(this.parentRowNode.sibling,t.next());const n=this.cache.getOrderedNodeMap();for(let s in n){const r=n[s];e(r.node,t.next());const o=r.node.childStore;o&&o.forEachNodeDeepAfterFilterAndSort(e,t,i)}"bottom"===s&&e(this.parentRowNode.sibling,t.next())}retryLoads(){this.cache.getNodes().forEach(({node:e})=>{e.failedLoad&&(e.failedLoad=!1,e.__needsRefreshWhenVisible=!0,e.stub=!0)}),this.forEachChildStoreShallow(e=>e.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(e){return this.parentRowNode.sibling&&e===this.parentRowNode.sibling.rowIndex?this.parentRowNode.sibling:this.cache.getRowByDisplayIndex(e)}getRowBounds(e){var t;if(!this.isDisplayIndexInStore(e))return null;const i=this.cache.getNodeCachedByDisplayIndex(e);if(i){const t=this.blockUtils.extractRowBounds(i,e);if(t)return t}const{previousNode:s,nextNode:r}=null!=(t=this.cache.getSurroundingNodesByDisplayIndex(e))?t:{};if(s){const t=this.blockUtils.extractRowBounds(s.node,e);if(null!=t)return t}const n=this.gos.getRowHeightAsNumber();if(r){const t=(r.node.rowIndex-e)*n;return{rowTop:r.node.rowTop-t,rowHeight:n}}return{rowTop:this.topPx+this.heightPx-(this.getDisplayIndexEnd()-e)*n,rowHeight:n}}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<this.topPx)return this.getDisplayIndexStart();if(e>=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&e>this.parentRowNode.sibling.rowTop&&e<this.parentRowNode.sibling.rowTop+this.parentRowNode.sibling.rowHeight)return this.parentRowNode.sibling.rowIndex;let t=Number.MAX_SAFE_INTEGER,i=null,s=Number.MAX_SAFE_INTEGER,r=null;if(this.cache.getNodes().forEach(({node:n})=>{const o=Math.abs(e-n.rowTop);n.rowTop<e?o<t&&(t=o,i=n):o<s&&(s=o,r=n)}),i){const t=this.blockUtils.getIndexAtPixel(i,e);if(null!=t)return t}const n=this.gos.getRowHeightAsNumber();if(r){const t=r.rowTop,i=Math.ceil((t-e)/n);return r.rowIndex-i}const o=this.topPx+this.heightPx,a=Math.floor((o-e)/n);return this.getDisplayIndexEnd()-a}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>{const t=this.cache.getNodes().find(t=>t.node.key==e);return t?t.node:null})}forEachChildStoreShallow(e){this.cache.getNodes().forEach(({node:t})=>{t.childStore&&e(t.childStore)})}refreshAfterSort(e){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){const e=this.cache.isStoreFullyLoaded(),t=this.gos.get("serverSideEnableClientSideSort");if(!e||!t){const e=this.cache.getRowCount();return this.destroyBean(this.cache),void(this.cache=this.createManagedBean(new tD(this,e,this.storeParams)))}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}refreshAfterFilter(e){!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)?this.refreshStore(!0):this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshStore(e){if(e)return this.destroyBean(this.cache),this.cache=this.createManagedBean(new tD(this,1,this.storeParams)),void this.fireStoreUpdatedEvent();this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){const t=this.cache.getDisplayIndexFromStoreIndex(e);return null!=t?t:e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){let i=!1;return r._.missing(e)&&!0,this.cache.getNodes().filter(({node:i})=>i.rowIndex>=e.rowIndex&&i.rowIndex<=t.rowIndex).map(({node:e})=>e)}addStoreStates(e){e.push({suppressInfiniteScroll:!1,route:this.parentRowNode.getGroupKeys(),rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(e){e&&Object.assign(this.info,e)}fireStoreUpdatedEvent(){const e={type:r.sVA.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}fireRefreshFinishedEvent(){const e={type:r.sVA.EVENT_STORE_REFRESHED,route:this.parentRowNode.getRoute()};this.eventService.dispatchEvent(e)}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}};ZT([(0,r.dsm)("ssrmBlockUtils")],iD.prototype,"blockUtils",2),ZT([(0,r.dsm)("ssrmStoreUtils")],iD.prototype,"storeUtils",2),ZT([(0,r.dsm)("columnModel")],iD.prototype,"columnModel",2),ZT([(0,r.dsm)("selectionService")],iD.prototype,"selectionService",2),ZT([r.o7C],iD.prototype,"init",1),ZT([r.yah],iD.prototype,"destroyRowNodes",1);var sD=class extends r.XQb{constructor(){super(...arguments),this.onRowHeightChanged_debounced=r._.debounce(this.onRowHeightChanged.bind(this),100),this.pauseStoreUpdateListening=!1,this.started=!1,this.managingPivotResultColumns=!1}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)}addEventListeners(){this.addManagedListener(this.eventService,r.sVA.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));const e=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_VALUE_CHANGED,e),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_CHANGED,e),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","suppressServerSideInfiniteScroll","cacheBlockSize"],e),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){const e=this.gos.get("serverSideDatasource");e&&this.setDatasource(e)}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&r._.warnOnce("initialGroupOrderComparator cannot be used with Server Side Row Model."),this.gos.isRowSelection()&&!this.gos.exists("getRowId")&&r._.warnOnce("getRowId callback must be provided for Server Side Row Model selection to work correctly.")}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,i){const s=this.getRootStore();if(!s)return;const r=s.getChildStore(i);r&&(r instanceof iD?r.applyRowData(e,t,e.rowData.length):r instanceof QT&&r.processServerResult(e))}isLastRowIndexKnown(){const e=this.getRootStore();return!!e&&e.isLastRowIndexKnown()}onColumnEverything(){if(!this.storeParams)return void this.resetRootStore();const e=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),t=this.columnsToValueObjects(this.columnModel.getValueColumns()),i=this.columnsToValueObjects(this.columnModel.getPivotColumns()),s=e=>{const t={};e.oldCols.forEach(e=>t[e.id]=e);const i=e.newCols.every(e=>{const i=t[e.id];return i&&delete t[e.id],i&&i.field===e.field&&i.aggFunc===e.aggFunc}),s=!e.allowRemovedColumns&&!!Object.values(t).length;return i&&!s},n=!r._.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),o=!s({oldCols:this.storeParams.rowGroupCols,newCols:e}),a=!s({oldCols:this.storeParams.pivotCols,newCols:i}),l=!!(null==e?void 0:e.length)&&!s({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(n||o||a||l)this.resetRootStore();else{const e=this.createStoreParams();this.storeParams.rowGroupCols=e.rowGroupCols,this.storeParams.pivotCols=e.pivotCols,this.storeParams.valueCols=e.valueCols}}destroyRootStore(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);const i=this.getRootStore();i&&(i.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefService)return void r.syG.__assertRegistered(r.zsj.RowGroupingModule,"pivotResultFields",this.context.getGridId());const t=this.pivotColDefService.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.columnModel.setSecondaryColumns(t,"rowModelUpdated")}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes(),t=this.gos.getRowHeightForNode(this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){const e=this.gos.getRowHeightForNode(this.rootNode.sibling);this.rootNode.sibling.setRowHeight(e.height,e.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{const i=this.gos.getRowHeightForNode(t);t.setRowHeight(i.height,i.estimated);const s=t.detailNode;if(s){const e=this.gos.getRowHeightForNode(s);s.setRowHeight(e.height,e.estimated)}if(t.sibling){const e=this.gos.getRowHeightForNode(t.sibling);s.setRowHeight(e.height,e.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new r.TUE(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.managingPivotResultColumns&&(this.columnModel.setSecondaryColumns(null,"api"),this.managingPivotResultColumns=!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e){return e.map(e=>({id:e.getId(),aggFunc:e.getAggFunc(),displayName:this.columnModel.getDisplayNameForColumn(e,"model"),field:e.getColDef().field}))}createStoreParams(){const e=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),t=this.columnsToValueObjects(this.columnModel.getValueColumns()),i=this.columnsToValueObjects(this.columnModel.getPivotColumns()),s=this.gos.isGetRowHeightFunction();return{valueCols:t,rowGroupCols:e,pivotCols:i,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.isAdvancedFilterEnabled()?this.filterManager.getAdvancedFilterModel():this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),datasource:this.datasource,lastAccessedSequence:new r.RI_,dynamicRowHeight:s}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){const t={type:r.sVA.EVENT_MODEL_UPDATED,animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1};this.eventService.dispatchEvent(t)}onStoreUpdated(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){const e=this.getRootStore();e&&e.setDisplayIndexes(new r.RI_,{value:0})}retryLoads(){const e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){const t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}setPaused(e){this.pauseStoreUpdateListening=e}expandAll(e){this.pauseStoreUpdateListening=!0,this.forEachNode(t=>{t.stub||t.hasChildren()&&t.setExpanded(e)}),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);const i=this.getRootStore();i&&(i.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore}getRowCount(){const e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){const e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){const t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){const t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:this.gos.getRowHeightAsNumber()}}getBlockStates(){const e=this.getRootStore();if(!e)return;const t={};return e.forEachStoreDeep(e=>{if(e instanceof QT){const{id:i,state:s}=e.getBlockStateJson();t[i]=s}else{if(!(e instanceof iD))throw new Error("AG Grid: Unsupported store type");Object.entries(e.getBlockStates()).forEach(([e,i])=>{t[e]=i})}}),t}getRowIndexAtPixel(e){const t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}isRowsToRender(){return null!=this.getRootStore()&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(e){const t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachNodeAfterFilterAndSort(e,t=!1){const i=this.getRootStore();i&&i.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;const i=this.getRootStore();if(!i)return!0;const s=i.getChildStore(e);return s&&t(s),!0}refreshStore(e={}){const t=e.route?e.route:[];this.executeOnStore(t,t=>t.refreshStore(1==e.purge))}getStoreState(){const e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){if(!r._.exists(e))return[];if(!t)return[e];const i=e.rowIndex,s=t.rowIndex;if(null===i||null===s)return[e];const n=[],[o,a]=[i,s].sort((e,t)=>e-t);return this.forEachNode(e=>{const t=e.rowIndex;null==t||e.stub||t>=o&&t<=a&&n.push(e)}),n.length!==a-o+1?[e]:n}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i),i.detailNode&&i.detailNode.id===e&&(t=i.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){const i=this.getRootStore();if(i){if(i instanceof iD)return void i.setRowCount(e,t);console.error("AG Grid: Infinite scrolling must be enabled in order to set the row count.")}}};ZT([(0,r.dsm)("columnModel")],sD.prototype,"columnModel",2),ZT([(0,r.dsm)("filterManager")],sD.prototype,"filterManager",2),ZT([(0,r.dsm)("sortController")],sD.prototype,"sortController",2),ZT([(0,r.dsm)("rowRenderer")],sD.prototype,"rowRenderer",2),ZT([(0,r.dsm)("ssrmNodeManager")],sD.prototype,"nodeManager",2),ZT([(0,r.dsm)("ssrmStoreFactory")],sD.prototype,"storeFactory",2),ZT([(0,r.dsm)("beans")],sD.prototype,"beans",2),ZT([(0,r.Xx1)("pivotColDefService")],sD.prototype,"pivotColDefService",2),ZT([r.yah],sD.prototype,"destroyDatasource",1),ZT([r.o7C],sD.prototype,"addEventListeners",1),ZT([r.yah],sD.prototype,"destroyRootStore",1),sD=ZT([(0,r.dR4)("rowModel")],sD);var rD=class extends r.XQb{loadFromDatasource(e){const{storeParams:t,parentBlock:i,parentNode:s}=e,r=s.getGroupKeys();if(!t.datasource)return;const n={startRow:e.startRow,endRow:e.endRow,rowGroupCols:t.rowGroupCols,valueCols:t.valueCols,pivotCols:t.pivotCols,pivotMode:t.pivotMode,groupKeys:r,filterModel:t.filterModel,sortModel:t.sortModel},o=this.gos.addGridCommonParams({success:e.success,fail:e.fail,request:n,parentNode:e.parentNode});window.setTimeout(()=>{t.datasource&&i.isAlive()?t.datasource.getRows(o):e.fail()},0)}getChildStore(e,t,i){if(r._.missingOrEmpty(e))return t;const s=i(e[0]);if(s){if(1===e.length&&!s.childStore){const e=this.serverSideRowModel.getParams();s.childStore=this.createBean(this.storeFactory.createStore(e,s))}const t=e.slice(1,e.length),i=s.childStore;return i?i.getChildStore(t):null}return null}isServerRefreshNeeded(e,t,i){if(i.valueColChanged||i.secondaryColChanged)return!0;const s=e.level+1;if(!(s<t.length))return!0;const r=t[s].id;if(i.changedColumns.indexOf(r)>-1)return!0;const n=this.columnModel.getAllGridColumns().filter(e=>e.getColDef().showRowGroup&&i.changedColumns.includes(e.getId())).map(e=>e.getColDef().showRowGroup).some(e=>!0===e||e===r);return n}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}assertRowModelIsServerSide(e){return!!this.gos.isRowModelType("serverSide")||(r._.warnOnce(`The '${e}' property can only be used with the Server Side Row Model.`),!1)}assertNotTreeData(e){return!this.gos.get("treeData")||(r._.warnOnce(`The '${e}' property cannot be used while using tree data.`),!1)}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&this.assertRowModelIsServerSide("serverSideSortAllLevels")}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&this.assertRowModelIsServerSide("serverSideOnlyRefreshFilteredGroups")}isServerSideSortOnServer(){return this.gos.get("serverSideSortOnServer")&&this.assertRowModelIsServerSide("serverSideSortOnServer")&&this.assertNotTreeData("serverSideSortOnServer")}isServerSideFilterOnServer(){return this.gos.get("serverSideFilterOnServer")&&this.assertRowModelIsServerSide("serverSideFilterOnServer")&&this.assertNotTreeData("serverSideFilterOnServer")}};ZT([(0,r.dsm)("columnModel")],rD.prototype,"columnModel",2),ZT([(0,r.dsm)("rowModel")],rD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("ssrmStoreFactory")],rD.prototype,"storeFactory",2),rD=ZT([(0,r.dR4)("ssrmStoreUtils")],rD);var nD=class extends r.XQb{createRowNode(e){const t=new r.TUE(this.beans),i=null!=e.rowHeight?e.rowHeight:this.gos.getRowHeightAsNumber();return t.setRowHeight(i),t.group=e.group,t.leafGroup=e.leafGroup,t.level=e.level,t.uiLevel=e.level,t.parent=e.parent,t.stub=!0,t.__needsRefreshWhenVisible=!1,t.group&&(t.expanded=!1,t.field=e.field,t.rowGroupColumn=e.rowGroupColumn),t}destroyRowNodes(e){e&&e.forEach(e=>this.destroyRowNode(e))}destroyRowNode(e,t=!1){e.childStore&&!t&&(this.destroyBean(e.childStore),e.childStore=null),e.sibling&&!e.footer&&this.destroyRowNode(e.sibling,!1),e.clearRowTopAndRowIndex(),null!=e.id&&this.nodeManager.removeNode(e)}setTreeGroupInfo(e){e.updateHasChildren();const t=this.gos.get("getServerSideGroupKey");e.hasChildren()&&null!=t&&(e.key=t(e.data)),e.hasChildren()||null==e.childStore||(this.destroyBean(e.childStore),e.childStore=null,e.expanded=!1)}setRowGroupInfo(e){e.key=this.valueService.getValue(e.rowGroupColumn,e),null!==e.key&&void 0!==e.key||r._.doOnce(()=>{console.warn("AG Grid: null and undefined values are not allowed for server side row model keys"),e.rowGroupColumn&&console.warn(`column = ${e.rowGroupColumn.getId()}`),console.warn("data is ",e.data)},"ServerSideBlock-CannotHaveNullOrUndefinedForKey"),this.beans.gos.getGroupTotalRowCallback()({node:e})&&(e.createFooter(),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){const t=this.gos.get("isRowMaster");e.master=null==t||t(e.data)}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get("treeData")?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e)):e.group?(this.setChildCountIntoRowNode(e),e.footer||(this.beans.gos.getGroupTotalRowCallback()({node:e})?e.sibling?e.sibling.updateData(t):e.createFooter():e.sibling&&e.destroyFooter())):this.gos.get("masterDetail")}setDataIntoRowNode(e,t,i,s){var n;e.stub=!1;const o=this.gos.get("treeData");r._.exists(t)?(e.setDataAndId(t,i),o?this.setTreeGroupInfo(e):e.group?this.setRowGroupInfo(e):this.gos.get("masterDetail")&&this.setMasterDetailInfo(e)):(e.setDataAndId(void 0,void 0),e.key=null),(o||e.group)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),r._.exists(t)&&(e.setRowHeight(this.gos.getRowHeightForNode(e,!1,s).height),null==(n=e.sibling)||n.setRowHeight(this.gos.getRowHeightForNode(e.sibling,!1,s).height))}setChildCountIntoRowNode(e){const t=this.gos.get("getChildCount");t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){const t=this.columnModel.getGroupDisplayColumns(),i=this.gos.get("treeData");t.forEach(t=>{if(null==e.groupData&&(e.groupData={}),i)e.groupData[t.getColId()]=e.key;else if(t.isRowGroupDisplayed(e.rowGroupColumn.getId())){const i=this.valueService.getValue(e.rowGroupColumn,e);e.groupData[t.getColId()]=i}})}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&r._.exists(e.childStore)&&e.childStore.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode.clearRowTopAndRowIndex()}setDisplayIndex(e,t,i){if(e.setRowIndex(t.next()),e.setRowTop(i.value),i.value+=e.rowHeight,!e.footer&&(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.next()),e.detailNode.setRowTop(i.value),i.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&r._.exists(e.childStore))){const s=e.childStore;e.expanded?s.setDisplayIndexes(t,i):s.clearDisplayIndexes()}}binarySearchForDisplayIndex(e,t){let i=0,s=t.length-1;if(r._.missing(s)||r._.missing(i))console.warn(`AG Grid: error: topPointer = ${s}, bottomPointer = ${i}`);else for(;;){const r=Math.floor((i+s)/2),n=t[r];if(n.rowIndex===e)return n;const o=n.master&&n.expanded,a=n.detailNode;if(o&&a&&a.rowIndex===e)return n.detailNode;const l=n.childStore;if(n.expanded&&l&&l.isDisplayIndexInStore(e))return l.getRowUsingDisplayIndex(e);if(n.rowIndex<e)i=r+1;else{if(!(n.rowIndex>e))return void console.warn(`AG Grid: error: unable to locate rowIndex = ${e} in cache`);s=r-1}}}extractRowBounds(e,t){const i=e=>({rowHeight:e.rowHeight,rowTop:e.rowTop});if(e.rowIndex===t)return i(e);if(e.hasChildren()&&e.expanded&&r._.exists(e.childStore)){const i=e.childStore;if(i.isDisplayIndexInStore(t))return i.getRowBounds(t)}else if(e.master&&e.expanded&&r._.exists(e.detailNode)&&e.detailNode.rowIndex===t)return i(e.detailNode)}getIndexAtPixel(e,t){if(e.isPixelInRange(t))return e.rowIndex;const i=e.master&&e.expanded,s=e.detailNode;if(i&&s&&s.isPixelInRange(t))return e.detailNode.rowIndex;if(e.hasChildren()&&e.expanded&&r._.exists(e.childStore)){const i=e.childStore;if(i.isPixelInRange(t))return i.getRowIndexAtPixel(t)}return null}createNodeIdPrefix(e){const t=[];let i=e;for(;i&&i.level>=0;)""===i.key?t.push("ag-Grid-MissingKey"):t.push(i.key),i=i.parent;if(t.length>0)return t.reverse().join("-")}checkOpenByDefault(e){return this.expansionService.checkOpenByDefault(e)}};ZT([(0,r.dsm)("valueService")],nD.prototype,"valueService",2),ZT([(0,r.dsm)("columnModel")],nD.prototype,"columnModel",2),ZT([(0,r.dsm)("ssrmNodeManager")],nD.prototype,"nodeManager",2),ZT([(0,r.dsm)("beans")],nD.prototype,"beans",2),ZT([(0,r.dsm)("expansionService")],nD.prototype,"expansionService",2),nD=ZT([(0,r.dR4)("ssrmBlockUtils")],nD);var oD=class{constructor(){this.rowNodes={}}addRowNode(e){const t=e.id;this.rowNodes[t]&&(console.warn(`AG Grid: Duplicate node id ${e.id}. Row ID's are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`),console.warn("first instance",this.rowNodes[t].data),console.warn("second instance",e.data)),this.rowNodes[t]=e}removeNode(e){const t=e.id;this.rowNodes[t]&&(this.rowNodes[t]=void 0)}clear(){this.rowNodes={}}};ZT([r.yah],oD.prototype,"clear",1),oD=ZT([(0,r.dR4)("ssrmNodeManager")],oD);var aD=class extends r.XQb{constructor(){super(...arguments),this.asyncTransactions=[]}postConstruct(){this.gos.isRowModelType("serverSide")}applyTransactionAsync(e,t){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){const e=this.gos.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;const e=[],t=[],i=[];let s=!1;if(this.asyncTransactions.forEach(n=>{let o;this.serverSideRowModel.executeOnStore(n.transaction.route,e=>{o=e.applyTransaction(n.transaction)})?null==o&&(o={status:r.a8A.StoreNotFound}):o={status:r.a8A.StoreNotStarted},t.push(o),o.status==r.a8A.StoreLoading?i.push(n):(n.callback&&e.push(()=>n.callback(o)),o.status===r.a8A.Applied&&(s=!0))}),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=i,s&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:r.sVA.EVENT_STORE_UPDATED})),t.length>0){const e={type:r.sVA.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}}flushAsyncTransactions(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(this.serverSideRowModel.executeOnStore(e.route,i=>{t=i.applyTransaction(e)})){if(t){if(this.valueCache.onDataChanged(),t.remove){const i=t.remove.map(e=>e.id);this.selectionService.deleteSelectionStateFromParent(e.route||[],i)}return this.eventService.dispatchEvent({type:r.sVA.EVENT_STORE_UPDATED}),t}return{status:r.a8A.StoreNotFound}}return{status:r.a8A.StoreNotStarted}}};ZT([(0,r.dsm)("rowNodeBlockLoader")],aD.prototype,"rowNodeBlockLoader",2),ZT([(0,r.dsm)("valueCache")],aD.prototype,"valueCache",2),ZT([(0,r.dsm)("rowModel")],aD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("rowRenderer")],aD.prototype,"rowRenderer",2),ZT([(0,r.dsm)("selectionService")],aD.prototype,"selectionService",2),ZT([r.o7C],aD.prototype,"postConstruct",1),aD=ZT([(0,r.dR4)("ssrmTransactionManager")],aD);var lD=class extends r.XQb{postConstruct(){this.gos.isRowModelType("serverSide")&&this.addManagedListener(this.eventService,r.sVA.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))}onRowGroupOpened(e){const t=e.node;if(t.expanded){if(t.master)this.createDetailNode(t);else if(r._.missing(t.childStore)){const e=this.serverSideRowModel.getParams();t.childStore=this.createBean(this.storeFactory.createStore(e,t))}}else this.gos.get("purgeClosedRowNodes")&&r._.exists(t.childStore)&&(t.childStore=this.destroyBean(t.childStore));const i={type:r.sVA.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(i)}createDetailNode(e){if(r._.exists(e.detailNode))return e.detailNode;const t=new r.TUE(this.beans);t.detail=!0,t.selectable=!1,t.parent=e,r._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1;const i=this.gos.getRowHeightForNode(t).height;return t.rowHeight=i||200,e.detailNode=t,t}};ZT([(0,r.dsm)("rowModel")],lD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("ssrmStoreFactory")],lD.prototype,"storeFactory",2),ZT([(0,r.dsm)("beans")],lD.prototype,"beans",2),ZT([r.o7C],lD.prototype,"postConstruct",1),lD=ZT([(0,r.dR4)("ssrmExpandListener")],lD);var cD=class extends r.XQb{postConstruct(){this.gos.isRowModelType("serverSide")&&this.addManagedListener(this.eventService,r.sVA.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))}onSortChanged(){const e=this.serverSideRowModel.getParams();if(!e)return;const t=this.sortController.getSortModel(),i=e.sortModel,s=this.findChangedColumnsInSort(t,i),r={valueColChanged:this.listenerUtils.isSortingWithValueColumn(s),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(s),changedColumns:s};this.serverSideRowModel.refreshAfterSort(t,r)}findChangedColumnsInSort(e,t){let i=[];return[e,t].forEach(e=>{if(e){const t=e.map(e=>e.colId);i=i.concat(t)}}),i.filter(i=>{const s=t.find(e=>e.colId===i),r=e.find(e=>e.colId===i);return((e,t)=>(e?e.sort:null)!==(t?t.sort:null))(s,r)||((i,s)=>(i?t.indexOf(i):-1)!==(s?e.indexOf(s):-1))(s,r)})}};ZT([(0,r.dsm)("sortController")],cD.prototype,"sortController",2),ZT([(0,r.dsm)("rowModel")],cD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("ssrmListenerUtils")],cD.prototype,"listenerUtils",2),ZT([r.o7C],cD.prototype,"postConstruct",1),cD=ZT([(0,r.dR4)("ssrmSortService")],cD);var hD=class extends r.XQb{postConstruct(){this.gos.isRowModelType("serverSide")&&(this.addManagedListener(this.eventService,r.sVA.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,()=>this.onFilterChanged(!0)),this.addManagedListener(this.eventService,r.sVA.EVENT_FILTER_CHANGED,()=>this.onFilterChanged()))}onFilterChanged(e){const t=this.serverSideRowModel.getParams();if(!t)return;const i=t.filterModel;let s,r;if(this.filterManager.isAdvancedFilterEnabled()){s=this.filterManager.getAdvancedFilterModel();const t=e?Object.keys(null!=i?i:{}):this.getAdvancedFilterColumns(i),n=this.getAdvancedFilterColumns(s);t.forEach(e=>n.add(e)),r=Array.from(n)}else if(s=this.filterManager.getFilterModel(),e){const e=this.getAdvancedFilterColumns(i);Object.keys(s).forEach(t=>e.add(t)),r=Array.from(e)}else r=this.findChangedColumns(i,s);const n={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),changedColumns:r};this.serverSideRowModel.refreshAfterFilter(s,n)}findChangedColumns(e,t){const i={};Object.keys(e).forEach(e=>i[e]=!0),Object.keys(t).forEach(e=>i[e]=!0);const s=[];return Object.keys(i).forEach(i=>{JSON.stringify(e[i])!=JSON.stringify(t[i])&&s.push(i)}),s}getAdvancedFilterColumns(e){const t=new Set;if(!e)return t;const i=e=>{"join"===e.filterType?e.conditions.forEach(e=>i(e)):t.add(e.colId)};return i(e),t}};ZT([(0,r.dsm)("rowModel")],hD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("filterManager")],hD.prototype,"filterManager",2),ZT([(0,r.dsm)("ssrmListenerUtils")],hD.prototype,"listenerUtils",2),ZT([r.o7C],hD.prototype,"postConstruct",1),hD=ZT([(0,r.dR4)("ssrmFilterListener")],hD);var dD=class{createStore(e,t){const i=this.getStoreParams(e,t);return new(i.suppressInfiniteScroll?QT:iD)(e,i,t)}getStoreParams(e,t){const i=this.getLevelSpecificParams(t),s=this.isInfiniteScroll(i);return{suppressInfiniteScroll:!s,cacheBlockSize:this.getBlockSize(s,i),maxBlocksInCache:this.getMaxBlocksInCache(s,e,i)}}getMaxBlocksInCache(e,t,i){if(!e)return;const s=i&&null!=i.maxBlocksInCache?i.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(null!=s&&s>=0){if(t.dynamicRowHeight){const e="Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.";return void r._.warnOnce(e)}if(this.columnModel.isAutoRowHeightActive()){const e="Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.";return void r._.warnOnce(e)}return s}}getBlockSize(e,t){if(!e)return;const i=t&&null!=t.cacheBlockSize?t.cacheBlockSize:this.gos.get("cacheBlockSize");return null!=i&&i>0?i:100}getLevelSpecificParams(e){const t=this.gos.getCallback("getServerSideGroupLevelParams");if(t)return t({level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()})}isInfiniteScroll(e){return!(e&&null!=e.suppressInfiniteScroll?e.suppressInfiniteScroll:this.isSuppressServerSideInfiniteScroll())}isSuppressServerSideInfiniteScroll(){return this.gos.get("suppressServerSideInfiniteScroll")}};ZT([(0,r.dsm)("gridOptionsService")],dD.prototype,"gos",2),ZT([(0,r.dsm)("columnModel")],dD.prototype,"columnModel",2),dD=ZT([(0,r.dR4)("ssrmStoreFactory")],dD);var uD=class{isSortingWithValueColumn(e){const t=this.columnModel.getValueColumns().map(e=>e.getColId());for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}isSortingWithSecondaryColumn(e){if(!this.columnModel.getSecondaryColumns())return!1;const t=this.columnModel.getSecondaryColumns().map(e=>e.getColId());for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}};ZT([(0,r.dsm)("columnModel")],uD.prototype,"columnModel",2),uD=ZT([(0,r.dR4)("ssrmListenerUtils")],uD);var pD=class extends r.XQb{constructor(){super(...arguments),this.selectedState={selectAll:!1,toggledNodes:new Set},this.lastSelected=null,this.selectAllUsed=!1,this.selectedNodes={}}init(){this.rowSelection=this.gos.get("rowSelection"),this.addManagedPropertyListener("rowSelection",e=>{this.rowSelection=e.currentValue})}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){const t={selectAll:!1,toggledNodes:new Set};"object"==typeof e?"selectAll"in e&&"boolean"==typeof e.selectAll?(t.selectAll=e.selectAll,"toggledNodes"in e&&Array.isArray(e.toggledNodes)?(e.toggledNodes.forEach(e=>{"string"==typeof e?t.toggledNodes.add(e):console.warn(`AG Grid: Provided ids must be of string type. Invalid id provided: ${e}`)}),this.selectedState=t):console.error("AG Grid: `toggledNodes` must be an array of string ids.")):console.error("AG Grid: Select all status should be of boolean type."):console.error("AG Grid: The provided selection state should be an object.")}deleteSelectionStateFromParent(e,t){if(0===this.selectedState.toggledNodes.size)return!1;let i=!1;return t.forEach(e=>{this.selectedState.toggledNodes.delete(e)&&(i=!0)}),i}setNodesSelected(e){if(0===e.nodes.length)return 0;const t=e.clearSelection&&e.newValue&&!e.rangeSelect;if("multiple"!==this.rowSelection||t){if(e.nodes.length>1)throw new Error("AG Grid: cannot select multiple rows when rowSelection is set to 'single'");const t=e.nodes[0];return e.newValue?(this.selectedNodes={[t.id]:t},this.selectedState={selectAll:!1,toggledNodes:new Set([t.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),this.lastSelected=t.id,1}const i=t=>{e.newValue?this.selectedNodes[t.id]=t:delete this.selectedNodes[t.id];const i=t.selectable;e.newValue!==this.selectedState.selectAll&&i?this.selectedState.toggledNodes.add(t.id):this.selectedState.toggledNodes.delete(t.id)};if(e.rangeSelect&&this.lastSelected){if(e.nodes.length>1)throw new Error("AG Grid: cannot select multiple rows when using rangeSelect");const t=e.nodes[0],s=this.rowModel.getRowNode(this.lastSelected);return this.rowModel.getNodesInRangeForSelection(t,null!=s?s:null).forEach(i),this.lastSelected=t.id,1}return e.nodes.forEach(i),this.lastSelected=e.nodes[e.nodes.length-1].id,1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){const t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(){return this.selectAllUsed&&console.warn("AG Grid: getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model.\n                Use `api.getServerSideSelectionState()` instead."),Object.values(this.selectedNodes)}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}clearOtherNodes(e,t){const i=this.selectedState.selectAll?1:this.selectedState.toggledNodes.size-1;this.selectedState={selectAll:!1,toggledNodes:new Set([e.id])},this.rowModel.forEachNode(i=>{i!==e&&i.selectThisNode(!1,void 0,t)});const s={type:r.sVA.EVENT_SELECTION_CHANGED,source:t};return this.eventService.dispatchEvent(s),i}isEmpty(){var e;return!this.selectedState.selectAll&&!(null==(e=this.selectedState.toggledNodes)?void 0:e.size)}selectAllRowNodes(e){this.selectedState={selectAll:!0,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed=!0}deselectAllRowNodes(e){this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectedNodes={}}getSelectAllState(e,t){return this.selectedState.selectAll?!(this.selectedState.toggledNodes.size>0)||null:this.selectedState.toggledNodes.size>0&&null}};ZT([(0,r.dsm)("rowModel")],pD.prototype,"rowModel",2),ZT([r.o7C],pD.prototype,"init",1);var gD=class extends r.XQb{constructor(){super(...arguments),this.selectedState={selectAllChildren:!1,toggledNodes:new Map},this.lastSelected=null}init(){this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,()=>this.removeRedundantState()),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.selectionService.reset("rowGroupChanged"))}getSelectedState(){const e=this.gos.get("treeData"),t=(i,s,r)=>{const n={nodeId:r};if((e||s<=this.columnModel.getRowGroupColumns().length)&&(n.selectAllChildren=i.selectAllChildren),i.toggledNodes.size){const e=[];i.toggledNodes.forEach((i,r)=>{const n=t(i,s+1,r);e.push(n)}),n.toggledNodes=e}return n};return t(this.selectedState,0)}setSelectedState(e){const t=(e,i)=>{var s,r;if("object"!=typeof e)throw new Error("AG Grid: Each provided state object must be an object.");if("selectAllChildren"in e&&"boolean"!=typeof e.selectAllChildren)throw new Error("AG Grid: `selectAllChildren` must be a boolean value or undefined.");if("toggledNodes"in e){if(!Array.isArray(e.toggledNodes))throw new Error("AG Grid: `toggledNodes` must be an array.");if(!e.toggledNodes.every(e=>"object"==typeof e&&"nodeId"in e&&"string"==typeof e.nodeId))throw new Error("AG Grid: Every `toggledNode` requires an associated string id.")}const n=null!=(s=e.selectAllChildren)?s:!i,o=null==(r=e.toggledNodes)?void 0:r.map(e=>[e.nodeId,t(e,n)]);if(null==o?void 0:o.some(([e,t])=>n===t.selectAllChildren&&0===t.toggledNodes.size))throw new Error("\n                    AG Grid: AG Grid: Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule.\n                    Please rebuild the selection state and reapply it.\n                ");return{selectAllChildren:n,toggledNodes:new Map(o)}};try{this.selectedState=t(e,!!e.selectAllChildren)}catch(e){console.error(e.message)}}deleteSelectionStateFromParent(e,t){let i=this.selectedState;const s=[...e];for(;i&&s.length;)i=i.toggledNodes.get(s.pop());if(!i)return!1;let r=!1;return t.forEach(e=>{(null==i?void 0:i.toggledNodes.delete(e))&&(r=!0)}),r&&this.removeRedundantState(),r}setNodesSelected(e){const t=e,{nodes:i}=t,s=XT(t,["nodes"]);if(0===i.length)return 0;if(e.rangeSelect){if(i.length>1)throw new Error("AG Grid: cannot select multiple rows when using rangeSelect");const e=i[0],t=this.rowModel.getNodesInRangeForSelection(e,this.lastSelected).map(this.getRouteToNode).sort((e,t)=>t.length-e.length),r=new Set;return t.forEach(t=>{r.has(t[t.length-1])||(t.forEach(e=>r.add(e)),this.recursivelySelectNode(t,this.selectedState,qT({node:e},s)))}),this.removeRedundantState(),this.lastSelected=e,1}return e.nodes.forEach(e=>{const t=this.getRouteToNode(e);var i;this.recursivelySelectNode(t,this.selectedState,(i=qT({},s),UT(i,WT({node:e}))))}),this.removeRedundantState(),this.lastSelected=e.nodes[e.nodes.length-1],1}isNodeSelected(e){const t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],i){if(0===t.length){const t=i.toggledNodes.has(e.id);if(e.hasChildren()){const t=i.toggledNodes.get(e.id);if(t&&t.toggledNodes.size)return}return i.selectAllChildren?!t:t}if(i.toggledNodes.has(e.id)){const s=i.toggledNodes.get(e.id);if(s)return this.isNodePathSelected(t,s)}return!!i.selectAllChildren}getRouteToNode(e){const t=[];let i=e;for(;i.parent;)t.push(i),i=i.parent;return t.reverse()}removeRedundantState(){if(this.filterManager.isAnyFilterPresent())return;const e=(t=this.selectedState,i,s)=>{if(t.toggledNodes.forEach((i,s)=>{e(i,s,t)}),i){const e=this.rowModel.getRowNode(i),s=null==e?void 0:e.childStore;if((null==s?void 0:s.isLastRowIndexKnown())&&t.toggledNodes.size>=s.getRowCount()){for(const e of t.toggledNodes.entries()){const[t,i]=e;if(i.toggledNodes.size>0)return;if(!this.rowModel.getRowNode(t))return}t.selectAllChildren=!t.selectAllChildren,t.toggledNodes.clear()}}const r=0===t.toggledNodes.size,n=(null==s?void 0:s.selectAllChildren)===t.selectAllChildren;r&&n&&(null==s||s.toggledNodes.delete(i))};e()}recursivelySelectNode([e,...t],i,s){if(!e)return;if(!t.length){const t=e.selectable;if(i.selectAllChildren===s.newValue||!t)return void i.toggledNodes.delete(e.id);const r={selectAllChildren:s.newValue,toggledNodes:new Map};return void i.toggledNodes.set(e.id,r)}const r=i.toggledNodes.has(e.id),n=r?i.toggledNodes.get(e.id):{selectAllChildren:i.selectAllChildren,toggledNodes:new Map};r||i.toggledNodes.set(e.id,n),this.recursivelySelectNode(t,n,s),i.selectAllChildren===n.selectAllChildren&&0===n.toggledNodes.size&&i.toggledNodes.delete(e.id)}getSelectedNodes(){console.warn("AG Grid: `getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model.\n            Use `api.getServerSideSelectionState()` instead.");const e=[];return this.rowModel.forEachNode(t=>{t.isSelected()&&e.push(t)}),e}processNewRow(e){}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return-1}isEmpty(){var e;return!this.selectedState.selectAllChildren&&!(null==(e=this.selectedState.toggledNodes)?void 0:e.size)}selectAllRowNodes(e){this.selectedState={selectAllChildren:!0,toggledNodes:new Map}}deselectAllRowNodes(e){this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}getSelectAllState(e,t){return this.selectedState.selectAllChildren?!(this.selectedState.toggledNodes.size>0)||null:this.selectedState.toggledNodes.size>0&&null}};ZT([(0,r.dsm)("rowModel")],gD.prototype,"rowModel",2),ZT([(0,r.dsm)("columnModel")],gD.prototype,"columnModel",2),ZT([(0,r.dsm)("filterManager")],gD.prototype,"filterManager",2),ZT([(0,r.dsm)("rowModel")],gD.prototype,"serverSideRowModel",2),ZT([(0,r.dsm)("selectionService")],gD.prototype,"selectionService",2),ZT([r.o7C],gD.prototype,"init",1);var mD=class extends r.XQb{init(){const e=this.gos.get("groupSelectsChildren");this.addManagedPropertyListener("groupSelectsChildren",e=>{this.destroyBean(this.selectionStrategy);const t=e.currentValue?gD:pD;this.selectionStrategy=this.createManagedBean(new t),this.shotgunResetNodeSelectionState();const i={type:r.sVA.EVENT_SELECTION_CHANGED,source:"api"};this.eventService.dispatchEvent(i)}),this.addManagedPropertyListener("rowSelection",()=>this.deselectAllRowNodes({source:"api"}));const t=e?gD:pD;this.selectionStrategy=this.createManagedBean(new t)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(Array.isArray(e))return;this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState();const i={type:r.sVA.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(i)}setNodesSelected(e){const t=e,{nodes:i}=t,s=XT(t,["nodes"]),n=this.gos.get("rowSelection");if(i.length>1&&"multiple"!==n)return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;if(i.length>1&&e.rangeSelect)return console.warn("AG Grid: cannot use range selection when multi selecting rows"),0;const o=qT({nodes:i.filter(e=>e.selectable)},s);if(!o.nodes.length)return 0;const a=this.selectionStrategy.setNodesSelected(o);this.shotgunResetNodeSelectionState(o.source);const l={type:r.sVA.EVENT_SELECTION_CHANGED,source:o.source};return this.eventService.dispatchEvent(l),a}deleteSelectionStateFromParent(e,t){if(!this.selectionStrategy.deleteSelectionStateFromParent(e,t))return;this.shotgunResetNodeSelectionState();const i={type:r.sVA.EVENT_SELECTION_CHANGED,source:"api"};this.eventService.dispatchEvent(i)}shotgunResetNodeSelectionState(e){this.rowModel.forEachNode(t=>{if(t.stub)return;const i=this.selectionStrategy.isNodeSelected(t);i!==t.isSelected()&&t.selectThisNode(i,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e,t){this.selectionStrategy.processNewRow(e);const i=this.selectionStrategy.isNodeSelected(e);if(0!=i&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState();const t={type:r.sVA.EVENT_SELECTION_CHANGED,source:"api"};return void this.eventService.dispatchEvent(t)}e.setSelectedInitialValue(i)}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"})}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(e=!1,t=!1){return!0}selectAllRowNodes(e){(e.justCurrentPage||e.justFiltered)&&console.warn("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"),this.selectionStrategy.selectAllRowNodes(e),this.rowModel.forEachNode(t=>{t.stub||t.selectThisNode(!0,void 0,e.source)});const t={type:r.sVA.EVENT_SELECTION_CHANGED,source:e.source};this.eventService.dispatchEvent(t)}deselectAllRowNodes(e){(e.justCurrentPage||e.justFiltered)&&console.warn("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"),this.selectionStrategy.deselectAllRowNodes(e),this.rowModel.forEachNode(t=>{t.stub||t.selectThisNode(!1,void 0,e.source)});const t={type:r.sVA.EVENT_SELECTION_CHANGED,source:e.source};this.eventService.dispatchEvent(t)}getSelectAllState(e,t){return this.selectionStrategy.getSelectAllState(e,t)}updateGroupsFromChildrenSelections(e,t){return!1}getBestCostNodeSelection(){console.warn("AG Grid: calling gridApi.getBestCostNodeSelection() is only possible when using rowModelType=`clientSide`.")}filterFromSelection(){}};ZT([(0,r.dsm)("rowModel")],mD.prototype,"rowModel",2),ZT([r.o7C],mD.prototype,"init",1),mD=ZT([(0,r.dR4)("selectionService")],mD);var fD=class extends r.pkb{constructor(){super(...arguments),this.queuedRowIds=new Set}postConstruct(){super.postConstruct(),this.addManagedListener(this.eventService,r.sVA.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>{this.queuedRowIds.clear()})}checkOpenByDefault(e){if(!e.isExpandable())return;if(this.queuedRowIds.has(e.id))return this.queuedRowIds.delete(e.id),void e.setExpanded(!0);const t=this.gos.getCallback("isServerSideGroupOpenByDefault");t&&t({data:e.data,rowNode:e})&&e.setExpanded(!0)}expandRows(e){e.forEach(e=>{const t=this.serverSideRowModel.getRowNode(e);t?t.setExpanded(!0):this.queuedRowIds.add(e)})}expandAll(e){this.serverSideRowModel.expandAll(e)}onGroupExpandedOrCollapsed(){}};ZT([(0,r.dsm)("rowModel")],fD.prototype,"serverSideRowModel",2),fD=ZT([(0,r.dR4)("expansionService")],fD);var yD={version:"31.3.4",moduleName:r.zsj.ServerSideRowModelModule,rowModel:"serverSide",beans:[sD,lD,cD,rD,nD,oD,aD,hD,dD,uD,mD,fD,eD],dependantModules:[mf]},vD=Object.defineProperty,CD=Object.getOwnPropertyDescriptor,bD=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?CD(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&vD(t,i,n),n},SD=class{constructor(e,t,i,s,r,n,o,a,l,c,h){this.rowModel=e,this.filterParams=t,this.createKey=i,this.caseFormat=s,this.columnModel=r,this.valueService=n,this.treeDataOrGrouping=o,this.treeData=a,this.getDataPath=l,this.groupAllowUnbalanced=c,this.addManagedListener=h}extractUniqueValuesAsync(e,t){return new r.oY$(i=>{if(this.rowModel.isRowDataLoaded())i(this.extractUniqueValues(e,t));else{const s=this.addManagedListener(r.sVA.EVENT_ROW_COUNT_READY,()=>{null==s||s(),i(this.extractUniqueValues(e,t))})}})}extractUniqueValues(e,t){const i=new Map,s=this.extractExistingFormattedKeys(t),n=new Set,o=this.treeData&&!!this.getDataPath,a=this.columnModel.getRowGroupColumns(),l=(e,o)=>{const a=this.caseFormat(e);if(!n.has(a)){n.add(a);let l=e,c=r._.makeNull(o);const h=null==s?void 0:s.get(a);null!=h&&(l=h,c=t.get(h)),i.set(l,c)}};return this.rowModel.forEachLeafNode(t=>{if(!t.data||!e(t))return;if(this.treeDataOrGrouping)return void this.addValueForTreeDataOrGrouping(t,o,a,l);let i=this.getValue(t);this.filterParams.convertValuesToStrings?this.addValueForConvertValuesToString(t,i,l):null!=i&&Array.isArray(i)?(i.forEach(e=>{l(this.createKey(e,t),e)}),0===i.length&&l(null,null)):l(this.createKey(i,t),i)}),i}addValueForConvertValuesToString(e,t,i){const s=this.createKey(t,e);null!=s&&Array.isArray(s)?(s.forEach(e=>{const t=r._.toStringOrNull(r._.makeNull(e));i(t,t)}),0===s.length&&i(null,null)):i(s,s)}addValueForTreeDataOrGrouping(e,t,i,s){var n;let o;if(t){if(null==(n=e.childrenAfterGroup)?void 0:n.length)return;o=this.getDataPath(e.data)}else o=i.map(t=>this.valueService.getKeyForNode(t,e)),o.push(this.getValue(e));o&&(o=o.map(e=>r._.toStringOrNull(r._.makeNull(e)))),!t&&this.groupAllowUnbalanced&&(null==o?void 0:o.some(e=>null==e))&&(o=o.filter(e=>null!=e)),s(this.createKey(o),o)}getValue(e){return this.filterParams.getValue(e)}extractExistingFormattedKeys(e){if(!e)return null;const t=new Map;return e.forEach((e,i)=>{t.set(this.caseFormat(i),i)}),t}},wD=class{};wD.SELECT_ALL="__AG_SELECT_ALL__",wD.ADD_SELECTION_TO_FILTER="__AG_ADD_SELECTION_TO_FILTER__";var xD=class{constructor(e,t,i,s){this.valueService=e,this.valueFormatter=t,this.formatter=i,this.column=s,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,i){this.displayedKeys=Array.from(i)}updateDisplayedValuesToMatchMiniFilter(e,t,i,s,r){this.displayedKeys=[];for(let t of i)if(null==t)r&&this.displayedKeys.push(t);else{const i=e(t),r=this.valueService.formatValue(this.column,null,i,this.valueFormatter,!1);s(this.formatter(r))&&this.displayedKeys.push(t)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return wD.SELECT_ALL}getAddSelectionToFilterItem(){return wD.ADD_SELECTION_TO_FILTER}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}},ED=class e{constructor(e,t,i,s){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=i,this.treeDataOrGrouping=s,this.allDisplayedItemsTree=[],this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:wD.SELECT_ALL,children:this.allDisplayedItemsTree,expanded:!0,key:wD.SELECT_ALL,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:wD.ADD_SELECTION_TO_FILTER,expanded:!0,key:wD.ADD_SELECTION_TO_FILTER,parentTreeKeys:[]}}updateDisplayedValuesToAllAvailable(e,t,i,s){"reload"===s?this.generateItemTree(e,t,i):"otherFilter"===s?(this.updateAvailable(i),this.updateExpandAll()):"miniFilter"===s&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,i,s,r,n){"reload"===n?this.generateItemTree(e,t,i):"otherFilter"===n&&this.updateAvailable(i),this.updateFilter(s,r),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,i){var s;this.allDisplayedItemsTree=[],this.groupsExist=!1;const r=this.getTreeListPathGetter(e,i);for(let n of t){const t=null!=(s=r(e(n)))?s:[null];t.length>1&&(this.groupsExist=!0);const o=i.has(n);let a,l=this.allDisplayedItemsTree,c=[];t.forEach((e,i)=>{l||(l=[],a.children=l),a=l.find(t=>{var i;return(null==(i=t.treeKey)?void 0:i.toUpperCase())===(null==e?void 0:e.toUpperCase())}),a||(a={treeKey:e,depth:i,filterPasses:!0,expanded:!1,available:o,parentTreeKeys:c},i===t.length-1&&(a.key=n),l.push(a)),l=a.children,c=[...c,e]})}this.updateAvailable(i),this.selectAllItem.children=this.allDisplayedItemsTree,this.selectAllItem.expanded=!1}getTreeListPathGetter(t,i){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return e=>e;let s=!1;for(const e of i){const i=t(e);if(i instanceof Date){s=!0;break}if(null!=i)break}return s?e.DATE_TREE_LIST_PATH_GETTER:(r._.warnOnce("property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date."),e=>[String(e)])}flattenItems(){this.activeDisplayedItemsFlat=[];const e=t=>{t.forEach(t=>{t.filterPasses&&t.available&&(this.activeDisplayedItemsFlat.push(t),t.children&&t.expanded&&e(t.children))})};e(this.allDisplayedItemsTree)}resetFilter(){const e=t=>{t.children&&t.children.forEach(t=>{e(t)}),t.filterPasses=!0};this.allDisplayedItemsTree.forEach(t=>e(t))}updateFilter(e,t){const i=i=>!!i.available&&(null==i.treeKey?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey)));this.allDisplayedItemsTree.forEach(e=>this.recursiveItemCheck(e,!1,i,"filterPasses"))}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){const e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){const t=(i,s)=>{i.children?i.expanded&&s||i.children.forEach(e=>{e.filterPasses&&t(e,!1)}):e(i.key)};this.activeDisplayedItemsFlat.forEach(e=>t(e,!0))}someDisplayedKey(e){const t=(i,s)=>i.children?(!i.expanded||!s)&&i.children.some(e=>!!e.filterPasses&&t(e,!1)):e(i.key);return this.activeDisplayedItemsFlat.some(e=>t(e,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){const e=(t,i,s)=>{for(const r of t){if(!r.filterPasses||!r.available||!r.children)continue;if(i=i||!!r.expanded,s=s||!r.expanded,i&&s)return;const t=e(r.children,i,s);if(void 0===t)return;t?i=!0:s=!0}return i&&s?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,i,s){let r=!1;e.children&&e.children.forEach(n=>{const o=this.recursiveItemCheck(n,t||i(e),i,s);r=r||o});const n=t||r||i(e);return e[s]=n,n}updateAvailable(e){const t=t=>e.has(t.key);this.allDisplayedItemsTree.forEach(e=>this.recursiveItemCheck(e,!1,t,"available"))}};ED.DATE_TREE_LIST_PATH_GETTER=e=>e?[String(e.getFullYear()),String(e.getMonth()+1),String(e.getDate())]:null;var MD=ED,AD=class{constructor({caseFormat:e}){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1,this.caseFormat=e}allFilteringKeys(){return this.filteringKeys}allFilteringKeysCaseFormatted(){return this.filteringKeysCaseFormatted}noAppliedFilteringKeys(){return this.hasNoAppliedFilteringKeys}setFilteringKeys(e){this.filteringKeys=new Set(e),this.hasNoAppliedFilteringKeys=!this.filteringKeys||0===this.filteringKeys.size,this.filteringKeysCaseFormatted=new Set,this.filteringKeys.forEach(e=>this.filteringKeysCaseFormatted.add(this.caseFormat(e)))}addFilteringKey(e){null==this.filteringKeys&&(this.filteringKeys=new Set,this.filteringKeysCaseFormatted=new Set),this.filteringKeys.add(e),this.filteringKeysCaseFormatted.add(this.caseFormat(e)),this.hasNoAppliedFilteringKeys&&(this.hasNoAppliedFilteringKeys=!1)}hasCaseFormattedFilteringKey(e){return this.filteringKeysCaseFormatted.has(this.caseFormat(e))}hasFilteringKey(e){return this.filteringKeys.has(e)}reset(){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1}},TD=class e{constructor(e){this.localEventService=new r.USV,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.providedValues=null,this.allValues=new Map,this.availableKeys=new Set,this.selectedKeys=new Set,this.initialised=!1;const{usingComplexObjects:t,columnModel:i,valueService:s,treeDataTreeList:n,groupingTreeList:o,filterParams:a,gos:l,valueFormatter:c,addManagedListener:h}=e,{column:d,colDef:u,textFormatter:p,doesRowPassOtherFilter:g,suppressSorting:m,comparator:f,rowModel:y,values:v,caseSensitive:C,convertValuesToStrings:b,treeList:S,treeListPathGetter:w,treeListFormatter:x}=a;this.filterParams=a,this.gos=l,this.setIsLoading=e.setIsLoading,this.translate=e.translate,this.caseFormat=e.caseFormat,this.createKey=e.createKey,this.usingComplexObjects=!!e.usingComplexObjects,this.formatter=p||r.U$F.DEFAULT_FORMATTER,this.doesRowPassOtherFilters=g,this.suppressSorting=m||!1,this.convertValuesToStrings=!!b,this.filteringKeys=new AD({caseFormat:this.caseFormat});const E=null!=f?f:u.comparator,M=!!n||!!o;this.compareByValue=!!(t&&E||M||S&&!w),this.entryComparator=M&&!E?this.createTreeDataOrGroupingComparator():!S||w||E?([e,t],[i,s])=>E(t,s):([e,t],[i,s])=>r._.defaultComparator(t,s),this.keyComparator=null!=E?E:r._.defaultComparator,this.caseSensitive=!!C;const A=l.get("getDataPath"),T=l.get("groupAllowUnbalanced");"clientSide"===y.getType()&&(this.clientSideValuesExtractor=new SD(y,this.filterParams,this.createKey,this.caseFormat,i,s,M,!!n,A,T,h)),null==v?this.valuesType=2:(this.valuesType=Array.isArray(v)?0:1,this.providedValues=v),this.displayValueModel=S?new MD(this.formatter,w,x,n||o):new xD(s,c,this.formatter,d),this.updateAllValues().then(e=>this.resetSelectionState(e||[]))}addEventListener(e,t,i){this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService.removeEventListener(e,t,i)}updateOnParamsChange(e){return new r.oY$(t=>{const{values:i,textFormatter:s,suppressSorting:n}=e,o=this.providedValues,a=this.suppressSorting;if(this.filterParams=e,this.formatter=s||r.U$F.DEFAULT_FORMATTER,this.suppressSorting=n||!1,this.providedValues=null!=i?i:null,this.providedValues!==o||this.suppressSorting!==a){i&&0!==i.length?this.valuesType=Array.isArray(i)?0:1:(this.valuesType=2,this.providedValues=null);const e=this.getModel();this.updateAllValues().then(i=>{this.setModel(e).then(()=>t())})}else t()})}refreshValues(){return new r.oY$(e=>{this.allValuesPromise.then(()=>{const t=this.getModel();this.updateAllValues(),this.setModel(t).then(()=>e())})})}overrideValues(e){return new r.oY$(t=>{this.allValuesPromise.then(()=>{this.valuesType=0,this.providedValues=e,this.refreshValues().then(()=>t())})})}refreshAfterAnyFilterChanged(){return this.showAvailableOnly()?this.allValuesPromise.then(e=>(this.updateAvailableKeys(null!=e?e:[],"otherFilter"),!0)):r.oY$.resolve(!1)}isInitialised(){return this.initialised}updateAllValues(){return this.allValuesPromise=new r.oY$(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync(!1).then(t=>e(this.processAllValues(t)));break;case 0:e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break;case 1:{this.setIsLoading(!0);const t=this.providedValues,{column:i,colDef:s}=this.filterParams,r=this.gos.addGridCommonParams({success:t=>{this.setIsLoading(!1),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(t))))},colDef:s,column:i});window.setTimeout(()=>t(r),0);break}default:throw new Error("Unrecognised valuesType")}}),this.allValuesPromise.then(e=>this.updateAvailableKeys(e||[],"reload")).then(()=>this.initialised=!0),this.allValuesPromise}processAllValues(e){const t=this.sortKeys(e);return this.allValues=null!=e?e:new Map,t}validateProvidedValues(e){if(this.usingComplexObjects&&(null==e?void 0:e.length)){const t=e[0];t&&"object"!=typeof t&&"function"!=typeof t&&(null==this.createKey(t)?r._.warnOnce("Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects or set convertValuesToStrings=true in the filterParams. See https://www.ag-grid.com/javascript-data-grid/filter-set-filter-list/#filter-value-types"):r._.warnOnce("Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects or enable convertValuesToStrings?"))}return e}setValuesType(e){this.valuesType=e}getValuesType(){return this.valuesType}isKeyAvailable(e){return this.availableKeys.has(e)}showAvailableOnly(){return 2===this.valuesType}updateAvailableKeys(t,i){const s=this.showAvailableOnly()?this.sortKeys(this.getValuesFromRows(!0)):t;this.availableKeys=new Set(s),this.localEventService.dispatchEvent({type:e.EVENT_AVAILABLE_VALUES_CHANGED}),this.updateDisplayedValues(i,t)}sortKeys(e){const t=null!=e?e:new Map;if(this.suppressSorting)return Array.from(t.keys());let i;return i=this.compareByValue?Array.from(t.entries()).sort(this.entryComparator).map(([e])=>e):Array.from(t.keys()).sort(this.keyComparator),this.filterParams.excelMode&&t.has(null)&&(i=i.filter(e=>null!=e),i.push(null)),i}getParamsForValuesFromRows(e=!1){return this.clientSideValuesExtractor?{predicate:t=>!e||this.doesRowPassOtherFilters(t),existingValues:e&&!this.caseSensitive?this.allValues:void 0}:(r._.doOnce(()=>{console.error("AG Grid: Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values")},"setFilterValueNotCSRM"),null)}getValuesFromRows(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValues(t.predicate,t.existingValues):null}getValuesFromRowsAsync(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValuesAsync(t.predicate,t.existingValues):r.oY$.resolve(null)}setMiniFilter(e){return e=r._.makeNull(e),this.miniFilterText!==e&&(null===e&&this.setAddCurrentSelectionToFilter(!1),this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0)}getMiniFilter(){return this.miniFilterText}updateDisplayedValues(e,t){if("expansion"===e)return void this.displayValueModel.refresh();if(null==this.miniFilterText)return void this.displayValueModel.updateDisplayedValuesToAllAvailable(e=>this.getValue(e),t,this.availableKeys,e);const i=this.caseFormat(this.formatter(this.miniFilterText)||""),s=e=>null!=e&&this.caseFormat(e).indexOf(i)>=0,r=!!this.filterParams.excelMode&&s(this.translate("blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(e=>this.getValue(e),t,this.availableKeys,s,r,e)}getDisplayedValueCount(){return this.displayValueModel.getDisplayedValueCount()}getDisplayedItem(e){return this.displayValueModel.getDisplayedItem(e)}getSelectAllItem(){return this.displayValueModel.getSelectAllItem()}getAddSelectionToFilterItem(){return this.displayValueModel.getAddSelectionToFilterItem()}hasSelections(){return this.filterParams.defaultToNothingSelected?this.selectedKeys.size>0:this.allValues.size!==this.selectedKeys.size}getKeys(){return Array.from(this.allValues.keys())}getValues(){return Array.from(this.allValues.values())}getValue(e){return this.allValues.get(e)}setAddCurrentSelectionToFilter(e){this.addCurrentSelectionToFilter=e}isInWindowsExcelMode(){return"windows"===this.filterParams.excelMode}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&r._.exists(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){null==this.miniFilterText?this.selectedKeys=new Set(this.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.add(e)))}deselectAllMatchingMiniFilter(){null==this.miniFilterText?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}selectKey(e){this.selectedKeys.add(e)}deselectKey(e){this.filterParams.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e)}isKeySelected(e){return this.selectedKeys.has(e)}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.isKeySelected(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.isKeySelected(e))}getModel(){if(!this.hasSelections())return null;const e=this.isAddCurrentSelectionToFilterChecked()?this.filteringKeys.allFilteringKeys():null;if(e&&e.size>0){if(this.selectedKeys){const t=new Set([...Array.from(e),...Array.from(this.selectedKeys).filter(t=>!e.has(t))]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setModel(e){return this.allValuesPromise.then(t=>{if(null==e)this.resetSelectionState(null!=t?t:[]);else{this.selectedKeys.clear();const t=new Map;this.allValues.forEach((e,i)=>{t.set(this.caseFormat(i),i)}),e.forEach(e=>{const i=this.caseFormat(r._.makeNull(e)),s=t.get(i);void 0!==s&&this.selectKey(s)})}})}uniqueValues(e){const t=new Map,i=new Set;return(null!=e?e:[]).forEach(e=>{const s=r._.makeNull(e),n=this.convertAndGetKey(s),o=this.caseFormat(n);i.has(o)||(i.add(o),t.set(n,s))}),t}convertAndGetKey(e){return this.convertValuesToStrings?e:this.createKey(e)}resetSelectionState(e){this.filterParams.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}hasGroups(){return this.displayValueModel.hasGroups()}createTreeDataOrGroupingComparator(){return([e,t],[i,s])=>{if(null==t)return null==s?0:-1;if(null==s)return 1;for(let e=0;e<t.length;e++){if(e>=s.length)return 1;const i=r._.defaultComparator(t[e],s[e]);if(0!==i)return i}return 0}}setAppliedModelKeys(e){this.filteringKeys.setFilteringKeys(e)}addToAppliedModelKeys(e){this.filteringKeys.addFilteringKey(e)}getAppliedModelKeys(){return this.filteringKeys.allFilteringKeys()}getCaseFormattedAppliedModelKeys(){return this.filteringKeys.allFilteringKeysCaseFormatted()}hasAppliedModelKey(e){return this.filteringKeys.hasCaseFormattedFilteringKey(e)}hasAnyAppliedModelKey(){return!this.filteringKeys.noAppliedFilteringKeys()}};TD.EVENT_AVAILABLE_VALUES_CHANGED="availableValuesChanged";var DD=TD,ID=class e extends r.uAl{constructor(t){var i;super(t.isGroup?e.GROUP_TEMPLATE:e.TEMPLATE),this.focusWrapper=t.focusWrapper,this.value=t.value,this.params=t.params,this.translate=t.translate,this.valueFormatter=t.valueFormatter,this.item=t.item,this.isSelected=t.isSelected,this.isTree=t.isTree,this.depth=null!=(i=t.depth)?i:0,this.isGroup=t.isGroup,this.groupsExist=t.groupsExist,this.isExpanded=t.isExpanded,this.hasIndeterminateExpandState=t.hasIndeterminateExpandState}init(){this.addDestroyFunc(()=>{var e;return null==(e=this.destroyCellRendererComponent)?void 0:e.call(this)}),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree&&(this.depth>0&&this.addCssClass("ag-set-filter-indent-"+this.depth),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCssClass("ag-set-filter-add-group-indent"),r._.setAriaLevel(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),this.params.readOnly||this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){this.eGroupClosedIcon.appendChild(r._.createIcon("setFilterGroupClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(r._.createIcon("setFilterGroupOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.hasIndeterminateExpandState&&(this.eGroupIndeterminateIcon.appendChild(r._.createIcon("setFilterGroupIndeterminate",this.gos,null)),this.addManagedListener(this.eGroupIndeterminateIcon,"click",this.onExpandOrContractClicked.bind(this))),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(t,i){if(this.isGroup&&t!==this.isExpanded){this.isExpanded=t;const s={type:e.EVENT_EXPANDED_CHANGED,isExpanded:!!t,item:this.item};i||this.dispatchEvent(s),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){r._.setDisplayed(this.eGroupClosedIcon,this.hasIndeterminateExpandState?!1===this.isExpanded:!this.isExpanded),r._.setDisplayed(this.eGroupOpenedIcon,!0===this.isExpanded),this.hasIndeterminateExpandState&&r._.setDisplayed(this.eGroupIndeterminateIcon,void 0===this.isExpanded)}onCheckboxChanged(t){this.isSelected=t;const i={type:e.EVENT_SELECTION_CHANGED,isSelected:t,item:this.item};this.dispatchEvent(i),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){this.params.readOnly||this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;const e=this.localeService.getLocaleTextFunc(),t=this.eCheckbox.getValue(),i=void 0===t?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),s=e("ariaToggleVisibility","Press SPACE to toggle visibility");r._.setAriaLabelledBy(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}setupFixedAriaLabels(e){if(!this.isTree)return;const t=this.localeService.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();r._.setAriaLabel(i,`${e} ${t}`),r._.setAriaDescribedBy(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){const e=this.getAriaElement();r._.setAriaChecked(e,this.eCheckbox.getValue())}refreshAriaExpanded(){r._.setAriaExpanded(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,i){var s,r;if(this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(i,!0),this.valueFunction){const e=this.valueFunction();this.setTooltipAndCellRendererParams(e,e),this.cellRendererComponent||this.renderCellWithoutCellRenderer()}if(this.cellRendererComponent&&!(null==(r=(s=this.cellRendererComponent).refresh)?void 0:r.call(s,this.cellRendererParams))){const e=this.cellRendererComponent;this.renderCell(),this.destroyBean(e)}}render(){const{params:{column:e}}=this;let{value:t}=this,i=null;"function"==typeof t?(this.valueFunction=t,i=this.valueFunction(),t=i):i=this.isTree?r._.toStringOrNull(t):this.getFormattedValue(e,t),this.setTooltipAndCellRendererParams(t,i),this.renderCell()}setTooltipAndCellRendererParams(e,t){const i="whenTruncated"===this.gos.get("tooltipShowMode");if(this.params.showTooltips&&(!i||!this.params.cellRenderer)){const s=null!=t?t:r._.toStringOrNull(e);let n;i&&(n=()=>{const e=this.eCheckbox.getGui().querySelector(".ag-label");return!e||e.scrollWidth>e.clientWidth}),this.setTooltip({newTooltipText:s,location:"setFilterValue",getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,shouldDisplayTooltip:n})}this.cellRendererParams=this.gos.addGridCommonParams({value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,location:"setFilterValue",shouldDisplayTooltip:t})}})}getTooltipParams(){const e=super.getTooltipParams();return e.location="setFilterValue",e.colDef=this.getComponentHolder(),this.isTree&&(e.level=this.depth),e}getFormattedValue(e,t){return this.valueService.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){const e=this.userComponentFactory.getSetFilterCellRendererDetails(this.params,this.cellRendererParams),t=e?e.newAgStackInstance():void 0;null!=t?t.then(e=>{e&&(this.cellRendererComponent=e,this.eCheckbox.setLabel(e.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(e))}):this.renderCellWithoutCellRenderer()}renderCellWithoutCellRenderer(){var e;let t=null!=(e=null==this.cellRendererParams.valueFormatted?this.cellRendererParams.value:this.cellRendererParams.valueFormatted)?e:this.translate("blanks");"string"!=typeof t&&(r._.warnOnce(`Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects, or set convertValuesToStrings=true in the filterParams. See ${this.getFrameworkOverrides().getDocLink("filter-set-filter-list/#filter-value-types")}`),t=""),this.eCheckbox.setLabel(t),this.setupFixedAriaLabels(t)}getComponentHolder(){return this.params.column.getColDef()}};ID.EVENT_SELECTION_CHANGED="selectionChanged",ID.EVENT_EXPANDED_CHANGED="expandedChanged",ID.GROUP_TEMPLATE='\n        <div class="ag-set-filter-item" aria-hidden="true">\n            <span class="ag-set-filter-group-icons">\n                <span class="ag-set-filter-group-closed-icon" ref="eGroupClosedIcon"></span>\n                <span class="ag-set-filter-group-opened-icon" ref="eGroupOpenedIcon"></span>\n                <span class="ag-set-filter-group-indeterminate-icon" ref="eGroupIndeterminateIcon"></span>\n            </span>\n            <ag-checkbox ref="eCheckbox" class="ag-set-filter-item-checkbox"></ag-checkbox>\n        </div>',ID.TEMPLATE='\n        <div class="ag-set-filter-item">\n            <ag-checkbox ref="eCheckbox" class="ag-set-filter-item-checkbox"></ag-checkbox>\n        </div>',bD([(0,r.dsm)("valueService")],ID.prototype,"valueService",2),bD([(0,r.dsm)("userComponentFactory")],ID.prototype,"userComponentFactory",2),bD([(0,r.PIB)("eCheckbox")],ID.prototype,"eCheckbox",2),bD([(0,r.PIB)("eGroupOpenedIcon")],ID.prototype,"eGroupOpenedIcon",2),bD([(0,r.PIB)("eGroupClosedIcon")],ID.prototype,"eGroupClosedIcon",2),bD([(0,r.PIB)("eGroupIndeterminateIcon")],ID.prototype,"eGroupIndeterminateIcon",2),bD([r.o7C],ID.prototype,"init",1);var RD=ID,PD={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches."},kD=class{getModelAsString(e,t){const{values:i}=e||t.getModel()||{},s=t.getValueModel();if(null==i||null==s)return"";const r=i.filter(e=>s.isKeyAvailable(e)),n=r.length;return`(${n}) ${r.slice(0,10).map(e=>t.getFormattedValue(e)).join(",")}${n>10?",...":""}`}},LD=class extends r.Q5x{constructor(){super("setFilter"),this.valueModel=null,this.setFilterParams=null,this.virtualList=null,this.caseSensitive=!1,this.convertValuesToStrings=!1,this.treeDataTreeList=!1,this.groupingTreeList=!1,this.hardRefreshVirtualList=!1,this.noValueFormatterSupplied=!1,this.filterModelFormatter=new kD,this.updateSetFilterOnParamsChange=e=>{var t;this.setFilterParams=e,this.convertValuesToStrings=!!e.convertValuesToStrings,this.caseSensitive=!!e.caseSensitive;const i=null!=(t=e.keyCreator)?t:e.colDef.keyCreator;this.setValueFormatter(e.valueFormatter,i,this.convertValuesToStrings,!!e.treeList,!!e.colDef.refData);const s=e.column.getId().startsWith(r.JPk);this.treeDataTreeList=this.gos.get("treeData")&&!!e.treeList&&s,this.getDataPath=this.gos.get("getDataPath"),this.groupingTreeList=!!this.columnModel.getRowGroupColumns().length&&!!e.treeList&&s,this.createKey=this.generateCreateKey(i,this.convertValuesToStrings,this.treeDataTreeList||this.groupingTreeList)}}postConstruct(){super.postConstruct()}updateUiVisibility(){}createBodyTemplate(){return`\n            <div class="ag-set-filter">\n                <div ref="eFilterLoading" class="ag-filter-loading ag-hidden">${this.translateForSetFilter("loadingOoo")}</div>\n                <ag-input-text-field class="ag-mini-filter" ref="eMiniFilter"></ag-input-text-field>\n                <div ref="eFilterNoMatches" class="ag-filter-no-matches ag-hidden">${this.translateForSetFilter("noMatches")}</div>\n                <div ref="eSetFilterList" class="ag-set-filter-list" role="presentation"></div>\n            </div>`}handleKeyDown(e){if(super.handleKeyDown(e),!e.defaultPrevented)switch(e.key){case r.DDm.SPACE:this.handleKeySpace(e);break;case r.DDm.ENTER:this.handleKeyEnter(e);break;case r.DDm.LEFT:this.handleKeyLeft(e);break;case r.DDm.RIGHT:this.handleKeyRight(e)}}handleKeySpace(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.toggleSelected()}handleKeyEnter(e){if(!this.setFilterParams)return;const{excelMode:t,readOnly:i}=this.setFilterParams||{};t&&!i&&(e.preventDefault(),this.onBtApply(!1,!1,e),"mac"===this.setFilterParams.excelMode&&this.eMiniFilter.getInputElement().select())}handleKeyLeft(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.setExpanded(!1)}handleKeyRight(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.setExpanded(!0)}getComponentForKeyEvent(e){var t;if(!this.eSetFilterList.contains(this.gos.getActiveDomElement())||!this.virtualList)return;const i=this.virtualList.getLastFocusedRow();if(null==i)return;const s=this.virtualList.getComponentAt(i);if(null==s)return;e.preventDefault();const{readOnly:r}=null!=(t=this.setFilterParams)?t:{};return r?void 0:s}getCssIdentifier(){return"set-filter"}setModel(e){var t;return null==e&&null==(null==(t=this.valueModel)?void 0:t.getModel())?(this.setMiniFilter(null),r.oY$.resolve()):super.setModel(e)}refresh(e){var t,i,s;return!!super.refresh(e)&&(!["treeList","treeListFormatter","treeListPathGetter","keyCreator","convertValuesToStrings","caseSensitive","comparator","suppressSelectAll","excelMode"].some(t=>{var i;return e[t]!==(null==(i=this.setFilterParams)?void 0:i[t])})&&!this.haveColDefParamsChanged(e.colDef)&&(super.updateParams(e),this.updateSetFilterOnParamsChange(e),this.updateMiniFilter(),e.cellRenderer===(null==(t=this.setFilterParams)?void 0:t.cellRenderer)&&e.valueFormatter===(null==(i=this.setFilterParams)?void 0:i.valueFormatter)||this.checkAndRefreshVirtualList(),null==(s=this.valueModel)||s.updateOnParamsChange(e).then(()=>{var e;(null==(e=this.valueModel)?void 0:e.hasSelections())&&this.refreshFilterValues()}),!0))}haveColDefParamsChanged(e){var t;const i=null==(t=this.setFilterParams)?void 0:t.colDef;return["keyCreator","filterValueGetter"].some(t=>e[t]!==(null==i?void 0:i[t]))}setModelAndRefresh(e){return this.valueModel?this.valueModel.setModel(e).then(()=>this.checkAndRefreshVirtualList()):r.oY$.resolve()}resetUiToDefaults(){return this.setMiniFilter(null),this.setModelAndRefresh(null)}setModelIntoUi(e){this.setMiniFilter(null);const t=null==e?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getModel();return e?{values:e,filterType:this.getFilterType()}:null}getFilterType(){return"set"}getValueModel(){return this.valueModel}areModelsEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&r._.areEqual(e.values,t.values)}setParams(e){var t;this.applyExcelModeOptions(e),super.setParams(e),this.updateSetFilterOnParamsChange(e);const i=null!=(t=e.keyCreator)?t:e.colDef.keyCreator;this.valueModel=new DD({filterParams:e,setIsLoading:e=>this.setIsLoading(e),translate:e=>this.translateForSetFilter(e),caseFormat:e=>this.caseFormat(e),createKey:this.createKey,valueFormatter:this.valueFormatter,usingComplexObjects:!!i,gos:this.gos,columnModel:this.columnModel,valueService:this.valueService,treeDataTreeList:this.treeDataTreeList,groupingTreeList:this.groupingTreeList,addManagedListener:(e,t)=>this.addManagedListener(this.eventService,e,t)}),this.initialiseFilterBodyUi(),this.addEventListenersForDataChanges()}onAddCurrentSelectionToFilterChange(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setAddCurrentSelectionToFilter(e)}setValueFormatter(e,t,i,s,n){let o=e;if(!o){if(t&&!i&&!s)throw new Error("AG Grid: Must supply a Value Formatter in Set Filter params when using a Key Creator unless convertValuesToStrings is enabled");this.noValueFormatterSupplied=!0,n||(o=e=>r._.toStringOrNull(e.value))}this.valueFormatter=o}generateCreateKey(e,t,i){if(i&&!e)throw new Error("AG Grid: Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.");return e?(t,i=null)=>{const s=this.getKeyCreatorParams(t,i);return r._.makeNull(e(s))}:t?e=>Array.isArray(e)?e:r._.makeNull(r._.toStringOrNull(e)):e=>r._.makeNull(r._.toStringOrNull(e))}getFormattedValue(e){var t;let i=this.valueModel.getValue(e);this.noValueFormatterSupplied&&(this.treeDataTreeList||this.groupingTreeList)&&Array.isArray(i)&&(i=r._.last(i));const s=this.valueService.formatValue(this.setFilterParams.column,null,i,this.valueFormatter,!1);return null!=(t=null==s?r._.toStringOrNull(i):s)?t:this.translateForSetFilter("blanks")}applyExcelModeOptions(e){"windows"===e.excelMode?(e.buttons||(e.buttons=["apply","cancel"]),null==e.closeOnApply&&(e.closeOnApply=!0)):"mac"===e.excelMode&&(e.buttons||(e.buttons=["reset"]),null==e.applyMiniFilterWhileTyping&&(e.applyMiniFilterWhileTyping=!0),null==e.debounceMs&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,r._.warnOnce('The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.'))}addEventListenersForDataChanges(){this.isValuesTakenFromGrid()&&(this.addManagedListener(this.eventService,r.sVA.EVENT_CELL_VALUE_CHANGED,e=>{this.setFilterParams&&e.column===this.setFilterParams.column&&this.syncAfterDataChange()}),this.addManagedPropertyListeners(["treeData","getDataPath","groupAllowUnbalanced"],()=>{this.syncAfterDataChange()}))}syncAfterDataChange(){if(!this.valueModel)throw new Error("Value model has not been created.");return this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),this.onBtApply(!1,!0)})}setIsLoading(e){r._.setDisplayed(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter()}initVirtualList(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.localeService.getLocaleTextFunc()("ariaFilterList","Filter List"),t=!!this.setFilterParams.treeList,i=this.virtualList=this.createBean(new r.wjn({cssIdentifier:"filter",ariaRole:t?"tree":"listbox",listName:e})),s=this.getRefElement("eSetFilterList");t&&s.classList.add("ag-set-filter-tree-list"),s&&s.appendChild(i.getGui());const{cellHeight:n}=this.setFilterParams;let o;null!=n&&i.setRowHeight(n),i.setComponentCreator((e,i)=>this.createSetListItem(e,t,i)),i.setComponentUpdater((e,t)=>this.updateSetListItem(e,t)),o=this.setFilterParams.suppressSelectAll?new ND(this.valueModel):new _D(this.valueModel,()=>this.isSelectAllSelected()),t&&(o=new OD(o)),i.setModel(o)}getSelectAllLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=null!=this.valueModel.getMiniFilter()&&this.setFilterParams.excelMode?"selectAllSearchResults":"selectAll";return this.translateForSetFilter(e)}getAddSelectionToFilterLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.translateForSetFilter("addCurrentSelectionToFilter")}createSetListItem(e,t,i){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const s=this.valueModel.hasGroups(),{isSelected:r,isExpanded:n}=this.isSelectedExpanded(e),{value:o,depth:a,isGroup:l,hasIndeterminateExpandState:c,selectedListener:h,expandedListener:d}=this.newSetListItemAttributes(e,t),u={focusWrapper:i,value:o,params:this.setFilterParams,translate:e=>this.translateForSetFilter(e),valueFormatter:this.valueFormatter,item:e,isSelected:r,isTree:t,depth:a,groupsExist:s,isGroup:l,isExpanded:n,hasIndeterminateExpandState:c},p=this.createBean(new RD(u));return p.addEventListener(RD.EVENT_SELECTION_CHANGED,h),d&&p.addEventListener(RD.EVENT_EXPANDED_CHANGED,d),p}newSetTreeItemAttributes(e,t){var i,s,r,n,o,a;if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const l=this.valueModel.hasGroups();return e.key===wD.SELECT_ALL?{value:()=>this.getSelectAllLabel(),isGroup:l,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:e=>this.onSelectAll(e.isSelected),expandedListener:e=>this.onExpandAll(e.item,e.isExpanded)}:e.key===wD.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:e=>{this.onAddCurrentSelectionToFilterChange(e.isSelected)}}:e.children?{value:null!=(r=null==(s=(i=this.setFilterParams).treeListFormatter)?void 0:s.call(i,e.treeKey,e.depth,e.parentTreeKeys))?r:e.treeKey,depth:e.depth,isGroup:!0,selectedListener:e=>this.onGroupItemSelected(e.item,e.isSelected),expandedListener:e=>this.onExpandedChanged(e.item,e.isExpanded)}:{value:null!=(a=null==(o=(n=this.setFilterParams).treeListFormatter)?void 0:o.call(n,e.treeKey,e.depth,e.parentTreeKeys))?a:e.treeKey,depth:e.depth,selectedListener:e=>this.onItemSelected(e.item.key,e.isSelected)}}newSetListItemAttributes(e,t){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e,t):e===wD.SELECT_ALL?{value:()=>this.getSelectAllLabel(),selectedListener:e=>this.onSelectAll(e.isSelected)}:e===wD.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:e=>{this.onAddCurrentSelectionToFilterChange(e.isSelected)}}:{value:this.valueModel.getValue(e),selectedListener:e=>this.onItemSelected(e.item,e.isSelected)}}updateSetListItem(e,t){const{isSelected:i,isExpanded:s}=this.isSelectedExpanded(e);t.refresh(e,i,s)}isSelectedExpanded(e){let t,i;return this.isSetFilterModelTreeItem(e)?(i=e.expanded,t=e.key===wD.SELECT_ALL?this.isSelectAllSelected():e.key===wD.ADD_SELECTION_TO_FILTER?this.valueModel.isAddCurrentSelectionToFilterChecked():e.children?this.areAllChildrenSelected(e):this.valueModel.isKeySelected(e.key)):t=e===wD.SELECT_ALL?this.isSelectAllSelected():e===wD.ADD_SELECTION_TO_FILTER?this.valueModel.isAddCurrentSelectionToFilterChecked():this.valueModel.isKeySelected(e),{isSelected:t,isExpanded:i}}isSetFilterModelTreeItem(e){return void 0!==(null==e?void 0:e.treeKey)}initMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e,localeService:t}=this,i=t.getLocaleTextFunc();e.setDisplayed(!this.setFilterParams.suppressMiniFilter),e.setValue(this.valueModel.getMiniFilter()),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(i("ariaSearchFilterValues","Search filter values")),this.addManagedListener(e.getInputElement(),"keydown",e=>this.onMiniFilterKeyDown(e))}updateMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e}=this;e.isDisplayed()!==!this.setFilterParams.suppressMiniFilter&&e.setDisplayed(!this.setFilterParams.suppressMiniFilter);const t=this.valueModel.getMiniFilter();e.getValue()!==t&&e.setValue(t)}afterGuiAttached(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(this.translateForSetFilter("searchOoo")),e&&e.suppressFocus||t.getFocusableElement().focus()}afterGuiDetached(){var e,t;super.afterGuiDetached(),(null==(e=this.setFilterParams)?void 0:e.excelMode)&&this.resetMiniFilter();const i=this.getModel();!(null==(t=this.setFilterParams)?void 0:t.excelMode)&&this.areModelsEqual(i,this.getModelFromUi())||(this.resetUiToActiveModel(i),this.showOrHideResults())}applyModel(e="api"){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");this.setFilterParams.excelMode&&"rowDataUpdated"!==e&&this.valueModel.isEverythingVisibleSelected()&&this.valueModel.selectAllMatchingMiniFilter();const t=this.valueModel.showAddCurrentSelectionToFilter()&&this.valueModel.isAddCurrentSelectionToFilterChecked();if(t&&!this.getModel())return!1;const i=super.applyModel(e),s=this.getModel();return s?(t||this.valueModel.setAppliedModelKeys(new Set),s.values.forEach(e=>{this.valueModel.addToAppliedModelKeys(e)})):t||this.valueModel.setAppliedModelKeys(null),i}isModelValid(e){return!this.setFilterParams||!this.setFilterParams.excelMode||null==e||e.values.length>0}doesFilterPass(e){if(!this.setFilterParams||!this.valueModel||!this.valueModel.getCaseFormattedAppliedModelKeys())return!0;if(!this.valueModel.hasAnyAppliedModelKey())return!1;const{node:t,data:i}=e;if(this.treeDataTreeList)return this.doesFilterPassForTreeData(t,i);if(this.groupingTreeList)return this.doesFilterPassForGrouping(t);let s=this.getValueFromNode(t);return this.convertValuesToStrings?this.doesFilterPassForConvertValuesToString(t,s):null!=s&&Array.isArray(s)?0===s.length?this.valueModel.hasAppliedModelKey(null):s.some(e=>this.isInAppliedModel(this.createKey(e,t))):this.isInAppliedModel(this.createKey(s,t))}doesFilterPassForConvertValuesToString(e,t){const i=this.createKey(t,e);return null!=i&&Array.isArray(i)?0===i.length?this.valueModel.hasAppliedModelKey(null):i.some(e=>this.isInAppliedModel(e)):this.isInAppliedModel(i)}doesFilterPassForTreeData(e,t){var i;return!(null==(i=e.childrenAfterGroup)?void 0:i.length)&&this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(this.getDataPath(t))))}doesFilterPassForGrouping(e){const t=this.columnModel.getRowGroupColumns().map(t=>this.valueService.getKeyForNode(t,e));return t.push(this.getValueFromNode(e)),this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(t)))}checkMakeNullDataPath(e){return e&&(e=e.map(e=>r._.toStringOrNull(r._.makeNull(e)))),(null==e?void 0:e.some(e=>null==e))?null:e}isInAppliedModel(e){return this.valueModel.hasAppliedModelKey(e)}getValueFromNode(e){return this.setFilterParams.getValue(e)}getKeyCreatorParams(e,t=null){return{value:e,colDef:this.setFilterParams.colDef,column:this.setFilterParams.column,node:t,data:null==t?void 0:t.data,api:this.setFilterParams.api,columnApi:this.setFilterParams.columnApi,context:this.setFilterParams.context}}onNewRowsLoaded(){this.isValuesTakenFromGrid()&&this.syncAfterDataChange()}isValuesTakenFromGrid(){return!!this.valueModel&&2===this.valueModel.getValuesType()}setFilterValues(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.overrideValues(e).then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}resetFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setValuesType(2),this.syncAfterDataChange()}refreshFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.isInitialised()&&this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}onAnyFilterChanged(){setTimeout(()=>{if(this.isAlive()){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.refreshAfterAnyFilterChanged().then(e=>{e&&(this.checkAndRefreshVirtualList(),this.showOrHideResults())})}},0)}onMiniFilterInput(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.valueModel.setMiniFilter(this.eMiniFilter.getValue()))return;const{applyMiniFilterWhileTyping:e,readOnly:t}=this.setFilterParams||{};!t&&e?this.filterOnAllVisibleValues(!1):this.updateUiAfterMiniFilterChange()}updateUiAfterMiniFilterChange(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{excelMode:e,readOnly:t}=this.setFilterParams||{};null==e||t?this.checkAndRefreshVirtualList():null==this.valueModel.getMiniFilter()?this.resetUiToActiveModel(this.getModel()):(this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged()),this.showOrHideResults()}showOrHideResults(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=null!=this.valueModel.getMiniFilter()&&this.valueModel.getDisplayedValueCount()<1;r._.setDisplayed(this.eNoMatches,e),r._.setDisplayed(this.eSetFilterList,!e)}resetMiniFilter(){var e;this.eMiniFilter.setValue(null,!0),null==(e=this.valueModel)||e.setMiniFilter(null)}resetUiToActiveModel(e,t){this.setModelAndRefresh(null==e?null:e.values).then(()=>{this.onUiChanged(!1,"prevent"),null==t||t()})}handleCancelEnd(e){this.setMiniFilter(null),super.handleCancelEnd(e)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:i}=this.setFilterParams||{};e.key!==r.DDm.ENTER||t||i||this.filterOnAllVisibleValues()}filterOnAllVisibleValues(e=!0){const{readOnly:t}=this.setFilterParams||{};if(!this.valueModel)throw new Error("Value model has not been created.");if(t)throw new Error("Unable to filter in readOnly mode.");this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged(!1,e?"immediately":"debounce"),this.showOrHideResults()}focusRowIfAlive(e){null!=e&&window.setTimeout(()=>{if(!this.virtualList)throw new Error("Virtual list has not been created.");this.isAlive()&&this.virtualList.focusRow(e)},0)}onSelectAll(e){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");e?this.valueModel.selectAllMatchingMiniFilter():this.valueModel.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const i=e=>{e.children?e.children.forEach(e=>i(e)):this.selectItem(e.key,t)};i(e),this.refreshAfterSelection()}onItemSelected(e,t){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");this.selectItem(e,t),this.refreshAfterSelection()}selectItem(e,t){t?this.valueModel.selectKey(e):this.valueModel.deselectKey(e)}onExpandAll(e,t){const i=e=>{e.filterPasses&&e.available&&e.children&&(e.children.forEach(e=>i(e)),e.expanded=t)};i(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.valueModel.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e){this.eMiniFilter.setValue(e),this.onMiniFilterInput()}getMiniFilter(){return this.valueModel?this.valueModel.getMiniFilter():null}checkAndRefreshVirtualList(){if(!this.virtualList)throw new Error("Virtual list has not been created.");this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return this.valueModel?this.valueModel.getKeys():[]}getFilterValues(){return this.valueModel?this.valueModel.getValues():[]}getValues(){return this.getFilterKeys()}refreshVirtualList(){this.setFilterParams&&this.setFilterParams.refreshValuesOnOpen?this.refreshFilterValues():this.checkAndRefreshVirtualList()}translateForSetFilter(e){return this.localeService.getLocaleTextFunc()(e,PD[e])}isSelectAllSelected(){if(!this.setFilterParams||!this.valueModel)return!1;if(this.setFilterParams.defaultToNothingSelected){if(this.valueModel.hasSelections()&&this.valueModel.isEverythingVisibleSelected())return!0;if(this.valueModel.isNothingVisibleSelected())return!1}else{if(this.valueModel.hasSelections()&&this.valueModel.isNothingVisibleSelected())return!1;if(this.valueModel.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=e=>{if(e.children){let i=!1,s=!1;return e.children.some(e=>{if(!e.filterPasses||!e.available)return!1;const r=t(e);return void 0===r||(r?i=!0:s=!0,i&&s)})?void 0:i}return this.valueModel.isKeySelected(e.key)};return this.setFilterParams.defaultToNothingSelected?this.valueModel.hasSelections()&&t(e):t(e)}destroy(){null!=this.virtualList&&(this.virtualList.destroy(),this.virtualList=null),super.destroy()}caseFormat(e){return null==e||"string"!=typeof e||this.caseSensitive?e:e.toUpperCase()}resetExpansion(){var e,t;if(!(null==(e=this.setFilterParams)?void 0:e.treeList))return;const i=null==(t=this.valueModel)?void 0:t.getSelectAllItem();if(this.isSetFilterModelTreeItem(i)){const e=t=>{t.children&&(t.children.forEach(t=>e(t)),t.expanded=!1)};e(i),this.valueModel.updateDisplayedValues("expansion")}}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e,this)}getPositionableElement(){return this.eSetFilterList}};bD([(0,r.PIB)("eMiniFilter")],LD.prototype,"eMiniFilter",2),bD([(0,r.PIB)("eFilterLoading")],LD.prototype,"eFilterLoading",2),bD([(0,r.PIB)("eSetFilterList")],LD.prototype,"eSetFilterList",2),bD([(0,r.PIB)("eFilterNoMatches")],LD.prototype,"eNoMatches",2),bD([(0,r.dsm)("columnModel")],LD.prototype,"columnModel",2),bD([(0,r.dsm)("valueService")],LD.prototype,"valueService",2);var ND=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},_D=class{constructor(e,t){this.model=e,this.isSelectAllSelected=t}getRowCount(){const e=this.model.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+e}getRow(e){if(0===e)return this.model.getSelectAllItem();const t=this.model.showAddCurrentSelectionToFilter(),i=t?2:1;return 1===e&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-i)}areRowsEqual(e,t){return e===t}},OD=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&e.treeKey===t.treeKey&&e.depth===t.depth}},FD=class extends r.uAl{constructor(){super('\n            <div class="ag-floating-filter-input ag-set-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>'),this.availableValuesListenerAdded=!1,this.filterModelFormatter=new kD}destroy(){super.destroy()}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof LD))throw new Error("AG Grid - SetFloatingFilter expects SetFilter as its parent");e(t)})}addAvailableValuesListener(){this.parentSetFilterInstance(e=>{const t=e.getValueModel();t&&this.addManagedListener(t,DD.EVENT_AVAILABLE_VALUES_CHANGED,()=>this.updateFloatingFilterText())}),this.availableValuesListenerAdded=!0}updateFloatingFilterText(e){this.availableValuesListenerAdded||this.addAvailableValuesListener(),this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(this.filterModelFormatter.getModelAsString(e,t))})}};bD([(0,r.PIB)("eFloatingFilterText")],FD.prototype,"eFloatingFilterText",2),bD([(0,r.dsm)("columnModel")],FD.prototype,"columnModel",2);var GD={version:"31.3.4",moduleName:r.zsj.SetFilterModule,beans:[],userComponents:[{componentName:"agSetColumnFilter",componentClass:LD},{componentName:"agSetColumnFloatingFilter",componentClass:FD}],dependantModules:[mf]},BD=Object.defineProperty,VD=Object.getOwnPropertyDescriptor,HD=Object.getOwnPropertySymbols,UD=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,WD=(e,t,i)=>t in e?BD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,jD=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?VD(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&BD(t,i,n),n},{extent:KD,isNumber:$D,isString:YD,isStringObject:qD,isDate:XD,createId:ZD,Padding:QD}=Um,{LinearScale:JD,BandScale:eI,TimeScale:tI}=Hm,iI=class{constructor(){this.type="category",this.stroke="rgb(204, 214, 235)",this.strokeWidth=1}},sI=class e{constructor(){this.id=ZD(this),this.seriesRect={x:0,y:0,width:0,height:0},this._context=void 0,this._container=void 0,this._data=void 0,this.padding=new QD(3),this.xKey="x",this.yKey="y",this.dataType=void 0,this.xData=[],this.yData=[],this.min=void 0,this.max=void 0,this.yScale=new JD,this.axis=new iI,this.highlightStyle={size:6,fill:"yellow",stroke:"silver",strokeWidth:1},this._width=100,this._height=100,this.smallestInterval=void 0,this.layoutId=0,this.defaultDateFormatter=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseOut=this.onMouseOut.bind(this);const t=new Pm.Group;this.rootGroup=t;const i=document.createElement("div");i.setAttribute("class","ag-sparkline-wrapper");const s=new Pm.Scene({});this.scene=s,this.canvasElement=s.canvas.element,s.setRoot(t),s.setContainer(i),this.resizeAndSetDimensions(this.width,this.height),e.tooltipDocuments.includes(document)||this.initialiseTooltipStyles(),this.setupDomEventListeners(this.canvasElement)}set context(e){this._context!==e&&(this._context=e)}get context(){return this._context}set container(e){if(this._container!==e){const{parentNode:t}=this.canvasElement;null!=t&&t.removeChild(this.canvasElement),e&&e.appendChild(this.canvasElement),this._container=e}}get container(){return this._container}set data(e){this._data!==e&&(this._data=e,this.processData(),this.mouseMoveEvent&&this.highlightedDatum&&this.updateHitPoint(this.mouseMoveEvent))}get data(){return this._data}resizeAndSetDimensions(e,t){this.scene.resize(e,t),this.seriesRect.width=e,this.seriesRect.height=t}initialiseTooltipStyles(){const t=document.createElement("style");t.innerHTML="\n.ag-sparkline-tooltip-wrapper {\n    position: absolute;\n    user-select: none;\n    pointer-events: none;\n}\n\n.ag-sparkline-tooltip {\n    position: relative;\n    font: 12px arial,sans-serif;\n    border-radius: 2px;\n    box-shadow: 0 1px 3px rgb(0 0 0 / 20%), 0 1px 1px rgb(0 0 0 / 14%);\n    line-height: 1.7em;\n    overflow: hidden;\n    white-space: nowrap;\n    z-index: 99999;\n    background-color: rgb(255, 255, 255);\n    color: rgba(0,0,0, 0.67);\n}\n\n.ag-sparkline-tooltip-content {\n    padding: 0 7px;\n    opacity: 1;\n}\n\n.ag-sparkline-tooltip-title {\n    padding-left: 7px;\n    opacity: 1;\n}\n\n.ag-sparkline-tooltip-wrapper-hidden {\n    top: -10000px !important;\n}\n\n.ag-sparkline-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n",document.head.insertBefore(t,document.head.querySelector("style")),e.tooltipDocuments.push(document)}set width(e){this._width!==e&&(this._width=e,this.scene.resize(e,this.height),this.scheduleLayout())}get width(){return this._width}set height(e){this._height!==e&&(this._height=e,this.scene.resize(this.width,e),this.scheduleLayout())}get height(){return this._height}update(){}updateYScale(){this.updateYScaleRange(),this.updateYScaleDomain()}updateYScaleDomain(){}updateYScaleRange(){const{yScale:e,seriesRect:t}=this;e.range=[t.height,0]}updateXScale(){const{type:e}=this.axis;this.xScale=this.getXScale(e),this.updateXScaleRange(),this.updateXScaleDomain()}updateXScaleRange(){this.xScale.range=[0,this.seriesRect.width]}updateXScaleDomain(){const{xData:e,xScale:t}=this;let i;(t instanceof JD||t instanceof tI)&&(i=KD(e)),this.xScale.domain=i?i.slice():e}getXScale(e="category"){switch(e){case"number":return new JD;case"time":return new tI;default:return new eI}}updateAxisLine(){}updateAxes(){this.updateYScale(),this.updateXScale(),this.updateAxisLine()}updateCrosshairs(){this.updateXCrosshairLine(),this.updateYCrosshairLine()}generateNodeData(){return[]}getNodeData(){return[]}updateNodes(){}updateXCrosshairLine(){}updateYCrosshairLine(){}highlightDatum(e){this.updateNodes()}dehighlightDatum(){this.highlightedDatum=void 0,this.updateNodes(),this.updateCrosshairs()}onMouseMove(e){this.mouseMoveEvent=e,this.updateHitPoint(e)}updateHitPoint(e){var t,i,s;const r=this.pickClosestSeriesNodeDatum(e.offsetX,e.offsetY);if(!r)return;const n=this.highlightedDatum;this.highlightedDatum=r,(this.highlightedDatum&&!n||this.highlightedDatum&&n&&this.highlightedDatum!==n)&&(this.highlightDatum(r),this.updateCrosshairs(),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e))),(null==(s=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.enabled)||s)&&this.handleTooltip(e,r)}onMouseOut(e){this.dehighlightDatum(),this.tooltip.toggle(!1),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e))}processData(){const{data:e,yData:t,xData:i}=this;if(!e||this.invalidData(this.data))return;t.length=0,i.length=0;const s=e.length,r=this.getDataType(e);this.dataType=r;const{type:n}=this.axis,o="number"!==n&&"time"!==n?"category":n,a="number"===o||"time"===o,l=(e,t)=>{null==this.smallestInterval&&(this.smallestInterval={x:1/0,y:1/0});const{x:i}=this.smallestInterval,s=Math.abs(e-t);s>0&&s<i&&(this.smallestInterval.x=s)};let c;if("number"===r)for(let r=0;r<s;r++){const s=r,n=e[r],h=this.getDatum(s,o),d=this.getDatum(n,"number");a&&l(h,c),i.push(h),t.push(d),c=h}else if("array"===r)for(let r=0;r<s;r++){const s=e[r];if(Array.isArray(s)){const e=s[0],r=s[1],n=this.getDatum(e,o),h=this.getDatum(r,"number");if(null==n)continue;a&&l(n,c),i.push(n),t.push(h),c=n}}else if("object"===r){const{yKey:r,xKey:n}=this;for(let h=0;h<s;h++){const s=e[h];if("object"==typeof s&&!Array.isArray(s)){const e=s[n],h=s[r],d=this.getDatum(e,o),u=this.getDatum(h,"number");if(null==d)continue;a&&l(d,c),i.push(d),t.push(u),c=d}}}this.updateAxes(),this.immediateLayout()}getDataType(e){for(const t of e)if(null!=t){if($D(t))return"number";if(Array.isArray(t))return"array";if("object"==typeof t)return"object"}}getDatum(e,t){if("number"===t&&$D(e)||"time"===t&&($D(e)||XD(e)))return e;if("category"===t){if(YD(e)||XD(e)||$D(e))return{toString:()=>String(e)};if(qD(e))return e}}get layoutScheduled(){return!!this.layoutId}scheduleLayout(){this.layoutId&&cancelAnimationFrame(this.layoutId),this.layoutId=requestAnimationFrame(()=>{this.immediateLayout(),this.layoutId=0})}immediateLayout(){this.setSparklineDimensions(),this.invalidData(this.data)||(this.updateXScaleRange(),this.updateYScaleRange(),this.updateAxisLine(),this.update(),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e)))}setSparklineDimensions(){const{width:e,height:t,padding:i,seriesRect:s,rootGroup:r}=this,n=e-i.left-i.right,o=t-i.top-i.bottom;s.width=n,s.height=o,s.x=i.left,s.y=i.top,r.translationX=s.x,r.translationY=s.y}pickClosestSeriesNodeDatum(e,t){let i,s=1/0;const r=this.rootGroup.transformPoint(e,t),n=this.getNodeData();for(let e=0;e<n.length;e++){const t=n[e];if(!t.point)return;const o=this.getDistance(r,t.point);o<=s&&(s=o,i=t)}return i}getDistance(e,t){return Math.abs(e.x-t.x)}handleTooltip(e,t){var i,s;const{seriesDatum:r}=t,{canvasElement:n}=this,{clientX:o,clientY:a}=e,l=null==(i=this.processedOptions)?void 0:i.tooltip,c={pageX:o,pageY:a,position:{xOffset:null==l?void 0:l.xOffset,yOffset:null==l?void 0:l.yOffset},container:null==l?void 0:l.container};null==c.container&&(c.container=n);const h=r.y,d=r.x;let u=null==(s=null==l?void 0:l.enabled)||s;const p=null==l?void 0:l.renderer;if(p){const e=p({context:this.context,datum:r,yValue:h,xValue:d});u="string"!=typeof e&&void 0!==e.enabled?e.enabled:u}const g=u&&void 0!==r.y&&this.getTooltipHtml(t);g&&this.tooltip.show(c,g)}formatNumericDatum(e){return String(Math.round(10*e)/10)}formatDatum(e){const t=this.axis.type||"category";return"number"===t&&"number"==typeof e?this.formatNumericDatum(e):"time"===t&&(e instanceof Date||$D(e))?this.defaultDateFormatter.format(e):String(e)}setupDomEventListeners(e){e.addEventListener("mousemove",this._onMouseMove),e.addEventListener("mouseout",this._onMouseOut)}cleanupDomEventListeners(e){e.removeEventListener("mousemove",this._onMouseMove),e.removeEventListener("mouseout",this._onMouseOut)}invalidData(e){return!e||!Array.isArray(e)}destroy(){this.cleanupDomEventListeners(this.canvasElement),this.scene.destroy(),this.container=void 0}};sI.tooltipDocuments=[];var rI=sI;function nI(e,t){var i,s,r;if("string"==typeof e)return e;t=null!=t?t:{};const{content:n=(null!=(i=t.content)?i:""),title:o=(null!=(s=t.title)?s:void 0),color:a=t.color,backgroundColor:l=t.backgroundColor,opacity:c=(null!=(r=t.opacity)?r:1)}=e;let h,d;a?(h=o?`<span class="${aI.class}-title"; style="color: ${a}">${o}</span>`:"",d=`<span class="${aI.class}-content" style="color: ${a}">${n}</span>`):(h=o?`<span class="${aI.class}-title">${o}</span>`:"",d=`<span class="${aI.class}-content">${n}</span>`);let u=`opacity: ${c}`;return l&&(u+=`; background-color: ${l.toLowerCase()}`),`<div class="${aI.class}" style="${u}">\n                ${h}\n                ${d}\n            </div>`}var oI=class e{constructor(){this.element=document.createElement("div"),document.body.appendChild(this.element)}isVisible(){const{element:t}=this;if(t.classList)return!t.classList.contains(`${e.class}-wrapper-hidden`);const i=t.getAttribute("class");return!!i&&i.split(" ").indexOf(`${e.class}-wrapper-hidden`)<0}updateClass(t){const i=[`${e.class}-wrapper`];!0!==t&&i.push(`${e.class}-wrapper-hidden`),this.element.setAttribute("class",i.join(" "))}show(e,t){var i,s,r,n;this.toggle(!1);const{element:o}=this;if(void 0!==t)o.innerHTML=t;else if(!o.innerHTML)return;const a=null!=(s=null==(i=e.position)?void 0:i.xOffset)?s:10,l=null!=(n=null==(r=e.position)?void 0:r.yOffset)?n:0;let c=e.pageX+a,h=e.pageY+l;const d=o.getBoundingClientRect();let u=window.innerWidth-d.width;if(e.container){const t=e.container.getBoundingClientRect();u=t.left+(t.width-d.width)}c>u&&(c=e.pageX-o.clientWidth-a),"undefined"!=typeof scrollX&&(c+=scrollX),"undefined"!=typeof scrollY&&(h+=scrollY),o.style.left=`${Math.round(c)}px`,o.style.top=`${Math.round(h)}px`,this.toggle(!0)}toggle(e){this.updateClass(e)}destroy(){const{parentNode:e}=this.element;e&&e.removeChild(this.element)}};oI.class="ag-sparkline-tooltip";var aI=oI;function lI(e){switch(e){case"circle":default:return Pm.Circle;case"square":return Pm.Square;case"diamond":return Pm.Diamond}}function cI(e,t="solid"){const i={solid:[],dash:[4,3],dot:[1,3],dashDot:[4,3,1,3],dashDotDot:[4,3,1,3,1,3],shortDot:[1,1],shortDash:[3,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],longDash:[8,3],longDashDot:[8,3,1,3],longDashDotDot:[8,3,1,3,1,3]},s={solid:[],dash:[3,3],dot:[0,3],dashDot:[3,3,0,3],dashDotDot:[3,3,0,3,0,3],shortDot:[0,2],shortDash:[2,2],shortDashDot:[2,2,0,2],shortDashDotDot:[2,2,0,2,0,2],longDash:[7,3],longDashDot:[7,3,0,3],longDashDotDot:[7,3,0,3,0,3]};return"round"===e||"square"===e?null==s[t]?(console.warn(`'${t}' is not a valid 'lineDash' option.`),s.solid):s[t]:null==i[t]?(console.warn(`'${t}' is not a valid 'lineDash' option.`),i.solid):i[t]}var{extent:hI}=Um,{BandScale:dI}=Hm,uI=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},pI=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},gI=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},mI=class extends rI{constructor(){super(),this.fill="rgba(124, 181, 236, 0.25)",this.strokePath=new Pm.Path,this.fillPath=new Pm.Path,this.xCrosshairLine=new Pm.Line,this.yCrosshairLine=new Pm.Line,this.areaSparklineGroup=new Pm.Group,this.xAxisLine=new Pm.Line,this.markers=new Pm.Group,this.markerSelection=Pm.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new uI,this.line=new pI,this.crosshairs=new gI,this.rootGroup.append(this.areaSparklineGroup),this.xAxisLine.zIndex=500,this.fillPath.zIndex=50,this.strokePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.areaSparklineGroup.append([this.fillPath,this.xAxisLine,this.strokePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}markerFactory(){const{shape:e}=this.marker;return new(lI(e))}getNodeData(){return this.markerSelectionData}update(){const e=this.generateNodeData();if(!e)return;const{nodeData:t,fillData:i,strokeData:s}=e;this.markerSelectionData=t,this.updateSelection(t),this.updateNodes(),this.updateStroke(s),this.updateFill(i)}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=hI(e);let s=0,r=1;void 0!==i&&(s=this.min=i[0],r=this.max=i[1]),s=s<0?s:0,r=r<0?0:r,t.domain=[s,r]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r}=this;if(!e)return;const n=!(s instanceof dI),o=n?0:s.bandwidth/2,a=t.length,l=[],c=[],h=[];let d,u,p,g;const m=r.convert(0);for(let e=0;e<a;e++){const f=t[e],y=i[e],v=s.convert(n?s.toDomain(y):y)+o,C=void 0===f?NaN:r.convert(f);e+1<a&&(g=s.convert(n?s.toDomain(i[e+1]):i[e+1])+o),h.push({seriesDatum:{x:y,y:f},point:{x:v,y:C}}),void 0===f&&void 0!==p?(c.push({seriesDatum:void 0,point:{x:p,y:m}}),void 0!==g&&c.push({seriesDatum:void 0,point:{x:g,y:m}})):void 0!==f&&(c.push({seriesDatum:{x:y,y:f},point:{x:v,y:C}}),l.push({seriesDatum:{x:y,y:f},point:{x:v,y:C}}),d=void 0!==d?d:v,u=v),p=v}return c.push({seriesDatum:void 0,point:{x:u,y:m}},{seriesDatum:void 0,point:{x:d,y:m}}),{nodeData:l,fillData:c,strokeData:h}}updateAxisLine(){const{xScale:e,yScale:t,axis:i,xAxisLine:s}=this;s.x1=e.range[0],s.x2=e.range[1],s.y1=s.y2=0,s.stroke=i.stroke,s.strokeWidth=i.strokeWidth;const r=t.convert(0);s.translationY=r}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:s,fill:r,stroke:n,strokeWidth:o}=t,a=i.formatter;this.markerSelection.each((t,l,c)=>{const{point:h,seriesDatum:d}=l;if(!h)return;const u=l===e,p=u&&void 0!==r?r:i.fill,g=u&&void 0!==n?n:i.stroke,m=u&&void 0!==o?o:i.strokeWidth,f=u&&void 0!==s?s:i.size;let y;if(a){const e=0===c,t=c===this.markerSelectionData.length-1,i=d.y===this.min,s=d.y===this.max;y=a({datum:l,xValue:d.x,yValue:d.y,min:i,max:s,first:e,last:t,fill:p,stroke:g,strokeWidth:m,size:f,highlighted:u})}t.size=y&&null!=y.size?y.size:f,t.fill=y&&null!=y.fill?y.fill:p,t.stroke=y&&null!=y.stroke?y.stroke:g,t.strokeWidth=y&&null!=y.strokeWidth?y.strokeWidth:m,t.translationX=h.x,t.translationY=h.y,t.visible=y&&null!=y.enabled?y.enabled:i.enabled&&t.size>0})}updateStroke(e){const{strokePath:t,yData:i,line:s}=this,r=t.path;if(r.clear(),i.length<2)return;const n=e.length;let o=!0;for(let t=0;t<n;t++){const{point:i,seriesDatum:s}=e[t],n=i.x,a=i.y;null==s.y?o=!0:o?(r.moveTo(n,a),o=!1):r.lineTo(n,a)}t.lineJoin=t.lineCap="round",t.fill=void 0,t.stroke=s.stroke,t.strokeWidth=s.strokeWidth}updateFill(e){const{fillPath:t,yData:i,fill:s}=this,r=t.path,n=e.length;if(r.clear(),!(i.length<2)){for(let t=0;t<n;t++){const{point:i}=e[t],s=i.x,n=i.y;t>0?r.lineTo(s,n):r.moveTo(s,n)}r.closePath(),t.lineJoin="round",t.stroke=void 0,t.fill=s}}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:s,crosshairs:{xLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:cI(i.lineCap,r.lineDash),i.translationX=s.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:s,crosshairs:{yLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:cI(i.lineCap,r.lineDash),i.translationY=s.point.y}getTooltipHtml(e){var t,i;const{dataType:s}=this,{seriesDatum:r}=e,n=r.y,o=r.x,a={content:this.formatNumericDatum(n),title:"array"===s||"object"===s?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?nI(l({context:this.context,datum:r,yValue:n,xValue:o}),a):nI(a)}};mI.className="AreaSparkline";var{extent:fI}=Um,{BandScale:yI}=Hm,vI=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},CI=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},bI=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},SI=class extends rI{constructor(){super(),this.linePath=new Pm.Path,this.xCrosshairLine=new Pm.Line,this.yCrosshairLine=new Pm.Line,this.lineSparklineGroup=new Pm.Group,this.markers=new Pm.Group,this.markerSelection=Pm.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new vI,this.line=new CI,this.crosshairs=new bI,this.rootGroup.append(this.lineSparklineGroup),this.linePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.lineSparklineGroup.append([this.linePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}getNodeData(){return this.markerSelectionData}markerFactory(){const{shape:e}=this.marker;return new(lI(e))}onMarkerShapeChange(){this.markerSelection=this.markerSelection.clear(),this.scheduleLayout()}update(){const e=this.generateNodeData();e&&(this.markerSelectionData=e,this.updateSelection(e),this.updateNodes(),this.updateLine())}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=fI(e);let s=0,r=1;if(void 0!==i&&(s=this.min=i[0],r=this.max=i[1]),s===r){const e=Math.abs(.01*s);s-=e,r+=e}t.domain=[s,r]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r}=this;if(!e)return;const n=!(s instanceof yI),o=n?0:s.bandwidth/2,a=[];for(let e=0;e<t.length;e++){const l=t[e],c=i[e];if(null==l)continue;const h=s.convert(n?s.toDomain(c):c)+o,d=void 0===l?NaN:r.convert(l);a.push({seriesDatum:{x:c,y:l},point:{x:h,y:d}})}return a}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:s,fill:r,stroke:n,strokeWidth:o}=t,a=i.formatter;this.markerSelection.each((t,l,c)=>{const h=l===e,d=h&&void 0!==r?r:i.fill,u=h&&void 0!==n?n:i.stroke,p=h&&void 0!==o?o:i.strokeWidth,g=h&&void 0!==s?s:i.size;let m;const{seriesDatum:f,point:y}=l;if(a){const e=0===c,t=c===this.markerSelectionData.length-1,i=f.y===this.min,s=f.y===this.max;m=a({datum:l,xValue:f.x,yValue:f.y,min:i,max:s,first:e,last:t,fill:d,stroke:u,strokeWidth:p,size:g,highlighted:h})}t.size=m&&null!=m.size?m.size:g,t.fill=m&&null!=m.fill?m.fill:d,t.stroke=m&&null!=m.stroke?m.stroke:u,t.strokeWidth=m&&null!=m.strokeWidth?m.strokeWidth:p,t.translationX=y.x,t.translationY=y.y,t.visible=m&&null!=m.enabled?m.enabled:i.enabled&&t.size>0})}updateLine(){const{linePath:e,yData:t,xData:i,xScale:s,yScale:r,line:n}=this,o=e.path;if(o.clear(),t.length<2)return;const a=!(s instanceof yI),l=t.length,c=a?0:s.bandwidth/2;let h=!0;for(let e=0;e<l;e++){const n=i[e],l=t[e],d=s.convert(a?s.toDomain(n):n)+c,u=void 0===l?NaN:r.convert(l);null==l?h=!0:h?(o.moveTo(d,u),h=!1):o.lineTo(d,u)}e.fill=void 0,e.stroke=n.stroke,e.strokeWidth=n.strokeWidth}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:s,crosshairs:{xLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:cI(i.lineCap,r.lineDash),i.translationX=s.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:s,crosshairs:{yLine:r}}=this;if(!r.enabled||null==s)return void(i.strokeWidth=0);i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=r.stroke,i.strokeWidth=null!=(e=r.strokeWidth)?e:1,i.lineCap="round"===r.lineCap||"square"===r.lineCap?r.lineCap:void 0;const{lineDash:n}=r;i.lineDash=Array.isArray(n)?n:cI(i.lineCap,r.lineDash),i.translationY=s.point.y}getTooltipHtml(e){var t,i;const{dataType:s}=this,{seriesDatum:r}=e,n=r.y,o=r.x,a={content:this.formatNumericDatum(n),title:"array"===s||"object"===s?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?nI(l({context:this.context,datum:r,yValue:n,xValue:o}),a):nI(a)}};SI.className="LineSparkline";var wI=class{constructor(){this.enabled=!0,this.fontSize=8,this.fontFamily="Verdana, sans-serif",this.fontStyle=void 0,this.fontWeight=void 0,this.color="rgba(70, 70, 70, 1)"}},{extent:xI}=Um,EI=class extends wI{constructor(){super(...arguments),this.formatter=void 0,this.placement="insideEnd"}},MI=class extends rI{constructor(){super(),this.fill="rgb(124, 181, 236)",this.stroke="silver",this.strokeWidth=0,this.paddingInner=.1,this.paddingOuter=.2,this.valueAxisDomain=void 0,this.formatter=void 0,this.axisLine=new Pm.Line,this.bandWidth=0,this.sparklineGroup=new Pm.Group,this.rectGroup=new Pm.Group,this.labelGroup=new Pm.Group,this.rectSelection=Pm.Selection.select(this.rectGroup,Pm.Rect),this.labelSelection=Pm.Selection.select(this.labelGroup,Pm.Text),this.nodeSelectionData=[],this.label=new EI,this.rootGroup.append(this.sparklineGroup),this.rectGroup.zIndex=50,this.axisLine.zIndex=500,this.labelGroup.zIndex=1500,this.sparklineGroup.append([this.rectGroup,this.axisLine,this.labelGroup]),this.axisLine.lineCap="round",this.label.enabled=!1}getNodeData(){return this.nodeSelectionData}update(){this.updateSelections(),this.updateNodes()}updateSelections(){const e=this.generateNodeData();e&&(this.nodeSelectionData=e,this.updateRectSelection(e),this.updateLabelSelection(e))}updateNodes(){this.updateRectNodes(),this.updateLabelNodes()}calculateStep(e){var t;const{xScale:i,paddingInner:s,paddingOuter:r,smallestInterval:n}=this;let o=(i.domain[1]-i.domain[0])/(null!=(t=null==n?void 0:n.x)?t:1)+1;const a=Math.min(o,50),l=a-1;return e/Math.max(1,2*r+l*s+a)}updateYScaleDomain(){const{yScale:e,yData:t,valueAxisDomain:i}=this,s=xI(t);let r=0,n=1;void 0!==s&&(r=this.min=s[0],n=this.max=s[1]),r=r<0?r:0,n=n<0?0:n,i&&(i[1]<n&&(i[1]=n),i[0]>r&&(i[0]=r)),e.domain=i||[r,n]}updateRectSelection(e){this.rectSelection.update(e)}updateRectNodes(){const{highlightedDatum:e,formatter:t,fill:i,stroke:s,strokeWidth:r}=this,{fill:n,stroke:o,strokeWidth:a}=this.highlightStyle;this.rectSelection.each((l,c,h)=>{const d=c===e,u=d&&void 0!==n?n:i,p=d&&void 0!==o?o:s,g=d&&void 0!==a?a:r;let m;const{x:f,y,width:v,height:C,seriesDatum:b}=c;if(t){const e=0===h,i=h===this.nodeSelectionData.length-1,s=b.y===this.min,r=b.y===this.max;m=t({datum:c,xValue:b.x,yValue:b.y,width:v,height:C,min:s,max:r,first:e,last:i,fill:u,stroke:p,strokeWidth:g,highlighted:d})}l.fill=m&&m.fill||u,l.stroke=m&&m.stroke||p,l.strokeWidth=m&&m.strokeWidth||g,l.x=l.y=0,l.width=v,l.height=C,l.visible=l.height>0,l.translationX=f,l.translationY=y})}updateLabelSelection(e){this.labelSelection.update(e,e=>{e.tag=1,e.pointerEvents=Pm.PointerEvents.None})}updateLabelNodes(){const{label:{enabled:e,fontStyle:t,fontWeight:i,fontSize:s,fontFamily:r,color:n}}=this;this.labelSelection.each((o,a)=>{const l=a.label;l&&e?(o.fontStyle=t,o.fontWeight=i,o.fontSize=s,o.fontFamily=r,o.textAlign=l.textAlign,o.textBaseline=l.textBaseline,o.text=l.text,o.x=l.x,o.y=l.y,o.fill=n,o.visible=!0):o.visible=!1})}getTooltipHtml(e){var t,i;const{dataType:s}=this,{seriesDatum:r}=e,n=r.y,o=r.x,a={content:this.formatNumericDatum(n),title:"array"===s||"object"===s?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?nI(l({context:this.context,datum:r,yValue:n,xValue:o}),a):nI(a)}formatLabelValue(e){return e%1!=0?e.toFixed(1):e.toFixed(0)}},{isNumber:AI}=Um,{BandScale:TI}=Hm,DI=class extends MI{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[0,e.width]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:s}=this;if(e instanceof TI)e.range=[0,t.height],e.paddingInner=s,e.paddingOuter=i;else{const r=this.calculateStep(t.height),n=r*i;this.bandWidth=r*(1-s),e.range=[n,t.height-n-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:s}=this,{strokeWidth:r}=t;i.x1=0,i.x2=0,i.y1=0,i.y2=s.height,i.stroke=t.stroke,i.strokeWidth=r+(r%2==1?1:0);const n=e.convert(0);i.translationX=n}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r,fill:n,stroke:o,strokeWidth:a,label:l}=this;if(!e)return;const{fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,color:p,formatter:g,placement:m}=l,f=[],y=r.convert(0),v=!(s instanceof TI);for(let e=0,l=t.length;e<l;e++){let l=t[e];const C=i[e],b=void 0===l;b&&(l=0);const S=s.convert(v?s.toDomain(C):C),w=Math.min(void 0===l?NaN:r.convert(l),y),x=Math.max(void 0===l?NaN:r.convert(l),y),E=v?this.bandWidth:s.bandwidth,M=x-w,A={x:y,y:S};let T;T=g?g({value:l}):void 0!==l&&AI(l)?this.formatLabelValue(l):"";const D=S+E/2;let I;const R="middle";let P;const k=void 0!==l&&l>=0,L=4;if("center"===m)I=w+M/2,P="center";else if("outsideEnd"===m)I=w+(k?M+L:-L),P=k?"start":"end";else if("insideEnd"===m){I=w+(k?M-L:L),P=k?"end":"start";const e=Pm.Text.getTextSize(T,u).width||20;(k&&I<y+e||!k&&I>y-e)&&(I=y+L*(k?1:-1),P=k?"start":"end")}else I=y+L*(k?1:-1),P=k?"start":"end";f.push({x:w,y:S,width:M,height:E,fill:n,stroke:o,strokeWidth:a,seriesDatum:{x:C,y:b?void 0:l},point:A,label:{x:I,y:D,text:T,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:P,textBaseline:R,fill:p}})}return f}getDistance(e,t){return Math.abs(e.y-t.y)}};DI.className="BarSparkline";var{isNumber:II}=Um,{BandScale:RI}=Hm,PI=class extends MI{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[e.height,0]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:s}=this;if(e instanceof RI)e.range=[0,t.width],e.paddingInner=s,e.paddingOuter=i;else{const r=this.calculateStep(t.width),n=r*i;this.bandWidth=r*(1-s),e.range=[n,t.width-n-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:s}=this,{strokeWidth:r}=t;i.x1=0,i.x2=s.width,i.y1=0,i.y2=0,i.stroke=t.stroke,i.strokeWidth=r+(r%2==1?1:0);const n=e.convert(0);i.translationY=n}generateNodeData(){const{data:e,yData:t,xData:i,xScale:s,yScale:r,fill:n,stroke:o,strokeWidth:a,label:l}=this;if(!e)return;const{fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,color:p,formatter:g,placement:m}=l,f=[],y=r.convert(0),v=!(s instanceof RI);for(let e=0,l=t.length;e<l;e++){let l=t[e];const C=i[e],b=void 0===l;b&&(l=0);const S=Math.min(void 0===l?NaN:r.convert(l),y),w=s.convert(v?s.toDomain(C):C),x=Math.max(void 0===l?NaN:r.convert(l),y),E=v?this.bandWidth:s.bandwidth,M=x-S,A={x:w+E/2,y};let T;T=g?g({value:l}):void 0!==l&&II(l)?this.formatLabelValue(l):"";const D=w+E/2;let I;const R="center";let P;const k=void 0!==l&&l>=0,L=2;if("center"===m)I=S+M/2,P="middle";else if("outsideEnd"===m)I=S+(k?-L:M+L),P=k?"bottom":"top";else if("insideEnd"===m){I=S+(k?L:M-L),P=k?"top":"bottom";const e=Pm.Text.getTextSize(T,u).height||10;(k&&I>y-e||!k&&I<y+e)&&(I=y+L*(k?-1:1),P=k?"bottom":"top")}else I=y+L*(k?-1:1),P=k?"bottom":"top";f.push({x:w,y:S,width:E,height:M,fill:n,stroke:o,strokeWidth:a,seriesDatum:{x:C,y:b?void 0:l},point:A,label:{x:D,y:I,text:T,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:R,textBaseline:P,fill:p}})}return f}};PI.className="ColumnSparkline";var{isNumber:kI}=Um,LI=class{static create(e,t){const i=function(e="line"){switch(e){case"column":return new PI;case"bar":return new DI;case"area":return new mI;default:return new SI}}((e=Um.deepClone(e)).type);return t&&(i.tooltip=t),function(e,t){HI(e,"context",t.context,t),HI(e,"width",t.width,t),HI(e,"height",t.height,t),HI(e,"container",t.container,t),HI(e,"xKey",t.xKey,t),HI(e,"yKey",t.yKey,t),t.padding&&function(e,t){HI(e,"top",t.top,t),HI(e,"right",t.right,t),HI(e,"bottom",t.bottom,t),HI(e,"left",t.left,t)}(e.padding,t.padding),t.axis&&function(e,t){HI(e,"type",t.type,t),HI(e,"stroke",t.stroke,t),HI(e,"strokeWidth",t.strokeWidth,t)}(e.axis,t.axis),t.highlightStyle&&function(e,t){HI(e,"fill",t.fill,t),HI(e,"size",t.size,t),HI(e,"stroke",t.stroke,t),HI(e,"strokeWidth",t.strokeWidth,t)}(e.highlightStyle,t.highlightStyle)}(i,e),function(e,t){switch(t.type){case"bar":case"column":!function(e,t){HI(e,"valueAxisDomain",t.valueAxisDomain,t),HI(e,"fill",t.fill,t),HI(e,"stroke",t.stroke,t),HI(e,"strokeWidth",t.strokeWidth,t),HI(e,"paddingInner",t.paddingInner,t),HI(e,"paddingOuter",t.paddingOuter,t),HI(e,"formatter",t.formatter,t),t.label&&function(e,t){HI(e,"enabled",t.enabled,t),HI(e,"fontStyle",t.fontStyle,t),HI(e,"fontWeight",t.fontWeight,t),HI(e,"fontSize",t.fontSize,t),HI(e,"fontFamily",t.fontFamily,t),HI(e,"textAlign",t.textAlign,t),HI(e,"textBaseline",t.textBaseline,t),HI(e,"color",t.color,t),HI(e,"formatter",t.formatter,t),HI(e,"placement",t.placement,t)}(e.label,t.label)}(e,t);break;case"area":!function(e,t){HI(e,"fill",t.fill,t),t.marker&&NI(e.marker,t.marker),t.line&&_I(e.line,t.line),t.crosshairs&&OI(e.crosshairs,t.crosshairs)}(e,t);break;default:!function(e,t){t.marker&&NI(e.marker,t.marker),t.line&&_I(e.line,t.line),t.crosshairs&&OI(e.crosshairs,t.crosshairs)}(e,t)}}(i,e),e.data&&(i.data=e.data),i.processedOptions=e,i}};function NI(e,t){HI(e,"enabled",t.enabled,t),HI(e,"size",t.size,t),HI(e,"shape",t.shape,t),HI(e,"fill",t.fill,t),HI(e,"stroke",t.stroke,t),HI(e,"strokeWidth",t.strokeWidth,t),HI(e,"formatter",t.formatter,t)}function _I(e,t){HI(e,"stroke",t.stroke,t),HI(e,"strokeWidth",t.strokeWidth,t)}function OI(e,t){e.xLine&&t.xLine&&FI(e.xLine,t.xLine),e.yLine&&t.yLine&&FI(e.yLine,t.yLine)}function FI(e,t){HI(e,"enabled",t.enabled,t),HI(e,"stroke",t.stroke,t),HI(e,"strokeWidth",t.strokeWidth,t),HI(e,"lineDash",t.lineDash,t),HI(e,"lineCap",t.lineCap,t)}var GI={},BI=(e,t,i)=>{if(kI(t))return!0;const s=`AG Charts: ${e} must be a number, the value you provided is not a valid number. Using the default of ${i}px.`;var r,n;return r=()=>console.warn(s),GI[n=`${e} not a number`]||(r(),GI[n]=!0),!1},VI={xOffset:BI,yOffset:BI};function HI(e,t,i,s){if(t in s)if(t in e){const s=VI[t];(!s||s(t,i,e[t]))&&e[t]!==i&&(e[t]=i)}else console.warn(`Property ${t} does not exist on the target object.`)}var UI=class e extends r.uAl{constructor(){super(e.TEMPLATE)}init(e){let t=!0;const i=this.resizeObserverService.observeResize(this.getGui(),()=>{const{clientWidth:i,clientHeight:s}=this.getGui();if(0!==i&&0!==s)if(t){const r=((e,t)=>{for(var i in t||(t={}))UD.call(t,i)&&WD(e,i,t[i]);if(HD)for(var i of HD(t))zD.call(t,i)&&WD(e,i,t[i]);return e})({data:e.value,width:i,height:s,context:{data:e.data}},e.sparklineOptions);this.sparkline=LI.create(r,this.sparklineTooltipSingleton.getSparklineTooltip()),this.eSparkline.appendChild(this.sparkline.canvasElement),t=!1}else this.sparkline.width=i,this.sparkline.height=s});this.addDestroyFunc(()=>i())}refresh(e){return!!this.sparkline&&(this.sparkline.data=e.value,!0)}destroy(){this.sparkline&&this.sparkline.destroy(),super.destroy()}};UI.TEMPLATE='<div class="ag-sparkline-wrapper">\n            <span ref="eSparkline"></span>\n        </div>',jD([(0,r.PIB)("eSparkline")],UI.prototype,"eSparkline",2),jD([(0,r.dsm)("resizeObserverService")],UI.prototype,"resizeObserverService",2),jD([(0,r.dsm)("sparklineTooltipSingleton")],UI.prototype,"sparklineTooltipSingleton",2);var zI=UI,WI=class extends r.XQb{postConstruct(){this.tooltip=new aI}getSparklineTooltip(){return this.tooltip}destroyTooltip(){this.tooltip&&this.tooltip.destroy()}};jD([r.o7C],WI.prototype,"postConstruct",1),jD([r.yah],WI.prototype,"destroyTooltip",1),WI=jD([(0,r.dR4)("sparklineTooltipSingleton")],WI);var jI={version:"31.3.4",moduleName:r.zsj.SparklinesModule,beans:[WI],userComponents:[{componentName:"agSparklineCellRenderer",componentClass:zI}],dependantModules:[mf]},KI=class extends r.XQb{constructor(){super(),this.allComponents=new Map}registerStatusPanel(e,t){this.allComponents.set(e,t)}unregisterStatusPanel(e){this.allComponents.delete(e)}unregisterAllComponents(){this.allComponents.clear()}getStatusPanel(e){return this.allComponents.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}};KI=of([(0,r.dR4)("statusBarService")],KI);var $I=class e extends r.uAl{constructor(){super(e.TEMPLATE),this.compDestroyFunctions={}}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this))}processStatusPanels(e){var t;const i=null==(t=this.gos.get("statusBar"))?void 0:t.statusPanels;if(i){const t=i.filter(e=>"left"===e.align);this.createAndRenderComponents(t,this.eStatusBarLeft,e);const s=i.filter(e=>"center"===e.align);this.createAndRenderComponents(s,this.eStatusBarCenter,e);const r=i.filter(e=>!e.align||"right"===e.align);this.createAndRenderComponents(r,this.eStatusBarRight,e)}else this.setDisplayed(!1)}handleStatusBarChanged(){var e;const t=null==(e=this.gos.get("statusBar"))?void 0:e.statusPanels,i=Array.isArray(t)&&t.length>0;this.setDisplayed(i);const s=new Map;i&&t.forEach(e=>{var t,i;const n=null!=(t=e.key)?t:e.statusPanel,o=this.statusBarService.getStatusPanel(n);if(null==o?void 0:o.refresh){const t=this.gos.addGridCommonParams(null!=(i=e.statusPanelParams)?i:{});o.refresh(t)&&(s.set(n,o),delete this.compDestroyFunctions[n],r._.removeFromParent(o.getGui()))}}),this.resetStatusBar(),i&&this.processStatusPanels(s)}resetStatusBar(){this.eStatusBarLeft.innerHTML="",this.eStatusBarCenter.innerHTML="",this.eStatusBarRight.innerHTML="",this.destroyComponents(),this.statusBarService.unregisterAllComponents()}destroyComponents(){Object.values(this.compDestroyFunctions).forEach(e=>e()),this.compDestroyFunctions={}}createAndRenderComponents(e,t,i){const s=[];e.forEach(e=>{const t=e.key||e.statusPanel,n=i.get(t);let o;if(n)o=r.oY$.resolve(n);else{const t={};if(o=this.userComponentFactory.getStatusPanelCompDetails(e,t).newAgStackInstance(),!o)return}s.push({key:t,promise:o})}),r.oY$.all(s.map(e=>e.promise)).then(()=>{s.forEach(e=>{e.promise.then(i=>{const s=()=>{this.getContext().destroyBean(i)};this.isAlive()?(this.statusBarService.registerStatusPanel(e.key,i),t.appendChild(i.getGui()),this.compDestroyFunctions[e.key]=s):s()})})})}};$I.TEMPLATE='<div class="ag-status-bar">\n            <div ref="eStatusBarLeft" class="ag-status-bar-left" role="status"></div>\n            <div ref="eStatusBarCenter" class="ag-status-bar-center" role="status"></div>\n            <div ref="eStatusBarRight" class="ag-status-bar-right" role="status"></div>\n        </div>',of([(0,r.dsm)("userComponentFactory")],$I.prototype,"userComponentFactory",2),of([(0,r.dsm)("statusBarService")],$I.prototype,"statusBarService",2),of([(0,r.PIB)("eStatusBarLeft")],$I.prototype,"eStatusBarLeft",2),of([(0,r.PIB)("eStatusBarCenter")],$I.prototype,"eStatusBarCenter",2),of([(0,r.PIB)("eStatusBarRight")],$I.prototype,"eStatusBarRight",2),of([r.o7C],$I.prototype,"postConstruct",1),of([r.yah],$I.prototype,"destroyComponents",1);var YI=$I,qI=class e extends r.uAl{constructor(){super(e.TEMPLATE)}setLabel(e,t){this.setDisplayed(!1);const i=this.localeService.getLocaleTextFunc();this.eLabel.innerHTML=i(e,t)}setValue(e){this.eValue.innerHTML=e}};qI.TEMPLATE='<div class="ag-status-name-value">\n            <span ref="eLabel"></span>:&nbsp;\n            <span ref="eValue" class="ag-status-name-value-value"></span>\n        </div>',of([(0,r.PIB)("eLabel")],qI.prototype,"eLabel",2),of([(0,r.PIB)("eValue")],qI.prototype,"eValue",2);var XI=qI,ZI=class extends XI{postConstruct(){"clientSide"===this.rowModel.getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this)),this.onDataChanged()):r._.warnOnce("agTotalAndFilteredRowCountComponent should only be used with the client side row model.")}onDataChanged(){const e=this.localeService.getLocaleTextFunc(),t=e("thousandSeparator",","),i=e("decimalSeparator","."),s=r._.formatNumberCommas(this.getFilteredRowCountValue(),t,i),n=r._.formatNumberCommas(this.getTotalRowCount(),t,i);if(s===n)this.setValue(s);else{const e=this.localeService.getLocaleTextFunc();this.setValue(`${s} ${e("of","of")} ${n}`)}}getFilteredRowCountValue(){let e=0;return this.rowModel.forEachNodeAfterFilter(t=>{t.group||e++}),e}getTotalRowCount(){let e=0;return this.rowModel.forEachNode(t=>{t.group||e++}),e}init(){}refresh(){return!0}destroy(){super.destroy()}};of([(0,r.dsm)("rowModel")],ZI.prototype,"rowModel",2),of([r.o7C],ZI.prototype,"postConstruct",1);var QI=class extends XI{postConstruct(){if(this.setLabel("filteredRows","Filtered"),"clientSide"!==this.rowModel.getType())return void r._.warnOnce("agFilteredRowCountComponent should only be used with the client side row model.");this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,e),e()}onDataChanged(){const e=this.getTotalRowCountValue(),t=this.getFilteredRowCountValue(),i=this.localeService.getLocaleTextFunc(),s=i("thousandSeparator",","),n=i("decimalSeparator",".");this.setValue(r._.formatNumberCommas(t,s,n)),this.setDisplayed(e!==t)}getTotalRowCountValue(){let e=0;return this.rowModel.forEachNode(t=>e+=1),e}getFilteredRowCountValue(){let e=0;return this.rowModel.forEachNodeAfterFilter(t=>{t.group||(e+=1)}),e}init(){}refresh(){return!0}destroy(){super.destroy()}};of([(0,r.dsm)("rowModel")],QI.prototype,"rowModel",2),of([r.o7C],QI.prototype,"postConstruct",1);var JI=class extends XI{postConstruct(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.rowModel.getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this)),this.onDataChanged()):r._.warnOnce("agTotalRowCountComponent should only be used with the client side row model.")}onDataChanged(){const e=this.localeService.getLocaleTextFunc(),t=e("thousandSeparator",","),i=e("decimalSeparator",".");this.setValue(r._.formatNumberCommas(this.getRowCountValue(),t,i))}getRowCountValue(){let e=0;return this.rowModel.forEachLeafNode(t=>e+=1),e}init(){}refresh(){return!0}destroy(){super.destroy()}};of([(0,r.dsm)("rowModel")],JI.prototype,"rowModel",2),of([r.o7C],JI.prototype,"postConstruct",1);var eR=class extends XI{postConstruct(){if(!this.isValidRowModel())return void console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.");this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count"),this.onRowSelectionChanged();const e=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,e),this.addManagedListener(this.eventService,r.sVA.EVENT_SELECTION_CHANGED,e)}isValidRowModel(){const e=this.rowModel.getType();return"clientSide"===e||"serverSide"===e}onRowSelectionChanged(){const e=this.selectionService.getSelectionCount();if(e<0)return this.setValue("?"),void this.setDisplayed(!0);const t=this.localeService.getLocaleTextFunc(),i=t("thousandSeparator",","),s=t("decimalSeparator",".");this.setValue(r._.formatNumberCommas(e,i,s)),this.setDisplayed(e>0)}init(){}refresh(){return!0}destroy(){super.destroy()}};of([(0,r.dsm)("rowModel")],eR.prototype,"rowModel",2),of([(0,r.dsm)("selectionService")],eR.prototype,"selectionService",2),of([r.o7C],eR.prototype,"postConstruct",1);var tR=class e extends r.uAl{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}postConstruct(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,r.sVA.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,r.sVA.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")}isValidRowModel(){const e=this.rowModel.getType();return"clientSide"===e||"serverSide"===e}init(e){this.params=e}refresh(e){return this.params=e,this.onRangeSelectionChanged(),!0}setAggregationComponentValue(e,t,i){var s;const n=this.getAllowedAggregationValueComponent(e);if(r._.exists(n)&&n){const e=this.localeService.getLocaleTextFunc(),s=e("thousandSeparator",","),o=e("decimalSeparator",".");n.setValue(r._.formatNumberTwoDecimalPlacesAndCommas(t,s,o)),n.setDisplayed(i)}else null==(s=this.getAggregationValueComponent(e))||s.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){return this[`${e}AggregationComp`]}onRangeSelectionChanged(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges();let i=0,s=0,n=0,o=null,a=null;const l={};if(t&&!r._.missingOrEmpty(t)&&this.rangeService)for(let e=0;e<t.length;e++){const c=t[e];let h=this.rangeService.getRangeStartRow(c);const d=this.rangeService.getRangeEndRow(c);for(;!r._.missing(h)&&h&&!this.rowPositionUtils.before(d,h)&&h&&c.columns;)c.columns.forEach(e=>{if(null===h)return;const t=this.cellPositionUtils.createId({rowPinned:h.rowPinned,column:e,rowIndex:h.rowIndex});if(l[t])return;l[t]=!0;const c=this.rowPositionUtils.getRowNode(h);if(r._.missing(c))return;let d=this.valueService.getValue(e,c);r._.missing(d)||""===d||(s++,"object"==typeof d&&"value"in d&&(d=d.value,""===d)||("string"==typeof d&&(d=Number(d)),"number"!=typeof d||isNaN(d)||(i+=d,(null===a||d>a)&&(a=d),(null===o||d<o)&&(o=d),n++)))}),h=this.cellNavigationService.getRowBelow(h)}const c=s>1,h=n>1;this.setAggregationComponentValue("count",s,c),this.setAggregationComponentValue("sum",i,h),this.setAggregationComponentValue("min",o,h),this.setAggregationComponentValue("max",a,h),this.setAggregationComponentValue("avg",i/n,h)}};tR.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n            <ag-name-value ref="avgAggregationComp"></ag-name-value>\n            <ag-name-value ref="countAggregationComp"></ag-name-value>\n            <ag-name-value ref="minAggregationComp"></ag-name-value>\n            <ag-name-value ref="maxAggregationComp"></ag-name-value>\n            <ag-name-value ref="sumAggregationComp"></ag-name-value>\n        </div>',of([(0,r.Xx1)("rangeService")],tR.prototype,"rangeService",2),of([(0,r.dsm)("valueService")],tR.prototype,"valueService",2),of([(0,r.dsm)("cellNavigationService")],tR.prototype,"cellNavigationService",2),of([(0,r.dsm)("rowModel")],tR.prototype,"rowModel",2),of([(0,r.dsm)("cellPositionUtils")],tR.prototype,"cellPositionUtils",2),of([(0,r.dsm)("rowPositionUtils")],tR.prototype,"rowPositionUtils",2),of([(0,r.PIB)("sumAggregationComp")],tR.prototype,"sumAggregationComp",2),of([(0,r.PIB)("countAggregationComp")],tR.prototype,"countAggregationComp",2),of([(0,r.PIB)("minAggregationComp")],tR.prototype,"minAggregationComp",2),of([(0,r.PIB)("maxAggregationComp")],tR.prototype,"maxAggregationComp",2),of([(0,r.PIB)("avgAggregationComp")],tR.prototype,"avgAggregationComp",2),of([r.o7C],tR.prototype,"postConstruct",1);var iR=tR,sR={version:"31.3.4",moduleName:r.zsj.StatusBarModule,beans:[KI],agStackComponents:[{componentName:"AgStatusBar",componentClass:YI},{componentName:"AgNameValue",componentClass:XI}],userComponents:[{componentName:"agAggregationComponent",componentClass:iR},{componentName:"agSelectedRowCountComponent",componentClass:eR},{componentName:"agTotalRowCountComponent",componentClass:JI},{componentName:"agFilteredRowCountComponent",componentClass:QI},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:ZI}],dependantModules:[mf]},rR=Object.defineProperty,nR=Object.getOwnPropertyDescriptor,oR=(e,t,i,s)=>{for(var r,n=s>1?void 0:s?nR(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&rR(t,i,n),n},aR=class extends r.XQb{constructor(){super(...arguments),this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.rowHeight=this.gos.getRowHeightAsNumber(),this.addManagedListener(this.eventService,r.sVA.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this)),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroyDatasource(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getViewportRowModelPageSize(){return this.gos.get("viewportRowModelPageSize")}getViewportRowModelBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getViewportRowModelBufferSize(),i=this.getViewportRowModelPageSize(),s=e-t;return s<0?0:Math.floor(s/i)*i}calculateLastRow(e){if(-1===e)return e;const t=this.getViewportRowModelBufferSize(),i=this.getViewportRowModelPageSize(),s=e+t,r=Math.ceil(s/i)*i,n=this.rowCount-1;return Math.min(r,n)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),i=this.calculateLastRow(e.lastRow);this.firstRow===t&&this.lastRow===i||(this.firstRow=t,this.lastRow=i,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))}purgeRowsNotInViewport(){Object.keys(this.rowNodesByIndex).forEach(e=>{const t=parseInt(e,10);if(t<this.firstRow||t>this.lastRow){if(this.isRowFocused(t))return;delete this.rowNodesByIndex[t]}})}isRowFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!!t&&(null==t.rowPinned&&t.rowIndex===e)}setViewportDatasource(e){this.destroyDatasource(),this.viewportDatasource=e,this.rowCount=-1,e.init?e.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):console.warn("AG Grid: viewport is missing init method.")}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}getRowCount(){return-1===this.rowCount?0:this.rowCount}getRowIndexAtPixel(e){return 0!==this.rowHeight?Math.floor(e/this.rowHeight):0}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e={type:r.sVA.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1};this.eventService.dispatchEvent(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const i=r._.missing(e)?0:e.rowIndex,s=t.rowIndex,n=i<this.firstRow||i>this.lastRow,o=s<this.firstRow||s>this.lastRow;if(n||o)return[];const a=[],l=i<=s?s:i;for(let e=i<=s?i:s;e<=l;e++)a.push(this.rowNodesByIndex[e]);return a}forEachNode(e){let t=0;Object.keys(this.rowNodesByIndex).forEach(i=>{const s=parseInt(i,10),r=this.rowNodesByIndex[s];e(r,t),t++})}setRowData(e){r._.iterateObject(e,(e,t)=>{const i=parseInt(e,10);if(i>=this.firstRow&&i<=this.lastRow){let e=this.rowNodesByIndex[i];r._.missing(e)&&(e=this.createBlankRowNode(i),this.rowNodesByIndex[i]=e),e.setDataAndId(t,i.toString())}})}createBlankRowNode(e){const t=new r.TUE(this.beans);return t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e,this.eventService.dispatchEventOnce({type:r.sVA.EVENT_ROW_COUNT_READY});const i={type:r.sVA.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:t,animate:!1};this.eventService.dispatchEvent(i)}isRowPresent(e){return!!this.getRowNode(e.id)}};oR([(0,r.dsm)("rowRenderer")],aR.prototype,"rowRenderer",2),oR([(0,r.dsm)("focusService")],aR.prototype,"focusService",2),oR([(0,r.dsm)("beans")],aR.prototype,"beans",2),oR([r.o7C],aR.prototype,"init",1),oR([r.yah],aR.prototype,"destroyDatasource",1),aR=oR([(0,r.dR4)("rowModel")],aR);var lR={version:"31.3.4",moduleName:r.zsj.ViewportRowModelModule,rowModel:"viewport",beans:[aR],dependantModules:[mf]};nf(af,hy),r.syG.__registerModules([r.Q90,r.Sko,r.n76,cy,Aw,Fw,EE,wA,VA,ZA,xT,GT,Ry,VT,yx,yD,GD,Hx,jI,sR,lR],!1,void 0)},56137(e,t,i){"use strict";i.d(t,{W6:()=>me});var s=i(22155),r=i(54989),n=i(70316),o=i(32431),a=Object.defineProperty,l=Object.defineProperties,c=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,i)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,g=(e,t)=>{for(var i in t||(t={}))d.call(t,i)&&p(e,i,t[i]);if(h)for(var i of h(t))u.call(t,i)&&p(e,i,t[i]);return e},m=(e,t)=>l(e,c(t)),f=(0,s.createContext)({setMethods:()=>{}}),y=(0,s.memo)(e=>{const{initialProps:t,addUpdateCallback:i,CustomComponentClass:r,setMethods:n}=e,[o,a]=(0,s.useState)(t);return(0,s.useEffect)(()=>{i(e=>a(e))},[]),s.createElement(f.Provider,{value:{setMethods:n}},s.createElement(r,g({},o)))}),v=0;function C(){return"agPortalKey_"+ ++v}var b=class{constructor(e,t,i,s){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=i,this.suppressFallbackMethods=!!s,this.statelessComponent=this.isStateless(this.reactComponent),this.key=C(),this.portalKey=C(),this.instanceCreated=this.isStatelessComponent()?r.oY$.resolve(!1):new r.oY$(e=>{this.resolveInstanceCreated=e})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),i=document.createElement(t||"div");return i.classList.add("ag-react-container"),e.reactContainer=i,i}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(r._.warnOnce('Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),Object.assign(this.eParentElement.style,this.componentInstance.getReactContainerStyle())),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses())&&(r._.warnOnce('Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),this.componentInstance.getReactContainerClasses().forEach(e=>this.eParentElement.classList.add(e)))}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return"function"==typeof Symbol&&Symbol.for}isStateless(e){return"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&null!=t[e]||this.fallbackMethodAvailable(e)}callMethod(e,t){const i=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!i)return void setTimeout(()=>this.callMethod(e,t));const s=i[e];return s?s.apply(i,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.params=e,this.createOrUpdatePortal(e),new r.oY$(e=>this.createReactComponent(e))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=e=>{var t;this.componentInstance=e,this.addParentContainerStyleAndClasses(),null==(t=this.resolveInstanceCreated)||t.call(this,!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,m(g({},e),{key:this.key})),this.portal=(0,n.createPortal)(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return(0,s.createElement)(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,t=>{e(t)})}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())}valueRenderedIsNull(e){if(!this.componentType.cellRenderer)return!1;const t=console.error;try{return console.error=()=>{},""===(0,o.renderToStaticMarkup)((0,s.createElement)(this.reactComponent,e))}catch(e){}finally{console.error=t}return!1}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const i=this[`${e}Component`];if(!this.suppressFallbackMethods&&i)return i.bind(this)(t)}fallbackMethodAvailable(e){return!this.suppressFallbackMethods&&!!this[`${e}Component`]}};function S(e,t,i){e.forEach(e=>{const s=t[e];s&&(i[e]=s)})}var w=class extends b{constructor(){super(...arguments),this.awaitUpdateCallback=new r.oY$(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=y}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:e=>this.setMethods(e),addUpdateCallback:e=>{this.updateCallback=()=>(e(this.getProps()),new r.oY$(e=>{setTimeout(()=>{e()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,S(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return m(g({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new r.oY$(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},x=class extends w{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},E=class extends w{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return null!=this.model}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.model=e,this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(e){this.setModel(e).then(()=>this.sourceParams.filterChangedCallback())}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,delete e.filterModifiedCallback,delete e.valueGetter,e}};function M(e,t){e.parentFilterInstance(i=>{(i.setModel(t)||r.oY$.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var A=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=e=>this.updateModel(e)}getProps(){return m(g({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){S(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),M(this.floatingFilterParams,e)}},T=class extends w{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),M(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},D=class extends w{refresh(e){this.sourceParams=e,this.refreshProps()}},I=class extends w{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},R=class extends w{refresh(e){this.sourceParams=e,this.refreshProps()}},P=class extends w{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},k=class extends w{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}},L=class e{constructor(t,i,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=i||"div",this.refresher=t,this.maxComponentCreationTimeMs=s||e.MAX_COMPONENT_CREATION_TIME_IN_MS}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,i){this.portals=[...this.portals,e],this.waitForInstance(t,i),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,i=Date.now()){if(this.destroyed)t(null);else if(e.rendered())t(e);else{if(Date.now()-i>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate)return e.isNullValue()?void t(e):(console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),void console.error("    If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`"));window.setTimeout(()=>{this.waitForInstance(e,t,i)})}}};L.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var N=L,_=s.createContext({}),O=(...e)=>e.filter(e=>null!=e&&""!==e).join(" "),F=class e{constructor(...e){this.classesMap={},e.forEach(e=>{this.classesMap[e]=!0})}setClass(t,i){if(!!this.classesMap[t]==i)return this;const s=new e;return s.classesMap=g({},this.classesMap),s.classesMap[t]=i,s}toString(){return Object.keys(this.classesMap).filter(e=>this.classesMap[e]).join(" ")}},G=e=>"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===("function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115),B=null!=n.createRoot&&null!=n.flushSync,V=!1,H=(e,t)=>{B&&e&&!V?n.flushSync(t):t()};function U(e,t,i){if(null==t||null==e)return t;if(e===t||0===t.length&&0===e.length)return e;if(i||0===e.length&&t.length>0||e.length>0&&0===t.length)return t;const s=[],r=[],n=new Map,o=new Map;for(let e=0;e<t.length;e++){const i=t[e];o.set(i.getInstanceId(),i)}for(let t=0;t<e.length;t++){const i=e[t];n.set(i.getInstanceId(),i),o.has(i.getInstanceId())&&s.push(i)}for(let e=0;e<t.length;e++){const i=t[e],s=i.getInstanceId();n.has(s)||r.push(i)}return s.length===e.length&&0===r.length?e:0===s.length&&r.length===t.length?t:0===s.length?r:0===r.length?s:[...s,...r]}var z=(e,t,i,s)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const r=e.newAgStackInstance();if(!r)return;let n,o,a=!1;return r.then(e=>{a?t.destroyBean(e):(n=e,o=n.getGui(),i.appendChild(o),W(s,n))}),()=>{a=!0,n&&(o&&o.parentElement&&o.parentElement.removeChild(o),t.destroyBean(n),s&&W(s,void 0))}},W=(e,t)=>{e&&(e instanceof Function?e(t):e.current=t)},j=(0,s.forwardRef)((e,t)=>{var i;const n=(0,s.useContext)(_).context,o=(0,s.useRef)(null),a=(0,s.useRef)(null),l=(0,s.useRef)(null),c=(0,s.useRef)(null),h=(0,s.useRef)(null),d=(0,s.useRef)(),[u,p]=(0,s.useState)(),[m,f]=(0,s.useState)(),[y,v]=(0,s.useState)(),[C,b]=(0,s.useState)(()=>new F),[S,w]=(0,s.useState)(()=>new F("ag-hidden")),[x,E]=(0,s.useState)(()=>new F("ag-hidden")),[M,A]=(0,s.useState)(()=>new F("ag-invisible"));(0,s.useImperativeHandle)(t,()=>({refresh:()=>!1})),(0,s.useLayoutEffect)(()=>z(u,n,a.current),[u]);const T=(0,s.useCallback)(t=>{if(o.current=t,!o.current)return n.destroyBean(d.current),void(d.current=null);const i={setInnerRenderer:(e,t)=>{p(e),v(t)},setChildCount:e=>f(e),addOrRemoveCssClass:(e,t)=>b(i=>i.setClass(e,t)),setContractedDisplayed:e=>E(t=>t.setClass("ag-hidden",!e)),setExpandedDisplayed:e=>w(t=>t.setClass("ag-hidden",!e)),setCheckboxVisible:e=>A(t=>t.setClass("ag-invisible",!e))};d.current=n.createBean(new r.ihO),d.current.init(i,o.current,l.current,c.current,h.current,j,e)},[]),D=(0,s.useMemo)(()=>`ag-cell-wrapper ${C.toString()}`,[C]),I=(0,s.useMemo)(()=>`ag-group-expanded ${S.toString()}`,[S]),R=(0,s.useMemo)(()=>`ag-group-contracted ${x.toString()}`,[x]),P=(0,s.useMemo)(()=>`ag-group-checkbox ${M.toString()}`,[M]),k=u&&u.componentFromFramework,L=k?u.componentClass:void 0,N=null==u&&null!=y,O=r._.escapeString(y,!0);return s.createElement("span",g({className:D,ref:T},e.colDef?{}:{role:null==(i=d.current)?void 0:i.getCellAriaRole()}),s.createElement("span",{className:I,ref:c}),s.createElement("span",{className:R,ref:h}),s.createElement("span",{className:P,ref:l}),s.createElement("span",{className:"ag-group-value",ref:a},N&&s.createElement(s.Fragment,null,O),k&&s.createElement(L,g({},u.params))),s.createElement("span",{className:"ag-group-child-count"},m))}),K=j,$=(0,s.memo)(e=>{const{ctrl:t}=e,i=t.isAlive(),{context:n}=(0,s.useContext)(_),o=i?t.getColId():void 0,[a,l]=(0,s.useState)(),c=(0,s.useRef)(null),h=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useRef)();let p=(0,s.useRef)();i&&!p.current&&(p.current=new r.hv8(()=>c.current));const f=(0,s.useCallback)(e=>{var s;if(c.current=e,!c.current||!i)return;const n={setWidth:e=>{c.current&&(c.current.style.width=e)},addOrRemoveCssClass:(e,t)=>p.current.addOrRemoveCssClass(e,t),setAriaSort:e=>{c.current&&(e?r._.setAriaSort(c.current,e):r._.removeAriaSort(c.current))},setUserCompDetails:e=>l(e),getUserCompInstance:()=>u.current||void 0};t.setComp(n,c.current,h.current,d.current);const o=t.getSelectAllGui();null==(s=h.current)||s.insertAdjacentElement("afterend",o)},[]);(0,s.useLayoutEffect)(()=>z(a,n,d.current,u),[a]),(0,s.useEffect)(()=>{t.setDragSource(c.current)},[a]);const y=(0,s.useMemo)(()=>!(!(null==a?void 0:a.componentFromFramework)||!G(a.componentClass)),[a]),v=a&&a.componentFromFramework,C=a&&a.componentClass;return s.createElement("div",{ref:f,className:"ag-header-cell","col-id":o,role:"columnheader"},s.createElement("div",{ref:h,className:"ag-header-cell-resize",role:"presentation"}),s.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},v&&y&&s.createElement(C,g({},a.params)),v&&!y&&s.createElement(C,m(g({},a.params),{ref:u}))))}),Y=(0,s.memo)(e=>{const{context:t}=(0,s.useContext)(_),{ctrl:i}=e,[r,n]=(0,s.useState)(()=>new F),[o,a]=(0,s.useState)(()=>new F),[l,c]=(0,s.useState)("false"),[h,d]=(0,s.useState)(),[u,p]=(0,s.useState)(),f=(0,s.useMemo)(()=>i.getColId(),[]),y=(0,s.useRef)(null),v=(0,s.useRef)(null),C=(0,s.useRef)(),b=(0,s.useCallback)(e=>{if(y.current=e,!y.current)return;const t={setWidth:e=>{y.current&&(y.current.style.width=e)},addOrRemoveCssClass:(e,t)=>n(i=>i.setClass(e,t)),setUserCompDetails:e=>p(e),setResizableDisplayed:e=>{a(t=>t.setClass("ag-hidden",!e)),c(e?"false":"true")},setAriaExpanded:e=>d(e),getUserCompInstance:()=>C.current||void 0};i.setComp(t,y.current,v.current)},[]);(0,s.useLayoutEffect)(()=>z(u,t,y.current),[u]),(0,s.useEffect)(()=>{y.current&&i.setDragSource(y.current)},[u]);const S=(0,s.useMemo)(()=>!(!(null==u?void 0:u.componentFromFramework)||!G(u.componentClass)),[u]),w=(0,s.useMemo)(()=>"ag-header-group-cell "+r.toString(),[r]),x=(0,s.useMemo)(()=>"ag-header-cell-resize "+o.toString(),[o]),E=u&&u.componentFromFramework,M=u&&u.componentClass;return s.createElement("div",{ref:b,className:w,"col-id":f,role:"columnheader","aria-expanded":h},E&&S&&s.createElement(M,g({},u.params)),E&&!S&&s.createElement(M,m(g({},u.params),{ref:C})),s.createElement("div",{ref:v,"aria-hidden":l,className:x}))});function q(){r._.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var X=(0,s.memo)(e=>{const{context:t,gos:i}=(0,s.useContext)(_),[n,o]=(0,s.useState)(()=>new F("ag-header-cell","ag-floating-filter")),[a,l]=(0,s.useState)(()=>new F),[c,h]=(0,s.useState)(()=>new F("ag-floating-filter-button","ag-hidden")),[d,u]=(0,s.useState)("false"),[p,y]=(0,s.useState)(),[v,C]=(0,s.useState)(1),b=(0,s.useRef)(null),S=(0,s.useRef)(null),w=(0,s.useRef)(null),x=(0,s.useRef)(null),E=(0,s.useRef)(),M=(0,s.useRef)(),T=e=>{null!=e&&E.current&&E.current(e)},{ctrl:D}=e,I=(0,s.useCallback)(e=>{if(b.current=e,!b.current)return;M.current=new r.oY$(e=>{E.current=e});const t={addOrRemoveCssClass:(e,t)=>o(i=>i.setClass(e,t)),addOrRemoveBodyCssClass:(e,t)=>l(i=>i.setClass(e,t)),setButtonWrapperDisplayed:e=>{h(t=>t.setClass("ag-hidden",!e)),u(e?"false":"true")},setWidth:e=>{b.current&&(b.current.style.width=e)},setCompDetails:e=>y(e),getFloatingFilterComp:()=>M.current?M.current:null,setMenuIcon:e=>{var t;return null==(t=x.current)?void 0:t.appendChild(e)}};D.setComp(t,b.current,x.current,S.current)},[]);(0,s.useLayoutEffect)(()=>z(p,t,S.current,T),[p]);const R=(0,s.useMemo)(()=>n.toString(),[n]),P=(0,s.useMemo)(()=>a.toString(),[a]),k=(0,s.useMemo)(()=>c.toString(),[c]),L=(0,s.useMemo)(()=>!!(p&&p.componentFromFramework&&G(p.componentClass)),[p]),N=(0,s.useMemo)(()=>i.get("reactiveCustomComponents"),[]),O=(0,s.useMemo)(()=>{if(p){if(N){const e=new A(p.params,()=>C(e=>e+1));return T(e),e}p.componentFromFramework&&q()}},[p]),B=null==O?void 0:O.getProps(),V=p&&p.componentFromFramework,H=p&&p.componentClass;return s.createElement("div",{ref:I,className:R,role:"gridcell"},s.createElement("div",{ref:S,className:P,role:"presentation"},V&&!N&&s.createElement(H,m(g({},p.params),{ref:L?()=>{}:T})),V&&N&&s.createElement(f.Provider,{value:{setMethods:e=>O.setMethods(e)}},s.createElement(H,g({},B)))),s.createElement("div",{ref:w,"aria-hidden":d,className:k,role:"presentation"},s.createElement("button",{ref:x,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))}),Z=(0,s.memo)(e=>{const{ctrl:t}=e,{topOffset:i,rowHeight:n}=(0,s.useMemo)(()=>t.getTopAndHeight(),[]),o=t.getAriaRowIndex(),a=t.getHeaderRowClass(),[l,c]=(0,s.useState)(()=>n+"px"),[h,d]=(0,s.useState)(()=>i+"px"),u=(0,s.useRef)(null),p=(0,s.useRef)(null),[g,m]=(0,s.useState)(()=>t.getHeaderCtrls()),f=(0,s.useRef)(null),y=(0,s.useCallback)(e=>{if(f.current=e,!e)return;const i={setHeight:e=>c(e),setTop:e=>d(e),setHeaderCtrls:(e,t,i)=>{p.current=u.current,u.current=e;const s=U(p.current,e,t);s!==p.current&&H(i,()=>m(s))},setWidth:e=>{f.current&&(f.current.style.width=e)}};t.setComp(i,!1)},[]),v=(0,s.useMemo)(()=>({height:l,top:h}),[l,h]),C=(0,s.useCallback)(e=>{switch(t.getType()){case r.YtK.COLUMN_GROUP:return s.createElement(Y,{ctrl:e,key:e.getInstanceId()});case r.YtK.FLOATING_FILTER:return s.createElement(X,{ctrl:e,key:e.getInstanceId()});default:return s.createElement($,{ctrl:e,key:e.getInstanceId()})}},[]);return s.createElement("div",{ref:y,className:a,role:"row",style:v,"aria-rowindex":o},g.map(C))}),Q=(0,s.memo)(e=>{const[t,i]=(0,s.useState)(!0),[n,o]=(0,s.useState)([]),{context:a}=(0,s.useContext)(_),l=(0,s.useRef)(null),c=(0,s.useRef)(null),h=(0,s.useRef)(null),d="left"===e.pinned,u="right"===e.pinned,p=!d&&!u,g=(0,s.useCallback)(t=>{if(l.current=t,!l.current)return a.destroyBean(h.current),void(h.current=null);const s={setDisplayed:i,setCtrls:e=>o(e),setCenterWidth:e=>{c.current&&(c.current.style.width=e)},setViewportScrollLeft:e=>{l.current&&(l.current.scrollLeft=e)},setPinnedContainerWidth:e=>{l.current&&(l.current.style.width=e,l.current.style.minWidth=e,l.current.style.maxWidth=e)}};h.current=a.createBean(new r.OPU(e.pinned)),h.current.setComp(s,l.current)},[]),m=t?"":"ag-hidden",f=()=>n.map(e=>s.createElement(Z,{ctrl:e,key:e.getInstanceId()}));return s.createElement(s.Fragment,null,d&&s.createElement("div",{ref:g,className:"ag-pinned-left-header "+m,"aria-hidden":!t,role:"rowgroup"},f()),u&&s.createElement("div",{ref:g,className:"ag-pinned-right-header "+m,"aria-hidden":!t,role:"rowgroup"},f()),p&&s.createElement("div",{ref:g,className:"ag-header-viewport "+m,role:"presentation"},s.createElement("div",{ref:c,className:"ag-header-container",role:"rowgroup"},f())))}),J=(0,s.memo)(()=>{const[e,t]=(0,s.useState)(()=>new F),[i,n]=(0,s.useState)(),{context:o}=(0,s.useContext)(_),a=(0,s.useRef)(null),l=(0,s.useRef)(null),c=(0,s.useCallback)(e=>{if(a.current=e,!e)return o.destroyBean(l.current),void(l.current=null);const i={addOrRemoveCssClass:(e,i)=>t(t=>t.setClass(e,i)),setHeightAndMinHeight:e=>n(e)};l.current=o.createBean(new r.vBt),l.current.setComp(i,a.current,a.current)},[]),h=(0,s.useMemo)(()=>"ag-header "+e.toString(),[e]),d=(0,s.useMemo)(()=>({height:i,minHeight:i}),[i]);return s.createElement("div",{ref:c,className:h,style:d,role:"presentation"},s.createElement(Q,{pinned:"left"}),s.createElement(Q,{pinned:null}),s.createElement(Q,{pinned:"right"}))}),ee=(e,t)=>{(0,s.useEffect)(()=>{const i=t.current;if(i){const t=i.parentElement;if(t){const s=document.createComment(e);return t.insertBefore(s,i),()=>{t.removeChild(s)}}}},[e])},te=(0,s.memo)(e=>{const[t,i]=(0,s.useState)(),{context:o,popupService:a,localeService:l,gos:c}=(0,s.useContext)(_);return(()=>{const t=(0,s.useRef)(()=>{const{editDetails:t,cellCtrl:s,eParentCell:n}=e,{compDetails:h}=t,d=c.get("stopEditingWhenCellsLoseFocus"),u=o.createBean(new r.zmE(h.params)),p=u.getGui();if(e.jsChildComp){const t=e.jsChildComp.getGui();t&&p.appendChild(t)}const g={column:s.getColumn(),rowNode:s.getRowNode(),type:"popupCellEditor",eventSource:n,ePopup:p,position:t.popupPosition,keepWithinBounds:!0},m=a.positionPopupByComponent.bind(a,g),f=l.getLocaleTextFunc(),y=a.addPopup({modal:d,eChild:p,closeOnEsc:!0,closedCallback:()=>{s.onPopupEditorClosed()},anchorToElement:n,positionCallback:m,ariaLabel:f("ariaLabelCellEditor","Cell Editor")}),v=y?y.hideFunc:void 0;return i(u),e.jsChildComp&&e.jsChildComp.afterGuiAttached&&e.jsChildComp.afterGuiAttached(),()=>{null!=v&&v(),o.destroyBean(u)}}),n=(0,s.useRef)(),h=(0,s.useRef)(!1),d=(0,s.useRef)(!1),[,u]=(0,s.useState)(0);h.current&&(d.current=!0),(0,s.useEffect)(()=>(h.current||(n.current=t.current(),h.current=!0),u(e=>e+1),()=>{d.current&&n.current&&n.current()}),[])})(),s.createElement(s.Fragment,null,t&&e.wrappedContent&&(0,n.createPortal)(e.wrappedContent,t.getGui()))}),ie=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new r.oY$(e=>{this.resolveInstanceCreated=e}),this.onValueChange=e=>this.updateValue(e),this.value=e.value}getProps(){return m(g({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){S(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){var t;this.componentInstance=e,null==(t=this.resolveInstanceCreated)||t.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(e){this.value=e,this.refreshProps()}},se=(e,t,i)=>{const r=e.compProxy;return s.createElement(s.Fragment,null,!r&&s.createElement(t,m(g({},e.compDetails.params),{ref:i})),r&&((e,t,i)=>{const{compProxy:r}=e;i(r);const n=r.getProps(),o=G(t);return s.createElement(f.Provider,{value:{setMethods:e=>r.setMethods(e)}},o&&s.createElement(t,g({},n)),!o&&s.createElement(t,m(g({},n),{ref:e=>r.setRef(e)})))})(e,t,i))},re=(0,s.memo)(e=>{const{context:t}=(0,s.useContext)(_),{cellCtrl:i,printLayout:n,editingRow:o}=e,a=i.getTabIndex(),l=i.getColumnIdSanitised(),c=i.getInstanceId(),[h,d]=(0,s.useState)(()=>i.isCellRenderer()?void 0:{compDetails:void 0,value:i.getValueToDisplay(),force:!1}),[u,p]=(0,s.useState)(),[f,y]=(0,s.useState)(1),[v,C]=(0,s.useState)(),[b,S]=(0,s.useState)(!1),[w,x]=(0,s.useState)(!1),[E,M]=(0,s.useState)(!1),[A,T]=(0,s.useState)(),D=(0,s.useMemo)(()=>i.isForceWrapper(),[i]),I=(0,s.useMemo)(()=>i.getCellAriaRole(),[i]),R=(0,s.useRef)(null),P=(0,s.useRef)(null),k=(0,s.useRef)(),L=(0,s.useRef)(),N=(0,s.useRef)(),O=(0,s.useRef)([]),F=(0,s.useRef)(),[B,V]=(0,s.useState)(0),H=(0,s.useCallback)(e=>{F.current=e,V(e=>e+1)},[]),U=D||null!=h&&(b||E||w),z=(0,s.useCallback)((e,t)=>{L.current=t,t&&(((e,t,i)=>{const s=i.getColumn();if(!e&&t.isPopup&&t.isPopup()){const e=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor is a popup using colDef.cellEditorPopup=true. AG Grid React cannot depend on the editor component specifying if it's in a popup (via the isPopup() method on the editor), as React needs to know this information BEFORE the component is created.`;r._.doOnce(()=>console.warn(e),"jsEditorComp-isPopup-"+i.getColumn().getColId())}if(e&&t.getPopupPosition&&null!=t.getPopupPosition()){const e=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor popup position using colDef.cellEditorPopupPosition=true. AG Grid React cannot depend on the editor component specifying it's position (via the getPopupPosition() method on the editor), as React needs to know this information BEFORE the component is created.`;r._.doOnce(()=>console.warn(e),"jsEditorComp-getPopupPosition-"+i.getColumn().getColId())}})(e,t,i),t.isCancelBeforeStart&&t.isCancelBeforeStart()&&setTimeout(()=>{i.stopEditing(!0),i.focusCell(!0)}))},[i]),W=(0,s.useCallback)(e=>z(!0,e),[z]),j=(0,s.useCallback)(e=>z(!1,e),[z]);let K=(0,s.useRef)();K.current||(K.current=new r.hv8(()=>R.current)),((e,t,i,r,n,o)=>{const{context:a}=(0,s.useContext)(_),l=(0,s.useCallback)(()=>{const e=n.current;if(!e)return;const t=e.getGui();t&&t.parentElement&&t.parentElement.removeChild(t),a.destroyBean(e),n.current=void 0},[]);(0,s.useEffect)(()=>{const s=null!=e,r=e&&e.compDetails&&!e.compDetails.componentFromFramework;if(!s||!r||t&&null==i)return void l();const a=e.compDetails;if(n.current){const t=n.current,i=!(null==t.refresh||0!=e.force)&&t.refresh(a.params);if(!0===i||void 0===i)return;l()}const c=a.newAgStackInstance();if(!c)return;const h=c.resolveNow(null,e=>e);if(!h)return;const d=h.getGui();d&&((t?i:o.current).appendChild(d),n.current=h)},[e,t,r]),(0,s.useEffect)(()=>l,[])})(h,U,F.current,B,k,R);const $=(0,s.useRef)();(0,s.useLayoutEffect)(()=>{const e=$.current,t=h;if($.current=h,null==e||null==e.compDetails||null==t||null==t.compDetails)return;const i=e.compDetails,s=t.compDetails;i.componentClass==s.componentClass&&null!=P.current&&null!=P.current.refresh&&1!=P.current.refresh(s.params)&&y(e=>e+1)},[h]),(0,s.useLayoutEffect)(()=>{if(!u||u.compDetails.componentFromFramework)return;const e=u.compDetails,i=!0===u.popup,s=(e=>{const t=e.newAgStackInstance();if(t)return t.resolveNow(null,e=>e)})(e);if(!s)return;const r=s.getGui();if(z(i,s),!i){const e=(D?N:R).current;null==e||e.appendChild(r),s.afterGuiAttached&&s.afterGuiAttached()}return T(s),()=>{t.destroyBean(s),z(i,void 0),T(void 0),r&&r.parentElement&&r.parentElement.removeChild(r)}},[u]);const Y=(0,s.useCallback)(e=>{if(N.current=e,!N.current)return O.current.forEach(e=>e()),void(O.current=[]);const s=e=>{var i;if(e){const s=e.getGui();null==(i=N.current)||i.insertAdjacentElement("afterbegin",s),O.current.push(()=>{t.destroyBean(e),r._.removeFromParent(s)})}return e};b&&s(i.createSelectionCheckbox()),E&&s(i.createDndSource()),w&&s(i.createRowDragComp())},[i,t,E,w,b]),X=(0,s.useCallback)(e=>{if(R.current=e,!R.current)return;if(!i)return;const t={addOrRemoveCssClass:(e,t)=>K.current.addOrRemoveCssClass(e,t),setUserStyles:e=>C(e),getFocusableElement:()=>R.current,setIncludeSelection:e=>S(e),setIncludeRowDrag:e=>x(e),setIncludeDndSource:e=>M(e),getCellEditor:()=>L.current||null,getCellRenderer:()=>P.current?P.current:k.current,getParentOfValue:()=>F.current?F.current:N.current?N.current:R.current,setRenderDetails:(e,t,i)=>{d(s=>(null==s?void 0:s.compDetails)!==e||(null==s?void 0:s.value)!==t||(null==s?void 0:s.force)!==i?{value:t,compDetails:e,force:i}:s)},setEditDetails:(e,t,i,s)=>{if(e){let r;s?r=new ie(e.params,()=>y(e=>e+1)):e.componentFromFramework&&q(),p({compDetails:e,popup:t,popupPosition:i,compProxy:r}),t||d(void 0)}else p(e=>{(null==e?void 0:e.compProxy)&&(L.current=void 0)})}},s=N.current||void 0;i.setComp(t,R.current,s,n,o)},[]),Z=(0,s.useMemo)(()=>!!(h&&h.compDetails&&h.compDetails.componentFromFramework&&G(h.compDetails.componentClass)),[h]);(0,s.useLayoutEffect)(()=>{var e;R.current&&(K.current.addOrRemoveCssClass("ag-cell-value",!U),K.current.addOrRemoveCssClass("ag-cell-inline-editing",!!u&&!u.popup),K.current.addOrRemoveCssClass("ag-cell-popup-editing",!!u&&!!u.popup),K.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!u||!!u.popup),null==(e=i.getRowCtrl())||e.setInlineEditingCss(!!u),i.shouldRestoreFocus()&&!i.isEditing()&&R.current.focus({preventScroll:!0}))});const Q=()=>s.createElement(s.Fragment,null,null!=h&&((e,t,i,r,n,o,a)=>{const{compDetails:l,value:c}=e,h=!l,d=l&&l.componentFromFramework,u=l&&l.componentClass,p=(null==c?void 0:c.toString)?c.toString():c,f=()=>s.createElement(s.Fragment,null,h&&s.createElement(s.Fragment,null,p),d&&!o&&s.createElement(u,m(g({},l.params),{key:t,ref:r})),d&&o&&s.createElement(u,m(g({},l.params),{key:t})));return s.createElement(s.Fragment,null,n?s.createElement("span",{role:"presentation",id:`cell-${i}`,className:"ag-cell-value",ref:a},f()):f())})(h,f,c,P,U,Z,H),null!=u&&((e,t,i,r,n,o)=>{const a=e.compDetails,l=a.componentClass,c=a.componentFromFramework&&!e.popup,h=a.componentFromFramework&&e.popup,d=!a.componentFromFramework&&e.popup;return s.createElement(s.Fragment,null,c&&se(e,l,t),h&&s.createElement(te,{editDetails:e,cellCtrl:n,eParentCell:r,wrappedContent:se(e,l,i)}),d&&o&&s.createElement(te,{editDetails:e,cellCtrl:n,eParentCell:r,jsChildComp:o}))})(u,j,W,R.current,i,A));return s.createElement("div",{ref:X,style:v,tabIndex:a,role:I,"col-id":l},U?s.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:Y},Q()):Q())}),ne=(0,s.memo)(e=>{const{context:t,gos:i}=(0,s.useContext)(_),{rowCtrl:n,containerType:o}=e,a=n.getTabIndex(),l=(0,s.useRef)(n.getDomOrder()),c=n.isFullWidth(),h=n.getRowNode().displayed,[d,u]=(0,s.useState)(()=>h?n.getRowIndex():null),[p,f]=(0,s.useState)(()=>n.getRowId()),[y,v]=(0,s.useState)(()=>n.getBusinessKey()),[C,b]=(0,s.useState)(()=>n.getRowStyles()),S=(0,s.useRef)(null),w=(0,s.useRef)(null),[x,E]=(0,s.useState)(()=>null),[M,A]=(0,s.useState)(),[T,D]=(0,s.useState)(()=>h?n.getInitialRowTop(o):void 0),[I,R]=(0,s.useState)(()=>h?n.getInitialTransform(o):void 0),P=(0,s.useRef)(null),k=(0,s.useRef)(),L=(0,s.useRef)(!1),[N,O]=(0,s.useState)(0);(0,s.useEffect)(()=>{var e;if(L.current)return;if(!M)return;if(N>10)return;const t=null==(e=P.current)?void 0:e.firstChild;t?(n.setupDetailRowAutoHeight(t),L.current=!0):O(e=>e+1)},[M,N]);let F=(0,s.useRef)();F.current||(F.current=new r.hv8(()=>P.current));const B=(0,s.useCallback)(e=>{if(P.current=e,!P.current)return void n.unsetComp(o);if(!n.isAlive())return;const t={setTop:D,setTransform:R,addOrRemoveCssClass:(e,t)=>F.current.addOrRemoveCssClass(e,t),setDomOrder:e=>l.current=e,setRowIndex:u,setRowId:f,setRowBusinessKey:v,setUserStyles:b,setCellCtrls:(e,t)=>{w.current=S.current,S.current=e;const i=U(w.current,e,l.current);i!==w.current&&H(t,()=>E(i))},showFullWidth:e=>A(e),getFullWidthCellRenderer:()=>k.current,refreshFullWidth:e=>$.current?(A(t=>m(g({},t),{params:e()})),!0):!(!k.current||!k.current.refresh)&&k.current.refresh(e())};n.setComp(t,P.current,o)},[]);(0,s.useLayoutEffect)(()=>z(M,t,P.current,k),[M]);const V=(0,s.useMemo)(()=>{const e={top:T,transform:I};return Object.assign(e,C),e},[T,I,C]),W=c&&M&&M.componentFromFramework,j=!c&&null!=x,K=(0,s.useMemo)(()=>!(!(null==M?void 0:M.componentFromFramework)||!G(M.componentClass)),[M]),$=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{$.current=K&&!!M&&!!i.get("reactiveCustomComponents")},[K,M]),s.createElement("div",{ref:B,role:"row",style:V,"row-index":d,"row-id":p,"row-business-key":y,tabIndex:a},j&&(null==x?void 0:x.map(e=>s.createElement(re,{cellCtrl:e,editingRow:n.isEditing(),printLayout:n.isPrintLayout(),key:e.getInstanceId()}))),W&&(()=>{const e=M.componentClass;return s.createElement(s.Fragment,null,K&&s.createElement(e,g({},M.params)),!K&&s.createElement(e,m(g({},M.params),{ref:k})))})())}),oe=(0,s.memo)(e=>{const{context:t}=(0,s.useContext)(_),{name:i}=e,n=(0,s.useMemo)(()=>(0,r.CSq)(i),[i]),o=(0,s.useRef)(null),a=(0,s.useRef)(null),l=(0,s.useRef)([]),c=(0,s.useRef)([]),[h,d]=(0,s.useState)(()=>[]),u=(0,s.useRef)(!1),p=(0,s.useRef)(),g=(0,s.useMemo)(()=>r.Rlq.getRowContainerCssClasses(i),[i]),m=(0,s.useMemo)(()=>O(g.viewport),[g]),f=(0,s.useMemo)(()=>O(g.container),[g]),y=i===r.lon.CENTER||i===r.lon.TOP_CENTER||i===r.lon.BOTTOM_CENTER||i===r.lon.STICKY_TOP_CENTER||i===r.lon.STICKY_BOTTOM_CENTER;ee(" AG Row Container "+i+" ",y?o:a);const v=(0,s.useCallback)(()=>y?null!=o.current&&null!=a.current:null!=a.current,[]),C=(0,s.useCallback)(()=>y?null==o.current&&null==a.current:null==a.current,[]),b=(0,s.useCallback)(()=>{if(C()&&(t.destroyBean(p.current),p.current=null),v()){const e=e=>{const t=U(c.current,l.current,u.current);t!==c.current&&(c.current=t,H(e,()=>d(t)))},s={setViewportHeight:e=>{o.current&&(o.current.style.height=e)},setRowCtrls:({rowCtrls:t,useFlushSync:i})=>{const s=!!i&&l.current.length>0&&t.length>0;l.current=t,e(s)},setDomOrder:t=>{u.current!=t&&(u.current=t,e(!1))},setContainerWidth:e=>{a.current&&(a.current.style.width=e)}};p.current=t.createBean(new r.Rlq(i)),p.current.setComp(s,a.current,o.current)}},[v,C]),S=(0,s.useCallback)(e=>{a.current=e,b()},[b]),w=(0,s.useCallback)(e=>{o.current=e,b()},[b]),x=()=>s.createElement("div",{className:f,ref:S,role:"rowgroup"},h.map(e=>s.createElement(ne,{rowCtrl:e,containerType:n,key:e.getInstanceId()})));return s.createElement(s.Fragment,null,y?s.createElement("div",{className:m,ref:w,role:"presentation"},x()):x())}),ae=(0,s.memo)(()=>{const{context:e,agStackComponentsRegistry:t,resizeObserverService:i}=(0,s.useContext)(_),[n,o]=(0,s.useState)(""),[a,l]=(0,s.useState)(0),[c,h]=(0,s.useState)(0),[d,u]=(0,s.useState)("0px"),[p,g]=(0,s.useState)("0px"),[m,f]=(0,s.useState)("100%"),[y,v]=(0,s.useState)("0px"),[C,b]=(0,s.useState)("0px"),[S,w]=(0,s.useState)("100%"),[x,E]=(0,s.useState)(""),[M,A]=(0,s.useState)(""),[T,D]=(0,s.useState)(null),[I,R]=(0,s.useState)(""),[P,k]=(0,s.useState)(null),[L,N]=(0,s.useState)("ag-layout-normal");let F=(0,s.useRef)();F.current||(F.current=new r.hv8(()=>G.current));const G=(0,s.useRef)(null),B=(0,s.useRef)(null),V=(0,s.useRef)(null),H=(0,s.useRef)(null),U=(0,s.useRef)(null),z=(0,s.useRef)(null),W=(0,s.useRef)(null),j=(0,s.useRef)([]),K=(0,s.useRef)([]);ee(" AG Grid Body ",G),ee(" AG Pinned Top ",B),ee(" AG Sticky Top ",V),ee(" AG Middle ",z),ee(" AG Pinned Bottom ",W);const $=(0,s.useCallback)(s=>{if(G.current=s,!G.current)return e.destroyBeans(j.current),K.current.forEach(e=>e()),j.current=[],void(K.current=[]);if(!e)return;const n=i=>{const s=t.getComponentClass(i),r=e.createBean(new s);return j.current.push(r),r},a=(e,t)=>{e.appendChild(t),K.current.push(()=>e.removeChild(t))};a(G.current,document.createComment(" AG Fake Horizontal Scroll ")),a(G.current,n("AG-FAKE-HORIZONTAL-SCROLL").getGui()),a(G.current,document.createComment(" AG Overlay Wrapper ")),a(G.current,n("AG-OVERLAY-WRAPPER").getGui()),U.current&&(a(U.current,document.createComment(" AG Fake Vertical Scroll ")),a(U.current,n("AG-FAKE-VERTICAL-SCROLL").getGui()));const c={setRowAnimationCssOnBodyViewport:o,setColumnCount:e=>{G.current&&r._.setAriaColCount(G.current,e)},setRowCount:e=>{G.current&&r._.setAriaRowCount(G.current,e)},setTopHeight:l,setBottomHeight:h,setStickyTopHeight:u,setStickyTopTop:g,setStickyTopWidth:f,setTopDisplay:E,setBottomDisplay:A,setColumnMovingCss:(e,t)=>F.current.addOrRemoveCssClass(e,t),updateLayoutClasses:N,setAlwaysVerticalScrollClass:D,setPinnedTopBottomOverflowY:R,setCellSelectableCss:(e,t)=>k(t?e:null),setBodyViewportWidth:e=>{z.current&&(z.current.style.width=e)},registerBodyViewportResizeListener:e=>{if(z.current){const t=i.observeResize(z.current,e);K.current.push(()=>t())}},setStickyBottomHeight:v,setStickyBottomBottom:b,setStickyBottomWidth:w},d=e.createBean(new r.m20);j.current.push(d),d.setComp(c,G.current,z.current,B.current,W.current,V.current,H.current)},[]),Y=(0,s.useMemo)(()=>O("ag-root","ag-unselectable",L),[L]),q=(0,s.useMemo)(()=>O("ag-body-viewport",n,L,T,P),[n,L,T,P]),X=(0,s.useMemo)(()=>O("ag-body",L),[L]),Z=(0,s.useMemo)(()=>O("ag-floating-top",P),[P]),Q=(0,s.useMemo)(()=>O("ag-sticky-top",P),[P]),te=(0,s.useMemo)(()=>O("ag-sticky-bottom",P),[P]),ie=(0,s.useMemo)(()=>O("ag-floating-bottom",P),[P]),se=(0,s.useMemo)(()=>({height:a,minHeight:a,display:x,overflowY:I}),[a,x,I]),re=(0,s.useMemo)(()=>({height:d,top:p,width:m}),[d,p,m]),ne=(0,s.useMemo)(()=>({height:y,bottom:C,width:S}),[y,C,S]),ae=(0,s.useMemo)(()=>({height:c,minHeight:c,display:M,overflowY:I}),[c,M,I]),le=e=>s.createElement(oe,{name:e,key:`${e}-container`}),ce=({section:e,children:t,className:i,style:r})=>s.createElement("div",{ref:e,className:i,role:"presentation",style:r},t.map(le));return s.createElement("div",{ref:$,className:Y,role:"treegrid"},s.createElement(J,null),ce({section:B,className:Z,style:se,children:[r.lon.TOP_LEFT,r.lon.TOP_CENTER,r.lon.TOP_RIGHT,r.lon.TOP_FULL_WIDTH]}),s.createElement("div",{className:X,ref:U,role:"presentation"},ce({section:z,className:q,children:[r.lon.LEFT,r.lon.CENTER,r.lon.RIGHT,r.lon.FULL_WIDTH]})),ce({section:V,className:Q,style:re,children:[r.lon.STICKY_TOP_LEFT,r.lon.STICKY_TOP_CENTER,r.lon.STICKY_TOP_RIGHT,r.lon.STICKY_TOP_FULL_WIDTH]}),ce({section:H,className:te,style:ne,children:[r.lon.STICKY_BOTTOM_LEFT,r.lon.STICKY_BOTTOM_CENTER,r.lon.STICKY_BOTTOM_RIGHT,r.lon.STICKY_BOTTOM_FULL_WIDTH]}),ce({section:W,className:ie,style:ae,children:[r.lon.BOTTOM_LEFT,r.lon.BOTTOM_CENTER,r.lon.BOTTOM_RIGHT,r.lon.BOTTOM_FULL_WIDTH]}))}),le=(0,s.forwardRef)((e,t)=>{const{children:i,eFocusableElement:n,onTabKeyDown:o,gridCtrl:a,forceFocusOutWhenTabGuardsAreEmpty:l}=e,{context:c}=(0,s.useContext)(_),h=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useRef)(),p=e=>{const t=null==e?void 0:parseInt(e,10).toString();[h,d].forEach(e=>{var i,s;void 0===t?null==(i=e.current)||i.removeAttribute("tabindex"):null==(s=e.current)||s.setAttribute("tabindex",t)})};(0,s.useImperativeHandle)(t,()=>({forceFocusOutOfContainer(e){var t;null==(t=u.current)||t.forceFocusOutOfContainer(e)}}));const g=(0,s.useCallback)(()=>{if(!h.current&&!d.current)return c.destroyBean(u.current),void(u.current=null);if(h.current&&d.current){const e={setTabIndex:p};u.current=c.createBean(new r.Udn({comp:e,eTopGuard:h.current,eBottomGuard:d.current,eFocusableElement:n,onTabKeyDown:o,forceFocusOutWhenTabGuardsAreEmpty:l,focusInnerElement:e=>a.focusInnerElement(e)}))}},[]),m=(0,s.useCallback)(e=>{h.current=e,g()},[g]),f=(0,s.useCallback)(e=>{d.current=e,g()},[g]),y=e=>{const t="top"===e?r.pA9.TAB_GUARD_TOP:r.pA9.TAB_GUARD_BOTTOM;return s.createElement("div",{className:`${r.pA9.TAB_GUARD} ${t}`,role:"presentation",ref:"top"===e?m:f})};return s.createElement(s.Fragment,null,y("top"),i,y("bottom"))}),ce=(0,s.memo)(le),he=(0,s.memo)(({context:e})=>{const[t,i]=(0,s.useState)(""),[n,o]=(0,s.useState)(""),[a,l]=(0,s.useState)(""),[c,h]=(0,s.useState)(null),[d,u]=(0,s.useState)(null),[p,g]=(0,s.useState)(!1),[m,f]=(0,s.useState)(),y=(0,s.useRef)(null),v=(0,s.useRef)(null),C=(0,s.useRef)(),[b,S]=(0,s.useState)(null),w=(0,s.useRef)(()=>{}),x=(0,s.useCallback)(()=>{},[]),E=(0,s.useMemo)(()=>e.isDestroyed()?null:e.getBean("beans"),[e]);ee(" AG Grid ",v);const M=(0,s.useCallback)(t=>{if(v.current=t,!v.current)return e.destroyBean(y.current),void(y.current=null);if(e.isDestroyed())return;y.current=e.createBean(new r.s1r);const s=y.current;w.current=s.focusInnerElement.bind(s);const n={destroyGridUi:()=>{},setRtlClass:i,forceFocusOutOfContainer:e=>{var t;null==(t=C.current)||t.forceFocusOutOfContainer(e)},updateLayoutClasses:l,getFocusableContainers:()=>{var e,t;const i=[],s=null==(e=v.current)?void 0:e.querySelector(".ag-root"),r=null==(t=v.current)?void 0:t.querySelector(".ag-side-bar:not(.ag-hidden)");return s&&i.push(s),r&&i.push(r),i},setCursor:h,setUserSelect:u};s.setComp(n,v.current,v.current),g(!0)},[]);(0,s.useEffect)(()=>{if(!(m&&E&&y.current&&b&&v.current))return;const t=y.current,i=[],{agStackComponentsRegistry:s}=E,r=s.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),n=s.getComponentClass("AG-SIDE-BAR"),o=s.getComponentClass("AG-STATUS-BAR"),a=s.getComponentClass("AG-WATERMARK"),l=s.getComponentClass("AG-PAGINATION"),c=[],h=v.current;if(t.showDropZones()&&r){const t=e.createBean(new r),s=t.getGui();h.insertAdjacentElement("afterbegin",s),c.push(s),i.push(t)}if(t.showSideBar()&&n){const t=e.createBean(new n),s=t.getGui(),r=b.querySelector(".ag-tab-guard-bottom");r&&(r.insertAdjacentElement("beforebegin",s),c.push(s)),i.push(t)}if(t.showStatusBar()&&o){const t=e.createBean(new o),s=t.getGui();h.insertAdjacentElement("beforeend",s),c.push(s),i.push(t)}if(l){const t=e.createBean(new l),s=t.getGui();h.insertAdjacentElement("beforeend",s),c.push(s),i.push(t)}if(t.showWatermark()&&a){const t=e.createBean(new a),s=t.getGui();h.insertAdjacentElement("beforeend",s),c.push(s),i.push(t)}return()=>{e.destroyBeans(i),c.forEach(e=>{e.parentElement&&e.parentElement.removeChild(e)})}},[m,b,E]);const A=(0,s.useMemo)(()=>O("ag-root-wrapper",t,n,a),[t,n,a]),T=(0,s.useMemo)(()=>O("ag-root-wrapper-body","ag-focus-managed",a),[a]),D=(0,s.useMemo)(()=>({userSelect:null!=d?d:"",WebkitUserSelect:null!=d?d:"",cursor:null!=c?c:""}),[d,c]),I=(0,s.useCallback)(e=>{C.current=e,f(null!==e)},[]);return s.createElement("div",{ref:M,className:A,style:D,role:"presentation"},s.createElement("div",{className:T,ref:S,role:"presentation"},p&&b&&E&&s.createElement(_.Provider,{value:E},s.createElement(ce,{ref:I,eFocusableElement:b,onTabKeyDown:x,gridCtrl:y.current,forceFocusOutWhenTabGuardsAreEmpty:!0},s.createElement(ae,null)))))}),de=e=>{var t,i;const n=(0,s.useRef)(),o=(0,s.useRef)(null),a=(0,s.useRef)(null),l=(0,s.useRef)([]),c=(0,s.useRef)([]),h=(0,s.useRef)(e),d=(0,s.useRef)(!1),[u,p]=(0,s.useState)(void 0),[,m]=(0,s.useState)(0),f=(0,s.useCallback)(t=>{if(o.current=t,!o.current)return l.current.forEach(e=>e()),void(l.current.length=0);const i=e.modules||[];a.current||(a.current=new N(()=>m(e=>e+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),l.current.push(()=>{var e;null==(e=a.current)||e.destroy(),a.current=null}));const s=r.kNx.combineAttributesAndGridOptions(e.gridOptions,e),h={providedBeanInstances:{frameworkComponentWrapper:new ue(a.current,!!s.reactiveCustomComponents)},modules:i,frameworkOverrides:new ge},u=new r.Ug$;n.current=u.create(o.current,s,t=>{p(t),l.current.push(()=>{t.destroy()}),t.getBean(r.GsR.NAME).whenReady(()=>{if(t.isDestroyed())return;const i=n.current;i&&e.setGridApi&&e.setGridApi(i,new r.jf3(i))})},e=>{e.getBean(r.GsR.NAME).whenReady(()=>{c.current.forEach(e=>e()),c.current.length=0,d.current=!0})},h)},[]),y=(0,s.useMemo)(()=>g({height:"100%"},e.containerStyle||{}),[e.containerStyle]),v=(0,s.useCallback)(e=>{d.current?e():c.current.push(e)},[]);return(0,s.useEffect)(()=>{const t=function(e,t){const i={};return Object.keys(t).forEach(s=>{const r=t[s];e[s]!==r&&(i[s]=r)}),i}(h.current,e);h.current=e,v(()=>{n.current&&r.kNx.processOnChange(t,n.current)})},[e]),s.createElement("div",{style:y,className:e.className,ref:f},u&&!u.isDestroyed()?s.createElement(he,{context:u}):null,null!=(i=null==(t=a.current)?void 0:t.getPortals())?i:null)},ue=class extends r.Cf3{constructor(e,t){super(),this.parent=e,this.reactiveCustomComponents=t}createWrapper(e,t){if(this.reactiveCustomComponents){const i=(e=>{switch(e){case"filter":return E;case"floatingFilterComponent":return T;case"dateComponent":return x;case"loadingOverlayComponent":return D;case"noRowsOverlayComponent":return R;case"statusPanel":return P;case"toolPanel":return k;case"menuItem":return I}})(t.propertyName);if(i)return new i(e,this.parent,t)}else switch(t.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":q()}const i=!t.cellRenderer&&"toolPanel"!==t.propertyName;return new b(e,this.parent,t,i)}},pe=(0,s.forwardRef)((e,t)=>{const{ctrlsFactory:i,context:n,gos:o,resizeObserverService:a,clientSideRowModel:l,serverSideRowModel:c}=(0,s.useContext)(_),[h,d]=(0,s.useState)(()=>new F),[u,p]=(0,s.useState)(()=>new F),[f,y]=(0,s.useState)(),[v,C]=(0,s.useState)(),b=(0,s.useRef)(),S=(0,s.useRef)(null),w=(0,s.useRef)(),x=(0,s.useMemo)(()=>r.syG.__getGridRegisteredModules(e.api.getGridId()),[e]),E=(0,s.useMemo)(()=>h.toString()+" ag-details-row",[h]),M=(0,s.useMemo)(()=>u.toString()+" ag-details-grid",[u]);t&&(0,s.useImperativeHandle)(t,()=>({refresh(){var e,t;return null!=(t=null==(e=b.current)?void 0:e.refresh())&&t}})),e.template&&r._.warnOnce("detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/");const A=(0,s.useCallback)(t=>{if(S.current=t,!S.current)return n.destroyBean(b.current),void(w.current&&w.current());const s={addOrRemoveCssClass:(e,t)=>d(i=>i.setClass(e,t)),addOrRemoveDetailGridCssClass:(e,t)=>p(i=>i.setClass(e,t)),setDetailGrid:e=>y(e),setRowData:e=>C(e),getGui:()=>S.current},r=i.getInstance("detailCellRenderer");if(r&&(n.createBean(r),r.init(s,e),b.current=r,o.get("detailRowAutoHeight"))){const t=()=>{if(null==S.current)return;const t=S.current.clientHeight;null!=t&&t>0&&setTimeout(()=>{e.node.setRowHeight(t),l?l.onRowHeightChanged():c&&c.onRowHeightChanged()},0)};w.current=a.observeResize(S.current,t),t()}},[]),T=(0,s.useCallback)((e,t)=>{var i;null==(i=b.current)||i.registerDetailWithMaster(e,t)},[]);return s.createElement("div",{className:E,ref:A},f&&s.createElement(de,m(g({className:M},f),{modules:x,rowData:v,setGridApi:T})))}),ge=class extends r.pow{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:K,agGroupRowRenderer:K,agDetailCellRenderer:pe},this.wrapIncoming=(e,t)=>{return"ensureVisible"===t?(i=e,V||setTimeout(()=>V=!1,0),V=!0,i()):e();var i},this.renderingEngine="react"}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}},me=class extends s.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(e,t)=>{this.api=e,this.columnApi=t,this.apiListeners.forEach(t=>t(e))}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return s.createElement(de,m(g({},this.props),{setGridApi:this.setGridApi}))}}},80183(e,t,i){"use strict";i.d(t,{A:()=>wt});var s={};function r(e,t){return function(){return e.apply(t,arguments)}}i.r(s),i.d(s,{hasBrowserEnv:()=>Me,hasStandardBrowserEnv:()=>Te,hasStandardBrowserWebWorkerEnv:()=>De,navigator:()=>Ae,origin:()=>Ie});var n=i(85409);const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:l,toStringTag:c}=Symbol,h=(d=Object.create(null),e=>{const t=o.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const u=e=>(e=e.toLowerCase(),t=>h(t)===e),p=e=>t=>typeof t===e,{isArray:g}=Array,m=p("undefined");function f(e){return null!==e&&!m(e)&&null!==e.constructor&&!m(e.constructor)&&C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=u("ArrayBuffer"),v=p("string"),C=p("function"),b=p("number"),S=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==h(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||c in e||l in e)},x=u("Date"),E=u("File"),M=u("Blob"),A=u("FileList"),T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},D=void 0!==T.FormData?T.FormData:void 0,I=u("URLSearchParams"),[R,P,k,L]=["ReadableStream","Request","Response","Headers"].map(u);function N(e,t,{allOwnKeys:i=!1}={}){if(null==e)return;let s,r;if("object"!=typeof e&&(e=[e]),g(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(f(e))return;const r=i?Object.getOwnPropertyNames(e):Object.keys(e),n=r.length;let o;for(s=0;s<n;s++)o=r[s],t.call(null,e[o],o,e)}}function _(e,t){if(f(e))return null;t=t.toLowerCase();const i=Object.keys(e);let s,r=i.length;for(;r-- >0;)if(s=i[r],t===s.toLowerCase())return s;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:globalThis,F=e=>!m(e)&&e!==O,G=(B="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>B&&e instanceof B);var B;const V=u("HTMLFormElement"),H=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),U=u("RegExp"),z=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),s={};N(i,(i,r)=>{let n;!1!==(n=t(i,r,e))&&(s[r]=n||i)}),Object.defineProperties(e,s)},W=u("AsyncFunction"),j=(K="function"==typeof setImmediate,$=C(O.postMessage),K?setImmediate:$?(Y=`axios@${Math.random()}`,q=[],O.addEventListener("message",({source:e,data:t})=>{e===O&&t===Y&&q.length&&q.shift()()},!1),e=>{q.push(e),O.postMessage(Y,"*")}):e=>setTimeout(e));var K,$,Y,q;const X="undefined"!=typeof queueMicrotask?queueMicrotask.bind(O):void 0!==n&&n.nextTick||j,Z={isArray:g,isArrayBuffer:y,isBuffer:f,isFormData:e=>{if(!e)return!1;if(D&&e instanceof D)return!0;const t=a(e);if(!t||t===Object.prototype)return!1;if(!C(e.append))return!1;const i=h(e);return"formdata"===i||"object"===i&&C(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:v,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:w,isEmptyObject:e=>{if(!S(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:P,isResponse:k,isHeaders:L,isUndefined:m,isDate:x,isFile:E,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:M,isRegExp:U,isFunction:C,isStream:e=>S(e)&&C(e.pipe),isURLSearchParams:I,isTypedArray:G,isFileList:A,forEach:N,merge:function e(...t){const{caseless:i,skipUndefined:s}=F(this)&&this||{},r={},n=(t,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;const o=i&&_(r,n)||n,a=H(r,o)?r[o]:void 0;w(a)&&w(t)?r[o]=e(a,t):w(t)?r[o]=e({},t):g(t)?r[o]=t.slice():s&&m(t)||(r[o]=t)};for(let e=0,i=t.length;e<i;e++)t[e]&&N(t[e],n);return r},extend:(e,t,i,{allOwnKeys:s}={})=>(N(t,(t,s)=>{i&&C(t)?Object.defineProperty(e,s,{__proto__:null,value:r(t,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,s)=>{let r,n,o;const l={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),n=r.length;n-- >0;)o=r[n],s&&!s(o,e,t)||l[o]||(t[o]=e[o],l[o]=!0);e=!1!==i&&a(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:u,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;const s=e.indexOf(t,i);return-1!==s&&s===i},toArray:e=>{if(!e)return null;if(g(e))return e;let t=e.length;if(!b(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const i=(e&&e[l]).call(e);let s;for(;(s=i.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let i;const s=[];for(;null!==(i=e.exec(t));)s.push(i);return s},isHTMLForm:V,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:z,freezeMethods:e=>{z(e,(t,i)=>{if(C(e)&&["arguments","caller","callee"].includes(i))return!1;const s=e[i];C(s)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))})},toObjectSet:(e,t)=>{const i={},s=e=>{e.forEach(e=>{i[e]=!0})};return g(e)?s(e):s(String(e).split(t)),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_,global:O,isContextDefined:F,isSpecCompliantForm:function(e){return!!(e&&C(e.append)&&"FormData"===e[c]&&e[l])},toJSONObject:e=>{const t=new WeakSet,i=e=>{if(S(e)){if(t.has(e))return;if(f(e))return e;if(!("toJSON"in e)){t.add(e);const s=g(e)?[]:{};return N(e,(e,t)=>{const r=i(e);!m(r)&&(s[t]=r)}),t.delete(e),s}}return e};return i(e)},isAsyncFn:W,isThenable:e=>e&&(S(e)||C(e))&&C(e.then)&&C(e.catch),setImmediate:j,asap:X,isIterable:e=>null!=e&&C(e[l])},Q=Z.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"]),J=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ee=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function te(e,t){return Z.isArray(e)?e.map(e=>te(e,t)):function(e){let t=0,i=e.length;for(;t<i;){const i=e.charCodeAt(t);if(9!==i&&32!==i)break;t+=1}for(;i>t;){const t=e.charCodeAt(i-1);if(9!==t&&32!==t)break;i-=1}return 0===t&&i===e.length?e:e.slice(t,i)}(String(e).replace(t,""))}function ie(e){const t=Object.create(null);return Z.forEach(e.toJSON(),(e,i)=>{t[i]=(e=>te(e,ee))(e)}),t}const se=Symbol("internals");function re(e){return e&&String(e).trim().toLowerCase()}function ne(e){return!1===e||null==e?e:Z.isArray(e)?e.map(ne):(e=>te(e,J))(String(e))}function oe(e,t,i,s,r){return Z.isFunction(s)?s.call(this,t,i):(r&&(t=i),Z.isString(t)?Z.isString(s)?-1!==t.indexOf(s):Z.isRegExp(s)?s.test(t):void 0:void 0)}class ae{constructor(e){e&&this.set(e)}set(e,t,i){const s=this;function r(e,t,i){const r=re(t);if(!r)throw new Error("header name must be a non-empty string");const n=Z.findKey(s,r);(!n||void 0===s[n]||!0===i||void 0===i&&!1!==s[n])&&(s[n||t]=ne(e))}const n=(e,t)=>Z.forEach(e,(e,i)=>r(e,i,t));if(Z.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))n((e=>{const t={};let i,s,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),i=e.substring(0,r).trim().toLowerCase(),s=e.substring(r+1).trim(),!i||t[i]&&Q[i]||("set-cookie"===i?t[i]?t[i].push(s):t[i]=[s]:t[i]=t[i]?t[i]+", "+s:s)}),t})(e),t);else if(Z.isObject(e)&&Z.isIterable(e)){let i,s,r={};for(const t of e){if(!Z.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[s=t[0]]=(i=r[s])?Z.isArray(i)?[...i,t[1]]:[i,t[1]]:t[1]}n(r,t)}else null!=e&&r(t,e,i);return this}get(e,t){if(e=re(e)){const i=Z.findKey(this,e);if(i){const e=this[i];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(e);)t[s[1]]=s[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,i);if(Z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=re(e)){const i=Z.findKey(this,e);return!(!i||void 0===this[i]||t&&!oe(0,this[i],i,t))}return!1}delete(e,t){const i=this;let s=!1;function r(e){if(e=re(e)){const r=Z.findKey(i,e);!r||t&&!oe(0,i[r],r,t)||(delete i[r],s=!0)}}return Z.isArray(e)?e.forEach(r):r(e),s}clear(e){const t=Object.keys(this);let i=t.length,s=!1;for(;i--;){const r=t[i];e&&!oe(0,this[r],r,e,!0)||(delete this[r],s=!0)}return s}normalize(e){const t=this,i={};return Z.forEach(this,(s,r)=>{const n=Z.findKey(i,r);if(n)return t[n]=ne(s),void delete t[r];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}(r):String(r).trim();o!==r&&delete t[r],t[o]=ne(s),i[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,(i,s)=>{null!=i&&!1!==i&&(t[s]=e&&Z.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(e=>i.set(e)),i}static accessor(e){const t=(this[se]=this[se]={accessors:{}}).accessors,i=this.prototype;function s(e){const s=re(e);t[s]||(function(e,t){const i=Z.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+i,{__proto__:null,value:function(e,i,r){return this[s].call(this,t,e,i,r)},configurable:!0})})}(i,e),t[s]=!0)}return Z.isArray(e)?e.forEach(s):s(e),this}}ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(ae.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[i]=e}}}),Z.freezeMethods(ae);const le=ae;class ce extends Error{static from(e,t,i,s,r,n){const o=new ce(e.message,t||e.code,i,s,r);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),n&&Object.assign(o,n),o}constructor(e,t,i,s,r){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),i&&(this.config=i),s&&(this.request=s),r&&(this.response=r,this.status=r.status)}toJSON(){const e=this.config,t=e&&Z.hasOwnProp(e,"redact")?e.redact:void 0,i=Z.isArray(t)&&t.length>0?function(e,t){const i=new Set(t.map(e=>String(e).toLowerCase())),s=[],r=e=>{if(null===e||"object"!=typeof e)return e;if(Z.isBuffer(e))return e;if(-1!==s.indexOf(e))return;let t;if(e instanceof le&&(e=e.toJSON()),s.push(e),Z.isArray(e))t=[],e.forEach((e,i)=>{const s=r(e);Z.isUndefined(s)||(t[i]=s)});else{if(!Z.isPlainObject(e)&&function(e){if(Z.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return s.pop(),e;t=Object.create(null);for(const[s,n]of Object.entries(e)){const e=i.has(s.toLowerCase())?"[REDACTED ****]":r(n);Z.isUndefined(e)||(t[s]=e)}}return s.pop(),t};return r(e)}(e,t):Z.toJSONObject(e);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:i,code:this.code,status:this.status}}}ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ce.ERR_BAD_OPTION="ERR_BAD_OPTION",ce.ECONNABORTED="ECONNABORTED",ce.ETIMEDOUT="ETIMEDOUT",ce.ECONNREFUSED="ECONNREFUSED",ce.ERR_NETWORK="ERR_NETWORK",ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ce.ERR_DEPRECATED="ERR_DEPRECATED",ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ce.ERR_CANCELED="ERR_CANCELED",ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ce.ERR_INVALID_URL="ERR_INVALID_URL",ce.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const he=ce;function de(e){return Z.isPlainObject(e)||Z.isArray(e)}function ue(e){return Z.endsWith(e,"[]")?e.slice(0,-2):e}function pe(e,t,i){return e?e.concat(t).map(function(e,t){return e=ue(e),!i&&t?"["+e+"]":e}).join(i?".":""):t}const ge=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)}),me=function(e,t,i){if(!Z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(i=Z.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Z.isUndefined(t[e])})).metaTokens,r=i.visitor||d,n=i.dots,o=i.indexes,a=i.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===i.maxDepth?100:i.maxDepth,c=a&&Z.isSpecCompliantForm(t);if(!Z.isFunction(r))throw new TypeError("visitor must be a function");function h(e){if(null===e)return"";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!c&&Z.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(e)||Z.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,i,r){let a=e;if(Z.isReactNative(t)&&Z.isReactNativeBlob(e))return t.append(pe(r,i,n),h(e)),!1;if(e&&!r&&"object"==typeof e)if(Z.endsWith(i,"{}"))i=s?i:i.slice(0,-2),e=JSON.stringify(e);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(de)}(e)||(Z.isFileList(e)||Z.endsWith(i,"[]"))&&(a=Z.toArray(e)))return i=ue(i),a.forEach(function(e,s){!Z.isUndefined(e)&&null!==e&&t.append(!0===o?pe([i],s,n):null===o?i:i+"[]",h(e))}),!1;return!!de(e)||(t.append(pe(r,i,n),h(e)),!1)}const u=[],p=Object.assign(ge,{defaultVisitor:d,convertValue:h,isVisitable:de});if(!Z.isObject(e))throw new TypeError("data must be an object");return function e(i,s,n=0){if(!Z.isUndefined(i)){if(n>l)throw new he("Object is too deeply nested ("+n+" levels). Max depth: "+l,he.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+s.join("."));u.push(i),Z.forEach(i,function(i,o){!0===(!(Z.isUndefined(i)||null===i)&&r.call(t,i,Z.isString(o)?o.trim():o,s,p))&&e(i,s?s.concat(o):[o],n+1)}),u.pop()}}(e),t};function fe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ye(e,t){this._pairs=[],e&&me(e,this,t)}const ve=ye.prototype;ve.append=function(e,t){this._pairs.push([e,t])},ve.toString=function(e){const t=e?function(t){return e.call(this,t,fe)}:fe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ce=ye;function be(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Se(e,t,i){if(!t)return e;const s=i&&i.encode||be,r=Z.isFunction(i)?{serialize:i}:i,n=r&&r.serialize;let o;if(o=n?n(t,r):Z.isURLSearchParams(t)?t.toString():new Ce(t,r).toString(s),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const we=class{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Z.forEach(this.handlers,function(t){null!==t&&e(t)})}},xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ce,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Me="undefined"!=typeof window&&"undefined"!=typeof document,Ae="object"==typeof navigator&&navigator||void 0,Te=Me&&(!Ae||["ReactNative","NativeScript","NS"].indexOf(Ae.product)<0),De="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ie=Me&&window.location.href||"http://localhost",Re={...s,...Ee},Pe=function(e){function t(e,i,s,r){let n=e[r++];if("__proto__"===n)return!0;const o=Number.isFinite(+n),a=r>=e.length;return n=!n&&Z.isArray(s)?s.length:n,a?(Z.hasOwnProp(s,n)?s[n]=Z.isArray(s[n])?s[n].concat(i):[s[n],i]:s[n]=i,!o):(Z.hasOwnProp(s,n)&&Z.isObject(s[n])||(s[n]=[]),t(e,i,s[n],r)&&Z.isArray(s[n])&&(s[n]=function(e){const t={},i=Object.keys(e);let s;const r=i.length;let n;for(s=0;s<r;s++)n=i[s],t[n]=e[n];return t}(s[n])),!o)}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const i={};return Z.forEachEntry(e,(e,s)=>{t(function(e){return Z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),s,i,0)}),i}return null},ke=(e,t)=>null!=e&&Z.hasOwnProp(e,t)?e[t]:void 0,Le={transitional:xe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",s=i.indexOf("application/json")>-1,r=Z.isObject(e);if(r&&Z.isHTMLForm(e)&&(e=new FormData(e)),Z.isFormData(e))return s?JSON.stringify(Pe(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(r){const t=ke(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return me(e,new Re.classes.URLSearchParams,{visitor:function(e,t,i,s){return Re.isNode&&Z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((n=Z.isFileList(e))||i.indexOf("multipart/form-data")>-1){const i=ke(this,"env"),s=i&&i.FormData;return me(n?{"files[]":e}:e,s&&new s,t)}}return r||s?(t.setContentType("application/json",!1),function(e){if(Z.isString(e))try{return(0,JSON.parse)(e),Z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=ke(this,"transitional")||Le.transitional,i=t&&t.forcedJSONParsing,s=ke(this,"responseType"),r="json"===s;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(i&&!s||r)){const i=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,ke(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,ke(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Re.classes.FormData,Blob:Re.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],e=>{Le.headers[e]={}});const Ne=Le;function _e(e,t){const i=this||Ne,s=t||i,r=le.from(s.headers);let n=s.data;return Z.forEach(e,function(e){n=e.call(i,n,r.normalize(),t?t.status:void 0)}),r.normalize(),n}function Oe(e){return!(!e||!e.__CANCEL__)}const Fe=class extends he{constructor(e,t,i){super(null==e?"canceled":e,he.ERR_CANCELED,t,i),this.name="CanceledError",this.__CANCEL__=!0}};function Ge(e,t,i){const s=i.config.validateStatus;i.status&&s&&!s(i.status)?t(new he("Request failed with status code "+i.status,i.status>=400&&i.status<500?he.ERR_BAD_REQUEST:he.ERR_BAD_RESPONSE,i.config,i.request,i)):e(i)}const Be=(e,t,i=3)=>{let s=0;const r=function(e,t){e=e||10;const i=new Array(e),s=new Array(e);let r,n=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=s[o];r||(r=l),i[n]=a,s[n]=l;let h=o,d=0;for(;h!==n;)d+=i[h++],h%=e;if(n=(n+1)%e,n===o&&(o=(o+1)%e),l-r<t)return;const u=c&&l-c;return u?Math.round(1e3*d/u):void 0}}(50,250);return function(e,t){let i,s,r=0,n=1e3/t;const o=(t,n=Date.now())=>{r=n,i=null,s&&(clearTimeout(s),s=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-r;a>=n?o(e,t):(i=e,s||(s=setTimeout(()=>{s=null,o(i)},n-a)))},()=>i&&o(i)]}(i=>{if(!i||"number"!=typeof i.loaded)return;const n=i.loaded,o=i.lengthComputable?i.total:void 0,a=null!=o?Math.min(n,o):n,l=Math.max(0,a-s),c=r(l);s=Math.max(s,a),e({loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:c||void 0,estimated:c&&o?(o-a)/c:void 0,event:i,lengthComputable:null!=o,[t?"download":"upload"]:!0})},i)},Ve=(e,t)=>{const i=null!=e;return[s=>t[0]({lengthComputable:i,total:e,loaded:s}),t[1]]},He=e=>(...t)=>Z.asap(()=>e(...t)),Ue=Re.hasStandardBrowserEnv?((e,t)=>i=>(i=new URL(i,Re.origin),e.protocol===i.protocol&&e.host===i.host&&(t||e.port===i.port)))(new URL(Re.origin),Re.navigator&&/(msie|trident)/i.test(Re.navigator.userAgent)):()=>!0,ze=Re.hasStandardBrowserEnv?{write(e,t,i,s,r,n,o){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(i)&&a.push(`expires=${new Date(i).toUTCString()}`),Z.isString(s)&&a.push(`path=${s}`),Z.isString(r)&&a.push(`domain=${r}`),!0===n&&a.push("secure"),Z.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let i=0;i<t.length;i++){const s=t[i].replace(/^\s+/,""),r=s.indexOf("=");if(-1!==r&&s.slice(0,r)===e)return decodeURIComponent(s.slice(r+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function We(e,t,i){let s=!("string"==typeof(r=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r));var r;return e&&(s||!1===i)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const je=e=>e instanceof le?{...e}:e;function Ke(e,t){t=t||{};const i=Object.create(null);function s(e,t,i,s){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:s},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function r(e,t,i,r){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:s(void 0,e,0,r):s(e,t,0,r)}function n(e,t){if(!Z.isUndefined(t))return s(void 0,t)}function o(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function a(i,r,n){return Z.hasOwnProp(t,n)?s(i,r):Z.hasOwnProp(e,n)?s(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const l={url:n,method:n,data:n,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:a,headers:(e,t,i)=>r(je(e),je(t),0,!0)};return Z.forEach(Object.keys({...e,...t}),function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const n=Z.hasOwnProp(l,s)?l[s]:r,o=n(Z.hasOwnProp(e,s)?e[s]:void 0,Z.hasOwnProp(t,s)?t[s]:void 0,s);Z.isUndefined(o)&&n!==a||(i[s]=o)}),i}const $e=["content-type","content-length"],Ye=e=>{const t=Ke({},e),i=e=>Z.hasOwnProp(t,e)?t[e]:void 0,s=i("data");let r=i("withXSRFToken");const n=i("xsrfHeaderName"),o=i("xsrfCookieName");let a=i("headers");const l=i("auth"),c=i("baseURL"),h=i("allowAbsoluteUrls"),d=i("url");var u;if(t.headers=a=le.from(a),t.url=Se(We(c,d,h),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?(u=l.password,encodeURIComponent(u).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))):""))),Z.isFormData(s)&&(Re.hasStandardBrowserEnv||Re.hasStandardBrowserWebWorkerEnv?a.setContentType(void 0):Z.isFunction(s.getHeaders)&&function(e,t,i){"content-only"===i?Object.entries(t).forEach(([t,i])=>{$e.includes(t.toLowerCase())&&e.set(t,i)}):e.set(t)}(a,s.getHeaders(),i("formDataHeaderPolicy"))),Re.hasStandardBrowserEnv&&(Z.isFunction(r)&&(r=r(t)),!0===r||null==r&&Ue(t.url))){const e=n&&o&&ze.read(o);e&&a.set(n,e)}return t},qe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,i){const s=Ye(e);let r=s.data;const n=le.from(s.headers).normalize();let o,a,l,c,h,{responseType:d,onUploadProgress:u,onDownloadProgress:p}=s;function g(){c&&c(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(o),s.signal&&s.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function f(){if(!m)return;const s=le.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ge(function(e){t(e),g()},function(e){i(e),g()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:s,config:e,request:m}),m=null}m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout,"onloadend"in m?m.onloadend=f:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(f)},m.onabort=function(){m&&(i(new he("Request aborted",he.ECONNABORTED,e,m)),g(),m=null)},m.onerror=function(t){const s=t&&t.message?t.message:"Network Error",r=new he(s,he.ERR_NETWORK,e,m);r.event=t||null,i(r),g(),m=null},m.ontimeout=function(){let t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const r=s.transitional||xe;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),i(new he(t,r.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,m)),g(),m=null},void 0===r&&n.setContentType(null),"setRequestHeader"in m&&Z.forEach(ie(n),function(e,t){m.setRequestHeader(t,e)}),Z.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),d&&"json"!==d&&(m.responseType=s.responseType),p&&([l,h]=Be(p,!0),m.addEventListener("progress",l)),u&&m.upload&&([a,c]=Be(u),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(s.cancelToken||s.signal)&&(o=t=>{m&&(i(!t||t.type?new Fe(null,e,m):t),m.abort(),g(),m=null)},s.cancelToken&&s.cancelToken.subscribe(o),s.signal&&(s.signal.aborted?o():s.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(s.url);!y||Re.protocols.includes(y)?m.send(r||null):i(new he("Unsupported protocol "+y+":",he.ERR_BAD_REQUEST,e))})},Xe=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const i=new AbortController;let s=!1;const r=function(e){if(!s){s=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof he?t:new Fe(t instanceof Error?t.message:t))}};let n=t&&setTimeout(()=>{n=null,r(new he(`timeout of ${t}ms exceeded`,he.ETIMEDOUT))},t);const o=()=>{e&&(n&&clearTimeout(n),n=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r));const{signal:a}=i;return a.unsubscribe=()=>Z.asap(o),a},Ze=function*(e,t){let i=e.byteLength;if(!t||i<t)return void(yield e);let s,r=0;for(;r<i;)s=r+t,yield e.slice(r,s),r=s},Qe=(e,t,i,s)=>{const r=async function*(e,t){for await(const i of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:i}=await t.read();if(e)break;yield i}}finally{await t.cancel()}}(e))yield*Ze(i,t)}(e,t);let n,o=0,a=e=>{n||(n=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:s}=await r.next();if(t)return a(),void e.close();let n=s.byteLength;if(i){let e=o+=n;i(e)}e.enqueue(new Uint8Array(s))}catch(e){throw a(e),e}},cancel:e=>(a(e),r.return())},{highWaterMark:2})},Je="1.16.1",{isFunction:et}=Z,tt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},it=e=>{const t=void 0!==Z.global&&null!==Z.global?Z.global:globalThis,{ReadableStream:i,TextEncoder:s}=t;e=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:r,Request:n,Response:o}=e,a=r?et(r):"function"==typeof fetch,l=et(n),c=et(o);if(!a)return!1;const h=a&&et(i),d=a&&("function"==typeof s?(u=new s,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const p=l&&h&&tt(()=>{let e=!1;const t=new n(Re.origin,{body:new i,method:"POST",get duplex(){return e=!0,"half"}}),s=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!s}),g=c&&h&&tt(()=>Z.isReadableStream(new o("").body)),m={stream:g&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!m[e]&&(m[e]=(t,i)=>{let s=t&&t[e];if(s)return s.call(t);throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,i)})});const f=async(e,t)=>{const i=Z.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new n(Re.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=""),Z.isString(e)?(await d(e)).byteLength:void 0)})(t):i};return async e=>{let{url:t,method:i,data:a,signal:c,cancelToken:h,timeout:d,onDownloadProgress:u,onUploadProgress:y,responseType:v,headers:C,withCredentials:b="same-origin",fetchOptions:S,maxContentLength:w,maxBodyLength:x}=Ye(e);const E=Z.isNumber(w)&&w>-1,M=Z.isNumber(x)&&x>-1;let A=r||fetch;v=v?(v+"").toLowerCase():"text";let T=Xe([c,h&&h.toAbortSignal()],d),D=null;const I=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let R;try{if(E&&"string"==typeof t&&t.startsWith("data:")){const i=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const i=e.slice(5,t),s=e.slice(t+1);if(/;base64/i.test(i)){let e=s.length;const t=s.length;for(let i=0;i<t;i++)if(37===s.charCodeAt(i)&&i+2<t){const t=s.charCodeAt(i+1),r=s.charCodeAt(i+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102)&&(e-=2,i+=2)}let i=0,r=t-1;const n=e=>e>=2&&37===s.charCodeAt(e-2)&&51===s.charCodeAt(e-1)&&(68===s.charCodeAt(e)||100===s.charCodeAt(e));r>=0&&(61===s.charCodeAt(r)?(i++,r--):n(r)&&(i++,r-=3)),1===i&&r>=0&&(61===s.charCodeAt(r)||n(r))&&i++;const o=3*Math.floor(e/4)-(i||0);return o>0?o:0}if("undefined"!=typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(s,"utf8");let r=0;for(let e=0,t=s.length;e<t;e++){const i=s.charCodeAt(e);if(i<128)r+=1;else if(i<2048)r+=2;else if(i>=55296&&i<=56319&&e+1<t){const t=s.charCodeAt(e+1);t>=56320&&t<=57343?(r+=4,e++):r+=3}else r+=3}return r}(t);if(i>w)throw new he("maxContentLength size of "+w+" exceeded",he.ERR_BAD_RESPONSE,e,D)}if(M&&"get"!==i&&"head"!==i){const t=await f(C,a);if("number"==typeof t&&isFinite(t)&&t>x)throw new he("Request body larger than maxBodyLength limit",he.ERR_BAD_REQUEST,e,D)}if(y&&p&&"get"!==i&&"head"!==i&&0!==(R=await f(C,a))){let e,i=new n(t,{method:"POST",body:a,duplex:"half"});if(Z.isFormData(a)&&(e=i.headers.get("content-type"))&&C.setContentType(e),i.body){const[e,t]=Ve(R,Be(He(y)));a=Qe(i.body,65536,e,t)}}Z.isString(b)||(b=b?"include":"omit");const r=l&&"credentials"in n.prototype;if(Z.isFormData(a)){const e=C.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&C.delete("content-type")}C.set("User-Agent","axios/"+Je,!1);const c={...S,signal:T,method:i.toUpperCase(),headers:ie(C.normalize()),body:a,duplex:"half",credentials:r?b:void 0};D=l&&new n(t,c);let h=await(l?A(D,S):A(t,c));if(E){const t=Z.toFiniteNumber(h.headers.get("content-length"));if(null!=t&&t>w)throw new he("maxContentLength size of "+w+" exceeded",he.ERR_BAD_RESPONSE,e,D)}const d=g&&("stream"===v||"response"===v);if(g&&h.body&&(u||E||d&&I)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=h[e]});const i=Z.toFiniteNumber(h.headers.get("content-length")),[s,r]=u&&Ve(i,Be(He(u),!0))||[];let n=0;const a=t=>{if(E&&(n=t,n>w))throw new he("maxContentLength size of "+w+" exceeded",he.ERR_BAD_RESPONSE,e,D);s&&s(t)};h=new o(Qe(h.body,65536,a,()=>{r&&r(),I&&I()}),t)}v=v||"text";let P=await m[Z.findKey(m,v)||"text"](h,e);if(E&&!g&&!d){let t;if(null!=P&&("number"==typeof P.byteLength?t=P.byteLength:"number"==typeof P.size?t=P.size:"string"==typeof P&&(t="function"==typeof s?(new s).encode(P).byteLength:P.length)),"number"==typeof t&&t>w)throw new he("maxContentLength size of "+w+" exceeded",he.ERR_BAD_RESPONSE,e,D)}return!d&&I&&I(),await new Promise((t,i)=>{Ge(t,i,{data:P,headers:le.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:D})})}catch(t){if(I&&I(),T&&T.aborted&&T.reason instanceof he){const i=T.reason;throw i.config=e,D&&(i.request=D),t!==i&&(i.cause=t),i}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new he("Network Error",he.ERR_NETWORK,e,D,t&&t.response),{cause:t.cause||t});throw he.from(t,t&&t.code,e,D,t&&t.response)}}},st=new Map,rt=e=>{let t=e&&e.env||{};const{fetch:i,Request:s,Response:r}=t,n=[s,r,i];let o,a,l=n.length,c=st;for(;l--;)o=n[l],a=c.get(o),void 0===a&&c.set(o,a=l?new Map:it(t)),c=a;return a},nt=(rt(),{http:null,xhr:qe,fetch:{get:rt}});Z.forEach(nt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ot=e=>`- ${e}`,at=e=>Z.isFunction(e)||null===e||!1===e,lt=function(e,t){e=Z.isArray(e)?e:[e];const{length:i}=e;let s,r;const n={};for(let o=0;o<i;o++){let i;if(s=e[o],r=s,!at(s)&&(r=nt[(i=String(s)).toLowerCase()],void 0===r))throw new he(`Unknown adapter '${i}'`);if(r&&(Z.isFunction(r)||(r=r.get(t))))break;n[i||"#"+o]=r}if(!r){const e=Object.entries(n).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=i?e.length>1?"since :\n"+e.map(ot).join("\n"):" "+ot(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return r};function ct(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fe(null,e)}function ht(e){return ct(e),e.headers=le.from(e.headers),e.data=_e.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),lt(e.adapter||Ne.adapter,e)(e).then(function(t){ct(e),e.response=t;try{t.data=_e.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=le.from(t.headers),t},function(t){if(!Oe(t)&&(ct(e),t&&t.response)){e.response=t.response;try{t.response.data=_e.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=le.from(t.response.headers)}return Promise.reject(t)})}const dt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dt[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const ut={};dt.transitional=function(e,t,i){function s(e,t){return"[Axios v"+Je+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,r,n)=>{if(!1===e)throw new he(s(r," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!ut[r]&&(ut[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,r,n)}},dt.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};const pt={assertOptions:function(e,t,i){if("object"!=typeof e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const n=s[r],o=Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0;if(o){const t=e[n],i=void 0===t||o(t,n,e);if(!0!==i)throw new he("option "+n+" must be "+i,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new he("Unknown option "+n,he.ERR_BAD_OPTION)}},validators:dt},gt=pt.validators;class mt{constructor(e){this.defaults=e||{},this.interceptors={request:new we,response:new we}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const i=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(i){const t=i.indexOf("\n"),s=-1===t?-1:i.indexOf("\n",t+1),r=-1===s?"":i.slice(s+1);String(e.stack).endsWith(r)||(e.stack+="\n"+i)}}else e.stack=i}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ke(this.defaults,t);const{transitional:i,paramsSerializer:s,headers:r}=t;void 0!==i&&pt.assertOptions(i,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean),legacyInterceptorReqResOrdering:gt.transitional(gt.boolean)},!1),null!=s&&(Z.isFunction(s)?t.paramsSerializer={serialize:s}:pt.assertOptions(s,{encode:gt.function,serialize:gt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pt.assertOptions(t,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=r&&Z.merge(r.common,r[t.method]);r&&Z.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete r[e]}),t.headers=le.concat(n,r);const o=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const i=t.transitional||xe;i&&i.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let h,d=0;if(!a){const e=[ht.bind(this),void 0];for(e.unshift(...o),e.push(...l),h=e.length,c=Promise.resolve(t);d<h;)c=c.then(e[d++],e[d++]);return c}h=o.length;let u=t;for(;d<h;){const e=o[d++],t=o[d++];try{u=e(u)}catch(e){t.call(this,e);break}}try{c=ht.call(this,u)}catch(e){return Promise.reject(e)}for(d=0,h=l.length;d<h;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Se(We((e=Ke(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Z.forEach(["delete","get","head","options"],function(e){mt.prototype[e]=function(t,i){return this.request(Ke(i||{},{method:e,url:t,data:(i||{}).data}))}}),Z.forEach(["post","put","patch","query"],function(e){function t(t){return function(i,s,r){return this.request(Ke(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}mt.prototype[e]=t(),"query"!==e&&(mt.prototype[e+"Form"]=t(!0))});const ft=mt;class yt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const i=this;this.promise.then(e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null}),this.promise.then=e=>{let t;const s=new Promise(e=>{i.subscribe(e),t=e}).then(e);return s.cancel=function(){i.unsubscribe(t)},s},e(function(e,s,r){i.reason||(i.reason=new Fe(e,s,r),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new yt(function(t){e=t}),cancel:e}}}const vt=yt,Ct={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(Ct).forEach(([e,t])=>{Ct[t]=e});const bt=Ct,St=function e(t){const i=new ft(t),s=r(ft.prototype.request,i);return Z.extend(s,ft.prototype,i,{allOwnKeys:!0}),Z.extend(s,i,null,{allOwnKeys:!0}),s.create=function(i){return e(Ke(t,i))},s}(Ne);St.Axios=ft,St.CanceledError=Fe,St.CancelToken=vt,St.isCancel=Oe,St.VERSION=Je,St.toFormData=me,St.AxiosError=he,St.Cancel=St.CanceledError,St.all=function(e){return Promise.all(e)},St.spread=function(e){return function(t){return e.apply(null,t)}},St.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},St.mergeConfig=Ke,St.AxiosHeaders=le,St.formToJSON=e=>Pe(Z.isHTMLForm(e)?new FormData(e):e),St.getAdapter=lt,St.HttpStatusCode=bt,St.default=St;const wt=St},67723(e,t,i){"use strict";function s(e){if(e)throw e}i.d(t,{V:()=>s})},29942(e,t,i){"use strict";function s(e,t){const i=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let s=0,r=i.indexOf(t);for(;-1!==r;)s++,r=i.indexOf(t,r+t.length);return s}i.d(t,{D:()=>s})},5779(e,t,i){"use strict";function s(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let i,r=0;r<e.length;r++)""!==(i=s(e[r]))&&(t+=(t&&" ")+i);else for(let i in e)e[i]&&(t+=(t&&" ")+i);return t}i.d(t,{A:()=>s})},70851(e,t,i){"use strict";function s(e){var t,i,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(i=s(e[t]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i);return r}i.d(t,{A:()=>r});const r=function(){for(var e,t,i=0,r="",n=arguments.length;i<n;i++)(e=arguments[i])&&(t=s(e))&&(r&&(r+=" "),r+=t);return r}},12172(e,t,i){"use strict";function s(e,t){const i=t||{};return(""===e[e.length-1]?[...e,""]:e).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()}i.d(t,{A:()=>s})},18600(e,t,i){"use strict";var s;function r(){}function n(){n.init.call(this)}function o(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function a(e,t,i,s){var n,a,l,c;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),a=e._events),l=a[t]):(a=e._events=new r,e._eventsCount=0),l){if("function"==typeof l?l=a[t]=s?[i,l]:[l,i]:s?l.unshift(i):l.push(i),!l.warned&&(n=o(e))&&n>0&&l.length>n){l.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=l.length,c=h,"function"==typeof console.warn?console.warn(c):console.log(c)}}else l=a[t]=i,++e._eventsCount;return e}function l(e,t,i){var s=!1;function r(){e.removeListener(t,r),s||(s=!0,i.apply(e,arguments))}return r.listener=i,r}function c(e){var t=this._events;if(t){var i=t[e];if("function"==typeof i)return 1;if(i)return i.length}return 0}function h(e,t){for(var i=new Array(t);t--;)i[t]=e[t];return i}i.d(t,{As:()=>ti}),r.prototype=Object.create(null),n.EventEmitter=n,n.usingDomains=!1,n.prototype.domain=void 0,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.init=function(){this.domain=null,n.usingDomains&&(!s.active||this instanceof s.Domain||(this.domain=s.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new r,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(e){var t,i,s,r,n,o,a,l="error"===e;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(a=this.domain,l){if(t=arguments[1],!a){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(i=o[e]))return!1;var d="function"==typeof i;switch(s=arguments.length){case 1:!function(e,t,i){if(t)e.call(i);else for(var s=e.length,r=h(e,s),n=0;n<s;++n)r[n].call(i)}(i,d,this);break;case 2:!function(e,t,i,s){if(t)e.call(i,s);else for(var r=e.length,n=h(e,r),o=0;o<r;++o)n[o].call(i,s)}(i,d,this,arguments[1]);break;case 3:!function(e,t,i,s,r){if(t)e.call(i,s,r);else for(var n=e.length,o=h(e,n),a=0;a<n;++a)o[a].call(i,s,r)}(i,d,this,arguments[1],arguments[2]);break;case 4:!function(e,t,i,s,r,n){if(t)e.call(i,s,r,n);else for(var o=e.length,a=h(e,o),l=0;l<o;++l)a[l].call(i,s,r,n)}(i,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(s-1),n=1;n<s;n++)r[n-1]=arguments[n];!function(e,t,i,s){if(t)e.apply(i,s);else for(var r=e.length,n=h(e,r),o=0;o<r;++o)n[o].apply(i,s)}(i,d,this,r)}return!0},n.prototype.addListener=function(e,t){return a(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return a(this,e,t,!0)},n.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,l(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,l(this,e,t)),this},n.prototype.removeListener=function(e,t){var i,s,n,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(s=this._events))return this;if(!(i=s[e]))return this;if(i===t||i.listener&&i.listener===t)0===--this._eventsCount?this._events=new r:(delete s[e],s.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(n=-1,o=i.length;o-- >0;)if(i[o]===t||i[o].listener&&i[o].listener===t){a=i[o].listener,n=o;break}if(n<0)return this;if(1===i.length){if(i[0]=void 0,0===--this._eventsCount)return this._events=new r,this;delete s[e]}else!function(e,t){for(var i=t,s=i+1,r=e.length;s<r;i+=1,s+=1)e[i]=e[s];e.pop()}(i,n);s.removeListener&&this.emit("removeListener",e,a||t)}return this},n.prototype.removeAllListeners=function(e){var t,i;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=new r,this._eventsCount=0):i[e]&&(0===--this._eventsCount?this._events=new r:delete i[e]),this;if(0===arguments.length){for(var s,n=Object.keys(i),o=0;o<n.length;++o)"removeListener"!==(s=n[o])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=new r,this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},n.prototype.listeners=function(e){var t,i=this._events;return i&&(t=i[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(t):[]},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},n.prototype.listenerCount=c,n.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u=[],p=[],g="undefined"!=typeof Uint8Array?Uint8Array:Array,m=!1;function f(){m=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)u[t]=e[t],p[e.charCodeAt(t)]=t;p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63}function y(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function v(e,t,i){for(var s,r=[],n=t;n<i;n+=3)s=(e[n]<<16)+(e[n+1]<<8)+e[n+2],r.push(y(s));return r.join("")}function C(e){var t;m||f();for(var i=e.length,s=i%3,r="",n=[],o=16383,a=0,l=i-s;a<l;a+=o)n.push(v(e,a,a+o>l?l:a+o));return 1===s?(t=e[i-1],r+=u[t>>2],r+=u[t<<4&63],r+="=="):2===s&&(t=(e[i-2]<<8)+e[i-1],r+=u[t>>10],r+=u[t>>4&63],r+=u[t<<2&63],r+="="),n.push(r),n.join("")}function b(e,t,i,s,r){var n,o,a=8*r-s-1,l=(1<<a)-1,c=l>>1,h=-7,d=i?r-1:0,u=i?-1:1,p=e[t+d];for(d+=u,n=p&(1<<-h)-1,p>>=-h,h+=a;h>0;n=256*n+e[t+d],d+=u,h-=8);for(o=n&(1<<-h)-1,n>>=-h,h+=s;h>0;o=256*o+e[t+d],d+=u,h-=8);if(0===n)n=1-c;else{if(n===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,s),n-=c}return(p?-1:1)*o*Math.pow(2,n-s)}function S(e,t,i,s,r,n){var o,a,l,c=8*n-r-1,h=(1<<c)-1,d=h>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=s?0:n-1,g=s?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?u/l:u*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=h?(a=0,o=h):o+d>=1?(a=(t*l-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[i+p]=255&a,p+=g,a/=256,r-=8);for(o=o<<r|a,c+=r;c>0;e[i+p]=255&o,p+=g,o/=256,c-=8);e[i+p-g]|=128*m}var w={}.toString,x=Array.isArray||function(e){return"[object Array]"==w.call(e)};function E(){return A.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function M(e,t){if(E()<t)throw new RangeError("Invalid typed array length");return A.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=A.prototype:(null===e&&(e=new A(t)),e.length=t),e}function A(e,t,i){if(!(A.TYPED_ARRAY_SUPPORT||this instanceof A))return new A(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return I(this,e)}return T(this,e,t,i)}function T(e,t,i,s){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,s){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(s||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===s?new Uint8Array(t):void 0===s?new Uint8Array(t,i):new Uint8Array(t,i,s),A.TYPED_ARRAY_SUPPORT?(e=t).__proto__=A.prototype:e=R(e,t),e}(e,t,i,s):"string"==typeof t?function(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!A.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var s=0|L(t,i),r=(e=M(e,s)).write(t,i);return r!==s&&(e=e.slice(0,r)),e}(e,t,i):function(e,t){if(k(t)){var i=0|P(t.length);return 0===(e=M(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(s=t.length)!=s?M(e,0):R(e,t);if("Buffer"===t.type&&x(t.data))return R(e,t.data)}var s;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function D(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function I(e,t){if(D(t),e=M(e,t<0?0:0|P(t)),!A.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function R(e,t){var i=t.length<0?0:0|P(t.length);e=M(e,i);for(var s=0;s<i;s+=1)e[s]=255&t[s];return e}function P(e){if(e>=E())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E().toString(16)+" bytes");return 0|e}function k(e){return!(null==e||!e._isBuffer)}function L(e,t){if(k(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return oe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return ae(e).length;default:if(s)return oe(e).length;t=(""+t).toLowerCase(),s=!0}}function N(e,t,i){var s=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return q(this,t,i);case"utf8":case"utf-8":return j(this,t,i);case"ascii":return $(this,t,i);case"latin1":case"binary":return Y(this,t,i);case"base64":return W(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,t,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function _(e,t,i){var s=e[t];e[t]=e[i],e[i]=s}function O(e,t,i,s,r){if(0===e.length)return-1;if("string"==typeof i?(s=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=A.from(t,s)),k(t))return 0===t.length?-1:F(e,t,i,s,r);if("number"==typeof t)return t&=255,A.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):F(e,[t],i,s,r);throw new TypeError("val must be string, number or Buffer")}function F(e,t,i,s,r){var n,o=1,a=e.length,l=t.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(n=i;n<a;n++)if(c(e,n)===c(t,-1===h?0:n-h)){if(-1===h&&(h=n),n-h+1===l)return h*o}else-1!==h&&(n-=n-h),h=-1}else for(i+l>a&&(i=a-l),n=i;n>=0;n--){for(var d=!0,u=0;u<l;u++)if(c(e,n+u)!==c(t,u)){d=!1;break}if(d)return n}return-1}function G(e,t,i,s){i=Number(i)||0;var r=e.length-i;s?(s=Number(s))>r&&(s=r):s=r;var n=t.length;if(n%2!=0)throw new TypeError("Invalid hex string");s>n/2&&(s=n/2);for(var o=0;o<s;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[i+o]=a}return o}function B(e,t,i,s){return le(oe(t,e.length-i),e,i,s)}function V(e,t,i,s){return le(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,s)}function H(e,t,i,s){return V(e,t,i,s)}function U(e,t,i,s){return le(ae(t),e,i,s)}function z(e,t,i,s){return le(function(e,t){for(var i,s,r,n=[],o=0;o<e.length&&!((t-=2)<0);++o)s=(i=e.charCodeAt(o))>>8,r=i%256,n.push(r),n.push(s);return n}(t,e.length-i),e,i,s)}function W(e,t,i){return 0===t&&i===e.length?C(e):C(e.slice(t,i))}function j(e,t,i){i=Math.min(e.length,i);for(var s=[],r=t;r<i;){var n,o,a,l,c=e[r],h=null,d=c>239?4:c>223?3:c>191?2:1;if(r+d<=i)switch(d){case 1:c<128&&(h=c);break;case 2:128==(192&(n=e[r+1]))&&(l=(31&c)<<6|63&n)>127&&(h=l);break;case 3:n=e[r+1],o=e[r+2],128==(192&n)&&128==(192&o)&&(l=(15&c)<<12|(63&n)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[r+1],o=e[r+2],a=e[r+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,d=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|1023&h),s.push(h),r+=d}return function(e){var t=e.length;if(t<=K)return String.fromCharCode.apply(String,e);for(var i="",s=0;s<t;)i+=String.fromCharCode.apply(String,e.slice(s,s+=K));return i}(s)}A.TYPED_ARRAY_SUPPORT=void 0===d.TYPED_ARRAY_SUPPORT||d.TYPED_ARRAY_SUPPORT,E(),A.poolSize=8192,A._augment=function(e){return e.__proto__=A.prototype,e},A.from=function(e,t,i){return T(null,e,t,i)},A.TYPED_ARRAY_SUPPORT&&(A.prototype.__proto__=Uint8Array.prototype,A.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&A[Symbol.species]),A.alloc=function(e,t,i){return function(e,t,i,s){return D(t),t<=0?M(e,t):void 0!==i?"string"==typeof s?M(e,t).fill(i,s):M(e,t).fill(i):M(e,t)}(null,e,t,i)},A.allocUnsafe=function(e){return I(null,e)},A.allocUnsafeSlow=function(e){return I(null,e)},A.isBuffer=ce,A.compare=function(e,t){if(!k(e)||!k(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,s=t.length,r=0,n=Math.min(i,s);r<n;++r)if(e[r]!==t[r]){i=e[r],s=t[r];break}return i<s?-1:s<i?1:0},A.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(e,t){if(!x(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return A.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var s=A.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var n=e[i];if(!k(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(s,r),r+=n.length}return s},A.byteLength=L,A.prototype._isBuffer=!0,A.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)_(this,t,t+1);return this},A.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},A.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},A.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?j(this,0,e):N.apply(this,arguments)},A.prototype.equals=function(e){if(!k(e))throw new TypeError("Argument must be a Buffer");return this===e||0===A.compare(this,e)},A.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},A.prototype.compare=function(e,t,i,s,r){if(!k(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===s&&(s=0),void 0===r&&(r=this.length),t<0||i>e.length||s<0||r>this.length)throw new RangeError("out of range index");if(s>=r&&t>=i)return 0;if(s>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var n=(r>>>=0)-(s>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(n,o),l=this.slice(s,r),c=e.slice(t,i),h=0;h<a;++h)if(l[h]!==c[h]){n=l[h],o=c[h];break}return n<o?-1:o<n?1:0},A.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},A.prototype.indexOf=function(e,t,i){return O(this,e,t,i,!0)},A.prototype.lastIndexOf=function(e,t,i){return O(this,e,t,i,!1)},A.prototype.write=function(e,t,i,s){if(void 0===t)s="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)s=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===s&&(s="utf8")):(s=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var n=!1;;)switch(s){case"hex":return G(this,e,t,i);case"utf8":case"utf-8":return B(this,e,t,i);case"ascii":return V(this,e,t,i);case"latin1":case"binary":return H(this,e,t,i);case"base64":return U(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,t,i);default:if(n)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),n=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;function $(e,t,i){var s="";i=Math.min(e.length,i);for(var r=t;r<i;++r)s+=String.fromCharCode(127&e[r]);return s}function Y(e,t,i){var s="";i=Math.min(e.length,i);for(var r=t;r<i;++r)s+=String.fromCharCode(e[r]);return s}function q(e,t,i){var s=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>s)&&(i=s);for(var r="",n=t;n<i;++n)r+=ne(e[n]);return r}function X(e,t,i){for(var s=e.slice(t,i),r="",n=0;n<s.length;n+=2)r+=String.fromCharCode(s[n]+256*s[n+1]);return r}function Z(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function Q(e,t,i,s,r,n){if(!k(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<n)throw new RangeError('"value" argument is out of bounds');if(i+s>e.length)throw new RangeError("Index out of range")}function J(e,t,i,s){t<0&&(t=65535+t+1);for(var r=0,n=Math.min(e.length-i,2);r<n;++r)e[i+r]=(t&255<<8*(s?r:1-r))>>>8*(s?r:1-r)}function ee(e,t,i,s){t<0&&(t=4294967295+t+1);for(var r=0,n=Math.min(e.length-i,4);r<n;++r)e[i+r]=t>>>8*(s?r:3-r)&255}function te(e,t,i,s,r,n){if(i+s>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function ie(e,t,i,s,r){return r||te(e,0,i,4),S(e,t,i,s,23,4),i+4}function se(e,t,i,s,r){return r||te(e,0,i,8),S(e,t,i,s,52,8),i+8}A.prototype.slice=function(e,t){var i,s=this.length;if((e=~~e)<0?(e+=s)<0&&(e=0):e>s&&(e=s),(t=void 0===t?s:~~t)<0?(t+=s)<0&&(t=0):t>s&&(t=s),t<e&&(t=e),A.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=A.prototype;else{var r=t-e;i=new A(r,void 0);for(var n=0;n<r;++n)i[n]=this[n+e]}return i},A.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var s=this[e],r=1,n=0;++n<t&&(r*=256);)s+=this[e+n]*r;return s},A.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var s=this[e+--t],r=1;t>0&&(r*=256);)s+=this[e+--t]*r;return s},A.prototype.readUInt8=function(e,t){return t||Z(e,1,this.length),this[e]},A.prototype.readUInt16LE=function(e,t){return t||Z(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUInt16BE=function(e,t){return t||Z(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUInt32LE=function(e,t){return t||Z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},A.prototype.readUInt32BE=function(e,t){return t||Z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var s=this[e],r=1,n=0;++n<t&&(r*=256);)s+=this[e+n]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},A.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var s=t,r=1,n=this[e+--s];s>0&&(r*=256);)n+=this[e+--s]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},A.prototype.readInt8=function(e,t){return t||Z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){t||Z(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},A.prototype.readInt16BE=function(e,t){t||Z(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},A.prototype.readInt32LE=function(e,t){return t||Z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return t||Z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readFloatLE=function(e,t){return t||Z(e,4,this.length),b(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return t||Z(e,4,this.length),b(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return t||Z(e,8,this.length),b(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return t||Z(e,8,this.length),b(this,e,!1,52,8)},A.prototype.writeUIntLE=function(e,t,i,s){e=+e,t|=0,i|=0,s||Q(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,n=0;for(this[t]=255&e;++n<i&&(r*=256);)this[t+n]=e/r&255;return t+i},A.prototype.writeUIntBE=function(e,t,i,s){e=+e,t|=0,i|=0,s||Q(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,n=1;for(this[t+r]=255&e;--r>=0&&(n*=256);)this[t+r]=e/n&255;return t+i},A.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,1,255,0),A.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},A.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,65535,0),A.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):J(this,e,t,!0),t+2},A.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,65535,0),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):J(this,e,t,!1),t+2},A.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,4294967295,0),A.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):ee(this,e,t,!0),t+4},A.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,4294967295,0),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ee(this,e,t,!1),t+4},A.prototype.writeIntLE=function(e,t,i,s){if(e=+e,t|=0,!s){var r=Math.pow(2,8*i-1);Q(this,e,t,i,r-1,-r)}var n=0,o=1,a=0;for(this[t]=255&e;++n<i&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},A.prototype.writeIntBE=function(e,t,i,s){if(e=+e,t|=0,!s){var r=Math.pow(2,8*i-1);Q(this,e,t,i,r-1,-r)}var n=i-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},A.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,1,127,-128),A.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},A.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,32767,-32768),A.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):J(this,e,t,!0),t+2},A.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,32767,-32768),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):J(this,e,t,!1),t+2},A.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,2147483647,-2147483648),A.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):ee(this,e,t,!0),t+4},A.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),A.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ee(this,e,t,!1),t+4},A.prototype.writeFloatLE=function(e,t,i){return ie(this,e,t,!0,i)},A.prototype.writeFloatBE=function(e,t,i){return ie(this,e,t,!1,i)},A.prototype.writeDoubleLE=function(e,t,i){return se(this,e,t,!0,i)},A.prototype.writeDoubleBE=function(e,t,i){return se(this,e,t,!1,i)},A.prototype.copy=function(e,t,i,s){if(i||(i=0),s||0===s||(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<i&&(s=i),s===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-i&&(s=e.length-t+i);var r,n=s-i;if(this===e&&i<t&&t<s)for(r=n-1;r>=0;--r)e[r+t]=this[r+i];else if(n<1e3||!A.TYPED_ARRAY_SUPPORT)for(r=0;r<n;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+n),t);return n},A.prototype.fill=function(e,t,i,s){if("string"==typeof e){if("string"==typeof t?(s=t,t=0,i=this.length):"string"==typeof i&&(s=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!A.isEncoding(s))throw new TypeError("Unknown encoding: "+s)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var n;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(n=t;n<i;++n)this[n]=e;else{var o=k(e)?e:oe(new A(e,s).toString()),a=o.length;for(n=0;n<i-t;++n)this[n+t]=o[n%a]}return this};var re=/[^+\/0-9A-Za-z-_]/g;function ne(e){return e<16?"0"+e.toString(16):e.toString(16)}function oe(e,t){var i;t=t||1/0;for(var s=e.length,r=null,n=[],o=0;o<s;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===s){(t-=3)>-1&&n.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&n.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return n}function ae(e){return function(e){var t,i,s,r,n,o;m||f();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");n="="===e[a-2]?2:"="===e[a-1]?1:0,o=new g(3*a/4-n),s=n>0?a-4:a;var l=0;for(t=0,i=0;t<s;t+=4,i+=3)r=p[e.charCodeAt(t)]<<18|p[e.charCodeAt(t+1)]<<12|p[e.charCodeAt(t+2)]<<6|p[e.charCodeAt(t+3)],o[l++]=r>>16&255,o[l++]=r>>8&255,o[l++]=255&r;return 2===n?(r=p[e.charCodeAt(t)]<<2|p[e.charCodeAt(t+1)]>>4,o[l++]=255&r):1===n&&(r=p[e.charCodeAt(t)]<<10|p[e.charCodeAt(t+1)]<<4|p[e.charCodeAt(t+2)]>>2,o[l++]=r>>8&255,o[l++]=255&r),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(re,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function le(e,t,i,s){for(var r=0;r<s&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function ce(e){return null!=e&&(!!e._isBuffer||he(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&he(e.slice(0,0))}(e))}function he(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function de(){throw new Error("setTimeout has not been defined")}function ue(){throw new Error("clearTimeout has not been defined")}var pe=de,ge=ue;function me(e){if(pe===setTimeout)return setTimeout(e,0);if((pe===de||!pe)&&setTimeout)return pe=setTimeout,setTimeout(e,0);try{return pe(e,0)}catch(t){try{return pe.call(null,e,0)}catch(t){return pe.call(this,e,0)}}}"function"==typeof d.setTimeout&&(pe=setTimeout),"function"==typeof d.clearTimeout&&(ge=clearTimeout);var fe,ye=[],ve=!1,Ce=-1;function be(){ve&&fe&&(ve=!1,fe.length?ye=fe.concat(ye):Ce=-1,ye.length&&Se())}function Se(){if(!ve){var e=me(be);ve=!0;for(var t=ye.length;t;){for(fe=ye,ye=[];++Ce<t;)fe&&fe[Ce].run();Ce=-1,t=ye.length}fe=null,ve=!1,function(e){if(ge===clearTimeout)return clearTimeout(e);if((ge===ue||!ge)&&clearTimeout)return ge=clearTimeout,clearTimeout(e);try{return ge(e)}catch(t){try{return ge.call(null,e)}catch(t){return ge.call(this,e)}}}(e)}}function we(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];ye.push(new xe(e,t)),1!==ye.length||ve||me(Se)}function xe(e,t){this.fun=e,this.array=t}xe.prototype.run=function(){this.fun.apply(null,this.array)};var Ee=d.performance||{};Ee.now||Ee.mozNow||Ee.msNow||Ee.oNow||Ee.webkitNow;var Me={env:{}},Ae="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e},Te=/%[sdj%]/g;function De(e){if(!Ve(e)){for(var t=[],i=0;i<arguments.length;i++)t.push(ke(arguments[i]));return t.join(" ")}i=1;for(var s=arguments,r=s.length,n=String(e).replace(Te,function(e){if("%%"===e)return"%";if(i>=r)return e;switch(e){case"%s":return String(s[i++]);case"%d":return Number(s[i++]);case"%j":try{return JSON.stringify(s[i++])}catch(e){return"[Circular]"}default:return e}}),o=s[i];i<r;o=s[++i])Be(o)||!ze(o)?n+=" "+o:n+=" "+ke(o);return n}function Ie(e,t){if(He(d.process))return function(){return Ie(e,t).apply(this,arguments)};if(!0===Me.noDeprecation)return e;var i=!1;return function(){if(!i){if(Me.throwDeprecation)throw new Error(t);Me.traceDeprecation?console.trace(t):console.error(t),i=!0}return e.apply(this,arguments)}}var Re,Pe={};function ke(e,t){var i={seen:[],stylize:Ne};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),Ge(t)?i.showHidden=t:t&&function(e,t){if(!t||!ze(t))return e;for(var i=Object.keys(t),s=i.length;s--;)e[i[s]]=t[i[s]]}(i,t),He(i.showHidden)&&(i.showHidden=!1),He(i.depth)&&(i.depth=2),He(i.colors)&&(i.colors=!1),He(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=Le),_e(i,e,i.depth)}function Le(e,t){var i=ke.styles[t];return i?"["+ke.colors[i][0]+"m"+e+"["+ke.colors[i][1]+"m":e}function Ne(e,t){return e}function _e(e,t,i){if(e.customInspect&&t&&Ke(t.inspect)&&t.inspect!==ke&&(!t.constructor||t.constructor.prototype!==t)){var s=t.inspect(i,e);return Ve(s)||(s=_e(e,s,i)),s}var r=function(e,t){if(He(t))return e.stylize("undefined","undefined");if(Ve(t)){var i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string")}return"number"==typeof t?e.stylize(""+t,"number"):Ge(t)?e.stylize(""+t,"boolean"):Be(t)?e.stylize("null","null"):void 0}(e,t);if(r)return r;var n=Object.keys(t),o=function(e){var t={};return e.forEach(function(e,i){t[e]=!0}),t}(n);if(e.showHidden&&(n=Object.getOwnPropertyNames(t)),je(t)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return Oe(t);if(0===n.length){if(Ke(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Ue(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(We(t))return e.stylize(Date.prototype.toString.call(t),"date");if(je(t))return Oe(t)}var l,c,h="",d=!1,u=["{","}"];return l=t,Array.isArray(l)&&(d=!0,u=["[","]"]),Ke(t)&&(h=" [Function"+(t.name?": "+t.name:"")+"]"),Ue(t)&&(h=" "+RegExp.prototype.toString.call(t)),We(t)&&(h=" "+Date.prototype.toUTCString.call(t)),je(t)&&(h=" "+Oe(t)),0!==n.length||d&&0!=t.length?i<0?Ue(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=d?function(e,t,i,s,r){for(var n=[],o=0,a=t.length;o<a;++o)Ye(t,String(o))?n.push(Fe(e,t,i,s,String(o),!0)):n.push("");return r.forEach(function(r){r.match(/^\d+$/)||n.push(Fe(e,t,i,s,r,!0))}),n}(e,t,i,o,n):n.map(function(s){return Fe(e,t,i,o,s,d)}),e.seen.pop(),function(e,t,i){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+i[1]:i[0]+t+" "+e.join(", ")+" "+i[1]}(c,h,u)):u[0]+h+u[1]}function Oe(e){return"["+Error.prototype.toString.call(e)+"]"}function Fe(e,t,i,s,r,n){var o,a,l;if((l=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),Ye(s,r)||(o="["+r+"]"),a||(e.seen.indexOf(l.value)<0?(a=Be(i)?_e(e,l.value,null):_e(e,l.value,i-1)).indexOf("\n")>-1&&(a=n?a.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return"   "+e}).join("\n")):a=e.stylize("[Circular]","special")),He(o)){if(n&&r.match(/^\d+$/))return a;(o=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function Ge(e){return"boolean"==typeof e}function Be(e){return null===e}function Ve(e){return"string"==typeof e}function He(e){return void 0===e}function Ue(e){return ze(e)&&"[object RegExp]"===$e(e)}function ze(e){return"object"==typeof e&&null!==e}function We(e){return ze(e)&&"[object Date]"===$e(e)}function je(e){return ze(e)&&("[object Error]"===$e(e)||e instanceof Error)}function Ke(e){return"function"==typeof e}function $e(e){return Object.prototype.toString.call(e)}function Ye(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qe(){this.head=null,this.tail=null,this.length=0}ke.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ke.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},qe.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},qe.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},qe.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},qe.prototype.clear=function(){this.head=this.tail=null,this.length=0},qe.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i},qe.prototype.concat=function(e){if(0===this.length)return A.alloc(0);if(1===this.length)return this.head.data;for(var t=A.allocUnsafe(e>>>0),i=this.head,s=0;i;)i.data.copy(t,s),s+=i.data.length,i=i.next;return t};var Xe=A.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ze(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Xe(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Je;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=et;break;default:return void(this.write=Qe)}this.charBuffer=new A(6),this.charReceived=0,this.charLength=0}function Qe(e){return e.toString(this.encoding)}function Je(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function et(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Ze.prototype.write=function(e){for(var t="";this.charLength;){var i=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,i),this.charReceived+=i,this.charReceived<this.charLength)return"";if(e=e.slice(i,e.length),!((s=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&s<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s,r=e.length;if(this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived),r=(t+=e.toString(this.encoding,0,r)).length-1,(s=t.charCodeAt(r))>=55296&&s<=56319){var n=this.surrogateSize;return this.charLength+=n,this.charReceived+=n,this.charBuffer.copy(this.charBuffer,n,0,n),e.copy(this.charBuffer,0,0,n),t.substring(0,r)}return t},Ze.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var i=e[e.length-t];if(1==t&&i>>5==6){this.charLength=2;break}if(t<=2&&i>>4==14){this.charLength=3;break}if(t<=3&&i>>3==30){this.charLength=4;break}}this.charReceived=t},Ze.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var i=this.charReceived,s=this.charBuffer,r=this.encoding;t+=s.slice(0,i).toString(r)}return t},rt.ReadableState=st;var tt,it=(tt="stream",He(Re)&&(Re=Me.env.NODE_DEBUG||""),tt=tt.toUpperCase(),Pe[tt]||(new RegExp("\\b"+tt+"\\b","i").test(Re)?Pe[tt]=function(){var e=De.apply(null,arguments);console.error("%s %d: %s",tt,0,e)}:Pe[tt]=function(){}),Pe[tt]);function st(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof kt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new qe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Ze(e.encoding),this.encoding=e.encoding)}function rt(e){if(!(this instanceof rt))return new rt(e);this._readableState=new st(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),n.call(this)}function nt(e,t,i,s,r){var n=function(e,t){var i=null;return ce(t)||"string"==typeof t||null==t||e.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i}(t,i);if(n)e.emit("error",n);else if(null===i)t.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,lt(e)}}(e,t);else if(t.objectMode||i&&i.length>0)if(t.ended&&!r){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&r){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var l;!t.decoder||r||s||(i=t.decoder.write(i),l=!t.objectMode&&0===i.length),r||(t.reading=!1),l||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",i),e.read(0)):(t.length+=t.objectMode?1:i.length,r?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&lt(e))),function(e,t){t.readingMore||(t.readingMore=!0,we(ht,e,t))}(e,t)}else r||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}Ae(rt,n),rt.prototype.push=function(e,t){var i=this._readableState;return i.objectMode||"string"!=typeof e||(t=t||i.defaultEncoding)!==i.encoding&&(e=A.from(e,t),t=""),nt(this,i,e,t,!1)},rt.prototype.unshift=function(e){return nt(this,this._readableState,e,"",!0)},rt.prototype.isPaused=function(){return!1===this._readableState.flowing},rt.prototype.setEncoding=function(e){return this._readableState.decoder=new Ze(e),this._readableState.encoding=e,this};var ot=8388608;function at(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=ot?e=ot:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(it("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?we(ct,e):ct(e))}function ct(e){it("emit readable"),e.emit("readable"),pt(e)}function ht(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(it("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}function dt(e){it("readable nexttick read 0"),e.read(0)}function ut(e,t){t.reading||(it("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),pt(e),t.flowing&&!t.reading&&e.read(0)}function pt(e){var t=e._readableState;for(it("flow",t.flowing);t.flowing&&null!==e.read(););}function gt(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):i=function(e,t,i){var s;return e<t.head.data.length?(s=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):s=e===t.head.data.length?t.shift():i?function(e,t){var i=t.head,s=1,r=i.data;for(e-=r.length;i=i.next;){var n=i.data,o=e>n.length?n.length:e;if(o===n.length?r+=n:r+=n.slice(0,e),0===(e-=o)){o===n.length?(++s,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=n.slice(o));break}++s}return t.length-=s,r}(e,t):function(e,t){var i=A.allocUnsafe(e),s=t.head,r=1;for(s.data.copy(i),e-=s.data.length;s=s.next;){var n=s.data,o=e>n.length?n.length:e;if(n.copy(i,i.length-e,0,o),0===(e-=o)){o===n.length?(++r,s.next?t.head=s.next:t.head=t.tail=null):(t.head=s,s.data=n.slice(o));break}++r}return t.length-=r,i}(e,t),s}(e,t.buffer,t.decoder),i);var i}function mt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,we(ft,t,e))}function ft(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function yt(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i]===t)return i;return-1}function vt(){}function Ct(e,t,i){this.chunk=e,this.encoding=t,this.callback=i,this.next=null}function bt(e,t){Object.defineProperty(this,"buffer",{get:Ie(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof kt&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var i=e._writableState,s=i.sync,r=i.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),t)!function(e,t,i,s,r){--t.pendingcb,i?we(r,s):r(s),e._writableState.errorEmitted=!0,e.emit("error",s)}(e,i,s,t,r);else{var n=Mt(i);n||i.corked||i.bufferProcessing||!i.bufferedRequest||Et(e,i),s?we(xt,e,i,n,r):xt(e,i,n,r)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Dt(this)}function St(e){if(!(this instanceof St||this instanceof kt))return new St(e);this._writableState=new bt(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),n.call(this)}function wt(e,t,i,s,r,n,o){t.writelen=s,t.writecb=o,t.writing=!0,t.sync=!0,i?e._writev(r,t.onwrite):e._write(r,n,t.onwrite),t.sync=!1}function xt(e,t,i,s){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,s(),Tt(e,t)}function Et(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var s=t.bufferedRequestCount,r=new Array(s),n=t.corkedRequestsFree;n.entry=i;for(var o=0;i;)r[o]=i,i=i.next,o+=1;wt(e,t,!0,t.length,r,"",n.finish),t.pendingcb++,t.lastBufferedRequest=null,n.next?(t.corkedRequestsFree=n.next,n.next=null):t.corkedRequestsFree=new Dt(t)}else{for(;i;){var a=i.chunk,l=i.encoding,c=i.callback;if(wt(e,t,!1,t.objectMode?1:a.length,a,l,c),i=i.next,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=i,t.bufferProcessing=!1}function Mt(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function At(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function Tt(e,t){var i=Mt(t);return i&&(0===t.pendingcb?(At(e,t),t.finished=!0,e.emit("finish")):At(e,t)),i}function Dt(e){var t=this;this.next=null,this.entry=null,this.finish=function(i){var s=t.entry;for(t.entry=null;s;){var r=s.callback;e.pendingcb--,r(i),s=s.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}rt.prototype.read=function(e){it("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return it("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?mt(this):lt(this),null;if(0===(e=at(e,t))&&t.ended)return 0===t.length&&mt(this),null;var s,r=t.needReadable;return it("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&it("length less than watermark",r=!0),t.ended||t.reading?it("reading or ended",r=!1):r&&(it("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=at(i,t))),null===(s=e>0?gt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&mt(this)),null!==s&&this.emit("data",s),s},rt.prototype._read=function(e){this.emit("error",new Error("not implemented"))},rt.prototype.pipe=function(e,t){var i=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,it("pipe count=%d opts=%j",s.pipesCount,t);var r=t&&!1===t.end?c:o;function n(e){it("onunpipe"),e===i&&c()}function o(){it("onend"),e.end()}s.endEmitted?we(r):i.once("end",r),e.on("unpipe",n);var a=function(e){return function(){var t=e._readableState;it("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(i);e.on("drain",a);var l=!1;function c(){it("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",a),e.removeListener("error",u),e.removeListener("unpipe",n),i.removeListener("end",o),i.removeListener("end",c),i.removeListener("data",d),l=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||a()}var h=!1;function d(t){it("ondata"),h=!1,!1!==e.write(t)||h||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==yt(s.pipes,e))&&!l&&(it("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,h=!0),i.pause())}function u(t){it("onerror",t),m(),e.removeListener("error",u),0===e.listeners("error").length&&e.emit("error",t)}function p(){e.removeListener("finish",g),m()}function g(){it("onfinish"),e.removeListener("close",p),m()}function m(){it("unpipe"),i.unpipe(e)}return i.on("data",d),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",u),e.once("close",p),e.once("finish",g),e.emit("pipe",i),s.flowing||(it("pipe resume"),i.resume()),e},rt.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var i=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var r=0;r<s;r++)i[r].emit("unpipe",this);return this}var n=yt(t.pipes,e);return-1===n||(t.pipes.splice(n,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},rt.prototype.on=function(e,t){var i=n.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&lt(this):we(dt,this))}return i},rt.prototype.addListener=rt.prototype.on,rt.prototype.resume=function(){var e=this._readableState;return e.flowing||(it("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,we(ut,e,t))}(this,e)),this},rt.prototype.pause=function(){return it("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(it("pause"),this._readableState.flowing=!1,this.emit("pause")),this},rt.prototype.wrap=function(e){var t=this._readableState,i=!1,s=this;for(var r in e.on("end",function(){if(it("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&s.push(e)}s.push(null)}),e.on("data",function(r){it("wrapped data"),t.decoder&&(r=t.decoder.write(r)),t.objectMode&&null==r||(t.objectMode||r&&r.length)&&(s.push(r)||(i=!0,e.pause()))}),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));return function(e,t){for(var i=0,s=e.length;i<s;i++)t(e[i])}(["error","close","destroy","pause","resume"],function(t){e.on(t,s.emit.bind(s,t))}),s._read=function(t){it("wrapped _read",t),i&&(i=!1,e.resume())},s},rt._fromList=gt,St.WritableState=bt,Ae(St,n),bt.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},St.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},St.prototype.write=function(e,t,i){var s=this._writableState,r=!1;return"function"==typeof t&&(i=t,t=null),A.isBuffer(e)?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof i&&(i=vt),s.ended?function(e,t){var i=new Error("write after end");e.emit("error",i),we(t,i)}(this,i):function(e,t,i,s){var r=!0,n=!1;return null===i?n=new TypeError("May not write null values to stream"):A.isBuffer(i)||"string"==typeof i||void 0===i||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n&&(e.emit("error",n),we(s,n),r=!1),r}(this,s,e,i)&&(s.pendingcb++,r=function(e,t,i,s,r){i=function(e,t,i){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=A.from(t,i)),t}(t,i,s),A.isBuffer(i)&&(s="buffer");var n=t.objectMode?1:i.length;t.length+=n;var o=t.length<t.highWaterMark;if(o||(t.needDrain=!0),t.writing||t.corked){var a=t.lastBufferedRequest;t.lastBufferedRequest=new Ct(i,s,r),a?a.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else wt(e,t,!1,n,i,s,r);return o}(this,s,e,t,i)),r},St.prototype.cork=function(){this._writableState.corked++},St.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||Et(this,e))},St.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},St.prototype._write=function(e,t,i){i(new Error("not implemented"))},St.prototype._writev=null,St.prototype.end=function(e,t,i){var s=this._writableState;"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,i){t.ending=!0,Tt(e,t),i&&(t.finished?we(i):e.once("finish",i)),t.ended=!0,e.writable=!1}(this,s,i)},Ae(kt,rt);for(var It=Object.keys(St.prototype),Rt=0;Rt<It.length;Rt++){var Pt=It[Rt];kt.prototype[Pt]||(kt.prototype[Pt]=St.prototype[Pt])}function kt(e){if(!(this instanceof kt))return new kt(e);rt.call(this,e),St.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Lt)}function Lt(){this.allowHalfOpen||this._writableState.ended||we(Nt,this)}function Nt(e){e.end()}function _t(e){this.afterTransform=function(t,i){return function(e,t,i){var s=e._transformState;s.transforming=!1;var r=s.writecb;if(!r)return e.emit("error",new Error("no writecb in Transform class"));s.writechunk=null,s.writecb=null,null!=i&&e.push(i),r(t);var n=e._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&e._read(n.highWaterMark)}(e,t,i)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Ot(e){if(!(this instanceof Ot))return new Ot(e);kt.call(this,e),this._transformState=new _t(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){Ft(t,e)}):Ft(t)})}function Ft(e,t){if(t)return e.emit("error",t);var i=e._writableState,s=e._transformState;if(i.length)throw new Error("Calling transform done when ws.length != 0");if(s.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Gt(e){if(!(this instanceof Gt))return new Gt(e);Ot.call(this,e)}function Bt(){n.call(this)}Ae(Ot,kt),Ot.prototype.push=function(e,t){return this._transformState.needTransform=!1,kt.prototype.push.call(this,e,t)},Ot.prototype._transform=function(e,t,i){throw new Error("Not implemented")},Ot.prototype._write=function(e,t,i){var s=this._transformState;if(s.writecb=i,s.writechunk=e,s.writeencoding=t,!s.transforming){var r=this._readableState;(s.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},Ot.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Ae(Gt,Ot),Gt.prototype._transform=function(e,t,i){i(null,e)},Ae(Bt,n),Bt.Readable=rt,Bt.Writable=St,Bt.Duplex=kt,Bt.Transform=Ot,Bt.PassThrough=Gt,Bt.Stream=Bt,Bt.prototype.pipe=function(e,t){var i=this;function s(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function r(){i.readable&&i.resume&&i.resume()}i.on("data",s),e.on("drain",r),e._isStdio||t&&!1===t.end||(i.on("end",a),i.on("close",l));var o=!1;function a(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(h(),0===n.listenerCount(this,"error"))throw e}function h(){i.removeListener("data",s),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),e.removeListener("error",c),i.removeListener("end",h),i.removeListener("close",h),e.removeListener("close",h)}return i.on("error",c),e.on("error",c),i.on("end",h),i.on("close",h),e.on("close",h),e.emit("pipe",i),e};class Vt extends Error{constructor(e,t,...i){Array.isArray(t)&&(t=t.join(" ")),super(t),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,Vt),this.code=e;for(const e of i)for(const t in e){const i=e[t];this[t]=ce(i)?i.toString():null==i?i:JSON.parse(JSON.stringify(i))}}}const Ht=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},Ut=".".charCodeAt(0),zt=/\\(\\)?/g,Wt=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kt=/^\w*$/,$t=function(e){const t=typeof e;return"symbol"===t||"object"===t&&e&&"[object Symbol]"===function(e){return Object.prototype.toString.call(e)}(e)},Yt=function(e){if("string"==typeof e||$t(e))return e;const t=`${e}`;return"0"==t&&1/e==-INFINITY?"-0":t},qt=function(e,t){let i=0;const s=(t=function(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;const i=typeof e;return!("number"!==i&&"symbol"!==i&&"boolean"!==i&&e&&!$t(e))||Kt.test(e)||!jt.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:function(e){const t=[];return e.charCodeAt(0)===Ut&&t.push(""),e.replace(Wt,function(e,i,s,r){let n=e;s?n=r.replace(zt,"$1"):i&&(n=i.trim()),t.push(n)}),t}(e)}(t,e)).length;for(;null!=e&&i<s;)e=e[Yt(t[i++])];return i&&i===s?e:void 0},Xt=function(e){if(null==e)return[void 0,void 0];if("object"!=typeof e)return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(e)){const t=[];for(const i of e)if("string"==typeof i)t.push({key:i,header:i});else{if("object"!=typeof i||null===i||Array.isArray(i))return[Error("Invalid column definition: expect a string or an object")];if(!i.key)return[Error('Invalid column definition: property "key" is required')];void 0===i.header&&(i.header=i.key),t.push(i)}e=t}else{const t=[];for(const i in e)t.push({key:i,header:e[i]});e=t}return[void 0,e]},Zt=function(e){return e.replace(/([A-Z])/g,function(e,t){return"_"+t.toLowerCase()})},Qt=function(e){const t={};for(const i in e)t[Zt(i)]=e[i];if(void 0===t.bom||null===t.bom||!1===t.bom)t.bom=!1;else if(!0!==t.bom)return[new Vt("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(t.bom)}`])];if(void 0===t.delimiter||null===t.delimiter)t.delimiter=",";else if(ce(t.delimiter))t.delimiter=t.delimiter.toString();else if("string"!=typeof t.delimiter)return[new Vt("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(t.delimiter)}`])];if(void 0===t.quote||null===t.quote)t.quote='"';else if(!0===t.quote)t.quote='"';else if(!1===t.quote)t.quote="";else if(ce(t.quote))t.quote=t.quote.toString();else if("string"!=typeof t.quote)return[new Vt("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify(t.quote)}`])];if(void 0!==t.quoted&&null!==t.quoted||(t.quoted=!1),void 0===t.escape_formulas||null===t.escape_formulas)t.escape_formulas=!1;else if("boolean"!=typeof t.escape_formulas)return[new Vt("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE",["option `escape_formulas` must be a boolean,",`got ${JSON.stringify(t.escape_formulas)}`])];if(void 0!==t.quoted_empty&&null!==t.quoted_empty||(t.quoted_empty=void 0),void 0===t.quoted_match||null===t.quoted_match||!1===t.quoted_match?t.quoted_match=null:Array.isArray(t.quoted_match)||(t.quoted_match=[t.quoted_match]),t.quoted_match)for(const e of t.quoted_match){const t=e instanceof RegExp;if("string"!=typeof e&&!t)return[Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(e)}`)]}if(void 0!==t.quoted_string&&null!==t.quoted_string||(t.quoted_string=!1),void 0!==t.eof&&null!==t.eof||(t.eof=!0),void 0===t.escape||null===t.escape)t.escape='"';else if(ce(t.escape))t.escape=t.escape.toString();else if("string"!=typeof t.escape)return[Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(t.escape)}`)];if(t.escape.length>1)return[Error(`Invalid Option: escape must be one character, got ${t.escape.length} characters`)];void 0!==t.header&&null!==t.header||(t.header=!1);const[i,s]=Xt(t.columns);if(void 0!==i)return[i];if(t.columns=s,void 0!==t.quoted&&null!==t.quoted||(t.quoted=!1),void 0!==t.cast&&null!==t.cast||(t.cast={}),void 0!==t.cast.bigint&&null!==t.cast.bigint||(t.cast.bigint=e=>""+e),void 0!==t.cast.boolean&&null!==t.cast.boolean||(t.cast.boolean=e=>e?"1":""),void 0!==t.cast.date&&null!==t.cast.date||(t.cast.date=e=>""+e.getTime()),void 0!==t.cast.number&&null!==t.cast.number||(t.cast.number=e=>""+e),void 0!==t.cast.object&&null!==t.cast.object||(t.cast.object=e=>JSON.stringify(e)),void 0!==t.cast.string&&null!==t.cast.string||(t.cast.string=function(e){return e}),void 0!==t.on_record&&"function"!=typeof t.on_record)return[Error('Invalid Option: "on_record" must be a function.')];if(void 0===t.record_delimiter||null===t.record_delimiter)t.record_delimiter="\n";else if(ce(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if("string"!=typeof t.record_delimiter)return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter="\n";break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter="\r\n";break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028"}return[void 0,t]},Jt=A.from([239,187,191]);class ei extends Ot{constructor(e={}){super({writableObjectMode:!0,...e});const[t,i]=Qt(e);if(void 0!==t)throw t;this.options=i,this.state={stop:!1},this.info={records:0},this.api=function(e,t,i){return{options:e,state:t,info:i,__transform:function(e,t){if(!Array.isArray(e)&&"object"!=typeof e)return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(e)}`);if(0===this.info.records)if(Array.isArray(e)){if(!0===this.options.header&&void 0===this.options.columns)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(void 0===this.options.columns){const[t,i]=Xt(Object.keys(e));if(t)return;this.options.columns=i}if(0===this.info.records){this.bom(t);const e=this.headers(t);if(e)return e}try{this.options.on_record&&this.options.on_record(e,this.info.records)}catch(i){return i}let i,s;if(this.options.eof){if([i,s]=this.stringify(e),i)return i;if(void 0===s)return;s+=this.options.record_delimiter}else{if([i,s]=this.stringify(e),i)return i;if(void 0===s)return;(this.options.header||this.info.records)&&(s=this.options.record_delimiter+s)}this.info.records++,t(s)},stringify:function(e,t=!1){if("object"!=typeof e)return[void 0,e];const{columns:i}=this.options,s=[];if(Array.isArray(e)){i&&e.splice(i.length);for(let i=0;i<e.length;i++){const r=e[i],[n,o]=this.__cast(r,{index:i,column:i,records:this.info.records,header:t});if(n)return[n];s[i]=[o,r]}}else for(let r=0;r<i.length;r++){const n=qt(e,i[r].key),[o,a]=this.__cast(n,{index:r,column:i[r].key,records:this.info.records,header:t});if(o)return[o];s[r]=[a,n]}let r="";for(let e=0;e<s.length;e++){let t,i,[n,o]=s[e];if("string"==typeof n)t=this.options;else if(Ht(n)){if(t=n,n=t.value,delete t.value,"string"!=typeof n&&null!=n&&i)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(n)}`)];if(t={...this.options,...t},[i,t]=Qt(t),void 0!==i)return[i]}else{if(null!=n)return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(n)}`)];t=this.options}const{delimiter:a,escape:l,quote:c,quoted:h,quoted_empty:d,quoted_string:u,quoted_match:p,record_delimiter:g,escape_formulas:m}=t;if(""===n&&""===o){let e=p&&p.filter(e=>"string"==typeof e?-1!==n.indexOf(e):e.test(n));e=e&&e.length>0,!0===(e||!0===d||!0===u&&!1!==d)&&(n=c+n+c),r+=n}else if(n){if("string"!=typeof n)return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(n)}`)];const e=a.length&&n.indexOf(a)>=0,t=""!==c&&n.indexOf(c)>=0,i=n.indexOf(l)>=0&&l!==c,s=n.indexOf(g)>=0,d=u&&"string"==typeof o;let f=p&&p.filter(e=>"string"==typeof e?-1!==n.indexOf(e):e.test(n));if(f=f&&f.length>0,m)switch(n[0]){case"=":case"+":case"-":case"@":case"\t":case"\r":case"＝":case"＋":case"－":case"＠":n=`'${n}`}const y=!0===t||e||s||h||d||f;if(!0===y&&!0===i){const e="\\"===l?new RegExp(l+l,"g"):new RegExp(l,"g");n=n.replace(e,l+l)}if(!0===t){const e=new RegExp(c,"g");n=n.replace(e,l+c)}!0===y&&(n=c+n+c),r+=n}else(!0===d||""===o&&!0===u&&!1!==d)&&(r+=c+c);e!==s.length-1&&(r+=a)}return[void 0,r]},bom:function(e){!0===this.options.bom&&e(Jt)},headers:function(e){if(!1===this.options.header)return;if(void 0===this.options.columns)return;let t,i=this.options.columns.map(e=>e.header);if(this.options.eof?([t,i]=this.stringify(i,!0),i+=this.options.record_delimiter):[t,i]=this.stringify(i),t)return t;e(i)},__cast:function(e,t){const i=typeof e;try{return"string"===i?[void 0,this.options.cast.string(e,t)]:"bigint"===i?[void 0,this.options.cast.bigint(e,t)]:"number"===i?[void 0,this.options.cast.number(e,t)]:"boolean"===i?[void 0,this.options.cast.boolean(e,t)]:e instanceof Date?[void 0,this.options.cast.date(e,t)]:"object"===i&&null!==e?[void 0,this.options.cast.object(e,t)]:[void 0,e,e]}catch(e){return[e]}}}}(this.options,this.state,this.info),this.api.options.on_record=(...e)=>{this.emit("record",...e)}}_transform(e,t,i){if(!0===this.state.stop)return;const s=this.api.__transform(e,this.push.bind(this));void 0!==s&&(this.state.stop=!0),i(s)}_flush(e){if(!0!==this.state.stop){if(0===this.info.records){this.api.bom(this.push.bind(this));const t=this.api.headers(this.push.bind(this));t&&e(t)}e()}}}const ti=function(){let e,t,i;for(const s in arguments){const r=arguments[s],n=typeof r;if(void 0===e&&Array.isArray(r))e=r;else if(void 0===t&&Ht(r))t=r;else{if(void 0!==i||"function"!==n)throw new Vt("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(r)} at index ${s}`]);i=r}}const s=new ei(t);if(i){const e=[];s.on("readable",function(){let t;for(;null!==(t=this.read());)e.push(t)}),s.on("error",function(e){i(e)}),s.on("end",function(){try{i(void 0,e.join(""))}catch(e){return void i(e)}})}if(void 0!==e){const t=function(){for(const t of e)s.write(t);s.end()};"function"==typeof setImmediate?setImmediate(t):setTimeout(t,0)}return s}},52413(e,t,i){"use strict";function s(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function r(e,t){var i=Object.create(e.prototype);for(var s in t)i[s]=t[s];return i}function n(){}i.d(t,{Ay:()=>S,Qh:()=>E});var o=.7,a=1/o,l="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",d=/^#([0-9a-f]{3,8})$/,u=new RegExp(`^rgb\\(${l},${l},${l}\\)$`),p=new RegExp(`^rgb\\(${h},${h},${h}\\)$`),g=new RegExp(`^rgba\\(${l},${l},${l},${c}\\)$`),m=new RegExp(`^rgba\\(${h},${h},${h},${c}\\)$`),f=new RegExp(`^hsl\\(${c},${h},${h}\\)$`),y=new RegExp(`^hsla\\(${c},${h},${h},${c}\\)$`),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function C(){return this.rgb().formatHex()}function b(){return this.rgb().formatRgb()}function S(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=d.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?w(t):3===i?new M(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?x(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?x(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=u.exec(e))?new M(t[1],t[2],t[3],1):(t=p.exec(e))?new M(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=g.exec(e))?x(t[1],t[2],t[3],t[4]):(t=m.exec(e))?x(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=f.exec(e))?P(t[1],t[2]/100,t[3]/100,1):(t=y.exec(e))?P(t[1],t[2]/100,t[3]/100,t[4]):v.hasOwnProperty(e)?w(v[e]):"transparent"===e?new M(NaN,NaN,NaN,0):null}function w(e){return new M(e>>16&255,e>>8&255,255&e,1)}function x(e,t,i,s){return s<=0&&(e=t=i=NaN),new M(e,t,i,s)}function E(e,t,i,s){return 1===arguments.length?((r=e)instanceof n||(r=S(r)),r?new M((r=r.rgb()).r,r.g,r.b,r.opacity):new M):new M(e,t,i,null==s?1:s);var r}function M(e,t,i,s){this.r=+e,this.g=+t,this.b=+i,this.opacity=+s}function A(){return`#${R(this.r)}${R(this.g)}${R(this.b)}`}function T(){const e=D(this.opacity);return`${1===e?"rgb(":"rgba("}${I(this.r)}, ${I(this.g)}, ${I(this.b)}${1===e?")":`, ${e})`}`}function D(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function I(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function R(e){return((e=I(e))<16?"0":"")+e.toString(16)}function P(e,t,i,s){return s<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new L(e,t,i,s)}function k(e){if(e instanceof L)return new L(e.h,e.s,e.l,e.opacity);if(e instanceof n||(e=S(e)),!e)return new L;if(e instanceof L)return e;var t=(e=e.rgb()).r/255,i=e.g/255,s=e.b/255,r=Math.min(t,i,s),o=Math.max(t,i,s),a=NaN,l=o-r,c=(o+r)/2;return l?(a=t===o?(i-s)/l+6*(i<s):i===o?(s-t)/l+2:(t-i)/l+4,l/=c<.5?o+r:2-o-r,a*=60):l=c>0&&c<1?0:a,new L(a,l,c,e.opacity)}function L(e,t,i,s){this.h=+e,this.s=+t,this.l=+i,this.opacity=+s}function N(e){return(e=(e||0)%360)<0?e+360:e}function _(e){return Math.max(0,Math.min(1,e||0))}function O(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}s(n,S,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:C,formatHex:C,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return k(this).formatHsl()},formatRgb:b,toString:b}),s(M,E,r(n,{brighter(e){return e=null==e?a:Math.pow(a,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?o:Math.pow(o,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new M(I(this.r),I(this.g),I(this.b),D(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:A,formatHex:A,formatHex8:function(){return`#${R(this.r)}${R(this.g)}${R(this.b)}${R(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:T,toString:T})),s(L,function(e,t,i,s){return 1===arguments.length?k(e):new L(e,t,i,null==s?1:s)},r(n,{brighter(e){return e=null==e?a:Math.pow(a,e),new L(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?o:Math.pow(o,e),new L(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*t,r=2*i-s;return new M(O(e>=240?e-240:e+120,r,s),O(e,r,s),O(e<120?e+240:e-120,r,s),this.opacity)},clamp(){return new L(N(this.h),_(this.s),_(this.l),D(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=D(this.opacity);return`${1===e?"hsl(":"hsla("}${N(this.h)}, ${100*_(this.s)}%, ${100*_(this.l)}%${1===e?")":`, ${e})`}`}}))},54560(e,t,i){"use strict";i.d(t,{A:()=>l});var s={value:()=>{}};function r(){for(var e,t=0,i=arguments.length,s={};t<i;++t){if(!(e=arguments[t]+"")||e in s||/[\s.]/.test(e))throw new Error("illegal type: "+e);s[e]=[]}return new n(s)}function n(e){this._=e}function o(e,t){for(var i,s=0,r=e.length;s<r;++s)if((i=e[s]).name===t)return i.value}function a(e,t,i){for(var r=0,n=e.length;r<n;++r)if(e[r].name===t){e[r]=s,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=i&&e.push({name:t,value:i}),e}n.prototype=r.prototype={constructor:n,on:function(e,t){var i,s,r=this._,n=(s=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",i=e.indexOf(".");if(i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),e&&!s.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),l=-1,c=n.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++l<c;)if(i=(e=n[l]).type)r[i]=a(r[i],e.name,t);else if(null==t)for(i in r)r[i]=a(r[i],e.name,null);return this}for(;++l<c;)if((i=(e=n[l]).type)&&(i=o(r[i],e.name)))return i},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new n(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var i,s,r=new Array(i),n=0;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(n=0,i=(s=this._[e]).length;n<i;++n)s[n].value.apply(t,r)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,n=s.length;r<n;++r)s[r].value.apply(t,i)}};const l=r},83971(e,t,i){"use strict";i.d(t,{A:()=>g});var s=i(54560),r=i(6063),n=i(60616),o=i(37572),a=i(7240);const l=e=>()=>e;function c(e,{sourceEvent:t,subject:i,target:s,identifier:r,active:n,x:o,y:a,dx:l,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:n,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}function h(e){return!e.ctrlKey&&!e.button}function d(){return this.parentNode}function u(e,t){return null==t?{x:e.x,y:e.y}:t}function p(){return navigator.maxTouchPoints||"ontouchstart"in this}function g(){var e,t,i,g,m=h,f=d,y=u,v=p,C={},b=(0,s.A)("start","drag","end"),S=0,w=0;function x(e){e.on("mousedown.drag",E).filter(v).on("touchstart.drag",T).on("touchmove.drag",D,a.vr).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(s,n){if(!g&&m.call(this,s,n)){var l=R(this,f.call(this,s,n),s,n,"mouse");l&&((0,r.A)(s.view).on("mousemove.drag",M,a.Rw).on("mouseup.drag",A,a.Rw),(0,o.A)(s.view),(0,a.GK)(s),i=!1,e=s.clientX,t=s.clientY,l("start",s))}}function M(s){if((0,a.Ay)(s),!i){var r=s.clientX-e,n=s.clientY-t;i=r*r+n*n>w}C.mouse("drag",s)}function A(e){(0,r.A)(e.view).on("mousemove.drag mouseup.drag",null),(0,o.y)(e.view,i),(0,a.Ay)(e),C.mouse("end",e)}function T(e,t){if(m.call(this,e,t)){var i,s,r=e.changedTouches,n=f.call(this,e,t),o=r.length;for(i=0;i<o;++i)(s=R(this,n,e,t,r[i].identifier,r[i]))&&((0,a.GK)(e),s("start",e,r[i]))}}function D(e){var t,i,s=e.changedTouches,r=s.length;for(t=0;t<r;++t)(i=C[s[t].identifier])&&((0,a.Ay)(e),i("drag",e,s[t]))}function I(e){var t,i,s=e.changedTouches,r=s.length;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),t=0;t<r;++t)(i=C[s[t].identifier])&&((0,a.GK)(e),i("end",e,s[t]))}function R(e,t,i,s,r,o){var a,l,h,d=b.copy(),u=(0,n.A)(o||i,t);if(null!=(h=y.call(e,new c("beforestart",{sourceEvent:i,target:x,identifier:r,active:S,x:u[0],y:u[1],dx:0,dy:0,dispatch:d}),s)))return a=h.x-u[0]||0,l=h.y-u[1]||0,function i(o,p,g){var m,f=u;switch(o){case"start":C[r]=i,m=S++;break;case"end":delete C[r],--S;case"drag":u=(0,n.A)(g||p,t),m=S}d.call(o,e,new c(o,{sourceEvent:p,subject:h,target:x,identifier:r,active:m,x:u[0]+a,y:u[1]+l,dx:u[0]-f[0],dy:u[1]-f[1],dispatch:d}),s)}}return x.filter=function(e){return arguments.length?(m="function"==typeof e?e:l(!!e),x):m},x.container=function(e){return arguments.length?(f="function"==typeof e?e:l(e),x):f},x.subject=function(e){return arguments.length?(y="function"==typeof e?e:l(e),x):y},x.touchable=function(e){return arguments.length?(v="function"==typeof e?e:l(!!e),x):v},x.on=function(){var e=b.on.apply(b,arguments);return e===b?x:e},x.clickDistance=function(e){return arguments.length?(w=(e=+e)*e,x):Math.sqrt(w)},x}c.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e}},37572(e,t,i){"use strict";i.d(t,{A:()=>n,y:()=>o});var s=i(6063),r=i(7240);function n(e){var t=e.document.documentElement,i=(0,s.A)(e).on("dragstart.drag",r.Ay,r.Rw);"onselectstart"in t?i.on("selectstart.drag",r.Ay,r.Rw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o(e,t){var i=e.document.documentElement,n=(0,s.A)(e).on("dragstart.drag",null);t&&(n.on("click.drag",r.Ay,r.Rw),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in i?n.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}},7240(e,t,i){"use strict";i.d(t,{Ay:()=>o,GK:()=>n,Rw:()=>r,vr:()=>s});const s={passive:!1},r={capture:!0,passive:!1};function n(e){e.stopImmediatePropagation()}function o(e){e.preventDefault(),e.stopImmediatePropagation()}},59394(e,t,i){"use strict";i.d(t,{A:()=>s});const s=e=>()=>e},77419(e,t,i){"use strict";function s(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}i.d(t,{A:()=>s})},92795(e,t,i){"use strict";i.d(t,{Ay:()=>a});var s=i(52413);function r(e,t,i,s,r){var n=e*e,o=n*e;return((1-3*e+3*n-o)*t+(4-6*n+3*o)*i+(1+3*e+3*n-3*o)*s+o*r)/6}var n=i(59394);function o(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):(0,n.A)(isNaN(e)?t:e)}const a=function e(t){var i=function(e){return 1===(e=+e)?o:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(s){return Math.pow(e+s*t,i)}}(t,i,e):(0,n.A)(isNaN(t)?i:t)}}(t);function r(e,t){var r=i((e=(0,s.Qh)(e)).r,(t=(0,s.Qh)(t)).r),n=i(e.g,t.g),a=i(e.b,t.b),l=o(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=n(t),e.b=a(t),e.opacity=l(t),e+""}}return r.gamma=e,r}(1);function l(e){return function(t){var i,r,n=t.length,o=new Array(n),a=new Array(n),l=new Array(n);for(i=0;i<n;++i)r=(0,s.Qh)(t[i]),o[i]=r.r||0,a[i]=r.g||0,l[i]=r.b||0;return o=e(o),a=e(a),l=e(l),r.opacity=1,function(e){return r.r=o(e),r.g=a(e),r.b=l(e),r+""}}}l(function(e){var t=e.length-1;return function(i){var s=i<=0?i=0:i>=1?(i=1,t-1):Math.floor(i*t),n=e[s],o=e[s+1],a=s>0?e[s-1]:2*n-o,l=s<t-1?e[s+2]:2*o-n;return r((i-s/t)*t,a,n,o,l)}}),l(function(e){var t=e.length;return function(i){var s=Math.floor(((i%=1)<0?++i:i)*t),n=e[(s+t-1)%t],o=e[s%t],a=e[(s+1)%t],l=e[(s+2)%t];return r((i-s/t)*t,n,o,a,l)}})},20835(e,t,i){"use strict";i.d(t,{A:()=>o});var s=i(77419),r=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,n=new RegExp(r.source,"g");function o(e,t){var i,o,a,l=r.lastIndex=n.lastIndex=0,c=-1,h=[],d=[];for(e+="",t+="";(i=r.exec(e))&&(o=n.exec(t));)(a=o.index)>l&&(a=t.slice(l,a),h[c]?h[c]+=a:h[++c]=a),(i=i[0])===(o=o[0])?h[c]?h[c]+=o:h[++c]=o:(h[++c]=null,d.push({i:c,x:(0,s.A)(i,o)})),l=n.lastIndex;return l<t.length&&(a=t.slice(l),h[c]?h[c]+=a:h[++c]=a),h.length<2?d[0]?function(e){return function(t){return e(t)+""}}(d[0].x):function(e){return function(){return e}}(t):(t=d.length,function(e){for(var i,s=0;s<t;++s)h[(i=d[s]).i]=i.x(e);return h.join("")})}},32262(e,t,i){"use strict";i.d(t,{A:()=>u});var s=i(52413),r=i(92795);function n(e,t){var i,s=t?t.length:0,r=e?Math.min(s,e.length):0,n=new Array(r),o=new Array(s);for(i=0;i<r;++i)n[i]=u(e[i],t[i]);for(;i<s;++i)o[i]=t[i];return function(e){for(i=0;i<r;++i)o[i]=n[i](e);return o}}function o(e,t){var i=new Date;return e=+e,t=+t,function(s){return i.setTime(e*(1-s)+t*s),i}}var a=i(77419);function l(e,t){var i,s={},r={};for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?s[i]=u(e[i],t[i]):r[i]=t[i];return function(e){for(i in s)r[i]=s[i](e);return r}}var c=i(20835),h=i(59394);function d(e,t){t||(t=[]);var i,s=e?Math.min(t.length,e.length):0,r=t.slice();return function(n){for(i=0;i<s;++i)r[i]=e[i]*(1-n)+t[i]*n;return r}}function u(e,t){var i,u,p=typeof t;return null==t||"boolean"===p?(0,h.A)(t):("number"===p?a.A:"string"===p?(i=(0,s.Ay)(t))?(t=i,r.Ay):c.A:t instanceof s.Ay?r.Ay:t instanceof Date?o:(u=t,!ArrayBuffer.isView(u)||u instanceof DataView?Array.isArray(t)?n:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?l:a.A:d))(e,t)}},96785(e,t,i){"use strict";function s(e){return((e=Math.exp(e))+1/e)/2}i.d(t,{A:()=>r});const r=function e(t,i,r){function n(e,n){var o,a,l=e[0],c=e[1],h=e[2],d=n[0],u=n[1],p=n[2],g=d-l,m=u-c,f=g*g+m*m;if(f<1e-12)a=Math.log(p/h)/t,o=function(e){return[l+e*g,c+e*m,h*Math.exp(t*e*a)]};else{var y=Math.sqrt(f),v=(p*p-h*h+r*f)/(2*h*i*y),C=(p*p-h*h-r*f)/(2*p*i*y),b=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(C*C+1)-C);a=(S-b)/t,o=function(e){var r,n=e*a,o=s(b),d=h/(i*y)*(o*(r=t*n+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[l+d*g,c+d*m,h*o/s(t*n+b)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return n.rho=function(t){var i=Math.max(.001,+t),s=i*i;return e(i,s,s*s)},n}(Math.SQRT2,2,4)},99269(e,t,i){"use strict";function s(e){return function(){return this.matches(e)}}function r(e){return function(t){return t.matches(e)}}i.d(t,{A:()=>s,j:()=>r})},39276(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(27683);function r(e){var t=e+="",i=t.indexOf(":");return i>=0&&"xmlns"!==(t=e.slice(0,i))&&(e=e.slice(i+1)),s.A.hasOwnProperty(t)?{space:s.A[t],local:e}:e}},27683(e,t,i){"use strict";i.d(t,{A:()=>r,g:()=>s});var s="http://www.w3.org/1999/xhtml";const r={svg:"http://www.w3.org/2000/svg",xhtml:s,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},60616(e,t,i){"use strict";function s(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var i=t.ownerSVGElement||t;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,[(s=s.matrixTransform(t.getScreenCTM().inverse())).x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}i.d(t,{A:()=>s})},6063(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i(64155);function r(e){return"string"==typeof e?new s.LN([[document.querySelector(e)]],[document.documentElement]):new s.LN([[e]],s.zr)}},64155(e,t,i){"use strict";i.d(t,{LN:()=>ne,Ay:()=>ae,zr:()=>re});var s=i(68166),r=i(54355);var n=i(99269),o=Array.prototype.find;function a(){return this.firstElementChild}var l=Array.prototype.filter;function c(){return Array.from(this.children)}function h(e){return new Array(e.length)}function d(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function u(e,t,i,s,r,n){for(var o,a=0,l=t.length,c=n.length;a<c;++a)(o=t[a])?(o.__data__=n[a],s[a]=o):i[a]=new d(e,n[a]);for(;a<l;++a)(o=t[a])&&(r[a]=o)}function p(e,t,i,s,r,n,o){var a,l,c,h=new Map,u=t.length,p=n.length,g=new Array(u);for(a=0;a<u;++a)(l=t[a])&&(g[a]=c=o.call(l,l.__data__,a,t)+"",h.has(c)?r[a]=l:h.set(c,l));for(a=0;a<p;++a)c=o.call(e,n[a],a,n)+"",(l=h.get(c))?(s[a]=l,l.__data__=n[a],h.delete(c)):i[a]=new d(e,n[a]);for(a=0;a<u;++a)(l=t[a])&&h.get(g[a])===l&&(r[a]=l)}function g(e){return e.__data__}function m(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function f(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}d.prototype={constructor:d,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var y=i(39276);function v(e){return function(){this.removeAttribute(e)}}function C(e){return function(){this.removeAttributeNS(e.space,e.local)}}function b(e,t){return function(){this.setAttribute(e,t)}}function S(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function w(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttribute(e):this.setAttribute(e,i)}}function x(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}var E=i(37915);function M(e){return function(){delete this[e]}}function A(e,t){return function(){this[e]=t}}function T(e,t){return function(){var i=t.apply(this,arguments);null==i?delete this[e]:this[e]=i}}function D(e){return e.trim().split(/^|\s+/)}function I(e){return e.classList||new R(e)}function R(e){this._node=e,this._names=D(e.getAttribute("class")||"")}function P(e,t){for(var i=I(e),s=-1,r=t.length;++s<r;)i.add(t[s])}function k(e,t){for(var i=I(e),s=-1,r=t.length;++s<r;)i.remove(t[s])}function L(e){return function(){P(this,e)}}function N(e){return function(){k(this,e)}}function _(e,t){return function(){(t.apply(this,arguments)?P:k)(this,e)}}function O(){this.textContent=""}function F(e){return function(){this.textContent=e}}function G(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function B(){this.innerHTML=""}function V(e){return function(){this.innerHTML=e}}function H(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function U(){this.nextSibling&&this.parentNode.appendChild(this)}function z(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}R.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var W=i(27683);function j(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===W.g&&t.documentElement.namespaceURI===W.g?t.createElement(e):t.createElementNS(i,e)}}function K(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $(e){var t=(0,y.A)(e);return(t.local?K:j)(t)}function Y(){return null}function q(){var e=this.parentNode;e&&e.removeChild(this)}function X(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Z(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Q(e){return function(){var t=this.__on;if(t){for(var i,s=0,r=-1,n=t.length;s<n;++s)i=t[s],e.type&&i.type!==e.type||i.name!==e.name?t[++r]=i:this.removeEventListener(i.type,i.listener,i.options);++r?t.length=r:delete this.__on}}}function J(e,t,i){return function(){var s,r=this.__on,n=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var o=0,a=r.length;o<a;++o)if((s=r[o]).type===e.type&&s.name===e.name)return this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=n,s.options=i),void(s.value=t);this.addEventListener(e.type,n,i),s={type:e.type,name:e.name,value:t,listener:n,options:i},r?r.push(s):this.__on=[s]}}var ee=i(46515);function te(e,t,i){var s=(0,ee.A)(e),r=s.CustomEvent;"function"==typeof r?r=new r(t,i):(r=s.document.createEvent("Event"),i?(r.initEvent(t,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function ie(e,t){return function(){return te(this,e,t)}}function se(e,t){return function(){return te(this,e,t.apply(this,arguments))}}var re=[null];function ne(e,t){this._groups=e,this._parents=t}function oe(){return new ne([[document.documentElement]],re)}ne.prototype=oe.prototype={constructor:ne,select:function(e){"function"!=typeof e&&(e=(0,s.A)(e));for(var t=this._groups,i=t.length,r=new Array(i),n=0;n<i;++n)for(var o,a,l=t[n],c=l.length,h=r[n]=new Array(c),d=0;d<c;++d)(o=l[d])&&(a=e.call(o,o.__data__,d,l))&&("__data__"in o&&(a.__data__=o.__data__),h[d]=a);return new ne(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):(0,r.A)(e);for(var t=this._groups,i=t.length,s=[],n=[],o=0;o<i;++o)for(var a,l=t[o],c=l.length,h=0;h<c;++h)(a=l[h])&&(s.push(e.call(a,a.__data__,h,l)),n.push(a));return new ne(s,n)},selectChild:function(e){return this.select(null==e?a:function(e){return function(){return o.call(this.children,e)}}("function"==typeof e?e:(0,n.j)(e)))},selectChildren:function(e){return this.selectAll(null==e?c:function(e){return function(){return l.call(this.children,e)}}("function"==typeof e?e:(0,n.j)(e)))},filter:function(e){"function"!=typeof e&&(e=(0,n.A)(e));for(var t=this._groups,i=t.length,s=new Array(i),r=0;r<i;++r)for(var o,a=t[r],l=a.length,c=s[r]=[],h=0;h<l;++h)(o=a[h])&&e.call(o,o.__data__,h,a)&&c.push(o);return new ne(s,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,g);var i,s=t?p:u,r=this._parents,n=this._groups;"function"!=typeof e&&(i=e,e=function(){return i});for(var o=n.length,a=new Array(o),l=new Array(o),c=new Array(o),h=0;h<o;++h){var d=r[h],f=n[h],y=f.length,v=m(e.call(d,d&&d.__data__,h,r)),C=v.length,b=l[h]=new Array(C),S=a[h]=new Array(C);s(d,f,b,S,c[h]=new Array(y),v,t);for(var w,x,E=0,M=0;E<C;++E)if(w=b[E]){for(E>=M&&(M=E+1);!(x=S[M])&&++M<C;);w._next=x||null}}return(a=new ne(a,r))._enter=l,a._exit=c,a},enter:function(){return new ne(this._enter||this._groups.map(h),this._parents)},exit:function(){return new ne(this._exit||this._groups.map(h),this._parents)},join:function(e,t,i){var s=this.enter(),r=this,n=this.exit();return"function"==typeof e?(s=e(s))&&(s=s.selection()):s=s.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==i?n.remove():i(n),s&&r?s.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,i=this._groups,s=t._groups,r=i.length,n=s.length,o=Math.min(r,n),a=new Array(r),l=0;l<o;++l)for(var c,h=i[l],d=s[l],u=h.length,p=a[l]=new Array(u),g=0;g<u;++g)(c=h[g]||d[g])&&(p[g]=c);for(;l<r;++l)a[l]=i[l];return new ne(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var s,r=e[t],n=r.length-1,o=r[n];--n>=0;)(s=r[n])&&(o&&4^s.compareDocumentPosition(o)&&o.parentNode.insertBefore(s,o),o=s);return this},sort:function(e){function t(t,i){return t&&i?e(t.__data__,i.__data__):!t-!i}e||(e=f);for(var i=this._groups,s=i.length,r=new Array(s),n=0;n<s;++n){for(var o,a=i[n],l=a.length,c=r[n]=new Array(l),h=0;h<l;++h)(o=a[h])&&(c[h]=o);c.sort(t)}return new ne(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var s=e[t],r=0,n=s.length;r<n;++r){var o=s[r];if(o)return o}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var r,n=t[i],o=0,a=n.length;o<a;++o)(r=n[o])&&e.call(r,r.__data__,o,n);return this},attr:function(e,t){var i=(0,y.A)(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((null==t?i.local?C:v:"function"==typeof t?i.local?x:w:i.local?S:b)(i,t))},style:E.A,property:function(e,t){return arguments.length>1?this.each((null==t?M:"function"==typeof t?T:A)(e,t)):this.node()[e]},classed:function(e,t){var i=D(e+"");if(arguments.length<2){for(var s=I(this.node()),r=-1,n=i.length;++r<n;)if(!s.contains(i[r]))return!1;return!0}return this.each(("function"==typeof t?_:t?L:N)(i,t))},text:function(e){return arguments.length?this.each(null==e?O:("function"==typeof e?G:F)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?B:("function"==typeof e?H:V)(e)):this.node().innerHTML},raise:function(){return this.each(U)},lower:function(){return this.each(z)},append:function(e){var t="function"==typeof e?e:$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var i="function"==typeof e?e:$(e),r=null==t?Y:"function"==typeof t?t:(0,s.A)(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(q)},clone:function(e){return this.select(e?Z:X)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,i){var s,r,n=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",i=e.indexOf(".");return i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}(e+""),o=n.length;if(!(arguments.length<2)){for(a=t?J:Q,s=0;s<o;++s)this.each(a(n[s],t,i));return this}var a=this.node().__on;if(a)for(var l,c=0,h=a.length;c<h;++c)for(s=0,l=a[c];s<o;++s)if((r=n[s]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?se:ie)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var s,r=e[t],n=0,o=r.length;n<o;++n)(s=r[n])&&(yield s)}};const ae=oe},37915(e,t,i){"use strict";i.d(t,{A:()=>a,j:()=>l});var s=i(46515);function r(e){return function(){this.style.removeProperty(e)}}function n(e,t,i){return function(){this.style.setProperty(e,t,i)}}function o(e,t,i){return function(){var s=t.apply(this,arguments);null==s?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function a(e,t,i){return arguments.length>1?this.each((null==t?r:"function"==typeof t?o:n)(e,t,null==i?"":i)):l(this.node(),e)}function l(e,t){return e.style.getPropertyValue(t)||(0,s.A)(e).getComputedStyle(e,null).getPropertyValue(t)}},68166(e,t,i){"use strict";function s(){}function r(e){return null==e?s:function(){return this.querySelector(e)}}i.d(t,{A:()=>r})},54355(e,t,i){"use strict";function s(){return[]}function r(e){return null==e?s:function(){return this.querySelectorAll(e)}}i.d(t,{A:()=>r})},46515(e,t,i){"use strict";function s(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}i.d(t,{A:()=>s})},17076(e,t,i){"use strict";i.d(t,{s_:()=>Le,GS:()=>xe,_V:()=>Ee});var s,r,n=i(54560),o=i(37572),a=i(96785),l=i(6063),c=i(60616),h=i(64155),d=0,u=0,p=0,g=0,m=0,f=0,y="object"==typeof performance&&performance.now?performance:Date,v="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function C(){return m||(v(b),m=y.now()+f)}function b(){m=0}function S(){this._call=this._time=this._next=null}function w(e,t,i){var s=new S;return s.restart(e,t,i),s}function x(){m=(g=y.now())+f,d=u=0;try{!function(){C(),++d;for(var e,t=s;t;)(e=m-t._time)>=0&&t._call.call(void 0,e),t=t._next;--d}()}finally{d=0,function(){for(var e,t,i=s,n=1/0;i;)i._call?(n>i._time&&(n=i._time),e=i,i=i._next):(t=i._next,i._next=null,i=e?e._next=t:s=t);r=e,M(n)}(),m=0}}function E(){var e=y.now(),t=e-g;t>1e3&&(f-=t,g=e)}function M(e){d||(u&&(u=clearTimeout(u)),e-m>24?(e<1/0&&(u=setTimeout(x,e-y.now()-f)),p&&(p=clearInterval(p))):(p||(g=y.now(),p=setInterval(E,1e3)),d=1,v(x)))}function A(e,t,i){var s=new S;return t=null==t?0:+t,s.restart(i=>{s.stop(),e(i+t)},t,i),s}S.prototype=w.prototype={constructor:S,restart:function(e,t,i){if("function"!=typeof e)throw new TypeError("callback is not a function");i=(null==i?C():+i)+(null==t?0:+t),this._next||r===this||(r?r._next=this:s=this,r=this),this._call=e,this._time=i,M()},stop:function(){this._call&&(this._call=null,this._time=1/0,M())}};var T=(0,n.A)("start","end","cancel","interrupt"),D=[];function I(e,t,i,s,r,n){var o=e.__transition;if(o){if(i in o)return}else e.__transition={};!function(e,t,i){var s,r=e.__transition;function n(l){var c,h,d,u;if(1!==i.state)return a();for(c in r)if((u=r[c]).name===i.name){if(3===u.state)return A(n);4===u.state?(u.state=6,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete r[c]):+c<t&&(u.state=6,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete r[c])}if(A(function(){3===i.state&&(i.state=4,i.timer.restart(o,i.delay,i.time),o(l))}),i.state=2,i.on.call("start",e,e.__data__,i.index,i.group),2===i.state){for(i.state=3,s=new Array(d=i.tween.length),c=0,h=-1;c<d;++c)(u=i.tween[c].value.call(e,e.__data__,i.index,i.group))&&(s[++h]=u);s.length=h+1}}function o(t){for(var r=t<i.duration?i.ease.call(null,t/i.duration):(i.timer.restart(a),i.state=5,1),n=-1,o=s.length;++n<o;)s[n].call(e,r);5===i.state&&(i.on.call("end",e,e.__data__,i.index,i.group),a())}function a(){for(var s in i.state=6,i.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=i,i.timer=w(function(e){i.state=1,i.timer.restart(n,i.delay,i.time),i.delay<=e&&n(e-i.delay)},0,i.time)}(e,i,{name:t,index:s,group:r,on:T,tween:D,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:0})}function R(e,t){var i=k(e,t);if(i.state>0)throw new Error("too late; already scheduled");return i}function P(e,t){var i=k(e,t);if(i.state>3)throw new Error("too late; already running");return i}function k(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function L(e,t){var i,s,r,n=e.__transition,o=!0;if(n){for(r in t=null==t?null:t+"",n)(i=n[r]).name===t?(s=i.state>2&&i.state<5,i.state=6,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[r]):o=!1;o&&delete e.__transition}}var N,_=i(77419),O=180/Math.PI,F={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function G(e,t,i,s,r,n){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*i+t*s)&&(i-=e*l,s-=t*l),(a=Math.sqrt(i*i+s*s))&&(i/=a,s/=a,l/=a),e*s<t*i&&(e=-e,t=-t,l=-l,o=-o),{translateX:r,translateY:n,rotate:Math.atan2(t,e)*O,skewX:Math.atan(l)*O,scaleX:o,scaleY:a}}function B(e,t,i,s){function r(e){return e.length?e.pop()+" ":""}return function(n,o){var a=[],l=[];return n=e(n),o=e(o),function(e,s,r,n,o,a){if(e!==r||s!==n){var l=o.push("translate(",null,t,null,i);a.push({i:l-4,x:(0,_.A)(e,r)},{i:l-2,x:(0,_.A)(s,n)})}else(r||n)&&o.push("translate("+r+t+n+i)}(n.translateX,n.translateY,o.translateX,o.translateY,a,l),function(e,t,i,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:i.push(r(i)+"rotate(",null,s)-2,x:(0,_.A)(e,t)})):t&&i.push(r(i)+"rotate("+t+s)}(n.rotate,o.rotate,a,l),function(e,t,i,n){e!==t?n.push({i:i.push(r(i)+"skewX(",null,s)-2,x:(0,_.A)(e,t)}):t&&i.push(r(i)+"skewX("+t+s)}(n.skewX,o.skewX,a,l),function(e,t,i,s,n,o){if(e!==i||t!==s){var a=n.push(r(n)+"scale(",null,",",null,")");o.push({i:a-4,x:(0,_.A)(e,i)},{i:a-2,x:(0,_.A)(t,s)})}else 1===i&&1===s||n.push(r(n)+"scale("+i+","+s+")")}(n.scaleX,n.scaleY,o.scaleX,o.scaleY,a,l),n=o=null,function(e){for(var t,i=-1,s=l.length;++i<s;)a[(t=l[i]).i]=t.x(e);return a.join("")}}}var V=B(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?F:G(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),H=B(function(e){return null==e?F:(N||(N=document.createElementNS("http://www.w3.org/2000/svg","g")),N.setAttribute("transform",e),(e=N.transform.baseVal.consolidate())?G((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):F)},", ",")",")"),U=i(39276);function z(e,t){var i,s;return function(){var r=P(this,e),n=r.tween;if(n!==i)for(var o=0,a=(s=i=n).length;o<a;++o)if(s[o].name===t){(s=s.slice()).splice(o,1);break}r.tween=s}}function W(e,t,i){var s,r;if("function"!=typeof i)throw new Error;return function(){var n=P(this,e),o=n.tween;if(o!==s){r=(s=o).slice();for(var a={name:t,value:i},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}n.tween=r}}function j(e,t,i){var s=e._id;return e.each(function(){var e=P(this,s);(e.value||(e.value={}))[t]=i.apply(this,arguments)}),function(e){return k(e,s).value[t]}}var K=i(52413),$=i(92795),Y=i(20835);function q(e,t){var i;return("number"==typeof t?_.A:t instanceof K.Ay?$.Ay:(i=(0,K.Ay)(t))?(t=i,$.Ay):Y.A)(e,t)}function X(e){return function(){this.removeAttribute(e)}}function Z(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Q(e,t,i){var s,r,n=i+"";return function(){var o=this.getAttribute(e);return o===n?null:o===s?r:r=t(s=o,i)}}function J(e,t,i){var s,r,n=i+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===n?null:o===s?r:r=t(s=o,i)}}function ee(e,t,i){var s,r,n;return function(){var o,a,l=i(this);if(null!=l)return(o=this.getAttribute(e))===(a=l+"")?null:o===s&&a===r?n:(r=a,n=t(s=o,l));this.removeAttribute(e)}}function te(e,t,i){var s,r,n;return function(){var o,a,l=i(this);if(null!=l)return(o=this.getAttributeNS(e.space,e.local))===(a=l+"")?null:o===s&&a===r?n:(r=a,n=t(s=o,l));this.removeAttributeNS(e.space,e.local)}}function ie(e,t){var i,s;function r(){var r=t.apply(this,arguments);return r!==s&&(i=(s=r)&&function(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}(e,r)),i}return r._value=t,r}function se(e,t){var i,s;function r(){var r=t.apply(this,arguments);return r!==s&&(i=(s=r)&&function(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}(e,r)),i}return r._value=t,r}function re(e,t){return function(){R(this,e).delay=+t.apply(this,arguments)}}function ne(e,t){return t=+t,function(){R(this,e).delay=t}}function oe(e,t){return function(){P(this,e).duration=+t.apply(this,arguments)}}function ae(e,t){return t=+t,function(){P(this,e).duration=t}}var le=i(99269),ce=i(68166),he=i(54355),de=h.Ay.prototype.constructor,ue=i(37915);function pe(e){return function(){this.style.removeProperty(e)}}var ge=0;function me(e,t,i,s){this._groups=e,this._parents=t,this._name=i,this._id=s}function fe(){return++ge}var ye=h.Ay.prototype;me.prototype=function(e){return(0,h.Ay)().transition(e)}.prototype={constructor:me,select:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=(0,ce.A)(e));for(var s=this._groups,r=s.length,n=new Array(r),o=0;o<r;++o)for(var a,l,c=s[o],h=c.length,d=n[o]=new Array(h),u=0;u<h;++u)(a=c[u])&&(l=e.call(a,a.__data__,u,c))&&("__data__"in a&&(l.__data__=a.__data__),d[u]=l,I(d[u],t,i,u,d,k(a,i)));return new me(n,this._parents,t,i)},selectAll:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=(0,he.A)(e));for(var s=this._groups,r=s.length,n=[],o=[],a=0;a<r;++a)for(var l,c=s[a],h=c.length,d=0;d<h;++d)if(l=c[d]){for(var u,p=e.call(l,l.__data__,d,c),g=k(l,i),m=0,f=p.length;m<f;++m)(u=p[m])&&I(u,t,i,m,p,g);n.push(p),o.push(l)}return new me(n,o,t,i)},selectChild:ye.selectChild,selectChildren:ye.selectChildren,filter:function(e){"function"!=typeof e&&(e=(0,le.A)(e));for(var t=this._groups,i=t.length,s=new Array(i),r=0;r<i;++r)for(var n,o=t[r],a=o.length,l=s[r]=[],c=0;c<a;++c)(n=o[c])&&e.call(n,n.__data__,c,o)&&l.push(n);return new me(s,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,s=t.length,r=i.length,n=Math.min(s,r),o=new Array(s),a=0;a<n;++a)for(var l,c=t[a],h=i[a],d=c.length,u=o[a]=new Array(d),p=0;p<d;++p)(l=c[p]||h[p])&&(u[p]=l);for(;a<s;++a)o[a]=t[a];return new me(o,this._parents,this._name,this._id)},selection:function(){return new de(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,i=fe(),s=this._groups,r=s.length,n=0;n<r;++n)for(var o,a=s[n],l=a.length,c=0;c<l;++c)if(o=a[c]){var h=k(o,t);I(o,e,i,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new me(s,this._parents,e,i)},call:ye.call,nodes:ye.nodes,node:ye.node,size:ye.size,empty:ye.empty,each:ye.each,on:function(e,t){var i=this._id;return arguments.length<2?k(this.node(),i).on.on(e):this.each(function(e,t,i){var s,r,n=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?R:P;return function(){var o=n(this,e),a=o.on;a!==s&&(r=(s=a).copy()).on(t,i),o.on=r}}(i,e,t))},attr:function(e,t){var i=(0,U.A)(e),s="transform"===i?H:q;return this.attrTween(e,"function"==typeof t?(i.local?te:ee)(i,s,j(this,"attr."+e,t)):null==t?(i.local?Z:X)(i):(i.local?J:Q)(i,s,t))},attrTween:function(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;var s=(0,U.A)(e);return this.tween(i,(s.local?ie:se)(s,t))},style:function(e,t,i){var s="transform"==(e+="")?V:q;return null==t?this.styleTween(e,function(e,t){var i,s,r;return function(){var n=(0,ue.j)(this,e),o=(this.style.removeProperty(e),(0,ue.j)(this,e));return n===o?null:n===i&&o===s?r:r=t(i=n,s=o)}}(e,s)).on("end.style."+e,pe(e)):"function"==typeof t?this.styleTween(e,function(e,t,i){var s,r,n;return function(){var o=(0,ue.j)(this,e),a=i(this),l=a+"";return null==a&&(this.style.removeProperty(e),l=a=(0,ue.j)(this,e)),o===l?null:o===s&&l===r?n:(r=l,n=t(s=o,a))}}(e,s,j(this,"style."+e,t))).each(function(e,t){var i,s,r,n,o="style."+t,a="end."+o;return function(){var l=P(this,e),c=l.on,h=null==l.value[o]?n||(n=pe(t)):void 0;c===i&&r===h||(s=(i=c).copy()).on(a,r=h),l.on=s}}(this._id,e)):this.styleTween(e,function(e,t,i){var s,r,n=i+"";return function(){var o=(0,ue.j)(this,e);return o===n?null:o===s?r:r=t(s=o,i)}}(e,s,t),i).on("end.style."+e,null)},styleTween:function(e,t,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(null==t)return this.tween(s,null);if("function"!=typeof t)throw new Error;return this.tween(s,function(e,t,i){var s,r;function n(){var n=t.apply(this,arguments);return n!==r&&(s=(r=n)&&function(e,t,i){return function(s){this.style.setProperty(e,t.call(this,s),i)}}(e,n,i)),s}return n._value=t,n}(e,t,null==i?"":i))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(j(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,i;function s(){var s=e.apply(this,arguments);return s!==i&&(t=(i=s)&&function(e){return function(t){this.textContent=e.call(this,t)}}(s)),t}return s._value=e,s}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var i=this._id;if(e+="",arguments.length<2){for(var s,r=k(this.node(),i).tween,n=0,o=r.length;n<o;++n)if((s=r[n]).name===e)return s.value;return null}return this.each((null==t?z:W)(i,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?re:ne)(t,e)):k(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?oe:ae)(t,e)):k(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){P(this,e).ease=t}}(t,e)):k(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var i=t.apply(this,arguments);if("function"!=typeof i)throw new Error;P(this,e).ease=i}}(this._id,e))},end:function(){var e,t,i=this,s=i._id,r=i.size();return new Promise(function(n,o){var a={value:o},l={value:function(){0===--r&&n()}};i.each(function(){var i=P(this,s),r=i.on;r!==e&&((t=(e=r).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),i.on=t}),0===r&&n()})},[Symbol.iterator]:ye[Symbol.iterator]};var ve={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Ce(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}h.Ay.prototype.interrupt=function(e){return this.each(function(){L(this,e)})},h.Ay.prototype.transition=function(e){var t,i;e instanceof me?(t=e._id,e=e._name):(t=fe(),(i=ve).time=C(),e=null==e?null:e+"");for(var s=this._groups,r=s.length,n=0;n<r;++n)for(var o,a=s[n],l=a.length,c=0;c<l;++c)(o=a[c])&&I(o,e,t,c,a,i||Ce(o,t));return new me(s,this._parents,e,t)};const be=e=>()=>e;function Se(e,{sourceEvent:t,target:i,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function we(e,t,i){this.k=e,this.x=t,this.y=i}we.prototype={constructor:we,scale:function(e){return 1===e?this:new we(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new we(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xe=new we(1,0,0);function Ee(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xe;return e.__zoom}function Me(e){e.stopImmediatePropagation()}function Ae(e){e.preventDefault(),e.stopImmediatePropagation()}function Te(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function De(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Ie(){return this.__zoom||xe}function Re(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Pe(){return navigator.maxTouchPoints||"ontouchstart"in this}function ke(e,t,i){var s=e.invertX(t[0][0])-i[0][0],r=e.invertX(t[1][0])-i[1][0],n=e.invertY(t[0][1])-i[0][1],o=e.invertY(t[1][1])-i[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o))}function Le(){var e,t,i,s=Te,r=De,h=ke,d=Re,u=Pe,p=[0,1/0],g=[[-1/0,-1/0],[1/0,1/0]],m=250,f=a.A,y=(0,n.A)("start","zoom","end"),v=0,C=10;function b(e){e.property("__zoom",Ie).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(u).on("touchstart.zoom",R).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(e,t){return(t=Math.max(p[0],Math.min(p[1],t)))===e.k?e:new we(t,e.x,e.y)}function w(e,t,i){var s=t[0]-i[0]*e.k,r=t[1]-i[1]*e.k;return s===e.x&&r===e.y?e:new we(e.k,s,r)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function E(e,t,i,s){e.on("start.zoom",function(){M(this,arguments).event(s).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(s).end()}).tween("zoom",function(){var e=this,n=arguments,o=M(e,n).event(s),a=r.apply(e,n),l=null==i?x(a):"function"==typeof i?i.apply(e,n):i,c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),h=e.__zoom,d="function"==typeof t?t.apply(e,n):t,u=f(h.invert(l).concat(c/h.k),d.invert(l).concat(c/d.k));return function(e){if(1===e)e=d;else{var t=u(e),i=c/t[2];e=new we(i,l[0]-t[0]*i,l[1]-t[1]*i)}o.zoom(null,e)}})}function M(e,t,i){return!i&&e.__zooming||new A(e,t)}function A(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function T(e,...t){if(s.apply(this,arguments)){var i=M(this,t).event(e),r=this.__zoom,n=Math.max(p[0],Math.min(p[1],r.k*Math.pow(2,d.apply(this,arguments)))),o=(0,c.A)(e);if(i.wheel)i.mouse[0][0]===o[0]&&i.mouse[0][1]===o[1]||(i.mouse[1]=r.invert(i.mouse[0]=o)),clearTimeout(i.wheel);else{if(r.k===n)return;i.mouse=[o,r.invert(o)],L(this),i.start()}Ae(e),i.wheel=setTimeout(function(){i.wheel=null,i.end()},150),i.zoom("mouse",h(w(S(r,n),i.mouse[0],i.mouse[1]),i.extent,g))}}function D(e,...t){if(!i&&s.apply(this,arguments)){var r=e.currentTarget,n=M(this,t,!0).event(e),a=(0,l.A)(e.view).on("mousemove.zoom",function(e){if(Ae(e),!n.moved){var t=e.clientX-u,i=e.clientY-p;n.moved=t*t+i*i>v}n.event(e).zoom("mouse",h(w(n.that.__zoom,n.mouse[0]=(0,c.A)(e,r),n.mouse[1]),n.extent,g))},!0).on("mouseup.zoom",function(e){a.on("mousemove.zoom mouseup.zoom",null),(0,o.y)(e.view,n.moved),Ae(e),n.event(e).end()},!0),d=(0,c.A)(e,r),u=e.clientX,p=e.clientY;(0,o.A)(e.view),Me(e),n.mouse=[d,this.__zoom.invert(d)],L(this),n.start()}}function I(e,...t){if(s.apply(this,arguments)){var i=this.__zoom,n=(0,c.A)(e.changedTouches?e.changedTouches[0]:e,this),o=i.invert(n),a=i.k*(e.shiftKey?.5:2),d=h(w(S(i,a),n,o),r.apply(this,t),g);Ae(e),m>0?(0,l.A)(this).transition().duration(m).call(E,d,n,e):(0,l.A)(this).call(b.transform,d,n,e)}}function R(i,...r){if(s.apply(this,arguments)){var n,o,a,l,h=i.touches,d=h.length,u=M(this,r,i.changedTouches.length===d).event(i);for(Me(i),o=0;o<d;++o)a=h[o],l=[l=(0,c.A)(a,this),this.__zoom.invert(l),a.identifier],u.touch0?u.touch1||u.touch0[2]===l[2]||(u.touch1=l,u.taps=0):(u.touch0=l,n=!0,u.taps=1+!!e);e&&(e=clearTimeout(e)),n&&(u.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),L(this),u.start())}}function P(e,...t){if(this.__zooming){var i,s,r,n,o=M(this,t).event(e),a=e.changedTouches,l=a.length;for(Ae(e),i=0;i<l;++i)s=a[i],r=(0,c.A)(s,this),o.touch0&&o.touch0[2]===s.identifier?o.touch0[0]=r:o.touch1&&o.touch1[2]===s.identifier&&(o.touch1[0]=r);if(s=o.that.__zoom,o.touch1){var d=o.touch0[0],u=o.touch0[1],p=o.touch1[0],m=o.touch1[1],f=(f=p[0]-d[0])*f+(f=p[1]-d[1])*f,y=(y=m[0]-u[0])*y+(y=m[1]-u[1])*y;s=S(s,Math.sqrt(f/y)),r=[(d[0]+p[0])/2,(d[1]+p[1])/2],n=[(u[0]+m[0])/2,(u[1]+m[1])/2]}else{if(!o.touch0)return;r=o.touch0[0],n=o.touch0[1]}o.zoom("touch",h(w(s,r,n),o.extent,g))}}function k(e,...s){if(this.__zooming){var r,n,o=M(this,s).event(e),a=e.changedTouches,h=a.length;for(Me(e),i&&clearTimeout(i),i=setTimeout(function(){i=null},500),r=0;r<h;++r)n=a[r],o.touch0&&o.touch0[2]===n.identifier?delete o.touch0:o.touch1&&o.touch1[2]===n.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(n=(0,c.A)(n,this),Math.hypot(t[0]-n[0],t[1]-n[1])<C)){var d=(0,l.A)(this).on("dblclick.zoom");d&&d.apply(this,arguments)}}}return b.transform=function(e,t,i,s){var r=e.selection?e.selection():e;r.property("__zoom",Ie),e!==r?E(e,t,i,s):r.interrupt().each(function(){M(this,arguments).event(s).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},b.scaleBy=function(e,t,i,s){b.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},i,s)},b.scaleTo=function(e,t,i,s){b.transform(e,function(){var e=r.apply(this,arguments),s=this.__zoom,n=null==i?x(e):"function"==typeof i?i.apply(this,arguments):i,o=s.invert(n),a="function"==typeof t?t.apply(this,arguments):t;return h(w(S(s,a),n,o),e,g)},i,s)},b.translateBy=function(e,t,i,s){b.transform(e,function(){return h(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof i?i.apply(this,arguments):i),r.apply(this,arguments),g)},null,s)},b.translateTo=function(e,t,i,s,n){b.transform(e,function(){var e=r.apply(this,arguments),n=this.__zoom,o=null==s?x(e):"function"==typeof s?s.apply(this,arguments):s;return h(xe.translate(o[0],o[1]).scale(n.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof i?-i.apply(this,arguments):-i),e,g)},s,n)},A.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=(0,l.A)(this.that).datum();y.call(e,this.that,new Se(e,{sourceEvent:this.sourceEvent,target:b,type:e,transform:this.that.__zoom,dispatch:y}),t)}},b.wheelDelta=function(e){return arguments.length?(d="function"==typeof e?e:be(+e),b):d},b.filter=function(e){return arguments.length?(s="function"==typeof e?e:be(!!e),b):s},b.touchable=function(e){return arguments.length?(u="function"==typeof e?e:be(!!e),b):u},b.extent=function(e){return arguments.length?(r="function"==typeof e?e:be([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),b):r},b.scaleExtent=function(e){return arguments.length?(p[0]=+e[0],p[1]=+e[1],b):[p[0],p[1]]},b.translateExtent=function(e){return arguments.length?(g[0][0]=+e[0][0],g[1][0]=+e[1][0],g[0][1]=+e[0][1],g[1][1]=+e[1][1],b):[[g[0][0],g[0][1]],[g[1][0],g[1][1]]]},b.constrain=function(e){return arguments.length?(h=e,b):h},b.duration=function(e){return arguments.length?(m=+e,b):m},b.interpolate=function(e){return arguments.length?(f=e,b):f},b.on=function(){var e=y.on.apply(y,arguments);return e===y?b:e},b.clickDistance=function(e){return arguments.length?(v=(e=+e)*e,b):Math.sqrt(v)},b.tapDistance=function(e){return arguments.length?(C=+e,b):C},b}Ee.prototype=we.prototype},67543(e,t,i){"use strict";i.d(t,{s:()=>r});const s=document.createElement("i");function r(e){const t="&"+e+";";s.innerHTML=t;const i=s.textContent;return(59!==i.charCodeAt(i.length-1)||"semi"===e)&&i!==t&&i}},40562(e,t,i){"use strict";function s(){}function r(){}i.d(t,{HB:()=>r,ok:()=>s})},36464(e,t,i){"use strict";function s(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}i.d(t,{A:()=>s})},10150(e,t,i){"use strict";i.d(t,{UU:()=>o});const s=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n={};function o(e,t){return((t||n).jsx?r:s).test(e)}},10114(e){"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7456(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},40501(e){"use strict";e.exports=JSON.parse('{"name":"aws-appsync-auth-link","version":"3.0.7","main":"lib/index.js","license":"Apache-2.0","description":"AWS Mobile AppSync Auth Link for JavaScript","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com/"},"homepage":"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git","repository":{"type":"git","url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git"},"scripts":{"prepare":"tsc","test":"jest --coverage --coverageReporters=text --passWithNoTests","test-watch":"jest --watch"},"dependencies":{"@aws-crypto/sha256-js":"^1.2.0","@aws-sdk/types":"^3.25.0","@aws-sdk/util-hex-encoding":"^3.29.0","debug":"2.6.9"},"devDependencies":{"@apollo/client":"^3.2.0"},"peerDependencies":{"@apollo/client":"3.x"}}')},3349(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},8049(e){"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},32279(e){"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},14923(e){"use strict";e.exports=JSON.parse('{"AElig":"Æ","AMP":"&","Aacute":"Á","Acirc":"Â","Agrave":"À","Aring":"Å","Atilde":"Ã","Auml":"Ä","COPY":"©","Ccedil":"Ç","ETH":"Ð","Eacute":"É","Ecirc":"Ê","Egrave":"È","Euml":"Ë","GT":">","Iacute":"Í","Icirc":"Î","Igrave":"Ì","Iuml":"Ï","LT":"<","Ntilde":"Ñ","Oacute":"Ó","Ocirc":"Ô","Ograve":"Ò","Oslash":"Ø","Otilde":"Õ","Ouml":"Ö","QUOT":"\\"","REG":"®","THORN":"Þ","Uacute":"Ú","Ucirc":"Û","Ugrave":"Ù","Uuml":"Ü","Yacute":"Ý","aacute":"á","acirc":"â","acute":"´","aelig":"æ","agrave":"à","amp":"&","aring":"å","atilde":"ã","auml":"ä","brvbar":"¦","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","curren":"¤","deg":"°","divide":"÷","eacute":"é","ecirc":"ê","egrave":"è","eth":"ð","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","iacute":"í","icirc":"î","iexcl":"¡","igrave":"ì","iquest":"¿","iuml":"ï","laquo":"«","lt":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","ntilde":"ñ","oacute":"ó","ocirc":"ô","ograve":"ò","ordf":"ª","ordm":"º","oslash":"ø","otilde":"õ","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","raquo":"»","reg":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","thorn":"þ","times":"×","uacute":"ú","ucirc":"û","ugrave":"ù","uml":"¨","uuml":"ü","yacute":"ý","yen":"¥","yuml":"ÿ"}')},61711(e){"use strict";e.exports=JSON.parse('{"0":"�","128":"€","130":"‚","131":"ƒ","132":"„","133":"…","134":"†","135":"‡","136":"ˆ","137":"‰","138":"Š","139":"‹","140":"Œ","142":"Ž","145":"‘","146":"’","147":"“","148":"”","149":"•","150":"–","151":"—","152":"˜","153":"™","154":"š","155":"›","156":"œ","158":"ž","159":"Ÿ"}')},37821(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},23718(e){"use strict";e.exports={rE:"6.6.1"}}}]);
//# sourceMappingURL=883.351e03bc8b137e3ddbd8.js.map