(r+(c?a-_:_))%o,k=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(u=n[x(0)],i.moveTo(u.x,u.y)),d=0;d<=a;++d){if(u=n[x(d)],u.skip)continue;const _=u.x,v=u.y,M=_|0;M===g?(vm&&(m=v),h=(f*h+_)/++f):(k(),i.lineTo(_,v),g=M,f=0,p=m=v),b=v}k()}function ss(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Mc:wc}function Sc(i){return i.stepped?Va:i.tension||i.cubicInterpolationMode==="monotone"?Ba:fe}function Dc(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Ao(i,t.options),i.stroke(n)}function Pc(i,t,e,s){const{segments:n,options:o}=t,r=ss(t);for(const a of n)Ao(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Oc=typeof Path2D=="function";function Tc(i,t,e,s){Oc&&!t.options.segment?Dc(i,t,e,s):Pc(i,t,e,s)}class Re extends we{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;Ta(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=qa(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Xa(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Sc(s);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function wn(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)-1?i.split(`
-`):i}function Ic(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Mn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=vt(t.bodyFont),c=vt(t.titleFont),h=vt(t.footerFont),f=o.length,d=n.length,u=s.length,g=Tt(t.padding);let p=g.height,m=0,b=s.reduce((_,v)=>_+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),b){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=u*_+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let x=0;const k=function(_){m=Math.max(m,e.measureText(_).width+x)};return e.save(),e.font=c.string,J(i.title,k),e.font=l.string,J(i.beforeBody.concat(i.afterBody),k),x=t.displayColors?r+2+t.boxPadding:0,J(s,_=>{J(_.before,k),J(_.lines,k),J(_.after,k)}),x=0,e.font=h.string,J(i.footer,k),e.restore(),m+=g.width,{width:m,height:p}}function Lc(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function Fc(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Rc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Fc(c,i,t,e)&&(c="center"),c}function Sn(i,t,e){const s=e.yAlign||t.yAlign||Lc(i,e);return{xAlign:e.xAlign||t.xAlign||Rc(i,t,e,s),yAlign:s}}function zc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Vc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Dn(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:f,bottomLeft:d,bottomRight:u}=We(r);let g=zc(t,a);const p=Vc(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+n:a==="right"&&(g+=Math.max(f,u)+n),{x:It(g,0,s.width-t.width),y:It(p,0,s.height-t.height)}}function pi(i,t,e){const s=Tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Pn(i){return Rt([],Xt(i))}function Bc(i,t,e){return oe(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function On(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Fo={beforeTitle:Ut,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex"u"?Fo[t].call(e,s):n}class ns extends we{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new vo(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Bc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=Ct(s,"beforeTitle",this,t),o=Ct(s,"title",this,t),r=Ct(s,"afterTitle",this,t);let a=[];return a=Rt(a,Xt(n)),a=Rt(a,Xt(o)),a=Rt(a,Xt(r)),a}getBeforeBody(t,e){return Pn(Ct(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return J(t,o=>{const r={before:[],lines:[],after:[]},a=On(s,o);Rt(r.before,Xt(Ct(a,"beforeLabel",this,o))),Rt(r.lines,Ct(a,"label",this,o)),Rt(r.after,Xt(Ct(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Pn(Ct(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=Ct(s,"beforeFooter",this,t),o=Ct(s,"footer",this,t),r=Ct(s,"afterFooter",this,t);let a=[];return a=Rt(a,Xt(n)),a=Rt(a,Xt(o)),a=Rt(a,Xt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,f,d,s))),t.itemSort&&(a=a.sort((h,f)=>t.itemSort(h,f,s))),J(a,h=>{const f=On(t.callbacks,h);n.push(Ct(f,"labelColor",this,h)),o.push(Ct(f,"labelPointStyle",this,h)),r.push(Ct(f,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=ze[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Mn(this,s),c=Object.assign({},a,l),h=Sn(this.chart,s,c),f=Dn(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:f}=We(a),{x:d,y:u}=t,{width:g,height:p}=e;let m,b,x,k,_,v;return o==="center"?(_=u+p/2,n==="left"?(m=d,b=m-r,k=_+r,v=_-r):(m=d+g,b=m+r,k=_-r,v=_+r),x=m):(n==="left"?b=d+Math.max(l,h)+r:n==="right"?b=d+g-Math.max(c,f)-r:b=this.caretX,o==="top"?(k=u,_=k-r,m=b-r,x=b+r):(k=u+p,_=k+r,m=b+r,x=b-r),v=k),{x1:m,x2:b,x3:x,y1:k,y2:_,y3:v}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Ui(s.rtl,this.x,this.width);for(t.x=pi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=vt(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;lx!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ts(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ts(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,f=vt(s.bodyFont);let d=f.lineHeight,u=0;const g=Ui(s.rtl,this.x,this.width),p=function(F){e.fillText(F,g.x(t.x+u),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let b,x,k,_,v,M,P;for(e.textAlign=r,e.textBaseline="middle",e.font=f.string,t.x=pi(this,m,s),e.fillStyle=s.bodyColor,J(this.beforeBody,p),u=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,_=0,M=n.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=ze[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Mn(this,t),l=Object.assign({},r,this._size),c=Sn(e,t,l),h=Dn(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=Tt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),ja(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Wa(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Di(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!Di(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=ze[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}j(ns,"positioners",ze);var Hc={id:"tooltip",_element:ns,positioners:ze,afterInit(i,t,e){e&&(i.tooltip=new ns({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Fo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Nc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function jc(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Nc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Wc=(i,t)=>i===null?null:It(Math.round(i),0,t);function Tn(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}j(os,"id","category"),j(os,"defaults",{ticks:{callback:Tn}});function Uc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:f,includeBounds:d}=i,u=o||1,g=h-1,{min:p,max:m}=t,b=!nt(r),x=!nt(a),k=!nt(c),_=(m-p)/(f+1);let v=Rs((m-p)/g/u)*u,M,P,F,D;if(v<1e-14&&!b&&!x)return[{value:p},{value:m}];D=Math.ceil(m/v)-Math.floor(p/v),D>g&&(v=Rs(D*v/g/u)*u),nt(l)||(M=Math.pow(10,l),v=Math.ceil(v*M)/M),n==="ticks"?(P=Math.floor(p/v)*v,F=Math.ceil(m/v)*v):(P=p,F=m),b&&x&&o&&Fr((a-r)/o,v/1e3)?(D=Math.round(Math.min((a-r)/v,h)),v=(a-r)/D,P=r,F=a):k?(P=b?r:P,F=x?a:F,D=c-1,v=(F-P)/D):(D=(F-P)/v,Be(D,Math.round(D),v/1e3)?D=Math.round(D):D=Math.ceil(D));const S=Math.max(zs(v),zs(P));M=Math.pow(10,nt(l)?S:l),P=Math.round(P*M)/M,F=Math.round(F*M)/M;let A=0;for(b&&(d&&P!==r?(e.push({value:r}),Pa)break;e.push({value:B})}return x&&d&&F!==a?e.length&&Be(e[e.length-1].value,a,En(a,_,i))?e[e.length-1].value=a:e.push({value:a}):(!x||F===a)&&e.push({value:F}),e}function En(i,t,{horizontal:e,minRotation:s}){const n=ee(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Fi extends me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return nt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ve(n),c=ve(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Uc(n,o);return t.bounds==="ticks"&&so(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return bs(t,this.chart.options.locale,this.options.ticks.format)}}class rs extends Fi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=mt(t)?t:0,this.max=mt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=ee(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}j(rs,"id","linear"),j(rs,"defaults",{ticks:{callback:zi.formatters.numeric}});const Ze=i=>Math.floor(te(i)),ce=(i,t)=>Math.pow(10,Ze(i)+t);function An(i){return i/Math.pow(10,Ze(i))===1}function In(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function Yc(i,t){const e=t-i;let s=Ze(e);for(;In(i,t,s)>10;)s++;for(;In(i,t,s)<10;)s--;return Math.min(s,Ze(i))}function Xc(i,{min:t,max:e}){t=Pt(i.min,t);const s=[],n=Ze(t);let o=Yc(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-h)/Math.pow(10,o)),d=Pt(i.min,Math.round((l+h+f*Math.pow(10,o))*r)/r);for(;d=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),d=Math.round((l+h+f*Math.pow(10,o))*r)/r;const u=Pt(i.max,d);return s.push({value:u,major:An(u),significand:f}),s}class Ln extends me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Fi.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return mt(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=mt(t)?Math.max(0,t):null,this.max=mt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!mt(this._userMin)&&(this.min=t===ce(this.min,0)?ce(this.min,-1):ce(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=a=>s=t?s:a,r=a=>n=e?n:a;s===n&&(s<=0?(o(1),r(10)):(o(ce(s,-1)),r(ce(n,1)))),s<=0&&o(ce(n,-1)),n<=0&&r(ce(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Xc(e,this);return t.bounds==="ticks"&&so(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":bs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=te(t),this._valueRange=te(this.max)-te(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(te(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}j(Ln,"id","logarithmic"),j(Ln,"defaults",{ticks:{callback:zi.formatters.logarithmic,major:{enabled:!0}}});function as(i){const t=i.ticks;if(t.display&&i.display){const e=Tt(t.backdropPadding);return tt(t.font&&t.font.size,dt.font.size)+e.height}return 0}function Gc(i,t,e){return e=ct(e)?e:[e],{w:ia(i,t.string,e),h:e.length*t.lineHeight}}function Fn(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function Kc(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?gt/o:0;for(let l=0;lt.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function Zc(i,t,e){const s=i.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,s+n+r,o),c=Math.round(gs(Ft(l.angle+St))),h=eh(l.y,a.h,c),f=Jc(c),d=th(l.x,a.w,f);return{visible:!0,x:l.x,y:h,textAlign:f,left:d,top:h,right:d+a.w,bottom:h+a.h}}function $c(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:o}=i;return!(qt({x:e,y:s},t)||qt({x:e,y:o},t)||qt({x:n,y:s},t)||qt({x:n,y:o},t))}function Qc(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:as(o)/2,additionalAngle:r?gt/n:0};let c;for(let h=0;h270||e<90)&&(i-=t),i}function ih(i,t,e){const{left:s,top:n,right:o,bottom:r}=e,{backdropColor:a}=t;if(!nt(a)){const l=We(t.borderRadius),c=Tt(t.backdropPadding);i.fillStyle=a;const h=s-c.left,f=n-c.top,d=o-s+c.width,u=r-n+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),ts(i,{x:h,y:f,w:d,h:u,radius:l}),i.fill()):i.fillRect(h,f,d,u)}}function sh(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=i._pointLabelItems[n];if(!o.visible)continue;const r=s.setContext(i.getPointLabelContext(n));ih(e,r,o);const a=vt(r.font),{x:l,y:c,textAlign:h}=o;Ke(e,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Ro(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,Lt);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r{const n=ht(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?Kc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=Lt/(this._pointLabels.length||1),s=this.options.startAngle||0;return Ft(t*e+ee(s))}getDistanceFromCenterForValue(t){if(nt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(nt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(f!==0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(f),u=n.setContext(d),g=o.setContext(d);nh(this,u,l,r,g)}}),s.display){for(t.save(),a=r-1;a>=0;a--){const h=s.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=h;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=s.setContext(this.getContext(l)),h=vt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Tt(c.backdropPadding);t.fillRect(-r/2-f.left,-o-h.size/2-f.top,r+f.width,h.size+f.height)}Ke(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}j(mi,"id","radialLinear"),j(mi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:zi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),j(mi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),j(mi,"descriptors",{angleLines:{_fallback:"grid"}});const Hi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mt=Object.keys(Hi);function Rn(i,t){return i-t}function zn(i,t){if(nt(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),mt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ge(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Vn(i,t,e,s){const n=Mt.length;for(let o=Mt.indexOf(i);o=Mt.indexOf(e);o--){const r=Mt[o];if(Hi[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return Mt[e?Mt.indexOf(e):0]}function ah(i){for(let t=Mt.indexOf(i)+1,e=Mt.length;t=t?e[s]:e[n];i[o]=!0}}function lh(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Hn(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=It(e,0,r),s=It(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Vn(o.minUnit,e,s,this._getLabelCapacity(e)),a=tt(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Ge(l)||l===!0,h={};let f=e,d,u;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(d=f,u=0;d+p)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return ht(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],f=c&&a[c],d=s[e],u=c&&f&&d&&d.major;return this._adapter.format(t,n||(u?f:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=de(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=de(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Nn extends Ri{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bi(e,this.min),this._tableRange=bi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(bi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return bi(this._table,s*this._tableRange+this._minPos,!0)}}j(Nn,"id","timeseries"),j(Nn,"defaults",Ri.defaults);const jn=/^on/,zo=[];Object.keys(globalThis).forEach(i=>{jn.test(i)&&zo.push(i.replace(jn,""))});function Vo(i){const t=Uo,e=[];function s(n){Wo(t,n)}ls(()=>{const n=i();zo.forEach(n instanceof Element?o=>e.push(pe(n,o,s)):o=>e.push(n.$on(o,s)))}),Qn(()=>{for(;e.length;)e.pop()()})}function ch(i){let t,e=[i[1]],s={};for(let n=0;n{e(2,l=new Bi(c,{type:s,data:n,options:o,plugins:r}))}),Yo(()=>{l&&(e(2,l.data=n,l),Object.assign(l.options,o),l.update(a))}),Qn(()=>{l&&l.destroy(),e(2,l=null)}),Vo(()=>c);function f(d){cs[d?"unshift":"push"](()=>{c=d,e(0,c)})}return i.$$set=d=>{e(9,t=xe(xe({},t),Mi(d))),"type"in d&&e(3,s=d.type),"data"in d&&e(4,n=d.data),"options"in d&&e(5,o=d.options),"plugins"in d&&e(6,r=d.plugins),"updateMode"in d&&e(7,a=d.updateMode),"chart"in d&&e(2,l=d.chart)},t=Mi(t),[c,h,l,s,n,o,r,a,f]}class dh extends Qe{constructor(t){super(),Je(this,t,fh,ch,$e,{type:3,data:4,options:5,plugins:6,updateMode:7,chart:2})}}function uh(i){let t,e,s;const n=[{type:"line"},i[1]];function o(a){i[4](a)}let r={};for(let a=0;aqo(t,"chart",o)),{c(){Bt(t.$$.fragment)},l(a){Ht(t.$$.fragment,a)},m(a,l){Nt(t,a,l),s=!0},p(a,[l]){const c=l&2?er(n,[n[0],ir(a[1])]):{};!e&&l&1&&(e=!0,c.chart=a[0],Xo(()=>e=!1)),t.$set(c)},i(a){s||(ft(t.$$.fragment,a),s=!0)},o(a){pt(t.$$.fragment,a),s=!1},d(a){i[3](null),jt(t,a)}}}function gh(i,t,e){Bi.register(vi);let{chart:s=null}=t,n,o;Vo(()=>o);function r(l){cs[l?"unshift":"push"](()=>{o=l,e(2,o)})}function a(l){s=l,e(0,s)}return i.$$set=l=>{e(5,t=xe(xe({},t),Mi(l))),"chart"in l&&e(0,s=l.chart)},i.$$.update=()=>{e(1,n=t)},t=Mi(t),[s,n,o,r,a]}class ph extends Qe{constructor(t){super(),Je(this,t,gh,uh,$e,{chart:0})}}function Vt(i,t=!0,e=1){const s=t?1e3:1024;if(Math.abs(i)=s&&olabel min
max
first
last
',A,B,R,ot,K,H=i[1]&&Yn(i),N=i[1]==="byte"&&Xn(i);function at(I,W){return I[8]?bh:mh}let rt=at(i),Q=rt(i),lt=si(i[2]),V=[];for(let I=0;I_.name),f={},d,u=n==="byte";const g=()=>{let _=[];o&&(o.forEach((v,M)=>{_=[..._,{name:v.name,color:v.color,first:d?d[M].first:v.values[v.values.length-1],last:v.values?v.values[v.values.length-1]:0,max:v.values?v.values[v.values.length-1]:0,min:v.values?v.values[v.values.length-1]:0}]}),d?(_.forEach((v,M)=>{_[M].max>d[M].max&&e(9,d[M].max=_[M].max,d),_[M].mine(7,u=!u),x=()=>e(8,c=!c);function k(){h=$o(m[0],this.__value,this.checked),e(5,h)}return i.$$set=_=>{"title"in _&&e(0,s=_.title),"unit"in _&&e(1,n=_.unit),"values"in _&&e(2,o=_.values),"labels"in _&&e(11,r=_.labels),"xName"in _&&e(3,a=_.xName),"yName"in _&&e(4,l=_.yName)},i.$$.update=()=>{i.$$.dirty&2084&&e(6,f={labels:r,datasets:o.length>0?o.filter(_=>h.includes(_.name)).map(_=>({label:_.name,lineTension:0,backgroundColor:_.color,borderColor:_.color,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"mitter",pointBorderColor:"transparent",pointBackgroundColor:"transparent",data:_.values})):[]}),i.$$.dirty&64&&f&&g(),i.$$.dirty&128&&e(10,p={scales:{y:{ticks:{callback(_,v,M){return u?Vt(_):_}}}},interaction:{intersect:!1,mode:"index"},plugins:{tooltip:{position:"nearest",callbacks:{labelColors:[{backgroundColor:"red"}],label:_=>{let v=u?Vt(_.parsed.y):_.parsed.y;return`${_.dataset.label}: ${v}`}}}},responsive:!0,animation:!1,maintainAspectRatio:!1})},[s,n,o,a,l,h,f,u,c,d,p,r,b,x,k,m]}class ye extends Qe{constructor(t){super(),Je(this,t,yh,_h,$e,{title:0,unit:1,values:2,labels:11,xName:3,yName:4})}}const xh=async()=>new Promise(async(i,t)=>{const e=location.port;await fetch(`http://localhost:${e}/debug/stati/info`).then(async s=>{let n=await s.json();i(n)}).catch(s=>t(s))}),vh=async()=>new Promise(async(i,t)=>{const e=location.port;await fetch(`http://localhost:${e}/debug/stati/config`).then(async s=>{let n=await s.json();i(n)}).catch(s=>t(s))});function kh(i){const t=i-1;return t*t*t+1}function Bo(i,{delay:t=0,duration:e=400,easing:s=Go}={}){const n=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:s,css:o=>`opacity: ${o*n}`}}function Kt(i,{delay:t=0,duration:e=400,easing:s=kh,x:n=0,y:o=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,h=l*(1-r),[f,d]=Ms(n),[u,g]=Ms(o);return{delay:t,duration:e,easing:s,css:(p,m)=>`
- transform: ${c} translate(${(1-p)*f}${d}, ${(1-p)*u}${g});
- opacity: ${l-h*m}`}}function Ch(i){let t,e,s,n,o,r,a,l,c,h,f,d,u,g,p,m;return{c(){t=bt("svg"),e=bt("mask"),s=bt("path"),n=bt("path"),o=bt("path"),r=bt("path"),a=bt("path"),l=bt("g"),c=bt("path"),h=bt("path"),f=bt("path"),d=bt("path"),u=bt("path"),g=bt("path"),p=bt("path"),m=bt("path"),this.h()},l(b){t=_t(b,"svg",{width:!0,viewBox:!0,fill:!0,xmlns:!0});var x=O(t);e=_t(x,"mask",{id:!0,style:!0,maskUnits:!0,x:!0,y:!0,width:!0,height:!0});var k=O(e);s=_t(k,"path",{d:!0,fill:!0}),O(s).forEach(w),n=_t(k,"path",{d:!0,fill:!0}),O(n).forEach(w),o=_t(k,"path",{d:!0,fill:!0}),O(o).forEach(w),r=_t(k,"path",{d:!0,fill:!0}),O(r).forEach(w),a=_t(k,"path",{d:!0,fill:!0}),O(a).forEach(w),k.forEach(w),l=_t(x,"g",{mask:!0});var _=O(l);c=_t(_,"path",{d:!0,fill:!0}),O(c).forEach(w),h=_t(_,"path",{d:!0,fill:!0}),O(h).forEach(w),f=_t(_,"path",{d:!0,fill:!0}),O(f).forEach(w),d=_t(_,"path",{d:!0,fill:!0}),O(d).forEach(w),u=_t(_,"path",{d:!0,fill:!0}),O(u).forEach(w),g=_t(_,"path",{d:!0,stroke:!0,"stroke-width":!0}),O(g).forEach(w),p=_t(_,"path",{d:!0,stroke:!0,"stroke-width":!0}),O(p).forEach(w),m=_t(_,"path",{d:!0,stroke:!0,"stroke-width":!0}),O(m).forEach(w),_.forEach(w),x.forEach(w),this.h()},h(){C(s,"d","M116.77 434C94.5278 434 74.7882 430.372 57.5508 423.115C40.5914 415.858 27.1072 405.81 17.0984 392.971C7.08959 380.132 1.39011 365.619 0 349.431H88.8284C89.9405 356.408 92.8597 361.572 97.5861 364.921C102.59 368.27 108.846 369.945 116.353 369.945C121.079 369.945 124.832 368.968 127.613 367.014C130.393 364.781 131.783 362.13 131.783 359.06C131.783 353.757 128.864 349.989 123.025 347.756C117.187 345.523 107.317 343.011 93.4157 340.22C76.4563 336.871 62.4162 333.242 51.2953 329.335C40.4524 325.427 30.8606 318.729 22.5199 309.239C14.4572 299.75 10.4259 286.632 10.4259 269.885C10.4259 255.372 14.1792 242.254 21.6858 230.531C29.4704 218.53 40.8694 209.179 55.8826 202.481C70.8959 195.503 89.1064 192.014 110.514 192.014C142.209 192.014 166.953 199.829 184.746 215.459C202.818 231.089 213.661 251.464 217.275 276.584H135.119C133.729 270.164 130.81 265.28 126.361 261.931C121.913 258.302 115.936 256.488 108.429 256.488C103.703 256.488 100.088 257.465 97.5861 259.419C95.0839 261.093 93.8328 263.745 93.8328 267.373C93.8328 272.118 96.752 275.746 102.591 278.258C108.429 280.491 117.743 282.864 130.532 285.376C147.491 288.725 161.809 292.493 173.486 296.679C185.163 300.866 195.311 308.123 203.93 318.45C212.549 328.498 216.858 342.453 216.858 360.316C216.858 374.271 212.827 386.831 204.764 397.995C196.701 409.16 185.024 417.951 169.733 424.371C154.72 430.79 137.065 434 116.77 434Z"),C(s,"fill","white"),C(n,"d","M399.978 351.943V431.069H364.948C300.446 431.069 268.196 398.833 268.196 334.359V272.397H239.003V194.945H268.196V138.007H360.777V194.945H399.144V272.397H360.777V336.033C360.777 341.616 362.028 345.663 364.531 348.175C367.311 350.687 371.759 351.943 377.876 351.943H399.978Z"),C(n,"fill","white"),C(o,"d","M422.726 313.007C422.726 288.167 426.897 266.675 435.237 248.533C443.856 230.112 455.533 216.157 470.268 206.667C485.004 196.899 501.546 192.014 519.895 192.014C535.187 192.014 548.393 195.224 559.514 201.644C570.635 207.784 579.114 216.297 584.953 227.182V194.945H677.117V431.069H584.953V398.833C579.114 409.718 570.635 418.37 559.514 424.789C548.393 430.93 535.187 434 519.895 434C501.546 434 485.004 429.255 470.268 419.766C455.533 409.997 443.856 396.041 435.237 377.9C426.897 359.478 422.726 337.848 422.726 313.007ZM584.953 313.007C584.953 300.447 581.756 290.679 575.361 283.701C568.966 276.723 560.765 273.234 550.756 273.234C540.747 273.234 532.545 276.723 526.151 283.701C519.756 290.679 516.559 300.447 516.559 313.007C516.559 325.567 519.756 335.336 526.151 342.313C532.545 349.291 540.747 352.78 550.756 352.78C560.765 352.78 568.966 349.291 575.361 342.313C581.756 335.336 584.953 325.567 584.953 313.007Z"),C(o,"fill","white"),C(r,"d","M865.07 351.943V431.069H830.039C765.537 431.069 733.287 398.833 733.287 334.359V272.397H704.094V194.945H733.287V138.007H825.868V194.945H864.236V272.397H825.868V336.033C825.868 341.616 827.12 345.663 829.622 348.175C832.402 350.687 836.85 351.943 842.967 351.943H865.07Z"),C(r,"fill","white"),C(a,"d","M947.037 176.105C930.911 176.105 917.983 171.779 908.252 163.127C898.522 154.474 893.656 143.589 893.656 130.471C893.656 117.074 898.522 106.049 908.252 97.3971C917.983 88.4657 930.911 84 947.037 84C962.884 84 975.673 88.4657 985.404 97.3971C995.135 106.049 1000 117.074 1000 130.471C1000 143.589 995.135 154.474 985.404 163.127C975.673 171.779 962.884 176.105 947.037 176.105ZM992.91 194.945V431.069H900.329V194.945H992.91Z"),C(a,"fill","white"),C(e,"id","mask0_2_2"),Qo(e,"mask-type","alpha"),C(e,"maskUnits","userSpaceOnUse"),C(e,"x","0"),C(e,"y","84"),C(e,"width","1000"),C(e,"height","350"),C(c,"d","M116.77 434C94.5278 434 74.7882 430.372 57.5508 423.115C40.5914 415.858 27.1072 405.81 17.0984 392.971C7.08959 380.132 1.39011 365.619 0 349.431H88.8284C89.9405 356.408 92.8597 361.572 97.5861 364.921C102.59 368.27 108.846 369.945 116.353 369.945C121.079 369.945 124.832 368.968 127.613 367.014C130.393 364.781 131.783 362.13 131.783 359.06C131.783 353.757 128.864 349.989 123.025 347.756C117.187 345.523 107.317 343.011 93.4157 340.22C76.4563 336.871 62.4162 333.242 51.2953 329.335C40.4524 325.427 30.8606 318.729 22.5199 309.239C14.4572 299.75 10.4259 286.632 10.4259 269.885C10.4259 255.372 14.1792 242.254 21.6858 230.531C29.4704 218.53 40.8694 209.179 55.8826 202.481C70.8959 195.503 89.1064 192.014 110.514 192.014C142.209 192.014 166.953 199.829 184.746 215.459C202.818 231.089 213.661 251.464 217.275 276.584H135.119C133.729 270.164 130.81 265.28 126.361 261.931C121.913 258.302 115.936 256.488 108.429 256.488C103.703 256.488 100.088 257.465 97.5861 259.419C95.0839 261.093 93.8328 263.745 93.8328 267.373C93.8328 272.118 96.752 275.746 102.591 278.258C108.429 280.491 117.743 282.864 130.532 285.376C147.491 288.725 161.809 292.493 173.486 296.679C185.163 300.866 195.311 308.123 203.93 318.45C212.549 328.498 216.858 342.453 216.858 360.316C216.858 374.271 212.827 386.831 204.764 397.995C196.701 409.16 185.024 417.951 169.733 424.371C154.72 430.79 137.065 434 116.77 434Z"),C(c,"fill","white"),C(h,"d","M399.978 351.943V431.069H364.948C300.446 431.069 268.196 398.833 268.196 334.359V272.397H239.003V194.945H268.196V138.007H360.777V194.945H399.144V272.397H360.777V336.033C360.777 341.616 362.028 345.663 364.531 348.175C367.311 350.687 371.759 351.943 377.876 351.943H399.978Z"),C(h,"fill","white"),C(f,"d","M422.726 313.007C422.726 288.167 426.897 266.675 435.237 248.533C443.856 230.112 455.533 216.157 470.268 206.667C485.004 196.899 501.546 192.014 519.895 192.014C535.187 192.014 548.393 195.224 559.514 201.644C570.635 207.784 579.114 216.297 584.953 227.182V194.945H677.117V431.069H584.953V398.833C579.114 409.718 570.635 418.37 559.514 424.789C548.393 430.93 535.187 434 519.895 434C501.546 434 485.004 429.255 470.268 419.766C455.533 409.997 443.856 396.041 435.237 377.9C426.897 359.478 422.726 337.848 422.726 313.007ZM584.953 313.007C584.953 300.447 581.756 290.679 575.361 283.701C568.966 276.723 560.765 273.234 550.756 273.234C540.747 273.234 532.545 276.723 526.151 283.701C519.756 290.679 516.559 300.447 516.559 313.007C516.559 325.567 519.756 335.336 526.151 342.313C532.545 349.291 540.747 352.78 550.756 352.78C560.765 352.78 568.966 349.291 575.361 342.313C581.756 335.336 584.953 325.567 584.953 313.007Z"),C(f,"fill","white"),C(d,"d","M865.07 351.943V431.069H830.039C765.537 431.069 733.287 398.833 733.287 334.359V272.397H704.094V194.945H733.287V138.007H825.868V194.945H864.236V272.397H825.868V336.033C825.868 341.616 827.12 345.663 829.622 348.175C832.402 350.687 836.85 351.943 842.967 351.943H865.07Z"),C(d,"fill","white"),C(u,"d","M947.037 176.105C930.911 176.105 917.983 171.779 908.252 163.127C898.522 154.474 893.656 143.589 893.656 130.471C893.656 117.074 898.522 106.049 908.252 97.3971C917.983 88.4657 930.911 84 947.037 84C962.884 84 975.673 88.4657 985.404 97.3971C995.135 106.049 1000 117.074 1000 130.471C1000 143.589 995.135 154.474 985.404 163.127C975.673 171.779 962.884 176.105 947.037 176.105ZM992.91 194.945V431.069H900.329V194.945H992.91Z"),C(u,"fill","white"),C(g,"d","M-48 436.5C-2.5 383 96.2 242 179 240C282.5 237.5 377.5 315 471.5 317C580 319.309 882.5 212 992.5 18.5"),C(g,"stroke","#FF0000"),C(g,"stroke-width","10"),C(p,"d","M-64.5 464C-19 410.5 102.2 294 185 292C288.5 289.5 384.979 388.5 479 388.5C696 388.5 962 266.5 1072 73"),C(p,"stroke","#00C136"),C(p,"stroke-width","10"),C(m,"d","M-71 474.5C-25.5 421 110.2 349 193 347C296.5 344.5 392.979 469.5 487 469.5C704 469.5 997 339 1107 145.5"),C(m,"stroke","#3C43FF"),C(m,"stroke-width","10"),C(l,"mask","url(#mask0_2_2)"),C(t,"width","100%"),C(t,"viewBox","0 0 1000 519"),C(t,"fill","none"),C(t,"xmlns","http://www.w3.org/2000/svg")},m(b,x){et(b,t,x),y(t,e),y(e,s),y(e,n),y(e,o),y(e,r),y(e,a),y(t,l),y(l,c),y(l,h),y(l,f),y(l,d),y(l,u),y(l,g),y(l,p),y(l,m)},p:Zt,i:Zt,o:Zt,d(b){b&&w(t)}}}class Ho extends Qe{constructor(t){super(),Je(this,t,null,Ch,$e,{})}}function wh(i){let t,e,s,n,o,r="could not connect",a,l,c="retry",h,f,d;return s=new Ho({}),{c(){t=T("div"),e=T("div"),Bt(s.$$.fragment),n=Y(),o=T("span"),o.textContent=r,a=Y(),l=T("button"),l.textContent=c,this.h()},l(u){t=E(u,"DIV",{class:!0});var g=O(t);e=E(g,"DIV",{class:!0});var p=O(e);Ht(s.$$.fragment,p),p.forEach(w),n=X(g),o=E(g,"SPAN",{"data-svelte-h":!0}),Ot(o)!=="svelte-h0vuko"&&(o.textContent=r),a=X(g),l=E(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ot(l)!=="svelte-vryu1a"&&(l.textContent=c),g.forEach(w),this.h()},h(){C(e,"class","w-64"),C(l,"class","rounded border border-white/20 px-3 py-2"),C(t,"class","flex flex-col w-screen h-screen justify-center items-center gap-5")},m(u,g){et(u,t,g),y(t,e),Nt(s,e,null),y(t,n),y(t,o),y(t,a),y(t,l),h=!0,f||(d=pe(l,"click",i[19]),f=!0)},p:Zt,i(u){h||(ft(s.$$.fragment,u),h=!0)},o(u){pt(s.$$.fragment,u),h=!1},d(u){u&&w(t),jt(s),f=!1,d()}}}function Mh(i){let t,e,s,n,o,r="Connecting...",a,l;return s=new Ho({}),{c(){t=T("div"),e=T("div"),Bt(s.$$.fragment),n=Y(),o=T("span"),o.textContent=r,this.h()},l(c){t=E(c,"DIV",{class:!0});var h=O(t);e=E(h,"DIV",{class:!0});var f=O(e);Ht(s.$$.fragment,f),f.forEach(w),n=X(h),o=E(h,"SPAN",{"data-svelte-h":!0}),Ot(o)!=="svelte-zvx9gy"&&(o.textContent=r),h.forEach(w),this.h()},h(){C(e,"class","w-64"),C(t,"class","flex flex-col w-screen h-screen justify-center items-center gap-5")},m(c,h){et(c,t,h),y(t,e),Nt(s,e,null),y(t,n),y(t,o),l=!0},p:Zt,i(c){l||(ft(s.$$.fragment,c),a&&a.end(1),l=!0)},o(c){pt(s.$$.fragment,c),c&&(a=tr(t,Bo,{duration:200})),l=!1},d(c){c&&w(t),jt(s),c&&a&&a.end()}}}function Sh(i){let t,e,s,n,o,r,a,l,c,h,f,d,u,g,p,m,b,x,k,_,v,M,P,F,D,S,A,B,R="Garbage Collector",ot,K,H,N,at,rt,Q,lt;function V(L,q){return L[3]?Ph:Dh}let G=V(i),U=G(i);h=new ye({props:{values:i[13],labels:i[10],title:"Goroutine",unit:"num",yName:"Num"}}),g=new ye({props:{values:i[14],labels:i[10],title:"Sys",unit:"byte",yName:"Bytes"}}),x=new ye({props:{values:i[11],labels:i[10],title:"Heap",unit:"byte",yName:"Bytes"}}),M=new ye({props:{values:i[12],labels:i[10],title:"Heap",unit:"count",yName:"Count"}});function I(L,q){return L[4]?Th:Oh}let W=I(i),Z=W(i),z=i[4]&&qn(i);return{c(){t=T("header"),e=T("h1"),s=it(i[9]),n=Y(),o=T("button"),U.c(),a=Y(),l=T("section"),c=T("div"),Bt(h.$$.fragment),d=Y(),u=T("div"),Bt(g.$$.fragment),m=Y(),b=T("div"),Bt(x.$$.fragment),_=Y(),v=T("div"),Bt(M.$$.fragment),F=Y(),D=T("div"),S=T("div"),A=T("div"),B=T("h1"),B.textContent=R,ot=Y(),K=T("div"),H=T("span"),Z.c(),N=Y(),z&&z.c(),this.h()},l(L){t=E(L,"HEADER",{class:!0});var q=O(t);e=E(q,"H1",{class:!0});var Dt=O(e);s=st(Dt,i[9]),Dt.forEach(w),n=X(q),o=E(q,"BUTTON",{class:!0});var kt=O(o);U.l(kt),kt.forEach(w),q.forEach(w),a=X(L),l=E(L,"SECTION",{class:!0});var ut=O(l);c=E(ut,"DIV",{});var Wt=O(c);Ht(h.$$.fragment,Wt),Wt.forEach(w),d=X(ut),u=E(ut,"DIV",{});var Me=O(u);Ht(g.$$.fragment,Me),Me.forEach(w),m=X(ut),b=E(ut,"DIV",{});var Se=O(b);Ht(x.$$.fragment,Se),Se.forEach(w),_=X(ut),v=E(ut,"DIV",{});var De=O(v);Ht(M.$$.fragment,De),De.forEach(w),F=X(ut),D=E(ut,"DIV",{});var Pe=O(D);S=E(Pe,"DIV",{class:!0});var Et=O(S);A=E(Et,"DIV",{class:!0});var ii=O(A);B=E(ii,"H1",{class:!0,"data-svelte-h":!0}),Ot(B)!=="svelte-1pnnmb5"&&(B.textContent=R),ot=X(ii),K=E(ii,"DIV",{});var Cs=O(K);H=E(Cs,"SPAN",{});var ws=O(H);Z.l(ws),ws.forEach(w),Cs.forEach(w),ii.forEach(w),N=X(Et),z&&z.l(Et),Et.forEach(w),Pe.forEach(w),ut.forEach(w),this.h()},h(){C(e,"class","svelte-oqgsdx"),C(o,"class","px-3 py-2 rounded border border-white/20 transition-all duration-200"),yt(o,"bg-red-900",i[3]),yt(o,"bg-green-900",!i[3]),C(t,"class","mt-10 p-3 container mx-auto flex justify-between items-center svelte-oqgsdx"),C(B,"class","text-lg font-bold"),C(A,"class","p-3 flex justify-between items-center border-white/20"),yt(A,"bg-green-900",i[4]),yt(A,"border-b",i[4]),yt(A,"bg-red-900",!i[4]),C(S,"class","rounded border border-white/20"),C(l,"class","mb-10 grid grid-cols-1 gap-5 p-3 container mx-auto")},m(L,q){et(L,t,q),y(t,e),y(e,s),y(t,n),y(t,o),U.m(o,null),et(L,a,q),et(L,l,q),y(l,c),Nt(h,c,null),y(l,d),y(l,u),Nt(g,u,null),y(l,m),y(l,b),Nt(x,b,null),y(l,_),y(l,v),Nt(M,v,null),y(l,F),y(l,D),y(D,S),y(S,A),y(A,B),y(A,ot),y(A,K),y(K,H),Z.m(H,null),y(S,N),z&&z.m(S,null),rt=!0,Q||(lt=pe(o,"click",i[18]),Q=!0)},p(L,q){(!rt||q&512)&&xt(s,L[9]),G!==(G=V(L))&&(U.d(1),U=G(L),U&&(U.c(),U.m(o,null))),(!rt||q&8)&&yt(o,"bg-red-900",L[3]),(!rt||q&8)&&yt(o,"bg-green-900",!L[3]);const Dt={};q&8192&&(Dt.values=L[13]),q&1024&&(Dt.labels=L[10]),h.$set(Dt);const kt={};q&16384&&(kt.values=L[14]),q&1024&&(kt.labels=L[10]),g.$set(kt);const ut={};q&2048&&(ut.values=L[11]),q&1024&&(ut.labels=L[10]),x.$set(ut);const Wt={};q&4096&&(Wt.values=L[12]),q&1024&&(Wt.labels=L[10]),M.$set(Wt),W!==(W=I(L))&&(Z.d(1),Z=W(L),Z&&(Z.c(),Z.m(H,null))),(!rt||q&16)&&yt(A,"bg-green-900",L[4]),(!rt||q&16)&&yt(A,"border-b",L[4]),(!rt||q&16)&&yt(A,"bg-red-900",!L[4]),L[4]?z?(z.p(L,q),q&16&&ft(z,1)):(z=qn(L),z.c(),ft(z,1),z.m(S,null)):z&&(xi(),pt(z,1,1,()=>{z=null}),yi())},i(L){rt||(L&&(r||Qt(()=>{r=be(t,Bo,{delay:200}),r.start()})),ft(h.$$.fragment,L),L&&(f||Qt(()=>{f=be(c,Kt,{y:100,delay:200}),f.start()})),ft(g.$$.fragment,L),L&&(p||Qt(()=>{p=be(u,Kt,{y:100,delay:400}),p.start()})),ft(x.$$.fragment,L),L&&(k||Qt(()=>{k=be(b,Kt,{y:100,delay:600}),k.start()})),ft(M.$$.fragment,L),L&&(P||Qt(()=>{P=be(v,Kt,{y:100,delay:800}),P.start()})),ft(z),L&&(at||Qt(()=>{at=be(D,Kt,{y:100,delay:1e3}),at.start()})),rt=!0)},o(L){pt(h.$$.fragment,L),pt(g.$$.fragment,L),pt(x.$$.fragment,L),pt(M.$$.fragment,L),pt(z),rt=!1},d(L){L&&(w(t),w(a),w(l)),U.d(),jt(h),jt(g),jt(x),jt(M),Z.d(),z&&z.d(),Q=!1,lt()}}}function Dh(i){let t;return{c(){t=it("Run")},l(e){t=st(e,"Run")},m(e,s){et(e,t,s)},d(e){e&&w(t)}}}function Ph(i){let t;return{c(){t=it("Stop")},l(e){t=st(e,"Stop")},m(e,s){et(e,t,s)},d(e){e&&w(t)}}}function Oh(i){let t;return{c(){t=it("Disabled")},l(e){t=st(e,"Disabled")},m(e,s){et(e,t,s)},d(e){e&&w(t)}}}function Th(i){let t;return{c(){t=it("Enabled")},l(e){t=st(e,"Enabled")},m(e,s){et(e,t,s)},d(e){e&&w(t)}}}function qn(i){let t,e,s,n="GC CPU Fraction",o,r,a,l,c,h,f="Total Pause",d,u,g,p,m,b,x,k="Last GC",_,v,M=i[17](i[7].toString())+"",P,F,D,S,A="Next GC Byte Target",B,R,ot,K,H,N,at,rt,Q,lt;return at=new ye({props:{values:i[15],labels:i[10],title:"GC",unit:"byte",yName:"Bytes"}}),Q=new ye({props:{values:i[16],labels:i[10],title:"GC",unit:"num",yName:"Num"}}),{c(){t=T("div"),e=T("div"),s=T("h2"),s.textContent=n,o=Y(),r=T("div"),a=it(i[5]),l=Y(),c=T("div"),h=T("h2"),h.textContent=f,d=Y(),u=T("div"),g=it(i[6]),p=it("ns"),m=Y(),b=T("div"),x=T("h2"),x.textContent=k,_=Y(),v=T("div"),P=it(M),F=Y(),D=T("div"),S=T("h2"),S.textContent=A,B=Y(),R=T("div"),ot=it(i[8]),K=it(" bytes"),H=Y(),N=T("div"),Bt(at.$$.fragment),rt=Y(),Bt(Q.$$.fragment),this.h()},l(V){t=E(V,"DIV",{class:!0});var G=O(t);e=E(G,"DIV",{class:!0});var U=O(e);s=E(U,"H2",{"data-svelte-h":!0}),Ot(s)!=="svelte-jaj66s"&&(s.textContent=n),o=X(U),r=E(U,"DIV",{class:!0});var I=O(r);a=st(I,i[5]),I.forEach(w),U.forEach(w),l=X(G),c=E(G,"DIV",{class:!0});var W=O(c);h=E(W,"H2",{"data-svelte-h":!0}),Ot(h)!=="svelte-xplty6"&&(h.textContent=f),d=X(W),u=E(W,"DIV",{class:!0});var Z=O(u);g=st(Z,i[6]),p=st(Z,"ns"),Z.forEach(w),W.forEach(w),m=X(G),b=E(G,"DIV",{class:!0});var z=O(b);x=E(z,"H2",{"data-svelte-h":!0}),Ot(x)!=="svelte-32qve0"&&(x.textContent=k),_=X(z),v=E(z,"DIV",{class:!0});var L=O(v);P=st(L,M),L.forEach(w),z.forEach(w),F=X(G),D=E(G,"DIV",{class:!0});var q=O(D);S=E(q,"H2",{"data-svelte-h":!0}),Ot(S)!=="svelte-1he0wl0"&&(S.textContent=A),B=X(q),R=E(q,"DIV",{class:!0});var Dt=O(R);ot=st(Dt,i[8]),K=st(Dt," bytes"),Dt.forEach(w),q.forEach(w),G.forEach(w),H=X(V),N=E(V,"DIV",{class:!0});var kt=O(N);Ht(at.$$.fragment,kt),rt=X(kt),Ht(Q.$$.fragment,kt),kt.forEach(w),this.h()},h(){C(r,"class","text-lg font-bold"),C(e,"class","rounded border border-white/20 p-3 bg-black/10"),C(u,"class","text-lg font-bold"),C(c,"class","rounded border border-white/20 p-3 bg-black/10"),C(v,"class","text-lg font-bold"),C(b,"class","rounded border border-white/20 p-3 bg-black/10"),C(R,"class","text-lg font-bold"),C(D,"class","rounded border border-white/20 p-3 bg-black/10"),C(t,"class","grid grid-cols-4 gap-5 p-3 bg-green-800"),C(N,"class","p-3 gap-5 grid grid-cols-1")},m(V,G){et(V,t,G),y(t,e),y(e,s),y(e,o),y(e,r),y(r,a),y(t,l),y(t,c),y(c,h),y(c,d),y(c,u),y(u,g),y(u,p),y(t,m),y(t,b),y(b,x),y(b,_),y(b,v),y(v,P),y(t,F),y(t,D),y(D,S),y(D,B),y(D,R),y(R,ot),y(R,K),et(V,H,G),et(V,N,G),Nt(at,N,null),y(N,rt),Nt(Q,N,null),lt=!0},p(V,G){(!lt||G&32)&&xt(a,V[5]),(!lt||G&64)&&xt(g,V[6]),(!lt||G&128)&&M!==(M=V[17](V[7].toString())+"")&&xt(P,M),(!lt||G&256)&&xt(ot,V[8]);const U={};G&32768&&(U.values=V[15]),G&1024&&(U.labels=V[10]),at.$set(U);const I={};G&65536&&(I.values=V[16]),G&1024&&(I.labels=V[10]),Q.$set(I)},i(V){lt||(ft(at.$$.fragment,V),ft(Q.$$.fragment,V),lt=!0)},o(V){pt(at.$$.fragment,V),pt(Q.$$.fragment,V),lt=!1},d(V){V&&(w(t),w(H),w(N)),jt(at),jt(Q)}}}function Zn(i){let t,e,s="Disconnected",n,o,r="retry",a,l,c,h;return{c(){t=T("div"),e=T("span"),e.textContent=s,n=Y(),o=T("button"),o.textContent=r,this.h()},l(f){t=E(f,"DIV",{class:!0});var d=O(t);e=E(d,"SPAN",{"data-svelte-h":!0}),Ot(e)!=="svelte-4saabx"&&(e.textContent=s),n=X(d),o=E(d,"BUTTON",{class:!0,"data-svelte-h":!0}),Ot(o)!=="svelte-vryu1a"&&(o.textContent=r),d.forEach(w),this.h()},h(){C(o,"class","rounded border border-white/20 px-3 py-2"),C(t,"class","fixed bottom-3 right-3 flex gap-3 items-center justify-center bg-red-900 border border-white/20 py-2 px-4 rounded-lg")},m(f,d){et(f,t,d),y(t,e),y(t,n),y(t,o),l=!0,c||(h=pe(o,"click",i[20]),c=!0)},p:Zt,i(f){l||(f&&Qt(()=>{l&&(a||(a=Si(t,Kt,{duration:200,y:-50},!0)),a.run(1))}),l=!0)},o(f){f&&(a||(a=Si(t,Kt,{duration:200,y:-50},!1)),a.run(0)),l=!1},d(f){f&&w(t),f&&a&&a.end(),c=!1,h()}}}function $n(i){let t,e="Connected",s,n;return{c(){t=T("div"),t.innerHTML=e,this.h()},l(o){t=E(o,"DIV",{class:!0,"data-svelte-h":!0}),Ot(t)!=="svelte-nvjer5"&&(t.innerHTML=e),this.h()},h(){C(t,"class","fixed bottom-3 right-3 flex gap-3 items-center justify-center bg-green-900 border border-white/20 py-2 px-4 rounded-lg")},m(o,r){et(o,t,r),n=!0},i(o){n||(o&&Qt(()=>{n&&(s||(s=Si(t,Kt,{duration:200,y:-50},!0)),s.run(1))}),n=!0)},o(o){o&&(s||(s=Si(t,Kt,{duration:200,y:-50},!1)),s.run(0)),n=!1},d(o){o&&w(t),o&&s&&s.end()}}}function Eh(i){let t,e,s,n,o,r,a,l;document.title=t=i[9];const c=[Sh,Mh,wh],h=[];function f(g,p){return g[0]==="connected"?0:g[0]==="connecting"?1:2}s=f(i),n=h[s]=c[s](i);let d=i[1]&&Zn(i),u=i[2]&&$n();return{c(){e=Y(),n.c(),o=Y(),d&&d.c(),r=Y(),u&&u.c(),a=Ps()},l(g){Jo("svelte-1y79pm6",document.head).forEach(w),e=X(g),n.l(g),o=X(g),d&&d.l(g),r=X(g),u&&u.l(g),a=Ps()},m(g,p){et(g,e,p),h[s].m(g,p),et(g,o,p),d&&d.m(g,p),et(g,r,p),u&&u.m(g,p),et(g,a,p),l=!0},p(g,[p]){(!l||p&512)&&t!==(t=g[9])&&(document.title=t);let m=s;s=f(g),s===m?h[s].p(g,p):(xi(),pt(h[m],1,1,()=>{h[m]=null}),yi(),n=h[s],n?n.p(g,p):(n=h[s]=c[s](g),n.c()),ft(n,1),n.m(o.parentNode,o)),g[1]?d?(d.p(g,p),p&2&&ft(d,1)):(d=Zn(g),d.c(),ft(d,1),d.m(r.parentNode,r)):d&&(xi(),pt(d,1,1,()=>{d=null}),yi()),g[2]?u?p&4&&ft(u,1):(u=$n(),u.c(),ft(u,1),u.m(a.parentNode,a)):u&&(xi(),pt(u,1,1,()=>{u=null}),yi())},i(g){l||(ft(n),ft(d),ft(u),l=!0)},o(g){pt(n),pt(d),pt(u),l=!1},d(g){g&&(w(e),w(o),w(r),w(a)),h[s].d(g),d&&d.d(g),u&&u.d(g)}}}let wt=100;function Ah(i,t,e){let s="connecting",n=!1,o=!1,r=!0,a=!1,l=0,c=0,h,f=0,d="Realtime Stats Title",u=[],g=[];for(let D=0;D{vh().then(D=>{e(9,d=D.name),setInterval(()=>{r&&xh().then(S=>{let A=new Date().toTimeString().split(" ")[0];e(10,u=[...u.slice(-(wt-1)),A]),p[0].values.push(S.heap_sys),p[1].values.push(S.heap_inuse),p[2].values.push(S.heap_alloc),p[3].values.push(S.heap_released),p[4].values.push(S.heap_idle),p.forEach((B,R)=>{p[R].values.length>wt&&e(11,p[R].values=p[R].values.slice(-wt),p)}),e(11,p),m[0].values.push(S.heap_objects),m[1].values.push(S.mallocs),m[2].values.push(S.frees),m.forEach((B,R)=>{m[R].values.length>wt&&e(12,m[R].values=m[R].values.slice(-wt),m)}),e(12,m),b[0].values.push(S.num_goroutines),b.forEach((B,R)=>{b[R].values.length>wt&&e(13,b[R].values=b[R].values.slice(-wt),b)}),e(13,b),x[0].values.push(S.sys),x[1].values.push(S.other_sys),x.forEach((B,R)=>{x[R].values.length>wt&&e(14,x[R].values=x[R].values.slice(-wt),x)}),e(14,x),k[0].values.push(S.gc_sys),k.forEach((B,R)=>{k[R].values.length>wt&&e(15,k[R].values=k[R].values.slice(-wt),k)}),e(15,k),_[0].values.push(S.num_gc),_[1].values.push(S.num_forced_gc),_.forEach((B,R)=>{_[R].values.length>wt&&e(16,_[R].values=_[R].values.slice(-wt),_)}),e(16,_),e(4,a=S.enable_gc),e(5,l=S.gc_cpu_fraction),e(6,c=S.pause_total_ns),e(7,h=S.last_gc),e(8,f=S.next_gc),(s!="connected"||n==!0)&&(e(2,o=!0),setTimeout(()=>e(2,o=!1),3e3)),e(0,s="connected"),e(1,n=!1)}).catch(()=>e(1,n=!0))},D.fetch_interval)}).catch(()=>e(0,s="disconnected"))}),[s,n,o,r,a,l,c,h,f,d,u,p,m,b,x,k,_,D=>D==="1970-01-01T02:00:00+02:00"?"not yet run":D.split("T")[1],()=>e(3,r=!r),()=>location.reload(),()=>location.reload()]}class Vh extends Qe{constructor(t){super(),Je(this,t,Ah,Eh,$e,{})}}export{Vh as component};
diff --git a/frontend/.svelte-kit/output/client/_app/version.json b/frontend/.svelte-kit/output/client/_app/version.json
deleted file mode 100644
index e905103..0000000
--- a/frontend/.svelte-kit/output/client/_app/version.json
+++ /dev/null
@@ -1 +0,0 @@
-{"version":"1692129495134"}
\ No newline at end of file
diff --git a/frontend/.svelte-kit/output/client/favicon.png b/frontend/.svelte-kit/output/client/favicon.png
deleted file mode 100644
index 825b9e6..0000000
Binary files a/frontend/.svelte-kit/output/client/favicon.png and /dev/null differ
diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.49338e76.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.49338e76.css
deleted file mode 100644
index 2902949..0000000
--- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.49338e76.css
+++ /dev/null
@@ -1 +0,0 @@
-*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.fixed{position:fixed}.bottom-3{bottom:.75rem}.right-3{right:.75rem}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.mb-10{margin-bottom:2.5rem}.mb-5{margin-bottom:1.25rem}.ml-auto{margin-left:auto}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.block{display:block}.flex{display:flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-4{height:1rem}.h-96{height:24rem}.h-\[500px\]{height:500px}.h-screen{height:100vh}.w-4{width:1rem}.w-64{width:16rem}.w-full{width:100%}.w-screen{width:100vw}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-5{gap:1.25rem}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-white\/20{border-color:#fff3}.bg-black\/10{background-color:#0000001a}.bg-green-800{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.bg-green-900{--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity))}.bg-red-900{--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.bg-white\/5{background-color:#ffffff0d}.p-3{padding:.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.text-alto{--tw-text-opacity: 1;color:rgb(217 217 217 / var(--tw-text-opacity))}.line-through{text-decoration-line:line-through}.opacity-50{opacity:.5}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}body{--tw-bg-opacity: 1;background-color:rgb(15 15 15 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(217 217 217 / var(--tw-text-opacity))}.box.svelte-1h57x8j.svelte-1h57x8j{overflow:hidden;border-radius:.25rem;border-width:1px;border-color:#fff3;background-color:#ffffff0d}.graph.svelte-1h57x8j.svelte-1h57x8j{height:24rem;flex:1 1 0%;padding:.75rem}.title.svelte-1h57x8j.svelte-1h57x8j{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;border-color:#fff3;background-color:#ffffff0d;padding:.5rem .75rem;font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(217 217 217 / var(--tw-text-opacity))}.tablo.svelte-1h57x8j>.svelte-1h57x8j:nth-child(2n){background-color:#0003}header.svelte-oqgsdx h1.svelte-oqgsdx{font-size:1.5rem;line-height:2rem;font-weight:700}
diff --git a/frontend/.svelte-kit/output/server/chunks/internal.js b/frontend/.svelte-kit/output/server/chunks/internal.js
deleted file mode 100644
index 19c44d1..0000000
--- a/frontend/.svelte-kit/output/server/chunks/internal.js
+++ /dev/null
@@ -1,185 +0,0 @@
-import { c as create_ssr_component, a as setContext, v as validate_component, m as missing_component } from "./ssr.js";
-let base = "";
-let assets = base;
-const initial = { base, assets };
-function reset() {
- base = initial.base;
- assets = initial.assets;
-}
-function set_assets(path) {
- assets = initial.assets = path;
-}
-let public_env = {};
-function set_private_env(environment) {
-}
-function set_public_env(environment) {
- public_env = environment;
-}
-function afterUpdate() {
-}
-function set_building() {
-}
-const Root = create_ssr_component(($$result, $$props, $$bindings, slots) => {
- let { stores } = $$props;
- let { page } = $$props;
- let { constructors } = $$props;
- let { components = [] } = $$props;
- let { form } = $$props;
- let { data_0 = null } = $$props;
- let { data_1 = null } = $$props;
- {
- setContext("__svelte__", stores);
- }
- afterUpdate(stores.page.notify);
- if ($$props.stores === void 0 && $$bindings.stores && stores !== void 0)
- $$bindings.stores(stores);
- if ($$props.page === void 0 && $$bindings.page && page !== void 0)
- $$bindings.page(page);
- if ($$props.constructors === void 0 && $$bindings.constructors && constructors !== void 0)
- $$bindings.constructors(constructors);
- if ($$props.components === void 0 && $$bindings.components && components !== void 0)
- $$bindings.components(components);
- if ($$props.form === void 0 && $$bindings.form && form !== void 0)
- $$bindings.form(form);
- if ($$props.data_0 === void 0 && $$bindings.data_0 && data_0 !== void 0)
- $$bindings.data_0(data_0);
- if ($$props.data_1 === void 0 && $$bindings.data_1 && data_1 !== void 0)
- $$bindings.data_1(data_1);
- let $$settled;
- let $$rendered;
- do {
- $$settled = true;
- {
- stores.page.set(page);
- }
- $$rendered = ` ${constructors[1] ? `${validate_component(constructors[0] || missing_component, "svelte:component").$$render(
- $$result,
- { data: data_0, this: components[0] },
- {
- this: ($$value) => {
- components[0] = $$value;
- $$settled = false;
- }
- },
- {
- default: () => {
- return `${validate_component(constructors[1] || missing_component, "svelte:component").$$render(
- $$result,
- { data: data_1, form, this: components[1] },
- {
- this: ($$value) => {
- components[1] = $$value;
- $$settled = false;
- }
- },
- {}
- )}`;
- }
- }
- )}` : `${validate_component(constructors[0] || missing_component, "svelte:component").$$render(
- $$result,
- { data: data_0, form, this: components[0] },
- {
- this: ($$value) => {
- components[0] = $$value;
- $$settled = false;
- }
- },
- {}
- )}`} ${``}`;
- } while (!$$settled);
- return $$rendered;
-});
-const options = {
- app_template_contains_nonce: false,
- csp: { "mode": "auto", "directives": { "upgrade-insecure-requests": false, "block-all-mixed-content": false }, "reportOnly": { "upgrade-insecure-requests": false, "block-all-mixed-content": false } },
- csrf_check_origin: true,
- track_server_fetches: false,
- embedded: false,
- env_public_prefix: "PUBLIC_",
- env_private_prefix: "",
- hooks: null,
- // added lazily, via `get_hooks`
- preload_strategy: "modulepreload",
- root: Root,
- service_worker: false,
- templates: {
- app: ({ head, body, assets: assets2, nonce, env }) => '\n\n \n \n \n \n ' + head + '\n \n \n ' + body + "
\n \n\n",
- error: ({ status, message }) => '\n\n \n \n ' + message + `
-
-
-
-
-
-
` + status + '\n
\n
' + message + "
\n \n
\n \n\n"
- },
- version_hash: "z5hk65"
-};
-function get_hooks() {
- return {};
-}
-export {
- assets as a,
- base as b,
- set_public_env as c,
- set_assets as d,
- set_building as e,
- get_hooks as g,
- options as o,
- public_env as p,
- reset as r,
- set_private_env as s
-};
diff --git a/frontend/.svelte-kit/output/server/chunks/ssr.js b/frontend/.svelte-kit/output/server/chunks/ssr.js
deleted file mode 100644
index 3095fa5..0000000
--- a/frontend/.svelte-kit/output/server/chunks/ssr.js
+++ /dev/null
@@ -1,117 +0,0 @@
-function noop() {
-}
-function run(fn) {
- return fn();
-}
-function blank_object() {
- return /* @__PURE__ */ Object.create(null);
-}
-function run_all(fns) {
- fns.forEach(run);
-}
-function safe_not_equal(a, b) {
- return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
-}
-function subscribe(store, ...callbacks) {
- if (store == null) {
- for (const callback of callbacks) {
- callback(void 0);
- }
- return noop;
- }
- const unsub = store.subscribe(...callbacks);
- return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
-}
-let current_component;
-function set_current_component(component) {
- current_component = component;
-}
-function get_current_component() {
- if (!current_component)
- throw new Error("Function called outside component initialization");
- return current_component;
-}
-function setContext(key, context) {
- get_current_component().$$.context.set(key, context);
- return context;
-}
-function getContext(key) {
- return get_current_component().$$.context.get(key);
-}
-const ATTR_REGEX = /[&"]/g;
-const CONTENT_REGEX = /[&<]/g;
-function escape(value, is_attr = false) {
- const str = String(value);
- const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
- pattern.lastIndex = 0;
- let escaped = "";
- let last = 0;
- while (pattern.test(str)) {
- const i = pattern.lastIndex - 1;
- const ch = str[i];
- escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<");
- last = i + 1;
- }
- return escaped + str.substring(last);
-}
-const missing_component = {
- $$render: () => ""
-};
-function validate_component(component, name) {
- if (!component || !component.$$render) {
- if (name === "svelte:component")
- name += " this={...}";
- throw new Error(
- `<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`
- );
- }
- return component;
-}
-let on_destroy;
-function create_ssr_component(fn) {
- function $$render(result, props, bindings, slots, context) {
- const parent_component = current_component;
- const $$ = {
- on_destroy,
- context: new Map(context || (parent_component ? parent_component.$$.context : [])),
- // these will be immediately discarded
- on_mount: [],
- before_update: [],
- after_update: [],
- callbacks: blank_object()
- };
- set_current_component({ $$ });
- const html = fn(result, props, bindings, slots);
- set_current_component(parent_component);
- return html;
- }
- return {
- render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => {
- on_destroy = [];
- const result = { title: "", head: "", css: /* @__PURE__ */ new Set() };
- const html = $$render(result, props, {}, $$slots, context);
- run_all(on_destroy);
- return {
- html,
- css: {
- code: Array.from(result.css).map((css) => css.code).join("\n"),
- map: null
- // TODO
- },
- head: result.title + result.head
- };
- },
- $$render
- };
-}
-export {
- setContext as a,
- subscribe as b,
- create_ssr_component as c,
- escape as e,
- getContext as g,
- missing_component as m,
- noop as n,
- safe_not_equal as s,
- validate_component as v
-};
diff --git a/frontend/.svelte-kit/output/server/entries/fallbacks/error.svelte.js b/frontend/.svelte-kit/output/server/entries/fallbacks/error.svelte.js
deleted file mode 100644
index 5fcfff2..0000000
--- a/frontend/.svelte-kit/output/server/entries/fallbacks/error.svelte.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import { g as getContext, c as create_ssr_component, b as subscribe, e as escape } from "../../chunks/ssr.js";
-const getStores = () => {
- const stores = getContext("__svelte__");
- return {
- /** @type {typeof page} */
- page: {
- subscribe: stores.page.subscribe
- },
- /** @type {typeof navigating} */
- navigating: {
- subscribe: stores.navigating.subscribe
- },
- /** @type {typeof updated} */
- updated: stores.updated
- };
-};
-const page = {
- subscribe(fn) {
- const store = getStores().page;
- return store.subscribe(fn);
- }
-};
-const Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
- let $page, $$unsubscribe_page;
- $$unsubscribe_page = subscribe(page, (value) => $page = value);
- $$unsubscribe_page();
- return `${escape($page.status)}
${escape($page.error?.message)}
`;
-});
-export {
- Error$1 as default
-};
diff --git a/frontend/.svelte-kit/output/server/entries/fallbacks/layout.svelte.js b/frontend/.svelte-kit/output/server/entries/fallbacks/layout.svelte.js
deleted file mode 100644
index f5f39bc..0000000
--- a/frontend/.svelte-kit/output/server/entries/fallbacks/layout.svelte.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import { c as create_ssr_component } from "../../chunks/ssr.js";
-const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
- return `${slots.default ? slots.default({}) : ``}`;
-});
-export {
- Layout as default
-};
diff --git a/frontend/.svelte-kit/output/server/entries/pages/_layout.js b/frontend/.svelte-kit/output/server/entries/pages/_layout.js
deleted file mode 100644
index 3953bf0..0000000
--- a/frontend/.svelte-kit/output/server/entries/pages/_layout.js
+++ /dev/null
@@ -1,4 +0,0 @@
-const ssr = false;
-export {
- ssr
-};
diff --git a/frontend/.svelte-kit/output/server/entries/pages/_page.svelte.js b/frontend/.svelte-kit/output/server/entries/pages/_page.svelte.js
deleted file mode 100644
index 3f7ae9d..0000000
--- a/frontend/.svelte-kit/output/server/entries/pages/_page.svelte.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import { c as create_ssr_component, e as escape, v as validate_component } from "../../chunks/ssr.js";
-const main = "";
-const eventPrefix = /^on/;
-const events = [];
-Object.keys(globalThis).forEach((key) => {
- if (eventPrefix.test(key)) {
- events.push(key.replace(eventPrefix, ""));
- }
-});
-const GraphBox_svelte_svelte_type_style_lang = "";
-const StatiLogo = create_ssr_component(($$result, $$props, $$bindings, slots) => {
- return ``;
-});
-const _page_svelte_svelte_type_style_lang = "";
-const css = {
- code: "header.svelte-oqgsdx h1.svelte-oqgsdx{font-size:1.5rem;line-height:2rem;font-weight:700\n}",
- map: null
-};
-const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
- let name = "Realtime Stats Title";
- $$result.css.add(css);
- return `${$$result.head += `${$$result.title = `${escape(name)}`, ""}`, ""} ${`${`${validate_component(StatiLogo, "StatiLogo").$$render($$result, {}, {}, {})}
Connecting... `}`} ${``} ${``}`;
-});
-export {
- Page as default
-};
diff --git a/frontend/.svelte-kit/output/server/index.js b/frontend/.svelte-kit/output/server/index.js
deleted file mode 100644
index 1efd9b6..0000000
--- a/frontend/.svelte-kit/output/server/index.js
+++ /dev/null
@@ -1,2916 +0,0 @@
-import { b as base, a as assets, r as reset, p as public_env, o as options, s as set_private_env, c as set_public_env, g as get_hooks } from "./chunks/internal.js";
-import * as devalue from "devalue";
-import { n as noop, s as safe_not_equal } from "./chunks/ssr.js";
-import { parse, serialize } from "cookie";
-import * as set_cookie_parser from "set-cookie-parser";
-const DEV = false;
-const SVELTE_KIT_ASSETS = "/_svelte_kit_assets";
-const ENDPOINT_METHODS = /* @__PURE__ */ new Set([
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE",
- "OPTIONS",
- "HEAD"
-]);
-const PAGE_METHODS = /* @__PURE__ */ new Set(["GET", "POST", "HEAD"]);
-function negotiate(accept, types) {
- const parts = [];
- accept.split(",").forEach((str, i) => {
- const match = /([^/]+)\/([^;]+)(?:;q=([0-9.]+))?/.exec(str);
- if (match) {
- const [, type, subtype, q = "1"] = match;
- parts.push({ type, subtype, q: +q, i });
- }
- });
- parts.sort((a, b) => {
- if (a.q !== b.q) {
- return b.q - a.q;
- }
- if (a.subtype === "*" !== (b.subtype === "*")) {
- return a.subtype === "*" ? 1 : -1;
- }
- if (a.type === "*" !== (b.type === "*")) {
- return a.type === "*" ? 1 : -1;
- }
- return a.i - b.i;
- });
- let accepted;
- let min_priority = Infinity;
- for (const mimetype of types) {
- const [type, subtype] = mimetype.split("/");
- const priority = parts.findIndex(
- (part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*")
- );
- if (priority !== -1 && priority < min_priority) {
- accepted = mimetype;
- min_priority = priority;
- }
- }
- return accepted;
-}
-function is_content_type(request, ...types) {
- const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? "";
- return types.includes(type.toLowerCase());
-}
-function is_form_content_type(request) {
- return is_content_type(
- request,
- "application/x-www-form-urlencoded",
- "multipart/form-data",
- "text/plain"
- );
-}
-class HttpError {
- /**
- * @param {number} status
- * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body
- */
- constructor(status, body) {
- this.status = status;
- if (typeof body === "string") {
- this.body = { message: body };
- } else if (body) {
- this.body = body;
- } else {
- this.body = { message: `Error: ${status}` };
- }
- }
- toString() {
- return JSON.stringify(this.body);
- }
-}
-class Redirect {
- /**
- * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status
- * @param {string} location
- */
- constructor(status, location) {
- this.status = status;
- this.location = location;
- }
-}
-class ActionFailure {
- /**
- * @param {number} status
- * @param {T} [data]
- */
- constructor(status, data) {
- this.status = status;
- this.data = data;
- }
-}
-function exec(match, params, matchers) {
- const result = {};
- const values = match.slice(1);
- let buffered = 0;
- for (let i = 0; i < params.length; i += 1) {
- const param = params[i];
- let value = values[i - buffered];
- if (param.chained && param.rest && buffered) {
- value = values.slice(i - buffered, i + 1).filter((s2) => s2).join("/");
- buffered = 0;
- }
- if (value === void 0) {
- if (param.rest)
- result[param.name] = "";
- continue;
- }
- if (!param.matcher || matchers[param.matcher](value)) {
- result[param.name] = value;
- const next_param = params[i + 1];
- const next_value = values[i + 1];
- if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) {
- buffered = 0;
- }
- continue;
- }
- if (param.optional && param.chained) {
- buffered++;
- continue;
- }
- return;
- }
- if (buffered)
- return;
- return result;
-}
-function error(status, body) {
- if (isNaN(status) || status < 400 || status > 599) {
- throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);
- }
- return new HttpError(status, body);
-}
-function json(data, init2) {
- const body = JSON.stringify(data);
- const headers = new Headers(init2?.headers);
- if (!headers.has("content-length")) {
- headers.set("content-length", encoder$3.encode(body).byteLength.toString());
- }
- if (!headers.has("content-type")) {
- headers.set("content-type", "application/json");
- }
- return new Response(body, {
- ...init2,
- headers
- });
-}
-const encoder$3 = new TextEncoder();
-function text(body, init2) {
- const headers = new Headers(init2?.headers);
- if (!headers.has("content-length")) {
- const encoded = encoder$3.encode(body);
- headers.set("content-length", encoded.byteLength.toString());
- return new Response(encoded, {
- ...init2,
- headers
- });
- }
- return new Response(body, {
- ...init2,
- headers
- });
-}
-function coalesce_to_error(err) {
- return err instanceof Error || err && /** @type {any} */
- err.name && /** @type {any} */
- err.message ? (
- /** @type {Error} */
- err
- ) : new Error(JSON.stringify(err));
-}
-function normalize_error(error2) {
- return (
- /** @type {import('../runtime/control.js').Redirect | import('../runtime/control.js').HttpError | Error} */
- error2
- );
-}
-function method_not_allowed(mod, method) {
- return text(`${method} method not allowed`, {
- status: 405,
- headers: {
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
- // "The server must generate an Allow header field in a 405 status code response"
- allow: allowed_methods(mod).join(", ")
- }
- });
-}
-function allowed_methods(mod) {
- const allowed = Array.from(ENDPOINT_METHODS).filter((method) => method in mod);
- if ("GET" in mod || "HEAD" in mod)
- allowed.push("HEAD");
- return allowed;
-}
-function static_error_page(options2, status, message) {
- let page = options2.templates.error({ status, message });
- return text(page, {
- headers: { "content-type": "text/html; charset=utf-8" },
- status
- });
-}
-async function handle_fatal_error(event, options2, error2) {
- error2 = error2 instanceof HttpError ? error2 : coalesce_to_error(error2);
- const status = error2 instanceof HttpError ? error2.status : 500;
- const body = await handle_error_and_jsonify(event, options2, error2);
- const type = negotiate(event.request.headers.get("accept") || "text/html", [
- "application/json",
- "text/html"
- ]);
- if (event.isDataRequest || type === "application/json") {
- return json(body, {
- status
- });
- }
- return static_error_page(options2, status, body.message);
-}
-async function handle_error_and_jsonify(event, options2, error2) {
- if (error2 instanceof HttpError) {
- return error2.body;
- } else {
- return await options2.hooks.handleError({ error: error2, event }) ?? {
- message: event.route.id != null ? "Internal Error" : "Not Found"
- };
- }
-}
-function redirect_response(status, location) {
- const response = new Response(void 0, {
- status,
- headers: { location }
- });
- return response;
-}
-function clarify_devalue_error(event, error2) {
- if (error2.path) {
- return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error2.message} (data${error2.path})`;
- }
- if (error2.path === "") {
- return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`;
- }
- return error2.message;
-}
-function stringify_uses(node) {
- const uses = [];
- if (node.uses && node.uses.dependencies.size > 0) {
- uses.push(`"dependencies":${JSON.stringify(Array.from(node.uses.dependencies))}`);
- }
- if (node.uses && node.uses.params.size > 0) {
- uses.push(`"params":${JSON.stringify(Array.from(node.uses.params))}`);
- }
- if (node.uses?.parent)
- uses.push('"parent":1');
- if (node.uses?.route)
- uses.push('"route":1');
- if (node.uses?.url)
- uses.push('"url":1');
- return `"uses":{${uses.join(",")}}`;
-}
-async function render_endpoint(event, mod, state) {
- const method = (
- /** @type {import('types').HttpMethod} */
- event.request.method
- );
- let handler = mod[method];
- if (!handler && method === "HEAD") {
- handler = mod.GET;
- }
- if (!handler) {
- return method_not_allowed(mod, method);
- }
- const prerender = mod.prerender ?? state.prerender_default;
- if (prerender && (mod.POST || mod.PATCH || mod.PUT || mod.DELETE)) {
- throw new Error("Cannot prerender endpoints that have mutative methods");
- }
- if (state.prerendering && !prerender) {
- if (state.depth > 0) {
- throw new Error(`${event.route.id} is not prerenderable`);
- } else {
- return new Response(void 0, { status: 204 });
- }
- }
- try {
- let response = await handler(
- /** @type {import('@sveltejs/kit').RequestEvent>} */
- event
- );
- if (!(response instanceof Response)) {
- throw new Error(
- `Invalid response from route ${event.url.pathname}: handler should return a Response object`
- );
- }
- if (state.prerendering) {
- response = new Response(response.body, {
- status: response.status,
- statusText: response.statusText,
- headers: new Headers(response.headers)
- });
- response.headers.set("x-sveltekit-prerender", String(prerender));
- }
- return response;
- } catch (e) {
- if (e instanceof Redirect) {
- return new Response(void 0, {
- status: e.status,
- headers: { location: e.location }
- });
- }
- throw e;
- }
-}
-function is_endpoint_request(event) {
- const { method, headers } = event.request;
- if (ENDPOINT_METHODS.has(method) && !PAGE_METHODS.has(method)) {
- return true;
- }
- if (method === "POST" && headers.get("x-sveltekit-action") === "true")
- return false;
- const accept = event.request.headers.get("accept") ?? "*/*";
- return negotiate(accept, ["*", "text/html"]) !== "text/html";
-}
-function compact(arr) {
- return arr.filter(
- /** @returns {val is NonNullable} */
- (val) => val != null
- );
-}
-function normalize_path(path, trailing_slash) {
- if (path === "/" || trailing_slash === "ignore")
- return path;
- if (trailing_slash === "never") {
- return path.endsWith("/") ? path.slice(0, -1) : path;
- } else if (trailing_slash === "always" && !path.endsWith("/")) {
- return path + "/";
- }
- return path;
-}
-function decode_pathname(pathname) {
- return pathname.split("%25").map(decodeURI).join("%25");
-}
-function decode_params(params) {
- for (const key2 in params) {
- params[key2] = decodeURIComponent(params[key2]);
- }
- return params;
-}
-const tracked_url_properties = (
- /** @type {const} */
- [
- "href",
- "pathname",
- "search",
- "searchParams",
- "toString",
- "toJSON"
- ]
-);
-function make_trackable(url, callback) {
- const tracked = new URL(url);
- for (const property of tracked_url_properties) {
- Object.defineProperty(tracked, property, {
- get() {
- callback();
- return url[property];
- },
- enumerable: true,
- configurable: true
- });
- }
- {
- tracked[Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
- return inspect(url, opts);
- };
- }
- disable_hash(tracked);
- return tracked;
-}
-function disable_hash(url) {
- Object.defineProperty(url, "hash", {
- get() {
- throw new Error(
- "Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead"
- );
- }
- });
-}
-function disable_search(url) {
- for (const property of ["search", "searchParams"]) {
- Object.defineProperty(url, property, {
- get() {
- throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);
- }
- });
- }
-}
-const DATA_SUFFIX = "/__data.json";
-function has_data_suffix(pathname) {
- return pathname.endsWith(DATA_SUFFIX);
-}
-function add_data_suffix(pathname) {
- return pathname.replace(/\/$/, "") + DATA_SUFFIX;
-}
-function strip_data_suffix(pathname) {
- return pathname.slice(0, -DATA_SUFFIX.length);
-}
-function is_action_json_request(event) {
- const accept = negotiate(event.request.headers.get("accept") ?? "*/*", [
- "application/json",
- "text/html"
- ]);
- return accept === "application/json" && event.request.method === "POST";
-}
-async function handle_action_json_request(event, options2, server) {
- const actions = server?.actions;
- if (!actions) {
- const no_actions_error = error(405, "POST method not allowed. No actions exist for this page");
- return action_json(
- {
- type: "error",
- error: await handle_error_and_jsonify(event, options2, no_actions_error)
- },
- {
- status: no_actions_error.status,
- headers: {
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
- // "The server must generate an Allow header field in a 405 status code response"
- allow: "GET"
- }
- }
- );
- }
- check_named_default_separate(actions);
- try {
- const data = await call_action(event, actions);
- if (false)
- ;
- if (data instanceof ActionFailure) {
- return action_json({
- type: "failure",
- status: data.status,
- // @ts-expect-error we assign a string to what is supposed to be an object. That's ok
- // because we don't use the object outside, and this way we have better code navigation
- // through knowing where the related interface is used.
- data: stringify_action_response(
- data.data,
- /** @type {string} */
- event.route.id
- )
- });
- } else {
- return action_json({
- type: "success",
- status: data ? 200 : 204,
- // @ts-expect-error see comment above
- data: stringify_action_response(
- data,
- /** @type {string} */
- event.route.id
- )
- });
- }
- } catch (e) {
- const err = normalize_error(e);
- if (err instanceof Redirect) {
- return action_json_redirect(err);
- }
- return action_json(
- {
- type: "error",
- error: await handle_error_and_jsonify(event, options2, check_incorrect_fail_use(err))
- },
- {
- status: err instanceof HttpError ? err.status : 500
- }
- );
- }
-}
-function check_incorrect_fail_use(error2) {
- return error2 instanceof ActionFailure ? new Error('Cannot "throw fail()". Use "return fail()"') : error2;
-}
-function action_json_redirect(redirect) {
- return action_json({
- type: "redirect",
- status: redirect.status,
- location: redirect.location
- });
-}
-function action_json(data, init2) {
- return json(data, init2);
-}
-function is_action_request(event) {
- return event.request.method === "POST";
-}
-async function handle_action_request(event, server) {
- const actions = server?.actions;
- if (!actions) {
- event.setHeaders({
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
- // "The server must generate an Allow header field in a 405 status code response"
- allow: "GET"
- });
- return {
- type: "error",
- error: error(405, "POST method not allowed. No actions exist for this page")
- };
- }
- check_named_default_separate(actions);
- try {
- const data = await call_action(event, actions);
- if (false)
- ;
- if (data instanceof ActionFailure) {
- return {
- type: "failure",
- status: data.status,
- data: data.data
- };
- } else {
- return {
- type: "success",
- status: 200,
- // @ts-expect-error this will be removed upon serialization, so `undefined` is the same as omission
- data
- };
- }
- } catch (e) {
- const err = normalize_error(e);
- if (err instanceof Redirect) {
- return {
- type: "redirect",
- status: err.status,
- location: err.location
- };
- }
- return {
- type: "error",
- error: check_incorrect_fail_use(err)
- };
- }
-}
-function check_named_default_separate(actions) {
- if (actions.default && Object.keys(actions).length > 1) {
- throw new Error(
- "When using named actions, the default action cannot be used. See the docs for more info: https://kit.svelte.dev/docs/form-actions#named-actions"
- );
- }
-}
-async function call_action(event, actions) {
- const url = new URL(event.request.url);
- let name = "default";
- for (const param of url.searchParams) {
- if (param[0].startsWith("/")) {
- name = param[0].slice(1);
- if (name === "default") {
- throw new Error('Cannot use reserved action name "default"');
- }
- break;
- }
- }
- const action = actions[name];
- if (!action) {
- throw new Error(`No action with name '${name}' found`);
- }
- if (!is_form_content_type(event.request)) {
- throw new Error(
- `Actions expect form-encoded data (received ${event.request.headers.get("content-type")})`
- );
- }
- return action(event);
-}
-function validate_action_return(data) {
- if (data instanceof Redirect) {
- throw new Error("Cannot `return redirect(...)` — use `throw redirect(...)` instead");
- }
- if (data instanceof HttpError) {
- throw new Error(
- "Cannot `return error(...)` — use `throw error(...)` or `return fail(...)` instead"
- );
- }
-}
-function uneval_action_response(data, route_id) {
- return try_deserialize(data, devalue.uneval, route_id);
-}
-function stringify_action_response(data, route_id) {
- return try_deserialize(data, devalue.stringify, route_id);
-}
-function try_deserialize(data, fn, route_id) {
- try {
- return fn(data);
- } catch (e) {
- const error2 = (
- /** @type {any} */
- e
- );
- if ("path" in error2) {
- let message = `Data returned from action inside ${route_id} is not serializable: ${error2.message}`;
- if (error2.path !== "")
- message += ` (data.${error2.path})`;
- throw new Error(message);
- }
- throw error2;
- }
-}
-async function unwrap_promises(object) {
- for (const key2 in object) {
- if (typeof object[key2]?.then === "function") {
- return Object.fromEntries(
- await Promise.all(Object.entries(object).map(async ([key3, value]) => [key3, await value]))
- );
- }
- }
- return object;
-}
-const INVALIDATED_PARAM = "x-sveltekit-invalidated";
-async function load_server_data({
- event,
- state,
- node,
- parent,
- // TODO 2.0: Remove this
- track_server_fetches
-}) {
- if (!node?.server)
- return null;
- const uses = {
- dependencies: /* @__PURE__ */ new Set(),
- params: /* @__PURE__ */ new Set(),
- parent: false,
- route: false,
- url: false
- };
- const url = make_trackable(event.url, () => {
- uses.url = true;
- });
- if (state.prerendering) {
- disable_search(url);
- }
- const result = await node.server.load?.call(null, {
- ...event,
- fetch: (info, init2) => {
- const url2 = new URL(info instanceof Request ? info.url : info, event.url);
- if (track_server_fetches) {
- uses.dependencies.add(url2.href);
- }
- return event.fetch(info, init2);
- },
- /** @param {string[]} deps */
- depends: (...deps) => {
- for (const dep of deps) {
- const { href } = new URL(dep, event.url);
- uses.dependencies.add(href);
- }
- },
- params: new Proxy(event.params, {
- get: (target, key2) => {
- uses.params.add(key2);
- return target[
- /** @type {string} */
- key2
- ];
- }
- }),
- parent: async () => {
- uses.parent = true;
- return parent();
- },
- route: new Proxy(event.route, {
- get: (target, key2) => {
- uses.route = true;
- return target[
- /** @type {'id'} */
- key2
- ];
- }
- }),
- url
- });
- const data = result ? await unwrap_promises(result) : null;
- return {
- type: "data",
- data,
- uses,
- slash: node.server.trailingSlash
- };
-}
-async function load_data({
- event,
- fetched,
- node,
- parent,
- server_data_promise,
- state,
- resolve_opts,
- csr
-}) {
- const server_data_node = await server_data_promise;
- if (!node?.universal?.load) {
- return server_data_node?.data ?? null;
- }
- const result = await node.universal.load.call(null, {
- url: event.url,
- params: event.params,
- data: server_data_node?.data ?? null,
- route: event.route,
- fetch: create_universal_fetch(event, state, fetched, csr, resolve_opts),
- setHeaders: event.setHeaders,
- depends: () => {
- },
- parent
- });
- const data = result ? await unwrap_promises(result) : null;
- return data;
-}
-function create_universal_fetch(event, state, fetched, csr, resolve_opts) {
- return async (input, init2) => {
- const cloned_body = input instanceof Request && input.body ? input.clone().body : null;
- const cloned_headers = input instanceof Request && [...input.headers].length ? new Headers(input.headers) : init2?.headers;
- let response = await event.fetch(input, init2);
- const url = new URL(input instanceof Request ? input.url : input, event.url);
- const same_origin = url.origin === event.url.origin;
- let dependency;
- if (same_origin) {
- if (state.prerendering) {
- dependency = { response, body: null };
- state.prerendering.dependencies.set(url.pathname, dependency);
- }
- } else {
- const mode = input instanceof Request ? input.mode : init2?.mode ?? "cors";
- if (mode === "no-cors") {
- response = new Response("", {
- status: response.status,
- statusText: response.statusText,
- headers: response.headers
- });
- } else {
- const acao = response.headers.get("access-control-allow-origin");
- if (!acao || acao !== event.url.origin && acao !== "*") {
- throw new Error(
- `CORS error: ${acao ? "Incorrect" : "No"} 'Access-Control-Allow-Origin' header is present on the requested resource`
- );
- }
- }
- }
- const proxy = new Proxy(response, {
- get(response2, key2, _receiver) {
- async function text2() {
- const body = await response2.text();
- if (!body || typeof body === "string") {
- const status_number = Number(response2.status);
- if (isNaN(status_number)) {
- throw new Error(
- `response.status is not a number. value: "${response2.status}" type: ${typeof response2.status}`
- );
- }
- fetched.push({
- url: same_origin ? url.href.slice(event.url.origin.length) : url.href,
- method: event.request.method,
- request_body: (
- /** @type {string | ArrayBufferView | undefined} */
- input instanceof Request && cloned_body ? await stream_to_string(cloned_body) : init2?.body
- ),
- request_headers: cloned_headers,
- response_body: body,
- response: response2
- });
- }
- if (dependency) {
- dependency.body = body;
- }
- return body;
- }
- if (key2 === "arrayBuffer") {
- return async () => {
- const buffer = await response2.arrayBuffer();
- if (dependency) {
- dependency.body = new Uint8Array(buffer);
- }
- return buffer;
- };
- }
- if (key2 === "text") {
- return text2;
- }
- if (key2 === "json") {
- return async () => {
- return JSON.parse(await text2());
- };
- }
- return Reflect.get(response2, key2, response2);
- }
- });
- if (csr) {
- const get = response.headers.get;
- response.headers.get = (key2) => {
- const lower = key2.toLowerCase();
- const value = get.call(response.headers, lower);
- if (value && !lower.startsWith("x-sveltekit-")) {
- const included = resolve_opts.filterSerializedResponseHeaders(lower, value);
- if (!included) {
- throw new Error(
- `Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route.id})`
- );
- }
- }
- return value;
- };
- }
- return proxy;
- };
-}
-async function stream_to_string(stream) {
- let result = "";
- const reader = stream.getReader();
- const decoder = new TextDecoder();
- while (true) {
- const { done, value } = await reader.read();
- if (done) {
- break;
- }
- result += decoder.decode(value);
- }
- return result;
-}
-const subscriber_queue = [];
-function readable(value, start) {
- return {
- subscribe: writable(value, start).subscribe
- };
-}
-function writable(value, start = noop) {
- let stop;
- const subscribers = /* @__PURE__ */ new Set();
- function set(new_value) {
- if (safe_not_equal(value, new_value)) {
- value = new_value;
- if (stop) {
- const run_queue = !subscriber_queue.length;
- for (const subscriber of subscribers) {
- subscriber[1]();
- subscriber_queue.push(subscriber, value);
- }
- if (run_queue) {
- for (let i = 0; i < subscriber_queue.length; i += 2) {
- subscriber_queue[i][0](subscriber_queue[i + 1]);
- }
- subscriber_queue.length = 0;
- }
- }
- }
- }
- function update(fn) {
- set(fn(value));
- }
- function subscribe(run, invalidate = noop) {
- const subscriber = [run, invalidate];
- subscribers.add(subscriber);
- if (subscribers.size === 1) {
- stop = start(set, update) || noop;
- }
- run(value);
- return () => {
- subscribers.delete(subscriber);
- if (subscribers.size === 0 && stop) {
- stop();
- stop = null;
- }
- };
- }
- return { set, update, subscribe };
-}
-function hash(...values) {
- let hash2 = 5381;
- for (const value of values) {
- if (typeof value === "string") {
- let i = value.length;
- while (i)
- hash2 = hash2 * 33 ^ value.charCodeAt(--i);
- } else if (ArrayBuffer.isView(value)) {
- const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
- let i = buffer.length;
- while (i)
- hash2 = hash2 * 33 ^ buffer[--i];
- } else {
- throw new TypeError("value must be a string or TypedArray");
- }
- }
- return (hash2 >>> 0).toString(36);
-}
-const escape_html_attr_dict = {
- "&": "&",
- '"': """
-};
-const escape_html_attr_regex = new RegExp(
- // special characters
- `[${Object.keys(escape_html_attr_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`,
- "g"
-);
-function escape_html_attr(str) {
- const escaped_str = str.replace(escape_html_attr_regex, (match) => {
- if (match.length === 2) {
- return match;
- }
- return escape_html_attr_dict[match] ?? `${match.charCodeAt(0)};`;
- });
- return `"${escaped_str}"`;
-}
-const replacements = {
- "<": "\\u003C",
- "\u2028": "\\u2028",
- "\u2029": "\\u2029"
-};
-const pattern = new RegExp(`[${Object.keys(replacements).join("")}]`, "g");
-function serialize_data(fetched, filter, prerendering = false) {
- const headers = {};
- let cache_control = null;
- let age = null;
- let varyAny = false;
- for (const [key2, value] of fetched.response.headers) {
- if (filter(key2, value)) {
- headers[key2] = value;
- }
- if (key2 === "cache-control")
- cache_control = value;
- else if (key2 === "age")
- age = value;
- else if (key2 === "vary" && value.trim() === "*")
- varyAny = true;
- }
- const payload = {
- status: fetched.response.status,
- statusText: fetched.response.statusText,
- headers,
- body: fetched.response_body
- };
- const safe_payload = JSON.stringify(payload).replace(pattern, (match) => replacements[match]);
- const attrs = [
- 'type="application/json"',
- "data-sveltekit-fetched",
- `data-url=${escape_html_attr(fetched.url)}`
- ];
- if (fetched.request_headers || fetched.request_body) {
- const values = [];
- if (fetched.request_headers) {
- values.push([...new Headers(fetched.request_headers)].join(","));
- }
- if (fetched.request_body) {
- values.push(fetched.request_body);
- }
- attrs.push(`data-hash="${hash(...values)}"`);
- }
- if (!prerendering && fetched.method === "GET" && cache_control && !varyAny) {
- const match = /s-maxage=(\d+)/g.exec(cache_control) ?? /max-age=(\d+)/g.exec(cache_control);
- if (match) {
- const ttl = +match[1] - +(age ?? "0");
- attrs.push(`data-ttl="${ttl}"`);
- }
- }
- return `
-
-