b&&(b=h),E=x*x*w,T=Math.max(b/E,E/v),T>S){x-=h;break}S=T}s.push(u={value:x,dice:m ji))l.moveTo(0,0);else if(x>q0-ji)l.moveTo(m*Mh(g),m*El(g)),l.arc(0,0,m,g,y,!v),p>ji&&(l.moveTo(p*Mh(y),p*El(y)),l.arc(0,0,p,y,g,v));else{var b=g,T=y,S=g,w=y,E=x,_=x,A=s.apply(this,arguments)/2,D=A>ji&&(n?+n.apply(this,arguments):Md(p*p+m*m)),O=U5(VD(m-p)/2,+r.apply(this,arguments)),R=O,k=O,L,C;if(D>ji){var I=UD(D/p*El(A)),M=UD(D/m*El(A));(E-=I*2)>ji?(I*=v?1:-1,S+=I,w-=I):(E=0,S=w=(g+y)/2),(_-=M*2)>ji?(M*=v?1:-1,b+=M,T-=M):(_=0,b=T=(g+y)/2)}var P=m*Mh(b),B=m*El(b),F=p*Mh(w),G=p*El(w);if(O>ji){var $=m*Mh(T),U=m*El(T),K=p*Mh(S),ne=p*El(S),j;if(x b&&(b=h),k=v*v*w,T=Math.max(b/k,k/x),T>S){v-=h;break}S=T}s.push(u={value:v,dice:m0;){if(h=sv(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function Tl(){var t=Nv();return t.copy=function(){return R5(t,Tl())},Lh.apply(t,arguments),Pke(t)}var Sq=N(()=>{"use strict";kh();bD();Rv();Eq();o(Pke,"linearish");o(Tl,"linear")});function wD(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(wD,"nice")});function bn(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hbn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(kD.setTime(+a),ED.setTime(+s),t(kD),t(ED),Math.floor(r(kD,ED))),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}var kD,ED,bu=N(()=>{"use strict";kD=new Date,ED=new Date;o(bn,"timeInterval")});var cc,Aq,SD=N(()=>{"use strict";bu();cc=bn(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);cc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?bn(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):cc);Aq=cc.range});var to,_q,CD=N(()=>{"use strict";bu();to=bn(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),_q=to.range});var Tu,Bke,N5,Fke,AD=N(()=>{"use strict";bu();Tu=bn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),Bke=Tu.range,N5=bn(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),Fke=N5.range});var wu,$ke,M5,Gke,_D=N(()=>{"use strict";bu();wu=bn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),$ke=wu.range,M5=bn(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),Gke=M5.range});var Lo,zke,Iv,Vke,I5,Uke,DD=N(()=>{"use strict";bu();Lo=bn(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),zke=Lo.range,Iv=bn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),Vke=Iv.range,I5=bn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),Uke=I5.range});function Dd(t){return bn(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function Ld(t){return bn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var wl,Rh,O5,P5,hc,B5,F5,Lq,Hke,Wke,qke,Yke,Xke,jke,Rd,U0,Rq,Nq,Nh,Mq,Iq,Oq,Kke,Qke,Zke,Jke,eEe,tEe,LD=N(()=>{"use strict";bu();o(Dd,"timeWeekday");wl=Dd(0),Rh=Dd(1),O5=Dd(2),P5=Dd(3),hc=Dd(4),B5=Dd(5),F5=Dd(6),Lq=wl.range,Hke=Rh.range,Wke=O5.range,qke=P5.range,Yke=hc.range,Xke=B5.range,jke=F5.range;o(Ld,"utcWeekday");Rd=Ld(0),U0=Ld(1),Rq=Ld(2),Nq=Ld(3),Nh=Ld(4),Mq=Ld(5),Iq=Ld(6),Oq=Rd.range,Kke=U0.range,Qke=Rq.range,Zke=Nq.range,Jke=Nh.range,eEe=Mq.range,tEe=Iq.range});var ku,rEe,$5,nEe,RD=N(()=>{"use strict";bu();ku=bn(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),rEe=ku.range,$5=bn(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),nEe=$5.range});var ro,iEe,kl,aEe,ND=N(()=>{"use strict";bu();ro=bn(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ro.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:bn(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});iEe=ro.range,kl=bn(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());kl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:bn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});aEe=kl.range});function Bq(t,e,r,n,i,a){let s=[[to,1,1e3],[to,5,5*1e3],[to,15,15*1e3],[to,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=f{"use strict";kh();SD();CD();AD();_D();DD();LD();RD();ND();o(Bq,"ticker");[oEe,lEe]=Bq(kl,$5,Rd,I5,M5,N5),[MD,ID]=Bq(ro,ku,wl,Lo,wu,Tu)});var G5=N(()=>{"use strict";SD();CD();AD();_D();DD();LD();RD();ND();Fq()});function OD(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function PD(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ov(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function BD(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=Pv(i),f=Bv(i),d=Pv(a),p=Bv(a),m=Pv(s),g=Bv(s),y=Pv(l),x=Bv(l),v=Pv(u),b=Bv(u),T={a:P,A:B,b:F,B:G,c:null,d:Hq,e:Hq,f:REe,g:zEe,G:UEe,H:_Ee,I:DEe,j:LEe,L:jq,m:NEe,M:MEe,p:$,q:U,Q:Yq,s:Xq,S:IEe,u:OEe,U:PEe,V:BEe,w:FEe,W:$Ee,x:null,X:null,y:GEe,Y:VEe,Z:HEe,"%":qq},S={a:K,A:ne,b:j,B:le,c:null,d:Wq,e:Wq,f:XEe,g:iSe,G:sSe,H:WEe,I:qEe,j:YEe,L:Qq,m:jEe,M:KEe,p:Z,q:ce,Q:Yq,s:Xq,S:QEe,u:ZEe,U:JEe,V:eSe,w:tSe,W:rSe,x:null,X:null,y:nSe,Y:aSe,Z:oSe,"%":qq},w={a:O,A:R,b:k,B:L,c:C,d:Vq,e:Vq,f:EEe,g:zq,G:Gq,H:Uq,I:Uq,j:bEe,L:kEe,m:xEe,M:TEe,p:D,q:vEe,Q:CEe,s:AEe,S:wEe,u:dEe,U:pEe,V:mEe,w:fEe,W:gEe,x:I,X:M,y:zq,Y:Gq,Z:yEe,"%":SEe};T.x=E(r,T),T.X=E(n,T),T.c=E(e,T),S.x=E(r,S),S.X=E(n,S),S.c=E(e,S);function E(Q,ee){return function(te){var re=[],he=-1,J=0,ye=Q.length,se,Se,W;for(te instanceof Date||(te=new Date(+te));++he{"use strict";dm();im();o(h7e,"copyObject");Fo=h7e});function f7e(t,e){for(var r=-1,n=Array(t);++r
"},r),Je.lineBreakRegex.test(t)))return t;let n=t.split(" ").filter(Boolean),i=[],a="";return n.forEach((s,l)=>{let u=Ji(`${s} `,r),h=Ji(a,r);if(u>e){let{hyphenatedStrings:p,remainingWord:m}=J7e(s,e,"-",r);i.push(a,...p),a=m}else h+u>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");l+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),J7e=tm((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...t],a=[],s="";return i.forEach((l,u)=>{let h=`${s}${l}`;if(Ji(h,n)>=e){let d=u+1,p=i.length===d,m=`${h}${r}`;a.push(p?h:m),s=""}else s=h}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);o(_T,"calculateTextHeight");o(Ji,"calculateTextWidth");FL=tm((t,e)=>{let{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};let[,a]=yc(r),s=["sans-serif",n],l=t.split(Je.lineBreakRegex),u=[],h=ze("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let f=h.append("svg");for(let p of s){let m=0,g={width:0,height:0,lineHeight:0};for(let y of l){let x=Q7e();x.text=y||RL;let v=Z7e(f,x).style("font-size",a).style("font-weight",i).style("font-family",p),b=(v._groups||v)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),m=Math.round(b.height),g.height+=m,g.lineHeight=Math.round(Math.max(g.lineHeight,m))}u.push(g)}f.remove();let d=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),LL=class{constructor(e=!1,r){this.count=0;this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},eAe=o(function(t){return AT=AT||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),AT.innerHTML=t,unescape(AT.textContent)},"entityDecode");o($L,"isDetailedError");tAe=o((t,e,r,n)=>{if(!n)return;let i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),yc=o(t=>{if(typeof t=="number")return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");o(Vn,"cleanAndMerge");Ht={assignWithDepth:Dn,wrapLabel:BL,calculateTextHeight:_T,calculateTextWidth:Ji,calculateTextDimensions:FL,cleanAndMerge:Vn,detectInit:V7e,detectDirective:Zj,isSubstringInArray:U7e,interpolateToCurve:NL,calcLabelPosition:Y7e,calcCardinalityPosition:X7e,calcTerminalLabelPosition:j7e,formatUrl:H7e,getStylesFromArray:IL,generateId:OL,random:PL,runFunc:W7e,entityDecode:eAe,insertTitle:tAe,isLabelCoordinateInPath:rAe,parseFontSize:yc,InitIDGenerator:LL},tK=o(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"\uFB02\xB0\xB0"+n+"\xB6\xDF":"\uFB02\xB0"+n+"\xB6\xDF"}),e},"encodeEntities"),ea=o(function(t){return t.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Hh=o((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");o(wn,"handleUndefinedAttr");o(rAe,"isLabelCoordinateInPath")});function Ll(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=BL(e[t].text,i,n),e[t].textLines=e[t].text.split(Je.lineBreakRegex).length,e[t].width=i,e[t].height=_T(e[t].text,n);else{let a=e[t].text.split(Je.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(let l of a)e[t].width=Math.max(Ji(l,n),e[t].width),s=_T(l,n),e[t].height=e[t].height+s}}function sK(t,e,r,n,i){let a=new NT(i);a.data.widthLimit=r.data.widthLimit/Math.min(GL,n.length);for(let[s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let h=l.wrap&&Wt.wrap,f=DT(Wt);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Ll("label",l,h,f,a.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let g=DT(Wt);Ll("type",l,h,g,a.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height}if(l.descr&&l.descr.text!==""){let g=DT(Wt);g.fontSize=g.fontSize-2,Ll("descr",l,h,g,a.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(s==0||s%GL===0){let g=r.data.startx+Wt.diagramMarginX,y=r.data.stopy+Wt.diagramMarginY+u;a.setData(g,g,y,y)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Wt.diagramMarginX:a.data.startx,y=a.data.starty;a.setData(g,g,y,y)}a.name=l.alias;let d=i.db.getC4ShapeArray(l.alias),p=i.db.getC4ShapeKeys(l.alias);p.length>0&&aK(a,t,d,p),e=l.alias;let m=i.db.getBoundaries(e);m.length>0&&sK(t,e,a,m,i),l.alias!=="global"&&iK(t,l,a),r.data.stopy=Math.max(a.data.stopy+Wt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Wt.c4ShapeMargin,r.data.stopx),LT=Math.max(LT,r.data.stopx),RT=Math.max(RT,r.data.stopy)}}var LT,RT,nK,GL,Wt,NT,zL,p2,DT,nAe,iK,aK,Ns,rK,iAe,aAe,sAe,VL,oK=N(()=>{"use strict";pr();rX();pt();SA();dr();OA();Xt();p0();tr();Ci();LT=0,RT=0,nK=4,GL=2;Jy.yy=av;Wt={},NT=class{static{o(this,"Bounds")}constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,zL(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,i=this.nextData.starty+e.margin*2,a=i+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>nK)&&(r=this.nextData.startx+e.margin+Wt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},zL(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},zL=o(function(t){Dn(Wt,t),t.fontFamily&&(Wt.personFontFamily=Wt.systemFontFamily=Wt.messageFontFamily=t.fontFamily),t.fontSize&&(Wt.personFontSize=Wt.systemFontSize=Wt.messageFontSize=t.fontSize),t.fontWeight&&(Wt.personFontWeight=Wt.systemFontWeight=Wt.messageFontWeight=t.fontWeight)},"setConf"),p2=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),DT=o(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),nAe=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");o(Ll,"calcC4ShapeTextWH");iK=o(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Wt.c4ShapeMargin-35;let n=e.wrap&&Wt.wrap,i=DT(Wt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Ji(e.label.text,i);Ll("label",e,n,i,a),Al.drawBoundary(t,e,Wt)},"drawBoundary"),aK=o(function(t,e,r,n){let i=0;for(let a of n){i=0;let s=r[a],l=p2(Wt,s.typeC4Shape.text);switch(l.fontSize=l.fontSize-2,s.typeC4Shape.width=Ji("\xAB"+s.typeC4Shape.text+"\xBB",l),s.typeC4Shape.height=l.fontSize+2,s.typeC4Shape.Y=Wt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let u=s.wrap&&Wt.wrap,h=Wt.width-Wt.c4ShapePadding*2,f=p2(Wt,s.typeC4Shape.text);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Ll("label",s,u,f,h),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let m=p2(Wt,s.typeC4Shape.text);Ll("type",s,u,m,h),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let m=p2(Wt,s.techn.text);Ll("techn",s,u,m,h),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,p=s.label.width;if(s.descr&&s.descr.text!==""){let m=p2(Wt,s.typeC4Shape.text);Ll("descr",s,u,m,h),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,p=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}p=p+Wt.c4ShapePadding,s.width=Math.max(s.width||Wt.width,p,Wt.width),s.height=Math.max(s.height||Wt.height,d,Wt.height),s.margin=s.margin||Wt.c4ShapeMargin,t.insert(s),Al.drawC4Shape(e,s,Wt)}t.bumpLastMargin(Wt.c4ShapeMargin)},"drawC4ShapeArray"),Ns=class{static{o(this,"Point")}constructor(e,r){this.x=e,this.y=r}},rK=o(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,l=n+t.height/2,u=Math.abs(r-i),h=Math.abs(n-a),f=h/u,d=t.height/t.width,p=null;return n==a&&ri?p=new Ns(r,l):r==i&&na&&(p=new Ns(s,n)),r>i&&n=f?p=new Ns(r,l+f*t.width/2):p=new Ns(s-u/h*t.height/2,n+t.height):r=f?p=new Ns(r+t.width,l+f*t.width/2):p=new Ns(s+u/h*t.height/2,n+t.height):ra?d>=f?p=new Ns(r+t.width,l-f*t.width/2):p=new Ns(s+t.height/2*u/h,n):r>i&&n>a&&(d>=f?p=new Ns(r,l-t.width/2*f):p=new Ns(s-t.height/2*u/h,n)),p},"getIntersectPoint"),iAe=o(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=rK(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=rK(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),aAe=o(function(t,e,r,n){let i=0;for(let a of e){i=i+1;let s=a.wrap&&Wt.wrap,l=nAe(Wt);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=i+": "+a.label.text);let h=Ji(a.label.text,l);Ll("label",a,s,l,h),a.techn&&a.techn.text!==""&&(h=Ji(a.techn.text,l),Ll("techn",a,s,l,h)),a.descr&&a.descr.text!==""&&(h=Ji(a.descr.text,l),Ll("descr",a,s,l,h));let f=r(a.from),d=r(a.to),p=iAe(f,d);a.startPoint=p.startPoint,a.endPoint=p.endPoint}Al.drawRels(t,e,Wt)},"drawRels");o(sK,"drawInsideBoundary");sAe=o(function(t,e,r,n){Wt=ge().c4;let i=ge().securityLevel,a;i==="sandbox"&&(a=ze("#i"+e));let s=i==="sandbox"?ze(a.nodes()[0].contentDocument.body):ze("body"),l=n.db;n.db.setWrap(Wt.wrap),nK=l.getC4ShapeInRow(),GL=l.getC4BoundaryInRow(),X.debug(`C:${JSON.stringify(Wt,null,2)}`);let u=i==="sandbox"?s.select(`[id="${e}"]`):ze(`[id="${e}"]`);Al.insertComputerIcon(u),Al.insertDatabaseIcon(u),Al.insertClockIcon(u);let h=new NT(n);h.setData(Wt.diagramMarginX,Wt.diagramMarginX,Wt.diagramMarginY,Wt.diagramMarginY),h.data.widthLimit=screen.availWidth,LT=Wt.diagramMarginX,RT=Wt.diagramMarginY;let f=n.db.getTitle(),d=n.db.getBoundaries("");sK(u,"",h,d,n),Al.insertArrowHead(u),Al.insertArrowEnd(u),Al.insertArrowCrossHead(u),Al.insertArrowFilledHead(u),aAe(u,n.db.getRels(),n.db.getC4Shape,n),h.data.stopx=LT,h.data.stopy=RT;let p=h.data,g=p.stopy-p.starty+2*Wt.diagramMarginY,x=p.stopx-p.startx+2*Wt.diagramMarginX;f&&u.append("text").text(f).attr("x",(p.stopx-p.startx)/2-4*Wt.diagramMarginX).attr("y",p.starty+Wt.diagramMarginY),fn(u,g,x,Wt.useMaxWidth);let v=f?60:0;u.attr("viewBox",p.startx-Wt.diagramMarginX+" -"+(Wt.diagramMarginY+v)+" "+x+" "+(g+v)),X.debug("models:",p)},"draw"),VL={drawPersonOrSystemArray:aK,drawBoundary:iK,setConf:zL,draw:sAe}});var oAe,lK,cK=N(()=>{"use strict";oAe=o(t=>`.person {
+`},"getStyles"),iH=o((t,e)=>{e!==void 0&&($3[t]=e)},"addStylesForDiagram"),aH=Kwe});var rv={};dr(rv,{clear:()=>Sr,getAccDescription:()=>Or,getAccTitle:()=>Mr,getDiagramTitle:()=>Pr,setAccDescription:()=>Ir,setAccTitle:()=>Rr,setDiagramTitle:()=>$r});var MA,IA,OA,PA,Sr,Rr,Mr,Ir,Or,$r,Pr,ci=N(()=>{"use strict";gr();qn();MA="",IA="",OA="",PA=o(t=>sr(t,Qt()),"sanitizeText"),Sr=o(()=>{MA="",OA="",IA=""},"clear"),Rr=o(t=>{MA=PA(t).replace(/^\s+/g,"")},"setAccTitle"),Mr=o(()=>MA,"getAccTitle"),Ir=o(t=>{OA=PA(t).replace(/\n\s+/g,`
+`)},"setAccDescription"),Or=o(()=>OA,"getAccDescription"),$r=o(t=>{IA=PA(t)},"setDiagramTitle"),Pr=o(()=>IA,"getDiagramTitle")});var sH,Qwe,ge,nv,G3,iv,FA,Zwe,z3,xd,av,BA,Xt=N(()=>{"use strict";vd();pt();qn();gr();Ei();NA();ci();sH=X,Qwe=Dy,ge=Qt,nv=n3,G3=gh,iv=o(t=>sr(t,ge()),"sanitizeText"),FA=ic,Zwe=o(()=>rv,"getCommonDb"),z3={},xd=o((t,e,r)=>{z3[t]&&sH.warn(`Diagram with id ${t} already registered. Overwriting.`),z3[t]=e,r&&LA(t,r),iH(t,e.styles),e.injectUtils?.(sH,Qwe,ge,iv,FA,Zwe(),()=>{})},"registerDiagram"),av=o(t=>{if(t in z3)return z3[t];throw new BA(t)},"getDiagram"),BA=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});var ml,Eh,ns,pl,ac,sv,$A,zA,V3,U3,oH,Jwe,eke,tke,rke,nke,ike,ake,ske,oke,lke,cke,uke,hke,fke,dke,pke,mke,lH,gke,yke,cH,vke,xke,bke,Tke,Sh,wke,kke,Eke,Ske,Cke,ov,GA=N(()=>{"use strict";Xt();gr();ci();ml=[],Eh=[""],ns="global",pl="",ac=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],sv=[],$A="",zA=!1,V3=4,U3=2,Jwe=o(function(){return oH},"getC4Type"),eke=o(function(t){oH=sr(t,ge())},"setC4Type"),tke=o(function(t,e,r,n,i,a,s,l,u){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let h={},f=sv.find(d=>d.from===e&&d.to===r);if(f?h=f:sv.push(h),h.type=t,h.from=e,h.to=r,h.label={text:n},i==null)h.techn={text:""};else if(typeof i=="object"){let[d,p]=Object.entries(i)[0];h[d]={text:p}}else h.techn={text:i};if(a==null)h.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];h[d]={text:p}}else h.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];h[d]=p}else h.sprite=s;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];h[d]=p}else h.tags=l;if(typeof u=="object"){let[d,p]=Object.entries(u)[0];h[d]=p}else h.link=u;h.wrap=Sh()},"addRel"),rke=o(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let l={},u=ml.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ml.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.descr={text:""};else if(typeof n=="object"){let[h,f]=Object.entries(n)[0];l[h]={text:f}}else l.descr={text:n};if(typeof i=="object"){let[h,f]=Object.entries(i)[0];l[h]=f}else l.sprite=i;if(typeof a=="object"){let[h,f]=Object.entries(a)[0];l[h]=f}else l.tags=a;if(typeof s=="object"){let[h,f]=Object.entries(s)[0];l[h]=f}else l.link=s;l.typeC4Shape={text:t},l.parentBoundary=ns,l.wrap=Sh()},"addPersonOrSystem"),nke=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ml.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ml.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=Sh(),u.typeC4Shape={text:t},u.parentBoundary=ns},"addContainer"),ike=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ml.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ml.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=Sh(),u.typeC4Shape={text:t},u.parentBoundary=ns},"addComponent"),ake=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=ac.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,ac.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=ns,a.wrap=Sh(),pl=ns,ns=t,Eh.push(pl)},"addPersonOrSystemBoundary"),ske=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=ac.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,ac.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=ns,a.wrap=Sh(),pl=ns,ns=t,Eh.push(pl)},"addContainerBoundary"),oke=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ac.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ac.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.type={text:"node"};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.type={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.nodeType=t,u.parentBoundary=ns,u.wrap=Sh(),pl=ns,ns=e,Eh.push(pl)},"addDeploymentNode"),lke=o(function(){ns=pl,Eh.pop(),pl=Eh.pop(),Eh.push(pl)},"popBoundaryParseStack"),cke=o(function(t,e,r,n,i,a,s,l,u,h,f){let d=ml.find(p=>p.alias===e);if(!(d===void 0&&(d=ac.find(p=>p.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[p,m]=Object.entries(r)[0];d[p]=m}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[p,m]=Object.entries(n)[0];d[p]=m}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[p,m]=Object.entries(i)[0];d[p]=m}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[p,m]=Object.entries(a)[0];d[p]=m}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[p,m]=Object.entries(s)[0];d[p]=m}else d.shape=s;if(l!=null)if(typeof l=="object"){let[p,m]=Object.entries(l)[0];d[p]=m}else d.sprite=l;if(u!=null)if(typeof u=="object"){let[p,m]=Object.entries(u)[0];d[p]=m}else d.techn=u;if(h!=null)if(typeof h=="object"){let[p,m]=Object.entries(h)[0];d[p]=m}else d.legendText=h;if(f!=null)if(typeof f=="object"){let[p,m]=Object.entries(f)[0];d[p]=m}else d.legendSprite=f}},"updateElStyle"),uke=o(function(t,e,r,n,i,a,s){let l=sv.find(u=>u.from===e&&u.to===r);if(l!==void 0){if(n!=null)if(typeof n=="object"){let[u,h]=Object.entries(n)[0];l[u]=h}else l.textColor=n;if(i!=null)if(typeof i=="object"){let[u,h]=Object.entries(i)[0];l[u]=h}else l.lineColor=i;if(a!=null)if(typeof a=="object"){let[u,h]=Object.entries(a)[0];l[u]=parseInt(h)}else l.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[u,h]=Object.entries(s)[0];l[u]=parseInt(h)}else l.offsetY=parseInt(s)}},"updateRelStyle"),hke=o(function(t,e,r){let n=V3,i=U3;if(typeof e=="object"){let a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){let a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(V3=n),i>=1&&(U3=i)},"updateLayoutConfig"),fke=o(function(){return V3},"getC4ShapeInRow"),dke=o(function(){return U3},"getC4BoundaryInRow"),pke=o(function(){return ns},"getCurrentBoundaryParse"),mke=o(function(){return pl},"getParentBoundaryParse"),lH=o(function(t){return t==null?ml:ml.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),gke=o(function(t){return ml.find(e=>e.alias===t)},"getC4Shape"),yke=o(function(t){return Object.keys(lH(t))},"getC4ShapeKeys"),cH=o(function(t){return t==null?ac:ac.filter(e=>e.parentBoundary===t)},"getBoundaries"),vke=cH,xke=o(function(){return sv},"getRels"),bke=o(function(){return $A},"getTitle"),Tke=o(function(t){zA=t},"setWrap"),Sh=o(function(){return zA},"autoWrap"),wke=o(function(){ml=[],ac=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],pl="",ns="global",Eh=[""],sv=[],Eh=[""],$A="",zA=!1,V3=4,U3=2},"clear"),kke={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},Eke={FILLED:0,OPEN:1},Ske={LEFTOF:0,RIGHTOF:1,OVER:2},Cke=o(function(t){$A=sr(t,ge())},"setTitle"),ov={addPersonOrSystem:rke,addPersonOrSystemBoundary:ake,addContainer:nke,addContainerBoundary:ske,addComponent:ike,addDeploymentNode:oke,popBoundaryParseStack:lke,addRel:tke,updateElStyle:cke,updateRelStyle:uke,updateLayoutConfig:hke,autoWrap:Sh,setWrap:Tke,getC4ShapeArray:lH,getC4Shape:gke,getC4ShapeKeys:yke,getBoundaries:cH,getBoundarys:vke,getCurrentBoundaryParse:pke,getParentBoundaryParse:mke,getRels:xke,getTitle:bke,getC4Type:Jwe,getC4ShapeInRow:fke,getC4BoundaryInRow:dke,setAccTitle:Rr,getAccTitle:Mr,getAccDescription:Or,setAccDescription:Ir,getConfig:o(()=>ge().c4,"getConfig"),clear:wke,LINETYPE:kke,ARROWTYPE:Eke,PLACEMENT:Ske,setTitle:Cke,setC4Type:eke}});function bd(t,e){return t==null||e==null?NaN:t0)for(var r=new Array(i),n=0,i,a;n{"use strict";_H()});var Z3,e8,t8=N(()=>{"use strict";Z3="http://www.w3.org/1999/xhtml",e8={svg:"http://www.w3.org/2000/svg",xhtml:Z3,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function sc(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),e8.hasOwnProperty(e)?{space:e8[e],local:t}:t}var J3=N(()=>{"use strict";t8();o(sc,"default")});function Hke(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Z3&&e.documentElement.namespaceURI===Z3?e.createElement(t):e.createElementNS(r,t)}}function qke(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function cv(t){var e=sc(t);return(e.local?qke:Hke)(e)}var r8=N(()=>{"use strict";J3();t8();o(Hke,"creatorInherit");o(qke,"creatorFixed");o(cv,"default")});function Wke(){}function Ah(t){return t==null?Wke:function(){return this.querySelector(t)}}var e5=N(()=>{"use strict";o(Wke,"none");o(Ah,"default")});function n8(t){typeof t!="function"&&(t=Ah(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";gl();o(y8,"default")});function v8(){for(var t=this._groups,e=-1,r=t.length;++e0;){if(h=lv(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function Tl(){var t=Iv();return t.copy=function(){return N5(t,Tl())},Mh.apply(t,arguments),l6e(t)}var WY=N(()=>{"use strict";Ch();CD();Mv();qY();o(l6e,"linearish");o(Tl,"linear")});function _D(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(_D,"nice")});function En(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hEn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(DD.setTime(+a),LD.setTime(+s),t(DD),t(LD),Math.floor(r(DD,LD))),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}var DD,LD,wu=N(()=>{"use strict";DD=new Date,LD=new Date;o(En,"timeInterval")});var uc,XY,RD=N(()=>{"use strict";wu();uc=En(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);uc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?En(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):uc);XY=uc.range});var io,jY,ND=N(()=>{"use strict";wu();io=En(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),jY=io.range});var ku,c6e,M5,u6e,MD=N(()=>{"use strict";wu();ku=En(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),c6e=ku.range,M5=En(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),u6e=M5.range});var Eu,h6e,I5,f6e,ID=N(()=>{"use strict";wu();Eu=En(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),h6e=Eu.range,I5=En(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),f6e=I5.range});var Ro,d6e,Pv,p6e,O5,m6e,OD=N(()=>{"use strict";wu();Ro=En(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),d6e=Ro.range,Pv=En(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),p6e=Pv.range,O5=En(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),m6e=O5.range});function Md(t){return En(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function Id(t){return En(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var wl,Ih,P5,B5,fc,F5,$5,QY,g6e,y6e,v6e,x6e,b6e,T6e,Od,Y0,ZY,JY,Oh,eX,tX,rX,w6e,k6e,E6e,S6e,C6e,A6e,PD=N(()=>{"use strict";wu();o(Md,"timeWeekday");wl=Md(0),Ih=Md(1),P5=Md(2),B5=Md(3),fc=Md(4),F5=Md(5),$5=Md(6),QY=wl.range,g6e=Ih.range,y6e=P5.range,v6e=B5.range,x6e=fc.range,b6e=F5.range,T6e=$5.range;o(Id,"utcWeekday");Od=Id(0),Y0=Id(1),ZY=Id(2),JY=Id(3),Oh=Id(4),eX=Id(5),tX=Id(6),rX=Od.range,w6e=Y0.range,k6e=ZY.range,E6e=JY.range,S6e=Oh.range,C6e=eX.range,A6e=tX.range});var Su,_6e,z5,D6e,BD=N(()=>{"use strict";wu();Su=En(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),_6e=Su.range,z5=En(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),D6e=z5.range});var ao,L6e,kl,R6e,FD=N(()=>{"use strict";wu();ao=En(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ao.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:En(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});L6e=ao.range,kl=En(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());kl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:En(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});R6e=kl.range});function iX(t,e,r,n,i,a){let s=[[io,1,1e3],[io,5,5*1e3],[io,15,15*1e3],[io,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=f{"use strict";Ch();RD();ND();MD();ID();OD();PD();BD();FD();o(iX,"ticker");[M6e,I6e]=iX(kl,z5,Od,O5,I5,M5),[$D,zD]=iX(ao,Su,wl,Ro,Eu,ku)});var G5=N(()=>{"use strict";RD();ND();MD();ID();OD();PD();BD();FD();aX()});function GD(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function VD(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Bv(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function UD(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=Fv(i),f=$v(i),d=Fv(a),p=$v(a),m=Fv(s),g=$v(s),y=Fv(l),v=$v(l),x=Fv(u),b=$v(u),T={a:P,A:B,b:F,B:G,c:null,d:hX,e:hX,f:nCe,g:dCe,G:mCe,H:eCe,I:tCe,j:rCe,L:gX,m:iCe,M:aCe,p:$,q:U,Q:pX,s:mX,S:sCe,u:oCe,U:lCe,V:cCe,w:uCe,W:hCe,x:null,X:null,y:fCe,Y:pCe,Z:gCe,"%":dX},S={a:j,A:te,b:Y,B:oe,c:null,d:fX,e:fX,f:bCe,g:LCe,G:NCe,H:yCe,I:vCe,j:xCe,L:vX,m:TCe,M:wCe,p:J,q:ue,Q:pX,s:mX,S:kCe,u:ECe,U:SCe,V:CCe,w:ACe,W:_Ce,x:null,X:null,y:DCe,Y:RCe,Z:MCe,"%":dX},w={a:I,A:L,b:E,B:D,c:_,d:cX,e:cX,f:K6e,g:lX,G:oX,H:uX,I:uX,j:W6e,L:j6e,m:q6e,M:Y6e,p:R,q:H6e,Q:Z6e,s:J6e,S:X6e,u:$6e,U:z6e,V:G6e,w:F6e,W:V6e,x:O,X:M,y:lX,Y:oX,Z:U6e,"%":Q6e};T.x=k(r,T),T.X=k(n,T),T.c=k(e,T),S.x=k(r,S),S.X=k(n,S),S.c=k(e,S);function k(re,ee){return function(Z){var K=[],ae=-1,Q=0,de=re.length,ne,Te,q;for(Z instanceof Date||(Z=new Date(+Z));++ae