@moderneinc/react-charts 1.3.0-next.44efd5 → 1.3.0-next.bc5134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use strict";var zy=Object.defineProperty;var By=(e,t,r)=>t in e?zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xi=(e,t,r)=>By(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react/jsx-runtime"),z=require("@mui/material"),Q=require("react"),Zg=require("@mui/icons-material");function Uy(e){return e}var Ss=1,Ts=2,Yu=3,Ri=4,Df=1e-6;function Hy(e){return"translate("+e+",0)"}function Gy(e){return"translate(0,"+e+")"}function jy(e){return t=>+e(t)}function Yy(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Xy(){return!this.__axis}function Qg(e,t){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===Ss||e===Ri?-1:1,c=e===Ri||e===Ts?"x":"y",f=e===Ss||e===Yu?Hy:Gy;function h(p){var g=n??(t.ticks?t.ticks.apply(t,r):t.domain()),d=i??(t.tickFormat?t.tickFormat.apply(t,r):Uy),m=Math.max(a,0)+o,v=t.range(),y=+v[0]+l,x=+v[v.length-1]+l,_=(t.bandwidth?Yy:jy)(t.copy(),l),S=p.selection?p.selection():p,w=S.selectAll(".domain").data([null]),b=S.selectAll(".tick").data(g,t).order(),T=b.exit(),M=b.enter().append("g").attr("class","tick"),C=b.select("line"),A=b.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),b=b.merge(M),C=C.merge(M.append("line").attr("stroke","currentColor").attr(c+"2",u*a)),A=A.merge(M.append("text").attr("fill","currentColor").attr(c,u*m).attr("dy",e===Ss?"0em":e===Yu?"0.71em":"0.32em")),p!==S&&(w=w.transition(p),b=b.transition(p),C=C.transition(p),A=A.transition(p),T=T.transition(p).attr("opacity",Df).attr("transform",function(F){return isFinite(F=_(F))?f(F+l):this.getAttribute("transform")}),M.attr("opacity",Df).attr("transform",function(F){var E=this.parentNode.__axis;return f((E&&isFinite(E=E(F))?E:_(F))+l)})),T.remove(),w.attr("d",e===Ri||e===Ts?s?"M"+u*s+","+y+"H"+l+"V"+x+"H"+u*s:"M"+l+","+y+"V"+x:s?"M"+y+","+u*s+"V"+l+"H"+x+"V"+u*s:"M"+y+","+l+"H"+x),b.attr("opacity",1).attr("transform",function(F){return f(_(F)+l)}),C.attr(c+"2",u*a),A.attr(c,u*m).text(d),S.filter(Xy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ts?"start":e===Ri?"end":"middle"),S.each(function(){this.__axis=_})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return r=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),h):r.slice()},h.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),h):n&&n.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(a=s=+p,h):a},h.tickSizeInner=function(p){return arguments.length?(a=+p,h):a},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function qr(e){return Qg(Yu,e)}function Ir(e){return Qg(Ri,e)}var Wy={value:()=>{}};function Dc(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Ma(r)}function Ma(e){this._=e}function Ky(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Ma.prototype=Dc.prototype={constructor:Ma,on:function(e,t){var r=this._,n=Ky(e+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a<s;)if((i=(e=n[a]).type)&&(i=Vy(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=n[a]).type)r[i]=Of(r[i],e.name,t);else if(t==null)for(i in r)r[i]=Of(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Ma(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};function Vy(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function Of(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=Wy,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Xu="http://www.w3.org/1999/xhtml";const Pf={svg:"http://www.w3.org/2000/svg",xhtml:Xu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function es(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Pf.hasOwnProperty(t)?{space:Pf[t],local:e}:e}function Zy(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Xu&&t.documentElement.namespaceURI===Xu?t.createElement(e):t.createElementNS(r,e)}}function Qy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jg(e){var t=es(e);return(t.local?Qy:Zy)(t)}function Jy(){}function Oc(e){return e==null?Jy:function(){return this.querySelector(e)}}function t_(e){typeof e!="function"&&(e=Oc(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,o=n[i]=new Array(s),l,u,c=0;c<s;++c)(l=a[c])&&(u=e.call(l,l.__data__,c,a))&&("__data__"in l&&(u.__data__=l.__data__),o[c]=u);return new tr(n,this._parents)}function e_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function r_(){return[]}function tm(e){return e==null?r_:function(){return this.querySelectorAll(e)}}function n_(e){return function(){return e_(e.apply(this,arguments))}}function i_(e){typeof e=="function"?e=n_(e):e=tm(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var s=t[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&(n.push(e.call(l,l.__data__,u,s)),i.push(l));return new tr(n,i)}function em(e){return function(){return this.matches(e)}}function rm(e){return function(t){return t.matches(e)}}var a_=Array.prototype.find;function s_(e){return function(){return a_.call(this.children,e)}}function o_(){return this.firstElementChild}function l_(e){return this.select(e==null?o_:s_(typeof e=="function"?e:rm(e)))}var u_=Array.prototype.filter;function c_(){return Array.from(this.children)}function f_(e){return function(){return u_.call(this.children,e)}}function h_(e){return this.selectAll(e==null?c_:f_(typeof e=="function"?e:rm(e)))}function p_(e){typeof e!="function"&&(e=em(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,o=n[i]=[],l,u=0;u<s;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&o.push(l);return new tr(n,this._parents)}function nm(e){return new Array(e.length)}function d_(){return new tr(this._enter||this._groups.map(nm),this._parents)}function Pa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Pa.prototype={constructor:Pa,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)}};function g_(e){return function(){return e}}function m_(e,t,r,n,i,a){for(var s=0,o,l=t.length,u=a.length;s<u;++s)(o=t[s])?(o.__data__=a[s],n[s]=o):r[s]=new Pa(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function y_(e,t,r,n,i,a,s){var o,l,u=new Map,c=t.length,f=a.length,h=new Array(c),p;for(o=0;o<c;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",u.has(p)?i[o]=l:u.set(p,l));for(o=0;o<f;++o)p=s.call(e,a[o],o,a)+"",(l=u.get(p))?(n[o]=l,l.__data__=a[o],u.delete(p)):r[o]=new Pa(e,a[o]);for(o=0;o<c;++o)(l=t[o])&&u.get(h[o])===l&&(i[o]=l)}function __(e){return e.__data__}function v_(e,t){if(!arguments.length)return Array.from(this,__);var r=t?y_:m_,n=this._parents,i=this._groups;typeof e!="function"&&(e=g_(e));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),u=0;u<a;++u){var c=n[u],f=i[u],h=f.length,p=x_(e.call(c,c&&c.__data__,u,n)),g=p.length,d=o[u]=new Array(g),m=s[u]=new Array(g),v=l[u]=new Array(h);r(c,f,d,m,v,p,t);for(var y=0,x=0,_,S;y<g;++y)if(_=d[y]){for(y>=x&&(x=y+1);!(S=m[x])&&++x<g;);_._next=S||null}}return s=new tr(s,n),s._enter=o,s._exit=l,s}function x_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b_(){return new tr(this._exit||this._groups.map(nm),this._parents)}function w_(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function S_(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var u=r[l],c=n[l],f=u.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=u[g]||c[g])&&(h[g]=p);for(;l<i;++l)o[l]=r[l];return new tr(o,this._parents)}function T_(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],s;--i>=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function M_(e){e||(e=A_);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var s=r[a],o=s.length,l=i[a]=new Array(o),u,c=0;c<o;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new tr(i,this._parents).order()}function A_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function C_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function k_(){return Array.from(this)}function R_(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function E_(){let e=0;for(const t of this)++e;return e}function D_(){return!this.node()}function O_(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function P_(e){return function(){this.removeAttribute(e)}}function F_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function N_(e,t){return function(){this.setAttribute(e,t)}}function $_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function L_(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function q_(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function I_(e,t){var r=es(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?F_:P_:typeof t=="function"?r.local?q_:L_:r.local?$_:N_)(r,t))}function im(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function z_(e){return function(){this.style.removeProperty(e)}}function B_(e,t,r){return function(){this.style.setProperty(e,t,r)}}function U_(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function H_(e,t,r){return arguments.length>1?this.each((t==null?z_:typeof t=="function"?U_:B_)(e,t,r??"")):ri(this.node(),e)}function ri(e,t){return e.style.getPropertyValue(t)||im(e).getComputedStyle(e,null).getPropertyValue(t)}function G_(e){return function(){delete this[e]}}function j_(e,t){return function(){this[e]=t}}function Y_(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function X_(e,t){return arguments.length>1?this.each((t==null?G_:typeof t=="function"?Y_:j_)(e,t)):this.node()[e]}function am(e){return e.trim().split(/^|\s+/)}function Pc(e){return e.classList||new sm(e)}function sm(e){this._node=e,this._names=am(e.getAttribute("class")||"")}sm.prototype={add:function(e){var t=this._names.indexOf(e);t<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}};function om(e,t){for(var r=Pc(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function lm(e,t){for(var r=Pc(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function W_(e){return function(){om(this,e)}}function K_(e){return function(){lm(this,e)}}function V_(e,t){return function(){(t.apply(this,arguments)?om:lm)(this,e)}}function Z_(e,t){var r=am(e+"");if(arguments.length<2){for(var n=Pc(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?V_:t?W_:K_)(r,t))}function Q_(){this.textContent=""}function J_(e){return function(){this.textContent=e}}function t1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function e1(e){return arguments.length?this.each(e==null?Q_:(typeof e=="function"?t1:J_)(e)):this.node().textContent}function r1(){this.innerHTML=""}function n1(e){return function(){this.innerHTML=e}}function i1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function a1(e){return arguments.length?this.each(e==null?r1:(typeof e=="function"?i1:n1)(e)):this.node().innerHTML}function s1(){this.nextSibling&&this.parentNode.appendChild(this)}function o1(){return this.each(s1)}function l1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function u1(){return this.each(l1)}function c1(e){var t=typeof e=="function"?e:Jg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function f1(){return null}function h1(e,t){var r=typeof e=="function"?e:Jg(e),n=t==null?f1:typeof t=="function"?t:Oc(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function p1(){var e=this.parentNode;e&&e.removeChild(this)}function d1(){return this.each(p1)}function g1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function y1(e){return this.select(e?m1:g1)}function _1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function v1(e){return function(t){e.call(this,t,this.__data__)}}function x1(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function b1(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function w1(e,t,r){return function(){var n=this.__on,i,a=v1(t);if(n){for(var s=0,o=n.length;s<o;++s)if((i=n[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function S1(e,t,r){var n=x1(e+""),i,a=n.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,c;l<u;++l)for(i=0,c=o[l];i<a;++i)if((s=n[i]).type===c.type&&s.name===c.name)return c.value}return}for(o=t?w1:b1,i=0;i<a;++i)this.each(o(n[i],t,r));return this}function um(e,t,r){var n=im(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function T1(e,t){return function(){return um(this,e,t)}}function M1(e,t){return function(){return um(this,e,t.apply(this,arguments))}}function A1(e,t){return this.each((typeof t=="function"?M1:T1)(e,t))}function*C1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,s;i<a;++i)(s=n[i])&&(yield s)}var cm=[null];function tr(e,t){this._groups=e,this._parents=t}function di(){return new tr([[document.documentElement]],cm)}function k1(){return this}tr.prototype=di.prototype={constructor:tr,select:t_,selectAll:i_,selectChild:l_,selectChildren:h_,filter:p_,data:v_,enter:d_,exit:b_,join:w_,merge:S_,selection:k1,order:T_,sort:M_,call:C_,nodes:k_,node:R_,size:E_,empty:D_,each:O_,attr:I_,style:H_,property:X_,classed:Z_,text:e1,html:a1,raise:o1,lower:u1,append:c1,insert:h1,remove:d1,clone:y1,datum:_1,on:S1,dispatch:A1,[Symbol.iterator]:C1};function Ct(e){return typeof e=="string"?new tr([[document.querySelector(e)]],[document.documentElement]):new tr([[e]],cm)}function R1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function en(e,t){if(e=R1(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Wu={capture:!0,passive:!1};function Ku(e){e.preventDefault(),e.stopImmediatePropagation()}function E1(e){var t=e.document.documentElement,r=Ct(e).on("dragstart.drag",Ku,Wu);"onselectstart"in t?r.on("selectstart.drag",Ku,Wu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function D1(e,t){var r=e.document.documentElement,n=Ct(e).on("dragstart.drag",null);t&&(n.on("click.drag",Ku,Wu),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Fc(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function fm(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ia(){}var Yi=.7,Fa=1/Yi,Wn="\\s*([+-]?\\d+)\\s*",Xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O1=/^#([0-9a-f]{3,8})$/,P1=new RegExp(`^rgb\\(${Wn},${Wn},${Wn}\\)$`),F1=new RegExp(`^rgb\\(${Tr},${Tr},${Tr}\\)$`),N1=new RegExp(`^rgba\\(${Wn},${Wn},${Wn},${Xi}\\)$`),$1=new RegExp(`^rgba\\(${Tr},${Tr},${Tr},${Xi}\\)$`),L1=new RegExp(`^hsl\\(${Xi},${Tr},${Tr}\\)$`),q1=new RegExp(`^hsla\\(${Xi},${Tr},${Tr},${Xi}\\)$`),Ff={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};Fc(ia,Tn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Nf,formatHex:Nf,formatHex8:I1,formatHsl:z1,formatRgb:$f,toString:$f});function Nf(){return this.rgb().formatHex()}function I1(){return this.rgb().formatHex8()}function z1(){return hm(this).formatHsl()}function $f(){return this.rgb().formatRgb()}function Tn(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=O1.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Lf(t):r===3?new Le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ma(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ma(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=P1.exec(e))?new Le(t[1],t[2],t[3],1):(t=F1.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=N1.exec(e))?ma(t[1],t[2],t[3],t[4]):(t=$1.exec(e))?ma(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=L1.exec(e))?zf(t[1],t[2]/100,t[3]/100,1):(t=q1.exec(e))?zf(t[1],t[2]/100,t[3]/100,t[4]):Ff.hasOwnProperty(e)?Lf(Ff[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function Lf(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function ma(e,t,r,n){return n<=0&&(e=t=r=NaN),new Le(e,t,r,n)}function B1(e){return e instanceof ia||(e=Tn(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function Vu(e,t,r,n){return arguments.length===1?B1(e):new Le(e,t,r,n??1)}function Le(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Fc(Le,Vu,fm(ia,{brighter(e){return e=e==null?Fa:Math.pow(Fa,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yi:Math.pow(Yi,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le(vn(this.r),vn(this.g),vn(this.b),Na(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:qf,formatHex:qf,formatHex8:U1,formatRgb:If,toString:If}));function qf(){return`#${mn(this.r)}${mn(this.g)}${mn(this.b)}`}function U1(){return`#${mn(this.r)}${mn(this.g)}${mn(this.b)}${mn((isNaN(this.opacity)?1:this.opacity)*255)}`}function If(){const e=Na(this.opacity);return`${e===1?"rgb(":"rgba("}${vn(this.r)}, ${vn(this.g)}, ${vn(this.b)}${e===1?")":`, ${e})`}`}function Na(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mn(e){return e=vn(e),(e<16?"0":"")+e.toString(16)}function zf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new mr(e,t,r,n)}function hm(e){if(e instanceof mr)return new mr(e.h,e.s,e.l,e.opacity);if(e instanceof ia||(e=Tn(e)),!e)return new mr;if(e instanceof mr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(r-n)/o+(r<n)*6:r===a?s=(n-t)/o+2:s=(t-r)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new mr(s,o,l,e.opacity)}function H1(e,t,r,n){return arguments.length===1?hm(e):new mr(e,t,r,n??1)}function mr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Fc(mr,H1,fm(ia,{brighter(e){return e=e==null?Fa:Math.pow(Fa,e),new mr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yi:Math.pow(Yi,e),new mr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Le(Ms(e>=240?e-240:e+120,i,n),Ms(e,i,n),Ms(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new mr(Bf(this.h),ya(this.s),ya(this.l),Na(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=Na(this.opacity);return`${e===1?"hsl(":"hsla("}${Bf(this.h)}, ${ya(this.s)*100}%, ${ya(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bf(e){return e=(e||0)%360,e<0?e+360:e}function ya(e){return Math.max(0,Math.min(1,e||0))}function Ms(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Nc=e=>()=>e;function G1(e,t){return function(r){return e+r*t}}function j1(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Y1(e){return(e=+e)==1?pm:function(t,r){return r-t?j1(t,r,e):Nc(isNaN(t)?r:t)}}function pm(e,t){var r=t-e;return r?G1(e,r):Nc(isNaN(e)?t:e)}const $a=(function e(t){var r=Y1(t);function n(i,a){var s=r((i=Vu(i)).r,(a=Vu(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=pm(i.opacity,a.opacity);return function(c){return i.r=s(c),i.g=o(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n})(1);function X1(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function W1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function K1(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=rs(e[s],t[s]);for(;s<r;++s)a[s]=t[s];return function(o){for(s=0;s<n;++s)a[s]=i[s](o);return a}}function V1(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function gr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Z1(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=rs(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Zu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,As=new RegExp(Zu.source,"g");function Q1(e){return function(){return e}}function J1(e){return function(t){return e(t)+""}}function dm(e,t){var r=Zu.lastIndex=As.lastIndex=0,n,i,a,s=-1,o=[],l=[];for(e=e+"",t=t+"";(n=Zu.exec(e))&&(i=As.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:gr(n,i)})),r=As.lastIndex;return r<t.length&&(a=t.slice(r),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?J1(l[0].x):Q1(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)o[(f=l[c]).i]=f.x(u);return o.join("")})}function rs(e,t){var r=typeof t,n;return t==null||r==="boolean"?Nc(t):(r==="number"?gr:r==="string"?(n=Tn(t))?(t=n,$a):dm:t instanceof Tn?$a:t instanceof Date?V1:W1(t)?X1:Array.isArray(t)?K1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Z1:gr)(e,t)}function tv(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var Uf=180/Math.PI,Qu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gm(e,t,r,n,i,a){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),e*n<t*r&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Uf,skewX:Math.atan(l)*Uf,scaleX:s,scaleY:o}}var _a;function ev(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qu:gm(t.a,t.b,t.c,t.d,t.e,t.f)}function rv(e){return e==null||(_a||(_a=document.createElementNS("http://www.w3.org/2000/svg","g")),_a.setAttribute("transform",e),!(e=_a.transform.baseVal.consolidate()))?Qu:(e=e.matrix,gm(e.a,e.b,e.c,e.d,e.e,e.f))}function mm(e,t,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push("translate(",null,t,null,r);g.push({i:d-4,x:gr(u,f)},{i:d-2,x:gr(c,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function s(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,n)-2,x:gr(u,c)})):c&&f.push(i(f)+"rotate("+c+n)}function o(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,n)-2,x:gr(u,c)}):c&&f.push(i(f)+"skewX("+c+n)}function l(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push(i(p)+"scale(",null,",",null,")");g.push({i:d-4,x:gr(u,f)},{i:d-2,x:gr(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),a(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),o(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var g=-1,d=h.length,m;++g<d;)f[(m=h[g]).i]=m.x(p);return f.join("")}}}var nv=mm(ev,"px, ","px)","deg)"),iv=mm(rv,", ",")",")"),ni=0,Ei=0,bi=0,ym=1e3,La,Di,qa=0,Mn=0,ns=0,Wi=typeof performance=="object"&&performance.now?performance:Date,_m=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $c(){return Mn||(_m(av),Mn=Wi.now()+ns)}function av(){Mn=0}function Ia(){this._call=this._time=this._next=null}Ia.prototype=vm.prototype={constructor:Ia,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?$c():+r)+(t==null?0:+t),!this._next&&Di!==this&&(Di?Di._next=this:La=this,Di=this),this._call=e,this._time=r,Ju()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ju())}};function vm(e,t,r){var n=new Ia;return n.restart(e,t,r),n}function sv(){$c(),++ni;for(var e=La,t;e;)(t=Mn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ni}function Hf(){Mn=(qa=Wi.now())+ns,ni=Ei=0;try{sv()}finally{ni=0,lv(),Mn=0}}function ov(){var e=Wi.now(),t=e-qa;t>ym&&(ns-=t,qa=e)}function lv(){for(var e,t=La,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:La=r);Di=e,Ju(n)}function Ju(e){if(!ni){Ei&&(Ei=clearTimeout(Ei));var t=e-Mn;t>24?(e<1/0&&(Ei=setTimeout(Hf,e-Wi.now()-ns)),bi&&(bi=clearInterval(bi))):(bi||(qa=Wi.now(),bi=setInterval(ov,ym)),ni=1,_m(Hf))}}function Gf(e,t,r){var n=new Ia;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var uv=Dc("start","end","cancel","interrupt"),cv=[],xm=0,jf=1,tc=2,Aa=3,Yf=4,ec=5,Ca=6;function is(e,t,r,n,i,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;fv(e,r,{name:t,index:n,group:i,on:uv,tween:cv,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:xm})}function Lc(e,t){var r=yr(e,t);if(r.state>xm)throw new Error("too late; already scheduled");return r}function Ar(e,t){var r=yr(e,t);if(r.state>Aa)throw new Error("too late; already running");return r}function yr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function fv(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=vm(a,0,r.time);function a(u){r.state=jf,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var c,f,h,p;if(r.state!==jf)return l();for(c in n)if(p=n[c],p.name===r.name){if(p.state===Aa)return Gf(s);p.state===Yf?(p.state=Ca,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[c]):+c<t&&(p.state=Ca,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete n[c])}if(Gf(function(){r.state===Aa&&(r.state=Yf,r.timer.restart(o,r.delay,r.time),o(u))}),r.state=tc,r.on.call("start",e,e.__data__,r.index,r.group),r.state===tc){for(r.state=Aa,i=new Array(h=r.tween.length),c=0,f=-1;c<h;++c)(p=r.tween[c].value.call(e,e.__data__,r.index,r.group))&&(i[++f]=p);i.length=f+1}}function o(u){for(var c=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(l),r.state=ec,1),f=-1,h=i.length;++f<h;)i[f].call(e,c);r.state===ec&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=Ca,r.timer.stop(),delete n[t];for(var u in n)return;delete e.__transition}}function rc(e,t){var r=e.__transition,n,i,a=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){a=!1;continue}i=n.state>tc&&n.state<ec,n.state=Ca,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}a&&delete e.__transition}}function hv(e){return this.each(function(){rc(this,e)})}function pv(e,t){var r,n;return function(){var i=Ar(this,e),a=i.tween;if(a!==r){n=r=a;for(var s=0,o=n.length;s<o;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function dv(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=Ar(this,e),s=a.tween;if(s!==n){i=(n=s).slice();for(var o={name:t,value:r},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=o;break}l===u&&i.push(o)}a.tween=i}}function gv(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=yr(this.node(),r).tween,i=0,a=n.length,s;i<a;++i)if((s=n[i]).name===e)return s.value;return null}return this.each((t==null?pv:dv)(r,e,t))}function qc(e,t,r){var n=e._id;return e.each(function(){var i=Ar(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return yr(i,n).value[t]}}function bm(e,t){var r;return(typeof t=="number"?gr:t instanceof Tn?$a:(r=Tn(t))?(t=r,$a):dm)(e,t)}function mv(e){return function(){this.removeAttribute(e)}}function yv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _v(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===n?a:a=t(n=s,r)}}function vv(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===n?a:a=t(n=s,r)}}function xv(e,t,r){var n,i,a;return function(){var s,o=r(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===n&&l===i?a:(i=l,a=t(n=s,o)))}}function bv(e,t,r){var n,i,a;return function(){var s,o=r(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===n&&l===i?a:(i=l,a=t(n=s,o)))}}function wv(e,t){var r=es(e),n=r==="transform"?iv:bm;return this.attrTween(e,typeof t=="function"?(r.local?bv:xv)(r,n,qc(this,"attr."+e,t)):t==null?(r.local?yv:mv)(r):(r.local?vv:_v)(r,n,t))}function Sv(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Tv(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Mv(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&Tv(e,a)),r}return i._value=t,i}function Av(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&Sv(e,a)),r}return i._value=t,i}function Cv(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=es(e);return this.tween(r,(n.local?Mv:Av)(n,t))}function kv(e,t){return function(){Lc(this,e).delay=+t.apply(this,arguments)}}function Rv(e,t){return t=+t,function(){Lc(this,e).delay=t}}function Ev(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kv:Rv)(t,e)):yr(this.node(),t).delay}function Dv(e,t){return function(){Ar(this,e).duration=+t.apply(this,arguments)}}function Ov(e,t){return t=+t,function(){Ar(this,e).duration=t}}function Pv(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Dv:Ov)(t,e)):yr(this.node(),t).duration}function Fv(e,t){if(typeof t!="function")throw new Error;return function(){Ar(this,e).ease=t}}function Nv(e){var t=this._id;return arguments.length?this.each(Fv(t,e)):yr(this.node(),t).ease}function $v(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ar(this,e).ease=r}}function Lv(e){if(typeof e!="function")throw new Error;return this.each($v(this._id,e))}function qv(e){typeof e!="function"&&(e=em(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,o=n[i]=[],l,u=0;u<s;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&o.push(l);return new zr(n,this._parents,this._name,this._id)}function Iv(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),s=new Array(n),o=0;o<a;++o)for(var l=t[o],u=r[o],c=l.length,f=s[o]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;o<n;++o)s[o]=t[o];return new zr(s,this._parents,this._name,this._id)}function zv(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Bv(e,t,r){var n,i,a=zv(t)?Lc:Ar;return function(){var s=a(this,e),o=s.on;o!==n&&(i=(n=o).copy()).on(t,r),s.on=i}}function Uv(e,t){var r=this._id;return arguments.length<2?yr(this.node(),r).on.on(e):this.each(Bv(r,e,t))}function Hv(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Gv(){return this.on("end.remove",Hv(this._id))}function jv(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Oc(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],l=o.length,u=a[s]=new Array(l),c,f,h=0;h<l;++h)(c=o[h])&&(f=e.call(c,c.__data__,h,o))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,is(u[h],t,r,h,u,yr(c,r)));return new zr(a,this._parents,t,r)}function Yv(e){var t=this._name,r=this._id;typeof e!="function"&&(e=tm(e));for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var l=n[o],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),p,g=yr(c,r),d=0,m=h.length;d<m;++d)(p=h[d])&&is(p,t,r,d,h,g);a.push(h),s.push(c)}return new zr(a,s,t,r)}var Xv=di.prototype.constructor;function Wv(){return new Xv(this._groups,this._parents)}function Kv(e,t){var r,n,i;return function(){var a=ri(this,e),s=(this.style.removeProperty(e),ri(this,e));return a===s?null:a===r&&s===n?i:i=t(r=a,n=s)}}function wm(e){return function(){this.style.removeProperty(e)}}function Vv(e,t,r){var n,i=r+"",a;return function(){var s=ri(this,e);return s===i?null:s===n?a:a=t(n=s,r)}}function Zv(e,t,r){var n,i,a;return function(){var s=ri(this,e),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),ri(this,e))),s===l?null:s===n&&l===i?a:(i=l,a=t(n=s,o))}}function Qv(e,t){var r,n,i,a="style."+t,s="end."+a,o;return function(){var l=Ar(this,e),u=l.on,c=l.value[a]==null?o||(o=wm(t)):void 0;(u!==r||i!==c)&&(n=(r=u).copy()).on(s,i=c),l.on=n}}function Jv(e,t,r){var n=(e+="")=="transform"?nv:bm;return t==null?this.styleTween(e,Kv(e,n)).on("end.style."+e,wm(e)):typeof t=="function"?this.styleTween(e,Zv(e,n,qc(this,"style."+e,t))).each(Qv(this._id,e)):this.styleTween(e,Vv(e,n,t),r).on("end.style."+e,null)}function tx(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function ex(e,t,r){var n,i;function a(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&tx(e,s,r)),n}return a._value=t,a}function rx(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,ex(e,t,r??""))}function nx(e){return function(){this.textContent=e}}function ix(e){return function(){var t=e(this);this.textContent=t??""}}function ax(e){return this.tween("text",typeof e=="function"?ix(qc(this,"text",e)):nx(e==null?"":e+""))}function sx(e){return function(t){this.textContent=e.call(this,t)}}function ox(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&sx(i)),t}return n._value=e,n}function lx(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ox(e))}function ux(){for(var e=this._name,t=this._id,r=Sm(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,l,u=0;u<o;++u)if(l=s[u]){var c=yr(l,t);is(l,e,r,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new zr(n,this._parents,e,r)}function cx(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};r.each(function(){var u=Ar(this,n),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),u.on=t}),i===0&&a()})}var fx=0;function zr(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function Ic(e){return di().transition(e)}function Sm(){return++fx}var Dr=di.prototype;zr.prototype=Ic.prototype={constructor:zr,select:jv,selectAll:Yv,selectChild:Dr.selectChild,selectChildren:Dr.selectChildren,filter:qv,merge:Iv,selection:Wv,transition:ux,call:Dr.call,nodes:Dr.nodes,node:Dr.node,size:Dr.size,empty:Dr.empty,each:Dr.each,on:Uv,attr:wv,attrTween:Cv,style:Jv,styleTween:rx,text:ax,textTween:lx,remove:Gv,tween:gv,delay:Ev,duration:Pv,ease:Nv,easeVarying:Lv,end:cx,[Symbol.iterator]:Dr[Symbol.iterator]};function hx(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var px={time:null,delay:0,duration:250,ease:hx};function dx(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function gx(e){var t,r;e instanceof zr?(t=e._id,e=e._name):(t=Sm(),(r=px).time=$c(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&is(l,e,t,u,s,r||dx(l,t));return new zr(n,this._parents,e,t)}di.prototype.interrupt=hv;di.prototype.transition=gx;const Cs=e=>()=>e;function mx(e,{sourceEvent:t,target:r,selection:n,mode:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:n,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function yx(e){e.stopImmediatePropagation()}function ks(e){e.preventDefault(),e.stopImmediatePropagation()}var Xf={name:"drag"},Rs={name:"space"},qn={name:"handle"},In={name:"center"};const{abs:Wf,max:Ae,min:Ce}=Math;function Kf(e){return[+e[0],+e[1]]}function Vf(e){return[Kf(e[0]),Kf(e[1])]}var ka={name:"x",handles:["w","e"].map(nc),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Es={},Or={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Zf={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Qf={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},_x={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},vx={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function nc(e){return{type:e}}function xx(e){return!e.ctrlKey&&!e.button}function bx(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function wx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ds(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Sx(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function gi(){return Tx(ka)}function Tx(e){var t=bx,r=xx,n=wx,i=!0,a=Dc("start","brush","end"),s=6,o;function l(m){var v=m.property("__brush",d).selectAll(".overlay").data([nc("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Or.overlay).merge(v).each(function(){var x=Ds(this).extent;Ct(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([nc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Or.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(e.handles,function(x){return x.type});y.exit().remove(),y.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return Or[x.type]}),m.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(n).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,y){m.tween?m.on("start.brush",function(x){c(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){c(this,arguments).end(x)}).tween("brush",function(){var x=this,_=x.__brush,S=c(x,arguments),w=_.selection,b=e.input(typeof v=="function"?v.apply(this,arguments):v,_.extent),T=rs(w,b);function M(C){_.selection=C===1&&b===null?null:T(C),u.call(x),S.brush()}return w!==null&&b!==null?M:M(1)}):m.each(function(){var x=this,_=arguments,S=x.__brush,w=e.input(typeof v=="function"?v.apply(x,_):v,S.extent),b=c(x,_).beforestart();rc(x),S.selection=w===null?null:w,u.call(x),b.start(y).brush(y).end(y)})},l.clear=function(m,v){l.move(m,null,v)};function u(){var m=Ct(this),v=Ds(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?v[1][0]-s/2:v[0][0]-s/2}).attr("y",function(y){return y.type[0]==="s"?v[1][1]-s/2:v[0][1]-s/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?v[1][0]-v[0][0]+s:s}).attr("height",function(y){return y.type==="e"||y.type==="w"?v[1][1]-v[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,v,y){var x=m.__brush.emitter;return x&&(!y||!x.clean)?x:new f(m,v,y)}function f(m,v,y){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=y}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,y){var x=Ct(this.that).datum();a.call(m,this.that,new mx(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:y,dispatch:a}),x)}};function h(m){if(o&&!m.touches||!r.apply(this,arguments))return;var v=this,y=m.target.__data__.type,x=(i&&m.metaKey?y="overlay":y)==="selection"?Xf:i&&m.altKey?In:qn,_=e===Es?null:_x[y],S=e===ka?null:vx[y],w=Ds(v),b=w.extent,T=w.selection,M=b[0][0],C,A,F=b[0][1],E,N,U=b[1][0],P,O,j=b[1][1],X,et,at=0,tt=0,G,W=_&&S&&i&&m.shiftKey,$,K,L=Array.from(m.touches||[m],rt=>{const ft=rt.identifier;return rt=en(rt,v),rt.point0=rt.slice(),rt.identifier=ft,rt});rc(v);var B=c(v,arguments,!0).beforestart();if(y==="overlay"){T&&(G=!0);const rt=[L[0],L[1]||L[0]];w.selection=T=[[C=e===Es?M:Ce(rt[0][0],rt[1][0]),E=e===ka?F:Ce(rt[0][1],rt[1][1])],[P=e===Es?U:Ae(rt[0][0],rt[1][0]),X=e===ka?j:Ae(rt[0][1],rt[1][1])]],L.length>1&&nt(m)}else C=T[0][0],E=T[0][1],P=T[1][0],X=T[1][1];A=C,N=E,O=P,et=X;var k=Ct(v).attr("pointer-events","none"),I=k.selectAll(".overlay").attr("cursor",Or[y]);if(m.touches)B.moved=R,B.ended=Y;else{var q=Ct(m.view).on("mousemove.brush",R,!0).on("mouseup.brush",Y,!0);i&&q.on("keydown.brush",Z,!0).on("keyup.brush",lt,!0),E1(m.view)}u.call(v),B.start(m,x.name);function R(rt){for(const ft of rt.changedTouches||[rt])for(const wt of L)wt.identifier===ft.identifier&&(wt.cur=en(ft,v));if(W&&!$&&!K&&L.length===1){const ft=L[0];Wf(ft.cur[0]-ft[0])>Wf(ft.cur[1]-ft[1])?K=!0:$=!0}for(const ft of L)ft.cur&&(ft[0]=ft.cur[0],ft[1]=ft.cur[1]);G=!0,ks(rt),nt(rt)}function nt(rt){const ft=L[0],wt=ft.point0;var st;switch(at=ft[0]-wt[0],tt=ft[1]-wt[1],x){case Rs:case Xf:{_&&(at=Ae(M-C,Ce(U-P,at)),A=C+at,O=P+at),S&&(tt=Ae(F-E,Ce(j-X,tt)),N=E+tt,et=X+tt);break}case qn:{L[1]?(_&&(A=Ae(M,Ce(U,L[0][0])),O=Ae(M,Ce(U,L[1][0])),_=1),S&&(N=Ae(F,Ce(j,L[0][1])),et=Ae(F,Ce(j,L[1][1])),S=1)):(_<0?(at=Ae(M-C,Ce(U-C,at)),A=C+at,O=P):_>0&&(at=Ae(M-P,Ce(U-P,at)),A=C,O=P+at),S<0?(tt=Ae(F-E,Ce(j-E,tt)),N=E+tt,et=X):S>0&&(tt=Ae(F-X,Ce(j-X,tt)),N=E,et=X+tt));break}case In:{_&&(A=Ae(M,Ce(U,C-at*_)),O=Ae(M,Ce(U,P+at*_))),S&&(N=Ae(F,Ce(j,E-tt*S)),et=Ae(F,Ce(j,X+tt*S)));break}}O<A&&(_*=-1,st=C,C=P,P=st,st=A,A=O,O=st,y in Zf&&I.attr("cursor",Or[y=Zf[y]])),et<N&&(S*=-1,st=E,E=X,X=st,st=N,N=et,et=st,y in Qf&&I.attr("cursor",Or[y=Qf[y]])),w.selection&&(T=w.selection),$&&(A=T[0][0],O=T[1][0]),K&&(N=T[0][1],et=T[1][1]),(T[0][0]!==A||T[0][1]!==N||T[1][0]!==O||T[1][1]!==et)&&(w.selection=[[A,N],[O,et]],u.call(v),B.brush(rt,x.name))}function Y(rt){if(yx(rt),rt.touches){if(rt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else D1(rt.view,G),q.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);k.attr("pointer-events","all"),I.attr("cursor",Or.overlay),w.selection&&(T=w.selection),Sx(T)&&(w.selection=null,u.call(v)),B.end(rt,x.name)}function Z(rt){switch(rt.keyCode){case 16:{W=_&&S;break}case 18:{x===qn&&(_&&(P=O-at*_,C=A+at*_),S&&(X=et-tt*S,E=N+tt*S),x=In,nt(rt));break}case 32:{(x===qn||x===In)&&(_<0?P=O-at:_>0&&(C=A-at),S<0?X=et-tt:S>0&&(E=N-tt),x=Rs,I.attr("cursor",Or.selection),nt(rt));break}default:return}ks(rt)}function lt(rt){switch(rt.keyCode){case 16:{W&&($=K=W=!1,nt(rt));break}case 18:{x===In&&(_<0?P=O:_>0&&(C=A),S<0?X=et:S>0&&(E=N),x=qn,nt(rt));break}case 32:{x===Rs&&(rt.altKey?(_&&(P=O-at*_,C=A+at*_),S&&(X=et-tt*S,E=N+tt*S),x=In):(_<0?P=O:_>0&&(C=A),S<0?X=et:S>0&&(E=N),x=qn),I.attr("cursor",Or[y]),nt(rt));break}default:return}ks(rt)}}function p(m){c(this,arguments).moved(m)}function g(m){c(this,arguments).ended(m)}function d(){var m=this.__brush||{selection:null};return m.extent=Vf(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Cs(Vf(m)),l):t},l.filter=function(m){return arguments.length?(r=typeof m=="function"?m:Cs(!!m),l):r},l.touchable=function(m){return arguments.length?(n=typeof m=="function"?m:Cs(!!m),l):n},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=a.on.apply(a,arguments);return m===a?l:m},l}function Ra(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Mx(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zc(e){let t,r,n;e.length!==2?(t=Ra,r=(o,l)=>Ra(e(o),l),n=(o,l)=>e(o)-l):(t=e===Ra||e===Mx?e:Ax,r=e,n=e);function i(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;r(o[f],l)<0?u=f+1:c=f}while(u<c)}return u}function a(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;r(o[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function s(o,l,u=0,c=o.length){const f=i(o,l,u,c-1);return f>u&&n(o[f-1],l)>-n(o[f],l)?f-1:f}return{left:i,center:s,right:a}}function Ax(){return 0}function Cx(e){return e===null?NaN:+e}const kx=zc(Ra),Rx=kx.right;zc(Cx).center;const Ex=Math.sqrt(50),Dx=Math.sqrt(10),Ox=Math.sqrt(2);function za(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Ex?10:a>=Dx?5:a>=Ox?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=r&&r<2?za(e,t,r*2):[o,l,u]}function Px(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,s]=n?za(t,e,r):za(e,t,r);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u<o;++u)l[u]=(a-u)/-s;else for(let u=0;u<o;++u)l[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)l[u]=(i+u)/-s;else for(let u=0;u<o;++u)l[u]=(i+u)*s;return l}function ic(e,t,r){return t=+t,e=+e,r=+r,za(e,t,r)[2]}function ac(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?ic(t,e,r):ic(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function Tm(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Fx(e){return function(){return e}}function Nx(e){return+e}var Jf=[0,1];function Gn(e){return e}function sc(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Fx(isNaN(t)?NaN:.5)}function $x(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Lx(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i<n?(n=sc(i,n),a=r(s,a)):(n=sc(n,i),a=r(a,s)),function(o){return a(n(o))}}function qx(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)i[s]=sc(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(o){var l=Rx(e,o,1,n)-1;return a[l](i[l](o))}}function Mm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ix(){var e=Jf,t=Jf,r=rs,n,i,a,s=Gn,o,l,u;function c(){var h=Math.min(e.length,t.length);return s!==Gn&&(s=$x(e[0],e[h-1])),o=h>2?qx:Lx,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=o(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(i((u||(u=o(t,e.map(n),gr)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Nx),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=tv,c()},f.clamp=function(h){return arguments.length?(s=h?!0:Gn,c()):s!==Gn},f.interpolate=function(h){return arguments.length?(r=h,c()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return n=h,i=p,c()}}function Am(){return Ix()(Gn,Gn)}function zx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ba(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ii(e){return e=Ba(Math.abs(e)),e?e[1]:NaN}function Bx(e,t){return function(r,n){for(var i=r.length,a=[],s=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Ux(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Hx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ua(e){if(!(t=Hx.exec(e)))throw new Error("invalid format: "+e);var t;return new Bc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ua.prototype=Bc.prototype;function Bc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Bc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Gx(e){t:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break t;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Cm;function jx(e,t){var r=Ba(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(Cm=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Ba(e,Math.max(0,t+a-1))[0]}function th(e,t){var r=Ba(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const eh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zx,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>th(e*100,t),r:th,s:jx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function rh(e){return e}var nh=Array.prototype.map,ih=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yx(e){var t=e.grouping===void 0||e.thousands===void 0?rh:Bx(nh.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?rh:Ux(nh.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Ua(f);var h=f.fill,p=f.align,g=f.sign,d=f.symbol,m=f.zero,v=f.width,y=f.comma,x=f.precision,_=f.trim,S=f.type;S==="n"?(y=!0,S="g"):eh[S]||(x===void 0&&(x=12),_=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=d==="$"?r:d==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",b=d==="$"?n:/[%p]/.test(S)?s:"",T=eh[S],M=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function C(A){var F=w,E=b,N,U,P;if(S==="c")E=T(A)+E,A="";else{A=+A;var O=A<0||1/A<0;if(A=isNaN(A)?l:T(Math.abs(A),x),_&&(A=Gx(A)),O&&+A==0&&g!=="+"&&(O=!1),F=(O?g==="("?g:o:g==="-"||g==="("?"":g)+F,E=(S==="s"?ih[8+Cm/3]:"")+E+(O&&g==="("?")":""),M){for(N=-1,U=A.length;++N<U;)if(P=A.charCodeAt(N),48>P||P>57){E=(P===46?i+A.slice(N+1):A.slice(N))+E,A=A.slice(0,N);break}}}y&&!m&&(A=t(A,1/0));var j=F.length+A.length+E.length,X=j<v?new Array(v-j+1).join(h):"";switch(y&&m&&(A=t(X+A,X.length?v-E.length:1/0),X=""),p){case"<":A=F+A+E+X;break;case"=":A=F+X+A+E;break;case"^":A=X.slice(0,j=X.length>>1)+F+A+E+X.slice(j);break;default:A=X+F+A+E;break}return a(A)}return C.toString=function(){return f+""},C}function c(f,h){var p=u((f=Ua(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(ii(h)/3)))*3,d=Math.pow(10,-g),m=ih[8+g/3];return function(v){return p(d*v)+m}}return{format:u,formatPrefix:c}}var va,km,Rm;Xx({thousands:",",grouping:[3],currency:["$",""]});function Xx(e){return va=Yx(e),km=va.format,Rm=va.formatPrefix,va}function Wx(e){return Math.max(0,-ii(Math.abs(e)))}function Kx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ii(t)/3)))*3-ii(Math.abs(e)))}function Vx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ii(t)-ii(e))+1}function Zx(e,t,r,n){var i=ac(e,t,r),a;switch(n=Ua(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Kx(i,s))&&(n.precision=a),Rm(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Vx(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Wx(i))&&(n.precision=a-(n.type==="%")*2);break}}return km(n)}function Qx(e){var t=e.domain;return e.ticks=function(r){var n=t();return Px(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Zx(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,c=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);c-- >0;){if(u=ic(s,o,r),u===l)return n[i]=s,n[a]=o,t(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return e},e}function ai(){var e=Am();return e.copy=function(){return Mm(e,ai())},Tm.apply(e,arguments),Qx(e)}function Jx(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],s;return a<i&&(s=r,r=n,n=s,s=i,i=a,a=s),e[r]=t.floor(i),e[n]=t.ceil(a),e}const Os=new Date,Ps=new Date;function pe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let u;do l.push(u=new Date(+a)),t(a,o),e(a);while(u<a&&a<s);return l},i.filter=a=>pe(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),r&&(i.count=(a,s)=>(Os.setTime(+a),Ps.setTime(+s),e(Os),e(Ps),Math.floor(r(Os,Ps))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Ha=pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ha.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Ha);Ha.range;const $r=1e3,sr=$r*60,Lr=sr*60,Br=Lr*24,Uc=Br*7,ah=Br*30,Fs=Br*365,jn=pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getUTCSeconds());jn.range;const Hc=pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$r)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getMinutes());Hc.range;const tb=pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getUTCMinutes());tb.range;const Gc=pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$r-e.getMinutes()*sr)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getHours());Gc.range;const eb=pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getUTCHours());eb.range;const aa=pe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*sr)/Br,e=>e.getDate()-1);aa.range;const jc=pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Br,e=>e.getUTCDate()-1);jc.range;const rb=pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Br,e=>Math.floor(e/Br));rb.range;function kn(e){return pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*sr)/Uc)}const as=kn(0),Ga=kn(1),nb=kn(2),ib=kn(3),si=kn(4),ab=kn(5),sb=kn(6);as.range;Ga.range;nb.range;ib.range;si.range;ab.range;sb.range;function Rn(e){return pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Uc)}const Em=Rn(0),ja=Rn(1),ob=Rn(2),lb=Rn(3),oi=Rn(4),ub=Rn(5),cb=Rn(6);Em.range;ja.range;ob.range;lb.range;oi.range;ub.range;cb.range;const Yc=pe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Yc.range;const fb=pe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());fb.range;const Ur=pe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ur.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ur.range;const An=pe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());An.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});An.range;function hb(e,t,r,n,i,a){const s=[[jn,1,$r],[jn,5,5*$r],[jn,15,15*$r],[jn,30,30*$r],[a,1,sr],[a,5,5*sr],[a,15,15*sr],[a,30,30*sr],[i,1,Lr],[i,3,3*Lr],[i,6,6*Lr],[i,12,12*Lr],[n,1,Br],[n,2,2*Br],[r,1,Uc],[t,1,ah],[t,3,3*ah],[e,1,Fs]];function o(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const p=f&&typeof f.range=="function"?f:l(u,c,f),g=p?p.range(u,+c+1):[];return h?g.reverse():g}function l(u,c,f){const h=Math.abs(c-u)/f,p=zc(([,,m])=>m).right(s,h);if(p===s.length)return e.every(ac(u/Fs,c/Fs,f));if(p===0)return Ha.every(Math.max(ac(u,c,f),1));const[g,d]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(d)}return[o,l]}const[pb,db]=hb(Ur,Yc,as,aa,Gc,Hc);function Ns(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function $s(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function wi(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function gb(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,u=Si(i),c=Ti(i),f=Si(a),h=Ti(a),p=Si(s),g=Ti(s),d=Si(o),m=Ti(o),v=Si(l),y=Ti(l),x={a:O,A:j,b:X,B:et,c:null,d:fh,e:fh,f:qb,g:Wb,G:Vb,H:Nb,I:$b,j:Lb,L:Dm,m:Ib,M:zb,p:at,q:tt,Q:dh,s:gh,S:Bb,u:Ub,U:Hb,V:Gb,w:jb,W:Yb,x:null,X:null,y:Xb,Y:Kb,Z:Zb,"%":ph},_={a:G,A:W,b:$,B:K,c:null,d:hh,e:hh,f:ew,g:fw,G:pw,H:Qb,I:Jb,j:tw,L:Pm,m:rw,M:nw,p:L,q:B,Q:dh,s:gh,S:iw,u:aw,U:sw,V:ow,w:lw,W:uw,x:null,X:null,y:cw,Y:hw,Z:dw,"%":ph},S={a:C,A,b:F,B:E,c:N,d:uh,e:uh,f:Db,g:lh,G:oh,H:ch,I:ch,j:Cb,L:Eb,m:Ab,M:kb,p:M,q:Mb,Q:Pb,s:Fb,S:Rb,u:xb,U:bb,V:wb,w:vb,W:Sb,x:U,X:P,y:lh,Y:oh,Z:Tb,"%":Ob};x.x=w(r,x),x.X=w(n,x),x.c=w(t,x),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(k,I){return function(q){var R=[],nt=-1,Y=0,Z=k.length,lt,rt,ft;for(q instanceof Date||(q=new Date(+q));++nt<Z;)k.charCodeAt(nt)===37&&(R.push(k.slice(Y,nt)),(rt=sh[lt=k.charAt(++nt)])!=null?lt=k.charAt(++nt):rt=lt==="e"?" ":"0",(ft=I[lt])&&(lt=ft(q,rt)),R.push(lt),Y=nt+1);return R.push(k.slice(Y,nt)),R.join("")}}function b(k,I){return function(q){var R=wi(1900,void 0,1),nt=T(R,k,q+="",0),Y,Z;if(nt!=q.length)return null;if("Q"in R)return new Date(R.Q);if("s"in R)return new Date(R.s*1e3+("L"in R?R.L:0));if(I&&!("Z"in R)&&(R.Z=0),"p"in R&&(R.H=R.H%12+R.p*12),R.m===void 0&&(R.m="q"in R?R.q:0),"V"in R){if(R.V<1||R.V>53)return null;"w"in R||(R.w=1),"Z"in R?(Y=$s(wi(R.y,0,1)),Z=Y.getUTCDay(),Y=Z>4||Z===0?ja.ceil(Y):ja(Y),Y=jc.offset(Y,(R.V-1)*7),R.y=Y.getUTCFullYear(),R.m=Y.getUTCMonth(),R.d=Y.getUTCDate()+(R.w+6)%7):(Y=Ns(wi(R.y,0,1)),Z=Y.getDay(),Y=Z>4||Z===0?Ga.ceil(Y):Ga(Y),Y=aa.offset(Y,(R.V-1)*7),R.y=Y.getFullYear(),R.m=Y.getMonth(),R.d=Y.getDate()+(R.w+6)%7)}else("W"in R||"U"in R)&&("w"in R||(R.w="u"in R?R.u%7:"W"in R?1:0),Z="Z"in R?$s(wi(R.y,0,1)).getUTCDay():Ns(wi(R.y,0,1)).getDay(),R.m=0,R.d="W"in R?(R.w+6)%7+R.W*7-(Z+5)%7:R.w+R.U*7-(Z+6)%7);return"Z"in R?(R.H+=R.Z/100|0,R.M+=R.Z%100,$s(R)):Ns(R)}}function T(k,I,q,R){for(var nt=0,Y=I.length,Z=q.length,lt,rt;nt<Y;){if(R>=Z)return-1;if(lt=I.charCodeAt(nt++),lt===37){if(lt=I.charAt(nt++),rt=S[lt in sh?I.charAt(nt++):lt],!rt||(R=rt(k,q,R))<0)return-1}else if(lt!=q.charCodeAt(R++))return-1}return R}function M(k,I,q){var R=u.exec(I.slice(q));return R?(k.p=c.get(R[0].toLowerCase()),q+R[0].length):-1}function C(k,I,q){var R=p.exec(I.slice(q));return R?(k.w=g.get(R[0].toLowerCase()),q+R[0].length):-1}function A(k,I,q){var R=f.exec(I.slice(q));return R?(k.w=h.get(R[0].toLowerCase()),q+R[0].length):-1}function F(k,I,q){var R=v.exec(I.slice(q));return R?(k.m=y.get(R[0].toLowerCase()),q+R[0].length):-1}function E(k,I,q){var R=d.exec(I.slice(q));return R?(k.m=m.get(R[0].toLowerCase()),q+R[0].length):-1}function N(k,I,q){return T(k,t,I,q)}function U(k,I,q){return T(k,r,I,q)}function P(k,I,q){return T(k,n,I,q)}function O(k){return s[k.getDay()]}function j(k){return a[k.getDay()]}function X(k){return l[k.getMonth()]}function et(k){return o[k.getMonth()]}function at(k){return i[+(k.getHours()>=12)]}function tt(k){return 1+~~(k.getMonth()/3)}function G(k){return s[k.getUTCDay()]}function W(k){return a[k.getUTCDay()]}function $(k){return l[k.getUTCMonth()]}function K(k){return o[k.getUTCMonth()]}function L(k){return i[+(k.getUTCHours()>=12)]}function B(k){return 1+~~(k.getUTCMonth()/3)}return{format:function(k){var I=w(k+="",x);return I.toString=function(){return k},I},parse:function(k){var I=b(k+="",!1);return I.toString=function(){return k},I},utcFormat:function(k){var I=w(k+="",_);return I.toString=function(){return k},I},utcParse:function(k){var I=b(k+="",!0);return I.toString=function(){return k},I}}}var sh={"-":"",_:" ",0:"0"},_e=/^\s*\d+/,mb=/^%/,yb=/[\\^$*+?|[\]().{}]/g;function Mt(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function _b(e){return e.replace(yb,"\\$&")}function Si(e){return new RegExp("^(?:"+e.map(_b).join("|")+")","i")}function Ti(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function vb(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function xb(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function bb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function wb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Sb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function oh(e,t,r){var n=_e.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function lh(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Tb(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Mb(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ab(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function uh(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Cb(e,t,r){var n=_e.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function ch(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function kb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Rb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Eb(e,t,r){var n=_e.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Db(e,t,r){var n=_e.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ob(e,t,r){var n=mb.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Pb(e,t,r){var n=_e.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Fb(e,t,r){var n=_e.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function fh(e,t){return Mt(e.getDate(),t,2)}function Nb(e,t){return Mt(e.getHours(),t,2)}function $b(e,t){return Mt(e.getHours()%12||12,t,2)}function Lb(e,t){return Mt(1+aa.count(Ur(e),e),t,3)}function Dm(e,t){return Mt(e.getMilliseconds(),t,3)}function qb(e,t){return Dm(e,t)+"000"}function Ib(e,t){return Mt(e.getMonth()+1,t,2)}function zb(e,t){return Mt(e.getMinutes(),t,2)}function Bb(e,t){return Mt(e.getSeconds(),t,2)}function Ub(e){var t=e.getDay();return t===0?7:t}function Hb(e,t){return Mt(as.count(Ur(e)-1,e),t,2)}function Om(e){var t=e.getDay();return t>=4||t===0?si(e):si.ceil(e)}function Gb(e,t){return e=Om(e),Mt(si.count(Ur(e),e)+(Ur(e).getDay()===4),t,2)}function jb(e){return e.getDay()}function Yb(e,t){return Mt(Ga.count(Ur(e)-1,e),t,2)}function Xb(e,t){return Mt(e.getFullYear()%100,t,2)}function Wb(e,t){return e=Om(e),Mt(e.getFullYear()%100,t,2)}function Kb(e,t){return Mt(e.getFullYear()%1e4,t,4)}function Vb(e,t){var r=e.getDay();return e=r>=4||r===0?si(e):si.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function Zb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function hh(e,t){return Mt(e.getUTCDate(),t,2)}function Qb(e,t){return Mt(e.getUTCHours(),t,2)}function Jb(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function tw(e,t){return Mt(1+jc.count(An(e),e),t,3)}function Pm(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function ew(e,t){return Pm(e,t)+"000"}function rw(e,t){return Mt(e.getUTCMonth()+1,t,2)}function nw(e,t){return Mt(e.getUTCMinutes(),t,2)}function iw(e,t){return Mt(e.getUTCSeconds(),t,2)}function aw(e){var t=e.getUTCDay();return t===0?7:t}function sw(e,t){return Mt(Em.count(An(e)-1,e),t,2)}function Fm(e){var t=e.getUTCDay();return t>=4||t===0?oi(e):oi.ceil(e)}function ow(e,t){return e=Fm(e),Mt(oi.count(An(e),e)+(An(e).getUTCDay()===4),t,2)}function lw(e){return e.getUTCDay()}function uw(e,t){return Mt(ja.count(An(e)-1,e),t,2)}function cw(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function fw(e,t){return e=Fm(e),Mt(e.getUTCFullYear()%100,t,2)}function hw(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function pw(e,t){var r=e.getUTCDay();return e=r>=4||r===0?oi(e):oi.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function dw(){return"+0000"}function ph(){return"%"}function dh(e){return+e}function gh(e){return Math.floor(+e/1e3)}var zn,Nm;gw({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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 gw(e){return zn=gb(e),Nm=zn.format,zn.parse,zn.utcFormat,zn.utcParse,zn}function mw(e){return new Date(e)}function yw(e){return e instanceof Date?+e:+new Date(+e)}function $m(e,t,r,n,i,a,s,o,l,u){var c=Am(),f=c.invert,h=c.domain,p=u(".%L"),g=u(":%S"),d=u("%I:%M"),m=u("%I %p"),v=u("%a %d"),y=u("%b %d"),x=u("%B"),_=u("%Y");function S(w){return(l(w)<w?p:o(w)<w?g:s(w)<w?d:a(w)<w?m:n(w)<w?i(w)<w?v:y:r(w)<w?x:_)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?h(Array.from(w,yw)):h().map(mw)},c.ticks=function(w){var b=h();return e(b[0],b[b.length-1],w??10)},c.tickFormat=function(w,b){return b==null?S:u(b)},c.nice=function(w){var b=h();return(!w||typeof w.range!="function")&&(w=t(b[0],b[b.length-1],w??10)),w?h(Jx(b,w)):c},c.copy=function(){return Mm(c,$m(e,t,r,n,i,a,s,o,l,u))},c}function Kn(){return Tm.apply($m(pb,db,Ur,Yc,as,aa,Gc,Hc,jn,Nm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Kt(e){return function(){return e}}const oc=Math.PI,lc=2*oc,dn=1e-6,_w=lc-dn;function Lm(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function vw(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Lm;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class xw{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Lm:vw(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=n-t,u=i-r,c=s-t,f=o-r,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>dn)if(!(Math.abs(f*l-u*c)>dn)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,g=i-o,d=l*l+u*u,m=p*p+g*g,v=Math.sqrt(d),y=Math.sqrt(h),x=a*Math.tan((oc-Math.acos((d+h-m)/(2*v*y)))/2),_=x/y,S=x/v;Math.abs(_-1)>dn&&this._append`L${t+_*c},${r+_*f}`,this._append`A${a},${a},0,0,${+(f*p>c*g)},${this._x1=t+S*l},${this._y1=r+S*u}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=t+o,c=r+l,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>dn||Math.abs(this._y1-c)>dn)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%lc+lc),h>_w?this._append`A${n},${n},0,1,${f},${t-o},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:h>dn&&this._append`A${n},${n},0,${+(h>=oc)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function qm(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new xw(t)}function Xc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Im(e){this._context=e}Im.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Cn(e){return new Im(e)}function zm(e){return e[0]}function Bm(e){return e[1]}function Um(e,t){var r=Kt(!0),n=null,i=Cn,a=null,s=qm(o);e=typeof e=="function"?e:e===void 0?zm:Kt(e),t=typeof t=="function"?t:t===void 0?Bm:Kt(t);function o(l){var u,c=(l=Xc(l)).length,f,h=!1,p;for(n==null&&(a=i(p=s())),u=0;u<=c;++u)!(u<c&&r(f=l[u],u,l))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,l),+t(f,u,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Kt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Kt(+l),o):t},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Kt(!!l),o):r},o.curve=function(l){return arguments.length?(i=l,n!=null&&(a=i(n)),o):i},o.context=function(l){return arguments.length?(l==null?n=a=null:a=i(n=l),o):n},o}function ss(e,t,r){var n=null,i=Kt(!0),a=null,s=Cn,o=null,l=qm(u);e=typeof e=="function"?e:e===void 0?zm:Kt(+e),t=typeof t=="function"?t:Kt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Bm:Kt(+r);function u(f){var h,p,g,d=(f=Xc(f)).length,m,v=!1,y,x=new Array(d),_=new Array(d);for(a==null&&(o=s(y=l())),h=0;h<=d;++h){if(!(h<d&&i(m=f[h],h,f))===v)if(v=!v)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(x[g],_[g]);o.lineEnd(),o.areaEnd()}v&&(x[h]=+e(m,h,f),_[h]=+t(m,h,f),o.point(n?+n(m,h,f):x[h],r?+r(m,h,f):_[h]))}if(y)return o=null,y+""||null}function c(){return Um().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Kt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Kt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Kt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Kt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Kt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Kt(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Kt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(o=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=o=null:o=s(a=f),u):a},u}function mh(e,t){if((s=e.length)>1)for(var r=1,n,i,a=e[t[0]],s,o=a.length;r<s;++r)for(i=a,a=e[t[r]],n=0;n<o;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function yh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function bw(e,t){return e[t]}function ww(e){const t=[];return t.key=e,t}function Ki(){var e=Kt([]),t=yh,r=mh,n=bw;function i(a){var s=Array.from(e.apply(this,arguments),ww),o,l=s.length,u=-1,c;for(const f of a)for(o=0,++u;o<l;++o)(s[o][u]=[0,+n(f,s[o].key,u,a)]).data=f;for(o=0,c=Xc(t(s));o<l;++o)s[c[o]].index=o;return r(s,c),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Kt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Kt(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?yh:typeof a=="function"?a:Kt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??mh,i):r},i}function Fr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
1
|
+
"use strict";var zy=Object.defineProperty;var By=(e,t,r)=>t in e?zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var va=(e,t,r)=>By(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react/jsx-runtime"),U=require("@mui/material"),K=require("react"),Zg=require("@mui/icons-material");function Uy(e){return e}var Ss=1,Ts=2,Yu=3,Ra=4,Df=1e-6;function Hy(e){return"translate("+e+",0)"}function Gy(e){return"translate(0,"+e+")"}function jy(e){return t=>+e(t)}function Yy(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Xy(){return!this.__axis}function Qg(e,t){var r=[],n=null,a=null,i=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===Ss||e===Ra?-1:1,c=e===Ra||e===Ts?"x":"y",f=e===Ss||e===Yu?Hy:Gy;function h(p){var g=n??(t.ticks?t.ticks.apply(t,r):t.domain()),d=a??(t.tickFormat?t.tickFormat.apply(t,r):Uy),m=Math.max(i,0)+o,x=t.range(),y=+x[0]+l,v=+x[x.length-1]+l,_=(t.bandwidth?Yy:jy)(t.copy(),l),S=p.selection?p.selection():p,w=S.selectAll(".domain").data([null]),b=S.selectAll(".tick").data(g,t).order(),T=b.exit(),M=b.enter().append("g").attr("class","tick"),k=b.select("line"),C=b.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),b=b.merge(M),k=k.merge(M.append("line").attr("stroke","currentColor").attr(c+"2",u*i)),C=C.merge(M.append("text").attr("fill","currentColor").attr(c,u*m).attr("dy",e===Ss?"0em":e===Yu?"0.71em":"0.32em")),p!==S&&(w=w.transition(p),b=b.transition(p),k=k.transition(p),C=C.transition(p),T=T.transition(p).attr("opacity",Df).attr("transform",function(O){return isFinite(O=_(O))?f(O+l):this.getAttribute("transform")}),M.attr("opacity",Df).attr("transform",function(O){var R=this.parentNode.__axis;return f((R&&isFinite(R=R(O))?R:_(O))+l)})),T.remove(),w.attr("d",e===Ra||e===Ts?s?"M"+u*s+","+y+"H"+l+"V"+v+"H"+u*s:"M"+l+","+y+"V"+v:s?"M"+y+","+u*s+"V"+l+"H"+v+"V"+u*s:"M"+y+","+l+"H"+v),b.attr("opacity",1).attr("transform",function(O){return f(_(O)+l)}),k.attr(c+"2",u*i),C.attr(c,u*m).text(d),S.filter(Xy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ts?"start":e===Ra?"end":"middle"),S.each(function(){this.__axis=_})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return r=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),h):r.slice()},h.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),h):n&&n.slice()},h.tickFormat=function(p){return arguments.length?(a=p,h):a},h.tickSize=function(p){return arguments.length?(i=s=+p,h):i},h.tickSizeInner=function(p){return arguments.length?(i=+p,h):i},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function Ir(e){return Qg(Yu,e)}function zr(e){return Qg(Ra,e)}var Wy={value:()=>{}};function Dc(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Mi(r)}function Mi(e){this._=e}function Ky(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",a=r.indexOf(".");if(a>=0&&(n=r.slice(a+1),r=r.slice(0,a)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Mi.prototype=Dc.prototype={constructor:Mi,on:function(e,t){var r=this._,n=Ky(e+"",r),a,i=-1,s=n.length;if(arguments.length<2){for(;++i<s;)if((a=(e=n[i]).type)&&(a=Vy(r[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(a=(e=n[i]).type)r[a]=Of(r[a],e.name,t);else if(t==null)for(a in r)r[a]=Of(r[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Mi(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var r=new Array(a),n=0,a,i;n<a;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],n=0,a=i.length;n<a;++n)i[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],a=0,i=n.length;a<i;++a)n[a].value.apply(t,r)}};function Vy(e,t){for(var r=0,n=e.length,a;r<n;++r)if((a=e[r]).name===t)return a.value}function Of(e,t,r){for(var n=0,a=e.length;n<a;++n)if(e[n].name===t){e[n]=Wy,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Xu="http://www.w3.org/1999/xhtml";const Pf={svg:"http://www.w3.org/2000/svg",xhtml:Xu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function es(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Pf.hasOwnProperty(t)?{space:Pf[t],local:e}:e}function Zy(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Xu&&t.documentElement.namespaceURI===Xu?t.createElement(e):t.createElementNS(r,e)}}function Qy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jg(e){var t=es(e);return(t.local?Qy:Zy)(t)}function Jy(){}function Oc(e){return e==null?Jy:function(){return this.querySelector(e)}}function t_(e){typeof e!="function"&&(e=Oc(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,o=n[a]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),o[c]=u);return new tr(n,this._parents)}function e_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function r_(){return[]}function tm(e){return e==null?r_:function(){return this.querySelectorAll(e)}}function n_(e){return function(){return e_(e.apply(this,arguments))}}function a_(e){typeof e=="function"?e=n_(e):e=tm(e);for(var t=this._groups,r=t.length,n=[],a=[],i=0;i<r;++i)for(var s=t[i],o=s.length,l,u=0;u<o;++u)(l=s[u])&&(n.push(e.call(l,l.__data__,u,s)),a.push(l));return new tr(n,a)}function em(e){return function(){return this.matches(e)}}function rm(e){return function(t){return t.matches(e)}}var i_=Array.prototype.find;function s_(e){return function(){return i_.call(this.children,e)}}function o_(){return this.firstElementChild}function l_(e){return this.select(e==null?o_:s_(typeof e=="function"?e:rm(e)))}var u_=Array.prototype.filter;function c_(){return Array.from(this.children)}function f_(e){return function(){return u_.call(this.children,e)}}function h_(e){return this.selectAll(e==null?c_:f_(typeof e=="function"?e:rm(e)))}function p_(e){typeof e!="function"&&(e=em(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,o=n[a]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&o.push(l);return new tr(n,this._parents)}function nm(e){return new Array(e.length)}function d_(){return new tr(this._enter||this._groups.map(nm),this._parents)}function Pi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Pi.prototype={constructor:Pi,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)}};function g_(e){return function(){return e}}function m_(e,t,r,n,a,i){for(var s=0,o,l=t.length,u=i.length;s<u;++s)(o=t[s])?(o.__data__=i[s],n[s]=o):r[s]=new Pi(e,i[s]);for(;s<l;++s)(o=t[s])&&(a[s]=o)}function y_(e,t,r,n,a,i,s){var o,l,u=new Map,c=t.length,f=i.length,h=new Array(c),p;for(o=0;o<c;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",u.has(p)?a[o]=l:u.set(p,l));for(o=0;o<f;++o)p=s.call(e,i[o],o,i)+"",(l=u.get(p))?(n[o]=l,l.__data__=i[o],u.delete(p)):r[o]=new Pi(e,i[o]);for(o=0;o<c;++o)(l=t[o])&&u.get(h[o])===l&&(a[o]=l)}function __(e){return e.__data__}function x_(e,t){if(!arguments.length)return Array.from(this,__);var r=t?y_:m_,n=this._parents,a=this._groups;typeof e!="function"&&(e=g_(e));for(var i=a.length,s=new Array(i),o=new Array(i),l=new Array(i),u=0;u<i;++u){var c=n[u],f=a[u],h=f.length,p=v_(e.call(c,c&&c.__data__,u,n)),g=p.length,d=o[u]=new Array(g),m=s[u]=new Array(g),x=l[u]=new Array(h);r(c,f,d,m,x,p,t);for(var y=0,v=0,_,S;y<g;++y)if(_=d[y]){for(y>=v&&(v=y+1);!(S=m[v])&&++v<g;);_._next=S||null}}return s=new tr(s,n),s._enter=o,s._exit=l,s}function v_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b_(){return new tr(this._exit||this._groups.map(nm),this._parents)}function w_(e,t,r){var n=this.enter(),a=this,i=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),r==null?i.remove():r(i),n&&a?n.merge(a).order():a}function S_(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,a=r.length,i=n.length,s=Math.min(a,i),o=new Array(a),l=0;l<s;++l)for(var u=r[l],c=n[l],f=u.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=u[g]||c[g])&&(h[g]=p);for(;l<a;++l)o[l]=r[l];return new tr(o,this._parents)}function T_(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],a=n.length-1,i=n[a],s;--a>=0;)(s=n[a])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function M_(e){e||(e=A_);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var r=this._groups,n=r.length,a=new Array(n),i=0;i<n;++i){for(var s=r[i],o=s.length,l=a[i]=new Array(o),u,c=0;c<o;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new tr(a,this._parents).order()}function A_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function C_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function k_(){return Array.from(this)}function R_(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length;a<i;++a){var s=n[a];if(s)return s}return null}function E_(){let e=0;for(const t of this)++e;return e}function D_(){return!this.node()}function O_(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,s=a.length,o;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this}function P_(e){return function(){this.removeAttribute(e)}}function F_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function N_(e,t){return function(){this.setAttribute(e,t)}}function $_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function L_(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function q_(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function I_(e,t){var r=es(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?F_:P_:typeof t=="function"?r.local?q_:L_:r.local?$_:N_)(r,t))}function am(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function z_(e){return function(){this.style.removeProperty(e)}}function B_(e,t,r){return function(){this.style.setProperty(e,t,r)}}function U_(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function H_(e,t,r){return arguments.length>1?this.each((t==null?z_:typeof t=="function"?U_:B_)(e,t,r??"")):ra(this.node(),e)}function ra(e,t){return e.style.getPropertyValue(t)||am(e).getComputedStyle(e,null).getPropertyValue(t)}function G_(e){return function(){delete this[e]}}function j_(e,t){return function(){this[e]=t}}function Y_(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function X_(e,t){return arguments.length>1?this.each((t==null?G_:typeof t=="function"?Y_:j_)(e,t)):this.node()[e]}function im(e){return e.trim().split(/^|\s+/)}function Pc(e){return e.classList||new sm(e)}function sm(e){this._node=e,this._names=im(e.getAttribute("class")||"")}sm.prototype={add:function(e){var t=this._names.indexOf(e);t<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}};function om(e,t){for(var r=Pc(e),n=-1,a=t.length;++n<a;)r.add(t[n])}function lm(e,t){for(var r=Pc(e),n=-1,a=t.length;++n<a;)r.remove(t[n])}function W_(e){return function(){om(this,e)}}function K_(e){return function(){lm(this,e)}}function V_(e,t){return function(){(t.apply(this,arguments)?om:lm)(this,e)}}function Z_(e,t){var r=im(e+"");if(arguments.length<2){for(var n=Pc(this.node()),a=-1,i=r.length;++a<i;)if(!n.contains(r[a]))return!1;return!0}return this.each((typeof t=="function"?V_:t?W_:K_)(r,t))}function Q_(){this.textContent=""}function J_(e){return function(){this.textContent=e}}function t1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function e1(e){return arguments.length?this.each(e==null?Q_:(typeof e=="function"?t1:J_)(e)):this.node().textContent}function r1(){this.innerHTML=""}function n1(e){return function(){this.innerHTML=e}}function a1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function i1(e){return arguments.length?this.each(e==null?r1:(typeof e=="function"?a1:n1)(e)):this.node().innerHTML}function s1(){this.nextSibling&&this.parentNode.appendChild(this)}function o1(){return this.each(s1)}function l1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function u1(){return this.each(l1)}function c1(e){var t=typeof e=="function"?e:Jg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function f1(){return null}function h1(e,t){var r=typeof e=="function"?e:Jg(e),n=t==null?f1:typeof t=="function"?t:Oc(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function p1(){var e=this.parentNode;e&&e.removeChild(this)}function d1(){return this.each(p1)}function g1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function y1(e){return this.select(e?m1:g1)}function _1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function x1(e){return function(t){e.call(this,t,this.__data__)}}function v1(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function b1(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,a=t.length,i;r<a;++r)i=t[r],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++n]=i;++n?t.length=n:delete this.__on}}}function w1(e,t,r){return function(){var n=this.__on,a,i=x1(t);if(n){for(var s=0,o=n.length;s<o;++s)if((a=n[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=r),a.value=t;return}}this.addEventListener(e.type,i,r),a={type:e.type,name:e.name,value:t,listener:i,options:r},n?n.push(a):this.__on=[a]}}function S1(e,t,r){var n=v1(e+""),a,i=n.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,c;l<u;++l)for(a=0,c=o[l];a<i;++a)if((s=n[a]).type===c.type&&s.name===c.name)return c.value}return}for(o=t?w1:b1,a=0;a<i;++a)this.each(o(n[a],t,r));return this}function um(e,t,r){var n=am(e),a=n.CustomEvent;typeof a=="function"?a=new a(t,r):(a=n.document.createEvent("Event"),r?(a.initEvent(t,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function T1(e,t){return function(){return um(this,e,t)}}function M1(e,t){return function(){return um(this,e,t.apply(this,arguments))}}function A1(e,t){return this.each((typeof t=="function"?M1:T1)(e,t))}function*C1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length,s;a<i;++a)(s=n[a])&&(yield s)}var cm=[null];function tr(e,t){this._groups=e,this._parents=t}function da(){return new tr([[document.documentElement]],cm)}function k1(){return this}tr.prototype=da.prototype={constructor:tr,select:t_,selectAll:a_,selectChild:l_,selectChildren:h_,filter:p_,data:x_,enter:d_,exit:b_,join:w_,merge:S_,selection:k1,order:T_,sort:M_,call:C_,nodes:k_,node:R_,size:E_,empty:D_,each:O_,attr:I_,style:H_,property:X_,classed:Z_,text:e1,html:i1,raise:o1,lower:u1,append:c1,insert:h1,remove:d1,clone:y1,datum:_1,on:S1,dispatch:A1,[Symbol.iterator]:C1};function Dt(e){return typeof e=="string"?new tr([[document.querySelector(e)]],[document.documentElement]):new tr([[e]],cm)}function R1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Tr(e,t){if(e=R1(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Wu={capture:!0,passive:!1};function Ku(e){e.preventDefault(),e.stopImmediatePropagation()}function E1(e){var t=e.document.documentElement,r=Dt(e).on("dragstart.drag",Ku,Wu);"onselectstart"in t?r.on("selectstart.drag",Ku,Wu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function D1(e,t){var r=e.document.documentElement,n=Dt(e).on("dragstart.drag",null);t&&(n.on("click.drag",Ku,Wu),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Fc(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function fm(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ai(){}var Ya=.7,Fi=1/Ya,Wn="\\s*([+-]?\\d+)\\s*",Xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O1=/^#([0-9a-f]{3,8})$/,P1=new RegExp(`^rgb\\(${Wn},${Wn},${Wn}\\)$`),F1=new RegExp(`^rgb\\(${Mr},${Mr},${Mr}\\)$`),N1=new RegExp(`^rgba\\(${Wn},${Wn},${Wn},${Xa}\\)$`),$1=new RegExp(`^rgba\\(${Mr},${Mr},${Mr},${Xa}\\)$`),L1=new RegExp(`^hsl\\(${Xa},${Mr},${Mr}\\)$`),q1=new RegExp(`^hsla\\(${Xa},${Mr},${Mr},${Xa}\\)$`),Ff={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};Fc(ai,Tn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Nf,formatHex:Nf,formatHex8:I1,formatHsl:z1,formatRgb:$f,toString:$f});function Nf(){return this.rgb().formatHex()}function I1(){return this.rgb().formatHex8()}function z1(){return hm(this).formatHsl()}function $f(){return this.rgb().formatRgb()}function Tn(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=O1.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Lf(t):r===3?new Le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?mi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?mi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=P1.exec(e))?new Le(t[1],t[2],t[3],1):(t=F1.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=N1.exec(e))?mi(t[1],t[2],t[3],t[4]):(t=$1.exec(e))?mi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=L1.exec(e))?zf(t[1],t[2]/100,t[3]/100,1):(t=q1.exec(e))?zf(t[1],t[2]/100,t[3]/100,t[4]):Ff.hasOwnProperty(e)?Lf(Ff[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function Lf(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function mi(e,t,r,n){return n<=0&&(e=t=r=NaN),new Le(e,t,r,n)}function B1(e){return e instanceof ai||(e=Tn(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function Vu(e,t,r,n){return arguments.length===1?B1(e):new Le(e,t,r,n??1)}function Le(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Fc(Le,Vu,fm(ai,{brighter(e){return e=e==null?Fi:Math.pow(Fi,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ya:Math.pow(Ya,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le(xn(this.r),xn(this.g),xn(this.b),Ni(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:qf,formatHex:qf,formatHex8:U1,formatRgb:If,toString:If}));function qf(){return`#${mn(this.r)}${mn(this.g)}${mn(this.b)}`}function U1(){return`#${mn(this.r)}${mn(this.g)}${mn(this.b)}${mn((isNaN(this.opacity)?1:this.opacity)*255)}`}function If(){const e=Ni(this.opacity);return`${e===1?"rgb(":"rgba("}${xn(this.r)}, ${xn(this.g)}, ${xn(this.b)}${e===1?")":`, ${e})`}`}function Ni(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mn(e){return e=xn(e),(e<16?"0":"")+e.toString(16)}function zf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new mr(e,t,r,n)}function hm(e){if(e instanceof mr)return new mr(e.h,e.s,e.l,e.opacity);if(e instanceof ai||(e=Tn(e)),!e)return new mr;if(e instanceof mr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,o=i-a,l=(i+a)/2;return o?(t===i?s=(r-n)/o+(r<n)*6:r===i?s=(n-t)/o+2:s=(t-r)/o+4,o/=l<.5?i+a:2-i-a,s*=60):o=l>0&&l<1?0:s,new mr(s,o,l,e.opacity)}function H1(e,t,r,n){return arguments.length===1?hm(e):new mr(e,t,r,n??1)}function mr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Fc(mr,H1,fm(ai,{brighter(e){return e=e==null?Fi:Math.pow(Fi,e),new mr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ya:Math.pow(Ya,e),new mr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Le(Ms(e>=240?e-240:e+120,a,n),Ms(e,a,n),Ms(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new mr(Bf(this.h),yi(this.s),yi(this.l),Ni(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=Ni(this.opacity);return`${e===1?"hsl(":"hsla("}${Bf(this.h)}, ${yi(this.s)*100}%, ${yi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bf(e){return e=(e||0)%360,e<0?e+360:e}function yi(e){return Math.max(0,Math.min(1,e||0))}function Ms(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Nc=e=>()=>e;function G1(e,t){return function(r){return e+r*t}}function j1(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Y1(e){return(e=+e)==1?pm:function(t,r){return r-t?j1(t,r,e):Nc(isNaN(t)?r:t)}}function pm(e,t){var r=t-e;return r?G1(e,r):Nc(isNaN(e)?t:e)}const $i=(function e(t){var r=Y1(t);function n(a,i){var s=r((a=Vu(a)).r,(i=Vu(i)).r),o=r(a.g,i.g),l=r(a.b,i.b),u=pm(a.opacity,i.opacity);return function(c){return a.r=s(c),a.g=o(c),a.b=l(c),a.opacity=u(c),a+""}}return n.gamma=e,n})(1);function X1(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function W1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function K1(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),s;for(s=0;s<n;++s)a[s]=rs(e[s],t[s]);for(;s<r;++s)i[s]=t[s];return function(o){for(s=0;s<n;++s)i[s]=a[s](o);return i}}function V1(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function gr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Z1(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=rs(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Zu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,As=new RegExp(Zu.source,"g");function Q1(e){return function(){return e}}function J1(e){return function(t){return e(t)+""}}function dm(e,t){var r=Zu.lastIndex=As.lastIndex=0,n,a,i,s=-1,o=[],l=[];for(e=e+"",t=t+"";(n=Zu.exec(e))&&(a=As.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),o[s]?o[s]+=i:o[++s]=i),(n=n[0])===(a=a[0])?o[s]?o[s]+=a:o[++s]=a:(o[++s]=null,l.push({i:s,x:gr(n,a)})),r=As.lastIndex;return r<t.length&&(i=t.slice(r),o[s]?o[s]+=i:o[++s]=i),o.length<2?l[0]?J1(l[0].x):Q1(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)o[(f=l[c]).i]=f.x(u);return o.join("")})}function rs(e,t){var r=typeof t,n;return t==null||r==="boolean"?Nc(t):(r==="number"?gr:r==="string"?(n=Tn(t))?(t=n,$i):dm:t instanceof Tn?$i:t instanceof Date?V1:W1(t)?X1:Array.isArray(t)?K1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Z1:gr)(e,t)}function tx(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var Uf=180/Math.PI,Qu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gm(e,t,r,n,a,i){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),e*n<t*r&&(e=-e,t=-t,l=-l,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*Uf,skewX:Math.atan(l)*Uf,scaleX:s,scaleY:o}}var _i;function ex(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qu:gm(t.a,t.b,t.c,t.d,t.e,t.f)}function rx(e){return e==null||(_i||(_i=document.createElementNS("http://www.w3.org/2000/svg","g")),_i.setAttribute("transform",e),!(e=_i.transform.baseVal.consolidate()))?Qu:(e=e.matrix,gm(e.a,e.b,e.c,e.d,e.e,e.f))}function mm(e,t,r,n){function a(u){return u.length?u.pop()+" ":""}function i(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push("translate(",null,t,null,r);g.push({i:d-4,x:gr(u,f)},{i:d-2,x:gr(c,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function s(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(a(f)+"rotate(",null,n)-2,x:gr(u,c)})):c&&f.push(a(f)+"rotate("+c+n)}function o(u,c,f,h){u!==c?h.push({i:f.push(a(f)+"skewX(",null,n)-2,x:gr(u,c)}):c&&f.push(a(f)+"skewX("+c+n)}function l(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push(a(p)+"scale(",null,",",null,")");g.push({i:d-4,x:gr(u,f)},{i:d-2,x:gr(c,h)})}else(f!==1||h!==1)&&p.push(a(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),o(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var g=-1,d=h.length,m;++g<d;)f[(m=h[g]).i]=m.x(p);return f.join("")}}}var nx=mm(ex,"px, ","px)","deg)"),ax=mm(rx,", ",")",")"),na=0,Ea=0,ba=0,ym=1e3,Li,Da,qi=0,Mn=0,ns=0,Wa=typeof performance=="object"&&performance.now?performance:Date,_m=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $c(){return Mn||(_m(ix),Mn=Wa.now()+ns)}function ix(){Mn=0}function Ii(){this._call=this._time=this._next=null}Ii.prototype=xm.prototype={constructor:Ii,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?$c():+r)+(t==null?0:+t),!this._next&&Da!==this&&(Da?Da._next=this:Li=this,Da=this),this._call=e,this._time=r,Ju()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ju())}};function xm(e,t,r){var n=new Ii;return n.restart(e,t,r),n}function sx(){$c(),++na;for(var e=Li,t;e;)(t=Mn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--na}function Hf(){Mn=(qi=Wa.now())+ns,na=Ea=0;try{sx()}finally{na=0,lx(),Mn=0}}function ox(){var e=Wa.now(),t=e-qi;t>ym&&(ns-=t,qi=e)}function lx(){for(var e,t=Li,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Li=r);Da=e,Ju(n)}function Ju(e){if(!na){Ea&&(Ea=clearTimeout(Ea));var t=e-Mn;t>24?(e<1/0&&(Ea=setTimeout(Hf,e-Wa.now()-ns)),ba&&(ba=clearInterval(ba))):(ba||(qi=Wa.now(),ba=setInterval(ox,ym)),na=1,_m(Hf))}}function Gf(e,t,r){var n=new Ii;return t=t==null?0:+t,n.restart(a=>{n.stop(),e(a+t)},t,r),n}var ux=Dc("start","end","cancel","interrupt"),cx=[],vm=0,jf=1,tc=2,Ai=3,Yf=4,ec=5,Ci=6;function as(e,t,r,n,a,i){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;fx(e,r,{name:t,index:n,group:a,on:ux,tween:cx,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:vm})}function Lc(e,t){var r=yr(e,t);if(r.state>vm)throw new Error("too late; already scheduled");return r}function Cr(e,t){var r=yr(e,t);if(r.state>Ai)throw new Error("too late; already running");return r}function yr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function fx(e,t,r){var n=e.__transition,a;n[t]=r,r.timer=xm(i,0,r.time);function i(u){r.state=jf,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var c,f,h,p;if(r.state!==jf)return l();for(c in n)if(p=n[c],p.name===r.name){if(p.state===Ai)return Gf(s);p.state===Yf?(p.state=Ci,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[c]):+c<t&&(p.state=Ci,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete n[c])}if(Gf(function(){r.state===Ai&&(r.state=Yf,r.timer.restart(o,r.delay,r.time),o(u))}),r.state=tc,r.on.call("start",e,e.__data__,r.index,r.group),r.state===tc){for(r.state=Ai,a=new Array(h=r.tween.length),c=0,f=-1;c<h;++c)(p=r.tween[c].value.call(e,e.__data__,r.index,r.group))&&(a[++f]=p);a.length=f+1}}function o(u){for(var c=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(l),r.state=ec,1),f=-1,h=a.length;++f<h;)a[f].call(e,c);r.state===ec&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=Ci,r.timer.stop(),delete n[t];for(var u in n)return;delete e.__transition}}function rc(e,t){var r=e.__transition,n,a,i=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){i=!1;continue}a=n.state>tc&&n.state<ec,n.state=Ci,n.timer.stop(),n.on.call(a?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}i&&delete e.__transition}}function hx(e){return this.each(function(){rc(this,e)})}function px(e,t){var r,n;return function(){var a=Cr(this,e),i=a.tween;if(i!==r){n=r=i;for(var s=0,o=n.length;s<o;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}a.tween=n}}function dx(e,t,r){var n,a;if(typeof r!="function")throw new Error;return function(){var i=Cr(this,e),s=i.tween;if(s!==n){a=(n=s).slice();for(var o={name:t,value:r},l=0,u=a.length;l<u;++l)if(a[l].name===t){a[l]=o;break}l===u&&a.push(o)}i.tween=a}}function gx(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=yr(this.node(),r).tween,a=0,i=n.length,s;a<i;++a)if((s=n[a]).name===e)return s.value;return null}return this.each((t==null?px:dx)(r,e,t))}function qc(e,t,r){var n=e._id;return e.each(function(){var a=Cr(this,n);(a.value||(a.value={}))[t]=r.apply(this,arguments)}),function(a){return yr(a,n).value[t]}}function bm(e,t){var r;return(typeof t=="number"?gr:t instanceof Tn?$i:(r=Tn(t))?(t=r,$i):dm)(e,t)}function mx(e){return function(){this.removeAttribute(e)}}function yx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _x(e,t,r){var n,a=r+"",i;return function(){var s=this.getAttribute(e);return s===a?null:s===n?i:i=t(n=s,r)}}function xx(e,t,r){var n,a=r+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===n?i:i=t(n=s,r)}}function vx(e,t,r){var n,a,i;return function(){var s,o=r(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===n&&l===a?i:(a=l,i=t(n=s,o)))}}function bx(e,t,r){var n,a,i;return function(){var s,o=r(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===n&&l===a?i:(a=l,i=t(n=s,o)))}}function wx(e,t){var r=es(e),n=r==="transform"?ax:bm;return this.attrTween(e,typeof t=="function"?(r.local?bx:vx)(r,n,qc(this,"attr."+e,t)):t==null?(r.local?yx:mx)(r):(r.local?xx:_x)(r,n,t))}function Sx(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Tx(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Mx(e,t){var r,n;function a(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&Tx(e,i)),r}return a._value=t,a}function Ax(e,t){var r,n;function a(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&Sx(e,i)),r}return a._value=t,a}function Cx(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=es(e);return this.tween(r,(n.local?Mx:Ax)(n,t))}function kx(e,t){return function(){Lc(this,e).delay=+t.apply(this,arguments)}}function Rx(e,t){return t=+t,function(){Lc(this,e).delay=t}}function Ex(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kx:Rx)(t,e)):yr(this.node(),t).delay}function Dx(e,t){return function(){Cr(this,e).duration=+t.apply(this,arguments)}}function Ox(e,t){return t=+t,function(){Cr(this,e).duration=t}}function Px(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Dx:Ox)(t,e)):yr(this.node(),t).duration}function Fx(e,t){if(typeof t!="function")throw new Error;return function(){Cr(this,e).ease=t}}function Nx(e){var t=this._id;return arguments.length?this.each(Fx(t,e)):yr(this.node(),t).ease}function $x(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Cr(this,e).ease=r}}function Lx(e){if(typeof e!="function")throw new Error;return this.each($x(this._id,e))}function qx(e){typeof e!="function"&&(e=em(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,o=n[a]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&o.push(l);return new Br(n,this._parents,this._name,this._id)}function Ix(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,a=r.length,i=Math.min(n,a),s=new Array(n),o=0;o<i;++o)for(var l=t[o],u=r[o],c=l.length,f=s[o]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;o<n;++o)s[o]=t[o];return new Br(s,this._parents,this._name,this._id)}function zx(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Bx(e,t,r){var n,a,i=zx(t)?Lc:Cr;return function(){var s=i(this,e),o=s.on;o!==n&&(a=(n=o).copy()).on(t,r),s.on=a}}function Ux(e,t){var r=this._id;return arguments.length<2?yr(this.node(),r).on.on(e):this.each(Bx(r,e,t))}function Hx(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Gx(){return this.on("end.remove",Hx(this._id))}function jx(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Oc(e));for(var n=this._groups,a=n.length,i=new Array(a),s=0;s<a;++s)for(var o=n[s],l=o.length,u=i[s]=new Array(l),c,f,h=0;h<l;++h)(c=o[h])&&(f=e.call(c,c.__data__,h,o))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,as(u[h],t,r,h,u,yr(c,r)));return new Br(i,this._parents,t,r)}function Yx(e){var t=this._name,r=this._id;typeof e!="function"&&(e=tm(e));for(var n=this._groups,a=n.length,i=[],s=[],o=0;o<a;++o)for(var l=n[o],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),p,g=yr(c,r),d=0,m=h.length;d<m;++d)(p=h[d])&&as(p,t,r,d,h,g);i.push(h),s.push(c)}return new Br(i,s,t,r)}var Xx=da.prototype.constructor;function Wx(){return new Xx(this._groups,this._parents)}function Kx(e,t){var r,n,a;return function(){var i=ra(this,e),s=(this.style.removeProperty(e),ra(this,e));return i===s?null:i===r&&s===n?a:a=t(r=i,n=s)}}function wm(e){return function(){this.style.removeProperty(e)}}function Vx(e,t,r){var n,a=r+"",i;return function(){var s=ra(this,e);return s===a?null:s===n?i:i=t(n=s,r)}}function Zx(e,t,r){var n,a,i;return function(){var s=ra(this,e),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),ra(this,e))),s===l?null:s===n&&l===a?i:(a=l,i=t(n=s,o))}}function Qx(e,t){var r,n,a,i="style."+t,s="end."+i,o;return function(){var l=Cr(this,e),u=l.on,c=l.value[i]==null?o||(o=wm(t)):void 0;(u!==r||a!==c)&&(n=(r=u).copy()).on(s,a=c),l.on=n}}function Jx(e,t,r){var n=(e+="")=="transform"?nx:bm;return t==null?this.styleTween(e,Kx(e,n)).on("end.style."+e,wm(e)):typeof t=="function"?this.styleTween(e,Zx(e,n,qc(this,"style."+e,t))).each(Qx(this._id,e)):this.styleTween(e,Vx(e,n,t),r).on("end.style."+e,null)}function tv(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function ev(e,t,r){var n,a;function i(){var s=t.apply(this,arguments);return s!==a&&(n=(a=s)&&tv(e,s,r)),n}return i._value=t,i}function rv(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,ev(e,t,r??""))}function nv(e){return function(){this.textContent=e}}function av(e){return function(){var t=e(this);this.textContent=t??""}}function iv(e){return this.tween("text",typeof e=="function"?av(qc(this,"text",e)):nv(e==null?"":e+""))}function sv(e){return function(t){this.textContent=e.call(this,t)}}function ov(e){var t,r;function n(){var a=e.apply(this,arguments);return a!==r&&(t=(r=a)&&sv(a)),t}return n._value=e,n}function lv(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ov(e))}function uv(){for(var e=this._name,t=this._id,r=Sm(),n=this._groups,a=n.length,i=0;i<a;++i)for(var s=n[i],o=s.length,l,u=0;u<o;++u)if(l=s[u]){var c=yr(l,t);as(l,e,r,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Br(n,this._parents,e,r)}function cv(){var e,t,r=this,n=r._id,a=r.size();return new Promise(function(i,s){var o={value:s},l={value:function(){--a===0&&i()}};r.each(function(){var u=Cr(this,n),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),u.on=t}),a===0&&i()})}var fv=0;function Br(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function Ic(e){return da().transition(e)}function Sm(){return++fv}var Or=da.prototype;Br.prototype=Ic.prototype={constructor:Br,select:jx,selectAll:Yx,selectChild:Or.selectChild,selectChildren:Or.selectChildren,filter:qx,merge:Ix,selection:Wx,transition:uv,call:Or.call,nodes:Or.nodes,node:Or.node,size:Or.size,empty:Or.empty,each:Or.each,on:Ux,attr:wx,attrTween:Cx,style:Jx,styleTween:rv,text:iv,textTween:lv,remove:Gx,tween:gx,delay:Ex,duration:Px,ease:Nx,easeVarying:Lx,end:cv,[Symbol.iterator]:Or[Symbol.iterator]};function hv(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var pv={time:null,delay:0,duration:250,ease:hv};function dv(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function gv(e){var t,r;e instanceof Br?(t=e._id,e=e._name):(t=Sm(),(r=pv).time=$c(),e=e==null?null:e+"");for(var n=this._groups,a=n.length,i=0;i<a;++i)for(var s=n[i],o=s.length,l,u=0;u<o;++u)(l=s[u])&&as(l,e,t,u,s,r||dv(l,t));return new Br(n,this._parents,e,t)}da.prototype.interrupt=hx;da.prototype.transition=gv;const Cs=e=>()=>e;function mv(e,{sourceEvent:t,target:r,selection:n,mode:a,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:n,enumerable:!0,configurable:!0},mode:{value:a,enumerable:!0,configurable:!0},_:{value:i}})}function yv(e){e.stopImmediatePropagation()}function ks(e){e.preventDefault(),e.stopImmediatePropagation()}var Xf={name:"drag"},Rs={name:"space"},qn={name:"handle"},In={name:"center"};const{abs:Wf,max:Ae,min:Ce}=Math;function Kf(e){return[+e[0],+e[1]]}function Vf(e){return[Kf(e[0]),Kf(e[1])]}var ki={name:"x",handles:["w","e"].map(nc),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Es={},Pr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Zf={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Qf={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},_v={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},xv={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function nc(e){return{type:e}}function vv(e){return!e.ctrlKey&&!e.button}function bv(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function wv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ds(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Sv(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ga(){return Tv(ki)}function Tv(e){var t=bv,r=vv,n=wv,a=!0,i=Dc("start","brush","end"),s=6,o;function l(m){var x=m.property("__brush",d).selectAll(".overlay").data([nc("overlay")]);x.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Pr.overlay).merge(x).each(function(){var v=Ds(this).extent;Dt(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),m.selectAll(".selection").data([nc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Pr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(e.handles,function(v){return v.type});y.exit().remove(),y.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return Pr[v.type]}),m.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(n).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,x,y){m.tween?m.on("start.brush",function(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,_=v.__brush,S=c(v,arguments),w=_.selection,b=e.input(typeof x=="function"?x.apply(this,arguments):x,_.extent),T=rs(w,b);function M(k){_.selection=k===1&&b===null?null:T(k),u.call(v),S.brush()}return w!==null&&b!==null?M:M(1)}):m.each(function(){var v=this,_=arguments,S=v.__brush,w=e.input(typeof x=="function"?x.apply(v,_):x,S.extent),b=c(v,_).beforestart();rc(v),S.selection=w===null?null:w,u.call(v),b.start(y).brush(y).end(y)})},l.clear=function(m,x){l.move(m,null,x)};function u(){var m=Dt(this),x=Ds(this).selection;x?(m.selectAll(".selection").style("display",null).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?x[1][0]-s/2:x[0][0]-s/2}).attr("y",function(y){return y.type[0]==="s"?x[1][1]-s/2:x[0][1]-s/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?x[1][0]-x[0][0]+s:s}).attr("height",function(y){return y.type==="e"||y.type==="w"?x[1][1]-x[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,x,y){var v=m.__brush.emitter;return v&&(!y||!v.clean)?v:new f(m,x,y)}function f(m,x,y){this.that=m,this.args=x,this.state=m.__brush,this.active=0,this.clean=y}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,x){return this.starting?(this.starting=!1,this.emit("start",m,x)):this.emit("brush",m),this},brush:function(m,x){return this.emit("brush",m,x),this},end:function(m,x){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,x)),this},emit:function(m,x,y){var v=Dt(this.that).datum();i.call(m,this.that,new mv(m,{sourceEvent:x,target:l,selection:e.output(this.state.selection),mode:y,dispatch:i}),v)}};function h(m){if(o&&!m.touches||!r.apply(this,arguments))return;var x=this,y=m.target.__data__.type,v=(a&&m.metaKey?y="overlay":y)==="selection"?Xf:a&&m.altKey?In:qn,_=e===Es?null:_v[y],S=e===ki?null:xv[y],w=Ds(x),b=w.extent,T=w.selection,M=b[0][0],k,C,O=b[0][1],R,E,H=b[1][0],I,P,j=b[1][1],Y,rt,tt=0,J=0,Q,it=_&&S&&a&&m.shiftKey,L,ot,nt=Array.from(m.touches||[m],V=>{const ut=V.identifier;return V=Tr(V,x),V.point0=V.slice(),V.identifier=ut,V});rc(x);var N=c(x,arguments,!0).beforestart();if(y==="overlay"){T&&(Q=!0);const V=[nt[0],nt[1]||nt[0]];w.selection=T=[[k=e===Es?M:Ce(V[0][0],V[1][0]),R=e===ki?O:Ce(V[0][1],V[1][1])],[I=e===Es?H:Ae(V[0][0],V[1][0]),Y=e===ki?j:Ae(V[0][1],V[1][1])]],nt.length>1&&W(m)}else k=T[0][0],R=T[0][1],I=T[1][0],Y=T[1][1];C=k,E=R,P=I,rt=Y;var F=Dt(x).attr("pointer-events","none"),z=F.selectAll(".overlay").attr("cursor",Pr[y]);if(m.touches)N.moved=A,N.ended=q;else{var B=Dt(m.view).on("mousemove.brush",A,!0).on("mouseup.brush",q,!0);a&&B.on("keydown.brush",$,!0).on("keyup.brush",lt,!0),E1(m.view)}u.call(x),N.start(m,v.name);function A(V){for(const ut of V.changedTouches||[V])for(const vt of nt)vt.identifier===ut.identifier&&(vt.cur=Tr(ut,x));if(it&&!L&&!ot&&nt.length===1){const ut=nt[0];Wf(ut.cur[0]-ut[0])>Wf(ut.cur[1]-ut[1])?ot=!0:L=!0}for(const ut of nt)ut.cur&&(ut[0]=ut.cur[0],ut[1]=ut.cur[1]);Q=!0,ks(V),W(V)}function W(V){const ut=nt[0],vt=ut.point0;var et;switch(tt=ut[0]-vt[0],J=ut[1]-vt[1],v){case Rs:case Xf:{_&&(tt=Ae(M-k,Ce(H-I,tt)),C=k+tt,P=I+tt),S&&(J=Ae(O-R,Ce(j-Y,J)),E=R+J,rt=Y+J);break}case qn:{nt[1]?(_&&(C=Ae(M,Ce(H,nt[0][0])),P=Ae(M,Ce(H,nt[1][0])),_=1),S&&(E=Ae(O,Ce(j,nt[0][1])),rt=Ae(O,Ce(j,nt[1][1])),S=1)):(_<0?(tt=Ae(M-k,Ce(H-k,tt)),C=k+tt,P=I):_>0&&(tt=Ae(M-I,Ce(H-I,tt)),C=k,P=I+tt),S<0?(J=Ae(O-R,Ce(j-R,J)),E=R+J,rt=Y):S>0&&(J=Ae(O-Y,Ce(j-Y,J)),E=R,rt=Y+J));break}case In:{_&&(C=Ae(M,Ce(H,k-tt*_)),P=Ae(M,Ce(H,I+tt*_))),S&&(E=Ae(O,Ce(j,R-J*S)),rt=Ae(O,Ce(j,Y+J*S)));break}}P<C&&(_*=-1,et=k,k=I,I=et,et=C,C=P,P=et,y in Zf&&z.attr("cursor",Pr[y=Zf[y]])),rt<E&&(S*=-1,et=R,R=Y,Y=et,et=E,E=rt,rt=et,y in Qf&&z.attr("cursor",Pr[y=Qf[y]])),w.selection&&(T=w.selection),L&&(C=T[0][0],P=T[1][0]),ot&&(E=T[0][1],rt=T[1][1]),(T[0][0]!==C||T[0][1]!==E||T[1][0]!==P||T[1][1]!==rt)&&(w.selection=[[C,E],[P,rt]],u.call(x),N.brush(V,v.name))}function q(V){if(yv(V),V.touches){if(V.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else D1(V.view,Q),B.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);F.attr("pointer-events","all"),z.attr("cursor",Pr.overlay),w.selection&&(T=w.selection),Sv(T)&&(w.selection=null,u.call(x)),N.end(V,v.name)}function $(V){switch(V.keyCode){case 16:{it=_&&S;break}case 18:{v===qn&&(_&&(I=P-tt*_,k=C+tt*_),S&&(Y=rt-J*S,R=E+J*S),v=In,W(V));break}case 32:{(v===qn||v===In)&&(_<0?I=P-tt:_>0&&(k=C-tt),S<0?Y=rt-J:S>0&&(R=E-J),v=Rs,z.attr("cursor",Pr.selection),W(V));break}default:return}ks(V)}function lt(V){switch(V.keyCode){case 16:{it&&(L=ot=it=!1,W(V));break}case 18:{v===In&&(_<0?I=P:_>0&&(k=C),S<0?Y=rt:S>0&&(R=E),v=qn,W(V));break}case 32:{v===Rs&&(V.altKey?(_&&(I=P-tt*_,k=C+tt*_),S&&(Y=rt-J*S,R=E+J*S),v=In):(_<0?I=P:_>0&&(k=C),S<0?Y=rt:S>0&&(R=E),v=qn),z.attr("cursor",Pr[y]),W(V));break}default:return}ks(V)}}function p(m){c(this,arguments).moved(m)}function g(m){c(this,arguments).ended(m)}function d(){var m=this.__brush||{selection:null};return m.extent=Vf(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Cs(Vf(m)),l):t},l.filter=function(m){return arguments.length?(r=typeof m=="function"?m:Cs(!!m),l):r},l.touchable=function(m){return arguments.length?(n=typeof m=="function"?m:Cs(!!m),l):n},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(a=!!m,l):a},l.on=function(){var m=i.on.apply(i,arguments);return m===i?l:m},l}function Ri(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Mv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zc(e){let t,r,n;e.length!==2?(t=Ri,r=(o,l)=>Ri(e(o),l),n=(o,l)=>e(o)-l):(t=e===Ri||e===Mv?e:Av,r=e,n=e);function a(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;r(o[f],l)<0?u=f+1:c=f}while(u<c)}return u}function i(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;r(o[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function s(o,l,u=0,c=o.length){const f=a(o,l,u,c-1);return f>u&&n(o[f-1],l)>-n(o[f],l)?f-1:f}return{left:a,center:s,right:i}}function Av(){return 0}function Cv(e){return e===null?NaN:+e}const kv=zc(Ri),Rv=kv.right;zc(Cv).center;const Ev=Math.sqrt(50),Dv=Math.sqrt(10),Ov=Math.sqrt(2);function zi(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=Ev?10:i>=Dv?5:i>=Ov?2:1;let o,l,u;return a<0?(u=Math.pow(10,-a)/s,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,a)*s,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=r&&r<2?zi(e,t,r*2):[o,l,u]}function Pv(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,s]=n?zi(t,e,r):zi(e,t,r);if(!(i>=a))return[];const o=i-a+1,l=new Array(o);if(n)if(s<0)for(let u=0;u<o;++u)l[u]=(i-u)/-s;else for(let u=0;u<o;++u)l[u]=(i-u)*s;else if(s<0)for(let u=0;u<o;++u)l[u]=(a+u)/-s;else for(let u=0;u<o;++u)l[u]=(a+u)*s;return l}function ac(e,t,r){return t=+t,e=+e,r=+r,zi(e,t,r)[2]}function ic(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?ac(t,e,r):ac(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function Tm(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Fv(e){return function(){return e}}function Nv(e){return+e}var Jf=[0,1];function Gn(e){return e}function sc(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Fv(isNaN(t)?NaN:.5)}function $v(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Lv(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a<n?(n=sc(a,n),i=r(s,i)):(n=sc(n,a),i=r(i,s)),function(o){return i(n(o))}}function qv(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)a[s]=sc(e[s],e[s+1]),i[s]=r(t[s],t[s+1]);return function(o){var l=Rv(e,o,1,n)-1;return i[l](a[l](o))}}function Mm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Iv(){var e=Jf,t=Jf,r=rs,n,a,i,s=Gn,o,l,u;function c(){var h=Math.min(e.length,t.length);return s!==Gn&&(s=$v(e[0],e[h-1])),o=h>2?qv:Lv,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?i:(l||(l=o(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(a((u||(u=o(t,e.map(n),gr)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Nv),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=tx,c()},f.clamp=function(h){return arguments.length?(s=h?!0:Gn,c()):s!==Gn},f.interpolate=function(h){return arguments.length?(r=h,c()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,p){return n=h,a=p,c()}}function Am(){return Iv()(Gn,Gn)}function zv(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bi(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function aa(e){return e=Bi(Math.abs(e)),e?e[1]:NaN}function Bv(e,t){return function(r,n){for(var a=r.length,i=[],s=0,o=e[0],l=0;a>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),i.push(r.substring(a-=o,a+o)),!((l+=o+1)>n));)o=e[s=(s+1)%e.length];return i.reverse().join(t)}}function Uv(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Hv=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ui(e){if(!(t=Hv.exec(e)))throw new Error("invalid format: "+e);var t;return new Bc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ui.prototype=Bc.prototype;function Bc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Bc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Gv(e){t:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break t;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Cm;function jv(e,t){var r=Bi(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(Cm=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Bi(e,Math.max(0,t+i-1))[0]}function th(e,t){var r=Bi(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const eh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zv,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>th(e*100,t),r:th,s:jv,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function rh(e){return e}var nh=Array.prototype.map,ah=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yv(e){var t=e.grouping===void 0||e.thousands===void 0?rh:Bv(nh.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?rh:Uv(nh.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Ui(f);var h=f.fill,p=f.align,g=f.sign,d=f.symbol,m=f.zero,x=f.width,y=f.comma,v=f.precision,_=f.trim,S=f.type;S==="n"?(y=!0,S="g"):eh[S]||(v===void 0&&(v=12),_=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=d==="$"?r:d==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",b=d==="$"?n:/[%p]/.test(S)?s:"",T=eh[S],M=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function k(C){var O=w,R=b,E,H,I;if(S==="c")R=T(C)+R,C="";else{C=+C;var P=C<0||1/C<0;if(C=isNaN(C)?l:T(Math.abs(C),v),_&&(C=Gv(C)),P&&+C==0&&g!=="+"&&(P=!1),O=(P?g==="("?g:o:g==="-"||g==="("?"":g)+O,R=(S==="s"?ah[8+Cm/3]:"")+R+(P&&g==="("?")":""),M){for(E=-1,H=C.length;++E<H;)if(I=C.charCodeAt(E),48>I||I>57){R=(I===46?a+C.slice(E+1):C.slice(E))+R,C=C.slice(0,E);break}}}y&&!m&&(C=t(C,1/0));var j=O.length+C.length+R.length,Y=j<x?new Array(x-j+1).join(h):"";switch(y&&m&&(C=t(Y+C,Y.length?x-R.length:1/0),Y=""),p){case"<":C=O+C+R+Y;break;case"=":C=O+Y+C+R;break;case"^":C=Y.slice(0,j=Y.length>>1)+O+C+R+Y.slice(j);break;default:C=Y+O+C+R;break}return i(C)}return k.toString=function(){return f+""},k}function c(f,h){var p=u((f=Ui(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(aa(h)/3)))*3,d=Math.pow(10,-g),m=ah[8+g/3];return function(x){return p(d*x)+m}}return{format:u,formatPrefix:c}}var xi,km,Rm;Xv({thousands:",",grouping:[3],currency:["$",""]});function Xv(e){return xi=Yv(e),km=xi.format,Rm=xi.formatPrefix,xi}function Wv(e){return Math.max(0,-aa(Math.abs(e)))}function Kv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(aa(t)/3)))*3-aa(Math.abs(e)))}function Vv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,aa(t)-aa(e))+1}function Zv(e,t,r,n){var a=ic(e,t,r),i;switch(n=Ui(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=Kv(a,s))&&(n.precision=i),Rm(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=Vv(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=Wv(a))&&(n.precision=i-(n.type==="%")*2);break}}return km(n)}function Qv(e){var t=e.domain;return e.ticks=function(r){var n=t();return Pv(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return Zv(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],o=n[i],l,u,c=10;for(o<s&&(u=s,s=o,o=u,u=a,a=i,i=u);c-- >0;){if(u=ac(s,o,r),u===l)return n[a]=s,n[i]=o,t(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return e},e}function ia(){var e=Am();return e.copy=function(){return Mm(e,ia())},Tm.apply(e,arguments),Qv(e)}function Jv(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return i<a&&(s=r,r=n,n=s,s=a,a=i,i=s),e[r]=t.floor(a),e[n]=t.ceil(i),e}const Os=new Date,Ps=new Date;function pe(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),o=a.ceil(i);return i-s<o-i?s:o},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,o)=>{const l=[];if(i=a.ceil(i),o=o==null?1:Math.floor(o),!(i<s)||!(o>0))return l;let u;do l.push(u=new Date(+i)),t(i,o),e(i);while(u<i&&i<s);return l},a.filter=i=>pe(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!i(s););else for(;--o>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>(Os.setTime(+i),Ps.setTime(+s),e(Os),e(Ps),Math.floor(r(Os,Ps))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const Hi=pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Hi);Hi.range;const Lr=1e3,sr=Lr*60,qr=sr*60,Ur=qr*24,Uc=Ur*7,ih=Ur*30,Fs=Ur*365,jn=pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getUTCSeconds());jn.range;const Hc=pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lr)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getMinutes());Hc.range;const tb=pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getUTCMinutes());tb.range;const Gc=pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lr-e.getMinutes()*sr)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getHours());Gc.range;const eb=pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*qr)},(e,t)=>(t-e)/qr,e=>e.getUTCHours());eb.range;const ii=pe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*sr)/Ur,e=>e.getDate()-1);ii.range;const jc=pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ur,e=>e.getUTCDate()-1);jc.range;const rb=pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ur,e=>Math.floor(e/Ur));rb.range;function kn(e){return pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*sr)/Uc)}const is=kn(0),Gi=kn(1),nb=kn(2),ab=kn(3),sa=kn(4),ib=kn(5),sb=kn(6);is.range;Gi.range;nb.range;ab.range;sa.range;ib.range;sb.range;function Rn(e){return pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Uc)}const Em=Rn(0),ji=Rn(1),ob=Rn(2),lb=Rn(3),oa=Rn(4),ub=Rn(5),cb=Rn(6);Em.range;ji.range;ob.range;lb.range;oa.range;ub.range;cb.range;const Yc=pe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Yc.range;const fb=pe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());fb.range;const Hr=pe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Hr.range;const An=pe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());An.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});An.range;function hb(e,t,r,n,a,i){const s=[[jn,1,Lr],[jn,5,5*Lr],[jn,15,15*Lr],[jn,30,30*Lr],[i,1,sr],[i,5,5*sr],[i,15,15*sr],[i,30,30*sr],[a,1,qr],[a,3,3*qr],[a,6,6*qr],[a,12,12*qr],[n,1,Ur],[n,2,2*Ur],[r,1,Uc],[t,1,ih],[t,3,3*ih],[e,1,Fs]];function o(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const p=f&&typeof f.range=="function"?f:l(u,c,f),g=p?p.range(u,+c+1):[];return h?g.reverse():g}function l(u,c,f){const h=Math.abs(c-u)/f,p=zc(([,,m])=>m).right(s,h);if(p===s.length)return e.every(ic(u/Fs,c/Fs,f));if(p===0)return Hi.every(Math.max(ic(u,c,f),1));const[g,d]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(d)}return[o,l]}const[pb,db]=hb(Hr,Yc,is,ii,Gc,Hc);function Ns(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function $s(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function wa(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function gb(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,u=Sa(a),c=Ta(a),f=Sa(i),h=Ta(i),p=Sa(s),g=Ta(s),d=Sa(o),m=Ta(o),x=Sa(l),y=Ta(l),v={a:P,A:j,b:Y,B:rt,c:null,d:fh,e:fh,f:qb,g:Wb,G:Vb,H:Nb,I:$b,j:Lb,L:Dm,m:Ib,M:zb,p:tt,q:J,Q:dh,s:gh,S:Bb,u:Ub,U:Hb,V:Gb,w:jb,W:Yb,x:null,X:null,y:Xb,Y:Kb,Z:Zb,"%":ph},_={a:Q,A:it,b:L,B:ot,c:null,d:hh,e:hh,f:ew,g:fw,G:pw,H:Qb,I:Jb,j:tw,L:Pm,m:rw,M:nw,p:nt,q:N,Q:dh,s:gh,S:aw,u:iw,U:sw,V:ow,w:lw,W:uw,x:null,X:null,y:cw,Y:hw,Z:dw,"%":ph},S={a:k,A:C,b:O,B:R,c:E,d:uh,e:uh,f:Db,g:lh,G:oh,H:ch,I:ch,j:Cb,L:Eb,m:Ab,M:kb,p:M,q:Mb,Q:Pb,s:Fb,S:Rb,u:vb,U:bb,V:wb,w:xb,W:Sb,x:H,X:I,y:lh,Y:oh,Z:Tb,"%":Ob};v.x=w(r,v),v.X=w(n,v),v.c=w(t,v),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(F,z){return function(B){var A=[],W=-1,q=0,$=F.length,lt,V,ut;for(B instanceof Date||(B=new Date(+B));++W<$;)F.charCodeAt(W)===37&&(A.push(F.slice(q,W)),(V=sh[lt=F.charAt(++W)])!=null?lt=F.charAt(++W):V=lt==="e"?" ":"0",(ut=z[lt])&&(lt=ut(B,V)),A.push(lt),q=W+1);return A.push(F.slice(q,W)),A.join("")}}function b(F,z){return function(B){var A=wa(1900,void 0,1),W=T(A,F,B+="",0),q,$;if(W!=B.length)return null;if("Q"in A)return new Date(A.Q);if("s"in A)return new Date(A.s*1e3+("L"in A?A.L:0));if(z&&!("Z"in A)&&(A.Z=0),"p"in A&&(A.H=A.H%12+A.p*12),A.m===void 0&&(A.m="q"in A?A.q:0),"V"in A){if(A.V<1||A.V>53)return null;"w"in A||(A.w=1),"Z"in A?(q=$s(wa(A.y,0,1)),$=q.getUTCDay(),q=$>4||$===0?ji.ceil(q):ji(q),q=jc.offset(q,(A.V-1)*7),A.y=q.getUTCFullYear(),A.m=q.getUTCMonth(),A.d=q.getUTCDate()+(A.w+6)%7):(q=Ns(wa(A.y,0,1)),$=q.getDay(),q=$>4||$===0?Gi.ceil(q):Gi(q),q=ii.offset(q,(A.V-1)*7),A.y=q.getFullYear(),A.m=q.getMonth(),A.d=q.getDate()+(A.w+6)%7)}else("W"in A||"U"in A)&&("w"in A||(A.w="u"in A?A.u%7:"W"in A?1:0),$="Z"in A?$s(wa(A.y,0,1)).getUTCDay():Ns(wa(A.y,0,1)).getDay(),A.m=0,A.d="W"in A?(A.w+6)%7+A.W*7-($+5)%7:A.w+A.U*7-($+6)%7);return"Z"in A?(A.H+=A.Z/100|0,A.M+=A.Z%100,$s(A)):Ns(A)}}function T(F,z,B,A){for(var W=0,q=z.length,$=B.length,lt,V;W<q;){if(A>=$)return-1;if(lt=z.charCodeAt(W++),lt===37){if(lt=z.charAt(W++),V=S[lt in sh?z.charAt(W++):lt],!V||(A=V(F,B,A))<0)return-1}else if(lt!=B.charCodeAt(A++))return-1}return A}function M(F,z,B){var A=u.exec(z.slice(B));return A?(F.p=c.get(A[0].toLowerCase()),B+A[0].length):-1}function k(F,z,B){var A=p.exec(z.slice(B));return A?(F.w=g.get(A[0].toLowerCase()),B+A[0].length):-1}function C(F,z,B){var A=f.exec(z.slice(B));return A?(F.w=h.get(A[0].toLowerCase()),B+A[0].length):-1}function O(F,z,B){var A=x.exec(z.slice(B));return A?(F.m=y.get(A[0].toLowerCase()),B+A[0].length):-1}function R(F,z,B){var A=d.exec(z.slice(B));return A?(F.m=m.get(A[0].toLowerCase()),B+A[0].length):-1}function E(F,z,B){return T(F,t,z,B)}function H(F,z,B){return T(F,r,z,B)}function I(F,z,B){return T(F,n,z,B)}function P(F){return s[F.getDay()]}function j(F){return i[F.getDay()]}function Y(F){return l[F.getMonth()]}function rt(F){return o[F.getMonth()]}function tt(F){return a[+(F.getHours()>=12)]}function J(F){return 1+~~(F.getMonth()/3)}function Q(F){return s[F.getUTCDay()]}function it(F){return i[F.getUTCDay()]}function L(F){return l[F.getUTCMonth()]}function ot(F){return o[F.getUTCMonth()]}function nt(F){return a[+(F.getUTCHours()>=12)]}function N(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var z=w(F+="",v);return z.toString=function(){return F},z},parse:function(F){var z=b(F+="",!1);return z.toString=function(){return F},z},utcFormat:function(F){var z=w(F+="",_);return z.toString=function(){return F},z},utcParse:function(F){var z=b(F+="",!0);return z.toString=function(){return F},z}}}var sh={"-":"",_:" ",0:"0"},_e=/^\s*\d+/,mb=/^%/,yb=/[\\^$*+?|[\]().{}]/g;function Mt(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function _b(e){return e.replace(yb,"\\$&")}function Sa(e){return new RegExp("^(?:"+e.map(_b).join("|")+")","i")}function Ta(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function xb(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function vb(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function bb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function wb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Sb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function oh(e,t,r){var n=_e.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function lh(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Tb(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Mb(e,t,r){var n=_e.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ab(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function uh(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Cb(e,t,r){var n=_e.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function ch(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function kb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Rb(e,t,r){var n=_e.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Eb(e,t,r){var n=_e.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Db(e,t,r){var n=_e.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ob(e,t,r){var n=mb.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Pb(e,t,r){var n=_e.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Fb(e,t,r){var n=_e.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function fh(e,t){return Mt(e.getDate(),t,2)}function Nb(e,t){return Mt(e.getHours(),t,2)}function $b(e,t){return Mt(e.getHours()%12||12,t,2)}function Lb(e,t){return Mt(1+ii.count(Hr(e),e),t,3)}function Dm(e,t){return Mt(e.getMilliseconds(),t,3)}function qb(e,t){return Dm(e,t)+"000"}function Ib(e,t){return Mt(e.getMonth()+1,t,2)}function zb(e,t){return Mt(e.getMinutes(),t,2)}function Bb(e,t){return Mt(e.getSeconds(),t,2)}function Ub(e){var t=e.getDay();return t===0?7:t}function Hb(e,t){return Mt(is.count(Hr(e)-1,e),t,2)}function Om(e){var t=e.getDay();return t>=4||t===0?sa(e):sa.ceil(e)}function Gb(e,t){return e=Om(e),Mt(sa.count(Hr(e),e)+(Hr(e).getDay()===4),t,2)}function jb(e){return e.getDay()}function Yb(e,t){return Mt(Gi.count(Hr(e)-1,e),t,2)}function Xb(e,t){return Mt(e.getFullYear()%100,t,2)}function Wb(e,t){return e=Om(e),Mt(e.getFullYear()%100,t,2)}function Kb(e,t){return Mt(e.getFullYear()%1e4,t,4)}function Vb(e,t){var r=e.getDay();return e=r>=4||r===0?sa(e):sa.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function Zb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function hh(e,t){return Mt(e.getUTCDate(),t,2)}function Qb(e,t){return Mt(e.getUTCHours(),t,2)}function Jb(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function tw(e,t){return Mt(1+jc.count(An(e),e),t,3)}function Pm(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function ew(e,t){return Pm(e,t)+"000"}function rw(e,t){return Mt(e.getUTCMonth()+1,t,2)}function nw(e,t){return Mt(e.getUTCMinutes(),t,2)}function aw(e,t){return Mt(e.getUTCSeconds(),t,2)}function iw(e){var t=e.getUTCDay();return t===0?7:t}function sw(e,t){return Mt(Em.count(An(e)-1,e),t,2)}function Fm(e){var t=e.getUTCDay();return t>=4||t===0?oa(e):oa.ceil(e)}function ow(e,t){return e=Fm(e),Mt(oa.count(An(e),e)+(An(e).getUTCDay()===4),t,2)}function lw(e){return e.getUTCDay()}function uw(e,t){return Mt(ji.count(An(e)-1,e),t,2)}function cw(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function fw(e,t){return e=Fm(e),Mt(e.getUTCFullYear()%100,t,2)}function hw(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function pw(e,t){var r=e.getUTCDay();return e=r>=4||r===0?oa(e):oa.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function dw(){return"+0000"}function ph(){return"%"}function dh(e){return+e}function gh(e){return Math.floor(+e/1e3)}var zn,Nm;gw({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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 gw(e){return zn=gb(e),Nm=zn.format,zn.parse,zn.utcFormat,zn.utcParse,zn}function mw(e){return new Date(e)}function yw(e){return e instanceof Date?+e:+new Date(+e)}function $m(e,t,r,n,a,i,s,o,l,u){var c=Am(),f=c.invert,h=c.domain,p=u(".%L"),g=u(":%S"),d=u("%I:%M"),m=u("%I %p"),x=u("%a %d"),y=u("%b %d"),v=u("%B"),_=u("%Y");function S(w){return(l(w)<w?p:o(w)<w?g:s(w)<w?d:i(w)<w?m:n(w)<w?a(w)<w?x:y:r(w)<w?v:_)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?h(Array.from(w,yw)):h().map(mw)},c.ticks=function(w){var b=h();return e(b[0],b[b.length-1],w??10)},c.tickFormat=function(w,b){return b==null?S:u(b)},c.nice=function(w){var b=h();return(!w||typeof w.range!="function")&&(w=t(b[0],b[b.length-1],w??10)),w?h(Jv(b,w)):c},c.copy=function(){return Mm(c,$m(e,t,r,n,a,i,s,o,l,u))},c}function Kn(){return Tm.apply($m(pb,db,Hr,Yc,is,ii,Gc,Hc,jn,Nm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Zt(e){return function(){return e}}const oc=Math.PI,lc=2*oc,dn=1e-6,_w=lc-dn;function Lm(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function xw(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Lm;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class vw{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Lm:xw(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,s){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,o=this._y1,l=n-t,u=a-r,c=s-t,f=o-r,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>dn)if(!(Math.abs(f*l-u*c)>dn)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,g=a-o,d=l*l+u*u,m=p*p+g*g,x=Math.sqrt(d),y=Math.sqrt(h),v=i*Math.tan((oc-Math.acos((d+h-m)/(2*x*y)))/2),_=v/y,S=v/x;Math.abs(_-1)>dn&&this._append`L${t+_*c},${r+_*f}`,this._append`A${i},${i},0,0,${+(f*p>c*g)},${this._x1=t+S*l},${this._y1=r+S*u}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(a),l=n*Math.sin(a),u=t+o,c=r+l,f=1^s,h=s?a-i:i-a;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>dn||Math.abs(this._y1-c)>dn)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%lc+lc),h>_w?this._append`A${n},${n},0,1,${f},${t-o},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:h>dn&&this._append`A${n},${n},0,${+(h>=oc)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function qm(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new vw(t)}function Xc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Im(e){this._context=e}Im.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Cn(e){return new Im(e)}function zm(e){return e[0]}function Bm(e){return e[1]}function Um(e,t){var r=Zt(!0),n=null,a=Cn,i=null,s=qm(o);e=typeof e=="function"?e:e===void 0?zm:Zt(e),t=typeof t=="function"?t:t===void 0?Bm:Zt(t);function o(l){var u,c=(l=Xc(l)).length,f,h=!1,p;for(n==null&&(i=a(p=s())),u=0;u<=c;++u)!(u<c&&r(f=l[u],u,l))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,u,l),+t(f,u,l));if(p)return i=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Zt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Zt(+l),o):t},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Zt(!!l),o):r},o.curve=function(l){return arguments.length?(a=l,n!=null&&(i=a(n)),o):a},o.context=function(l){return arguments.length?(l==null?n=i=null:i=a(n=l),o):n},o}function ss(e,t,r){var n=null,a=Zt(!0),i=null,s=Cn,o=null,l=qm(u);e=typeof e=="function"?e:e===void 0?zm:Zt(+e),t=typeof t=="function"?t:Zt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Bm:Zt(+r);function u(f){var h,p,g,d=(f=Xc(f)).length,m,x=!1,y,v=new Array(d),_=new Array(d);for(i==null&&(o=s(y=l())),h=0;h<=d;++h){if(!(h<d&&a(m=f[h],h,f))===x)if(x=!x)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(v[g],_[g]);o.lineEnd(),o.areaEnd()}x&&(v[h]=+e(m,h,f),_[h]=+t(m,h,f),o.point(n?+n(m,h,f):v[h],r?+r(m,h,f):_[h]))}if(y)return o=null,y+""||null}function c(){return Um().defined(a).curve(s).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Zt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Zt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Zt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Zt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Zt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Zt(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:Zt(!!f),u):a},u.curve=function(f){return arguments.length?(s=f,i!=null&&(o=s(i)),u):s},u.context=function(f){return arguments.length?(f==null?i=o=null:o=s(i=f),u):i},u}function mh(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,o=i.length;r<s;++r)for(a=i,i=e[t[r]],n=0;n<o;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function yh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function bw(e,t){return e[t]}function ww(e){const t=[];return t.key=e,t}function Ka(){var e=Zt([]),t=yh,r=mh,n=bw;function a(i){var s=Array.from(e.apply(this,arguments),ww),o,l=s.length,u=-1,c;for(const f of i)for(o=0,++u;o<l;++o)(s[o][u]=[0,+n(f,s[o].key,u,i)]).data=f;for(o=0,c=Xc(t(s));o<l;++o)s[c[o]].index=o;return r(s,c),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Zt(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:Zt(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?yh:typeof i=="function"?i:Zt(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??mh,a):r},a}function Nr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
2
2
|
* GSAP 3.14.2
|
|
3
3
|
* https://gsap.com
|
|
4
4
|
*
|
|
5
5
|
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
|
6
6
|
* Subject to the terms at https://gsap.com/standard-license
|
|
7
7
|
* @author: Jack Doyle, jack@greensock.com
|
|
8
|
-
*/var Je={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},li={duration:.5,overwrite:!1,delay:0},Wc,Se,Bt,or=1e8,Ot=1/or,uc=Math.PI*2,Sw=uc/4,Tw=0,Gm=Math.sqrt,Mw=Math.cos,Aw=Math.sin,ye=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},Hr=function(t){return typeof t=="number"},Kc=function(t){return typeof t>"u"},Mr=function(t){return typeof t=="object"},Ie=function(t){return t!==!1},Vc=function(){return typeof window<"u"},xa=function(t){return Vt(t)||ye(t)},jm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ee=Array.isArray,Cw=/random\([^)]+\)/g,kw=/,\s*/g,_h=/(?:-?\.?\d|\.)+/gi,Ym=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Yn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ls=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Xm=/[+-]=-?[.\d]+/,Rw=/[^,'"\[\]\s]+/gi,Ew=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Yt,br,cc,Zc,er={},Ya={},Wm,Km=function(t){return(Ya=ui(t,er))&&He},Qc=function(t,r){return console.warn("Invalid property",t,"set to",r,"Missing plugin? gsap.registerPlugin()")},Vi=function(t,r){return!r&&console.warn(t)},Vm=function(t,r){return t&&(er[t]=r)&&Ya&&(Ya[t]=r)||er},Zi=function(){return 0},Dw={suppressEvents:!0,isStart:!0,kill:!1},Ea={suppressEvents:!0,kill:!1},Ow={suppressEvents:!0},Jc={},Jr=[],fc={},Zm,Ke={},qs={},vh=30,Da=[],tf="",ef=function(t){var r=t[0],n,i;if(Mr(r)||Vt(r)||(t=[t]),!(n=(r._gsap||{}).harness)){for(i=Da.length;i--&&!Da[i].targetTest(r););n=Da[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new b0(t[i],n)))||t.splice(i,1);return t},xn=function(t){return t._gsap||ef(lr(t))[0]._gsap},Qm=function(t,r,n){return(n=t[r])&&Vt(n)?t[r]():Kc(n)&&t.getAttribute&&t.getAttribute(r)||n},ze=function(t,r){return(t=t.split(",")).forEach(r)||t},ne=function(t){return Math.round(t*1e5)/1e5||0},jt=function(t){return Math.round(t*1e7)/1e7||0},Vn=function(t,r){var n=r.charAt(0),i=parseFloat(r.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},Pw=function(t,r){for(var n=r.length,i=0;t.indexOf(r[i])<0&&++i<n;);return i<n},Xa=function(){var t=Jr.length,r=Jr.slice(0),n,i;for(fc={},Jr.length=0,n=0;n<t;n++)i=r[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},rf=function(t){return!!(t._initted||t._startAt||t.add)},Jm=function(t,r,n,i){Jr.length&&!Se&&Xa(),t.render(r,n,!!(Se&&r<0&&rf(t))),Jr.length&&!Se&&Xa()},t0=function(t){var r=parseFloat(t);return(r||r===0)&&(t+"").match(Rw).length<2?r:ye(t)?t.trim():t},e0=function(t){return t},rr=function(t,r){for(var n in r)n in t||(t[n]=r[n]);return t},Fw=function(t){return function(r,n){for(var i in n)i in r||i==="duration"&&t||i==="ease"||(r[i]=n[i])}},ui=function(t,r){for(var n in r)t[n]=r[n];return t},xh=function e(t,r){for(var n in r)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=Mr(r[n])?e(t[n]||(t[n]={}),r[n]):r[n]);return t},Wa=function(t,r){var n={},i;for(i in t)i in r||(n[i]=t[i]);return n},$i=function(t){var r=t.parent||Yt,n=t.keyframes?Fw(Ee(t.keyframes)):rr;if(Ie(t.inherit))for(;r;)n(t,r.vars.defaults),r=r.parent||r._dp;return t},Nw=function(t,r){for(var n=t.length,i=n===r.length;i&&n--&&t[n]===r[n];);return n<0},r0=function(t,r,n,i,a){var s=t[i],o;if(a)for(o=r[a];s&&s[a]>o;)s=s._prev;return s?(r._next=s._next,s._next=r):(r._next=t[n],t[n]=r),r._next?r._next._prev=r:t[i]=r,r._prev=s,r.parent=r._dp=t,r},os=function(t,r,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var a=r._prev,s=r._next;a?a._next=s:t[n]===r&&(t[n]=s),s?s._prev=a:t[i]===r&&(t[i]=a),r._next=r._prev=r.parent=null},rn=function(t,r){t.parent&&(!r||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},bn=function(t,r){if(t&&(!r||r._end>t._dur||r._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},$w=function(t){for(var r=t.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return t},hc=function(t,r,n,i){return t._startAt&&(Se?t._startAt.revert(Ea):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(r,!0,i))},Lw=function e(t){return!t||t._ts&&e(t.parent)},bh=function(t){return t._repeat?ci(t._tTime,t=t.duration()+t._rDelay)*t:0},ci=function(t,r){var n=Math.floor(t=jt(t/r));return t&&n===t?n-1:n},Ka=function(t,r){return(t-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},ls=function(t){return t._end=jt(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ot)||0))},us=function(t,r){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=jt(n._time-(t._ts>0?r/t._ts:((t._dirty?t.totalDuration():t._tDur)-r)/-t._ts)),ls(t),n._dirty||bn(n,t)),t},n0=function(t,r){var n;if((r._time||!r._dur&&r._initted||r._start<t._time&&(r._dur||!r.add))&&(n=Ka(t.rawTime(),r),(!r._dur||sa(0,r.totalDuration(),n)-r._tTime>Ot)&&r.render(n,!0)),bn(t,r)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-Ot}},wr=function(t,r,n,i){return r.parent&&rn(r),r._start=jt((Hr(n)?n:n||t!==Yt?ar(t,n,r):t._time)+r._delay),r._end=jt(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),r0(t,r,"_first","_last",t._sort?"_start":0),pc(r)||(t._recent=r),i||n0(t,r),t._ts<0&&us(t,t._tTime),t},i0=function(t,r){return(er.ScrollTrigger||Qc("scrollTrigger",r))&&er.ScrollTrigger.create(r,t)},a0=function(t,r,n,i,a){if(af(t,r,a),!t._initted)return 1;if(!n&&t._pt&&!Se&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Zm!==Ve.frame)return Jr.push(t),t._lazy=[a,i],1},qw=function e(t){var r=t.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||e(r))},pc=function(t){var r=t.data;return r==="isFromStart"||r==="isStart"},Iw=function(t,r,n,i){var a=t.ratio,s=r<0||!r&&(!t._start&&qw(t)&&!(!t._initted&&pc(t))||(t._ts<0||t._dp._ts<0)&&!pc(t))?0:1,o=t._rDelay,l=0,u,c,f;if(o&&t._repeat&&(l=sa(0,t._tDur,r),c=ci(l,o),t._yoyo&&c&1&&(s=1-s),c!==ci(t._tTime,o)&&(a=1-s,t.vars.repeatRefresh&&t._initted&&t.invalidate())),s!==a||Se||i||t._zTime===Ot||!r&&t._zTime){if(!t._initted&&a0(t,r,i,n,l))return;for(f=t._zTime,t._zTime=r||(n?Ot:0),n||(n=r&&!f),t.ratio=s,t._from&&(s=1-s),t._time=0,t._tTime=l,u=t._pt;u;)u.r(s,u.d),u=u._next;r<0&&hc(t,r,n,!0),t._onUpdate&&!n&&Ze(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&Ze(t,"onRepeat"),(r>=t._tDur||r<0)&&t.ratio===s&&(s&&rn(t,1),!n&&!Se&&(Ze(t,s?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=r)},zw=function(t,r,n){var i;if(n>r)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>r)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<r)return i;i=i._prev}},fi=function(t,r,n,i){var a=t._repeat,s=jt(r)||0,o=t._tTime/t._tDur;return o&&!i&&(t._time*=s/t._dur),t._dur=s,t._tDur=a?a<0?1e10:jt(s*(a+1)+t._rDelay*a):s,o>0&&!i&&us(t,t._tTime=t._tDur*o),t.parent&&ls(t),n||bn(t.parent,t),t},wh=function(t){return t instanceof Oe?bn(t):fi(t,t._dur)},Bw={_start:0,endTime:Zi,totalDuration:Zi},ar=function e(t,r,n){var i=t.labels,a=t._recent||Bw,s=t.duration()>=or?a.endTime(!1):t._dur,o,l,u;return ye(r)&&(isNaN(r)||r in i)?(l=r.charAt(0),u=r.substr(-1)==="%",o=r.indexOf("="),l==="<"||l===">"?(o>=0&&(r=r.replace(/=/,"")),(l==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(r.substr(1))||0)*(u?(o<0?a:n).totalDuration()/100:1)):o<0?(r in i||(i[r]=s),i[r]):(l=parseFloat(r.charAt(o-1)+r.substr(o+1)),u&&n&&(l=l/100*(Ee(n)?n[0]:n).totalDuration()),o>1?e(t,r.substr(0,o-1),n)+l:s+l)):r==null?s:+r},Li=function(t,r,n){var i=Hr(r[1]),a=(i?2:1)+(t<2?0:1),s=r[a],o,l;if(i&&(s.duration=r[1]),s.parent=n,t){for(o=s,l=n;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Ie(l.vars.inherit)&&l.parent;s.immediateRender=Ie(o.immediateRender),t<2?s.runBackwards=1:s.startAt=r[a-1]}return new oe(r[0],s,r[a+1])},sn=function(t,r){return t||t===0?r(t):r},sa=function(t,r,n){return n<t?t:n>r?r:n},Re=function(t,r){return!ye(t)||!(r=Ew.exec(t))?"":r[1]},Uw=function(t,r,n){return sn(n,function(i){return sa(t,r,i)})},dc=[].slice,s0=function(t,r){return t&&Mr(t)&&"length"in t&&(!r&&!t.length||t.length-1 in t&&Mr(t[0]))&&!t.nodeType&&t!==br},Hw=function(t,r,n){return n===void 0&&(n=[]),t.forEach(function(i){var a;return ye(i)&&!r||s0(i,1)?(a=n).push.apply(a,lr(i)):n.push(i)})||n},lr=function(t,r,n){return Bt&&!r&&Bt.selector?Bt.selector(t):ye(t)&&!n&&(cc||!hi())?dc.call((r||Zc).querySelectorAll(t),0):Ee(t)?Hw(t,n):s0(t)?dc.call(t,0):t?[t]:[]},gc=function(t){return t=lr(t)[0]||Vi("Invalid scope")||{},function(r){var n=t.current||t.nativeElement||t;return lr(r,n.querySelectorAll?n:n===t?Vi("Invalid scope")||Zc.createElement("div"):t)}},o0=function(t){return t.sort(function(){return .5-Math.random()})},l0=function(t){if(Vt(t))return t;var r=Mr(t)?t:{each:t},n=wn(r.ease),i=r.from||0,a=parseFloat(r.base)||0,s={},o=i>0&&i<1,l=isNaN(i)||o,u=r.axis,c=i,f=i;return ye(i)?c=f={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(c=i[0],f=i[1]),function(h,p,g){var d=(g||r).length,m=s[d],v,y,x,_,S,w,b,T,M;if(!m){if(M=r.grid==="auto"?0:(r.grid||[1,or])[1],!M){for(b=-or;b<(b=g[M++].getBoundingClientRect().left)&&M<d;);M<d&&M--}for(m=s[d]=[],v=l?Math.min(M,d)*c-.5:i%M,y=M===or?0:l?d*f/M-.5:i/M|0,b=0,T=or,w=0;w<d;w++)x=w%M-v,_=y-(w/M|0),m[w]=S=u?Math.abs(u==="y"?_:x):Gm(x*x+_*_),S>b&&(b=S),S<T&&(T=S);i==="random"&&o0(m),m.max=b-T,m.min=T,m.v=d=(parseFloat(r.amount)||parseFloat(r.each)*(M>d?d-1:u?u==="y"?d/M:M:Math.max(M,d/M))||0)*(i==="edges"?-1:1),m.b=d<0?a-d:a,m.u=Re(r.amount||r.each)||0,n=n&&d<0?_0(n):n}return d=(m[h]-m.min)/m.max||0,jt(m.b+(n?n(d):d)*m.v)+m.u}},mc=function(t){var r=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=jt(Math.round(parseFloat(n)/t)*t*r);return(i-i%1)/r+(Hr(n)?0:Re(n))}},u0=function(t,r){var n=Ee(t),i,a;return!n&&Mr(t)&&(i=n=t.radius||or,t.values?(t=lr(t.values),(a=!Hr(t[0]))&&(i*=i)):t=mc(t.increment)),sn(r,n?Vt(t)?function(s){return a=t(s),Math.abs(a-s)<=i?a:s}:function(s){for(var o=parseFloat(a?s.x:s),l=parseFloat(a?s.y:0),u=or,c=0,f=t.length,h,p;f--;)a?(h=t[f].x-o,p=t[f].y-l,h=h*h+p*p):h=Math.abs(t[f]-o),h<u&&(u=h,c=f);return c=!i||u<=i?t[c]:s,a||c===s||Hr(s)?c:c+Re(s)}:mc(t))},c0=function(t,r,n,i){return sn(Ee(t)?!r:n===!0?!!(n=0):!i,function(){return Ee(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(r-t+n*.99))/n)*n*i)/i})},Gw=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(i){return r.reduce(function(a,s){return s(a)},i)}},jw=function(t,r){return function(n){return t(parseFloat(n))+(r||Re(n))}},Yw=function(t,r,n){return h0(t,r,0,1,n)},f0=function(t,r,n){return sn(n,function(i){return t[~~r(i)]})},Xw=function e(t,r,n){var i=r-t;return Ee(t)?f0(t,e(0,t.length),r):sn(n,function(a){return(i+(a-t)%i)%i+t})},Ww=function e(t,r,n){var i=r-t,a=i*2;return Ee(t)?f0(t,e(0,t.length-1),r):sn(n,function(s){return s=(a+(s-t)%a)%a||0,t+(s>i?a-s:s)})},Qi=function(t){return t.replace(Cw,function(r){var n=r.indexOf("[")+1,i=r.substring(n||7,n?r.indexOf("]"):r.length-1).split(kw);return c0(n?i:+i[0],n?0:+i[1],+i[2]||1e-5)})},h0=function(t,r,n,i,a){var s=r-t,o=i-n;return sn(a,function(l){return n+((l-t)/s*o||0)})},Kw=function e(t,r,n,i){var a=isNaN(t+r)?0:function(p){return(1-p)*t+p*r};if(!a){var s=ye(t),o={},l,u,c,f,h;if(n===!0&&(i=1)&&(n=null),s)t={p:t},r={p:r};else if(Ee(t)&&!Ee(r)){for(c=[],f=t.length,h=f-2,u=1;u<f;u++)c.push(e(t[u-1],t[u]));f--,a=function(g){g*=f;var d=Math.min(h,~~g);return c[d](g-d)},n=r}else i||(t=ui(Ee(t)?[]:{},t));if(!c){for(l in r)nf.call(o,t,l,"get",r[l]);a=function(g){return lf(g,o)||(s?t.p:t)}}}return sn(n,a)},Sh=function(t,r,n){var i=t.labels,a=or,s,o,l;for(s in i)o=i[s]-r,o<0==!!n&&o&&a>(o=Math.abs(o))&&(l=s,a=o);return l},Ze=function(t,r,n){var i=t.vars,a=i[r],s=Bt,o=t._ctx,l,u,c;if(a)return l=i[r+"Params"],u=i.callbackScope||t,n&&Jr.length&&Xa(),o&&(Bt=o),c=l?a.apply(u,l):a.call(u),Bt=s,c},Oi=function(t){return rn(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Se),t.progress()<1&&Ze(t,"onInterrupt"),t},Xn,p0=[],d0=function(t){if(t)if(t=!t.name&&t.default||t,Vc()||t.headless){var r=t.name,n=Vt(t),i=r&&!n&&t.init?function(){this._props=[]}:t,a={init:Zi,render:lf,add:nf,kill:fS,modifier:cS,rawVars:0},s={targetTest:0,get:0,getSetter:of,aliases:{},register:0};if(hi(),t!==i){if(Ke[r])return;rr(i,rr(Wa(t,a),s)),ui(i.prototype,ui(a,Wa(t,s))),Ke[i.prop=r]=i,t.targetTest&&(Da.push(i),Jc[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}Vm(r,i),t.register&&t.register(He,i,Be)}else p0.push(t)},Dt=255,Pi={aqua:[0,Dt,Dt],lime:[0,Dt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Dt],navy:[0,0,128],white:[Dt,Dt,Dt],olive:[128,128,0],yellow:[Dt,Dt,0],orange:[Dt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Dt,0,0],pink:[Dt,192,203],cyan:[0,Dt,Dt],transparent:[Dt,Dt,Dt,0]},Is=function(t,r,n){return t+=t<0?1:t>1?-1:0,(t*6<1?r+(n-r)*t*6:t<.5?n:t*3<2?r+(n-r)*(2/3-t)*6:r)*Dt+.5|0},g0=function(t,r,n){var i=t?Hr(t)?[t>>16,t>>8&Dt,t&Dt]:0:Pi.black,a,s,o,l,u,c,f,h,p,g;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Pi[t])i=Pi[t];else if(t.charAt(0)==="#"){if(t.length<6&&(a=t.charAt(1),s=t.charAt(2),o=t.charAt(3),t="#"+a+a+s+s+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&Dt,i&Dt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Dt,t&Dt]}else if(t.substr(0,3)==="hsl"){if(i=g=t.match(_h),!r)l=+i[0]%360/360,u=+i[1]/100,c=+i[2]/100,s=c<=.5?c*(u+1):c+u-c*u,a=c*2-s,i.length>3&&(i[3]*=1),i[0]=Is(l+1/3,a,s),i[1]=Is(l,a,s),i[2]=Is(l-1/3,a,s);else if(~t.indexOf("="))return i=t.match(Ym),n&&i.length<4&&(i[3]=1),i}else i=t.match(_h)||Pi.transparent;i=i.map(Number)}return r&&!g&&(a=i[0]/Dt,s=i[1]/Dt,o=i[2]/Dt,f=Math.max(a,s,o),h=Math.min(a,s,o),c=(f+h)/2,f===h?l=u=0:(p=f-h,u=c>.5?p/(2-f-h):p/(f+h),l=f===a?(s-o)/p+(s<o?6:0):f===s?(o-a)/p+2:(a-s)/p+4,l*=60),i[0]=~~(l+.5),i[1]=~~(u*100+.5),i[2]=~~(c*100+.5)),n&&i.length<4&&(i[3]=1),i},m0=function(t){var r=[],n=[],i=-1;return t.split(tn).forEach(function(a){var s=a.match(Yn)||[];r.push.apply(r,s),n.push(i+=s.length+1)}),r.c=n,r},Th=function(t,r,n){var i="",a=(t+i).match(tn),s=r?"hsla(":"rgba(",o=0,l,u,c,f;if(!a)return t;if(a=a.map(function(h){return(h=g0(h,r,1))&&s+(r?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),n&&(c=m0(t),l=n.c,l.join(i)!==c.c.join(i)))for(u=t.replace(tn,"1").split(Yn),f=u.length-1;o<f;o++)i+=u[o]+(~l.indexOf(o)?a.shift()||s+"0,0,0,0)":(c.length?c:a.length?a:n).shift());if(!u)for(u=t.split(tn),f=u.length-1;o<f;o++)i+=u[o]+a[o];return i+u[f]},tn=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Pi)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),Vw=/hsl[a]?\(/,y0=function(t){var r=t.join(" "),n;if(tn.lastIndex=0,tn.test(r))return n=Vw.test(r),t[1]=Th(t[1],n),t[0]=Th(t[0],n,m0(t[1])),!0},Ji,Ve=(function(){var e=Date.now,t=500,r=33,n=e(),i=n,a=1e3/240,s=a,o=[],l,u,c,f,h,p,g=function d(m){var v=e()-i,y=m===!0,x,_,S,w;if((v>t||v<0)&&(n+=v-r),i+=v,S=i-n,x=S-s,(x>0||y)&&(w=++f.frame,h=S-f.time*1e3,f.time=S=S/1e3,s+=x+(x>=a?4:a-x),_=1),y||(l=u(d)),_)for(p=0;p<o.length;p++)o[p](S,h,w,m)};return f={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(m){return h/(1e3/(m||60))},wake:function(){Wm&&(!cc&&Vc()&&(br=cc=window,Zc=br.document||{},er.gsap=He,(br.gsapVersions||(br.gsapVersions=[])).push(He.version),Km(Ya||br.GreenSockGlobals||!br.gsap&&br||{}),p0.forEach(d0)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),u=c||function(m){return setTimeout(m,s-f.time*1e3+1|0)},Ji=1,g(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Ji=0,u=Zi},lagSmoothing:function(m,v){t=m||1/0,r=Math.min(v||33,t)},fps:function(m){a=1e3/(m||240),s=f.time*1e3+a},add:function(m,v,y){var x=v?function(_,S,w,b){m(_,S,w,b),f.remove(x)}:m;return f.remove(m),o[y?"unshift":"push"](x),hi(),x},remove:function(m,v){~(v=o.indexOf(m))&&o.splice(v,1)&&p>=v&&p--},_listeners:o},f})(),hi=function(){return!Ji&&Ve.wake()},vt={},Zw=/^[\d.\-M][\d.\-,\s]/,Qw=/["']/g,Jw=function(t){for(var r={},n=t.substr(1,t.length-3).split(":"),i=n[0],a=1,s=n.length,o,l,u;a<s;a++)l=n[a],o=a!==s-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),r[i]=isNaN(u)?u.replace(Qw,"").trim():+u,i=l.substr(o+1).trim();return r},tS=function(t){var r=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",r);return t.substring(r,~i&&i<n?t.indexOf(")",n+1):n)},eS=function(t){var r=(t+"").split("("),n=vt[r[0]];return n&&r.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[Jw(r[1])]:tS(t).split(",").map(t0)):vt._CE&&Zw.test(t)?vt._CE("",t):n},_0=function(t){return function(r){return 1-t(1-r)}},v0=function e(t,r){for(var n=t._first,i;n;)n instanceof Oe?e(n,r):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==r&&(n.timeline?e(n.timeline,r):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=r)),n=n._next},wn=function(t,r){return t&&(Vt(t)?t:vt[t]||eS(t))||r},En=function(t,r,n,i){n===void 0&&(n=function(l){return 1-r(1-l)}),i===void 0&&(i=function(l){return l<.5?r(l*2)/2:1-r((1-l)*2)/2});var a={easeIn:r,easeOut:n,easeInOut:i},s;return ze(t,function(o){vt[o]=er[o]=a,vt[s=o.toLowerCase()]=n;for(var l in a)vt[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=vt[o+"."+l]=a[l]}),a},x0=function(t){return function(r){return r<.5?(1-t(1-r*2))/2:.5+t((r-.5)*2)/2}},zs=function e(t,r,n){var i=r>=1?r:1,a=(n||(t?.3:.45))/(r<1?r:1),s=a/uc*(Math.asin(1/i)||0),o=function(c){return c===1?1:i*Math.pow(2,-10*c)*Aw((c-s)*a)+1},l=t==="out"?o:t==="in"?function(u){return 1-o(1-u)}:x0(o);return a=uc/a,l.config=function(u,c){return e(t,u,c)},l},Bs=function e(t,r){r===void 0&&(r=1.70158);var n=function(s){return s?--s*s*((r+1)*s+r)+1:0},i=t==="out"?n:t==="in"?function(a){return 1-n(1-a)}:x0(n);return i.config=function(a){return e(t,a)},i};ze("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var r=t<5?t+1:t;En(e+",Power"+(r-1),t?function(n){return Math.pow(n,r)}:function(n){return n},function(n){return 1-Math.pow(1-n,r)},function(n){return n<.5?Math.pow(n*2,r)/2:1-Math.pow((1-n)*2,r)/2})});vt.Linear.easeNone=vt.none=vt.Linear.easeIn;En("Elastic",zs("in"),zs("out"),zs());(function(e,t){var r=1/t,n=2*r,i=2.5*r,a=function(o){return o<r?e*o*o:o<n?e*Math.pow(o-1.5/t,2)+.75:o<i?e*(o-=2.25/t)*o+.9375:e*Math.pow(o-2.625/t,2)+.984375};En("Bounce",function(s){return 1-a(1-s)},a)})(7.5625,2.75);En("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});En("Circ",function(e){return-(Gm(1-e*e)-1)});En("Sine",function(e){return e===1?1:-Mw(e*Sw)+1});En("Back",Bs("in"),Bs("out"),Bs());vt.SteppedEase=vt.steps=er.SteppedEase={config:function(t,r){t===void 0&&(t=1);var n=1/t,i=t+(r?0:1),a=r?1:0,s=1-Ot;return function(o){return((i*sa(0,s,o)|0)+a)*n}}};li.ease=vt["quad.out"];ze("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return tf+=e+","+e+"Params,"});var b0=function(t,r){this.id=Tw++,t._gsap=this,this.target=t,this.harness=r,this.get=r?r.get:Qm,this.set=r?r.getSetter:of},ta=(function(){function e(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,fi(this,+r.duration,1,1),this.data=r.data,Bt&&(this._ctx=Bt,Bt.data.push(this)),Ji||Ve.wake()}var t=e.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,fi(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(hi(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(us(this,n),!a._dp||a.parent||n0(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&wr(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Ot||!this._initted&&this._dur&&n||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Jm(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+bh(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+bh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*a,i):this._repeat?ci(this._tTime,a)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-Ot?0:this._rts;if(this._rts===n)return this;var a=this.parent&&this._ts?Ka(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-Ot?0:this._rts,this.totalTime(sa(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),ls(this),$w(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(hi(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ot&&(this._tTime-=Ot)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=jt(n);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&wr(i,this,this._start-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Ie(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ka(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=Ow);var i=Se;return Se=n,rf(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),Se=i,this},t.globalTime=function(n){for(var i=this,a=arguments.length?n:i.rawTime();i;)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):a},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,wh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,wh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(ar(this,n),Ie(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Ie(i)),this._dur||(this._zTime=-Ot),this},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-Ot:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ot,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,a;return!!(!n||this._ts&&this._initted&&n.isActive()&&(a=n.rawTime(!0))>=i&&a<this.endTime(!0)-Ot)},t.eventCallback=function(n,i,a){var s=this.vars;return arguments.length>1?(i?(s[n]=i,a&&(s[n+"Params"]=a),n==="onUpdate"&&(this._onUpdate=i)):delete s[n],this):s[n]},t.then=function(n){var i=this,a=i._prom;return new Promise(function(s){var o=Vt(n)?n:e0,l=function(){var c=i.then;i.then=null,a&&a(),Vt(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},t.kill=function(){Oi(this)},e})();rr(ta.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ot,_prom:0,_ps:!1,_rts:1});var Oe=(function(e){Hm(t,e);function t(n,i){var a;return n===void 0&&(n={}),a=e.call(this,n)||this,a.labels={},a.smoothChildTiming=!!n.smoothChildTiming,a.autoRemoveChildren=!!n.autoRemoveChildren,a._sort=Ie(n.sortChildren),Yt&&wr(n.parent||Yt,Fr(a),i),n.reversed&&a.reverse(),n.paused&&a.paused(!0),n.scrollTrigger&&i0(Fr(a),n.scrollTrigger),a}var r=t.prototype;return r.to=function(i,a,s){return Li(0,arguments,this),this},r.from=function(i,a,s){return Li(1,arguments,this),this},r.fromTo=function(i,a,s,o){return Li(2,arguments,this),this},r.set=function(i,a,s){return a.duration=0,a.parent=this,$i(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new oe(i,a,ar(this,s),1),this},r.call=function(i,a,s){return wr(this,oe.delayedCall(0,i,a),s)},r.staggerTo=function(i,a,s,o,l,u,c){return s.duration=a,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=c,s.parent=this,new oe(i,s,ar(this,l)),this},r.staggerFrom=function(i,a,s,o,l,u,c){return s.runBackwards=1,$i(s).immediateRender=Ie(s.immediateRender),this.staggerTo(i,a,s,o,l,u,c)},r.staggerFromTo=function(i,a,s,o,l,u,c,f){return o.startAt=s,$i(o).immediateRender=Ie(o.immediateRender),this.staggerTo(i,a,o,l,u,c,f)},r.render=function(i,a,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=i<=0?0:jt(i),f=this._zTime<0!=i<0&&(this._initted||!u),h,p,g,d,m,v,y,x,_,S,w,b;if(this!==Yt&&c>l&&i>=0&&(c=l),c!==this._tTime||s||f){if(o!==this._time&&u&&(c+=this._time-o,i+=this._time-o),h=c,_=this._start,x=this._ts,v=!x,f&&(u||(o=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(w=this._yoyo,m=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,a,s);if(h=jt(c%m),c===l?(d=this._repeat,h=u):(S=jt(c/m),d=~~S,d&&d===S&&(h=u,d--),h>u&&(h=u)),S=ci(this._tTime,m),!o&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),w&&d&1&&(h=u-h,b=1),d!==S&&!this._lock){var T=w&&S&1,M=T===(w&&d&1);if(d<S&&(T=!T),o=T?0:c%u?u:c,this._lock=1,this.render(o||(b?0:jt(d*m)),a,!u)._lock=0,this._tTime=c,!a&&this.parent&&Ze(this,"onRepeat"),this.vars.repeatRefresh&&!b&&(this.invalidate()._lock=1,S=d),o&&o!==this._time||v!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,M&&(this._lock=2,o=T?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!b&&this.invalidate()),this._lock=0,!this._ts&&!v)return this;v0(this,b)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=zw(this,jt(o),jt(h)),y&&(c-=h-(h=y._start))),this._tTime=c,this._time=h,this._act=!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&c&&u&&!a&&!S&&(Ze(this,"onStart"),this._tTime!==c))return this;if(h>=o&&i>=0)for(p=this._first;p;){if(g=p._next,(p._act||h>=p._start)&&p._ts&&y!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(h-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(h-p._start)*p._ts,a,s),h!==this._time||!this._ts&&!v){y=0,g&&(c+=this._zTime=-Ot);break}}p=g}else{p=this._last;for(var C=i<0?i:h;p;){if(g=p._prev,(p._act||C<=p._end)&&p._ts&&y!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(C-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(C-p._start)*p._ts,a,s||Se&&rf(p)),h!==this._time||!this._ts&&!v){y=0,g&&(c+=this._zTime=C?-Ot:Ot);break}}p=g}}if(y&&!a&&(this.pause(),y.render(h>=o?0:-Ot)._zTime=h>=o?1:-1,this._ts))return this._start=_,ls(this),this.render(i,a,s);this._onUpdate&&!a&&Ze(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(_===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&rn(this,1),!a&&!(i<0&&!o)&&(c||o||!l)&&(Ze(this,c===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(i,a){var s=this;if(Hr(a)||(a=ar(this,a,i)),!(i instanceof ta)){if(Ee(i))return i.forEach(function(o){return s.add(o,a)}),this;if(ye(i))return this.addLabel(i,a);if(Vt(i))i=oe.delayedCall(0,i);else return this}return this!==i?wr(this,i,a):this},r.getChildren=function(i,a,s,o){i===void 0&&(i=!0),a===void 0&&(a=!0),s===void 0&&(s=!0),o===void 0&&(o=-or);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof oe?a&&l.push(u):(s&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,a,s)))),u=u._next;return l},r.getById=function(i){for(var a=this.getChildren(1,1,1),s=a.length;s--;)if(a[s].vars.id===i)return a[s]},r.remove=function(i){return ye(i)?this.removeLabel(i):Vt(i)?this.killTweensOf(i):(i.parent===this&&os(this,i),i===this._recent&&(this._recent=this._last),bn(this))},r.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=jt(Ve.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),e.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},r.addLabel=function(i,a){return this.labels[i]=ar(this,a),this},r.removeLabel=function(i){return delete this.labels[i],this},r.addPause=function(i,a,s){var o=oe.delayedCall(0,a||Zi,s);return o.data="isPause",this._hasPause=1,wr(this,o,ar(this,i))},r.removePause=function(i){var a=this._first;for(i=ar(this,i);a;)a._start===i&&a.data==="isPause"&&rn(a),a=a._next},r.killTweensOf=function(i,a,s){for(var o=this.getTweensOf(i,s),l=o.length;l--;)Vr!==o[l]&&o[l].kill(i,a);return this},r.getTweensOf=function(i,a){for(var s=[],o=lr(i),l=this._first,u=Hr(a),c;l;)l instanceof oe?Pw(l._targets,o)&&(u?(!Vr||l._initted&&l._ts)&&l.globalTime(0)<=a&&l.globalTime(l.totalDuration())>a:!a||l.isActive())&&s.push(l):(c=l.getTweensOf(o,a)).length&&s.push.apply(s,c),l=l._next;return s},r.tweenTo=function(i,a){a=a||{};var s=this,o=ar(s,i),l=a,u=l.startAt,c=l.onStart,f=l.onStartParams,h=l.immediateRender,p,g=oe.to(s,rr({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||Ot,onStart:function(){if(s.pause(),!p){var m=a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());g._dur!==m&&fi(g,m,0,1).render(g._time,!0,!0),p=1}c&&c.apply(g,f||[])}},a));return h?g.render(0):g},r.tweenFromTo=function(i,a,s){return this.tweenTo(a,rr({startAt:{time:ar(this,i)}},s))},r.recent=function(){return this._recent},r.nextLabel=function(i){return i===void 0&&(i=this._time),Sh(this,ar(this,i))},r.previousLabel=function(i){return i===void 0&&(i=this._time),Sh(this,ar(this,i),1)},r.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Ot)},r.shiftChildren=function(i,a,s){s===void 0&&(s=0);var o=this._first,l=this.labels,u;for(i=jt(i);o;)o._start>=s&&(o._start+=i,o._end+=i),o=o._next;if(a)for(u in l)l[u]>=s&&(l[u]+=i);return bn(this)},r.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return e.prototype.invalidate.call(this,i)},r.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,s;a;)s=a._next,this.remove(a),a=s;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),bn(this)},r.totalDuration=function(i){var a=0,s=this,o=s._last,l=or,u,c,f;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-i:i));if(s._dirty){for(f=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,wr(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(a-=c,(!f&&!s._dp||f&&f.smoothChildTiming)&&(s._start+=jt(c/s._ts),s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>a&&o._ts&&(a=o._end),o=u;fi(s,s===Yt&&s._time>a?s._time:a,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(i){if(Yt._ts&&(Jm(Yt,Ka(i,Yt)),Zm=Ve.frame),Ve.frame>=vh){vh+=Je.autoSleep||120;var a=Yt._first;if((!a||!a._ts)&&Je.autoSleep&&Ve._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||Ve.sleep()}}},t})(ta);rr(Oe.prototype,{_lock:0,_hasPause:0,_forcing:0});var rS=function(t,r,n,i,a,s,o){var l=new Be(this._pt,t,r,0,1,C0,null,a),u=0,c=0,f,h,p,g,d,m,v,y;for(l.b=n,l.e=i,n+="",i+="",(v=~i.indexOf("random("))&&(i=Qi(i)),s&&(y=[n,i],s(y,t,r),n=y[0],i=y[1]),h=n.match(Ls)||[];f=Ls.exec(i);)g=f[0],d=i.substring(u,f.index),p?p=(p+1)%5:d.substr(-5)==="rgba("&&(p=1),g!==h[c++]&&(m=parseFloat(h[c-1])||0,l._pt={_next:l._pt,p:d||c===1?d:",",s:m,c:g.charAt(1)==="="?Vn(m,g)-m:parseFloat(g)-m,m:p&&p<4?Math.round:0},u=Ls.lastIndex);return l.c=u<i.length?i.substring(u,i.length):"",l.fp=o,(Xm.test(i)||v)&&(l.e=0),this._pt=l,l},nf=function(t,r,n,i,a,s,o,l,u,c){Vt(i)&&(i=i(a||0,t,s));var f=t[r],h=n!=="get"?n:Vt(f)?u?t[r.indexOf("set")||!Vt(t["get"+r.substr(3)])?r:"get"+r.substr(3)](u):t[r]():f,p=Vt(f)?u?oS:M0:sf,g;if(ye(i)&&(~i.indexOf("random(")&&(i=Qi(i)),i.charAt(1)==="="&&(g=Vn(h,i)+(Re(h)||0),(g||g===0)&&(i=g))),!c||h!==i||yc)return!isNaN(h*i)&&i!==""?(g=new Be(this._pt,t,r,+h||0,i-(h||0),typeof f=="boolean"?uS:A0,0,p),u&&(g.fp=u),o&&g.modifier(o,this,t),this._pt=g):(!f&&!(r in t)&&Qc(r,i),rS.call(this,t,r,h,i,p,l||Je.stringFilter,u))},nS=function(t,r,n,i,a){if(Vt(t)&&(t=qi(t,a,r,n,i)),!Mr(t)||t.style&&t.nodeType||Ee(t)||jm(t))return ye(t)?qi(t,a,r,n,i):t;var s={},o;for(o in t)s[o]=qi(t[o],a,r,n,i);return s},w0=function(t,r,n,i,a,s){var o,l,u,c;if(Ke[t]&&(o=new Ke[t]).init(a,o.rawVars?r[t]:nS(r[t],i,a,s,n),n,i,s)!==!1&&(n._pt=l=new Be(n._pt,a,t,0,1,o.render,o,0,o.priority),n!==Xn))for(u=n._ptLookup[n._targets.indexOf(a)],c=o._props.length;c--;)u[o._props[c]]=l;return o},Vr,yc,af=function e(t,r,n){var i=t.vars,a=i.ease,s=i.startAt,o=i.immediateRender,l=i.lazy,u=i.onUpdate,c=i.runBackwards,f=i.yoyoEase,h=i.keyframes,p=i.autoRevert,g=t._dur,d=t._startAt,m=t._targets,v=t.parent,y=v&&v.data==="nested"?v.vars.targets:m,x=t._overwrite==="auto"&&!Wc,_=t.timeline,S,w,b,T,M,C,A,F,E,N,U,P,O;if(_&&(!h||!a)&&(a="none"),t._ease=wn(a,li.ease),t._yEase=f?_0(wn(f===!0?a:f,li.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!_&&!!i.runBackwards,!_||h&&!i.stagger){if(F=m[0]?xn(m[0]).harness:0,P=F&&i[F.prop],S=Wa(i,Jc),d&&(d._zTime<0&&d.progress(1),r<0&&c&&o&&!p?d.render(-1,!0):d.revert(c&&g?Ea:Dw),d._lazy=0),s){if(rn(t._startAt=oe.set(m,rr({data:"isStart",overwrite:!1,parent:v,immediateRender:!0,lazy:!d&&Ie(l),startAt:null,delay:0,onUpdate:u&&function(){return Ze(t,"onUpdate")},stagger:0},s))),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Se||!o&&!p)&&t._startAt.revert(Ea),o&&g&&r<=0&&n<=0){r&&(t._zTime=r);return}}else if(c&&g&&!d){if(r&&(o=!1),b=rr({overwrite:!1,data:"isFromStart",lazy:o&&!d&&Ie(l),immediateRender:o,stagger:0,parent:v},S),P&&(b[F.prop]=P),rn(t._startAt=oe.set(m,b)),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Se?t._startAt.revert(Ea):t._startAt.render(-1,!0)),t._zTime=r,!o)e(t._startAt,Ot,Ot);else if(!r)return}for(t._pt=t._ptCache=0,l=g&&Ie(l)||l&&!g,w=0;w<m.length;w++){if(M=m[w],A=M._gsap||ef(m)[w]._gsap,t._ptLookup[w]=N={},fc[A.id]&&Jr.length&&Xa(),U=y===m?w:y.indexOf(M),F&&(E=new F).init(M,P||S,t,U,y)!==!1&&(t._pt=T=new Be(t._pt,M,E.name,0,1,E.render,E,0,E.priority),E._props.forEach(function(j){N[j]=T}),E.priority&&(C=1)),!F||P)for(b in S)Ke[b]&&(E=w0(b,S,t,U,M,y))?E.priority&&(C=1):N[b]=T=nf.call(t,M,b,"get",S[b],U,y,0,i.stringFilter);t._op&&t._op[w]&&t.kill(M,t._op[w]),x&&t._pt&&(Vr=t,Yt.killTweensOf(M,N,t.globalTime(r)),O=!t.parent,Vr=0),t._pt&&l&&(fc[A.id]=1)}C&&k0(t),t._onInit&&t._onInit(t)}t._onUpdate=u,t._initted=(!t._op||t._pt)&&!O,h&&r<=0&&_.render(or,!0,!0)},iS=function(t,r,n,i,a,s,o,l){var u=(t._pt&&t._ptCache||(t._ptCache={}))[r],c,f,h,p;if(!u)for(u=t._ptCache[r]=[],h=t._ptLookup,p=t._targets.length;p--;){if(c=h[p][r],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==r&&c.fp!==r;)c=c._next;if(!c)return yc=1,t.vars[r]="+=0",af(t,o),yc=0,l?Vi(r+" not eligible for reset"):1;u.push(c)}for(p=u.length;p--;)f=u[p],c=f._pt||f,c.s=(i||i===0)&&!a?i:c.s+(i||0)+s*c.c,c.c=n-c.s,f.e&&(f.e=ne(n)+Re(f.e)),f.b&&(f.b=c.s+Re(f.b))},aS=function(t,r){var n=t[0]?xn(t[0]).harness:0,i=n&&n.aliases,a,s,o,l;if(!i)return r;a=ui({},r);for(s in i)if(s in a)for(l=i[s].split(","),o=l.length;o--;)a[l[o]]=a[s];return a},sS=function(t,r,n,i){var a=r.ease||i||"power1.inOut",s,o;if(Ee(r))o=n[t]||(n[t]=[]),r.forEach(function(l,u){return o.push({t:u/(r.length-1)*100,v:l,e:a})});else for(s in r)o=n[s]||(n[s]=[]),s==="ease"||o.push({t:parseFloat(t),v:r[s],e:a})},qi=function(t,r,n,i,a){return Vt(t)?t.call(r,n,i,a):ye(t)&&~t.indexOf("random(")?Qi(t):t},S0=tf+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",T0={};ze(S0+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return T0[e]=1});var oe=(function(e){Hm(t,e);function t(n,i,a,s){var o;typeof i=="number"&&(a.duration=i,i=a,a=null),o=e.call(this,s?i:$i(i))||this;var l=o.vars,u=l.duration,c=l.delay,f=l.immediateRender,h=l.stagger,p=l.overwrite,g=l.keyframes,d=l.defaults,m=l.scrollTrigger,v=l.yoyoEase,y=i.parent||Yt,x=(Ee(n)||jm(n)?Hr(n[0]):"length"in i)?[n]:lr(n),_,S,w,b,T,M,C,A;if(o._targets=x.length?ef(x):Vi("GSAP target "+n+" not found. https://gsap.com",!Je.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=p,g||h||xa(u)||xa(c)){if(i=o.vars,_=o.timeline=new Oe({data:"nested",defaults:d||{},targets:y&&y.data==="nested"?y.vars.targets:x}),_.kill(),_.parent=_._dp=Fr(o),_._start=0,h||xa(u)||xa(c)){if(b=x.length,C=h&&l0(h),Mr(h))for(T in h)~S0.indexOf(T)&&(A||(A={}),A[T]=h[T]);for(S=0;S<b;S++)w=Wa(i,T0),w.stagger=0,v&&(w.yoyoEase=v),A&&ui(w,A),M=x[S],w.duration=+qi(u,Fr(o),S,M,x),w.delay=(+qi(c,Fr(o),S,M,x)||0)-o._delay,!h&&b===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),_.to(M,w,C?C(S,M,x):0),_._ease=vt.none;_.duration()?u=c=0:o.timeline=0}else if(g){$i(rr(_.vars.defaults,{ease:"none"})),_._ease=wn(g.ease||i.ease||"none");var F=0,E,N,U;if(Ee(g))g.forEach(function(P){return _.to(x,P,">")}),_.duration();else{w={};for(T in g)T==="ease"||T==="easeEach"||sS(T,g[T],w,g.easeEach);for(T in w)for(E=w[T].sort(function(P,O){return P.t-O.t}),F=0,S=0;S<E.length;S++)N=E[S],U={ease:N.e,duration:(N.t-(S?E[S-1].t:0))/100*u},U[T]=N.v,_.to(x,U,F),F+=U.duration;_.duration()<u&&_.to({},{duration:u-_.duration()})}}u||o.duration(u=_.duration())}else o.timeline=0;return p===!0&&!Wc&&(Vr=Fr(o),Yt.killTweensOf(x),Vr=0),wr(y,Fr(o),a),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(f||!u&&!g&&o._start===jt(y._time)&&Ie(f)&&Lw(Fr(o))&&y.data!=="nested")&&(o._tTime=-Ot,o.render(Math.max(0,-c)||0)),m&&i0(Fr(o),m),o}var r=t.prototype;return r.render=function(i,a,s){var o=this._time,l=this._tDur,u=this._dur,c=i<0,f=i>l-Ot&&!c?l:i<Ot?0:i,h,p,g,d,m,v,y,x,_;if(!u)Iw(this,i,a,s);else if(f!==this._tTime||!i||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(h=f,x=this.timeline,this._repeat){if(d=u+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+i,a,s);if(h=jt(f%d),f===l?(g=this._repeat,h=u):(m=jt(f/d),g=~~m,g&&g===m?(h=u,g--):h>u&&(h=u)),v=this._yoyo&&g&1,v&&(_=this._yEase,h=u-h),m=ci(this._tTime,d),h===o&&!s&&this._initted&&g===m)return this._tTime=f,this;g!==m&&(x&&this._yEase&&v0(x,v),this.vars.repeatRefresh&&!v&&!this._lock&&h!==d&&this._initted&&(this._lock=s=1,this.render(jt(d*g),!0).invalidate()._lock=0))}if(!this._initted){if(a0(this,c?i:h,s,a,f))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==m))return this;if(u!==this._dur)return this.render(i,a,s)}if(this._tTime=f,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(_||this._ease)(h/u),this._from&&(this.ratio=y=1-y),!o&&f&&!a&&!m&&(Ze(this,"onStart"),this._tTime!==f))return this;for(p=this._pt;p;)p.r(y,p.d),p=p._next;x&&x.render(i<0?i:x._dur*x._ease(h/this._dur),a,s)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(c&&hc(this,i,a,s),Ze(this,"onUpdate")),this._repeat&&g!==m&&this.vars.onRepeat&&!a&&this.parent&&Ze(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&hc(this,i,!0,!0),(i||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&rn(this,1),!a&&!(c&&!o)&&(f||o||v)&&(Ze(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),e.prototype.invalidate.call(this,i)},r.resetTo=function(i,a,s,o,l){Ji||Ve.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||af(this,u),c=this._ease(u/this._dur),iS(this,i,a,s,o,c,u,l)?this.resetTo(i,a,s,o,1):(us(this,0),this.parent||r0(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(i,a){if(a===void 0&&(a="all"),!i&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?Oi(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Se),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,Vr&&Vr.vars.overwrite!==!0)._first||Oi(this),this.parent&&s!==this.timeline.totalDuration()&&fi(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=i?lr(i):o,u=this._ptLookup,c=this._pt,f,h,p,g,d,m,v;if((!a||a==="all")&&Nw(o,l))return a==="all"&&(this._pt=0),Oi(this);for(f=this._op=this._op||[],a!=="all"&&(ye(a)&&(d={},ze(a,function(y){return d[y]=1}),a=d),a=aS(o,a)),v=o.length;v--;)if(~l.indexOf(o[v])){h=u[v],a==="all"?(f[v]=a,g=h,p={}):(p=f[v]=f[v]||{},g=a);for(d in g)m=h&&h[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&os(this,m,"_pt"),delete h[d]),p!=="all"&&(p[d]=1)}return this._initted&&!this._pt&&c&&Oi(this),this},t.to=function(i,a){return new t(i,a,arguments[2])},t.from=function(i,a){return Li(1,arguments)},t.delayedCall=function(i,a,s,o){return new t(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},t.fromTo=function(i,a,s){return Li(2,arguments)},t.set=function(i,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new t(i,a)},t.killTweensOf=function(i,a,s){return Yt.killTweensOf(i,a,s)},t})(ta);rr(oe.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ze("staggerTo,staggerFrom,staggerFromTo",function(e){oe[e]=function(){var t=new Oe,r=dc.call(arguments,0);return r.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,r)}});var sf=function(t,r,n){return t[r]=n},M0=function(t,r,n){return t[r](n)},oS=function(t,r,n,i){return t[r](i.fp,n)},lS=function(t,r,n){return t.setAttribute(r,n)},of=function(t,r){return Vt(t[r])?M0:Kc(t[r])&&t.setAttribute?lS:sf},A0=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e6)/1e6,r)},uS=function(t,r){return r.set(r.t,r.p,!!(r.s+r.c*t),r)},C0=function(t,r){var n=r._pt,i="";if(!t&&r.b)i=r.b;else if(t===1&&r.e)i=r.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=r.c}r.set(r.t,r.p,i,r)},lf=function(t,r){for(var n=r._pt;n;)n.r(t,n.d),n=n._next},cS=function(t,r,n,i){for(var a=this._pt,s;a;)s=a._next,a.p===i&&a.modifier(t,r,n),a=s},fS=function(t){for(var r=this._pt,n,i;r;)i=r._next,r.p===t&&!r.op||r.op===t?os(this,r,"_pt"):r.dep||(n=1),r=i;return!n},hS=function(t,r,n,i){i.mSet(t,r,i.m.call(i.tween,n,i.mt),i)},k0=function(t){for(var r=t._pt,n,i,a,s;r;){for(n=r._next,i=a;i&&i.pr>r.pr;)i=i._next;(r._prev=i?i._prev:s)?r._prev._next=r:a=r,(r._next=i)?i._prev=r:s=r,r=n}t._pt=a},Be=(function(){function e(r,n,i,a,s,o,l,u,c){this.t=n,this.s=a,this.c=s,this.p=i,this.r=o||A0,this.d=l||this,this.set=u||sf,this.pr=c||0,this._next=r,r&&(r._prev=this)}var t=e.prototype;return t.modifier=function(n,i,a){this.mSet=this.mSet||this.set,this.set=hS,this.m=n,this.mt=a,this.tween=i},e})();ze(tf+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(e){return Jc[e]=1});er.TweenMax=er.TweenLite=oe;er.TimelineLite=er.TimelineMax=Oe;Yt=new Oe({sortChildren:!1,defaults:li,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Je.stringFilter=y0;var Sn=[],Oa={},pS=[],Mh=0,dS=0,Us=function(t){return(Oa[t]||pS).map(function(r){return r()})},_c=function(){var t=Date.now(),r=[];t-Mh>2&&(Us("matchMediaInit"),Sn.forEach(function(n){var i=n.queries,a=n.conditions,s,o,l,u;for(o in i)s=br.matchMedia(i[o]).matches,s&&(l=1),s!==a[o]&&(a[o]=s,u=1);u&&(n.revert(),l&&r.push(n))}),Us("matchMediaRevert"),r.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Mh=t,Us("matchMedia"))},R0=(function(){function e(r,n){this.selector=n&&gc(n),this.data=[],this._r=[],this.isReverted=!1,this.id=dS++,r&&this.add(r)}var t=e.prototype;return t.add=function(n,i,a){Vt(n)&&(a=i,i=n,n=Vt);var s=this,o=function(){var u=Bt,c=s.selector,f;return u&&u!==s&&u.data.push(s),a&&(s.selector=gc(a)),Bt=s,f=i.apply(s,arguments),Vt(f)&&s._r.push(f),Bt=u,s.selector=c,s.isReverted=!1,f};return s.last=o,n===Vt?o(s,function(l){return s.add(null,l)}):n?s[n]=o:o},t.ignore=function(n){var i=Bt;Bt=null,n(this),Bt=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof e?n.push.apply(n,i.getTweens()):i instanceof oe&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var a=this;if(n?(function(){for(var o=a.getTweens(),l=a.data.length,u;l--;)u=a.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(n)}),l=a.data.length;l--;)u=a.data[l],u instanceof Oe?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof oe)&&u.revert&&u.revert(n);a._r.forEach(function(c){return c(n,a)}),a.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var s=Sn.length;s--;)Sn[s].id===this.id&&Sn.splice(s,1)},t.revert=function(n){this.kill(n||{})},e})(),gS=(function(){function e(r){this.contexts=[],this.scope=r,Bt&&Bt.data.push(this)}var t=e.prototype;return t.add=function(n,i,a){Mr(n)||(n={matches:n});var s=new R0(0,a||this.scope),o=s.conditions={},l,u,c;Bt&&!s.selector&&(s.selector=Bt.selector),this.contexts.push(s),i=s.add("onMatch",i),s.queries=n;for(u in n)u==="all"?c=1:(l=br.matchMedia(n[u]),l&&(Sn.indexOf(s)<0&&Sn.push(s),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(_c):l.addEventListener("change",_c)));return c&&i(s,function(f){return s.add(null,f)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},e})(),Va={registerPlugin:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach(function(i){return d0(i)})},timeline:function(t){return new Oe(t)},getTweensOf:function(t,r){return Yt.getTweensOf(t,r)},getProperty:function(t,r,n,i){ye(t)&&(t=lr(t)[0]);var a=xn(t||{}).get,s=n?e0:t0;return n==="native"&&(n=""),t&&(r?s((Ke[r]&&Ke[r].get||a)(t,r,n,i)):function(o,l,u){return s((Ke[o]&&Ke[o].get||a)(t,o,l,u))})},quickSetter:function(t,r,n){if(t=lr(t),t.length>1){var i=t.map(function(c){return He.quickSetter(c,r,n)}),a=i.length;return function(c){for(var f=a;f--;)i[f](c)}}t=t[0]||{};var s=Ke[r],o=xn(t),l=o.harness&&(o.harness.aliases||{})[r]||r,u=s?function(c){var f=new s;Xn._pt=0,f.init(t,n?c+n:c,Xn,0,[t]),f.render(1,f),Xn._pt&&lf(1,Xn)}:o.set(t,l);return s?u:function(c){return u(t,l,n?c+n:c,o,1)}},quickTo:function(t,r,n){var i,a=He.to(t,rr((i={},i[r]="+=0.1",i.paused=!0,i.stagger=0,i),n||{})),s=function(l,u,c){return a.resetTo(r,l,u,c)};return s.tween=a,s},isTweening:function(t){return Yt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=wn(t.ease,li.ease)),xh(li,t||{})},config:function(t){return xh(Je,t||{})},registerEffect:function(t){var r=t.name,n=t.effect,i=t.plugins,a=t.defaults,s=t.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Ke[o]&&!er[o]&&Vi(r+" effect requires "+o+" plugin.")}),qs[r]=function(o,l,u){return n(lr(o),rr(l||{},a),u)},s&&(Oe.prototype[r]=function(o,l,u){return this.add(qs[r](o,Mr(l)?l:(u=l)&&{},this),u)})},registerEase:function(t,r){vt[t]=wn(r)},parseEase:function(t,r){return arguments.length?wn(t,r):vt},getById:function(t){return Yt.getById(t)},exportRoot:function(t,r){t===void 0&&(t={});var n=new Oe(t),i,a;for(n.smoothChildTiming=Ie(t.smoothChildTiming),Yt.remove(n),n._dp=0,n._time=n._tTime=Yt._time,i=Yt._first;i;)a=i._next,(r||!(!i._dur&&i instanceof oe&&i.vars.onComplete===i._targets[0]))&&wr(n,i,i._start-i._delay),i=a;return wr(Yt,n,0),n},context:function(t,r){return t?new R0(t,r):Bt},matchMedia:function(t){return new gS(t)},matchMediaRefresh:function(){return Sn.forEach(function(t){var r=t.conditions,n,i;for(i in r)r[i]&&(r[i]=!1,n=1);n&&t.revert()})||_c()},addEventListener:function(t,r){var n=Oa[t]||(Oa[t]=[]);~n.indexOf(r)||n.push(r)},removeEventListener:function(t,r){var n=Oa[t],i=n&&n.indexOf(r);i>=0&&n.splice(i,1)},utils:{wrap:Xw,wrapYoyo:Ww,distribute:l0,random:c0,snap:u0,normalize:Yw,getUnit:Re,clamp:Uw,splitColor:g0,toArray:lr,selector:gc,mapRange:h0,pipe:Gw,unitize:jw,interpolate:Kw,shuffle:o0},install:Km,effects:qs,ticker:Ve,updateRoot:Oe.updateRoot,plugins:Ke,globalTimeline:Yt,core:{PropTween:Be,globals:Vm,Tween:oe,Timeline:Oe,Animation:ta,getCache:xn,_removeLinkedListItem:os,reverting:function(){return Se},context:function(t){return t&&Bt&&(Bt.data.push(t),t._ctx=Bt),Bt},suppressOverwrites:function(t){return Wc=t}}};ze("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return Va[e]=oe[e]});Ve.add(Oe.updateRoot);Xn=Va.to({},{duration:0});var mS=function(t,r){for(var n=t._pt;n&&n.p!==r&&n.op!==r&&n.fp!==r;)n=n._next;return n},yS=function(t,r){var n=t._targets,i,a,s;for(i in r)for(a=n.length;a--;)s=t._ptLookup[a][i],s&&(s=s.d)&&(s._pt&&(s=mS(s,i)),s&&s.modifier&&s.modifier(r[i],t,n[a],i))},Hs=function(t,r){return{name:t,headless:1,rawVars:1,init:function(i,a,s){s._onInit=function(o){var l,u;if(ye(a)&&(l={},ze(a,function(c){return l[c]=1}),a=l),r){l={};for(u in a)l[u]=r(a[u]);a=l}yS(o,a)}}}},He=Va.registerPlugin({name:"attr",init:function(t,r,n,i,a){var s,o,l;this.tween=n;for(s in r)l=t.getAttribute(s)||"",o=this.add(t,"setAttribute",(l||0)+"",r[s],i,a,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(t,r){for(var n=r._pt;n;)Se?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",headless:1,init:function(t,r){for(var n=r.length;n--;)this.add(t,n,t[n]||0,r[n],0,0,0,0,0,1)}},Hs("roundProps",mc),Hs("modifiers"),Hs("snap",u0))||Va;oe.version=Oe.version=He.version="3.14.2";Wm=1;Vc()&&hi();vt.Power0;vt.Power1;vt.Power2;vt.Power3;vt.Power4;vt.Linear;vt.Quad;vt.Cubic;vt.Quart;vt.Quint;vt.Strong;vt.Elastic;vt.Back;vt.SteppedEase;vt.Bounce;vt.Sine;vt.Expo;vt.Circ;/*!
|
|
8
|
+
*/var Je={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},la={duration:.5,overwrite:!1,delay:0},Wc,Se,Gt,or=1e8,Lt=1/or,uc=Math.PI*2,Sw=uc/4,Tw=0,Gm=Math.sqrt,Mw=Math.cos,Aw=Math.sin,ye=function(t){return typeof t=="string"},Qt=function(t){return typeof t=="function"},Gr=function(t){return typeof t=="number"},Kc=function(t){return typeof t>"u"},Ar=function(t){return typeof t=="object"},Ie=function(t){return t!==!1},Vc=function(){return typeof window<"u"},vi=function(t){return Qt(t)||ye(t)},jm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ee=Array.isArray,Cw=/random\([^)]+\)/g,kw=/,\s*/g,_h=/(?:-?\.?\d|\.)+/gi,Ym=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Yn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ls=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Xm=/[+-]=-?[.\d]+/,Rw=/[^,'"\[\]\s]+/gi,Ew=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Wt,br,cc,Zc,er={},Yi={},Wm,Km=function(t){return(Yi=ua(t,er))&&He},Qc=function(t,r){return console.warn("Invalid property",t,"set to",r,"Missing plugin? gsap.registerPlugin()")},Va=function(t,r){return!r&&console.warn(t)},Vm=function(t,r){return t&&(er[t]=r)&&Yi&&(Yi[t]=r)||er},Za=function(){return 0},Dw={suppressEvents:!0,isStart:!0,kill:!1},Ei={suppressEvents:!0,kill:!1},Ow={suppressEvents:!0},Jc={},tn=[],fc={},Zm,Ke={},qs={},xh=30,Di=[],tf="",ef=function(t){var r=t[0],n,a;if(Ar(r)||Qt(r)||(t=[t]),!(n=(r._gsap||{}).harness)){for(a=Di.length;a--&&!Di[a].targetTest(r););n=Di[a]}for(a=t.length;a--;)t[a]&&(t[a]._gsap||(t[a]._gsap=new b0(t[a],n)))||t.splice(a,1);return t},vn=function(t){return t._gsap||ef(lr(t))[0]._gsap},Qm=function(t,r,n){return(n=t[r])&&Qt(n)?t[r]():Kc(n)&&t.getAttribute&&t.getAttribute(r)||n},ze=function(t,r){return(t=t.split(",")).forEach(r)||t},ae=function(t){return Math.round(t*1e5)/1e5||0},Xt=function(t){return Math.round(t*1e7)/1e7||0},Vn=function(t,r){var n=r.charAt(0),a=parseFloat(r.substr(2));return t=parseFloat(t),n==="+"?t+a:n==="-"?t-a:n==="*"?t*a:t/a},Pw=function(t,r){for(var n=r.length,a=0;t.indexOf(r[a])<0&&++a<n;);return a<n},Xi=function(){var t=tn.length,r=tn.slice(0),n,a;for(fc={},tn.length=0,n=0;n<t;n++)a=r[n],a&&a._lazy&&(a.render(a._lazy[0],a._lazy[1],!0)._lazy=0)},rf=function(t){return!!(t._initted||t._startAt||t.add)},Jm=function(t,r,n,a){tn.length&&!Se&&Xi(),t.render(r,n,!!(Se&&r<0&&rf(t))),tn.length&&!Se&&Xi()},t0=function(t){var r=parseFloat(t);return(r||r===0)&&(t+"").match(Rw).length<2?r:ye(t)?t.trim():t},e0=function(t){return t},rr=function(t,r){for(var n in r)n in t||(t[n]=r[n]);return t},Fw=function(t){return function(r,n){for(var a in n)a in r||a==="duration"&&t||a==="ease"||(r[a]=n[a])}},ua=function(t,r){for(var n in r)t[n]=r[n];return t},vh=function e(t,r){for(var n in r)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=Ar(r[n])?e(t[n]||(t[n]={}),r[n]):r[n]);return t},Wi=function(t,r){var n={},a;for(a in t)a in r||(n[a]=t[a]);return n},$a=function(t){var r=t.parent||Wt,n=t.keyframes?Fw(Ee(t.keyframes)):rr;if(Ie(t.inherit))for(;r;)n(t,r.vars.defaults),r=r.parent||r._dp;return t},Nw=function(t,r){for(var n=t.length,a=n===r.length;a&&n--&&t[n]===r[n];);return n<0},r0=function(t,r,n,a,i){var s=t[a],o;if(i)for(o=r[i];s&&s[i]>o;)s=s._prev;return s?(r._next=s._next,s._next=r):(r._next=t[n],t[n]=r),r._next?r._next._prev=r:t[a]=r,r._prev=s,r.parent=r._dp=t,r},os=function(t,r,n,a){n===void 0&&(n="_first"),a===void 0&&(a="_last");var i=r._prev,s=r._next;i?i._next=s:t[n]===r&&(t[n]=s),s?s._prev=i:t[a]===r&&(t[a]=i),r._next=r._prev=r.parent=null},rn=function(t,r){t.parent&&(!r||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},bn=function(t,r){if(t&&(!r||r._end>t._dur||r._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},$w=function(t){for(var r=t.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return t},hc=function(t,r,n,a){return t._startAt&&(Se?t._startAt.revert(Ei):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(r,!0,a))},Lw=function e(t){return!t||t._ts&&e(t.parent)},bh=function(t){return t._repeat?ca(t._tTime,t=t.duration()+t._rDelay)*t:0},ca=function(t,r){var n=Math.floor(t=Xt(t/r));return t&&n===t?n-1:n},Ki=function(t,r){return(t-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},ls=function(t){return t._end=Xt(t._start+(t._tDur/Math.abs(t._ts||t._rts||Lt)||0))},us=function(t,r){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Xt(n._time-(t._ts>0?r/t._ts:((t._dirty?t.totalDuration():t._tDur)-r)/-t._ts)),ls(t),n._dirty||bn(n,t)),t},n0=function(t,r){var n;if((r._time||!r._dur&&r._initted||r._start<t._time&&(r._dur||!r.add))&&(n=Ki(t.rawTime(),r),(!r._dur||si(0,r.totalDuration(),n)-r._tTime>Lt)&&r.render(n,!0)),bn(t,r)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-Lt}},wr=function(t,r,n,a){return r.parent&&rn(r),r._start=Xt((Gr(n)?n:n||t!==Wt?ir(t,n,r):t._time)+r._delay),r._end=Xt(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),r0(t,r,"_first","_last",t._sort?"_start":0),pc(r)||(t._recent=r),a||n0(t,r),t._ts<0&&us(t,t._tTime),t},a0=function(t,r){return(er.ScrollTrigger||Qc("scrollTrigger",r))&&er.ScrollTrigger.create(r,t)},i0=function(t,r,n,a,i){if(af(t,r,i),!t._initted)return 1;if(!n&&t._pt&&!Se&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Zm!==Ve.frame)return tn.push(t),t._lazy=[i,a],1},qw=function e(t){var r=t.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||e(r))},pc=function(t){var r=t.data;return r==="isFromStart"||r==="isStart"},Iw=function(t,r,n,a){var i=t.ratio,s=r<0||!r&&(!t._start&&qw(t)&&!(!t._initted&&pc(t))||(t._ts<0||t._dp._ts<0)&&!pc(t))?0:1,o=t._rDelay,l=0,u,c,f;if(o&&t._repeat&&(l=si(0,t._tDur,r),c=ca(l,o),t._yoyo&&c&1&&(s=1-s),c!==ca(t._tTime,o)&&(i=1-s,t.vars.repeatRefresh&&t._initted&&t.invalidate())),s!==i||Se||a||t._zTime===Lt||!r&&t._zTime){if(!t._initted&&i0(t,r,a,n,l))return;for(f=t._zTime,t._zTime=r||(n?Lt:0),n||(n=r&&!f),t.ratio=s,t._from&&(s=1-s),t._time=0,t._tTime=l,u=t._pt;u;)u.r(s,u.d),u=u._next;r<0&&hc(t,r,n,!0),t._onUpdate&&!n&&Ze(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&Ze(t,"onRepeat"),(r>=t._tDur||r<0)&&t.ratio===s&&(s&&rn(t,1),!n&&!Se&&(Ze(t,s?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=r)},zw=function(t,r,n){var a;if(n>r)for(a=t._first;a&&a._start<=n;){if(a.data==="isPause"&&a._start>r)return a;a=a._next}else for(a=t._last;a&&a._start>=n;){if(a.data==="isPause"&&a._start<r)return a;a=a._prev}},fa=function(t,r,n,a){var i=t._repeat,s=Xt(r)||0,o=t._tTime/t._tDur;return o&&!a&&(t._time*=s/t._dur),t._dur=s,t._tDur=i?i<0?1e10:Xt(s*(i+1)+t._rDelay*i):s,o>0&&!a&&us(t,t._tTime=t._tDur*o),t.parent&&ls(t),n||bn(t.parent,t),t},wh=function(t){return t instanceof Oe?bn(t):fa(t,t._dur)},Bw={_start:0,endTime:Za,totalDuration:Za},ir=function e(t,r,n){var a=t.labels,i=t._recent||Bw,s=t.duration()>=or?i.endTime(!1):t._dur,o,l,u;return ye(r)&&(isNaN(r)||r in a)?(l=r.charAt(0),u=r.substr(-1)==="%",o=r.indexOf("="),l==="<"||l===">"?(o>=0&&(r=r.replace(/=/,"")),(l==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(r.substr(1))||0)*(u?(o<0?i:n).totalDuration()/100:1)):o<0?(r in a||(a[r]=s),a[r]):(l=parseFloat(r.charAt(o-1)+r.substr(o+1)),u&&n&&(l=l/100*(Ee(n)?n[0]:n).totalDuration()),o>1?e(t,r.substr(0,o-1),n)+l:s+l)):r==null?s:+r},La=function(t,r,n){var a=Gr(r[1]),i=(a?2:1)+(t<2?0:1),s=r[i],o,l;if(a&&(s.duration=r[1]),s.parent=n,t){for(o=s,l=n;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Ie(l.vars.inherit)&&l.parent;s.immediateRender=Ie(o.immediateRender),t<2?s.runBackwards=1:s.startAt=r[i-1]}return new le(r[0],s,r[i+1])},sn=function(t,r){return t||t===0?r(t):r},si=function(t,r,n){return n<t?t:n>r?r:n},Re=function(t,r){return!ye(t)||!(r=Ew.exec(t))?"":r[1]},Uw=function(t,r,n){return sn(n,function(a){return si(t,r,a)})},dc=[].slice,s0=function(t,r){return t&&Ar(t)&&"length"in t&&(!r&&!t.length||t.length-1 in t&&Ar(t[0]))&&!t.nodeType&&t!==br},Hw=function(t,r,n){return n===void 0&&(n=[]),t.forEach(function(a){var i;return ye(a)&&!r||s0(a,1)?(i=n).push.apply(i,lr(a)):n.push(a)})||n},lr=function(t,r,n){return Gt&&!r&&Gt.selector?Gt.selector(t):ye(t)&&!n&&(cc||!ha())?dc.call((r||Zc).querySelectorAll(t),0):Ee(t)?Hw(t,n):s0(t)?dc.call(t,0):t?[t]:[]},gc=function(t){return t=lr(t)[0]||Va("Invalid scope")||{},function(r){var n=t.current||t.nativeElement||t;return lr(r,n.querySelectorAll?n:n===t?Va("Invalid scope")||Zc.createElement("div"):t)}},o0=function(t){return t.sort(function(){return .5-Math.random()})},l0=function(t){if(Qt(t))return t;var r=Ar(t)?t:{each:t},n=wn(r.ease),a=r.from||0,i=parseFloat(r.base)||0,s={},o=a>0&&a<1,l=isNaN(a)||o,u=r.axis,c=a,f=a;return ye(a)?c=f={center:.5,edges:.5,end:1}[a]||0:!o&&l&&(c=a[0],f=a[1]),function(h,p,g){var d=(g||r).length,m=s[d],x,y,v,_,S,w,b,T,M;if(!m){if(M=r.grid==="auto"?0:(r.grid||[1,or])[1],!M){for(b=-or;b<(b=g[M++].getBoundingClientRect().left)&&M<d;);M<d&&M--}for(m=s[d]=[],x=l?Math.min(M,d)*c-.5:a%M,y=M===or?0:l?d*f/M-.5:a/M|0,b=0,T=or,w=0;w<d;w++)v=w%M-x,_=y-(w/M|0),m[w]=S=u?Math.abs(u==="y"?_:v):Gm(v*v+_*_),S>b&&(b=S),S<T&&(T=S);a==="random"&&o0(m),m.max=b-T,m.min=T,m.v=d=(parseFloat(r.amount)||parseFloat(r.each)*(M>d?d-1:u?u==="y"?d/M:M:Math.max(M,d/M))||0)*(a==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Re(r.amount||r.each)||0,n=n&&d<0?_0(n):n}return d=(m[h]-m.min)/m.max||0,Xt(m.b+(n?n(d):d)*m.v)+m.u}},mc=function(t){var r=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var a=Xt(Math.round(parseFloat(n)/t)*t*r);return(a-a%1)/r+(Gr(n)?0:Re(n))}},u0=function(t,r){var n=Ee(t),a,i;return!n&&Ar(t)&&(a=n=t.radius||or,t.values?(t=lr(t.values),(i=!Gr(t[0]))&&(a*=a)):t=mc(t.increment)),sn(r,n?Qt(t)?function(s){return i=t(s),Math.abs(i-s)<=a?i:s}:function(s){for(var o=parseFloat(i?s.x:s),l=parseFloat(i?s.y:0),u=or,c=0,f=t.length,h,p;f--;)i?(h=t[f].x-o,p=t[f].y-l,h=h*h+p*p):h=Math.abs(t[f]-o),h<u&&(u=h,c=f);return c=!a||u<=a?t[c]:s,i||c===s||Gr(s)?c:c+Re(s)}:mc(t))},c0=function(t,r,n,a){return sn(Ee(t)?!r:n===!0?!!(n=0):!a,function(){return Ee(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(a=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(r-t+n*.99))/n)*n*a)/a})},Gw=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(a){return r.reduce(function(i,s){return s(i)},a)}},jw=function(t,r){return function(n){return t(parseFloat(n))+(r||Re(n))}},Yw=function(t,r,n){return h0(t,r,0,1,n)},f0=function(t,r,n){return sn(n,function(a){return t[~~r(a)]})},Xw=function e(t,r,n){var a=r-t;return Ee(t)?f0(t,e(0,t.length),r):sn(n,function(i){return(a+(i-t)%a)%a+t})},Ww=function e(t,r,n){var a=r-t,i=a*2;return Ee(t)?f0(t,e(0,t.length-1),r):sn(n,function(s){return s=(i+(s-t)%i)%i||0,t+(s>a?i-s:s)})},Qa=function(t){return t.replace(Cw,function(r){var n=r.indexOf("[")+1,a=r.substring(n||7,n?r.indexOf("]"):r.length-1).split(kw);return c0(n?a:+a[0],n?0:+a[1],+a[2]||1e-5)})},h0=function(t,r,n,a,i){var s=r-t,o=a-n;return sn(i,function(l){return n+((l-t)/s*o||0)})},Kw=function e(t,r,n,a){var i=isNaN(t+r)?0:function(p){return(1-p)*t+p*r};if(!i){var s=ye(t),o={},l,u,c,f,h;if(n===!0&&(a=1)&&(n=null),s)t={p:t},r={p:r};else if(Ee(t)&&!Ee(r)){for(c=[],f=t.length,h=f-2,u=1;u<f;u++)c.push(e(t[u-1],t[u]));f--,i=function(g){g*=f;var d=Math.min(h,~~g);return c[d](g-d)},n=r}else a||(t=ua(Ee(t)?[]:{},t));if(!c){for(l in r)nf.call(o,t,l,"get",r[l]);i=function(g){return lf(g,o)||(s?t.p:t)}}}return sn(n,i)},Sh=function(t,r,n){var a=t.labels,i=or,s,o,l;for(s in a)o=a[s]-r,o<0==!!n&&o&&i>(o=Math.abs(o))&&(l=s,i=o);return l},Ze=function(t,r,n){var a=t.vars,i=a[r],s=Gt,o=t._ctx,l,u,c;if(i)return l=a[r+"Params"],u=a.callbackScope||t,n&&tn.length&&Xi(),o&&(Gt=o),c=l?i.apply(u,l):i.call(u),Gt=s,c},Oa=function(t){return rn(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Se),t.progress()<1&&Ze(t,"onInterrupt"),t},Xn,p0=[],d0=function(t){if(t)if(t=!t.name&&t.default||t,Vc()||t.headless){var r=t.name,n=Qt(t),a=r&&!n&&t.init?function(){this._props=[]}:t,i={init:Za,render:lf,add:nf,kill:fS,modifier:cS,rawVars:0},s={targetTest:0,get:0,getSetter:of,aliases:{},register:0};if(ha(),t!==a){if(Ke[r])return;rr(a,rr(Wi(t,i),s)),ua(a.prototype,ua(i,Wi(t,s))),Ke[a.prop=r]=a,t.targetTest&&(Di.push(a),Jc[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}Vm(r,a),t.register&&t.register(He,a,Be)}else p0.push(t)},$t=255,Pa={aqua:[0,$t,$t],lime:[0,$t,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,$t],navy:[0,0,128],white:[$t,$t,$t],olive:[128,128,0],yellow:[$t,$t,0],orange:[$t,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[$t,0,0],pink:[$t,192,203],cyan:[0,$t,$t],transparent:[$t,$t,$t,0]},Is=function(t,r,n){return t+=t<0?1:t>1?-1:0,(t*6<1?r+(n-r)*t*6:t<.5?n:t*3<2?r+(n-r)*(2/3-t)*6:r)*$t+.5|0},g0=function(t,r,n){var a=t?Gr(t)?[t>>16,t>>8&$t,t&$t]:0:Pa.black,i,s,o,l,u,c,f,h,p,g;if(!a){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Pa[t])a=Pa[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),s=t.charAt(2),o=t.charAt(3),t="#"+i+i+s+s+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return a=parseInt(t.substr(1,6),16),[a>>16,a>>8&$t,a&$t,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),a=[t>>16,t>>8&$t,t&$t]}else if(t.substr(0,3)==="hsl"){if(a=g=t.match(_h),!r)l=+a[0]%360/360,u=+a[1]/100,c=+a[2]/100,s=c<=.5?c*(u+1):c+u-c*u,i=c*2-s,a.length>3&&(a[3]*=1),a[0]=Is(l+1/3,i,s),a[1]=Is(l,i,s),a[2]=Is(l-1/3,i,s);else if(~t.indexOf("="))return a=t.match(Ym),n&&a.length<4&&(a[3]=1),a}else a=t.match(_h)||Pa.transparent;a=a.map(Number)}return r&&!g&&(i=a[0]/$t,s=a[1]/$t,o=a[2]/$t,f=Math.max(i,s,o),h=Math.min(i,s,o),c=(f+h)/2,f===h?l=u=0:(p=f-h,u=c>.5?p/(2-f-h):p/(f+h),l=f===i?(s-o)/p+(s<o?6:0):f===s?(o-i)/p+2:(i-s)/p+4,l*=60),a[0]=~~(l+.5),a[1]=~~(u*100+.5),a[2]=~~(c*100+.5)),n&&a.length<4&&(a[3]=1),a},m0=function(t){var r=[],n=[],a=-1;return t.split(en).forEach(function(i){var s=i.match(Yn)||[];r.push.apply(r,s),n.push(a+=s.length+1)}),r.c=n,r},Th=function(t,r,n){var a="",i=(t+a).match(en),s=r?"hsla(":"rgba(",o=0,l,u,c,f;if(!i)return t;if(i=i.map(function(h){return(h=g0(h,r,1))&&s+(r?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),n&&(c=m0(t),l=n.c,l.join(a)!==c.c.join(a)))for(u=t.replace(en,"1").split(Yn),f=u.length-1;o<f;o++)a+=u[o]+(~l.indexOf(o)?i.shift()||s+"0,0,0,0)":(c.length?c:i.length?i:n).shift());if(!u)for(u=t.split(en),f=u.length-1;o<f;o++)a+=u[o]+i[o];return a+u[f]},en=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Pa)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),Vw=/hsl[a]?\(/,y0=function(t){var r=t.join(" "),n;if(en.lastIndex=0,en.test(r))return n=Vw.test(r),t[1]=Th(t[1],n),t[0]=Th(t[0],n,m0(t[1])),!0},Ja,Ve=(function(){var e=Date.now,t=500,r=33,n=e(),a=n,i=1e3/240,s=i,o=[],l,u,c,f,h,p,g=function d(m){var x=e()-a,y=m===!0,v,_,S,w;if((x>t||x<0)&&(n+=x-r),a+=x,S=a-n,v=S-s,(v>0||y)&&(w=++f.frame,h=S-f.time*1e3,f.time=S=S/1e3,s+=v+(v>=i?4:i-v),_=1),y||(l=u(d)),_)for(p=0;p<o.length;p++)o[p](S,h,w,m)};return f={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(m){return h/(1e3/(m||60))},wake:function(){Wm&&(!cc&&Vc()&&(br=cc=window,Zc=br.document||{},er.gsap=He,(br.gsapVersions||(br.gsapVersions=[])).push(He.version),Km(Yi||br.GreenSockGlobals||!br.gsap&&br||{}),p0.forEach(d0)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),u=c||function(m){return setTimeout(m,s-f.time*1e3+1|0)},Ja=1,g(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Ja=0,u=Za},lagSmoothing:function(m,x){t=m||1/0,r=Math.min(x||33,t)},fps:function(m){i=1e3/(m||240),s=f.time*1e3+i},add:function(m,x,y){var v=x?function(_,S,w,b){m(_,S,w,b),f.remove(v)}:m;return f.remove(m),o[y?"unshift":"push"](v),ha(),v},remove:function(m,x){~(x=o.indexOf(m))&&o.splice(x,1)&&p>=x&&p--},_listeners:o},f})(),ha=function(){return!Ja&&Ve.wake()},wt={},Zw=/^[\d.\-M][\d.\-,\s]/,Qw=/["']/g,Jw=function(t){for(var r={},n=t.substr(1,t.length-3).split(":"),a=n[0],i=1,s=n.length,o,l,u;i<s;i++)l=n[i],o=i!==s-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),r[a]=isNaN(u)?u.replace(Qw,"").trim():+u,a=l.substr(o+1).trim();return r},tS=function(t){var r=t.indexOf("(")+1,n=t.indexOf(")"),a=t.indexOf("(",r);return t.substring(r,~a&&a<n?t.indexOf(")",n+1):n)},eS=function(t){var r=(t+"").split("("),n=wt[r[0]];return n&&r.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[Jw(r[1])]:tS(t).split(",").map(t0)):wt._CE&&Zw.test(t)?wt._CE("",t):n},_0=function(t){return function(r){return 1-t(1-r)}},x0=function e(t,r){for(var n=t._first,a;n;)n instanceof Oe?e(n,r):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==r&&(n.timeline?e(n.timeline,r):(a=n._ease,n._ease=n._yEase,n._yEase=a,n._yoyo=r)),n=n._next},wn=function(t,r){return t&&(Qt(t)?t:wt[t]||eS(t))||r},En=function(t,r,n,a){n===void 0&&(n=function(l){return 1-r(1-l)}),a===void 0&&(a=function(l){return l<.5?r(l*2)/2:1-r((1-l)*2)/2});var i={easeIn:r,easeOut:n,easeInOut:a},s;return ze(t,function(o){wt[o]=er[o]=i,wt[s=o.toLowerCase()]=n;for(var l in i)wt[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=wt[o+"."+l]=i[l]}),i},v0=function(t){return function(r){return r<.5?(1-t(1-r*2))/2:.5+t((r-.5)*2)/2}},zs=function e(t,r,n){var a=r>=1?r:1,i=(n||(t?.3:.45))/(r<1?r:1),s=i/uc*(Math.asin(1/a)||0),o=function(c){return c===1?1:a*Math.pow(2,-10*c)*Aw((c-s)*i)+1},l=t==="out"?o:t==="in"?function(u){return 1-o(1-u)}:v0(o);return i=uc/i,l.config=function(u,c){return e(t,u,c)},l},Bs=function e(t,r){r===void 0&&(r=1.70158);var n=function(s){return s?--s*s*((r+1)*s+r)+1:0},a=t==="out"?n:t==="in"?function(i){return 1-n(1-i)}:v0(n);return a.config=function(i){return e(t,i)},a};ze("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var r=t<5?t+1:t;En(e+",Power"+(r-1),t?function(n){return Math.pow(n,r)}:function(n){return n},function(n){return 1-Math.pow(1-n,r)},function(n){return n<.5?Math.pow(n*2,r)/2:1-Math.pow((1-n)*2,r)/2})});wt.Linear.easeNone=wt.none=wt.Linear.easeIn;En("Elastic",zs("in"),zs("out"),zs());(function(e,t){var r=1/t,n=2*r,a=2.5*r,i=function(o){return o<r?e*o*o:o<n?e*Math.pow(o-1.5/t,2)+.75:o<a?e*(o-=2.25/t)*o+.9375:e*Math.pow(o-2.625/t,2)+.984375};En("Bounce",function(s){return 1-i(1-s)},i)})(7.5625,2.75);En("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});En("Circ",function(e){return-(Gm(1-e*e)-1)});En("Sine",function(e){return e===1?1:-Mw(e*Sw)+1});En("Back",Bs("in"),Bs("out"),Bs());wt.SteppedEase=wt.steps=er.SteppedEase={config:function(t,r){t===void 0&&(t=1);var n=1/t,a=t+(r?0:1),i=r?1:0,s=1-Lt;return function(o){return((a*si(0,s,o)|0)+i)*n}}};la.ease=wt["quad.out"];ze("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return tf+=e+","+e+"Params,"});var b0=function(t,r){this.id=Tw++,t._gsap=this,this.target=t,this.harness=r,this.get=r?r.get:Qm,this.set=r?r.getSetter:of},ti=(function(){function e(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,fa(this,+r.duration,1,1),this.data=r.data,Gt&&(this._ctx=Gt,Gt.data.push(this)),Ja||Ve.wake()}var t=e.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,fa(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,a){if(ha(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(us(this,n),!i._dp||i.parent||n0(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&wr(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!a||this._initted&&Math.abs(this._zTime)===Lt||!this._initted&&this._dur&&n||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Jm(this,n,a)),this},t.time=function(n,a){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+bh(this))%(this._dur+this._rDelay)||(n?this._dur:0),a):this._time},t.totalProgress=function(n,a){return arguments.length?this.totalTime(this.totalDuration()*n,a):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(n,a){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+bh(this),a):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,a){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*i,a):this._repeat?ca(this._tTime,i)+1:1},t.timeScale=function(n,a){if(!arguments.length)return this._rts===-Lt?0:this._rts;if(this._rts===n)return this;var i=this.parent&&this._ts?Ki(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-Lt?0:this._rts,this.totalTime(si(-Math.abs(this._delay),this.totalDuration(),i),a!==!1),ls(this),$w(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ha(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Lt&&(this._tTime-=Lt)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=Xt(n);var a=this.parent||this._dp;return a&&(a._sort||!this.parent)&&wr(a,this,this._start-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Ie(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var a=this.parent||this._dp;return a?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ki(a.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=Ow);var a=Se;return Se=n,rf(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),Se=a,this},t.globalTime=function(n){for(var a=this,i=arguments.length?n:a.rawTime();a;)i=a._start+i/(Math.abs(a._ts)||1),a=a._dp;return!this.parent&&this._sat?this._sat.globalTime(n):i},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,wh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var a=this._time;return this._rDelay=n,wh(this),a?this.time(a):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,a){return this.totalTime(ir(this,n),Ie(a))},t.restart=function(n,a){return this.play().totalTime(n?-this._delay:0,Ie(a)),this._dur||(this._zTime=-Lt),this},t.play=function(n,a){return n!=null&&this.seek(n,a),this.reversed(!1).paused(!1)},t.reverse=function(n,a){return n!=null&&this.seek(n||this.totalDuration(),a),this.reversed(!0).paused(!1)},t.pause=function(n,a){return n!=null&&this.seek(n,a),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-Lt:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Lt,this},t.isActive=function(){var n=this.parent||this._dp,a=this._start,i;return!!(!n||this._ts&&this._initted&&n.isActive()&&(i=n.rawTime(!0))>=a&&i<this.endTime(!0)-Lt)},t.eventCallback=function(n,a,i){var s=this.vars;return arguments.length>1?(a?(s[n]=a,i&&(s[n+"Params"]=i),n==="onUpdate"&&(this._onUpdate=a)):delete s[n],this):s[n]},t.then=function(n){var a=this,i=a._prom;return new Promise(function(s){var o=Qt(n)?n:e0,l=function(){var c=a.then;a.then=null,i&&i(),Qt(o)&&(o=o(a))&&(o.then||o===a)&&(a.then=c),s(o),a.then=c};a._initted&&a.totalProgress()===1&&a._ts>=0||!a._tTime&&a._ts<0?l():a._prom=l})},t.kill=function(){Oa(this)},e})();rr(ti.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Lt,_prom:0,_ps:!1,_rts:1});var Oe=(function(e){Hm(t,e);function t(n,a){var i;return n===void 0&&(n={}),i=e.call(this,n)||this,i.labels={},i.smoothChildTiming=!!n.smoothChildTiming,i.autoRemoveChildren=!!n.autoRemoveChildren,i._sort=Ie(n.sortChildren),Wt&&wr(n.parent||Wt,Nr(i),a),n.reversed&&i.reverse(),n.paused&&i.paused(!0),n.scrollTrigger&&a0(Nr(i),n.scrollTrigger),i}var r=t.prototype;return r.to=function(a,i,s){return La(0,arguments,this),this},r.from=function(a,i,s){return La(1,arguments,this),this},r.fromTo=function(a,i,s,o){return La(2,arguments,this),this},r.set=function(a,i,s){return i.duration=0,i.parent=this,$a(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new le(a,i,ir(this,s),1),this},r.call=function(a,i,s){return wr(this,le.delayedCall(0,a,i),s)},r.staggerTo=function(a,i,s,o,l,u,c){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=c,s.parent=this,new le(a,s,ir(this,l)),this},r.staggerFrom=function(a,i,s,o,l,u,c){return s.runBackwards=1,$a(s).immediateRender=Ie(s.immediateRender),this.staggerTo(a,i,s,o,l,u,c)},r.staggerFromTo=function(a,i,s,o,l,u,c,f){return o.startAt=s,$a(o).immediateRender=Ie(o.immediateRender),this.staggerTo(a,i,o,l,u,c,f)},r.render=function(a,i,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=a<=0?0:Xt(a),f=this._zTime<0!=a<0&&(this._initted||!u),h,p,g,d,m,x,y,v,_,S,w,b;if(this!==Wt&&c>l&&a>=0&&(c=l),c!==this._tTime||s||f){if(o!==this._time&&u&&(c+=this._time-o,a+=this._time-o),h=c,_=this._start,v=this._ts,x=!v,f&&(u||(o=this._zTime),(a||!i)&&(this._zTime=a)),this._repeat){if(w=this._yoyo,m=u+this._rDelay,this._repeat<-1&&a<0)return this.totalTime(m*100+a,i,s);if(h=Xt(c%m),c===l?(d=this._repeat,h=u):(S=Xt(c/m),d=~~S,d&&d===S&&(h=u,d--),h>u&&(h=u)),S=ca(this._tTime,m),!o&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),w&&d&1&&(h=u-h,b=1),d!==S&&!this._lock){var T=w&&S&1,M=T===(w&&d&1);if(d<S&&(T=!T),o=T?0:c%u?u:c,this._lock=1,this.render(o||(b?0:Xt(d*m)),i,!u)._lock=0,this._tTime=c,!i&&this.parent&&Ze(this,"onRepeat"),this.vars.repeatRefresh&&!b&&(this.invalidate()._lock=1,S=d),o&&o!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,M&&(this._lock=2,o=T?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!b&&this.invalidate()),this._lock=0,!this._ts&&!x)return this;x0(this,b)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=zw(this,Xt(o),Xt(h)),y&&(c-=h-(h=y._start))),this._tTime=c,this._time=h,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=a,o=0),!o&&c&&u&&!i&&!S&&(Ze(this,"onStart"),this._tTime!==c))return this;if(h>=o&&a>=0)for(p=this._first;p;){if(g=p._next,(p._act||h>=p._start)&&p._ts&&y!==p){if(p.parent!==this)return this.render(a,i,s);if(p.render(p._ts>0?(h-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(h-p._start)*p._ts,i,s),h!==this._time||!this._ts&&!x){y=0,g&&(c+=this._zTime=-Lt);break}}p=g}else{p=this._last;for(var k=a<0?a:h;p;){if(g=p._prev,(p._act||k<=p._end)&&p._ts&&y!==p){if(p.parent!==this)return this.render(a,i,s);if(p.render(p._ts>0?(k-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(k-p._start)*p._ts,i,s||Se&&rf(p)),h!==this._time||!this._ts&&!x){y=0,g&&(c+=this._zTime=k?-Lt:Lt);break}}p=g}}if(y&&!i&&(this.pause(),y.render(h>=o?0:-Lt)._zTime=h>=o?1:-1,this._ts))return this._start=_,ls(this),this.render(a,i,s);this._onUpdate&&!i&&Ze(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(_===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((a||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&rn(this,1),!i&&!(a<0&&!o)&&(c||o||!l)&&(Ze(this,c===l&&a>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(a,i){var s=this;if(Gr(i)||(i=ir(this,i,a)),!(a instanceof ti)){if(Ee(a))return a.forEach(function(o){return s.add(o,i)}),this;if(ye(a))return this.addLabel(a,i);if(Qt(a))a=le.delayedCall(0,a);else return this}return this!==a?wr(this,a,i):this},r.getChildren=function(a,i,s,o){a===void 0&&(a=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-or);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof le?i&&l.push(u):(s&&l.push(u),a&&l.push.apply(l,u.getChildren(!0,i,s)))),u=u._next;return l},r.getById=function(a){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===a)return i[s]},r.remove=function(a){return ye(a)?this.removeLabel(a):Qt(a)?this.killTweensOf(a):(a.parent===this&&os(this,a),a===this._recent&&(this._recent=this._last),bn(this))},r.totalTime=function(a,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Xt(Ve.time-(this._ts>0?a/this._ts:(this.totalDuration()-a)/-this._ts))),e.prototype.totalTime.call(this,a,i),this._forcing=0,this):this._tTime},r.addLabel=function(a,i){return this.labels[a]=ir(this,i),this},r.removeLabel=function(a){return delete this.labels[a],this},r.addPause=function(a,i,s){var o=le.delayedCall(0,i||Za,s);return o.data="isPause",this._hasPause=1,wr(this,o,ir(this,a))},r.removePause=function(a){var i=this._first;for(a=ir(this,a);i;)i._start===a&&i.data==="isPause"&&rn(i),i=i._next},r.killTweensOf=function(a,i,s){for(var o=this.getTweensOf(a,s),l=o.length;l--;)Zr!==o[l]&&o[l].kill(a,i);return this},r.getTweensOf=function(a,i){for(var s=[],o=lr(a),l=this._first,u=Gr(i),c;l;)l instanceof le?Pw(l._targets,o)&&(u?(!Zr||l._initted&&l._ts)&&l.globalTime(0)<=i&&l.globalTime(l.totalDuration())>i:!i||l.isActive())&&s.push(l):(c=l.getTweensOf(o,i)).length&&s.push.apply(s,c),l=l._next;return s},r.tweenTo=function(a,i){i=i||{};var s=this,o=ir(s,a),l=i,u=l.startAt,c=l.onStart,f=l.onStartParams,h=l.immediateRender,p,g=le.to(s,rr({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||Lt,onStart:function(){if(s.pause(),!p){var m=i.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());g._dur!==m&&fa(g,m,0,1).render(g._time,!0,!0),p=1}c&&c.apply(g,f||[])}},i));return h?g.render(0):g},r.tweenFromTo=function(a,i,s){return this.tweenTo(i,rr({startAt:{time:ir(this,a)}},s))},r.recent=function(){return this._recent},r.nextLabel=function(a){return a===void 0&&(a=this._time),Sh(this,ir(this,a))},r.previousLabel=function(a){return a===void 0&&(a=this._time),Sh(this,ir(this,a),1)},r.currentLabel=function(a){return arguments.length?this.seek(a,!0):this.previousLabel(this._time+Lt)},r.shiftChildren=function(a,i,s){s===void 0&&(s=0);var o=this._first,l=this.labels,u;for(a=Xt(a);o;)o._start>=s&&(o._start+=a,o._end+=a),o=o._next;if(i)for(u in l)l[u]>=s&&(l[u]+=a);return bn(this)},r.invalidate=function(a){var i=this._first;for(this._lock=0;i;)i.invalidate(a),i=i._next;return e.prototype.invalidate.call(this,a)},r.clear=function(a){a===void 0&&(a=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),a&&(this.labels={}),bn(this)},r.totalDuration=function(a){var i=0,s=this,o=s._last,l=or,u,c,f;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-a:a));if(s._dirty){for(f=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,wr(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(i-=c,(!f&&!s._dp||f&&f.smoothChildTiming)&&(s._start+=Xt(c/s._ts),s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>i&&o._ts&&(i=o._end),o=u;fa(s,s===Wt&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(a){if(Wt._ts&&(Jm(Wt,Ki(a,Wt)),Zm=Ve.frame),Ve.frame>=xh){xh+=Je.autoSleep||120;var i=Wt._first;if((!i||!i._ts)&&Je.autoSleep&&Ve._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Ve.sleep()}}},t})(ti);rr(Oe.prototype,{_lock:0,_hasPause:0,_forcing:0});var rS=function(t,r,n,a,i,s,o){var l=new Be(this._pt,t,r,0,1,C0,null,i),u=0,c=0,f,h,p,g,d,m,x,y;for(l.b=n,l.e=a,n+="",a+="",(x=~a.indexOf("random("))&&(a=Qa(a)),s&&(y=[n,a],s(y,t,r),n=y[0],a=y[1]),h=n.match(Ls)||[];f=Ls.exec(a);)g=f[0],d=a.substring(u,f.index),p?p=(p+1)%5:d.substr(-5)==="rgba("&&(p=1),g!==h[c++]&&(m=parseFloat(h[c-1])||0,l._pt={_next:l._pt,p:d||c===1?d:",",s:m,c:g.charAt(1)==="="?Vn(m,g)-m:parseFloat(g)-m,m:p&&p<4?Math.round:0},u=Ls.lastIndex);return l.c=u<a.length?a.substring(u,a.length):"",l.fp=o,(Xm.test(a)||x)&&(l.e=0),this._pt=l,l},nf=function(t,r,n,a,i,s,o,l,u,c){Qt(a)&&(a=a(i||0,t,s));var f=t[r],h=n!=="get"?n:Qt(f)?u?t[r.indexOf("set")||!Qt(t["get"+r.substr(3)])?r:"get"+r.substr(3)](u):t[r]():f,p=Qt(f)?u?oS:M0:sf,g;if(ye(a)&&(~a.indexOf("random(")&&(a=Qa(a)),a.charAt(1)==="="&&(g=Vn(h,a)+(Re(h)||0),(g||g===0)&&(a=g))),!c||h!==a||yc)return!isNaN(h*a)&&a!==""?(g=new Be(this._pt,t,r,+h||0,a-(h||0),typeof f=="boolean"?uS:A0,0,p),u&&(g.fp=u),o&&g.modifier(o,this,t),this._pt=g):(!f&&!(r in t)&&Qc(r,a),rS.call(this,t,r,h,a,p,l||Je.stringFilter,u))},nS=function(t,r,n,a,i){if(Qt(t)&&(t=qa(t,i,r,n,a)),!Ar(t)||t.style&&t.nodeType||Ee(t)||jm(t))return ye(t)?qa(t,i,r,n,a):t;var s={},o;for(o in t)s[o]=qa(t[o],i,r,n,a);return s},w0=function(t,r,n,a,i,s){var o,l,u,c;if(Ke[t]&&(o=new Ke[t]).init(i,o.rawVars?r[t]:nS(r[t],a,i,s,n),n,a,s)!==!1&&(n._pt=l=new Be(n._pt,i,t,0,1,o.render,o,0,o.priority),n!==Xn))for(u=n._ptLookup[n._targets.indexOf(i)],c=o._props.length;c--;)u[o._props[c]]=l;return o},Zr,yc,af=function e(t,r,n){var a=t.vars,i=a.ease,s=a.startAt,o=a.immediateRender,l=a.lazy,u=a.onUpdate,c=a.runBackwards,f=a.yoyoEase,h=a.keyframes,p=a.autoRevert,g=t._dur,d=t._startAt,m=t._targets,x=t.parent,y=x&&x.data==="nested"?x.vars.targets:m,v=t._overwrite==="auto"&&!Wc,_=t.timeline,S,w,b,T,M,k,C,O,R,E,H,I,P;if(_&&(!h||!i)&&(i="none"),t._ease=wn(i,la.ease),t._yEase=f?_0(wn(f===!0?i:f,la.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!_&&!!a.runBackwards,!_||h&&!a.stagger){if(O=m[0]?vn(m[0]).harness:0,I=O&&a[O.prop],S=Wi(a,Jc),d&&(d._zTime<0&&d.progress(1),r<0&&c&&o&&!p?d.render(-1,!0):d.revert(c&&g?Ei:Dw),d._lazy=0),s){if(rn(t._startAt=le.set(m,rr({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!d&&Ie(l),startAt:null,delay:0,onUpdate:u&&function(){return Ze(t,"onUpdate")},stagger:0},s))),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Se||!o&&!p)&&t._startAt.revert(Ei),o&&g&&r<=0&&n<=0){r&&(t._zTime=r);return}}else if(c&&g&&!d){if(r&&(o=!1),b=rr({overwrite:!1,data:"isFromStart",lazy:o&&!d&&Ie(l),immediateRender:o,stagger:0,parent:x},S),I&&(b[O.prop]=I),rn(t._startAt=le.set(m,b)),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Se?t._startAt.revert(Ei):t._startAt.render(-1,!0)),t._zTime=r,!o)e(t._startAt,Lt,Lt);else if(!r)return}for(t._pt=t._ptCache=0,l=g&&Ie(l)||l&&!g,w=0;w<m.length;w++){if(M=m[w],C=M._gsap||ef(m)[w]._gsap,t._ptLookup[w]=E={},fc[C.id]&&tn.length&&Xi(),H=y===m?w:y.indexOf(M),O&&(R=new O).init(M,I||S,t,H,y)!==!1&&(t._pt=T=new Be(t._pt,M,R.name,0,1,R.render,R,0,R.priority),R._props.forEach(function(j){E[j]=T}),R.priority&&(k=1)),!O||I)for(b in S)Ke[b]&&(R=w0(b,S,t,H,M,y))?R.priority&&(k=1):E[b]=T=nf.call(t,M,b,"get",S[b],H,y,0,a.stringFilter);t._op&&t._op[w]&&t.kill(M,t._op[w]),v&&t._pt&&(Zr=t,Wt.killTweensOf(M,E,t.globalTime(r)),P=!t.parent,Zr=0),t._pt&&l&&(fc[C.id]=1)}k&&k0(t),t._onInit&&t._onInit(t)}t._onUpdate=u,t._initted=(!t._op||t._pt)&&!P,h&&r<=0&&_.render(or,!0,!0)},aS=function(t,r,n,a,i,s,o,l){var u=(t._pt&&t._ptCache||(t._ptCache={}))[r],c,f,h,p;if(!u)for(u=t._ptCache[r]=[],h=t._ptLookup,p=t._targets.length;p--;){if(c=h[p][r],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==r&&c.fp!==r;)c=c._next;if(!c)return yc=1,t.vars[r]="+=0",af(t,o),yc=0,l?Va(r+" not eligible for reset"):1;u.push(c)}for(p=u.length;p--;)f=u[p],c=f._pt||f,c.s=(a||a===0)&&!i?a:c.s+(a||0)+s*c.c,c.c=n-c.s,f.e&&(f.e=ae(n)+Re(f.e)),f.b&&(f.b=c.s+Re(f.b))},iS=function(t,r){var n=t[0]?vn(t[0]).harness:0,a=n&&n.aliases,i,s,o,l;if(!a)return r;i=ua({},r);for(s in a)if(s in i)for(l=a[s].split(","),o=l.length;o--;)i[l[o]]=i[s];return i},sS=function(t,r,n,a){var i=r.ease||a||"power1.inOut",s,o;if(Ee(r))o=n[t]||(n[t]=[]),r.forEach(function(l,u){return o.push({t:u/(r.length-1)*100,v:l,e:i})});else for(s in r)o=n[s]||(n[s]=[]),s==="ease"||o.push({t:parseFloat(t),v:r[s],e:i})},qa=function(t,r,n,a,i){return Qt(t)?t.call(r,n,a,i):ye(t)&&~t.indexOf("random(")?Qa(t):t},S0=tf+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",T0={};ze(S0+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return T0[e]=1});var le=(function(e){Hm(t,e);function t(n,a,i,s){var o;typeof a=="number"&&(i.duration=a,a=i,i=null),o=e.call(this,s?a:$a(a))||this;var l=o.vars,u=l.duration,c=l.delay,f=l.immediateRender,h=l.stagger,p=l.overwrite,g=l.keyframes,d=l.defaults,m=l.scrollTrigger,x=l.yoyoEase,y=a.parent||Wt,v=(Ee(n)||jm(n)?Gr(n[0]):"length"in a)?[n]:lr(n),_,S,w,b,T,M,k,C;if(o._targets=v.length?ef(v):Va("GSAP target "+n+" not found. https://gsap.com",!Je.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=p,g||h||vi(u)||vi(c)){if(a=o.vars,_=o.timeline=new Oe({data:"nested",defaults:d||{},targets:y&&y.data==="nested"?y.vars.targets:v}),_.kill(),_.parent=_._dp=Nr(o),_._start=0,h||vi(u)||vi(c)){if(b=v.length,k=h&&l0(h),Ar(h))for(T in h)~S0.indexOf(T)&&(C||(C={}),C[T]=h[T]);for(S=0;S<b;S++)w=Wi(a,T0),w.stagger=0,x&&(w.yoyoEase=x),C&&ua(w,C),M=v[S],w.duration=+qa(u,Nr(o),S,M,v),w.delay=(+qa(c,Nr(o),S,M,v)||0)-o._delay,!h&&b===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),_.to(M,w,k?k(S,M,v):0),_._ease=wt.none;_.duration()?u=c=0:o.timeline=0}else if(g){$a(rr(_.vars.defaults,{ease:"none"})),_._ease=wn(g.ease||a.ease||"none");var O=0,R,E,H;if(Ee(g))g.forEach(function(I){return _.to(v,I,">")}),_.duration();else{w={};for(T in g)T==="ease"||T==="easeEach"||sS(T,g[T],w,g.easeEach);for(T in w)for(R=w[T].sort(function(I,P){return I.t-P.t}),O=0,S=0;S<R.length;S++)E=R[S],H={ease:E.e,duration:(E.t-(S?R[S-1].t:0))/100*u},H[T]=E.v,_.to(v,H,O),O+=H.duration;_.duration()<u&&_.to({},{duration:u-_.duration()})}}u||o.duration(u=_.duration())}else o.timeline=0;return p===!0&&!Wc&&(Zr=Nr(o),Wt.killTweensOf(v),Zr=0),wr(y,Nr(o),i),a.reversed&&o.reverse(),a.paused&&o.paused(!0),(f||!u&&!g&&o._start===Xt(y._time)&&Ie(f)&&Lw(Nr(o))&&y.data!=="nested")&&(o._tTime=-Lt,o.render(Math.max(0,-c)||0)),m&&a0(Nr(o),m),o}var r=t.prototype;return r.render=function(a,i,s){var o=this._time,l=this._tDur,u=this._dur,c=a<0,f=a>l-Lt&&!c?l:a<Lt?0:a,h,p,g,d,m,x,y,v,_;if(!u)Iw(this,a,i,s);else if(f!==this._tTime||!a||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(h=f,v=this.timeline,this._repeat){if(d=u+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+a,i,s);if(h=Xt(f%d),f===l?(g=this._repeat,h=u):(m=Xt(f/d),g=~~m,g&&g===m?(h=u,g--):h>u&&(h=u)),x=this._yoyo&&g&1,x&&(_=this._yEase,h=u-h),m=ca(this._tTime,d),h===o&&!s&&this._initted&&g===m)return this._tTime=f,this;g!==m&&(v&&this._yEase&&x0(v,x),this.vars.repeatRefresh&&!x&&!this._lock&&h!==d&&this._initted&&(this._lock=s=1,this.render(Xt(d*g),!0).invalidate()._lock=0))}if(!this._initted){if(i0(this,c?a:h,s,i,f))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==m))return this;if(u!==this._dur)return this.render(a,i,s)}if(this._tTime=f,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(_||this._ease)(h/u),this._from&&(this.ratio=y=1-y),!o&&f&&!i&&!m&&(Ze(this,"onStart"),this._tTime!==f))return this;for(p=this._pt;p;)p.r(y,p.d),p=p._next;v&&v.render(a<0?a:v._dur*v._ease(h/this._dur),i,s)||this._startAt&&(this._zTime=a),this._onUpdate&&!i&&(c&&hc(this,a,i,s),Ze(this,"onUpdate")),this._repeat&&g!==m&&this.vars.onRepeat&&!i&&this.parent&&Ze(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&hc(this,a,!0,!0),(a||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&rn(this,1),!i&&!(c&&!o)&&(f||o||x)&&(Ze(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(a){return(!a||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(a),e.prototype.invalidate.call(this,a)},r.resetTo=function(a,i,s,o,l){Ja||Ve.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||af(this,u),c=this._ease(u/this._dur),aS(this,a,i,s,o,c,u,l)?this.resetTo(a,i,s,o,1):(us(this,0),this.parent||r0(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(a,i){if(i===void 0&&(i="all"),!a&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?Oa(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Se),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(a,i,Zr&&Zr.vars.overwrite!==!0)._first||Oa(this),this.parent&&s!==this.timeline.totalDuration()&&fa(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=a?lr(a):o,u=this._ptLookup,c=this._pt,f,h,p,g,d,m,x;if((!i||i==="all")&&Nw(o,l))return i==="all"&&(this._pt=0),Oa(this);for(f=this._op=this._op||[],i!=="all"&&(ye(i)&&(d={},ze(i,function(y){return d[y]=1}),i=d),i=iS(o,i)),x=o.length;x--;)if(~l.indexOf(o[x])){h=u[x],i==="all"?(f[x]=i,g=h,p={}):(p=f[x]=f[x]||{},g=i);for(d in g)m=h&&h[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&os(this,m,"_pt"),delete h[d]),p!=="all"&&(p[d]=1)}return this._initted&&!this._pt&&c&&Oa(this),this},t.to=function(a,i){return new t(a,i,arguments[2])},t.from=function(a,i){return La(1,arguments)},t.delayedCall=function(a,i,s,o){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:a,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},t.fromTo=function(a,i,s){return La(2,arguments)},t.set=function(a,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(a,i)},t.killTweensOf=function(a,i,s){return Wt.killTweensOf(a,i,s)},t})(ti);rr(le.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ze("staggerTo,staggerFrom,staggerFromTo",function(e){le[e]=function(){var t=new Oe,r=dc.call(arguments,0);return r.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,r)}});var sf=function(t,r,n){return t[r]=n},M0=function(t,r,n){return t[r](n)},oS=function(t,r,n,a){return t[r](a.fp,n)},lS=function(t,r,n){return t.setAttribute(r,n)},of=function(t,r){return Qt(t[r])?M0:Kc(t[r])&&t.setAttribute?lS:sf},A0=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e6)/1e6,r)},uS=function(t,r){return r.set(r.t,r.p,!!(r.s+r.c*t),r)},C0=function(t,r){var n=r._pt,a="";if(!t&&r.b)a=r.b;else if(t===1&&r.e)a=r.e;else{for(;n;)a=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+a,n=n._next;a+=r.c}r.set(r.t,r.p,a,r)},lf=function(t,r){for(var n=r._pt;n;)n.r(t,n.d),n=n._next},cS=function(t,r,n,a){for(var i=this._pt,s;i;)s=i._next,i.p===a&&i.modifier(t,r,n),i=s},fS=function(t){for(var r=this._pt,n,a;r;)a=r._next,r.p===t&&!r.op||r.op===t?os(this,r,"_pt"):r.dep||(n=1),r=a;return!n},hS=function(t,r,n,a){a.mSet(t,r,a.m.call(a.tween,n,a.mt),a)},k0=function(t){for(var r=t._pt,n,a,i,s;r;){for(n=r._next,a=i;a&&a.pr>r.pr;)a=a._next;(r._prev=a?a._prev:s)?r._prev._next=r:i=r,(r._next=a)?a._prev=r:s=r,r=n}t._pt=i},Be=(function(){function e(r,n,a,i,s,o,l,u,c){this.t=n,this.s=i,this.c=s,this.p=a,this.r=o||A0,this.d=l||this,this.set=u||sf,this.pr=c||0,this._next=r,r&&(r._prev=this)}var t=e.prototype;return t.modifier=function(n,a,i){this.mSet=this.mSet||this.set,this.set=hS,this.m=n,this.mt=i,this.tween=a},e})();ze(tf+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(e){return Jc[e]=1});er.TweenMax=er.TweenLite=le;er.TimelineLite=er.TimelineMax=Oe;Wt=new Oe({sortChildren:!1,defaults:la,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Je.stringFilter=y0;var Sn=[],Oi={},pS=[],Mh=0,dS=0,Us=function(t){return(Oi[t]||pS).map(function(r){return r()})},_c=function(){var t=Date.now(),r=[];t-Mh>2&&(Us("matchMediaInit"),Sn.forEach(function(n){var a=n.queries,i=n.conditions,s,o,l,u;for(o in a)s=br.matchMedia(a[o]).matches,s&&(l=1),s!==i[o]&&(i[o]=s,u=1);u&&(n.revert(),l&&r.push(n))}),Us("matchMediaRevert"),r.forEach(function(n){return n.onMatch(n,function(a){return n.add(null,a)})}),Mh=t,Us("matchMedia"))},R0=(function(){function e(r,n){this.selector=n&&gc(n),this.data=[],this._r=[],this.isReverted=!1,this.id=dS++,r&&this.add(r)}var t=e.prototype;return t.add=function(n,a,i){Qt(n)&&(i=a,a=n,n=Qt);var s=this,o=function(){var u=Gt,c=s.selector,f;return u&&u!==s&&u.data.push(s),i&&(s.selector=gc(i)),Gt=s,f=a.apply(s,arguments),Qt(f)&&s._r.push(f),Gt=u,s.selector=c,s.isReverted=!1,f};return s.last=o,n===Qt?o(s,function(l){return s.add(null,l)}):n?s[n]=o:o},t.ignore=function(n){var a=Gt;Gt=null,n(this),Gt=a},t.getTweens=function(){var n=[];return this.data.forEach(function(a){return a instanceof e?n.push.apply(n,a.getTweens()):a instanceof le&&!(a.parent&&a.parent.data==="nested")&&n.push(a)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,a){var i=this;if(n?(function(){for(var o=i.getTweens(),l=i.data.length,u;l--;)u=i.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(n)}),l=i.data.length;l--;)u=i.data[l],u instanceof Oe?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof le)&&u.revert&&u.revert(n);i._r.forEach(function(c){return c(n,i)}),i.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),a)for(var s=Sn.length;s--;)Sn[s].id===this.id&&Sn.splice(s,1)},t.revert=function(n){this.kill(n||{})},e})(),gS=(function(){function e(r){this.contexts=[],this.scope=r,Gt&&Gt.data.push(this)}var t=e.prototype;return t.add=function(n,a,i){Ar(n)||(n={matches:n});var s=new R0(0,i||this.scope),o=s.conditions={},l,u,c;Gt&&!s.selector&&(s.selector=Gt.selector),this.contexts.push(s),a=s.add("onMatch",a),s.queries=n;for(u in n)u==="all"?c=1:(l=br.matchMedia(n[u]),l&&(Sn.indexOf(s)<0&&Sn.push(s),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(_c):l.addEventListener("change",_c)));return c&&a(s,function(f){return s.add(null,f)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(a){return a.kill(n,!0)})},e})(),Vi={registerPlugin:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach(function(a){return d0(a)})},timeline:function(t){return new Oe(t)},getTweensOf:function(t,r){return Wt.getTweensOf(t,r)},getProperty:function(t,r,n,a){ye(t)&&(t=lr(t)[0]);var i=vn(t||{}).get,s=n?e0:t0;return n==="native"&&(n=""),t&&(r?s((Ke[r]&&Ke[r].get||i)(t,r,n,a)):function(o,l,u){return s((Ke[o]&&Ke[o].get||i)(t,o,l,u))})},quickSetter:function(t,r,n){if(t=lr(t),t.length>1){var a=t.map(function(c){return He.quickSetter(c,r,n)}),i=a.length;return function(c){for(var f=i;f--;)a[f](c)}}t=t[0]||{};var s=Ke[r],o=vn(t),l=o.harness&&(o.harness.aliases||{})[r]||r,u=s?function(c){var f=new s;Xn._pt=0,f.init(t,n?c+n:c,Xn,0,[t]),f.render(1,f),Xn._pt&&lf(1,Xn)}:o.set(t,l);return s?u:function(c){return u(t,l,n?c+n:c,o,1)}},quickTo:function(t,r,n){var a,i=He.to(t,rr((a={},a[r]="+=0.1",a.paused=!0,a.stagger=0,a),n||{})),s=function(l,u,c){return i.resetTo(r,l,u,c)};return s.tween=i,s},isTweening:function(t){return Wt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=wn(t.ease,la.ease)),vh(la,t||{})},config:function(t){return vh(Je,t||{})},registerEffect:function(t){var r=t.name,n=t.effect,a=t.plugins,i=t.defaults,s=t.extendTimeline;(a||"").split(",").forEach(function(o){return o&&!Ke[o]&&!er[o]&&Va(r+" effect requires "+o+" plugin.")}),qs[r]=function(o,l,u){return n(lr(o),rr(l||{},i),u)},s&&(Oe.prototype[r]=function(o,l,u){return this.add(qs[r](o,Ar(l)?l:(u=l)&&{},this),u)})},registerEase:function(t,r){wt[t]=wn(r)},parseEase:function(t,r){return arguments.length?wn(t,r):wt},getById:function(t){return Wt.getById(t)},exportRoot:function(t,r){t===void 0&&(t={});var n=new Oe(t),a,i;for(n.smoothChildTiming=Ie(t.smoothChildTiming),Wt.remove(n),n._dp=0,n._time=n._tTime=Wt._time,a=Wt._first;a;)i=a._next,(r||!(!a._dur&&a instanceof le&&a.vars.onComplete===a._targets[0]))&&wr(n,a,a._start-a._delay),a=i;return wr(Wt,n,0),n},context:function(t,r){return t?new R0(t,r):Gt},matchMedia:function(t){return new gS(t)},matchMediaRefresh:function(){return Sn.forEach(function(t){var r=t.conditions,n,a;for(a in r)r[a]&&(r[a]=!1,n=1);n&&t.revert()})||_c()},addEventListener:function(t,r){var n=Oi[t]||(Oi[t]=[]);~n.indexOf(r)||n.push(r)},removeEventListener:function(t,r){var n=Oi[t],a=n&&n.indexOf(r);a>=0&&n.splice(a,1)},utils:{wrap:Xw,wrapYoyo:Ww,distribute:l0,random:c0,snap:u0,normalize:Yw,getUnit:Re,clamp:Uw,splitColor:g0,toArray:lr,selector:gc,mapRange:h0,pipe:Gw,unitize:jw,interpolate:Kw,shuffle:o0},install:Km,effects:qs,ticker:Ve,updateRoot:Oe.updateRoot,plugins:Ke,globalTimeline:Wt,core:{PropTween:Be,globals:Vm,Tween:le,Timeline:Oe,Animation:ti,getCache:vn,_removeLinkedListItem:os,reverting:function(){return Se},context:function(t){return t&&Gt&&(Gt.data.push(t),t._ctx=Gt),Gt},suppressOverwrites:function(t){return Wc=t}}};ze("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return Vi[e]=le[e]});Ve.add(Oe.updateRoot);Xn=Vi.to({},{duration:0});var mS=function(t,r){for(var n=t._pt;n&&n.p!==r&&n.op!==r&&n.fp!==r;)n=n._next;return n},yS=function(t,r){var n=t._targets,a,i,s;for(a in r)for(i=n.length;i--;)s=t._ptLookup[i][a],s&&(s=s.d)&&(s._pt&&(s=mS(s,a)),s&&s.modifier&&s.modifier(r[a],t,n[i],a))},Hs=function(t,r){return{name:t,headless:1,rawVars:1,init:function(a,i,s){s._onInit=function(o){var l,u;if(ye(i)&&(l={},ze(i,function(c){return l[c]=1}),i=l),r){l={};for(u in i)l[u]=r(i[u]);i=l}yS(o,i)}}}},He=Vi.registerPlugin({name:"attr",init:function(t,r,n,a,i){var s,o,l;this.tween=n;for(s in r)l=t.getAttribute(s)||"",o=this.add(t,"setAttribute",(l||0)+"",r[s],a,i,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(t,r){for(var n=r._pt;n;)Se?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",headless:1,init:function(t,r){for(var n=r.length;n--;)this.add(t,n,t[n]||0,r[n],0,0,0,0,0,1)}},Hs("roundProps",mc),Hs("modifiers"),Hs("snap",u0))||Vi;le.version=Oe.version=He.version="3.14.2";Wm=1;Vc()&&ha();wt.Power0;wt.Power1;wt.Power2;wt.Power3;wt.Power4;wt.Linear;wt.Quad;wt.Cubic;wt.Quart;wt.Quint;wt.Strong;wt.Elastic;wt.Back;wt.SteppedEase;wt.Bounce;wt.Sine;wt.Expo;wt.Circ;/*!
|
|
9
9
|
* CSSPlugin 3.14.2
|
|
10
10
|
* https://gsap.com
|
|
11
11
|
*
|
|
12
12
|
* Copyright 2008-2025, GreenSock. All rights reserved.
|
|
13
13
|
* Subject to the terms at https://gsap.com/standard-license
|
|
14
14
|
* @author: Jack Doyle, jack@greensock.com
|
|
15
|
-
*/var Ah,Zr,Zn,uf,yn,Ch,cf,_S=function(){return typeof window<"u"},Gr={},gn=180/Math.PI,Qn=Math.PI/180,Bn=Math.atan2,kh=1e8,ff=/([A-Z])/g,vS=/(left|right|width|margin|padding|x)/i,xS=/[\s,\(]\S/,Sr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},vc=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},bS=function(t,r){return r.set(r.t,r.p,t===1?r.e:Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},wS=function(t,r){return r.set(r.t,r.p,t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},SS=function(t,r){return r.set(r.t,r.p,t===1?r.e:t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},TS=function(t,r){var n=r.s+r.c*t;r.set(r.t,r.p,~~(n+(n<0?-.5:.5))+r.u,r)},E0=function(t,r){return r.set(r.t,r.p,t?r.e:r.b,r)},D0=function(t,r){return r.set(r.t,r.p,t!==1?r.b:r.e,r)},MS=function(t,r,n){return t.style[r]=n},AS=function(t,r,n){return t.style.setProperty(r,n)},CS=function(t,r,n){return t._gsap[r]=n},kS=function(t,r,n){return t._gsap.scaleX=t._gsap.scaleY=n},RS=function(t,r,n,i,a){var s=t._gsap;s.scaleX=s.scaleY=n,s.renderTransform(a,s)},ES=function(t,r,n,i,a){var s=t._gsap;s[r]=n,s.renderTransform(a,s)},Xt="transform",Ue=Xt+"Origin",DS=function e(t,r){var n=this,i=this.target,a=i.style,s=i._gsap;if(t in Gr&&a){if(this.tfm=this.tfm||{},t!=="transform")t=Sr[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return n.tfm[o]=Nr(i,o)}):this.tfm[t]=s.x?s[t]:Nr(i,t),t===Ue&&(this.tfm.zOrigin=s.zOrigin);else return Sr.transform.split(",").forEach(function(o){return e.call(n,o,r)});if(this.props.indexOf(Xt)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ue,r,"")),t=Xt}(a||r)&&this.props.push(t,r,a[t])},O0=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},OS=function(){var t=this.props,r=this.target,n=r.style,i=r._gsap,a,s;for(a=0;a<t.length;a+=3)t[a+1]?t[a+1]===2?r[t[a]](t[a+2]):r[t[a]]=t[a+2]:t[a+2]?n[t[a]]=t[a+2]:n.removeProperty(t[a].substr(0,2)==="--"?t[a]:t[a].replace(ff,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)i[s]=this.tfm[s];i.svg&&(i.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),a=cf(),(!a||!a.isStart)&&!n[Xt]&&(O0(n),i.zOrigin&&n[Ue]&&(n[Ue]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},P0=function(t,r){var n={target:t,props:[],revert:OS,save:DS};return t._gsap||He.core.getCache(t),r&&t.style&&t.nodeType&&r.split(",").forEach(function(i){return n.save(i)}),n},F0,xc=function(t,r){var n=Zr.createElementNS?Zr.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Zr.createElement(t);return n&&n.style?n:Zr.createElement(t)},Qe=function e(t,r,n){var i=getComputedStyle(t);return i[r]||i.getPropertyValue(r.replace(ff,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&e(t,pi(r)||r,1)||""},Rh="O,Moz,ms,Ms,Webkit".split(","),pi=function(t,r,n){var i=r||yn,a=i.style,s=5;if(t in a&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);s--&&!(Rh[s]+t in a););return s<0?null:(s===3?"ms":s>=0?Rh[s]:"")+t},bc=function(){_S()&&window.document&&(Ah=window,Zr=Ah.document,Zn=Zr.documentElement,yn=xc("div")||{style:{}},xc("div"),Xt=pi(Xt),Ue=Xt+"Origin",yn.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",F0=!!pi("perspective"),cf=He.core.reverting,uf=1)},Eh=function(t){var r=t.ownerSVGElement,n=xc("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=t.cloneNode(!0),a;i.style.display="block",n.appendChild(i),Zn.appendChild(n);try{a=i.getBBox()}catch{}return n.removeChild(i),Zn.removeChild(n),a},Dh=function(t,r){for(var n=r.length;n--;)if(t.hasAttribute(r[n]))return t.getAttribute(r[n])},N0=function(t){var r,n;try{r=t.getBBox()}catch{r=Eh(t),n=1}return r&&(r.width||r.height)||n||(r=Eh(t)),r&&!r.width&&!r.x&&!r.y?{x:+Dh(t,["x","cx","x1"])||0,y:+Dh(t,["y","cy","y1"])||0,width:0,height:0}:r},$0=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&N0(t))},nn=function(t,r){if(r){var n=t.style,i;r in Gr&&r!==Ue&&(r=Xt),n.removeProperty?(i=r.substr(0,2),(i==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),n.removeProperty(i==="--"?r:r.replace(ff,"-$1").toLowerCase())):n.removeAttribute(r)}},Qr=function(t,r,n,i,a,s){var o=new Be(t._pt,r,n,0,1,s?D0:E0);return t._pt=o,o.b=i,o.e=a,t._props.push(n),o},Oh={deg:1,rad:1,turn:1},PS={grid:1,flex:1},an=function e(t,r,n,i){var a=parseFloat(n)||0,s=(n+"").trim().substr((a+"").length)||"px",o=yn.style,l=vS.test(r),u=t.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),f=100,h=i==="px",p=i==="%",g,d,m,v;if(i===s||!a||Oh[i]||Oh[s])return a;if(s!=="px"&&!h&&(a=e(t,r,n,"px")),v=t.getCTM&&$0(t),(p||s==="%")&&(Gr[r]||~r.indexOf("adius")))return g=v?t.getBBox()[l?"width":"height"]:t[c],ne(p?a/g*f:a/100*g);if(o[l?"width":"height"]=f+(h?s:i),d=i!=="rem"&&~r.indexOf("adius")||i==="em"&&t.appendChild&&!u?t:t.parentNode,v&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===Zr||!d.appendChild)&&(d=Zr.body),m=d._gsap,m&&p&&m.width&&l&&m.time===Ve.time&&!m.uncache)return ne(a/m.width*f);if(p&&(r==="height"||r==="width")){var y=t.style[r];t.style[r]=f+i,g=t[c],y?t.style[r]=y:nn(t,r)}else(p||s==="%")&&!PS[Qe(d,"display")]&&(o.position=Qe(t,"position")),d===t&&(o.position="static"),d.appendChild(yn),g=yn[c],d.removeChild(yn),o.position="absolute";return l&&p&&(m=xn(d),m.time=Ve.time,m.width=d[c]),ne(h?g*a/f:g&&a?f/g*a:0)},Nr=function(t,r,n,i){var a;return uf||bc(),r in Sr&&r!=="transform"&&(r=Sr[r],~r.indexOf(",")&&(r=r.split(",")[0])),Gr[r]&&r!=="transform"?(a=ra(t,i),a=r!=="transformOrigin"?a[r]:a.svg?a.origin:Qa(Qe(t,Ue))+" "+a.zOrigin+"px"):(a=t.style[r],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=Za[r]&&Za[r](t,r,n)||Qe(t,r)||Qm(t,r)||(r==="opacity"?1:0))),n&&!~(a+"").trim().indexOf(" ")?an(t,r,a,n)+n:a},FS=function(t,r,n,i){if(!n||n==="none"){var a=pi(r,t,1),s=a&&Qe(t,a,1);s&&s!==n?(r=a,n=s):r==="borderColor"&&(n=Qe(t,"borderTopColor"))}var o=new Be(this._pt,t.style,r,0,1,C0),l=0,u=0,c,f,h,p,g,d,m,v,y,x,_,S;if(o.b=n,o.e=i,n+="",i+="",i.substring(0,6)==="var(--"&&(i=Qe(t,i.substring(4,i.indexOf(")")))),i==="auto"&&(d=t.style[r],t.style[r]=i,i=Qe(t,r)||i,d?t.style[r]=d:nn(t,r)),c=[n,i],y0(c),n=c[0],i=c[1],h=n.match(Yn)||[],S=i.match(Yn)||[],S.length){for(;f=Yn.exec(i);)m=f[0],y=i.substring(l,f.index),g?g=(g+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(g=1),m!==(d=h[u++]||"")&&(p=parseFloat(d)||0,_=d.substr((p+"").length),m.charAt(1)==="="&&(m=Vn(p,m)+_),v=parseFloat(m),x=m.substr((v+"").length),l=Yn.lastIndex-x.length,x||(x=x||Je.units[r]||_,l===i.length&&(i+=x,o.e+=x)),_!==x&&(p=an(t,r,d,x)||0),o._pt={_next:o._pt,p:y||u===1?y:",",s:p,c:v-p,m:g&&g<4||r==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=r==="display"&&i==="none"?D0:E0;return Xm.test(i)&&(o.e=0),this._pt=o,o},Ph={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},NS=function(t){var r=t.split(" "),n=r[0],i=r[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),r[0]=Ph[n]||n,r[1]=Ph[i]||i,r.join(" ")},$S=function(t,r){if(r.tween&&r.tween._time===r.tween._dur){var n=r.t,i=n.style,a=r.u,s=n._gsap,o,l,u;if(a==="all"||a===!0)i.cssText="",l=1;else for(a=a.split(","),u=a.length;--u>-1;)o=a[u],Gr[o]&&(l=1,o=o==="transformOrigin"?Ue:Xt),nn(n,o);l&&(nn(n,Xt),s&&(s.svg&&n.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",ra(n,1),s.uncache=1,O0(i)))}},Za={clearProps:function(t,r,n,i,a){if(a.data!=="isFromStart"){var s=t._pt=new Be(t._pt,r,n,0,0,$S);return s.u=i,s.pr=-10,s.tween=a,t._props.push(n),1}}},ea=[1,0,0,1,0,0],L0={},q0=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Fh=function(t){var r=Qe(t,Xt);return q0(r)?ea:r.substr(7).match(Ym).map(ne)},hf=function(t,r){var n=t._gsap||xn(t),i=t.style,a=Fh(t),s,o,l,u;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,a=[l.a,l.b,l.c,l.d,l.e,l.f],a.join(",")==="1,0,0,1,0,0"?ea:a):(a===ea&&!t.offsetParent&&t!==Zn&&!n.svg&&(l=i.display,i.display="block",s=t.parentNode,(!s||!t.offsetParent&&!t.getBoundingClientRect().width)&&(u=1,o=t.nextElementSibling,Zn.appendChild(t)),a=Fh(t),l?i.display=l:nn(t,"display"),u&&(o?s.insertBefore(t,o):s?s.appendChild(t):Zn.removeChild(t))),r&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},wc=function(t,r,n,i,a,s){var o=t._gsap,l=a||hf(t,!0),u=o.xOrigin||0,c=o.yOrigin||0,f=o.xOffset||0,h=o.yOffset||0,p=l[0],g=l[1],d=l[2],m=l[3],v=l[4],y=l[5],x=r.split(" "),_=parseFloat(x[0])||0,S=parseFloat(x[1])||0,w,b,T,M;n?l!==ea&&(b=p*m-g*d)&&(T=_*(m/b)+S*(-d/b)+(d*y-m*v)/b,M=_*(-g/b)+S*(p/b)-(p*y-g*v)/b,_=T,S=M):(w=N0(t),_=w.x+(~x[0].indexOf("%")?_/100*w.width:_),S=w.y+(~(x[1]||x[0]).indexOf("%")?S/100*w.height:S)),i||i!==!1&&o.smooth?(v=_-u,y=S-c,o.xOffset=f+(v*p+y*d)-v,o.yOffset=h+(v*g+y*m)-y):o.xOffset=o.yOffset=0,o.xOrigin=_,o.yOrigin=S,o.smooth=!!i,o.origin=r,o.originIsAbsolute=!!n,t.style[Ue]="0px 0px",s&&(Qr(s,o,"xOrigin",u,_),Qr(s,o,"yOrigin",c,S),Qr(s,o,"xOffset",f,o.xOffset),Qr(s,o,"yOffset",h,o.yOffset)),t.setAttribute("data-svg-origin",_+" "+S)},ra=function(t,r){var n=t._gsap||new b0(t);if("x"in n&&!r&&!n.uncache)return n;var i=t.style,a=n.scaleX<0,s="px",o="deg",l=getComputedStyle(t),u=Qe(t,Ue)||"0",c,f,h,p,g,d,m,v,y,x,_,S,w,b,T,M,C,A,F,E,N,U,P,O,j,X,et,at,tt,G,W,$;return c=f=h=d=m=v=y=x=_=0,p=g=1,n.svg=!!(t.getCTM&&$0(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Xt]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Xt]!=="none"?l[Xt]:"")),i.scale=i.rotate=i.translate="none"),b=hf(t,n.svg),n.svg&&(n.uncache?(j=t.getBBox(),u=n.xOrigin-j.x+"px "+(n.yOrigin-j.y)+"px",O=""):O=!r&&t.getAttribute("data-svg-origin"),wc(t,O||u,!!O||n.originIsAbsolute,n.smooth!==!1,b)),S=n.xOrigin||0,w=n.yOrigin||0,b!==ea&&(A=b[0],F=b[1],E=b[2],N=b[3],c=U=b[4],f=P=b[5],b.length===6?(p=Math.sqrt(A*A+F*F),g=Math.sqrt(N*N+E*E),d=A||F?Bn(F,A)*gn:0,y=E||N?Bn(E,N)*gn+d:0,y&&(g*=Math.abs(Math.cos(y*Qn))),n.svg&&(c-=S-(S*A+w*E),f-=w-(S*F+w*N))):($=b[6],G=b[7],et=b[8],at=b[9],tt=b[10],W=b[11],c=b[12],f=b[13],h=b[14],T=Bn($,tt),m=T*gn,T&&(M=Math.cos(-T),C=Math.sin(-T),O=U*M+et*C,j=P*M+at*C,X=$*M+tt*C,et=U*-C+et*M,at=P*-C+at*M,tt=$*-C+tt*M,W=G*-C+W*M,U=O,P=j,$=X),T=Bn(-E,tt),v=T*gn,T&&(M=Math.cos(-T),C=Math.sin(-T),O=A*M-et*C,j=F*M-at*C,X=E*M-tt*C,W=N*C+W*M,A=O,F=j,E=X),T=Bn(F,A),d=T*gn,T&&(M=Math.cos(T),C=Math.sin(T),O=A*M+F*C,j=U*M+P*C,F=F*M-A*C,P=P*M-U*C,A=O,U=j),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,v=180-v),p=ne(Math.sqrt(A*A+F*F+E*E)),g=ne(Math.sqrt(P*P+$*$)),T=Bn(U,P),y=Math.abs(T)>2e-4?T*gn:0,_=W?1/(W<0?-W:W):0),n.svg&&(O=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!q0(Qe(t,Xt)),O&&t.setAttribute("transform",O))),Math.abs(y)>90&&Math.abs(y)<270&&(a?(p*=-1,y+=d<=0?180:-180,d+=d<=0?180:-180):(g*=-1,y+=y<=0?180:-180)),r=r||n.uncache,n.x=c-((n.xPercent=c&&(!r&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+s,n.y=f-((n.yPercent=f&&(!r&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+s,n.z=h+s,n.scaleX=ne(p),n.scaleY=ne(g),n.rotation=ne(d)+o,n.rotationX=ne(m)+o,n.rotationY=ne(v)+o,n.skewX=y+o,n.skewY=x+o,n.transformPerspective=_+s,(n.zOrigin=parseFloat(u.split(" ")[2])||!r&&n.zOrigin||0)&&(i[Ue]=Qa(u)),n.xOffset=n.yOffset=0,n.force3D=Je.force3D,n.renderTransform=n.svg?qS:F0?I0:LS,n.uncache=0,n},Qa=function(t){return(t=t.split(" "))[0]+" "+t[1]},Gs=function(t,r,n){var i=Re(r);return ne(parseFloat(r)+parseFloat(an(t,"x",n+"px",i)))+i},LS=function(t,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,I0(t,r)},hn="0deg",Mi="0px",pn=") ",I0=function(t,r){var n=r||this,i=n.xPercent,a=n.yPercent,s=n.x,o=n.y,l=n.z,u=n.rotation,c=n.rotationY,f=n.rotationX,h=n.skewX,p=n.skewY,g=n.scaleX,d=n.scaleY,m=n.transformPerspective,v=n.force3D,y=n.target,x=n.zOrigin,_="",S=v==="auto"&&t&&t!==1||v===!0;if(x&&(f!==hn||c!==hn)){var w=parseFloat(c)*Qn,b=Math.sin(w),T=Math.cos(w),M;w=parseFloat(f)*Qn,M=Math.cos(w),s=Gs(y,s,b*M*-x),o=Gs(y,o,-Math.sin(w)*-x),l=Gs(y,l,T*M*-x+x)}m!==Mi&&(_+="perspective("+m+pn),(i||a)&&(_+="translate("+i+"%, "+a+"%) "),(S||s!==Mi||o!==Mi||l!==Mi)&&(_+=l!==Mi||S?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+pn),u!==hn&&(_+="rotate("+u+pn),c!==hn&&(_+="rotateY("+c+pn),f!==hn&&(_+="rotateX("+f+pn),(h!==hn||p!==hn)&&(_+="skew("+h+", "+p+pn),(g!==1||d!==1)&&(_+="scale("+g+", "+d+pn),y.style[Xt]=_||"translate(0, 0)"},qS=function(t,r){var n=r||this,i=n.xPercent,a=n.yPercent,s=n.x,o=n.y,l=n.rotation,u=n.skewX,c=n.skewY,f=n.scaleX,h=n.scaleY,p=n.target,g=n.xOrigin,d=n.yOrigin,m=n.xOffset,v=n.yOffset,y=n.forceCSS,x=parseFloat(s),_=parseFloat(o),S,w,b,T,M;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=Qn,u*=Qn,S=Math.cos(l)*f,w=Math.sin(l)*f,b=Math.sin(l-u)*-h,T=Math.cos(l-u)*h,u&&(c*=Qn,M=Math.tan(u-c),M=Math.sqrt(1+M*M),b*=M,T*=M,c&&(M=Math.tan(c),M=Math.sqrt(1+M*M),S*=M,w*=M)),S=ne(S),w=ne(w),b=ne(b),T=ne(T)):(S=f,T=h,w=b=0),(x&&!~(s+"").indexOf("px")||_&&!~(o+"").indexOf("px"))&&(x=an(p,"x",s,"px"),_=an(p,"y",o,"px")),(g||d||m||v)&&(x=ne(x+g-(g*S+d*b)+m),_=ne(_+d-(g*w+d*T)+v)),(i||a)&&(M=p.getBBox(),x=ne(x+i/100*M.width),_=ne(_+a/100*M.height)),M="matrix("+S+","+w+","+b+","+T+","+x+","+_+")",p.setAttribute("transform",M),y&&(p.style[Xt]=M)},IS=function(t,r,n,i,a){var s=360,o=ye(a),l=parseFloat(a)*(o&&~a.indexOf("rad")?gn:1),u=l-i,c=i+u+"deg",f,h;return o&&(f=a.split("_")[1],f==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),f==="cw"&&u<0?u=(u+s*kh)%s-~~(u/s)*s:f==="ccw"&&u>0&&(u=(u-s*kh)%s-~~(u/s)*s)),t._pt=h=new Be(t._pt,r,n,i,u,bS),h.e=c,h.u="deg",t._props.push(n),h},Nh=function(t,r){for(var n in r)t[n]=r[n];return t},zS=function(t,r,n){var i=Nh({},n._gsap),a="perspective,force3D,transformOrigin,svgOrigin",s=n.style,o,l,u,c,f,h,p,g;i.svg?(u=n.getAttribute("transform"),n.setAttribute("transform",""),s[Xt]=r,o=ra(n,1),nn(n,Xt),n.setAttribute("transform",u)):(u=getComputedStyle(n)[Xt],s[Xt]=r,o=ra(n,1),s[Xt]=u);for(l in Gr)u=i[l],c=o[l],u!==c&&a.indexOf(l)<0&&(p=Re(u),g=Re(c),f=p!==g?an(n,l,u,g):parseFloat(u),h=parseFloat(c),t._pt=new Be(t._pt,o,l,f,h-f,vc),t._pt.u=g||0,t._props.push(l));Nh(o,i)};ze("padding,margin,Width,Radius",function(e,t){var r="Top",n="Right",i="Bottom",a="Left",s=(t<3?[r,n,i,a]:[r+a,r+n,i+n,i+a]).map(function(o){return t<2?e+o:"border"+o+e});Za[t>1?"border"+e:e]=function(o,l,u,c,f){var h,p;if(arguments.length<4)return h=s.map(function(g){return Nr(o,g,u)}),p=h.join(" "),p.split(h[0]).length===5?h[0]:p;h=(c+"").split(" "),p={},s.forEach(function(g,d){return p[g]=h[d]=h[d]||h[(d-1)/2|0]}),o.init(l,p,f)}});var z0={name:"css",register:bc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,r,n,i,a){var s=this._props,o=t.style,l=n.vars.startAt,u,c,f,h,p,g,d,m,v,y,x,_,S,w,b,T,M;uf||bc(),this.styles=this.styles||P0(t),T=this.styles.props,this.tween=n;for(d in r)if(d!=="autoRound"&&(c=r[d],!(Ke[d]&&w0(d,r,n,i,t,a)))){if(p=typeof c,g=Za[d],p==="function"&&(c=c.call(n,i,t,a),p=typeof c),p==="string"&&~c.indexOf("random(")&&(c=Qi(c)),g)g(this,t,d,c,n)&&(b=1);else if(d.substr(0,2)==="--")u=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",tn.lastIndex=0,tn.test(u)||(m=Re(u),v=Re(c),v?m!==v&&(u=an(t,d,u,v)+v):m&&(c+=m)),this.add(o,"setProperty",u,c,i,a,0,0,d),s.push(d),T.push(d,0,o[d]);else if(p!=="undefined"){if(l&&d in l?(u=typeof l[d]=="function"?l[d].call(n,i,t,a):l[d],ye(u)&&~u.indexOf("random(")&&(u=Qi(u)),Re(u+"")||u==="auto"||(u+=Je.units[d]||Re(Nr(t,d))||""),(u+"").charAt(1)==="="&&(u=Nr(t,d))):u=Nr(t,d),h=parseFloat(u),y=p==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),f=parseFloat(c),d in Sr&&(d==="autoAlpha"&&(h===1&&Nr(t,"visibility")==="hidden"&&f&&(h=0),T.push("visibility",0,o.visibility),Qr(this,o,"visibility",h?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Sr[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in Gr,x){if(this.styles.save(d),M=c,p==="string"&&c.substring(0,6)==="var(--"){if(c=Qe(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var C=t.style.perspective;t.style.perspective=c,c=Qe(t,"perspective"),C?t.style.perspective=C:nn(t,"perspective")}f=parseFloat(c)}if(_||(S=t._gsap,S.renderTransform&&!r.parseTransform||ra(t,r.parseTransform),w=r.smoothOrigin!==!1&&S.smooth,_=this._pt=new Be(this._pt,o,Xt,0,1,S.renderTransform,S,0,-1),_.dep=1),d==="scale")this._pt=new Be(this._pt,S,"scaleY",S.scaleY,(y?Vn(S.scaleY,y+f):f)-S.scaleY||0,vc),this._pt.u=0,s.push("scaleY",d),d+="X";else if(d==="transformOrigin"){T.push(Ue,0,o[Ue]),c=NS(c),S.svg?wc(t,c,0,w,0,this):(v=parseFloat(c.split(" ")[2])||0,v!==S.zOrigin&&Qr(this,S,"zOrigin",S.zOrigin,v),Qr(this,o,d,Qa(u),Qa(c)));continue}else if(d==="svgOrigin"){wc(t,c,1,w,0,this);continue}else if(d in L0){IS(this,S,d,h,y?Vn(h,y+c):c);continue}else if(d==="smoothOrigin"){Qr(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){zS(this,c,t);continue}}else d in o||(d=pi(d)||d);if(x||(f||f===0)&&(h||h===0)&&!xS.test(c)&&d in o)m=(u+"").substr((h+"").length),f||(f=0),v=Re(c)||(d in Je.units?Je.units[d]:m),m!==v&&(h=an(t,d,u,v)),this._pt=new Be(this._pt,x?S:o,d,h,(y?Vn(h,y+f):f)-h,!x&&(v==="px"||d==="zIndex")&&r.autoRound!==!1?TS:vc),this._pt.u=v||0,x&&M!==c?(this._pt.b=u,this._pt.e=M,this._pt.r=SS):m!==v&&v!=="%"&&(this._pt.b=u,this._pt.r=wS);else if(d in o)FS.call(this,t,d,u,y?y+c:c);else if(d in t)this.add(t,d,u||t[d],y?y+c:c,i,a);else if(d!=="parseTransform"){Qc(d,c);continue}x||(d in o?T.push(d,0,o[d]):typeof t[d]=="function"?T.push(d,2,t[d]()):T.push(d,1,u||t[d])),s.push(d)}}b&&k0(this)},render:function(t,r){if(r.tween._time||!cf())for(var n=r._pt;n;)n.r(t,n.d),n=n._next;else r.styles.revert()},get:Nr,aliases:Sr,getSetter:function(t,r,n){var i=Sr[r];return i&&i.indexOf(",")<0&&(r=i),r in Gr&&r!==Ue&&(t._gsap.x||Nr(t,"x"))?n&&Ch===n?r==="scale"?kS:CS:(Ch=n||{})&&(r==="scale"?RS:ES):t.style&&!Kc(t.style[r])?MS:~r.indexOf("-")?AS:of(t,r)},core:{_removeProperty:nn,_getMatrix:hf}};He.utils.checkPrefix=pi;He.core.getStyleSaver=P0;(function(e,t,r,n){var i=ze(e+","+t+","+r,function(a){Gr[a]=1});ze(t,function(a){Je.units[a]="deg",L0[a]=1}),Sr[i[13]]=e+","+t,ze(n,function(a){var s=a.split(":");Sr[s[1]]=i[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ze("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){Je.units[e]="px"});He.registerPlugin(z0);var Sc=He.registerPlugin(z0)||He;Sc.core.Tween;const Un={IN_OUT:"power2.inOut",OUT:"power2.out"},Ai={NO_STAGGER:0,RIPPLE_STAGGER_DELAY:.05};class B0{constructor(t,r={}){xi(this,"timeline");xi(this,"currentStage","");xi(this,"callbacks");xi(this,"durations");this.durations=t,this.callbacks=r,this.timeline=Sc.timeline({paused:!0,onUpdate:()=>this.handleProgress(),onComplete:()=>{var i,a,s,o;(a=(i=this.callbacks).onComplete)==null||a.call(i),(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"complete")}});let n=0;this.timeline.addLabel("seatsToRings",n),n+=t.seatsToRings/1e3,this.timeline.addLabel("ringsToBar",n),n+=t.ringsToBar/1e3,this.timeline.addLabel("axesReveal",n),n+=t.axesReveal/1e3,this.timeline.addLabel("barSlide",n),n+=t.barSlide/1e3,this.timeline.addLabel("barsGrow",n),n+=t.barsGrow/1e3,this.timeline.addLabel("barsToArea",n)}animateSeatsToRings(t,r){const n=this.durations.seatsToRings/1e3;return t.each(function(){const i=this;if(!i.getAttribute("data-orig-x")){const a=i.getAttribute("x"),s=i.getAttribute("y"),o=i.getAttribute("width"),l=i.getAttribute("height");i.setAttribute("data-orig-x",a||"0"),i.setAttribute("data-orig-y",s||"0"),i.setAttribute("data-orig-width",o||"0"),i.setAttribute("data-orig-height",l||"0")}}),this.timeline.to(t.nodes(),{width:2,y:(i,a)=>parseFloat(a.getAttribute("y")||"0"),height:(i,a)=>{const s=parseFloat(a.getAttribute("y")||"0");return r-s},duration:n,ease:Un.IN_OUT,stagger:Ai.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="seatsToRings",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"seatsToRings")}},"seatsToRings"),this}animateRingsToBar(t,r){const n=this.durations.ringsToBar/1e3;return t.each(function(i,a){const s=this;if(!r[a])return;const l=s.getAttribute("x"),u=s.getAttribute("y"),c=s.getAttribute("width"),f=s.getAttribute("height");s.setAttribute("data-orig-x",l||"0"),s.setAttribute("data-orig-y",u||"0"),s.setAttribute("data-orig-width",c||"0"),s.setAttribute("data-orig-height",f||"0")}),this.timeline.to(t.nodes(),{x:i=>{var a;return((a=r[i])==null?void 0:a.x)??0},y:i=>{var a;return((a=r[i])==null?void 0:a.y)??0},width:i=>{var a;return((a=r[i])==null?void 0:a.width)??0},height:i=>{var a;return((a=r[i])==null?void 0:a.height)??0},duration:n,ease:Un.IN_OUT,stagger:Ai.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="ringsToBar",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"ringsToBar")}},"ringsToBar"),this}animateAxesReveal(t,r){const n=this.durations.axesReveal/1e3;return this.timeline.to([t.node(),r.node()],{opacity:1,duration:n,ease:Un.IN_OUT,stagger:Ai.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="axesReveal",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"axesReveal")}},"axesReveal"),this}animateBarSlide(t,r){const n=this.durations.barSlide/1e3;return this.timeline.to(t.nodes(),{x:r,duration:n,ease:Un.OUT,stagger:Ai.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="barSlide",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"barSlide")}},"barSlide"),this}animateBarsGrow(t,r,n=Ai.RIPPLE_STAGGER_DELAY){const i=this.durations.barsGrow/1e3;return t.nodes().forEach((s,o)=>{const l=s,u=l.getAttribute("data-final-y")||"0",c=l.getAttribute("data-final-height")||"0",f=parseInt(l.getAttribute("data-timestamp-index")||"0"),p=Math.abs(f-r)*n;this.timeline.fromTo(l,{height:0,y:parseFloat(l.getAttribute("data-chart-baseline")||"400")},{y:parseFloat(u),height:parseFloat(c),duration:i,delay:p,ease:Un.OUT},"barsGrow")}),this.timeline.call(()=>{var s,o;this.currentStage="barsGrow",(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"barsGrow")},[],"barsGrow"),this}animateBarsToArea(t,r,n,i){const a=this.durations.barsToArea/1e3,s=new Map;return t.each(function(){var c;const o=this,l=o.getAttribute("class");if(!l)return;const u=l.match(/category-([\w-]+)/);if(u&&u[1]){const f=u[1];s.has(f)||s.set(f,[]),(c=s.get(f))==null||c.push(o)}}),this.timeline.set(t.nodes(),{opacity:0},"barsToArea"),this.timeline.set(r.nodes(),{opacity:1},"barsToArea"),r.each(function(){const o=this,l=o.getAttribute("data-category");if(!l)return;const u=n.get(l);u&&Sc.to(o,{attr:{d:u},duration:a,ease:Un.IN_OUT})}),this.timeline.call(()=>{var o,l;this.currentStage="barsToArea",(l=(o=this.callbacks).onStageComplete)==null||l.call(o,"barsToArea")},[],"barsToArea"),this}handleProgress(){var r,n;const t=this.timeline.progress();(n=(r=this.callbacks).onProgress)==null||n.call(r,t)}getControls(){return{play:()=>this.timeline.play(),pause:()=>this.timeline.pause(),reverse:()=>this.timeline.reverse(),restart:()=>this.timeline.restart(),seek:t=>this.timeline.progress(t),seekToStage:t=>{const r=this.timeline.labels[t];r!==void 0&&this.timeline.seek(r)},kill:()=>this.timeline.kill(),getProgress:()=>this.timeline.progress(),getCurrentStage:()=>this.currentStage,getTimeline:()=>this.timeline}}play(){this.timeline.play()}destroy(){this.timeline.kill()}}function BS(e,t){const{arcAngle:r,arcAngleFlexibility:n=5,radius:i,seatSize:a,minSeatSize:s,maxSeatSize:o,spacing:l,innerRadiusRatio:u}=t,c=i*u,f=e.reduce((F,E)=>F+E.seats,0);let h={seatSize:a,arcAngle:r,score:-1};const p=r-n,g=r+n;for(let F=p;F<=g;F+=2.5){const E=F*Math.PI/180;for(let N=o;N>=s;N-=.1){const U=N*2,P=U*l,O=Math.floor((i-c)/P);for(let j=1;j<=Math.min(O,10);j++){let X=0;for(let et=0;et<j;et++){const at=c+(et+.5)*P,tt=U*l/at,G=Math.floor(E/tt);X+=G}if(X>=f){const et=f/X,at=(N-s)/(o-s),tt=(X-f)/f,G=tt<.15?1:tt<.3?.7:tt<.5?.4:.1,W=1-Math.abs(F-r)/n,$=G*.5+at*.3+et*.15+W*.05;$>h.score&&(h={seatSize:N,arcAngle:F,rings:j,score:$})}}}}const d=h.seatSize,m=h.arcAngle,v=m*Math.PI/180,y=d*2,x=y*l,_=Math.floor((i-c)/x),S=[],w=-v/2-Math.PI/2,b=[];let T=0,M=[];for(let F=1;F<=_;F++){let E=0;const N=[];for(let U=0;U<F;U++){const P=c+(U+.5)*x,O=y*l/P,j=Math.floor(v/O);N.push(j),E+=j}if(E>=f){T=F,M=N;break}}if(T>0)b.push(...M);else for(let F=0;F<_;F++){const E=c+(F+.5)*x,N=y*l/E,U=Math.floor(v/N);b.push(U)}for(let F=0;F<b.length;F++){const E=c+(F+.5)*x,N=b[F]??0;if(N>0){const U=v/N;for(let P=0;P<N;P++){const O=w+(P+.5)*U,j=Math.cos(O)*E,X=Math.sin(O)*E;S.push({ring:F,index:P,angle:O,x:j,y:X})}}}S.sort((F,E)=>{const N=F.angle-E.angle;return Math.abs(N)>.001?N:F.ring-E.ring});const C=[];let A=0;return e.forEach((F,E)=>{const N=Math.min(F.seats,S.length-A);for(let U=0;U<N&&A<S.length;U++){const P=S[A++];P&&C.push({x:P.x,y:P.y,category:F.name,categoryIndex:E,seatIndex:U,ring:P.ring,angle:P.angle,radius:d})}}),{arcAngle:m,radius:i,innerRadius:c,centerX:i,centerY:i,seatSize:d,seats:C,totalSeats:f}}function US(e,t,r){const n=t<=r?1:r/t;return e.filter(i=>i.value>0).map(i=>{const a=t<=r?i.value:Math.max(1,Math.floor(i.value*n));return{id:i.dataKey,name:i.label,seats:a,colour:i.color}})}function Ja({svg:e,events:t,xScale:r,chartHeight:n,chartWidth:i,timelineHeight:a,timelineOffset:s,instanceId:o,setHoveredTimelineEvent:l,enableBrush:u=!1,onTimeRangeChange:c,minAllowedTime:f,maxAllowedTime:h,brushColor:p="#69b3a2",mainGroupSelector:g}){const d=n+s,m=o?`.main-chart-group-${o}`:".main-chart-group",v=e.select(g??m),y=o?`timeline-track timeline-track-${o}`:"timeline-track",x=v.append("g").attr("class",y),_=6,S=o?`timeline-clip-${o}`:`timeline-clip-${Math.random().toString(36).substr(2,9)}`;e.append("defs").append("clipPath").attr("id",S).append("rect").attr("x",0).attr("y",d).attr("width",i+_).attr("height",a),x.append("rect").attr("class","timeline-background").attr("x",0).attr("y",d).attr("width",i).attr("height",a).attr("fill","#FFFFFF").attr("stroke","#9CA3AF").attr("stroke-width",1);const w=x.append("g").attr("clip-path",`url(#${S})`),b=3,T=w.selectAll(".timeline-event").data(t).enter().append("rect").attr("class","timeline-event").attr("x",C=>r(new Date(C.timestamp))-b/2).attr("y",d).attr("width",b).attr("height",a).attr("fill",C=>C.color||"#2F42FF").attr("stroke","none").attr("cursor","pointer").attr("data-timestamp",C=>C.timestamp).attr("data-event-name",C=>C.eventName),M=6;if(T.on("mouseenter",function(C,A){const F=Ct(this),E=r(new Date(A.timestamp));F.transition().duration(150).attr("x",E-M/2).attr("width",M),l&&l({timestamp:A.timestamp,eventName:A.eventName,x:E})}).on("mouseleave",function(C,A){const F=Ct(this),E=r(new Date(A.timestamp));F.transition().duration(150).attr("x",E-b/2).attr("width",b),l&&l(null)}),u&&c){const C=f,A=h,F=gi().extent([[0,d],[i,d+a]]).on("start",U=>{if(!U.selection&&C!==void 0&&A!==void 0){const P=U.sourceEvent;if(P){const O=P.offsetX,j=+r.invert(O);if(j<C||j>A){const X=o?`.timeline-brush-${o}`:".timeline-brush";e.select(X).call(F.move,null);return}}}}).on("brush",U=>{if(!U.selection)return;const[P,O]=U.selection;let j=+r.invert(P),X=+r.invert(O);C!==void 0&&(j=Math.max(j,C),X=Math.max(X,C)),A!==void 0&&(j=Math.min(j,A),X=Math.min(X,A));const et=r(new Date(j)),at=r(new Date(X));if(et!==P||at!==O){const tt=o?`.timeline-brush-${o}`:".timeline-brush";e.select(tt).call(F.move,[et,at])}}).on("end",U=>{if(!U.selection)return;const[P,O]=U.selection,j=[+r.invert(P),+r.invert(O)];C!==void 0&&(j[0]=Math.max(j[0],C)),A!==void 0&&(j[1]=Math.min(j[1],A)),c(j);const X=o?`.timeline-brush-${o}`:".timeline-brush";e.select(X).call(F.move,null)}),E=o?`timeline-brush timeline-brush-${o}`:"timeline-brush",N=v.append("g").attr("class",E).call(F);N.selectAll(".selection").attr("fill",p).attr("fill-opacity",.2).attr("stroke",p).attr("stroke-width",1),N.selectAll(".handle").attr("fill",p).attr("fill-opacity",.8),N.on("dblclick",()=>{const U=r.domain(),P=[+U[0],+U[1]];c(P)})}}const ur={neoGrey:{200:"#EDEFEF",400:"#ADB5BD"},neoDigitalGreen:{600:"#40c048"}},Ii=["#4CA75A","#FDDA04","#FFC008","#FF9800","#F9A91B","#FF5C24","#ED4134","#CB3446"],qe={greyHatch:{background:ur.neoGrey[200],lines:ur.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}};function HS(e,t){const r=e.append("pattern").attr("id",`${t}-greyHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");r.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.greyHatch.background),r.append("path").attr("d","M0,2 L8,2").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M0,6 L8,6").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5)}function GS(e,t){const r=e.append("pattern").attr("id",`${t}-dataMissingHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");r.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.dataMissingHatch.background),r.append("path").attr("d","M0,8 L8,0").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M-2,2 L2,-2").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M6,10 L10,6").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5)}function jS(e,t){const r=e.append("pattern").attr("id",`${t}-noLstHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");r.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.noLstHatch.background),r.append("path").attr("d","M0,0 L8,8").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M-2,6 L2,10").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M6,-2 L10,2").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5)}function ba(e,t){let r=e.select("defs");r.empty()&&(r=e.append("defs")),HS(r,t),GS(r,t),jS(r,t)}function $h(e,t){if(e.startsWith("url(#")&&e.endsWith(")")){const r=e.slice(5,-1);return`url(#${t}-${r})`}return e}function pf(e){return e.includes("greyHatchPattern")?qe.greyHatch.lines:e.includes("dataMissingHatchPattern")?qe.dataMissingHatch.lines:e.includes("noLstHatchPattern")?qe.noLstHatch.lines:e}function Tc(e,t,r,n){const{xScale:i,yScale:a,addClasses:s=!0,instanceId:o}=n,l=ss().x(h=>i(new Date(h.data.timestamp))).y0(h=>a(h[0])).y1(h=>a(h[1])).curve(Cn),u=Um().x(h=>i(new Date(h.data.timestamp))).y(h=>a(h[1])).curve(Cn),c=o?`areas areas-${o}`:"areas";let f=e.select(o?`.areas-${o}`:".areas");f.empty()&&(f=e.append("g").attr("class",c)),t.forEach((h,p)=>{var v;const g=r[p];if(!g)return;const d=((v=g.parliamentMapping)==null?void 0:v.isSpecialCategory)??!1,m=pf(g.color);if(d){const y=f.append("path").datum(h).attr("fill","none").attr("stroke",m).attr("stroke-width",3).attr("stroke-dasharray","15 8").attr("d",u).style("pointer-events","none");if(s){const x=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",x)}}else{const y=f.append("path").datum(h).attr("fill",g.color).attr("fill-opacity",g.fillOpacity??.7).attr("stroke",m).attr("stroke-width",g.strokeWidth??1.5).attr("d",l).style("pointer-events","none");if(s){const x=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",x)}}})}function YS(e,t){var n;const r=[];for(const i of e){let a=0;for(const s of t){const o=i[s.dataKey]||0,l=a,u=a+o;r.push({timestamp:i.timestamp,category:s.label,dataKey:s.dataKey,y0:l,y1:u,value:o,color:s.color,isSpecialCategory:((n=s.parliamentMapping)==null?void 0:n.isSpecialCategory)??!1}),a+=o}}return r}function ke(e){return e.replace(/[^a-zA-Z0-9-_]/g,"-")}function U0(e,t,r,n){const{centerX:i,centerY:a,addClasses:s=!0,instanceId:o,parliamentRadius:l=200}=n,u=o?`parliament parliament-${o}`:"parliament";let c=e.select(o?`.parliament-${o}`:".parliament");c.empty()&&(c=e.append("g").attr("class",u)),t.seats.forEach(p=>{const g=r.find(v=>v.label===p.category);if(!g)return;const d=c.append("circle").attr("cx",i+p.x).attr("cy",a+p.y).attr("r",p.radius).attr("fill",g.color).attr("stroke",g.color).attr("stroke-width",.5),m=c.append("circle").attr("cx",i+p.x).attr("cy",a+p.y).attr("r",p.radius*2.5).attr("fill","transparent").attr("stroke","none").attr("pointer-events","all");if(s){const v=o?`seat seat-${o} seat-${ke(p.category)}`:`seat seat-${ke(p.category)}`;d.attr("class",v),m.attr("class",v)}});const f=o?`parliament-label parliament-label-${o}`:"parliament-label";if(e.select(`.${f.split(" ")[0]}`).empty()){const p=e.append("g").attr("class",f).attr("transform",`translate(${i},${a-l*.15})`).style("opacity","0").style("pointer-events","none");p.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),p.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const g=p.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");g.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),g.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}}function XS(e,t,r,n,i,a,s=!1){var f;const o=new Map;let l=i;if(t.length>0&&((f=t[0])==null?void 0:f.timestamp)!==void 0){const h=t[0].timestamp;l=r(new Date(h))}const u=new Map;for(const h of e.seats)u.has(h.category)||u.set(h.category,[]),u.get(h.category).push(h);const c=new Map;for(const h of t)c.set(h.dataKey,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory}),h.label&&h.label!==h.dataKey&&c.set(h.label,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory});for(const h of e.seats){const p=c.get(h.category);if(!p){o.set(h,{x:l,y:a/2});continue}const g=n(p.y0),d=n(p.y1);let m;if(s){const v=u.get(h.category)??[],y=h.seatIndex,x=v.length;if(x===1)m=(g+d)/2;else{const _=y/(x-1);m=g+(d-g)*_}}else m=d;o.set(h,{x:l,y:m})}return o}function WS(e,t,r){var s;if(e.length===0)return[];const n=e[e.length-1],i=[];let a=0;for(const o of t){const l=n[o.dataKey]||0,u=a,c=a+l;i.push({dataKey:o.dataKey,label:o.label,y0:u,y1:c,value:l,timestamp:n.timestamp,isSpecialCategory:((s=o.parliamentMapping)==null?void 0:s.isSpecialCategory)??!1}),a+=l}return i}function KS(e){const t=e;return{seatsToLines:t*.2,seatsToBar:t*.07,crossFadePause:t*.003,barSlideToTimeline:t*.22,axesAndBarsGrow:t*.22,barsToArea:t*.287}}const _n=new Map;Ct.prototype.transition=Ic;const VS=({containerRef:e,data:t,categories:r,mode:n,width:i,height:a,margin:s,timeRange:o,showGrid:l=!0,showAxes:u=!0,axisLabelColor:c,axisLabelSize:f=14,formatDate:h,formatValue:p,markers:g=[],arcAngle:d=200,parliamentRadius:m=200,seatSize:v=4.5,animationDuration:y=900,onMorphComplete:x,onAnimationStateChange:_,onTimelineReady:S,onAnimationProgress:w,onHoveredDataChange:b,hoveredCategory:T,maxSeats:M=2e3,parliamentTimestamp:C,enableBrush:A=!1,onTimeRangeChange:F,minAllowedTime:E,maxAllowedTime:N,showScaleIndicator:U=!1,reposPerSeat:P=1,timelineEvents:O=[],showTimeline:j=!1,timelineHeight:X=40,timelineOffset:et=35,brushColor:at="#69b3a2"})=>{const[tt,G]=Q.useState("area"),[W,$]=Q.useState(!1),[K,L]=Q.useState(null),[B,k]=Q.useState(0),[I,q]=Q.useState(null),[R,nt]=Q.useState(null),[Y,Z]=Q.useState([]),lt=Q.useRef(null),rt=Q.useRef(n),ft=Q.useRef(!0),wt=Q.useRef(!1),st=Q.useRef(`morph-${Math.random().toString(36).substr(2,9)}`),_t=Q.useRef(void 0),Pt=Q.useRef(o),ot=Q.useRef(g),mt=Q.useRef(O),yt=Q.useRef(x),bt=Q.useRef(_),Ut=Q.useRef(S),qt=Q.useRef(w),$t=Q.useRef(b);Q.useEffect(()=>{yt.current=x,bt.current=_,Ut.current=S,qt.current=w,$t.current=b},[x,_,S,w,b]),Q.useEffect(()=>{if(e.current&&tt==="parliament")if(T){const xt=r.find(Lt=>Lt.dataKey===T);if(xt){const Lt=xt.label;if(L(Lt),Ui(e.current,Lt),t.length>0){const Zt=t[t.length-1],Ht=Math.round(Zt.values[xt.dataKey]||0),Wt={label:xt.label,value:Ht,color:pf(xt.color)};Bi(e.current,Wt,U,P,st.current)}}}else L(null),Ui(e.current,null),Bi(e.current,null,U,P,st.current)},[T,tt,r,t,U,P]);const le=i-s.left-s.right,It=a-s.top-s.bottom;return Q.useEffect(()=>{var kt;if(!e.current||t.length===0||r.length===0||(_t.current&&(_t.current(),_t.current=void 0),wt.current))return;const xt=Ct(e.current),Lt=n!==rt.current;ft.current?(xt.selectAll("*").remove(),ba(xt,st.current),ft.current=!1):Lt||(xt.selectAll("*").remove(),ba(xt,st.current));const Zt=t[t.length-1],Ht=r.reduce((ct,Rt)=>ct+(Zt.values[Rt.dataKey]||0),0),Wt=t.map(ct=>{const Rt={timestamp:ct.timestamp};for(const Ft of r)Rt[Ft.dataKey]=ct.values[Ft.dataKey]||0;return Rt}),je=r.map(ct=>ct.dataKey),ue=Ki().keys(je),fr=ue(Wt),ve=t.map(ct=>ct.timestamp),Ye=Lt||!o?Math.min(...ve):o[0],Te=Lt||!o?Math.max(...ve):o[1],nr=[...ve].sort((ct,Rt)=>ct-Rt),ge=[];for(let ct=0;ct<nr.length-1;ct++)ge.push(nr[ct+1]-nr[ct]);const At=ge.length>0?ge.reduce((ct,Rt)=>ct+Rt,0)/ge.length:0,Qt=Te+At*1.15,St=Kn().domain([new Date(Ye),new Date(Qt)]).range([0,le]),ie=Wt.filter(ct=>ct.timestamp>=Ye&&ct.timestamp<=Te),xe=ue(ie),Gt=xe.length>0?Math.max(...xe[xe.length-1].map(ct=>ct[1]??0)):0,Jt=ai().domain([0,Gt*1.15]).range([It,0]),ce=r.map(ct=>({...ct,color:$h(ct.color,st.current)})),ir=ce.map(ct=>({dataKey:ct.dataKey,label:ct.label,color:ct.color,value:Zt.values[ct.dataKey]||0})),H=US(ir,Ht,M).reverse(),ut=BS(H,{arcAngle:d,radius:m,seatSize:v,minSeatSize:4,maxSeatSize:30,spacing:1.1,innerRadiusRatio:.4});lt.current=ut;const pt=WS(Wt,r),Tt=XS(ut,pt,St,Jt,le,It);if(Lt&&!wt.current){wt.current=!0,$(!0),(kt=bt.current)==null||kt.call(bt,!0),q(null),Z([]),k(0);let ct=xt.select("g[transform]");if(ct.empty()&&(ct=xt.select("g")),ct.empty()){xt.selectAll("*").remove(),ba(xt,st.current),js(xt,n==="parliament"?"parliament":"area",fr,ce,ut,St,Jt,le,It,s,l,u,c,f,h,p,A,F,st.current,g,o,Z,q,O,j,X,et,nt,E,N,at),$(!1),G(n==="parliament"?"parliament":"area"),k(n==="parliament"?1:0),rt.current=n;return}const Rt=setTimeout(()=>{wt.current=!1,$(!1),rt.current=n},y*3);JS(xt,n,fr,ce,ut,Tt,St,Jt,le,It,s,y,()=>{var Ft,me,te;if(clearTimeout(Rt),wt.current=!1,$(!1),G(n==="parliament"?"parliament":"area"),n==="parliament"&&k(1),(Ft=bt.current)==null||Ft.call(bt,!1),(me=yt.current)==null||me.call(yt),rt.current=n,n==="parliament"&&e.current&&$t.current&&(_t.current=Ys(e.current,ce,t,K,L,$t.current,U,P,st.current)),n!=="parliament"&&e.current){L(null),(te=$t.current)==null||te.call($t,null),Bi(e.current,null,U,P,st.current);const De=Ct(e.current),fe=De.select(st.current?`.main-chart-group-${st.current}`:".main-chart-group");if(j){const Fe=st.current?`.timeline-track-${st.current}`:".timeline-track",Ne=st.current?`.timeline-brush-${st.current}`:".timeline-brush";fe.select(Fe).remove(),fe.select(Ne).remove(),Ja({svg:De,events:O,xScale:St,chartHeight:It,chartWidth:le,timelineHeight:X,timelineOffset:et,instanceId:st.current,setHoveredTimelineEvent:nt,enableBrush:A,onTimeRangeChange:F,minAllowedTime:E,maxAllowedTime:N,brushColor:at})}if(A&&F){const Fe=fe.select(st.current?`.chart-content-group-${st.current}`:".chart-content-group");ZS(Fe,le,It,St,F,st.current,De,E,N,at)}if(g.length>0&&Z&&q&&o){const Ne=g.filter(ee=>ee.timestamp>=(o[0]??0)-1&&ee.timestamp<=(o[1]??1/0)+1).map(ee=>({...ee,x:St(new Date(ee.timestamp))}));if(Z(Ne),Ne.length>0){Lh(fe,Ne,It,le,A,q,st.current);const ee=fe.select(st.current?`.markers-${st.current}`:".markers");if(!ee.empty()){fe.selectAll(".marker-hover-overlay").remove();const Pn=fe.select(st.current?`.chart-content-group-${st.current}`:".chart-content-group");let hr;A?hr=Pn.select(".brush .overlay"):hr=fe.append("rect").attr("class","marker-hover-overlay").attr("x",0).attr("y",0).attr("width",le).attr("height",It).attr("fill","none").attr("pointer-events","all");let kr=null;hr.on("mousemove",function(Fn){const[jr]=en(Fn,this);let Nn=null,pr=1/0;if(Ne.forEach(on=>{const V=Math.abs(jr-on.x);V<pr&&(pr=V,Nn=on)}),!Nn||pr>50){kr!==null&&(kr=null,ee.selectAll(".marker-line").attr("opacity",0),ee.selectAll(".marker-label").attr("opacity",0),q(null));return}const Rr=Nn;kr!==Rr.timestamp&&(kr=Rr.timestamp,ee.selectAll(".marker-line").attr("opacity",0),ee.selectAll(".marker-label").attr("opacity",0),ee.selectAll(".marker-line").filter(function(){return Ct(this).attr("data-timestamp")===String(Rr.timestamp)}).attr("opacity",.6),ee.selectAll(".marker-label").filter(function(){return Ct(this).attr("data-timestamp")===String(Rr.timestamp)}).attr("opacity",1),q(Rr))}),hr.on("mouseleave",function(){kr=null,ee.selectAll(".marker-line").attr("opacity",0),ee.selectAll(".marker-label").attr("opacity",0),q(null)})}}}}},u,f,h,p,Ut.current,(Ft,me)=>{var te;if(n==="parliament"&&Ft>=.95){const De=(Ft-.95)/.05;k(Math.min(De,1))}(te=qt.current)==null||te.call(qt,Ft,me)},C,st.current)}else rt.current=n,n==="parliament"&&(q(null),Z([])),js(xt,n==="parliament"?"parliament":"area",fr,ce,ut,St,Jt,le,It,s,l,u,c,f,h,p,A,F,st.current,g,o,Z,q,O,j,X,et,nt,E,N,at),G(n==="parliament"?"parliament":"area"),k(n==="parliament"?1:0),n==="parliament"&&e.current&&$t.current&&(_t.current=Ys(e.current,ce,t,K,L,$t.current,U,P,st.current));return()=>{_t.current&&(_t.current(),_t.current=void 0)}},[n]),Q.useEffect(()=>{var ie,xe;if(!e.current||t.length===0||wt.current)return;if(ft.current){Pt.current=o;return}if(!(o!==Pt.current&&((o==null?void 0:o[0])!==((ie=Pt.current)==null?void 0:ie[0])||(o==null?void 0:o[1])!==((xe=Pt.current)==null?void 0:xe[1]))))return;Pt.current=o;const Lt=Ct(e.current),Zt=t.map(Gt=>{const Jt={timestamp:Gt.timestamp};for(const ce of r)Jt[ce.dataKey]=Gt.values[ce.dataKey]||0;return Jt}),Ht=r.map(Gt=>Gt.dataKey),je=Ki().keys(Ht)(Zt),ue=t.map(Gt=>Gt.timestamp),fr=o?o[0]:Math.min(...ue),ve=o?o[1]:Math.max(...ue),Te=(ue.length>1?(ue[ue.length-1]-ue[0])/(ue.length-1):0)*.5,nr=Kn().domain([new Date(fr-Te),new Date(ve+Te)]).range([0,i-s.left-s.right]),ge=Math.max(...je[je.length-1].map(Gt=>Gt[1])),At=ai().domain([0,ge*1.1]).range([a-s.top-s.bottom,0]);if(!lt.current)return;const Qt=lt.current,St=r.map(Gt=>({...Gt,color:$h(Gt.color,st.current)}));Lt.selectAll("*").remove(),ba(Lt,st.current),js(Lt,tt==="parliament"?"parliament":"area",je,St,Qt,nr,At,i-s.left-s.right,a-s.top-s.bottom,s,l,u,c,f,h,p,A,F,st.current,g,o,Z,q,O,j,X,et,nt,E,N,at),tt==="parliament"&&e.current&&$t.current&&(_t.current=Ys(e.current,St,t,K,L,$t.current,U,P,st.current))},[o]),Q.useEffect(()=>{if(!e.current||t.length===0||wt.current)return;if(ft.current){ot.current=g,mt.current=O;return}if(tt==="parliament"){ot.current=g,mt.current=O;return}const xt=g.length!==ot.current.length||g.some((At,Qt)=>{var St,ie;return At.timestamp!==((St=ot.current[Qt])==null?void 0:St.timestamp)||At.label!==((ie=ot.current[Qt])==null?void 0:ie.label)}),Lt=O.length!==mt.current.length||O.some((At,Qt)=>{var St,ie;return At.timestamp!==((St=mt.current[Qt])==null?void 0:St.timestamp)||At.eventName!==((ie=mt.current[Qt])==null?void 0:ie.eventName)});if(!xt&&!Lt)return;ot.current=g,mt.current=O;const Zt=Ct(e.current),Ht=Zt.select(st.current?`.main-chart-group-${st.current}`:".main-chart-group");if(Ht.empty())return;const Wt=t.map(At=>At.timestamp),je=o?o[0]:Math.min(...Wt),ue=o?o[1]:Math.max(...Wt),ve=(Wt.length>1?(Wt[Wt.length-1]-Wt[0])/(Wt.length-1):0)*.5,Ye=i-s.left-s.right,Te=a-s.top-s.bottom,nr=Kn().domain([new Date(je-ve),new Date(ue+ve)]).range([0,Ye]);if(Lt&&j){const At=st.current?`.timeline-track-${st.current}`:".timeline-track",Qt=st.current?`.timeline-brush-${st.current}`:".timeline-brush";Ht.select(At).remove(),Ht.select(Qt).remove(),Ja({svg:Zt,events:O,xScale:nr,chartHeight:Te,chartWidth:Ye,timelineHeight:X,timelineOffset:et,instanceId:st.current,setHoveredTimelineEvent:nt,enableBrush:A,onTimeRangeChange:F,minAllowedTime:E,maxAllowedTime:N,brushColor:at})}let ge=[];if(xt&&g.length>0&&o){const At=st.current?`.markers-${st.current}`:".markers";Ht.select(At).remove();const Qt=1;ge=g.filter(St=>St.timestamp>=(o[0]??0)-Qt&&St.timestamp<=(o[1]??1/0)+Qt).map(St=>({...St,x:nr(new Date(St.timestamp))})),Z(ge),ge.length>0&&Lh(Ht,ge,Te,Ye,A,q,st.current)}if(ge.length>0){const At=Ht.select(st.current?`.markers-${st.current}`:".markers");if(!At.empty()){Ht.selectAll(".marker-hover-overlay").remove();const Qt=Ht.append("rect").attr("class","marker-hover-overlay").attr("x",0).attr("y",0).attr("width",Ye).attr("height",Te).attr("fill","none").attr("pointer-events","all");let St=null;Qt.on("mousemove",function(ie){const[xe]=en(ie,this);let Gt=null,Jt=1/0;if(ge.forEach(H=>{const ut=Math.abs(xe-H.x);ut<Jt&&(Jt=ut,Gt=H)}),!Gt||Jt>50){St!==null&&(St=null,At.selectAll(".marker-line").attr("opacity",0),At.selectAll(".marker-label").attr("opacity",0),q(null));return}const ir=Gt;St!==ir.timestamp&&(St=ir.timestamp,At.selectAll(".marker-line").attr("opacity",0),At.selectAll(".marker-label").attr("opacity",0),At.selectAll(".marker-line").filter(function(){return Ct(this).attr("data-timestamp")===String(ir.timestamp)}).attr("opacity",.6),At.selectAll(".marker-label").filter(function(){return Ct(this).attr("data-timestamp")===String(ir.timestamp)}).attr("opacity",1),q(ir))}),Qt.on("mouseleave",function(){St=null,At.selectAll(".marker-line").attr("opacity",0),At.selectAll(".marker-label").attr("opacity",0),q(null)})}}},[g,O,W]),{isMorphing:W,currentMode:tt,hoveredCategory:K,scaleIndicatorOpacity:B,visibleMarkers:Y,hoveredMarker:I,setHoveredMarker:q,hoveredTimelineEvent:R,setHoveredTimelineEvent:nt}};function ZS(e,t,r,n,i,a,s,o,l,u){const c=o,f=l,h=gi().extent([[0,0],[t,r]]).on("start",g=>{if(!g.selection&&c!==void 0&&f!==void 0){const d=g.sourceEvent;if(d){const m=d.offsetX,v=+n.invert(m);if(v<c||v>f){s.select(".brush").call(h.move,null);return}}}}).on("brush",g=>{if(!g.selection)return;const[d,m]=g.selection;let v=+n.invert(d),y=+n.invert(m);c!==void 0&&(v=Math.max(v,c),y=Math.max(y,c)),f!==void 0&&(v=Math.min(v,f),y=Math.min(y,f));const x=n(new Date(v)),_=n(new Date(y));(x!==d||_!==m)&&s.select(".brush").call(h.move,[x,_])}).on("end",g=>{if(!g.selection)return;const[d,m]=g.selection,v=[+n.invert(d),+n.invert(m)];c!==void 0&&(v[0]=Math.max(v[0],c)),f!==void 0&&(v[1]=Math.min(v[1],f)),i(v),s.select(".brush").call(h.move,null)}),p=e.append("g").attr("class","brush").call(h);p.selectAll(".selection").attr("fill",u).attr("fill-opacity",.2).attr("stroke",u).attr("stroke-width",1),p.selectAll(".handle").attr("fill",u).attr("fill-opacity",.8),p.on("dblclick",()=>{const g=n.domain(),d=[+g[0],+g[1]];o!==void 0&&(d[0]=Math.max(d[0],o)),l!==void 0&&(d[1]=Math.min(d[1],l)),i(d)})}function Lh(e,t,r,n,i,a,s){const o=s?`markers markers-${s}`:"markers",l=e.append("g").attr("class",o);t.forEach(u=>{l.append("line").attr("class","marker-line").attr("data-timestamp",u.timestamp).attr("x1",u.x).attr("x2",u.x).attr("y1",0).attr("y2",r).attr("stroke",u.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),u.label&&l.append("text").attr("class","marker-label").attr("data-timestamp",u.timestamp).attr("x",u.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",u.color??"#2F42FF").attr("opacity",0)})}function QS(e,t,r,n,i,a,s){let o=null,l;a?l=e.select(".brush .overlay"):l=e.append("rect").attr("class","marker-hover-overlay").attr("width",n).attr("height",i).attr("fill","none").attr("pointer-events","all");const u=c=>{let f=null,h=1/0;if(r.forEach(d=>{const m=Math.abs(c-d.x);m<h&&(h=m,f=d)}),!f||h>50)return o!==null&&(o=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null)),!1;const g=f;return o===g.timestamp||(o=g.timestamp,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),t.selectAll(".marker-line").filter(function(){return Ct(this).attr("data-timestamp")===String(g.timestamp)}).attr("opacity",.6),t.selectAll(".marker-label").filter(function(){return Ct(this).attr("data-timestamp")===String(g.timestamp)}).attr("opacity",1),s(g)),!0};l.on("mousemove",function(c){const[f]=en(c,this);u(f)}),l.on("mouseleave",function(){o=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null)})}function js(e,t,r,n,i,a,s,o,l,u,c,f,h,p,g,d,m=!1,v,y,x=[],_=[0,0],S,w,b=[],T=!1,M=40,C=15,A,F,E,N="#69b3a2"){const U=F,P=E;let O=null;const j=y?`main-chart-group main-chart-group-${y}`:"main-chart-group",X=e.append("g").attr("class",j).attr("transform",`translate(${u.left},${u.top})`),et=y?`chart-clip-${y}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`;e.select("defs").append("clipPath").attr("id",et).append("rect").attr("x",0).attr("y",0).attr("width",o).attr("height",l);const at=y?`chart-content-group chart-content-group-${y}`:"chart-content-group",tt=X.append("g").attr("class",at).attr("clip-path",`url(#${et})`);if(c&&t!=="parliament"&&(tt.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qr(a).ticks(6).tickSize(l).tickFormat(()=>"")),tt.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(Ir(s).ticks(5).tickSize(-o).tickFormat(()=>""))),t==="area"&&(Tc(tt,r,n,{xScale:a,yScale:s,addClasses:!0,instanceId:y}),x.length>0)){const W=x.filter($=>$.timestamp>=_[0]-1&&$.timestamp<=_[1]+1).map($=>({...$,x:a(new Date($.timestamp))}));O={markersGroup:null,visibleMarkers:W},S&&S(W)}if(t==="parliament"){const G=o/2,W=i.radius+10,$=l-i.radius*.3,K=Math.max(W,$);U0(tt,i,n,{centerX:G,centerY:K,addClasses:!0,instanceId:y,parliamentRadius:i.radius})}if(f&&t!=="parliament"){const W=qr(a).ticks(6).tickPadding(12);g&&W.tickFormat(I=>g(+I));const K=X.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).call(W).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&K.attr("fill",h);const L=Ir(s).ticks(5);L.tickFormat(I=>+I==0?"":d?d(+I):String(I));const k=X.append("g").attr("class","axis axis-y").call(L).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&k.attr("fill",h)}if(m&&v&&t==="area"){const G=U,W=P,$=gi().extent([[0,0],[o,l]]).on("start",L=>{if(!L.selection&&G!==void 0&&W!==void 0){const B=L.sourceEvent;if(B){const k=B.offsetX-((u==null?void 0:u.left)||0),I=+a.invert(k);if(I<G||I>W){e.select(".brush").call($.move,null);return}}}}).on("brush",L=>{if(!L.selection)return;const[B,k]=L.selection;let I=+a.invert(B),q=+a.invert(k);G!==void 0&&(I=Math.max(I,G),q=Math.max(q,G)),W!==void 0&&(I=Math.min(I,W),q=Math.min(q,W));const R=a(new Date(I)),nt=a(new Date(q));(R!==B||nt!==k)&&e.select(".brush").call($.move,[R,nt])}).on("end",L=>{if(!L.selection)return;const[B,k]=L.selection,I=[+a.invert(B),+a.invert(k)];G!==void 0&&(I[0]=Math.max(I[0],G)),W!==void 0&&(I[1]=Math.min(I[1],W)),v(I),e.select(".brush").call($.move,null)}),K=tt.append("g").attr("class","brush").call($);K.selectAll(".selection").attr("fill",N).attr("fill-opacity",.2).attr("stroke",N).attr("stroke-width",1),K.selectAll(".handle").attr("fill",N).attr("fill-opacity",.8),K.on("dblclick",()=>{const L=a.domain(),B=[+L[0],+L[1]];v(B)})}if(t==="area"&&O&&O.visibleMarkers.length>0){const G=X.append("g").attr("class","markers").attr("clip-path",`url(#${et})`);O.visibleMarkers.forEach(W=>{G.append("line").attr("class","marker-line").attr("data-timestamp",W.timestamp).attr("x1",W.x).attr("x2",W.x).attr("y1",0).attr("y2",l).attr("stroke",W.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),W.label&&G.append("text").attr("class","marker-label").attr("data-timestamp",W.timestamp).attr("x",W.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",W.color??"#2F42FF").attr("opacity",0)}),O.markersGroup=G}t==="area"&&T&&A&&Ja({svg:e,events:b,xScale:a,chartHeight:l,chartWidth:o,timelineHeight:M,timelineOffset:C,instanceId:y,setHoveredTimelineEvent:A,enableBrush:m,onTimeRangeChange:v,minAllowedTime:U,maxAllowedTime:P,brushColor:N}),O&&O.visibleMarkers.length>0&&w&&t==="area"&&QS(tt,O.markersGroup,O.visibleMarkers,o,l,m,w)}function JS(e,t,r,n,i,a,s,o,l,u,c,f,h,p=!0,g=14,d,m,v,y,x,_){const S=e.select(_?`.main-chart-group-${_}`:".main-chart-group");S.selectAll(".markers").remove(),S.selectAll(".marker-hover-overlay").remove(),S.selectAll(".brush").remove(),t==="stacked-area"||t==="area"?tT(S,r,n,i,a,s,o,l,u,f,h,p,g,d,m,v,y,x,_):eT(S,r,n,i,a,s,o,l,u,f,h,p,g,d,m,v,y,x,_)}function zi(e,t,r,n,i,a,s,o){const l=e[a];if(!l)return"";const u=l.find(w=>w.data.timestamp===s);if(!u)return"";const c=u.data,f=t[a];if(!f)return"";const h=f.dataKey,p=c[h];if(!p||p<=0)return"";const g=r.get(s);if(!g)return"";const d=g.x,m=g.width,v=u[0],y=u[1],x=o?i:n(v),_=o?i:n(y),S=[];return S.push(`M ${d} ${x}`),S.push(`L ${d} ${_}`),S.push(`L ${d+m} ${_}`),S.push(`L ${d+m} ${x}`),S.push("Z"),S.join(" ")}function tT(e,t,r,n,i,a,s,o,l,u,c,f=!0,h=14,p,g,d,m,v,y){var on;const x=y?`.seat-${y}`:".seat",_=e.selectAll(x),S=y?`.chart-content-group-${y}`:".chart-content-group";let w=e.select(S);if(w.empty()){const V=e.attr("clip-path"),it=V?((on=V.match(/url\(#(.+)\)/))==null?void 0:on[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,ht=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";w=e.append("g").attr("class",ht).attr("clip-path",`url(#${it})`)}if(_.size()===0){Tc(e,t,r,{xScale:a,yScale:s,addClasses:!0,instanceId:y}),c();return}const b=KS(u),T=y?_n.get(y):void 0;T&&(T.destroy(),y&&_n.delete(y));const M=V=>V<.2?"seatsToRings":V<.35?"ringsToBar":V<.464?"axesReveal":V<.6?"barSlide":V<.82?"barsGrow":"barsToArea",C=new B0({seatsToRings:b.seatsToLines,ringsToBar:b.seatsToBar,axesReveal:b.barSlideToTimeline*.3,barSlide:b.barSlideToTimeline*.7,barsGrow:b.axesAndBarsGrow,barsToArea:b.barsToArea},{onStageComplete:V=>{},onProgress:V=>{if(m){const it=M(V);m(V,it)}},onComplete:()=>{c()}});y&&_n.set(y,C),d&&d(C.getControls().getTimeline());const A=t[0].map(V=>V.data),F=YS(A,r),E=o/2,N=n.radius+10,U=l-n.radius*.3,P=Math.max(N,U),O=A.map(V=>V.timestamp),j=v??Math.max(...O),X=new Map,et=[];O.forEach((V,it)=>{const ht=a(new Date(V)),gt=O[it+1];if(gt){const zt=a(new Date(gt))-ht;et.push(zt)}});const at=et.length>0?et.reduce((V,it)=>V+it,0)/et.length:30;O.forEach((V,it)=>{const ht=a(new Date(V)),gt=O[it+1],zt=it===O.length-1?at:a(new Date(gt))-ht;X.set(V,{x:ht,width:zt})});const tt=F.filter(V=>V.timestamp===j),G=X.get(j),W=666,$=y?`parliament-bar-path parliament-bar-path-${y}`:"parliament-bar-path",K=w.append("g").attr("class",$);tt.sort((V,it)=>it.y0-V.y0),new Map().set(j,{x:W-G.width/2,width:G.width});const B=[],k=(n.radius-n.innerRadius)*.6,q=l*.8,R=P,nt=tt.reduce((V,it)=>V+(it.y1-it.y0),0);let Y=0;r.forEach(V=>{const it=tt.find(we=>we.dataKey===V.dataKey);if(!it)return;const re=(it.y1-it.y0)/nt*q,zt=R-Y,Me=R-Y-re,be=W-k/2,$e=`M ${be} ${zt} L ${be} ${Me} L ${be+k} ${Me} L ${be+k} ${zt} Z`;Y+=re;const Xe=K.append("path").attr("class",`parliament-bar-segment category-${ke(it.dataKey)}`).attr("d",$e).attr("fill",it.color).style("opacity",0).node();Xe&&B.push(Xe)}),y&&(window.orchestratorMap=_n);const Z=C.getControls().getTimeline(),lt=b.seatsToLines/1e3,rt=b.seatsToBar/1e3;Z.call(()=>{m==null||m(Z.progress(),"seatsToRings")},[],"seatsToRings");const ft=_.nodes(),wt=E,st=P,_t=Math.max(...n.seats.map(V=>V.ring)),Pt=n.seats.filter(V=>V.ring===_t),ot=e.append("g").attr("class",`seat-lines-${y||"default"}`),mt=r.map(V=>{const it=_.filter(`.seat-${ke(V.dataKey)}`).size();return it>0?{name:V.dataKey,seatCount:it,color:V.color}:null}).filter(V=>V!==null).reverse(),yt=mt.reduce((V,it)=>V+it.seatCount,0),bt=Pt.length,Ut=n.radius-n.innerRadius,qt=Ut*.6,$t=qt/2,le=Ut*.6,It=[];let xt=0;mt.forEach(V=>{const it=Math.max(1,Math.round(V.seatCount/yt*bt));for(let ht=0;ht<it;ht++){const gt=(xt+ht)/bt,re=n.arcAngle*Math.PI/180,Me=-re/2-Math.PI/2+gt*re,be=(n.innerRadius+n.radius)/2,$e=wt+Math.cos(Me)*be,Xe=st+Math.sin(Me)*be,we=Math.cos(Me),Yr=Math.sin(Me),ln=$e-$t*we,$n=Xe-$t*Yr,he=$e+$t*we,Xr=Xe+$t*Yr,Wr=ot.append("line").attr("class","seat-line").attr("x1",ln).attr("y1",$n).attr("x2",he).attr("y2",Xr).attr("stroke",V.color).attr("stroke-width",n.seatSize*2).attr("stroke-linecap","butt").style("opacity",0).attr("data-angle",Me*180/Math.PI).attr("data-center-x",$e).attr("data-center-y",Xe).attr("data-initial-length",qt).node();It.push({element:Wr,angle:Me})}xt+=it});const Lt=()=>{ot.remove()},Zt=lt*.5,Ht=0,Wt=[];if(Wt.push(...ft),Wt.sort((V,it)=>{const ht=parseInt(V.getAttribute("data-layout-index")||"-1",10),gt=parseInt(it.getAttribute("data-layout-index")||"-1",10);return ht-gt}),Wt.length>0&&It.length>0){const V=It.map(it=>it.element);Z.to(Wt,{attr:{r:1.5},duration:Zt*.3,ease:"power2.in"},`seatsToRings+=${Ht}`),V.forEach(it=>{const ht=it.getAttribute("x1")||"0",gt=it.getAttribute("y1")||"0",re=it.getAttribute("x2")||"0",zt=it.getAttribute("y2")||"0";it.setAttribute("data-final-x1",ht),it.setAttribute("data-final-y1",gt),it.setAttribute("data-final-x2",re),it.setAttribute("data-final-y2",zt),it.setAttribute("x1",ht),it.setAttribute("y1",gt),it.setAttribute("x2",ht),it.setAttribute("y2",gt)}),Z.to(V,{attr:{x2:(it,ht)=>parseFloat(ht.getAttribute("data-final-x2")||"0"),y2:(it,ht)=>parseFloat(ht.getAttribute("data-final-y2")||"0")},opacity:.9,duration:Zt*.6,ease:"power2.out"},`seatsToRings+=${Ht+Zt*.2}`),Z.to(Wt,{opacity:0,duration:Zt*.3,ease:"power2.out"},`seatsToRings+=${Ht+Zt*.3}`)}const je=lt*.05,ue=lt*.7,fr=Ht+Zt+je;if(It.length>0){const V=W,it=P,gt=l*.8/It.length,re=it,zt=[...It].sort(($e,Xe)=>Xe.angle-$e.angle),be=.6/zt.length;zt.forEach(($e,Xe)=>{const we=V,ln=re-Xe*gt,$n=be*Xe*ue,he=$e.element,Xr=parseFloat(he.getAttribute("data-final-x1")||"0"),Wr=parseFloat(he.getAttribute("data-final-y1")||"0"),vi=parseFloat(he.getAttribute("data-final-x2")||"0"),Ln=parseFloat(he.getAttribute("data-final-y2")||"0"),da=(Xr+vi)/2,_r=(Wr+Ln)/2,Kr=Math.atan2(Ln-Wr,vi-Xr),un=Math.sqrt(Math.pow(vi-Xr,2)+Math.pow(Ln-Wr,2));Z.to({progress:0},{progress:1,duration:ue*.5,ease:"power2.inOut",delay:$n,onUpdate:function(){const ae=this.progress(),vs=da+(we-da)*ae,xs=_r+(ln-_r)*ae,vr=40*4*ae*(1-ae),cn=vs,fn=xs-vr,ws=0-Kr,Er=Kr+ws*ae*ae,ga=(un+(le-un)*ae)/2,$y=cn-ga*Math.cos(Er),Ly=fn-ga*Math.sin(Er),qy=cn+ga*Math.cos(Er),Iy=fn+ga*Math.sin(Er);he.setAttribute("x1",$y.toString()),he.setAttribute("y1",Ly.toString()),he.setAttribute("x2",qy.toString()),he.setAttribute("y2",Iy.toString())},onComplete:function(){const ae=le/2;he.setAttribute("x1",(we-ae).toString()),he.setAttribute("y1",ln.toString()),he.setAttribute("x2",(we+ae).toString()),he.setAttribute("y2",ln.toString())}},`seatsToRings+=${fr}`),Z.to($e.element,{opacity:.95,duration:ue*.3,ease:"power2.out",delay:$n},`seatsToRings+=${fr}`)})}const ve=ot,Ye=[];tt.forEach((V,it)=>{const ht=_.filter(`.seat-${ke(V.category)}`),gt=ht.size();if(gt===0)return;const re=s(V.y1),zt=s(V.y0)-s(V.y1),Me=ht.nodes().sort((_r,Kr)=>{const un=parseInt(_r.getAttribute("data-layout-index")||"-1",10),ae=parseInt(Kr.getAttribute("data-layout-index")||"-1",10);return un-ae}),be=Math.max(G.width,100),$e=zt,Xe=be/Math.max($e,1),we=Math.max(2,Math.ceil(Math.sqrt(gt*Xe))),Yr=Math.ceil(gt/we),ln=be*.8,$n=$e*.8,he=we>1?ln/(we-1):0,Xr=Yr>1?$n/(Yr-1):0,Wr=we>1?(we-1)*he:0,vi=Yr>1?(Yr-1)*Xr:0,Ln=W-be/2+(be-Wr)/2,da=re+($e-vi)/2;Me.forEach((_r,Kr)=>{const un=parseInt(_r.getAttribute("data-layout-index")||"-1",10),ae=un>=0?n.seats[un]:void 0,vs=ae?E+ae.x:parseFloat(_r.getAttribute("cx")||"0"),xs=ae?P+ae.y:parseFloat(_r.getAttribute("cy")||"0"),Rf=(ae==null?void 0:ae.radius)||parseFloat(_r.getAttribute("r")||"4"),vr=gt%we;let cn,fn;if(vr>0&&Kr<vr)fn=0,cn=Kr;else{const Er=Kr-(vr>0?vr:0);cn=Er%we,fn=Math.floor(Er/we)+(vr>0?1:0)}let bs=Ln+cn*he;if(vr>0&&fn===0){const Er=vr>1?(vr-1)*he:0,Ef=(Wr-Er)/2;bs=Ln+Ef+cn*he}const ws=da+fn*Xr;Ye.push({element:_r,startX:vs,startY:xs,startRadius:Rf,category:V.dataKey,segmentIndex:it,endY:ws,endX:bs})})});const Te=Ye.map(V=>{const it=V.startX-E,ht=V.startY-P,gt=Math.atan2(ht,it);return{...V,angle:gt}});Te.sort((V,it)=>it.angle-V.angle);const nr=rt*.8,ge=.6,At=Te.length,St=nr/Math.max(At,1)*(At-1)+ge,ie=rt*.3,xe=St;Z.to(B,{opacity:1,duration:ie,ease:"power2.inOut"},`seatsToBar+=${xe}`),ve&&(Z.to(ve.selectAll(".seat-line").nodes(),{opacity:0,duration:ie,ease:"power2.inOut"},`seatsToBar+=${xe}`),Z.call(()=>{Lt()},[],`seatsToBar+=${xe+ie}`));const Gt=b.barSlideToTimeline/1e3;let Jt=null,ce=null;if(f){const it=qr(a).ticks(6).tickPadding(12);p&&it.tickFormat(gt=>p(gt.getTime())),Jt=e.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).attr("opacity",0),Jt.call(it).selectAll("text").attr("font-size",h).attr("font-weight",500);const ht=Ir(s).ticks(5);ht.tickFormat(gt=>+gt==0?"":g?g(gt):String(gt)),ce=e.append("g").attr("class","axis axis-y").attr("opacity",0),ce.call(ht).selectAll("text").attr("font-size",h).attr("font-weight",500)}const ir=b.crossFadePause/1e3,H=xe+ie+ir;B.forEach(V=>{const it=Array.from(V.classList).find(zt=>zt.startsWith("category-"));if(!it||!tt.find(zt=>ke(zt.dataKey)===it.replace("category-","")))return;const gt=r.findIndex(zt=>ke(zt.dataKey)===it.replace("category-",""));if(gt===-1)return;const re=zi(t,r,X,s,l,gt,j,!1);re&&Z.to(V,{attr:{d:re},duration:Gt,ease:"power2.out"},`seatsToBar+=${H}`)});const ut=ss().x(V=>a(V.data.timestamp)).y0(V=>s(V[0])).y1(V=>s(V[1])).curve(Cn),pt=new Map;t.forEach((V,it)=>{const ht=r[it];if(ht){const gt=ut(V)||"";pt.set(ht.dataKey,gt)}});const Tt=H+Gt;f&&Jt&&ce&&Z.to([Jt.node(),ce.node()],{opacity:1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${H}`);const kt=w.select(".grid-vertical"),ct=w.select(".grid-horizontal");if(!kt.empty()||!ct.empty()){const it=[];kt.empty()||it.push(kt.node()),ct.empty()||it.push(ct.node()),Z.to(it,{opacity:.1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${H}`)}const Rt=b.axesAndBarsGrow/1e3,Ft=b.barsToArea/1e3,me=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",te=w.append("g").attr("class",me);O.forEach(V=>{if(V===j)return;const it=X.get(V);it&&r.forEach((ht,gt)=>{const re=zi(t,r,X,s,l,gt,V,!0),zt=zi(t,r,X,s,l,gt,V,!1);if(!re||!zt)return;const Me=y?`histogram-path histogram-path-${y} category-${ke(ht.dataKey)}`:`histogram-path category-${ke(ht.dataKey)}`;te.append("path").attr("class",Me).attr("d",re).attr("fill",ht.color).attr("stroke",ht.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",ht.dataKey).attr("data-timestamp",V).attr("data-x-position",it.x).attr("data-full-height-path",zt)})});const De=y?`.histogram-path-${y}`:".histogram-path",fe=te.selectAll(De);Z.to(fe.nodes(),{opacity:1,duration:.3,ease:"power2.inOut"},`seatsToBar+=${Tt}`);const Fe=G.x+G.width/2;fe.each(function(){var be;const V=this.getAttribute("data-full-height-path");if(!V)return;const it=parseFloat(this.getAttribute("data-x-position")||"0"),ht=parseFloat(this.getAttribute("data-timestamp")||"0"),gt=((be=X.get(ht))==null?void 0:be.width)||0,re=it+gt/2,Me=Math.abs(re-Fe)*8e-4;Z.to(this,{attr:{d:V},duration:Rt,ease:"power2.out"},`seatsToBar+=${Tt+Me}`)});const Ne=Tt+Rt,ee=O[O.length-1],hr=a(new Date(ee))+at,Fn=a.invert(hr).getTime(),jr=t.map(V=>{const it=V[V.length-1],ht={...it,data:{...it.data,timestamp:Fn}};return[...V,ht]});Tc(e,jr,r,{xScale:a,yScale:s,addClasses:!0,instanceId:y});const Nn=y?`.area-${y}`:".area",pr=e.selectAll(Nn);pr.attr("opacity",0),Z.to(fe.nodes(),{opacity:0,duration:Ft,ease:"power2.inOut"},`seatsToBar+=${Ne}`);const _i=K.selectAll("path").nodes();_i.length>0&&Z.to(_i,{opacity:0,duration:Ft,ease:"power2.inOut"},`seatsToBar+=${Ne}`),Z.to(pr.nodes(),{opacity:1,duration:Ft,ease:"power2.inOut"},`seatsToBar+=${Ne}`);const Rr=c;C.getControls().getTimeline().eventCallback("onComplete",()=>{const V=y?`.morph-bar-${y}`:".morph-bar";e.selectAll(V).remove();const it=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(it).remove();const ht=y?`.seat-${y}`:".seat";e.selectAll(ht).style("pointer-events","none"),f&&(Jt&&Jt.attr("opacity",1),ce&&ce.attr("opacity",1)),Rr()}),C.play()}function eT(e,t,r,n,i,a,s,o,l,u,c,f=!0,h=14,p,g,d,m,v,y){var ir;const x=y?`.chart-content-group-${y}`:".chart-content-group";let _=e.select(x);if(_.empty()){const H=e.attr("clip-path"),ut=H?((ir=H.match(/url\(#(.+)\)/))==null?void 0:ir[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,pt=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";_=e.append("g").attr("class",pt).attr("clip-path",`url(#${ut})`)}const S=y?`.area-${y}`:".area",w=e.selectAll(S);if(w.size()===0){rT(e,r,n,o,l,y),c();return}const b={areaToBar:u*.18,barsShrink:u*.22,barSlide:u*.22,axesHide:u*.03,barToRings:u*.07,ringsExpand:u*.18,ringsHold:u*.05,ringsToSeats:u*.07},T=y?_n.get(y):void 0;T&&(T.destroy(),y&&_n.delete(y));const M=H=>H<.18?"areaToBar":H<.4?"barsShrink":H<.62?"barSlide":H<.65?"axesHide":H<.72?"barToRings":H<.9?"ringsExpand":H<.95?"ringsHold":"ringsToSeats",C=new B0({seatsToRings:b.ringsToSeats,ringsHold:b.ringsHold,ringsToBar:b.barToRings,axesReveal:b.axesHide,barSlide:b.barSlide,barsGrow:b.barsShrink,barsToArea:b.areaToBar},{onStageComplete:H=>{},onProgress:H=>{if(m){const ut=M(H);m(H,ut)}},onComplete:()=>{c()}});y&&_n.set(y,C),d&&d(C.getControls().getTimeline());const F=t[0].map(H=>H.data).map(H=>H.timestamp),E=v??Math.max(...F),N=new Map,U=[];F.forEach((H,ut)=>{const pt=a(new Date(H)),Tt=F[ut+1];if(Tt){const ct=a(new Date(Tt))-pt;U.push(ct)}});const P=U.length>0?U.reduce((H,ut)=>H+ut,0)/U.length:30;F.forEach((H,ut)=>{const pt=a(new Date(H)),Tt=F[ut+1],ct=ut===F.length-1?P:a(new Date(Tt))-pt;N.set(H,{x:pt,width:ct})});const O=C.getControls().getTimeline(),j=b.areaToBar/1e3,X=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",et=_.append("g").attr("class",X);F.forEach(H=>{const ut=N.get(H);ut&&r.forEach((pt,Tt)=>{const kt=zi(t,r,N,s,l,Tt,H,!1);if(!kt)return;const ct=y?`histogram-path histogram-path-${y} category-${ke(pt.dataKey)}`:`histogram-path category-${ke(pt.dataKey)}`;et.append("path").attr("class",ct).attr("d",kt).attr("fill",pt.color).attr("stroke",pt.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",pt.dataKey).attr("data-timestamp",H).attr("data-x-position",ut.x)})});const at=y?`.histogram-path-${y}`:".histogram-path",tt=et.selectAll(at);O.to(w.nodes(),{opacity:0,duration:j,ease:"power2.inOut"},"areaToBar"),O.to(tt.nodes(),{opacity:1,duration:j,ease:"power2.inOut"},"areaToBar");const G=b.barsShrink/1e3,W=j;tt.each(function(){const H=parseFloat(this.getAttribute("data-timestamp")||"0");if(H===E)return;const ut=r.find(kt=>this.classList.contains(`category-${ke(kt.dataKey)}`));if(!ut)return;const pt=r.indexOf(ut),Tt=zi(t,r,N,s,l,pt,H,!0);Tt&&O.to(this,{attr:{d:Tt},duration:G,ease:"power2.in"},W)});const $=b.axesHide/1e3,K=W+G;if(f){const H=e.select(".axis-x"),ut=e.select(".axis-y");H.empty()||O.to(H.node(),{opacity:0,duration:$,ease:"power2.inOut"},K),ut.empty()||O.to(ut.node(),{opacity:0,duration:$,ease:"power2.inOut"},K)}const L=_.select(".grid-vertical"),B=_.select(".grid-horizontal");L.empty()||O.to(L.node(),{opacity:0,duration:$,ease:"power2.inOut"},K),B.empty()||O.to(B.node(),{opacity:0,duration:$,ease:"power2.inOut"},K);const k=[];t.forEach((H,ut)=>{const pt=H.find(kt=>kt.data.timestamp===E);if(!pt)return;const Tt=r[ut];Tt&&k.push({category:Tt.label,dataKey:Tt.dataKey,color:Tt.color,y0:pt[0],y1:pt[1]})}),k.sort((H,ut)=>ut.y0-H.y0);const I=k.reduce((H,ut)=>H+(ut.y1-ut.y0),0),q=n.radius-n.innerRadius,R=o/2,nt=n.radius+10,Y=l-n.radius*.3,Z=Math.max(nt,Y),lt=q*.6,ft=l*.8,wt=Z,st=b.barSlide/1e3,_t=K+$,Pt=666,ot=tt.nodes().filter(H=>parseFloat(H.getAttribute("data-timestamp")||"0")!==E);O.to(ot,{opacity:0,duration:st*.2,ease:"power2.out"},_t);const mt=tt.nodes().filter(H=>parseFloat(H.getAttribute("data-timestamp")||"0")===E);mt.forEach(H=>{const ut=H.getAttribute("data-category");if(!ut)return;const pt=k.find(fe=>fe.dataKey===ut);if(!pt)return;const ct=(pt.y1-pt.y0)/I*ft;let Rt=0;for(const fe of r){const Fe=k.find(Pn=>Pn.dataKey===fe.dataKey);if(!Fe)continue;if(Fe.dataKey===pt.dataKey)break;const ee=(Fe.y1-Fe.y0)/I;Rt+=ee*ft}const Ft=wt-Rt,me=wt-Rt-ct,te=Pt-lt/2,De=`M ${te} ${Ft} L ${te} ${me} L ${te+lt} ${me} L ${te+lt} ${Ft} Z`;O.to(H,{attr:{d:De},duration:st,ease:"power2.inOut"},_t)});const yt=b.barToRings/1e3,bt=_t+st,Ut=b.ringsExpand/1e3,qt=bt+yt,$t=b.ringsHold/1e3,le=qt+Ut,It=b.ringsToSeats/1e3,xt=le+$t,Lt=Math.max(...n.seats.map(H=>H.ring)),Zt=n.seats.filter(H=>H.ring===Lt),Ht=_.append("g").attr("class",`slinky-${y||"h2p-default"}`),Wt=()=>{Ht.remove()};Zt.forEach((H,ut)=>{const pt=r.find(Tt=>Tt.label===H.category);pt&&Ht.append("line").attr("class","slinky-ring").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0).attr("stroke",pt.color).attr("stroke-width",n.seatSize*2).attr("stroke-linecap","butt").attr("data-category",H.category).attr("data-category-index",H.categoryIndex).attr("data-ring-index",ut).attr("data-seat-x",R+H.x).attr("data-seat-y",Z+H.y).attr("data-seat-angle",Math.atan2(H.y,H.x)).style("opacity",0)});const je=Ht.selectAll(".slinky-ring").nodes(),ue=Pt,fr=ft/je.length,ve=[...je].sort((H,ut)=>{const pt=parseFloat(H.getAttribute("data-seat-angle")||"0");return parseFloat(ut.getAttribute("data-seat-angle")||"0")-pt}),Ye=wt;ve.forEach((H,ut)=>{const pt=Ye-ut*fr,kt=lt/2,ct=ue-kt,Rt=ue+kt;H.setAttribute("x1",ct.toString()),H.setAttribute("y1",pt.toString()),H.setAttribute("x2",Rt.toString()),H.setAttribute("y2",pt.toString()),H.style.opacity="0"}),O.to(mt,{opacity:0,duration:yt*.7,ease:"power2.out"},bt+yt*.3),O.to(ve,{opacity:1,duration:yt,ease:"power2.in",stagger:.005},bt);const Te=q*.8;ve.forEach((H,ut)=>{const pt=parseFloat(H.getAttribute("data-seat-x")||"0"),Tt=parseFloat(H.getAttribute("data-seat-y")||"0"),kt=parseFloat(H.getAttribute("data-seat-angle")||"0"),ct=(ve.length-1-ut)/ve.length*(Ut*.4),Rt=parseFloat(H.getAttribute("x1")||"0"),Ft=parseFloat(H.getAttribute("y1")||"0"),me=parseFloat(H.getAttribute("x2")||"0"),te=parseFloat(H.getAttribute("y2")||"0"),De=(Rt+me)/2,fe=(Ft+te)/2,Fe=Math.atan2(te-Ft,me-Rt),Ne=Math.sqrt(Math.pow(me-Rt,2)+Math.pow(te-Ft,2)),ee=pt-Te/2*Math.cos(kt),Pn=Tt-Te/2*Math.sin(kt);O.to({progress:0},{progress:1,duration:Ut*.7,ease:"power2.out",onUpdate:function(){const hr=this.progress(),kr=De+(ee-De)*hr,Fn=fe+(Pn-fe)*hr,jr=Fe+(kt-Fe)*hr,pr=(Ne+(Te-Ne)*hr)/2,_i=kr-pr*Math.cos(jr),Rr=Fn-pr*Math.sin(jr),on=kr+pr*Math.cos(jr),V=Fn+pr*Math.sin(jr);H.setAttribute("x1",_i.toString()),H.setAttribute("y1",Rr.toString()),H.setAttribute("x2",on.toString()),H.setAttribute("y2",V.toString())}},qt+ct),O.to(H,{opacity:.9,duration:Ut*.3,ease:"power2.in"},qt+ct)}),O.call(()=>{m&&m(O.progress(),"ringsHold")},[],le);const nr=y?`parliament parliament-${y}`:"parliament",ge=_.append("g").attr("class",nr);n.seats.forEach((H,ut)=>{const pt=r.find(me=>me.label===H.category);if(!pt)return;const Tt=R+H.x,kt=Z+H.y;let ct,Rt,Ft;H.ring===Lt?(ct=Tt,Rt=kt,Ft=2):(ct=Tt,Rt=kt,Ft=H.radius),ge.append("circle").attr("cx",ct).attr("cy",Rt).attr("r",Ft).attr("fill",pt.color).attr("stroke",pt.color).attr("stroke-width",.5).attr("opacity",0).attr("class",()=>y?`seat seat-${y} seat-${ke(H.category)}`:`seat seat-${ke(H.category)}`).attr("data-layout-index",ut).attr("data-ring",H.ring).attr("data-final-x",Tt).attr("data-final-y",kt).attr("data-final-r",H.radius)});const At=y?`.seat-${y}`:".seat",Qt=ge.selectAll(At);O.to(je,{opacity:0,duration:It*.2,ease:"power3.out"},xt),O.to(Qt.nodes(),{opacity:.8,duration:It*.3,ease:"power2.in"},xt+It*.25);const St=Qt.nodes(),ie=[],xe=[];St.forEach(H=>{parseInt(H.getAttribute("data-ring")||"0")===Lt?ie.push(H):xe.push(H)});const Gt=It*.2,Jt=It*.7;ie.forEach(H=>{const ut=parseFloat(H.getAttribute("data-final-r")||"4");O.to(H,{attr:{r:ut},opacity:1,duration:Jt*.6,ease:"power2.out"},xt+Gt)}),xe.length>0&&O.to(xe,{opacity:1,duration:Jt*.5,ease:"power2.in"},xt+Gt+It*.15);const ce=c;C.getControls().getTimeline().eventCallback("onComplete",()=>{const H=y?`.areas-${y}`:".areas",ut=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(H).remove(),e.selectAll(ut).remove(),Wt(),e.selectAll(".axis-x").remove(),e.selectAll(".axis-y").remove(),_.selectAll(".grid-vertical").remove(),_.selectAll(".grid-horizontal").remove();const pt=y?`.parliament-label-${y}`:".parliament-label";if(e.select(pt).empty()){const kt=o/2,ct=n.radius+10,Rt=l-n.radius*.3,Ft=Math.max(ct,Rt),me=y?`parliament-label parliament-label-${y}`:"parliament-label",te=e.append("g").attr("class",me).attr("transform",`translate(${kt},${Ft-n.radius*.15})`).style("opacity","0").style("pointer-events","none");te.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),te.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const De=te.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");De.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),De.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}ce()}),C.play()}function rT(e,t,r,n,i,a){const s=n/2,o=r.radius+10,l=i-r.radius*.3,u=Math.max(o,l);U0(e,r,t,{centerX:s,centerY:u,addClasses:!0,instanceId:a,parliamentRadius:r.radius})}function Bi(e,t,r,n,i){const a=i?`.parliament-label-${i}`:".parliament-label",s=Ct(e).select(a);if(!s.empty())if(t){s.style("opacity","1"),s.select(".label-category").text(t.label).style("fill","#666");const o=t.value>1?"repos":"repo";s.select(".label-value").text(`${t.value} ${o}`).style("fill",t.color);const l=s.select(".scale-indicator");r?l.style("opacity","1").select("text").text(`= ~${n} repos`):l.style("opacity","0")}else s.style("opacity","0")}function Ys(e,t,r,n,i,a,s,o,l){const u=e.querySelectorAll(".seat");if(!u||u.length===0)return;const c=r[r.length-1];if(!c)return;const f=[];u.forEach(p=>{const g=p;g.style.cursor="pointer",g.style.transition="fill-opacity 150ms ease, stroke-opacity 150ms ease"}),u.forEach(p=>{const m=(p.getAttribute("class")||"").split(/\s+/).filter(S=>S.startsWith("seat-")),v=m[m.length-1];if(!v)return;const y=v.substring(5),x=t.find(S=>ke(S.label)===y);if(!x)return;const _=()=>{i(x.label);const S=Math.round(c.values[x.dataKey]||0),w=pf(x.color),b={label:x.label,value:S,color:w};a&&a(b),Bi(e,b,s??!1,o??1,l),Ui(e,x.label)};p.addEventListener("mouseenter",_),f.push({element:p,handler:_})});const h=()=>{i(null),a&&a(null),Bi(e,null,!1,1,l),Ui(e,null)};return e.addEventListener("mouseleave",h),n&&Ui(e,n),()=>{f.forEach(({element:p,handler:g})=>{p.removeEventListener("mouseenter",g)}),e.removeEventListener("mouseleave",h),u.forEach(p=>{const g=p;g.style.cursor="",g.style.transition=""})}}function Ui(e,t){const r=e.querySelectorAll(".seat"),n=t?ke(t):null;r.forEach(i=>{const a=i,l=(i.getAttribute("class")||"").split(/\s+/).filter(f=>f.startsWith("seat-")),u=l[l.length-1];if(!u)return;const c=u.substring(5);n?c===n?(a.setAttribute("fill-opacity","1"),a.setAttribute("stroke-opacity","1")):(a.setAttribute("fill-opacity","0.3"),a.setAttribute("stroke-opacity","0.2")):(a.setAttribute("fill-opacity","1"),a.setAttribute("stroke-opacity","1"))})}const H0=({data:e,categories:t,mode:r,width:n=900,height:i=400,margin:a={top:10,right:30,bottom:40,left:60},timeRange:s,showGrid:o=!0,showAxes:l=!0,axisLabelColor:u,axisLabelSize:c=14,formatDate:f,formatValue:h,markers:p=[],arcAngle:g=200,parliamentRadius:d=200,seatSize:m=4.5,animationDuration:v=900,onMorphComplete:y,onAnimationStateChange:x,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:w,hoveredCategory:b,maxSeats:T=500,showTooltip:M=!0,showTable:C=!1,showScaledIndicator:A=!0,parliamentTimestamp:F,enableBrush:E=!1,onTimeRangeChange:N,minAllowedTime:U,maxAllowedTime:P,timelineEvents:O=[],showTimeline:j=!1,timelineHeight:X=40,timelineOffset:et,brushColor:at="#69b3a2"})=>{const tt=Q.useRef(null),G=Q.useCallback(rt=>{w&&w(rt)},[w]),W=12,K=et??6+W+c+W,L=e[e.length-1],B=L?t.reduce((rt,ft)=>rt+(L.values[ft.dataKey]||0),0):0,k=B>T,I=k?Math.round(B/T):1,q=j&&r==="stacked-area"?i+X+K:i,{isMorphing:R,currentMode:nt,visibleMarkers:Y,hoveredMarker:Z,hoveredTimelineEvent:lt}=VS({containerRef:tt,data:e,categories:t,mode:r,width:n,height:i,margin:a,timeRange:s,showGrid:o,showAxes:l,axisLabelColor:u,axisLabelSize:c,formatDate:f,formatValue:h,markers:p,arcAngle:g,parliamentRadius:d,seatSize:m,animationDuration:v,onMorphComplete:y,onAnimationStateChange:x,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:G,hoveredCategory:b,maxSeats:T,parliamentTimestamp:F,enableBrush:E,onTimeRangeChange:N,minAllowedTime:U,maxAllowedTime:P,showScaleIndicator:A&&k,reposPerSeat:I,timelineEvents:O,showTimeline:j,timelineHeight:X,timelineOffset:K,brushColor:at});return D.jsxs(z.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:tt,viewBox:`0 0 ${n} ${q}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),nt==="area"&&Y.map(rt=>{const ft=(rt.x+a.left)/n*100,wt=a.top/i*100,st=new Date(rt.timestamp),_t=f?f(rt.timestamp):st.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),Pt=D.jsxs(z.Box,{children:[D.jsx(z.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:rt.label?.5:0},children:_t}),rt.label&&D.jsx(z.Box,{sx:{color:"white",fontWeight:500},children:rt.label})]});return D.jsx(z.Tooltip,{title:Pt,open:(Z==null?void 0:Z.timestamp)===rt.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(z.Box,{sx:{position:"absolute",left:`${ft}%`,top:`${wt}%`,width:"1px",height:`${(i-a.top-a.bottom)/i*100}%`,pointerEvents:"none"}})},rt.timestamp)}),lt&&nt==="area"&&D.jsx(z.Tooltip,{title:D.jsxs(z.Box,{children:[D.jsx(z.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:f?f(lt.timestamp):new Date(lt.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),D.jsx(z.Box,{sx:{color:"white",fontWeight:500},children:lt.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(z.Box,{sx:{position:"absolute",left:`${(lt.x+a.left)/n*100}%`,top:`${(i+K+X/2)/q*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})}),R&&D.jsxs(z.Box,{sx:{position:"absolute",top:8,right:8,padding:"4px 8px",backgroundColor:"rgba(0,0,0,0.7)",color:"white",borderRadius:"4px",fontSize:"12px",pointerEvents:"none",display:"none"},children:["Morphing: ",nt," → ",r]})]})},G0=[{minRepos:0,maxRepos:10,minArc:90,maxArc:90,minSeatSize:28,maxSeatSize:28},{minRepos:10,maxRepos:25,minArc:90,maxArc:110,minSeatSize:24,maxSeatSize:24},{minRepos:25,maxRepos:50,minArc:110,maxArc:120,minSeatSize:20,maxSeatSize:20},{minRepos:50,maxRepos:100,minArc:120,maxArc:150,minSeatSize:16.5,maxSeatSize:16.5},{minRepos:100,maxRepos:200,minArc:150,maxArc:180,minSeatSize:15,maxSeatSize:15},{minRepos:200,maxRepos:1/0,minArc:180,maxArc:180,minSeatSize:14.5,maxSeatSize:14.5}],df=({repositoryCount:e})=>{const t=G0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 180;if(t.minArc===t.maxArc)return t.minArc;const r=t.maxRepos-t.minRepos,i=(e-t.minRepos)/r,a=t.maxArc-t.minArc,s=t.minArc+a*i;return Math.round(s)},gf=({repositoryCount:e})=>{const t=G0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 6.5;if(t.minSeatSize===t.maxSeatSize)return t.minSeatSize;const r=t.maxRepos-t.minRepos,i=(e-t.minRepos)/r,a=t.maxSeatSize-t.minSeatSize,s=t.minSeatSize+a*i;return Math.round(s*10)/10};class oa{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}oa.prototype.normal={};oa.prototype.property={};oa.prototype.space=void 0;function j0(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new oa(r,n,t)}function na(e){return e.toLowerCase()}class Ge{constructor(t,r){this.attribute=r,this.property=t}}Ge.prototype.attribute="";Ge.prototype.booleanish=!1;Ge.prototype.boolean=!1;Ge.prototype.commaOrSpaceSeparated=!1;Ge.prototype.commaSeparated=!1;Ge.prototype.defined=!1;Ge.prototype.mustUseProperty=!1;Ge.prototype.number=!1;Ge.prototype.overloadedBoolean=!1;Ge.prototype.property="";Ge.prototype.spaceSeparated=!1;Ge.prototype.space=void 0;let nT=0;const dt=Dn(),se=Dn(),Mc=Dn(),J=Dn(),Nt=Dn(),Jn=Dn(),We=Dn();function Dn(){return 2**++nT}const Ac=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:se,commaOrSpaceSeparated:We,commaSeparated:Jn,number:J,overloadedBoolean:Mc,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),Xs=Object.keys(Ac);class mf extends Ge{constructor(t,r,n,i){let a=-1;if(super(t,r),qh(this,"space",i),typeof n=="number")for(;++a<Xs.length;){const s=Xs[a];qh(this,Xs[a],(n&Ac[s])===Ac[s])}}}mf.prototype.defined=!0;function qh(e,t,r){r&&(e[t]=r)}function mi(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const a=new mf(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),t[n]=a,r[na(n)]=n,r[na(a.attribute)]=n}return new oa(t,r,e.space)}const Y0=mi({properties:{ariaActiveDescendant:null,ariaAtomic:se,ariaAutoComplete:null,ariaBusy:se,ariaChecked:se,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:se,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:se,ariaFlowTo:Nt,ariaGrabbed:se,ariaHasPopup:null,ariaHidden:se,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:J,ariaLive:null,ariaModal:se,ariaMultiLine:se,ariaMultiSelectable:se,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:se,ariaReadOnly:se,ariaRelevant:null,ariaRequired:se,ariaRoleDescription:Nt,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:se,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function X0(e,t){return t in e?e[t]:t}function W0(e,t){return X0(e,t.toLowerCase())}const iT=mi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jn,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Nt,autoFocus:dt,autoPlay:dt,blocking:Nt,capture:null,charSet:null,checked:dt,cite:null,className:Nt,cols:J,colSpan:null,content:null,contentEditable:se,controls:dt,controlsList:Nt,coords:J|Jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Mc,draggable:se,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Nt,height:J,hidden:Mc,high:J,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:dt,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:J,pattern:null,ping:Nt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Nt,required:dt,reversed:dt,rows:J,rowSpan:J,sandbox:Nt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:se,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:se,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:se,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:J,security:null,unselectable:null},space:"html",transform:W0}),aT=mi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:We,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:Nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jn,g2:Jn,glyphName:Jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:We,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:We,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:We,rev:We,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:We,requiredFeatures:We,requiredFonts:We,requiredFormats:We,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:We,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:We,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:We,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X0}),K0=mi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),V0=mi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:W0}),Z0=mi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),sT=/[A-Z]/g,Ih=/-[a-z]/g,oT=/^data[-\w.:]+$/i;function Q0(e,t){const r=na(t);let n=t,i=Ge;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&oT.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ih,uT);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ih.test(a)){let s=a.replace(sT,lT);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=mf}return new i(n,t)}function lT(e){return"-"+e.toLowerCase()}function uT(e){return e.charAt(1).toUpperCase()}const J0=j0([Y0,iT,K0,V0,Z0],"html"),yf=j0([Y0,aT,K0,V0,Z0],"svg");function zh(e){const t=[],r=String(e||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const s=r.slice(i,n).trim();(s||!a)&&t.push(s),i=n+1,n=r.indexOf(",",i)}return t}function cT(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Bh=/[#.]/g;function fT(e,t){const r=e||"",n={};let i=0,a,s;for(;i<r.length;){Bh.lastIndex=i;const o=Bh.exec(r),l=r.slice(i,o?o.index:r.length);l&&(a?a==="#"?n.id=l:Array.isArray(n.className)?n.className.push(l):n.className=[l]:s=l,i+=l.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||t||"div",properties:n,children:[]}}function Uh(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function hT(e){return e.join(" ").trim()}function ty(e,t,r){const n=r?mT(r):void 0;function i(a,s,...o){let l;if(a==null){l={type:"root",children:[]};const u=s;o.unshift(u)}else{l=fT(a,t);const u=l.tagName.toLowerCase(),c=n?n.get(u):void 0;if(l.tagName=c||u,pT(s))o.unshift(s);else for(const[f,h]of Object.entries(s))dT(e,l.properties,f,h)}for(const u of o)Cc(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function pT(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const i=t[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function dT(e,t,r,n){const i=Q0(e,r);let a;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;a=n}else typeof n=="boolean"?a=n:typeof n=="string"?i.spaceSeparated?a=Uh(n):i.commaSeparated?a=zh(n):i.commaOrSpaceSeparated?a=Uh(zh(n).join(" ")):a=Hh(i,i.property,n):Array.isArray(n)?a=[...n]:a=i.property==="style"?gT(n):String(n);if(Array.isArray(a)){const s=[];for(const o of a)s.push(Hh(i,i.property,o));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Cc(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)Cc(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?Cc(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Hh(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||na(r)===na(t)))return!0}return r}function gT(e){const t=[];for(const[r,n]of Object.entries(e))t.push([r,n].join(": "));return t.join("; ")}function mT(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const yT=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"];ty(J0,"div");const la=ty(yf,"g",yT),ey=(e=la)=>e("pattern",{id:"greyHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:ur.neoGrey[200]}),e("path",{d:"M0,2 L8,2",stroke:ur.neoGrey[400],"stroke-width":.5}),e("path",{d:"M0,6 L8,6",stroke:ur.neoGrey[400],"stroke-width":.5})]),ry=(e=la)=>e("pattern",{id:"dataMissingHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFF3CC"}),e("path",{d:"M0,8 L8,0",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M-2,2 L2,-2",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M6,10 L10,6",stroke:"#FFB800","stroke-width":.5})]),ny=(e=la)=>e("pattern",{id:"noLstHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFE5E5"}),e("path",{d:"M0,0 L8,8",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M-2,6 L2,10",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M6,-2 L10,2",stroke:"#ED4134","stroke-width":.5})]),Et={greyHatch:{background:ur.neoGrey[200],lines:ur.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}},_T=({categories:e,activeCategory:t,onCategoryHover:r,mode:n,visible:i=!0})=>D.jsx(z.Box,{className:"category-table",sx:{width:"100%",display:"flex",justifyContent:"center",opacity:i?1:0,transition:"opacity 0.3s ease-in-out","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>r(null),children:D.jsxs(z.Table,{"aria-label":"Categories summary",className:"category-summary-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[D.jsx("thead",{children:D.jsxs(z.TableRow,{children:[D.jsx(z.TableCell,{}),D.jsx(z.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),n==="point-in-time"?D.jsxs(D.Fragment,{children:[D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"#"}),D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"%"})]}):D.jsxs(D.Fragment,{children:[D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Last"}),D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Max"}),D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Min"})]})]})}),D.jsx("tbody",{children:e.map(a=>{const s=a.color==="url(#greyHatchPattern)"?Et.greyHatch.lines:a.color==="url(#dataMissingHatchPattern)"?Et.dataMissingHatch.lines:a.color==="url(#noLstHatchPattern)"?Et.noLstHatch.lines:a.color;return D.jsxs(z.TableRow,{onMouseEnter:()=>r(a.id),sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:t===a.id?`${s}15`:"transparent","&:hover":{backgroundColor:`${s}15`}},children:[D.jsx(z.TableCell,{align:"center",sx:{width:20},children:D.jsx(z.Box,{sx:{width:n==="historical"?4:12,height:12,backgroundColor:a.color==="url(#greyHatchPattern)"?Et.greyHatch.background:a.color==="url(#dataMissingHatchPattern)"?Et.dataMissingHatch.background:a.color==="url(#noLstHatchPattern)"?Et.noLstHatch.background:a.color,borderRadius:n==="historical"?2:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:t===a.id?"scale(1.2)":"scale(1)",...a.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
15
|
+
*/var Ah,Qr,Zn,uf,yn,Ch,cf,_S=function(){return typeof window<"u"},jr={},gn=180/Math.PI,Qn=Math.PI/180,Bn=Math.atan2,kh=1e8,ff=/([A-Z])/g,xS=/(left|right|width|margin|padding|x)/i,vS=/[\s,\(]\S/,Sr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},xc=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},bS=function(t,r){return r.set(r.t,r.p,t===1?r.e:Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},wS=function(t,r){return r.set(r.t,r.p,t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},SS=function(t,r){return r.set(r.t,r.p,t===1?r.e:t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},TS=function(t,r){var n=r.s+r.c*t;r.set(r.t,r.p,~~(n+(n<0?-.5:.5))+r.u,r)},E0=function(t,r){return r.set(r.t,r.p,t?r.e:r.b,r)},D0=function(t,r){return r.set(r.t,r.p,t!==1?r.b:r.e,r)},MS=function(t,r,n){return t.style[r]=n},AS=function(t,r,n){return t.style.setProperty(r,n)},CS=function(t,r,n){return t._gsap[r]=n},kS=function(t,r,n){return t._gsap.scaleX=t._gsap.scaleY=n},RS=function(t,r,n,a,i){var s=t._gsap;s.scaleX=s.scaleY=n,s.renderTransform(i,s)},ES=function(t,r,n,a,i){var s=t._gsap;s[r]=n,s.renderTransform(i,s)},Kt="transform",Ue=Kt+"Origin",DS=function e(t,r){var n=this,a=this.target,i=a.style,s=a._gsap;if(t in jr&&i){if(this.tfm=this.tfm||{},t!=="transform")t=Sr[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return n.tfm[o]=$r(a,o)}):this.tfm[t]=s.x?s[t]:$r(a,t),t===Ue&&(this.tfm.zOrigin=s.zOrigin);else return Sr.transform.split(",").forEach(function(o){return e.call(n,o,r)});if(this.props.indexOf(Kt)>=0)return;s.svg&&(this.svgo=a.getAttribute("data-svg-origin"),this.props.push(Ue,r,"")),t=Kt}(i||r)&&this.props.push(t,r,i[t])},O0=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},OS=function(){var t=this.props,r=this.target,n=r.style,a=r._gsap,i,s;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?r[t[i]](t[i+2]):r[t[i]]=t[i+2]:t[i+2]?n[t[i]]=t[i+2]:n.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(ff,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)a[s]=this.tfm[s];a.svg&&(a.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),i=cf(),(!i||!i.isStart)&&!n[Kt]&&(O0(n),a.zOrigin&&n[Ue]&&(n[Ue]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}},P0=function(t,r){var n={target:t,props:[],revert:OS,save:DS};return t._gsap||He.core.getCache(t),r&&t.style&&t.nodeType&&r.split(",").forEach(function(a){return n.save(a)}),n},F0,vc=function(t,r){var n=Qr.createElementNS?Qr.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Qr.createElement(t);return n&&n.style?n:Qr.createElement(t)},Qe=function e(t,r,n){var a=getComputedStyle(t);return a[r]||a.getPropertyValue(r.replace(ff,"-$1").toLowerCase())||a.getPropertyValue(r)||!n&&e(t,pa(r)||r,1)||""},Rh="O,Moz,ms,Ms,Webkit".split(","),pa=function(t,r,n){var a=r||yn,i=a.style,s=5;if(t in i&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);s--&&!(Rh[s]+t in i););return s<0?null:(s===3?"ms":s>=0?Rh[s]:"")+t},bc=function(){_S()&&window.document&&(Ah=window,Qr=Ah.document,Zn=Qr.documentElement,yn=vc("div")||{style:{}},vc("div"),Kt=pa(Kt),Ue=Kt+"Origin",yn.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",F0=!!pa("perspective"),cf=He.core.reverting,uf=1)},Eh=function(t){var r=t.ownerSVGElement,n=vc("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),a=t.cloneNode(!0),i;a.style.display="block",n.appendChild(a),Zn.appendChild(n);try{i=a.getBBox()}catch{}return n.removeChild(a),Zn.removeChild(n),i},Dh=function(t,r){for(var n=r.length;n--;)if(t.hasAttribute(r[n]))return t.getAttribute(r[n])},N0=function(t){var r,n;try{r=t.getBBox()}catch{r=Eh(t),n=1}return r&&(r.width||r.height)||n||(r=Eh(t)),r&&!r.width&&!r.x&&!r.y?{x:+Dh(t,["x","cx","x1"])||0,y:+Dh(t,["y","cy","y1"])||0,width:0,height:0}:r},$0=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&N0(t))},nn=function(t,r){if(r){var n=t.style,a;r in jr&&r!==Ue&&(r=Kt),n.removeProperty?(a=r.substr(0,2),(a==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),n.removeProperty(a==="--"?r:r.replace(ff,"-$1").toLowerCase())):n.removeAttribute(r)}},Jr=function(t,r,n,a,i,s){var o=new Be(t._pt,r,n,0,1,s?D0:E0);return t._pt=o,o.b=a,o.e=i,t._props.push(n),o},Oh={deg:1,rad:1,turn:1},PS={grid:1,flex:1},an=function e(t,r,n,a){var i=parseFloat(n)||0,s=(n+"").trim().substr((i+"").length)||"px",o=yn.style,l=xS.test(r),u=t.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),f=100,h=a==="px",p=a==="%",g,d,m,x;if(a===s||!i||Oh[a]||Oh[s])return i;if(s!=="px"&&!h&&(i=e(t,r,n,"px")),x=t.getCTM&&$0(t),(p||s==="%")&&(jr[r]||~r.indexOf("adius")))return g=x?t.getBBox()[l?"width":"height"]:t[c],ae(p?i/g*f:i/100*g);if(o[l?"width":"height"]=f+(h?s:a),d=a!=="rem"&&~r.indexOf("adius")||a==="em"&&t.appendChild&&!u?t:t.parentNode,x&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===Qr||!d.appendChild)&&(d=Qr.body),m=d._gsap,m&&p&&m.width&&l&&m.time===Ve.time&&!m.uncache)return ae(i/m.width*f);if(p&&(r==="height"||r==="width")){var y=t.style[r];t.style[r]=f+a,g=t[c],y?t.style[r]=y:nn(t,r)}else(p||s==="%")&&!PS[Qe(d,"display")]&&(o.position=Qe(t,"position")),d===t&&(o.position="static"),d.appendChild(yn),g=yn[c],d.removeChild(yn),o.position="absolute";return l&&p&&(m=vn(d),m.time=Ve.time,m.width=d[c]),ae(h?g*i/f:g&&i?f/g*i:0)},$r=function(t,r,n,a){var i;return uf||bc(),r in Sr&&r!=="transform"&&(r=Sr[r],~r.indexOf(",")&&(r=r.split(",")[0])),jr[r]&&r!=="transform"?(i=ri(t,a),i=r!=="transformOrigin"?i[r]:i.svg?i.origin:Qi(Qe(t,Ue))+" "+i.zOrigin+"px"):(i=t.style[r],(!i||i==="auto"||a||~(i+"").indexOf("calc("))&&(i=Zi[r]&&Zi[r](t,r,n)||Qe(t,r)||Qm(t,r)||(r==="opacity"?1:0))),n&&!~(i+"").trim().indexOf(" ")?an(t,r,i,n)+n:i},FS=function(t,r,n,a){if(!n||n==="none"){var i=pa(r,t,1),s=i&&Qe(t,i,1);s&&s!==n?(r=i,n=s):r==="borderColor"&&(n=Qe(t,"borderTopColor"))}var o=new Be(this._pt,t.style,r,0,1,C0),l=0,u=0,c,f,h,p,g,d,m,x,y,v,_,S;if(o.b=n,o.e=a,n+="",a+="",a.substring(0,6)==="var(--"&&(a=Qe(t,a.substring(4,a.indexOf(")")))),a==="auto"&&(d=t.style[r],t.style[r]=a,a=Qe(t,r)||a,d?t.style[r]=d:nn(t,r)),c=[n,a],y0(c),n=c[0],a=c[1],h=n.match(Yn)||[],S=a.match(Yn)||[],S.length){for(;f=Yn.exec(a);)m=f[0],y=a.substring(l,f.index),g?g=(g+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(g=1),m!==(d=h[u++]||"")&&(p=parseFloat(d)||0,_=d.substr((p+"").length),m.charAt(1)==="="&&(m=Vn(p,m)+_),x=parseFloat(m),v=m.substr((x+"").length),l=Yn.lastIndex-v.length,v||(v=v||Je.units[r]||_,l===a.length&&(a+=v,o.e+=v)),_!==v&&(p=an(t,r,d,v)||0),o._pt={_next:o._pt,p:y||u===1?y:",",s:p,c:x-p,m:g&&g<4||r==="zIndex"?Math.round:0});o.c=l<a.length?a.substring(l,a.length):""}else o.r=r==="display"&&a==="none"?D0:E0;return Xm.test(a)&&(o.e=0),this._pt=o,o},Ph={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},NS=function(t){var r=t.split(" "),n=r[0],a=r[1]||"50%";return(n==="top"||n==="bottom"||a==="left"||a==="right")&&(t=n,n=a,a=t),r[0]=Ph[n]||n,r[1]=Ph[a]||a,r.join(" ")},$S=function(t,r){if(r.tween&&r.tween._time===r.tween._dur){var n=r.t,a=n.style,i=r.u,s=n._gsap,o,l,u;if(i==="all"||i===!0)a.cssText="",l=1;else for(i=i.split(","),u=i.length;--u>-1;)o=i[u],jr[o]&&(l=1,o=o==="transformOrigin"?Ue:Kt),nn(n,o);l&&(nn(n,Kt),s&&(s.svg&&n.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",ri(n,1),s.uncache=1,O0(a)))}},Zi={clearProps:function(t,r,n,a,i){if(i.data!=="isFromStart"){var s=t._pt=new Be(t._pt,r,n,0,0,$S);return s.u=a,s.pr=-10,s.tween=i,t._props.push(n),1}}},ei=[1,0,0,1,0,0],L0={},q0=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Fh=function(t){var r=Qe(t,Kt);return q0(r)?ei:r.substr(7).match(Ym).map(ae)},hf=function(t,r){var n=t._gsap||vn(t),a=t.style,i=Fh(t),s,o,l,u;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,i=[l.a,l.b,l.c,l.d,l.e,l.f],i.join(",")==="1,0,0,1,0,0"?ei:i):(i===ei&&!t.offsetParent&&t!==Zn&&!n.svg&&(l=a.display,a.display="block",s=t.parentNode,(!s||!t.offsetParent&&!t.getBoundingClientRect().width)&&(u=1,o=t.nextElementSibling,Zn.appendChild(t)),i=Fh(t),l?a.display=l:nn(t,"display"),u&&(o?s.insertBefore(t,o):s?s.appendChild(t):Zn.removeChild(t))),r&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},wc=function(t,r,n,a,i,s){var o=t._gsap,l=i||hf(t,!0),u=o.xOrigin||0,c=o.yOrigin||0,f=o.xOffset||0,h=o.yOffset||0,p=l[0],g=l[1],d=l[2],m=l[3],x=l[4],y=l[5],v=r.split(" "),_=parseFloat(v[0])||0,S=parseFloat(v[1])||0,w,b,T,M;n?l!==ei&&(b=p*m-g*d)&&(T=_*(m/b)+S*(-d/b)+(d*y-m*x)/b,M=_*(-g/b)+S*(p/b)-(p*y-g*x)/b,_=T,S=M):(w=N0(t),_=w.x+(~v[0].indexOf("%")?_/100*w.width:_),S=w.y+(~(v[1]||v[0]).indexOf("%")?S/100*w.height:S)),a||a!==!1&&o.smooth?(x=_-u,y=S-c,o.xOffset=f+(x*p+y*d)-x,o.yOffset=h+(x*g+y*m)-y):o.xOffset=o.yOffset=0,o.xOrigin=_,o.yOrigin=S,o.smooth=!!a,o.origin=r,o.originIsAbsolute=!!n,t.style[Ue]="0px 0px",s&&(Jr(s,o,"xOrigin",u,_),Jr(s,o,"yOrigin",c,S),Jr(s,o,"xOffset",f,o.xOffset),Jr(s,o,"yOffset",h,o.yOffset)),t.setAttribute("data-svg-origin",_+" "+S)},ri=function(t,r){var n=t._gsap||new b0(t);if("x"in n&&!r&&!n.uncache)return n;var a=t.style,i=n.scaleX<0,s="px",o="deg",l=getComputedStyle(t),u=Qe(t,Ue)||"0",c,f,h,p,g,d,m,x,y,v,_,S,w,b,T,M,k,C,O,R,E,H,I,P,j,Y,rt,tt,J,Q,it,L;return c=f=h=d=m=x=y=v=_=0,p=g=1,n.svg=!!(t.getCTM&&$0(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(a[Kt]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Kt]!=="none"?l[Kt]:"")),a.scale=a.rotate=a.translate="none"),b=hf(t,n.svg),n.svg&&(n.uncache?(j=t.getBBox(),u=n.xOrigin-j.x+"px "+(n.yOrigin-j.y)+"px",P=""):P=!r&&t.getAttribute("data-svg-origin"),wc(t,P||u,!!P||n.originIsAbsolute,n.smooth!==!1,b)),S=n.xOrigin||0,w=n.yOrigin||0,b!==ei&&(C=b[0],O=b[1],R=b[2],E=b[3],c=H=b[4],f=I=b[5],b.length===6?(p=Math.sqrt(C*C+O*O),g=Math.sqrt(E*E+R*R),d=C||O?Bn(O,C)*gn:0,y=R||E?Bn(R,E)*gn+d:0,y&&(g*=Math.abs(Math.cos(y*Qn))),n.svg&&(c-=S-(S*C+w*R),f-=w-(S*O+w*E))):(L=b[6],Q=b[7],rt=b[8],tt=b[9],J=b[10],it=b[11],c=b[12],f=b[13],h=b[14],T=Bn(L,J),m=T*gn,T&&(M=Math.cos(-T),k=Math.sin(-T),P=H*M+rt*k,j=I*M+tt*k,Y=L*M+J*k,rt=H*-k+rt*M,tt=I*-k+tt*M,J=L*-k+J*M,it=Q*-k+it*M,H=P,I=j,L=Y),T=Bn(-R,J),x=T*gn,T&&(M=Math.cos(-T),k=Math.sin(-T),P=C*M-rt*k,j=O*M-tt*k,Y=R*M-J*k,it=E*k+it*M,C=P,O=j,R=Y),T=Bn(O,C),d=T*gn,T&&(M=Math.cos(T),k=Math.sin(T),P=C*M+O*k,j=H*M+I*k,O=O*M-C*k,I=I*M-H*k,C=P,H=j),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,x=180-x),p=ae(Math.sqrt(C*C+O*O+R*R)),g=ae(Math.sqrt(I*I+L*L)),T=Bn(H,I),y=Math.abs(T)>2e-4?T*gn:0,_=it?1/(it<0?-it:it):0),n.svg&&(P=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!q0(Qe(t,Kt)),P&&t.setAttribute("transform",P))),Math.abs(y)>90&&Math.abs(y)<270&&(i?(p*=-1,y+=d<=0?180:-180,d+=d<=0?180:-180):(g*=-1,y+=y<=0?180:-180)),r=r||n.uncache,n.x=c-((n.xPercent=c&&(!r&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+s,n.y=f-((n.yPercent=f&&(!r&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+s,n.z=h+s,n.scaleX=ae(p),n.scaleY=ae(g),n.rotation=ae(d)+o,n.rotationX=ae(m)+o,n.rotationY=ae(x)+o,n.skewX=y+o,n.skewY=v+o,n.transformPerspective=_+s,(n.zOrigin=parseFloat(u.split(" ")[2])||!r&&n.zOrigin||0)&&(a[Ue]=Qi(u)),n.xOffset=n.yOffset=0,n.force3D=Je.force3D,n.renderTransform=n.svg?qS:F0?I0:LS,n.uncache=0,n},Qi=function(t){return(t=t.split(" "))[0]+" "+t[1]},Gs=function(t,r,n){var a=Re(r);return ae(parseFloat(r)+parseFloat(an(t,"x",n+"px",a)))+a},LS=function(t,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,I0(t,r)},hn="0deg",Ma="0px",pn=") ",I0=function(t,r){var n=r||this,a=n.xPercent,i=n.yPercent,s=n.x,o=n.y,l=n.z,u=n.rotation,c=n.rotationY,f=n.rotationX,h=n.skewX,p=n.skewY,g=n.scaleX,d=n.scaleY,m=n.transformPerspective,x=n.force3D,y=n.target,v=n.zOrigin,_="",S=x==="auto"&&t&&t!==1||x===!0;if(v&&(f!==hn||c!==hn)){var w=parseFloat(c)*Qn,b=Math.sin(w),T=Math.cos(w),M;w=parseFloat(f)*Qn,M=Math.cos(w),s=Gs(y,s,b*M*-v),o=Gs(y,o,-Math.sin(w)*-v),l=Gs(y,l,T*M*-v+v)}m!==Ma&&(_+="perspective("+m+pn),(a||i)&&(_+="translate("+a+"%, "+i+"%) "),(S||s!==Ma||o!==Ma||l!==Ma)&&(_+=l!==Ma||S?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+pn),u!==hn&&(_+="rotate("+u+pn),c!==hn&&(_+="rotateY("+c+pn),f!==hn&&(_+="rotateX("+f+pn),(h!==hn||p!==hn)&&(_+="skew("+h+", "+p+pn),(g!==1||d!==1)&&(_+="scale("+g+", "+d+pn),y.style[Kt]=_||"translate(0, 0)"},qS=function(t,r){var n=r||this,a=n.xPercent,i=n.yPercent,s=n.x,o=n.y,l=n.rotation,u=n.skewX,c=n.skewY,f=n.scaleX,h=n.scaleY,p=n.target,g=n.xOrigin,d=n.yOrigin,m=n.xOffset,x=n.yOffset,y=n.forceCSS,v=parseFloat(s),_=parseFloat(o),S,w,b,T,M;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=Qn,u*=Qn,S=Math.cos(l)*f,w=Math.sin(l)*f,b=Math.sin(l-u)*-h,T=Math.cos(l-u)*h,u&&(c*=Qn,M=Math.tan(u-c),M=Math.sqrt(1+M*M),b*=M,T*=M,c&&(M=Math.tan(c),M=Math.sqrt(1+M*M),S*=M,w*=M)),S=ae(S),w=ae(w),b=ae(b),T=ae(T)):(S=f,T=h,w=b=0),(v&&!~(s+"").indexOf("px")||_&&!~(o+"").indexOf("px"))&&(v=an(p,"x",s,"px"),_=an(p,"y",o,"px")),(g||d||m||x)&&(v=ae(v+g-(g*S+d*b)+m),_=ae(_+d-(g*w+d*T)+x)),(a||i)&&(M=p.getBBox(),v=ae(v+a/100*M.width),_=ae(_+i/100*M.height)),M="matrix("+S+","+w+","+b+","+T+","+v+","+_+")",p.setAttribute("transform",M),y&&(p.style[Kt]=M)},IS=function(t,r,n,a,i){var s=360,o=ye(i),l=parseFloat(i)*(o&&~i.indexOf("rad")?gn:1),u=l-a,c=a+u+"deg",f,h;return o&&(f=i.split("_")[1],f==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),f==="cw"&&u<0?u=(u+s*kh)%s-~~(u/s)*s:f==="ccw"&&u>0&&(u=(u-s*kh)%s-~~(u/s)*s)),t._pt=h=new Be(t._pt,r,n,a,u,bS),h.e=c,h.u="deg",t._props.push(n),h},Nh=function(t,r){for(var n in r)t[n]=r[n];return t},zS=function(t,r,n){var a=Nh({},n._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=n.style,o,l,u,c,f,h,p,g;a.svg?(u=n.getAttribute("transform"),n.setAttribute("transform",""),s[Kt]=r,o=ri(n,1),nn(n,Kt),n.setAttribute("transform",u)):(u=getComputedStyle(n)[Kt],s[Kt]=r,o=ri(n,1),s[Kt]=u);for(l in jr)u=a[l],c=o[l],u!==c&&i.indexOf(l)<0&&(p=Re(u),g=Re(c),f=p!==g?an(n,l,u,g):parseFloat(u),h=parseFloat(c),t._pt=new Be(t._pt,o,l,f,h-f,xc),t._pt.u=g||0,t._props.push(l));Nh(o,a)};ze("padding,margin,Width,Radius",function(e,t){var r="Top",n="Right",a="Bottom",i="Left",s=(t<3?[r,n,a,i]:[r+i,r+n,a+n,a+i]).map(function(o){return t<2?e+o:"border"+o+e});Zi[t>1?"border"+e:e]=function(o,l,u,c,f){var h,p;if(arguments.length<4)return h=s.map(function(g){return $r(o,g,u)}),p=h.join(" "),p.split(h[0]).length===5?h[0]:p;h=(c+"").split(" "),p={},s.forEach(function(g,d){return p[g]=h[d]=h[d]||h[(d-1)/2|0]}),o.init(l,p,f)}});var z0={name:"css",register:bc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,r,n,a,i){var s=this._props,o=t.style,l=n.vars.startAt,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b,T,M;uf||bc(),this.styles=this.styles||P0(t),T=this.styles.props,this.tween=n;for(d in r)if(d!=="autoRound"&&(c=r[d],!(Ke[d]&&w0(d,r,n,a,t,i)))){if(p=typeof c,g=Zi[d],p==="function"&&(c=c.call(n,a,t,i),p=typeof c),p==="string"&&~c.indexOf("random(")&&(c=Qa(c)),g)g(this,t,d,c,n)&&(b=1);else if(d.substr(0,2)==="--")u=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",en.lastIndex=0,en.test(u)||(m=Re(u),x=Re(c),x?m!==x&&(u=an(t,d,u,x)+x):m&&(c+=m)),this.add(o,"setProperty",u,c,a,i,0,0,d),s.push(d),T.push(d,0,o[d]);else if(p!=="undefined"){if(l&&d in l?(u=typeof l[d]=="function"?l[d].call(n,a,t,i):l[d],ye(u)&&~u.indexOf("random(")&&(u=Qa(u)),Re(u+"")||u==="auto"||(u+=Je.units[d]||Re($r(t,d))||""),(u+"").charAt(1)==="="&&(u=$r(t,d))):u=$r(t,d),h=parseFloat(u),y=p==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),f=parseFloat(c),d in Sr&&(d==="autoAlpha"&&(h===1&&$r(t,"visibility")==="hidden"&&f&&(h=0),T.push("visibility",0,o.visibility),Jr(this,o,"visibility",h?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Sr[d],~d.indexOf(",")&&(d=d.split(",")[0]))),v=d in jr,v){if(this.styles.save(d),M=c,p==="string"&&c.substring(0,6)==="var(--"){if(c=Qe(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var k=t.style.perspective;t.style.perspective=c,c=Qe(t,"perspective"),k?t.style.perspective=k:nn(t,"perspective")}f=parseFloat(c)}if(_||(S=t._gsap,S.renderTransform&&!r.parseTransform||ri(t,r.parseTransform),w=r.smoothOrigin!==!1&&S.smooth,_=this._pt=new Be(this._pt,o,Kt,0,1,S.renderTransform,S,0,-1),_.dep=1),d==="scale")this._pt=new Be(this._pt,S,"scaleY",S.scaleY,(y?Vn(S.scaleY,y+f):f)-S.scaleY||0,xc),this._pt.u=0,s.push("scaleY",d),d+="X";else if(d==="transformOrigin"){T.push(Ue,0,o[Ue]),c=NS(c),S.svg?wc(t,c,0,w,0,this):(x=parseFloat(c.split(" ")[2])||0,x!==S.zOrigin&&Jr(this,S,"zOrigin",S.zOrigin,x),Jr(this,o,d,Qi(u),Qi(c)));continue}else if(d==="svgOrigin"){wc(t,c,1,w,0,this);continue}else if(d in L0){IS(this,S,d,h,y?Vn(h,y+c):c);continue}else if(d==="smoothOrigin"){Jr(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){zS(this,c,t);continue}}else d in o||(d=pa(d)||d);if(v||(f||f===0)&&(h||h===0)&&!vS.test(c)&&d in o)m=(u+"").substr((h+"").length),f||(f=0),x=Re(c)||(d in Je.units?Je.units[d]:m),m!==x&&(h=an(t,d,u,x)),this._pt=new Be(this._pt,v?S:o,d,h,(y?Vn(h,y+f):f)-h,!v&&(x==="px"||d==="zIndex")&&r.autoRound!==!1?TS:xc),this._pt.u=x||0,v&&M!==c?(this._pt.b=u,this._pt.e=M,this._pt.r=SS):m!==x&&x!=="%"&&(this._pt.b=u,this._pt.r=wS);else if(d in o)FS.call(this,t,d,u,y?y+c:c);else if(d in t)this.add(t,d,u||t[d],y?y+c:c,a,i);else if(d!=="parseTransform"){Qc(d,c);continue}v||(d in o?T.push(d,0,o[d]):typeof t[d]=="function"?T.push(d,2,t[d]()):T.push(d,1,u||t[d])),s.push(d)}}b&&k0(this)},render:function(t,r){if(r.tween._time||!cf())for(var n=r._pt;n;)n.r(t,n.d),n=n._next;else r.styles.revert()},get:$r,aliases:Sr,getSetter:function(t,r,n){var a=Sr[r];return a&&a.indexOf(",")<0&&(r=a),r in jr&&r!==Ue&&(t._gsap.x||$r(t,"x"))?n&&Ch===n?r==="scale"?kS:CS:(Ch=n||{})&&(r==="scale"?RS:ES):t.style&&!Kc(t.style[r])?MS:~r.indexOf("-")?AS:of(t,r)},core:{_removeProperty:nn,_getMatrix:hf}};He.utils.checkPrefix=pa;He.core.getStyleSaver=P0;(function(e,t,r,n){var a=ze(e+","+t+","+r,function(i){jr[i]=1});ze(t,function(i){Je.units[i]="deg",L0[i]=1}),Sr[a[13]]=e+","+t,ze(n,function(i){var s=i.split(":");Sr[s[1]]=a[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ze("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){Je.units[e]="px"});He.registerPlugin(z0);var Sc=He.registerPlugin(z0)||He;Sc.core.Tween;const Un={IN_OUT:"power2.inOut",OUT:"power2.out"},Aa={NO_STAGGER:0,RIPPLE_STAGGER_DELAY:.05};class B0{constructor(t,r={}){va(this,"timeline");va(this,"currentStage","");va(this,"callbacks");va(this,"durations");this.durations=t,this.callbacks=r,this.timeline=Sc.timeline({paused:!0,onUpdate:()=>this.handleProgress(),onComplete:()=>{var a,i,s,o;(i=(a=this.callbacks).onComplete)==null||i.call(a),(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"complete")}});let n=0;this.timeline.addLabel("seatsToRings",n),n+=t.seatsToRings/1e3,this.timeline.addLabel("ringsToBar",n),n+=t.ringsToBar/1e3,this.timeline.addLabel("axesReveal",n),n+=t.axesReveal/1e3,this.timeline.addLabel("barSlide",n),n+=t.barSlide/1e3,this.timeline.addLabel("barsGrow",n),n+=t.barsGrow/1e3,this.timeline.addLabel("barsToArea",n)}animateSeatsToRings(t,r){const n=this.durations.seatsToRings/1e3;return t.each(function(){const a=this;if(!a.getAttribute("data-orig-x")){const i=a.getAttribute("x"),s=a.getAttribute("y"),o=a.getAttribute("width"),l=a.getAttribute("height");a.setAttribute("data-orig-x",i||"0"),a.setAttribute("data-orig-y",s||"0"),a.setAttribute("data-orig-width",o||"0"),a.setAttribute("data-orig-height",l||"0")}}),this.timeline.to(t.nodes(),{width:2,y:(a,i)=>parseFloat(i.getAttribute("y")||"0"),height:(a,i)=>{const s=parseFloat(i.getAttribute("y")||"0");return r-s},duration:n,ease:Un.IN_OUT,stagger:Aa.NO_STAGGER,onStart:()=>{var a,i;this.currentStage="seatsToRings",(i=(a=this.callbacks).onStageComplete)==null||i.call(a,"seatsToRings")}},"seatsToRings"),this}animateRingsToBar(t,r){const n=this.durations.ringsToBar/1e3;return t.each(function(a,i){const s=this;if(!r[i])return;const l=s.getAttribute("x"),u=s.getAttribute("y"),c=s.getAttribute("width"),f=s.getAttribute("height");s.setAttribute("data-orig-x",l||"0"),s.setAttribute("data-orig-y",u||"0"),s.setAttribute("data-orig-width",c||"0"),s.setAttribute("data-orig-height",f||"0")}),this.timeline.to(t.nodes(),{x:a=>{var i;return((i=r[a])==null?void 0:i.x)??0},y:a=>{var i;return((i=r[a])==null?void 0:i.y)??0},width:a=>{var i;return((i=r[a])==null?void 0:i.width)??0},height:a=>{var i;return((i=r[a])==null?void 0:i.height)??0},duration:n,ease:Un.IN_OUT,stagger:Aa.NO_STAGGER,onStart:()=>{var a,i;this.currentStage="ringsToBar",(i=(a=this.callbacks).onStageComplete)==null||i.call(a,"ringsToBar")}},"ringsToBar"),this}animateAxesReveal(t,r){const n=this.durations.axesReveal/1e3;return this.timeline.to([t.node(),r.node()],{opacity:1,duration:n,ease:Un.IN_OUT,stagger:Aa.NO_STAGGER,onStart:()=>{var a,i;this.currentStage="axesReveal",(i=(a=this.callbacks).onStageComplete)==null||i.call(a,"axesReveal")}},"axesReveal"),this}animateBarSlide(t,r){const n=this.durations.barSlide/1e3;return this.timeline.to(t.nodes(),{x:r,duration:n,ease:Un.OUT,stagger:Aa.NO_STAGGER,onStart:()=>{var a,i;this.currentStage="barSlide",(i=(a=this.callbacks).onStageComplete)==null||i.call(a,"barSlide")}},"barSlide"),this}animateBarsGrow(t,r,n=Aa.RIPPLE_STAGGER_DELAY){const a=this.durations.barsGrow/1e3;return t.nodes().forEach((s,o)=>{const l=s,u=l.getAttribute("data-final-y")||"0",c=l.getAttribute("data-final-height")||"0",f=parseInt(l.getAttribute("data-timestamp-index")||"0"),p=Math.abs(f-r)*n;this.timeline.fromTo(l,{height:0,y:parseFloat(l.getAttribute("data-chart-baseline")||"400")},{y:parseFloat(u),height:parseFloat(c),duration:a,delay:p,ease:Un.OUT},"barsGrow")}),this.timeline.call(()=>{var s,o;this.currentStage="barsGrow",(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"barsGrow")},[],"barsGrow"),this}animateBarsToArea(t,r,n,a){const i=this.durations.barsToArea/1e3,s=new Map;return t.each(function(){var c;const o=this,l=o.getAttribute("class");if(!l)return;const u=l.match(/category-([\w-]+)/);if(u&&u[1]){const f=u[1];s.has(f)||s.set(f,[]),(c=s.get(f))==null||c.push(o)}}),this.timeline.set(t.nodes(),{opacity:0},"barsToArea"),this.timeline.set(r.nodes(),{opacity:1},"barsToArea"),r.each(function(){const o=this,l=o.getAttribute("data-category");if(!l)return;const u=n.get(l);u&&Sc.to(o,{attr:{d:u},duration:i,ease:Un.IN_OUT})}),this.timeline.call(()=>{var o,l;this.currentStage="barsToArea",(l=(o=this.callbacks).onStageComplete)==null||l.call(o,"barsToArea")},[],"barsToArea"),this}handleProgress(){var r,n;const t=this.timeline.progress();(n=(r=this.callbacks).onProgress)==null||n.call(r,t)}getControls(){return{play:()=>this.timeline.play(),pause:()=>this.timeline.pause(),reverse:()=>this.timeline.reverse(),restart:()=>this.timeline.restart(),seek:t=>this.timeline.progress(t),seekToStage:t=>{const r=this.timeline.labels[t];r!==void 0&&this.timeline.seek(r)},kill:()=>this.timeline.kill(),getProgress:()=>this.timeline.progress(),getCurrentStage:()=>this.currentStage,getTimeline:()=>this.timeline}}play(){this.timeline.play()}destroy(){this.timeline.kill()}}function BS(e,t){const{arcAngle:r,arcAngleFlexibility:n=5,radius:a,seatSize:i,minSeatSize:s,maxSeatSize:o,spacing:l,innerRadiusRatio:u}=t,c=a*u,f=e.reduce((O,R)=>O+R.seats,0);let h={seatSize:i,arcAngle:r,score:-1};const p=r-n,g=r+n;for(let O=p;O<=g;O+=2.5){const R=O*Math.PI/180;for(let E=o;E>=s;E-=.1){const H=E*2,I=H*l,P=Math.floor((a-c)/I);for(let j=1;j<=Math.min(P,10);j++){let Y=0;for(let rt=0;rt<j;rt++){const tt=c+(rt+.5)*I,J=H*l/tt,Q=Math.floor(R/J);Y+=Q}if(Y>=f){const rt=f/Y,tt=(E-s)/(o-s),J=(Y-f)/f,Q=J<.15?1:J<.3?.7:J<.5?.4:.1,it=1-Math.abs(O-r)/n,L=Q*.5+tt*.3+rt*.15+it*.05;L>h.score&&(h={seatSize:E,arcAngle:O,rings:j,score:L})}}}}const d=h.seatSize,m=h.arcAngle,x=m*Math.PI/180,y=d*2,v=y*l,_=Math.floor((a-c)/v),S=[],w=-x/2-Math.PI/2,b=[];let T=0,M=[];for(let O=1;O<=_;O++){let R=0;const E=[];for(let H=0;H<O;H++){const I=c+(H+.5)*v,P=y*l/I,j=Math.floor(x/P);E.push(j),R+=j}if(R>=f){T=O,M=E;break}}if(T>0)b.push(...M);else for(let O=0;O<_;O++){const R=c+(O+.5)*v,E=y*l/R,H=Math.floor(x/E);b.push(H)}for(let O=0;O<b.length;O++){const R=c+(O+.5)*v,E=b[O]??0;if(E>0){const H=x/E;for(let I=0;I<E;I++){const P=w+(I+.5)*H,j=Math.cos(P)*R,Y=Math.sin(P)*R;S.push({ring:O,index:I,angle:P,x:j,y:Y})}}}S.sort((O,R)=>{const E=O.angle-R.angle;return Math.abs(E)>.001?E:O.ring-R.ring});const k=[];let C=0;return e.forEach((O,R)=>{const E=Math.min(O.seats,S.length-C);for(let H=0;H<E&&C<S.length;H++){const I=S[C++];I&&k.push({x:I.x,y:I.y,category:O.name,categoryIndex:R,seatIndex:H,ring:I.ring,angle:I.angle,radius:d})}}),{arcAngle:m,radius:a,innerRadius:c,centerX:a,centerY:a,seatSize:d,seats:k,totalSeats:f}}function US(e,t,r){const n=t<=r?1:r/t;return e.filter(a=>a.value>0).map(a=>{const i=t<=r?a.value:Math.max(1,Math.floor(a.value*n));return{id:a.dataKey,name:a.label,seats:i,colour:a.color}})}function Ji({svg:e,events:t,xScale:r,chartHeight:n,chartWidth:a,timelineHeight:i,timelineOffset:s,instanceId:o,setHoveredTimelineEvent:l,enableBrush:u=!1,onTimeRangeChange:c,minAllowedTime:f,maxAllowedTime:h,brushColor:p="#69b3a2",mainGroupSelector:g}){const d=n+s,m=o?`.main-chart-group-${o}`:".main-chart-group",x=e.select(g??m),y=o?`timeline-track timeline-track-${o}`:"timeline-track",v=x.append("g").attr("class",y),_=6,S=o?`timeline-clip-${o}`:`timeline-clip-${Math.random().toString(36).substr(2,9)}`;e.append("defs").append("clipPath").attr("id",S).append("rect").attr("x",0).attr("y",d).attr("width",a+_).attr("height",i),v.append("rect").attr("class","timeline-background").attr("x",0).attr("y",d).attr("width",a).attr("height",i).attr("fill","#FFFFFF").attr("stroke","#9CA3AF").attr("stroke-width",1);const w=v.append("g").attr("clip-path",`url(#${S})`),b=3,T=w.selectAll(".timeline-event").data(t).enter().append("rect").attr("class","timeline-event").attr("x",k=>r(new Date(k.timestamp))-b/2).attr("y",d).attr("width",b).attr("height",i).attr("fill",k=>k.color||"#2F42FF").attr("stroke","none").attr("cursor","pointer").attr("data-timestamp",k=>k.timestamp).attr("data-event-name",k=>k.eventName),M=6;if(T.on("mouseenter",function(k,C){const O=Dt(this),R=r(new Date(C.timestamp));O.transition().duration(150).attr("x",R-M/2).attr("width",M),l&&l({timestamp:C.timestamp,eventName:C.eventName,x:R})}).on("mouseleave",function(k,C){const O=Dt(this),R=r(new Date(C.timestamp));O.transition().duration(150).attr("x",R-b/2).attr("width",b),l&&l(null)}),u&&c){const k=f,C=h,O=ga().extent([[0,d],[a,d+i]]).on("start",H=>{if(!H.selection&&k!==void 0&&C!==void 0){const I=H.sourceEvent;if(I){const P=I.offsetX,j=+r.invert(P);if(j<k||j>C){const Y=o?`.timeline-brush-${o}`:".timeline-brush";e.select(Y).call(O.move,null);return}}}}).on("brush",H=>{if(!H.selection)return;const[I,P]=H.selection;let j=+r.invert(I),Y=+r.invert(P);k!==void 0&&(j=Math.max(j,k),Y=Math.max(Y,k)),C!==void 0&&(j=Math.min(j,C),Y=Math.min(Y,C));const rt=r(new Date(j)),tt=r(new Date(Y));if(rt!==I||tt!==P){const J=o?`.timeline-brush-${o}`:".timeline-brush";e.select(J).call(O.move,[rt,tt])}}).on("end",H=>{if(!H.selection)return;const[I,P]=H.selection,j=[+r.invert(I),+r.invert(P)];k!==void 0&&(j[0]=Math.max(j[0],k)),C!==void 0&&(j[1]=Math.min(j[1],C)),c(j);const Y=o?`.timeline-brush-${o}`:".timeline-brush";e.select(Y).call(O.move,null)}),R=o?`timeline-brush timeline-brush-${o}`:"timeline-brush",E=x.append("g").attr("class",R).call(O);E.selectAll(".selection").attr("fill",p).attr("fill-opacity",.2).attr("stroke",p).attr("stroke-width",1),E.selectAll(".handle").attr("fill",p).attr("fill-opacity",.8),E.on("dblclick",()=>{const H=r.domain(),I=[+H[0],+H[1]];c(I)})}}const ur={neoGrey:{200:"#EDEFEF",400:"#ADB5BD"},neoDigitalGreen:{600:"#40c048"}},Ia=["#4CA75A","#FDDA04","#FFC008","#FF9800","#F9A91B","#FF5C24","#ED4134","#CB3446"],qe={greyHatch:{background:ur.neoGrey[200],lines:ur.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}};function HS(e,t){const r=e.append("pattern").attr("id",`${t}-greyHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");r.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.greyHatch.background),r.append("path").attr("d","M0,2 L8,2").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M0,6 L8,6").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5)}function GS(e,t){const r=e.append("pattern").attr("id",`${t}-dataMissingHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");r.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.dataMissingHatch.background),r.append("path").attr("d","M0,8 L8,0").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M-2,2 L2,-2").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M6,10 L10,6").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5)}function jS(e,t){const r=e.append("pattern").attr("id",`${t}-noLstHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");r.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.noLstHatch.background),r.append("path").attr("d","M0,0 L8,8").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M-2,6 L2,10").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),r.append("path").attr("d","M6,-2 L10,2").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5)}function bi(e,t){let r=e.select("defs");r.empty()&&(r=e.append("defs")),HS(r,t),GS(r,t),jS(r,t)}function $h(e,t){if(e.startsWith("url(#")&&e.endsWith(")")){const r=e.slice(5,-1);return`url(#${t}-${r})`}return e}function pf(e){return e.includes("greyHatchPattern")?qe.greyHatch.lines:e.includes("dataMissingHatchPattern")?qe.dataMissingHatch.lines:e.includes("noLstHatchPattern")?qe.noLstHatch.lines:e}function Tc(e,t,r,n){const{xScale:a,yScale:i,addClasses:s=!0,instanceId:o}=n,l=ss().x(h=>a(new Date(h.data.timestamp))).y0(h=>i(h[0])).y1(h=>i(h[1])).curve(Cn),u=Um().x(h=>a(new Date(h.data.timestamp))).y(h=>i(h[1])).curve(Cn),c=o?`areas areas-${o}`:"areas";let f=e.select(o?`.areas-${o}`:".areas");f.empty()&&(f=e.append("g").attr("class",c)),t.forEach((h,p)=>{var x;const g=r[p];if(!g)return;const d=((x=g.parliamentMapping)==null?void 0:x.isSpecialCategory)??!1,m=pf(g.color);if(d){const y=f.append("path").datum(h).attr("fill","none").attr("stroke",m).attr("stroke-width",3).attr("stroke-dasharray","15 8").attr("d",u).style("pointer-events","none");if(s){const v=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",v)}}else{const y=f.append("path").datum(h).attr("fill",g.color).attr("fill-opacity",g.fillOpacity??.7).attr("stroke",m).attr("stroke-width",g.strokeWidth??1.5).attr("d",l).style("pointer-events","none");if(s){const v=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",v)}}})}function YS(e,t){var n;const r=[];for(const a of e){let i=0;for(const s of t){const o=a[s.dataKey]||0,l=i,u=i+o;r.push({timestamp:a.timestamp,category:s.label,dataKey:s.dataKey,y0:l,y1:u,value:o,color:s.color,isSpecialCategory:((n=s.parliamentMapping)==null?void 0:n.isSpecialCategory)??!1}),i+=o}}return r}function ke(e){return e.replace(/[^a-zA-Z0-9-_]/g,"-")}function U0(e,t,r,n){const{centerX:a,centerY:i,addClasses:s=!0,instanceId:o,parliamentRadius:l=200}=n,u=o?`parliament parliament-${o}`:"parliament";let c=e.select(o?`.parliament-${o}`:".parliament");c.empty()&&(c=e.append("g").attr("class",u)),t.seats.forEach(p=>{const g=r.find(x=>x.label===p.category);if(!g)return;const d=c.append("circle").attr("cx",a+p.x).attr("cy",i+p.y).attr("r",p.radius).attr("fill",g.color).attr("stroke",g.color).attr("stroke-width",.5),m=c.append("circle").attr("cx",a+p.x).attr("cy",i+p.y).attr("r",p.radius*2.5).attr("fill","transparent").attr("stroke","none").attr("pointer-events","all");if(s){const x=o?`seat seat-${o} seat-${ke(p.category)}`:`seat seat-${ke(p.category)}`;d.attr("class",x),m.attr("class",x)}});const f=o?`parliament-label parliament-label-${o}`:"parliament-label";if(e.select(`.${f.split(" ")[0]}`).empty()){const p=e.append("g").attr("class",f).attr("transform",`translate(${a},${i-l*.15})`).style("opacity","0").style("pointer-events","none");p.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),p.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const g=p.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");g.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),g.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}}function XS(e,t,r,n,a,i,s=!1){var f;const o=new Map;let l=a;if(t.length>0&&((f=t[0])==null?void 0:f.timestamp)!==void 0){const h=t[0].timestamp;l=r(new Date(h))}const u=new Map;for(const h of e.seats)u.has(h.category)||u.set(h.category,[]),u.get(h.category).push(h);const c=new Map;for(const h of t)c.set(h.dataKey,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory}),h.label&&h.label!==h.dataKey&&c.set(h.label,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory});for(const h of e.seats){const p=c.get(h.category);if(!p){o.set(h,{x:l,y:i/2});continue}const g=n(p.y0),d=n(p.y1);let m;if(s){const x=u.get(h.category)??[],y=h.seatIndex,v=x.length;if(v===1)m=(g+d)/2;else{const _=y/(v-1);m=g+(d-g)*_}}else m=d;o.set(h,{x:l,y:m})}return o}function WS(e,t,r){var s;if(e.length===0)return[];const n=e[e.length-1],a=[];let i=0;for(const o of t){const l=n[o.dataKey]||0,u=i,c=i+l;a.push({dataKey:o.dataKey,label:o.label,y0:u,y1:c,value:l,timestamp:n.timestamp,isSpecialCategory:((s=o.parliamentMapping)==null?void 0:s.isSpecialCategory)??!1}),i+=l}return a}function KS(e){const t=e;return{seatsToLines:t*.2,seatsToBar:t*.07,crossFadePause:t*.003,barSlideToTimeline:t*.22,axesAndBarsGrow:t*.22,barsToArea:t*.287}}const _n=new Map;Dt.prototype.transition=Ic;const VS=({containerRef:e,data:t,categories:r,mode:n,width:a,height:i,margin:s,timeRange:o,showGrid:l=!0,showAxes:u=!0,axisLabelColor:c,axisLabelSize:f=14,formatDate:h,formatValue:p,markers:g=[],arcAngle:d=200,parliamentRadius:m=200,seatSize:x=4.5,animationDuration:y=900,onMorphComplete:v,onAnimationStateChange:_,onTimelineReady:S,onAnimationProgress:w,onHoveredDataChange:b,hoveredCategory:T,maxSeats:M=2e3,parliamentTimestamp:k,enableBrush:C=!1,onTimeRangeChange:O,minAllowedTime:R,maxAllowedTime:E,showScaleIndicator:H=!1,reposPerSeat:I=1,timelineEvents:P=[],showTimeline:j=!1,timelineHeight:Y=40,timelineOffset:rt=35,brushColor:tt="#69b3a2"})=>{const[J,Q]=K.useState("area"),[it,L]=K.useState(!1),[ot,nt]=K.useState(null),[N,F]=K.useState(0),[z,B]=K.useState(null),[A,W]=K.useState(null),[q,$]=K.useState([]),lt=K.useRef(null),V=K.useRef(n),ut=K.useRef(!0),vt=K.useRef(!1),et=K.useRef(`morph-${Math.random().toString(36).substr(2,9)}`),mt=K.useRef(void 0),Ct=K.useRef(o),st=K.useRef(g),yt=K.useRef(P),ht=K.useRef(v),bt=K.useRef(_),Bt=K.useRef(S),Ft=K.useRef(w),kt=K.useRef(b);K.useEffect(()=>{ht.current=v,bt.current=_,Bt.current=S,Ft.current=w,kt.current=b},[v,_,S,w,b]),K.useEffect(()=>{if(e.current&&J==="parliament")if(T){const xt=r.find(At=>At.dataKey===T);if(xt){const At=xt.label;if(nt(At),Ua(e.current,At),t.length>0){const jt=t[t.length-1],qt=Math.round(jt.values[xt.dataKey]||0),Ut={label:xt.label,value:qt,color:pf(xt.color)};Ba(e.current,Ut,H,I,et.current)}}}else nt(null),Ua(e.current,null),Ba(e.current,null,H,I,et.current)},[T,J,r,t,H,I]);const Vt=a-s.left-s.right,Rt=i-s.top-s.bottom;return K.useEffect(()=>{var Ot;if(!e.current||t.length===0||r.length===0||(mt.current&&(mt.current(),mt.current=void 0),vt.current))return;const xt=Dt(e.current),At=n!==V.current;ut.current?(xt.selectAll("*").remove(),bi(xt,et.current),ut.current=!1):At||(xt.selectAll("*").remove(),bi(xt,et.current));const jt=t[t.length-1],qt=r.reduce((ft,Pt)=>ft+(jt.values[Pt.dataKey]||0),0),Ut=t.map(ft=>{const Pt={timestamp:ft.timestamp};for(const It of r)Pt[It.dataKey]=ft.values[It.dataKey]||0;return Pt}),je=r.map(ft=>ft.dataKey),ue=Ka().keys(je),fr=ue(Ut),xe=t.map(ft=>ft.timestamp),Ye=At||!o?Math.min(...xe):o[0],Te=At||!o?Math.max(...xe):o[1],nr=[...xe].sort((ft,Pt)=>ft-Pt),ge=[];for(let ft=0;ft<nr.length-1;ft++)ge.push(nr[ft+1]-nr[ft]);const Et=ge.length>0?ge.reduce((ft,Pt)=>ft+Pt,0)/ge.length:0,Jt=Te+Et*1.15,St=Kn().domain([new Date(Ye),new Date(Jt)]).range([0,Vt]),ie=Ut.filter(ft=>ft.timestamp>=Ye&&ft.timestamp<=Te),ve=ue(ie),Yt=ve.length>0?Math.max(...ve[ve.length-1].map(ft=>ft[1]??0)):0,te=ia().domain([0,Yt*1.15]).range([Rt,0]),ce=r.map(ft=>({...ft,color:$h(ft.color,et.current)})),ar=ce.map(ft=>({dataKey:ft.dataKey,label:ft.label,color:ft.color,value:jt.values[ft.dataKey]||0})),G=US(ar,qt,M).reverse(),ct=BS(G,{arcAngle:d,radius:m,seatSize:x,minSeatSize:4,maxSeatSize:30,spacing:1.1,innerRadiusRatio:.4});lt.current=ct;const dt=WS(Ut,r),Tt=XS(ct,dt,St,te,Vt,Rt);if(At&&!vt.current){vt.current=!0,L(!0),(Ot=bt.current)==null||Ot.call(bt,!0),B(null),$([]),F(0);let ft=xt.select("g[transform]");if(ft.empty()&&(ft=xt.select("g")),ft.empty()){xt.selectAll("*").remove(),bi(xt,et.current),js(xt,n==="parliament"?"parliament":"area",fr,ce,ct,St,te,Vt,Rt,s,l,u,c,f,h,p,C,O,et.current,g,o,$,B,P,j,Y,rt,W,R,E,tt),L(!1),Q(n==="parliament"?"parliament":"area"),F(n==="parliament"?1:0),V.current=n;return}const Pt=setTimeout(()=>{vt.current=!1,L(!1),V.current=n},y*3);JS(xt,n,fr,ce,ct,Tt,St,te,Vt,Rt,s,y,()=>{var It,me,ee;if(clearTimeout(Pt),vt.current=!1,L(!1),Q(n==="parliament"?"parliament":"area"),n==="parliament"&&F(1),(It=bt.current)==null||It.call(bt,!1),(me=ht.current)==null||me.call(ht),V.current=n,n==="parliament"&&e.current&&kt.current&&(mt.current=Ys(e.current,ce,t,ot,nt,kt.current,H,I,et.current)),n!=="parliament"&&e.current){nt(null),(ee=kt.current)==null||ee.call(kt,null),Ba(e.current,null,H,I,et.current);const De=Dt(e.current),fe=De.select(et.current?`.main-chart-group-${et.current}`:".main-chart-group");if(j){const Fe=et.current?`.timeline-track-${et.current}`:".timeline-track",Ne=et.current?`.timeline-brush-${et.current}`:".timeline-brush";fe.select(Fe).remove(),fe.select(Ne).remove(),Ji({svg:De,events:P,xScale:St,chartHeight:Rt,chartWidth:Vt,timelineHeight:Y,timelineOffset:rt,instanceId:et.current,setHoveredTimelineEvent:W,enableBrush:C,onTimeRangeChange:O,minAllowedTime:R,maxAllowedTime:E,brushColor:tt})}if(C&&O){const Fe=fe.select(et.current?`.chart-content-group-${et.current}`:".chart-content-group");ZS(Fe,Vt,Rt,St,O,et.current,De,R,E,tt)}if(g.length>0&&$&&B&&o){const Ne=g.filter(re=>re.timestamp>=(o[0]??0)-1&&re.timestamp<=(o[1]??1/0)+1).map(re=>({...re,x:St(new Date(re.timestamp))}));if($(Ne),Ne.length>0){Lh(fe,Ne,Rt,Vt,C,B,et.current);const re=fe.select(et.current?`.markers-${et.current}`:".markers");if(!re.empty()){fe.selectAll(".marker-hover-overlay").remove();const Pn=fe.select(et.current?`.chart-content-group-${et.current}`:".chart-content-group");let hr;C?hr=Pn.select(".brush .overlay"):hr=fe.append("rect").attr("class","marker-hover-overlay").attr("x",0).attr("y",0).attr("width",Vt).attr("height",Rt).attr("fill","none").attr("pointer-events","all");let Rr=null;hr.on("mousemove",function(Fn){const[Yr]=Tr(Fn,this);let Nn=null,pr=1/0;if(Ne.forEach(on=>{const X=Math.abs(Yr-on.x);X<pr&&(pr=X,Nn=on)}),!Nn||pr>50){Rr!==null&&(Rr=null,re.selectAll(".marker-line").attr("opacity",0),re.selectAll(".marker-label").attr("opacity",0),B(null));return}const Er=Nn;Rr!==Er.timestamp&&(Rr=Er.timestamp,re.selectAll(".marker-line").attr("opacity",0),re.selectAll(".marker-label").attr("opacity",0),re.selectAll(".marker-line").filter(function(){return Dt(this).attr("data-timestamp")===String(Er.timestamp)}).attr("opacity",.6),re.selectAll(".marker-label").filter(function(){return Dt(this).attr("data-timestamp")===String(Er.timestamp)}).attr("opacity",1),B(Er))}),hr.on("mouseleave",function(){Rr=null,re.selectAll(".marker-line").attr("opacity",0),re.selectAll(".marker-label").attr("opacity",0),B(null)})}}}}},u,f,h,p,Bt.current,(It,me)=>{var ee;if(n==="parliament"&&It>=.95){const De=(It-.95)/.05;F(Math.min(De,1))}(ee=Ft.current)==null||ee.call(Ft,It,me)},k,et.current)}else V.current=n,n==="parliament"&&(B(null),$([])),js(xt,n==="parliament"?"parliament":"area",fr,ce,ct,St,te,Vt,Rt,s,l,u,c,f,h,p,C,O,et.current,g,o,$,B,P,j,Y,rt,W,R,E,tt),Q(n==="parliament"?"parliament":"area"),F(n==="parliament"?1:0),n==="parliament"&&e.current&&kt.current&&(mt.current=Ys(e.current,ce,t,ot,nt,kt.current,H,I,et.current));return()=>{mt.current&&(mt.current(),mt.current=void 0)}},[n]),K.useEffect(()=>{var ie,ve;if(!e.current||t.length===0||vt.current)return;if(ut.current){Ct.current=o;return}if(!(o!==Ct.current&&((o==null?void 0:o[0])!==((ie=Ct.current)==null?void 0:ie[0])||(o==null?void 0:o[1])!==((ve=Ct.current)==null?void 0:ve[1]))))return;Ct.current=o;const At=Dt(e.current),jt=t.map(Yt=>{const te={timestamp:Yt.timestamp};for(const ce of r)te[ce.dataKey]=Yt.values[ce.dataKey]||0;return te}),qt=r.map(Yt=>Yt.dataKey),je=Ka().keys(qt)(jt),ue=t.map(Yt=>Yt.timestamp),fr=o?o[0]:Math.min(...ue),xe=o?o[1]:Math.max(...ue),Te=(ue.length>1?(ue[ue.length-1]-ue[0])/(ue.length-1):0)*.5,nr=Kn().domain([new Date(fr-Te),new Date(xe+Te)]).range([0,a-s.left-s.right]),ge=Math.max(...je[je.length-1].map(Yt=>Yt[1])),Et=ia().domain([0,ge*1.1]).range([i-s.top-s.bottom,0]);if(!lt.current)return;const Jt=lt.current,St=r.map(Yt=>({...Yt,color:$h(Yt.color,et.current)}));At.selectAll("*").remove(),bi(At,et.current),js(At,J==="parliament"?"parliament":"area",je,St,Jt,nr,Et,a-s.left-s.right,i-s.top-s.bottom,s,l,u,c,f,h,p,C,O,et.current,g,o,$,B,P,j,Y,rt,W,R,E,tt),J==="parliament"&&e.current&&kt.current&&(mt.current=Ys(e.current,St,t,ot,nt,kt.current,H,I,et.current))},[o]),K.useEffect(()=>{if(!e.current||t.length===0||vt.current)return;if(ut.current){st.current=g,yt.current=P;return}if(J==="parliament"){st.current=g,yt.current=P;return}const xt=g.length!==st.current.length||g.some((Et,Jt)=>{var St,ie;return Et.timestamp!==((St=st.current[Jt])==null?void 0:St.timestamp)||Et.label!==((ie=st.current[Jt])==null?void 0:ie.label)}),At=P.length!==yt.current.length||P.some((Et,Jt)=>{var St,ie;return Et.timestamp!==((St=yt.current[Jt])==null?void 0:St.timestamp)||Et.eventName!==((ie=yt.current[Jt])==null?void 0:ie.eventName)});if(!xt&&!At)return;st.current=g,yt.current=P;const jt=Dt(e.current),qt=jt.select(et.current?`.main-chart-group-${et.current}`:".main-chart-group");if(qt.empty())return;const Ut=t.map(Et=>Et.timestamp),je=o?o[0]:Math.min(...Ut),ue=o?o[1]:Math.max(...Ut),xe=(Ut.length>1?(Ut[Ut.length-1]-Ut[0])/(Ut.length-1):0)*.5,Ye=a-s.left-s.right,Te=i-s.top-s.bottom,nr=Kn().domain([new Date(je-xe),new Date(ue+xe)]).range([0,Ye]);if(At&&j){const Et=et.current?`.timeline-track-${et.current}`:".timeline-track",Jt=et.current?`.timeline-brush-${et.current}`:".timeline-brush";qt.select(Et).remove(),qt.select(Jt).remove(),Ji({svg:jt,events:P,xScale:nr,chartHeight:Te,chartWidth:Ye,timelineHeight:Y,timelineOffset:rt,instanceId:et.current,setHoveredTimelineEvent:W,enableBrush:C,onTimeRangeChange:O,minAllowedTime:R,maxAllowedTime:E,brushColor:tt})}let ge=[];if(xt&&g.length>0&&o){const Et=et.current?`.markers-${et.current}`:".markers";qt.select(Et).remove();const Jt=1;ge=g.filter(St=>St.timestamp>=(o[0]??0)-Jt&&St.timestamp<=(o[1]??1/0)+Jt).map(St=>({...St,x:nr(new Date(St.timestamp))})),$(ge),ge.length>0&&Lh(qt,ge,Te,Ye,C,B,et.current)}if(ge.length>0){const Et=qt.select(et.current?`.markers-${et.current}`:".markers");if(!Et.empty()){qt.selectAll(".marker-hover-overlay").remove();const Jt=qt.append("rect").attr("class","marker-hover-overlay").attr("x",0).attr("y",0).attr("width",Ye).attr("height",Te).attr("fill","none").attr("pointer-events","all");let St=null;Jt.on("mousemove",function(ie){const[ve]=Tr(ie,this);let Yt=null,te=1/0;if(ge.forEach(G=>{const ct=Math.abs(ve-G.x);ct<te&&(te=ct,Yt=G)}),!Yt||te>50){St!==null&&(St=null,Et.selectAll(".marker-line").attr("opacity",0),Et.selectAll(".marker-label").attr("opacity",0),B(null));return}const ar=Yt;St!==ar.timestamp&&(St=ar.timestamp,Et.selectAll(".marker-line").attr("opacity",0),Et.selectAll(".marker-label").attr("opacity",0),Et.selectAll(".marker-line").filter(function(){return Dt(this).attr("data-timestamp")===String(ar.timestamp)}).attr("opacity",.6),Et.selectAll(".marker-label").filter(function(){return Dt(this).attr("data-timestamp")===String(ar.timestamp)}).attr("opacity",1),B(ar))}),Jt.on("mouseleave",function(){St=null,Et.selectAll(".marker-line").attr("opacity",0),Et.selectAll(".marker-label").attr("opacity",0),B(null)})}}},[g,P,it]),{isMorphing:it,currentMode:J,hoveredCategory:ot,scaleIndicatorOpacity:N,visibleMarkers:q,hoveredMarker:z,setHoveredMarker:B,hoveredTimelineEvent:A,setHoveredTimelineEvent:W}};function ZS(e,t,r,n,a,i,s,o,l,u){const c=o,f=l,h=ga().extent([[0,0],[t,r]]).on("start",g=>{if(!g.selection&&c!==void 0&&f!==void 0){const d=g.sourceEvent;if(d){const m=d.offsetX,x=+n.invert(m);if(x<c||x>f){s.select(".brush").call(h.move,null);return}}}}).on("brush",g=>{if(!g.selection)return;const[d,m]=g.selection;let x=+n.invert(d),y=+n.invert(m);c!==void 0&&(x=Math.max(x,c),y=Math.max(y,c)),f!==void 0&&(x=Math.min(x,f),y=Math.min(y,f));const v=n(new Date(x)),_=n(new Date(y));(v!==d||_!==m)&&s.select(".brush").call(h.move,[v,_])}).on("end",g=>{if(!g.selection)return;const[d,m]=g.selection,x=[+n.invert(d),+n.invert(m)];c!==void 0&&(x[0]=Math.max(x[0],c)),f!==void 0&&(x[1]=Math.min(x[1],f)),a(x),s.select(".brush").call(h.move,null)}),p=e.append("g").attr("class","brush").call(h);p.selectAll(".selection").attr("fill",u).attr("fill-opacity",.2).attr("stroke",u).attr("stroke-width",1),p.selectAll(".handle").attr("fill",u).attr("fill-opacity",.8),p.on("dblclick",()=>{const g=n.domain(),d=[+g[0],+g[1]];o!==void 0&&(d[0]=Math.max(d[0],o)),l!==void 0&&(d[1]=Math.min(d[1],l)),a(d)})}function Lh(e,t,r,n,a,i,s){const o=s?`markers markers-${s}`:"markers",l=e.append("g").attr("class",o);t.forEach(u=>{l.append("line").attr("class","marker-line").attr("data-timestamp",u.timestamp).attr("x1",u.x).attr("x2",u.x).attr("y1",0).attr("y2",r).attr("stroke",u.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),u.label&&l.append("text").attr("class","marker-label").attr("data-timestamp",u.timestamp).attr("x",u.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",u.color??"#2F42FF").attr("opacity",0)})}function QS(e,t,r,n,a,i,s){let o=null,l;i?l=e.select(".brush .overlay"):l=e.append("rect").attr("class","marker-hover-overlay").attr("width",n).attr("height",a).attr("fill","none").attr("pointer-events","all");const u=c=>{let f=null,h=1/0;if(r.forEach(d=>{const m=Math.abs(c-d.x);m<h&&(h=m,f=d)}),!f||h>50)return o!==null&&(o=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null)),!1;const g=f;return o===g.timestamp||(o=g.timestamp,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),t.selectAll(".marker-line").filter(function(){return Dt(this).attr("data-timestamp")===String(g.timestamp)}).attr("opacity",.6),t.selectAll(".marker-label").filter(function(){return Dt(this).attr("data-timestamp")===String(g.timestamp)}).attr("opacity",1),s(g)),!0};l.on("mousemove",function(c){const[f]=Tr(c,this);u(f)}),l.on("mouseleave",function(){o=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null)})}function js(e,t,r,n,a,i,s,o,l,u,c,f,h,p,g,d,m=!1,x,y,v=[],_=[0,0],S,w,b=[],T=!1,M=40,k=15,C,O,R,E="#69b3a2"){const H=O,I=R;let P=null;const j=y?`main-chart-group main-chart-group-${y}`:"main-chart-group",Y=e.append("g").attr("class",j).attr("transform",`translate(${u.left},${u.top})`),rt=y?`chart-clip-${y}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`;e.select("defs").append("clipPath").attr("id",rt).append("rect").attr("x",0).attr("y",0).attr("width",o).attr("height",l);const tt=y?`chart-content-group chart-content-group-${y}`:"chart-content-group",J=Y.append("g").attr("class",tt).attr("clip-path",`url(#${rt})`);if(c&&t!=="parliament"&&(J.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(Ir(i).ticks(6).tickSize(l).tickFormat(()=>"")),J.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(zr(s).ticks(5).tickSize(-o).tickFormat(()=>""))),t==="area"&&(Tc(J,r,n,{xScale:i,yScale:s,addClasses:!0,instanceId:y}),v.length>0)){const it=v.filter(L=>L.timestamp>=_[0]-1&&L.timestamp<=_[1]+1).map(L=>({...L,x:i(new Date(L.timestamp))}));P={markersGroup:null,visibleMarkers:it},S&&S(it)}if(t==="parliament"){const Q=o/2,it=a.radius+10,L=l-a.radius*.3,ot=Math.max(it,L);U0(J,a,n,{centerX:Q,centerY:ot,addClasses:!0,instanceId:y,parliamentRadius:a.radius})}if(f&&t!=="parliament"){const it=Ir(i).ticks(6).tickPadding(12);g&&it.tickFormat(z=>g(+z));const ot=Y.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).call(it).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&ot.attr("fill",h);const nt=zr(s).ticks(5);nt.tickFormat(z=>+z==0?"":d?d(+z):String(z));const F=Y.append("g").attr("class","axis axis-y").call(nt).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&F.attr("fill",h)}if(m&&x&&t==="area"){const Q=H,it=I,L=ga().extent([[0,0],[o,l]]).on("start",nt=>{if(!nt.selection&&Q!==void 0&&it!==void 0){const N=nt.sourceEvent;if(N){const F=N.offsetX-((u==null?void 0:u.left)||0),z=+i.invert(F);if(z<Q||z>it){e.select(".brush").call(L.move,null);return}}}}).on("brush",nt=>{if(!nt.selection)return;const[N,F]=nt.selection;let z=+i.invert(N),B=+i.invert(F);Q!==void 0&&(z=Math.max(z,Q),B=Math.max(B,Q)),it!==void 0&&(z=Math.min(z,it),B=Math.min(B,it));const A=i(new Date(z)),W=i(new Date(B));(A!==N||W!==F)&&e.select(".brush").call(L.move,[A,W])}).on("end",nt=>{if(!nt.selection)return;const[N,F]=nt.selection,z=[+i.invert(N),+i.invert(F)];Q!==void 0&&(z[0]=Math.max(z[0],Q)),it!==void 0&&(z[1]=Math.min(z[1],it)),x(z),e.select(".brush").call(L.move,null)}),ot=J.append("g").attr("class","brush").call(L);ot.selectAll(".selection").attr("fill",E).attr("fill-opacity",.2).attr("stroke",E).attr("stroke-width",1),ot.selectAll(".handle").attr("fill",E).attr("fill-opacity",.8),ot.on("dblclick",()=>{const nt=i.domain(),N=[+nt[0],+nt[1]];x(N)})}if(t==="area"&&P&&P.visibleMarkers.length>0){const Q=Y.append("g").attr("class","markers").attr("clip-path",`url(#${rt})`);P.visibleMarkers.forEach(it=>{Q.append("line").attr("class","marker-line").attr("data-timestamp",it.timestamp).attr("x1",it.x).attr("x2",it.x).attr("y1",0).attr("y2",l).attr("stroke",it.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),it.label&&Q.append("text").attr("class","marker-label").attr("data-timestamp",it.timestamp).attr("x",it.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",it.color??"#2F42FF").attr("opacity",0)}),P.markersGroup=Q}t==="area"&&T&&C&&Ji({svg:e,events:b,xScale:i,chartHeight:l,chartWidth:o,timelineHeight:M,timelineOffset:k,instanceId:y,setHoveredTimelineEvent:C,enableBrush:m,onTimeRangeChange:x,minAllowedTime:H,maxAllowedTime:I,brushColor:E}),P&&P.visibleMarkers.length>0&&w&&t==="area"&&QS(J,P.markersGroup,P.visibleMarkers,o,l,m,w)}function JS(e,t,r,n,a,i,s,o,l,u,c,f,h,p=!0,g=14,d,m,x,y,v,_){const S=e.select(_?`.main-chart-group-${_}`:".main-chart-group");S.selectAll(".markers").remove(),S.selectAll(".marker-hover-overlay").remove(),S.selectAll(".brush").remove(),t==="stacked-area"||t==="area"?tT(S,r,n,a,i,s,o,l,u,f,h,p,g,d,m,x,y,v,_):eT(S,r,n,a,i,s,o,l,u,f,h,p,g,d,m,x,y,v,_)}function za(e,t,r,n,a,i,s,o){const l=e[i];if(!l)return"";const u=l.find(w=>w.data.timestamp===s);if(!u)return"";const c=u.data,f=t[i];if(!f)return"";const h=f.dataKey,p=c[h];if(!p||p<=0)return"";const g=r.get(s);if(!g)return"";const d=g.x,m=g.width,x=u[0],y=u[1],v=o?a:n(x),_=o?a:n(y),S=[];return S.push(`M ${d} ${v}`),S.push(`L ${d} ${_}`),S.push(`L ${d+m} ${_}`),S.push(`L ${d+m} ${v}`),S.push("Z"),S.join(" ")}function tT(e,t,r,n,a,i,s,o,l,u,c,f=!0,h=14,p,g,d,m,x,y){var on;const v=y?`.seat-${y}`:".seat",_=e.selectAll(v),S=y?`.chart-content-group-${y}`:".chart-content-group";let w=e.select(S);if(w.empty()){const X=e.attr("clip-path"),at=X?((on=X.match(/url\(#(.+)\)/))==null?void 0:on[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,pt=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";w=e.append("g").attr("class",pt).attr("clip-path",`url(#${at})`)}if(_.size()===0){Tc(e,t,r,{xScale:i,yScale:s,addClasses:!0,instanceId:y}),c();return}const b=KS(u),T=y?_n.get(y):void 0;T&&(T.destroy(),y&&_n.delete(y));const M=X=>X<.2?"seatsToRings":X<.35?"ringsToBar":X<.464?"axesReveal":X<.6?"barSlide":X<.82?"barsGrow":"barsToArea",k=new B0({seatsToRings:b.seatsToLines,ringsToBar:b.seatsToBar,axesReveal:b.barSlideToTimeline*.3,barSlide:b.barSlideToTimeline*.7,barsGrow:b.axesAndBarsGrow,barsToArea:b.barsToArea},{onStageComplete:X=>{},onProgress:X=>{if(m){const at=M(X);m(X,at)}},onComplete:()=>{c()}});y&&_n.set(y,k),d&&d(k.getControls().getTimeline());const C=t[0].map(X=>X.data),O=YS(C,r),R=o/2,E=n.radius+10,H=l-n.radius*.3,I=Math.max(E,H),P=C.map(X=>X.timestamp),j=x??Math.max(...P),Y=new Map,rt=[];P.forEach((X,at)=>{const pt=i(new Date(X)),_t=P[at+1];if(_t){const Ht=i(new Date(_t))-pt;rt.push(Ht)}});const tt=rt.length>0?rt.reduce((X,at)=>X+at,0)/rt.length:30;P.forEach((X,at)=>{const pt=i(new Date(X)),_t=P[at+1],Ht=at===P.length-1?tt:i(new Date(_t))-pt;Y.set(X,{x:pt,width:Ht})});const J=O.filter(X=>X.timestamp===j),Q=Y.get(j),it=666,L=y?`parliament-bar-path parliament-bar-path-${y}`:"parliament-bar-path",ot=w.append("g").attr("class",L);J.sort((X,at)=>at.y0-X.y0),new Map().set(j,{x:it-Q.width/2,width:Q.width});const N=[],F=(n.radius-n.innerRadius)*.6,B=l*.8,A=I,W=J.reduce((X,at)=>X+(at.y1-at.y0),0);let q=0;r.forEach(X=>{const at=J.find(we=>we.dataKey===X.dataKey);if(!at)return;const ne=(at.y1-at.y0)/W*B,Ht=A-q,Me=A-q-ne,be=it-F/2,$e=`M ${be} ${Ht} L ${be} ${Me} L ${be+F} ${Me} L ${be+F} ${Ht} Z`;q+=ne;const Xe=ot.append("path").attr("class",`parliament-bar-segment category-${ke(at.dataKey)}`).attr("d",$e).attr("fill",at.color).style("opacity",0).node();Xe&&N.push(Xe)}),y&&(window.orchestratorMap=_n);const $=k.getControls().getTimeline(),lt=b.seatsToLines/1e3,V=b.seatsToBar/1e3;$.call(()=>{m==null||m($.progress(),"seatsToRings")},[],"seatsToRings");const ut=_.nodes(),vt=R,et=I,mt=Math.max(...n.seats.map(X=>X.ring)),Ct=n.seats.filter(X=>X.ring===mt),st=e.append("g").attr("class",`seat-lines-${y||"default"}`),yt=r.map(X=>{const at=_.filter(`.seat-${ke(X.dataKey)}`).size();return at>0?{name:X.dataKey,seatCount:at,color:X.color}:null}).filter(X=>X!==null).reverse(),ht=yt.reduce((X,at)=>X+at.seatCount,0),bt=Ct.length,Bt=n.radius-n.innerRadius,Ft=Bt*.6,kt=Ft/2,Vt=Bt*.6,Rt=[];let xt=0;yt.forEach(X=>{const at=Math.max(1,Math.round(X.seatCount/ht*bt));for(let pt=0;pt<at;pt++){const _t=(xt+pt)/bt,ne=n.arcAngle*Math.PI/180,Me=-ne/2-Math.PI/2+_t*ne,be=(n.innerRadius+n.radius)/2,$e=vt+Math.cos(Me)*be,Xe=et+Math.sin(Me)*be,we=Math.cos(Me),Xr=Math.sin(Me),ln=$e-kt*we,$n=Xe-kt*Xr,he=$e+kt*we,Wr=Xe+kt*Xr,Kr=st.append("line").attr("class","seat-line").attr("x1",ln).attr("y1",$n).attr("x2",he).attr("y2",Wr).attr("stroke",X.color).attr("stroke-width",n.seatSize*2).attr("stroke-linecap","butt").style("opacity",0).attr("data-angle",Me*180/Math.PI).attr("data-center-x",$e).attr("data-center-y",Xe).attr("data-initial-length",Ft).node();Rt.push({element:Kr,angle:Me})}xt+=at});const At=()=>{st.remove()},jt=lt*.5,qt=0,Ut=[];if(Ut.push(...ut),Ut.sort((X,at)=>{const pt=parseInt(X.getAttribute("data-layout-index")||"-1",10),_t=parseInt(at.getAttribute("data-layout-index")||"-1",10);return pt-_t}),Ut.length>0&&Rt.length>0){const X=Rt.map(at=>at.element);$.to(Ut,{attr:{r:1.5},duration:jt*.3,ease:"power2.in"},`seatsToRings+=${qt}`),X.forEach(at=>{const pt=at.getAttribute("x1")||"0",_t=at.getAttribute("y1")||"0",ne=at.getAttribute("x2")||"0",Ht=at.getAttribute("y2")||"0";at.setAttribute("data-final-x1",pt),at.setAttribute("data-final-y1",_t),at.setAttribute("data-final-x2",ne),at.setAttribute("data-final-y2",Ht),at.setAttribute("x1",pt),at.setAttribute("y1",_t),at.setAttribute("x2",pt),at.setAttribute("y2",_t)}),$.to(X,{attr:{x2:(at,pt)=>parseFloat(pt.getAttribute("data-final-x2")||"0"),y2:(at,pt)=>parseFloat(pt.getAttribute("data-final-y2")||"0")},opacity:.9,duration:jt*.6,ease:"power2.out"},`seatsToRings+=${qt+jt*.2}`),$.to(Ut,{opacity:0,duration:jt*.3,ease:"power2.out"},`seatsToRings+=${qt+jt*.3}`)}const je=lt*.05,ue=lt*.7,fr=qt+jt+je;if(Rt.length>0){const X=it,at=I,_t=l*.8/Rt.length,ne=at,Ht=[...Rt].sort(($e,Xe)=>Xe.angle-$e.angle),be=.6/Ht.length;Ht.forEach(($e,Xe)=>{const we=X,ln=ne-Xe*_t,$n=be*Xe*ue,he=$e.element,Wr=parseFloat(he.getAttribute("data-final-x1")||"0"),Kr=parseFloat(he.getAttribute("data-final-y1")||"0"),xa=parseFloat(he.getAttribute("data-final-x2")||"0"),Ln=parseFloat(he.getAttribute("data-final-y2")||"0"),di=(Wr+xa)/2,_r=(Kr+Ln)/2,Vr=Math.atan2(Ln-Kr,xa-Wr),un=Math.sqrt(Math.pow(xa-Wr,2)+Math.pow(Ln-Kr,2));$.to({progress:0},{progress:1,duration:ue*.5,ease:"power2.inOut",delay:$n,onUpdate:function(){const se=this.progress(),xs=di+(we-di)*se,vs=_r+(ln-_r)*se,xr=40*4*se*(1-se),cn=xs,fn=vs-xr,ws=0-Vr,Dr=Vr+ws*se*se,gi=(un+(Vt-un)*se)/2,$y=cn-gi*Math.cos(Dr),Ly=fn-gi*Math.sin(Dr),qy=cn+gi*Math.cos(Dr),Iy=fn+gi*Math.sin(Dr);he.setAttribute("x1",$y.toString()),he.setAttribute("y1",Ly.toString()),he.setAttribute("x2",qy.toString()),he.setAttribute("y2",Iy.toString())},onComplete:function(){const se=Vt/2;he.setAttribute("x1",(we-se).toString()),he.setAttribute("y1",ln.toString()),he.setAttribute("x2",(we+se).toString()),he.setAttribute("y2",ln.toString())}},`seatsToRings+=${fr}`),$.to($e.element,{opacity:.95,duration:ue*.3,ease:"power2.out",delay:$n},`seatsToRings+=${fr}`)})}const xe=st,Ye=[];J.forEach((X,at)=>{const pt=_.filter(`.seat-${ke(X.category)}`),_t=pt.size();if(_t===0)return;const ne=s(X.y1),Ht=s(X.y0)-s(X.y1),Me=pt.nodes().sort((_r,Vr)=>{const un=parseInt(_r.getAttribute("data-layout-index")||"-1",10),se=parseInt(Vr.getAttribute("data-layout-index")||"-1",10);return un-se}),be=Math.max(Q.width,100),$e=Ht,Xe=be/Math.max($e,1),we=Math.max(2,Math.ceil(Math.sqrt(_t*Xe))),Xr=Math.ceil(_t/we),ln=be*.8,$n=$e*.8,he=we>1?ln/(we-1):0,Wr=Xr>1?$n/(Xr-1):0,Kr=we>1?(we-1)*he:0,xa=Xr>1?(Xr-1)*Wr:0,Ln=it-be/2+(be-Kr)/2,di=ne+($e-xa)/2;Me.forEach((_r,Vr)=>{const un=parseInt(_r.getAttribute("data-layout-index")||"-1",10),se=un>=0?n.seats[un]:void 0,xs=se?R+se.x:parseFloat(_r.getAttribute("cx")||"0"),vs=se?I+se.y:parseFloat(_r.getAttribute("cy")||"0"),Rf=(se==null?void 0:se.radius)||parseFloat(_r.getAttribute("r")||"4"),xr=_t%we;let cn,fn;if(xr>0&&Vr<xr)fn=0,cn=Vr;else{const Dr=Vr-(xr>0?xr:0);cn=Dr%we,fn=Math.floor(Dr/we)+(xr>0?1:0)}let bs=Ln+cn*he;if(xr>0&&fn===0){const Dr=xr>1?(xr-1)*he:0,Ef=(Kr-Dr)/2;bs=Ln+Ef+cn*he}const ws=di+fn*Wr;Ye.push({element:_r,startX:xs,startY:vs,startRadius:Rf,category:X.dataKey,segmentIndex:at,endY:ws,endX:bs})})});const Te=Ye.map(X=>{const at=X.startX-R,pt=X.startY-I,_t=Math.atan2(pt,at);return{...X,angle:_t}});Te.sort((X,at)=>at.angle-X.angle);const nr=V*.8,ge=.6,Et=Te.length,St=nr/Math.max(Et,1)*(Et-1)+ge,ie=V*.3,ve=St;$.to(N,{opacity:1,duration:ie,ease:"power2.inOut"},`seatsToBar+=${ve}`),xe&&($.to(xe.selectAll(".seat-line").nodes(),{opacity:0,duration:ie,ease:"power2.inOut"},`seatsToBar+=${ve}`),$.call(()=>{At()},[],`seatsToBar+=${ve+ie}`));const Yt=b.barSlideToTimeline/1e3;let te=null,ce=null;if(f){const at=Ir(i).ticks(6).tickPadding(12);p&&at.tickFormat(_t=>p(_t.getTime())),te=e.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).attr("opacity",0),te.call(at).selectAll("text").attr("font-size",h).attr("font-weight",500);const pt=zr(s).ticks(5);pt.tickFormat(_t=>+_t==0?"":g?g(_t):String(_t)),ce=e.append("g").attr("class","axis axis-y").attr("opacity",0),ce.call(pt).selectAll("text").attr("font-size",h).attr("font-weight",500)}const ar=b.crossFadePause/1e3,G=ve+ie+ar;N.forEach(X=>{const at=Array.from(X.classList).find(Ht=>Ht.startsWith("category-"));if(!at||!J.find(Ht=>ke(Ht.dataKey)===at.replace("category-","")))return;const _t=r.findIndex(Ht=>ke(Ht.dataKey)===at.replace("category-",""));if(_t===-1)return;const ne=za(t,r,Y,s,l,_t,j,!1);ne&&$.to(X,{attr:{d:ne},duration:Yt,ease:"power2.out"},`seatsToBar+=${G}`)});const ct=ss().x(X=>i(X.data.timestamp)).y0(X=>s(X[0])).y1(X=>s(X[1])).curve(Cn),dt=new Map;t.forEach((X,at)=>{const pt=r[at];if(pt){const _t=ct(X)||"";dt.set(pt.dataKey,_t)}});const Tt=G+Yt;f&&te&&ce&&$.to([te.node(),ce.node()],{opacity:1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${G}`);const Ot=w.select(".grid-vertical"),ft=w.select(".grid-horizontal");if(!Ot.empty()||!ft.empty()){const at=[];Ot.empty()||at.push(Ot.node()),ft.empty()||at.push(ft.node()),$.to(at,{opacity:.1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${G}`)}const Pt=b.axesAndBarsGrow/1e3,It=b.barsToArea/1e3,me=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",ee=w.append("g").attr("class",me);P.forEach(X=>{if(X===j)return;const at=Y.get(X);at&&r.forEach((pt,_t)=>{const ne=za(t,r,Y,s,l,_t,X,!0),Ht=za(t,r,Y,s,l,_t,X,!1);if(!ne||!Ht)return;const Me=y?`histogram-path histogram-path-${y} category-${ke(pt.dataKey)}`:`histogram-path category-${ke(pt.dataKey)}`;ee.append("path").attr("class",Me).attr("d",ne).attr("fill",pt.color).attr("stroke",pt.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",pt.dataKey).attr("data-timestamp",X).attr("data-x-position",at.x).attr("data-full-height-path",Ht)})});const De=y?`.histogram-path-${y}`:".histogram-path",fe=ee.selectAll(De);$.to(fe.nodes(),{opacity:1,duration:.3,ease:"power2.inOut"},`seatsToBar+=${Tt}`);const Fe=Q.x+Q.width/2;fe.each(function(){var be;const X=this.getAttribute("data-full-height-path");if(!X)return;const at=parseFloat(this.getAttribute("data-x-position")||"0"),pt=parseFloat(this.getAttribute("data-timestamp")||"0"),_t=((be=Y.get(pt))==null?void 0:be.width)||0,ne=at+_t/2,Me=Math.abs(ne-Fe)*8e-4;$.to(this,{attr:{d:X},duration:Pt,ease:"power2.out"},`seatsToBar+=${Tt+Me}`)});const Ne=Tt+Pt,re=P[P.length-1],hr=i(new Date(re))+tt,Fn=i.invert(hr).getTime(),Yr=t.map(X=>{const at=X[X.length-1],pt={...at,data:{...at.data,timestamp:Fn}};return[...X,pt]});Tc(e,Yr,r,{xScale:i,yScale:s,addClasses:!0,instanceId:y});const Nn=y?`.area-${y}`:".area",pr=e.selectAll(Nn);pr.attr("opacity",0),$.to(fe.nodes(),{opacity:0,duration:It,ease:"power2.inOut"},`seatsToBar+=${Ne}`);const _a=ot.selectAll("path").nodes();_a.length>0&&$.to(_a,{opacity:0,duration:It,ease:"power2.inOut"},`seatsToBar+=${Ne}`),$.to(pr.nodes(),{opacity:1,duration:It,ease:"power2.inOut"},`seatsToBar+=${Ne}`);const Er=c;k.getControls().getTimeline().eventCallback("onComplete",()=>{const X=y?`.morph-bar-${y}`:".morph-bar";e.selectAll(X).remove();const at=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(at).remove();const pt=y?`.seat-${y}`:".seat";e.selectAll(pt).style("pointer-events","none"),f&&(te&&te.attr("opacity",1),ce&&ce.attr("opacity",1)),Er()}),k.play()}function eT(e,t,r,n,a,i,s,o,l,u,c,f=!0,h=14,p,g,d,m,x,y){var ar;const v=y?`.chart-content-group-${y}`:".chart-content-group";let _=e.select(v);if(_.empty()){const G=e.attr("clip-path"),ct=G?((ar=G.match(/url\(#(.+)\)/))==null?void 0:ar[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,dt=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";_=e.append("g").attr("class",dt).attr("clip-path",`url(#${ct})`)}const S=y?`.area-${y}`:".area",w=e.selectAll(S);if(w.size()===0){rT(e,r,n,o,l,y),c();return}const b={areaToBar:u*.18,barsShrink:u*.22,barSlide:u*.22,axesHide:u*.03,barToRings:u*.07,ringsExpand:u*.18,ringsHold:u*.05,ringsToSeats:u*.07},T=y?_n.get(y):void 0;T&&(T.destroy(),y&&_n.delete(y));const M=G=>G<.18?"areaToBar":G<.4?"barsShrink":G<.62?"barSlide":G<.65?"axesHide":G<.72?"barToRings":G<.9?"ringsExpand":G<.95?"ringsHold":"ringsToSeats",k=new B0({seatsToRings:b.ringsToSeats,ringsHold:b.ringsHold,ringsToBar:b.barToRings,axesReveal:b.axesHide,barSlide:b.barSlide,barsGrow:b.barsShrink,barsToArea:b.areaToBar},{onStageComplete:G=>{},onProgress:G=>{if(m){const ct=M(G);m(G,ct)}},onComplete:()=>{c()}});y&&_n.set(y,k),d&&d(k.getControls().getTimeline());const O=t[0].map(G=>G.data).map(G=>G.timestamp),R=x??Math.max(...O),E=new Map,H=[];O.forEach((G,ct)=>{const dt=i(new Date(G)),Tt=O[ct+1];if(Tt){const ft=i(new Date(Tt))-dt;H.push(ft)}});const I=H.length>0?H.reduce((G,ct)=>G+ct,0)/H.length:30;O.forEach((G,ct)=>{const dt=i(new Date(G)),Tt=O[ct+1],ft=ct===O.length-1?I:i(new Date(Tt))-dt;E.set(G,{x:dt,width:ft})});const P=k.getControls().getTimeline(),j=b.areaToBar/1e3,Y=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",rt=_.append("g").attr("class",Y);O.forEach(G=>{const ct=E.get(G);ct&&r.forEach((dt,Tt)=>{const Ot=za(t,r,E,s,l,Tt,G,!1);if(!Ot)return;const ft=y?`histogram-path histogram-path-${y} category-${ke(dt.dataKey)}`:`histogram-path category-${ke(dt.dataKey)}`;rt.append("path").attr("class",ft).attr("d",Ot).attr("fill",dt.color).attr("stroke",dt.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",dt.dataKey).attr("data-timestamp",G).attr("data-x-position",ct.x)})});const tt=y?`.histogram-path-${y}`:".histogram-path",J=rt.selectAll(tt);P.to(w.nodes(),{opacity:0,duration:j,ease:"power2.inOut"},"areaToBar"),P.to(J.nodes(),{opacity:1,duration:j,ease:"power2.inOut"},"areaToBar");const Q=b.barsShrink/1e3,it=j;J.each(function(){const G=parseFloat(this.getAttribute("data-timestamp")||"0");if(G===R)return;const ct=r.find(Ot=>this.classList.contains(`category-${ke(Ot.dataKey)}`));if(!ct)return;const dt=r.indexOf(ct),Tt=za(t,r,E,s,l,dt,G,!0);Tt&&P.to(this,{attr:{d:Tt},duration:Q,ease:"power2.in"},it)});const L=b.axesHide/1e3,ot=it+Q;if(f){const G=e.select(".axis-x"),ct=e.select(".axis-y");G.empty()||P.to(G.node(),{opacity:0,duration:L,ease:"power2.inOut"},ot),ct.empty()||P.to(ct.node(),{opacity:0,duration:L,ease:"power2.inOut"},ot)}const nt=_.select(".grid-vertical"),N=_.select(".grid-horizontal");nt.empty()||P.to(nt.node(),{opacity:0,duration:L,ease:"power2.inOut"},ot),N.empty()||P.to(N.node(),{opacity:0,duration:L,ease:"power2.inOut"},ot);const F=[];t.forEach((G,ct)=>{const dt=G.find(Ot=>Ot.data.timestamp===R);if(!dt)return;const Tt=r[ct];Tt&&F.push({category:Tt.label,dataKey:Tt.dataKey,color:Tt.color,y0:dt[0],y1:dt[1]})}),F.sort((G,ct)=>ct.y0-G.y0);const z=F.reduce((G,ct)=>G+(ct.y1-ct.y0),0),B=n.radius-n.innerRadius,A=o/2,W=n.radius+10,q=l-n.radius*.3,$=Math.max(W,q),lt=B*.6,ut=l*.8,vt=$,et=b.barSlide/1e3,mt=ot+L,Ct=666,st=J.nodes().filter(G=>parseFloat(G.getAttribute("data-timestamp")||"0")!==R);P.to(st,{opacity:0,duration:et*.2,ease:"power2.out"},mt);const yt=J.nodes().filter(G=>parseFloat(G.getAttribute("data-timestamp")||"0")===R);yt.forEach(G=>{const ct=G.getAttribute("data-category");if(!ct)return;const dt=F.find(fe=>fe.dataKey===ct);if(!dt)return;const ft=(dt.y1-dt.y0)/z*ut;let Pt=0;for(const fe of r){const Fe=F.find(Pn=>Pn.dataKey===fe.dataKey);if(!Fe)continue;if(Fe.dataKey===dt.dataKey)break;const re=(Fe.y1-Fe.y0)/z;Pt+=re*ut}const It=vt-Pt,me=vt-Pt-ft,ee=Ct-lt/2,De=`M ${ee} ${It} L ${ee} ${me} L ${ee+lt} ${me} L ${ee+lt} ${It} Z`;P.to(G,{attr:{d:De},duration:et,ease:"power2.inOut"},mt)});const ht=b.barToRings/1e3,bt=mt+et,Bt=b.ringsExpand/1e3,Ft=bt+ht,kt=b.ringsHold/1e3,Vt=Ft+Bt,Rt=b.ringsToSeats/1e3,xt=Vt+kt,At=Math.max(...n.seats.map(G=>G.ring)),jt=n.seats.filter(G=>G.ring===At),qt=_.append("g").attr("class",`slinky-${y||"h2p-default"}`),Ut=()=>{qt.remove()};jt.forEach((G,ct)=>{const dt=r.find(Tt=>Tt.label===G.category);dt&&qt.append("line").attr("class","slinky-ring").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0).attr("stroke",dt.color).attr("stroke-width",n.seatSize*2).attr("stroke-linecap","butt").attr("data-category",G.category).attr("data-category-index",G.categoryIndex).attr("data-ring-index",ct).attr("data-seat-x",A+G.x).attr("data-seat-y",$+G.y).attr("data-seat-angle",Math.atan2(G.y,G.x)).style("opacity",0)});const je=qt.selectAll(".slinky-ring").nodes(),ue=Ct,fr=ut/je.length,xe=[...je].sort((G,ct)=>{const dt=parseFloat(G.getAttribute("data-seat-angle")||"0");return parseFloat(ct.getAttribute("data-seat-angle")||"0")-dt}),Ye=vt;xe.forEach((G,ct)=>{const dt=Ye-ct*fr,Ot=lt/2,ft=ue-Ot,Pt=ue+Ot;G.setAttribute("x1",ft.toString()),G.setAttribute("y1",dt.toString()),G.setAttribute("x2",Pt.toString()),G.setAttribute("y2",dt.toString()),G.style.opacity="0"}),P.to(yt,{opacity:0,duration:ht*.7,ease:"power2.out"},bt+ht*.3),P.to(xe,{opacity:1,duration:ht,ease:"power2.in",stagger:.005},bt);const Te=B*.8;xe.forEach((G,ct)=>{const dt=parseFloat(G.getAttribute("data-seat-x")||"0"),Tt=parseFloat(G.getAttribute("data-seat-y")||"0"),Ot=parseFloat(G.getAttribute("data-seat-angle")||"0"),ft=(xe.length-1-ct)/xe.length*(Bt*.4),Pt=parseFloat(G.getAttribute("x1")||"0"),It=parseFloat(G.getAttribute("y1")||"0"),me=parseFloat(G.getAttribute("x2")||"0"),ee=parseFloat(G.getAttribute("y2")||"0"),De=(Pt+me)/2,fe=(It+ee)/2,Fe=Math.atan2(ee-It,me-Pt),Ne=Math.sqrt(Math.pow(me-Pt,2)+Math.pow(ee-It,2)),re=dt-Te/2*Math.cos(Ot),Pn=Tt-Te/2*Math.sin(Ot);P.to({progress:0},{progress:1,duration:Bt*.7,ease:"power2.out",onUpdate:function(){const hr=this.progress(),Rr=De+(re-De)*hr,Fn=fe+(Pn-fe)*hr,Yr=Fe+(Ot-Fe)*hr,pr=(Ne+(Te-Ne)*hr)/2,_a=Rr-pr*Math.cos(Yr),Er=Fn-pr*Math.sin(Yr),on=Rr+pr*Math.cos(Yr),X=Fn+pr*Math.sin(Yr);G.setAttribute("x1",_a.toString()),G.setAttribute("y1",Er.toString()),G.setAttribute("x2",on.toString()),G.setAttribute("y2",X.toString())}},Ft+ft),P.to(G,{opacity:.9,duration:Bt*.3,ease:"power2.in"},Ft+ft)}),P.call(()=>{m&&m(P.progress(),"ringsHold")},[],Vt);const nr=y?`parliament parliament-${y}`:"parliament",ge=_.append("g").attr("class",nr);n.seats.forEach((G,ct)=>{const dt=r.find(me=>me.label===G.category);if(!dt)return;const Tt=A+G.x,Ot=$+G.y;let ft,Pt,It;G.ring===At?(ft=Tt,Pt=Ot,It=2):(ft=Tt,Pt=Ot,It=G.radius),ge.append("circle").attr("cx",ft).attr("cy",Pt).attr("r",It).attr("fill",dt.color).attr("stroke",dt.color).attr("stroke-width",.5).attr("opacity",0).attr("class",()=>y?`seat seat-${y} seat-${ke(G.category)}`:`seat seat-${ke(G.category)}`).attr("data-layout-index",ct).attr("data-ring",G.ring).attr("data-final-x",Tt).attr("data-final-y",Ot).attr("data-final-r",G.radius)});const Et=y?`.seat-${y}`:".seat",Jt=ge.selectAll(Et);P.to(je,{opacity:0,duration:Rt*.2,ease:"power3.out"},xt),P.to(Jt.nodes(),{opacity:.8,duration:Rt*.3,ease:"power2.in"},xt+Rt*.25);const St=Jt.nodes(),ie=[],ve=[];St.forEach(G=>{parseInt(G.getAttribute("data-ring")||"0")===At?ie.push(G):ve.push(G)});const Yt=Rt*.2,te=Rt*.7;ie.forEach(G=>{const ct=parseFloat(G.getAttribute("data-final-r")||"4");P.to(G,{attr:{r:ct},opacity:1,duration:te*.6,ease:"power2.out"},xt+Yt)}),ve.length>0&&P.to(ve,{opacity:1,duration:te*.5,ease:"power2.in"},xt+Yt+Rt*.15);const ce=c;k.getControls().getTimeline().eventCallback("onComplete",()=>{const G=y?`.areas-${y}`:".areas",ct=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(G).remove(),e.selectAll(ct).remove(),Ut(),e.selectAll(".axis-x").remove(),e.selectAll(".axis-y").remove(),_.selectAll(".grid-vertical").remove(),_.selectAll(".grid-horizontal").remove();const dt=y?`.parliament-label-${y}`:".parliament-label";if(e.select(dt).empty()){const Ot=o/2,ft=n.radius+10,Pt=l-n.radius*.3,It=Math.max(ft,Pt),me=y?`parliament-label parliament-label-${y}`:"parliament-label",ee=e.append("g").attr("class",me).attr("transform",`translate(${Ot},${It-n.radius*.15})`).style("opacity","0").style("pointer-events","none");ee.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),ee.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const De=ee.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");De.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),De.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}ce()}),k.play()}function rT(e,t,r,n,a,i){const s=n/2,o=r.radius+10,l=a-r.radius*.3,u=Math.max(o,l);U0(e,r,t,{centerX:s,centerY:u,addClasses:!0,instanceId:i,parliamentRadius:r.radius})}function Ba(e,t,r,n,a){const i=a?`.parliament-label-${a}`:".parliament-label",s=Dt(e).select(i);if(!s.empty())if(t){s.style("opacity","1"),s.select(".label-category").text(t.label).style("fill","#666");const o=t.value>1?"repos":"repo";s.select(".label-value").text(`${t.value} ${o}`).style("fill",t.color);const l=s.select(".scale-indicator");r?l.style("opacity","1").select("text").text(`= ~${n} repos`):l.style("opacity","0")}else s.style("opacity","0")}function Ys(e,t,r,n,a,i,s,o,l){const u=e.querySelectorAll(".seat");if(!u||u.length===0)return;const c=r[r.length-1];if(!c)return;const f=[];u.forEach(p=>{const g=p;g.style.cursor="pointer",g.style.transition="fill-opacity 150ms ease, stroke-opacity 150ms ease"}),u.forEach(p=>{const m=(p.getAttribute("class")||"").split(/\s+/).filter(S=>S.startsWith("seat-")),x=m[m.length-1];if(!x)return;const y=x.substring(5),v=t.find(S=>ke(S.label)===y);if(!v)return;const _=()=>{a(v.label);const S=Math.round(c.values[v.dataKey]||0),w=pf(v.color),b={label:v.label,value:S,color:w};i&&i(b),Ba(e,b,s??!1,o??1,l),Ua(e,v.label)};p.addEventListener("mouseenter",_),f.push({element:p,handler:_})});const h=()=>{a(null),i&&i(null),Ba(e,null,!1,1,l),Ua(e,null)};return e.addEventListener("mouseleave",h),n&&Ua(e,n),()=>{f.forEach(({element:p,handler:g})=>{p.removeEventListener("mouseenter",g)}),e.removeEventListener("mouseleave",h),u.forEach(p=>{const g=p;g.style.cursor="",g.style.transition=""})}}function Ua(e,t){const r=e.querySelectorAll(".seat"),n=t?ke(t):null;r.forEach(a=>{const i=a,l=(a.getAttribute("class")||"").split(/\s+/).filter(f=>f.startsWith("seat-")),u=l[l.length-1];if(!u)return;const c=u.substring(5);n?c===n?(i.setAttribute("fill-opacity","1"),i.setAttribute("stroke-opacity","1")):(i.setAttribute("fill-opacity","0.3"),i.setAttribute("stroke-opacity","0.2")):(i.setAttribute("fill-opacity","1"),i.setAttribute("stroke-opacity","1"))})}const H0=({data:e,categories:t,mode:r,width:n=900,height:a=400,margin:i={top:10,right:30,bottom:40,left:60},timeRange:s,showGrid:o=!0,showAxes:l=!0,axisLabelColor:u,axisLabelSize:c=14,formatDate:f,formatValue:h,markers:p=[],arcAngle:g=200,parliamentRadius:d=200,seatSize:m=4.5,animationDuration:x=900,onMorphComplete:y,onAnimationStateChange:v,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:w,hoveredCategory:b,maxSeats:T=500,showTooltip:M=!0,showTable:k=!1,showScaledIndicator:C=!0,parliamentTimestamp:O,enableBrush:R=!1,onTimeRangeChange:E,minAllowedTime:H,maxAllowedTime:I,timelineEvents:P=[],showTimeline:j=!1,timelineHeight:Y=40,timelineOffset:rt,brushColor:tt="#69b3a2"})=>{const J=K.useRef(null),Q=K.useCallback(V=>{w&&w(V)},[w]),it=12,ot=rt??6+it+c+it,nt=e[e.length-1],N=nt?t.reduce((V,ut)=>V+(nt.values[ut.dataKey]||0),0):0,F=N>T,z=F?Math.round(N/T):1,B=j&&r==="stacked-area"?a+Y+ot:a,{isMorphing:A,currentMode:W,visibleMarkers:q,hoveredMarker:$,hoveredTimelineEvent:lt}=VS({containerRef:J,data:e,categories:t,mode:r,width:n,height:a,margin:i,timeRange:s,showGrid:o,showAxes:l,axisLabelColor:u,axisLabelSize:c,formatDate:f,formatValue:h,markers:p,arcAngle:g,parliamentRadius:d,seatSize:m,animationDuration:x,onMorphComplete:y,onAnimationStateChange:v,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:Q,hoveredCategory:b,maxSeats:T,parliamentTimestamp:O,enableBrush:R,onTimeRangeChange:E,minAllowedTime:H,maxAllowedTime:I,showScaleIndicator:C&&F,reposPerSeat:z,timelineEvents:P,showTimeline:j,timelineHeight:Y,timelineOffset:ot,brushColor:tt});return D.jsxs(U.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:J,viewBox:`0 0 ${n} ${B}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),W==="area"&&q.map(V=>{const ut=(V.x+i.left)/n*100,vt=i.top/a*100,et=new Date(V.timestamp),mt=f?f(V.timestamp):et.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),Ct=D.jsxs(U.Box,{children:[D.jsx(U.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:V.label?.5:0},children:mt}),V.label&&D.jsx(U.Box,{sx:{color:"white",fontWeight:500},children:V.label})]});return D.jsx(U.Tooltip,{title:Ct,open:($==null?void 0:$.timestamp)===V.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(U.Box,{sx:{position:"absolute",left:`${ut}%`,top:`${vt}%`,width:"1px",height:`${(a-i.top-i.bottom)/a*100}%`,pointerEvents:"none"}})},V.timestamp)}),lt&&W==="area"&&D.jsx(U.Tooltip,{title:D.jsxs(U.Box,{children:[D.jsx(U.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:f?f(lt.timestamp):new Date(lt.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),D.jsx(U.Box,{sx:{color:"white",fontWeight:500},children:lt.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(U.Box,{sx:{position:"absolute",left:`${(lt.x+i.left)/n*100}%`,top:`${(a+ot+Y/2)/B*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})}),A&&D.jsxs(U.Box,{sx:{position:"absolute",top:8,right:8,padding:"4px 8px",backgroundColor:"rgba(0,0,0,0.7)",color:"white",borderRadius:"4px",fontSize:"12px",pointerEvents:"none",display:"none"},children:["Morphing: ",W," → ",r]})]})},G0=[{minRepos:0,maxRepos:10,minArc:90,maxArc:90,minSeatSize:28,maxSeatSize:28},{minRepos:10,maxRepos:25,minArc:90,maxArc:110,minSeatSize:24,maxSeatSize:24},{minRepos:25,maxRepos:50,minArc:110,maxArc:120,minSeatSize:20,maxSeatSize:20},{minRepos:50,maxRepos:100,minArc:120,maxArc:150,minSeatSize:16.5,maxSeatSize:16.5},{minRepos:100,maxRepos:200,minArc:150,maxArc:180,minSeatSize:15,maxSeatSize:15},{minRepos:200,maxRepos:1/0,minArc:180,maxArc:180,minSeatSize:14.5,maxSeatSize:14.5}],df=({repositoryCount:e})=>{const t=G0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 180;if(t.minArc===t.maxArc)return t.minArc;const r=t.maxRepos-t.minRepos,a=(e-t.minRepos)/r,i=t.maxArc-t.minArc,s=t.minArc+i*a;return Math.round(s)},gf=({repositoryCount:e})=>{const t=G0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 6.5;if(t.minSeatSize===t.maxSeatSize)return t.minSeatSize;const r=t.maxRepos-t.minRepos,a=(e-t.minRepos)/r,i=t.maxSeatSize-t.minSeatSize,s=t.minSeatSize+i*a;return Math.round(s*10)/10};class oi{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}oi.prototype.normal={};oi.prototype.property={};oi.prototype.space=void 0;function j0(e,t){const r={},n={};for(const a of e)Object.assign(r,a.property),Object.assign(n,a.normal);return new oi(r,n,t)}function ni(e){return e.toLowerCase()}class Ge{constructor(t,r){this.attribute=r,this.property=t}}Ge.prototype.attribute="";Ge.prototype.booleanish=!1;Ge.prototype.boolean=!1;Ge.prototype.commaOrSpaceSeparated=!1;Ge.prototype.commaSeparated=!1;Ge.prototype.defined=!1;Ge.prototype.mustUseProperty=!1;Ge.prototype.number=!1;Ge.prototype.overloadedBoolean=!1;Ge.prototype.property="";Ge.prototype.spaceSeparated=!1;Ge.prototype.space=void 0;let nT=0;const gt=Dn(),oe=Dn(),Mc=Dn(),Z=Dn(),zt=Dn(),Jn=Dn(),We=Dn();function Dn(){return 2**++nT}const Ac=Object.freeze(Object.defineProperty({__proto__:null,boolean:gt,booleanish:oe,commaOrSpaceSeparated:We,commaSeparated:Jn,number:Z,overloadedBoolean:Mc,spaceSeparated:zt},Symbol.toStringTag,{value:"Module"})),Xs=Object.keys(Ac);class mf extends Ge{constructor(t,r,n,a){let i=-1;if(super(t,r),qh(this,"space",a),typeof n=="number")for(;++i<Xs.length;){const s=Xs[i];qh(this,Xs[i],(n&Ac[s])===Ac[s])}}}mf.prototype.defined=!0;function qh(e,t,r){r&&(e[t]=r)}function ma(e){const t={},r={};for(const[n,a]of Object.entries(e.properties)){const i=new mf(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),t[n]=i,r[ni(n)]=n,r[ni(i.attribute)]=n}return new oi(t,r,e.space)}const Y0=ma({properties:{ariaActiveDescendant:null,ariaAtomic:oe,ariaAutoComplete:null,ariaBusy:oe,ariaChecked:oe,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:zt,ariaCurrent:null,ariaDescribedBy:zt,ariaDetails:null,ariaDisabled:oe,ariaDropEffect:zt,ariaErrorMessage:null,ariaExpanded:oe,ariaFlowTo:zt,ariaGrabbed:oe,ariaHasPopup:null,ariaHidden:oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zt,ariaLevel:Z,ariaLive:null,ariaModal:oe,ariaMultiLine:oe,ariaMultiSelectable:oe,ariaOrientation:null,ariaOwns:zt,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:oe,ariaReadOnly:oe,ariaRelevant:null,ariaRequired:oe,ariaRoleDescription:zt,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:oe,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function X0(e,t){return t in e?e[t]:t}function W0(e,t){return X0(e,t.toLowerCase())}const aT=ma({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jn,acceptCharset:zt,accessKey:zt,action:null,allow:null,allowFullScreen:gt,allowPaymentRequest:gt,allowUserMedia:gt,alt:null,as:null,async:gt,autoCapitalize:null,autoComplete:zt,autoFocus:gt,autoPlay:gt,blocking:zt,capture:null,charSet:null,checked:gt,cite:null,className:zt,cols:Z,colSpan:null,content:null,contentEditable:oe,controls:gt,controlsList:zt,coords:Z|Jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:gt,defer:gt,dir:null,dirName:null,disabled:gt,download:Mc,draggable:oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:gt,formTarget:null,headers:zt,height:Z,hidden:Mc,high:Z,href:null,hrefLang:null,htmlFor:zt,httpEquiv:zt,id:null,imageSizes:null,imageSrcSet:null,inert:gt,inputMode:null,integrity:null,is:null,isMap:gt,itemId:null,itemProp:zt,itemRef:zt,itemScope:gt,itemType:zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:gt,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:gt,muted:gt,name:null,nonce:null,noModule:gt,noValidate:gt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:gt,optimum:Z,pattern:null,ping:zt,placeholder:null,playsInline:gt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:gt,referrerPolicy:null,rel:zt,required:gt,reversed:gt,rows:Z,rowSpan:Z,sandbox:zt,scope:null,scoped:gt,seamless:gt,selected:gt,shadowRootClonable:gt,shadowRootDelegatesFocus:gt,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:gt,useMap:null,value:oe,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zt,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:gt,declare:gt,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:gt,noHref:gt,noShade:gt,noWrap:gt,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:oe,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:gt,disableRemotePlayback:gt,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:W0}),iT=ma({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:We,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:zt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:gt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jn,g2:Jn,glyphName:Jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:We,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:We,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:We,rev:We,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:We,requiredFeatures:We,requiredFonts:We,requiredFormats:We,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:We,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:We,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:We,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X0}),K0=ma({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),V0=ma({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:W0}),Z0=ma({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),sT=/[A-Z]/g,Ih=/-[a-z]/g,oT=/^data[-\w.:]+$/i;function Q0(e,t){const r=ni(t);let n=t,a=Ge;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&oT.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Ih,uT);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Ih.test(i)){let s=i.replace(sT,lT);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=mf}return new a(n,t)}function lT(e){return"-"+e.toLowerCase()}function uT(e){return e.charAt(1).toUpperCase()}const J0=j0([Y0,aT,K0,V0,Z0],"html"),yf=j0([Y0,iT,K0,V0,Z0],"svg");function zh(e){const t=[],r=String(e||"");let n=r.indexOf(","),a=0,i=!1;for(;!i;){n===-1&&(n=r.length,i=!0);const s=r.slice(a,n).trim();(s||!i)&&t.push(s),a=n+1,n=r.indexOf(",",a)}return t}function cT(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Bh=/[#.]/g;function fT(e,t){const r=e||"",n={};let a=0,i,s;for(;a<r.length;){Bh.lastIndex=a;const o=Bh.exec(r),l=r.slice(a,o?o.index:r.length);l&&(i?i==="#"?n.id=l:Array.isArray(n.className)?n.className.push(l):n.className=[l]:s=l,a+=l.length),o&&(i=o[0],a++)}return{type:"element",tagName:s||t||"div",properties:n,children:[]}}function Uh(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function hT(e){return e.join(" ").trim()}function ty(e,t,r){const n=r?mT(r):void 0;function a(i,s,...o){let l;if(i==null){l={type:"root",children:[]};const u=s;o.unshift(u)}else{l=fT(i,t);const u=l.tagName.toLowerCase(),c=n?n.get(u):void 0;if(l.tagName=c||u,pT(s))o.unshift(s);else for(const[f,h]of Object.entries(s))dT(e,l.properties,f,h)}for(const u of o)Cc(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return a}function pT(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const a=t[n];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const i=a;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function dT(e,t,r,n){const a=Q0(e,r);let i;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;i=n}else typeof n=="boolean"?i=n:typeof n=="string"?a.spaceSeparated?i=Uh(n):a.commaSeparated?i=zh(n):a.commaOrSpaceSeparated?i=Uh(zh(n).join(" ")):i=Hh(a,a.property,n):Array.isArray(n)?i=[...n]:i=a.property==="style"?gT(n):String(n);if(Array.isArray(i)){const s=[];for(const o of i)s.push(Hh(a,a.property,o));i=s}a.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[a.property]=i}}function Cc(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)Cc(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?Cc(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Hh(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||ni(r)===ni(t)))return!0}return r}function gT(e){const t=[];for(const[r,n]of Object.entries(e))t.push([r,n].join(": "));return t.join("; ")}function mT(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const yT=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"];ty(J0,"div");const li=ty(yf,"g",yT),ey=(e=li)=>e("pattern",{id:"greyHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:ur.neoGrey[200]}),e("path",{d:"M0,2 L8,2",stroke:ur.neoGrey[400],"stroke-width":.5}),e("path",{d:"M0,6 L8,6",stroke:ur.neoGrey[400],"stroke-width":.5})]),ry=(e=li)=>e("pattern",{id:"dataMissingHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFF3CC"}),e("path",{d:"M0,8 L8,0",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M-2,2 L2,-2",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M6,10 L10,6",stroke:"#FFB800","stroke-width":.5})]),ny=(e=li)=>e("pattern",{id:"noLstHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFE5E5"}),e("path",{d:"M0,0 L8,8",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M-2,6 L2,10",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M6,-2 L10,2",stroke:"#ED4134","stroke-width":.5})]),Nt={greyHatch:{background:ur.neoGrey[200],lines:ur.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}},_T=({categories:e,activeCategory:t,onCategoryHover:r,mode:n,visible:a=!0})=>D.jsx(U.Box,{className:"category-table",sx:{width:"100%",display:"flex",justifyContent:"center",opacity:a?1:0,transition:"opacity 0.3s ease-in-out","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>r(null),children:D.jsxs(U.Table,{"aria-label":"Categories summary",className:"category-summary-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[D.jsx("thead",{children:D.jsxs(U.TableRow,{children:[D.jsx(U.TableCell,{}),D.jsx(U.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),n==="point-in-time"?D.jsxs(D.Fragment,{children:[D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"#"}),D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"%"})]}):D.jsxs(D.Fragment,{children:[D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Last"}),D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Max"}),D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Min"})]})]})}),D.jsx("tbody",{children:e.map(i=>{const s=i.color==="url(#greyHatchPattern)"?Nt.greyHatch.lines:i.color==="url(#dataMissingHatchPattern)"?Nt.dataMissingHatch.lines:i.color==="url(#noLstHatchPattern)"?Nt.noLstHatch.lines:i.color;return D.jsxs(U.TableRow,{onMouseEnter:()=>r(i.id),sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:t===i.id?`${s}15`:"transparent","&:hover":{backgroundColor:`${s}15`}},children:[D.jsx(U.TableCell,{align:"center",sx:{width:20},children:D.jsx(U.Box,{sx:{width:n==="historical"?4:12,height:12,backgroundColor:i.color==="url(#greyHatchPattern)"?Nt.greyHatch.background:i.color==="url(#dataMissingHatchPattern)"?Nt.dataMissingHatch.background:i.color==="url(#noLstHatchPattern)"?Nt.noLstHatch.background:i.color,borderRadius:n==="historical"?2:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:t===i.id?"scale(1.2)":"scale(1)",...i.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
16
16
|
0deg,
|
|
17
17
|
transparent,
|
|
18
18
|
transparent 3px,
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
)`,borderRadius:n==="historical"?2:"50%"}},...
|
|
19
|
+
${Nt.greyHatch.lines} 3px,
|
|
20
|
+
${Nt.greyHatch.lines} 4px
|
|
21
|
+
)`,borderRadius:n==="historical"?2:"50%"}},...i.label==="Data Missing"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
22
22
|
45deg,
|
|
23
23
|
transparent,
|
|
24
24
|
transparent 3px,
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
)`,borderRadius:n==="historical"?2:"50%"}},...
|
|
25
|
+
${Nt.dataMissingHatch.lines} 3px,
|
|
26
|
+
${Nt.dataMissingHatch.lines} 4px
|
|
27
|
+
)`,borderRadius:n==="historical"?2:"50%"}},...i.label==="No LST"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
28
28
|
-45deg,
|
|
29
29
|
transparent,
|
|
30
30
|
transparent 3px,
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
)`,borderRadius:n==="historical"?2:"50%"}}}})}),D.jsx(z.TableCell,{children:D.jsxs(z.Stack,{direction:"row",alignItems:"center",gap:.5,children:[D.jsx("span",{children:a.label}),a.tooltip&&D.jsx(z.Tooltip,{title:a.tooltip,placement:"right",arrow:!0,children:D.jsx(Zg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),n==="point-in-time"?D.jsxs(D.Fragment,{children:[D.jsx(z.TableCell,{align:"right",children:a.value}),D.jsxs(z.TableCell,{align:"right",children:[a.percentage,"%"]})]}):D.jsxs(D.Fragment,{children:[D.jsx(z.TableCell,{align:"right",children:a.value}),D.jsx(z.TableCell,{align:"right",children:a.max??"-"}),D.jsx(z.TableCell,{align:"right",children:a.min??"-"})]})]},a.id)})})]})}),Gh={"N/A":"Items that aren't applicable to this migration.","No LST":"There are no LSTs for these items.","Data Missing":"There is data missing in the LSTs."},vT=(e,t="point-in-time")=>{const r=e.timeSeries[e.timeSeries.length-1];if(!r)return[];const n=e.categories.filter(f=>{var h;return!((h=f.parliamentMapping)!=null&&h.isSpecialCategory)}),i=n.reduce((f,h)=>f+(r.values[h.id]??0),0),a=e.metadata.specialCounts,s=a?(a.notApplicable??0)+(a.noLst??0)+(a.unavailable??0):0,o=i+s,l=t==="historical"?new Map(n.map(f=>{const h=e.timeSeries.map(p=>Math.round(p.values[f.id]??0)).filter(p=>p!==void 0);return[f.id,{max:Math.max(...h),min:Math.min(...h)}]})):null,u=n.map(f=>{const h=Math.round(r.values[f.id]??0),p=h/o*100,g=p>0&&p<1?"< 1":p.toFixed(0),d={id:f.id,label:f.label,value:h,percentage:Number.parseFloat(g),color:f.color,tooltip:Gh[f.label]};if(l){const m=l.get(f.id);m&&(d.max=m.max,d.min=m.min)}return d}),c=[];if(a){const f=e.categories.filter(h=>{var p;return(p=h.parliamentMapping)==null?void 0:p.isSpecialCategory});for(const h of f){let p=0;if(h.label==="N/A"?p=Math.round(a.notApplicable??0):h.label==="No LST"?p=Math.round(a.noLst??0):h.label==="Data Missing"&&(p=Math.round(a.unavailable??0)),p>0){const g=p/o*100,d=g>0&&g<1?"< 1":g.toFixed(0);c.push({id:h.id,label:h.label,value:p,percentage:Number.parseFloat(d),color:h.color,tooltip:Gh[h.label]})}}}return[...u,...c]},xT=e=>{if(!e.timeSeries[e.timeSeries.length-1])throw new Error("ChronoChart: No data points available");const r=e.timeSeries.map(i=>({timestamp:i.timestamp,values:i.values})),n=e.categories.map(i=>{var a;return{dataKey:i.id,label:i.label,color:i.color,fillOpacity:.7,strokeWidth:(a=i.parliamentMapping)!=null&&a.isSpecialCategory?3:1.5,strokeDasharray:i.strokeDasharray,parliamentMapping:i.parliamentMapping}});return{data:r,categories:n}},bT=e=>{if(!e.timeSeries||e.timeSeries.length===0)throw new Error("ChronoChart: timeSeries must not be empty");if(!e.categories||e.categories.length===0)throw new Error("ChronoChart: categories must not be empty");if(!e.metadata||typeof e.metadata.total!="number")throw new Error("ChronoChart: metadata.total is required");if(!e.timeSeries.every((n,i)=>i===0||n.timestamp>=e.timeSeries[i-1].timestamp))throw new Error("ChronoChart: timeSeries must be sorted by timestamp (ascending)");const r=e.timeSeries[0];if(r){for(const n of e.categories.filter(i=>{var a;return!((a=i.parliamentMapping)!=null&&a.isSpecialCategory)}))if(!(n.id in r.values))throw new Error(`ChronoChart: Category "${n.id}" not found in timeSeries data`)}},iy=({data:e,selectedIndex:t,title:r,subtitle:n,showHeader:i=!0,width:a=960,height:s=400,timeRange:o,onTimeRangeChange:l,minAllowedTime:u,maxAllowedTime:c,enableBrush:f=!1,showLegend:h=!0,showTooltip:p=!0,showGrid:g=!0,axisLabelColor:d,axisLabelSize:m=14,enableAnimation:v=!0,animationDuration:y=5439,disableTimeline:x=!1,formatDate:_,formatValue:S,onAnimationStateChange:w,onTimelineReady:b,onAnimationProgress:T,brushColor:M="#69b3a2"})=>{bT(e);const[C,A]=Q.useState(null),[F,E]=Q.useState(!0),N=Q.useRef("historical"),U=Q.useRef(void 0),P=Q.useMemo(()=>e.timeSeries.length===1||t!==void 0?"point-in-time":"historical",[t,e.timeSeries.length]),O=Q.useMemo(()=>{var Z;let Y;return t!==void 0&&e.timeSeries[t]?(Y=e.timeSeries[t].timestamp,U.current=Y):N.current==="point-in-time"&&P==="historical"&&U.current!==void 0?Y=U.current:Y=(Z=e.timeSeries[e.timeSeries.length-1])==null?void 0:Z.timestamp,N.current=P,Y},[t,e.timeSeries,P]),j=e.timeSeries[0].timestamp,X=e.timeSeries[e.timeSeries.length-1].timestamp,[et,at]=Q.useState([j,X]),tt=o??et,G=Q.useCallback(Y=>{const Z=[u!==void 0?Math.max(Y[0],u):Y[0],c!==void 0?Math.min(Y[1],c):Y[1]];l?l(Z):at(Z)},[l,u,c]);Q.useEffect(()=>{A(null)},[P]);const W=Q.useMemo(()=>({top:10,right:30,left:60,bottom:30}),[]),$=Q.useMemo(()=>xT(e),[e]),K=Q.useMemo(()=>vT(e,P),[e,P]),L=Q.useMemo(()=>{const Y=e.timeSeries[e.timeSeries.length-1];return Y?Object.values(Y.values).reduce((Z,lt)=>Z+lt,0):0},[e.timeSeries]),B=Q.useMemo(()=>df({repositoryCount:L}),[L]),k=Q.useMemo(()=>gf({repositoryCount:L}),[L]),I=Q.useMemo(()=>{const Y=s-W.top-W.bottom;return Math.round(Y*.9)},[s,W]),q=Q.useMemo(()=>e.events?e.events.map(Y=>({timestamp:Y.timestamp,label:Y.eventName,color:typeof Y.color=="string"?Y.color:"#2F42FF"})):[],[e.events]),R=Q.useCallback(Y=>{if(Y){const Z=e.categories.find(lt=>lt.label===Y.label);A((Z==null?void 0:Z.id)??null)}else A(null)},[e.categories]),nt=Q.useCallback(Y=>{E(!Y),w&&w(Y)},[w]);return D.jsxs(z.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(r||n)&&D.jsxs(z.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[r&&D.jsx(z.Typography,{variant:"h5",sx:{fontWeight:500},children:r}),n&&D.jsx(z.Typography,{variant:"body2",sx:{color:"text.secondary"},children:n})]}),D.jsx(z.Box,{sx:{position:"relative",width:"100%"},children:D.jsx(H0,{data:$.data,categories:$.categories,mode:P==="point-in-time"?"parliament":"stacked-area",width:a,height:s,timeRange:tt,onTimeRangeChange:G,minAllowedTime:u,maxAllowedTime:c,enableBrush:f,showGrid:g,showAxes:!0,axisLabelColor:d,axisLabelSize:m,margin:W,markers:q,formatDate:_,formatValue:S,animationDuration:y,onAnimationStateChange:nt,onTimelineReady:b,onAnimationProgress:T,onHoveredDataChange:R,hoveredCategory:C,arcAngle:B,parliamentRadius:I,seatSize:k,parliamentTimestamp:O,timelineEvents:e.events??[],showTimeline:P==="historical"&&!x,brushColor:M})}),D.jsx(_T,{categories:K,activeCategory:C,onCategoryHover:A,mode:P,visible:F})]})},wT=({containerRef:e,data:t,categories:r,width:n,height:i,margin:a,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,markers:d=[],markerVisibilityMode:m="hover",onMarkerHoverChange:v,brushColor:y="#69b3a2"})=>{Q.useEffect(()=>{if(!e.current||t.length===0||r.length===0)return;const x=Ct(e.current),_=n-a.left-a.right,S=i-a.top-a.bottom;x.selectAll("*").remove();const w=x.append("g").attr("transform",`translate(${a.left},${a.top})`),b=`d3-chart-clip-${Math.random().toString(36).substr(2,9)}`;x.append("defs").append("clipPath").attr("id",b).append("rect").attr("x",0).attr("y",0).attr("width",_).attr("height",S);const T=w.append("g").attr("clip-path",`url(#${b})`),M=[...t].sort((G,W)=>G.timestamp-W.timestamp),C=r.map(G=>G.dataKey),A=Ki().keys(C),F=A(M),E=t.map(G=>G.timestamp),N=s?s[0]:Math.min(...E),U=s?s[1]:Math.max(...E),P=Kn().domain([new Date(N),new Date(U)]).range([0,_]),O=M.filter(G=>G.timestamp>=N&&G.timestamp<=U),j=A(O),X=j.length>0?Math.max(...j[j.length-1].map(G=>G[1]??0)):0,et=ai().domain([0,X*1.1]).range([S,0]).nice();o&&(T.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qr(P).ticks(6).tickSize(S).tickFormat(()=>"")),T.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(Ir(et).ticks(5).tickSize(-_).tickFormat(()=>"")));const at=ss().x(G=>P(new Date(G.data.timestamp))).y0(G=>et(G[0])).y1(G=>et(G[1])).curve(Cn),tt=T.append("g").attr("class","areas");if(F.forEach((G,W)=>{const $=r[W];if(!$)return;const K=tt.append("path").datum(G).attr("class",`area area-${$.dataKey}`).attr("fill",$.color).attr("fill-opacity",$.fillOpacity??.7).attr("stroke",$.color).attr("stroke-width",$.strokeWidth??1.5).attr("d",at);$.strokeDasharray&&K.attr("stroke-dasharray",$.strokeDasharray)}),d.length>0){const G=T.append("g").attr("class","markers"),W=m==="hover"?0:.6,$=d.filter(K=>K.timestamp>=N&&K.timestamp<=U).map(K=>({...K,x:P(new Date(K.timestamp))}));if($.forEach(K=>{const L=G.append("line").attr("class","marker-line").attr("data-timestamp",K.timestamp).attr("x1",K.x).attr("x2",K.x).attr("y1",0).attr("y2",S).attr("stroke",K.color??"#131E7A").attr("stroke-width",2).attr("opacity",W);K.strokeDasharray&&L.attr("stroke-dasharray",K.strokeDasharray),K.label&&G.append("text").attr("class","marker-label").attr("data-timestamp",K.timestamp).attr("x",K.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",K.color??"#131E7A").attr("opacity",W).text(K.label)}),m==="hover"&&$.length>0){const K=x.append("g").attr("class","marker-tooltip").attr("transform",`translate(${a.left},${a.top})`).style("pointer-events","none").style("display","none"),L=K.append("rect").attr("fill","#131E7A").attr("rx",4).attr("ry",4).attr("filter","drop-shadow(0px 2px 4px rgba(0,0,0,0.2))"),B=K.append("text").attr("fill","white").attr("font-size",12).attr("font-weight",500).attr("text-anchor","middle");let k=null;const I=T.append("rect").attr("class","marker-hover-overlay").attr("width",_).attr("height",S).attr("fill","none").attr("pointer-events","all"),q=R=>{let nt=null,Y=1/0;if($.forEach(bt=>{const Ut=Math.abs(R-bt.x);Ut<Y&&(Y=Ut,nt=bt)}),!nt||Y>50)return k!==null&&(k=null,G.selectAll(".marker-line").attr("opacity",0),G.selectAll(".marker-label").attr("opacity",0),K.style("display","none"),v==null||v(!1)),!1;const lt=nt;if(k===null&&(v==null||v(!0)),k===lt.timestamp)return!0;k=lt.timestamp,G.selectAll(".marker-line").attr("opacity",0),G.selectAll(".marker-label").attr("opacity",0),G.selectAll(".marker-line").filter(function(){return Ct(this).attr("data-timestamp")===String(lt.timestamp)}).attr("opacity",.6),G.selectAll(".marker-label").filter(function(){return Ct(this).attr("data-timestamp")===String(lt.timestamp)}).attr("opacity",1);const rt=new Date(lt.timestamp),ft=p?p(lt.timestamp):rt.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),wt=lt.label?`${lt.label}: ${ft}`:ft;B.text(wt);const st=B.node().getBBox(),_t=8,Pt=st.width+_t*2,ot=st.height+_t*2;L.attr("width",Pt).attr("height",ot);let mt=lt.x-Pt/2;const yt=10;return mt<0?mt=0:mt+Pt>_&&(mt=_-Pt),K.attr("transform",`translate(${a.left+mt},${a.top+yt})`),B.attr("x",Pt/2).attr("y",ot/2+4),K.style("display","block"),!0};I.on("mousemove",function(R){const[nt]=en(R,this);q(nt)&&R.stopPropagation()}),I.on("mouseleave",function(){k=null,G.selectAll(".marker-line").attr("opacity",0),G.selectAll(".marker-label").attr("opacity",0),K.style("display","none"),v==null||v(!1)})}}if(l){const G=qr(P).ticks(6);p&&G.tickFormat(W=>p(+W)),w.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${S})`).call(G).selectAll("text").attr("font-size",11)}if(u){const G=Ir(et).ticks(5);g&&G.tickFormat(W=>g(+W)),w.append("g").attr("class","axis axis-y").call(G).selectAll("text").attr("font-size",11)}if(c&&h){const G=gi().extent([[0,0],[_,S]]).on("end",$=>{if(!$.selection)return;const[K,L]=$.selection,B=[+P.invert(K),+P.invert(L)];h(B),f&&x.select(".brush").call(G.move,null)}),W=T.append("g").attr("class","brush").call(G);W.selectAll(".selection").attr("fill",y).attr("fill-opacity",.2).attr("stroke",y).attr("stroke-width",1),W.selectAll(".handle").attr("fill",y).attr("fill-opacity",.8)}return()=>{x.selectAll("*").remove()}},[e,t,r,n,i,a,s,o,l,u,c,f,h,p,g,d,m,v,y])},ST=({data:e,categories:t,title:r,subtitle:n,showHeader:i=!0,showLegend:a=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:v,enableBrush:y=!1,zoomToSelection:x=!1,markers:_=[],markerVisibilityMode:S="hover",brushColor:w="#69b3a2"})=>{const b=Q.useRef(null),[T,M]=Q.useState(null),[C,A]=Q.useState(!1);Q.useEffect(()=>{C&&M(null)},[C]),wT({containerRef:b,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:x,onTimeRangeChange:v,formatDate:d,formatValue:m,markers:_,markerVisibilityMode:S,onMarkerHoverChange:A,brushColor:w});const N=P=>{if(!s||!b.current||C)return;const O=b.current.getBoundingClientRect(),j=P.clientX-O.left-u.left,X=P.clientY-O.top,et=o-u.left-u.right;if(j<0||j>et){M(null);return}const at=e.map(q=>q.timestamp),tt=c?c[0]:Math.min(...at),G=c?c[1]:Math.max(...at),W=j/et*(G-tt)+tt,K=((q,R)=>{let nt=0,Y=q.length;for(;nt<Y;){const Z=nt+Y>>>1;q[Z]<R?nt=Z+1:Y=Z}return nt})(at,W),L=e[K-1],B=e[K];let k=B;if(L&&B?k=W-L.timestamp>B.timestamp-W?B:L:L&&(k=L),!k){M(null);return}const I=t.map(q=>({label:q.label,value:k[q.dataKey]??0,color:q.color}));M({visible:!0,x:P.clientX-O.left,y:X,timestamp:k.timestamp,values:I})},U=()=>{s&&M(null)};return D.jsxs(z.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(r||n)&&D.jsxs(z.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[r&&D.jsx(z.Typography,{variant:"h5",sx:{fontWeight:500},children:r}),n&&D.jsx(z.Typography,{variant:"body2",sx:{color:"text.secondary"},children:n})]}),D.jsxs(z.Box,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:b,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"},onMouseMove:N,onMouseLeave:U}),s&&T&&T.visible&&D.jsxs(z.Paper,{elevation:3,sx:{position:"absolute",left:T.x+10,top:T.y-10,pointerEvents:"none",padding:1.5,minWidth:150,zIndex:1e3,transform:T.x>o/2?"translateX(-100%) translateX(-20px)":"none"},children:[D.jsx(z.Typography,{variant:"caption",sx:{fontWeight:600,mb:1},children:d?d(T.timestamp):new Date(T.timestamp).toLocaleDateString()}),D.jsx(z.Stack,{spacing:.5,sx:{mt:1},children:T.values.map(P=>D.jsxs(z.Stack,{direction:"row",justifyContent:"space-between",spacing:2,alignItems:"center",children:[D.jsxs(z.Stack,{direction:"row",spacing:.5,alignItems:"center",children:[D.jsx(z.Box,{sx:{width:8,height:8,backgroundColor:P.color,borderRadius:"50%"}}),D.jsxs(z.Typography,{variant:"caption",children:[P.label,":"]})]}),D.jsx(z.Typography,{variant:"caption",sx:{fontWeight:600},children:m?m(P.value):P.value})]},P.label))})]})]}),a&&D.jsx(z.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(P=>D.jsxs(z.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[D.jsx(z.Box,{sx:{width:16,height:16,backgroundColor:P.color,opacity:P.fillOpacity??.7,border:`2px solid ${P.color}`,borderRadius:"2px",...P.strokeDasharray&&{backgroundImage:`repeating-linear-gradient(
|
|
31
|
+
${Nt.noLstHatch.lines} 3px,
|
|
32
|
+
${Nt.noLstHatch.lines} 4px
|
|
33
|
+
)`,borderRadius:n==="historical"?2:"50%"}}}})}),D.jsx(U.TableCell,{children:D.jsxs(U.Stack,{direction:"row",alignItems:"center",gap:.5,children:[D.jsx("span",{children:i.label}),i.tooltip&&D.jsx(U.Tooltip,{title:i.tooltip,placement:"right",arrow:!0,children:D.jsx(Zg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),n==="point-in-time"?D.jsxs(D.Fragment,{children:[D.jsx(U.TableCell,{align:"right",children:i.value}),D.jsxs(U.TableCell,{align:"right",children:[i.percentage,"%"]})]}):D.jsxs(D.Fragment,{children:[D.jsx(U.TableCell,{align:"right",children:i.value}),D.jsx(U.TableCell,{align:"right",children:i.max??"-"}),D.jsx(U.TableCell,{align:"right",children:i.min??"-"})]})]},i.id)})})]})}),Gh={"N/A":"Items that aren't applicable to this migration.","No LST":"There are no LSTs for these items.","Data Missing":"There is data missing in the LSTs."},xT=(e,t="point-in-time")=>{const r=e.timeSeries[e.timeSeries.length-1];if(!r)return[];const n=e.categories.filter(f=>{var h;return!((h=f.parliamentMapping)!=null&&h.isSpecialCategory)}),a=n.reduce((f,h)=>f+(r.values[h.id]??0),0),i=e.metadata.specialCounts,s=i?(i.notApplicable??0)+(i.noLst??0)+(i.unavailable??0):0,o=a+s,l=t==="historical"?new Map(n.map(f=>{const h=e.timeSeries.map(p=>Math.round(p.values[f.id]??0)).filter(p=>p!==void 0);return[f.id,{max:Math.max(...h),min:Math.min(...h)}]})):null,u=n.map(f=>{const h=Math.round(r.values[f.id]??0),p=h/o*100,g=p>0&&p<1?"< 1":p.toFixed(0),d={id:f.id,label:f.label,value:h,percentage:Number.parseFloat(g),color:f.color,tooltip:Gh[f.label]};if(l){const m=l.get(f.id);m&&(d.max=m.max,d.min=m.min)}return d}),c=[];if(i){const f=e.categories.filter(h=>{var p;return(p=h.parliamentMapping)==null?void 0:p.isSpecialCategory});for(const h of f){let p=0;if(h.label==="N/A"?p=Math.round(i.notApplicable??0):h.label==="No LST"?p=Math.round(i.noLst??0):h.label==="Data Missing"&&(p=Math.round(i.unavailable??0)),p>0){const g=p/o*100,d=g>0&&g<1?"< 1":g.toFixed(0);c.push({id:h.id,label:h.label,value:p,percentage:Number.parseFloat(d),color:h.color,tooltip:Gh[h.label]})}}}return[...u,...c]},vT=e=>{if(!e.timeSeries[e.timeSeries.length-1])throw new Error("ChronoChart: No data points available");const r=e.timeSeries.map(a=>({timestamp:a.timestamp,values:a.values})),n=e.categories.map(a=>{var i;return{dataKey:a.id,label:a.label,color:a.color,fillOpacity:.7,strokeWidth:(i=a.parliamentMapping)!=null&&i.isSpecialCategory?3:1.5,strokeDasharray:a.strokeDasharray,parliamentMapping:a.parliamentMapping}});return{data:r,categories:n}},bT=e=>{if(!e.timeSeries||e.timeSeries.length===0)throw new Error("ChronoChart: timeSeries must not be empty");if(!e.categories||e.categories.length===0)throw new Error("ChronoChart: categories must not be empty");if(!e.metadata||typeof e.metadata.total!="number")throw new Error("ChronoChart: metadata.total is required");if(!e.timeSeries.every((n,a)=>a===0||n.timestamp>=e.timeSeries[a-1].timestamp))throw new Error("ChronoChart: timeSeries must be sorted by timestamp (ascending)");const r=e.timeSeries[0];if(r){for(const n of e.categories.filter(a=>{var i;return!((i=a.parliamentMapping)!=null&&i.isSpecialCategory)}))if(!(n.id in r.values))throw new Error(`ChronoChart: Category "${n.id}" not found in timeSeries data`)}},ay=({data:e,selectedIndex:t,title:r,subtitle:n,showHeader:a=!0,width:i=960,height:s=400,timeRange:o,onTimeRangeChange:l,minAllowedTime:u,maxAllowedTime:c,enableBrush:f=!1,showLegend:h=!0,showTooltip:p=!0,showGrid:g=!0,axisLabelColor:d,axisLabelSize:m=14,enableAnimation:x=!0,animationDuration:y=5439,disableTimeline:v=!1,formatDate:_,formatValue:S,onAnimationStateChange:w,onTimelineReady:b,onAnimationProgress:T,brushColor:M="#69b3a2"})=>{bT(e);const[k,C]=K.useState(null),[O,R]=K.useState(!0),E=K.useRef("historical"),H=K.useRef(void 0),I=K.useMemo(()=>e.timeSeries.length===1||t!==void 0?"point-in-time":"historical",[t,e.timeSeries.length]),P=K.useMemo(()=>{var $;let q;return t!==void 0&&e.timeSeries[t]?(q=e.timeSeries[t].timestamp,H.current=q):E.current==="point-in-time"&&I==="historical"&&H.current!==void 0?q=H.current:q=($=e.timeSeries[e.timeSeries.length-1])==null?void 0:$.timestamp,E.current=I,q},[t,e.timeSeries,I]),j=e.timeSeries[0].timestamp,Y=e.timeSeries[e.timeSeries.length-1].timestamp,[rt,tt]=K.useState([j,Y]),J=o??rt,Q=K.useCallback(q=>{const $=[u!==void 0?Math.max(q[0],u):q[0],c!==void 0?Math.min(q[1],c):q[1]];l?l($):tt($)},[l,u,c]);K.useEffect(()=>{C(null)},[I]);const it=K.useMemo(()=>({top:10,right:30,left:60,bottom:30}),[]),L=K.useMemo(()=>vT(e),[e]),ot=K.useMemo(()=>xT(e,I),[e,I]),nt=K.useMemo(()=>{const q=e.timeSeries[e.timeSeries.length-1];return q?Object.values(q.values).reduce(($,lt)=>$+lt,0):0},[e.timeSeries]),N=K.useMemo(()=>df({repositoryCount:nt}),[nt]),F=K.useMemo(()=>gf({repositoryCount:nt}),[nt]),z=K.useMemo(()=>{const q=s-it.top-it.bottom;return Math.round(q*.9)},[s,it]),B=K.useMemo(()=>e.events?e.events.map(q=>({timestamp:q.timestamp,label:q.eventName,color:typeof q.color=="string"?q.color:"#2F42FF"})):[],[e.events]),A=K.useCallback(q=>{if(q){const $=e.categories.find(lt=>lt.label===q.label);C(($==null?void 0:$.id)??null)}else C(null)},[e.categories]),W=K.useCallback(q=>{R(!q),w&&w(q)},[w]);return D.jsxs(U.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[a&&(r||n)&&D.jsxs(U.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[r&&D.jsx(U.Typography,{variant:"h5",sx:{fontWeight:500},children:r}),n&&D.jsx(U.Typography,{variant:"body2",sx:{color:"text.secondary"},children:n})]}),D.jsx(U.Box,{sx:{position:"relative",width:"100%"},children:D.jsx(H0,{data:L.data,categories:L.categories,mode:I==="point-in-time"?"parliament":"stacked-area",width:i,height:s,timeRange:J,onTimeRangeChange:Q,minAllowedTime:u,maxAllowedTime:c,enableBrush:f,showGrid:g,showAxes:!0,axisLabelColor:d,axisLabelSize:m,margin:it,markers:B,formatDate:_,formatValue:S,animationDuration:y,onAnimationStateChange:W,onTimelineReady:b,onAnimationProgress:T,onHoveredDataChange:A,hoveredCategory:k,arcAngle:N,parliamentRadius:z,seatSize:F,parliamentTimestamp:P,timelineEvents:e.events??[],showTimeline:I==="historical"&&!v,brushColor:M})}),D.jsx(_T,{categories:ot,activeCategory:k,onCategoryHover:C,mode:I,visible:O})]})},wT=({containerRef:e,data:t,categories:r,width:n,height:a,margin:i,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,markers:d=[],markerVisibilityMode:m="hover",onMarkerHoverChange:x,brushColor:y="#69b3a2",showCrosshair:v=!1,crosshairColor:_="#666",crosshairDashArray:S="4,4",onHoveredAreaChange:w,onCrosshairMove:b})=>{K.useEffect(()=>{if(!e.current||t.length===0||r.length===0)return;const T=Dt(e.current),M=n-i.left-i.right,k=a-i.top-i.bottom;T.selectAll("*").remove();const C=T.append("g").attr("transform",`translate(${i.left},${i.top})`),O=`d3-chart-clip-${Math.random().toString(36).substr(2,9)}`;T.append("defs").append("clipPath").attr("id",O).append("rect").attr("x",0).attr("y",0).attr("width",M).attr("height",k);const R=C.append("g").attr("clip-path",`url(#${O})`),E=[...t].sort((A,W)=>A.timestamp-W.timestamp),H=r.map(A=>A.dataKey),I=Ka().keys(H),P=I(E),j=t.map(A=>A.timestamp),Y=s?s[0]:Math.min(...j),rt=s?s[1]:Math.max(...j),tt=Kn().domain([new Date(Y),new Date(rt)]).range([0,M]),J=E.filter(A=>A.timestamp>=Y&&A.timestamp<=rt),Q=I(J),it=Q.length>0?Math.max(...Q[Q.length-1].map(A=>A[1]??0)):0,L=ia().domain([0,it*1.1]).range([k,0]).nice();o&&(R.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(Ir(tt).ticks(6).tickSize(k).tickFormat(()=>"")),R.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(zr(L).ticks(5).tickSize(-M).tickFormat(()=>"")));const ot=ss().x(A=>tt(new Date(A.data.timestamp))).y0(A=>L(A[0])).y1(A=>L(A[1])).curve(Cn),nt=R.append("g").attr("class","areas");if(P.forEach((A,W)=>{const q=r[W];if(!q)return;const $=nt.append("path").datum(A).attr("class",`area area-${q.dataKey}`).attr("fill",q.color).attr("fill-opacity",q.fillOpacity??.7).attr("stroke",q.color).attr("stroke-width",q.strokeWidth??1.5).attr("d",ot).attr("pointer-events","none");q.strokeDasharray&&$.attr("stroke-dasharray",q.strokeDasharray)}),d.length>0){const A=R.append("g").attr("class","markers"),W=m==="hover"?0:.6,q=d.filter($=>$.timestamp>=Y&&$.timestamp<=rt).map($=>({...$,x:tt(new Date($.timestamp))}));if(q.forEach($=>{const lt=A.append("line").attr("class","marker-line").attr("data-timestamp",$.timestamp).attr("x1",$.x).attr("x2",$.x).attr("y1",0).attr("y2",k).attr("stroke",$.color??"#131E7A").attr("stroke-width",2).attr("opacity",W);$.strokeDasharray&<.attr("stroke-dasharray",$.strokeDasharray),$.label&&A.append("text").attr("class","marker-label").attr("data-timestamp",$.timestamp).attr("x",$.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",$.color??"#131E7A").attr("opacity",W).text($.label)}),m==="hover"&&q.length>0){const $=T.append("g").attr("class","marker-tooltip").attr("transform",`translate(${i.left},${i.top})`).style("pointer-events","none").style("display","none"),lt=$.append("rect").attr("fill","#131E7A").attr("rx",4).attr("ry",4).attr("filter","drop-shadow(0px 2px 4px rgba(0,0,0,0.2))"),V=$.append("text").attr("fill","white").attr("font-size",12).attr("font-weight",500).attr("text-anchor","middle");let ut=null;const vt=R.append("rect").attr("class","marker-hover-overlay").attr("width",M).attr("height",k).attr("fill","none").attr("pointer-events","all"),et=mt=>{let Ct=null,st=1/0;if(q.forEach(qt=>{const Ut=Math.abs(mt-qt.x);Ut<st&&(st=Ut,Ct=qt)}),!Ct||st>50)return ut!==null&&(ut=null,A.selectAll(".marker-line").attr("opacity",0),A.selectAll(".marker-label").attr("opacity",0),$.style("display","none"),x==null||x(!1)),!1;const ht=Ct;if(ut===null&&(x==null||x(!0)),ut===ht.timestamp)return!0;ut=ht.timestamp,A.selectAll(".marker-line").attr("opacity",0),A.selectAll(".marker-label").attr("opacity",0),A.selectAll(".marker-line").filter(function(){return Dt(this).attr("data-timestamp")===String(ht.timestamp)}).attr("opacity",.6),A.selectAll(".marker-label").filter(function(){return Dt(this).attr("data-timestamp")===String(ht.timestamp)}).attr("opacity",1);const bt=new Date(ht.timestamp),Bt=p?p(ht.timestamp):bt.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),Ft=ht.label?`${ht.label}: ${Bt}`:Bt;V.text(Ft);const kt=V.node().getBBox(),Vt=8,Rt=kt.width+Vt*2,xt=kt.height+Vt*2;lt.attr("width",Rt).attr("height",xt);let At=ht.x-Rt/2;const jt=10;return At<0?At=0:At+Rt>M&&(At=M-Rt),$.attr("transform",`translate(${i.left+At},${i.top+jt})`),V.attr("x",Rt/2).attr("y",xt/2+4),$.style("display","block"),!0};vt.on("mousemove",function(mt){const[Ct]=Tr(mt,this);et(Ct)&&mt.stopPropagation()}),vt.on("mouseleave",function(){ut=null,A.selectAll(".marker-line").attr("opacity",0),A.selectAll(".marker-label").attr("opacity",0),$.style("display","none"),x==null||x(!1)})}}if(l){const A=Ir(tt).ticks(6);p&&A.tickFormat(W=>p(+W)),C.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${k})`).call(A).selectAll("text").attr("font-size",11)}if(u){const A=zr(L).ticks(5);g&&A.tickFormat(W=>g(+W)),C.append("g").attr("class","axis axis-y").call(A).selectAll("text").attr("font-size",11)}const N=v?C.append("g").attr("class","crosshair").attr("pointer-events","none"):null;N&&(N.append("line").attr("class","crosshair-vertical").attr("y1",0).attr("y2",k).attr("stroke",_).attr("stroke-dasharray",S).attr("stroke-width",1).attr("opacity",0).attr("pointer-events","none"),N.append("line").attr("class","crosshair-horizontal").attr("x1",0).attr("x2",M).attr("stroke",_).attr("stroke-dasharray",S).attr("stroke-width",1).attr("opacity",0).attr("pointer-events","none"));const F=(A,W)=>{const q=+tt.invert(A);let $=-1;for(let et=0;et<E.length-1;et++)if(E[et].timestamp<=q&&E[et+1].timestamp>=q){$=et;break}$===-1&&(q<=E[0].timestamp?$=0:$=E.length-2);const lt=E[$],V=E[$+1];if(!lt||!V)return null;const ut=V.timestamp-lt.timestamp,vt=ut>0?(q-lt.timestamp)/ut:0;for(let et=P.length-1;et>=0;et--){const mt=P[et],Ct=r[et];if(!mt||!Ct)continue;const st=mt[$],yt=mt[$+1];if(!st||!yt)continue;const ht=st[0]+vt*(yt[0]-st[0]),bt=st[1]+vt*(yt[1]-st[1]),Bt=L(ht),Ft=L(bt);if(W>=Ft&&W<=Bt){const kt=bt-ht;return{timestamp:q,category:{label:Ct.label,color:Ct.color},value:kt}}}return null},z=(A,W)=>{const[q,$]=Tr(A,W);N&&(N.select(".crosshair-vertical").attr("x1",q).attr("x2",q).attr("opacity",1),N.select(".crosshair-horizontal").attr("y1",$).attr("y2",$).attr("opacity",1)),b==null||b({x:q+i.left,y:$+i.top});const lt=F(q,$);w==null||w(lt)},B=()=>{N&&(N.select(".crosshair-vertical").attr("opacity",0),N.select(".crosshair-horizontal").attr("opacity",0)),b==null||b(null),w==null||w(null)};if(!c){const A=R.append("rect").attr("class","mouse-overlay").attr("width",M).attr("height",k).attr("fill","none").attr("pointer-events","all");A.on("mousemove",function(W){z(W,this)}),A.on("mouseleave",B)}if(c&&h){const A=ga().extent([[0,0],[M,k]]).on("brush",q=>{if(q.sourceEvent&&N){const $=T.select(".brush .overlay").node();if($){const[lt,V]=Tr(q.sourceEvent,$);N.select(".crosshair-vertical").attr("x1",lt).attr("x2",lt).attr("opacity",1),N.select(".crosshair-horizontal").attr("y1",V).attr("y2",V).attr("opacity",1)}}}).on("end",q=>{if(!q.selection)return;const[$,lt]=q.selection,V=[+tt.invert($),+tt.invert(lt)];h(V),f&&T.select(".brush").call(A.move,null)}),W=T.append("g").attr("class","brush").attr("transform",`translate(${i.left},${i.top})`).call(A);W.select(".selection").style("fill",y).style("fill-opacity","0.4").style("stroke",y).style("stroke-width","2px"),W.selectAll(".handle").style("fill",y).style("fill-opacity","0.9"),W.select(".overlay").on("mousemove",function(q){z(q,this)}).on("mouseleave",B)}return()=>{T.selectAll("*").remove()}},[e,t,r,n,a,i,s,o,l,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b])},ST=({data:e,categories:t,title:r,subtitle:n,showHeader:a=!0,showLegend:i=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:x,enableBrush:y=!1,zoomToSelection:v=!1,markers:_=[],markerVisibilityMode:S="hover",brushColor:w="#69b3a2",showCrosshair:b=!1,crosshairColor:T="#666",crosshairDashArray:M="4,4"})=>{const k=K.useRef(null),[C,O]=K.useState(null),[R,E]=K.useState(null),[H,I]=K.useState(!1),P=K.useCallback(Q=>{H||O(Q)},[H]),j=K.useCallback(Q=>{H||E(Q)},[H]),Y=K.useCallback(Q=>{I(Q),Q&&(O(null),E(null))},[]);wT({containerRef:k,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:v,onTimeRangeChange:x,formatDate:d,formatValue:m,markers:_,markerVisibilityMode:S,onMarkerHoverChange:Y,brushColor:w,showCrosshair:b,crosshairColor:T,crosshairDashArray:M,onHoveredAreaChange:P,onCrosshairMove:j});const J=Q=>d?d(Q):new Date(Q).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0});return D.jsxs(U.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[a&&(r||n)&&D.jsxs(U.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[r&&D.jsx(U.Typography,{variant:"h5",sx:{fontWeight:500},children:r}),n&&D.jsx(U.Typography,{variant:"body2",sx:{color:"text.secondary"},children:n})]}),D.jsxs(U.Box,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:k,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),s&&C&&R&&D.jsxs(U.Paper,{elevation:3,sx:{position:"absolute",left:R.x+10,top:R.y-10,pointerEvents:"none",p:2,whiteSpace:"nowrap",zIndex:1e3,transform:R.x>o/2?"translateX(-100%) translateX(-20px)":"none"},children:[D.jsx(U.Typography,{sx:{fontFamily:"monospace",fontSize:"0.875rem",color:"text.secondary",mb:1.5},children:J(C.timestamp)}),D.jsxs(U.Stack,{direction:"row",spacing:1.5,children:[D.jsx(U.Box,{sx:{width:5,backgroundColor:C.category.color,borderRadius:1}}),D.jsxs(U.Stack,{children:[D.jsx(U.Typography,{sx:{fontWeight:700,fontSize:"1.125rem"},children:C.category.label}),D.jsx(U.Typography,{sx:{fontSize:"1rem",textDecoration:"underline"},children:m?m(C.value):C.value.toLocaleString()})]})]})]})]}),i&&D.jsx(U.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(Q=>D.jsxs(U.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[D.jsx(U.Box,{sx:{width:16,height:16,backgroundColor:Q.color,opacity:Q.fillOpacity??.7,border:`2px solid ${Q.color}`,borderRadius:"2px",...Q.strokeDasharray&&{backgroundImage:`repeating-linear-gradient(
|
|
34
34
|
45deg,
|
|
35
35
|
transparent,
|
|
36
36
|
transparent 4px,
|
|
37
|
-
${
|
|
38
|
-
${
|
|
39
|
-
)`}}}),D.jsx(z.Typography,{variant:"body2",children:P.label})]},P.dataKey))})]})},TT=({containerRef:e,data:t,categories:r,width:n,height:i,margin:a,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,showCrosshair:d=!0,crosshairColor:m="#666",crosshairDashArray:v="4,4",brushColor:y="#69b3a2",onTooltipChange:x})=>{Q.useEffect(()=>{if(!e.current||t.length===0||r.length===0)return;const _=Ct(e.current),S=n-a.left-a.right,w=i-a.top-a.bottom;_.selectAll("*").remove();const b=_.append("g").attr("transform",`translate(${a.left},${a.top})`),T=`d3-bar-clip-${Math.random().toString(36).substr(2,9)}`;_.append("defs").append("clipPath").attr("id",T).append("rect").attr("x",0).attr("y",0).attr("width",S).attr("height",w);const M=b.append("g").attr("clip-path",`url(#${T})`),C=[...t].sort((L,B)=>L.timestamp-B.timestamp),A=r.map(L=>L.dataKey),F=Ki().keys(A),E=F(C),N=t.map(L=>L.timestamp),U=s?s[0]:Math.min(...N),P=s?s[1]:Math.max(...N),O=Kn().domain([new Date(U),new Date(P)]).range([0,S]),j=C.filter(L=>L.timestamp>=U&&L.timestamp<=P),X=F(j),et=X.length>0?Math.max(...X[X.length-1].map(L=>L[1]??0)):0,at=ai().domain([0,et*1.1]).range([w,0]).nice();o&&(M.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qr(O).ticks(6).tickSize(w).tickFormat(()=>"")),M.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(Ir(at).ticks(5).tickSize(-S).tickFormat(()=>"")));const tt=M.append("g").attr("class","bars"),G=[];E.forEach((L,B)=>{const k=r[B];k&&L.forEach((I,q)=>{const R=C[q];if(!R)return;const nt=R.timestamp,Y=C[q+1],Z=Y?Y.timestamp:P;if(Z<U||nt>P)return;const lt=Math.max(nt,U),rt=Math.min(Z,P),ft=O(new Date(lt)),wt=O(new Date(rt))-ft;if(wt<=0)return;const st=at(I[0]),_t=at(I[1]),Pt=st-_t;if(Pt<=0)return;const ot=I[1]-I[0];G.push({barIndex:q,categoryIndex:B,category:k,x:ft,width:wt,y:_t,height:Pt,value:ot,startTime:nt,endTime:Z})})}),tt.selectAll(".bar-segment").data(G).enter().append("rect").attr("class","bar-segment").attr("data-bar-index",L=>L.barIndex).attr("data-category-index",L=>L.categoryIndex).attr("x",L=>L.x).attr("y",L=>L.y).attr("width",L=>L.width).attr("height",L=>L.height).attr("fill",L=>L.category.color).attr("fill-opacity",L=>L.category.fillOpacity??.8).attr("stroke",L=>L.category.color).attr("stroke-width",.5).attr("pointer-events","none");const W=d?b.append("g").attr("class","crosshair"):null;W&&(W.append("line").attr("class","crosshair-vertical").attr("y1",0).attr("y2",w).attr("stroke",m).attr("stroke-dasharray",v).attr("stroke-width",1).attr("opacity",0).attr("pointer-events","none"),W.append("line").attr("class","crosshair-horizontal").attr("x1",0).attr("x2",S).attr("stroke",m).attr("stroke-dasharray",v).attr("stroke-width",1).attr("opacity",0).attr("pointer-events","none"));const $=(L,B)=>{const[k,I]=en(L,B);W&&(W.select(".crosshair-vertical").attr("x1",k).attr("x2",k).attr("opacity",1),W.select(".crosshair-horizontal").attr("y1",I).attr("y2",I).attr("opacity",1));const q=G.find(R=>k>=R.x&&k<=R.x+R.width&&I>=R.y&&I<=R.y+R.height);q&&x?x({visible:!0,x:k+a.left,y:I+a.top,category:{label:q.category.label,color:q.category.color},value:q.value,startTime:q.startTime,endTime:q.endTime}):x&&x(null)},K=()=>{W&&(W.select(".crosshair-vertical").attr("opacity",0),W.select(".crosshair-horizontal").attr("opacity",0)),x&&x(null)};if(c&&h){const L=gi().extent([[0,0],[S,w]]).on("brush",k=>{if(k.sourceEvent){const I=M.select(".brush .overlay").node();I&&$(k.sourceEvent,I)}}).on("end",k=>{if(!k.selection)return;const[I,q]=k.selection,R=[+O.invert(I),+O.invert(q)];h(R),f&&_.select(".brush").call(L.move,null)}),B=b.append("g").attr("class","brush").call(L);B.selectAll(".selection").attr("fill",y).attr("fill-opacity",.3).attr("stroke",y).attr("stroke-width",2),B.selectAll(".handle").attr("fill",y).attr("fill-opacity",.8),B.select(".overlay").on("mousemove",function(k){$(k,this)}).on("mouseleave",K)}else{const L=M.append("rect").attr("class","mouse-overlay").attr("width",S).attr("height",w).attr("fill","none").attr("pointer-events","all");L.on("mousemove",function(B){$(B,this)}),L.on("mouseleave",K)}if(l){const L=qr(O).ticks(6);p&&L.tickFormat(B=>p(+B)),b.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${w})`).call(L).selectAll("text").attr("font-size",11)}if(u){const L=Ir(at).ticks(5);g&&L.tickFormat(B=>g(+B)),b.append("g").attr("class","axis axis-y").call(L).selectAll("text").attr("font-size",11)}return()=>{_.selectAll("*").remove()}},[e,t,r,n,i,a,s,o,l,u,c,f,h,p,g,d,m,v,y,x])},MT=({data:e,categories:t,title:r,subtitle:n,showHeader:i=!0,showLegend:a=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:v,enableBrush:y=!1,zoomToSelection:x=!1,brushColor:_="#69b3a2",showCrosshair:S=!0,crosshairColor:w="#666",crosshairDashArray:b="4,4"})=>{const T=Q.useRef(null),[M,C]=Q.useState(null);TT({containerRef:T,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:x,onTimeRangeChange:v,formatDate:d,formatValue:m,showCrosshair:S,crosshairColor:w,crosshairDashArray:b,brushColor:_,onTooltipChange:s?C:void 0});const E=N=>{if(d)return d(N);const U=new Date(N),P=U.getFullYear(),O=String(U.getMonth()+1).padStart(2,"0"),j=String(U.getDate()).padStart(2,"0");return`${P}-${O}-${j}`};return D.jsxs(z.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(r||n)&&D.jsxs(z.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[r&&D.jsx(z.Typography,{variant:"h5",sx:{fontWeight:500},children:r}),n&&D.jsx(z.Typography,{variant:"body2",sx:{color:"text.secondary"},children:n})]}),D.jsxs(z.Box,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:T,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),s&&M&&M.visible&&D.jsxs(z.Paper,{elevation:3,sx:{position:"absolute",left:M.x+10,top:M.y-10,pointerEvents:"none",zIndex:1e3,transform:M.x>o/2?"translateX(-100%) translateX(-20px)":"none",p:2,whiteSpace:"nowrap"},children:[D.jsx(z.Typography,{sx:{fontFamily:"monospace",fontSize:"0.875rem",color:"text.secondary",mb:1.5},children:E(M.startTime)}),D.jsxs(z.Stack,{direction:"row",spacing:1.5,children:[D.jsx(z.Box,{sx:{width:5,backgroundColor:M.category.color,borderRadius:1,flexShrink:0}}),D.jsxs(z.Stack,{children:[D.jsx(z.Typography,{sx:{fontWeight:700,fontSize:"1.125rem",lineHeight:1.3},children:M.category.label}),D.jsx(z.Typography,{sx:{fontSize:"1rem",color:"text.primary",textDecoration:"underline",textDecorationColor:"rgba(0,0,0,0.2)",textUnderlineOffset:"3px"},children:m?m(M.value):M.value.toLocaleString()})]})]})]})]}),a&&D.jsx(z.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(N=>D.jsxs(z.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[D.jsx(z.Box,{sx:{width:16,height:16,backgroundColor:N.color,opacity:N.fillOpacity??.8,border:`1px solid ${N.color}`,borderRadius:"2px"}}),D.jsx(z.Typography,{variant:"body2",children:N.label})]},N.dataKey))})]})},AT=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],jh={}.hasOwnProperty;function CT(e,t){const r=t||{};function n(i,...a){let s=n.invalid;const o=n.handlers;if(i&&jh.call(i,e)){const l=String(i[e]);s=jh.call(o,l)?o[l]:n.unknown}if(s)return s.call(this,i,...a)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const kT=/["&'<>`]/g,RT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ET=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,DT=/[|\\{}()[\]^$+*?.]/g,Yh=new WeakMap;function OT(e,t){if(e=e.replace(t.subset?PT(t.subset):kT,n),t.subset||t.escapeOnly)return e;return e.replace(RT,r).replace(ET,n);function r(i,a,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),t)}function n(i,a,s){return t.format(i.charCodeAt(0),s.charCodeAt(a+1),t)}}function PT(e){let t=Yh.get(e);return t||(t=FT(e),Yh.set(e,t)),t}function FT(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(DT,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const NT=/[\dA-Fa-f]/;function $T(e,t,r){const n="&#x"+e.toString(16).toUpperCase();return r&&t&&!NT.test(String.fromCharCode(t))?n:n+";"}const LT=/\d/;function qT(e,t,r){const n="&#"+String(e);return r&&t&&!LT.test(String.fromCharCode(t))?n:n+";"}const IT=["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"],Ws={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zT=["cent","copy","divide","gt","lt","not","para","times"],ay={}.hasOwnProperty,kc={};let wa;for(wa in Ws)ay.call(Ws,wa)&&(kc[Ws[wa]]=wa);const BT=/[^\dA-Za-z]/;function UT(e,t,r,n){const i=String.fromCharCode(e);if(ay.call(kc,i)){const a=kc[i],s="&"+a;return r&&IT.includes(a)&&!zT.includes(a)&&(!n||t&&t!==61&&BT.test(String.fromCharCode(t)))?s:s+";"}return""}function HT(e,t,r){let n=$T(e,t,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=UT(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const a=qT(e,t,r.omitOptionalSemicolons);a.length<n.length&&(n=a)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function ti(e,t){return OT(e,Object.assign({format:HT},t))}const GT=/^>|^->|<!--|-->|--!>|<!-$/g,jT=[">"],YT=["<",">"];function XT(e,t,r,n){return n.settings.bogusComments?"<?"+ti(e.value,Object.assign({},n.settings.characterReferences,{subset:jT}))+">":"<!--"+e.value.replace(GT,i)+"-->";function i(a){return ti(a,Object.assign({},n.settings.characterReferences,{subset:YT}))}}function WT(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function Xh(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}const KT=/[ \t\n\f\r]/g;function _f(e){return typeof e=="object"?e.type==="text"?Wh(e.value):!1:Wh(e)}function Wh(e){return e.replace(KT,"")===""}const de=oy(1),sy=oy(-1),VT=[];function oy(e){return t;function t(r,n,i){const a=r?r.children:VT;let s=(n||0)+e,o=a[s];if(!i)for(;o&&_f(o);)s+=e,o=a[s];return o}}const ZT={}.hasOwnProperty;function ly(e){return t;function t(r,n,i){return ZT.call(e,r.tagName)&&e[r.tagName](r,n,i)}}const vf=ly({body:JT,caption:Ks,colgroup:Ks,dd:nM,dt:rM,head:Ks,html:QT,li:eM,optgroup:iM,option:aM,p:tM,rp:Kh,rt:Kh,tbody:oM,td:Vh,tfoot:lM,th:Vh,thead:sM,tr:uM});function Ks(e,t,r){const n=de(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&_f(n.value.charAt(0)))}function QT(e,t,r){const n=de(r,t);return!n||n.type!=="comment"}function JT(e,t,r){const n=de(r,t);return!n||n.type!=="comment"}function tM(e,t,r){const n=de(r,t);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function eM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&n.tagName==="li"}function rM(e,t,r){const n=de(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function nM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function Kh(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function iM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function aM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function sM(e,t,r){const n=de(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function oM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function lM(e,t,r){return!de(r,t)}function uM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function Vh(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const cM=ly({body:pM,colgroup:dM,head:hM,html:fM,tbody:gM});function fM(e){const t=de(e,-1);return!t||t.type!=="comment"}function hM(e){const t=new Set;for(const n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}const r=e.children[0];return!r||r.type==="element"}function pM(e){const t=de(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&_f(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function dM(e,t,r){const n=sy(r,t),i=de(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&vf(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function gM(e,t,r){const n=sy(r,t),i=de(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&vf(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Sa={name:[[`
|
|
37
|
+
${Q.color} 4px,
|
|
38
|
+
${Q.color} 8px
|
|
39
|
+
)`}}}),D.jsx(U.Typography,{variant:"body2",children:Q.label})]},Q.dataKey))})]})},TT=({containerRef:e,data:t,categories:r,width:n,height:a,margin:i,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,showCrosshair:d=!0,crosshairColor:m="#666",crosshairDashArray:x="4,4",brushColor:y="#69b3a2",onTooltipChange:v})=>{K.useEffect(()=>{if(!e.current||t.length===0||r.length===0)return;const _=Dt(e.current),S=n-i.left-i.right,w=a-i.top-i.bottom;_.selectAll("*").remove();const b=_.append("g").attr("transform",`translate(${i.left},${i.top})`),T=`d3-bar-clip-${Math.random().toString(36).substr(2,9)}`;_.append("defs").append("clipPath").attr("id",T).append("rect").attr("x",0).attr("y",0).attr("width",S).attr("height",w);const M=b.append("g").attr("clip-path",`url(#${T})`),k=[...t].sort((N,F)=>N.timestamp-F.timestamp),C=r.map(N=>N.dataKey),O=Ka().keys(C),R=O(k),E=t.map(N=>N.timestamp),H=s?s[0]:Math.min(...E),I=s?s[1]:Math.max(...E),P=Kn().domain([new Date(H),new Date(I)]).range([0,S]),j=k.filter(N=>N.timestamp>=H&&N.timestamp<=I),Y=O(j),rt=Y.length>0?Math.max(...Y[Y.length-1].map(N=>N[1]??0)):0,tt=ia().domain([0,rt*1.1]).range([w,0]).nice();o&&(M.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(Ir(P).ticks(6).tickSize(w).tickFormat(()=>"")),M.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(zr(tt).ticks(5).tickSize(-S).tickFormat(()=>"")));const J=M.append("g").attr("class","bars"),Q=[];R.forEach((N,F)=>{const z=r[F];z&&N.forEach((B,A)=>{const W=k[A];if(!W)return;const q=W.timestamp,$=k[A+1],lt=$?$.timestamp:I;if(lt<H||q>I)return;const V=Math.max(q,H),ut=Math.min(lt,I),vt=P(new Date(V)),et=P(new Date(ut))-vt;if(et<=0)return;const mt=tt(B[0]),Ct=tt(B[1]),st=mt-Ct;if(st<=0)return;const yt=B[1]-B[0];Q.push({barIndex:A,categoryIndex:F,category:z,x:vt,width:et,y:Ct,height:st,value:yt,startTime:q,endTime:lt})})});const it=1;J.selectAll(".bar-segment").data(Q).enter().append("rect").attr("class","bar-segment").attr("data-bar-index",N=>N.barIndex).attr("data-category-index",N=>N.categoryIndex).attr("x",N=>N.x).attr("y",N=>N.y).attr("width",N=>Math.max(0,N.width-it)).attr("height",N=>N.height).attr("fill",N=>N.category.color).attr("fill-opacity",N=>N.category.fillOpacity??.8).attr("pointer-events","none");const L=d?b.append("g").attr("class","crosshair"):null;L&&(L.append("line").attr("class","crosshair-vertical").attr("y1",0).attr("y2",w).attr("stroke",m).attr("stroke-dasharray",x).attr("stroke-width",1).attr("opacity",0).attr("pointer-events","none"),L.append("line").attr("class","crosshair-horizontal").attr("x1",0).attr("x2",S).attr("stroke",m).attr("stroke-dasharray",x).attr("stroke-width",1).attr("opacity",0).attr("pointer-events","none"));const ot=(N,F)=>{const[z,B]=Tr(N,F);L&&(L.select(".crosshair-vertical").attr("x1",z).attr("x2",z).attr("opacity",1),L.select(".crosshair-horizontal").attr("y1",B).attr("y2",B).attr("opacity",1));const A=Q.find(W=>z>=W.x&&z<=W.x+W.width&&B>=W.y&&B<=W.y+W.height);A&&v?v({visible:!0,x:z+i.left,y:B+i.top,category:{label:A.category.label,color:A.category.color},value:A.value,startTime:A.startTime,endTime:A.endTime}):v&&v(null)},nt=()=>{L&&(L.select(".crosshair-vertical").attr("opacity",0),L.select(".crosshair-horizontal").attr("opacity",0)),v&&v(null)};if(c&&h){const N=ga().extent([[0,0],[S,w]]).on("brush",z=>{if(z.sourceEvent){const B=M.select(".brush .overlay").node();B&&ot(z.sourceEvent,B)}}).on("end",z=>{if(!z.selection)return;const[B,A]=z.selection,W=[+P.invert(B),+P.invert(A)];h(W),f&&_.select(".brush").call(N.move,null)}),F=b.append("g").attr("class","brush").call(N);F.selectAll(".selection").attr("fill",y).attr("fill-opacity",.3).attr("stroke",y).attr("stroke-width",2),F.selectAll(".handle").attr("fill",y).attr("fill-opacity",.8),F.select(".overlay").on("mousemove",function(z){ot(z,this)}).on("mouseleave",nt)}else{const N=M.append("rect").attr("class","mouse-overlay").attr("width",S).attr("height",w).attr("fill","none").attr("pointer-events","all");N.on("mousemove",function(F){ot(F,this)}),N.on("mouseleave",nt)}if(l){const N=Ir(P).ticks(6);p&&N.tickFormat(F=>p(+F)),b.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${w})`).call(N).selectAll("text").attr("font-size",11)}if(u){const N=zr(tt).ticks(5);g&&N.tickFormat(F=>g(+F)),b.append("g").attr("class","axis axis-y").call(N).selectAll("text").attr("font-size",11)}return()=>{_.selectAll("*").remove()}},[e,t,r,n,a,i,s,o,l,u,c,f,h,p,g,d,m,x,y,v])},MT=({data:e,categories:t,title:r,subtitle:n,showHeader:a=!0,showLegend:i=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:x,enableBrush:y=!1,zoomToSelection:v=!1,brushColor:_="#69b3a2",showCrosshair:S=!0,crosshairColor:w="#666",crosshairDashArray:b="4,4"})=>{const T=K.useRef(null),[M,k]=K.useState(null);TT({containerRef:T,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:v,onTimeRangeChange:x,formatDate:d,formatValue:m,showCrosshair:S,crosshairColor:w,crosshairDashArray:b,brushColor:_,onTooltipChange:s?k:void 0});const R=E=>{if(d)return d(E);const H=new Date(E),I=H.getFullYear(),P=String(H.getMonth()+1).padStart(2,"0"),j=String(H.getDate()).padStart(2,"0");return`${I}-${P}-${j}`};return D.jsxs(U.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[a&&(r||n)&&D.jsxs(U.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[r&&D.jsx(U.Typography,{variant:"h5",sx:{fontWeight:500},children:r}),n&&D.jsx(U.Typography,{variant:"body2",sx:{color:"text.secondary"},children:n})]}),D.jsxs(U.Box,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:T,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),s&&M&&M.visible&&D.jsxs(U.Paper,{elevation:3,sx:{position:"absolute",left:M.x+10,top:M.y-10,pointerEvents:"none",zIndex:1e3,transform:M.x>o/2?"translateX(-100%) translateX(-20px)":"none",p:2,whiteSpace:"nowrap"},children:[D.jsx(U.Typography,{sx:{fontFamily:"monospace",fontSize:"0.875rem",color:"text.secondary",mb:1.5},children:R(M.startTime)}),D.jsxs(U.Stack,{direction:"row",spacing:1.5,children:[D.jsx(U.Box,{sx:{width:5,backgroundColor:M.category.color,borderRadius:1,flexShrink:0}}),D.jsxs(U.Stack,{children:[D.jsx(U.Typography,{sx:{fontWeight:700,fontSize:"1.125rem",lineHeight:1.3},children:M.category.label}),D.jsx(U.Typography,{sx:{fontSize:"1rem",color:"text.primary",textDecoration:"underline",textDecorationColor:"rgba(0,0,0,0.2)",textUnderlineOffset:"3px"},children:m?m(M.value):M.value.toLocaleString()})]})]})]})]}),i&&D.jsx(U.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(E=>D.jsxs(U.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[D.jsx(U.Box,{sx:{width:16,height:16,backgroundColor:E.color,opacity:E.fillOpacity??.8,border:`1px solid ${E.color}`,borderRadius:"2px"}}),D.jsx(U.Typography,{variant:"body2",children:E.label})]},E.dataKey))})]})},AT=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],jh={}.hasOwnProperty;function CT(e,t){const r=t||{};function n(a,...i){let s=n.invalid;const o=n.handlers;if(a&&jh.call(a,e)){const l=String(a[e]);s=jh.call(o,l)?o[l]:n.unknown}if(s)return s.call(this,a,...i)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const kT=/["&'<>`]/g,RT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ET=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,DT=/[|\\{}()[\]^$+*?.]/g,Yh=new WeakMap;function OT(e,t){if(e=e.replace(t.subset?PT(t.subset):kT,n),t.subset||t.escapeOnly)return e;return e.replace(RT,r).replace(ET,n);function r(a,i,s){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function n(a,i,s){return t.format(a.charCodeAt(0),s.charCodeAt(i+1),t)}}function PT(e){let t=Yh.get(e);return t||(t=FT(e),Yh.set(e,t)),t}function FT(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(DT,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const NT=/[\dA-Fa-f]/;function $T(e,t,r){const n="&#x"+e.toString(16).toUpperCase();return r&&t&&!NT.test(String.fromCharCode(t))?n:n+";"}const LT=/\d/;function qT(e,t,r){const n="&#"+String(e);return r&&t&&!LT.test(String.fromCharCode(t))?n:n+";"}const IT=["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"],Ws={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zT=["cent","copy","divide","gt","lt","not","para","times"],iy={}.hasOwnProperty,kc={};let wi;for(wi in Ws)iy.call(Ws,wi)&&(kc[Ws[wi]]=wi);const BT=/[^\dA-Za-z]/;function UT(e,t,r,n){const a=String.fromCharCode(e);if(iy.call(kc,a)){const i=kc[a],s="&"+i;return r&&IT.includes(i)&&!zT.includes(i)&&(!n||t&&t!==61&&BT.test(String.fromCharCode(t)))?s:s+";"}return""}function HT(e,t,r){let n=$T(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=UT(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const i=qT(e,t,r.omitOptionalSemicolons);i.length<n.length&&(n=i)}return a&&(!r.useShortestReferences||a.length<n.length)?a:n}function ta(e,t){return OT(e,Object.assign({format:HT},t))}const GT=/^>|^->|<!--|-->|--!>|<!-$/g,jT=[">"],YT=["<",">"];function XT(e,t,r,n){return n.settings.bogusComments?"<?"+ta(e.value,Object.assign({},n.settings.characterReferences,{subset:jT}))+">":"<!--"+e.value.replace(GT,a)+"-->";function a(i){return ta(i,Object.assign({},n.settings.characterReferences,{subset:YT}))}}function WT(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function Xh(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(t);for(;a!==-1;)n++,a=r.indexOf(t,a+t.length);return n}const KT=/[ \t\n\f\r]/g;function _f(e){return typeof e=="object"?e.type==="text"?Wh(e.value):!1:Wh(e)}function Wh(e){return e.replace(KT,"")===""}const de=oy(1),sy=oy(-1),VT=[];function oy(e){return t;function t(r,n,a){const i=r?r.children:VT;let s=(n||0)+e,o=i[s];if(!a)for(;o&&_f(o);)s+=e,o=i[s];return o}}const ZT={}.hasOwnProperty;function ly(e){return t;function t(r,n,a){return ZT.call(e,r.tagName)&&e[r.tagName](r,n,a)}}const xf=ly({body:JT,caption:Ks,colgroup:Ks,dd:nM,dt:rM,head:Ks,html:QT,li:eM,optgroup:aM,option:iM,p:tM,rp:Kh,rt:Kh,tbody:oM,td:Vh,tfoot:lM,th:Vh,thead:sM,tr:uM});function Ks(e,t,r){const n=de(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&_f(n.value.charAt(0)))}function QT(e,t,r){const n=de(r,t);return!n||n.type!=="comment"}function JT(e,t,r){const n=de(r,t);return!n||n.type!=="comment"}function tM(e,t,r){const n=de(r,t);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function eM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&n.tagName==="li"}function rM(e,t,r){const n=de(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function nM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function Kh(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function aM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function iM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function sM(e,t,r){const n=de(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function oM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function lM(e,t,r){return!de(r,t)}function uM(e,t,r){const n=de(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function Vh(e,t,r){const n=de(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const cM=ly({body:pM,colgroup:dM,head:hM,html:fM,tbody:gM});function fM(e){const t=de(e,-1);return!t||t.type!=="comment"}function hM(e){const t=new Set;for(const n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}const r=e.children[0];return!r||r.type==="element"}function pM(e){const t=de(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&_f(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function dM(e,t,r){const n=sy(r,t),a=de(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&xf(n,r.children.indexOf(n),r)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function gM(e,t,r){const n=sy(r,t),a=de(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&xf(n,r.children.indexOf(n),r)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Si={name:[[`
|
|
40
40
|
\f\r &/=>`.split(""),`
|
|
41
41
|
\f\r "&'/=>\``.split("")],[`\0
|
|
42
42
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -44,22 +44,22 @@
|
|
|
44
44
|
\f\r &>`.split(""),`\0
|
|
45
45
|
\f\r "&'<=>\``.split("")],[`\0
|
|
46
46
|
\f\r "&'<=>\``.split(""),`\0
|
|
47
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function mM(e,t,r,n){const i=n.schema,a=i.space==="svg"?!1:n.settings.omitOptionalTags;let s=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;i.space==="html"&&e.tagName==="svg"&&(n.schema=yf);const u=yM(n,e.properties),c=n.all(i.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=i,c&&(s=!1),(u||!a||!cM(e,t,r))&&(o.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||n.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(c),!s&&(!a||!vf(e,t,r))&&o.push("</"+e.tagName+">"),o.join("")}function yM(e,t){const r=[];let n=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const a=_M(e,i,t[i]);a&&r.push(a)}}for(;++n<r.length;){const a=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&a!=='"'&&a!=="'"&&(r[n]+=" ")}return r.join("")}function _M(e,t,r){const n=Q0(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=ti(n.attribute,Object.assign({},e.settings.characterReferences,{subset:Sa.name[i][a]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?cT:hT)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(o=ti(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Sa.unquoted[i][a]}))),o!==r&&(e.settings.quoteSmart&&Xh(r,s)>Xh(r,e.alternative)&&(s=e.alternative),o=s+ti(r,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Sa.single:Sa.double)[i][a],attribute:!0}))+s),l+(o&&"="+o))}const vM=["<","&"];function uy(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:ti(e.value,Object.assign({},n.settings.characterReferences,{subset:vM}))}function xM(e,t,r,n){return n.settings.allowDangerousHtml?e.value:uy(e,t,r,n)}function bM(e,t,r,n){return n.all(e)}const wM=CT("type",{invalid:SM,unknown:TM,handlers:{comment:XT,doctype:WT,element:mM,raw:xM,root:bM,text:uy}});function SM(e){throw new Error("Expected node, not `"+e+"`")}function TM(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const MM={},AM={},CM=[];function kM(e,t){const r=MM,n=r.quote||'"',i=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:RM,all:EM,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||AT,characterReferences:r.characterReferences||AM,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?yf:J0,quote:n,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function RM(e,t,r){return wM(e,t,r,this)}function EM(e){const t=[],r=e&&e.children||CM;let n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}const Pe={arcAngle:180,maxSeats:200,useEnhanced:!0,chartConfig:{radius:220,seatSize:5,minSeatSize:4,maxSeatSize:18,spacing:1.1,innerRadiusRatio:.4,arcAngleFlexibility:5},colors:{emptySeats:"#f8f8f8",emptySeatsBorder:"#d8d8d8",seatBorder:"#fff"},animation:{transitionDuration:"0.2s",hoverOpacity:{active:"1",dimmed:"0.2",empty:"0.3"}},scaling:{enableScaling:!0,scaleThreshold:200}},ei={COMPLETED:ur.neoDigitalGreen[600],NOT_APPLICABLE:"url(#greyHatchPattern)",NO_LST:"url(#noLstHatchPattern)",DATA_MISSING:"url(#dataMissingHatchPattern)"},Hi="N/A",Gi="No LST",ji="Data Missing";function DM(e,t,r,n="left-to-right",i=900,a){Ct.prototype.transition=Ic;const s=t*Math.PI/180,o=-s/2-Math.PI/2,l=s/2-Math.PI/2;let u=e.querySelector("defs");u||(u=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.appendChild(u));const c="arc-sweep-clip";let f=u.querySelector(`#${c}`);f||(f=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),f.setAttribute("id",c),u.appendChild(f));const h=document.createElementNS("http://www.w3.org/2000/svg","path");f.innerHTML="",f.appendChild(h);const p=e.querySelector(".arc-container"),g=e.querySelector(".points-container");if(g&&p)if(g.setAttribute("clip-path",`url(#${c})`),n==="left-to-right"){const m=y=>{const x=r*1.5,_=Math.cos(y)*x,S=Math.sin(y)*x,w=Math.cos(l)*x,b=Math.sin(l)*x,T=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${x},${x} 0 ${T},1 ${w},${b} Z`};h.setAttribute("d",m(o)),Ct(h).transition().duration(i).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const x=o+(l-o)*y;h.setAttribute("d",m(x))}).on("end",()=>{a&&a(),setTimeout(()=>{g.removeAttribute("clip-path")},50)})}else{const m=y=>{const x=r*1.5,_=Math.cos(y)*x,S=Math.sin(y)*x,w=Math.cos(l)*x,b=Math.sin(l)*x,T=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${x},${x} 0 ${T},1 ${w},${b} Z`};h.setAttribute("d",m(l)),Ct(h).transition().duration(i).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const x=l-(l-o)*y;h.setAttribute("d",m(x))}).on("end",()=>{g.removeAttribute("clip-path"),a&&a()})}}var Ta=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vs,Zh;function cy(){if(Zh)return Vs;Zh=1;var e=typeof Ta=="object"&&Ta&&Ta.Object===Object&&Ta;return Vs=e,Vs}var Zs,Qh;function Cr(){if(Qh)return Zs;Qh=1;var e=cy(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Zs=r,Zs}var Qs,Jh;function OM(){if(Jh)return Qs;Jh=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Qs=t,Qs}var Js,tp;function PM(){if(tp)return Js;tp=1;var e=OM(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Js=r,Js}var to,ep;function ua(){if(ep)return to;ep=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return to=e,to}var eo,rp;function ca(){if(rp)return eo;rp=1;var e=Cr(),t=e.Symbol;return eo=t,eo}var ro,np;function FM(){if(np)return ro;np=1;var e=ca(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(s){var o=r.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[i]=l:delete s[i]),c}return ro=a,ro}var no,ip;function NM(){if(ip)return no;ip=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return no=r,no}var io,ap;function fa(){if(ap)return io;ap=1;var e=ca(),t=FM(),r=NM(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function s(o){return o==null?o===void 0?i:n:a&&a in Object(o)?t(o):r(o)}return io=s,io}var ao,sp;function ha(){if(sp)return ao;sp=1;function e(t){return t!=null&&typeof t=="object"}return ao=e,ao}var so,op;function pa(){if(op)return so;op=1;var e=fa(),t=ha(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return so=n,so}var oo,lp;function fy(){if(lp)return oo;lp=1;var e=PM(),t=ua(),r=pa(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||s.test(u)?o(u.slice(2),f?2:8):i.test(u)?n:+u}return oo=l,oo}var lo,up;function hy(){if(up)return lo;up=1;var e=fy(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*r}return i===i?i:0}return lo=n,lo}var uo,cp;function py(){if(cp)return uo;cp=1;var e=hy();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return uo=t,uo}var co,fp;function cs(){if(fp)return co;fp=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return co=e,co}var fo,hp;function cr(){if(hp)return fo;hp=1;var e=Array.isArray;return fo=e,fo}var ho,pp;function $M(){if(pp)return ho;pp=1;var e=ca(),t=cs(),r=cr(),n=pa(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return t(o,s)+"";if(n(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return ho=s,ho}var po,dp;function dy(){if(dp)return po;dp=1;var e=$M();function t(r){return r==null?"":e(r)}return po=t,po}var go,gp;function LM(){if(gp)return go;gp=1;var e=Cr(),t=py(),r=fy(),n=dy(),i=e.isFinite,a=Math.min;function s(o){var l=Math[o];return function(u,c){if(u=r(u),c=c==null?0:a(t(c),292),c&&i(u)){var f=(n(u)+"e").split("e"),h=l(f[0]+"e"+(+f[1]+c));return f=(n(h)+"e").split("e"),+(f[0]+"e"+(+f[1]-c))}return l(u)}}return go=s,go}var mo,mp;function qM(){if(mp)return mo;mp=1;var e=LM(),t=e("round");return mo=t,mo}var IM=qM();const zM=yi(IM);var yo,yp;function gy(){if(yp)return yo;yp=1;function e(t,r){for(var n=-1,i=r.length,a=t.length;++n<i;)t[a+n]=r[n];return t}return yo=e,yo}var _o,_p;function BM(){if(_p)return _o;_p=1;var e=fa(),t=ha(),r="[object Arguments]";function n(i){return t(i)&&e(i)==r}return _o=n,_o}var vo,vp;function xf(){if(vp)return vo;vp=1;var e=BM(),t=ha(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(s){return t(s)&&n.call(s,"callee")&&!i.call(s,"callee")};return vo=a,vo}var xo,xp;function UM(){if(xp)return xo;xp=1;var e=ca(),t=xf(),r=cr(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return xo=i,xo}var bo,bp;function my(){if(bp)return bo;bp=1;var e=gy(),t=UM();function r(n,i,a,s,o){var l=-1,u=n.length;for(a||(a=t),o||(o=[]);++l<u;){var c=n[l];i>0&&a(c)?i>1?r(c,i-1,a,s,o):e(o,c):s||(o[o.length]=c)}return o}return bo=r,bo}var wo,wp;function bf(){if(wp)return wo;wp=1;var e=cr(),t=pa(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(e(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||s!=null&&a in Object(s)}return wo=i,wo}var So,Sp;function yy(){if(Sp)return So;Sp=1;var e=fa(),t=ua(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==n||l==i||l==r||l==a}return So=s,So}var To,Tp;function HM(){if(Tp)return To;Tp=1;var e=Cr(),t=e["__core-js_shared__"];return To=t,To}var Mo,Mp;function GM(){if(Mp)return Mo;Mp=1;var e=HM(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Mo=r,Mo}var Ao,Ap;function _y(){if(Ap)return Ao;Ap=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ao=r,Ao}var Co,Cp;function jM(){if(Cp)return Co;Cp=1;var e=yy(),t=GM(),r=ua(),n=_y(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||t(h))return!1;var p=e(h)?c:a;return p.test(n(h))}return Co=f,Co}var ko,kp;function YM(){if(kp)return ko;kp=1;function e(t,r){return t==null?void 0:t[r]}return ko=e,ko}var Ro,Rp;function On(){if(Rp)return Ro;Rp=1;var e=jM(),t=YM();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return Ro=r,Ro}var Eo,Ep;function fs(){if(Ep)return Eo;Ep=1;var e=On(),t=e(Object,"create");return Eo=t,Eo}var Do,Dp;function XM(){if(Dp)return Do;Dp=1;var e=fs();function t(){this.__data__=e?e(null):{},this.size=0}return Do=t,Do}var Oo,Op;function WM(){if(Op)return Oo;Op=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Oo=e,Oo}var Po,Pp;function KM(){if(Pp)return Po;Pp=1;var e=fs(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var s=this.__data__;if(e){var o=s[a];return o===t?void 0:o}return n.call(s,a)?s[a]:void 0}return Po=i,Po}var Fo,Fp;function VM(){if(Fp)return Fo;Fp=1;var e=fs(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Fo=n,Fo}var No,Np;function ZM(){if(Np)return No;Np=1;var e=fs(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return No=r,No}var $o,$p;function QM(){if($p)return $o;$p=1;var e=XM(),t=WM(),r=KM(),n=VM(),i=ZM();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,$o=a,$o}var Lo,Lp;function JM(){if(Lp)return Lo;Lp=1;function e(){this.__data__=[],this.size=0}return Lo=e,Lo}var qo,qp;function wf(){if(qp)return qo;qp=1;function e(t,r){return t===r||t!==t&&r!==r}return qo=e,qo}var Io,Ip;function hs(){if(Ip)return Io;Ip=1;var e=wf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Io=t,Io}var zo,zp;function tA(){if(zp)return zo;zp=1;var e=hs(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,s=e(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():r.call(a,s,1),--this.size,!0}return zo=n,zo}var Bo,Bp;function eA(){if(Bp)return Bo;Bp=1;var e=hs();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Bo=t,Bo}var Uo,Up;function rA(){if(Up)return Uo;Up=1;var e=hs();function t(r){return e(this.__data__,r)>-1}return Uo=t,Uo}var Ho,Hp;function nA(){if(Hp)return Ho;Hp=1;var e=hs();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ho=t,Ho}var Go,Gp;function ps(){if(Gp)return Go;Gp=1;var e=JM(),t=tA(),r=eA(),n=rA(),i=nA();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Go=a,Go}var jo,jp;function Sf(){if(jp)return jo;jp=1;var e=On(),t=Cr(),r=e(t,"Map");return jo=r,jo}var Yo,Yp;function iA(){if(Yp)return Yo;Yp=1;var e=QM(),t=ps(),r=Sf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Yo=n,Yo}var Xo,Xp;function aA(){if(Xp)return Xo;Xp=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Xo=e,Xo}var Wo,Wp;function ds(){if(Wp)return Wo;Wp=1;var e=aA();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Wo=t,Wo}var Ko,Kp;function sA(){if(Kp)return Ko;Kp=1;var e=ds();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Ko=t,Ko}var Vo,Vp;function oA(){if(Vp)return Vo;Vp=1;var e=ds();function t(r){return e(this,r).get(r)}return Vo=t,Vo}var Zo,Zp;function lA(){if(Zp)return Zo;Zp=1;var e=ds();function t(r){return e(this,r).has(r)}return Zo=t,Zo}var Qo,Qp;function uA(){if(Qp)return Qo;Qp=1;var e=ds();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return Qo=t,Qo}var Jo,Jp;function Tf(){if(Jp)return Jo;Jp=1;var e=iA(),t=sA(),r=oA(),n=lA(),i=uA();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Jo=a,Jo}var tl,td;function cA(){if(td)return tl;td=1;var e=Tf(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(r.Cache||e),a}return r.Cache=e,tl=r,tl}var el,ed;function fA(){if(ed)return el;ed=1;var e=cA(),t=500;function r(n){var i=e(n,function(s){return a.size===t&&a.clear(),s}),a=i.cache;return i}return el=r,el}var rl,rd;function hA(){if(rd)return rl;rd=1;var e=fA(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(s,o,l,u){a.push(l?u.replace(r,"$1"):o||s)}),a});return rl=n,rl}var nl,nd;function vy(){if(nd)return nl;nd=1;var e=cr(),t=bf(),r=hA(),n=dy();function i(a,s){return e(a)?a:t(a,s)?[a]:r(n(a))}return nl=i,nl}var il,id;function gs(){if(id)return il;id=1;var e=pa();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return il=t,il}var al,ad;function Mf(){if(ad)return al;ad=1;var e=vy(),t=gs();function r(n,i){i=e(i,n);for(var a=0,s=i.length;n!=null&&a<s;)n=n[t(i[a++])];return a&&a==s?n:void 0}return al=r,al}var sl,sd;function pA(){if(sd)return sl;sd=1;var e=ps();function t(){this.__data__=new e,this.size=0}return sl=t,sl}var ol,od;function dA(){if(od)return ol;od=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return ol=e,ol}var ll,ld;function gA(){if(ld)return ll;ld=1;function e(t){return this.__data__.get(t)}return ll=e,ll}var ul,ud;function mA(){if(ud)return ul;ud=1;function e(t){return this.__data__.has(t)}return ul=e,ul}var cl,cd;function yA(){if(cd)return cl;cd=1;var e=ps(),t=Sf(),r=Tf(),n=200;function i(a,s){var o=this.__data__;if(o instanceof e){var l=o.__data__;if(!t||l.length<n-1)return l.push([a,s]),this.size=++o.size,this;o=this.__data__=new r(l)}return o.set(a,s),this.size=o.size,this}return cl=i,cl}var fl,fd;function xy(){if(fd)return fl;fd=1;var e=ps(),t=pA(),r=dA(),n=gA(),i=mA(),a=yA();function s(o){var l=this.__data__=new e(o);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,fl=s,fl}var hl,hd;function _A(){if(hd)return hl;hd=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return hl=t,hl}var pl,pd;function vA(){if(pd)return pl;pd=1;function e(t){return this.__data__.has(t)}return pl=e,pl}var dl,dd;function xA(){if(dd)return dl;dd=1;var e=Tf(),t=_A(),r=vA();function n(i){var a=-1,s=i==null?0:i.length;for(this.__data__=new e;++a<s;)this.add(i[a])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,dl=n,dl}var gl,gd;function bA(){if(gd)return gl;gd=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(t[n],n,t))return!0;return!1}return gl=e,gl}var ml,md;function wA(){if(md)return ml;md=1;function e(t,r){return t.has(r)}return ml=e,ml}var yl,yd;function by(){if(yd)return yl;yd=1;var e=xA(),t=bA(),r=wA(),n=1,i=2;function a(s,o,l,u,c,f){var h=l&n,p=s.length,g=o.length;if(p!=g&&!(h&&g>p))return!1;var d=f.get(s),m=f.get(o);if(d&&m)return d==o&&m==s;var v=-1,y=!0,x=l&i?new e:void 0;for(f.set(s,o),f.set(o,s);++v<p;){var _=s[v],S=o[v];if(u)var w=h?u(S,_,v,o,s,f):u(_,S,v,s,o,f);if(w!==void 0){if(w)continue;y=!1;break}if(x){if(!t(o,function(b,T){if(!r(x,T)&&(_===b||c(_,b,l,u,f)))return x.push(T)})){y=!1;break}}else if(!(_===S||c(_,S,l,u,f))){y=!1;break}}return f.delete(s),f.delete(o),y}return yl=a,yl}var _l,_d;function SA(){if(_d)return _l;_d=1;var e=Cr(),t=e.Uint8Array;return _l=t,_l}var vl,vd;function TA(){if(vd)return vl;vd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i,a){n[++r]=[a,i]}),n}return vl=e,vl}var xl,xd;function MA(){if(xd)return xl;xd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i){n[++r]=i}),n}return xl=e,xl}var bl,bd;function AA(){if(bd)return bl;bd=1;var e=ca(),t=SA(),r=wf(),n=by(),i=TA(),a=MA(),s=1,o=2,l="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Map]",h="[object Number]",p="[object RegExp]",g="[object Set]",d="[object String]",m="[object Symbol]",v="[object ArrayBuffer]",y="[object DataView]",x=e?e.prototype:void 0,_=x?x.valueOf:void 0;function S(w,b,T,M,C,A,F){switch(T){case y:if(w.byteLength!=b.byteLength||w.byteOffset!=b.byteOffset)return!1;w=w.buffer,b=b.buffer;case v:return!(w.byteLength!=b.byteLength||!A(new t(w),new t(b)));case l:case u:case h:return r(+w,+b);case c:return w.name==b.name&&w.message==b.message;case p:case d:return w==b+"";case f:var E=i;case g:var N=M&s;if(E||(E=a),w.size!=b.size&&!N)return!1;var U=F.get(w);if(U)return U==b;M|=o,F.set(w,b);var P=n(E(w),E(b),M,C,A,F);return F.delete(w),P;case m:if(_)return _.call(w)==_.call(b)}return!1}return bl=S,bl}var wl,wd;function CA(){if(wd)return wl;wd=1;var e=gy(),t=cr();function r(n,i,a){var s=i(n);return t(n)?s:e(s,a(n))}return wl=r,wl}var Sl,Sd;function kA(){if(Sd)return Sl;Sd=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=0,s=[];++n<i;){var o=t[n];r(o,n,t)&&(s[a++]=o)}return s}return Sl=e,Sl}var Tl,Td;function RA(){if(Td)return Tl;Td=1;function e(){return[]}return Tl=e,Tl}var Ml,Md;function EA(){if(Md)return Ml;Md=1;var e=kA(),t=RA(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(o){return n.call(s,o)}))}:t;return Ml=a,Ml}var Al,Ad;function DA(){if(Ad)return Al;Ad=1;function e(t,r){for(var n=-1,i=Array(t);++n<t;)i[n]=r(n);return i}return Al=e,Al}var Fi={exports:{}},Cl,Cd;function OA(){if(Cd)return Cl;Cd=1;function e(){return!1}return Cl=e,Cl}Fi.exports;var kd;function wy(){return kd||(kd=1,(function(e,t){var r=Cr(),n=OA(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===i,o=s?r.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||n;e.exports=u})(Fi,Fi.exports)),Fi.exports}var kl,Rd;function Af(){if(Rd)return kl;Rd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<i}return kl=r,kl}var Rl,Ed;function Cf(){if(Ed)return Rl;Ed=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Rl=t,Rl}var El,Dd;function PA(){if(Dd)return El;Dd=1;var e=fa(),t=Cf(),r=ha(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",d="[object WeakMap]",m="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",w="[object Int32Array]",b="[object Uint8Array]",T="[object Uint8ClampedArray]",M="[object Uint16Array]",C="[object Uint32Array]",A={};A[y]=A[x]=A[_]=A[S]=A[w]=A[b]=A[T]=A[M]=A[C]=!0,A[n]=A[i]=A[m]=A[a]=A[v]=A[s]=A[o]=A[l]=A[u]=A[c]=A[f]=A[h]=A[p]=A[g]=A[d]=!1;function F(E){return r(E)&&t(E.length)&&!!A[e(E)]}return El=F,El}var Dl,Od;function Sy(){if(Od)return Dl;Od=1;function e(t){return function(r){return t(r)}}return Dl=e,Dl}var Ni={exports:{}};Ni.exports;var Pd;function FA(){return Pd||(Pd=1,(function(e,t){var r=cy(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,s=a&&r.process,o=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(Ni,Ni.exports)),Ni.exports}var Ol,Fd;function Ty(){if(Fd)return Ol;Fd=1;var e=PA(),t=Sy(),r=FA(),n=r&&r.isTypedArray,i=n?t(n):e;return Ol=i,Ol}var Pl,Nd;function NA(){if(Nd)return Pl;Nd=1;var e=DA(),t=xf(),r=cr(),n=wy(),i=Af(),a=Ty(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var f=r(u),h=!f&&t(u),p=!f&&!h&&n(u),g=!f&&!h&&!p&&a(u),d=f||h||p||g,m=d?e(u.length,String):[],v=m.length;for(var y in u)(c||o.call(u,y))&&!(d&&(y=="length"||p&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,v)))&&m.push(y);return m}return Pl=l,Pl}var Fl,$d;function $A(){if($d)return Fl;$d=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return Fl=t,Fl}var Nl,Ld;function LA(){if(Ld)return Nl;Ld=1;function e(t,r){return function(n){return t(r(n))}}return Nl=e,Nl}var $l,qd;function qA(){if(qd)return $l;qd=1;var e=LA(),t=e(Object.keys,Object);return $l=t,$l}var Ll,Id;function IA(){if(Id)return Ll;Id=1;var e=$A(),t=qA(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var s=[];for(var o in Object(a))n.call(a,o)&&o!="constructor"&&s.push(o);return s}return Ll=i,Ll}var ql,zd;function ms(){if(zd)return ql;zd=1;var e=yy(),t=Cf();function r(n){return n!=null&&t(n.length)&&!e(n)}return ql=r,ql}var Il,Bd;function ys(){if(Bd)return Il;Bd=1;var e=NA(),t=IA(),r=ms();function n(i){return r(i)?e(i):t(i)}return Il=n,Il}var zl,Ud;function zA(){if(Ud)return zl;Ud=1;var e=CA(),t=EA(),r=ys();function n(i){return e(i,r,t)}return zl=n,zl}var Bl,Hd;function BA(){if(Hd)return Bl;Hd=1;var e=zA(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,s,o,l,u,c){var f=o&t,h=e(a),p=h.length,g=e(s),d=g.length;if(p!=d&&!f)return!1;for(var m=p;m--;){var v=h[m];if(!(f?v in s:n.call(s,v)))return!1}var y=c.get(a),x=c.get(s);if(y&&x)return y==s&&x==a;var _=!0;c.set(a,s),c.set(s,a);for(var S=f;++m<p;){v=h[m];var w=a[v],b=s[v];if(l)var T=f?l(b,w,v,s,a,c):l(w,b,v,a,s,c);if(!(T===void 0?w===b||u(w,b,o,l,c):T)){_=!1;break}S||(S=v=="constructor")}if(_&&!S){var M=a.constructor,C=s.constructor;M!=C&&"constructor"in a&&"constructor"in s&&!(typeof M=="function"&&M instanceof M&&typeof C=="function"&&C instanceof C)&&(_=!1)}return c.delete(a),c.delete(s),_}return Bl=i,Bl}var Ul,Gd;function UA(){if(Gd)return Ul;Gd=1;var e=On(),t=Cr(),r=e(t,"DataView");return Ul=r,Ul}var Hl,jd;function HA(){if(jd)return Hl;jd=1;var e=On(),t=Cr(),r=e(t,"Promise");return Hl=r,Hl}var Gl,Yd;function GA(){if(Yd)return Gl;Yd=1;var e=On(),t=Cr(),r=e(t,"Set");return Gl=r,Gl}var jl,Xd;function jA(){if(Xd)return jl;Xd=1;var e=On(),t=Cr(),r=e(t,"WeakMap");return jl=r,jl}var Yl,Wd;function YA(){if(Wd)return Yl;Wd=1;var e=UA(),t=Sf(),r=HA(),n=GA(),i=jA(),a=fa(),s=_y(),o="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),g=s(t),d=s(r),m=s(n),v=s(i),y=a;return(e&&y(new e(new ArrayBuffer(1)))!=h||t&&y(new t)!=o||r&&y(r.resolve())!=u||n&&y(new n)!=c||i&&y(new i)!=f)&&(y=function(x){var _=a(x),S=_==l?x.constructor:void 0,w=S?s(S):"";if(w)switch(w){case p:return h;case g:return o;case d:return u;case m:return c;case v:return f}return _}),Yl=y,Yl}var Xl,Kd;function XA(){if(Kd)return Xl;Kd=1;var e=xy(),t=by(),r=AA(),n=BA(),i=YA(),a=cr(),s=wy(),o=Ty(),l=1,u="[object Arguments]",c="[object Array]",f="[object Object]",h=Object.prototype,p=h.hasOwnProperty;function g(d,m,v,y,x,_){var S=a(d),w=a(m),b=S?c:i(d),T=w?c:i(m);b=b==u?f:b,T=T==u?f:T;var M=b==f,C=T==f,A=b==T;if(A&&s(d)){if(!s(m))return!1;S=!0,M=!1}if(A&&!M)return _||(_=new e),S||o(d)?t(d,m,v,y,x,_):r(d,m,b,v,y,x,_);if(!(v&l)){var F=M&&p.call(d,"__wrapped__"),E=C&&p.call(m,"__wrapped__");if(F||E){var N=F?d.value():d,U=E?m.value():m;return _||(_=new e),x(N,U,v,y,_)}}return A?(_||(_=new e),n(d,m,v,y,x,_)):!1}return Xl=g,Xl}var Wl,Vd;function My(){if(Vd)return Wl;Vd=1;var e=XA(),t=ha();function r(n,i,a,s,o){return n===i?!0:n==null||i==null||!t(n)&&!t(i)?n!==n&&i!==i:e(n,i,a,s,r,o)}return Wl=r,Wl}var Kl,Zd;function WA(){if(Zd)return Kl;Zd=1;var e=xy(),t=My(),r=1,n=2;function i(a,s,o,l){var u=o.length,c=u,f=!l;if(a==null)return!c;for(a=Object(a);u--;){var h=o[u];if(f&&h[2]?h[1]!==a[h[0]]:!(h[0]in a))return!1}for(;++u<c;){h=o[u];var p=h[0],g=a[p],d=h[1];if(f&&h[2]){if(g===void 0&&!(p in a))return!1}else{var m=new e;if(l)var v=l(g,d,p,a,s,m);if(!(v===void 0?t(d,g,r|n,l,m):v))return!1}}return!0}return Kl=i,Kl}var Vl,Qd;function Ay(){if(Qd)return Vl;Qd=1;var e=ua();function t(r){return r===r&&!e(r)}return Vl=t,Vl}var Zl,Jd;function KA(){if(Jd)return Zl;Jd=1;var e=Ay(),t=ys();function r(n){for(var i=t(n),a=i.length;a--;){var s=i[a],o=n[s];i[a]=[s,o,e(o)]}return i}return Zl=r,Zl}var Ql,tg;function Cy(){if(tg)return Ql;tg=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Ql=e,Ql}var Jl,eg;function VA(){if(eg)return Jl;eg=1;var e=WA(),t=KA(),r=Cy();function n(i){var a=t(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(s){return s===i||e(s,i,a)}}return Jl=n,Jl}var tu,rg;function ZA(){if(rg)return tu;rg=1;var e=Mf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return tu=t,tu}var eu,ng;function QA(){if(ng)return eu;ng=1;function e(t,r){return t!=null&&r in Object(t)}return eu=e,eu}var ru,ig;function JA(){if(ig)return ru;ig=1;var e=vy(),t=xf(),r=cr(),n=Af(),i=Cf(),a=gs();function s(o,l,u){l=e(l,o);for(var c=-1,f=l.length,h=!1;++c<f;){var p=a(l[c]);if(!(h=o!=null&&u(o,p)))break;o=o[p]}return h||++c!=f?h:(f=o==null?0:o.length,!!f&&i(f)&&n(p,f)&&(r(o)||t(o)))}return ru=s,ru}var nu,ag;function tC(){if(ag)return nu;ag=1;var e=QA(),t=JA();function r(n,i){return n!=null&&t(n,i,e)}return nu=r,nu}var iu,sg;function eC(){if(sg)return iu;sg=1;var e=My(),t=ZA(),r=tC(),n=bf(),i=Ay(),a=Cy(),s=gs(),o=1,l=2;function u(c,f){return n(c)&&i(f)?a(s(c),f):function(h){var p=t(h,c);return p===void 0&&p===f?r(h,c):e(f,p,o|l)}}return iu=u,iu}var au,og;function _s(){if(og)return au;og=1;function e(t){return t}return au=e,au}var su,lg;function rC(){if(lg)return su;lg=1;function e(t){return function(r){return r==null?void 0:r[t]}}return su=e,su}var ou,ug;function nC(){if(ug)return ou;ug=1;var e=Mf();function t(r){return function(n){return e(n,r)}}return ou=t,ou}var lu,cg;function iC(){if(cg)return lu;cg=1;var e=rC(),t=nC(),r=bf(),n=gs();function i(a){return r(a)?e(n(a)):t(a)}return lu=i,lu}var uu,fg;function ky(){if(fg)return uu;fg=1;var e=VA(),t=eC(),r=_s(),n=cr(),i=iC();function a(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?t(s[0],s[1]):e(s):i(s)}return uu=a,uu}var cu,hg;function aC(){if(hg)return cu;hg=1;function e(t){return function(r,n,i){for(var a=-1,s=Object(r),o=i(r),l=o.length;l--;){var u=o[t?l:++a];if(n(s[u],u,s)===!1)break}return r}}return cu=e,cu}var fu,pg;function sC(){if(pg)return fu;pg=1;var e=aC(),t=e();return fu=t,fu}var hu,dg;function oC(){if(dg)return hu;dg=1;var e=sC(),t=ys();function r(n,i){return n&&e(n,i,t)}return hu=r,hu}var pu,gg;function lC(){if(gg)return pu;gg=1;var e=ms();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var s=i.length,o=n?s:-1,l=Object(i);(n?o--:++o<s)&&a(l[o],o,l)!==!1;);return i}}return pu=t,pu}var du,mg;function uC(){if(mg)return du;mg=1;var e=oC(),t=lC(),r=t(e);return du=r,du}var gu,yg;function Ry(){if(yg)return gu;yg=1;var e=uC(),t=ms();function r(n,i){var a=-1,s=t(n)?Array(n.length):[];return e(n,function(o,l,u){s[++a]=i(o,l,u)}),s}return gu=r,gu}var mu,_g;function cC(){if(_g)return mu;_g=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return mu=e,mu}var yu,vg;function fC(){if(vg)return yu;vg=1;var e=pa();function t(r,n){if(r!==n){var i=r!==void 0,a=r===null,s=r===r,o=e(r),l=n!==void 0,u=n===null,c=n===n,f=e(n);if(!u&&!f&&!o&&r>n||o&&l&&c&&!u&&!f||a&&l&&c||!i&&c||!s)return 1;if(!a&&!o&&!f&&r<n||f&&i&&s&&!a&&!o||u&&i&&s||!l&&s||!c)return-1}return 0}return yu=t,yu}var _u,xg;function hC(){if(xg)return _u;xg=1;var e=fC();function t(r,n,i){for(var a=-1,s=r.criteria,o=n.criteria,l=s.length,u=i.length;++a<l;){var c=e(s[a],o[a]);if(c){if(a>=u)return c;var f=i[a];return c*(f=="desc"?-1:1)}}return r.index-n.index}return _u=t,_u}var vu,bg;function pC(){if(bg)return vu;bg=1;var e=cs(),t=Mf(),r=ky(),n=Ry(),i=cC(),a=Sy(),s=hC(),o=_s(),l=cr();function u(c,f,h){f.length?f=e(f,function(d){return l(d)?function(m){return t(m,d.length===1?d[0]:d)}:d}):f=[o];var p=-1;f=e(f,a(r));var g=n(c,function(d,m,v){var y=e(f,function(x){return x(d)});return{criteria:y,index:++p,value:d}});return i(g,function(d,m){return s(d,m,h)})}return vu=u,vu}var xu,wg;function dC(){if(wg)return xu;wg=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return xu=e,xu}var bu,Sg;function gC(){if(Sg)return bu;Sg=1;var e=dC(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var s=arguments,o=-1,l=t(s.length-i,0),u=Array(l);++o<l;)u[o]=s[i+o];o=-1;for(var c=Array(i+1);++o<i;)c[o]=s[o];return c[i]=a(u),e(n,this,c)}}return bu=r,bu}var wu,Tg;function mC(){if(Tg)return wu;Tg=1;function e(t){return function(){return t}}return wu=e,wu}var Su,Mg;function yC(){if(Mg)return Su;Mg=1;var e=On(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Su=t,Su}var Tu,Ag;function _C(){if(Ag)return Tu;Ag=1;var e=mC(),t=yC(),r=_s(),n=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return Tu=n,Tu}var Mu,Cg;function vC(){if(Cg)return Mu;Cg=1;var e=800,t=16,r=Date.now;function n(i){var a=0,s=0;return function(){var o=r(),l=t-(o-s);if(s=o,l>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Mu=n,Mu}var Au,kg;function xC(){if(kg)return Au;kg=1;var e=_C(),t=vC(),r=t(e);return Au=r,Au}var Cu,Rg;function bC(){if(Rg)return Cu;Rg=1;var e=_s(),t=gC(),r=xC();function n(i,a){return r(t(i,a,e),i+"")}return Cu=n,Cu}var ku,Eg;function kf(){if(Eg)return ku;Eg=1;var e=wf(),t=ms(),r=Af(),n=ua();function i(a,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?t(o)&&r(s,o.length):l=="string"&&s in o)?e(o[s],a):!1}return ku=i,ku}var Ru,Dg;function wC(){if(Dg)return Ru;Dg=1;var e=my(),t=pC(),r=bC(),n=kf(),i=r(function(a,s){if(a==null)return[];var o=s.length;return o>1&&n(a,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(a,e(s,1),[])});return Ru=i,Ru}var SC=wC();const TC=yi(SC);var Eu,Og;function MC(){if(Og)return Eu;Og=1;function e(t){for(var r=-1,n=t==null?0:t.length,i={};++r<n;){var a=t[r];i[a[0]]=a[1]}return i}return Eu=e,Eu}var AC=MC();const Pg=yi(AC);var Du,Fg;function CC(){if(Fg)return Du;Fg=1;var e=Math.ceil,t=Math.max;function r(n,i,a,s){for(var o=-1,l=t(e((i-n)/(a||1)),0),u=Array(l);l--;)u[s?l:++o]=n,n+=a;return u}return Du=r,Du}var Ou,Ng;function kC(){if(Ng)return Ou;Ng=1;var e=CC(),t=kf(),r=hy();function n(i){return function(a,s,o){return o&&typeof o!="number"&&t(a,s,o)&&(s=o=void 0),a=r(a),s===void 0?(s=a,a=0):s=r(s),o=o===void 0?a<s?1:-1:r(o),e(a,s,o,i)}}return Ou=n,Ou}var Pu,$g;function RC(){if($g)return Pu;$g=1;var e=kC(),t=e();return Pu=t,Pu}var EC=RC();const DC=yi(EC);var Fu,Lg;function OC(){if(Lg)return Fu;Lg=1;var e=cs(),t=ky(),r=Ry(),n=cr();function i(a,s){var o=n(a)?e:r;return o(a,t(s,3))}return Fu=i,Fu}var Nu,qg;function PC(){if(qg)return Nu;qg=1;var e=my(),t=OC();function r(n,i){return e(t(n,i),1)}return Nu=r,Nu}var FC=PC();const NC=yi(FC);var $u,Ig;function Ey(){if(Ig)return $u;Ig=1;function e(t,r,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),r!==void 0&&(t=t>=r?t:r)),t}return $u=e,$u}var Lu,zg;function $C(){if(zg)return Lu;zg=1;function e(t,r){var n=-1,i=t.length;for(r||(r=Array(i));++n<i;)r[n]=t[n];return r}return Lu=e,Lu}var qu,Bg;function LC(){if(Bg)return qu;Bg=1;var e=Math.floor,t=Math.random;function r(n,i){return n+e(t()*(i-n+1))}return qu=r,qu}var Iu,Ug;function Dy(){if(Ug)return Iu;Ug=1;var e=LC();function t(r,n){var i=-1,a=r.length,s=a-1;for(n=n===void 0?a:n;++i<n;){var o=e(i,s),l=r[o];r[o]=r[i],r[i]=l}return r.length=n,r}return Iu=t,Iu}var zu,Hg;function qC(){if(Hg)return zu;Hg=1;var e=Ey(),t=$C(),r=Dy();function n(i,a){return r(t(i),e(a,0,i.length))}return zu=n,zu}var Bu,Gg;function IC(){if(Gg)return Bu;Gg=1;var e=cs();function t(r,n){return e(n,function(i){return r[i]})}return Bu=t,Bu}var Uu,jg;function zC(){if(jg)return Uu;jg=1;var e=IC(),t=ys();function r(n){return n==null?[]:e(n,t(n))}return Uu=r,Uu}var Hu,Yg;function BC(){if(Yg)return Hu;Yg=1;var e=Ey(),t=Dy(),r=zC();function n(i,a){var s=r(i);return t(s,e(a,0,s.length))}return Hu=n,Hu}var Gu,Xg;function UC(){if(Xg)return Gu;Xg=1;var e=qC(),t=BC(),r=cr(),n=kf(),i=py();function a(s,o,l){(l?n(s,o,l):o===void 0)?o=1:o=i(o);var u=r(s)?e:t;return u(s,o)}return Gu=a,Gu}var HC=UC();const GC=yi(HC),jC=e=>zM(e,14),Wg=e=>Object.values(e).reduce((t,r)=>t+r,0),YC=(e,t,r={})=>{const n=Object.assign({draw:!1},r);if(Object.values(e).length<1)throw new Error("vote distribution must contain at least one party");if(!Object.values(e).every(g=>typeof g=="number"&&g>=0))throw new Error("party vote counts must be non-negative integers");if(!Number.isInteger(t)||t<=0)throw new Error("seats must be a positive integer");if(typeof n.draw!="boolean")throw new Error("opt.draw must be a boolean");const i=Wg(e),a=Pg(Object.entries(e).map(([g,d])=>{const m=Math.max(t-Object.keys(e).length,0),v=Math.round(m*d/i);return[g,v]})),s=Pg(Object.entries(e).map(([g,d])=>{const m=t+Object.keys(e).length,v=Math.min(Math.round(m*d/i),t);return[g,v]})),o=NC(Object.entries(e).map(([g,d])=>{const m=a[g],v=s[g];return DC(m,v).map(y=>{const x=jC(d/(y+.5));return{party:g,quotient:x}})})),l=Wg(a),u=t-l,c=TC(o,({quotient:g})=>-g),f=c[u-1].quotient,h=c.filter(({quotient:g})=>g>f),p=c.filter(({quotient:g})=>g===f);if(h.length+p.length===u)h.push(...p);else{if(!n.draw)throw new Error("result is ambiguous, a draw would need to be made, but opt.draw is disabled");h.push(...GC(p,u-h.length))}return h.reduce((g,{party:d})=>(g[d]+=1,g),a)},ts=e=>Math.round(e*1e10)/1e10,XC=e=>e.reduce((t,r)=>t+r.seats,0),WC=e=>e.flat(),KC=(e,t,r)=>{const n=(Math.PI-r)/2,i=t/e+n-Math.PI;return{x:ts(e*Math.cos(i)),y:ts(e*Math.sin(i))}},Oy=(e,t,r,n)=>{const i=n*t*r/(e-t),a=1+n*(t-1)*t/2/(e-t);return i/a},Ci=(e,t,r,n)=>{const i=n/Math.PI*.7142857142857143;return Math.abs(Oy(e,t,r,n)*t/r-i)},VC=(e,t,r)=>{let n=Math.floor(Math.log(e)/Math.log(2))||1,i=Ci(e,n,t,r),a=0;for(Ci(e,n+1,t,r)<i&&(a=1),Ci(e,n-1,t,r)<i&&n>1&&(a=-1);Ci(e,n+a,t,r)<i&&n>0;)i=Ci(e,n+a,t,r),n+=a;return n},ZC=(e,t)=>{var i,a;let r,n;for(let s=0;s<e.length;s++)n=ts((t[s]||0)/(((i=e[s])==null?void 0:i.length)??1)),(!r||n<r)&&(r=n);for(let s=0;s<e.length;s++)if(n=ts((t[s]||0)/(((a=e[s])==null?void 0:a.length)??1)),n===r)return s;return 0},QC=(e,t,r)=>{const n=XC(e),i=VC(n,t,r),a=Oy(n,i,t,r);let s={};for(let h=1;h<=i;h++)s[h]=t-(h-1)*a;s=YC(s,n);const o=[];let l,u,c;for(let h=1;h<=i;h++){const p=[];l=t-(h-1)*a,u=r*l/((s[h]??1)-1||1);for(let g=0;g<=(s[h]??1)-1;g++)c={...KC(l,g*u,r),r:.4*a},p.push(c);o.push(p)}const f=Array(o.length).fill(0);for(const h of e)for(let p=0;p<h.seats;p++){const g=ZC(o,f),d=o[g],m=f[g]??0,v=d==null?void 0:d[m];v&&(v.fill=h.colour,v.party=String(h.id)),f[g]=m+1}return WC(o)},JC=e=>t=>e("circle",{cx:t.x,cy:t.y,r:t.r,fill:t.fill,class:t.party}),tk={seatCount:!1,arcAngle:180,hFunction:la},ek=(e,t={})=>{var m;const{seatCount:r,arcAngle:n,hFunction:i}=Object.assign({},tk,t);if(typeof r!="boolean")throw new Error("`seatCount` option must be a boolean");if(typeof i!="function")throw new Error("`hFunction` option must be a function");if(typeof n!="number"||n<=0||n>360)throw new Error("`arcAngle` option must be a number between 0 and 360");const a=n*Math.PI/180,s=20,o=QC(e,s,a),l=(((m=o[0])==null?void 0:m.r)??0)/.4||0,u=o.map(JC(i));r&&u.push(i("text",{x:0,y:0,"text-anchor":"middle",style:{"font-family":"Helvetica","font-size":.25*s+"px"},class:"seatNumber"},String(u.length)));const c=n<=180?s+l:s*(1+Math.sin((a-Math.PI)/2))+l,f=s+l,h=Math.max(c,f),p=n<=180?-s-l/2:-s*(1+Math.sin((a-Math.PI)/2))-l/2,g=i("defs",[ey(i),ry(i),ny(i)]);return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:[-s-l/2,p,2*s+l,h].join(",")},[g,...u])},rk={seatCount:!1,arcAngle:200,arcAngleFlexibility:5,radius:380,seatSize:4.5,minSeatSize:1.8,maxSeatSize:3,spacing:1.8,innerRadiusRatio:.6,showLabels:!0,hFunction:la},nk=(e,t={})=>{const r={...rk,...t},{arcAngle:n,arcAngleFlexibility:i,radius:a,seatSize:s,minSeatSize:o,maxSeatSize:l,spacing:u,innerRadiusRatio:c,showLabels:f,hFunction:h}=r,p=a*c,g=e.reduce((B,k)=>B+k.seats,0);let d={seatSize:s,arcAngle:n,score:-1};const m=n-i,v=n+i;for(let B=m;B<=v;B+=2.5){const k=B*Math.PI/180;for(let I=l;I>=o;I-=.1){const q=I*2,R=q*u,nt=Math.floor((a-p)/R);for(let Y=1;Y<=Math.min(nt,10);Y++){let Z=0;for(let lt=0;lt<Y;lt++){const rt=p+(lt+.5)*R,ft=q*u/rt,wt=Math.floor(k/ft);Z+=wt}if(Z>=g){const lt=g/Z,rt=(I-o)/(l-o),ft=(Z-g)/g,wt=ft<.15?1:ft<.3?.7:ft<.5?.4:.1,st=1-Math.abs(B-n)/i,_t=wt*.5+rt*.3+lt*.15+st*.05;_t>d.score&&(d={seatSize:I,arcAngle:B,rings:Y,score:_t})}}}}const y=d.seatSize,x=d.arcAngle,_=x*Math.PI/180,S=y*2,w=S*u,b=Math.floor((a-p)/w),T=[],M=-_/2-Math.PI/2,C=[];let A=0,F=[];for(let B=1;B<=b;B++){let k=0;const I=[];for(let q=0;q<B;q++){const R=p+(q+.5)*w,nt=S*u/R,Y=Math.floor(_/nt);I.push(Y),k+=Y}if(k>=g){A=B,F=I;break}}if(A>0)C.push(...F);else for(let B=0;B<b;B++){const k=p+(B+.5)*w,I=S*u/k,q=Math.floor(_/I);C.push(q)}for(let B=0;B<C.length;B++){const k=p+(B+.5)*w,I=C[B]??0;if(I>0){const q=_/I;for(let R=0;R<I;R++){const nt=M+(R+.5)*q,Y=Math.cos(nt)*k,Z=Math.sin(nt)*k;T.push({ring:B,index:R,angle:nt,x:Y,y:Z})}}}T.sort((B,k)=>{const I=B.angle-k.angle;return Math.abs(I)>.001?I:B.ring-k.ring});const E=[];let N=0;e.forEach(B=>{const k=[],I=Math.min(B.seats,T.length-N);let q=1/0,R=-1/0;for(let Y=0;Y<I&&N<T.length;Y++){const Z=T[N++];Z&&(q=Math.min(q,Z.angle),R=Math.max(R,Z.angle),Math.sqrt(Z.x*Z.x+Z.y*Z.y),k.push(h("circle",{fill:B.colour,stroke:B.colour,className:"circle seat-visual seat-hover-zone",transform:`translate(${Z.x}, ${Z.y})`,r:y,"data-party":B.name,"data-party-id":String(B.id),style:"pointer-events: all; cursor: pointer;"})))}const nt=k;E.push(h("g",{className:"party-group","data-party":B.name,style:"opacity: 1; outline: none;"},nt))});const U=h("g",{className:"arc-bg"},[h("circle",{className:"outer",cx:0,cy:0,fill:"#ffffff",r:a}),h("circle",{className:"inner",cx:0,cy:0,fill:"#ffffff",r:p})]),P=h("g",{className:"points-container"},E),O=f?h("g",{className:"label-container",mask:"url(#label-clip)",style:"pointer-events: none;"},[h("text",{className:"party_count",dy:"-0.05em",style:"font-size: 24vw; font-weight: bold; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"}),h("text",{className:"party_name",y:0,dy:"1em",style:"font-size: 6vw; font-weight: normal; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"})]):null,j=h("defs",[h("radialGradient",{id:"label-gradient"},[h("stop",{offset:"0%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"80%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"90%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"}),h("stop",{offset:"100%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0;"})]),h("mask",{id:"label-clip"},[h("circle",{fill:"url(#label-gradient)",r:p})]),ey(h),ry(h),ny(h)]),at=h("g",{className:"arc-container",transform:`translate(${a}, ${a})`},[U,P,O].filter(Boolean)),tt=_/2;let G;if(x<=180)G=a*Math.sin(tt)+y;else{const B=tt-Math.PI/2;G=a*(1+Math.sin(B))+y}const W=a+y,$=a*2,K=Math.max(G,W);return h("svg",{id:"chart-container","font-family":"Canva Sans Variable",viewBox:`0 0 ${$} ${K}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg"},[at,j])};function Py(e){return!e||!e.color?"#cccccc":e.color==="url(#hatchPattern)"?ei.COMPLETED:e.color==="url(#greyHatchPattern)"?Et.greyHatch.lines:e.color}function Rc(e,t){if(!e)return;const r=e.querySelectorAll(".party-group");r&&r.length>0&&r.forEach(n=>{if(!n)return;const i=n,a=i.getAttribute("data-party");t?a===t?i.style.opacity=Pe.animation.hoverOpacity.active:i.style.opacity=Pe.animation.hoverOpacity.dimmed:i.style.opacity="1"})}function Ec(e,t){e.forEach(r=>{const n=r,i=r.getAttribute("class")||"";t?i===t?(n.setAttribute("fill-opacity","1"),n.setAttribute("stroke-opacity","1")):(n.setAttribute("fill-opacity",Pe.animation.hoverOpacity.dimmed),n.setAttribute("stroke-opacity","0.2")):(n.setAttribute("fill-opacity","1"),n.setAttribute("stroke-opacity","1"))})}const ik=({containerRef:e,processedData:t,totalRepositories:r,arcAngle:n,useEnhanced:i,maxSeats:a,setHoveredData:s,activePartyName:o,setActivePartyName:l,chartConfig:u,seatSize:c,shouldAnimate:f=!1,animationDirection:h="left-to-right",onAnimationComplete:p})=>{Q.useEffect(()=>{if(!e.current||t.length===0)return;for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const g=r<=a?1:a/r,d=t.filter(w=>w.value>0).map(w=>{const b=r<=a?w.value:Math.max(1,Math.floor(w.value*g));return{id:String(w.id),name:w.label,seats:b,colour:w.color==="url(#hatchPattern)"?ei.COMPLETED:w.color}}),m=i?nk(d,{arcAngle:n,arcAngleFlexibility:u.arcAngleFlexibility,radius:u.radius,seatSize:c,minSeatSize:u.minSeatSize,maxSeatSize:u.maxSeatSize,spacing:u.spacing,innerRadiusRatio:u.innerRadiusRatio,showLabels:!0}):ek(d,{arcAngle:n});m.properties&&(m.properties.width="100%",m.properties.height="100%",m.properties.style="display: block; width: 100%; max-width: 100%; height: auto;",m.properties.preserveAspectRatio="xMidYMid meet");const v=kM(m),_=new DOMParser().parseFromString(v,"image/svg+xml").documentElement;if(!_)return;_.setAttribute("width","100%"),_.setAttribute("height","100%"),_.style.width="100%",_.style.height="auto",_.style.display="block",i?ak(_,d,t,s,o,l):sk(_,d,t,s,o,l);const S=()=>{if(s(null),l(null),i)Rc(_,null);else{const w=_.querySelectorAll("circle");Ec(w,null)}};return _&&_.addEventListener("mouseleave",S),e.current.appendChild(_),f&&_&&DM(_,n,u.radius,h,900,p),()=>{if(_&&_.removeEventListener("mouseleave",S),e.current)for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild)}},[t,r,n,i,a,s,o,l,e,u,c,f,h,p])};function ak(e,t,r,n,i,a){if(!e)return;const s=e.querySelectorAll(".seat-hover-zone"),o=e.querySelectorAll(".party-group circle.seat-visual");o&&o.length>0&&o.forEach(l=>{if(l){const u=l;u.style.stroke=Pe.colors.seatBorder,u.style.strokeWidth="0.5",u.setAttribute("fill-opacity","1"),u.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s&&s.length>0&&s.forEach(l=>{if(!l)return;const u=l.getAttribute("data-party"),c=l.getAttribute("data-party-id"),f=()=>{if(u&&u!==i){const h=t.find(p=>p.name===u||String(p.id)===c);if(h){const p=r.find(g=>g.label===h.name||String(g.id)===h.id);if(p){const g=Py(p);n({label:p.label||"Unknown",value:p.value||0,color:g}),a(h.name),Rc(e,h.name)}}}};l.addEventListener("mouseenter",f)}),i&&Rc(e,i)}function sk(e,t,r,n,i,a){if(!e)return;const s=e.querySelectorAll("circle");if(s&&s.length>0&&(s.forEach(o=>{if(o){const l=o;l.style.cursor="pointer",l.style.stroke=Pe.colors.seatBorder,l.style.strokeWidth="0.5",l.setAttribute("fill-opacity","1"),l.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s.forEach(o=>{if(!o)return;const l=o.getAttribute("class")||"",u=parseInt(l,10),c=t[u],f=()=>{if(c){const h=c.name;if(h&&h!==i){const p=r.find(g=>g.label===c.name||String(g.id)===c.id);if(p){const g=Py(p);n({label:p.label||"Unknown",value:p.value||0,color:g}),a(h),Ec(s,l)}}}};o.addEventListener("mouseenter",f)})),i){const o=t.find(l=>l.name===i);if(o){const l=t.indexOf(o);Ec(s,String(l))}}}const ju=Ii,Kg={[Hi]:ei.NOT_APPLICABLE,[Gi]:ei.NO_LST,[ji]:ei.DATA_MISSING},ki=(e,t,r)=>{if(e in Kg)return Kg[e];const n=r-1-t,i=ju.length,a=Math.floor(n/Math.max(1,r-1)*(i-1)),s=Math.min(Math.max(0,a),i-1);return ju[s]??ju[0]??"#000000"},Fy=({dataSeries:e,notApplicableRepositories:t,noLstRepositories:r,unavailableRepositories:n})=>{const{special:i,regular:a}=e.reduce((p,g,d)=>([Hi,Gi,ji].includes(g.label)?p.special.push({...g,originalIndex:d}):p.regular.push({...g,originalIndex:d}),p),{special:[],regular:[]}),s=a.reverse().map((p,g)=>({id:`measure-${g}`,label:p.label,value:p.value,color:ki(p.label,a.length-1-g,a.length)})),o=i.map((p,g)=>({id:p.label.toLowerCase().replace(" ","-"),label:p.label,value:p.value,color:ki(p.label,g,i.length)})),l=n,u={id:"no-lst",label:Gi,value:r,color:ki(Gi,0,1)},c={id:"data-missing",label:ji,value:l,color:ki(ji,0,1)},f={id:"n/a",label:Hi,value:t,color:ki(Hi,0,1)},h=[];return f.value>0&&h.push(f),u.value>0&&h.push(u),c.value>0&&h.push(c),h.push(...o),h.push(...s),h},Vg={"N/A":"Repos that aren't applicable to this migration.","No LST":"There are no LSTs for these repos.","Data Missing":"There is data missing in the LSTs."},ok=({dataSeries:e,totalRepositories:t,notApplicableRepositories:r,noLstRepositories:n,unavailableRepositories:i,arcAngle:a,useEnhanced:s=Pe.useEnhanced,showTable:o=!0,shouldAnimate:l=!1,animationDirection:u="left-to-right",onAnimationComplete:c})=>{const f=Q.useRef(null),[h,p]=Q.useState(null),[g,d]=Q.useState(null),v=Fy({dataSeries:e,notApplicableRepositories:r,noLstRepositories:n,unavailableRepositories:i}).map(b=>{const T=typeof b.color=="function"?b.color("arc"):b.color,M=typeof b.label=="function"?b.label("arc"):b.label;return{...b,color:T,label:M}}),y=a??df({repositoryCount:t}),x=gf({repositoryCount:t});ik({containerRef:f,processedData:v,totalRepositories:t,arcAngle:y,useEnhanced:s,maxSeats:Pe.maxSeats,setHoveredData:p,activePartyName:g,setActivePartyName:d,chartConfig:Pe.chartConfig,seatSize:x,shouldAnimate:l,animationDirection:u,onAnimationComplete:c});const _=v.map(b=>{const T=b.value/t*100,M=T>0&&T<1?"< 1":T.toFixed(0);return{id:String(b.id),label:b.label,value:b.value,percentage:M,color:b.color}}),S=t>Pe.maxSeats,w=S?Math.round(t/Pe.maxSeats):1;return D.jsxs(z.Stack,{sx:{width:"100%",alignItems:"center",gap:{xs:.5,sm:.75,md:1,lg:1},py:0,"@media (min-width: 1024px) and (max-width: 1225px)":{gap:.25}},children:[D.jsxs(z.Box,{className:"parliament-chart-container",sx:{position:"relative",width:"100%",minHeight:"200px",mb:{xs:.5,sm:.75,md:1},"@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"250px",mb:.25}},children:[D.jsx(z.Box,{className:"parliament-chart-svg-container",ref:f,sx:{width:"100%",height:"100%",position:"relative",display:"flex",justifyContent:"center",alignItems:"center","& svg":{width:"100%",height:"100%",maxWidth:"100%","@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"230px"}}}}),D.jsxs(z.Box,{className:"parliament-chart-tooltip",sx:{position:"absolute",bottom:"0%",left:"50%",transform:"translate(-50%, 0%)",pointerEvents:"none",textAlign:"center",zIndex:10,"@media (min-width: 1024px) and (max-width: 1225px)":{bottom:"5%"}},children:[h&&D.jsxs(Q.Fragment,{children:[D.jsx(z.Typography,{sx:{color:"text.secondary",mb:.3,fontSize:"clamp(0.75rem, 1.5vw, 0.85rem)",display:"block","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"0.7rem",mb:.2}},children:h.label}),D.jsxs(z.Typography,{sx:{fontWeight:"bold",color:h.color,lineHeight:1,fontSize:"clamp(1.1rem, 2.2vw, 1.3rem)","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"1rem"}},children:[h.value," ",h.value>1?"repos":"repo"]})]}),S&&D.jsxs(z.Box,{className:"parliament-chart-scaled-indicator",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,mt:h?.5:0,color:"text.secondary",fontSize:"clamp(0.65rem, 1.2vw, 0.72rem)"},children:[D.jsx(z.Box,{className:"parliament-chart-scaled-indicator-dot",sx:{width:8,height:8,borderRadius:"50%",backgroundColor:"#888888",flexShrink:0}}),D.jsxs(z.Typography,{variant:"caption",sx:{fontSize:"inherit",fontStyle:"italic"},children:["= ~",w," repos"]})]})]})]}),o&&D.jsx(z.Box,{className:"parliament-chart-data-table",sx:{width:"100%",display:"flex",justifyContent:"center","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>{p(null),d(null)},children:D.jsxs(z.Table,{"aria-label":"Repository categories summary",className:"parliament-chart-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[D.jsx("thead",{children:D.jsxs(z.TableRow,{children:[D.jsx(z.TableCell,{}),D.jsx(z.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"# of repos"}),D.jsx(z.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"% of org"})]})}),D.jsx("tbody",{children:_.map(b=>{const T=b.color==="url(#greyHatchPattern)"?Et.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Et.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Et.noLstHatch.lines:b.color;return D.jsxs(z.TableRow,{onMouseEnter:()=>{d(b.label),p({label:b.label,value:b.value,color:b.color==="url(#greyHatchPattern)"?Et.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Et.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Et.noLstHatch.lines:b.color})},sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:g===b.label?`${T}15`:"transparent","&:hover":{backgroundColor:`${T}15`}},children:[D.jsx(z.TableCell,{align:"center",sx:{width:20},children:D.jsx(z.Box,{sx:{width:12,height:12,backgroundColor:b.color==="url(#greyHatchPattern)"?Et.greyHatch.background:b.color==="url(#dataMissingHatchPattern)"?Et.dataMissingHatch.background:b.color==="url(#noLstHatchPattern)"?Et.noLstHatch.background:b.color,borderRadius:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:g===b.label?"scale(1.2)":"scale(1)",...b.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
47
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function mM(e,t,r,n){const a=n.schema,i=a.space==="svg"?!1:n.settings.omitOptionalTags;let s=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;a.space==="html"&&e.tagName==="svg"&&(n.schema=yf);const u=yM(n,e.properties),c=n.all(a.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=a,c&&(s=!1),(u||!i||!cM(e,t,r))&&(o.push("<",e.tagName,u?" "+u:""),s&&(a.space==="svg"||n.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(c),!s&&(!i||!xf(e,t,r))&&o.push("</"+e.tagName+">"),o.join("")}function yM(e,t){const r=[];let n=-1,a;if(t){for(a in t)if(t[a]!==null&&t[a]!==void 0){const i=_M(e,a,t[a]);i&&r.push(i)}}for(;++n<r.length;){const i=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&i!=='"'&&i!=="'"&&(r[n]+=" ")}return r.join("")}function _M(e,t,r){const n=Q0(e.schema,t),a=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=ta(n.attribute,Object.assign({},e.settings.characterReferences,{subset:Si.name[a][i]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?cT:hT)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(o=ta(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Si.unquoted[a][i]}))),o!==r&&(e.settings.quoteSmart&&Xh(r,s)>Xh(r,e.alternative)&&(s=e.alternative),o=s+ta(r,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Si.single:Si.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const xM=["<","&"];function uy(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:ta(e.value,Object.assign({},n.settings.characterReferences,{subset:xM}))}function vM(e,t,r,n){return n.settings.allowDangerousHtml?e.value:uy(e,t,r,n)}function bM(e,t,r,n){return n.all(e)}const wM=CT("type",{invalid:SM,unknown:TM,handlers:{comment:XT,doctype:WT,element:mM,raw:vM,root:bM,text:uy}});function SM(e){throw new Error("Expected node, not `"+e+"`")}function TM(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const MM={},AM={},CM=[];function kM(e,t){const r=MM,n=r.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:RM,all:EM,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||AT,characterReferences:r.characterReferences||AM,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?yf:J0,quote:n,alternative:a}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function RM(e,t,r){return wM(e,t,r,this)}function EM(e){const t=[],r=e&&e.children||CM;let n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}const Pe={arcAngle:180,maxSeats:200,useEnhanced:!0,chartConfig:{radius:220,seatSize:5,minSeatSize:4,maxSeatSize:18,spacing:1.1,innerRadiusRatio:.4,arcAngleFlexibility:5},colors:{emptySeats:"#f8f8f8",emptySeatsBorder:"#d8d8d8",seatBorder:"#fff"},animation:{transitionDuration:"0.2s",hoverOpacity:{active:"1",dimmed:"0.2",empty:"0.3"}},scaling:{enableScaling:!0,scaleThreshold:200}},ea={COMPLETED:ur.neoDigitalGreen[600],NOT_APPLICABLE:"url(#greyHatchPattern)",NO_LST:"url(#noLstHatchPattern)",DATA_MISSING:"url(#dataMissingHatchPattern)"},Ha="N/A",Ga="No LST",ja="Data Missing";function DM(e,t,r,n="left-to-right",a=900,i){Dt.prototype.transition=Ic;const s=t*Math.PI/180,o=-s/2-Math.PI/2,l=s/2-Math.PI/2;let u=e.querySelector("defs");u||(u=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.appendChild(u));const c="arc-sweep-clip";let f=u.querySelector(`#${c}`);f||(f=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),f.setAttribute("id",c),u.appendChild(f));const h=document.createElementNS("http://www.w3.org/2000/svg","path");f.innerHTML="",f.appendChild(h);const p=e.querySelector(".arc-container"),g=e.querySelector(".points-container");if(g&&p)if(g.setAttribute("clip-path",`url(#${c})`),n==="left-to-right"){const m=y=>{const v=r*1.5,_=Math.cos(y)*v,S=Math.sin(y)*v,w=Math.cos(l)*v,b=Math.sin(l)*v,T=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${v},${v} 0 ${T},1 ${w},${b} Z`};h.setAttribute("d",m(o)),Dt(h).transition().duration(a).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const v=o+(l-o)*y;h.setAttribute("d",m(v))}).on("end",()=>{i&&i(),setTimeout(()=>{g.removeAttribute("clip-path")},50)})}else{const m=y=>{const v=r*1.5,_=Math.cos(y)*v,S=Math.sin(y)*v,w=Math.cos(l)*v,b=Math.sin(l)*v,T=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${v},${v} 0 ${T},1 ${w},${b} Z`};h.setAttribute("d",m(l)),Dt(h).transition().duration(a).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const v=l-(l-o)*y;h.setAttribute("d",m(v))}).on("end",()=>{g.removeAttribute("clip-path"),i&&i()})}}var Ti=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vs,Zh;function cy(){if(Zh)return Vs;Zh=1;var e=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti;return Vs=e,Vs}var Zs,Qh;function kr(){if(Qh)return Zs;Qh=1;var e=cy(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Zs=r,Zs}var Qs,Jh;function OM(){if(Jh)return Qs;Jh=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Qs=t,Qs}var Js,tp;function PM(){if(tp)return Js;tp=1;var e=OM(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Js=r,Js}var to,ep;function ui(){if(ep)return to;ep=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return to=e,to}var eo,rp;function ci(){if(rp)return eo;rp=1;var e=kr(),t=e.Symbol;return eo=t,eo}var ro,np;function FM(){if(np)return ro;np=1;var e=ci(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function i(s){var o=r.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}return ro=i,ro}var no,ap;function NM(){if(ap)return no;ap=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return no=r,no}var ao,ip;function fi(){if(ip)return ao;ip=1;var e=ci(),t=FM(),r=NM(),n="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function s(o){return o==null?o===void 0?a:n:i&&i in Object(o)?t(o):r(o)}return ao=s,ao}var io,sp;function hi(){if(sp)return io;sp=1;function e(t){return t!=null&&typeof t=="object"}return io=e,io}var so,op;function pi(){if(op)return so;op=1;var e=fi(),t=hi(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return so=n,so}var oo,lp;function fy(){if(lp)return oo;lp=1;var e=PM(),t=ui(),r=pi(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=i.test(u);return f||s.test(u)?o(u.slice(2),f?2:8):a.test(u)?n:+u}return oo=l,oo}var lo,up;function hy(){if(up)return lo;up=1;var e=fy(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return lo=n,lo}var uo,cp;function py(){if(cp)return uo;cp=1;var e=hy();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return uo=t,uo}var co,fp;function cs(){if(fp)return co;fp=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=Array(a);++n<a;)i[n]=r(t[n],n,t);return i}return co=e,co}var fo,hp;function cr(){if(hp)return fo;hp=1;var e=Array.isArray;return fo=e,fo}var ho,pp;function $M(){if(pp)return ho;pp=1;var e=ci(),t=cs(),r=cr(),n=pi(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return t(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return ho=s,ho}var po,dp;function dy(){if(dp)return po;dp=1;var e=$M();function t(r){return r==null?"":e(r)}return po=t,po}var go,gp;function LM(){if(gp)return go;gp=1;var e=kr(),t=py(),r=fy(),n=dy(),a=e.isFinite,i=Math.min;function s(o){var l=Math[o];return function(u,c){if(u=r(u),c=c==null?0:i(t(c),292),c&&a(u)){var f=(n(u)+"e").split("e"),h=l(f[0]+"e"+(+f[1]+c));return f=(n(h)+"e").split("e"),+(f[0]+"e"+(+f[1]-c))}return l(u)}}return go=s,go}var mo,mp;function qM(){if(mp)return mo;mp=1;var e=LM(),t=e("round");return mo=t,mo}var IM=qM();const zM=ya(IM);var yo,yp;function gy(){if(yp)return yo;yp=1;function e(t,r){for(var n=-1,a=r.length,i=t.length;++n<a;)t[i+n]=r[n];return t}return yo=e,yo}var _o,_p;function BM(){if(_p)return _o;_p=1;var e=fi(),t=hi(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return _o=n,_o}var xo,xp;function vf(){if(xp)return xo;xp=1;var e=BM(),t=hi(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(s){return t(s)&&n.call(s,"callee")&&!a.call(s,"callee")};return xo=i,xo}var vo,vp;function UM(){if(vp)return vo;vp=1;var e=ci(),t=vf(),r=cr(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return vo=a,vo}var bo,bp;function my(){if(bp)return bo;bp=1;var e=gy(),t=UM();function r(n,a,i,s,o){var l=-1,u=n.length;for(i||(i=t),o||(o=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?r(c,a-1,i,s,o):e(o,c):s||(o[o.length]=c)}return o}return bo=r,bo}var wo,wp;function bf(){if(wp)return wo;wp=1;var e=cr(),t=pi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(e(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return wo=a,wo}var So,Sp;function yy(){if(Sp)return So;Sp=1;var e=fi(),t=ui(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==n||l==a||l==r||l==i}return So=s,So}var To,Tp;function HM(){if(Tp)return To;Tp=1;var e=kr(),t=e["__core-js_shared__"];return To=t,To}var Mo,Mp;function GM(){if(Mp)return Mo;Mp=1;var e=HM(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Mo=r,Mo}var Ao,Ap;function _y(){if(Ap)return Ao;Ap=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ao=r,Ao}var Co,Cp;function jM(){if(Cp)return Co;Cp=1;var e=yy(),t=GM(),r=ui(),n=_y(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||t(h))return!1;var p=e(h)?c:i;return p.test(n(h))}return Co=f,Co}var ko,kp;function YM(){if(kp)return ko;kp=1;function e(t,r){return t==null?void 0:t[r]}return ko=e,ko}var Ro,Rp;function On(){if(Rp)return Ro;Rp=1;var e=jM(),t=YM();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return Ro=r,Ro}var Eo,Ep;function fs(){if(Ep)return Eo;Ep=1;var e=On(),t=e(Object,"create");return Eo=t,Eo}var Do,Dp;function XM(){if(Dp)return Do;Dp=1;var e=fs();function t(){this.__data__=e?e(null):{},this.size=0}return Do=t,Do}var Oo,Op;function WM(){if(Op)return Oo;Op=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Oo=e,Oo}var Po,Pp;function KM(){if(Pp)return Po;Pp=1;var e=fs(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(e){var o=s[i];return o===t?void 0:o}return n.call(s,i)?s[i]:void 0}return Po=a,Po}var Fo,Fp;function VM(){if(Fp)return Fo;Fp=1;var e=fs(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return Fo=n,Fo}var No,Np;function ZM(){if(Np)return No;Np=1;var e=fs(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return No=r,No}var $o,$p;function QM(){if($p)return $o;$p=1;var e=XM(),t=WM(),r=KM(),n=VM(),a=ZM();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,$o=i,$o}var Lo,Lp;function JM(){if(Lp)return Lo;Lp=1;function e(){this.__data__=[],this.size=0}return Lo=e,Lo}var qo,qp;function wf(){if(qp)return qo;qp=1;function e(t,r){return t===r||t!==t&&r!==r}return qo=e,qo}var Io,Ip;function hs(){if(Ip)return Io;Ip=1;var e=wf();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return Io=t,Io}var zo,zp;function tA(){if(zp)return zo;zp=1;var e=hs(),t=Array.prototype,r=t.splice;function n(a){var i=this.__data__,s=e(i,a);if(s<0)return!1;var o=i.length-1;return s==o?i.pop():r.call(i,s,1),--this.size,!0}return zo=n,zo}var Bo,Bp;function eA(){if(Bp)return Bo;Bp=1;var e=hs();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return Bo=t,Bo}var Uo,Up;function rA(){if(Up)return Uo;Up=1;var e=hs();function t(r){return e(this.__data__,r)>-1}return Uo=t,Uo}var Ho,Hp;function nA(){if(Hp)return Ho;Hp=1;var e=hs();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Ho=t,Ho}var Go,Gp;function ps(){if(Gp)return Go;Gp=1;var e=JM(),t=tA(),r=eA(),n=rA(),a=nA();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Go=i,Go}var jo,jp;function Sf(){if(jp)return jo;jp=1;var e=On(),t=kr(),r=e(t,"Map");return jo=r,jo}var Yo,Yp;function aA(){if(Yp)return Yo;Yp=1;var e=QM(),t=ps(),r=Sf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Yo=n,Yo}var Xo,Xp;function iA(){if(Xp)return Xo;Xp=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Xo=e,Xo}var Wo,Wp;function ds(){if(Wp)return Wo;Wp=1;var e=iA();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Wo=t,Wo}var Ko,Kp;function sA(){if(Kp)return Ko;Kp=1;var e=ds();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Ko=t,Ko}var Vo,Vp;function oA(){if(Vp)return Vo;Vp=1;var e=ds();function t(r){return e(this,r).get(r)}return Vo=t,Vo}var Zo,Zp;function lA(){if(Zp)return Zo;Zp=1;var e=ds();function t(r){return e(this,r).has(r)}return Zo=t,Zo}var Qo,Qp;function uA(){if(Qp)return Qo;Qp=1;var e=ds();function t(r,n){var a=e(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return Qo=t,Qo}var Jo,Jp;function Tf(){if(Jp)return Jo;Jp=1;var e=aA(),t=sA(),r=oA(),n=lA(),a=uA();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Jo=i,Jo}var tl,td;function cA(){if(td)return tl;td=1;var e=Tf(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||e),i}return r.Cache=e,tl=r,tl}var el,ed;function fA(){if(ed)return el;ed=1;var e=cA(),t=500;function r(n){var a=e(n,function(s){return i.size===t&&i.clear(),s}),i=a.cache;return a}return el=r,el}var rl,rd;function hA(){if(rd)return rl;rd=1;var e=fA(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return rl=n,rl}var nl,nd;function xy(){if(nd)return nl;nd=1;var e=cr(),t=bf(),r=hA(),n=dy();function a(i,s){return e(i)?i:t(i,s)?[i]:r(n(i))}return nl=a,nl}var al,ad;function gs(){if(ad)return al;ad=1;var e=pi();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return al=t,al}var il,id;function Mf(){if(id)return il;id=1;var e=xy(),t=gs();function r(n,a){a=e(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[t(a[i++])];return i&&i==s?n:void 0}return il=r,il}var sl,sd;function pA(){if(sd)return sl;sd=1;var e=ps();function t(){this.__data__=new e,this.size=0}return sl=t,sl}var ol,od;function dA(){if(od)return ol;od=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return ol=e,ol}var ll,ld;function gA(){if(ld)return ll;ld=1;function e(t){return this.__data__.get(t)}return ll=e,ll}var ul,ud;function mA(){if(ud)return ul;ud=1;function e(t){return this.__data__.has(t)}return ul=e,ul}var cl,cd;function yA(){if(cd)return cl;cd=1;var e=ps(),t=Sf(),r=Tf(),n=200;function a(i,s){var o=this.__data__;if(o instanceof e){var l=o.__data__;if(!t||l.length<n-1)return l.push([i,s]),this.size=++o.size,this;o=this.__data__=new r(l)}return o.set(i,s),this.size=o.size,this}return cl=a,cl}var fl,fd;function vy(){if(fd)return fl;fd=1;var e=ps(),t=pA(),r=dA(),n=gA(),a=mA(),i=yA();function s(o){var l=this.__data__=new e(o);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=a,s.prototype.set=i,fl=s,fl}var hl,hd;function _A(){if(hd)return hl;hd=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return hl=t,hl}var pl,pd;function xA(){if(pd)return pl;pd=1;function e(t){return this.__data__.has(t)}return pl=e,pl}var dl,dd;function vA(){if(dd)return dl;dd=1;var e=Tf(),t=_A(),r=xA();function n(a){var i=-1,s=a==null?0:a.length;for(this.__data__=new e;++i<s;)this.add(a[i])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,dl=n,dl}var gl,gd;function bA(){if(gd)return gl;gd=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(t[n],n,t))return!0;return!1}return gl=e,gl}var ml,md;function wA(){if(md)return ml;md=1;function e(t,r){return t.has(r)}return ml=e,ml}var yl,yd;function by(){if(yd)return yl;yd=1;var e=vA(),t=bA(),r=wA(),n=1,a=2;function i(s,o,l,u,c,f){var h=l&n,p=s.length,g=o.length;if(p!=g&&!(h&&g>p))return!1;var d=f.get(s),m=f.get(o);if(d&&m)return d==o&&m==s;var x=-1,y=!0,v=l&a?new e:void 0;for(f.set(s,o),f.set(o,s);++x<p;){var _=s[x],S=o[x];if(u)var w=h?u(S,_,x,o,s,f):u(_,S,x,s,o,f);if(w!==void 0){if(w)continue;y=!1;break}if(v){if(!t(o,function(b,T){if(!r(v,T)&&(_===b||c(_,b,l,u,f)))return v.push(T)})){y=!1;break}}else if(!(_===S||c(_,S,l,u,f))){y=!1;break}}return f.delete(s),f.delete(o),y}return yl=i,yl}var _l,_d;function SA(){if(_d)return _l;_d=1;var e=kr(),t=e.Uint8Array;return _l=t,_l}var xl,xd;function TA(){if(xd)return xl;xd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,i){n[++r]=[i,a]}),n}return xl=e,xl}var vl,vd;function MA(){if(vd)return vl;vd=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return vl=e,vl}var bl,bd;function AA(){if(bd)return bl;bd=1;var e=ci(),t=SA(),r=wf(),n=by(),a=TA(),i=MA(),s=1,o=2,l="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Map]",h="[object Number]",p="[object RegExp]",g="[object Set]",d="[object String]",m="[object Symbol]",x="[object ArrayBuffer]",y="[object DataView]",v=e?e.prototype:void 0,_=v?v.valueOf:void 0;function S(w,b,T,M,k,C,O){switch(T){case y:if(w.byteLength!=b.byteLength||w.byteOffset!=b.byteOffset)return!1;w=w.buffer,b=b.buffer;case x:return!(w.byteLength!=b.byteLength||!C(new t(w),new t(b)));case l:case u:case h:return r(+w,+b);case c:return w.name==b.name&&w.message==b.message;case p:case d:return w==b+"";case f:var R=a;case g:var E=M&s;if(R||(R=i),w.size!=b.size&&!E)return!1;var H=O.get(w);if(H)return H==b;M|=o,O.set(w,b);var I=n(R(w),R(b),M,k,C,O);return O.delete(w),I;case m:if(_)return _.call(w)==_.call(b)}return!1}return bl=S,bl}var wl,wd;function CA(){if(wd)return wl;wd=1;var e=gy(),t=cr();function r(n,a,i){var s=a(n);return t(n)?s:e(s,i(n))}return wl=r,wl}var Sl,Sd;function kA(){if(Sd)return Sl;Sd=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=0,s=[];++n<a;){var o=t[n];r(o,n,t)&&(s[i++]=o)}return s}return Sl=e,Sl}var Tl,Td;function RA(){if(Td)return Tl;Td=1;function e(){return[]}return Tl=e,Tl}var Ml,Md;function EA(){if(Md)return Ml;Md=1;var e=kA(),t=RA(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(s){return s==null?[]:(s=Object(s),e(a(s),function(o){return n.call(s,o)}))}:t;return Ml=i,Ml}var Al,Ad;function DA(){if(Ad)return Al;Ad=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return Al=e,Al}var Fa={exports:{}},Cl,Cd;function OA(){if(Cd)return Cl;Cd=1;function e(){return!1}return Cl=e,Cl}Fa.exports;var kd;function wy(){return kd||(kd=1,(function(e,t){var r=kr(),n=OA(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,o=s?r.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||n;e.exports=u})(Fa,Fa.exports)),Fa.exports}var kl,Rd;function Af(){if(Rd)return kl;Rd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return kl=r,kl}var Rl,Ed;function Cf(){if(Ed)return Rl;Ed=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Rl=t,Rl}var El,Dd;function PA(){if(Dd)return El;Dd=1;var e=fi(),t=Cf(),r=hi(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",d="[object WeakMap]",m="[object ArrayBuffer]",x="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",w="[object Int32Array]",b="[object Uint8Array]",T="[object Uint8ClampedArray]",M="[object Uint16Array]",k="[object Uint32Array]",C={};C[y]=C[v]=C[_]=C[S]=C[w]=C[b]=C[T]=C[M]=C[k]=!0,C[n]=C[a]=C[m]=C[i]=C[x]=C[s]=C[o]=C[l]=C[u]=C[c]=C[f]=C[h]=C[p]=C[g]=C[d]=!1;function O(R){return r(R)&&t(R.length)&&!!C[e(R)]}return El=O,El}var Dl,Od;function Sy(){if(Od)return Dl;Od=1;function e(t){return function(r){return t(r)}}return Dl=e,Dl}var Na={exports:{}};Na.exports;var Pd;function FA(){return Pd||(Pd=1,(function(e,t){var r=cy(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,o=(function(){try{var l=a&&a.require&&a.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(Na,Na.exports)),Na.exports}var Ol,Fd;function Ty(){if(Fd)return Ol;Fd=1;var e=PA(),t=Sy(),r=FA(),n=r&&r.isTypedArray,a=n?t(n):e;return Ol=a,Ol}var Pl,Nd;function NA(){if(Nd)return Pl;Nd=1;var e=DA(),t=vf(),r=cr(),n=wy(),a=Af(),i=Ty(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var f=r(u),h=!f&&t(u),p=!f&&!h&&n(u),g=!f&&!h&&!p&&i(u),d=f||h||p||g,m=d?e(u.length,String):[],x=m.length;for(var y in u)(c||o.call(u,y))&&!(d&&(y=="length"||p&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||a(y,x)))&&m.push(y);return m}return Pl=l,Pl}var Fl,$d;function $A(){if($d)return Fl;$d=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return Fl=t,Fl}var Nl,Ld;function LA(){if(Ld)return Nl;Ld=1;function e(t,r){return function(n){return t(r(n))}}return Nl=e,Nl}var $l,qd;function qA(){if(qd)return $l;qd=1;var e=LA(),t=e(Object.keys,Object);return $l=t,$l}var Ll,Id;function IA(){if(Id)return Ll;Id=1;var e=$A(),t=qA(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var s=[];for(var o in Object(i))n.call(i,o)&&o!="constructor"&&s.push(o);return s}return Ll=a,Ll}var ql,zd;function ms(){if(zd)return ql;zd=1;var e=yy(),t=Cf();function r(n){return n!=null&&t(n.length)&&!e(n)}return ql=r,ql}var Il,Bd;function ys(){if(Bd)return Il;Bd=1;var e=NA(),t=IA(),r=ms();function n(a){return r(a)?e(a):t(a)}return Il=n,Il}var zl,Ud;function zA(){if(Ud)return zl;Ud=1;var e=CA(),t=EA(),r=ys();function n(a){return e(a,r,t)}return zl=n,zl}var Bl,Hd;function BA(){if(Hd)return Bl;Hd=1;var e=zA(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o,l,u,c){var f=o&t,h=e(i),p=h.length,g=e(s),d=g.length;if(p!=d&&!f)return!1;for(var m=p;m--;){var x=h[m];if(!(f?x in s:n.call(s,x)))return!1}var y=c.get(i),v=c.get(s);if(y&&v)return y==s&&v==i;var _=!0;c.set(i,s),c.set(s,i);for(var S=f;++m<p;){x=h[m];var w=i[x],b=s[x];if(l)var T=f?l(b,w,x,s,i,c):l(w,b,x,i,s,c);if(!(T===void 0?w===b||u(w,b,o,l,c):T)){_=!1;break}S||(S=x=="constructor")}if(_&&!S){var M=i.constructor,k=s.constructor;M!=k&&"constructor"in i&&"constructor"in s&&!(typeof M=="function"&&M instanceof M&&typeof k=="function"&&k instanceof k)&&(_=!1)}return c.delete(i),c.delete(s),_}return Bl=a,Bl}var Ul,Gd;function UA(){if(Gd)return Ul;Gd=1;var e=On(),t=kr(),r=e(t,"DataView");return Ul=r,Ul}var Hl,jd;function HA(){if(jd)return Hl;jd=1;var e=On(),t=kr(),r=e(t,"Promise");return Hl=r,Hl}var Gl,Yd;function GA(){if(Yd)return Gl;Yd=1;var e=On(),t=kr(),r=e(t,"Set");return Gl=r,Gl}var jl,Xd;function jA(){if(Xd)return jl;Xd=1;var e=On(),t=kr(),r=e(t,"WeakMap");return jl=r,jl}var Yl,Wd;function YA(){if(Wd)return Yl;Wd=1;var e=UA(),t=Sf(),r=HA(),n=GA(),a=jA(),i=fi(),s=_y(),o="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),g=s(t),d=s(r),m=s(n),x=s(a),y=i;return(e&&y(new e(new ArrayBuffer(1)))!=h||t&&y(new t)!=o||r&&y(r.resolve())!=u||n&&y(new n)!=c||a&&y(new a)!=f)&&(y=function(v){var _=i(v),S=_==l?v.constructor:void 0,w=S?s(S):"";if(w)switch(w){case p:return h;case g:return o;case d:return u;case m:return c;case x:return f}return _}),Yl=y,Yl}var Xl,Kd;function XA(){if(Kd)return Xl;Kd=1;var e=vy(),t=by(),r=AA(),n=BA(),a=YA(),i=cr(),s=wy(),o=Ty(),l=1,u="[object Arguments]",c="[object Array]",f="[object Object]",h=Object.prototype,p=h.hasOwnProperty;function g(d,m,x,y,v,_){var S=i(d),w=i(m),b=S?c:a(d),T=w?c:a(m);b=b==u?f:b,T=T==u?f:T;var M=b==f,k=T==f,C=b==T;if(C&&s(d)){if(!s(m))return!1;S=!0,M=!1}if(C&&!M)return _||(_=new e),S||o(d)?t(d,m,x,y,v,_):r(d,m,b,x,y,v,_);if(!(x&l)){var O=M&&p.call(d,"__wrapped__"),R=k&&p.call(m,"__wrapped__");if(O||R){var E=O?d.value():d,H=R?m.value():m;return _||(_=new e),v(E,H,x,y,_)}}return C?(_||(_=new e),n(d,m,x,y,v,_)):!1}return Xl=g,Xl}var Wl,Vd;function My(){if(Vd)return Wl;Vd=1;var e=XA(),t=hi();function r(n,a,i,s,o){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,i,s,r,o)}return Wl=r,Wl}var Kl,Zd;function WA(){if(Zd)return Kl;Zd=1;var e=vy(),t=My(),r=1,n=2;function a(i,s,o,l){var u=o.length,c=u,f=!l;if(i==null)return!c;for(i=Object(i);u--;){var h=o[u];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<c;){h=o[u];var p=h[0],g=i[p],d=h[1];if(f&&h[2]){if(g===void 0&&!(p in i))return!1}else{var m=new e;if(l)var x=l(g,d,p,i,s,m);if(!(x===void 0?t(d,g,r|n,l,m):x))return!1}}return!0}return Kl=a,Kl}var Vl,Qd;function Ay(){if(Qd)return Vl;Qd=1;var e=ui();function t(r){return r===r&&!e(r)}return Vl=t,Vl}var Zl,Jd;function KA(){if(Jd)return Zl;Jd=1;var e=Ay(),t=ys();function r(n){for(var a=t(n),i=a.length;i--;){var s=a[i],o=n[s];a[i]=[s,o,e(o)]}return a}return Zl=r,Zl}var Ql,tg;function Cy(){if(tg)return Ql;tg=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Ql=e,Ql}var Jl,eg;function VA(){if(eg)return Jl;eg=1;var e=WA(),t=KA(),r=Cy();function n(a){var i=t(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(s){return s===a||e(s,a,i)}}return Jl=n,Jl}var tu,rg;function ZA(){if(rg)return tu;rg=1;var e=Mf();function t(r,n,a){var i=r==null?void 0:e(r,n);return i===void 0?a:i}return tu=t,tu}var eu,ng;function QA(){if(ng)return eu;ng=1;function e(t,r){return t!=null&&r in Object(t)}return eu=e,eu}var ru,ag;function JA(){if(ag)return ru;ag=1;var e=xy(),t=vf(),r=cr(),n=Af(),a=Cf(),i=gs();function s(o,l,u){l=e(l,o);for(var c=-1,f=l.length,h=!1;++c<f;){var p=i(l[c]);if(!(h=o!=null&&u(o,p)))break;o=o[p]}return h||++c!=f?h:(f=o==null?0:o.length,!!f&&a(f)&&n(p,f)&&(r(o)||t(o)))}return ru=s,ru}var nu,ig;function tC(){if(ig)return nu;ig=1;var e=QA(),t=JA();function r(n,a){return n!=null&&t(n,a,e)}return nu=r,nu}var au,sg;function eC(){if(sg)return au;sg=1;var e=My(),t=ZA(),r=tC(),n=bf(),a=Ay(),i=Cy(),s=gs(),o=1,l=2;function u(c,f){return n(c)&&a(f)?i(s(c),f):function(h){var p=t(h,c);return p===void 0&&p===f?r(h,c):e(f,p,o|l)}}return au=u,au}var iu,og;function _s(){if(og)return iu;og=1;function e(t){return t}return iu=e,iu}var su,lg;function rC(){if(lg)return su;lg=1;function e(t){return function(r){return r==null?void 0:r[t]}}return su=e,su}var ou,ug;function nC(){if(ug)return ou;ug=1;var e=Mf();function t(r){return function(n){return e(n,r)}}return ou=t,ou}var lu,cg;function aC(){if(cg)return lu;cg=1;var e=rC(),t=nC(),r=bf(),n=gs();function a(i){return r(i)?e(n(i)):t(i)}return lu=a,lu}var uu,fg;function ky(){if(fg)return uu;fg=1;var e=VA(),t=eC(),r=_s(),n=cr(),a=aC();function i(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?t(s[0],s[1]):e(s):a(s)}return uu=i,uu}var cu,hg;function iC(){if(hg)return cu;hg=1;function e(t){return function(r,n,a){for(var i=-1,s=Object(r),o=a(r),l=o.length;l--;){var u=o[t?l:++i];if(n(s[u],u,s)===!1)break}return r}}return cu=e,cu}var fu,pg;function sC(){if(pg)return fu;pg=1;var e=iC(),t=e();return fu=t,fu}var hu,dg;function oC(){if(dg)return hu;dg=1;var e=sC(),t=ys();function r(n,a){return n&&e(n,a,t)}return hu=r,hu}var pu,gg;function lC(){if(gg)return pu;gg=1;var e=ms();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var s=a.length,o=n?s:-1,l=Object(a);(n?o--:++o<s)&&i(l[o],o,l)!==!1;);return a}}return pu=t,pu}var du,mg;function uC(){if(mg)return du;mg=1;var e=oC(),t=lC(),r=t(e);return du=r,du}var gu,yg;function Ry(){if(yg)return gu;yg=1;var e=uC(),t=ms();function r(n,a){var i=-1,s=t(n)?Array(n.length):[];return e(n,function(o,l,u){s[++i]=a(o,l,u)}),s}return gu=r,gu}var mu,_g;function cC(){if(_g)return mu;_g=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return mu=e,mu}var yu,xg;function fC(){if(xg)return yu;xg=1;var e=pi();function t(r,n){if(r!==n){var a=r!==void 0,i=r===null,s=r===r,o=e(r),l=n!==void 0,u=n===null,c=n===n,f=e(n);if(!u&&!f&&!o&&r>n||o&&l&&c&&!u&&!f||i&&l&&c||!a&&c||!s)return 1;if(!i&&!o&&!f&&r<n||f&&a&&s&&!i&&!o||u&&a&&s||!l&&s||!c)return-1}return 0}return yu=t,yu}var _u,vg;function hC(){if(vg)return _u;vg=1;var e=fC();function t(r,n,a){for(var i=-1,s=r.criteria,o=n.criteria,l=s.length,u=a.length;++i<l;){var c=e(s[i],o[i]);if(c){if(i>=u)return c;var f=a[i];return c*(f=="desc"?-1:1)}}return r.index-n.index}return _u=t,_u}var xu,bg;function pC(){if(bg)return xu;bg=1;var e=cs(),t=Mf(),r=ky(),n=Ry(),a=cC(),i=Sy(),s=hC(),o=_s(),l=cr();function u(c,f,h){f.length?f=e(f,function(d){return l(d)?function(m){return t(m,d.length===1?d[0]:d)}:d}):f=[o];var p=-1;f=e(f,i(r));var g=n(c,function(d,m,x){var y=e(f,function(v){return v(d)});return{criteria:y,index:++p,value:d}});return a(g,function(d,m){return s(d,m,h)})}return xu=u,xu}var vu,wg;function dC(){if(wg)return vu;wg=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return vu=e,vu}var bu,Sg;function gC(){if(Sg)return bu;Sg=1;var e=dC(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var s=arguments,o=-1,l=t(s.length-a,0),u=Array(l);++o<l;)u[o]=s[a+o];o=-1;for(var c=Array(a+1);++o<a;)c[o]=s[o];return c[a]=i(u),e(n,this,c)}}return bu=r,bu}var wu,Tg;function mC(){if(Tg)return wu;Tg=1;function e(t){return function(){return t}}return wu=e,wu}var Su,Mg;function yC(){if(Mg)return Su;Mg=1;var e=On(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Su=t,Su}var Tu,Ag;function _C(){if(Ag)return Tu;Ag=1;var e=mC(),t=yC(),r=_s(),n=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:r;return Tu=n,Tu}var Mu,Cg;function xC(){if(Cg)return Mu;Cg=1;var e=800,t=16,r=Date.now;function n(a){var i=0,s=0;return function(){var o=r(),l=t-(o-s);if(s=o,l>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Mu=n,Mu}var Au,kg;function vC(){if(kg)return Au;kg=1;var e=_C(),t=xC(),r=t(e);return Au=r,Au}var Cu,Rg;function bC(){if(Rg)return Cu;Rg=1;var e=_s(),t=gC(),r=vC();function n(a,i){return r(t(a,i,e),a+"")}return Cu=n,Cu}var ku,Eg;function kf(){if(Eg)return ku;Eg=1;var e=wf(),t=ms(),r=Af(),n=ui();function a(i,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?t(o)&&r(s,o.length):l=="string"&&s in o)?e(o[s],i):!1}return ku=a,ku}var Ru,Dg;function wC(){if(Dg)return Ru;Dg=1;var e=my(),t=pC(),r=bC(),n=kf(),a=r(function(i,s){if(i==null)return[];var o=s.length;return o>1&&n(i,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return Ru=a,Ru}var SC=wC();const TC=ya(SC);var Eu,Og;function MC(){if(Og)return Eu;Og=1;function e(t){for(var r=-1,n=t==null?0:t.length,a={};++r<n;){var i=t[r];a[i[0]]=i[1]}return a}return Eu=e,Eu}var AC=MC();const Pg=ya(AC);var Du,Fg;function CC(){if(Fg)return Du;Fg=1;var e=Math.ceil,t=Math.max;function r(n,a,i,s){for(var o=-1,l=t(e((a-n)/(i||1)),0),u=Array(l);l--;)u[s?l:++o]=n,n+=i;return u}return Du=r,Du}var Ou,Ng;function kC(){if(Ng)return Ou;Ng=1;var e=CC(),t=kf(),r=hy();function n(a){return function(i,s,o){return o&&typeof o!="number"&&t(i,s,o)&&(s=o=void 0),i=r(i),s===void 0?(s=i,i=0):s=r(s),o=o===void 0?i<s?1:-1:r(o),e(i,s,o,a)}}return Ou=n,Ou}var Pu,$g;function RC(){if($g)return Pu;$g=1;var e=kC(),t=e();return Pu=t,Pu}var EC=RC();const DC=ya(EC);var Fu,Lg;function OC(){if(Lg)return Fu;Lg=1;var e=cs(),t=ky(),r=Ry(),n=cr();function a(i,s){var o=n(i)?e:r;return o(i,t(s,3))}return Fu=a,Fu}var Nu,qg;function PC(){if(qg)return Nu;qg=1;var e=my(),t=OC();function r(n,a){return e(t(n,a),1)}return Nu=r,Nu}var FC=PC();const NC=ya(FC);var $u,Ig;function Ey(){if(Ig)return $u;Ig=1;function e(t,r,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),r!==void 0&&(t=t>=r?t:r)),t}return $u=e,$u}var Lu,zg;function $C(){if(zg)return Lu;zg=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return Lu=e,Lu}var qu,Bg;function LC(){if(Bg)return qu;Bg=1;var e=Math.floor,t=Math.random;function r(n,a){return n+e(t()*(a-n+1))}return qu=r,qu}var Iu,Ug;function Dy(){if(Ug)return Iu;Ug=1;var e=LC();function t(r,n){var a=-1,i=r.length,s=i-1;for(n=n===void 0?i:n;++a<n;){var o=e(a,s),l=r[o];r[o]=r[a],r[a]=l}return r.length=n,r}return Iu=t,Iu}var zu,Hg;function qC(){if(Hg)return zu;Hg=1;var e=Ey(),t=$C(),r=Dy();function n(a,i){return r(t(a),e(i,0,a.length))}return zu=n,zu}var Bu,Gg;function IC(){if(Gg)return Bu;Gg=1;var e=cs();function t(r,n){return e(n,function(a){return r[a]})}return Bu=t,Bu}var Uu,jg;function zC(){if(jg)return Uu;jg=1;var e=IC(),t=ys();function r(n){return n==null?[]:e(n,t(n))}return Uu=r,Uu}var Hu,Yg;function BC(){if(Yg)return Hu;Yg=1;var e=Ey(),t=Dy(),r=zC();function n(a,i){var s=r(a);return t(s,e(i,0,s.length))}return Hu=n,Hu}var Gu,Xg;function UC(){if(Xg)return Gu;Xg=1;var e=qC(),t=BC(),r=cr(),n=kf(),a=py();function i(s,o,l){(l?n(s,o,l):o===void 0)?o=1:o=a(o);var u=r(s)?e:t;return u(s,o)}return Gu=i,Gu}var HC=UC();const GC=ya(HC),jC=e=>zM(e,14),Wg=e=>Object.values(e).reduce((t,r)=>t+r,0),YC=(e,t,r={})=>{const n=Object.assign({draw:!1},r);if(Object.values(e).length<1)throw new Error("vote distribution must contain at least one party");if(!Object.values(e).every(g=>typeof g=="number"&&g>=0))throw new Error("party vote counts must be non-negative integers");if(!Number.isInteger(t)||t<=0)throw new Error("seats must be a positive integer");if(typeof n.draw!="boolean")throw new Error("opt.draw must be a boolean");const a=Wg(e),i=Pg(Object.entries(e).map(([g,d])=>{const m=Math.max(t-Object.keys(e).length,0),x=Math.round(m*d/a);return[g,x]})),s=Pg(Object.entries(e).map(([g,d])=>{const m=t+Object.keys(e).length,x=Math.min(Math.round(m*d/a),t);return[g,x]})),o=NC(Object.entries(e).map(([g,d])=>{const m=i[g],x=s[g];return DC(m,x).map(y=>{const v=jC(d/(y+.5));return{party:g,quotient:v}})})),l=Wg(i),u=t-l,c=TC(o,({quotient:g})=>-g),f=c[u-1].quotient,h=c.filter(({quotient:g})=>g>f),p=c.filter(({quotient:g})=>g===f);if(h.length+p.length===u)h.push(...p);else{if(!n.draw)throw new Error("result is ambiguous, a draw would need to be made, but opt.draw is disabled");h.push(...GC(p,u-h.length))}return h.reduce((g,{party:d})=>(g[d]+=1,g),i)},ts=e=>Math.round(e*1e10)/1e10,XC=e=>e.reduce((t,r)=>t+r.seats,0),WC=e=>e.flat(),KC=(e,t,r)=>{const n=(Math.PI-r)/2,a=t/e+n-Math.PI;return{x:ts(e*Math.cos(a)),y:ts(e*Math.sin(a))}},Oy=(e,t,r,n)=>{const a=n*t*r/(e-t),i=1+n*(t-1)*t/2/(e-t);return a/i},Ca=(e,t,r,n)=>{const a=n/Math.PI*.7142857142857143;return Math.abs(Oy(e,t,r,n)*t/r-a)},VC=(e,t,r)=>{let n=Math.floor(Math.log(e)/Math.log(2))||1,a=Ca(e,n,t,r),i=0;for(Ca(e,n+1,t,r)<a&&(i=1),Ca(e,n-1,t,r)<a&&n>1&&(i=-1);Ca(e,n+i,t,r)<a&&n>0;)a=Ca(e,n+i,t,r),n+=i;return n},ZC=(e,t)=>{var a,i;let r,n;for(let s=0;s<e.length;s++)n=ts((t[s]||0)/(((a=e[s])==null?void 0:a.length)??1)),(!r||n<r)&&(r=n);for(let s=0;s<e.length;s++)if(n=ts((t[s]||0)/(((i=e[s])==null?void 0:i.length)??1)),n===r)return s;return 0},QC=(e,t,r)=>{const n=XC(e),a=VC(n,t,r),i=Oy(n,a,t,r);let s={};for(let h=1;h<=a;h++)s[h]=t-(h-1)*i;s=YC(s,n);const o=[];let l,u,c;for(let h=1;h<=a;h++){const p=[];l=t-(h-1)*i,u=r*l/((s[h]??1)-1||1);for(let g=0;g<=(s[h]??1)-1;g++)c={...KC(l,g*u,r),r:.4*i},p.push(c);o.push(p)}const f=Array(o.length).fill(0);for(const h of e)for(let p=0;p<h.seats;p++){const g=ZC(o,f),d=o[g],m=f[g]??0,x=d==null?void 0:d[m];x&&(x.fill=h.colour,x.party=String(h.id)),f[g]=m+1}return WC(o)},JC=e=>t=>e("circle",{cx:t.x,cy:t.y,r:t.r,fill:t.fill,class:t.party}),tk={seatCount:!1,arcAngle:180,hFunction:li},ek=(e,t={})=>{var m;const{seatCount:r,arcAngle:n,hFunction:a}=Object.assign({},tk,t);if(typeof r!="boolean")throw new Error("`seatCount` option must be a boolean");if(typeof a!="function")throw new Error("`hFunction` option must be a function");if(typeof n!="number"||n<=0||n>360)throw new Error("`arcAngle` option must be a number between 0 and 360");const i=n*Math.PI/180,s=20,o=QC(e,s,i),l=(((m=o[0])==null?void 0:m.r)??0)/.4||0,u=o.map(JC(a));r&&u.push(a("text",{x:0,y:0,"text-anchor":"middle",style:{"font-family":"Helvetica","font-size":.25*s+"px"},class:"seatNumber"},String(u.length)));const c=n<=180?s+l:s*(1+Math.sin((i-Math.PI)/2))+l,f=s+l,h=Math.max(c,f),p=n<=180?-s-l/2:-s*(1+Math.sin((i-Math.PI)/2))-l/2,g=a("defs",[ey(a),ry(a),ny(a)]);return a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:[-s-l/2,p,2*s+l,h].join(",")},[g,...u])},rk={seatCount:!1,arcAngle:200,arcAngleFlexibility:5,radius:380,seatSize:4.5,minSeatSize:1.8,maxSeatSize:3,spacing:1.8,innerRadiusRatio:.6,showLabels:!0,hFunction:li},nk=(e,t={})=>{const r={...rk,...t},{arcAngle:n,arcAngleFlexibility:a,radius:i,seatSize:s,minSeatSize:o,maxSeatSize:l,spacing:u,innerRadiusRatio:c,showLabels:f,hFunction:h}=r,p=i*c,g=e.reduce((N,F)=>N+F.seats,0);let d={seatSize:s,arcAngle:n,score:-1};const m=n-a,x=n+a;for(let N=m;N<=x;N+=2.5){const F=N*Math.PI/180;for(let z=l;z>=o;z-=.1){const B=z*2,A=B*u,W=Math.floor((i-p)/A);for(let q=1;q<=Math.min(W,10);q++){let $=0;for(let lt=0;lt<q;lt++){const V=p+(lt+.5)*A,ut=B*u/V,vt=Math.floor(F/ut);$+=vt}if($>=g){const lt=g/$,V=(z-o)/(l-o),ut=($-g)/g,vt=ut<.15?1:ut<.3?.7:ut<.5?.4:.1,et=1-Math.abs(N-n)/a,mt=vt*.5+V*.3+lt*.15+et*.05;mt>d.score&&(d={seatSize:z,arcAngle:N,rings:q,score:mt})}}}}const y=d.seatSize,v=d.arcAngle,_=v*Math.PI/180,S=y*2,w=S*u,b=Math.floor((i-p)/w),T=[],M=-_/2-Math.PI/2,k=[];let C=0,O=[];for(let N=1;N<=b;N++){let F=0;const z=[];for(let B=0;B<N;B++){const A=p+(B+.5)*w,W=S*u/A,q=Math.floor(_/W);z.push(q),F+=q}if(F>=g){C=N,O=z;break}}if(C>0)k.push(...O);else for(let N=0;N<b;N++){const F=p+(N+.5)*w,z=S*u/F,B=Math.floor(_/z);k.push(B)}for(let N=0;N<k.length;N++){const F=p+(N+.5)*w,z=k[N]??0;if(z>0){const B=_/z;for(let A=0;A<z;A++){const W=M+(A+.5)*B,q=Math.cos(W)*F,$=Math.sin(W)*F;T.push({ring:N,index:A,angle:W,x:q,y:$})}}}T.sort((N,F)=>{const z=N.angle-F.angle;return Math.abs(z)>.001?z:N.ring-F.ring});const R=[];let E=0;e.forEach(N=>{const F=[],z=Math.min(N.seats,T.length-E);let B=1/0,A=-1/0;for(let q=0;q<z&&E<T.length;q++){const $=T[E++];$&&(B=Math.min(B,$.angle),A=Math.max(A,$.angle),Math.sqrt($.x*$.x+$.y*$.y),F.push(h("circle",{fill:N.colour,stroke:N.colour,className:"circle seat-visual seat-hover-zone",transform:`translate(${$.x}, ${$.y})`,r:y,"data-party":N.name,"data-party-id":String(N.id),style:"pointer-events: all; cursor: pointer;"})))}const W=F;R.push(h("g",{className:"party-group","data-party":N.name,style:"opacity: 1; outline: none;"},W))});const H=h("g",{className:"arc-bg"},[h("circle",{className:"outer",cx:0,cy:0,fill:"#ffffff",r:i}),h("circle",{className:"inner",cx:0,cy:0,fill:"#ffffff",r:p})]),I=h("g",{className:"points-container"},R),P=f?h("g",{className:"label-container",mask:"url(#label-clip)",style:"pointer-events: none;"},[h("text",{className:"party_count",dy:"-0.05em",style:"font-size: 24vw; font-weight: bold; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"}),h("text",{className:"party_name",y:0,dy:"1em",style:"font-size: 6vw; font-weight: normal; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"})]):null,j=h("defs",[h("radialGradient",{id:"label-gradient"},[h("stop",{offset:"0%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"80%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"90%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"}),h("stop",{offset:"100%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0;"})]),h("mask",{id:"label-clip"},[h("circle",{fill:"url(#label-gradient)",r:p})]),ey(h),ry(h),ny(h)]),tt=h("g",{className:"arc-container",transform:`translate(${i}, ${i})`},[H,I,P].filter(Boolean)),J=_/2;let Q;if(v<=180)Q=i*Math.sin(J)+y;else{const N=J-Math.PI/2;Q=i*(1+Math.sin(N))+y}const it=i+y,L=i*2,ot=Math.max(Q,it);return h("svg",{id:"chart-container","font-family":"Canva Sans Variable",viewBox:`0 0 ${L} ${ot}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg"},[tt,j])};function Py(e){return!e||!e.color?"#cccccc":e.color==="url(#hatchPattern)"?ea.COMPLETED:e.color==="url(#greyHatchPattern)"?Nt.greyHatch.lines:e.color}function Rc(e,t){if(!e)return;const r=e.querySelectorAll(".party-group");r&&r.length>0&&r.forEach(n=>{if(!n)return;const a=n,i=a.getAttribute("data-party");t?i===t?a.style.opacity=Pe.animation.hoverOpacity.active:a.style.opacity=Pe.animation.hoverOpacity.dimmed:a.style.opacity="1"})}function Ec(e,t){e.forEach(r=>{const n=r,a=r.getAttribute("class")||"";t?a===t?(n.setAttribute("fill-opacity","1"),n.setAttribute("stroke-opacity","1")):(n.setAttribute("fill-opacity",Pe.animation.hoverOpacity.dimmed),n.setAttribute("stroke-opacity","0.2")):(n.setAttribute("fill-opacity","1"),n.setAttribute("stroke-opacity","1"))})}const ak=({containerRef:e,processedData:t,totalRepositories:r,arcAngle:n,useEnhanced:a,maxSeats:i,setHoveredData:s,activePartyName:o,setActivePartyName:l,chartConfig:u,seatSize:c,shouldAnimate:f=!1,animationDirection:h="left-to-right",onAnimationComplete:p})=>{K.useEffect(()=>{if(!e.current||t.length===0)return;for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const g=r<=i?1:i/r,d=t.filter(w=>w.value>0).map(w=>{const b=r<=i?w.value:Math.max(1,Math.floor(w.value*g));return{id:String(w.id),name:w.label,seats:b,colour:w.color==="url(#hatchPattern)"?ea.COMPLETED:w.color}}),m=a?nk(d,{arcAngle:n,arcAngleFlexibility:u.arcAngleFlexibility,radius:u.radius,seatSize:c,minSeatSize:u.minSeatSize,maxSeatSize:u.maxSeatSize,spacing:u.spacing,innerRadiusRatio:u.innerRadiusRatio,showLabels:!0}):ek(d,{arcAngle:n});m.properties&&(m.properties.width="100%",m.properties.height="100%",m.properties.style="display: block; width: 100%; max-width: 100%; height: auto;",m.properties.preserveAspectRatio="xMidYMid meet");const x=kM(m),_=new DOMParser().parseFromString(x,"image/svg+xml").documentElement;if(!_)return;_.setAttribute("width","100%"),_.setAttribute("height","100%"),_.style.width="100%",_.style.height="auto",_.style.display="block",a?ik(_,d,t,s,o,l):sk(_,d,t,s,o,l);const S=()=>{if(s(null),l(null),a)Rc(_,null);else{const w=_.querySelectorAll("circle");Ec(w,null)}};return _&&_.addEventListener("mouseleave",S),e.current.appendChild(_),f&&_&&DM(_,n,u.radius,h,900,p),()=>{if(_&&_.removeEventListener("mouseleave",S),e.current)for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild)}},[t,r,n,a,i,s,o,l,e,u,c,f,h,p])};function ik(e,t,r,n,a,i){if(!e)return;const s=e.querySelectorAll(".seat-hover-zone"),o=e.querySelectorAll(".party-group circle.seat-visual");o&&o.length>0&&o.forEach(l=>{if(l){const u=l;u.style.stroke=Pe.colors.seatBorder,u.style.strokeWidth="0.5",u.setAttribute("fill-opacity","1"),u.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s&&s.length>0&&s.forEach(l=>{if(!l)return;const u=l.getAttribute("data-party"),c=l.getAttribute("data-party-id"),f=()=>{if(u&&u!==a){const h=t.find(p=>p.name===u||String(p.id)===c);if(h){const p=r.find(g=>g.label===h.name||String(g.id)===h.id);if(p){const g=Py(p);n({label:p.label||"Unknown",value:p.value||0,color:g}),i(h.name),Rc(e,h.name)}}}};l.addEventListener("mouseenter",f)}),a&&Rc(e,a)}function sk(e,t,r,n,a,i){if(!e)return;const s=e.querySelectorAll("circle");if(s&&s.length>0&&(s.forEach(o=>{if(o){const l=o;l.style.cursor="pointer",l.style.stroke=Pe.colors.seatBorder,l.style.strokeWidth="0.5",l.setAttribute("fill-opacity","1"),l.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s.forEach(o=>{if(!o)return;const l=o.getAttribute("class")||"",u=parseInt(l,10),c=t[u],f=()=>{if(c){const h=c.name;if(h&&h!==a){const p=r.find(g=>g.label===c.name||String(g.id)===c.id);if(p){const g=Py(p);n({label:p.label||"Unknown",value:p.value||0,color:g}),i(h),Ec(s,l)}}}};o.addEventListener("mouseenter",f)})),a){const o=t.find(l=>l.name===a);if(o){const l=t.indexOf(o);Ec(s,String(l))}}}const ju=Ia,Kg={[Ha]:ea.NOT_APPLICABLE,[Ga]:ea.NO_LST,[ja]:ea.DATA_MISSING},ka=(e,t,r)=>{if(e in Kg)return Kg[e];const n=r-1-t,a=ju.length,i=Math.floor(n/Math.max(1,r-1)*(a-1)),s=Math.min(Math.max(0,i),a-1);return ju[s]??ju[0]??"#000000"},Fy=({dataSeries:e,notApplicableRepositories:t,noLstRepositories:r,unavailableRepositories:n})=>{const{special:a,regular:i}=e.reduce((p,g,d)=>([Ha,Ga,ja].includes(g.label)?p.special.push({...g,originalIndex:d}):p.regular.push({...g,originalIndex:d}),p),{special:[],regular:[]}),s=i.reverse().map((p,g)=>({id:`measure-${g}`,label:p.label,value:p.value,color:ka(p.label,i.length-1-g,i.length)})),o=a.map((p,g)=>({id:p.label.toLowerCase().replace(" ","-"),label:p.label,value:p.value,color:ka(p.label,g,a.length)})),l=n,u={id:"no-lst",label:Ga,value:r,color:ka(Ga,0,1)},c={id:"data-missing",label:ja,value:l,color:ka(ja,0,1)},f={id:"n/a",label:Ha,value:t,color:ka(Ha,0,1)},h=[];return f.value>0&&h.push(f),u.value>0&&h.push(u),c.value>0&&h.push(c),h.push(...o),h.push(...s),h},Vg={"N/A":"Repos that aren't applicable to this migration.","No LST":"There are no LSTs for these repos.","Data Missing":"There is data missing in the LSTs."},ok=({dataSeries:e,totalRepositories:t,notApplicableRepositories:r,noLstRepositories:n,unavailableRepositories:a,arcAngle:i,useEnhanced:s=Pe.useEnhanced,showTable:o=!0,shouldAnimate:l=!1,animationDirection:u="left-to-right",onAnimationComplete:c})=>{const f=K.useRef(null),[h,p]=K.useState(null),[g,d]=K.useState(null),x=Fy({dataSeries:e,notApplicableRepositories:r,noLstRepositories:n,unavailableRepositories:a}).map(b=>{const T=typeof b.color=="function"?b.color("arc"):b.color,M=typeof b.label=="function"?b.label("arc"):b.label;return{...b,color:T,label:M}}),y=i??df({repositoryCount:t}),v=gf({repositoryCount:t});ak({containerRef:f,processedData:x,totalRepositories:t,arcAngle:y,useEnhanced:s,maxSeats:Pe.maxSeats,setHoveredData:p,activePartyName:g,setActivePartyName:d,chartConfig:Pe.chartConfig,seatSize:v,shouldAnimate:l,animationDirection:u,onAnimationComplete:c});const _=x.map(b=>{const T=b.value/t*100,M=T>0&&T<1?"< 1":T.toFixed(0);return{id:String(b.id),label:b.label,value:b.value,percentage:M,color:b.color}}),S=t>Pe.maxSeats,w=S?Math.round(t/Pe.maxSeats):1;return D.jsxs(U.Stack,{sx:{width:"100%",alignItems:"center",gap:{xs:.5,sm:.75,md:1,lg:1},py:0,"@media (min-width: 1024px) and (max-width: 1225px)":{gap:.25}},children:[D.jsxs(U.Box,{className:"parliament-chart-container",sx:{position:"relative",width:"100%",minHeight:"200px",mb:{xs:.5,sm:.75,md:1},"@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"250px",mb:.25}},children:[D.jsx(U.Box,{className:"parliament-chart-svg-container",ref:f,sx:{width:"100%",height:"100%",position:"relative",display:"flex",justifyContent:"center",alignItems:"center","& svg":{width:"100%",height:"100%",maxWidth:"100%","@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"230px"}}}}),D.jsxs(U.Box,{className:"parliament-chart-tooltip",sx:{position:"absolute",bottom:"0%",left:"50%",transform:"translate(-50%, 0%)",pointerEvents:"none",textAlign:"center",zIndex:10,"@media (min-width: 1024px) and (max-width: 1225px)":{bottom:"5%"}},children:[h&&D.jsxs(K.Fragment,{children:[D.jsx(U.Typography,{sx:{color:"text.secondary",mb:.3,fontSize:"clamp(0.75rem, 1.5vw, 0.85rem)",display:"block","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"0.7rem",mb:.2}},children:h.label}),D.jsxs(U.Typography,{sx:{fontWeight:"bold",color:h.color,lineHeight:1,fontSize:"clamp(1.1rem, 2.2vw, 1.3rem)","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"1rem"}},children:[h.value," ",h.value>1?"repos":"repo"]})]}),S&&D.jsxs(U.Box,{className:"parliament-chart-scaled-indicator",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,mt:h?.5:0,color:"text.secondary",fontSize:"clamp(0.65rem, 1.2vw, 0.72rem)"},children:[D.jsx(U.Box,{className:"parliament-chart-scaled-indicator-dot",sx:{width:8,height:8,borderRadius:"50%",backgroundColor:"#888888",flexShrink:0}}),D.jsxs(U.Typography,{variant:"caption",sx:{fontSize:"inherit",fontStyle:"italic"},children:["= ~",w," repos"]})]})]})]}),o&&D.jsx(U.Box,{className:"parliament-chart-data-table",sx:{width:"100%",display:"flex",justifyContent:"center","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>{p(null),d(null)},children:D.jsxs(U.Table,{"aria-label":"Repository categories summary",className:"parliament-chart-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[D.jsx("thead",{children:D.jsxs(U.TableRow,{children:[D.jsx(U.TableCell,{}),D.jsx(U.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"# of repos"}),D.jsx(U.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"% of org"})]})}),D.jsx("tbody",{children:_.map(b=>{const T=b.color==="url(#greyHatchPattern)"?Nt.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Nt.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Nt.noLstHatch.lines:b.color;return D.jsxs(U.TableRow,{onMouseEnter:()=>{d(b.label),p({label:b.label,value:b.value,color:b.color==="url(#greyHatchPattern)"?Nt.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Nt.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Nt.noLstHatch.lines:b.color})},sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:g===b.label?`${T}15`:"transparent","&:hover":{backgroundColor:`${T}15`}},children:[D.jsx(U.TableCell,{align:"center",sx:{width:20},children:D.jsx(U.Box,{sx:{width:12,height:12,backgroundColor:b.color==="url(#greyHatchPattern)"?Nt.greyHatch.background:b.color==="url(#dataMissingHatchPattern)"?Nt.dataMissingHatch.background:b.color==="url(#noLstHatchPattern)"?Nt.noLstHatch.background:b.color,borderRadius:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:g===b.label?"scale(1.2)":"scale(1)",...b.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
48
48
|
0deg,
|
|
49
49
|
transparent,
|
|
50
50
|
transparent 3px,
|
|
51
|
-
${
|
|
52
|
-
${
|
|
51
|
+
${Nt.greyHatch.lines} 3px,
|
|
52
|
+
${Nt.greyHatch.lines} 4px
|
|
53
53
|
)`,borderRadius:"50%"}},...b.label==="Data Missing"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
54
54
|
45deg,
|
|
55
55
|
transparent,
|
|
56
56
|
transparent 3px,
|
|
57
|
-
${
|
|
58
|
-
${
|
|
57
|
+
${Nt.dataMissingHatch.lines} 3px,
|
|
58
|
+
${Nt.dataMissingHatch.lines} 4px
|
|
59
59
|
)`,borderRadius:"50%"}},...b.label==="No LST"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
60
60
|
-45deg,
|
|
61
61
|
transparent,
|
|
62
62
|
transparent 3px,
|
|
63
|
-
${
|
|
64
|
-
${
|
|
65
|
-
)`,borderRadius:"50%"}}}})}),D.jsx(z.TableCell,{children:D.jsxs(z.Stack,{direction:"row",alignItems:"center",gap:.5,children:[D.jsx("span",{children:b.label}),Vg[b.label]&&D.jsx(z.Tooltip,{title:Vg[b.label],placement:"right",arrow:!0,children:D.jsx(Zg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),D.jsx(z.TableCell,{align:"right",children:b.value}),D.jsxs(z.TableCell,{align:"right",children:[b.percentage,"%"]})]},b.id)})})]})})]})},lk=({containerRef:e,data:t,categories:r,width:n,height:i,margin:a,timelineEvents:s=[],showTimeline:o=!0,timelineHeight:l=40,timelineOffset:u=35,timeRange:c,showGrid:f=!0,showAxes:h=!0,axisLabelColor:p,axisLabelSize:g=14,enableBrush:d=!1,onTimeRangeChange:m,minAllowedTime:v,maxAllowedTime:y,brushColor:x="#69b3a2",formatDate:_,formatValue:S,markers:w=[],onHoveredDataChange:b,hoveredCategory:T,onTimelineEventHover:M})=>{const[C,A]=Q.useState(null),[F,E]=Q.useState(null),[N,U]=Q.useState([]),P=Q.useRef(`sawt-${Math.random().toString(36).substr(2,9)}`),O=Q.useCallback(j=>{A(j),M==null||M(j)},[M]);return Q.useEffect(()=>{if(!e.current||t.length===0||r.length===0)return;const j=Ct(e.current),X=n-a.left-a.right,et=i-a.top-a.bottom,at=P.current;j.selectAll("*").remove();const tt=`main-chart-group main-chart-group-${at}`,G=j.append("g").attr("class",tt).attr("transform",`translate(${a.left},${a.top})`),W=`sawt-clip-${at}`;j.append("defs").append("clipPath").attr("id",W).append("rect").attr("x",0).attr("y",0).attr("width",X).attr("height",et);const $=G.append("g").attr("clip-path",`url(#${W})`),L=[...t.map(ot=>({timestamp:ot.timestamp,...ot.values}))].sort((ot,mt)=>ot.timestamp-mt.timestamp),B=r.map(ot=>ot.dataKey),k=Ki().keys(B),I=k(L),q=t.map(ot=>ot.timestamp),R=c?c[0]:Math.min(...q),nt=c?c[1]:Math.max(...q),Y=Kn().domain([new Date(R),new Date(nt)]).range([0,X]),Z=L.filter(ot=>ot.timestamp>=R&&ot.timestamp<=nt),lt=k(Z),rt=lt.length>0?Math.max(...lt[lt.length-1].map(ot=>ot[1]??0)):0,ft=ai().domain([0,rt*1.1]).range([et,0]).nice();f&&($.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qr(Y).ticks(6).tickSize(et).tickFormat(()=>"")),$.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(Ir(ft).ticks(5).tickSize(-X).tickFormat(()=>"")));const wt=ss().x(ot=>Y(new Date(ot.data.timestamp))).y0(ot=>ft(ot[0])).y1(ot=>ft(ot[1])).curve(Cn),st=$.append("g").attr("class","areas");I.forEach((ot,mt)=>{const yt=r[mt];if(!yt)return;const bt=T===yt.dataKey,Ut=T!=null;st.append("path").datum(ot).attr("class",`area area-${yt.dataKey}`).attr("fill",yt.color).attr("fill-opacity",Ut?bt?.9:.3:.7).attr("stroke",yt.color).attr("stroke-width",bt?2:1.5).attr("d",wt).on("mouseenter",()=>{const qt=Z[Z.length-1],$t=qt?qt[yt.dataKey]??0:0;b==null||b({label:yt.label,value:$t,color:yt.color})}).on("mouseleave",()=>{b==null||b(null)})});const _t=w.filter(ot=>ot.timestamp>=R&&ot.timestamp<=nt).map(ot=>({...ot,x:Y(new Date(ot.timestamp))}));U(ot=>ot.length!==_t.length||ot.some((mt,yt)=>{var bt,Ut;return mt.timestamp!==((bt=_t[yt])==null?void 0:bt.timestamp)||mt.x!==((Ut=_t[yt])==null?void 0:Ut.x)})?_t:ot);let Pt=null;if(_t.length>0&&(Pt=$.append("g").attr("class","markers"),_t.forEach(ot=>{Pt.append("line").attr("class","marker-line").attr("data-timestamp",ot.timestamp).attr("x1",ot.x).attr("x2",ot.x).attr("y1",0).attr("y2",et).attr("stroke",ot.color??"#131E7A").attr("stroke-width",2).attr("opacity",0)})),h){const mt=qr(Y).ticks(6).tickPadding(12);_&&mt.tickFormat(bt=>_(+bt)),G.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${et})`).call(mt).selectAll("text").attr("font-size",g).attr("fill",p??null);const yt=Ir(ft).ticks(5);yt.tickFormat(bt=>+bt==0?"":S?S(+bt):String(bt)),G.append("g").attr("class","axis axis-y").call(yt).selectAll("text").attr("font-size",g).attr("fill",p??null)}if(d&&m){const ot=gi().extent([[0,0],[X,et]]).on("end",yt=>{if(!yt.selection)return;const[bt,Ut]=yt.selection,qt=[+Y.invert(bt),+Y.invert(Ut)];v!==void 0&&(qt[0]=Math.max(qt[0],v)),y!==void 0&&(qt[1]=Math.min(qt[1],y)),m(qt),j.select(".brush").call(ot.move,null)}),mt=$.append("g").attr("class","brush").call(ot);mt.selectAll(".selection").attr("fill",x).attr("fill-opacity",.2).attr("stroke",x).attr("stroke-width",1),mt.selectAll(".handle").attr("fill",x).attr("fill-opacity",.8)}if(o&&Ja({svg:j,events:s,xScale:Y,chartHeight:et,chartWidth:X,timelineHeight:l,timelineOffset:u,instanceId:at,setHoveredTimelineEvent:O,enableBrush:d,onTimeRangeChange:m,minAllowedTime:v,maxAllowedTime:y,brushColor:x,mainGroupSelector:`.main-chart-group-${at}`}),_t.length>0&&Pt){let ot=null,mt;d?mt=$.select(".brush .overlay"):mt=G.append("rect").attr("class","marker-hover-overlay").attr("width",X).attr("height",et).attr("fill","none").attr("pointer-events","all");const yt=Pt,bt=qt=>{let $t=null,le=1/0;if(_t.forEach(Lt=>{const Zt=Math.abs(qt-Lt.x);Zt<le&&(le=Zt,$t=Lt)}),!$t||le>50)return ot!==null&&(ot=null,yt.selectAll(".marker-line").attr("opacity",0),E(null)),!1;const xt=$t;return ot===xt.timestamp||(ot=xt.timestamp,yt.selectAll(".marker-line").attr("opacity",0),yt.selectAll(".marker-line").filter(function(){return Ct(this).attr("data-timestamp")===String(xt.timestamp)}).attr("opacity",.6),E(xt)),!0},Ut=function(qt){const[$t]=en(qt,this);bt($t)};mt.on("mouseenter",Ut),mt.on("mousemove",Ut),mt.on("mouseleave",function(){ot=null,yt.selectAll(".marker-line").attr("opacity",0),E(null)})}return()=>{j.selectAll("*").remove()}},[e,t,r,n,i,a,s,o,l,u,c,f,h,p,g,d,m,v,y,x,_,S,w,b,T,O]),{hoveredTimelineEvent:C,hoveredMarker:F,visibleMarkers:N}},uk=({data:e,categories:t,timelineEvents:r=[],showTimeline:n=!0,timelineHeight:i=40,timelineOffset:a,width:s=900,height:o=400,margin:l={top:10,right:30,bottom:40,left:60},showGrid:u=!0,showAxes:c=!0,axisLabelColor:f,axisLabelSize:h=14,formatDate:p,formatValue:g,timeRange:d,enableBrush:m=!1,onTimeRangeChange:v,minAllowedTime:y,maxAllowedTime:x,brushColor:_="#69b3a2",markers:S=[],onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:T})=>{const M=Q.useRef(null),C=12,F=a??6+C+h+C,E=n?o+i+F:o,{hoveredTimelineEvent:N,hoveredMarker:U,visibleMarkers:P}=lk({containerRef:M,data:e,categories:t,width:s,height:o,margin:l,timelineEvents:r,showTimeline:n,timelineHeight:i,timelineOffset:F,timeRange:d,showGrid:u,showAxes:c,axisLabelColor:f,axisLabelSize:h,enableBrush:m,onTimeRangeChange:v,minAllowedTime:y,maxAllowedTime:x,brushColor:_,formatDate:p,formatValue:g,markers:S,onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:T});return D.jsxs(z.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:M,viewBox:`0 0 ${s} ${E}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),P.map(O=>{const j=(O.x+l.left)/s*100,X=l.top/E*100,et=new Date(O.timestamp),at=p?p(O.timestamp):et.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),tt=D.jsxs(z.Box,{children:[D.jsx(z.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:O.label?.5:0},children:at}),O.label&&D.jsx(z.Box,{sx:{color:"white",fontWeight:500},children:O.label})]});return D.jsx(z.Tooltip,{title:tt,open:(U==null?void 0:U.timestamp)===O.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(z.Box,{sx:{position:"absolute",left:`${j}%`,top:`${X}%`,width:"1px",height:`${(o-l.top-l.bottom)/E*100}%`,pointerEvents:"none"}})},O.timestamp)}),N&&n&&!U&&D.jsx(z.Tooltip,{title:D.jsxs(z.Box,{children:[D.jsx(z.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:p?p(N.timestamp):new Date(N.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),D.jsx(z.Box,{sx:{color:"white",fontWeight:500},children:N.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(z.Box,{sx:{position:"absolute",left:`${(N.x+l.left)/s*100}%`,top:`${(o+F+i/2)/E*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})})]})},xr={colors:{primary:"#992FB9",background:"#FFFFFF",border:"#9CA3AF",highlightBackground:"rgba(31, 41, 55, 0.14)",monthLabel:"#9ca3af",tooltipText:"#6b7280"},dimensions:{height:32,eventWidth:2}},ck=(e="#4B5563")=>({startHandle:{sx:{position:"absolute",left:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}},endHandle:{sx:{position:"absolute",right:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}}}),dr={header:{sx:{}},title:{sx:{m:0}},instructions:{sx:{color:"text.secondary",minHeight:"40px",display:"flex",alignItems:"center"}},monthLabelsContainer:{sx:{justifyContent:"space-between",px:1.25,height:"20px",fontSize:"11px",color:xr.colors.monthLabel,mb:1}},monthLabel:{sx:{fontSize:"11px"}},timeline:{sx:{position:"relative",height:`${xr.dimensions.height}px`,backgroundColor:xr.colors.background,borderRadius:0,overflow:"visible",border:`1px solid ${xr.colors.border}`}},event:{sx:{position:"absolute",top:0,width:`${xr.dimensions.eventWidth}px`,height:"100%",backgroundColor:xr.colors.primary,cursor:"pointer",transition:"transform 0.2s",transformOrigin:"center"}},selection:{sx:{position:"absolute",top:0,height:"100%",backgroundColor:xr.colors.highlightBackground,pointerEvents:"none"}},tooltip:{sx:{position:"absolute",bottom:"-40px",backgroundColor:"white",p:"6px 10px",borderRadius:.5,boxShadow:"0 2px 8px rgba(0,0,0,0.15)",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10,border:`1px solid ${xr.colors.border}`}},tooltipEventName:{sx:{fontWeight:600}},tooltipDate:{sx:{color:xr.colors.tooltipText,fontSize:"11px"}}},fk=(e="#9CA3AF")=>({startHandle:{sx:{position:"absolute",left:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}},endHandle:{sx:{position:"absolute",right:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}}}),hk=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},pk=({events:e,selectedRange:t,onSelectionChange:r,enableZoom:n,zoomToSelection:i,visibleRange:a,onVisibleRangeChange:s})=>{hk()&&e.length>1&&(e.every((K,L)=>L===0||K.timestamp>=e[L-1].timestamp)||console.warn("TimelineChart: events array should be sorted by timestamp for optimal performance and correct behavior."));const[o,l]=Q.useState(!1),[u,c]=Q.useState(null),[f,h]=Q.useState(null),[p,g]=Q.useState({start:null,end:null}),[d,m]=Q.useState({start:null,end:null}),[v,y]=Q.useState(null),x=Q.useRef(null),_=t??p,S=a??d,w=Q.useMemo(()=>{var $;return e.length>0?(($=e[0])==null?void 0:$.timestamp)??0:0},[e]),b=Q.useMemo(()=>{var $;return e.length>0?(($=e[e.length-1])==null?void 0:$.timestamp)??0:0},[e]),T=Q.useMemo(()=>i&&S.start&&S.end?S.start:w,[i,S,w]),M=Q.useMemo(()=>i&&S.start&&S.end?S.end:b,[i,S,b]),C=Q.useMemo(()=>M-T,[M,T]),A=Q.useMemo(()=>!n&&_.start!==null&&_.end!==null,[n,_]),F=Q.useCallback($=>C===0?0:($-T)/C*100,[T,C]),E=Q.useCallback(($,K)=>{const L=$/K*100;return T+L/100*C},[T,C]),N=Q.useCallback($=>{t===void 0&&g($),r==null||r($)},[t,r]),U=Q.useCallback($=>{const K=$.currentTarget.getBoundingClientRect(),L=$.clientX-K.left,B=E(L,K.width);l(!0),c(B),N({start:B,end:B})},[E,N]),P=Q.useCallback($=>{if(!o||u===null)return;const K=$.currentTarget.getBoundingClientRect(),L=$.clientX-K.left,B=E(L,K.width);if(f==="start"){const k=Math.min(B,_.end-C*.01);N({start:Math.max(k,T),end:_.end})}else if(f==="end"){const k=Math.max(B,_.start+C*.01);N({start:_.start,end:Math.min(k,M)})}else if(f==="body"){const k=B-u,I=_.end-_.start;let q=_.start+k,R=_.end+k;q<T&&(q=T,R=T+I),R>M&&(R=M,q=M-I),N({start:q,end:R}),c(B)}else N({start:Math.min(u,B),end:Math.max(u,B)})},[o,u,f,_,C,T,M,E,N]),O=Q.useCallback(()=>{const $=o;if(l(!1),h(null),$&&i&&_.start&&_.end&&_.start!==_.end){const K={start:_.start,end:_.end};a===void 0&&m(K),s==null||s(K)}},[o,i,_,a,s]);Q.useEffect(()=>{if(!o||u===null||!x.current)return;const $=L=>{const B=x.current;if(!B)return;const k=B.getBoundingClientRect(),I=L.clientX-k.left,q=E(I,k.width);if(f==="start"){const R=Math.min(q,_.end-C*.01);N({start:Math.max(R,T),end:_.end})}else if(f==="end"){const R=Math.max(q,_.start+C*.01);N({start:_.start,end:Math.min(R,M)})}else if(f==="body"){const R=q-u,nt=_.end-_.start;let Y=_.start+R,Z=_.end+R;Y<T&&(Y=T,Z=T+nt),Z>M&&(Z=M,Y=M-nt),N({start:Y,end:Z}),c(q)}else N({start:Math.min(u,q),end:Math.max(u,q)})},K=()=>{O()};return document.addEventListener("mousemove",$),document.addEventListener("mouseup",K),()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",K)}},[o,u,f,_,C,T,M,E,N,O]);const j=Q.useCallback($=>{$.stopPropagation(),_.start!==null&&(l(!0),c(_.start),h("start"))},[_]),X=Q.useCallback($=>{$.stopPropagation(),_.end!==null&&(l(!0),c(_.end),h("end"))},[_]),et=Q.useCallback($=>{$.stopPropagation();const K=x.current;if(!K)return;const L=K.getBoundingClientRect(),B=$.clientX-L.left,k=E(B,L.width);l(!0),c(k),h("body")},[E]),at=Q.useCallback($=>{if($.cancelable&&n&&$.preventDefault(),!n||!_.start||!_.end||C===0)return;const K=(_.start+_.end)/2,L=_.end-_.start,B=$.deltaY>0?1.1:.9,k=Math.max(L*B,C*.01),I=C*1.5,q=Math.min(k,I);let R=K-q/2,nt=K+q/2;R<T&&(R=T,nt=Math.min(T+q,M)),nt>M&&(nt=M,R=Math.max(M-q,T)),N({start:R,end:nt})},[n,_,C,T,M,N]),tt=Q.useCallback(()=>!_.start||!_.end?[]:e.filter($=>$.timestamp>=_.start&&$.timestamp<=_.end),[e,_]),G=Q.useCallback(()=>{const $={start:w,end:b};a===void 0&&m({start:null,end:null}),s==null||s($)},[w,b,a,s]),W=Q.useCallback(()=>{i&&G()},[i,G]);return{isDragging:o,dragStart:u,dragHandleType:f,internalSelectedRange:_,internalVisibleRange:S,hoveredEvent:v,minDate:T,maxDate:M,timeSpan:C,timelineContainerRef:x,getPositionFromTimestamp:F,getTimestampFromPosition:E,handleMouseDown:U,handleMouseMove:P,handleMouseUp:O,handleWheel:at,handleDoubleClick:W,handleStartHandleMouseDown:j,handleEndHandleMouseDown:X,handleSelectionBodyMouseDown:et,setHoveredEvent:y,getEventsInRange:tt,resetZoom:G,showHandles:A}},dk=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),gk=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),mk=e=>{const t=e/864e5;return t>60?r=>new Date(r).toLocaleDateString("en-US",{month:"short",year:"numeric"}):t>7?r=>new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric"}):r=>new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",hour12:!0})},yk=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},_k=(e,t="arrow",r)=>{const n=t==="grip"?fk(r||"#9CA3AF"):ck(r||"#4B5563");return{header:{...dr.header,...e==null?void 0:e.header},title:{...dr.title,...e==null?void 0:e.title},instructions:{...dr.instructions,...e==null?void 0:e.instructions},monthLabelsContainer:{...dr.monthLabelsContainer,...e==null?void 0:e.monthLabelsContainer},monthLabel:{...dr.monthLabel,...e==null?void 0:e.monthLabel},timeline:{...dr.timeline,...e==null?void 0:e.timeline},event:{...dr.event,...e==null?void 0:e.event},selection:{...dr.selection,...e==null?void 0:e.selection},startHandle:{...n.startHandle,...e==null?void 0:e.startHandle},endHandle:{...n.endHandle,...e==null?void 0:e.endHandle},tooltip:{...dr.tooltip,...e==null?void 0:e.tooltip},tooltipEventName:{...dr.tooltipEventName,...e==null?void 0:e.tooltipEventName},tooltipDate:{...dr.tooltipDate,...e==null?void 0:e.tooltipDate}}},vk=({events:e,onSelectionChange:t,selectedRange:r,height:n=xr.dimensions.height,margin:i={top:0,right:0,bottom:0,left:0},formatDate:a=dk,formatMonthYear:s=gk,showMonthLabels:o=!0,monthLabelCount:l=6,enableZoom:u=!0,dragHandleVariant:c="arrow",dragHandleColor:f,showHeader:h=!0,title:p="Event Timeline Selector",zoomToSelection:g=!1,visibleRange:d,onVisibleRangeChange:m,timeRange:v,onTimeRangeChange:y,slotProps:x})=>{const _=v?{start:v[0],end:v[1]}:d,S=y?$=>{$.start!==null&&$.end!==null&&y([$.start,$.end])}:m;yk()&&e.length>500&&console.warn(`TimelineChart: Rendering ${e.length} events may impact performance. Consider implementing virtualization or canvas rendering for datasets larger than 500 events.`);const w=Q.useMemo(()=>_k(x,c,f),[x,c,f]),{isDragging:b,dragHandleType:T,internalSelectedRange:M,hoveredEvent:C,minDate:A,timeSpan:F,timelineContainerRef:E,getPositionFromTimestamp:N,handleMouseDown:U,handleWheel:P,handleDoubleClick:O,handleStartHandleMouseDown:j,handleEndHandleMouseDown:X,handleSelectionBodyMouseDown:et,setHoveredEvent:at,getEventsInRange:tt,showHandles:G}=pk({events:e,selectedRange:r,onSelectionChange:t,enableZoom:u,zoomToSelection:g,visibleRange:_,onVisibleRangeChange:S}),W=M.start&&M.end?`Selected: ${a(M.start)} - ${a(M.end)} (${tt().length} events)`:"Click and drag on the timeline below to select a date range. Use mouse wheel to zoom in/out.";return D.jsxs(z.Stack,{sx:{width:"100%"},children:[h&&D.jsxs(z.Stack,{spacing:1,sx:{mb:3},...w.header,children:[D.jsx(z.Typography,{variant:"h5",...w.title,children:p}),D.jsx(z.Typography,{variant:"body2",...w.instructions,children:W})]}),o&&D.jsx(z.Stack,{direction:"row",...w.monthLabelsContainer,sx:{...w.monthLabelsContainer.sx,paddingLeft:`${i.left}px`,paddingRight:`${i.right}px`},children:Array.from({length:l},($,K)=>{const L=A+F/(l-1)*K,B=mk(F);return D.jsx(z.Typography,{variant:"caption",...w.monthLabel,children:B(L)},K)})}),D.jsxs(z.Box,{...w.timeline,sx:{...w.timeline.sx,height:`${n}px`,paddingLeft:`${i.left}px`,paddingRight:`${i.right}px`},children:[D.jsx(z.Box,{sx:{position:"absolute",top:i.top,left:0,right:0,bottom:i.bottom},children:e.map(($,K)=>{const L=N($.timestamp);return D.jsx(z.Box,{onMouseEnter:()=>at($),onMouseLeave:()=>at(null),"aria-label":`Event: ${$.eventName} at ${a($.timestamp)}`,...w.event,sx:{...w.event.sx,left:`${L}%`,transform:(C==null?void 0:C.timestamp)===$.timestamp?"scaleX(2)":"scaleX(1)"}},`${$.timestamp}-${K}`)})}),M.start&&M.end&&(!g||b)&&D.jsx(z.Box,{...w.selection,onMouseDown:G&&!b?et:void 0,sx:{...w.selection.sx,left:`${N(M.start)}%`,width:`${N(M.end)-N(M.start)}%`,pointerEvents:G?"all":"none",zIndex:2,cursor:G&&!b?T==="body"?"grabbing":"grab":"default"},children:G&&!(b&&T===null)&&D.jsxs(D.Fragment,{children:[D.jsx(z.Box,{...w.startHandle,onMouseDown:j,sx:{...w.startHandle.sx,cursor:"ew-resize",opacity:b&&T!=="start"?.5:1},"aria-label":"Drag to adjust start of selection"}),D.jsx(z.Box,{...w.endHandle,onMouseDown:X,sx:{...w.endHandle.sx,cursor:"ew-resize",opacity:b&&T!=="end"?.5:1},"aria-label":"Drag to adjust end of selection"})]})}),D.jsx(z.Box,{ref:E,role:"application","aria-label":"Interactive timeline - click and drag to select date range","aria-describedby":h?void 0:"timeline-instructions",tabIndex:0,sx:{position:"absolute",top:0,left:0,right:0,height:"100%",cursor:"crosshair",pointerEvents:"all",zIndex:1},onMouseDown:U,onWheel:P,onDoubleClick:O}),!h&&D.jsx("span",{id:"timeline-instructions",style:{display:"none"},children:W}),C&&D.jsxs(z.Box,{role:"tooltip","aria-live":"polite",...w.tooltip,sx:{...w.tooltip.sx,left:`${N(C.timestamp)}%`,transform:"translateX(-50%)"},children:[D.jsx(z.Typography,{variant:"body2",...w.tooltipEventName,children:C.eventName}),D.jsx(z.Typography,{variant:"caption",...w.tooltipDate,children:a(C.timestamp)})]})]})]})},xk="#8b5cf6",bk=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),wk=({events:e,title:t="Events in Selected Range",maxHeight:r="200px",formatDate:n=bk,primaryColor:i=xk})=>e.length===0?null:D.jsxs("div",{style:{marginTop:"24px",padding:"20px",backgroundColor:"#f9fafb",borderRadius:"8px",border:"1px solid #e5e7eb"},children:[D.jsxs("h3",{style:{margin:"0 0 12px 0",fontSize:"16px",color:"#374151"},children:[t," (",e.length,")"]}),D.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"8px",maxHeight:r,overflowY:"auto"},children:e.map((a,s)=>D.jsxs("div",{style:{padding:"8px 12px",backgroundColor:"white",borderRadius:"4px",fontSize:"13px",border:"1px solid #e5e7eb"},children:[D.jsx("div",{style:{fontWeight:500,color:i},children:a.eventName}),D.jsx("div",{style:{color:"#6b7280",fontSize:"12px",marginTop:"2px"},children:n(a.timestamp)})]},`${a.timestamp}-${s}`))})]});function Sk(e,t){const r=t-1-e,n=Ii.length,i=Math.floor(r/Math.max(1,t-1)*(n-1)),a=Math.min(Math.max(0,i),n-1);return Ii[a]??Ii[0]??"#000000"}function Ny(e){return Array.from({length:e},(t,r)=>Sk(r,e))}const Hn=Ny(5),Pr={critical:"#dc3545",high:"#fd7e14",medium:"#ffc107",low:"#17a2b8",complete:ur.neoDigitalGreen[600],inProgress:"#007bff",farthest:Hn[0],far:Hn[1],close:Hn[2],closest:Hn[3],completed:Hn[4],primary:"#007bff",secondary:"#6c757d",success:ur.neoDigitalGreen[600],danger:"#dc3545",warning:"#ffc107",info:"#17a2b8",light:ur.neoGrey[200],dark:"#343a40"},Tk={migration:Hn,severity:[Pr.critical,Pr.high,Pr.medium,Pr.low,Pr.info],status:[Pr.danger,Pr.warning,Pr.success],extended:["#e74c3c","#e67e22","#f39c12","#2ecc71","#3498db","#9b59b6","#1abc9c","#95a5a6"],colorblindSafe:["#0173B2","#DE8F05","#029E73","#CC78BC","#CA9161","#FBAFE4","#949494","#ECE133"]},Mk={FARTHEST:"Farthest",FAR:"Far",CLOSE:"Close",CLOSEST:"Closest",COMPLETE:"Complete",CRITICAL:"Critical",HIGH:"High",MEDIUM:"Medium",LOW:"Low",INFO:"Info",NOT_APPLICABLE:"N/A",NO_LST:"No LST",DATA_MISSING:"Data Missing"};exports.CAMPAIGN_DATA_MISSING=ji;exports.CAMPAIGN_NOT_APPLICABLE=Hi;exports.CAMPAIGN_NO_LST=Gi;exports.CATEGORY_LABELS=Mk;exports.ChronoChart=iy;exports.ChronoPerspectiveChart=iy;exports.D3StackedAreaChart=ST;exports.D3StackedBarChart=MT;exports.DEFAULT_CHART_COLORS=ur;exports.DEFAULT_CHART_CONFIG=Pe;exports.DEFAULT_STACKED_AREA_COLORS=Pr;exports.MEASURE_GRADIENT_COLORS=Ii;exports.MODERNE_VULNERABILITY_COLORS=ei;exports.MorphChart=H0;exports.ParliamentChart=ok;exports.STACKED_AREA_PALETTES=Tk;exports.StackedAreaWithTimeline=uk;exports.TimelineChart=vk;exports.TimelineSelectedEvents=wk;exports.calculateDataSeries=Fy;exports.calculateOptimalArcAngle=df;exports.calculateOptimalSeatSize=gf;exports.generateMeasureGradient=Ny;
|
|
63
|
+
${Nt.noLstHatch.lines} 3px,
|
|
64
|
+
${Nt.noLstHatch.lines} 4px
|
|
65
|
+
)`,borderRadius:"50%"}}}})}),D.jsx(U.TableCell,{children:D.jsxs(U.Stack,{direction:"row",alignItems:"center",gap:.5,children:[D.jsx("span",{children:b.label}),Vg[b.label]&&D.jsx(U.Tooltip,{title:Vg[b.label],placement:"right",arrow:!0,children:D.jsx(Zg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),D.jsx(U.TableCell,{align:"right",children:b.value}),D.jsxs(U.TableCell,{align:"right",children:[b.percentage,"%"]})]},b.id)})})]})})]})},lk=({containerRef:e,data:t,categories:r,width:n,height:a,margin:i,timelineEvents:s=[],showTimeline:o=!0,timelineHeight:l=40,timelineOffset:u=35,timeRange:c,showGrid:f=!0,showAxes:h=!0,axisLabelColor:p,axisLabelSize:g=14,enableBrush:d=!1,onTimeRangeChange:m,minAllowedTime:x,maxAllowedTime:y,brushColor:v="#69b3a2",formatDate:_,formatValue:S,markers:w=[],onHoveredDataChange:b,hoveredCategory:T,onTimelineEventHover:M})=>{const[k,C]=K.useState(null),[O,R]=K.useState(null),[E,H]=K.useState([]),I=K.useRef(`sawt-${Math.random().toString(36).substr(2,9)}`),P=K.useCallback(j=>{C(j),M==null||M(j)},[M]);return K.useEffect(()=>{if(!e.current||t.length===0||r.length===0)return;const j=Dt(e.current),Y=n-i.left-i.right,rt=a-i.top-i.bottom,tt=I.current;j.selectAll("*").remove();const J=`main-chart-group main-chart-group-${tt}`,Q=j.append("g").attr("class",J).attr("transform",`translate(${i.left},${i.top})`),it=`sawt-clip-${tt}`;j.append("defs").append("clipPath").attr("id",it).append("rect").attr("x",0).attr("y",0).attr("width",Y).attr("height",rt);const L=Q.append("g").attr("clip-path",`url(#${it})`),nt=[...t.map(st=>({timestamp:st.timestamp,...st.values}))].sort((st,yt)=>st.timestamp-yt.timestamp),N=r.map(st=>st.dataKey),F=Ka().keys(N),z=F(nt),B=t.map(st=>st.timestamp),A=c?c[0]:Math.min(...B),W=c?c[1]:Math.max(...B),q=Kn().domain([new Date(A),new Date(W)]).range([0,Y]),$=nt.filter(st=>st.timestamp>=A&&st.timestamp<=W),lt=F($),V=lt.length>0?Math.max(...lt[lt.length-1].map(st=>st[1]??0)):0,ut=ia().domain([0,V*1.1]).range([rt,0]).nice();f&&(L.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(Ir(q).ticks(6).tickSize(rt).tickFormat(()=>"")),L.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(zr(ut).ticks(5).tickSize(-Y).tickFormat(()=>"")));const vt=ss().x(st=>q(new Date(st.data.timestamp))).y0(st=>ut(st[0])).y1(st=>ut(st[1])).curve(Cn),et=L.append("g").attr("class","areas");z.forEach((st,yt)=>{const ht=r[yt];if(!ht)return;const bt=T===ht.dataKey,Bt=T!=null;et.append("path").datum(st).attr("class",`area area-${ht.dataKey}`).attr("fill",ht.color).attr("fill-opacity",Bt?bt?.9:.3:.7).attr("stroke",ht.color).attr("stroke-width",bt?2:1.5).attr("d",vt).on("mouseenter",()=>{const Ft=$[$.length-1],kt=Ft?Ft[ht.dataKey]??0:0;b==null||b({label:ht.label,value:kt,color:ht.color})}).on("mouseleave",()=>{b==null||b(null)})});const mt=w.filter(st=>st.timestamp>=A&&st.timestamp<=W).map(st=>({...st,x:q(new Date(st.timestamp))}));H(st=>st.length!==mt.length||st.some((yt,ht)=>{var bt,Bt;return yt.timestamp!==((bt=mt[ht])==null?void 0:bt.timestamp)||yt.x!==((Bt=mt[ht])==null?void 0:Bt.x)})?mt:st);let Ct=null;if(mt.length>0&&(Ct=L.append("g").attr("class","markers"),mt.forEach(st=>{Ct.append("line").attr("class","marker-line").attr("data-timestamp",st.timestamp).attr("x1",st.x).attr("x2",st.x).attr("y1",0).attr("y2",rt).attr("stroke",st.color??"#131E7A").attr("stroke-width",2).attr("opacity",0)})),h){const yt=Ir(q).ticks(6).tickPadding(12);_&&yt.tickFormat(bt=>_(+bt)),Q.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${rt})`).call(yt).selectAll("text").attr("font-size",g).attr("fill",p??null);const ht=zr(ut).ticks(5);ht.tickFormat(bt=>+bt==0?"":S?S(+bt):String(bt)),Q.append("g").attr("class","axis axis-y").call(ht).selectAll("text").attr("font-size",g).attr("fill",p??null)}if(d&&m){const st=ga().extent([[0,0],[Y,rt]]).on("end",ht=>{if(!ht.selection)return;const[bt,Bt]=ht.selection,Ft=[+q.invert(bt),+q.invert(Bt)];x!==void 0&&(Ft[0]=Math.max(Ft[0],x)),y!==void 0&&(Ft[1]=Math.min(Ft[1],y)),m(Ft),j.select(".brush").call(st.move,null)}),yt=L.append("g").attr("class","brush").call(st);yt.selectAll(".selection").attr("fill",v).attr("fill-opacity",.2).attr("stroke",v).attr("stroke-width",1),yt.selectAll(".handle").attr("fill",v).attr("fill-opacity",.8)}if(o&&Ji({svg:j,events:s,xScale:q,chartHeight:rt,chartWidth:Y,timelineHeight:l,timelineOffset:u,instanceId:tt,setHoveredTimelineEvent:P,enableBrush:d,onTimeRangeChange:m,minAllowedTime:x,maxAllowedTime:y,brushColor:v,mainGroupSelector:`.main-chart-group-${tt}`}),mt.length>0&&Ct){let st=null,yt;d?yt=L.select(".brush .overlay"):yt=Q.append("rect").attr("class","marker-hover-overlay").attr("width",Y).attr("height",rt).attr("fill","none").attr("pointer-events","all");const ht=Ct,bt=Ft=>{let kt=null,Vt=1/0;if(mt.forEach(At=>{const jt=Math.abs(Ft-At.x);jt<Vt&&(Vt=jt,kt=At)}),!kt||Vt>50)return st!==null&&(st=null,ht.selectAll(".marker-line").attr("opacity",0),R(null)),!1;const xt=kt;return st===xt.timestamp||(st=xt.timestamp,ht.selectAll(".marker-line").attr("opacity",0),ht.selectAll(".marker-line").filter(function(){return Dt(this).attr("data-timestamp")===String(xt.timestamp)}).attr("opacity",.6),R(xt)),!0},Bt=function(Ft){const[kt]=Tr(Ft,this);bt(kt)};yt.on("mouseenter",Bt),yt.on("mousemove",Bt),yt.on("mouseleave",function(){st=null,ht.selectAll(".marker-line").attr("opacity",0),R(null)})}return()=>{j.selectAll("*").remove()}},[e,t,r,n,a,i,s,o,l,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b,T,P]),{hoveredTimelineEvent:k,hoveredMarker:O,visibleMarkers:E}},uk=({data:e,categories:t,timelineEvents:r=[],showTimeline:n=!0,timelineHeight:a=40,timelineOffset:i,width:s=900,height:o=400,margin:l={top:10,right:30,bottom:40,left:60},showGrid:u=!0,showAxes:c=!0,axisLabelColor:f,axisLabelSize:h=14,formatDate:p,formatValue:g,timeRange:d,enableBrush:m=!1,onTimeRangeChange:x,minAllowedTime:y,maxAllowedTime:v,brushColor:_="#69b3a2",markers:S=[],onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:T})=>{const M=K.useRef(null),k=12,O=i??6+k+h+k,R=n?o+a+O:o,{hoveredTimelineEvent:E,hoveredMarker:H,visibleMarkers:I}=lk({containerRef:M,data:e,categories:t,width:s,height:o,margin:l,timelineEvents:r,showTimeline:n,timelineHeight:a,timelineOffset:O,timeRange:d,showGrid:u,showAxes:c,axisLabelColor:f,axisLabelSize:h,enableBrush:m,onTimeRangeChange:x,minAllowedTime:y,maxAllowedTime:v,brushColor:_,formatDate:p,formatValue:g,markers:S,onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:T});return D.jsxs(U.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[D.jsx("svg",{ref:M,viewBox:`0 0 ${s} ${R}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),I.map(P=>{const j=(P.x+l.left)/s*100,Y=l.top/R*100,rt=new Date(P.timestamp),tt=p?p(P.timestamp):rt.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),J=D.jsxs(U.Box,{children:[D.jsx(U.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:P.label?.5:0},children:tt}),P.label&&D.jsx(U.Box,{sx:{color:"white",fontWeight:500},children:P.label})]});return D.jsx(U.Tooltip,{title:J,open:(H==null?void 0:H.timestamp)===P.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(U.Box,{sx:{position:"absolute",left:`${j}%`,top:`${Y}%`,width:"1px",height:`${(o-l.top-l.bottom)/R*100}%`,pointerEvents:"none"}})},P.timestamp)}),E&&n&&!H&&D.jsx(U.Tooltip,{title:D.jsxs(U.Box,{children:[D.jsx(U.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:p?p(E.timestamp):new Date(E.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),D.jsx(U.Box,{sx:{color:"white",fontWeight:500},children:E.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:D.jsx(U.Box,{sx:{position:"absolute",left:`${(E.x+l.left)/s*100}%`,top:`${(o+O+a/2)/R*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})})]})},vr={colors:{primary:"#992FB9",background:"#FFFFFF",border:"#9CA3AF",highlightBackground:"rgba(31, 41, 55, 0.14)",monthLabel:"#9ca3af",tooltipText:"#6b7280"},dimensions:{height:32,eventWidth:2}},ck=(e="#4B5563")=>({startHandle:{sx:{position:"absolute",left:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}},endHandle:{sx:{position:"absolute",right:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}}}),dr={header:{sx:{}},title:{sx:{m:0}},instructions:{sx:{color:"text.secondary",minHeight:"40px",display:"flex",alignItems:"center"}},monthLabelsContainer:{sx:{justifyContent:"space-between",px:1.25,height:"20px",fontSize:"11px",color:vr.colors.monthLabel,mb:1}},monthLabel:{sx:{fontSize:"11px"}},timeline:{sx:{position:"relative",height:`${vr.dimensions.height}px`,backgroundColor:vr.colors.background,borderRadius:0,overflow:"visible",border:`1px solid ${vr.colors.border}`}},event:{sx:{position:"absolute",top:0,width:`${vr.dimensions.eventWidth}px`,height:"100%",backgroundColor:vr.colors.primary,cursor:"pointer",transition:"transform 0.2s",transformOrigin:"center"}},selection:{sx:{position:"absolute",top:0,height:"100%",backgroundColor:vr.colors.highlightBackground,pointerEvents:"none"}},tooltip:{sx:{position:"absolute",bottom:"-40px",backgroundColor:"white",p:"6px 10px",borderRadius:.5,boxShadow:"0 2px 8px rgba(0,0,0,0.15)",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10,border:`1px solid ${vr.colors.border}`}},tooltipEventName:{sx:{fontWeight:600}},tooltipDate:{sx:{color:vr.colors.tooltipText,fontSize:"11px"}}},fk=(e="#9CA3AF")=>({startHandle:{sx:{position:"absolute",left:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}},endHandle:{sx:{position:"absolute",right:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}}}),hk=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},pk=({events:e,selectedRange:t,onSelectionChange:r,enableZoom:n,zoomToSelection:a,visibleRange:i,onVisibleRangeChange:s})=>{hk()&&e.length>1&&(e.every((ot,nt)=>nt===0||ot.timestamp>=e[nt-1].timestamp)||console.warn("TimelineChart: events array should be sorted by timestamp for optimal performance and correct behavior."));const[o,l]=K.useState(!1),[u,c]=K.useState(null),[f,h]=K.useState(null),[p,g]=K.useState({start:null,end:null}),[d,m]=K.useState({start:null,end:null}),[x,y]=K.useState(null),v=K.useRef(null),_=t??p,S=i??d,w=K.useMemo(()=>{var L;return e.length>0?((L=e[0])==null?void 0:L.timestamp)??0:0},[e]),b=K.useMemo(()=>{var L;return e.length>0?((L=e[e.length-1])==null?void 0:L.timestamp)??0:0},[e]),T=K.useMemo(()=>a&&S.start&&S.end?S.start:w,[a,S,w]),M=K.useMemo(()=>a&&S.start&&S.end?S.end:b,[a,S,b]),k=K.useMemo(()=>M-T,[M,T]),C=K.useMemo(()=>!n&&_.start!==null&&_.end!==null,[n,_]),O=K.useCallback(L=>k===0?0:(L-T)/k*100,[T,k]),R=K.useCallback((L,ot)=>{const nt=L/ot*100;return T+nt/100*k},[T,k]),E=K.useCallback(L=>{t===void 0&&g(L),r==null||r(L)},[t,r]),H=K.useCallback(L=>{const ot=L.currentTarget.getBoundingClientRect(),nt=L.clientX-ot.left,N=R(nt,ot.width);l(!0),c(N),E({start:N,end:N})},[R,E]),I=K.useCallback(L=>{if(!o||u===null)return;const ot=L.currentTarget.getBoundingClientRect(),nt=L.clientX-ot.left,N=R(nt,ot.width);if(f==="start"){const F=Math.min(N,_.end-k*.01);E({start:Math.max(F,T),end:_.end})}else if(f==="end"){const F=Math.max(N,_.start+k*.01);E({start:_.start,end:Math.min(F,M)})}else if(f==="body"){const F=N-u,z=_.end-_.start;let B=_.start+F,A=_.end+F;B<T&&(B=T,A=T+z),A>M&&(A=M,B=M-z),E({start:B,end:A}),c(N)}else E({start:Math.min(u,N),end:Math.max(u,N)})},[o,u,f,_,k,T,M,R,E]),P=K.useCallback(()=>{const L=o;if(l(!1),h(null),L&&a&&_.start&&_.end&&_.start!==_.end){const ot={start:_.start,end:_.end};i===void 0&&m(ot),s==null||s(ot)}},[o,a,_,i,s]);K.useEffect(()=>{if(!o||u===null||!v.current)return;const L=nt=>{const N=v.current;if(!N)return;const F=N.getBoundingClientRect(),z=nt.clientX-F.left,B=R(z,F.width);if(f==="start"){const A=Math.min(B,_.end-k*.01);E({start:Math.max(A,T),end:_.end})}else if(f==="end"){const A=Math.max(B,_.start+k*.01);E({start:_.start,end:Math.min(A,M)})}else if(f==="body"){const A=B-u,W=_.end-_.start;let q=_.start+A,$=_.end+A;q<T&&(q=T,$=T+W),$>M&&($=M,q=M-W),E({start:q,end:$}),c(B)}else E({start:Math.min(u,B),end:Math.max(u,B)})},ot=()=>{P()};return document.addEventListener("mousemove",L),document.addEventListener("mouseup",ot),()=>{document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",ot)}},[o,u,f,_,k,T,M,R,E,P]);const j=K.useCallback(L=>{L.stopPropagation(),_.start!==null&&(l(!0),c(_.start),h("start"))},[_]),Y=K.useCallback(L=>{L.stopPropagation(),_.end!==null&&(l(!0),c(_.end),h("end"))},[_]),rt=K.useCallback(L=>{L.stopPropagation();const ot=v.current;if(!ot)return;const nt=ot.getBoundingClientRect(),N=L.clientX-nt.left,F=R(N,nt.width);l(!0),c(F),h("body")},[R]),tt=K.useCallback(L=>{if(L.cancelable&&n&&L.preventDefault(),!n||!_.start||!_.end||k===0)return;const ot=(_.start+_.end)/2,nt=_.end-_.start,N=L.deltaY>0?1.1:.9,F=Math.max(nt*N,k*.01),z=k*1.5,B=Math.min(F,z);let A=ot-B/2,W=ot+B/2;A<T&&(A=T,W=Math.min(T+B,M)),W>M&&(W=M,A=Math.max(M-B,T)),E({start:A,end:W})},[n,_,k,T,M,E]),J=K.useCallback(()=>!_.start||!_.end?[]:e.filter(L=>L.timestamp>=_.start&&L.timestamp<=_.end),[e,_]),Q=K.useCallback(()=>{const L={start:w,end:b};i===void 0&&m({start:null,end:null}),s==null||s(L)},[w,b,i,s]),it=K.useCallback(()=>{a&&Q()},[a,Q]);return{isDragging:o,dragStart:u,dragHandleType:f,internalSelectedRange:_,internalVisibleRange:S,hoveredEvent:x,minDate:T,maxDate:M,timeSpan:k,timelineContainerRef:v,getPositionFromTimestamp:O,getTimestampFromPosition:R,handleMouseDown:H,handleMouseMove:I,handleMouseUp:P,handleWheel:tt,handleDoubleClick:it,handleStartHandleMouseDown:j,handleEndHandleMouseDown:Y,handleSelectionBodyMouseDown:rt,setHoveredEvent:y,getEventsInRange:J,resetZoom:Q,showHandles:C}},dk=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),gk=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),mk=e=>{const t=e/864e5;return t>60?r=>new Date(r).toLocaleDateString("en-US",{month:"short",year:"numeric"}):t>7?r=>new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric"}):r=>new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",hour12:!0})},yk=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},_k=(e,t="arrow",r)=>{const n=t==="grip"?fk(r||"#9CA3AF"):ck(r||"#4B5563");return{header:{...dr.header,...e==null?void 0:e.header},title:{...dr.title,...e==null?void 0:e.title},instructions:{...dr.instructions,...e==null?void 0:e.instructions},monthLabelsContainer:{...dr.monthLabelsContainer,...e==null?void 0:e.monthLabelsContainer},monthLabel:{...dr.monthLabel,...e==null?void 0:e.monthLabel},timeline:{...dr.timeline,...e==null?void 0:e.timeline},event:{...dr.event,...e==null?void 0:e.event},selection:{...dr.selection,...e==null?void 0:e.selection},startHandle:{...n.startHandle,...e==null?void 0:e.startHandle},endHandle:{...n.endHandle,...e==null?void 0:e.endHandle},tooltip:{...dr.tooltip,...e==null?void 0:e.tooltip},tooltipEventName:{...dr.tooltipEventName,...e==null?void 0:e.tooltipEventName},tooltipDate:{...dr.tooltipDate,...e==null?void 0:e.tooltipDate}}},xk=({events:e,onSelectionChange:t,selectedRange:r,height:n=vr.dimensions.height,margin:a={top:0,right:0,bottom:0,left:0},formatDate:i=dk,formatMonthYear:s=gk,showMonthLabels:o=!0,monthLabelCount:l=6,enableZoom:u=!0,dragHandleVariant:c="arrow",dragHandleColor:f,showHeader:h=!0,title:p="Event Timeline Selector",zoomToSelection:g=!1,visibleRange:d,onVisibleRangeChange:m,timeRange:x,onTimeRangeChange:y,slotProps:v})=>{const _=x?{start:x[0],end:x[1]}:d,S=y?L=>{L.start!==null&&L.end!==null&&y([L.start,L.end])}:m;yk()&&e.length>500&&console.warn(`TimelineChart: Rendering ${e.length} events may impact performance. Consider implementing virtualization or canvas rendering for datasets larger than 500 events.`);const w=K.useMemo(()=>_k(v,c,f),[v,c,f]),{isDragging:b,dragHandleType:T,internalSelectedRange:M,hoveredEvent:k,minDate:C,timeSpan:O,timelineContainerRef:R,getPositionFromTimestamp:E,handleMouseDown:H,handleWheel:I,handleDoubleClick:P,handleStartHandleMouseDown:j,handleEndHandleMouseDown:Y,handleSelectionBodyMouseDown:rt,setHoveredEvent:tt,getEventsInRange:J,showHandles:Q}=pk({events:e,selectedRange:r,onSelectionChange:t,enableZoom:u,zoomToSelection:g,visibleRange:_,onVisibleRangeChange:S}),it=M.start&&M.end?`Selected: ${i(M.start)} - ${i(M.end)} (${J().length} events)`:"Click and drag on the timeline below to select a date range. Use mouse wheel to zoom in/out.";return D.jsxs(U.Stack,{sx:{width:"100%"},children:[h&&D.jsxs(U.Stack,{spacing:1,sx:{mb:3},...w.header,children:[D.jsx(U.Typography,{variant:"h5",...w.title,children:p}),D.jsx(U.Typography,{variant:"body2",...w.instructions,children:it})]}),o&&D.jsx(U.Stack,{direction:"row",...w.monthLabelsContainer,sx:{...w.monthLabelsContainer.sx,paddingLeft:`${a.left}px`,paddingRight:`${a.right}px`},children:Array.from({length:l},(L,ot)=>{const nt=C+O/(l-1)*ot,N=mk(O);return D.jsx(U.Typography,{variant:"caption",...w.monthLabel,children:N(nt)},ot)})}),D.jsxs(U.Box,{...w.timeline,sx:{...w.timeline.sx,height:`${n}px`,paddingLeft:`${a.left}px`,paddingRight:`${a.right}px`},children:[D.jsx(U.Box,{sx:{position:"absolute",top:a.top,left:0,right:0,bottom:a.bottom},children:e.map((L,ot)=>{const nt=E(L.timestamp);return D.jsx(U.Box,{onMouseEnter:()=>tt(L),onMouseLeave:()=>tt(null),"aria-label":`Event: ${L.eventName} at ${i(L.timestamp)}`,...w.event,sx:{...w.event.sx,left:`${nt}%`,transform:(k==null?void 0:k.timestamp)===L.timestamp?"scaleX(2)":"scaleX(1)"}},`${L.timestamp}-${ot}`)})}),M.start&&M.end&&(!g||b)&&D.jsx(U.Box,{...w.selection,onMouseDown:Q&&!b?rt:void 0,sx:{...w.selection.sx,left:`${E(M.start)}%`,width:`${E(M.end)-E(M.start)}%`,pointerEvents:Q?"all":"none",zIndex:2,cursor:Q&&!b?T==="body"?"grabbing":"grab":"default"},children:Q&&!(b&&T===null)&&D.jsxs(D.Fragment,{children:[D.jsx(U.Box,{...w.startHandle,onMouseDown:j,sx:{...w.startHandle.sx,cursor:"ew-resize",opacity:b&&T!=="start"?.5:1},"aria-label":"Drag to adjust start of selection"}),D.jsx(U.Box,{...w.endHandle,onMouseDown:Y,sx:{...w.endHandle.sx,cursor:"ew-resize",opacity:b&&T!=="end"?.5:1},"aria-label":"Drag to adjust end of selection"})]})}),D.jsx(U.Box,{ref:R,role:"application","aria-label":"Interactive timeline - click and drag to select date range","aria-describedby":h?void 0:"timeline-instructions",tabIndex:0,sx:{position:"absolute",top:0,left:0,right:0,height:"100%",cursor:"crosshair",pointerEvents:"all",zIndex:1},onMouseDown:H,onWheel:I,onDoubleClick:P}),!h&&D.jsx("span",{id:"timeline-instructions",style:{display:"none"},children:it}),k&&D.jsxs(U.Box,{role:"tooltip","aria-live":"polite",...w.tooltip,sx:{...w.tooltip.sx,left:`${E(k.timestamp)}%`,transform:"translateX(-50%)"},children:[D.jsx(U.Typography,{variant:"body2",...w.tooltipEventName,children:k.eventName}),D.jsx(U.Typography,{variant:"caption",...w.tooltipDate,children:i(k.timestamp)})]})]})]})},vk="#8b5cf6",bk=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),wk=({events:e,title:t="Events in Selected Range",maxHeight:r="200px",formatDate:n=bk,primaryColor:a=vk})=>e.length===0?null:D.jsxs("div",{style:{marginTop:"24px",padding:"20px",backgroundColor:"#f9fafb",borderRadius:"8px",border:"1px solid #e5e7eb"},children:[D.jsxs("h3",{style:{margin:"0 0 12px 0",fontSize:"16px",color:"#374151"},children:[t," (",e.length,")"]}),D.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"8px",maxHeight:r,overflowY:"auto"},children:e.map((i,s)=>D.jsxs("div",{style:{padding:"8px 12px",backgroundColor:"white",borderRadius:"4px",fontSize:"13px",border:"1px solid #e5e7eb"},children:[D.jsx("div",{style:{fontWeight:500,color:a},children:i.eventName}),D.jsx("div",{style:{color:"#6b7280",fontSize:"12px",marginTop:"2px"},children:n(i.timestamp)})]},`${i.timestamp}-${s}`))})]});function Sk(e,t){const r=t-1-e,n=Ia.length,a=Math.floor(r/Math.max(1,t-1)*(n-1)),i=Math.min(Math.max(0,a),n-1);return Ia[i]??Ia[0]??"#000000"}function Ny(e){return Array.from({length:e},(t,r)=>Sk(r,e))}const Hn=Ny(5),Fr={critical:"#dc3545",high:"#fd7e14",medium:"#ffc107",low:"#17a2b8",complete:ur.neoDigitalGreen[600],inProgress:"#007bff",farthest:Hn[0],far:Hn[1],close:Hn[2],closest:Hn[3],completed:Hn[4],primary:"#007bff",secondary:"#6c757d",success:ur.neoDigitalGreen[600],danger:"#dc3545",warning:"#ffc107",info:"#17a2b8",light:ur.neoGrey[200],dark:"#343a40"},Tk={migration:Hn,severity:[Fr.critical,Fr.high,Fr.medium,Fr.low,Fr.info],status:[Fr.danger,Fr.warning,Fr.success],extended:["#e74c3c","#e67e22","#f39c12","#2ecc71","#3498db","#9b59b6","#1abc9c","#95a5a6"],colorblindSafe:["#0173B2","#DE8F05","#029E73","#CC78BC","#CA9161","#FBAFE4","#949494","#ECE133"]},Mk={FARTHEST:"Farthest",FAR:"Far",CLOSE:"Close",CLOSEST:"Closest",COMPLETE:"Complete",CRITICAL:"Critical",HIGH:"High",MEDIUM:"Medium",LOW:"Low",INFO:"Info",NOT_APPLICABLE:"N/A",NO_LST:"No LST",DATA_MISSING:"Data Missing"};exports.CAMPAIGN_DATA_MISSING=ja;exports.CAMPAIGN_NOT_APPLICABLE=Ha;exports.CAMPAIGN_NO_LST=Ga;exports.CATEGORY_LABELS=Mk;exports.ChronoChart=ay;exports.ChronoPerspectiveChart=ay;exports.D3StackedAreaChart=ST;exports.D3StackedBarChart=MT;exports.DEFAULT_CHART_COLORS=ur;exports.DEFAULT_CHART_CONFIG=Pe;exports.DEFAULT_STACKED_AREA_COLORS=Fr;exports.MEASURE_GRADIENT_COLORS=Ia;exports.MODERNE_VULNERABILITY_COLORS=ea;exports.MorphChart=H0;exports.ParliamentChart=ok;exports.STACKED_AREA_PALETTES=Tk;exports.StackedAreaWithTimeline=uk;exports.TimelineChart=xk;exports.TimelineSelectedEvents=wk;exports.calculateDataSeries=Fy;exports.calculateOptimalArcAngle=df;exports.calculateOptimalSeatSize=gf;exports.generateMeasureGradient=Ny;
|