@mxtommy/kip 4.8.1 → 4.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -3
- package/package.json +27 -4
- package/public/{chunk-Bp0MQwPM.js → chunk-07zHjmg-.js} +1 -1
- package/public/{chunk-AANk-NXH.js → chunk-0z3nIRXw.js} +3 -3
- package/public/{chunk-sNakMDHi.js → chunk-B09jfNia.js} +1 -1
- package/public/{chunk-DDqeRiB0.js → chunk-B0D54iJs.js} +1 -1
- package/public/{chunk-BwOIef42.js → chunk-B0eE4udE.js} +1 -1
- package/public/{chunk-BX6skw5k.js → chunk-B9nVBlGj.js} +1 -1
- package/public/{chunk-C2VQxCXa.js → chunk-BFpzxIIT.js} +1 -1
- package/public/{chunk-Dxlia2NE.js → chunk-BIb-xYiS.js} +1 -1
- package/public/{chunk-dgaOX1wC.js → chunk-BJ-wyixK.js} +1 -1
- package/public/chunk-BLEZOsfR.js +1 -0
- package/public/{chunk-CNMFlw_H.js → chunk-BN7A4g6c.js} +1 -1
- package/public/{chunk-By8ZVvDx.js → chunk-BTOTKeBo.js} +1 -1
- package/public/{chunk-BoNDCNGE.js → chunk-BUguZ7cK.js} +1 -1
- package/public/{chunk-DE4ylhpq.js → chunk-BZx964-p.js} +1 -1
- package/public/{chunk-CNNTuNlM.js → chunk-BeM64etA.js} +1 -1
- package/public/chunk-BfiyH3nV.js +1 -0
- package/public/{chunk-Ii9n-oiL.js → chunk-BjINKQ03.js} +1 -1
- package/public/{chunk-MjWuPUhu.js → chunk-BpcNrtxJ.js} +1 -1
- package/public/{chunk-CkXTl3su.js → chunk-BuvyF0y5.js} +1 -1
- package/public/{chunk-BKj60jdq.js → chunk-C6b8CVno.js} +1 -1
- package/public/{chunk-hd2_AKwt.js → chunk-CCfhzpE8.js} +1 -1
- package/public/{chunk-nu4vZg-z.js → chunk-CHAFm_nM.js} +1 -1
- package/public/{chunk-5U8d2Ygo.js → chunk-CIGP2YJm.js} +1 -1
- package/public/{chunk-JbEkcxJm.js → chunk-CLTHuhlN.js} +1 -1
- package/public/{chunk-CwSa_BNV.js → chunk-CLs_NL1y.js} +1 -1
- package/public/{chunk-DNS-qsFC.js → chunk-COI6IBXH.js} +1 -1
- package/public/{chunk-CpuB_ZZz.js → chunk-CQMVIDcp.js} +1 -1
- package/public/{chunk-00hwknVI.js → chunk-CXvWM_vF.js} +1 -1
- package/public/{chunk-BdokyhBM.js → chunk-CYYBxjrc.js} +1 -1
- package/public/{chunk-DzTTqoF_.js → chunk-C_OZJltF.js} +1 -1
- package/public/{chunk-DQnoPLyC.js → chunk-Co2wVrD6.js} +1 -1
- package/public/{chunk-CXvG8mMq.js → chunk-CoCQ3DW2.js} +1 -1
- package/public/{chunk-DchvLV_Y.js → chunk-CxPx4NZv.js} +1 -1
- package/public/{chunk-CA6RRaxd.js → chunk-CyVRpGoJ.js} +1 -1
- package/public/{chunk-CL2xiH57.js → chunk-D-_-GUVr.js} +1 -1
- package/public/{chunk-C6UXF7BI.js → chunk-D1HYfaL_.js} +1 -1
- package/public/{chunk-DjZgzSiH.js → chunk-D2953Rfp.js} +1 -1
- package/public/{chunk-BJz7Ij9E.js → chunk-DIl1k00y.js} +1 -1
- package/public/{chunk-B6bEhzNR.js → chunk-DPnbM-aB.js} +1 -1
- package/public/{chunk-CIlfzV9R.js → chunk-DTN-sa1K.js} +1 -1
- package/public/{chunk-BOAD0N2a.js → chunk-DUEKoZhd.js} +1 -1
- package/public/{chunk-DumLX5k_.js → chunk-DmkAKXR1.js} +1 -1
- package/public/chunk-Do8wqING.js +1 -0
- package/public/{chunk-DXkKj21H.js → chunk-JhFkJS7i.js} +1 -1
- package/public/{chunk-B82ADJSs.js → chunk-OeQDZKFO.js} +1 -1
- package/public/{chunk-PheXEqie.js → chunk-_zRMMvCu.js} +1 -1
- package/public/{chunk-CrBxxZCe.js → chunk-eQ1pa34Q.js} +1 -1
- package/public/{chunk-D4xZ2tGB.js → chunk-ibauGmSP.js} +1 -1
- package/public/{chunk-VgxMqRPk.js → chunk-otzyItXL.js} +1 -1
- package/public/{chunk-BQr-tSkv.js → chunk-q9NoPvcx.js} +1 -1
- package/public/{chunk-DWLISAZi.js → chunk-szQs8fiq.js} +1 -1
- package/public/{chunk-tAiV3ARh.js → chunk-x7L6DXVK.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-BAV5VDOD.js → main-YKDNK5VZ.js} +20 -20
- package/plugin/history-series.service.js +0 -637
- package/plugin/index.js +0 -1322
- package/plugin/kip-series-contract.js +0 -31
- package/plugin/openApi.json +0 -855
- package/plugin/sqlite-history-storage.service.js +0 -1124
- package/plugin/src/history-series.service.js +0 -634
- package/plugin/src/index.js +0 -1322
- package/plugin/src/kip-series-contract.js +0 -31
- package/plugin/src/openApi.json +0 -855
- package/plugin/src/sqlite-history-storage.service.js +0 -1122
- package/public/chunk-Blokg6Ds.js +0 -1
- package/public/chunk-CpMCBDvH.js +0 -1
- package/public/chunk-y1imvaA-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,e as e$1}from'./chunk-B6bEhzNR.js';import {g as ge$1}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-BAV5VDOD.js';import {c,e}from'./chunk-Dxlia2NE.js';var ie=["alternatorSvg"];function oe(d,e){d&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No alternators detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K alternator paths or select alternators in widget settings."),ul()());}function ne(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Z=class d{static ALTERNATOR_DESCRIPTOR=a("widget-alternator");static SELF_ROOT_PATH=(()=>{let e=d.ALTERNATOR_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetAlternatorComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${d.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${ne(d.SELF_ROOT_PATH)}\\.([^.]+)\\.(.+)$`);static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,alternator:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("alternatorSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredAlternatorIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["voltage","current","power","revolutions"]});alternatorsByKey=vt({});visibleAlternatorKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(i=>i.key);let r=this.alternatorsByKey(),t=new Set(this.discoveredAlternatorIds());return Object.keys(r).filter(i=>{let a=r[i];return !!a&&t.has(a.id)}).sort((i,a)=>i.localeCompare(a))});visibleAlternators=Dt(()=>{let e=this.visibleAlternatorKeys(),r=this.alternatorsByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasAlternators=Dt(()=>this.visibleAlternators().length>0);activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleAlternators();return e.length!==1?"Alternators":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e$1=this.visibleAlternators(),r=this.theme(),t=this.widgetColors(),i=this.ignoreZones(),a=new Map;e$1.forEach(o=>a.set(o.id,(a.get(o.id)??0)+1));let l=new Set([...a.entries()].filter(([,o])=>o>1).map(([o])=>o)),s={};for(let o of e$1){let c=o.deviceKey??o.id,n=!!o.source&&l.has(o.id),p=this.resolveMostSevereState(o.powerState??null,o.currentState??null,o.voltageState??null,o.temperatureState??null,o.chargingModeState??null,o.revolutionsState??null,o.fieldDriveState??null,o.regulatorTemperatureState??null),T=this.resolveMostSevereState(o.voltageState??null,o.currentState??null),C=this.resolveMostSevereState(o.powerState??null,o.revolutionsState??null,o.temperatureState??null,o.regulatorTemperatureState??null),[u,I]=this.buildMetricRows(o);s[c]={id:o.id,titleText:this.resolveTitleText(o),modeText:this.isCompactCardMode()?"":this.resolveModeText(o),busText:this.isCompactCardMode()?"":n?o.source??"-":o.associatedBus||o.location||"-",metricsLineOne:u,metricsLineTwo:I,stateBarColor:e(p,t?.dim??"var(--kip-contrast-color)",r,i),titleTextColor:e(p,"var(--kip-contrast-color)",r,i),metaTextColor:e(this.resolveMostSevereState(o.chargingModeState??null,o.fieldDriveState??null),"var(--kip-contrast-dim-color)",r,i),primaryMetricsTextColor:e(T,"var(--kip-contrast-color)",r,i),secondaryMetricsTextColor:e(C,"var(--kip-contrast-color)",r,i)};}return s});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleAlternators(),a=this.widgetColors();!this.svg||!a||this.requestRender({alternators:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(d.ROOT_PATTERN)],r=false;for(let t of e)if(t.initial.length){r=true;for(let i of t.initial)this.enqueuePathUpdate(i,true);}r&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(i=>{this.enqueuePathUpdate(i);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${d.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Alternator View"),this.layer=this.svg.append("g").attr("class","alternator-layer");}applyConfig(e){let r=this.resolveAlternatorConfig(e);this.trackedDevices.set(r.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(r.trackedDevices??[]),this.optionsById.set(r.optionsById),this.cardMode.set(this.normalizeCardMode(r.cardMode));}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map;e.forEach(t=>{let i=r.get(t.id)??[];i.push(t.key),r.set(t.id,i);}),this.alternatorsByKey.update(t=>{let i=t,a=false;return r.forEach((l,s)=>{let o=t[s];if(o){for(let c of l){if(t[c])continue;let n=e.find(p=>p.key===c);a||(i=G({},t),a=true),i[c]=z(G({},o),{source:n?.source??null,deviceKey:c});}a&&i[s]?.deviceKey===void 0&&delete i[s];}}),a?i:t});}resolveAlternatorConfig(e){let r=e.alternator,t=this.normalizeOptionsById(r?.optionsById??r?.alternatorOptionsById);return {trackedDevices:this.normalizeTrackedDevices(r?.trackedDevices),optionsById:t,cardMode:this.normalizeCardMode(r?.cardMode)}}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let i=t,a=this.normalizeOptionalString(i.id),l=this.normalizeOptionalString(i.source);if(!a||!l)return;let s=this.normalizeOptionalString(i.key)??`${a}||${l}`;r.set(s,{id:a,source:l,key:s});}),[...r.values()].sort((t,i)=>t.key.localeCompare(i.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(r=>{let t=e.get(r.id)??[];t.push(r.key),e.set(r.id,t);}),e}normalizeCardMode(e){let r=e&&typeof e=="object"?e:null;if(!r)return {displayMode:"full",metrics:["voltage","current","power","revolutions"]};let t=this.normalizeStringList(r?.metrics);return {displayMode:r?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["voltage","current","power","revolutions"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let r=new Set;return e.forEach(t=>{if(typeof t!="string")return;let i=t.trim();i.length>0&&r.add(i);}),[...r].sort((t,i)=>t.localeCompare(i))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let r={};return Object.entries(e).forEach(([t])=>{let i=this.normalizeOptionalString(t);i&&(r[i]={});}),r}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parsePath(e.path);if(!t)return;let i=e.update?.data?.value??null,a=e.update?.state??null,l=`${t.id}::${t.key}`;if(this.pendingPathUpdates.set(l,{id:t.id,key:t.key,value:i,state:a}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},d.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(d.PATH_REGEX);return r?{id:r[1],key:r[2]}:null}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(i=>i.id)).forEach(i=>this.trackDiscoveredAlternator(i));let t=this.buildIdToDeviceKeysMap();this.alternatorsByKey.update(i=>{let a=i,l=false;for(let s of e){let o=t.get(s.id),c=o?.length?o:[s.id];for(let n of c){let p=!!o?.length,T=p?this.trackedDevices().find(Q=>Q.key===n):null,C=a[n]??{id:s.id,source:T?.source??null,deviceKey:p?n:void 0},u=G({},C);if(!this.applyValue(u,s.key,s.value,s.state))continue;let D=u.rawPower!=null?u.rawPower:u.voltage!=null&&u.current!=null?u.voltage*u.current:null;D!=null?u.power=Number.isFinite(D)?D:null:u.power=null,u.rawPower==null&&(u.powerState=this.resolveMostSevereState(u.voltageState??null,u.currentState??null)),l||(a=G({},a),l=true),a[n]=u;}}return l?a:i});}trackDiscoveredAlternator(e){let r=this.discoveredAlternatorIds();r.includes(e)||this.discoveredAlternatorIds.set([...r,e].sort((t,i)=>t.localeCompare(i)));}applyValue(e,r,t,i){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),i);case "voltage":return this.setMetricValue(e,"voltage","voltageState",this.toNumber(t,"V"),i);case "current":return this.setMetricValue(e,"current","currentState",this.toNumber(t,"A"),i);case "power":case "realPower":return this.setMetricValue(e,"rawPower","powerState",this.toNumber(t,"W"),i);case "temperature":return this.setMetricValue(e,"temperature","temperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "revolutions":return this.setMetricValue(e,"revolutions","revolutionsState",this.toNumber(t,"Hz"),i);case "fieldDrive":return this.setMetricValue(e,"fieldDrive","fieldDriveState",this.toNumber(t,"%"),i);case "regulatorTemperature":return this.setMetricValue(e,"regulatorTemperature","regulatorTemperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "setpointVoltage":return this.setMetricValue(e,"setpointVoltage","setpointVoltageState",this.toNumber(t,"V"),i);case "setpointCurrent":return this.setMetricValue(e,"setpointCurrent","setpointCurrentState",this.toNumber(t,"A"),i);default:return false}}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}setMetricValue(e,r,t,i,a){let l=!Object.is(e[r],i),s=!Object.is(e[t],a);return !l&&!s?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{alternators:this.visibleAlternators(),displayModels:this.displayModels(),widgetColors:r},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e$1,i=r?d.COMPACT_CARD_HEIGHT:d.CARD_HEIGHT,a=e.alternators.map((n,p)=>({key:n.deviceKey??n.id,alternator:n,y:p*(i+d.CARD_GAP)})),l=a.length?a[a.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${l}`);let s=this.layer.selectAll("g.alternator-card").data(a,n=>n.key),o=s.enter().append("g").attr("class","alternator-card");o.append("rect").attr("class","alternator-card-bg"),o.append("rect").attr("class","alternator-state-bar"),o.append("text").attr("class","alternator-title"),o.append("text").attr("class","alternator-id"),o.append("text").attr("class","alternator-mode"),o.append("text").attr("class","alternator-bus"),o.append("text").attr("class","alternator-metrics-1"),o.append("text").attr("class","alternator-metrics-2");let c=o.merge(s);c.attr("transform",n=>`translate(0, ${n.y})`),c.select("rect.alternator-card-bg").attr("x",.5).attr("y",.5).attr("rx",t.cardCornerRadius).attr("ry",t.cardCornerRadius).attr("width",d.VIEWBOX_WIDTH-1).attr("height",i-1).attr("stroke","var(--mat-sys-outline-variant)").attr("stroke-width",.5).attr("fill","none"),c.select("rect.alternator-state-bar").attr("x",1.5).attr("y",1.5).attr("rx",t.stateBarCornerRadius).attr("ry",t.stateBarCornerRadius).attr("width",3).attr("height",i-3).attr("fill",n=>e.displayModels[n.key]?.stateBarColor??e.widgetColors.dim),e.alternators.length>1?c.select("text.alternator-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill",n=>e.displayModels[n.key]?.titleTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.titleText??this.resolveTitleText(n.alternator)):c.select("text.alternator-title").text(""),c.select("text.alternator-id").attr("x",t.idX).attr("y",t.idY).attr("text-anchor","end").attr("font-size",t.idFontSize).attr("fill","var(--kip-contrast-dim-color)").text(n=>n.alternator.id),c.select("text.alternator-mode").attr("x",t.metaLeftX).attr("y",t.metaY).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.modeText??""),c.select("text.alternator-bus").attr("x",t.metaRightX).attr("y",t.metaY).attr("text-anchor","end").attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.busText??""),c.select("text.alternator-metrics-1").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",n=>e.displayModels[n.key]?.primaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineOne??""),c.select("text.alternator-metrics-2").attr("x",t.lineTwoX).attr("y",t.lineTwoY).attr("font-size",t.lineTwoFontSize).attr("opacity",.85).attr("fill",n=>e.displayModels[n.key]?.secondaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineTwo??""),s.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`Alternator ${e.id}`}resolveModeText(e){return e.chargingMode?`Mode ${e.chargingMode}`:e.fieldDrive!=null?`Field ${e.fieldDrive.toFixed(0)} %`:"Mode -"}buildMetricRows(e){let r=this.cardMode();if(this.activeDisplayMode()==="full")return [`V ${this.formatValue(e.voltage,"V")} A ${this.formatValue(e.current,"A")}`,`P ${this.formatValue(e.power,"W")} RPM ${this.formatRevolutions(e.revolutions)}`];let t=r.metrics.map(l=>this.toMetricLabel(l,e)).filter(l=>!!l);if(!t.length)return ["V - A -","P - RPM -"];let i=t.slice(0,2).join(" "),a=t.slice(2,4).join(" ");return [i||" ",a||" "]}toMetricLabel(e,r){switch(e){case "voltage":return `V ${this.formatValue(r.voltage,"V")}`;case "current":return `A ${this.formatValue(r.current,"A")}`;case "power":return `P ${this.formatValue(r.power,"W")}`;case "temperature":return `T ${this.formatTemperature(r.temperature)}`;case "revolutions":return `RPM ${this.formatRevolutions(r.revolutions)}`;case "fieldDrive":return `FD ${this.formatPercent(r.fieldDrive)}`;case "regulatorTemperature":return `RT ${this.formatTemperature(r.regulatorTemperature)}`;default:return null}}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${r}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`}formatRevolutions(e){return e==null||Number.isNaN(e)?"-":Math.round(e*60).toString()}formatPercent(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)} %`}toStringValue(e){return typeof e=="string"?e:null}resolveMostSevereState(...e){return e.some(r=>r===n$1.Alert)?n$1.Alert:e.some(r=>r===n$1.Alarm)?n$1.Alarm:e.some(r=>r===n$1.Warn)?n$1.Warn:e.some(r=>r===n$1.Normal)?n$1.Normal:null}toNumber(e,r){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let i=this.units.convertToUnit(r,t);return Number.isFinite(i)?i:t}static \u0275fac=function(r){return new(r||d)};static \u0275cmp=JD({type:d,selectors:[["widget-alternator"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ie,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["alternatorSvg",""],[3,"text","color"],["aria-hidden","false",1,"alternator-svg"],[1,"alternator-empty"],[1,"alternator-empty-title"],[1,"alternator-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,oe,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasAlternators()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.alternator-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.alternator-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.alternator-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.alternator-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{Z as WidgetAlternatorComponent};
|
|
1
|
+
import {C,e as e$1}from'./chunk-DPnbM-aB.js';import {g as ge$1}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-YKDNK5VZ.js';import {c,e}from'./chunk-BIb-xYiS.js';var ie=["alternatorSvg"];function oe(d,e){d&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No alternators detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K alternator paths or select alternators in widget settings."),ul()());}function ne(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Z=class d{static ALTERNATOR_DESCRIPTOR=a("widget-alternator");static SELF_ROOT_PATH=(()=>{let e=d.ALTERNATOR_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetAlternatorComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${d.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${ne(d.SELF_ROOT_PATH)}\\.([^.]+)\\.(.+)$`);static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,alternator:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("alternatorSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredAlternatorIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["voltage","current","power","revolutions"]});alternatorsByKey=vt({});visibleAlternatorKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(i=>i.key);let r=this.alternatorsByKey(),t=new Set(this.discoveredAlternatorIds());return Object.keys(r).filter(i=>{let a=r[i];return !!a&&t.has(a.id)}).sort((i,a)=>i.localeCompare(a))});visibleAlternators=Dt(()=>{let e=this.visibleAlternatorKeys(),r=this.alternatorsByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasAlternators=Dt(()=>this.visibleAlternators().length>0);activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleAlternators();return e.length!==1?"Alternators":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e$1=this.visibleAlternators(),r=this.theme(),t=this.widgetColors(),i=this.ignoreZones(),a=new Map;e$1.forEach(o=>a.set(o.id,(a.get(o.id)??0)+1));let l=new Set([...a.entries()].filter(([,o])=>o>1).map(([o])=>o)),s={};for(let o of e$1){let c=o.deviceKey??o.id,n=!!o.source&&l.has(o.id),p=this.resolveMostSevereState(o.powerState??null,o.currentState??null,o.voltageState??null,o.temperatureState??null,o.chargingModeState??null,o.revolutionsState??null,o.fieldDriveState??null,o.regulatorTemperatureState??null),T=this.resolveMostSevereState(o.voltageState??null,o.currentState??null),C=this.resolveMostSevereState(o.powerState??null,o.revolutionsState??null,o.temperatureState??null,o.regulatorTemperatureState??null),[u,I]=this.buildMetricRows(o);s[c]={id:o.id,titleText:this.resolveTitleText(o),modeText:this.isCompactCardMode()?"":this.resolveModeText(o),busText:this.isCompactCardMode()?"":n?o.source??"-":o.associatedBus||o.location||"-",metricsLineOne:u,metricsLineTwo:I,stateBarColor:e(p,t?.dim??"var(--kip-contrast-color)",r,i),titleTextColor:e(p,"var(--kip-contrast-color)",r,i),metaTextColor:e(this.resolveMostSevereState(o.chargingModeState??null,o.fieldDriveState??null),"var(--kip-contrast-dim-color)",r,i),primaryMetricsTextColor:e(T,"var(--kip-contrast-color)",r,i),secondaryMetricsTextColor:e(C,"var(--kip-contrast-color)",r,i)};}return s});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleAlternators(),a=this.widgetColors();!this.svg||!a||this.requestRender({alternators:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(d.ROOT_PATTERN)],r=false;for(let t of e)if(t.initial.length){r=true;for(let i of t.initial)this.enqueuePathUpdate(i,true);}r&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(i=>{this.enqueuePathUpdate(i);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${d.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Alternator View"),this.layer=this.svg.append("g").attr("class","alternator-layer");}applyConfig(e){let r=this.resolveAlternatorConfig(e);this.trackedDevices.set(r.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(r.trackedDevices??[]),this.optionsById.set(r.optionsById),this.cardMode.set(this.normalizeCardMode(r.cardMode));}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map;e.forEach(t=>{let i=r.get(t.id)??[];i.push(t.key),r.set(t.id,i);}),this.alternatorsByKey.update(t=>{let i=t,a=false;return r.forEach((l,s)=>{let o=t[s];if(o){for(let c of l){if(t[c])continue;let n=e.find(p=>p.key===c);a||(i=G({},t),a=true),i[c]=z(G({},o),{source:n?.source??null,deviceKey:c});}a&&i[s]?.deviceKey===void 0&&delete i[s];}}),a?i:t});}resolveAlternatorConfig(e){let r=e.alternator,t=this.normalizeOptionsById(r?.optionsById??r?.alternatorOptionsById);return {trackedDevices:this.normalizeTrackedDevices(r?.trackedDevices),optionsById:t,cardMode:this.normalizeCardMode(r?.cardMode)}}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let i=t,a=this.normalizeOptionalString(i.id),l=this.normalizeOptionalString(i.source);if(!a||!l)return;let s=this.normalizeOptionalString(i.key)??`${a}||${l}`;r.set(s,{id:a,source:l,key:s});}),[...r.values()].sort((t,i)=>t.key.localeCompare(i.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(r=>{let t=e.get(r.id)??[];t.push(r.key),e.set(r.id,t);}),e}normalizeCardMode(e){let r=e&&typeof e=="object"?e:null;if(!r)return {displayMode:"full",metrics:["voltage","current","power","revolutions"]};let t=this.normalizeStringList(r?.metrics);return {displayMode:r?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["voltage","current","power","revolutions"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let r=new Set;return e.forEach(t=>{if(typeof t!="string")return;let i=t.trim();i.length>0&&r.add(i);}),[...r].sort((t,i)=>t.localeCompare(i))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let r={};return Object.entries(e).forEach(([t])=>{let i=this.normalizeOptionalString(t);i&&(r[i]={});}),r}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parsePath(e.path);if(!t)return;let i=e.update?.data?.value??null,a=e.update?.state??null,l=`${t.id}::${t.key}`;if(this.pendingPathUpdates.set(l,{id:t.id,key:t.key,value:i,state:a}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},d.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(d.PATH_REGEX);return r?{id:r[1],key:r[2]}:null}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(i=>i.id)).forEach(i=>this.trackDiscoveredAlternator(i));let t=this.buildIdToDeviceKeysMap();this.alternatorsByKey.update(i=>{let a=i,l=false;for(let s of e){let o=t.get(s.id),c=o?.length?o:[s.id];for(let n of c){let p=!!o?.length,T=p?this.trackedDevices().find(Q=>Q.key===n):null,C=a[n]??{id:s.id,source:T?.source??null,deviceKey:p?n:void 0},u=G({},C);if(!this.applyValue(u,s.key,s.value,s.state))continue;let D=u.rawPower!=null?u.rawPower:u.voltage!=null&&u.current!=null?u.voltage*u.current:null;D!=null?u.power=Number.isFinite(D)?D:null:u.power=null,u.rawPower==null&&(u.powerState=this.resolveMostSevereState(u.voltageState??null,u.currentState??null)),l||(a=G({},a),l=true),a[n]=u;}}return l?a:i});}trackDiscoveredAlternator(e){let r=this.discoveredAlternatorIds();r.includes(e)||this.discoveredAlternatorIds.set([...r,e].sort((t,i)=>t.localeCompare(i)));}applyValue(e,r,t,i){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),i);case "voltage":return this.setMetricValue(e,"voltage","voltageState",this.toNumber(t,"V"),i);case "current":return this.setMetricValue(e,"current","currentState",this.toNumber(t,"A"),i);case "power":case "realPower":return this.setMetricValue(e,"rawPower","powerState",this.toNumber(t,"W"),i);case "temperature":return this.setMetricValue(e,"temperature","temperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "revolutions":return this.setMetricValue(e,"revolutions","revolutionsState",this.toNumber(t,"Hz"),i);case "fieldDrive":return this.setMetricValue(e,"fieldDrive","fieldDriveState",this.toNumber(t,"%"),i);case "regulatorTemperature":return this.setMetricValue(e,"regulatorTemperature","regulatorTemperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "setpointVoltage":return this.setMetricValue(e,"setpointVoltage","setpointVoltageState",this.toNumber(t,"V"),i);case "setpointCurrent":return this.setMetricValue(e,"setpointCurrent","setpointCurrentState",this.toNumber(t,"A"),i);default:return false}}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}setMetricValue(e,r,t,i,a){let l=!Object.is(e[r],i),s=!Object.is(e[t],a);return !l&&!s?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{alternators:this.visibleAlternators(),displayModels:this.displayModels(),widgetColors:r},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e$1,i=r?d.COMPACT_CARD_HEIGHT:d.CARD_HEIGHT,a=e.alternators.map((n,p)=>({key:n.deviceKey??n.id,alternator:n,y:p*(i+d.CARD_GAP)})),l=a.length?a[a.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${l}`);let s=this.layer.selectAll("g.alternator-card").data(a,n=>n.key),o=s.enter().append("g").attr("class","alternator-card");o.append("rect").attr("class","alternator-card-bg"),o.append("rect").attr("class","alternator-state-bar"),o.append("text").attr("class","alternator-title"),o.append("text").attr("class","alternator-id"),o.append("text").attr("class","alternator-mode"),o.append("text").attr("class","alternator-bus"),o.append("text").attr("class","alternator-metrics-1"),o.append("text").attr("class","alternator-metrics-2");let c=o.merge(s);c.attr("transform",n=>`translate(0, ${n.y})`),c.select("rect.alternator-card-bg").attr("x",.5).attr("y",.5).attr("rx",t.cardCornerRadius).attr("ry",t.cardCornerRadius).attr("width",d.VIEWBOX_WIDTH-1).attr("height",i-1).attr("stroke","var(--mat-sys-outline-variant)").attr("stroke-width",.5).attr("fill","none"),c.select("rect.alternator-state-bar").attr("x",1.5).attr("y",1.5).attr("rx",t.stateBarCornerRadius).attr("ry",t.stateBarCornerRadius).attr("width",3).attr("height",i-3).attr("fill",n=>e.displayModels[n.key]?.stateBarColor??e.widgetColors.dim),e.alternators.length>1?c.select("text.alternator-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill",n=>e.displayModels[n.key]?.titleTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.titleText??this.resolveTitleText(n.alternator)):c.select("text.alternator-title").text(""),c.select("text.alternator-id").attr("x",t.idX).attr("y",t.idY).attr("text-anchor","end").attr("font-size",t.idFontSize).attr("fill","var(--kip-contrast-dim-color)").text(n=>n.alternator.id),c.select("text.alternator-mode").attr("x",t.metaLeftX).attr("y",t.metaY).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.modeText??""),c.select("text.alternator-bus").attr("x",t.metaRightX).attr("y",t.metaY).attr("text-anchor","end").attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.busText??""),c.select("text.alternator-metrics-1").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",n=>e.displayModels[n.key]?.primaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineOne??""),c.select("text.alternator-metrics-2").attr("x",t.lineTwoX).attr("y",t.lineTwoY).attr("font-size",t.lineTwoFontSize).attr("opacity",.85).attr("fill",n=>e.displayModels[n.key]?.secondaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineTwo??""),s.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`Alternator ${e.id}`}resolveModeText(e){return e.chargingMode?`Mode ${e.chargingMode}`:e.fieldDrive!=null?`Field ${e.fieldDrive.toFixed(0)} %`:"Mode -"}buildMetricRows(e){let r=this.cardMode();if(this.activeDisplayMode()==="full")return [`V ${this.formatValue(e.voltage,"V")} A ${this.formatValue(e.current,"A")}`,`P ${this.formatValue(e.power,"W")} RPM ${this.formatRevolutions(e.revolutions)}`];let t=r.metrics.map(l=>this.toMetricLabel(l,e)).filter(l=>!!l);if(!t.length)return ["V - A -","P - RPM -"];let i=t.slice(0,2).join(" "),a=t.slice(2,4).join(" ");return [i||" ",a||" "]}toMetricLabel(e,r){switch(e){case "voltage":return `V ${this.formatValue(r.voltage,"V")}`;case "current":return `A ${this.formatValue(r.current,"A")}`;case "power":return `P ${this.formatValue(r.power,"W")}`;case "temperature":return `T ${this.formatTemperature(r.temperature)}`;case "revolutions":return `RPM ${this.formatRevolutions(r.revolutions)}`;case "fieldDrive":return `FD ${this.formatPercent(r.fieldDrive)}`;case "regulatorTemperature":return `RT ${this.formatTemperature(r.regulatorTemperature)}`;default:return null}}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${r}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`}formatRevolutions(e){return e==null||Number.isNaN(e)?"-":Math.round(e*60).toString()}formatPercent(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)} %`}toStringValue(e){return typeof e=="string"?e:null}resolveMostSevereState(...e){return e.some(r=>r===n$1.Alert)?n$1.Alert:e.some(r=>r===n$1.Alarm)?n$1.Alarm:e.some(r=>r===n$1.Warn)?n$1.Warn:e.some(r=>r===n$1.Normal)?n$1.Normal:null}toNumber(e,r){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let i=this.units.convertToUnit(r,t);return Number.isFinite(i)?i:t}static \u0275fac=function(r){return new(r||d)};static \u0275cmp=JD({type:d,selectors:[["widget-alternator"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ie,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["alternatorSvg",""],[3,"text","color"],["aria-hidden","false",1,"alternator-svg"],[1,"alternator-empty"],[1,"alternator-empty-title"],[1,"alternator-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,oe,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasAlternators()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.alternator-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.alternator-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.alternator-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.alternator-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{Z as WidgetAlternatorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {ad as Qe,w,a6 as Lr,ak as nw}from'./main-
|
|
1
|
+
import {ad as Qe,w,a6 as Lr,ak as nw}from'./main-YKDNK5VZ.js';var u=(()=>{class t{resizeChange=new Qe;kipResize=new Qe;el=w(Lr);ro=null;constructor(){this.ro=new ResizeObserver(i=>{let e=i[i.length-1],{width:c,height:h}=e.contentRect;this.resizeChange.emit(e),this.kipResize.emit({width:c,height:h,entry:e});}),this.ro.observe(this.el.nativeElement);}ngOnDestroy(){this.ro?.disconnect(),this.ro=null;}static \u0275fac=function(e){return new(e||t)};static \u0275dir=nw({type:t,selectors:[["","kipResizeObserver",""]],outputs:{resizeChange:"resizeChange",kipResize:"kipResize"}})}return t})();export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d1 as Hj,w,du as p,dv as rt,aZ as
|
|
1
|
+
import {d1 as Hj,w,du as p,dv as rt,aZ as R,$ as $j,v as vt,D as Dt,F as Fa,dn as ge,J as JD,cp as Uh,f as eg,K as Kw}from'./main-YKDNK5VZ.js';import {c}from'./chunk-BIb-xYiS.js';var P=["canvasMainRef"],B=(()=>{class s{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);streams=w(rt);canvas=w(R);canvasRef=$j.required("canvasMainRef");canvasElement=null;ctx=null;cssWidth=0;cssHeight=0;titleBitmap=null;titleBitmapText=null;titleBitmapColor=null;maxTextWidth=0;maxTextHeight=0;middle=0;center=0;fontSizeOffset=0;latPos="";longPos="";labelColor=vt("");valueColor="";normalizedConfig=Dt(()=>this.runtime.options()??s.DEFAULT_CONFIG);positionPaths=Dt(()=>this.normalizedConfig().paths??{});static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,displayName:"Position",filterSelfPaths:true,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:true,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:true,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:true,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:true,pathSkUnitsFilter:null,sampleTime:500}},color:"contrast",enableTimeout:false,dataTimeout:5};constructor(){Fa(()=>{let e=this.normalizedConfig(),t=this.theme();t&&ge(()=>{let i=c(e.color??"contrast",t);this.labelColor.set(i.dim),this.valueColor=i.color,this.draw();});}),Fa(()=>{let e=this.positionPaths().longPath;e?.path&&ge(()=>this.streams.observe("longPath",t=>{let i=t?.data?.value;i==null?this.longPos="":e.convertUnitTo==="pdeg"?this.longPos=i.toFixed(6)+"\xB0":this.longPos=String(i),this.calculateFontSizeAndPositions(),this.draw();}));}),Fa(()=>{let e=this.positionPaths().latPath;e?.path&&ge(()=>this.streams.observe("latPath",t=>{let i=t?.data?.value;i==null?this.latPos="":e.convertUnitTo==="pdeg"?this.latPos=i.toFixed(7)+"\xB0":this.latPos=String(i),this.calculateFontSizeAndPositions(),this.draw();}));});}ngAfterViewInit(){this.canvasElement=this.canvasRef().nativeElement,this.ctx=this.canvasElement.getContext("2d"),this.canvas.registerCanvas(this.canvasElement,{autoRelease:true,onResize:(e,t)=>{this.cssWidth=e,this.cssHeight=t,this.calculateFontSizeAndPositions(),this.draw();}}),this.cssHeight=Math.round(this.canvasElement.getBoundingClientRect().height),this.cssWidth=Math.round(this.canvasElement.getBoundingClientRect().width),this.calculateFontSizeAndPositions(),this.draw();}calculateFontSizeAndPositions(){if(!this.cssWidth||!this.cssHeight)return;this.maxTextHeight=Math.floor(this.cssHeight*.6/2),this.maxTextWidth=Math.floor(this.cssWidth*.85),this.center=this.cssWidth/2,this.middle=this.cssHeight*.57;let e=this.latPos.length>this.longPos.length?this.latPos:this.longPos;if(this.ctx){let t=this.canvas.calculateOptimalFontSize(this.ctx,e,this.maxTextWidth,this.maxTextHeight,"bold");this.fontSizeOffset=Math.floor(t*5e-4);}}draw(){if(!this.ctx||!this.canvasElement)return;let t=this.normalizedConfig().displayName||"Position",i=this.labelColor();(!this.titleBitmap||this.titleBitmap.width!==this.canvasElement.width||this.titleBitmap.height!==this.canvasElement.height||this.titleBitmapText!==t||this.titleBitmapColor!==i)&&(this.titleBitmap=this.canvas.createTitleBitmap(t,i,"normal",this.cssWidth,this.cssHeight),this.titleBitmapText=t,this.titleBitmapColor=i),this.canvas.clearCanvas(this.ctx,this.cssWidth,this.cssHeight),this.titleBitmap&&this.titleBitmap.width>0&&this.titleBitmap.height>0&&this.ctx.drawImage(this.titleBitmap,0,0,this.cssWidth,this.cssHeight),this.canvas.drawText(this.ctx,this.latPos,this.center,this.middle-this.fontSizeOffset,this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor,"center","bottom"),this.canvas.drawText(this.ctx,this.longPos,this.center,this.middle+this.fontSizeOffset,this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor,"center","top");}ngOnDestroy(){try{this.canvasElement&&this.canvas.unregisterCanvas(this.canvasElement);}catch(e){}}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=JD({type:s,selectors:[["widget-position"]],viewQuery:function(t,i){t&1&&eg(i.canvasRef,P,5),t&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:2,vars:0,consts:[["canvasMainRef",""],[1,"position-canvas"]],template:function(t,i){t&1&&Uh(0,"canvas",1,0);},styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.position-canvas[_ngcontent-%COMP%]{display:block;width:100%!important;height:100%!important;min-height:1px}"]})}return s})();export{B as WidgetPositionComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {w as w$1,n as G$1,N,i as ir,W as Wp,E as Em,D as Dt,J as JD,y as yt,b as wt,O as Op,o as eu,p as R,r as f,P as Pi,k as Qh,u as ul,T as TT,c as $h,e as EE,t as pT,B as Bh,x as DA,a as G$2,A as re,C as Ff,H as Dr,I as zA,L as Fp,S as ca,U as Kh,V as L,X as xw,Y as Aw,Z as TI,a0 as _,a1 as vA,a2 as Jt,a3 as Xt$1,a4 as Zt$1,a5 as st,_ as _w,M as Mw,a6 as Lr,a7 as Gj,a8 as H,a9 as ru,aa as N$1,ab as te,ac as Mr,ad as Qe,ae as be,af as Tu,ag as bu,ah as nn,ai as Ar,aj as zm,ak as nw,al as Zj,am as LT,an as Hh,s as sg,ao as ue,ap as Ki,aq as Bn,ar as S,as as ke$1,at as Tp,au as be$1,av as _t,aw as Cu,ax as ry,ay as lv,az as Yj,h as Fw,l as ud,g as qw,m as dd,aA as gg,d as ig,aB as gr,aC as L$1,aD as Ce$1,aE as Sr,v as vt,aF as Pr,aG as tD,aH as j,aI as ms,aJ as wm,aK as wr,aL as me,aM as At$1,aN as wt$1}from'./main-
|
|
1
|
+
import {w as w$1,n as G$1,N,i as ir,W as Wp,E as Em,D as Dt,J as JD,y as yt,b as wt,O as Op,o as eu,p as R,r as f,P as Pi,k as Qh,u as ul,T as TT,c as $h,e as EE,t as pT,B as Bh,x as DA,a as G$2,A as re,C as Ff,H as Dr,I as zA,L as Fp,S as ca,U as Kh,V as L,X as xw,Y as Aw,Z as TI,a0 as _,a1 as vA,a2 as Jt,a3 as Xt$1,a4 as Zt$1,a5 as st,_ as _w,M as Mw,a6 as Lr,a7 as Gj,a8 as H,a9 as ru,aa as N$1,ab as te,ac as Mr,ad as Qe,ae as be,af as Tu,ag as bu,ah as nn,ai as Ar,aj as zm,ak as nw,al as Zj,am as LT,an as Hh,s as sg,ao as ue,ap as Ki,aq as Bn,ar as S,as as ke$1,at as Tp,au as be$1,av as _t,aw as Cu,ax as ry,ay as lv,az as Yj,h as Fw,l as ud,g as qw,m as dd,aA as gg,d as ig,aB as gr,aC as L$1,aD as Ce$1,aE as Sr,v as vt,aF as Pr,aG as tD,aH as j,aI as ms,aJ as wm,aK as wr,aL as me,aM as At$1,aN as wt$1}from'./main-YKDNK5VZ.js';function Pe(o){let t=o.cloneNode(true),e=t.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();t.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return i==="canvas"?Tt(o,t):(i==="input"||i==="select"||i==="textarea")&&It(o,t),Rt("canvas",o,t,Tt),Rt("input, textarea, select",o,t,It),t}function Rt(o,t,e,i){let n=t.querySelectorAll(o);if(n.length){let s=e.querySelectorAll(o);for(let r=0;r<n.length;r++)i(n[r],s[r]);}}var si=0;function It(o,t){t.type!=="file"&&(t.value=o.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${si++}`);}function Tt(o,t){let e=t.getContext("2d");if(e)try{e.drawImage(o,0,0);}catch(i){}}function Te(o){let t=o.getBoundingClientRect();return {top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function ye(o,t,e){let{top:i,bottom:n,left:s,right:r}=o;return e>=i&&e<=n&&t>=s&&t<=r}function oi(o,t){let e=t.left<o.left,i=t.left+t.width>o.right,n=t.top<o.top,s=t.top+t.height>o.bottom;return e||i||n||s}function G(o,t,e){o.top+=t,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width;}function kt(o,t,e,i){let{top:n,right:s,bottom:r,left:a,width:l,height:d}=o,h=l*t,v=d*t;return i>n-v&&i<r+v&&e>a-h&&e<s+h}var X=class{_document;positions=new Map;constructor(t){this._document=t;}clear(){this.positions.clear();}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Te(e)});});}handleScroll(t){let e=me(t),i=this.positions.get(e);if(!i)return null;let n=i.scrollPosition,s,r;if(e===this._document){let d=this.getViewportScrollPosition();s=d.top,r=d.left;}else s=e.scrollTop,r=e.scrollLeft;let a=n.top-s,l=n.left-r;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&G(d.clientRect,a,l);}),n.top=s,n.left=r,{top:a,left:l}}getViewportScrollPosition(){return {top:window.scrollY,left:window.scrollX}}};function Wt(o,t){let e=o.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(n=>i.appendChild(n)),i}function ke(o,t,e){for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];n?o.setProperty(i,n,e?.has(i)?"important":""):o.removeProperty(i);}return o}function A(o,t){let e=t?"":"none";ke(o.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e});}function Ot(o,t,e){ke(o.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e);}function J(o,t){return t&&t!="none"?o+" "+t:o}function Mt(o,t){o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.style.transform=$(t.left,t.top);}function $(o,t){return `translate3d(${Math.round(o)}px, ${Math.round(t)}px, 0)`}var V={capture:true},we={passive:false,capture:true},ri=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=JD({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,n){},styles:[`@layer cdk-resets {
|
|
2
2
|
.cdk-drag-preview {
|
|
3
3
|
background: none;
|
|
4
4
|
border: none;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {w,n as G,cD as V,aY as xe,v as vt,W as Wp,as as ke,cE as Xl,D as Dt,F as Fa,J as JD,cF as Un,O as Op,bh as xp,o as eu,cG as Ht,cH as R,cI as ee,cJ as Nt,cK as Lt,r as f,bt as u,y as yt,b as wt,P as Pi,c as $h,T as TT,u as ul,_ as _w,cf as xh,k as Qh,bl as Jw,e as EE,d as ig,aA as gg,B as Bh,M as Mw,g as qw,X as xw,Y as Aw,h as Fw,l as ud,m as dd,bp as gl,cL as vb,cM as yb}from'./main-BAV5VDOD.js';var Ue=yb((ft,ce)=>{var Ye=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var p=(function(r){var f=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},e={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function t(n){return n instanceof a?new a(n.type,t(n.content),n.alias):Array.isArray(n)?n.map(t):n.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++i}),t.__id},clone:function t(n,s){s=s||{};var l,u;switch(e.util.type(n)){case "Object":if(u=e.util.objId(n),s[u])return s[u];l={},s[u]=l;for(var m in n)n.hasOwnProperty(m)&&(l[m]=t(n[m],s));return l;case "Array":return u=e.util.objId(n),s[u]?s[u]:(l=[],s[u]=l,n.forEach(function(E,g){l[g]=t(E,s);}),l);default:return n}},getLanguage:function(t){for(;t;){var n=f.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement;}return "none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(f,"gi"),""),t.classList.add("language-"+n);},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(l){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(l.stack)||[])[1];if(t){var n=document.getElementsByTagName("script");for(var s in n)if(n[s].src==t)return n[s]}return null}},isActive:function(t,n,s){for(var l="no-"+n;t;){var u=t.classList;if(u.contains(n))return !0;if(u.contains(l))return !1;t=t.parentElement;}return !!s}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(t,n){var s=e.util.clone(e.languages[t]);for(var l in n)s[l]=n[l];return s},insertBefore:function(t,n,s,l){l=l||e.languages;var u=l[t],m={};for(var E in u)if(u.hasOwnProperty(E)){if(E==n)for(var g in s)s.hasOwnProperty(g)&&(m[g]=s[g]);s.hasOwnProperty(E)||(m[E]=u[E]);}var T=l[t];return l[t]=m,e.languages.DFS(e.languages,function(O,z){z===T&&O!=t&&(this[O]=m);}),m},DFS:function t(n,s,l,u){u=u||{};var m=e.util.objId;for(var E in n)if(n.hasOwnProperty(E)){s.call(n,E,n[E],l||E);var g=n[E],T=e.util.type(g);T==="Object"&&!u[m(g)]?(u[m(g)]=!0,t(g,s,null,u)):T==="Array"&&!u[m(g)]&&(u[m(g)]=!0,t(g,s,E,u));}}},plugins:{},highlightAll:function(t,n){e.highlightAllUnder(document,t,n);},highlightAllUnder:function(t,n,s){var l={callback:s,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};e.hooks.run("before-highlightall",l),l.elements=Array.prototype.slice.apply(l.container.querySelectorAll(l.selector)),e.hooks.run("before-all-elements-highlight",l);for(var u=0,m;m=l.elements[u++];)e.highlightElement(m,n===!0,l.callback);},highlightElement:function(t,n,s){var l=e.util.getLanguage(t),u=e.languages[l];e.util.setLanguage(t,l);var m=t.parentElement;m&&m.nodeName.toLowerCase()==="pre"&&e.util.setLanguage(m,l);var E=t.textContent,g={element:t,language:l,grammar:u,code:E};function T(z){g.highlightedCode=z,e.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,e.hooks.run("after-highlight",g),e.hooks.run("complete",g),s&&s.call(g.element);}if(e.hooks.run("before-sanity-check",g),m=g.element.parentElement,m&&m.nodeName.toLowerCase()==="pre"&&!m.hasAttribute("tabindex")&&m.setAttribute("tabindex","0"),!g.code){e.hooks.run("complete",g),s&&s.call(g.element);return}if(e.hooks.run("before-highlight",g),!g.grammar){T(e.util.encode(g.code));return}if(n&&r.Worker){var O=new Worker(e.filename);O.onmessage=function(z){T(z.data);},O.postMessage(JSON.stringify({language:g.language,code:g.code,immediateClose:!0}));}else T(e.highlight(g.code,g.grammar,g.language));},highlight:function(t,n,s){var l={code:t,grammar:n,language:s};if(e.hooks.run("before-tokenize",l),!l.grammar)throw new Error('The language "'+l.language+'" has no grammar.');return l.tokens=e.tokenize(l.code,l.grammar),e.hooks.run("after-tokenize",l),a.stringify(e.util.encode(l.tokens),l.language)},tokenize:function(t,n){var s=n.rest;if(s){for(var l in s)n[l]=s[l];delete n.rest;}var u=new F;return C(u,u.head,t),S(t,u,n,u.head,0),L(u)},hooks:{all:{},add:function(t,n){var s=e.hooks.all;s[t]=s[t]||[],s[t].push(n);},run:function(t,n){var s=e.hooks.all[t];if(!(!s||!s.length))for(var l=0,u;u=s[l++];)u(n);}},Token:a};r.Prism=e;function a(t,n,s,l){this.type=t,this.content=n,this.alias=s,this.length=(l||"").length|0;}a.stringify=function t(n,s){if(typeof n=="string")return n;if(Array.isArray(n)){var l="";return n.forEach(function(T){l+=t(T,s);}),l}var u={type:n.type,content:t(n.content,s),tag:"span",classes:["token",n.type],attributes:{},language:s},m=n.alias;m&&(Array.isArray(m)?Array.prototype.push.apply(u.classes,m):u.classes.push(m)),e.hooks.run("wrap",u);var E="";for(var g in u.attributes)E+=" "+g+'="'+(u.attributes[g]||"").replace(/"/g,""")+'"';return "<"+u.tag+' class="'+u.classes.join(" ")+'"'+E+">"+u.content+"</"+u.tag+">"};function h(t,n,s,l){t.lastIndex=n;var u=t.exec(s);if(u&&l&&u[1]){var m=u[1].length;u.index+=m,u[0]=u[0].slice(m);}return u}function S(t,n,s,l,u,m){for(var E in s)if(!(!s.hasOwnProperty(E)||!s[E])){var g=s[E];g=Array.isArray(g)?g:[g];for(var T=0;T<g.length;++T){if(m&&m.cause==E+","+T)return;var O=g[T],z=O.inside,ae=!!O.lookbehind,X=!!O.greedy,de=O.alias;if(X&&!O.pattern.global){var pe=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,pe+"g");}for(var oe=O.pattern||O,$=l.next,N=u;$!==n.tail&&!(m&&N>=m.reach);N+=$.value.length,$=$.next){var U=$.value;if(n.length>t.length)return;if(!(U instanceof a)){var q=1,G;if(X){if(G=h(oe,N,t,ae),!G||G.index>=t.length)break;var _=G.index,A=G.index+G[0].length,c=N;for(c+=$.value.length;_>=c;)$=$.next,c+=$.value.length;if(c-=$.value.length,N=c,$.value instanceof a)continue;for(var d=$;d!==n.tail&&(c<A||typeof d.value=="string");d=d.next)q++,c+=d.value.length;q--,U=t.slice(N,c),G.index-=N;}else if(G=h(oe,0,U,ae),!G)continue;var _=G.index,x=G[0],w=U.slice(0,_),H=U.slice(_+x.length),B=N+U.length;m&&B>m.reach&&(m.reach=B);var K=$.prev;w&&(K=C(n,K,w),N+=w.length),k(n,K,q);var qe=new a(E,z?e.tokenize(x,z):x,de,x);if($=C(n,K,qe),H&&C(n,$,H),q>1){var fe={cause:E+","+T,reach:B};S(t,n,s,$.prev,N,fe),m&&fe.reach>m.reach&&(m.reach=fe.reach);}}}}}}function F(){var t={value:null,prev:null,next:null},n={value:null,prev:t,next:null};t.next=n,this.head=t,this.tail=n,this.length=0;}function C(t,n,s){var l=n.next,u={value:s,prev:n,next:l};return n.next=u,l.prev=u,t.length++,u}function k(t,n,s){for(var l=n.next,u=0;u<s&&l!==t.tail;u++)l=l.next;n.next=l,l.prev=n,t.length-=u;}function L(t){for(var n=[],s=t.head.next;s!==t.tail;)n.push(s.value),s=s.next;return n}if(!r.document)return r.addEventListener&&(e.disableWorkerMessageHandler||r.addEventListener("message",function(t){var n=JSON.parse(t.data),s=n.language,l=n.code,u=n.immediateClose;r.postMessage(e.highlight(l,e.languages[s],s)),u&&r.close();},!1)),e;var y=e.util.currentScript();y&&(e.filename=y.src,y.hasAttribute("data-manual")&&(e.manual=!0));function v(){e.manual||e.highlightAll();}if(!e.manual){var b=document.readyState;b==="loading"||b==="interactive"&&y&&y.defer?document.addEventListener("DOMContentLoaded",v):window.requestAnimationFrame?window.requestAnimationFrame(v):window.setTimeout(v,16);}return e})(Ye);typeof ce<"u"&&ce.exports&&(ce.exports=p);typeof global<"u"&&(global.Prism=p);p.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};p.languages.markup.tag.inside["attr-value"].inside.entity=p.languages.markup.entity;p.languages.markup.doctype.inside["internal-subset"].inside=p.languages.markup;p.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"));});Object.defineProperty(p.languages.markup.tag,"addInlined",{value:function(f,i){var o={};o["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:p.languages[i]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var e={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};e["language-"+i]={pattern:/[\s\S]+/,inside:p.languages[i]};var a={};a[f]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return f}),"i"),lookbehind:!0,greedy:!0,inside:e},p.languages.insertBefore("markup","cdata",a);}});Object.defineProperty(p.languages.markup.tag,"addAttribute",{value:function(r,f){p.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[f,"language-"+f],inside:p.languages[f]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}});}});p.languages.html=p.languages.markup;p.languages.mathml=p.languages.markup;p.languages.svg=p.languages.markup;p.languages.xml=p.languages.extend("markup",{});p.languages.ssml=p.languages.xml;p.languages.atom=p.languages.xml;p.languages.rss=p.languages.xml;(function(r){var f=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+f.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+f.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+f.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+f.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:f,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"));})(p);p.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};p.languages.javascript=p.languages.extend("clike",{"class-name":[p.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});p.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;p.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:p.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:p.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:p.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:p.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:p.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});p.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:p.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});p.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});p.languages.markup&&(p.languages.markup.tag.addInlined("script","javascript"),p.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));p.languages.js=p.languages.javascript;(function(){if(typeof p>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading\u2026",f=function(y,v){return "\u2716 Error "+y+" while fetching file: "+v},i="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},e="data-src-status",a="loading",h="loaded",S="failed",F="pre[data-src]:not(["+e+'="'+h+'"]):not(['+e+'="'+a+'"])';function C(y,v,b){var t=new XMLHttpRequest;t.open("GET",y,!0),t.onreadystatechange=function(){t.readyState==4&&(t.status<400&&t.responseText?v(t.responseText):t.status>=400?b(f(t.status,t.statusText)):b(i));},t.send(null);}function k(y){var v=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y||"");if(v){var b=Number(v[1]),t=v[2],n=v[3];return t?n?[b,Number(n)]:[b,void 0]:[b,b]}}p.hooks.add("before-highlightall",function(y){y.selector+=", "+F;}),p.hooks.add("before-sanity-check",function(y){var v=y.element;if(v.matches(F)){y.code="",v.setAttribute(e,a);var b=v.appendChild(document.createElement("CODE"));b.textContent=r;var t=v.getAttribute("data-src"),n=y.language;if(n==="none"){var s=(/\.(\w+)$/.exec(t)||[,"none"])[1];n=o[s]||s;}p.util.setLanguage(b,n),p.util.setLanguage(v,n);var l=p.plugins.autoloader;l&&l.loadLanguages(n),C(t,function(u){v.setAttribute(e,h);var m=k(v.getAttribute("data-range"));if(m){var E=u.split(/\r\n?|\n/g),g=m[0],T=m[1]==null?E.length:m[1];g<0&&(g+=E.length),g=Math.max(0,Math.min(g-1,E.length)),T<0&&(T+=E.length),T=Math.max(0,Math.min(T,E.length)),u=E.slice(g,T).join(`
|
|
1
|
+
import {w,n as G,cD as V,aY as xe,v as vt,W as Wp,as as ke,cE as Xl,D as Dt,F as Fa,J as JD,cF as Un,O as Op,bh as xp,o as eu,cG as Ht,cH as R,cI as ee,cJ as Nt,cK as Lt,r as f,bt as u,y as yt,b as wt,P as Pi,c as $h,T as TT,u as ul,_ as _w,cf as xh,k as Qh,bl as Jw,e as EE,d as ig,aA as gg,B as Bh,M as Mw,g as qw,X as xw,Y as Aw,h as Fw,l as ud,m as dd,bp as gl,cL as vb,cM as yb}from'./main-YKDNK5VZ.js';var Ue=yb((ft,ce)=>{var Ye=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var p=(function(r){var f=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},e={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function t(n){return n instanceof a?new a(n.type,t(n.content),n.alias):Array.isArray(n)?n.map(t):n.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++i}),t.__id},clone:function t(n,s){s=s||{};var l,u;switch(e.util.type(n)){case "Object":if(u=e.util.objId(n),s[u])return s[u];l={},s[u]=l;for(var m in n)n.hasOwnProperty(m)&&(l[m]=t(n[m],s));return l;case "Array":return u=e.util.objId(n),s[u]?s[u]:(l=[],s[u]=l,n.forEach(function(E,g){l[g]=t(E,s);}),l);default:return n}},getLanguage:function(t){for(;t;){var n=f.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement;}return "none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(f,"gi"),""),t.classList.add("language-"+n);},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(l){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(l.stack)||[])[1];if(t){var n=document.getElementsByTagName("script");for(var s in n)if(n[s].src==t)return n[s]}return null}},isActive:function(t,n,s){for(var l="no-"+n;t;){var u=t.classList;if(u.contains(n))return !0;if(u.contains(l))return !1;t=t.parentElement;}return !!s}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(t,n){var s=e.util.clone(e.languages[t]);for(var l in n)s[l]=n[l];return s},insertBefore:function(t,n,s,l){l=l||e.languages;var u=l[t],m={};for(var E in u)if(u.hasOwnProperty(E)){if(E==n)for(var g in s)s.hasOwnProperty(g)&&(m[g]=s[g]);s.hasOwnProperty(E)||(m[E]=u[E]);}var T=l[t];return l[t]=m,e.languages.DFS(e.languages,function(O,z){z===T&&O!=t&&(this[O]=m);}),m},DFS:function t(n,s,l,u){u=u||{};var m=e.util.objId;for(var E in n)if(n.hasOwnProperty(E)){s.call(n,E,n[E],l||E);var g=n[E],T=e.util.type(g);T==="Object"&&!u[m(g)]?(u[m(g)]=!0,t(g,s,null,u)):T==="Array"&&!u[m(g)]&&(u[m(g)]=!0,t(g,s,E,u));}}},plugins:{},highlightAll:function(t,n){e.highlightAllUnder(document,t,n);},highlightAllUnder:function(t,n,s){var l={callback:s,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};e.hooks.run("before-highlightall",l),l.elements=Array.prototype.slice.apply(l.container.querySelectorAll(l.selector)),e.hooks.run("before-all-elements-highlight",l);for(var u=0,m;m=l.elements[u++];)e.highlightElement(m,n===!0,l.callback);},highlightElement:function(t,n,s){var l=e.util.getLanguage(t),u=e.languages[l];e.util.setLanguage(t,l);var m=t.parentElement;m&&m.nodeName.toLowerCase()==="pre"&&e.util.setLanguage(m,l);var E=t.textContent,g={element:t,language:l,grammar:u,code:E};function T(z){g.highlightedCode=z,e.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,e.hooks.run("after-highlight",g),e.hooks.run("complete",g),s&&s.call(g.element);}if(e.hooks.run("before-sanity-check",g),m=g.element.parentElement,m&&m.nodeName.toLowerCase()==="pre"&&!m.hasAttribute("tabindex")&&m.setAttribute("tabindex","0"),!g.code){e.hooks.run("complete",g),s&&s.call(g.element);return}if(e.hooks.run("before-highlight",g),!g.grammar){T(e.util.encode(g.code));return}if(n&&r.Worker){var O=new Worker(e.filename);O.onmessage=function(z){T(z.data);},O.postMessage(JSON.stringify({language:g.language,code:g.code,immediateClose:!0}));}else T(e.highlight(g.code,g.grammar,g.language));},highlight:function(t,n,s){var l={code:t,grammar:n,language:s};if(e.hooks.run("before-tokenize",l),!l.grammar)throw new Error('The language "'+l.language+'" has no grammar.');return l.tokens=e.tokenize(l.code,l.grammar),e.hooks.run("after-tokenize",l),a.stringify(e.util.encode(l.tokens),l.language)},tokenize:function(t,n){var s=n.rest;if(s){for(var l in s)n[l]=s[l];delete n.rest;}var u=new F;return C(u,u.head,t),S(t,u,n,u.head,0),L(u)},hooks:{all:{},add:function(t,n){var s=e.hooks.all;s[t]=s[t]||[],s[t].push(n);},run:function(t,n){var s=e.hooks.all[t];if(!(!s||!s.length))for(var l=0,u;u=s[l++];)u(n);}},Token:a};r.Prism=e;function a(t,n,s,l){this.type=t,this.content=n,this.alias=s,this.length=(l||"").length|0;}a.stringify=function t(n,s){if(typeof n=="string")return n;if(Array.isArray(n)){var l="";return n.forEach(function(T){l+=t(T,s);}),l}var u={type:n.type,content:t(n.content,s),tag:"span",classes:["token",n.type],attributes:{},language:s},m=n.alias;m&&(Array.isArray(m)?Array.prototype.push.apply(u.classes,m):u.classes.push(m)),e.hooks.run("wrap",u);var E="";for(var g in u.attributes)E+=" "+g+'="'+(u.attributes[g]||"").replace(/"/g,""")+'"';return "<"+u.tag+' class="'+u.classes.join(" ")+'"'+E+">"+u.content+"</"+u.tag+">"};function h(t,n,s,l){t.lastIndex=n;var u=t.exec(s);if(u&&l&&u[1]){var m=u[1].length;u.index+=m,u[0]=u[0].slice(m);}return u}function S(t,n,s,l,u,m){for(var E in s)if(!(!s.hasOwnProperty(E)||!s[E])){var g=s[E];g=Array.isArray(g)?g:[g];for(var T=0;T<g.length;++T){if(m&&m.cause==E+","+T)return;var O=g[T],z=O.inside,ae=!!O.lookbehind,X=!!O.greedy,de=O.alias;if(X&&!O.pattern.global){var pe=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,pe+"g");}for(var oe=O.pattern||O,$=l.next,N=u;$!==n.tail&&!(m&&N>=m.reach);N+=$.value.length,$=$.next){var U=$.value;if(n.length>t.length)return;if(!(U instanceof a)){var q=1,G;if(X){if(G=h(oe,N,t,ae),!G||G.index>=t.length)break;var _=G.index,A=G.index+G[0].length,c=N;for(c+=$.value.length;_>=c;)$=$.next,c+=$.value.length;if(c-=$.value.length,N=c,$.value instanceof a)continue;for(var d=$;d!==n.tail&&(c<A||typeof d.value=="string");d=d.next)q++,c+=d.value.length;q--,U=t.slice(N,c),G.index-=N;}else if(G=h(oe,0,U,ae),!G)continue;var _=G.index,x=G[0],w=U.slice(0,_),H=U.slice(_+x.length),B=N+U.length;m&&B>m.reach&&(m.reach=B);var K=$.prev;w&&(K=C(n,K,w),N+=w.length),k(n,K,q);var qe=new a(E,z?e.tokenize(x,z):x,de,x);if($=C(n,K,qe),H&&C(n,$,H),q>1){var fe={cause:E+","+T,reach:B};S(t,n,s,$.prev,N,fe),m&&fe.reach>m.reach&&(m.reach=fe.reach);}}}}}}function F(){var t={value:null,prev:null,next:null},n={value:null,prev:t,next:null};t.next=n,this.head=t,this.tail=n,this.length=0;}function C(t,n,s){var l=n.next,u={value:s,prev:n,next:l};return n.next=u,l.prev=u,t.length++,u}function k(t,n,s){for(var l=n.next,u=0;u<s&&l!==t.tail;u++)l=l.next;n.next=l,l.prev=n,t.length-=u;}function L(t){for(var n=[],s=t.head.next;s!==t.tail;)n.push(s.value),s=s.next;return n}if(!r.document)return r.addEventListener&&(e.disableWorkerMessageHandler||r.addEventListener("message",function(t){var n=JSON.parse(t.data),s=n.language,l=n.code,u=n.immediateClose;r.postMessage(e.highlight(l,e.languages[s],s)),u&&r.close();},!1)),e;var y=e.util.currentScript();y&&(e.filename=y.src,y.hasAttribute("data-manual")&&(e.manual=!0));function v(){e.manual||e.highlightAll();}if(!e.manual){var b=document.readyState;b==="loading"||b==="interactive"&&y&&y.defer?document.addEventListener("DOMContentLoaded",v):window.requestAnimationFrame?window.requestAnimationFrame(v):window.setTimeout(v,16);}return e})(Ye);typeof ce<"u"&&ce.exports&&(ce.exports=p);typeof global<"u"&&(global.Prism=p);p.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};p.languages.markup.tag.inside["attr-value"].inside.entity=p.languages.markup.entity;p.languages.markup.doctype.inside["internal-subset"].inside=p.languages.markup;p.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"));});Object.defineProperty(p.languages.markup.tag,"addInlined",{value:function(f,i){var o={};o["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:p.languages[i]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var e={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};e["language-"+i]={pattern:/[\s\S]+/,inside:p.languages[i]};var a={};a[f]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return f}),"i"),lookbehind:!0,greedy:!0,inside:e},p.languages.insertBefore("markup","cdata",a);}});Object.defineProperty(p.languages.markup.tag,"addAttribute",{value:function(r,f){p.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[f,"language-"+f],inside:p.languages[f]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}});}});p.languages.html=p.languages.markup;p.languages.mathml=p.languages.markup;p.languages.svg=p.languages.markup;p.languages.xml=p.languages.extend("markup",{});p.languages.ssml=p.languages.xml;p.languages.atom=p.languages.xml;p.languages.rss=p.languages.xml;(function(r){var f=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+f.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+f.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+f.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+f.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:f,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"));})(p);p.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};p.languages.javascript=p.languages.extend("clike",{"class-name":[p.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});p.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;p.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:p.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:p.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:p.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:p.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:p.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});p.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:p.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});p.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});p.languages.markup&&(p.languages.markup.tag.addInlined("script","javascript"),p.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));p.languages.js=p.languages.javascript;(function(){if(typeof p>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading\u2026",f=function(y,v){return "\u2716 Error "+y+" while fetching file: "+v},i="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},e="data-src-status",a="loading",h="loaded",S="failed",F="pre[data-src]:not(["+e+'="'+h+'"]):not(['+e+'="'+a+'"])';function C(y,v,b){var t=new XMLHttpRequest;t.open("GET",y,!0),t.onreadystatechange=function(){t.readyState==4&&(t.status<400&&t.responseText?v(t.responseText):t.status>=400?b(f(t.status,t.statusText)):b(i));},t.send(null);}function k(y){var v=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y||"");if(v){var b=Number(v[1]),t=v[2],n=v[3];return t?n?[b,Number(n)]:[b,void 0]:[b,b]}}p.hooks.add("before-highlightall",function(y){y.selector+=", "+F;}),p.hooks.add("before-sanity-check",function(y){var v=y.element;if(v.matches(F)){y.code="",v.setAttribute(e,a);var b=v.appendChild(document.createElement("CODE"));b.textContent=r;var t=v.getAttribute("data-src"),n=y.language;if(n==="none"){var s=(/\.(\w+)$/.exec(t)||[,"none"])[1];n=o[s]||s;}p.util.setLanguage(b,n),p.util.setLanguage(v,n);var l=p.plugins.autoloader;l&&l.loadLanguages(n),C(t,function(u){v.setAttribute(e,h);var m=k(v.getAttribute("data-range"));if(m){var E=u.split(/\r\n?|\n/g),g=m[0],T=m[1]==null?E.length:m[1];g<0&&(g+=E.length),g=Math.max(0,Math.min(g-1,E.length)),T<0&&(T+=E.length),T=Math.max(0,Math.min(T,E.length)),u=E.slice(g,T).join(`
|
|
2
2
|
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(g+1));}b.textContent=u,p.highlightElement(b);},function(u){v.setAttribute(e,S),b.textContent=u;});}}),p.plugins.fileHighlight={highlight:function(v){for(var b=(v||document).querySelectorAll(F),t=0,n;n=b[t++];)p.highlightElement(n);}};var L=!1;p.fileHighlight=function(){L||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),L=!0),p.plugins.fileHighlight.highlight.apply(this,arguments);};})();});var je=yb((re,he)=>{(function(f,i){typeof re=="object"&&typeof he=="object"?he.exports=i():typeof define=="function"&&define.amd?define([],i):typeof re=="object"?re.ClipboardJS=i():f.ClipboardJS=i();})(re,function(){return (function(){var r={686:(function(o,e,a){"use strict";a.d(e,{default:function(){return G}});var h=a(279),S=a.n(h),F=a(370),C=a.n(F),k=a(817),L=a.n(k);function y(A){try{return document.execCommand(A)}catch(c){return !1}}var v=function(c){var d=L()(c);return y("cut"),d},b=v;function t(A){var c=document.documentElement.getAttribute("dir")==="rtl",d=document.createElement("textarea");d.style.fontSize="12pt",d.style.border="0",d.style.padding="0",d.style.margin="0",d.style.position="absolute",d.style[c?"right":"left"]="-9999px";var _=window.pageYOffset||document.documentElement.scrollTop;return d.style.top="".concat(_,"px"),d.setAttribute("readonly",""),d.value=A,d}var n=function(c,d){var _=t(c);d.container.appendChild(_);var x=L()(_);return y("copy"),_.remove(),x},s=function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},_="";return typeof c=="string"?_=n(c,d):c instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(c?.type)?_=n(c.value,d):(_=L()(c),y("copy")),_},l=s;function u(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(d){return typeof d}:u=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},u(A)}var m=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=c.action,_=d===void 0?"copy":d,x=c.container,w=c.target,H=c.text;if(_!=="copy"&&_!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(w!==void 0)if(w&&u(w)==="object"&&w.nodeType===1){if(_==="copy"&&w.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(_==="cut"&&(w.hasAttribute("readonly")||w.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(H)return l(H,{container:x});if(w)return _==="cut"?b(w):l(w,{container:x})},E=m;function g(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(d){return typeof d}:g=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},g(A)}function T(A,c){if(!(A instanceof c))throw new TypeError("Cannot call a class as a function")}function O(A,c){for(var d=0;d<c.length;d++){var _=c[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(A,_.key,_);}}function z(A,c,d){return c&&O(A.prototype,c),d&&O(A,d),A}function ae(A,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(c&&c.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),c&&X(A,c);}function X(A,c){return X=Object.setPrototypeOf||function(_,x){return _.__proto__=x,_},X(A,c)}function de(A){var c=$();return function(){var _=N(A),x;if(c){var w=N(this).constructor;x=Reflect.construct(_,arguments,w);}else x=_.apply(this,arguments);return pe(this,x)}}function pe(A,c){return c&&(g(c)==="object"||typeof c=="function")?c:oe(A)}function oe(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function $(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return !1;if(typeof Proxy=="function")return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(A){return !1}}function N(A){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},N(A)}function U(A,c){var d="data-clipboard-".concat(A);if(c.hasAttribute(d))return c.getAttribute(d)}var q=(function(A){ae(d,A);var c=de(d);function d(_,x){var w;return T(this,d),w=c.call(this),w.resolveOptions(x),w.listenClick(_),w}return z(d,[{key:"resolveOptions",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof x.action=="function"?x.action:this.defaultAction,this.target=typeof x.target=="function"?x.target:this.defaultTarget,this.text=typeof x.text=="function"?x.text:this.defaultText,this.container=g(x.container)==="object"?x.container:document.body;}},{key:"listenClick",value:function(x){var w=this;this.listener=C()(x,"click",function(H){return w.onClick(H)});}},{key:"onClick",value:function(x){var w=x.delegateTarget||x.currentTarget,H=this.action(w)||"copy",B=E({action:H,container:this.container,target:this.target(w),text:this.text(w)});this.emit(B?"success":"error",{action:H,text:B,trigger:w,clearSelection:function(){w&&w.focus(),window.getSelection().removeAllRanges();}});}},{key:"defaultAction",value:function(x){return U("action",x)}},{key:"defaultTarget",value:function(x){var w=U("target",x);if(w)return document.querySelector(w)}},{key:"defaultText",value:function(x){return U("text",x)}},{key:"destroy",value:function(){this.listener.destroy();}}],[{key:"copy",value:function(x){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return l(x,w)}},{key:"cut",value:function(x){return b(x)}},{key:"isSupported",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],w=typeof x=="string"?[x]:x,H=!!document.queryCommandSupported;return w.forEach(function(B){H=H&&!!document.queryCommandSupported(B);}),H}}]),d})(S()),G=q;}),828:(function(o){var e=9;if(typeof Element<"u"&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector;}function h(S,F){for(;S&&S.nodeType!==e;){if(typeof S.matches=="function"&&S.matches(F))return S;S=S.parentNode;}}o.exports=h;}),438:(function(o,e,a){var h=a(828);function S(k,L,y,v,b){var t=C.apply(this,arguments);return k.addEventListener(y,t,b),{destroy:function(){k.removeEventListener(y,t,b);}}}function F(k,L,y,v,b){return typeof k.addEventListener=="function"?S.apply(null,arguments):typeof y=="function"?S.bind(null,document).apply(null,arguments):(typeof k=="string"&&(k=document.querySelectorAll(k)),Array.prototype.map.call(k,function(t){return S(t,L,y,v,b)}))}function C(k,L,y,v){return function(b){b.delegateTarget=h(b.target,L),b.delegateTarget&&v.call(k,b);}}o.exports=F;}),879:(function(o,e){e.node=function(a){return a!==void 0&&a instanceof HTMLElement&&a.nodeType===1},e.nodeList=function(a){var h=Object.prototype.toString.call(a);return a!==void 0&&(h==="[object NodeList]"||h==="[object HTMLCollection]")&&"length"in a&&(a.length===0||e.node(a[0]))},e.string=function(a){return typeof a=="string"||a instanceof String},e.fn=function(a){var h=Object.prototype.toString.call(a);return h==="[object Function]"};}),370:(function(o,e,a){var h=a(879),S=a(438);function F(y,v,b){if(!y&&!v&&!b)throw new Error("Missing required arguments");if(!h.string(v))throw new TypeError("Second argument must be a String");if(!h.fn(b))throw new TypeError("Third argument must be a Function");if(h.node(y))return C(y,v,b);if(h.nodeList(y))return k(y,v,b);if(h.string(y))return L(y,v,b);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function C(y,v,b){return y.addEventListener(v,b),{destroy:function(){y.removeEventListener(v,b);}}}function k(y,v,b){return Array.prototype.forEach.call(y,function(t){t.addEventListener(v,b);}),{destroy:function(){Array.prototype.forEach.call(y,function(t){t.removeEventListener(v,b);});}}}function L(y,v,b){return S(document.body,y,v,b)}o.exports=F;}),817:(function(o){function e(a){var h;if(a.nodeName==="SELECT")a.focus(),h=a.value;else if(a.nodeName==="INPUT"||a.nodeName==="TEXTAREA"){var S=a.hasAttribute("readonly");S||a.setAttribute("readonly",""),a.select(),a.setSelectionRange(0,a.value.length),S||a.removeAttribute("readonly"),h=a.value;}else {a.hasAttribute("contenteditable")&&a.focus();var F=window.getSelection(),C=document.createRange();C.selectNodeContents(a),F.removeAllRanges(),F.addRange(C),h=F.toString();}return h}o.exports=e;}),279:(function(o){function e(){}e.prototype={on:function(a,h,S){var F=this.e||(this.e={});return (F[a]||(F[a]=[])).push({fn:h,ctx:S}),this},once:function(a,h,S){var F=this;function C(){F.off(a,C),h.apply(S,arguments);}return C._=h,this.on(a,C,S)},emit:function(a){var h=[].slice.call(arguments,1),S=((this.e||(this.e={}))[a]||[]).slice(),F=0,C=S.length;for(F;F<C;F++)S[F].fn.apply(S[F].ctx,h);return this},off:function(a,h){var S=this.e||(this.e={}),F=S[a],C=[];if(F&&h)for(var k=0,L=F.length;k<L;k++)F[k].fn!==h&&F[k].fn._!==h&&C.push(F[k]);return C.length?S[a]=C:delete S[a],this}},o.exports=e,o.exports.TinyEmitter=e;})},f={};function i(o){if(f[o])return f[o].exports;var e=f[o]={exports:{}};return r[o](e,e.exports,i),e.exports}return (function(){i.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(e,{a:e}),e};})(),(function(){i.d=function(o,e){for(var a in e)i.o(e,a)&&!i.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:e[a]});};})(),(function(){i.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)};})(),i(686)})().default});});vb(Ue());(function(r){var f="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",i={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:true,alias:"punctuation",inside:null},o={bash:i,environment:{pattern:RegExp("\\$"+f),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:true,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:true},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:true,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:true,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+f),lookbehind:true,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};r.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:true},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:true,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:true},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+f),lookbehind:true,alias:"constant"}},alias:"variable",lookbehind:true},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:true},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:true,greedy:true,inside:o},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:true,greedy:true,inside:{bash:i}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:true,greedy:true,inside:o},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:true,greedy:true},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:true,inside:{entity:o.entity}}],environment:{pattern:RegExp("\\$?"+f),alias:"constant"},variable:o.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:true},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:true},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:true,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:true},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:true}},i.inside=r.languages.bash;for(var e=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=o.variable[1].inside,h=0;h<e.length;h++)a[e[h]]=r.languages.bash[e[h]];r.languages.sh=r.languages.bash,r.languages.shell=r.languages.bash;})(Prism);(function(r){r.languages.typescript=r.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:true,greedy:true,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),r.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete r.languages.typescript.parameter,delete r.languages.typescript["literal-property"];var f=r.languages.extend("typescript",{});delete f["class-name"],r.languages.typescript["class-name"].inside=f,r.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:true,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:f}}}}),r.languages.ts=r.languages.typescript;})(Prism);var Be=vb(je());var Ve=(r,f)=>f.title,Xe=(r,f)=>f.file;function We(r,f){r&1&&TT(0," Loading... ");}function Ze(r,f){r&1&&TT(0," Table of Content ");}function Ke(r,f){r&1&&(Pi(0,"button",12),TT(1,"Error loading menu"),ul());}function Je(r,f){r&1&&(Pi(0,"button",12),TT(1,"No help entries"),ul());}function Qe(r,f){if(r&1){let i=Fw();Pi(0,"button",15),Qh("click",function(){let e=ud(i).$implicit,a=qw(5);return dd(a.selectFile(e.file))}),TT(1),ul();}if(r&2){let i=f.$implicit,o=qw(5);Bh("disabled",o.selectedFile()===i.file),EE(),gl(" ",i.title," ");}}function et(r,f){if(r&1&&(Pi(0,"button",14),TT(1),ul(),xw(2,Qe,2,2,"button",13,Xe)),r&2){let i=qw().$implicit;EE(),gg(i.title),EE(),Aw(i.items);}}function tt(r,f){if(r&1){let i=Fw();Pi(0,"button",15),Qh("click",function(){ud(i);let e=qw().$implicit,a=qw(3);return dd(a.selectFile(e.file))}),TT(1),ul();}if(r&2){let i=qw().$implicit,o=qw(3);Bh("disabled",o.selectedFile()===i.file),EE(),gl(" ",i.title," ");}}function nt(r,f){if(r&1&&_w(0,et,4,1)(1,tt,2,2,"button",13),r&2){let i=f.$implicit,o=qw(3);Mw(o.isGroup(i)?0:1);}}function it(r,f){if(r&1&&xw(0,nt,2,1,null,null,Ve),r&2){let i=qw(2);Aw(i.helpMenuItems());}}function rt(r,f){if(r&1){let i=Fw();Pi(0,"button",15),Qh("click",function(){let e=ud(i).$implicit,a=qw(5);return dd(a.selectFile(e.file))}),TT(1),ul();}if(r&2){let i=f.$implicit,o=qw(5);Bh("disabled",o.selectedFile()===i.file),EE(),gl(" ",i.title," ");}}function at(r,f){if(r&1&&(Pi(0,"button",16),TT(1),ul(),Pi(2,"mat-menu",17,1),xw(4,rt,2,2,"button",13,Xe),ul()),r&2){let i=Jw(3),o=qw().$implicit;Bh("matMenuTriggerFor",i),EE(),gg(o.title),EE(),Bh("overlapTrigger",false),EE(2),Aw(o.items);}}function ot(r,f){if(r&1){let i=Fw();Pi(0,"button",15),Qh("click",function(){ud(i);let e=qw().$implicit,a=qw(3);return dd(a.selectFile(e.file))}),TT(1),ul();}if(r&2){let i=qw().$implicit,o=qw(3);Bh("disabled",o.selectedFile()===i.file),EE(),gl(" ",i.title," ");}}function st(r,f){if(r&1&&_w(0,at,6,3)(1,ot,2,2,"button",13),r&2){let i=f.$implicit,o=qw(3);Mw(o.isGroup(i)?0:1);}}function lt(r,f){if(r&1&&xw(0,st,2,1,null,null,Ve),r&2){let i=qw(2);Aw(i.helpMenuItems());}}function ut(r,f){if(r&1&&_w(0,Ke,2,0,"button",12)(1,Je,2,0,"button",12)(2,it,2,0)(3,lt,2,0),r&2){let i=qw();Mw(i.hasError()?0:!i.isLoading()&&i.helpFiles().length===0?1:i.isMobileMenuMode()?2:3);}}function ct(r,f){r&1&&(Pi(0,"div",11),TT(1,"Unable to load help content."),ul());}function dt(r,f){r&1&&(Pi(0,"div",11),TT(1,"Loading help..."),ul());}function pt(r,f){if(r&1&&(Pi(0,"div",11),$h(1,"markdown",18),ul()),r&2){let i=qw();EE(),Bh("src",`assets/help-docs/${i.selectedFile()}`);}}window.ClipboardJS=Be.default;var $t=(()=>{class r{pageTitle="Help";_router=w(G);_route=w(V);_destroyRef=w(xe);_isMobileMenuMode=vt(this.detectMobileMenuMode());_selectedPageFromRoute=Wp(this._route.paramMap.pipe(ke(i=>i.get("page"))),{initialValue:null});constructor(){let i=this.getMobileMenuMediaQuery();if(i===null)return;this._isMobileMenuMode.set(i.matches);let o=e=>{this._isMobileMenuMode.set(e.matches);};i.addEventListener("change",o),this._destroyRef.onDestroy(()=>{i.removeEventListener("change",o);});}_helpMenuRes=Xl(()=>"assets/help-docs/menu.json");helpMenuItems=Dt(()=>this._helpMenuRes.hasValue()?this.normalizeMenu(this._helpMenuRes.value()??[]):[]);helpFiles=Dt(()=>{let i=this.helpMenuItems();return i.length===0?[]:i.flatMap(o=>this.isGroup(o)?o.items:[o])});selectedFile=vt("");_syncEffect=Fa(()=>{let i=this.helpFiles(),o=this._selectedPageFromRoute();if(i.length===0)return;let e=this.resolveSelectedFile(o,i);this.selectedFile()!==e&&this.selectedFile.set(e);});hasError=Dt(()=>this._helpMenuRes.error()!=null);isLoading=Dt(()=>this._helpMenuRes.isLoading());isMobileMenuMode=Dt(()=>this._isMobileMenuMode());isGroup(i){return "items"in i}selectFile(i){this.selectedFile.set(i),this._router.navigate(["/help",this.toPageSegment(i)]);}backPage(){this._router.navigate(["/settings"]);}closePage(){this._router.navigate(["/dashboard"]);}resolveSelectedFile(i,o){if(i){let e=i.endsWith(".md")?i:`${i}.md`,a=o.find(h=>h.file===e);if(a)return a.file}return o[0].file}toPageSegment(i){return i.endsWith(".md")?i.slice(0,-3):i}normalizeMenu(i){let o=[];return i.forEach(e=>{let a=(e.title??"").trim();if(Array.isArray(e.items)){let h=e.items.filter(this.isValidLeaf).filter(S=>S.file.endsWith(".md")).map(S=>({title:S.title.trim(),file:S.file.trim()}));if(!a||h.length===0)return;o.push({title:a,items:h});return}this.isValidLeaf(e)&&e.file.endsWith(".md")&&o.push({title:e.title.trim(),file:e.file.trim()});}),o}isValidLeaf(i){return typeof i.title=="string"&&i.title.trim().length>0&&typeof i.file=="string"&&i.file.trim().length>0}detectMobileMenuMode(){return this.getMobileMenuMediaQuery()?.matches??false}getMobileMenuMediaQuery(){return typeof window>"u"||typeof window.matchMedia!="function"?null:window.matchMedia("(max-width: 900px), (hover: none) and (pointer: coarse)")}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=JD({type:r,selectors:[["app-help"]],decls:22,vars:9,consts:[["helpMenu","matMenu"],["childMenu","matMenu"],[1,"fullpage-header"],[1,"page-icon"],["svgIcon","help-center","aria-hidden","false"],[1,"page-title"],["mat-flat-button","",3,"matMenuTriggerFor","disabled"],[1,"help-menu-panel"],["matMenuContent",""],[1,"dialog-close-icon"],["mat-icon-button","",3,"click"],[1,"markdown-content"],["mat-menu-item","","disabled",""],["mat-menu-item","",3,"disabled"],["mat-menu-item","","disabled","",1,"help-menu-group-title"],["mat-menu-item","",3,"click","disabled"],["mat-menu-item","",3,"matMenuTriggerFor"],[1,"help-menu-panel",3,"overlapTrigger"],["clipboard","",3,"src"]],template:function(o,e){if(o&1&&(Pi(0,"div",2)(1,"div",3),$h(2,"mat-icon",4),Pi(3,"h6",5),TT(4),ul()(),Pi(5,"button",6),_w(6,We,1,0)(7,Ze,1,0),ul(),Pi(8,"mat-menu",7,0),xh(10,ut,4,1,"ng-template",8),ul(),Pi(11,"div",9)(12,"button",10),Qh("click",function(){return e.backPage()}),Pi(13,"mat-icon"),TT(14,"arrow_back_ios"),ul()(),Pi(15,"button",10),Qh("click",function(){return e.closePage()}),Pi(16,"mat-icon"),TT(17,"close"),ul()()()(),$h(18,"mat-divider"),_w(19,ct,2,0,"div",11)(20,dt,2,0,"div",11)(21,pt,2,1,"div",11)),o&2){let a=Jw(9);EE(2),ig("width",24,"px")("height",24,"px"),EE(2),gg(e.pageTitle),EE(),Bh("matMenuTriggerFor",a)("disabled",e.isLoading()||e.hasError()||e.helpFiles().length===0),EE(),Mw(e.isLoading()?6:7),EE(13),Mw(e.hasError()?19:e.isLoading()&&e.helpFiles().length===0?20:e.selectedFile()?21:-1);}},dependencies:[Un,Op,xp,eu,Ht,R,ee,Nt,Lt,f,u,yt,wt],styles:[".fullpage-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.page-icon[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center;margin-left:15px}.page-title[_ngcontent-%COMP%]{margin-block-start:0px;margin-block-end:0px;padding:18px 0 13px 5px;color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, .03125em))}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.dialog-close-icon[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;padding-right:15px}.help-menu-group-title[_ngcontent-%COMP%]{font-weight:600;opacity:.9} .mat-mdc-menu-panel.help-menu-panel{border:1px solid var(--mat-sys-outline);background:var(--mat-sys-surface-container-high)} .markdown-content{display:block;height:calc(100% - 75px);width:100%;overflow-x:scroll;padding:25px;font-size:1.1rem;line-height:1.7;background:var(--mat-sys-surface-container, #fff);color:var(--mat-sys-on-surface, #222);border-radius:12px;box-shadow:0 2px 8px #00000012;max-width:900px;margin:0 auto} .markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4{color:var(--mat-sys-primary, #1976d2);margin-top:1.5em;margin-bottom:.5em;font-weight:600} .markdown-content pre{padding:1em;overflow-x:auto} .markdown-content table{border:1px solid var(--mat-sys-on-background);border-collapse:collapse;width:100%;margin:1em 0} .markdown-content table td{border:1px solid var(--mat-sys-on-background);padding:8px;text-align:left} .markdown-content th{color:var(--mat-sys-primary, #1976d2);font-weight:600;padding:.5em 1em;border:2px solid var(--mat-sys-primary, #1976d2);text-align:left} .markdown-content table tr:nth-child(2n){background-color:var(--mat-sys-surface-container-high)} .markdown-content a{color:var(--mat-sys-primary, #1976d2);text-decoration:underline} .markdown-content a:hover{text-decoration:none;color:var(--mat-sys-secondary, #005fa3)} .markdown-content ul, .markdown-content ol{margin-left:2em;margin-bottom:1em} .markdown-content blockquote{border-left:4px solid var(--mat-sys-tertiary);background:var(--mat-sys-on-tertiary-fixed-variant);padding:.5em 1em;color:var(--mat-sys-on-surface-variant, #555);margin:1em 0}"]})}return r})();export{$t as AppHelpComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {G as Gt,L as Lt}from'./chunk-
|
|
1
|
+
import {G as Gt,L as Lt}from'./chunk-q9NoPvcx.js';import {u}from'./chunk-CCfhzpE8.js';import {c}from'./chunk-BIb-xYiS.js';import {d1 as Hj,w,du as p,dv as rt,v as vt,D as Dt,$ as $j,a6 as Lr,dx as n$1,F as Fa,dn as ge,J as JD,_ as _w,M as Mw,f as eg,K as Kw,h as Fw,P as Pi,k as Qh,u as ul,g as qw,B as Bh,an as Hh,l as ud,m as dd}from'./main-YKDNK5VZ.js';var O=["compassGauge"];function L(n,p){if(n&1){let a=Fw();Pi(0,"radial-gauge",2,0),Qh("resizeChange",function(e){ud(a);let o=qw();return dd(o.onResized(e))}),ul();}if(n&2){let a=qw();Bh("options",a.gaugeOptions)("value",a.displayValue()),Hh("value-text",a.textValue())("color-stroke-ticks",a.colorStrokeTicks);}}function z(n){let p=n.match(/(\d+(\.\d+)?|\.\d+)/g);if(!p||p.length<3)throw new Error("Invalid RGBA format");let[a,t,e,o=1]=p.map(Number),s=o===1?"":Math.round(o*255).toString(16).padStart(2,"0").toUpperCase();return "#"+((1<<24)+(a<<16)+(t<<8)+e).toString(16).slice(1).toUpperCase()+s}function U(n){return n<0&&(n=360+n),n}var $=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);streams=w(rt);static DEFAULT_CONFIG={displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",suppressBootstrapNull:true,isPathConfigurable:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",showConvertUnitTo:false,convertUnitTo:"deg",sampleTime:500}},supportAutomaticHistoricalSeries:true,gauge:{type:"ngRadial",subType:"baseplateCompass",enableTicks:true,compassUseNumbers:false,showValueBox:false},enableTimeout:false,color:"contrast",dataTimeout:5};LINE="line";NEEDLE_START=40;NEEDLE_END=100;NEEDLE_CIRCLE_SIZE=15;BORDER_MIDDLE_WIDTH=2;BORDER_INNER_WIDTH=2;ANIMATION_TARGET_PLATE="plate";ANIMATION_TARGET_NEEDLE="needle";textValue=vt("--");value=vt(void 0);displayValue=Dt(()=>this.value()??0);shouldRenderGauge=Dt(()=>this.value()!==void 0);gaugeBootstrapped=vt(false);animationEnabled=Dt(()=>this.gaugeBootstrapped());ngGauge=$j("compassGauge");gauge=$j("compassGauge",{read:Lr});viewReady=vt(false);gaugeOptions={};colorStrokeTicks="";currentState=vt(n$1.Normal);lastAppliedState=null;negToPortPaths=["self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.environment.wind.angleTrueWaterDamped","self.performance.beatAngle","self.performance.gybeAngle","self.performance.targetAngle","self.performance.optimumWindAngle"];displayName=Dt(()=>this.runtime.options()?.displayName);constructor(){Fa(()=>{let a=this.runtime.options(),t=this.theme();if(!a||!t)return;let e=a.paths?.gaugePath;e?.path&&ge(()=>this.streams.observe("gaugePath",o=>{let s=o?.data?.value??null;if(s==null)this.value.set(0),this.textValue.set("--");else {let r=e.path;r&&this.negToPortPaths.includes(r)&&(s=U(s));let T=Math.min(Math.max(s,0),360);this.value.set(T),this.textValue.set(T.toFixed(0));}let i=o?.state??n$1.Normal;i!==this.currentState()&&this.currentState.set(i);}));}),Fa(()=>{let a=this.runtime.options(),t=this.theme();!a||!t||ge(()=>{if(this.buildGaugeOptions(a,t),this.viewReady())try{this.ngGauge()?.update(this.gaugeOptions);}catch(e){}});}),Fa(()=>{let a=this.ngGauge();!a||this.gaugeBootstrapped()||ge(()=>{try{requestAnimationFrame(()=>{this.gaugeBootstrapped.set(!0);try{a.update({animation:!0,animatedValue:!0});}catch(t){}});}catch(t){}});}),Fa(()=>{let a=this.runtime.options(),t=this.theme(),e=this.currentState();!a||!t||this.viewReady()&&e!==this.lastAppliedState&&ge(()=>{let o={};switch(e){case n$1.Emergency:o.colorValueText=t.zoneEmergency;break;case n$1.Alarm:o.colorValueText=t.zoneAlarm;break;case n$1.Warn:o.colorValueText=t.zoneWarn;break;case n$1.Alert:o.colorValueText=t.zoneAlert;break;default:o.colorValueText=t.contrast;break}try{this.ngGauge()?.update(o);}catch(s){}this.lastAppliedState=e;});});}buildGaugeOptions(a,t){let e=this.gaugeOptions={},o=a.paths?.gaugePath;e.title=this.displayName(),e.minValue=0,e.maxValue=360,e.units=o?.convertUnitTo||"",e.valueDec=a.numDecimal??0,e.valueInt=a.numInt??1,e.barProgress=false,e.barWidth=0,e.valueBox=!!a.gauge?.showValueBox,e.fontValueSize=60,e.valueBoxWidth=30,e.valueBoxBorderRadius=10,e.valueBoxStroke=0,e.ticksAngle=360,e.startAngle=180,e.exactTicks=false,e.strokeTicks="",e.majorTicks=a.gauge?.compassUseNumbers?["N","30","60","E","120","150","S","210","240","W","300","330","N"]:["N","NE","E","SE","S","SW","W","NW","N"],e.majorTicksDec=0,e.majorTicksInt=1,e.numbersMargin=5,e.fontNumbersSize=25,e.minorTicks=a.gauge?.compassUseNumbers?3:2,e.needle=true,e.needleType=this.LINE,e.needleStart=this.NEEDLE_START,e.needleEnd=this.NEEDLE_END,e.needleCircleSize=this.NEEDLE_CIRCLE_SIZE,e.needleWidth=4,e.needleShadow=false,e.needleCircleInner=false,e.needleCircleOuter=false,e.borders=true,e.borderOuterWidth=0,e.borderMiddleWidth=this.BORDER_MIDDLE_WIDTH,e.borderInnerWidth=this.BORDER_INNER_WIDTH,e.borderShadowWidth=0,e.highlights=[],e.highlightsWidth=0,e.fontTitle="Roboto",e.fontTitleWeight="normal",e.fontTitleSize=25,e.fontUnits="Roboto",e.fontUnitsSize=25,e.fontUnitsWeight="normal",e.barStrokeWidth=0,e.barShadow=0,e.fontValue="Roboto",e.fontValueWeight="bold",e.valueTextShadow=false,e.colorValueBoxShadow="",e.fontNumbers="Roboto",e.fontNumbersWeight="bold",a.gauge?.subType==="marineCompass"?(e.animationTarget=this.ANIMATION_TARGET_PLATE,e.useMinPath=true):(e.animationTarget=this.ANIMATION_TARGET_NEEDLE,e.useMinPath=true),e.animateOnInit=false,e.animation=this.animationEnabled(),e.animatedValue=this.animationEnabled(),e.animationRule="linear",e.animationDuration=(o?.sampleTime??500)-50;let s=c(a.color??"contrast",t),i=z(s.dim),r=z(c("contrast",t).dim);e.colorBarProgress=s.color,e.colorBorderMiddle=i,e.colorBorderMiddleEnd=i,e.colorNeedle=s.color,e.colorNeedleEnd=s.color,e.colorTitle=r,e.colorUnits=r,e.colorValueText=s.color,e.colorMinorTicks=r,e.colorNumbers=a.gauge?.compassUseNumbers?[t.port,r,r,i,r,r,i,r,r,i,r,r,t.port]:[t.port,i,i,i,i,i,i,i,t.port],e.colorMajorTicks=a.gauge?.compassUseNumbers?[t.port,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.port]:[t.port,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.contrast,t.port],e.colorPlate=e.colorPlateEnd=e.colorBorderInner=e.colorBorderInnerEnd=t.cardColor,e.colorBar=t.background,e.colorBarStroke="",e.colorValueBoxBackground=t.background,e.colorNeedleShadowUp="",e.colorNeedleShadowDown="",e.colorNeedleCircleInner=e.colorPlate,e.colorNeedleCircleInnerEnd=e.colorPlate,e.colorNeedleCircleOuter=e.colorPlate,e.colorNeedleCircleOuterEnd=e.colorPlate;}setCanvasSize(){let a=this.gauge()?.nativeElement;if(!a)return;let t=a.getBoundingClientRect(),e={height:t.height,width:t.width};try{this.ngGauge()?.update(e);}catch(o){}}ngAfterViewInit(){this.viewReady.set(true),this.setCanvasSize();try{this.ngGauge()?.update(this.gaugeOptions);}catch(a){}}onResized(a){let t={height:a.contentRect.height,width:a.contentRect.width};try{this.ngGauge()?.update(t);}catch(e){}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["widget-gauge-ng-compass"]],viewQuery:function(t,e){t&1&&eg(e.ngGauge,O,5)(e.gauge,O,5,Lr),t&2&&Kw(2);},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:1,consts:[["compassGauge",""],["kipResizeObserver","",3,"options","value"],["kipResizeObserver","",3,"resizeChange","options","value"]],template:function(t,e){t&1&&_w(0,L,2,4,"radial-gauge",1),t&2&&Mw(e.shouldRenderGauge()?0:-1);},dependencies:[u,Gt,Lt],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%} radial-gauge{display:block;position:relative;width:100%;min-width:8px;height:100%;overflow:clip} radial-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);padding:10px}"]})}return n})();export{$ as WidgetGaugeNgCompassComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-By8ZVvDx.js';import {d1 as Hj,w,du as p,dv as rt,aZ as F,dw as S,$ as $j,v as vt,D as Dt,dx as n$1,F as Fa,dn as ge,J as JD,_ as _w,c as $h,M as Mw,f as eg,K as Kw,bu as ut,dy as K,ao as ue,a6 as Lr,b0 as Wl,cp as Uh,g as qw,B as Bh}from'./main-BAV5VDOD.js';import {c}from'./chunk-Dxlia2NE.js';var H=["widgetDataChart"],C=(()=>{class n{theme=Hj.required();color=null;dataPath=null;dataSource=null;convertUnitTo=null;numDecimal=null;yScaleMin=null;yScaleMax=null;inverseYAxis=false;verticalChart=null;datasetUUID=null;unitsService=w(ut);dsService=w(K);ngZone=w(ue);canvasService=w(F);widgetDataChart=$j("widgetDataChart",{read:Lr});lineChartData={datasets:[]};lineChartOptions={parsing:false,datasets:{line:{pointRadius:0,pointHoverRadius:0,tension:.4}},animations:{tension:{easing:"easeInOutCubic"}}};lineChartType="line";chart=null;dsServiceSub=null;datasetConfig=null;dataSourceInfo=null;isDestroyed=false;lastChartSignature=null;config={datasetAverageArray:"sma",showAverageData:false,trackAgainstAverage:false,startScaleAtZero:false,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:false};constructor(){Fa(()=>{this.theme()&&ge(()=>{this.datasetConfig&&(this.setChartOptions(),this.setDatasetsColors());});});}startChart(){if(!(this.isDestroyed||!this.datasetUUID)&&(this.datasetConfig=this.dsService.getDatasetConfig(this.datasetUUID)??null,this.dataSourceInfo=this.dsService.getDataSourceInfo(this.datasetUUID)??null,this.datasetConfig&&this.dataSourceInfo)){let t=this.buildChartSignature();if(this.chart&&t===this.lastChartSignature)return;this.chart&&t!==this.lastChartSignature&&this.destroyChart(),this.setChartOptions(),this.createDatasets();let i=this.widgetDataChart()?.nativeElement?.getContext("2d");if(!i)return;this.chart=new Wl(i,{type:this.lineChartType,data:this.lineChartData,options:this.lineChartOptions}),this.lastChartSignature=t,this.startStreaming();}}buildChartSignature(){return [this.datasetUUID,this.dataPath,this.dataSource,this.convertUnitTo,this.numDecimal,this.yScaleMin,this.yScaleMax,this.inverseYAxis?"1":"0",this.verticalChart?"1":"0",this.color].join("|")}setChartOptions(){let t=this.datasetConfig,e=this.dataSourceInfo;!t||!e||(this.lineChartOptions.maintainAspectRatio=false,this.lineChartOptions.animation=false,this.lineChartOptions.indexAxis=this.verticalChart?"y":"x",this.verticalChart?this.lineChartOptions.scales={x:{display:false,position:"right",suggestedMin:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMin),suggestedMax:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMax),min:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMin):void 0,max:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMax):void 0,beginAtZero:this.config.startScaleAtZero,reverse:this.inverseYAxis,title:{display:false,text:"Value Axis",align:"center"},ticks:{maxTicksLimit:8,precision:this.numberOrUndefined(this.numDecimal),color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}},y:{type:"realtime",display:false,title:{display:false},time:{unit:t.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:false,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}}}:this.lineChartOptions.scales={x:{type:"realtime",display:false,title:{display:false},time:{unit:t.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:false,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}},y:{display:false,position:"right",suggestedMin:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMin),suggestedMax:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMax),min:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMin):void 0,max:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMax):void 0,beginAtZero:this.config.startScaleAtZero,reverse:this.inverseYAxis,title:{display:false,text:"Value Axis",align:"center"},ticks:{maxTicksLimit:8,precision:this.numberOrUndefined(this.numDecimal),color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}}},this.lineChartOptions.plugins={legend:{display:false},annotation:{annotations:{}},streaming:{duration:e.maxDataPoints*e.sampleTime,delay:e.sampleTime,frameRate:t.timeScaleFormat==="day"?5:t.timeScaleFormat==="hour"?8:t.timeScaleFormat==="minute"?15:30}});}numberOrUndefined(t){return t??void 0}createDatasets(){let t=this.lineChartOptions.scales?.y?.reverse?"start":true;this.lineChartData.datasets=[],this.lineChartData.datasets.push({label:"Value",data:[],order:0,parsing:false,tension:.4,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:3,fill:t}),this.lineChartData.datasets.push({label:"Average",data:[],order:1,parsing:false,tension:.4,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:3,fill:t}),this.setDatasetsColors();}setDatasetsColors(){this.lineChartData.datasets.forEach(t=>{t.borderColor=this.getThemeColors().averageLine,t.backgroundColor=this.getThemeColors().averageFill;});}getThemeColors(){let t=this.color,e={valueLine:"",valueFill:"",averageLine:"",averageFill:"",averageChartLine:"",chartLabel:"",chartValue:""};switch(t){case "contrast":this.config.trackAgainstAverage?(e.valueLine=this.theme().contrastDimmer,e.valueFill=this.theme().contrastDimmer,e.averageLine=this.theme().contrast,e.averageFill=this.theme().contrast,e.chartValue=e.averageLine):(e.valueLine=this.theme().contrast,e.valueFill=this.theme().contrast,e.averageLine=this.theme().contrastDimmer,e.averageFill=this.theme().contrastDimmer,e.chartValue=this.theme().contrast),e.averageChartLine=this.theme().contrastDim,e.chartLabel=this.theme().contrastDim;break;case "blue":this.config.trackAgainstAverage?(e.valueLine=this.theme().blueDimmer,e.valueFill=this.theme().blueDimmer,e.averageLine=this.theme().blue,e.averageFill=this.theme().blue,e.chartValue=e.averageLine):(e.valueLine=this.theme().blue,e.valueFill=this.theme().blue,e.averageLine=this.theme().blueDimmer,e.averageFill=this.theme().blueDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().blueDim,e.chartLabel=this.theme().contrastDim;break;case "green":this.config.trackAgainstAverage?(e.valueLine=this.theme().greenDimmer,e.valueFill=this.theme().greenDimmer,e.averageLine=this.theme().green,e.averageFill=this.theme().green,e.chartValue=e.averageLine):(e.valueLine=this.theme().green,e.valueFill=this.theme().green,e.averageLine=this.theme().greenDimmer,e.averageFill=this.theme().greenDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greenDim,e.chartLabel=this.theme().contrastDim;break;case "pink":this.config.trackAgainstAverage?(e.valueLine=this.theme().pinkDimmer,e.valueFill=this.theme().pinkDimmer,e.averageLine=this.theme().pink,e.averageFill=this.theme().pink,e.chartValue=e.averageLine):(e.valueLine=this.theme().pink,e.valueFill=this.theme().pink,e.averageLine=this.theme().pinkDimmer,e.averageFill=this.theme().pinkDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().pinkDim,e.chartLabel=this.theme().contrastDim;break;case "orange":this.config.trackAgainstAverage?(e.valueLine=this.theme().orangeDimmer,e.valueFill=this.theme().orangeDimmer,e.averageLine=this.theme().orange,e.averageFill=this.theme().orange,e.chartValue=e.averageLine):(e.valueLine=this.theme().orange,e.valueFill=this.theme().orange,e.averageLine=this.theme().orangeDimmer,e.averageFill=this.theme().orangeDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().orangeDim,e.chartLabel=this.theme().contrastDim;break;case "purple":this.config.trackAgainstAverage?(e.valueLine=this.theme().purpleDimmer,e.valueFill=this.theme().purpleDimmer,e.averageLine=this.theme().purple,e.averageFill=this.theme().purple,e.chartValue=e.averageLine):(e.valueLine=this.theme().purple,e.valueFill=this.theme().purple,e.averageLine=this.theme().purpleDimmer,e.averageFill=this.theme().purpleDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().purpleDim,e.chartLabel=this.theme().contrastDim;break;case "grey":this.config.trackAgainstAverage?(e.valueLine=this.theme().greyDimmer,e.valueFill=this.theme().greyDimmer,e.averageLine=this.theme().grey,e.averageFill=this.theme().grey,e.chartValue=e.averageLine):(e.valueLine=this.theme().grey,e.valueFill=this.theme().grey,e.averageLine=this.theme().greyDimmer,e.averageFill=this.theme().greyDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greyDim,e.chartLabel=this.theme().contrastDim;break;case "yellow":this.config.trackAgainstAverage?(e.valueLine=this.theme().yellowDimmer,e.valueFill=this.theme().yellowDimmer,e.averageLine=this.theme().yellow,e.averageFill=this.theme().yellow,e.chartValue=e.averageLine):(e.valueLine=this.theme().yellow,e.valueFill=this.theme().yellow,e.averageLine=this.theme().yellowDimmer,e.averageFill=this.theme().yellowDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().yellowDim,e.chartLabel=this.theme().contrastDim;break}return e}startStreaming(){if(this.dsServiceSub?.unsubscribe(),!this.datasetUUID||!this.chart)return;let t=this.dsService.getDatasetBatchThenLiveObservable(this.datasetUUID);t&&(this.dsServiceSub=t.subscribe(e=>{if(!(this.isDestroyed||!this.chart||!this.chart.ctx)){if(Array.isArray(e)){let s=this.transformDatasetRows(e,0);if(this.chart.data.datasets[0].data.push(...s),this.config.showAverageData){let r=this.transformDatasetRows(e,this.config.datasetAverageArray);this.chart.data.datasets[1].data.push(...r);}}else {let s=this.transformDatasetRows([e],0)[0];if(this.chart.data.datasets[0].data.push(s),this.config.showAverageData){let r=this.transformDatasetRows([e],this.config.datasetAverageArray)[0];this.chart.data.datasets[1].data.push(r);}}this.ngZone.runOutsideAngular(()=>{if(this.isDestroyed||!this.chart)return;let s=this.chart;s.ctx&&s.update("none");});}}));}destroyChart(){this.dsServiceSub?.unsubscribe(),this.dsServiceSub=null,this.chart?.destroy(),this.chart=null,this.lastChartSignature=null;}transformDatasetRows(t,e){let i=a=>this.unitsService.convertToUnit(this.convertUnitTo??"",a)??a,s=this.verticalChart===true,r=this.config.datasetAverageArray;return t.map(a=>{if(s){if(e===0)return {x:i(a.data.value),y:a.timestamp};{let D={sma:a.data.sma,ema:a.data.ema,dema:a.data.doubleEma,avg:a.data.lastAverage};return {x:i(D[r]??a.data.value),y:a.timestamp}}}else {if(e===0)return {x:a.timestamp,y:i(a.data.value)};{let D={sma:a.data.sma,ema:a.data.ema,dema:a.data.doubleEma,avg:a.data.lastAverage};return {x:a.timestamp,y:i(D[r]??a.data.value)}}}})}ngOnDestroy(){this.isDestroyed=true,this.destroyChart();let t=this.widgetDataChart?.()?.nativeElement;this.canvasService.releaseCanvas(t,{clear:true,removeFromDom:true});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JD({type:n,selectors:[["minichart"]],viewQuery:function(e,i){e&1&&eg(i.widgetDataChart,H,5,Lr),e&2&&Kw();},inputs:{theme:[1,"theme"]},decls:2,vars:0,consts:[["widgetDataChart",""],[2,"z-index","inherit"]],template:function(e,i){e&1&&Uh(0,"canvas",1,0);},styles:["[_nghost-%COMP%]{display:block;width:100%;height:calc(90% - 10px);position:absolute;bottom:0;border-radius:12px;overflow:hidden}"]})}return n})();var I=["canvasMainRef"];function E(n,P){if(n&1&&$h(0,"minichart",1),n&2){let t=qw();Bh("theme",t.theme());}}var se=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{numericPath:{description:"Numeric Data",path:null,source:null,pathType:"number",suppressBootstrapNull:true,isPathConfigurable:true,convertUnitTo:"unitless",showPathSkUnitsFilter:true,pathSkUnitsFilter:null,sampleTime:500}},showMax:false,showMin:false,numDecimal:1,showMiniChart:false,yScaleMin:0,yScaleMax:10,inverseYAxis:false,verticalChart:false,color:"contrast",enableTimeout:false,dataTimeout:5,ignoreZones:false};runtime=w(p);stream=w(rt);canvas=w(F);datasetLifecycle=w(S);miniChart=$j(C);canvasMainRef=$j.required("canvasMainRef");showMiniChart=vt(false);labelColor=vt("");canvasElement;canvasCtx=null;cssWidth=0;cssHeight=0;backgroundBitmap=null;backgroundBitmapText=null;dataValue=null;maxValue=null;minValue=null;valueColor="";valueStateColor="";maxValueTextWidth=0;maxValueTextHeight=0;maxMinMaxTextWidth=0;maxMinMaxTextHeight=0;streamRegistered=false;pathDataState=null;isDestroyed=false;lastSubscriptionSignature=null;normalizedConfig=Dt(()=>this.runtime.options()??n.DEFAULT_CONFIG);numericPathConfig=Dt(()=>this.normalizedConfig().paths?.numericPath);subscriptionSignature=Dt(()=>{this.normalizedConfig();let e=this.numericPathConfig();if(!e?.path)return null;let i=e.source?.trim()||"default";return [e.path,e.pathType,e.sampleTime,e.convertUnitTo,i,e.suppressBootstrapNull?"1":"0"].join("|")});onNumericValue=t=>{if(this.dataValue=t.data.value,this.minValue===null||this.dataValue<this.minValue?this.minValue=this.dataValue:(this.maxValue===null||this.dataValue>this.maxValue)&&(this.maxValue=this.dataValue),!this.normalizedConfig().ignoreZones&&this.pathDataState!==t.state)switch(this.pathDataState=t.state,t.state){case n$1.Alarm:this.valueStateColor=this.theme().zoneAlarm;break;case n$1.Warn:this.valueStateColor=this.theme().zoneWarn;break;case n$1.Alert:this.valueStateColor=this.theme().zoneAlert;break;default:this.valueStateColor=this.valueColor;break}this.drawWidget();};constructor(){this.showMiniChart.set(this.normalizedConfig().showMiniChart??false),Fa(()=>{let t=this.theme(),e=this.normalizedConfig().color;ge(()=>{t&&e!==void 0&&(this.setColors(),this.drawWidget());});}),Fa(()=>{let t=this.subscriptionSignature();ge(()=>{this.isDestroyed||!this.canvasCtx||t===this.lastSubscriptionSignature&&this.streamRegistered||(this.minValue=null,this.maxValue=null,this.dataValue=null,this.pathDataState=null,this.lastSubscriptionSignature=t,t&&(this.stream?.observe("numericPath",this.onNumericValue),this.streamRegistered=true,this.manageDatasetAndChart()));});}),Fa(()=>{let t=this.showMiniChart(),e=this.miniChart(),i=this.normalizedConfig(),s=this.numericPathConfig();[i?.showMiniChart?"1":"0",s?.path??"",s?.source??"default",s?.convertUnitTo??"",i?.numDecimal??"",i?.yScaleMin??"",i?.yScaleMax??"",i?.inverseYAxis?"1":"0",i?.verticalChart?"1":"0",i?.color??""].join("|")&&t&&e&&(this.setMiniChart(),e.startChart());});}ngOnInit(){this.setColors(),this.canvasElement=this.canvasMainRef().nativeElement,this.canvasCtx=this.canvasElement.getContext("2d"),this.canvas.registerCanvas(this.canvasElement,{autoRelease:true,onResize:(t,e)=>{this.cssWidth=t,this.cssHeight=e,this.calculateMaxMinTextDimensions(),this.drawWidget();}});}ngAfterViewInit(){this.isDestroyed||!this.streamRegistered&&this.subscriptionSignature()&&(this.stream?.observe("numericPath",this.onNumericValue),this.streamRegistered=true,this.manageDatasetAndChart());}calculateMaxMinTextDimensions(){this.maxValueTextWidth=Math.floor(this.cssWidth*.85),this.maxValueTextHeight=Math.floor(this.cssHeight*.7),this.maxMinMaxTextWidth=Math.floor(this.cssWidth*.57),this.maxMinMaxTextHeight=Math.floor(this.cssHeight*.1);}manageDatasetAndChart(){let t=this.normalizedConfig(),e=this.numericPathConfig(),i=!!t.showMiniChart;if(this.showMiniChart.set(i),!i){this.datasetLifecycle.removeDatasetIfExists(this.id(),false);return}if(!e||!e.path)return;let s=e.source??"default";this.datasetLifecycle.syncNumericMiniChartDataset(this.id(),e.path,s);}setMiniChart(){let t=this.miniChart(),e=this.normalizedConfig(),i=this.numericPathConfig();t&&(t.dataPath=i?.path??null,t.dataSource=i?.source??"default",t.color=e.color??"contrast",t.convertUnitTo=i?.convertUnitTo??null,t.numDecimal=e.numDecimal??null,t.yScaleMin=e.yScaleMin??null,t.yScaleMax=e.yScaleMax??null,t.inverseYAxis=e.inverseYAxis??false,t.verticalChart=e.verticalChart??null,t.datasetUUID=this.id());}setColors(){let t=this.normalizedConfig(),e=this.theme(),i=t.color??"contrast";this.labelColor.set(c(i,e).dim),this.valueStateColor=this.valueColor=c(i,e).color,this.backgroundBitmap=null,this.backgroundBitmapText=null;}drawWidget(){if(!this.canvasCtx)return;let t=this.normalizedConfig(),e=this.numericPathConfig()?.convertUnitTo??"",i=10*this.canvas.scaleFactor,s=5*this.canvas.scaleFactor,r=(t.displayName??"")+"|"+e;(!this.backgroundBitmap||this.backgroundBitmap.width!==this.canvasElement.width||this.backgroundBitmap.height!==this.canvasElement.height||this.backgroundBitmapText!==r)&&(this.backgroundBitmap=this.canvas.renderStaticToBitmap(this.canvasCtx,this.cssWidth,this.cssHeight,a=>{this.canvas.drawTitleInternal(a,t.displayName??"",this.labelColor(),"normal",this.cssWidth,this.cssHeight,.1),["unitless","percent","ratio","latitudeSec","latitudeMin","longitudeSec","longitudeMin"].includes(e)||this.canvas.drawText(a,e,this.cssWidth-i,this.cssHeight-s,Math.floor(this.cssWidth*.25),Math.floor(this.cssHeight*.15),"bold",this.valueColor,"end","bottom");}),this.backgroundBitmapText=r),this.canvas.clearCanvas(this.canvasCtx,this.cssWidth,this.cssHeight),this.backgroundBitmap&&this.backgroundBitmap.width>0&&this.backgroundBitmap.height>0&&this.canvasCtx.drawImage(this.backgroundBitmap,0,0,this.cssWidth,this.cssHeight),this.drawValue(),(t.showMax||t.showMin)&&this.drawMinMax();}drawValue(){let t=this.getValueText(),e=this.canvasCtx;e&&this.canvas.drawText(e,t,Math.floor(this.cssWidth/2),Math.floor(this.cssHeight/2*1.15),this.maxValueTextWidth,this.maxValueTextHeight,"bold",this.valueStateColor);}getValueText(){if(this.dataValue===null)return "--";let t=this.normalizedConfig(),e=this.numericPathConfig()?.convertUnitTo??"";return ["latitudeSec","latitudeMin","longitudeSec","longitudeMin","D HH:MM:SS"].includes(e)?this.dataValue.toString():this.applyDecorations(this.dataValue.toFixed(t.numDecimal??1))}drawMinMax(){let t=this.normalizedConfig();if(!t.showMin&&!t.showMax)return;let e=t.numDecimal??1,i="";t.showMin&&(i=this.minValue!=null?` Min: ${this.applyDecorations(this.minValue.toFixed(e))}`:" Min: --"),t.showMax&&(i+=this.maxValue!=null?` Max: ${this.applyDecorations(this.maxValue.toFixed(e))}`:" Max: --"),i=i.trim();let s=10*this.canvas.scaleFactor,r=5*this.canvas.scaleFactor,a=this.canvasCtx;a&&this.canvas.drawText(a,i,s,Math.floor(this.cssHeight-r),this.maxMinMaxTextWidth,this.maxMinMaxTextHeight,"normal",this.valueColor,"start","bottom");}applyDecorations(t){switch(this.numericPathConfig()?.convertUnitTo??""){case "percent":case "percentraw":t+="%";break}return t}ngOnDestroy(){this.isDestroyed=true,this.datasetLifecycle.removeDatasetIfExists(this.id(),false);try{this.canvas.unregisterCanvas(this.canvasElement);}catch(t){}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JD({type:n,selectors:[["widget-numeric"]],viewQuery:function(e,i){e&1&&eg(i.miniChart,C,5)(i.canvasMainRef,I,5),e&2&&Kw(2);},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:3,vars:1,consts:[["canvasMainRef",""],[3,"theme"],[1,"numeric-canvas"]],template:function(e,i){e&1&&(_w(0,E,1,1,"minichart",1),$h(1,"canvas",2,0)),e&2&&Mw(i.showMiniChart()?0:-1);},dependencies:[C],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.numeric-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:1px}.numeric-canvas[_ngcontent-%COMP%]{position:relative;width:100%!important;height:100%!important;display:block}"]})}return n})();export{se as WidgetNumericComponent};
|
|
1
|
+
import'./chunk-BTOTKeBo.js';import {d1 as Hj,w,du as p,dv as rt,aZ as R,dw as S,$ as $j,v as vt,D as Dt,dx as n$1,F as Fa,dn as ge,J as JD,_ as _w,c as $h,M as Mw,f as eg,K as Kw,bu as ut,dy as K,ao as ue,a6 as Lr,b0 as Wl,cp as Uh,g as qw,B as Bh}from'./main-YKDNK5VZ.js';import {c}from'./chunk-BIb-xYiS.js';var H=["widgetDataChart"],C=(()=>{class n{theme=Hj.required();color=null;dataPath=null;dataSource=null;convertUnitTo=null;numDecimal=null;yScaleMin=null;yScaleMax=null;inverseYAxis=false;verticalChart=null;datasetUUID=null;unitsService=w(ut);dsService=w(K);ngZone=w(ue);canvasService=w(R);widgetDataChart=$j("widgetDataChart",{read:Lr});lineChartData={datasets:[]};lineChartOptions={parsing:false,datasets:{line:{pointRadius:0,pointHoverRadius:0,tension:.4}},animations:{tension:{easing:"easeInOutCubic"}}};lineChartType="line";chart=null;dsServiceSub=null;datasetConfig=null;dataSourceInfo=null;isDestroyed=false;lastChartSignature=null;config={datasetAverageArray:"sma",showAverageData:false,trackAgainstAverage:false,startScaleAtZero:false,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:false};constructor(){Fa(()=>{this.theme()&&ge(()=>{this.datasetConfig&&(this.setChartOptions(),this.setDatasetsColors());});});}startChart(){if(!(this.isDestroyed||!this.datasetUUID)&&(this.datasetConfig=this.dsService.getDatasetConfig(this.datasetUUID)??null,this.dataSourceInfo=this.dsService.getDataSourceInfo(this.datasetUUID)??null,this.datasetConfig&&this.dataSourceInfo)){let t=this.buildChartSignature();if(this.chart&&t===this.lastChartSignature)return;this.chart&&t!==this.lastChartSignature&&this.destroyChart(),this.setChartOptions(),this.createDatasets();let i=this.widgetDataChart()?.nativeElement?.getContext("2d");if(!i)return;this.chart=new Wl(i,{type:this.lineChartType,data:this.lineChartData,options:this.lineChartOptions}),this.lastChartSignature=t,this.startStreaming();}}buildChartSignature(){return [this.datasetUUID,this.dataPath,this.dataSource,this.convertUnitTo,this.numDecimal,this.yScaleMin,this.yScaleMax,this.inverseYAxis?"1":"0",this.verticalChart?"1":"0",this.color].join("|")}setChartOptions(){let t=this.datasetConfig,e=this.dataSourceInfo;!t||!e||(this.lineChartOptions.maintainAspectRatio=false,this.lineChartOptions.animation=false,this.lineChartOptions.indexAxis=this.verticalChart?"y":"x",this.verticalChart?this.lineChartOptions.scales={x:{display:false,position:"right",suggestedMin:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMin),suggestedMax:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMax),min:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMin):void 0,max:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMax):void 0,beginAtZero:this.config.startScaleAtZero,reverse:this.inverseYAxis,title:{display:false,text:"Value Axis",align:"center"},ticks:{maxTicksLimit:8,precision:this.numberOrUndefined(this.numDecimal),color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}},y:{type:"realtime",display:false,title:{display:false},time:{unit:t.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:false,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}}}:this.lineChartOptions.scales={x:{type:"realtime",display:false,title:{display:false},time:{unit:t.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:false,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}},y:{display:false,position:"right",suggestedMin:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMin),suggestedMax:this.config.enableMinMaxScaleLimit?void 0:this.numberOrUndefined(this.yScaleMax),min:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMin):void 0,max:this.config.enableMinMaxScaleLimit?this.numberOrUndefined(this.yScaleMax):void 0,beginAtZero:this.config.startScaleAtZero,reverse:this.inverseYAxis,title:{display:false,text:"Value Axis",align:"center"},ticks:{maxTicksLimit:8,precision:this.numberOrUndefined(this.numDecimal),color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:false,color:this.theme().contrastDimmer}}},this.lineChartOptions.plugins={legend:{display:false},annotation:{annotations:{}},streaming:{duration:e.maxDataPoints*e.sampleTime,delay:e.sampleTime,frameRate:t.timeScaleFormat==="day"?5:t.timeScaleFormat==="hour"?8:t.timeScaleFormat==="minute"?15:30}});}numberOrUndefined(t){return t??void 0}createDatasets(){let t=this.lineChartOptions.scales?.y?.reverse?"start":true;this.lineChartData.datasets=[],this.lineChartData.datasets.push({label:"Value",data:[],order:0,parsing:false,tension:.4,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:3,fill:t}),this.lineChartData.datasets.push({label:"Average",data:[],order:1,parsing:false,tension:.4,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:3,fill:t}),this.setDatasetsColors();}setDatasetsColors(){this.lineChartData.datasets.forEach(t=>{t.borderColor=this.getThemeColors().averageLine,t.backgroundColor=this.getThemeColors().averageFill;});}getThemeColors(){let t=this.color,e={valueLine:"",valueFill:"",averageLine:"",averageFill:"",averageChartLine:"",chartLabel:"",chartValue:""};switch(t){case "contrast":this.config.trackAgainstAverage?(e.valueLine=this.theme().contrastDimmer,e.valueFill=this.theme().contrastDimmer,e.averageLine=this.theme().contrast,e.averageFill=this.theme().contrast,e.chartValue=e.averageLine):(e.valueLine=this.theme().contrast,e.valueFill=this.theme().contrast,e.averageLine=this.theme().contrastDimmer,e.averageFill=this.theme().contrastDimmer,e.chartValue=this.theme().contrast),e.averageChartLine=this.theme().contrastDim,e.chartLabel=this.theme().contrastDim;break;case "blue":this.config.trackAgainstAverage?(e.valueLine=this.theme().blueDimmer,e.valueFill=this.theme().blueDimmer,e.averageLine=this.theme().blue,e.averageFill=this.theme().blue,e.chartValue=e.averageLine):(e.valueLine=this.theme().blue,e.valueFill=this.theme().blue,e.averageLine=this.theme().blueDimmer,e.averageFill=this.theme().blueDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().blueDim,e.chartLabel=this.theme().contrastDim;break;case "green":this.config.trackAgainstAverage?(e.valueLine=this.theme().greenDimmer,e.valueFill=this.theme().greenDimmer,e.averageLine=this.theme().green,e.averageFill=this.theme().green,e.chartValue=e.averageLine):(e.valueLine=this.theme().green,e.valueFill=this.theme().green,e.averageLine=this.theme().greenDimmer,e.averageFill=this.theme().greenDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greenDim,e.chartLabel=this.theme().contrastDim;break;case "pink":this.config.trackAgainstAverage?(e.valueLine=this.theme().pinkDimmer,e.valueFill=this.theme().pinkDimmer,e.averageLine=this.theme().pink,e.averageFill=this.theme().pink,e.chartValue=e.averageLine):(e.valueLine=this.theme().pink,e.valueFill=this.theme().pink,e.averageLine=this.theme().pinkDimmer,e.averageFill=this.theme().pinkDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().pinkDim,e.chartLabel=this.theme().contrastDim;break;case "orange":this.config.trackAgainstAverage?(e.valueLine=this.theme().orangeDimmer,e.valueFill=this.theme().orangeDimmer,e.averageLine=this.theme().orange,e.averageFill=this.theme().orange,e.chartValue=e.averageLine):(e.valueLine=this.theme().orange,e.valueFill=this.theme().orange,e.averageLine=this.theme().orangeDimmer,e.averageFill=this.theme().orangeDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().orangeDim,e.chartLabel=this.theme().contrastDim;break;case "purple":this.config.trackAgainstAverage?(e.valueLine=this.theme().purpleDimmer,e.valueFill=this.theme().purpleDimmer,e.averageLine=this.theme().purple,e.averageFill=this.theme().purple,e.chartValue=e.averageLine):(e.valueLine=this.theme().purple,e.valueFill=this.theme().purple,e.averageLine=this.theme().purpleDimmer,e.averageFill=this.theme().purpleDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().purpleDim,e.chartLabel=this.theme().contrastDim;break;case "grey":this.config.trackAgainstAverage?(e.valueLine=this.theme().greyDimmer,e.valueFill=this.theme().greyDimmer,e.averageLine=this.theme().grey,e.averageFill=this.theme().grey,e.chartValue=e.averageLine):(e.valueLine=this.theme().grey,e.valueFill=this.theme().grey,e.averageLine=this.theme().greyDimmer,e.averageFill=this.theme().greyDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greyDim,e.chartLabel=this.theme().contrastDim;break;case "yellow":this.config.trackAgainstAverage?(e.valueLine=this.theme().yellowDimmer,e.valueFill=this.theme().yellowDimmer,e.averageLine=this.theme().yellow,e.averageFill=this.theme().yellow,e.chartValue=e.averageLine):(e.valueLine=this.theme().yellow,e.valueFill=this.theme().yellow,e.averageLine=this.theme().yellowDimmer,e.averageFill=this.theme().yellowDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().yellowDim,e.chartLabel=this.theme().contrastDim;break}return e}startStreaming(){if(this.dsServiceSub?.unsubscribe(),!this.datasetUUID||!this.chart)return;let t=this.dsService.getDatasetBatchThenLiveObservable(this.datasetUUID);t&&(this.dsServiceSub=t.subscribe(e=>{if(!(this.isDestroyed||!this.chart||!this.chart.ctx)){if(Array.isArray(e)){let s=this.transformDatasetRows(e,0);if(this.chart.data.datasets[0].data.push(...s),this.config.showAverageData){let r=this.transformDatasetRows(e,this.config.datasetAverageArray);this.chart.data.datasets[1].data.push(...r);}}else {let s=this.transformDatasetRows([e],0)[0];if(this.chart.data.datasets[0].data.push(s),this.config.showAverageData){let r=this.transformDatasetRows([e],this.config.datasetAverageArray)[0];this.chart.data.datasets[1].data.push(r);}}this.ngZone.runOutsideAngular(()=>{if(this.isDestroyed||!this.chart)return;let s=this.chart;s.ctx&&s.update("none");});}}));}destroyChart(){this.dsServiceSub?.unsubscribe(),this.dsServiceSub=null,this.chart?.destroy(),this.chart=null,this.lastChartSignature=null;}transformDatasetRows(t,e){let i=a=>this.unitsService.convertToUnit(this.convertUnitTo??"",a)??a,s=this.verticalChart===true,r=this.config.datasetAverageArray;return t.map(a=>{if(s){if(e===0)return {x:i(a.data.value),y:a.timestamp};{let D={sma:a.data.sma,ema:a.data.ema,dema:a.data.doubleEma,avg:a.data.lastAverage};return {x:i(D[r]??a.data.value),y:a.timestamp}}}else {if(e===0)return {x:a.timestamp,y:i(a.data.value)};{let D={sma:a.data.sma,ema:a.data.ema,dema:a.data.doubleEma,avg:a.data.lastAverage};return {x:a.timestamp,y:i(D[r]??a.data.value)}}}})}ngOnDestroy(){this.isDestroyed=true,this.destroyChart();let t=this.widgetDataChart?.()?.nativeElement;this.canvasService.releaseCanvas(t,{clear:true,removeFromDom:true});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JD({type:n,selectors:[["minichart"]],viewQuery:function(e,i){e&1&&eg(i.widgetDataChart,H,5,Lr),e&2&&Kw();},inputs:{theme:[1,"theme"]},decls:2,vars:0,consts:[["widgetDataChart",""],[2,"z-index","inherit"]],template:function(e,i){e&1&&Uh(0,"canvas",1,0);},styles:["[_nghost-%COMP%]{display:block;width:100%;height:calc(90% - 10px);position:absolute;bottom:0;border-radius:12px;overflow:hidden}"]})}return n})();var I=["canvasMainRef"];function E(n,P){if(n&1&&$h(0,"minichart",1),n&2){let t=qw();Bh("theme",t.theme());}}var se=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{numericPath:{description:"Numeric Data",path:null,source:null,pathType:"number",suppressBootstrapNull:true,isPathConfigurable:true,convertUnitTo:"unitless",showPathSkUnitsFilter:true,pathSkUnitsFilter:null,sampleTime:500}},showMax:false,showMin:false,numDecimal:1,showMiniChart:false,yScaleMin:0,yScaleMax:10,inverseYAxis:false,verticalChart:false,color:"contrast",enableTimeout:false,dataTimeout:5,ignoreZones:false};runtime=w(p);stream=w(rt);canvas=w(R);datasetLifecycle=w(S);miniChart=$j(C);canvasMainRef=$j.required("canvasMainRef");showMiniChart=vt(false);labelColor=vt("");canvasElement;canvasCtx=null;cssWidth=0;cssHeight=0;backgroundBitmap=null;backgroundBitmapText=null;dataValue=null;maxValue=null;minValue=null;valueColor="";valueStateColor="";maxValueTextWidth=0;maxValueTextHeight=0;maxMinMaxTextWidth=0;maxMinMaxTextHeight=0;streamRegistered=false;pathDataState=null;isDestroyed=false;lastSubscriptionSignature=null;normalizedConfig=Dt(()=>this.runtime.options()??n.DEFAULT_CONFIG);numericPathConfig=Dt(()=>this.normalizedConfig().paths?.numericPath);subscriptionSignature=Dt(()=>{this.normalizedConfig();let e=this.numericPathConfig();if(!e?.path)return null;let i=e.source?.trim()||"default";return [e.path,e.pathType,e.sampleTime,e.convertUnitTo,i,e.suppressBootstrapNull?"1":"0"].join("|")});onNumericValue=t=>{if(this.dataValue=t.data.value,this.minValue===null||this.dataValue<this.minValue?this.minValue=this.dataValue:(this.maxValue===null||this.dataValue>this.maxValue)&&(this.maxValue=this.dataValue),!this.normalizedConfig().ignoreZones&&this.pathDataState!==t.state)switch(this.pathDataState=t.state,t.state){case n$1.Alarm:this.valueStateColor=this.theme().zoneAlarm;break;case n$1.Warn:this.valueStateColor=this.theme().zoneWarn;break;case n$1.Alert:this.valueStateColor=this.theme().zoneAlert;break;default:this.valueStateColor=this.valueColor;break}this.drawWidget();};constructor(){this.showMiniChart.set(this.normalizedConfig().showMiniChart??false),Fa(()=>{let t=this.theme(),e=this.normalizedConfig().color;ge(()=>{t&&e!==void 0&&(this.setColors(),this.drawWidget());});}),Fa(()=>{let t=this.subscriptionSignature();ge(()=>{this.isDestroyed||!this.canvasCtx||t===this.lastSubscriptionSignature&&this.streamRegistered||(this.minValue=null,this.maxValue=null,this.dataValue=null,this.pathDataState=null,this.lastSubscriptionSignature=t,t&&(this.stream?.observe("numericPath",this.onNumericValue),this.streamRegistered=true,this.manageDatasetAndChart()));});}),Fa(()=>{let t=this.showMiniChart(),e=this.miniChart(),i=this.normalizedConfig(),s=this.numericPathConfig();[i?.showMiniChart?"1":"0",s?.path??"",s?.source??"default",s?.convertUnitTo??"",i?.numDecimal??"",i?.yScaleMin??"",i?.yScaleMax??"",i?.inverseYAxis?"1":"0",i?.verticalChart?"1":"0",i?.color??""].join("|")&&t&&e&&(this.setMiniChart(),e.startChart());});}ngOnInit(){this.setColors(),this.canvasElement=this.canvasMainRef().nativeElement,this.canvasCtx=this.canvasElement.getContext("2d"),this.canvas.registerCanvas(this.canvasElement,{autoRelease:true,onResize:(t,e)=>{this.cssWidth=t,this.cssHeight=e,this.calculateMaxMinTextDimensions(),this.drawWidget();}});}ngAfterViewInit(){this.isDestroyed||!this.streamRegistered&&this.subscriptionSignature()&&(this.stream?.observe("numericPath",this.onNumericValue),this.streamRegistered=true,this.manageDatasetAndChart());}calculateMaxMinTextDimensions(){this.maxValueTextWidth=Math.floor(this.cssWidth*.85),this.maxValueTextHeight=Math.floor(this.cssHeight*.7),this.maxMinMaxTextWidth=Math.floor(this.cssWidth*.57),this.maxMinMaxTextHeight=Math.floor(this.cssHeight*.1);}manageDatasetAndChart(){let t=this.normalizedConfig(),e=this.numericPathConfig(),i=!!t.showMiniChart;if(this.showMiniChart.set(i),!i){this.datasetLifecycle.removeDatasetIfExists(this.id(),false);return}if(!e||!e.path)return;let s=e.source??"default";this.datasetLifecycle.syncNumericMiniChartDataset(this.id(),e.path,s);}setMiniChart(){let t=this.miniChart(),e=this.normalizedConfig(),i=this.numericPathConfig();t&&(t.dataPath=i?.path??null,t.dataSource=i?.source??"default",t.color=e.color??"contrast",t.convertUnitTo=i?.convertUnitTo??null,t.numDecimal=e.numDecimal??null,t.yScaleMin=e.yScaleMin??null,t.yScaleMax=e.yScaleMax??null,t.inverseYAxis=e.inverseYAxis??false,t.verticalChart=e.verticalChart??null,t.datasetUUID=this.id());}setColors(){let t=this.normalizedConfig(),e=this.theme(),i=t.color??"contrast";this.labelColor.set(c(i,e).dim),this.valueStateColor=this.valueColor=c(i,e).color,this.backgroundBitmap=null,this.backgroundBitmapText=null;}drawWidget(){if(!this.canvasCtx)return;let t=this.normalizedConfig(),e=this.numericPathConfig()?.convertUnitTo??"",i=10*this.canvas.scaleFactor,s=5*this.canvas.scaleFactor,r=(t.displayName??"")+"|"+e;(!this.backgroundBitmap||this.backgroundBitmap.width!==this.canvasElement.width||this.backgroundBitmap.height!==this.canvasElement.height||this.backgroundBitmapText!==r)&&(this.backgroundBitmap=this.canvas.renderStaticToBitmap(this.canvasCtx,this.cssWidth,this.cssHeight,a=>{this.canvas.drawTitleInternal(a,t.displayName??"",this.labelColor(),"normal",this.cssWidth,this.cssHeight,.1),["unitless","percent","ratio","latitudeSec","latitudeMin","longitudeSec","longitudeMin"].includes(e)||this.canvas.drawText(a,e,this.cssWidth-i,this.cssHeight-s,Math.floor(this.cssWidth*.25),Math.floor(this.cssHeight*.15),"bold",this.valueColor,"end","bottom");}),this.backgroundBitmapText=r),this.canvas.clearCanvas(this.canvasCtx,this.cssWidth,this.cssHeight),this.backgroundBitmap&&this.backgroundBitmap.width>0&&this.backgroundBitmap.height>0&&this.canvasCtx.drawImage(this.backgroundBitmap,0,0,this.cssWidth,this.cssHeight),this.drawValue(),(t.showMax||t.showMin)&&this.drawMinMax();}drawValue(){let t=this.getValueText(),e=this.canvasCtx;e&&this.canvas.drawText(e,t,Math.floor(this.cssWidth/2),Math.floor(this.cssHeight/2*1.15),this.maxValueTextWidth,this.maxValueTextHeight,"bold",this.valueStateColor);}getValueText(){if(this.dataValue===null)return "--";let t=this.normalizedConfig(),e=this.numericPathConfig()?.convertUnitTo??"";return ["latitudeSec","latitudeMin","longitudeSec","longitudeMin","D HH:MM:SS"].includes(e)?this.dataValue.toString():this.applyDecorations(this.dataValue.toFixed(t.numDecimal??1))}drawMinMax(){let t=this.normalizedConfig();if(!t.showMin&&!t.showMax)return;let e=t.numDecimal??1,i="";t.showMin&&(i=this.minValue!=null?` Min: ${this.applyDecorations(this.minValue.toFixed(e))}`:" Min: --"),t.showMax&&(i+=this.maxValue!=null?` Max: ${this.applyDecorations(this.maxValue.toFixed(e))}`:" Max: --"),i=i.trim();let s=10*this.canvas.scaleFactor,r=5*this.canvas.scaleFactor,a=this.canvasCtx;a&&this.canvas.drawText(a,i,s,Math.floor(this.cssHeight-r),this.maxMinMaxTextWidth,this.maxMinMaxTextHeight,"normal",this.valueColor,"start","bottom");}applyDecorations(t){switch(this.numericPathConfig()?.convertUnitTo??""){case "percent":case "percentraw":t+="%";break}return t}ngOnDestroy(){this.isDestroyed=true,this.datasetLifecycle.removeDatasetIfExists(this.id(),false);try{this.canvas.unregisterCanvas(this.canvasElement);}catch(t){}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JD({type:n,selectors:[["widget-numeric"]],viewQuery:function(e,i){e&1&&eg(i.miniChart,C,5)(i.canvasMainRef,I,5),e&2&&Kw(2);},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:3,vars:1,consts:[["canvasMainRef",""],[3,"theme"],[1,"numeric-canvas"]],template:function(e,i){e&1&&(_w(0,E,1,1,"minichart",1),$h(1,"canvas",2,0)),e&2&&Mw(i.showMiniChart()?0:-1);},dependencies:[C],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.numeric-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:1px}.numeric-canvas[_ngcontent-%COMP%]{position:relative;width:100%!important;height:100%!important;display:block}"]})}return n})();export{se as WidgetNumericComponent};
|